doway-coms 1.6.39 → 1.6.40
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 +1 -1
- package/packages/BaseGridAdjust/src/index.vue +324 -297
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:loading="adjustGridLoading"
|
|
7
7
|
@resizable-change="resizableChange"
|
|
8
8
|
:filter-config="{
|
|
9
|
-
remote: true
|
|
9
|
+
remote: true,
|
|
10
10
|
}"
|
|
11
11
|
:sort-config="{
|
|
12
12
|
multiple: true,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<template #empty>
|
|
21
21
|
<div>拖拽调整字段位置或者宽度</div>
|
|
22
22
|
</template>
|
|
23
|
-
<!-- 是否显示字段 -->
|
|
23
|
+
<!-- 是否显示字段 -->
|
|
24
24
|
<template #checkbox="{ column }">
|
|
25
25
|
<a-checkbox
|
|
26
26
|
v-model="column.params.show"
|
|
@@ -29,244 +29,259 @@
|
|
|
29
29
|
{{ column.title }}
|
|
30
30
|
</template>
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
<!-- 筛选过滤 -->
|
|
33
|
+
<template #text_filter="scope">
|
|
34
|
+
<div class="interceptor-class">
|
|
35
|
+
<div
|
|
36
|
+
:class="scope.column.field + '_filter_' + $index"
|
|
37
|
+
v-for="(loopFilterValue, $index) in scope.column.filters[0].data
|
|
38
38
|
.displayValues"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
:key="$index"
|
|
40
|
+
>
|
|
41
|
+
<a-input
|
|
42
|
+
allowClear
|
|
43
|
+
v-model="loopFilterValue.value[0]"
|
|
44
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
<a-button @click="filterAddExp(scope.column)">添加条件</a-button>
|
|
48
|
+
<a-button @click="filterConfirm(scope.column)">确认</a-button>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
<template #customCell_filter="scope">
|
|
52
|
+
<div class="interceptor-class">
|
|
53
|
+
<div
|
|
54
|
+
:class="scope.column.field + '_filter_' + $index"
|
|
55
|
+
v-for="(loopFilterValue, $index) in scope.column.filters[0].data
|
|
52
56
|
.displayValues"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
:key="$index"
|
|
58
|
+
>
|
|
59
|
+
<a-input
|
|
60
|
+
allowClear
|
|
61
|
+
v-model="loopFilterValue.value[0]"
|
|
62
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
<a-button @click="filterAddExp(scope.column)">添加条件</a-button>
|
|
66
|
+
<a-button @click="filterConfirm(scope.column)">确认</a-button>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<template #pulldown_filter="scope">
|
|
70
|
+
<div class="interceptor-class">
|
|
71
|
+
<div
|
|
72
|
+
:class="scope.column.field + '_filter_' + $index"
|
|
73
|
+
v-for="(loopFilterValue, $index) in scope.column.filters[0].data
|
|
66
74
|
.displayValues"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
:key="$index"
|
|
76
|
+
>
|
|
77
|
+
<a-input
|
|
78
|
+
allowClear
|
|
79
|
+
v-model="loopFilterValue.value[0]"
|
|
80
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<a-button @click="filterAddExp(scope.column)">添加条件</a-button>
|
|
84
|
+
<a-button @click="filterConfirm(scope.column)">确认</a-button>
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
<template #number_filter="scope">
|
|
88
|
+
<div class="interceptor-class">
|
|
89
|
+
<div
|
|
90
|
+
:class="scope.column.field + '_filter_' + $index"
|
|
91
|
+
v-for="(loopFilterValue, $index) in scope.column.filters[0].data
|
|
80
92
|
.displayValues"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
93
|
+
:key="$index"
|
|
94
|
+
>
|
|
95
|
+
<a-input-number
|
|
96
|
+
:precision="0"
|
|
97
|
+
size="small"
|
|
98
|
+
v-model="loopFilterValue.value[0]"
|
|
99
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
100
|
+
/>~
|
|
101
|
+
<a-input-number
|
|
102
|
+
:precision="0"
|
|
103
|
+
size="small"
|
|
104
|
+
v-model="loopFilterValue.value[1]"
|
|
105
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
<a-button @click="filterAddExp(scope.column)">添加条件</a-button>
|
|
109
|
+
<a-button @click="filterConfirm(scope.column)">确认</a-button>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
<template #select_filter="scope">
|
|
113
|
+
<div class="interceptor-class">
|
|
114
|
+
<a-checkbox-group
|
|
115
|
+
v-model="scope.column.filters[0].data.displayValues"
|
|
116
|
+
:style="{
|
|
117
|
+
display: 'flex',
|
|
118
|
+
flexWrap: 'wrap',
|
|
119
|
+
justifyContent: 'left',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
maxHeight: '150px',
|
|
122
|
+
overflow: 'auto',
|
|
123
|
+
maxWidth: '100px',
|
|
124
|
+
}"
|
|
125
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
126
|
+
>
|
|
127
|
+
<br />
|
|
128
|
+
<a-checkbox
|
|
129
|
+
v-for="loopSource in scope.column.params.dataSource"
|
|
130
|
+
:key="loopSource.value"
|
|
131
|
+
:value="loopSource.value"
|
|
132
|
+
style="margin: 5px 0"
|
|
133
|
+
>{{ loopSource.caption }}
|
|
134
|
+
</a-checkbox>
|
|
135
|
+
</a-checkbox-group>
|
|
136
|
+
<!-- <a-select-->
|
|
137
|
+
<!-- v-model="scope.column.filters[0].data.displayValues"-->
|
|
138
|
+
<!-- mode="multiple"-->
|
|
139
|
+
<!-- allowClear-->
|
|
140
|
+
<!-- style="width: 300px;"-->
|
|
141
|
+
<!-- placeholder="筛选条件"-->
|
|
142
|
+
<!-- showArrow-->
|
|
143
|
+
<!-- >-->
|
|
144
|
+
<!-- <a-select-option-->
|
|
145
|
+
<!-- v-for="loopSource in scope.column.params.dataSource"-->
|
|
146
|
+
<!-- :key="loopSource.value"-->
|
|
147
|
+
<!-- :value="loopSource.value"-->
|
|
148
|
+
<!-- >{{ loopSource.caption }}</a-select-option-->
|
|
149
|
+
<!-- >-->
|
|
150
|
+
<!-- </a-select>-->
|
|
151
|
+
<br />
|
|
152
|
+
<a-button @click="filterConfirm(scope.column)">确认</a-button>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
<template #datetime_filter="scope">
|
|
156
|
+
<div class="interceptor-class">
|
|
157
|
+
<div
|
|
158
|
+
:class="scope.column.field + '_filter_' + $index"
|
|
159
|
+
v-for="(loopFilterValue, $index) in scope.column.filters[0].data
|
|
148
160
|
.displayValues"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
161
|
+
:key="$index"
|
|
162
|
+
>
|
|
163
|
+
<a-date-picker
|
|
164
|
+
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
165
|
+
format="YYYY-MM-DD HH:mm:ss"
|
|
166
|
+
:show-time="{
|
|
155
167
|
defaultValue: moment(
|
|
156
168
|
'2000-01-01 00:00:00',
|
|
157
169
|
'YYYY-MM-DD HH:mm:ss'
|
|
158
170
|
),
|
|
159
171
|
}"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
placeholder="开始时间"
|
|
173
|
+
v-model="loopFilterValue.value[0]"
|
|
174
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
175
|
+
/>
|
|
176
|
+
<a-date-picker
|
|
177
|
+
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
178
|
+
format="YYYY-MM-DD HH:mm:ss"
|
|
179
|
+
:show-time="{
|
|
168
180
|
defaultValue: moment(
|
|
169
181
|
'2000-01-01 23:59:59',
|
|
170
182
|
'YYYY-MM-DD HH:mm:ss'
|
|
171
183
|
),
|
|
172
184
|
}"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
placeholder="结束时间"
|
|
186
|
+
v-model="loopFilterValue.value[1]"
|
|
187
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
<a-button @click="filterAddExp(scope.column)">添加条件</a-button>
|
|
191
|
+
<a-button @click="filterConfirm(scope.column)">确认</a-button>
|
|
192
|
+
</div>
|
|
193
|
+
</template>
|
|
194
|
+
<template #date_filter="scope">
|
|
195
|
+
<div class="interceptor-class">
|
|
196
|
+
<div
|
|
197
|
+
:class="scope.column.field + '_filter_' + $index"
|
|
198
|
+
v-for="(loopFilterValue, $index) in scope.column.filters[0].data
|
|
187
199
|
.displayValues"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
:key="$index"
|
|
201
|
+
>
|
|
202
|
+
<a-range-picker
|
|
203
|
+
v-model:value="loopFilterValue.value"
|
|
204
|
+
valueFormat="YYYY-MM-DD"
|
|
205
|
+
format="YYYY-MM-DD"
|
|
206
|
+
@keyup.enter.native="filterConfirm(scope.column)"
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
<a-button @click="filterAddExp(scope.column)">添加条件</a-button>
|
|
210
|
+
<a-button @click="filterConfirm(scope.column)">确认</a-button>
|
|
211
|
+
</div>
|
|
212
|
+
</template>
|
|
201
213
|
</vxe-grid>
|
|
202
214
|
</div>
|
|
203
215
|
</template>
|
|
204
216
|
<script>
|
|
205
|
-
import Sortable from
|
|
206
|
-
import VXETable from
|
|
217
|
+
import Sortable from "sortablejs";
|
|
218
|
+
import VXETable from "vxe-table";
|
|
207
219
|
import XEUtils from "xe-utils";
|
|
208
220
|
import { controlType } from "../../utils/enum";
|
|
209
221
|
|
|
210
222
|
export default {
|
|
211
|
-
props:{
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
},
|
|
223
|
+
props: {
|
|
224
|
+
userDefineColumns: {
|
|
225
|
+
type: Array,
|
|
226
|
+
default: function () {
|
|
227
|
+
return [];
|
|
217
228
|
},
|
|
229
|
+
},
|
|
218
230
|
},
|
|
219
231
|
created() {
|
|
220
|
-
this.adjustUserDefineColumns = this.userDefineColumns
|
|
221
|
-
this.adjustUserDefineColumns.forEach(item => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
})
|
|
228
|
-
this.adjustGridOptions.columns = []
|
|
229
|
-
this.adjustUserDefineColumns.forEach(item => {
|
|
230
|
-
if (item.field ===
|
|
231
|
-
|
|
232
|
+
this.adjustUserDefineColumns = this.userDefineColumns;
|
|
233
|
+
this.adjustUserDefineColumns.forEach((item) => {
|
|
234
|
+
if (item.visible) {
|
|
235
|
+
this.$set(item, "show", true);
|
|
236
|
+
} else {
|
|
237
|
+
this.$set(item, "show", false);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
this.adjustGridOptions.columns = [];
|
|
241
|
+
this.adjustUserDefineColumns.forEach((item) => {
|
|
242
|
+
if (item.field === "operation") {
|
|
243
|
+
return;
|
|
232
244
|
}
|
|
233
245
|
|
|
234
246
|
const column = {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
this.$set(column.params,
|
|
257
|
-
this.adjustGridOptions.columns.push(column)
|
|
258
|
-
})
|
|
247
|
+
field: item.field,
|
|
248
|
+
title: item.title,
|
|
249
|
+
slots: {
|
|
250
|
+
header: "checkbox",
|
|
251
|
+
filter: item.slots.filter,
|
|
252
|
+
},
|
|
253
|
+
params: item.params,
|
|
254
|
+
width: item.width,
|
|
255
|
+
filters: item.filters,
|
|
256
|
+
sortable: item.sortable,
|
|
257
|
+
filterResetMethod: ({ options, column }) => {
|
|
258
|
+
column.filters = [
|
|
259
|
+
{
|
|
260
|
+
data: {
|
|
261
|
+
bindingValues: [],
|
|
262
|
+
displayValues: [],
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
];
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
this.$set(column.params, "show", item.show);
|
|
269
|
+
this.adjustGridOptions.columns.push(column);
|
|
270
|
+
});
|
|
259
271
|
},
|
|
260
272
|
mounted() {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
273
|
+
this.$refs.adjustGrid.getTableColumn().collectColumn.forEach((item) => {
|
|
274
|
+
const find = XEUtils.find(
|
|
275
|
+
this.adjustUserDefineColumns,
|
|
276
|
+
(innerItem) => item.field === innerItem.field
|
|
277
|
+
);
|
|
278
|
+
item.order = find.order;
|
|
279
|
+
});
|
|
280
|
+
this.columnDrop(this.adjustUserDefineColumns);
|
|
266
281
|
},
|
|
267
282
|
beforeDestroy() {
|
|
268
283
|
if (this.sortable) {
|
|
269
|
-
this.sortable.destroy()
|
|
284
|
+
this.sortable.destroy();
|
|
270
285
|
}
|
|
271
286
|
},
|
|
272
287
|
data() {
|
|
@@ -284,154 +299,166 @@ export default {
|
|
|
284
299
|
],
|
|
285
300
|
],
|
|
286
301
|
},
|
|
287
|
-
enabled:true
|
|
302
|
+
enabled: true,
|
|
288
303
|
},
|
|
289
304
|
adjustGridLoading: false,
|
|
290
305
|
adjustUserDefineColumns: null,
|
|
291
306
|
adjustGridOptions: {
|
|
292
307
|
border: true,
|
|
293
|
-
class:
|
|
308
|
+
class: "sortable-column-demo",
|
|
294
309
|
columnConfig: {
|
|
295
310
|
useKey: true,
|
|
296
|
-
resizable: true
|
|
311
|
+
resizable: true,
|
|
297
312
|
},
|
|
298
313
|
scrollX: {
|
|
299
|
-
enabled: false
|
|
314
|
+
enabled: false,
|
|
300
315
|
},
|
|
301
316
|
columns: [],
|
|
302
|
-
data: []
|
|
303
|
-
}
|
|
304
|
-
}
|
|
317
|
+
data: [],
|
|
318
|
+
},
|
|
319
|
+
};
|
|
305
320
|
},
|
|
306
321
|
|
|
307
322
|
methods: {
|
|
308
323
|
changeCheckbox(val) {
|
|
309
|
-
const find = XEUtils.find(
|
|
310
|
-
|
|
324
|
+
const find = XEUtils.find(
|
|
325
|
+
this.$refs.adjustGrid.getTableColumn().collectColumn,
|
|
326
|
+
(item) => item.field === val.field
|
|
327
|
+
);
|
|
328
|
+
find.visible = val.params.show;
|
|
311
329
|
},
|
|
312
330
|
//右键菜单事件
|
|
313
331
|
contextMenuClickEvent({ menu, row, column }) {
|
|
314
332
|
const $table = this.$refs.adjustGrid;
|
|
315
333
|
switch (menu.code) {
|
|
316
|
-
case
|
|
334
|
+
case "clearFilter":
|
|
317
335
|
const filterList = this.$refs.adjustGrid.getCheckedFilters();
|
|
318
336
|
filterList.forEach((col) => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
337
|
+
this.getTableColumn().forEach((column) => {
|
|
338
|
+
if (column.field == col.property) {
|
|
339
|
+
this.$set(column.filters[0].data, "displayValues", []);
|
|
340
|
+
this.$set(column.filters[0].data, "bindingValues", []);
|
|
341
|
+
this.$refs.adjustGrid.clearFilter(column);
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
//这个col和 internalColumn之间没有绑定上
|
|
345
|
+
col.column.filters = [
|
|
346
|
+
{
|
|
347
|
+
data: {
|
|
348
|
+
bindingValues: [],
|
|
349
|
+
displayValues: [],
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
];
|
|
335
353
|
});
|
|
336
354
|
// this.$refs.adjustGrid.clearFilter()
|
|
337
355
|
// .then(res=>{
|
|
338
356
|
// console.log('a',this.$refs.adjustGrid.getCheckedFilters())
|
|
339
357
|
// console.log('b',this.getTableColumn())
|
|
340
358
|
// })
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
break
|
|
359
|
+
// XEUtils.clear(this.filterExpression)
|
|
360
|
+
// vm.$emit("filterChange");
|
|
361
|
+
break;
|
|
344
362
|
}
|
|
345
363
|
},
|
|
346
364
|
resizableChange($rowIndex) {
|
|
347
|
-
|
|
365
|
+
this.$refs.adjustGrid.getTableColumn().collectColumn.forEach((item) => {
|
|
348
366
|
if (item.field === $rowIndex.column.field) {
|
|
349
|
-
item.width = $rowIndex.column.resizeWidth
|
|
367
|
+
item.width = $rowIndex.column.resizeWidth;
|
|
350
368
|
}
|
|
351
|
-
})
|
|
369
|
+
});
|
|
352
370
|
},
|
|
353
371
|
columnDrop() {
|
|
354
372
|
this.$nextTick(() => {
|
|
355
|
-
this.adjustGridLoading = true
|
|
356
|
-
const $table = this.$refs.adjustGrid
|
|
373
|
+
this.adjustGridLoading = true;
|
|
374
|
+
const $table = this.$refs.adjustGrid;
|
|
357
375
|
this.sortable = Sortable.create(
|
|
358
376
|
$table.$el.querySelector(
|
|
359
|
-
|
|
377
|
+
".body--wrapper>.vxe-table--header .vxe-header--row"
|
|
360
378
|
),
|
|
361
379
|
{
|
|
362
|
-
handle:
|
|
380
|
+
handle: ".vxe-header--column",
|
|
363
381
|
onEnd: ({ item, newIndex, oldIndex }) => {
|
|
364
|
-
const { fullColumn, tableColumn } = $table.getTableColumn()
|
|
365
|
-
const targetThElem = item
|
|
366
|
-
const wrapperElem = targetThElem.parentNode
|
|
367
|
-
const newColumn = fullColumn[newIndex]
|
|
382
|
+
const { fullColumn, tableColumn } = $table.getTableColumn();
|
|
383
|
+
const targetThElem = item;
|
|
384
|
+
const wrapperElem = targetThElem.parentNode;
|
|
385
|
+
const newColumn = fullColumn[newIndex];
|
|
368
386
|
if (newColumn.fixed) {
|
|
369
|
-
const oldThElem = wrapperElem.children[oldIndex]
|
|
387
|
+
const oldThElem = wrapperElem.children[oldIndex];
|
|
370
388
|
// 错误的移动
|
|
371
389
|
if (newIndex > oldIndex) {
|
|
372
|
-
wrapperElem.insertBefore(targetThElem, oldThElem)
|
|
390
|
+
wrapperElem.insertBefore(targetThElem, oldThElem);
|
|
373
391
|
} else {
|
|
374
392
|
wrapperElem.insertBefore(
|
|
375
393
|
targetThElem,
|
|
376
394
|
oldThElem ? oldThElem.nextElementSibling : oldThElem
|
|
377
|
-
)
|
|
395
|
+
);
|
|
378
396
|
}
|
|
379
397
|
VXETable.modal.message({
|
|
380
|
-
content:
|
|
381
|
-
status:
|
|
382
|
-
})
|
|
383
|
-
return
|
|
398
|
+
content: "固定列不允许拖动,即将还原操作!",
|
|
399
|
+
status: "error",
|
|
400
|
+
});
|
|
401
|
+
return;
|
|
384
402
|
}
|
|
385
403
|
// 获取列索引 columnIndex > fullColumn
|
|
386
404
|
const oldColumnIndex = $table.getColumnIndex(
|
|
387
405
|
tableColumn[oldIndex]
|
|
388
|
-
)
|
|
406
|
+
);
|
|
389
407
|
const newColumnIndex = $table.getColumnIndex(
|
|
390
408
|
tableColumn[newIndex]
|
|
391
|
-
)
|
|
409
|
+
);
|
|
392
410
|
// 移动到目标列
|
|
393
|
-
const currRow = fullColumn.splice(oldColumnIndex, 1)[0]
|
|
394
|
-
fullColumn.splice(newColumnIndex, 0, currRow)
|
|
395
|
-
$table.loadColumn(fullColumn)
|
|
396
|
-
this.adjustUserDefineColumns = fullColumn
|
|
397
|
-
}
|
|
411
|
+
const currRow = fullColumn.splice(oldColumnIndex, 1)[0];
|
|
412
|
+
fullColumn.splice(newColumnIndex, 0, currRow);
|
|
413
|
+
$table.loadColumn(fullColumn);
|
|
414
|
+
this.adjustUserDefineColumns = fullColumn;
|
|
415
|
+
},
|
|
398
416
|
}
|
|
399
|
-
)
|
|
400
|
-
this.adjustGridLoading = false
|
|
401
|
-
})
|
|
417
|
+
);
|
|
418
|
+
this.adjustGridLoading = false;
|
|
419
|
+
});
|
|
402
420
|
},
|
|
403
421
|
filterAddExp(colInfo) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
422
|
+
colInfo.filters[0].data.displayValues.push({
|
|
423
|
+
value: [null, null],
|
|
424
|
+
});
|
|
407
425
|
},
|
|
408
426
|
filterConfirm(colInfo) {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
colInfo.filters[0].data.bindingValues.
|
|
425
|
-
|
|
427
|
+
let col = this.adjustUserDefineColumns.find(
|
|
428
|
+
(x) => x.field === colInfo.property
|
|
429
|
+
);
|
|
430
|
+
this.$set(col.filters[0].data, "bindingValues", []);
|
|
431
|
+
colInfo.filters[0].data.bindingValues = [];
|
|
432
|
+
XEUtils.arrayEach(colInfo.filters[0].data.displayValues, (item) => {
|
|
433
|
+
if (colInfo.params.controlType === controlType.select) {
|
|
434
|
+
colInfo.filters[0].data.bindingValues.push(item);
|
|
435
|
+
this.$set(
|
|
436
|
+
col.filters[0].data,
|
|
437
|
+
"bindingValues",
|
|
438
|
+
colInfo.filters[0].data.bindingValues
|
|
439
|
+
);
|
|
440
|
+
} else {
|
|
441
|
+
if (item.value[0] || item.value[1]) {
|
|
442
|
+
colInfo.filters[0].data.bindingValues.push(item);
|
|
443
|
+
this.$set(
|
|
444
|
+
col.filters[0].data,
|
|
445
|
+
"bindingValues",
|
|
446
|
+
colInfo.filters[0].data.bindingValues
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
colInfo.filters[0].checked =
|
|
452
|
+
colInfo.filters[0].data.bindingValues.length > 0;
|
|
453
|
+
this.$refs.adjustGrid.closeFilter();
|
|
426
454
|
},
|
|
427
455
|
getTableColumn() {
|
|
428
|
-
|
|
456
|
+
return this.$refs.adjustGrid.getTableColumn().collectColumn;
|
|
429
457
|
},
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
458
|
+
},
|
|
459
|
+
};
|
|
433
460
|
</script>
|
|
434
|
-
<style scoped>
|
|
461
|
+
<style scoped lang="less">
|
|
435
462
|
.sortable-column-demo .vxe-header--row .vxe-header--column.sortable-ghost,
|
|
436
463
|
.sortable-column-demo .vxe-header--row .vxe-header--column.sortable-chosen {
|
|
437
464
|
background-color: #dfecfb;
|
|
@@ -441,15 +468,15 @@ export default {
|
|
|
441
468
|
}
|
|
442
469
|
|
|
443
470
|
.interceptor-class {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
471
|
+
padding: 10px;
|
|
472
|
+
::v-deep .ant-btn {
|
|
473
|
+
margin: 10px 10px 0;
|
|
474
|
+
}
|
|
475
|
+
::v-deep .ant-input {
|
|
476
|
+
margin-bottom: 5px;
|
|
477
|
+
}
|
|
478
|
+
::v-deep .ant-calendar-picker {
|
|
479
|
+
margin: 0 5px;
|
|
480
|
+
}
|
|
454
481
|
}
|
|
455
482
|
</style>
|