doway-coms 2.2.17 → 2.2.18

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doway-coms",
3
- "version": "2.2.17",
3
+ "version": "2.2.18",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -7,31 +7,48 @@
7
7
  <div>
8
8
  <a-space>
9
9
  <a-radio-group
10
- :size="'small'"
11
- v-model="timeViewValue"
12
- button-style="solid"
13
- @change="timeViewChange"
10
+ :size="'small'"
11
+ v-model="timeViewValue"
12
+ button-style="solid"
13
+ @change="timeViewChange"
14
14
  >
15
- <a-radio-button value="day">天</a-radio-button>
16
- <a-radio-button value="1">1小时</a-radio-button>
17
- <a-radio-button value="2">2小时</a-radio-button>
18
- <a-radio-button value="4">4小时</a-radio-button>
19
- <a-radio-button value="8">8小时</a-radio-button>
20
- <a-radio-button value="12">12小时</a-radio-button>
15
+ <a-radio-button value="day">
16
+
17
+ </a-radio-button>
18
+ <a-radio-button value="1">
19
+ 1小时
20
+ </a-radio-button>
21
+ <a-radio-button value="2">
22
+ 2小时
23
+ </a-radio-button>
24
+ <a-radio-button value="4">
25
+ 4小时
26
+ </a-radio-button>
27
+ <a-radio-button value="8">
28
+ 8小时
29
+ </a-radio-button>
30
+ <a-radio-button value="12">
31
+ 12小时
32
+ </a-radio-button>
21
33
  </a-radio-group>
22
34
  </a-space>
23
35
  </div>
24
36
  </div>
25
37
  <vxe-grid
26
- border
27
- show-header-overflow
28
- ref="headDay"
29
- class="head-grid"
30
- :size="'small'"
31
- header-cell-class-name="header-cell-day"
38
+ border
39
+ show-header-overflow
40
+ ref="headDay"
41
+ class="head-grid"
42
+ :size="'small'"
43
+ header-cell-class-name="header-cell-day"
32
44
  >
33
45
  <template #customSearchHeader>
34
- <vxe-input v-model="searchValue" placeholder="搜索" type="search" @input="onSearch"></vxe-input>
46
+ <vxe-input
47
+ v-model="searchValue"
48
+ placeholder="搜索"
49
+ type="search"
50
+ @input="onSearch"
51
+ ></vxe-input>
35
52
  </template>
36
53
  <template #dateWeekHeader="{ column }">
37
54
  <div>
@@ -41,13 +58,14 @@
41
58
  </template>
42
59
  </vxe-grid>
43
60
  <vxe-grid
44
- border
45
- show-header-overflow
46
- ref="headHour"
47
- class="head-grid"
48
- :size="'small'"
49
- v-show="hourCols.length > 0"
50
- ></vxe-grid>
61
+ border
62
+ show-header-overflow
63
+ ref="headHour"
64
+ class="head-grid"
65
+ :size="'small'"
66
+ v-show="hourCols.length > 0"
67
+ >
68
+ </vxe-grid>
51
69
 
52
70
  <!-- <div class="gantt-line-area" ref="lineArea">
53
71
  <div
@@ -56,11 +74,11 @@
56
74
  :key="loopLine"
57
75
  :style="{ left: loopLine + 'px', height: lineHeight + 'px' }"
58
76
  ></div>
59
- </div>-->
77
+ </div> -->
60
78
  <div
61
- class="gantt-bar-tooltip"
62
- v-if="ganttBarTooltip.show === true"
63
- :style="{
79
+ class="gantt-bar-tooltip"
80
+ v-if="ganttBarTooltip.show === true"
81
+ :style="{
64
82
  left: ganttBarTooltip.left + 'px',
65
83
  top: ganttBarTooltip.top + 'px'
66
84
  }"
@@ -68,47 +86,47 @@
68
86
  <slot name="itemTip" :item="ganttBarTooltip.item"></slot>
69
87
  </div>
70
88
  <vxe-grid
