doway-coms 2.2.14 → 2.2.16
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/dist/css/chunk-vendors.7f83d8f9.css +8 -0
- package/dist/css/index.86478f73.css +3 -0
- package/dist/favicon.ico +0 -0
- package/dist/js/chunk-vendors.307eaa8f.js +347 -0
- package/dist/js/index.48e7f7ac.js +2 -0
- package/package.json +1 -1
- package/packages/BaseGantt/src/index.vue +220 -204
- package/packages/BasePulldown/src/index.vue +15 -11
|
@@ -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,48 +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
|
-
|
|
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="{
|
|
81
99
|
isCurrent: isCurrent,
|
|
82
|
-
isHover: true
|
|
100
|
+
isHover: true
|
|
83
101
|
}"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
:checkbox-config="checkboxConfig"
|
|
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"
|
|
93
110
|
>
|
|
94
111
|
<template #content="{ row, rowIndex }">
|
|
95
112
|
<div>
|
|
96
113
|
<div class="gantt-line-area" v-if="rowIndex === 0" ref="lineArea">
|
|
97
114
|
<div
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
115
|
+
class="gantt-line"
|
|
116
|
+
v-for="loopLine in lines"
|
|
117
|
+
:key="loopLine"
|
|
118
|
+
:style="{ left: loopLine + 'px', height: lineHeight + 'px' }"
|
|
102
119
|
></div>
|
|
103
120
|
</div>
|
|
104
121
|
<div
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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="{
|
|
113
130
|
marginLeft: loopItem.left + 'px',
|
|
114
131
|
width: loopItem.width + 'px'
|
|
115
132
|
}"
|
|
@@ -127,22 +144,22 @@
|
|
|
127
144
|
|
|
128
145
|
<script>
|
|
129
146
|
import { Space, Radio } from "ant-design-vue";
|
|
130
|
-
import XEUtils from
|
|
131
|
-
import moment from
|
|
132
|
-
import draggable from
|
|
133
|
-
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';
|
|
134
151
|
export default {
|
|
135
152
|
name: "BaseGantt",
|
|
136
153
|
components: {
|
|
137
154
|
draggable,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
155
|
+
'a-space': Space,
|
|
156
|
+
'a-radio-button': Radio.Button,
|
|
157
|
+
'a-radio-group': Radio.Group,
|
|
141
158
|
},
|
|
142
159
|
data() {
|
|
143
160
|
return {
|
|
144
|
-
searchValue:
|
|
145
|
-
timeViewValue:
|
|
161
|
+
searchValue: '',
|
|
162
|
+
timeViewValue: 'day',
|
|
146
163
|
loading: false,
|
|
147
164
|
rowColData: {},
|
|
148
165
|
minDate: null,
|
|
@@ -164,11 +181,11 @@ export default {
|
|
|
164
181
|
left: 0,
|
|
165
182
|
top: 0,
|
|
166
183
|
item: {},
|
|
167
|
-
color:
|
|
184
|
+
color: ''
|
|
168
185
|
},
|
|
169
186
|
rows: [],
|
|
170
|
-
weekDay: [
|
|
171
|
-
}
|
|
187
|
+
weekDay: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
|
188
|
+
}
|
|
172
189
|
},
|
|
173
190
|
props: {
|
|
174
191
|
showSeachHeader: {
|
|
@@ -181,15 +198,15 @@ export default {
|
|
|
181
198
|
},
|
|
182
199
|
timeValue: {
|
|
183
200
|
type: String,
|
|
184
|
-
default:
|
|
201
|
+
default: 'day'
|
|
185
202
|
},
|
|
186
203
|
height: {
|
|
187
|
-
default:
|
|
204
|
+
default: 'auto'
|
|
188
205
|
},
|
|
189
206
|
leftCols: {
|
|
190
207
|
type: Array,
|
|
191
208
|
default: function() {
|
|
192
|
-
return [{ field:
|
|
209
|
+
return [{ field: 'eqp', width: 100, fixed: 'left' }]
|
|
193
210
|
}
|
|
194
211
|
},
|
|
195
212
|
cellClassName: {
|
|
@@ -200,35 +217,34 @@ export default {
|
|
|
200
217
|
type: Function,
|
|
201
218
|
default: function() {}
|
|
202
219
|
},
|
|
203
|
-
treeConfig:
|
|
220
|
+
treeConfig:{
|
|
204
221
|
type: Object,
|
|
205
222
|
default: function() {
|
|
206
|
-
return null
|
|
223
|
+
return null
|
|
207
224
|
}
|
|
208
225
|
}
|
|
209
226
|
},
|
|
210
227
|
computed: {
|
|
211
228
|
computedHeight: function() {
|
|
212
|
-
return this.height - this.headerHeight
|
|
229
|
+
return this.height - this.headerHeight
|
|
213
230
|
}
|
|
214
231
|
},
|
|
215
232
|
mounted() {
|
|
233
|
+
|
|
216
234
|
let erd = resizeDetector({
|
|
217
|
-
strategy:
|
|
235
|
+
strategy: 'scroll'
|
|
218
236
|
});
|
|
219
|
-
let gridBodyDiv = this.$refs.bodyGrid.$el.getElementsByClassName(
|
|
220
|
-
|
|
221
|
-
)[0];
|
|
222
|
-
let vm = this;
|
|
237
|
+
let gridBodyDiv = this.$refs.bodyGrid.$el.getElementsByClassName('vxe-table--body')[0]
|
|
238
|
+
let vm = this
|
|
223
239
|
erd.listenTo(gridBodyDiv, () => {
|
|
224
|
-
|
|
240
|
+
vm.lineHeight = gridBodyDiv.clientHeight
|
|
225
241
|
});
|
|
226
|
-
this.timeViewValue = this.timeValue
|
|
242
|
+
this.timeViewValue = this.timeValue
|
|
227
243
|
},
|
|
228
244
|
created() {},
|
|
229
245
|
methods: {
|
|
230
|
-
toggleTreeExpand(scope)
|
|
231
|
-
|
|
246
|
+
toggleTreeExpand(scope){
|
|
247
|
+
// console.debug(this.$refs.bodyGrid.$el.getElementsByClassName('vxe-table--body')[0].clientHeight)
|
|
232
248
|
},
|
|
233
249
|
filterChangeEvent({ column }) {},
|
|
234
250
|
// headerDayCellStyle({ column, columnIndex }){
|
|
@@ -241,28 +257,28 @@ export default {
|
|
|
241
257
|
* 视图改变后初始化表头
|
|
242
258
|
*/
|
|
243
259
|
setLoading(b) {
|
|
244
|
-
this.loading = b
|
|
260
|
+
this.loading = b
|
|
245
261
|
},
|
|
246
262
|
timeViewChange() {
|
|
247
|
-
this.initHeaders(this.dateRange)
|
|
248
|
-
this.initContent()
|
|
263
|
+
this.initHeaders(this.dateRange)
|
|
264
|
+
this.initContent()
|
|
249
265
|
},
|
|
250
266
|
initHeaders(dateRange) {
|
|
251
|
-
this.dateRange = dateRange
|
|
252
|
-
let contentWidth = 0
|
|
253
|
-
let minDate = moment(this.dateRange[0])
|
|
254
|
-
let maxDate = moment(this.dateRange[1])
|
|
255
|
-
let splitCount = 1
|
|
256
|
-
let diffDays = maxDate.diff(minDate,
|
|
257
|
-
this.monthCols = []
|
|
258
|
-
this.dayCols = []
|
|
259
|
-
this.hourCols = []
|
|
260
|
-
this.lines = []
|
|
261
|
-
let bodyCols = []
|
|
262
|
-
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
|
|
263
279
|
for (let i = 0; i < this.leftCols.length; i++) {
|
|
264
|
-
if (this.leftCols[i].fixed ==
|
|
265
|
-
this.fixedColWidth = this.fixedColWidth + this.leftCols[i].width
|
|
280
|
+
if (this.leftCols[i].fixed == 'left') {
|
|
281
|
+
this.fixedColWidth = this.fixedColWidth + this.leftCols[i].width
|
|
266
282
|
}
|
|
267
283
|
let obj = {
|
|
268
284
|
field: this.leftCols[i].field,
|
|
@@ -271,15 +287,15 @@ export default {
|
|
|
271
287
|
width: this.leftCols[i].width
|
|
272
288
|
// filters:[{data:null}],
|
|
273
289
|
// filterRender:{name: 'input'}
|
|
274
|
-
}
|
|
275
|
-
if
|
|
276
|
-
obj[
|
|
290
|
+
}
|
|
291
|
+
if(this.leftCols[i].treeNode===true){
|
|
292
|
+
obj['treeNode'] = true
|
|
277
293
|
}
|
|
278
294
|
|
|
279
295
|
if (this.leftCols[i].slots) {
|
|
280
|
-
obj.slots = this.leftCols[i].slots
|
|
296
|
+
obj.slots = this.leftCols[i].slots
|
|
281
297
|
}
|
|
282
|
-
this.monthCols.push()
|
|
298
|
+
this.monthCols.push()
|
|
283
299
|
|
|
284
300
|
// tmp.filters=undefined
|
|
285
301
|
// tmp.filterRender=undefined
|
|
@@ -290,155 +306,155 @@ export default {
|
|
|
290
306
|
// this.dayCols.push(tmp)
|
|
291
307
|
// obj.filters=[{data:null}]
|
|
292
308
|
// obj.filterRender={name:'input'}
|
|
293
|
-
bodyCols.push(obj)
|
|
294
|
-
if (this.timeViewValue !==
|
|
295
|
-
this.splitHour = parseInt(this.timeViewValue)
|
|
296
|
-
this.hourCols.push(obj)
|
|
297
|
-
this.colWidth = 60
|
|
298
|
-
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
|
|
299
315
|
} else {
|
|
300
|
-
this.splitHour = 24
|
|
301
|
-
this.colWidth = 130
|
|
302
|
-
splitCount = 1
|
|
316
|
+
this.splitHour = 24
|
|
317
|
+
this.colWidth = 130
|
|
318
|
+
splitCount = 1
|
|
303
319
|
}
|
|
304
320
|
}
|
|
305
321
|
|
|
306
322
|
let tmp = {
|
|
307
|
-
type:
|
|
308
|
-
fixed:
|
|
309
|
-
title:
|
|
323
|
+
type: 'seq',
|
|
324
|
+
fixed: 'left',
|
|
325
|
+
title: '',
|
|
310
326
|
|
|
311
327
|
width: this.fixedColWidth
|
|
312
|
-
}
|
|
328
|
+
}
|
|
313
329
|
if (this.showSeachHeader) {
|
|
314
330
|
tmp.slots = {
|
|
315
|
-
header:
|
|
316
|
-
}
|
|
331
|
+
header: 'customSearchHeader'
|
|
332
|
+
}
|
|
317
333
|
}
|
|
318
|
-
this.dayCols.push(tmp)
|
|
334
|
+
this.dayCols.push(tmp)
|
|
319
335
|
|
|
320
|
-
let tempYearMonthCol = null
|
|
336
|
+
let tempYearMonthCol = null
|
|
321
337
|
for (let i = 0; i <= diffDays; i++) {
|
|
322
338
|
if (tempYearMonthCol === null) {
|
|
323
339
|
tempYearMonthCol = {
|
|
324
|
-
title: minDate.format(
|
|
325
|
-
field: minDate.format(
|
|
340
|
+
title: minDate.format('YYYY-MM'),
|
|
341
|
+
field: minDate.format('YYYY-MM'),
|
|
326
342
|
width: this.colWidth * splitCount
|
|
327
|
-
}
|
|
328
|
-
this.monthCols.push(tempYearMonthCol)
|
|
343
|
+
}
|
|
344
|
+
this.monthCols.push(tempYearMonthCol)
|
|
329
345
|
} else {
|
|
330
346
|
tempYearMonthCol.width =
|
|
331
|
-
|
|
347
|
+
tempYearMonthCol.width + this.colWidth * splitCount
|
|
332
348
|
}
|
|
333
349
|
|
|
334
350
|
//添加天数
|
|
335
351
|
let tempDayCol = {
|
|
336
|
-
title: minDate.format(
|
|
337
|
-
field: minDate.format(
|
|
352
|
+
title: minDate.format('YYYY年MM月DD日'),
|
|
353
|
+
field: minDate.format('YYYY-MM-DD'),
|
|
338
354
|
width: this.colWidth * splitCount,
|
|
339
|
-
align:
|
|
355
|
+
align: 'center',
|
|
340
356
|
slots: {
|
|
341
|
-
header:
|
|
357
|
+
header: 'dateWeekHeader'
|
|
342
358
|
},
|
|
343
359
|
params: {
|
|
344
|
-
date: minDate.format(
|
|
345
|
-
week: this.weekDay[minDate.format(
|
|
360
|
+
date: minDate.format('YYYY年MM月DD日'),
|
|
361
|
+
week: this.weekDay[minDate.format('E') - 1]
|
|
346
362
|
}
|
|
347
|
-
}
|
|
348
|
-
this.dayCols.push(tempDayCol)
|
|
363
|
+
}
|
|
364
|
+
this.dayCols.push(tempDayCol)
|
|
349
365
|
//添加小时
|
|
350
|
-
if (this.timeViewValue !==
|
|
366
|
+
if (this.timeViewValue !== 'day') {
|
|
351
367
|
for (let j = 0; j < splitCount; j++) {
|
|
352
|
-
let tempHour = j * this.splitHour
|
|
353
|
-
tempHour =
|
|
354
|
-
tempHour = tempHour.substr(tempHour.length - 2, 2)
|
|
355
|
-
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
|
|
356
372
|
this.hourCols.push({
|
|
357
|
-
field: minDate.format(
|
|
373
|
+
field: minDate.format('YYYY-MM-DD') + ' ' + tempHour + ':00:00',
|
|
358
374
|
title: tempHour,
|
|
359
375
|
width: this.colWidth
|
|
360
|
-
})
|
|
376
|
+
})
|
|
361
377
|
}
|
|
362
378
|
} else {
|
|
363
|
-
contentWidth = contentWidth + tempDayCol.width
|
|
379
|
+
contentWidth = contentWidth + tempDayCol.width
|
|
364
380
|
}
|
|
365
|
-
minDate.add(1,
|
|
366
|
-
if (minDate.format(
|
|
367
|
-
tempYearMonthCol = null
|
|
381
|
+
minDate.add(1, 'day')
|
|
382
|
+
if (minDate.format('YYYY-MM') !== tempYearMonthCol.field) {
|
|
383
|
+
tempYearMonthCol = null
|
|
368
384
|
}
|
|
369
385
|
}
|
|
370
|
-
let colLength = this.dayCols.length
|
|
386
|
+
let colLength = this.dayCols.length
|
|
371
387
|
// this.$refs.headMonth.reloadColumn(this.monthCols)
|
|
372
|
-
this.$refs.headDay.reloadColumn(this.dayCols)
|
|
373
|
-
if (this.timeViewValue !==
|
|
374
|
-
this.headerHeight = 160
|
|
375
|
-
colLength = this.hourCols.length
|
|
376
|
-
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)
|
|
377
393
|
} else {
|
|
378
|
-
this.headerHeight = 120
|
|
394
|
+
this.headerHeight = 120
|
|
379
395
|
}
|
|
380
396
|
for (let i = 0; i < colLength; i++) {
|
|
381
|
-
this.lines.push(i * this.colWidth)
|
|
397
|
+
this.lines.push(i * this.colWidth)
|
|
382
398
|
}
|
|
383
399
|
bodyCols.push({
|
|
384
|
-
field:
|
|
385
|
-
title:
|
|
400
|
+
field: 'content',
|
|
401
|
+
title: '内容',
|
|
386
402
|
width: contentWidth,
|
|
387
|
-
className:
|
|
403
|
+
className: 'custom-cell',
|
|
388
404
|
slots: {
|
|
389
|
-
default:
|
|
405
|
+
default: 'content'
|
|
390
406
|
}
|
|
391
|
-
})
|
|
392
|
-
this.$refs.bodyGrid.reloadColumn(bodyCols)
|
|
407
|
+
})
|
|
408
|
+
this.$refs.bodyGrid.reloadColumn(bodyCols)
|
|
393
409
|
// this.$refs.lineArea.style.marginLeft =
|
|
394
410
|
// ((this.fixedColWidth-this.colWidth)) + 'px'
|
|
395
411
|
},
|
|
396
412
|
loadData(rows) {
|
|
397
|
-
this.rows = rows
|
|
398
|
-
this.initContent()
|
|
413
|
+
this.rows = rows
|
|
414
|
+
this.initContent()
|
|
399
415
|
},
|
|
400
416
|
initContent() {
|
|
401
|
-
let splitMinutes = XEUtils.multiply(this.splitHour, 60)
|
|
402
|
-
let minDateTime = this.dateRange[0]
|
|
417
|
+
let splitMinutes = XEUtils.multiply(this.splitHour, 60)
|
|
418
|
+
let minDateTime = this.dateRange[0]
|
|
403
419
|
for (let i = 0; i < this.rows.length; i++) {
|
|
404
|
-
this.rows[i][
|
|
420
|
+
this.rows[i]['content'] = ''
|
|
405
421
|
for (let j = 0; j < this.rows[i].items.length; j++) {
|
|
406
422
|
let diffMiniutes = moment(this.rows[i].items[j].start).diff(
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
)
|
|
423
|
+
moment(minDateTime),
|
|
424
|
+
'minutes'
|
|
425
|
+
)
|
|
410
426
|
let tempLeft = XEUtils.divide(
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
)
|
|
427
|
+
XEUtils.multiply(this.colWidth, diffMiniutes),
|
|
428
|
+
splitMinutes
|
|
429
|
+
)
|
|
414
430
|
//计算左边距
|
|
415
|
-
this.rows[i].items[j][
|
|
431
|
+
this.rows[i].items[j]['left'] = tempLeft
|
|
416
432
|
//计算宽度
|
|
417
433
|
let ordMinutes = moment(this.rows[i].items[j].end).diff(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
)
|
|
434
|
+
moment(this.rows[i].items[j].start),
|
|
435
|
+
'minutes'
|
|
436
|
+
)
|
|
421
437
|
let tempWidth = XEUtils.divide(
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
)
|
|
425
|
-
this.rows[i].items[j][
|
|
438
|
+
XEUtils.multiply(this.colWidth, ordMinutes),
|
|
439
|
+
splitMinutes
|
|
440
|
+
)
|
|
441
|
+
this.rows[i].items[j]['width'] = tempWidth
|
|
426
442
|
}
|
|
427
443
|
}
|
|
428
|
-
this.lineHeight = this.rows.length * 40
|
|
429
|
-
this.$refs.bodyGrid.reloadData(this.rows)
|
|
444
|
+
this.lineHeight = this.rows.length * 40
|
|
445
|
+
this.$refs.bodyGrid.reloadData(this.rows)
|
|
430
446
|
},
|
|
431
447
|
ganttBarMouseEnter(evt, ordInfo, rowIndex) {
|
|
432
|
-
this.ganttBarTooltip.left = evt.clientX
|
|
448
|
+
this.ganttBarTooltip.left = evt.clientX //ordInfo.left + this.eqpWidth
|
|
433
449
|
this.ganttBarTooltip.top =
|
|
434
|
-
|
|
435
|
-
this.ganttBarTooltip.item = ordInfo
|
|
436
|
-
this.ganttBarTooltip.show = true
|
|
437
|
-
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)
|
|
438
454
|
},
|
|
439
455
|
ganttBarMouseLeave(evt, ordInfo) {
|
|
440
|
-
this.ganttBarTooltip.show = false
|
|
441
|
-
this.$emit(
|
|
456
|
+
this.ganttBarTooltip.show = false
|
|
457
|
+
this.$emit('mouseLeave',ordInfo)
|
|
442
458
|
},
|
|
443
459
|
bodyScroll(scrollInfo) {
|
|
444
460
|
if (scrollInfo.isX === true) {
|
|
@@ -446,27 +462,27 @@ export default {
|
|
|
446
462
|
// (scrollInfo.scrollLeft-(this.fixedColWidth-this.colWidth)) * -1 + 'px'
|
|
447
463
|
|
|
448
464
|
// this.$refs.headMonth.scrollTo(scrollInfo.scrollLeft)
|
|
449
|
-
this.$refs.headDay.scrollTo(scrollInfo.scrollLeft)
|
|
450
|
-
this.$refs.headHour.scrollTo(scrollInfo.scrollLeft)
|
|
465
|
+
this.$refs.headDay.scrollTo(scrollInfo.scrollLeft)
|
|
466
|
+
this.$refs.headHour.scrollTo(scrollInfo.scrollLeft)
|
|
451
467
|
}
|
|
452
468
|
},
|
|
453
469
|
setCurrentRow(row) {
|
|
454
|
-
this.$refs.bodyGrid.setCurrentRow(row)
|
|
470
|
+
this.$refs.bodyGrid.setCurrentRow(row)
|
|
455
471
|
},
|
|
456
472
|
getTableData() {
|
|
457
|
-
return this.$refs.bodyGrid.getTableData().fullData
|
|
473
|
+
return this.$refs.bodyGrid.getTableData().fullData
|
|
458
474
|
},
|
|
459
475
|
cellClick(scope) {
|
|
460
|
-
this.$emit(
|
|
476
|
+
this.$emit('cellClick', scope)
|
|
461
477
|
},
|
|
462
478
|
onSearch() {
|
|
463
|
-
this.$emit(
|
|
479
|
+
this.$emit('search', this.searchValue)
|
|
464
480
|
},
|
|
465
481
|
scrollRow(row) {
|
|
466
|
-
this.$refs.bodyGrid.scrollToRow(row)
|
|
482
|
+
this.$refs.bodyGrid.scrollToRow(row)
|
|
467
483
|
}
|
|
468
484
|
}
|
|
469
|
-
}
|
|
485
|
+
}
|
|
470
486
|
</script>
|
|
471
487
|
|
|
472
488
|
<style lang="scss">
|
|
@@ -478,10 +494,10 @@ export default {
|
|
|
478
494
|
padding-right: 0px !important;
|
|
479
495
|
}
|
|
480
496
|
.head-grid
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
497
|
+
.vxe-table
|
|
498
|
+
.vxe-table--render-wrapper
|
|
499
|
+
.vxe-table--main-wrapper
|
|
500
|
+
.vxe-table--body-wrapper {
|
|
485
501
|
height: 0px !important;
|
|
486
502
|
}
|
|
487
503
|
.head-grid .vxe-table .vxe-table--empty-content {
|