gunter-kgd 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/gante.vue +895 -0
  2. package/gunter.js +32 -0
  3. package/index.js +13 -0
  4. package/package.json +11 -0
package/gante.vue ADDED
@@ -0,0 +1,895 @@
1
+ <template>
2
+ <div class="ganteLiuBox">
3
+ <div ref="gante_box" :style="{height:Number(height) ? height+'px': height}" class="gante-box">
4
+ <div class="gante-menu">
5
+ <div class="today" @click="toToday">今天</div>
6
+ <dropdown
7
+ :value="time_mode"
8
+ :options="dropdownOptions"
9
+ placeholder="请选择"
10
+ class="gante-dropdown"
11
+ @input="(val)=> trickMode(val)"
12
+ ></dropdown>
13
+
14
+ </div>
15
+ <!--左边表格-->
16
+ <div :style="{width: Number(tabe_width)? tabe_width+'px' : tabe_width }" class="gante-table-box">
17
+ <gante-table
18
+ @sort="sortGunter"
19
+ :th_data="th_data"
20
+ :showLoading="showLoading"
21
+ :data="ganteData">
22
+
23
+ </gante-table>
24
+ </div>
25
+ <!--右边时间-->
26
+ <div class="gante-gc-box"
27
+ :style="{left:Number(tabe_width) ? tabe_width+'px': tabe_width,width: `calc(100% - ${Number(tabe_width) ? tabe_width +'px': tabe_width}) `}">
28
+ <gante-gc
29
+ ref="gante_gc"
30
+ :start_time="start_time"
31
+ :end_time="end_time"
32
+ :th_data="th_data"
33
+ :gante_data="ganteData"
34
+ :toast-render="toastRender"
35
+ :toast-class="toastClass"></gante-gc>
36
+ </div>
37
+ <gante-split :left="tabe_width" :th_data="th_data"></gante-split>
38
+ </div>
39
+ <!--日历-->
40
+ <calendar :left="calendar_left" :choose_date="checkDate" v-model="show_calendar" @change="chooseDate"
41
+ :top="calendar_top"></calendar>
42
+ </div>
43
+ </template>
44
+ <script>
45
+ import ganteTable from '../components/gante_test/gante-table.vue'
46
+ import ganteGc from '../components/gante_test/gante-gc.vue'
47
+ import ganteSplit from '../components/gante_test/gante-split.vue'
48
+ import commitEmit from '../components/gante_test/commit'
49
+ import calendar from '../components/gante_test/calendar.vue'
50
+ import searchLastWidth from '../components/gante_test/search_last_width';
51
+ import ganteOp from '../components/gante_test/gante_op';
52
+ import myPublic from '../../utils/public'
53
+ import dropdown from '../components/common/dropdown.vue'
54
+ let number = 0 //序号
55
+ export default {
56
+ name: 'gante',
57
+ mixins: [searchLastWidth,ganteOp],
58
+ data() {
59
+ return {
60
+ checkModel: 1,
61
+ tabe_width: 0, //表格的宽度
62
+ time_mode: 1,//时间刻度 1:日,2周,3月,4季,5年
63
+ th_data: {}, //表格头部数据
64
+ ganteData: [],//甘特图的数据
65
+ toastRender: null, // 自定义 toast 渲染函数
66
+ toastClass: '', // 追加在默认 toast 上的类名
67
+ beforeTaskInfoList:[], // 前置任务关系
68
+ _filterBeforeGunterData: [],//排序之前的数据
69
+ height: 300,
70
+ open: true,
71
+ calendar_left: 0, //日期选择的位置
72
+ calendar_top: 0,//日期选择的位置
73
+ show_calendar: false,
74
+ checkDate: new Date(),//选中的日期
75
+ change_id: '', //修改数据的id,修改时间用到
76
+ change_value: '',//修改数据的值,修改时间用到
77
+ start_time: 0, //最小的开始时间
78
+ end_time: 0, //最大的结束时间
79
+ edit_data: {},//修改后传递出的数据
80
+ showLoading: false,
81
+ onEdit: () => {},
82
+ onClick: () => {},
83
+ onLoad: () => {},//懒加载
84
+ onDragChangeTime: () => {}, // 拖动改变时间
85
+ dropdownOptions: [
86
+ { value: 1, label: '日' },
87
+ { value: 2, label: '周' },
88
+ { value: 3, label: '月' },
89
+ { value: 4, label: '季' },
90
+ { value: 5, label: '年' },
91
+ ],
92
+ }
93
+ },
94
+ created() {
95
+ commitEmit.$off('change')
96
+ commitEmit.$on('change', (data) => {
97
+ this.change(data)
98
+ });
99
+ commitEmit.$off('change-calendar')
100
+ commitEmit.$on('change-calendar', (data) => {
101
+ this.change_calendar(data)
102
+ });
103
+ // 某个单元格的点击事件
104
+ commitEmit.$off('on-click')
105
+ commitEmit.$on('on-click', (data) => {
106
+ this.onclick(data)
107
+ });
108
+ // 拖动改变时间
109
+ commitEmit.$off('onDragChangeTime')
110
+ commitEmit.$on('onDragChangeTime', (oldData,data) => {
111
+ const resolves = (bol)=>{
112
+ if(!bol){
113
+ this.resetTask(this.ganteData,oldData);
114
+ }
115
+ }
116
+ this.onDragChangeTime(data,resolves)
117
+ });
118
+
119
+
120
+ //懒加载
121
+ commitEmit.$off('on-load')
122
+ commitEmit.$on('on-load', () => {
123
+ /**
124
+ *
125
+ * @type {Function}
126
+ * requestBol: 是否显示加载图标
127
+ * data: 加载的数据
128
+ * start_time: 最小开始时间
129
+ * end_time: 最大的结束时间
130
+ */
131
+ const resolve = ((requestBol, data, start_time, end_time) => {
132
+ if (!requestBol) {
133
+ this.showLoading = false
134
+ }
135
+ this.ganteData.push(...data)
136
+ this.start_time = start_time
137
+ this.end_time = end_time
138
+ this.init({ganteData: this.ganteData, start_time: this.start_time, end_time: this.end_time},false)
139
+ this.$nextTick(function () {
140
+ this.$refs.gante_gc.requestBol = requestBol
141
+ })
142
+ })
143
+ this.onLoad(resolve)
144
+ });
145
+
146
+
147
+ commitEmit.$off('triggerInit');
148
+ commitEmit.$on('triggerInit', (start_time,end_time) =>{
149
+ this.init({start_time: start_time, end_time: end_time},false)
150
+ })
151
+ },
152
+ mounted() {
153
+ this.$nextTick(function () {
154
+ setTimeout(() => {
155
+ // 获取到左边表格所有td加起来的宽度
156
+ this.find_attr(document.getElementsByClassName('gante-table-box')[0].clientWidth, this.th_data)
157
+ })
158
+ })
159
+
160
+ },
161
+ methods: {
162
+ //设置加载提示
163
+ setShowLoading(data) {
164
+ this.showLoading = data
165
+ this.$refs.gante_gc.requestBol = data
166
+ },
167
+ /**
168
+ * 排序
169
+ * @param key 要排序的key值
170
+ * @param mode 是正序还是倒叙 asc:正 desc:倒
171
+ */
172
+ sortGunter(key, mode) {
173
+ console.log(mode)
174
+ if (!key) {
175
+ this.ganteData = JSON.parse(JSON.stringify(this._filterBeforeGunterData))
176
+ return;
177
+ }
178
+ sortNum(this.ganteData, key, mode)
179
+ number = 0
180
+ formate_number(this.ganteData)
181
+ function sortNum(data) {
182
+ data.sort(compare(key))
183
+ for (let i of data) {
184
+ if (i.children) {
185
+ sortNum(i.children, key)
186
+ }
187
+ }
188
+
189
+ }
190
+
191
+ function compare(property) {
192
+ return function (a, b) {
193
+ if (mode == 'asc') {
194
+ return (a[property] - b[property])
195
+ } else {
196
+ console.log(b,property)
197
+ return (b[property] - a[property])
198
+ }
199
+ }
200
+ }
201
+
202
+ function formate_number(data) {
203
+ for (let i of data) {
204
+ if (i.children) {
205
+ number++
206
+ i.params['number'] = number
207
+ formate_number(i.children)
208
+ } else {
209
+ number++
210
+ i.params['number'] = number
211
+ }
212
+ }
213
+ }
214
+
215
+ console.log(key)
216
+ console.log(this.ganteData)
217
+ },
218
+ // 选择日期
219
+ chooseDate(date) {
220
+ if (date) {
221
+ var year = date.getFullYear()
222
+ var month = date.getMonth() + 1
223
+ var day = date.getDate()
224
+ var time = year + '-' + (month < 10 ? ('0' + month) : month) + '-' + (day < 10 ? ('0' + day) : day)
225
+ this.change_value[0].value = time
226
+ this.change_value[1].value = new Date(year, month - 1, day).getTime()
227
+ this.change({
228
+ change_value: {
229
+ id: this.change_id,
230
+ value: this.change_value
231
+ }
232
+ })
233
+ this.init({ganteData: this.ganteData, start_time: this.start_time, end_time: this.end_time},false)
234
+ }
235
+ },
236
+ // 点击显示日历
237
+ change_calendar(data) {
238
+ console.log('展开', data.show_calendar)
239
+ if (data.changeDate) {
240
+ this.checkDate = data.changeDate
241
+ }
242
+ this.show_calendar = data.show_calendar
243
+ console.log(this.show_calendar)
244
+ if (data.calendar_left != undefined) {
245
+ this.calendar_left = data.calendar_left
246
+ }
247
+ if (data.calendar_top != undefined) {
248
+ this.calendar_top = data.calendar_top
249
+ }
250
+ if (data.change_value != undefined) {
251
+ this.change_id = data.change_value.id
252
+ this.change_value = data.change_value.argument
253
+ }
254
+ },
255
+ // 监听点击事件
256
+ onclick(data) {
257
+ if (typeof this.onClick === 'function') {
258
+ for (let i in data.data) {
259
+ //返回数据的时候去掉没用的数据
260
+ if (i == 'width' || i == 'left' || i == 'open') {
261
+ delete data.data[i]
262
+ }
263
+ }
264
+ this.onClick(data)
265
+ }
266
+ },
267
+ // 统一改变数据
268
+ change(data) {
269
+ //修改数据
270
+ if (data.change_value) {
271
+ this.gunter_data_change(data.change_value.id, data.change_value.value, this.ganteData)
272
+ if (typeof this.onEdit === 'function') {
273
+ for (let i in this.edit_data.data) {
274
+ if (i == 'width' || i == 'left' || i == 'open') {
275
+ delete this.edit_data.data[i]
276
+ }
277
+ }
278
+ this.onEdit(this.edit_data)
279
+ }
280
+ }
281
+ },
282
+ /**
283
+ * 统一修改甘特图数据的方法
284
+ * @param id 修改的甘特图数据的id
285
+ * @param value 修改的甘特图数据的值(argument: 修改的是哪个参数,value:值)
286
+ * @param data 甘特图数据
287
+ */
288
+ gunter_data_change(id, value, data) {
289
+ for (let i of data) {
290
+ if (i.gunter_id == id) {
291
+ for (let s of value) {
292
+ //修改时间用到的
293
+ if (s.mode) {
294
+ this.$set(i, s.argument, s.value)
295
+ } else {
296
+ this.$set(i['params'], s.argument, s.value)
297
+ }
298
+
299
+ }
300
+ this.edit_data['data'] = JSON.parse(JSON.stringify(i))
301
+ this.edit_data['argument'] = value[0].argument
302
+ this.edit_data['value'] = value[0].value
303
+ }
304
+ // 判断最小开始时间和最大结束时间
305
+ if (this.start_time > i.start_time && (i.start_time)) {
306
+ this.start_time = i.start_time
307
+ }
308
+ if (this.end_time < i.end_time && i.end_time) {
309
+ this.end_time = i.end_time
310
+ }
311
+ if (i.children) {
312
+ this.gunter_data_change(id, value, i.children)
313
+ }
314
+ }
315
+ },
316
+ // 重置任务,在拖动时间后如果没有权限后重置任务
317
+ resetTask(ganteData,oldData){
318
+ for(let i of ganteData){
319
+ if(i.gunter_id == oldData.gunter_id){
320
+ this.$set(i,'start_time',new Date(myPublic.dateFormat.dateReplace(oldData.start_time)).getTime());
321
+ this.$set(i,'end_time',new Date(myPublic.dateFormat.dateReplace(oldData.end_time)).getTime());
322
+ this.$set(i.params,oldData.startAttr,oldData.start_time);
323
+ this.$set(i.params,oldData.endAttr,oldData.end_time);
324
+ this.$set(i,'width',oldData.width);
325
+ this.$set(i,'left',oldData.left);
326
+ break;
327
+ }
328
+ if(i.children){
329
+ this.resetTask(i.children,oldData)
330
+ }
331
+ }
332
+ },
333
+ // 初始化
334
+ init(params,mode = true) {
335
+
336
+ Object.assign(this.$data, params);
337
+
338
+ if(params.ganteData == undefined){
339
+ let ganteData = JSON.parse(JSON.stringify(this.ganteData));
340
+ this.ganteData = [];
341
+ this.ganteData = ganteData;
342
+ }else{
343
+ this.ganteData = JSON.parse(JSON.stringify(params.ganteData));
344
+ }
345
+
346
+ if(!params.openLoad && mode){
347
+ this.showLoading = false
348
+ this.$nextTick(function () {
349
+ this.$refs.gante_gc.requestBol = false
350
+ })
351
+ }
352
+ if(!this.th_data.number){
353
+ let number = {number:{value:'序号',width:50,showToast:false,listen_click:false,weight:true}}
354
+ this.th_data = Object.assign(number,this.th_data)
355
+ }
356
+ let current_date = new Date().getTime();
357
+ if (current_date < this.start_time) {
358
+ this.start_time = current_date;
359
+ }
360
+ if (current_date > this.end_time) {
361
+ this.end_time = current_date;
362
+ }
363
+
364
+ this.$nextTick(function () {
365
+ let data = this.$refs.gante_gc.init(this.time_mode);
366
+ number = 0;
367
+ format_gante_data(this.ganteData, data.time, data.start_time)
368
+ this._filterBeforeGunterData = JSON.parse(JSON.stringify(this.ganteData))
369
+ if (mode) {
370
+ if (params.tabe_width != undefined) {
371
+ this.tabe_width = params.tabe_width
372
+ } else {
373
+ let _width = this.$refs.gante_box.clientWidth
374
+ this.tabe_width = _width / 2
375
+ }
376
+ }
377
+ })
378
+ let self = this;
379
+
380
+ /**
381
+ * 处理甘特图数据
382
+ * @param gante_data 甘特图的数据
383
+ * @param time 1px代表的时间
384
+ * @param start_time 开始时间
385
+ * @param parent_gunter_id 父元素的id
386
+ */
387
+ function format_gante_data(gante_data, time, start_time,parent_gunter_id = null) {
388
+ for (let i of gante_data) {
389
+ if (i.open == undefined) {
390
+ self.$set(i, 'open', self.open)
391
+ }
392
+ if (i.start_time || i.end_time) {
393
+ i['left'] = (i.start_time - start_time) / time
394
+ if (i.end_time && i.end_time >= i.start_time && i.start_time) {
395
+ let width = (i.end_time - i.start_time) / time
396
+ // let width = (new Date(new Date(i.end_time).getFullYear(),new Date(i.end_time).getMonth(),new Date(i.end_time).getDate()+1) - i.start_time)/time
397
+ if (width >= 0 && width <= 1) {
398
+ width = 1
399
+ }
400
+ i['width'] = width
401
+ } else {
402
+ i['width'] = 0
403
+ }
404
+ }
405
+ i['parent_gunter_id'] = parent_gunter_id
406
+
407
+ i['showLoading'] = false
408
+ if (i.children) {
409
+ number++
410
+ self.$set(i.params,'number',number)
411
+ format_gante_data(i.children, time, start_time,i.gunter_id)
412
+ }else{
413
+ number++
414
+ self.$set(i.params,'number',number)
415
+ }
416
+ }
417
+ }
418
+
419
+ },
420
+ },
421
+ components: {
422
+ ganteTable,
423
+ ganteGc,
424
+ ganteSplit,
425
+ calendar,
426
+ dropdown
427
+ }
428
+ }
429
+ </script>
430
+ <style lang="less">
431
+ li {
432
+ list-style: none;
433
+ }
434
+
435
+ .ganteLiuBox {
436
+ height: 100%;
437
+ }
438
+
439
+ .gante-box {
440
+ position: relative;
441
+ width: 100%;
442
+ overflow: hidden;
443
+ border-radius: 5px;
444
+ background: #fff;
445
+ border: 1px solid #ccc;
446
+ box-sizing: border-box;
447
+ .gante-menu{
448
+ position: absolute;
449
+ right: 20px;
450
+ top: 55px;
451
+ display: flex;
452
+ align-items: center;
453
+ justify-content: space-between;
454
+ z-index: 99999;
455
+ gap: 10px;
456
+ .today{
457
+ padding: 6px 10px;
458
+ border: 1px solid #dcdfe6;
459
+ border-radius: 4px;
460
+ background-color: #fff;
461
+ cursor: pointer;
462
+ font-size: 14px;
463
+ &:hover{
464
+ border-color: #00a578;
465
+ }
466
+ &:focus {
467
+ outline: none;
468
+ border-color: #00a578;
469
+ box-shadow: 0 0 0 2px rgba(0, 165, 120, 0.2);
470
+ }
471
+ &.dropdown-active {
472
+ border-color: #00a578;
473
+ border-radius: 4px 4px 0 0;
474
+ }
475
+ }
476
+
477
+ }
478
+ .gante-top-op{
479
+ height: 54px;
480
+ padding: 0 10px 0 20px;
481
+ box-sizing: border-box;
482
+ display: flex;
483
+ align-items: center;
484
+ justify-content: space-between;
485
+ position: relative;
486
+ z-index: 3;
487
+ .btns{
488
+ /deep/.el-button-group{
489
+ width: 140px!important;
490
+ }
491
+ /deep/.btn-one{
492
+ text-align: left!important;
493
+ }
494
+ /deep/.el-button{
495
+ &:first-child{
496
+ width:86px!important;
497
+ border-radius: 17px 0 0 17px;
498
+ }
499
+ &:nth-child(2){
500
+ border-radius: 0 17px 17px 0 ;
501
+ padding: 10px 11px!important;
502
+ }
503
+ }
504
+ }
505
+ .filter{
506
+ display: flex;
507
+ .filter-one{
508
+ position: relative;
509
+ margin-left: 15px;
510
+ .projectName{
511
+ display: flex;
512
+ align-items: center;
513
+ cursor: pointer;
514
+ &:hover{
515
+ color: #3396fb;
516
+ }
517
+ .name{
518
+ margin-right: 5px;
519
+ }
520
+ }
521
+ }
522
+ .opens{
523
+ position: relative;
524
+ cursor: pointer;
525
+ &:hover{
526
+ color: #3396fb;
527
+ }
528
+ &:after{
529
+ content: '';
530
+ position: absolute;
531
+ left: -18px;
532
+ top: 2px;
533
+ height: 17px;
534
+ width: 1px;
535
+ background: #ccc;
536
+ }
537
+ }
538
+ .batch{
539
+ cursor: pointer;
540
+ &:hover{
541
+ color: #3396fb;
542
+ }
543
+ }
544
+ }
545
+ /*级联选择框*/
546
+ .cascade-content{
547
+ position: relative;
548
+ height: 19px;
549
+ line-height: 20px;
550
+ padding-right: 25px;
551
+ .text{
552
+ cursor: pointer;
553
+ &:hover{
554
+ color: #3396fb;
555
+ }
556
+ }
557
+ .icon-right{
558
+ position: absolute;
559
+ right: 5px;
560
+ top: 3px;
561
+ }
562
+ .cascade-menu{
563
+ background: #fff;
564
+ position: absolute;
565
+ max-height: 275px;
566
+ overflow-y: overlay;
567
+ right: 0;
568
+ box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
569
+ top: 32px;
570
+ display: flex;
571
+ border-radius: 4px;
572
+ .cascade-menu-one{
573
+ height: 100%;
574
+ max-height: 275px;
575
+ overflow-y: overlay;
576
+ border-right: 1px solid #ccc;
577
+ box-sizing: border-box;
578
+ min-width: 140px;
579
+ padding: 10px;
580
+ border-right: 1px solid #e4e7ed;
581
+ &:last-child{
582
+ border-right: none;
583
+ }
584
+ .menu-one{
585
+ padding: 8px 16px;
586
+ border-radius: 4px;
587
+ cursor: pointer;
588
+ display: flex;
589
+ justify-content: space-between;
590
+ align-items: center;
591
+ &:hover{
592
+ background: #eee;
593
+ }
594
+ }
595
+ .menu-one.active{
596
+ color: #3396fb;
597
+ }
598
+ }
599
+ }
600
+ &:before{
601
+ content: " ";
602
+ position: absolute;
603
+ display: block;
604
+ width: 0;height: 0;
605
+ top: 24px;
606
+ left: calc(50% - 20px);
607
+ border-left: 8px solid transparent;
608
+ border-right: 8px solid transparent;
609
+ border-bottom: 8px solid rgba(0,0,0,.1);
610
+ }
611
+ &:after{
612
+ content: " ";
613
+ position: absolute;
614
+ display: block;
615
+ width: 0;
616
+ height: 0;
617
+ top:24px;
618
+ left:calc(50% - 20px);
619
+ border-left: 8px solid transparent;
620
+ border-right: 8px solid transparent;
621
+ border-bottom: 8px solid #fff;
622
+ }
623
+ }
624
+ }
625
+ }
626
+
627
+ .gante-table-box {
628
+ overflow-x: auto;
629
+ overflow-y: hidden;
630
+ width: 50%;
631
+ height: 100%;
632
+ left: 0;
633
+ bottom: 0;
634
+ position: absolute;
635
+ }
636
+
637
+ .gante-gc-box {
638
+ overflow: auto;
639
+ width: 50%;
640
+ position: absolute;
641
+ top: 0;
642
+ border-left: 5px solid transparent;
643
+ height: 100%;
644
+ box-sizing: border-box;
645
+ padding-right: 2px;
646
+ }
647
+
648
+ .change-mode {
649
+ width: 65px;
650
+ height: 30px;
651
+ line-height: 30px;
652
+ text-align: center;
653
+ display: inline-block;
654
+ background: #00b0ff;
655
+ border-radius: 3px;
656
+ color: #fff;
657
+ margin-top: 10px;
658
+ cursor: pointer;
659
+ }
660
+
661
+ .gante-toast-liu {
662
+ position: fixed;
663
+ z-index: 10000;
664
+ width: 300px;
665
+ height: auto;
666
+ font-size: 13px;
667
+ line-height: 1.5;
668
+ font-family: "Microsoft Yahei", Arial, sans-serif;
669
+ border-radius: 8px;
670
+ transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
671
+ background-color: #fff;
672
+ padding: 14px 16px;
673
+ color: #1f2933;
674
+ border: 1px solid #e6ebf1;
675
+ box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12);
676
+ }
677
+
678
+ .toast-card {
679
+ display: flex;
680
+ flex-direction: column;
681
+ gap: 12px;
682
+ }
683
+ .toast-card__header {
684
+ display: flex;
685
+ align-items: center;
686
+ justify-content: flex-start;
687
+ gap: 8px;
688
+ }
689
+ .toast-card__title {
690
+ font-size: 20px;
691
+ font-weight: bold;
692
+ color: rgba(0, 0, 0, 0.65);
693
+ overflow: hidden;
694
+ text-overflow: ellipsis;
695
+ white-space: nowrap;
696
+ }
697
+ .toast-card__tag {
698
+ display: inline-flex;
699
+ align-items: center;
700
+ gap: 6px;
701
+ padding: 4px 10px;
702
+ border-radius: 14px;
703
+ background: #ffcccc;
704
+ color: #ff0000;
705
+ font-size: 12px;
706
+ font-weight: 600;
707
+ }
708
+ .toast-card__dot {
709
+ width: 8px;
710
+ height: 8px;
711
+ border-radius: 50%;
712
+ background: #ff0000;
713
+ display: inline-block;
714
+ }
715
+ .toast-card__body {
716
+ display: flex;
717
+ align-items: center;
718
+ justify-content: space-between;
719
+ gap: 12px;
720
+ }
721
+ .toast-card__meta {
722
+ display: flex;
723
+ flex-direction: column;
724
+ gap: 6px;
725
+ }
726
+ .toast-card__label {
727
+ color: #7a869a;
728
+ font-size: 18px;
729
+ }
730
+ .toast-card__value {
731
+ color: #1f2933;
732
+ font-size: 14px;
733
+ }
734
+ .toast-card__progress {
735
+ display: flex;
736
+ flex-direction: column;
737
+ align-items: center;
738
+ gap: 6px;
739
+ min-width: 90px;
740
+ }
741
+ .toast-card__progress-ring {
742
+ width: 48px;
743
+ height: 48px;
744
+ border-radius: 50%;
745
+ border: 6px solid var(--ring-color, #2bae73);
746
+ display: flex;
747
+ align-items: center;
748
+ justify-content: center;
749
+ box-shadow: inset 0 0 0 6px #f1faf5, 0 4px 12px rgba(0, 0, 0, 0.1);
750
+ background: #fff;
751
+ }
752
+ .toast-card__progress-ring-inner {
753
+ width: 46px;
754
+ height: 46px;
755
+ border-radius: 50%;
756
+ background: #fff;
757
+ display: flex;
758
+ align-items: center;
759
+ justify-content: center;
760
+ font-size: 13px;
761
+ font-weight: 700;
762
+ color: var(--ring-color, #2bae73);
763
+ }
764
+ .toast-card__progress-text {
765
+ color: #7a869a;
766
+ font-size: 12px;
767
+ }
768
+
769
+ .unselecttable {
770
+ -webkit-touch-callout: none; /*系统默认菜单被禁用*/
771
+ -webkit-user-select: none; /*webkit浏览器*/
772
+ -khtml-user-select: none; /*早期浏览器*/
773
+ -moz-user-select: none; /*火狐*/
774
+ -ms-user-select: none; /*IE10*/
775
+ user-select: none;
776
+ }
777
+
778
+ .gante-out-op {
779
+ display: flex;
780
+ z-index: 10;
781
+ .gante-trigger, .to-today {
782
+ margin-right: 20px;
783
+ border-radius: 3px;
784
+ padding: 5px 12px;
785
+ background: #fff;
786
+ border: 1px solid #ccc;
787
+ cursor: pointer;
788
+ &:hover {
789
+ background: #f5f5f5;
790
+ color: #3396fb;
791
+ }
792
+ }
793
+
794
+ .reOrde {
795
+ display: flex;
796
+ align-items: center;
797
+ margin-right: 20px;
798
+ border: 1px solid #ccc;
799
+ .icons{
800
+ padding: 8px 8px;
801
+ cursor: pointer;
802
+ background: #fff;
803
+ &:hover {
804
+ background: #f5f5f5;
805
+ color: #3396fb!important;
806
+ }
807
+ &:first-child{
808
+ border-radius: 3px 0 0 3px;
809
+ border-right: 1px solid rgba(0,0,0,0.05);
810
+ }
811
+ &:last-child{
812
+ border-radius: 0 3px 3px 0;
813
+ padding: 8px 12px;
814
+ }
815
+ }
816
+ }
817
+ .fullScreen{
818
+ border-radius: 3px;
819
+ padding: 5px 12px;
820
+ background: #fff;
821
+ border: 1px solid #ccc;
822
+ cursor: pointer;
823
+ img{
824
+ width: 20px;
825
+ height: 20px;
826
+ }
827
+ &:hover{
828
+ background: #f5f5f5;
829
+ color: #3396fb;
830
+ }
831
+ }
832
+ }
833
+ .project_op_drop .el-dropdown-menu__item{
834
+ letter-spacing: 0!important;
835
+ }
836
+ </style>
837
+ <style scoped lang="less">
838
+ .projectTabs{
839
+ position: absolute;
840
+ width: 170px;
841
+ left: -75px;
842
+ top: 25px;
843
+ min-width: 80px!important;
844
+ background: #fff;
845
+ box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
846
+ padding: 10px;
847
+ border-radius: 4px;
848
+ .mode-one{
849
+ line-height: 30px;
850
+ cursor: pointer;
851
+ padding: 0 5px;
852
+ border-radius: 4px;
853
+ transition: all .2s ease;
854
+ display: flex;
855
+ justify-content: space-between;
856
+ align-items: center;
857
+ &:hover{
858
+ background: #eee;
859
+ }
860
+ }
861
+ .mode-one.active{
862
+ color: #3396fb;
863
+ }
864
+ }
865
+ /*拖动排序*/
866
+ .gu-transit {
867
+ opacity: 0.2;
868
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
869
+ filter: alpha(opacity=20);
870
+ }
871
+ .gu-mirror {
872
+ position: fixed !important;
873
+ margin: 0 !important;
874
+ z-index: 9999 !important;
875
+ opacity: 1!important;
876
+ border-radius: 5px!important;
877
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"!important;
878
+ filter: alpha(opacity=80)!important;
879
+ box-shadow: 0 1px 2px 2px rgba(0, 0, 0, 0.1);
880
+ background: #fff;
881
+ &:hover{
882
+ background: #fff;
883
+ cursor: grabbing!important;
884
+ }
885
+ }
886
+ .gu-hide {
887
+ display: none !important;
888
+ }
889
+ .gu-unselectable {
890
+ -webkit-user-select: none !important;
891
+ -moz-user-select: none !important;
892
+ -ms-user-select: none !important;
893
+ user-select: none !important;
894
+ }
895
+ </style>
package/gunter.js ADDED
@@ -0,0 +1,32 @@
1
+ import Gante from './gante.vue'
2
+ export default {
3
+ install(Vue, options = {}) {
4
+ const VueGante = Vue.extend(Gante)
5
+ let gante = null
6
+
7
+ function $gante(params) {
8
+ return new Promise(resolve => {
9
+ // console.log(gante)
10
+ let container = 'body'
11
+ if (params.container) {
12
+ container = params.container
13
+ }
14
+ gante = new VueGante()
15
+ gante.$store = this.$root.$store;
16
+ gante.$mount();
17
+ let ganteLiuBox=document.querySelector('#gante .ganteLiuBox');
18
+ // console.log('ganteLiuBox',ganteLiuBox);
19
+ if(ganteLiuBox){
20
+ document.querySelector(container).replaceChild(gante.$el,ganteLiuBox);
21
+ }else{
22
+ document.querySelector(container).appendChild(gante.$el);
23
+ }
24
+ // }
25
+ gante.init(params);
26
+ resolve(gante)
27
+ })
28
+ }
29
+
30
+ Vue.prototype.$gante = $gante
31
+ }
32
+ }
package/index.js ADDED
@@ -0,0 +1,13 @@
1
+ //package/index.js
2
+ import gante from "../package/gante.vue"; // 引入封装好的组件
3
+ import gunter from "./gunter";
4
+ const coms = [gante]; // 将来如果有其它组件,都可以写到这个数组里
5
+
6
+ // 批量组件注册
7
+ const install = function (Vue) {
8
+ coms.forEach((com) => {
9
+ Vue.component(com.name, com);
10
+ });
11
+ };
12
+
13
+ export default { install,gunter };
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "gunter-kgd",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1"
7
+ },
8
+ "author": "",
9
+ "license": "ISC",
10
+ "description": ""
11
+ }