doway-coms 2.2.15 → 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 +221 -211
- 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,41 +217,34 @@ export default {
|
|
|
200
217
|
type: Function,
|
|
201
218
|
default: function() {}
|
|
202
219
|
},
|
|
203
|
-
treeConfig:
|
|
204
|
-
type: Object,
|
|
205
|
-
default: function() {
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
checkboxConfig: {
|
|
220
|
+
treeConfig:{
|
|
210
221
|
type: Object,
|
|
211
222
|
default: function() {
|
|
212
|
-
return null
|
|
223
|
+
return null
|
|
213
224
|
}
|
|
214
|
-
}
|
|
225
|
+
}
|
|
215
226
|
},
|
|
216
227
|
computed: {
|
|
217
228
|
computedHeight: function() {
|
|
218
|
-
return this.height - this.headerHeight
|
|
229
|
+
return this.height - this.headerHeight
|
|
219
230
|
}
|
|
220
231
|
},
|
|
221
232
|
mounted() {
|
|
233
|
+
|
|
222
234
|
let erd = resizeDetector({
|
|
223
|
-
strategy:
|
|
235
|
+
strategy: 'scroll'
|
|
224
236
|
});
|
|
225
|
-
let gridBodyDiv = this.$refs.bodyGrid.$el.getElementsByClassName(
|
|
226
|
-
|
|
227
|
-
)[0];
|
|
228
|
-
let vm = this;
|
|
237
|
+
let gridBodyDiv = this.$refs.bodyGrid.$el.getElementsByClassName('vxe-table--body')[0]
|
|
238
|
+
let vm = this
|
|
229
239
|
erd.listenTo(gridBodyDiv, () => {
|
|
230
|
-
|
|
240
|
+
vm.lineHeight = gridBodyDiv.clientHeight
|
|
231
241
|
});
|
|
232
|
-
this.timeViewValue = this.timeValue
|
|
242
|
+
this.timeViewValue = this.timeValue
|
|
233
243
|
},
|
|
234
244
|
created() {},
|
|
235
245
|
methods: {
|
|
236
|
-
toggleTreeExpand(scope)
|
|
237
|
-
|
|
246
|
+
toggleTreeExpand(scope){
|
|
247
|
+
// console.debug(this.$refs.bodyGrid.$el.getElementsByClassName('vxe-table--body')[0].clientHeight)
|
|
238
248
|
},
|
|
239
249
|
filterChangeEvent({ column }) {},
|
|
240
250
|
// headerDayCellStyle({ column, columnIndex }){
|
|
@@ -247,28 +257,28 @@ export default {
|
|
|
247
257
|
* 视图改变后初始化表头
|
|
248
258
|
*/
|
|
249
259
|
setLoading(b) {
|
|
250
|
-
this.loading = b
|
|
260
|
+
this.loading = b
|
|
251
261
|
},
|
|
252
262
|
timeViewChange() {
|
|
253
|
-
this.initHeaders(this.dateRange)
|
|
254
|
-
this.initContent()
|
|
263
|
+
this.initHeaders(this.dateRange)
|
|
264
|
+
this.initContent()
|
|
255
265
|
},
|
|
256
266
|
initHeaders(dateRange) {
|
|
257
|
-
this.dateRange = dateRange
|
|
258
|
-
let contentWidth = 0
|
|
259
|
-
let minDate = moment(this.dateRange[0])
|
|
260
|
-
let maxDate = moment(this.dateRange[1])
|
|
261
|
-
let splitCount = 1
|
|
262
|
-
let diffDays = maxDate.diff(minDate,
|
|
263
|
-
this.monthCols = []
|
|
264
|
-
this.dayCols = []
|
|
265
|
-
this.hourCols = []
|
|
266
|
-
this.lines = []
|
|
267
|
-
let bodyCols = []
|
|
268
|
-
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
|
|
269
279
|
for (let i = 0; i < this.leftCols.length; i++) {
|
|
270
|
-
if (this.leftCols[i].fixed ==
|
|
271
|
-
this.fixedColWidth = this.fixedColWidth + this.leftCols[i].width
|
|
280
|
+
if (this.leftCols[i].fixed == 'left') {
|
|
281
|
+
this.fixedColWidth = this.fixedColWidth + this.leftCols[i].width
|
|
272
282
|
}
|
|
273
283
|
let obj = {
|
|
274
284
|
field: this.leftCols[i].field,
|
|
@@ -277,15 +287,15 @@ export default {
|
|
|
277
287
|
width: this.leftCols[i].width
|
|
278
288
|
// filters:[{data:null}],
|
|
279
289
|
// filterRender:{name: 'input'}
|
|
280
|
-
}
|
|
281
|
-
if
|
|
282
|
-
obj[
|
|
290
|
+
}
|
|
291
|
+
if(this.leftCols[i].treeNode===true){
|
|
292
|
+
obj['treeNode'] = true
|
|
283
293
|
}
|
|
284
294
|
|
|
285
295
|
if (this.leftCols[i].slots) {
|
|
286
|
-
obj.slots = this.leftCols[i].slots
|
|
296
|
+
obj.slots = this.leftCols[i].slots
|
|
287
297
|
}
|
|
288
|
-
this.monthCols.push()
|
|
298
|
+
this.monthCols.push()
|
|
289
299
|
|
|
290
300
|
// tmp.filters=undefined
|
|
291
301
|
// tmp.filterRender=undefined
|
|
@@ -296,155 +306,155 @@ export default {
|
|
|
296
306
|
// this.dayCols.push(tmp)
|
|
297
307
|
// obj.filters=[{data:null}]
|
|
298
308
|
// obj.filterRender={name:'input'}
|
|
299
|
-
bodyCols.push(obj)
|
|
300
|
-
if (this.timeViewValue !==
|
|
301
|
-
this.splitHour = parseInt(this.timeViewValue)
|
|
302
|
-
this.hourCols.push(obj)
|
|
303
|
-
this.colWidth = 60
|
|
304
|
-
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
|
|
305
315
|
} else {
|
|
306
|
-
this.splitHour = 24
|
|
307
|
-
this.colWidth = 130
|
|
308
|
-
splitCount = 1
|
|
316
|
+
this.splitHour = 24
|
|
317
|
+
this.colWidth = 130
|
|
318
|
+
splitCount = 1
|
|
309
319
|
}
|
|
310
320
|
}
|
|
311
321
|
|
|
312
322
|
let tmp = {
|
|
313
|
-
type:
|
|
314
|
-
fixed:
|
|
315
|
-
title:
|
|
323
|
+
type: 'seq',
|
|
324
|
+
fixed: 'left',
|
|
325
|
+
title: '',
|
|
316
326
|
|
|
317
327
|
width: this.fixedColWidth
|
|
318
|
-
}
|
|
328
|
+
}
|
|
319
329
|
if (this.showSeachHeader) {
|
|
320
330
|
tmp.slots = {
|
|
321
|
-
header:
|
|
322
|
-
}
|
|
331
|
+
header: 'customSearchHeader'
|
|
332
|
+
}
|
|
323
333
|
}
|
|
324
|
-
this.dayCols.push(tmp)
|
|
334
|
+
this.dayCols.push(tmp)
|
|
325
335
|
|
|
326
|
-
let tempYearMonthCol = null
|
|
336
|
+
let tempYearMonthCol = null
|
|
327
337
|
for (let i = 0; i <= diffDays; i++) {
|
|
328
338
|
if (tempYearMonthCol === null) {
|
|
329
339
|
tempYearMonthCol = {
|
|
330
|
-
title: minDate.format(
|
|
331
|
-
field: minDate.format(
|
|
340
|
+
title: minDate.format('YYYY-MM'),
|
|
341
|
+
field: minDate.format('YYYY-MM'),
|
|
332
342
|
width: this.colWidth * splitCount
|
|
333
|
-
}
|
|
334
|
-
this.monthCols.push(tempYearMonthCol)
|
|
343
|
+
}
|
|
344
|
+
this.monthCols.push(tempYearMonthCol)
|
|
335
345
|
} else {
|
|
336
346
|
tempYearMonthCol.width =
|
|
337
|
-
|
|
347
|
+
tempYearMonthCol.width + this.colWidth * splitCount
|
|
338
348
|
}
|
|
339
349
|
|
|
340
350
|
//添加天数
|
|
341
351
|
let tempDayCol = {
|
|
342
|
-
title: minDate.format(
|
|
343
|
-
field: minDate.format(
|
|
352
|
+
title: minDate.format('YYYY年MM月DD日'),
|
|
353
|
+
field: minDate.format('YYYY-MM-DD'),
|
|
344
354
|
width: this.colWidth * splitCount,
|
|
345
|
-
align:
|
|
355
|
+
align: 'center',
|
|
346
356
|
slots: {
|
|
347
|
-
header:
|
|
357
|
+
header: 'dateWeekHeader'
|
|
348
358
|
},
|
|
349
359
|
params: {
|
|
350
|
-
date: minDate.format(
|
|
351
|
-
week: this.weekDay[minDate.format(
|
|
360
|
+
date: minDate.format('YYYY年MM月DD日'),
|
|
361
|
+
week: this.weekDay[minDate.format('E') - 1]
|
|
352
362
|
}
|
|
353
|
-
}
|
|
354
|
-
this.dayCols.push(tempDayCol)
|
|
363
|
+
}
|
|
364
|
+
this.dayCols.push(tempDayCol)
|
|
355
365
|
//添加小时
|
|
356
|
-
if (this.timeViewValue !==
|
|
366
|
+
if (this.timeViewValue !== 'day') {
|
|
357
367
|
for (let j = 0; j < splitCount; j++) {
|
|
358
|
-
let tempHour = j * this.splitHour
|
|
359
|
-
tempHour =
|
|
360
|
-
tempHour = tempHour.substr(tempHour.length - 2, 2)
|
|
361
|
-
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
|
|
362
372
|
this.hourCols.push({
|
|
363
|
-
field: minDate.format(
|
|
373
|
+
field: minDate.format('YYYY-MM-DD') + ' ' + tempHour + ':00:00',
|
|
364
374
|
title: tempHour,
|
|
365
375
|
width: this.colWidth
|
|
366
|
-
})
|
|
376
|
+
})
|
|
367
377
|
}
|
|
368
378
|
} else {
|
|
369
|
-
contentWidth = contentWidth + tempDayCol.width
|
|
379
|
+
contentWidth = contentWidth + tempDayCol.width
|
|
370
380
|
}
|
|
371
|
-
minDate.add(1,
|
|
372
|
-
if (minDate.format(
|
|
373
|
-
tempYearMonthCol = null
|
|
381
|
+
minDate.add(1, 'day')
|
|
382
|
+
if (minDate.format('YYYY-MM') !== tempYearMonthCol.field) {
|
|
383
|
+
tempYearMonthCol = null
|
|
374
384
|
}
|
|
375
385
|
}
|
|
376
|
-
let colLength = this.dayCols.length
|
|
386
|
+
let colLength = this.dayCols.length
|
|
377
387
|
// this.$refs.headMonth.reloadColumn(this.monthCols)
|
|
378
|
-
this.$refs.headDay.reloadColumn(this.dayCols)
|
|
379
|
-
if (this.timeViewValue !==
|
|
380
|
-
this.headerHeight = 160
|
|
381
|
-
colLength = this.hourCols.length
|
|
382
|
-
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)
|
|
383
393
|
} else {
|
|
384
|
-
this.headerHeight = 120
|
|
394
|
+
this.headerHeight = 120
|
|
385
395
|
}
|
|
386
396
|
for (let i = 0; i < colLength; i++) {
|
|
387
|
-
this.lines.push(i * this.colWidth)
|
|
397
|
+
this.lines.push(i * this.colWidth)
|
|
388
398
|
}
|
|
389
399
|
bodyCols.push({
|
|
390
|
-
field:
|
|
391
|
-
title:
|
|
400
|
+
field: 'content',
|
|
401
|
+
title: '内容',
|
|
392
402
|
width: contentWidth,
|
|
393
|
-
className:
|
|
403
|
+
className: 'custom-cell',
|
|
394
404
|
slots: {
|
|
395
|
-
default:
|
|
405
|
+
default: 'content'
|
|
396
406
|
}
|
|
397
|
-
})
|
|
398
|
-
this.$refs.bodyGrid.reloadColumn(bodyCols)
|
|
407
|
+
})
|
|
408
|
+
this.$refs.bodyGrid.reloadColumn(bodyCols)
|
|
399
409
|
// this.$refs.lineArea.style.marginLeft =
|
|
400
410
|
// ((this.fixedColWidth-this.colWidth)) + 'px'
|
|
401
411
|
},
|
|
402
412
|
loadData(rows) {
|
|
403
|
-
this.rows = rows
|
|
404
|
-
this.initContent()
|
|
413
|
+
this.rows = rows
|
|
414
|
+
this.initContent()
|
|
405
415
|
},
|
|
406
416
|
initContent() {
|
|
407
|
-
let splitMinutes = XEUtils.multiply(this.splitHour, 60)
|
|
408
|
-
let minDateTime = this.dateRange[0]
|
|
417
|
+
let splitMinutes = XEUtils.multiply(this.splitHour, 60)
|
|
418
|
+
let minDateTime = this.dateRange[0]
|
|
409
419
|
for (let i = 0; i < this.rows.length; i++) {
|
|
410
|
-
this.rows[i][
|
|
420
|
+
this.rows[i]['content'] = ''
|
|
411
421
|
for (let j = 0; j < this.rows[i].items.length; j++) {
|
|
412
422
|
let diffMiniutes = moment(this.rows[i].items[j].start).diff(
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
)
|
|
423
|
+
moment(minDateTime),
|
|
424
|
+
'minutes'
|
|
425
|
+
)
|
|
416
426
|
let tempLeft = XEUtils.divide(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
)
|
|
427
|
+
XEUtils.multiply(this.colWidth, diffMiniutes),
|
|
428
|
+
splitMinutes
|
|
429
|
+
)
|
|
420
430
|
//计算左边距
|
|
421
|
-
this.rows[i].items[j][
|
|
431
|
+
this.rows[i].items[j]['left'] = tempLeft
|
|
422
432
|
//计算宽度
|
|
423
433
|
let ordMinutes = moment(this.rows[i].items[j].end).diff(
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
)
|
|
434
|
+
moment(this.rows[i].items[j].start),
|
|
435
|
+
'minutes'
|
|
436
|
+
)
|
|
427
437
|
let tempWidth = XEUtils.divide(
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
)
|
|
431
|
-
this.rows[i].items[j][
|
|
438
|
+
XEUtils.multiply(this.colWidth, ordMinutes),
|
|
439
|
+
splitMinutes
|
|
440
|
+
)
|
|
441
|
+
this.rows[i].items[j]['width'] = tempWidth
|
|
432
442
|
}
|
|
433
443
|
}
|
|
434
|
-
this.lineHeight = this.rows.length * 40
|
|
435
|
-
this.$refs.bodyGrid.reloadData(this.rows)
|
|
444
|
+
this.lineHeight = this.rows.length * 40
|
|
445
|
+
this.$refs.bodyGrid.reloadData(this.rows)
|
|
436
446
|
},
|
|
437
447
|
ganttBarMouseEnter(evt, ordInfo, rowIndex) {
|
|
438
|
-
this.ganttBarTooltip.left = evt.clientX
|
|
448
|
+
this.ganttBarTooltip.left = evt.clientX //ordInfo.left + this.eqpWidth
|
|
439
449
|
this.ganttBarTooltip.top =
|
|
440
|
-
|
|
441
|
-
this.ganttBarTooltip.item = ordInfo
|
|
442
|
-
this.ganttBarTooltip.show = true
|
|
443
|
-
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)
|
|
444
454
|
},
|
|
445
455
|
ganttBarMouseLeave(evt, ordInfo) {
|
|
446
|
-
this.ganttBarTooltip.show = false
|
|
447
|
-
this.$emit(
|
|
456
|
+
this.ganttBarTooltip.show = false
|
|
457
|
+
this.$emit('mouseLeave',ordInfo)
|
|
448
458
|
},
|
|
449
459
|
bodyScroll(scrollInfo) {
|
|
450
460
|
if (scrollInfo.isX === true) {
|
|
@@ -452,27 +462,27 @@ export default {
|
|
|
452
462
|
// (scrollInfo.scrollLeft-(this.fixedColWidth-this.colWidth)) * -1 + 'px'
|
|
453
463
|
|
|
454
464
|
// this.$refs.headMonth.scrollTo(scrollInfo.scrollLeft)
|
|
455
|
-
this.$refs.headDay.scrollTo(scrollInfo.scrollLeft)
|
|
456
|
-
this.$refs.headHour.scrollTo(scrollInfo.scrollLeft)
|
|
465
|
+
this.$refs.headDay.scrollTo(scrollInfo.scrollLeft)
|
|
466
|
+
this.$refs.headHour.scrollTo(scrollInfo.scrollLeft)
|
|
457
467
|
}
|
|
458
468
|
},
|
|
459
469
|
setCurrentRow(row) {
|
|
460
|
-
this.$refs.bodyGrid.setCurrentRow(row)
|
|
470
|
+
this.$refs.bodyGrid.setCurrentRow(row)
|
|
461
471
|
},
|
|
462
472
|
getTableData() {
|
|
463
|
-
return this.$refs.bodyGrid.getTableData().fullData
|
|
473
|
+
return this.$refs.bodyGrid.getTableData().fullData
|
|
464
474
|
},
|
|
465
475
|
cellClick(scope) {
|
|
466
|
-
this.$emit(
|
|
476
|
+
this.$emit('cellClick', scope)
|
|
467
477
|
},
|
|
468
478
|
onSearch() {
|
|
469
|
-
this.$emit(
|
|
479
|
+
this.$emit('search', this.searchValue)
|
|
470
480
|
},
|
|
471
481
|
scrollRow(row) {
|
|
472
|
-
this.$refs.bodyGrid.scrollToRow(row)
|
|
482
|
+
this.$refs.bodyGrid.scrollToRow(row)
|
|
473
483
|
}
|
|
474
484
|
}
|
|
475
|
-
}
|
|
485
|
+
}
|
|
476
486
|
</script>
|
|
477
487
|
|
|
478
488
|
<style lang="scss">
|
|
@@ -484,10 +494,10 @@ export default {
|
|
|
484
494
|
padding-right: 0px !important;
|
|
485
495
|
}
|
|
486
496
|
.head-grid
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
497
|
+
.vxe-table
|
|
498
|
+
.vxe-table--render-wrapper
|
|
499
|
+
.vxe-table--main-wrapper
|
|
500
|
+
.vxe-table--body-wrapper {
|
|
491
501
|
height: 0px !important;
|
|
492
502
|
}
|
|
493
503
|
.head-grid .vxe-table .vxe-table--empty-content {
|