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