doway-coms 1.4.87 → 1.4.89
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
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
chronological: true,
|
|
15
15
|
}"
|
|
16
16
|
column-key
|
|
17
|
+
:menu-config="menuConfig"
|
|
18
|
+
@menu-click="contextMenuClickEvent"
|
|
17
19
|
>
|
|
18
20
|
<template #empty>
|
|
19
21
|
<div>拖拽调整字段位置或者宽度</div>
|
|
@@ -216,7 +218,6 @@ export default {
|
|
|
216
218
|
},
|
|
217
219
|
created() {
|
|
218
220
|
this.adjustUserDefineColumns = this.userDefineColumns
|
|
219
|
-
|
|
220
221
|
this.adjustUserDefineColumns.forEach(item => {
|
|
221
222
|
if (item.visible) {
|
|
222
223
|
this.$set(item, 'show', true)
|
|
@@ -226,22 +227,34 @@ export default {
|
|
|
226
227
|
})
|
|
227
228
|
this.adjustGridOptions.columns = []
|
|
228
229
|
this.adjustUserDefineColumns.forEach(item => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
230
|
+
if (item.field === 'operation') {
|
|
231
|
+
return
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const column = {
|
|
235
|
+
field: item.field,
|
|
236
|
+
title: item.title,
|
|
237
|
+
slots: {
|
|
238
|
+
header: 'checkbox',
|
|
239
|
+
filter: item.slots.filter
|
|
240
|
+
},
|
|
241
|
+
params: item.params,
|
|
242
|
+
width: item.width,
|
|
243
|
+
filters: item.filters,
|
|
244
|
+
sortable: true,
|
|
245
|
+
filterResetMethod:({ options, column })=>{
|
|
246
|
+
column.filters = [
|
|
247
|
+
{
|
|
248
|
+
data: {
|
|
249
|
+
bindingValues: [],
|
|
250
|
+
displayValues: []
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
this.$set(column.params,'show',item.show)
|
|
257
|
+
this.adjustGridOptions.columns.push(column)
|
|
245
258
|
})
|
|
246
259
|
},
|
|
247
260
|
mounted() {
|
|
@@ -258,6 +271,21 @@ export default {
|
|
|
258
271
|
},
|
|
259
272
|
data() {
|
|
260
273
|
return {
|
|
274
|
+
menuConfig: {
|
|
275
|
+
header: {
|
|
276
|
+
options: [
|
|
277
|
+
[
|
|
278
|
+
{
|
|
279
|
+
code: "clearFilter",
|
|
280
|
+
name: "清空筛选",
|
|
281
|
+
visible: true,
|
|
282
|
+
disabled: false,
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
],
|
|
286
|
+
},
|
|
287
|
+
enabled:true
|
|
288
|
+
},
|
|
261
289
|
adjustGridLoading: false,
|
|
262
290
|
adjustUserDefineColumns: null,
|
|
263
291
|
adjustGridOptions: {
|
|
@@ -281,6 +309,40 @@ export default {
|
|
|
281
309
|
const find = XEUtils.find(this.$refs.adjustGrid.getTableColumn().collectColumn,item=>item.field ===val.field)
|
|
282
310
|
find.visible = val.params.show
|
|
283
311
|
},
|
|
312
|
+
//右键菜单事件
|
|
313
|
+
contextMenuClickEvent({ menu, row, column }) {
|
|
314
|
+
const $table = this.$refs.adjustGrid;
|
|
315
|
+
switch (menu.code) {
|
|
316
|
+
case 'clearFilter':
|
|
317
|
+
const filterList = this.$refs.adjustGrid.getCheckedFilters();
|
|
318
|
+
filterList.forEach((col) => {
|
|
319
|
+
this.getTableColumn().forEach(column => {
|
|
320
|
+
if(column.field==col.property){
|
|
321
|
+
this.$set(column.filters[0].data,'displayValues',[])
|
|
322
|
+
this.$set(column.filters[0].data,'bindingValues',[])
|
|
323
|
+
this.$refs.adjustGrid.clearFilter(column)
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
//这个col和 internalColumn之间没有绑定上
|
|
327
|
+
col.column.filters = [
|
|
328
|
+
{
|
|
329
|
+
data: {
|
|
330
|
+
bindingValues: [],
|
|
331
|
+
displayValues: []
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
});
|
|
336
|
+
// this.$refs.adjustGrid.clearFilter()
|
|
337
|
+
// .then(res=>{
|
|
338
|
+
// console.log('a',this.$refs.adjustGrid.getCheckedFilters())
|
|
339
|
+
// console.log('b',this.getTableColumn())
|
|
340
|
+
// })
|
|
341
|
+
// XEUtils.clear(this.filterExpression)
|
|
342
|
+
// vm.$emit("filterChange");
|
|
343
|
+
break
|
|
344
|
+
}
|
|
345
|
+
},
|
|
284
346
|
resizableChange($rowIndex) {
|
|
285
347
|
this.adjustUserDefineColumns.forEach(item => {
|
|
286
348
|
if (item.field === $rowIndex.column.field) {
|
|
@@ -365,6 +427,7 @@ export default {
|
|
|
365
427
|
getTableColumn() {
|
|
366
428
|
return this.$refs.adjustGrid.getTableColumn().collectColumn
|
|
367
429
|
},
|
|
430
|
+
|
|
368
431
|
}
|
|
369
432
|
}
|
|
370
433
|
</script>
|