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
|
@@ -7,31 +7,48 @@
|
|
|
7
7
|
<div>
|
|
8
8
|
<a-space>
|
|
9
9
|
<a-radio-group
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
:size="'small'"
|
|
11
|
+
v-model="timeViewValue"
|
|
12
|
+
button-style="solid"
|
|
13
|
+
@change="timeViewChange"
|
|
14
14
|
>
|
|
15
|
-
<a-radio-button value="day"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<a-radio-button value="
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
|
130
|
-
import moment from
|
|
131
|
-
import draggable from
|
|
132
|
-
import resizeDetector from
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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:
|
|
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:
|
|
201
|
+
default: 'day'
|
|
184
202
|
},
|
|
185
203
|
height: {
|
|
186
|
-
default:
|
|
204
|
+
default: 'auto'
|
|
187
205
|
},
|
|
188
206
|
leftCols: {
|
|
189
207
|
type: Array,
|
|
190
208
|
default: function() {
|
|
191
|
-
return [{ field:
|
|
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:
|
|
235
|
+
strategy: 'scroll'
|
|
223
236
|
});
|
|
224
|
-
let gridBodyDiv = this.$refs.bodyGrid.$el.getElementsByClassName(
|
|
225
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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 ==
|
|
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
|
|
281
|
-
obj[
|
|
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 !==
|
|
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:
|
|
313
|
-
fixed:
|
|
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:
|
|
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(
|
|
330
|
-
field: minDate.format(
|
|
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
|
-
|
|
347
|
+
tempYearMonthCol.width + this.colWidth * splitCount
|
|
337
348
|
}
|
|
338
349
|
|
|
339
350
|
//添加天数
|
|
340
351
|
let tempDayCol = {
|
|
341
|
-
title: minDate.format(
|
|
342
|
-
field: minDate.format(
|
|
352
|
+
title: minDate.format('YYYY年MM月DD日'),
|
|
353
|
+
field: minDate.format('YYYY-MM-DD'),
|
|
343
354
|
width: this.colWidth * splitCount,
|
|
344
|
-
align:
|
|
355
|
+
align: 'center',
|
|
345
356
|
slots: {
|
|
346
|
-
header:
|
|
357
|
+
header: 'dateWeekHeader'
|
|
347
358
|
},
|
|
348
359
|
params: {
|
|
349
|
-
date: minDate.format(
|
|
350
|
-
week: this.weekDay[minDate.format(
|
|
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 !==
|
|
366
|
+
if (this.timeViewValue !== 'day') {
|
|
356
367
|
for (let j = 0; j < splitCount; j++) {
|
|
357
|
-
let tempHour = j * this.splitHour
|
|
358
|
-
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(
|
|
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,
|
|
371
|
-
if (minDate.format(
|
|
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 !==
|
|
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:
|
|
390
|
-
title:
|
|
400
|
+
field: 'content',
|
|
401
|
+
title: '内容',
|
|
391
402
|
width: contentWidth,
|
|
392
|
-
className:
|
|
403
|
+
className: 'custom-cell',
|
|
393
404
|
slots: {
|
|
394
|
-
default:
|
|
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][
|
|
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
|
-
|
|
413
|
-
|
|
414
|
-
)
|
|
423
|
+
moment(minDateTime),
|
|
424
|
+
'minutes'
|
|
425
|
+
)
|
|
415
426
|
let tempLeft = XEUtils.divide(
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
)
|
|
427
|
+
XEUtils.multiply(this.colWidth, diffMiniutes),
|
|
428
|
+
splitMinutes
|
|
429
|
+
)
|
|
419
430
|
//计算左边距
|
|
420
|
-
this.rows[i].items[j][
|
|
431
|
+
this.rows[i].items[j]['left'] = tempLeft
|
|
421
432
|
//计算宽度
|
|
422
433
|
let ordMinutes = moment(this.rows[i].items[j].end).diff(
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
)
|
|
434
|
+
moment(this.rows[i].items[j].start),
|
|
435
|
+
'minutes'
|
|
436
|
+
)
|
|
426
437
|
let tempWidth = XEUtils.divide(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
)
|
|
430
|
-
this.rows[i].items[j][
|
|
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
|
|
448
|
+
this.ganttBarTooltip.left = evt.clientX //ordInfo.left + this.eqpWidth
|
|
438
449
|
this.ganttBarTooltip.top =
|
|
439
|
-
|
|
440
|
-
this.ganttBarTooltip.item = ordInfo
|
|
441
|
-
this.ganttBarTooltip.show = true
|
|
442
|
-
this.$emit(
|
|
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(
|
|
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(
|
|
476
|
+
this.$emit('cellClick', scope)
|
|
466
477
|
},
|
|
467
478
|
onSearch() {
|
|
468
|
-
this.$emit(
|
|
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
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
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
|
-
|
|
509
|
-
|
|
510
|
-
|
|
519
|
+
position: absolute;
|
|
520
|
+
top: 8px;
|
|
521
|
+
z-index: 2;
|
|
511
522
|
// float:left;
|
|
512
|
-
|
|
523
|
+
height: 30px;
|
|
513
524
|
cursor: pointer;
|
|
514
525
|
overflow: hidden;
|
|
515
526
|
border-radius: 5px;
|
|
@@ -602,18 +602,22 @@ export default {
|
|
|
602
602
|
}
|
|
603
603
|
},
|
|
604
604
|
routeLinkClick() {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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:
|
|
616
|
-
query: { id:
|
|
619
|
+
name: tempRouteName,
|
|
620
|
+
query: { id: tempRouteQuery },
|
|
617
621
|
})
|
|
618
622
|
},
|
|
619
623
|
/**
|