71
- border
72
- resizable
73
- auto-resize
74
- ref="bodyGrid"
75
- show-overflow
76
- class="mytable-scrollbar"
77
- :show-header="false"
78
- :size="'small'"
79
- :height="computedHeight"
80
- :row-config="{
81
- isCurrent: isCurrent,//点击高亮
82
- isHover: true,
89
+ border
90
+ resizable
91
+ auto-resize
92
+ ref="bodyGrid"
93
+ show-overflow
94
+ class="mytable-scrollbar"
95
+ :show-header="false"
96
+ :size="'small'"
97
+ :height="computedHeight"
98
+ :row-config="{
99
+ isCurrent: isCurrent,
100
+ isHover: true
83
101
  }"
84
- :treeConfig="treeConfig"
85
- :cell-class-name="cellClassName"
86
- :row-class-name="rowClassName"
87
- @cell-click="cellClick"
88
- @scroll="bodyScroll"
89
- :loading="loading"
90
- @filter-change="filterChangeEvent"
91
- @toggle-tree-expand="toggleTreeExpand"
102
+ :treeConfig="treeConfig"
103
+ :cell-class-name="cellClassName"
104
+ :row-class-name="rowClassName"
105
+ @cell-click="cellClick"
106
+ @scroll="bodyScroll"
107
+ :loading="loading"
108
+ @filter-change="filterChangeEvent"
109
+ @toggle-tree-expand="toggleTreeExpand"
92
110
  >
93
111
  <template #content="{ row, rowIndex }">
94
112
  <div>
95
113
  <div class="gantt-line-area" v-if="rowIndex === 0" ref="lineArea">
96
114
  <div
97
- class="gantt-line"
98
- v-for="loopLine in lines"
99
- :key="loopLine"
100
- :style="{ left: loopLine + 'px', height: lineHeight + 'px' }"
115
+ class="gantt-line"
116
+ v-for="loopLine in lines"
117
+ :key="loopLine"
118
+ :style="{ left: loopLine + 'px', height: lineHeight + 'px' }"
101
119
  ></div>
102
120
  </div>
103
121
  <div
104
- v-for="loopItem in row.items"
105
- :key="loopItem.id"
106
- :name="'gantt-bar'+loopItem.taskId"
107
- :id="'gantt-bar'+loopItem.id"
108
- class="gantt-bar"
109
- @mouseenter="ganttBarMouseEnter($event, loopItem, rowIndex)"
110
- @mouseleave="ganttBarMouseLeave($event, loopItem)"
111
- :style="{
122
+ v-for="loopItem in row.items"
123
+ :key="loopItem.id"
124
+ :name="'gantt-bar'+loopItem.taskId"
125
+ :id="'gantt-bar'+loopItem.id"
126
+ class="gantt-bar"
127
+ @mouseenter="ganttBarMouseEnter($event, loopItem, rowIndex)"
128
+ @mouseleave="ganttBarMouseLeave($event, loopItem)"
129
+ :style="{
112
130
  marginLeft: loopItem.left + 'px',
113
131
  width: loopItem.width + 'px'
114
132
  }"
@@ -126,22 +144,22 @@
126
144
 
127
145
  <script>
128
146
  import { Space, Radio } from "ant-design-vue";
129
- import XEUtils from "xe-utils";
130
- import moment from "moment";
131
- import draggable from "vuedraggable";
132
- import resizeDetector from "element-resize-detector";
147
+ import XEUtils from 'xe-utils'
148
+ import moment from 'moment'
149
+ import draggable from 'vuedraggable'
150
+ import resizeDetector from 'element-resize-detector';
133
151
  export default {
134
152
  name: "BaseGantt",
135
153
  components: {
136
154
  draggable,
137
- "a-space": Space,
138
- "a-radio-button": Radio.Button,
139
- "a-radio-group": Radio.Group
155
+ 'a-space': Space,
156
+ 'a-radio-button': Radio.Button,
157
+ 'a-radio-group': Radio.Group,
140
158
  },
141
159
  data() {
142
160
  return {
143
- searchValue: "",
144
- timeViewValue: "day",
161
+ searchValue: '',
162
+ timeViewValue: 'day',
145
163
  loading: false,
146
164
  rowColData: {},
147
165
  minDate: null,
@@ -163,11 +181,11 @@ export default {
163
181
  left: 0,
164
182
  top: 0,
165
183
  item: {},
166
- color: ""
184
+ color: ''
167
185
  },
168
186
  rows: [],
169
- weekDay: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
170
- };
187
+ weekDay: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
188
+ }
171
189
  },
