vxe-table 4.7.4 → 4.7.5

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.
Files changed (40) hide show
  1. package/es/style.css +1 -1
  2. package/es/style.min.css +1 -1
  3. package/es/table/module/custom/hook.js +18 -2
  4. package/es/table/module/custom/panel.js +263 -159
  5. package/es/table/src/columnInfo.js +2 -0
  6. package/es/table/src/table.js +8 -2
  7. package/es/table/style.css +69 -9
  8. package/es/table/style.min.css +1 -1
  9. package/es/toolbar/src/toolbar.js +1 -1
  10. package/es/ui/index.js +4 -2
  11. package/es/vxe-table/style.css +69 -9
  12. package/es/vxe-table/style.min.css +1 -1
  13. package/lib/index.umd.js +214 -87
  14. package/lib/index.umd.min.js +1 -1
  15. package/lib/style.css +1 -1
  16. package/lib/style.min.css +1 -1
  17. package/lib/table/module/custom/hook.js +23 -2
  18. package/lib/table/module/custom/hook.min.js +1 -1
  19. package/lib/table/module/custom/panel.js +174 -80
  20. package/lib/table/module/custom/panel.min.js +1 -1
  21. package/lib/table/src/columnInfo.js +2 -0
  22. package/lib/table/src/columnInfo.min.js +1 -1
  23. package/lib/table/src/table.js +11 -2
  24. package/lib/table/src/table.min.js +1 -1
  25. package/lib/table/style/style.css +69 -9
  26. package/lib/table/style/style.min.css +1 -1
  27. package/lib/toolbar/src/toolbar.js +1 -1
  28. package/lib/toolbar/src/toolbar.min.js +1 -1
  29. package/lib/ui/index.js +4 -2
  30. package/lib/ui/index.min.js +1 -1
  31. package/lib/vxe-table/style/style.css +69 -9
  32. package/lib/vxe-table/style/style.min.css +1 -1
  33. package/package.json +2 -2
  34. package/packages/table/module/custom/hook.ts +19 -3
  35. package/packages/table/module/custom/panel.ts +272 -165
  36. package/packages/table/src/columnInfo.ts +4 -0
  37. package/packages/table/src/table.ts +8 -2
  38. package/packages/toolbar/src/toolbar.ts +1 -1
  39. package/packages/ui/index.ts +2 -0
  40. package/styles/components/table-module/custom.scss +78 -4
@@ -1,4 +1,4 @@
1
- import { defineComponent, h, inject, ref, Ref, VNode, PropType, resolveComponent, TransitionGroup } from 'vue'
1
+ import { defineComponent, h, inject, ref, Ref, VNode, PropType, resolveComponent, TransitionGroup, createCommentVNode } from 'vue'
2
2
  import { VxeUI } from '../../../ui'
3
3
  import { formatText } from '../../../ui/src/utils'
4
4
  import { addClass, removeClass } from '../../../ui/src/dom'
