vxe-table 3.20.7 → 3.20.9

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 (144) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +106 -106
  3. package/es/index.esm.js +2 -1
  4. package/es/style.css +1 -1
  5. package/es/table/src/methods.js +81 -84
  6. package/es/table/src/table.js +20 -1
  7. package/es/table/src/util.js +6 -0
  8. package/es/table/style.css +18 -48
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/dom.js +19 -20
  11. package/es/ui/src/log.js +1 -1
  12. package/es/vxe-table/style.css +18 -48
  13. package/lib/index.common.js +2 -1
  14. package/lib/index.umd.js +1985 -3291
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/style.css +1 -1
  17. package/lib/table/src/methods.js +17 -15
  18. package/lib/table/src/methods.min.js +1 -1
  19. package/lib/table/src/table.js +19 -1
  20. package/lib/table/src/table.min.js +1 -1
  21. package/lib/table/src/util.js +6 -0
  22. package/lib/table/src/util.min.js +1 -1
  23. package/lib/table/style/style.css +18 -48
  24. package/lib/ui/index.js +1 -1
  25. package/lib/ui/index.min.js +1 -1
  26. package/lib/ui/src/dom.js +21 -20
  27. package/lib/ui/src/dom.min.js +1 -1
  28. package/lib/ui/src/log.js +1 -1
  29. package/lib/ui/src/log.min.js +1 -1
  30. package/lib/v-x-e-table/index.js +2 -1
  31. package/lib/v-x-e-table/index.min.js +1 -1
  32. package/lib/vxe-colgroup/index.js +2 -1
  33. package/lib/vxe-colgroup/index.min.js +1 -1
  34. package/lib/vxe-column/index.js +2 -1
  35. package/lib/vxe-column/index.min.js +1 -1
  36. package/lib/vxe-grid/index.js +2 -1
  37. package/lib/vxe-grid/index.min.js +1 -1
  38. package/lib/vxe-table/index.js +2 -1
  39. package/lib/vxe-table/index.min.js +1 -1
  40. package/lib/vxe-table/style/style.css +18 -48
  41. package/lib/vxe-toolbar/index.js +2 -1
  42. package/lib/vxe-toolbar/index.min.js +1 -1
  43. package/lib/vxe-ui/index.js +2 -1
  44. package/lib/vxe-ui/index.min.js +1 -1
  45. package/lib/vxe-v-x-e-table/index.js +2 -1
  46. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  47. package/package.json +93 -93
  48. package/packages/colgroup/index.ts +22 -22
  49. package/packages/column/index.ts +22 -22
  50. package/packages/components.ts +42 -42
  51. package/packages/grid/index.ts +22 -22
  52. package/packages/grid/src/grid.ts +1935 -1935
  53. package/packages/index.ts +4 -4
  54. package/packages/locale/lang/ar-EG.ts +832 -832
  55. package/packages/locale/lang/de-DE.ts +832 -832
  56. package/packages/locale/lang/en-US.ts +832 -832
  57. package/packages/locale/lang/es-ES.ts +832 -832
  58. package/packages/locale/lang/fr-FR.ts +832 -832
  59. package/packages/locale/lang/hu-HU.ts +832 -832
  60. package/packages/locale/lang/hy-AM.ts +832 -832
  61. package/packages/locale/lang/id-ID.ts +832 -832
  62. package/packages/locale/lang/it-IT.ts +832 -832
  63. package/packages/locale/lang/ja-JP.ts +832 -832
  64. package/packages/locale/lang/ko-KR.ts +832 -832
  65. package/packages/locale/lang/ms-MY.ts +832 -832
  66. package/packages/locale/lang/nb-NO.ts +832 -832
  67. package/packages/locale/lang/pt-BR.ts +832 -832
  68. package/packages/locale/lang/ru-RU.ts +832 -832
  69. package/packages/locale/lang/th-TH.ts +832 -832
  70. package/packages/locale/lang/ug-CN.ts +832 -832
  71. package/packages/locale/lang/uk-UA.ts +832 -832
  72. package/packages/locale/lang/uz-UZ.ts +832 -832
  73. package/packages/locale/lang/vi-VN.ts +832 -832
  74. package/packages/locale/lang/zh-CHT.ts +832 -832
  75. package/packages/locale/lang/zh-CN.ts +832 -832
  76. package/packages/locale/lang/zh-HK.ts +3 -3
  77. package/packages/locale/lang/zh-MO.ts +3 -3
  78. package/packages/locale/lang/zh-TC.ts +3 -3
  79. package/packages/locale/lang/zh-TW.ts +3 -3
  80. package/packages/table/index.ts +49 -49
  81. package/packages/table/module/custom/mixin.ts +369 -369
  82. package/packages/table/module/custom/panel.ts +1461 -1461
  83. package/packages/table/module/edit/mixin.ts +1123 -1123
  84. package/packages/table/module/export/export-panel.ts +658 -658
  85. package/packages/table/module/export/import-panel.ts +319 -319
  86. package/packages/table/module/export/mixin.ts +1693 -1693
  87. package/packages/table/module/export/util.ts +24 -24
  88. package/packages/table/module/filter/mixin.ts +507 -507
  89. package/packages/table/module/filter/panel.ts +329 -329
  90. package/packages/table/module/keyboard/mixin.ts +513 -513
  91. package/packages/table/module/menu/mixin.ts +329 -329
  92. package/packages/table/module/menu/panel.ts +212 -212
  93. package/packages/table/module/validator/mixin.ts +626 -626
  94. package/packages/table/render/index.ts +1456 -1456
  95. package/packages/table/src/body.ts +969 -969
  96. package/packages/table/src/cell.ts +1285 -1285
  97. package/packages/table/src/column.ts +205 -205
  98. package/packages/table/src/columnInfo.ts +228 -228
  99. package/packages/table/src/footer.ts +388 -388
  100. package/packages/table/src/group.ts +51 -51
  101. package/packages/table/src/header.ts +602 -602
  102. package/packages/table/src/methods.ts +12936 -12939
  103. package/packages/table/src/props.ts +311 -311
  104. package/packages/table/src/store.ts +15 -15
  105. package/packages/table/src/table.ts +2523 -2505
  106. package/packages/table/src/util.ts +1018 -1012
  107. package/packages/toolbar/index.ts +18 -18
  108. package/packages/toolbar/src/toolbar.ts +856 -856
  109. package/packages/ui/index.ts +530 -530
  110. package/packages/ui/src/anime.ts +52 -52
  111. package/packages/ui/src/comp.ts +3 -3
  112. package/packages/ui/src/dom.ts +237 -236
  113. package/packages/ui/src/log.ts +8 -8
  114. package/packages/ui/src/utils.ts +56 -56
  115. package/packages/ui/src/vn.ts +65 -65
  116. package/packages/v-x-e-table/index.ts +4 -4
  117. package/styles/all.scss +7 -7
  118. package/styles/base.scss +16 -16
  119. package/styles/components/grid.scss +89 -89
  120. package/styles/components/icon.scss +225 -225
  121. package/styles/components/old-icon.scss +715 -715
  122. package/styles/components/table-module/all.scss +6 -6
  123. package/styles/components/table-module/custom.scss +527 -527
  124. package/styles/components/table-module/export.scss +130 -130
  125. package/styles/components/table-module/filter.scss +130 -130
  126. package/styles/components/table-module/menu.scss +81 -81
  127. package/styles/components/table.scss +2679 -2679
  128. package/styles/components/toolbar.scss +119 -119
  129. package/styles/default.scss +2 -2
  130. package/styles/helpers/baseMixin.scss +95 -95
  131. package/styles/index.scss +3 -3
  132. package/styles/modules.scss +5 -5
  133. package/styles/theme/base.scss +93 -93
  134. package/styles/theme/dark.scss +49 -49
  135. package/styles/theme/light.scss +44 -44
  136. package/styles/variable.scss +43 -43
  137. package/types/all.d.ts +53 -53
  138. package/types/index.d.ts +4 -4
  139. /package/es/{iconfont.1773991883171.ttf → iconfont.1774420912543.ttf} +0 -0
  140. /package/es/{iconfont.1773991883171.woff → iconfont.1774420912543.woff} +0 -0
  141. /package/es/{iconfont.1773991883171.woff2 → iconfont.1774420912543.woff2} +0 -0
  142. /package/lib/{iconfont.1773991883171.ttf → iconfont.1774420912543.ttf} +0 -0
  143. /package/lib/{iconfont.1773991883171.woff → iconfont.1774420912543.woff} +0 -0
  144. /package/lib/{iconfont.1773991883171.woff2 → iconfont.1774420912543.woff2} +0 -0