172
190
  props: {
173
191
  showSeachHeader: {
@@ -180,15 +198,15 @@ export default {
180
198
  },
181
199
  timeValue: {
182
200
  type: String,
183
- default: "day"
201
+ default: 'day'
184
202
  },
185
203
  height: {
186
- default: "auto"
204
+ default: 'auto'
187
205
  },
188
206
  leftCols: {
189
207
  type: Array,
190
208
  default: function() {
191
- return [{ field: "eqp", width: 100, fixed: "left" }];
209
+ return [{ field: 'eqp', width: 100, fixed: 'left' }]
192
210
  }
193
211
  },
194
212
  cellClassName: {
@@ -199,41 +217,34 @@ export default {
199
217
  type: Function,
200
218
  default: function() {}
201
219
  },
202
- treeConfig: {
220
+ treeConfig:{
203
221
  type: Object,
204
222
  default: function() {
205
- return null;
223
+ return null
206
224
  }
207
- },
208
- checkboxConfig: {
209
- type: Object,
210
- default: function() {
211
- return null;
212
- }
213
- },
225
+ }
214
226
  },
215
227
  computed: {
216
228
  computedHeight: function() {
217
- return this.height - this.headerHeight;
229
+ return this.height - this.headerHeight
218
230
  }
219
231
  },
220
232
  mounted() {
233
+
221
234
  let erd = resizeDetector({
222
- strategy: "scroll"
235
+ strategy: 'scroll'
223
236
  });
224
- let gridBodyDiv = this.$refs.bodyGrid.$el.getElementsByClassName(
225
- "vxe-table--body"
226
- )[0];
227
- let vm = this;
237
+ let gridBodyDiv = this.$refs.bodyGrid.$el.getElementsByClassName('vxe-table--body')[0]
238
+ let vm = this
228
239
  erd.listenTo(gridBodyDiv, () => {
229
- vm.lineHeight = gridBodyDiv.clientHeight;
240
+ vm.lineHeight = gridBodyDiv.clientHeight
230
241
  });
231
- this.timeViewValue = this.timeValue;
242
+ this.timeViewValue = this.timeValue
232
243
  },
233
244
  created() {},
234
245
  methods: {
235
- toggleTreeExpand(scope) {
236
- // console.debug(this.$refs.bodyGrid.$el.getElementsByClassName('vxe-table--body')[0].clientHeight)
246
+ toggleTreeExpand(scope){
247
+ // console.debug(this.$refs.bodyGrid.$el.getElementsByClassName('vxe-table--body')[0].clientHeight)
237
248
  },
238
249
  filterChangeEvent({ column }) {},
239
250
  // headerDayCellStyle({ column, columnIndex }){
@@ -246,28 +257,28 @@ export default {
246
257
  * 视图改变后初始化表头
247
258
  */
248
259
  setLoading(b) {
249
- this.loading = b;
260
+ this.loading = b
250
261
  },
251
262
  timeViewChange() {
252
- this.initHeaders(this.dateRange);
253
- this.initContent();
263
+ this.initHeaders(this.dateRange)
264
+ this.initContent()
254
265
  },
255
266
  initHeaders(dateRange) {
256
- this.dateRange = dateRange;
257
- let contentWidth = 0;
258
- let minDate = moment(this.dateRange[0]);
259
- let maxDate = moment(this.dateRange[1]);
260
- let splitCount = 1;
261
- let diffDays = maxDate.diff(minDate, "day");
262
- this.monthCols = [];
263
- this.dayCols = [];
264
- this.hourCols = [];
265
- this.lines = [];
266
- let bodyCols = [];
267
- this.fixedColWidth = 0;
267
+ this.dateRange = dateRange
268
+ let contentWidth = 0
269
+ let minDate = moment(this.dateRange[0])
270
+ let maxDate = moment(this.dateRange[1])
271
+ let splitCount = 1
272
+ let diffDays = maxDate.diff(minDate, 'day')
273
+ this.monthCols = []
274
+ this.dayCols = []
275
+ this.hourCols = []
276
+ this.lines = []
277
+ let bodyCols = []
278
+ this.fixedColWidth = 0
268
279
  for (let i = 0; i < this.leftCols.length; i++) {
269
- if (this.leftCols[i].fixed == "left") {
270
- this.fixedColWidth = this.fixedColWidth + this.leftCols[i].width;
280
+ if (this.leftCols[i].fixed == 'left') {
281
+ this.fixedColWidth = this.fixedColWidth + this.leftCols[i].width
271
282
  }
272
283
  let obj = {
273
284
  field: this.leftCols[i].field,
@@ -276,15 +287,15 @@ export default {
276
287
  width: this.leftCols[i].width
277
288
  // filters:[{data:null}],
278
289
  // filterRender:{name: 'input'}
279
- };
280
- if (this.leftCols[i].treeNode === true) {
281
- obj["treeNode"] = true;
290
+ }
291
+ if(this.leftCols[i].treeNode===true){
292
+ obj['treeNode'] = true
282
293
  }
283
294
 
284
295
  if (this.leftCols[i].slots) {
285
- obj.slots = this.leftCols[i].slots;
296
+ obj.slots = this.leftCols[i].slots
286
297
  }
287
- this.monthCols.push();
298
+ this.monthCols.push()
288
299
 
289
300
  // tmp.filters=undefined
290
301
  // tmp.filterRender=undefined
@@ -295,155 +306,155 @@ export default {
295
306
  // this.dayCols.push(tmp)
296
307
  // obj.filters=[{data:null}]
297
308
  // obj.filterRender={name:'input'}
298
- bodyCols.push(obj);
299
- if (this.timeViewValue !== "day") {
300
- this.splitHour = parseInt(this.timeViewValue);
301
- this.hourCols.push(obj);
302
- this.colWidth = 60;
303
- splitCount = 24 / this.splitHour;
309
+ bodyCols.push(obj)
310
+ if (this.timeViewValue !== 'day') {
311
+ this.splitHour = parseInt(this.timeViewValue)
312
+ this.hourCols.push(obj)
313
+ this.colWidth = 60
314
+ splitCount = 24 / this.splitHour
304
315
  } else {
305
- this.splitHour = 24;
306
- this.colWidth = 130;
307
- splitCount = 1;
316
+ this.splitHour = 24
317
+ this.colWidth = 130
318
+ splitCount = 1
308
319
  }
309
320
  }
310
321
 
311
322
  let tmp = {
312
- type: "seq",
313
- fixed: "left",
314
- title: "",
323
+ type: 'seq',
324
+ fixed: 'left',
325
+ title: '',
315
326
 
316
327
  width: this.fixedColWidth
317
- };
328
+ }
318
329
  if (this.showSeachHeader) {
319
330
  tmp.slots = {
320
- header: "customSearchHeader"
321
- };
331
+ header: 'customSearchHeader'
332
+ }
322
333
  }
323
- this.dayCols.push(tmp);
334
+ this.dayCols.push(tmp)
324
335
 
325
- let tempYearMonthCol = null;
336
+ let tempYearMonthCol = null
326
337
  for (let i = 0; i <= diffDays; i++) {
327
338
  if (tempYearMonthCol === null) {
328
339
  tempYearMonthCol = {
329
- title: minDate.format("YYYY-MM"),
330
- field: minDate.format("YYYY-MM"),
340
+ title: minDate.format('YYYY-MM'),
341
+ field: minDate.format('YYYY-MM'),
331
342
  width: this.colWidth * splitCount
332
- };
333
- this.monthCols.push(tempYearMonthCol);
343
+ }
344
+ this.monthCols.push(tempYearMonthCol)
334
345
  } else {
335
346
  tempYearMonthCol.width =
336
- tempYearMonthCol.width + this.colWidth * splitCount;
347
+ tempYearMonthCol.width + this.colWidth * splitCount
337
348
  }
338
349
 
339
350
  //添加天数
340
351
  let tempDayCol = {
341
- title: minDate.format("YYYY年MM月DD日"),
342
- field: minDate.format("YYYY-MM-DD"),
352
+ title: minDate.format('YYYY年MM月DD日'),
353
+ field: minDate.format('YYYY-MM-DD'),
343
354
  width: this.colWidth * splitCount,
344
- align: "center",
355
+ align: 'center',
345
356
  slots: {
346
- header: "dateWeekHeader"
357
+ header: 'dateWeekHeader'
347
358
  },
348
359
  params: {
349
- date: minDate.format("YYYY年MM月DD日"),
350
- week: this.weekDay[minDate.format("E") - 1]
360
+ date: minDate.format('YYYY年MM月DD日'),
361
+ week: this.weekDay[minDate.format('E') - 1]
351
362
  }
352
- };
353
- this.dayCols.push(tempDayCol);
363
+ }
364
+ this.dayCols.push(tempDayCol)
354
365
  //添加小时
355
- if (this.timeViewValue !== "day") {
366
+ if (this.timeViewValue !== 'day') {
356
367
  for (let j = 0; j < splitCount; j++) {
357
- let tempHour = j * this.splitHour;
358
- tempHour = "000" + tempHour;
359
- tempHour = tempHour.substr(tempHour.length - 2, 2);
360
- contentWidth = contentWidth + this.colWidth;
368
+ let tempHour = j * this.splitHour
369
+ tempHour = '000' + tempHour
370
+ tempHour = tempHour.substr(tempHour.length - 2, 2)
371
+ contentWidth = contentWidth + this.colWidth
361
372
  this.hourCols.push({
362
- field: minDate.format("YYYY-MM-DD") + " " + tempHour + ":00:00",
373
+ field: minDate.format('YYYY-MM-DD') + ' ' + tempHour + ':00:00',
363
374
  title: tempHour,
364
375
  width: this.colWidth
365
- });
376
+ })
366
377
  }
367
378
  } else {
368
- contentWidth = contentWidth + tempDayCol.width;
379
+ contentWidth = contentWidth + tempDayCol.width
369
380
  }
370
- minDate.add(1, "day");
371
- if (minDate.format("YYYY-MM") !== tempYearMonthCol.field) {
372
- tempYearMonthCol = null;
381
+ minDate.add(1, 'day')
382
+ if (minDate.format('YYYY-MM') !== tempYearMonthCol.field) {
383
+ tempYearMonthCol = null
373
384
  }
374
385
  }
375
- let colLength = this.dayCols.length;
386
+ let colLength = this.dayCols.length
376
387
  // this.$refs.headMonth.reloadColumn(this.monthCols)
377
- this.$refs.headDay.reloadColumn(this.dayCols);
378
- if (this.timeViewValue !== "day") {
379
- this.headerHeight = 160;
380
- colLength = this.hourCols.length;
381
- this.$refs.headHour.reloadColumn(this.hourCols);
388
+ this.$refs.headDay.reloadColumn(this.dayCols)
389
+ if (this.timeViewValue !== 'day') {
390
+ this.headerHeight = 160
391
+ colLength = this.hourCols.length
392
+ this.$refs.headHour.reloadColumn(this.hourCols)
382
393
  } else {
383
- this.headerHeight = 120;
394
+ this.headerHeight = 120
384
395
  }
385
396
  for (let i = 0; i < colLength; i++) {
386
- this.lines.push(i * this.colWidth);
397
+ this.lines.push(i * this.colWidth)
387
398
  }
388
399
  bodyCols.push({
389
- field: "content",
390
- title: "内容",
400
+ field: 'content',
401
+ title: '内容',
391
402
  width: contentWidth,
392
- className: "custom-cell",
403
+ className: 'custom-cell',
393
404
  slots: {
394
- default: "content"
405
+ default: 'content'
395
406
  }
396
- });
397
- this.$refs.bodyGrid.reloadColumn(bodyCols);
407
+ })
408
+ this.$refs.bodyGrid.reloadColumn(bodyCols)
398
409
  // this.$refs.lineArea.style.marginLeft =
399
410
  // ((this.fixedColWidth-this.colWidth)) + 'px'
400
411
  },
401
412
  loadData(rows) {
402
- this.rows = rows;
403
- this.initContent();
413
+ this.rows = rows
414
+ this.initContent()
404
415
  },
405
416
  initContent() {
406
- let splitMinutes = XEUtils.multiply(this.splitHour, 60);
407
- let minDateTime = this.dateRange[0];
417
+ let splitMinutes = XEUtils.multiply(this.splitHour, 60)
418
+ let minDateTime = this.dateRange[0]
408
419
  for (let i = 0; i < this.rows.length; i++) {
409
- this.rows[i]["content"] = "";
420
+ this.rows[i]['content'] = ''
410
421
  for (let j = 0; j < this.rows[i].items.length; j++) {
411
422
  let diffMiniutes = moment(this.rows[i].items[j].start).diff(
412
- moment(minDateTime),
413
- "minutes"
414
- );
423
+ moment(minDateTime),
424
+ 'minutes'
425
+ )
415
426
  let tempLeft = XEUtils.divide(
416
- XEUtils.multiply(this.colWidth, diffMiniutes),
417
- splitMinutes
418
- );
427
+ XEUtils.multiply(this.colWidth, diffMiniutes),
428
+ splitMinutes
429
+ )
419
430
  //计算左边距
420
- this.rows[i].items[j]["left"] = tempLeft;
431
+ this.rows[i].items[j]['left'] = tempLeft
421
432
  //计算宽度
422
433
  let ordMinutes = moment(this.rows[i].items[j].end).diff(
423
- moment(this.rows[i].items[j].start),
424
- "minutes"
425
- );
434
+ moment(this.rows[i].items[j].start),
435
+ 'minutes'
436
+ )
426
437
  let tempWidth = XEUtils.divide(
427
- XEUtils.multiply(this.colWidth, ordMinutes),
428
- splitMinutes
429
- );
430
- this.rows[i].items[j]["width"] = tempWidth;
438
+ XEUtils.multiply(this.colWidth, ordMinutes),
439
+ splitMinutes
440
+ )
441
+ this.rows[i].items[j]['width'] = tempWidth
431
442
  }
432
443
  }
433
- this.lineHeight = this.rows.length * 40;
434
- this.$refs.bodyGrid.reloadData(this.rows);
444
+ this.lineHeight = this.rows.length * 40
445
+ this.$refs.bodyGrid.reloadData(this.rows)
435
446
  },