@@ -19,7 +19,7 @@ export default defineComponent({
19
19
  setup (props) {
20
20
  const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
21
21
 
22
- const { reactData } = $xeTable
22
+ const { props: tableProps, reactData } = $xeTable
23
23
  const { computeCustomOpts, computeColumnOpts, computeIsMaxFixedColumn } = $xeTable.getComputeMaps()
24
24
 
25
25
  const refElem = ref() as Ref<HTMLDivElement>
@@ -41,29 +41,67 @@ export default defineComponent({
41
41
  customStore.activeWrapper = false
42
42
  setTimeout(() => {
43
43
  if (!customStore.activeBtn && !customStore.activeWrapper) {
44
- $xeTable.customColseEvent(evnt)
44
+ $xeTable.customCloseEvent(evnt)
45
45
  }
46
46
  }, 300)
47
47
  }
48
48
 
49
+ const getStoreData = (): VxeTableDefines.CustomStoreData => {
50
+ return {}
51
+ }
52
+
53
+ const handleSaveStore = (type: 'confirm' | 'reset') => {
54
+ const { id } = tableProps
55
+ const customOpts = computeCustomOpts.value
56
+ const { storage, updateStore } = customOpts
57
+ if (storage && id && updateStore) {
58
+ updateStore({
59
+ id,
60
+ type,
61
+ storeData: getStoreData()
62
+ })
63
+ }
64
+ }
65
+
49
66
  const confirmCustomEvent = (evnt: Event) => {
50
- updateColumnSort()
67
+ const { customColumnList } = reactData
68
+ customColumnList.forEach((column, index) => {
69
+ const sortIndex = index + 1
70
+ column.renderSortNumber = sortIndex
71
+ column.fixed = column.renderFixed
72
+ column.visible = column.renderVisible
73
+ })
51
74
  $xeTable.closeCustom()
52
75
  $xeTable.emitCustomEvent('confirm', evnt)
76
+ handleSaveStore('confirm')
53
77
  }
54
78
 
55
79
  const cancelCustomEvent = (evnt: Event) => {
80
+ const { customStore } = props
81
+ const { customColumnList } = reactData
82
+ const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore
83
+ XEUtils.eachTree(customColumnList, column => {
84
+ const colid = column.getKey()
85
+ const visible = !!oldVisibleMaps[colid]
86
+ const fixed = oldFixedMaps[colid] || ''
87
+ column.renderVisible = visible
88
+ column.visible = visible
89
+ column.renderFixed = fixed
90
+ column.fixed = fixed
91
+ column.renderSortNumber = oldSortMaps[colid] || 0
92
+ }, { children: 'children' })
56
93
  $xeTable.closeCustom()
57
94
  $xeTable.emitCustomEvent('cancel', evnt)
58
95
  }
59
96
 
60
- const resetCustomEvent = (evnt: Event) => {
97
+ const handleResetCustomEvent = (evnt: Event) => {
61
98
  $xeTable.resetColumn(true)
62
99
  $xeTable.closeCustom()
63
100
  $xeTable.emitCustomEvent('reset', evnt)
101
+ handleSaveStore('confirm')
64
102
  }
65
103
 
66
- const resetPopupCustomEvent = (evnt: Event) => {
104
+ const resetCustomEvent = (evnt: Event) => {
67
105
  if (VxeUI.modal) {
68
106
  VxeUI.modal.confirm({
69
107
  content: getI18n('vxe.custom.cstmConfirmRestore'),
@@ -71,11 +109,11 @@ export default defineComponent({
71
109
  escClosable: true
72
110
  }).then(type => {
73
111
  if (type === 'confirm') {
74
- resetCustomEvent(evnt)
112
+ handleResetCustomEvent(evnt)
75
113
  }
76
114
  })
77
115
  } else {
78
- resetCustomEvent(evnt)
116
+ handleResetCustomEvent(evnt)
79
117
  }
80
118
  }
81
119
 
@@ -85,18 +123,18 @@ export default defineComponent({
85
123
  if (matchObj && matchObj.parent) {
86
124
  const { parent } = matchObj
87
125
  if (parent.children && parent.children.length) {
88
- parent.visible = parent.children.every((column) => column.visible)
89
- parent.halfVisible = !parent.visible && parent.children.some((column) => column.visible || column.halfVisible)
126
+ parent.renderVisible = parent.children.every((column) => column.renderVisible)
127
+ parent.halfVisible = !parent.renderVisible && parent.children.some((column) => column.renderVisible || column.halfVisible)
90
128
  handleOptionCheck(parent)
91
129
  }
92
130
  }
93
131
  }
94
132
 
95
133
  const changeCheckboxOption = (column: VxeTableDefines.ColumnInfo) => {
96
- const isChecked = !column.visible
134
+ const isChecked = !column.renderVisible
97
135
  const customOpts = computeCustomOpts.value
98
136
  XEUtils.eachTree([column], (item) => {
99
- item.visible = isChecked
137
+ item.renderVisible = isChecked
100
138
  item.halfVisible = false
101
139
  })
102
140
  handleOptionCheck(column)
@@ -108,21 +146,23 @@ export default defineComponent({
108
146
 
109
147
  const changeFixedOption = (column: VxeTableDefines.ColumnInfo, colFixed: VxeColumnPropTypes.Fixed) => {
110
148
  const isMaxFixedColumn = computeIsMaxFixedColumn.value
111
- if (column.fixed === colFixed) {
112
- $xeTable.clearColumnFixed(column)
149
+ if (column.renderFixed === colFixed) {
150
+ column.renderFixed = ''
151
+ // $xeTable.clearColumnFixed(column)
113
152
  } else {
114
- if (!isMaxFixedColumn || column.fixed) {
115
- $xeTable.setColumnFixed(column, colFixed)
153
+ if (!isMaxFixedColumn || column.renderFixed) {
154
+ column.renderFixed = colFixed
155
+ // $xeTable.setColumnFixed(column, colFixed)
116
156
  }
117
157
  }
118
158
  }
119
159
 
120
- const changePopupFixedOption = (column: VxeTableDefines.ColumnInfo) => {
121
- const isMaxFixedColumn = computeIsMaxFixedColumn.value
122
- if (!isMaxFixedColumn) {
123
- $xeTable.setColumnFixed(column, column.fixed)
124
- }
125
- }
160
+ // const changePopupFixedOption = () => {
161
+ // const isMaxFixedColumn = computeIsMaxFixedColumn.value
162
+ // if (!isMaxFixedColumn) {
163
+ // // $xeTable.setColumnFixed(column, column.fixed)
164
+ // }
165
+ // }
126
166
 
127
167
  const allCustomEvent = () => {
128
168
  const { customStore } = props
@@ -132,7 +172,7 @@ export default defineComponent({
132
172
  const isAll = !customStore.isAll
133
173
  XEUtils.eachTree(customColumnList, (column) => {
134
174
  if (!checkMethod || checkMethod({ column })) {
135
- column.visible = isAll
175
+ column.renderVisible = isAll
136
176
  column.halfVisible = false
137
177
  }
138
178
  })
@@ -171,15 +211,6 @@ export default defineComponent({
171
211
  }
172
212
  }
173
213
 
174
- const updateColumnSort = () => {
175
- const { customColumnList } = reactData
176
- // 更新顺序
177
- customColumnList.forEach((column, index) => {
178
- const sortIndex = index + 1
179
- column.renderSortNumber = sortIndex
180
- })
181
- }
182
-
183
214
  const sortDragendEvent = (evnt: DragEvent) => {
184
215
  const { customColumnList } = reactData
185
216
  const trEl = evnt.currentTarget as HTMLElement
@@ -217,8 +248,6 @@ export default defineComponent({
217
248
  }
218
249
  removeClass(trEl, 'active--drag-target')
219
250
  removeClass(trEl, 'active--drag-origin')
220
- // 更新顺序
221
- updateColumnSort()
222
251
  }
223
252
 
224
253
  const sortDragoverEvent = (evnt: DragEvent) => {
@@ -260,7 +289,7 @@ export default defineComponent({
260
289
  const { customColumnList } = reactData
261
290
  const customOpts = computeCustomOpts.value
262
291
  const { maxHeight } = customStore
263
- const { checkMethod, visibleMethod, trigger } = customOpts
292
+ const { checkMethod, visibleMethod, allowSort, allowFixed, trigger } = customOpts
264
293
  const isMaxFixedColumn = computeIsMaxFixedColumn.value
265
294
  const colVNs: VNode[] = []
266
295
  const customWrapperOns: any = {}
@@ -272,7 +301,7 @@ export default defineComponent({
272
301
  XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
273
302
  const isVisible = visibleMethod ? visibleMethod({ column }) : true
274
303
  if (isVisible) {
275
- const isChecked = column.visible
304
+ const isChecked = column.renderVisible
276
305
  const isIndeterminate = column.halfVisible
277
306
  const isColGroup = column.children && column.children.length
278
307
  const colTitle = formatText(column.getTitle(), 1)
@@ -280,17 +309,21 @@ export default defineComponent({
280
309
  colVNs.push(
281
310
  h('li', {
282
311
  key: column.id,
312
+ colid: column.id,
283
313
  class: ['vxe-table-custom--option', `level--${column.level}`, {
284
314
  'is--group': isColGroup
285
- }]
315
+ }],
316
+ onDragstart: sortDragstartEvent,
317
+ onDragend: sortDragendEvent,
318
+ onDragover: sortDragoverEvent
286
319
  }, [
287
320
  h('div', {
288
- title: colTitle,
289
321
  class: ['vxe-table-custom--checkbox-option', {
290
322
  'is--checked': isChecked,
291
323
  'is--indeterminate': isIndeterminate,
292
324
  'is--disabled': isDisabled
293
325
  }],
326
+ title: getI18n('vxe.custom.setting.colVisible'),
294
327
  onClick: () => {
295
328
  if (!isDisabled) {
296
329
  changeCheckboxOption(column)
@@ -299,37 +332,54 @@ export default defineComponent({
299
332
  }, [
300
333
  h('span', {
301
334
  class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
302
- }),
303
- h('span', {
304
- class: 'vxe-checkbox--label'
305
- }, colTitle)
335
+ })
306
336
  ]),
307
- !parent && customOpts.allowFixed
337
+ allowSort && column.level === 1
338
+ ? h('div', {
339
+ class: 'vxe-table-custom--sort-option'
340
+ }, [
341
+ h('span', {
342
+ class: 'vxe-table-custom--sort-btn',
343
+ title: getI18n('vxe.custom.setting.sortHelpTip'),
344
+ onMousedown: sortMousedownEvent,
345
+ onMouseup: sortMouseupEvent
346
+ }, [
347
+ h('i', {
348
+ class: getIcon().TABLE_CUSTOM_SORT
349
+ })
350
+ ])
351
+ ])
352
+ : createCommentVNode(),
353
+ h('div', {
354
+ class: 'vxe-table-custom--checkbox-label',
355
+ title: colTitle
356
+ }, colTitle),
357
+ !parent && allowFixed
308
358
  ? h('div', {
309
359
  class: 'vxe-table-custom--fixed-option'
310
360
  }, [
311
361
  h('span', {
312
- class: ['vxe-table-custom--fixed-left-option', column.fixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT, {
313
- 'is--checked': column.fixed === 'left',
314
- 'is--disabled': isMaxFixedColumn && !column.fixed
362
+ class: ['vxe-table-custom--fixed-left-option', column.renderFixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT, {
363
+ 'is--checked': column.renderFixed === 'left',
364
+ 'is--disabled': isMaxFixedColumn && !column.renderFixed
315
365
  }],
316
- title: getI18n(column.fixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft'),
366
+ title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft'),
317
367
  onClick: () => {
318
368
  changeFixedOption(column, 'left')
319
369
  }
320
370
  }),
321
371
  h('span', {
322
- class: ['vxe-table-custom--fixed-right-option', column.fixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT, {
323
- 'is--checked': column.fixed === 'right',
324
- 'is--disabled': isMaxFixedColumn && !column.fixed
372
+ class: ['vxe-table-custom--fixed-right-option', column.renderFixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT, {
373
+ 'is--checked': column.renderFixed === 'right',
374
+ 'is--disabled': isMaxFixedColumn && !column.renderFixed
325
375
  }],
326
- title: getI18n(column.fixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight'),
376
+ title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight'),
327
377
  onClick: () => {
328
378
  changeFixedOption(column, 'right')
329
379
  }
330
380
  })
331
381
  ])
332
- : null
382
+ : createCommentVNode()
333
383
  ])
334
384
  )
335
385
  }
@@ -342,68 +392,89 @@ export default defineComponent({
342
392
  class: ['vxe-table-custom-wrapper', {
343
393
  'is--active': customStore.visible
344
394
  }]
345
- }, [
346
- h('ul', {
347
- class: 'vxe-table-custom--header'
348
- }, [
349
- h('li', {
350
- class: 'vxe-table-custom--option'
351
- }, [
395
+ }, customStore.visible
396
+ ? [
397
+ h('ul', {
398
+ class: 'vxe-table-custom--header'
399
+ }, [
400
+ h('li', {
401
+ class: 'vxe-table-custom--option'
402
+ }, [
403
+ h('div', {
404
+ class: ['vxe-table-custom--checkbox-option', {
405
+ 'is--checked': isAllChecked,
406
+ 'is--indeterminate': isAllIndeterminate
407
+ }],
408
+ title: getI18n('vxe.table.allTitle'),
409
+ onClick: allCustomEvent
410
+ }, [
411
+ h('span', {
412
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
413
+ }),
414
+ h('span', {
415
+ class: 'vxe-checkbox--label'
416
+ }, getI18n('vxe.toolbar.customAll'))
417
+ ])
418
+ ])
419
+ ]),
352
420
  h('div', {
353
- class: ['vxe-table-custom--checkbox-option', {
354
- 'is--checked': isAllChecked,
355
- 'is--indeterminate': isAllIndeterminate
356
- }],
357
- title: getI18n('vxe.table.allTitle'),
358
- onClick: allCustomEvent
421
+ ref: bodyElemRef,
422
+ class: 'vxe-table-custom--list-wrapper'
359
423
  }, [
360
- h('span', {
361
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
424
+ h(TransitionGroup, {
425
+ class: 'vxe-table-custom--body',
426
+ name: 'vxe-table-custom--list',
427
+ tag: 'ul',
428
+ style: maxHeight
429
+ ? {
430
+ maxHeight: `${maxHeight}px`
431
+ }
432
+ : {},
433
+ ...customWrapperOns
434
+ }, {
435
+ default: () => colVNs
362
436
  }),
363
- h('span', {
364
- class: 'vxe-checkbox--label'
365
- }, getI18n('vxe.toolbar.customAll'))
366
- ])
367
- ])
368
- ]),
369
- h('ul', {
370
- class: 'vxe-table-custom--body',
371
- style: maxHeight
372
- ? {
373
- maxHeight: `${maxHeight}px`
374
- }
375
- : {},
376
- ...customWrapperOns
377
- }, colVNs),
378
- customOpts.showFooter
379
- ? h('div', {
380
- class: 'vxe-table-custom--footer'
381
- }, [
382
- h('button', {
383
- class: 'btn--reset',
384
- onClick: resetCustomEvent
385
- }, customOpts.resetButtonText || getI18n('vxe.toolbar.customRestore')),
386
- h('button', {
387
- class: 'btn--confirm',
388
- onClick: confirmCustomEvent
389
- }, customOpts.confirmButtonText || getI18n('vxe.toolbar.customConfirm'))
390
- ])
391
- : null
392
- ])
437
+ h('div', {
438
+ ref: dragHintElemRef,
439
+ class: 'vxe-table-custom-popup--drag-hint'
440
+ }, getI18n('vxe.custom.cstmDragTarget', [dragColumn.value ? dragColumn.value.getTitle() : '']))
441
+ ]),
442
+ customOpts.showFooter
443
+ ? h('div', {
444
+ class: 'vxe-table-custom--footer'
445
+ }, [
446
+ h('button', {
447
+ class: 'btn--reset',
448
+ onClick: resetCustomEvent
449
+ }, customOpts.resetButtonText || getI18n('vxe.table.customRestore')),
450
+ customOpts.immediate
451
+ ? createCommentVNode()
452
+ : h('button', {
453
+ class: 'btn--cancel',
454
+ onClick: cancelCustomEvent
455
+ }, customOpts.resetButtonText || getI18n('vxe.table.customCancel')),
456
+ h('button', {
457
+ class: 'btn--confirm',
458
+ onClick: confirmCustomEvent
459
+ }, customOpts.confirmButtonText || getI18n('vxe.table.customConfirm'))
460
+ ])
461
+ : null
462
+ ]
463
+ : [])
393
464
  }
394
465
 
395
466
  const renderPopupPanel = () => {
396
467
  const { customStore } = props
397
468
  const { customColumnList } = reactData
398
469
  const customOpts = computeCustomOpts.value
399
- const { checkMethod, visibleMethod } = customOpts
470
+ const { allowSort, allowFixed, checkMethod, visibleMethod } = customOpts
400
471
  const columnOpts = computeColumnOpts.value
401
472
  const isMaxFixedColumn = computeIsMaxFixedColumn.value
402
473
  const trVNs: VNode[] = []
403
474
  XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
404
475
  const isVisible = visibleMethod ? visibleMethod({ column }) : true
405
476
  if (isVisible) {
406
- const isChecked = column.visible
477
+ const isChecked = column.renderVisible
407
478
  const isIndeterminate = column.halfVisible
408
479
  const colTitle = formatText(column.getTitle(), 1)
409
480
  const isColGroup = column.children && column.children.length
@@ -419,29 +490,6 @@ export default defineComponent({
419
490
  onDragend: sortDragendEvent,
420
491
  onDragover: sortDragoverEvent
421
492
  }, [
422
- h('td', {
423
- class: 'vxe-table-custom-popup--column-item col--sort'
424
- }, [
425
- column.level === 1
426
- ? h('span', {
427
- class: 'vxe-table-custom-popup--column-sort-btn',
428
- onMousedown: sortMousedownEvent,
429
- onMouseup: sortMouseupEvent
430
- }, [
431
- h('i', {
432
- class: 'vxe-icon-sort'
433
- })
434
- ])
435
- : null
436
- ]),
437
- h('td', {
438
- class: 'vxe-table-custom-popup--column-item col--name'
439
- }, [
440
- h('div', {
441
- class: 'vxe-table-custom-popup--name',
442
- title: colTitle
443
- }, colTitle)
444
- ]),
445
493
  h('td', {
446
494
  class: 'vxe-table-custom-popup--column-item col--visible'
447
495
  }, [
@@ -451,6 +499,7 @@ export default defineComponent({
451
499
  'is--indeterminate': isIndeterminate,
452
500
  'is--disabled': isDisabled
453
501
  }],
502
+ title: getI18n('vxe.custom.setting.colVisible'),
454
503
  onClick: () => {
455
504
  if (!isDisabled) {
456
505
  changeCheckboxOption(column)
@@ -462,32 +511,62 @@ export default defineComponent({
462
511
  })
463
512
  ])
464
513
  ]),
514
+ allowSort
515
+ ? h('td', {
516
+ class: 'vxe-table-custom-popup--column-item col--sort'
517
+ }, [
518
+ column.level === 1
519
+ ? h('span', {
520
+ class: 'vxe-table-custom-popup--column-sort-btn',
521
+ title: getI18n('vxe.custom.setting.sortHelpTip'),
522
+ onMousedown: sortMousedownEvent,
523
+ onMouseup: sortMouseupEvent
524
+ }, [
525
+ h('i', {
526
+ class: getIcon().TABLE_CUSTOM_SORT
527
+ })
528
+ ])
529
+ : null
530
+ ])
531
+ : createCommentVNode(),
465
532
  h('td', {
466
- class: 'vxe-table-custom-popup--column-item col--fixed'
533
+ class: 'vxe-table-custom-popup--column-item col--name'
467
534
  }, [
468
- !parent && customOpts.allowFixed
469
- ? h(resolveComponent('vxe-radio-group') as VxeRadioGroupComponent, {
470
- modelValue: column.fixed || '',
471
- type: 'button',
472
- size: 'mini',
473
- options: [
474
- { label: getI18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isMaxFixedColumn },
475
- { label: getI18n('vxe.custom.setting.fixedUnset'), value: '' },
476
- { label: getI18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isMaxFixedColumn }
477
- ],
478
- 'onUpdate:modelValue' (value: any) {
479
- column.fixed = value
480
- },
481
- onChange () {
482
- changePopupFixedOption(column)
483
- }
484
- })
485
- : null
486
- ])
535
+ h('div', {
536
+ class: 'vxe-table-custom-popup--name',
537
+ title: colTitle
538
+ }, colTitle)
539
+ ]),
540
+ allowFixed
541
+ ? h('td', {
542
+ class: 'vxe-table-custom-popup--column-item col--fixed'
543
+ }, [
544
+ !parent
545
+ ? h(resolveComponent('vxe-radio-group') as VxeRadioGroupComponent, {
546
+ modelValue: column.renderFixed || '',
547
+ type: 'button',
548
+ size: 'mini',
549
+ options: [
550
+ { label: getI18n('vxe.custom.setting.fixedLeft'), value: 'left', disabled: isMaxFixedColumn },
551
+ { label: getI18n('vxe.custom.setting.fixedUnset'), value: '' },
552
+ { label: getI18n('vxe.custom.setting.fixedRight'), value: 'right', disabled: isMaxFixedColumn }
553
+ ],
554
+ 'onUpdate:modelValue' (value: any) {
555
+ column.renderFixed = value
556
+ }
557
+ // onChange () {
558
+ // changePopupFixedOption(column)
559
+ // }
560
+ })
561
+ : null
562
+ ])
563
+ : createCommentVNode()
487
564
  ])
488
565
  )
489
566
  }
490
567
  })
568
+ const isAllChecked = customStore.isAll
569
+ const isAllIndeterminate = customStore.isIndeterminate
491
570
  return h(resolveComponent('vxe-modal') as VxeModalComponent, {
492
571
  key: 'popup',
493
572
  className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
@@ -522,38 +601,66 @@ export default defineComponent({
522
601
  width: '80px'
523
602
  }
524
603
  }),
525
- h('col', {}),
604
+ allowSort
605
+ ? h('col', {
606
+ style: {
607
+ width: '80px'
608
+ }
609
+ })
610
+ : createCommentVNode(),
526
611
  h('col', {
527
612
  style: {
528
- width: '80px'
613
+ minWidth: '120px'
529
614
  }
530
615
  }),
531
- h('col', {
532
- style: {
533
- width: '200px'
534
- }
535
- })
616
+ allowFixed
617
+ ? h('col', {
618
+ style: {
619
+ width: '200px'
620
+ }
621
+ })
622
+ : createCommentVNode()
536
623
  ]),
537
624
  h('thead', {}, [
538
625
  h('tr', {}, [
539
626
  h('th', {}, [
540
- h('span', {
541
- class: 'vxe-table-custom-popup--table-sort-help-title'
542
- }, getI18n('vxe.custom.setting.colSort')),
543
- h(resolveComponent('vxe-tooltip') as VxeTooltipComponent, {
544
- enterable: true,
545
- content: getI18n('vxe.custom.setting.sortHelpTip')
546
- }, {
547
- default: () => {
548
- return h('i', {
549
- class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
550
- })
551
- }
552
- })
627
+ h('div', {
628
+ class: ['vxe-table-custom--checkbox-option', {
629
+ 'is--checked': isAllChecked,
630
+ 'is--indeterminate': isAllIndeterminate
631
+ }],
632
+ title: getI18n('vxe.table.allTitle'),
633
+ onClick: allCustomEvent
634
+ }, [
635
+ h('span', {
636
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
637
+ }),
638
+ h('span', {
639
+ class: 'vxe-checkbox--label'
640
+ }, getI18n('vxe.toolbar.customAll'))
641
+ ])
553
642
  ]),
643
+ allowSort
644
+ ? h('th', {}, [
645
+ h('span', {
646
+ class: 'vxe-table-custom-popup--table-sort-help-title'
647
+ }, getI18n('vxe.custom.setting.colSort')),
648
+ h(resolveComponent('vxe-tooltip') as VxeTooltipComponent, {
649
+ enterable: true,
650
+ content: getI18n('vxe.custom.setting.sortHelpTip')
651
+ }, {
652
+ default: () => {
653
+ return h('i', {
654
+ class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
655
+ })
656
+ }
657
+ })
658
+ ])
659
+ : createCommentVNode(),
554
660
  h('th', {}, getI18n('vxe.custom.setting.colTitle')),
555
- h('th', {}, getI18n('vxe.custom.setting.colVisible')),
556
- h('th', {}, getI18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))
661
+ allowFixed
662
+ ? h('th', {}, getI18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))
663
+ : createCommentVNode()
557
664
  ])
558
665
  ]),
559
666
  h(TransitionGroup, {
@@ -577,7 +684,7 @@ export default defineComponent({
577
684
  }, [
578
685
  h(resolveComponent('vxe-button') as VxeButtonComponent, {
579
686
  content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
580
- onClick: resetPopupCustomEvent
687
+ onClick: resetCustomEvent
581
688
  }),
582
689
  h(resolveComponent('vxe-button') as VxeButtonComponent, {
583
690
  content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel'),
@@ -102,6 +102,7 @@ export class ColumnInfo {
102
102
  halfVisible: false,
103
103
  defaultVisible: visible,
104
104
  defaultFixed: _vm.fixed,
105
+
105
106
  checked: false,
106
107
  halfChecked: false,
107
108
  disabled: false,
@@ -120,6 +121,9 @@ export class ColumnInfo {
120
121
  sortNumber: 0, // 用于记录自定义列顺序
121
122
  renderSortNumber: 0, // 用于记录自定义列顺序
122
123
 
124
+ renderFixed: '',
125
+ renderVisible: false,
126
+
123
127
  renderWidth: 0,
124
128
  renderHeight: 0,
125
129
  resizeWidth: 0, // 手动调整