doway-coms 1.4.88 → 1.4.90
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,24 +227,34 @@ export default {
|
|
|
226
227
|
})
|
|
227
228
|
this.adjustGridOptions.columns = []
|
|
228
229
|
this.adjustUserDefineColumns.forEach(item => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
if (item.field === 'operation') {
|
|
231
|
+
return
|
|
232
|
+
}
|
|
232
233
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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)
|
|
247
258
|
})
|
|
248
259
|
},
|
|
249
260
|
mounted() {
|
|
@@ -260,6 +271,21 @@ export default {
|
|
|
260
271
|
},
|
|
261
272
|
data() {
|
|
262
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
|
+
},
|
|
263
289
|
adjustGridLoading: false,
|
|
264
290
|
adjustUserDefineColumns: null,
|
|
265
291
|
adjustGridOptions: {
|
|
@@ -283,8 +309,42 @@ export default {
|
|
|
283
309
|
const find = XEUtils.find(this.$refs.adjustGrid.getTableColumn().collectColumn,item=>item.field ===val.field)
|
|
284
310
|
find.visible = val.params.show
|
|
285
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
|
+
},
|
|
286
346
|
resizableChange($rowIndex) {
|
|
287
|
-
|
|
347
|
+
this.$refs.adjustGrid.getTableColumn().collectColumn.forEach(item => {
|
|
288
348
|
if (item.field === $rowIndex.column.field) {
|
|
289
349
|
item.width = $rowIndex.column.resizeWidth
|
|
290
350
|
}
|
|
@@ -367,6 +427,7 @@ export default {
|
|
|
367
427
|
getTableColumn() {
|
|
368
428
|
return this.$refs.adjustGrid.getTableColumn().collectColumn
|
|
369
429
|
},
|
|
430
|
+
|
|
370
431
|
}
|
|
371
432
|
}
|
|
372
433
|
</script>
|