436
447
  ganttBarMouseEnter(evt, ordInfo, rowIndex) {
437
- this.ganttBarTooltip.left = evt.clientX; //ordInfo.left + this.eqpWidth
448
+ this.ganttBarTooltip.left = evt.clientX //ordInfo.left + this.eqpWidth
438
449
  this.ganttBarTooltip.top =
439
- evt.clientY + evt.target.offsetHeight - evt.offsetY; // (rowIndex + 1) * this.rowHeight
440
- this.ganttBarTooltip.item = ordInfo;
441
- this.ganttBarTooltip.show = true;
442
- this.$emit("mouseEnter", ordInfo);
450
+ evt.clientY + evt.target.offsetHeight - evt.offsetY // (rowIndex + 1) * this.rowHeight
451
+ this.ganttBarTooltip.item = ordInfo
452
+ this.ganttBarTooltip.show = true
453
+ this.$emit('mouseEnter',ordInfo)
443
454
  },
444
455
  ganttBarMouseLeave(evt, ordInfo) {
445
- this.ganttBarTooltip.show = false;
446
- this.$emit("mouseLeave", ordInfo);
456
+ this.ganttBarTooltip.show = false
457
+ this.$emit('mouseLeave',ordInfo)
447
458
  },
448
459
  bodyScroll(scrollInfo) {
449
460
  if (scrollInfo.isX === true) {
@@ -451,27 +462,27 @@ export default {
451
462
  // (scrollInfo.scrollLeft-(this.fixedColWidth-this.colWidth)) * -1 + 'px'
452
463
 
453
464
  // this.$refs.headMonth.scrollTo(scrollInfo.scrollLeft)
454
- this.$refs.headDay.scrollTo(scrollInfo.scrollLeft);
455
- this.$refs.headHour.scrollTo(scrollInfo.scrollLeft);
465
+ this.$refs.headDay.scrollTo(scrollInfo.scrollLeft)
466
+ this.$refs.headHour.scrollTo(scrollInfo.scrollLeft)
456
467
  }
457
468
  },
458
469
  setCurrentRow(row) {
459
- this.$refs.bodyGrid.setCurrentRow(row);
470
+ this.$refs.bodyGrid.setCurrentRow(row)
460
471
  },
461
472
  getTableData() {
462
- return this.$refs.bodyGrid.getTableData().fullData;
473
+ return this.$refs.bodyGrid.getTableData().fullData
463
474
  },
464
475
  cellClick(scope) {
465
- this.$emit("cellClick", scope);
476
+ this.$emit('cellClick', scope)
466
477
  },
467
478
  onSearch() {
468
- this.$emit("search", this.searchValue);
479
+ this.$emit('search', this.searchValue)
469
480
  },
470
481
  scrollRow(row) {
471
- this.$refs.bodyGrid.scrollToRow(row);
482
+ this.$refs.bodyGrid.scrollToRow(row)
472
483
  }
473
484
  }
