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