@@ -1,658 +1,658 @@
1
- import { CreateElement, VNode, PropType } from 'vue'
2
- import { defineVxeComponent } from '../../../ui/src/comp'
3
- import { VxeUI } from '../../../ui'
4
- import XEUtils from 'xe-utils'
5
- import { formatText } from '../../../ui/src/utils'
6
- import { errLog } from '../../../ui/src/log'
7
-
8
- import type { VxeComponentSizeType } from 'vxe-pc-ui'
9
- import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines } from '../../../../types'
10
-
11
- const { getI18n, getIcon, globalMixins, renderEmptyElement } = VxeUI
12
-
13
- export default /* define-vxe-component start */ defineVxeComponent({
14
- name: 'VxeTableExportPanel',
15
- mixins: [
16
- globalMixins.sizeMixin
17
- ],
18
- props: {
19
- defaultOptions: {
20
- type: Object as PropType<VxeTableDefines.ExportParamsObj>,
21
- default: () => ({} as VxeTableDefines.ExportParamsObj)
22
- },
23
- storeData: {
24
- type: Object as PropType<VxeTableDefines.ExportStoreObj>,
25
- default: () => ({} as VxeTableDefines.ExportStoreObj)
26
- }
27
- },
28
- inject: {
29
- $xeTable: {
30
- default: null
31
- }
32
- },
33
- data () {
34
- const reactData = {
35
- isAll: false,
36
- isIndeterminate: false,
37
- loading: false
38
- }
39
-
40
- return {
41
- reactData
42
- }
43
- },
44
- computed: {
45
- ...({} as {
46
- computeSize(): VxeComponentSizeType
47
- $xeTable(): VxeTableConstructor & VxeTablePrivateMethods
48
- }),
49
- computeCheckedAll () {
50
- const $xeExportPanel = this
51
- const props = $xeExportPanel
52
-
53
- const { storeData } = props
54
- return storeData.columns.every((column) => column.checked)
55
- },
56
- computeShowSheet () {
57
- const $xeExportPanel = this
58
- const props = $xeExportPanel
59
-
60
- const { defaultOptions } = props
61
- return ['html', 'xml', 'xlsx', 'pdf'].indexOf(defaultOptions.type) > -1
62
- },
63
- computeSupportMerge () {
64
- const $xeExportPanel = this
65
- const props = $xeExportPanel
66
-
67
- const { storeData, defaultOptions } = props
68
- return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1)
69
- },
70
- // computeSupportGroup () {
71
- // const $xeExportPanel = this
72
- // const props = $xeExportPanel
73
-
74
- // const { defaultOptions } = props
75
- // return ['html', 'xlsx', 'csv', 'txt'].indexOf(defaultOptions.type) > -1
76
- // },
77
- computeSupportStyle () {
78
- const $xeExportPanel = this
79
- const props = $xeExportPanel
80
-
81
- const { defaultOptions } = props
82
- return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1
83
- }
84
- },
85
- created () {
86
- const $xeTableExportPanel = this
87
-
88
- const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
89
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
90
- const VxeUISelectComponent = VxeUI.getComponent('VxeSelect')
91
- const VxeUIInputComponent = VxeUI.getComponent('VxeInput')
92
- const VxeUICheckboxComponent = VxeUI.getComponent('VxeCheckbox')
93
-
94
- $xeTableExportPanel.$nextTick(() => {
95
- if (!VxeUIModalComponent) {
96
- errLog('vxe.error.reqComp', ['vxe-modal'])
97
- }
98
- if (!VxeUIButtonComponent) {
99
- errLog('vxe.error.reqComp', ['vxe-button'])
100
- }
101
- if (!VxeUISelectComponent) {
102
- errLog('vxe.error.reqComp', ['vxe-select'])
103
- }
104
- if (!VxeUIInputComponent) {
105
- errLog('vxe.error.reqComp', ['vxe-input'])
106
- }
107
- if (!VxeUICheckboxComponent) {
108
- errLog('vxe.error.reqComp', ['vxe-checkbox'])
109
- }
110
- })
111
- },
112
- methods: {
113
- changeOption (column: any) {
114
- const $xeExportPanel = this
115
-
116
- const isChecked = !column.checked
117
- XEUtils.eachTree([column], (item) => {
118
- item.checked = isChecked
119
- item.halfChecked = false
120
- })
121
- $xeExportPanel.handleOptionCheck(column)
122
- $xeExportPanel.checkStatus()
123
- },
124
- handleOptionCheck (column: any) {
125
- const $xeExportPanel = this
126
- const props = $xeExportPanel
127
-
128
- const { storeData } = props
129
- const matchObj = XEUtils.findTree(storeData.columns as any[], item => item === column)
130
- if (matchObj && matchObj.parent) {
131
- const { parent } = matchObj
132
- if (parent.children && parent.children.length) {
133
- parent.checked = parent.children.every((column: any) => column.checked)
134
- parent.halfChecked = !parent.checked && parent.children.some((column: any) => column.checked || column.halfChecked)
135
- $xeExportPanel.handleOptionCheck(parent)
136
- }
137
- }
138
- },
139
- checkStatus () {
140
- const $xeExportPanel = this
141
- const props = $xeExportPanel
142
- const reactData = $xeExportPanel.reactData
143
-
144
- const { storeData } = props
145
- const columns = storeData.columns
146
- reactData.isAll = columns.every((column: any) => column.disabled || column.checked)
147
- reactData.isIndeterminate = !reactData.isAll && columns.some((column: any) => !column.disabled && (column.checked || column.halfChecked))
148
- },
149
- allColumnEvent () {
150
- const $xeExportPanel = this
151
- const props = $xeExportPanel
152
- const reactData = $xeExportPanel.reactData
153
-
154
- const { storeData } = props
155
- const isAll = !reactData.isAll
156
- XEUtils.eachTree(storeData.columns, column => {
157
- if (!column.disabled) {
158
- column.checked = isAll
159
- column.halfChecked = false
160
- }
161
- })
162
- reactData.isAll = isAll
163
- $xeExportPanel.checkStatus()
164
- },
165
- showEvent () {
166
- const $xeExportPanel = this
167
-
168
- $xeExportPanel.$nextTick(() => {
169
- const targetElem = ($xeExportPanel.$refs.filename || $xeExportPanel.$refs.sheetname || $xeExportPanel.$refs.confirmBtn) as HTMLInputElement
170
- if (targetElem) {
171
- targetElem.focus()
172
- }
173
- })
174
- $xeExportPanel.checkStatus()
175
- },
176
- getExportOption (): VxeTableDefines.ExportParamsObj {
177
- const $xeExportPanel = this
178
- const props = $xeExportPanel
179
-
180
- const { storeData, defaultOptions } = props
181
- const { hasMerge, columns } = storeData
182
- const checkedAll = $xeExportPanel.computeCheckedAll
183
- const supportMerge = $xeExportPanel.computeSupportMerge
184
- const expColumns = XEUtils.searchTree(columns, column => column.checked, { children: 'children', mapChildren: 'childNodes', original: true })
185
- return Object.assign({}, defaultOptions, {
186
- columns: expColumns,
187
- isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
188
- })
189
- },
190
- cancelEvent () {
191
- const $xeExportPanel = this
192
- const props = $xeExportPanel
193
-
194
- const { storeData } = props
195
- storeData.visible = false
196
- },
197
- confirmEvent () {
198
- const $xeExportPanel = this
199
- const props = $xeExportPanel
200
-
201
- const { storeData } = props
202
- if (storeData.isPrint) {
203
- $xeExportPanel.printEvent()
204
- } else {
205
- $xeExportPanel.exportEvent()
206
- }
207
- },
208
- printEvent () {
209
- const $xeExportPanel = this
210
- const props = $xeExportPanel
211
- const $xeTable = $xeExportPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
212
-
213
- const { storeData } = props
214
- storeData.visible = false
215
- $xeTable.print(Object.assign({}, $xeTable.printOpts, $xeExportPanel.getExportOption()))
216
- },
217
- exportEvent () {
218
- const $xeExportPanel = this
219
- const props = $xeExportPanel
220
- const reactData = $xeExportPanel.reactData
221
- const $xeTable = $xeExportPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
222
-
223
- const { storeData } = props
224
- const exportOpts = $xeTable.exportOpts
225
- reactData.loading = true
226
- $xeTable.exportData(Object.assign({}, exportOpts, $xeExportPanel.getExportOption())).then(() => {
227
- reactData.loading = false
228
- storeData.visible = false
229
- }).catch(() => {
230
- reactData.loading = false
231
- })
232
- },
233
-
234
- renderVN (h: CreateElement): VNode {
235
- const $xeExportPanel = this
236
- const props = $xeExportPanel
237
- const reactData = $xeExportPanel.reactData
238
-
239
- const $xeTable = $xeExportPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
240
- const $xeGrid = $xeTable.$xeGrid
241
- const $xeGantt = $xeTable.$xeGantt
242
-
243
- const { defaultOptions, storeData } = props
244
- const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData
245
- const { hasTree, hasMerge, isPrint, hasColgroup, columns } = storeData
246
- const { isHeader } = defaultOptions
247
- const colVNs: VNode[] = []
248
- const checkedAll = $xeExportPanel.computeCheckedAll
249
- const showSheet = $xeExportPanel.computeShowSheet
250
- const supportMerge = $xeExportPanel.computeSupportMerge
251
- const supportStyle = $xeExportPanel.computeSupportStyle
252
- // const supportGroup = $xeExportPanel.computeSupportGroup
253
- const slots = defaultOptions.slots || {}
254
- const topSlot = slots.top
255
- const bottomSlot = slots.bottom
256
- const defaultSlot = slots.default
257
- const footerSlot = slots.footer
258
- const parameterSlot = slots.parameter
259
- XEUtils.eachTree(columns, column => {
260
- const colTitle = formatText(column.getTitle(), 1)
261
- const isColGroup = column.children && column.children.length
262
- const isChecked = column.checked
263
- const indeterminate = column.halfChecked
264
- const isHtml = column.type === 'html'
265
- colVNs.push(
266
- h('li', {
267
- class: ['vxe-table-export--panel-column-option', `level--${column.level}`, {
268
- 'is--group': isColGroup,
269
- 'is--checked': isChecked,
270
- 'is--indeterminate': indeterminate,
271
- 'is--disabled': column.disabled
272
- }],
273
- attrs: {
274
- title: colTitle
275
- },
276
- on: {
277
- click: () => {
278
- if (!column.disabled) {
279
- $xeExportPanel.changeOption(column)
280
- }
281
- }
282
- }
283
- }, [
284
- h('span', {
285
- class: ['vxe-checkbox--icon', indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
286
- }),
287
- isHtml
288
- ? h('span', {
289
- key: '1',
290
- class: 'vxe-checkbox--label',
291
- domProps: {
292
- innerHTML: colTitle
293
- }
294
- })
295
- : h('span', {
296
- key: '0',
297
- class: 'vxe-checkbox--label'
298
- }, colTitle)
299
- ])
300
- )
301
- })
302
- return h('vxe-modal', {
303
- ref: 'modal',
304
- props: {
305
- id: 'VXE_EXPORT_MODAL',
306
- value: storeData.visible,
307
- title: getI18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
308
- width: 660,
309
- minWidth: 500,
310
- minHeight: 400,
311
- mask: true,
312
- lockView: true,
313
- showFooter: true,
314
- escClosable: true,
315
- maskClosable: true,
316
- showMaximize: true,
317
- resize: true,
318
- loading: reactData.loading
319
- },
320
- on: {
321
- input (value: any) {
322
- storeData.visible = value
323
- },
324
- show: $xeExportPanel.showEvent
325
- },
326
- scopedSlots: {
327
- default (): VNode {
328
- const params = {
329
- $table: $xeTable,
330
- $grid: $xeGrid,
331
- $gantt: $xeGantt,
332
- options: defaultOptions,
333
- columns,
334
- params: defaultOptions.params as any
335
- }
336
- const hasEmptyData = defaultOptions.mode === 'empty'
337
-
338
- return h('div', {
339
- class: 'vxe-table-export--panel'
340
- }, [
341
- topSlot
342
- ? h('div', {
343
- class: 'vxe-table-export--panel-top'
344
- }, $xeTable.callSlot(topSlot, params, h))
345
- : renderEmptyElement($xeTable),
346
- h('div', {
347
- class: 'vxe-table-export--panel-body'
348
- }, defaultSlot
349
- ? $xeTable.callSlot(defaultSlot, params, h)
350
- : [
351
- h('table', {
352
- attrs: {
353
- class: 'vxe-table-export--panel-table',
354
- cellspacing: 0,
355
- cellpadding: 0,
356
- border: 0
357
- }
358
- }, [
359
- h('tbody', [
360
- [
361
- isPrint
362
- ? renderEmptyElement($xeTable)
363
- : h('tr', [
364
- h('td', getI18n('vxe.export.expName')),
365
- h('td', [
366
- h('vxe-input', {
367
- ref: 'filename',
368
- props: {
369
- value: defaultOptions.filename,
370
- type: 'text',
371
- clearable: true,
372
- placeholder: getI18n('vxe.export.expNamePlaceholder')
373
- },
374
- on: {
375
- modelValue (value: any) {
376
- defaultOptions.filename = value
377
- }
378
- }
379
- })
380
- ])
381
- ]),
382
- isPrint
383
- ? renderEmptyElement($xeTable)
384
- : h('tr', [
385
- h('td', getI18n('vxe.export.expType')),
386
- h('td', [
387
- h('vxe-select', {
388
- props: {
389
- value: defaultOptions.type,
390
- options: storeData.typeList
391
- },
392
- on: {
393
- modelValue (value: any) {
394
- defaultOptions.type = value
395
- }
396
- }
397
- })
398
- ])
399
- ]),
400
- isPrint || showSheet
401
- ? h('tr', [
402
- h('td', getI18n('vxe.export.expSheetName')),
403
- h('td', [
404
- h('vxe-input', {
405
- ref: 'sheetname',
406
- props: {
407
- value: defaultOptions.sheetName,
408
- type: 'text',
409
- clearable: true,
410
- placeholder: getI18n('vxe.export.expSheetNamePlaceholder')
411
- },
412
- on: {
413
- modelValue (value: any) {
414
- defaultOptions.sheetName = value
415
- }
416
- }
417
- })
418
- ])
419
- ])
420
- : renderEmptyElement($xeTable),
421
- h('tr', [
422
- h('td', getI18n('vxe.export.expMode')),
423
- h('td', [
424
- h('vxe-select', {
425
- props: {
426
- value: defaultOptions.mode,
427
- options: storeData.modeList
428
- },
429
- on: {
430
- modelValue (value: any) {
431
- defaultOptions.mode = value
432
- }
433
- }
434
- })
435
- ])
436
- ]),
437
- h('tr', [
438
- h('td', [getI18n('vxe.export.expColumn')]),
439
- h('td', [
440
- h('div', {
441
- class: 'vxe-table-export--panel-column'
442
- }, [
443
- h('ul', {
444
- class: 'vxe-table-export--panel-column-header'
445
- }, [
446
- h('li', {
447
- class: ['vxe-table-export--panel-column-option', {
448
- 'is--checked': isAllChecked,
449
- 'is--indeterminate': isAllIndeterminate
450
- }],
451
- attrs: {
452
- title: getI18n('vxe.table.allTitle')
453
- },
454
- on: {
455
- click: $xeExportPanel.allColumnEvent
456
- }
457
- }, [
458
- h('span', {
459
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
460
- }),
461
- h('span', {
462
- class: 'vxe-checkbox--label'
463
- }, getI18n('vxe.export.expCurrentColumn'))
464
- ])
465
- ]),
466
- h('ul', {
467
- class: 'vxe-table-export--panel-column-body'
468
- }, colVNs)
469
- ])
470
- ])
471
- ]),
472
- h('tr', [
473
- h('td', getI18n('vxe.export.expOpts')),
474
- parameterSlot
475
- ? h('td', [
476
- h('div', {
477
- class: 'vxe-table-export--panel-option-row'
478
- }, $xeTable.callSlot(parameterSlot, params, h))
479
- ])
480
- : h('td', [
481
- h('div', {
482
- class: 'vxe-table-export--panel-option-row'
483
- }, [
484
- h('vxe-checkbox', {
485
- props: {
486
- value: hasEmptyData || isHeader,
487
- disabled: hasEmptyData,
488
- title: getI18n('vxe.export.expHeaderTitle'),
489
- content: getI18n('vxe.export.expOptHeader')
490
- },
491
- on: {
492
- input (value: any) {
493
- defaultOptions.isHeader = value
494
- }
495
- }
496
- }),
497
- h('vxe-checkbox', {
498
- props: {
499
- value: isHeader ? defaultOptions.isTitle : false,
500
- disabled: !isHeader,
501
- title: getI18n('vxe.export.expTitleTitle'),
502
- content: getI18n('vxe.export.expOptTitle')
503
- },
504
- on: {
505
- input (value: any) {
506
- defaultOptions.isTitle = value
507
- }
508
- }
509
- }),
510
- h('vxe-checkbox', {
511
- props: {
512
- value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
513
- disabled: !isHeader || !hasColgroup || !supportMerge,
514
- title: getI18n('vxe.export.expColgroupTitle'),
515
- content: getI18n('vxe.export.expOptColgroup')
516
- },
517
- on: {
518
- input (value: any) {
519
- defaultOptions.isColgroup = value
520
- }
521
- }
522
- })
523
- ]),
524
- h('div', {
525
- class: 'vxe-table-export--panel-option-row'
526
- }, [
527
- h('vxe-checkbox', {
528
- props: {
529
- value: hasEmptyData ? false : defaultOptions.original,
530
- disabled: hasEmptyData,
531
- title: getI18n('vxe.export.expOriginalTitle'),
532
- content: getI18n('vxe.export.expOptOriginal')
533
- },
534
- on: {
535
- input (value: any) {
536
- defaultOptions.original = value
537
- }
538
- }
539
- }),
540
- h('vxe-checkbox', {
541
- props: {
542
- value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
543
- disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
544
- title: getI18n('vxe.export.expMergeTitle'),
545
- content: getI18n('vxe.export.expOptMerge')
546
- },
547
- on: {
548
- input (value: any) {
549
- defaultOptions.isMerge = value
550
- }
551
- }
552
- }),
553
- isPrint
554
- ? renderEmptyElement($xeTable)
555
- : h('vxe-checkbox', {
556
- props: {
557
- value: supportStyle ? defaultOptions.useStyle : false,
558
- disabled: !supportStyle,
559
- title: getI18n('vxe.export.expUseStyleTitle'),
560
- content: getI18n('vxe.export.expOptUseStyle')
561
- },
562
- on: {
563
- input (value: any) {
564
- defaultOptions.useStyle = value
565
- }
566
- }
567
- }),
568
- h('vxe-checkbox', {
569
- props: {
570
- value: hasTree ? defaultOptions.isAllExpand : false,
571
- disabled: hasEmptyData || !hasTree,
572
- title: getI18n('vxe.export.expAllExpandTitle'),
573
- content: getI18n('vxe.export.expOptAllExpand')
574
- },
575
- on: {
576
- input (value: any) {
577
- defaultOptions.isAllExpand = value
578
- }
579
- }
580
- })
581
- ]),
582
-
583
- h('div', {
584
- class: 'vxe-table-export--panel-option-row'
585
- }, [
586
- h('vxe-checkbox', {
587
- props: {
588
- value: defaultOptions.isFooter,
589
- disabled: !storeData.hasFooter,
590
- title: getI18n('vxe.export.expFooterTitle'),
591
- content: getI18n('vxe.export.expOptFooter')
592
- },
593
- on: {
594
- input (value: any) {
595
- defaultOptions.isFooter = value
596
- }
597
- }
598
- })
599
- ])
600
- ])
601
- ])
602
- ]
603
- ])
604
- ])
605
- ]),
606
- bottomSlot
607
- ? h('div', {
608
- class: 'vxe-table-export--panel-bottom'
609
- }, $xeTable.callSlot(bottomSlot, params, h))
610
- : renderEmptyElement($xeTable)
611
- ])
612
- },
613
- footer (): VNode {
614
- const params = {
615
- $table: $xeTable,
616
- $grid: $xeGrid,
617
- $gantt: $xeGantt,
618
- options: defaultOptions,
619
- columns,
620
- params: defaultOptions.params as any
621
- }
622
- return h('div', {
623
- class: 'vxe-table-export--panel-footer'
624
- }, footerSlot
625
- ? $xeTable.callSlot(footerSlot, params, h)
626
- : [
627
- h('div', {
628
- class: 'vxe-table-export--panel-btns'
629
- }, [
630
- h('vxe-button', {
631
- props: {
632
- content: getI18n('vxe.export.expCancel')
633
- },
634
- on: {
635
- click: $xeExportPanel.cancelEvent
636
- }
637
- }),
638
- h('vxe-button', {
639
- ref: 'confirmBtn',
640
- props: {
641
- status: 'primary',
642
- content: getI18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
643
- },
644
- on: {
645
- click: $xeExportPanel.confirmEvent
646
- }
647
- })
648
- ])
649
- ])
650
- }
651
- }
652
- })
653
- }
654
- },
655
- render (h: CreateElement) {
656
- return (this as any).renderVN(h)
657
- }
658
- }) /* define-vxe-component end */
1
+ import { CreateElement, VNode, PropType } from 'vue'
2
+ import { defineVxeComponent } from '../../../ui/src/comp'
3
+ import { VxeUI } from '../../../ui'
4
+ import XEUtils from 'xe-utils'
5
+ import { formatText } from '../../../ui/src/utils'
6
+ import { errLog } from '../../../ui/src/log'
7
+
8
+ import type { VxeComponentSizeType } from 'vxe-pc-ui'
9
+ import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines } from '../../../../types'
10
+
11
+ const { getI18n, getIcon, globalMixins, renderEmptyElement } = VxeUI
12
+
13
+ export default /* define-vxe-component start */ defineVxeComponent({
14
+ name: 'VxeTableExportPanel',
15
+ mixins: [
16
+ globalMixins.sizeMixin
17
+ ],
18
+ props: {
19
+ defaultOptions: {
20
+ type: Object as PropType<VxeTableDefines.ExportParamsObj>,
21
+ default: () => ({} as VxeTableDefines.ExportParamsObj)
22
+ },
23
+ storeData: {
24
+ type: Object as PropType<VxeTableDefines.ExportStoreObj>,
25
+ default: () => ({} as VxeTableDefines.ExportStoreObj)
26
+ }
27
+ },
28
+ inject: {
29
+ $xeTable: {
30
+ default: null
31
+ }
32
+ },
33
+ data () {
34
+ const reactData = {
35
+ isAll: false,
36
+ isIndeterminate: false,
37
+ loading: false
38
+ }
39
+
40
+ return {
41
+ reactData
42
+ }
43
+ },
44
+ computed: {
45
+ ...({} as {
46
+ computeSize(): VxeComponentSizeType
47
+ $xeTable(): VxeTableConstructor & VxeTablePrivateMethods
48
+ }),
49
+ computeCheckedAll () {
50
+ const $xeExportPanel = this
51
+ const props = $xeExportPanel
52
+
53
+ const { storeData } = props
54
+ return storeData.columns.every((column) => column.checked)
55
+ },
56
+ computeShowSheet () {
57
+ const $xeExportPanel = this
58
+ const props = $xeExportPanel
59
+
60
+ const { defaultOptions } = props
61
+ return ['html', 'xml', 'xlsx', 'pdf'].indexOf(defaultOptions.type) > -1
62
+ },
63
+ computeSupportMerge () {
64
+ const $xeExportPanel = this
65
+ const props = $xeExportPanel
66
+
67
+ const { storeData, defaultOptions } = props
68
+ return !defaultOptions.original && defaultOptions.mode === 'current' && (storeData.isPrint || ['html', 'xlsx'].indexOf(defaultOptions.type) > -1)
69
+ },
70
+ // computeSupportGroup () {
71
+ // const $xeExportPanel = this
72
+ // const props = $xeExportPanel
73
+
74
+ // const { defaultOptions } = props
75
+ // return ['html', 'xlsx', 'csv', 'txt'].indexOf(defaultOptions.type) > -1
76
+ // },
77
+ computeSupportStyle () {
78
+ const $xeExportPanel = this
79
+ const props = $xeExportPanel
80
+
81
+ const { defaultOptions } = props
82
+ return !defaultOptions.original && ['xlsx'].indexOf(defaultOptions.type) > -1
83
+ }
84
+ },
85
+ created () {
86
+ const $xeTableExportPanel = this
87
+
88
+ const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
89
+ const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
90
+ const VxeUISelectComponent = VxeUI.getComponent('VxeSelect')
91
+ const VxeUIInputComponent = VxeUI.getComponent('VxeInput')
92
+ const VxeUICheckboxComponent = VxeUI.getComponent('VxeCheckbox')
93
+
94
+ $xeTableExportPanel.$nextTick(() => {
95
+ if (!VxeUIModalComponent) {
96
+ errLog('vxe.error.reqComp', ['vxe-modal'])
97
+ }
98
+ if (!VxeUIButtonComponent) {
99
+ errLog('vxe.error.reqComp', ['vxe-button'])
100
+ }
101
+ if (!VxeUISelectComponent) {
102
+ errLog('vxe.error.reqComp', ['vxe-select'])
103
+ }
104
+ if (!VxeUIInputComponent) {
105
+ errLog('vxe.error.reqComp', ['vxe-input'])
106
+ }
107
+ if (!VxeUICheckboxComponent) {
108
+ errLog('vxe.error.reqComp', ['vxe-checkbox'])
109
+ }
110
+ })
111
+ },
112
+ methods: {
113
+ changeOption (column: any) {
114
+ const $xeExportPanel = this
115
+
116
+ const isChecked = !column.checked
117
+ XEUtils.eachTree([column], (item) => {
118
+ item.checked = isChecked
119
+ item.halfChecked = false
120
+ })
121
+ $xeExportPanel.handleOptionCheck(column)
122
+ $xeExportPanel.checkStatus()
123
+ },
124
+ handleOptionCheck (column: any) {
125
+ const $xeExportPanel = this
126
+ const props = $xeExportPanel
127
+
128
+ const { storeData } = props
129
+ const matchObj = XEUtils.findTree(storeData.columns as any[], item => item === column)
130
+ if (matchObj && matchObj.parent) {
131
+ const { parent } = matchObj
132
+ if (parent.children && parent.children.length) {
133
+ parent.checked = parent.children.every((column: any) => column.checked)
134
+ parent.halfChecked = !parent.checked && parent.children.some((column: any) => column.checked || column.halfChecked)
135
+ $xeExportPanel.handleOptionCheck(parent)
136
+ }
137
+ }
138
+ },
139
+ checkStatus () {
140
+ const $xeExportPanel = this
141
+ const props = $xeExportPanel
142
+ const reactData = $xeExportPanel.reactData
143
+
144
+ const { storeData } = props
145
+ const columns = storeData.columns
146
+ reactData.isAll = columns.every((column: any) => column.disabled || column.checked)
147
+ reactData.isIndeterminate = !reactData.isAll && columns.some((column: any) => !column.disabled && (column.checked || column.halfChecked))
148
+ },
149
+ allColumnEvent () {
150
+ const $xeExportPanel = this
151
+ const props = $xeExportPanel
152
+ const reactData = $xeExportPanel.reactData
153
+
154
+ const { storeData } = props
155
+ const isAll = !reactData.isAll
156
+ XEUtils.eachTree(storeData.columns, column => {
157
+ if (!column.disabled) {
158
+ column.checked = isAll
159
+ column.halfChecked = false
160
+ }
161
+ })
162
+ reactData.isAll = isAll
163
+ $xeExportPanel.checkStatus()
164
+ },
165
+ showEvent () {
166
+ const $xeExportPanel = this
167
+
168
+ $xeExportPanel.$nextTick(() => {
169
+ const targetElem = ($xeExportPanel.$refs.filename || $xeExportPanel.$refs.sheetname || $xeExportPanel.$refs.confirmBtn) as HTMLInputElement
170
+ if (targetElem) {
171
+ targetElem.focus()
172
+ }
173
+ })
174
+ $xeExportPanel.checkStatus()
175
+ },
176
+ getExportOption (): VxeTableDefines.ExportParamsObj {
177
+ const $xeExportPanel = this
178
+ const props = $xeExportPanel
179
+
180
+ const { storeData, defaultOptions } = props
181
+ const { hasMerge, columns } = storeData
182
+ const checkedAll = $xeExportPanel.computeCheckedAll
183
+ const supportMerge = $xeExportPanel.computeSupportMerge
184
+ const expColumns = XEUtils.searchTree(columns, column => column.checked, { children: 'children', mapChildren: 'childNodes', original: true })
185
+ return Object.assign({}, defaultOptions, {
186
+ columns: expColumns,
187
+ isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
188
+ })
189
+ },
190
+ cancelEvent () {
191
+ const $xeExportPanel = this
192
+ const props = $xeExportPanel
193
+
194
+ const { storeData } = props
195
+ storeData.visible = false
196
+ },
197
+ confirmEvent () {
198
+ const $xeExportPanel = this
199
+ const props = $xeExportPanel
200
+
201
+ const { storeData } = props
202
+ if (storeData.isPrint) {
203
+ $xeExportPanel.printEvent()
204
+ } else {
205
+ $xeExportPanel.exportEvent()
206
+ }
207
+ },
208
+ printEvent () {
209
+ const $xeExportPanel = this
210
+ const props = $xeExportPanel
211
+ const $xeTable = $xeExportPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
212
+
213
+ const { storeData } = props
214
+ storeData.visible = false
215
+ $xeTable.print(Object.assign({}, $xeTable.printOpts, $xeExportPanel.getExportOption()))
216
+ },
217
+ exportEvent () {
218
+ const $xeExportPanel = this
219
+ const props = $xeExportPanel
220
+ const reactData = $xeExportPanel.reactData
221
+ const $xeTable = $xeExportPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
222
+
223
+ const { storeData } = props
224
+ const exportOpts = $xeTable.exportOpts
225
+ reactData.loading = true
226
+ $xeTable.exportData(Object.assign({}, exportOpts, $xeExportPanel.getExportOption())).then(() => {
227
+ reactData.loading = false
228
+ storeData.visible = false
229
+ }).catch(() => {
230
+ reactData.loading = false
231
+ })
232
+ },
233
+
234
+ renderVN (h: CreateElement): VNode {
235
+ const $xeExportPanel = this
236
+ const props = $xeExportPanel
237
+ const reactData = $xeExportPanel.reactData
238
+
239
+ const $xeTable = $xeExportPanel.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
240
+ const $xeGrid = $xeTable.$xeGrid
241
+ const $xeGantt = $xeTable.$xeGantt
242
+
243
+ const { defaultOptions, storeData } = props
244
+ const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData
245
+ const { hasTree, hasMerge, isPrint, hasColgroup, columns } = storeData
246
+ const { isHeader } = defaultOptions
247
+ const colVNs: VNode[] = []
248
+ const checkedAll = $xeExportPanel.computeCheckedAll
249
+ const showSheet = $xeExportPanel.computeShowSheet
250
+ const supportMerge = $xeExportPanel.computeSupportMerge
251
+ const supportStyle = $xeExportPanel.computeSupportStyle
252
+ // const supportGroup = $xeExportPanel.computeSupportGroup
253
+ const slots = defaultOptions.slots || {}
254
+ const topSlot = slots.top
255
+ const bottomSlot = slots.bottom
256
+ const defaultSlot = slots.default
257
+ const footerSlot = slots.footer
258
+ const parameterSlot = slots.parameter
259
+ XEUtils.eachTree(columns, column => {
260
+ const colTitle = formatText(column.getTitle(), 1)
261
+ const isColGroup = column.children && column.children.length
262
+ const isChecked = column.checked
263
+ const indeterminate = column.halfChecked
264
+ const isHtml = column.type === 'html'
265
+ colVNs.push(
266
+ h('li', {
267
+ class: ['vxe-table-export--panel-column-option', `level--${column.level}`, {
268
+ 'is--group': isColGroup,
269
+ 'is--checked': isChecked,
270
+ 'is--indeterminate': indeterminate,
271
+ 'is--disabled': column.disabled
272
+ }],
273
+ attrs: {
274
+ title: colTitle
275
+ },
276
+ on: {
277
+ click: () => {
278
+ if (!column.disabled) {
279
+ $xeExportPanel.changeOption(column)
280
+ }
281
+ }
282
+ }
283
+ }, [
284
+ h('span', {
285
+ class: ['vxe-checkbox--icon', indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
286
+ }),
287
+ isHtml
288
+ ? h('span', {
289
+ key: '1',
290
+ class: 'vxe-checkbox--label',
291
+ domProps: {
292
+ innerHTML: colTitle
293
+ }
294
+ })
295
+ : h('span', {
296
+ key: '0',
297
+ class: 'vxe-checkbox--label'
298
+ }, colTitle)
299
+ ])
300
+ )
301
+ })
302
+ return h('vxe-modal', {
303
+ ref: 'modal',
304
+ props: {
305
+ id: 'VXE_EXPORT_MODAL',
306
+ value: storeData.visible,
307
+ title: getI18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
308
+ width: 660,
309
+ minWidth: 500,
310
+ minHeight: 400,
311
+ mask: true,
312
+ lockView: true,
313
+ showFooter: true,
314
+ escClosable: true,
315
+ maskClosable: true,
316
+ showMaximize: true,
317
+ resize: true,
318
+ loading: reactData.loading
319
+ },
320
+ on: {
321
+ input (value: any) {
322
+ storeData.visible = value
323
+ },
324
+ show: $xeExportPanel.showEvent
325
+ },
326
+ scopedSlots: {
327
+ default (): VNode {
328
+ const params = {
329
+ $table: $xeTable,
330
+ $grid: $xeGrid,
331
+ $gantt: $xeGantt,
332
+ options: defaultOptions,
333
+ columns,
334
+ params: defaultOptions.params as any
335
+ }
336
+ const hasEmptyData = defaultOptions.mode === 'empty'
337
+
338
+ return h('div', {
339
+ class: 'vxe-table-export--panel'
340
+ }, [
341
+ topSlot
342
+ ? h('div', {
343
+ class: 'vxe-table-export--panel-top'
344
+ }, $xeTable.callSlot(topSlot, params, h))
345
+ : renderEmptyElement($xeTable),
346
+ h('div', {
347
+ class: 'vxe-table-export--panel-body'
348
+ }, defaultSlot
349
+ ? $xeTable.callSlot(defaultSlot, params, h)
350
+ : [
351
+ h('table', {
352
+ attrs: {
353
+ class: 'vxe-table-export--panel-table',
354
+ cellspacing: 0,
355
+ cellpadding: 0,
356
+ border: 0
357
+ }
358
+ }, [
359
+ h('tbody', [
360
+ [
361
+ isPrint
362
+ ? renderEmptyElement($xeTable)
363
+ : h('tr', [
364
+ h('td', getI18n('vxe.export.expName')),
365
+ h('td', [
366
+ h('vxe-input', {
367
+ ref: 'filename',
368
+ props: {
369
+ value: defaultOptions.filename,
370
+ type: 'text',
371
+ clearable: true,
372
+ placeholder: getI18n('vxe.export.expNamePlaceholder')
373
+ },
374
+ on: {
375
+ modelValue (value: any) {
376
+ defaultOptions.filename = value
377
+ }
378
+ }
379
+ })
380
+ ])
381
+ ]),
382
+ isPrint
383
+ ? renderEmptyElement($xeTable)
384
+ : h('tr', [
385
+ h('td', getI18n('vxe.export.expType')),
386
+ h('td', [
387
+ h('vxe-select', {
388
+ props: {
389
+ value: defaultOptions.type,
390
+ options: storeData.typeList
391
+ },
392
+ on: {
393
+ modelValue (value: any) {
394
+ defaultOptions.type = value
395
+ }
396
+ }
397
+ })
398
+ ])
399
+ ]),
400
+ isPrint || showSheet
401
+ ? h('tr', [
402
+ h('td', getI18n('vxe.export.expSheetName')),
403
+ h('td', [
404
+ h('vxe-input', {
405
+ ref: 'sheetname',
406
+ props: {
407
+ value: defaultOptions.sheetName,
408
+ type: 'text',
409
+ clearable: true,
410
+ placeholder: getI18n('vxe.export.expSheetNamePlaceholder')
411
+ },
412
+ on: {
413
+ modelValue (value: any) {
414
+ defaultOptions.sheetName = value
415
+ }
416
+ }
417
+ })
418
+ ])
419
+ ])
420
+ : renderEmptyElement($xeTable),
421
+ h('tr', [
422
+ h('td', getI18n('vxe.export.expMode')),
423
+ h('td', [
424
+ h('vxe-select', {
425
+ props: {
426
+ value: defaultOptions.mode,
427
+ options: storeData.modeList
428
+ },
429
+ on: {
430
+ modelValue (value: any) {
431
+ defaultOptions.mode = value
432
+ }
433
+ }
434
+ })
435
+ ])
436
+ ]),
437
+ h('tr', [
438
+ h('td', [getI18n('vxe.export.expColumn')]),
439
+ h('td', [
440
+ h('div', {
441
+ class: 'vxe-table-export--panel-column'
442
+ }, [
443
+ h('ul', {
444
+ class: 'vxe-table-export--panel-column-header'
445
+ }, [
446
+ h('li', {
447
+ class: ['vxe-table-export--panel-column-option', {
448
+ 'is--checked': isAllChecked,
449
+ 'is--indeterminate': isAllIndeterminate
450
+ }],
451
+ attrs: {
452
+ title: getI18n('vxe.table.allTitle')
453
+ },
454
+ on: {
455
+ click: $xeExportPanel.allColumnEvent
456
+ }
457
+ }, [
458
+ h('span', {
459
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
460
+ }),
461
+ h('span', {
462
+ class: 'vxe-checkbox--label'
463
+ }, getI18n('vxe.export.expCurrentColumn'))
464
+ ])
465
+ ]),
466
+ h('ul', {
467
+ class: 'vxe-table-export--panel-column-body'
468
+ }, colVNs)
469
+ ])
470
+ ])
471
+ ]),
472
+ h('tr', [
473
+ h('td', getI18n('vxe.export.expOpts')),
474
+ parameterSlot
475
+ ? h('td', [
476
+ h('div', {
477
+ class: 'vxe-table-export--panel-option-row'
478
+ }, $xeTable.callSlot(parameterSlot, params, h))
479
+ ])
480
+ : h('td', [
481
+ h('div', {
482
+ class: 'vxe-table-export--panel-option-row'
483
+ }, [
484
+ h('vxe-checkbox', {
485
+ props: {
486
+ value: hasEmptyData || isHeader,
487
+ disabled: hasEmptyData,
488
+ title: getI18n('vxe.export.expHeaderTitle'),
489
+ content: getI18n('vxe.export.expOptHeader')
490
+ },
491
+ on: {
492
+ input (value: any) {
493
+ defaultOptions.isHeader = value
494
+ }
495
+ }
496
+ }),
497
+ h('vxe-checkbox', {
498
+ props: {
499
+ value: isHeader ? defaultOptions.isTitle : false,
500
+ disabled: !isHeader,
501
+ title: getI18n('vxe.export.expTitleTitle'),
502
+ content: getI18n('vxe.export.expOptTitle')
503
+ },
504
+ on: {
505
+ input (value: any) {
506
+ defaultOptions.isTitle = value
507
+ }
508
+ }
509
+ }),
510
+ h('vxe-checkbox', {
511
+ props: {
512
+ value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
513
+ disabled: !isHeader || !hasColgroup || !supportMerge,
514
+ title: getI18n('vxe.export.expColgroupTitle'),
515
+ content: getI18n('vxe.export.expOptColgroup')
516
+ },
517
+ on: {
518
+ input (value: any) {
519
+ defaultOptions.isColgroup = value
520
+ }
521
+ }
522
+ })
523
+ ]),
524
+ h('div', {
525
+ class: 'vxe-table-export--panel-option-row'
526
+ }, [
527
+ h('vxe-checkbox', {
528
+ props: {
529
+ value: hasEmptyData ? false : defaultOptions.original,
530
+ disabled: hasEmptyData,
531
+ title: getI18n('vxe.export.expOriginalTitle'),
532
+ content: getI18n('vxe.export.expOptOriginal')
533
+ },
534
+ on: {
535
+ input (value: any) {
536
+ defaultOptions.original = value
537
+ }
538
+ }
539
+ }),
540
+ h('vxe-checkbox', {
541
+ props: {
542
+ value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
543
+ disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
544
+ title: getI18n('vxe.export.expMergeTitle'),
545
+ content: getI18n('vxe.export.expOptMerge')
546
+ },
547
+ on: {
548
+ input (value: any) {
549
+ defaultOptions.isMerge = value
550
+ }
551
+ }
552
+ }),
553
+ isPrint
554
+ ? renderEmptyElement($xeTable)
555
+ : h('vxe-checkbox', {
556
+ props: {
557
+ value: supportStyle ? defaultOptions.useStyle : false,
558
+ disabled: !supportStyle,
559
+ title: getI18n('vxe.export.expUseStyleTitle'),
560
+ content: getI18n('vxe.export.expOptUseStyle')
561
+ },
562
+ on: {
563
+ input (value: any) {
564
+ defaultOptions.useStyle = value
565
+ }
566
+ }
567
+ }),
568
+ h('vxe-checkbox', {
569
+ props: {
570
+ value: hasTree ? defaultOptions.isAllExpand : false,
571
+ disabled: hasEmptyData || !hasTree,
572
+ title: getI18n('vxe.export.expAllExpandTitle'),
573
+ content: getI18n('vxe.export.expOptAllExpand')
574
+ },
575
+ on: {
576
+ input (value: any) {
577
+ defaultOptions.isAllExpand = value
578
+ }
579
+ }
580
+ })
581
+ ]),
582
+
583
+ h('div', {
584
+ class: 'vxe-table-export--panel-option-row'
585
+ }, [
586
+ h('vxe-checkbox', {
587
+ props: {
588
+ value: defaultOptions.isFooter,
589
+ disabled: !storeData.hasFooter,
590
+ title: getI18n('vxe.export.expFooterTitle'),
591
+ content: getI18n('vxe.export.expOptFooter')
592
+ },
593
+ on: {
594
+ input (value: any) {
595
+ defaultOptions.isFooter = value
596
+ }
597
+ }
598
+ })
599
+ ])
600
+ ])
601
+ ])
602
+ ]
603
+ ])
604
+ ])
605
+ ]),
606
+ bottomSlot
607
+ ? h('div', {
608
+ class: 'vxe-table-export--panel-bottom'
609
+ }, $xeTable.callSlot(bottomSlot, params, h))
610
+ : renderEmptyElement($xeTable)
611
+ ])
612
+ },
613
+ footer (): VNode {
614
+ const params = {
615
+ $table: $xeTable,
616
+ $grid: $xeGrid,
617
+ $gantt: $xeGantt,
618
+ options: defaultOptions,
619
+ columns,
620
+ params: defaultOptions.params as any
621
+ }
622
+ return h('div', {
623
+ class: 'vxe-table-export--panel-footer'
624
+ }, footerSlot
625
+ ? $xeTable.callSlot(footerSlot, params, h)
626
+ : [
627
+ h('div', {
628
+ class: 'vxe-table-export--panel-btns'
629
+ }, [
630
+ h('vxe-button', {
631
+ props: {
632
+ content: getI18n('vxe.export.expCancel')
633
+ },
634
+ on: {
635
+ click: $xeExportPanel.cancelEvent
636
+ }
637
+ }),
638
+ h('vxe-button', {
639
+ ref: 'confirmBtn',
640
+ props: {
641
+ status: 'primary',
642
+ content: getI18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
643
+ },
644
+ on: {
645
+ click: $xeExportPanel.confirmEvent
646
+ }
647
+ })
648
+ ])
649
+ ])
650
+ }
651
+ }
652
+ })
653
+ }
654
+ },
655
+ render (h: CreateElement) {
656
+ return (this as any).renderVN(h)
657
+ }
658
+ }) /* define-vxe-component end */