474
- };
485
+ }
475
486
  </script>
476
487
 
477
488
  <style lang="scss">
@@ -483,10 +494,10 @@ export default {
483
494
  padding-right: 0px !important;
484
495
  }
485
496
  .head-grid
486
- .vxe-table
487
- .vxe-table--render-wrapper
488
- .vxe-table--main-wrapper
489
- .vxe-table--body-wrapper {
497
+ .vxe-table
498
+ .vxe-table--render-wrapper
499
+ .vxe-table--main-wrapper
500
+ .vxe-table--body-wrapper {
490
501
  height: 0px !important;
491
502
  }
492
503
  .head-grid .vxe-table .vxe-table--empty-content {
@@ -505,11 +516,11 @@ export default {
505
516
  </style>
506
517
  <style lang="scss" scoped>
507
518
  .gantt-bar {
508
- // position: absolute;
509
- // top: 8px;
510
- // z-index: 2;
519
+ position: absolute;
520
+ top: 8px;
521
+ z-index: 2;
511
522
  // float:left;
512
- // height: 30px;
523
+ height: 30px;
513
524
  cursor: pointer;
514
525
  overflow: hidden;
515
526
  border-radius: 5px;
@@ -3399,6 +3399,9 @@ export default {
3399
3399
  console.debug(err)
3400
3400
  })
3401
3401
  },
3402
+ setTreeExpand(rows, checked) {
3403
+ this.$refs.baseGrid.setTreeExpand(rows, checked)
3404
+ },
3402
3405
  },
3403
3406
  }
