vxe-table 3.20.7 → 3.20.8

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 +75 -78
  6. package/es/table/src/table.js +10 -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 +1912 -3228
  15. package/lib/index.umd.min.js +1 -1
  16. package/lib/style.css +1 -1
  17. package/lib/table/src/methods.js +12 -10
  18. package/lib/table/src/methods.min.js +1 -1
  19. package/lib/table/src/table.js +9 -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 +2513 -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.1774240303597.ttf} +0 -0
  140. /package/es/{iconfont.1773991883171.woff → iconfont.1774240303597.woff} +0 -0
  141. /package/es/{iconfont.1773991883171.woff2 → iconfont.1774240303597.woff2} +0 -0
  142. /package/lib/{iconfont.1773991883171.ttf → iconfont.1774240303597.ttf} +0 -0
  143. /package/lib/{iconfont.1773991883171.woff → iconfont.1774240303597.woff} +0 -0
  144. /package/lib/{iconfont.1773991883171.woff2 → iconfont.1774240303597.woff2} +0 -0
@@ -1,319 +1,319 @@
1
- import { CreateElement, PropType } from 'vue'
2
- import { defineVxeComponent } from '../../../ui/src/comp'
3
- import { VxeUI } from '../../../ui'
4
- import XEUtils from 'xe-utils'
5
- import { parseFile } 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: 'VxeTableImportPanel',
15
- mixins: [
16
- globalMixins.sizeMixin
17
- ],
18
- props: {
19
- defaultOptions: {
20
- type: Object as PropType<VxeTableDefines.ImportParamsObj>,
21
- default: () => ({} as VxeTableDefines.ImportParamsObj)
22
- },
23
- storeData: {
24
- type: Object as PropType<VxeTableDefines.ImportStoreObj>,
25
- default: () => ({} as VxeTableDefines.ImportStoreObj)
26
- }
27
- },
28
- inject: {
29
- $xeTable: {
30
- default: null
31
- }
32
- },
33
- data () {
34
- const reactData = {
35
- loading: false
36
- }
37
-
38
- return {
39
- reactData
40
- }
41
- },
42
- computed: {
43
- ...({} as {
44
- computeSize(): VxeComponentSizeType
45
- $xeTable(): VxeTableConstructor & VxeTablePrivateMethods
46
- }),
47
- computeSelectName () {
48
- const $xeImportPanel = this
49
- const props = $xeImportPanel
50
-
51
- const { storeData } = props
52
- return `${storeData.filename}.${storeData.type}`
53
- },
54
- computeHasFile () {
55
- const $xeImportPanel = this
56
- const props = $xeImportPanel
57
-
58
- const { storeData } = props
59
- return storeData.file && storeData.type
60
- },
61
- computeParseTypeLabel () {
62
- const $xeImportPanel = this
63
- const props = $xeImportPanel
64
-
65
- const { storeData } = props
66
- const { type, typeList } = storeData
67
- if (type) {
68
- const selectItem = XEUtils.find(typeList, item => type === item.value)
69
- return `${selectItem ? selectItem.label : '*.*'}`
70
- }
71
- return `*.${typeList.map((item) => item.value).join(', *.')}`
72
- }
73
- },
74
- created () {
75
- const $xeTableImportPanel = this
76
-
77
- const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
78
- const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
79
- const VxeUISelectComponent = VxeUI.getComponent('VxeSelect')
80
-
81
- $xeTableImportPanel.$nextTick(() => {
82
- if (!VxeUIModalComponent) {
83
- errLog('vxe.error.reqComp', ['vxe-modal'])
84
- }
85
- if (!VxeUIButtonComponent) {
86
- errLog('vxe.error.reqComp', ['vxe-button'])
87
- }
88
- if (!VxeUISelectComponent) {
89
- errLog('vxe.error.reqComp', ['vxe-select'])
90
- }
91
- })
92
- },
93
- methods: {
94
- clearFileEvent () {
95
- Object.assign(this.storeData, {
96
- filename: '',
97
- sheetName: '',
98
- type: ''
99
- })
100
- },
101
- selectFileEvent () {
102
- const $xeImportPanel = this
103
- const props = $xeImportPanel
104
- const $xeTable = $xeImportPanel.$xeTable
105
-
106
- const { storeData, defaultOptions } = props
107
- $xeTable.readFile(defaultOptions).then((params) => {
108
- const { file } = params
109
- Object.assign(storeData, parseFile(file), { file })
110
- }).catch(() => {})
111
- },
112
- showEvent () {
113
- const $xeImportPanel = this
114
- $xeImportPanel.$nextTick(() => {
115
- const targetElem = $xeImportPanel.$refs.fileBtn as HTMLButtonElement
116
- if (targetElem) {
117
- targetElem.focus()
118
- }
119
- })
120
- },
121
- cancelEvent () {
122
- const $xeImportPanel = this
123
- const props = $xeImportPanel
124
-
125
- const { storeData } = props
126
- storeData.visible = false
127
- },
128
- importEvent () {
129
- const $xeImportPanel = this
130
- const props = $xeImportPanel
131
- const reactData = $xeImportPanel.reactData
132
- const $xeTable = $xeImportPanel.$xeTable
133
-
134
- const { storeData, defaultOptions } = props
135
- const importOpts = $xeTable.computeImportOpts
136
- reactData.loading = true
137
- $xeTable.importByFile(storeData.file, Object.assign({}, importOpts, defaultOptions)).then(() => {
138
- reactData.loading = false
139
- storeData.visible = false
140
- }).catch(() => {
141
- reactData.loading = false
142
- })
143
- },
144
- renderVN (h: CreateElement) {
145
- const $xeImportPanel = this
146
- const props = $xeImportPanel
147
- const reactData = $xeImportPanel.reactData
148
- const $xeTable = $xeImportPanel.$xeTable
149
- const $xeGrid = $xeTable.$xeGrid
150
- const $xeGantt = $xeTable.$xeGantt
151
-
152
- const { defaultOptions, storeData } = props
153
- const selectName = $xeImportPanel.computeSelectName as string
154
- const hasFile = $xeImportPanel.computeHasFile
155
- const parseTypeLabel = $xeImportPanel.computeParseTypeLabel as string
156
- const slots = defaultOptions.slots || {}
157
- const topSlot = slots.top
158
- const bottomSlot = slots.bottom
159
- const defaultSlot = slots.default
160
- const footerSlot = slots.footer
161
- return h('vxe-modal', {
162
- ref: 'modal',
163
- props: {
164
- id: 'VXE_IMPORT_MODAL',
165
- value: storeData.visible,
166
- title: getI18n('vxe.import.impTitle'),
167
- width: 540,
168
- minWidth: 360,
169
- minHeight: 240,
170
- mask: true,
171
- lockView: true,
172
- showFooter: true,
173
- escClosable: true,
174
- maskClosable: true,
175
- showMaximize: true,
176
- resize: true,
177
- loading: reactData.loading
178
- },
179
- on: {
180
- input (value: any) {
181
- storeData.visible = value
182
- },
183
- show: $xeImportPanel.showEvent
184
- },
185
- scopedSlots: {
186
- default: () => {
187
- const params = {
188
- $table: $xeTable,
189
- $grid: $xeGrid,
190
- $gantt: $xeGantt,
191
- options: defaultOptions,
192
- params: defaultOptions.params as any
193
- }
194
-
195
- return h('div', {
196
- class: 'vxe-table-export--panel'
197
- }, [
198
- topSlot
199
- ? h('div', {
200
- class: 'vxe-table-export--panel-top'
201
- }, $xeTable.callSlot(topSlot, params, h))
202
- : renderEmptyElement($xeTable),
203
- h('div', {
204
- class: 'vxe-table-export--panel-body'
205
- }, defaultSlot
206
- ? $xeTable.callSlot(defaultSlot, params, h)
207
- : [
208
- h('table', {
209
- class: 'vxe-table-export--panel-table',
210
- attrs: {
211
- cellspacing: 0,
212
- cellpadding: 0,
213
- border: 0
214
- }
215
- }, [
216
- h('tbody', [
217
- h('tr', [
218
- h('td', getI18n('vxe.import.impFile')),
219
- h('td', [
220
- hasFile
221
- ? h('div', {
222
- class: 'vxe-table-export--selected--file',
223
- attrs: {
224
- title: selectName
225
- }
226
- }, [
227
- h('span', selectName),
228
- h('i', {
229
- class: getIcon().INPUT_CLEAR,
230
- on: {
231
- click: $xeImportPanel.clearFileEvent
232
- }
233
- })
234
- ])
235
- : h('button', {
236
- ref: 'fileBtn',
237
- class: 'vxe-table-export--select--file',
238
- attrs: {
239
- type: 'button'
240
- },
241
- on: {
242
- click: $xeImportPanel.selectFileEvent
243
- }
244
- }, getI18n('vxe.import.impSelect'))
245
- ])
246
- ]),
247
- h('tr', [
248
- h('td', getI18n('vxe.import.impType')),
249
- h('td', parseTypeLabel)
250
- ]),
251
- h('tr', [
252
- h('td', getI18n('vxe.import.impMode')),
253
- h('td', [
254
- h('vxe-select', {
255
- props: {
256
- value: defaultOptions.mode,
257
- options: storeData.modeList
258
- },
259
- on: {
260
- modelValue (value: any) {
261
- defaultOptions.mode = value
262
- }
263
- }
264
- })
265
- ])
266
- ])
267
- ])
268
- ])
269
- ]
270
- ),
271
- bottomSlot
272
- ? h('div', {
273
- class: 'vxe-table-export--panel-bottom'
274
- }, $xeTable.callSlot(bottomSlot, params, h))
275
- : renderEmptyElement($xeTable)
276
- ])
277
- },
278
- footer: () => {
279
- const params = {
280
- $table: $xeTable,
281
- $grid: $xeGrid,
282
- $gantt: $xeGantt,
283
- options: defaultOptions,
284
- params: defaultOptions.params as any
285
- }
286
- return h('div', {
287
- class: 'vxe-table-export--panel-footer'
288
- }, footerSlot
289
- ? $xeTable.callSlot(footerSlot, params, h)
290
- : [
291
- h('div', {
292
- class: 'vxe-table-export--panel-btns'
293
- }, [
294
- h('vxe-button', {
295
- on: {
296
- click: $xeImportPanel.cancelEvent
297
- }
298
- }, getI18n('vxe.import.impCancel')),
299
- h('vxe-button', {
300
- props: {
301
- status: 'primary',
302
- disabled: !hasFile || reactData.loading
303
- },
304
- on: {
305
- click: $xeImportPanel.importEvent
306
- }
307
- }, getI18n('vxe.import.impConfirm'))
308
- ])
309
- ]
310
- )
311
- }
312
- }
313
- })
314
- }
315
- },
316
- render (h: CreateElement) {
317
- return (this as any).renderVN(h)
318
- }
319
- }) /* define-vxe-component end */
1
+ import { CreateElement, PropType } from 'vue'
2
+ import { defineVxeComponent } from '../../../ui/src/comp'
3
+ import { VxeUI } from '../../../ui'
4
+ import XEUtils from 'xe-utils'
5
+ import { parseFile } 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: 'VxeTableImportPanel',
15
+ mixins: [
16
+ globalMixins.sizeMixin
17
+ ],
18
+ props: {
19
+ defaultOptions: {
20
+ type: Object as PropType<VxeTableDefines.ImportParamsObj>,
21
+ default: () => ({} as VxeTableDefines.ImportParamsObj)
22
+ },
23
+ storeData: {
24
+ type: Object as PropType<VxeTableDefines.ImportStoreObj>,
25
+ default: () => ({} as VxeTableDefines.ImportStoreObj)
26
+ }
27
+ },
28
+ inject: {
29
+ $xeTable: {
30
+ default: null
31
+ }
32
+ },
33
+ data () {
34
+ const reactData = {
35
+ loading: false
36
+ }
37
+
38
+ return {
39
+ reactData
40
+ }
41
+ },
42
+ computed: {
43
+ ...({} as {
44
+ computeSize(): VxeComponentSizeType
45
+ $xeTable(): VxeTableConstructor & VxeTablePrivateMethods
46
+ }),
47
+ computeSelectName () {
48
+ const $xeImportPanel = this
49
+ const props = $xeImportPanel
50
+
51
+ const { storeData } = props
52
+ return `${storeData.filename}.${storeData.type}`
53
+ },
54
+ computeHasFile () {
55
+ const $xeImportPanel = this
56
+ const props = $xeImportPanel
57
+
58
+ const { storeData } = props
59
+ return storeData.file && storeData.type
60
+ },
61
+ computeParseTypeLabel () {
62
+ const $xeImportPanel = this
63
+ const props = $xeImportPanel
64
+
65
+ const { storeData } = props
66
+ const { type, typeList } = storeData
67
+ if (type) {
68
+ const selectItem = XEUtils.find(typeList, item => type === item.value)
69
+ return `${selectItem ? selectItem.label : '*.*'}`
70
+ }
71
+ return `*.${typeList.map((item) => item.value).join(', *.')}`
72
+ }
73
+ },
74
+ created () {
75
+ const $xeTableImportPanel = this
76
+
77
+ const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
78
+ const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
79
+ const VxeUISelectComponent = VxeUI.getComponent('VxeSelect')
80
+
81
+ $xeTableImportPanel.$nextTick(() => {
82
+ if (!VxeUIModalComponent) {
83
+ errLog('vxe.error.reqComp', ['vxe-modal'])
84
+ }
85
+ if (!VxeUIButtonComponent) {
86
+ errLog('vxe.error.reqComp', ['vxe-button'])
87
+ }
88
+ if (!VxeUISelectComponent) {
89
+ errLog('vxe.error.reqComp', ['vxe-select'])
90
+ }
91
+ })
92
+ },
93
+ methods: {
94
+ clearFileEvent () {
95
+ Object.assign(this.storeData, {
96
+ filename: '',
97
+ sheetName: '',
98
+ type: ''
99
+ })
100
+ },
101
+ selectFileEvent () {
102
+ const $xeImportPanel = this
103
+ const props = $xeImportPanel
104
+ const $xeTable = $xeImportPanel.$xeTable
105
+
106
+ const { storeData, defaultOptions } = props
107
+ $xeTable.readFile(defaultOptions).then((params) => {
108
+ const { file } = params
109
+ Object.assign(storeData, parseFile(file), { file })
110
+ }).catch(() => {})
111
+ },
112
+ showEvent () {
113
+ const $xeImportPanel = this
114
+ $xeImportPanel.$nextTick(() => {
115
+ const targetElem = $xeImportPanel.$refs.fileBtn as HTMLButtonElement
116
+ if (targetElem) {
117
+ targetElem.focus()
118
+ }
119
+ })
120
+ },
121
+ cancelEvent () {
122
+ const $xeImportPanel = this
123
+ const props = $xeImportPanel
124
+
125
+ const { storeData } = props
126
+ storeData.visible = false
127
+ },
128
+ importEvent () {
129
+ const $xeImportPanel = this
130
+ const props = $xeImportPanel
131
+ const reactData = $xeImportPanel.reactData
132
+ const $xeTable = $xeImportPanel.$xeTable
133
+
134
+ const { storeData, defaultOptions } = props
135
+ const importOpts = $xeTable.computeImportOpts
136
+ reactData.loading = true
137
+ $xeTable.importByFile(storeData.file, Object.assign({}, importOpts, defaultOptions)).then(() => {
138
+ reactData.loading = false
139
+ storeData.visible = false
140
+ }).catch(() => {
141
+ reactData.loading = false
142
+ })
143
+ },
144
+ renderVN (h: CreateElement) {
145
+ const $xeImportPanel = this
146
+ const props = $xeImportPanel
147
+ const reactData = $xeImportPanel.reactData
148
+ const $xeTable = $xeImportPanel.$xeTable
149
+ const $xeGrid = $xeTable.$xeGrid
150
+ const $xeGantt = $xeTable.$xeGantt
151
+
152
+ const { defaultOptions, storeData } = props
153
+ const selectName = $xeImportPanel.computeSelectName as string
154
+ const hasFile = $xeImportPanel.computeHasFile
155
+ const parseTypeLabel = $xeImportPanel.computeParseTypeLabel as string
156
+ const slots = defaultOptions.slots || {}
157
+ const topSlot = slots.top
158
+ const bottomSlot = slots.bottom
159
+ const defaultSlot = slots.default
160
+ const footerSlot = slots.footer
161
+ return h('vxe-modal', {
162
+ ref: 'modal',
163
+ props: {
164
+ id: 'VXE_IMPORT_MODAL',
165
+ value: storeData.visible,
166
+ title: getI18n('vxe.import.impTitle'),
167
+ width: 540,
168
+ minWidth: 360,
169
+ minHeight: 240,
170
+ mask: true,
171
+ lockView: true,
172
+ showFooter: true,
173
+ escClosable: true,
174
+ maskClosable: true,
175
+ showMaximize: true,
176
+ resize: true,
177
+ loading: reactData.loading
178
+ },
179
+ on: {
180
+ input (value: any) {
181
+ storeData.visible = value
182
+ },
183
+ show: $xeImportPanel.showEvent
184
+ },
185
+ scopedSlots: {
186
+ default: () => {
187
+ const params = {
188
+ $table: $xeTable,
189
+ $grid: $xeGrid,
190
+ $gantt: $xeGantt,
191
+ options: defaultOptions,
192
+ params: defaultOptions.params as any
193
+ }
194
+
195
+ return h('div', {
196
+ class: 'vxe-table-export--panel'
197
+ }, [
198
+ topSlot
199
+ ? h('div', {
200
+ class: 'vxe-table-export--panel-top'
201
+ }, $xeTable.callSlot(topSlot, params, h))
202
+ : renderEmptyElement($xeTable),
203
+ h('div', {
204
+ class: 'vxe-table-export--panel-body'
205
+ }, defaultSlot
206
+ ? $xeTable.callSlot(defaultSlot, params, h)
207
+ : [
208
+ h('table', {
209
+ class: 'vxe-table-export--panel-table',
210
+ attrs: {
211
+ cellspacing: 0,
212
+ cellpadding: 0,
213
+ border: 0
214
+ }
215
+ }, [
216
+ h('tbody', [
217
+ h('tr', [
218
+ h('td', getI18n('vxe.import.impFile')),
219
+ h('td', [
220
+ hasFile
221
+ ? h('div', {
222
+ class: 'vxe-table-export--selected--file',
223
+ attrs: {
224
+ title: selectName
225
+ }
226
+ }, [
227
+ h('span', selectName),
228
+ h('i', {
229
+ class: getIcon().INPUT_CLEAR,
230
+ on: {
231
+ click: $xeImportPanel.clearFileEvent
232
+ }
233
+ })
234
+ ])
235
+ : h('button', {
236
+ ref: 'fileBtn',
237
+ class: 'vxe-table-export--select--file',
238
+ attrs: {
239
+ type: 'button'
240
+ },
241
+ on: {
242
+ click: $xeImportPanel.selectFileEvent
243
+ }
244
+ }, getI18n('vxe.import.impSelect'))
245
+ ])
246
+ ]),
247
+ h('tr', [
248
+ h('td', getI18n('vxe.import.impType')),
249
+ h('td', parseTypeLabel)
250
+ ]),
251
+ h('tr', [
252
+ h('td', getI18n('vxe.import.impMode')),
253
+ h('td', [
254
+ h('vxe-select', {
255
+ props: {
256
+ value: defaultOptions.mode,
257
+ options: storeData.modeList
258
+ },
259
+ on: {
260
+ modelValue (value: any) {
261
+ defaultOptions.mode = value
262
+ }
263
+ }
264
+ })
265
+ ])
266
+ ])
267
+ ])
268
+ ])
269
+ ]
270
+ ),
271
+ bottomSlot
272
+ ? h('div', {
273
+ class: 'vxe-table-export--panel-bottom'
274
+ }, $xeTable.callSlot(bottomSlot, params, h))
275
+ : renderEmptyElement($xeTable)
276
+ ])
277
+ },
278
+ footer: () => {
279
+ const params = {
280
+ $table: $xeTable,
281
+ $grid: $xeGrid,
282
+ $gantt: $xeGantt,
283
+ options: defaultOptions,
284
+ params: defaultOptions.params as any
285
+ }
286
+ return h('div', {
287
+ class: 'vxe-table-export--panel-footer'
288
+ }, footerSlot
289
+ ? $xeTable.callSlot(footerSlot, params, h)
290
+ : [
291
+ h('div', {
292
+ class: 'vxe-table-export--panel-btns'
293
+ }, [
294
+ h('vxe-button', {
295
+ on: {
296
+ click: $xeImportPanel.cancelEvent
297
+ }
298
+ }, getI18n('vxe.import.impCancel')),
299
+ h('vxe-button', {
300
+ props: {
301
+ status: 'primary',
302
+ disabled: !hasFile || reactData.loading
303
+ },
304
+ on: {
305
+ click: $xeImportPanel.importEvent
306
+ }
307
+ }, getI18n('vxe.import.impConfirm'))
308
+ ])
309
+ ]
310
+ )
311
+ }
312
+ }
313
+ })
314
+ }
315
+ },
316
+ render (h: CreateElement) {
317
+ return (this as any).renderVN(h)
318
+ }
319
+ }) /* define-vxe-component end */