3404
3407
  </script>
@@ -602,18 +602,22 @@ export default {
602
602
  }
603
603
  },
604
604
  routeLinkClick() {
605
- //首先需要判断是否有权限
606
- // let treeModule = XEUtils.findTree(
607
- // this.$store.getters.addRouters,
608
- // item => item.name === this.route.name
609
- // )
610
- // if (!treeModule) {
611
- // this.$antwarning('没有权限')
612
- // return
613
- // }
605
+ let tempRouteName = this.route.name
606
+ let tempRouteQuery = this.row[this.route.field]
607
+ if (XEUtils.isArray(tempRouteName)) {
608
+ //需要不同条件跳转不同页面
609
+ for (let i = 0; i < tempRouteName.length; i++) {
610
+ if (tempRouteName[i].value === this.row[tempRouteName[i].field]) {
611
+ tempRouteQuery =
612
+ this.row[tempRouteName[i].query] || this.row[this.route.field]
613
+ tempRouteName = tempRouteName[i].name
614
+ break
615
+ }
616
+ }
617
+ }
614
618
  this.$router.pushRoute({
615
- name: this.route.name,
616
- query: { id: this.row[this.route.field] },
619
+ name: tempRouteName,
620
+ query: { id: tempRouteQuery },
617
621
  })
618
622
  },
619
623
  /**