vxe-table 4.23.8 → 4.23.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.
- package/dist/all.esm.js +5715 -3783
- package/es/components.d.ts +1 -0
- package/es/components.js +2 -7
- package/es/grid/src/emits.js +1 -15
- package/es/grid/src/grid.js +397 -120
- package/es/index.esm.js +1 -0
- package/es/index.js +1 -0
- package/es/table/module/custom/hook.js +49 -42
- package/es/table/module/custom/panel.js +777 -527
- package/es/table/module/edit/hook.js +140 -62
- package/es/table/module/export/export-panel.js +399 -316
- package/es/table/module/export/hook.js +395 -337
- package/es/table/module/export/import-panel.js +152 -123
- package/es/table/module/filter/hook.js +16 -2
- package/es/table/module/filter/panel.js +146 -84
- package/es/table/module/keyboard/hook.js +8 -4
- package/es/table/module/menu/panel.js +197 -126
- package/es/table/render/index.js +151 -98
- package/es/table/src/body.js +355 -233
- package/es/table/src/cell.js +426 -269
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/footer.js +144 -99
- package/es/table/src/group.js +7 -3
- package/es/table/src/header.js +229 -172
- package/es/table/src/table.js +1503 -1030
- package/es/table/src/util.js +15 -19
- package/es/toolbar/src/toolbar.js +132 -75
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +9 -6
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.d.ts +1 -1
- package/lib/components.js +2 -7
- package/lib/grid/src/emits.js +1 -15
- package/lib/grid/src/grid.js +397 -120
- package/lib/index.common.js +1 -0
- package/lib/index.js +1 -0
- package/lib/index.umd.js +5732 -3800
- package/lib/index.umd.min.js +3 -3
- package/lib/table/module/custom/hook.js +49 -42
- package/lib/table/module/custom/panel.js +777 -527
- package/lib/table/module/edit/hook.js +140 -62
- package/lib/table/module/export/export-panel.js +399 -316
- package/lib/table/module/export/hook.js +395 -337
- package/lib/table/module/export/import-panel.js +152 -123
- package/lib/table/module/filter/hook.js +16 -2
- package/lib/table/module/filter/panel.js +146 -84
- package/lib/table/module/keyboard/hook.js +8 -4
- package/lib/table/module/menu/panel.js +197 -126
- package/lib/table/render/index.js +151 -98
- package/lib/table/src/body.js +355 -233
- package/lib/table/src/cell.js +426 -269
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/footer.js +144 -99
- package/lib/table/src/group.js +7 -3
- package/lib/table/src/header.js +229 -172
- package/lib/table/src/table.js +1471 -1029
- package/lib/table/src/util.js +15 -19
- package/lib/toolbar/src/toolbar.js +132 -75
- package/lib/ui/index.js +1 -1
- package/lib/ui/src/dom.js +9 -6
- package/lib/ui/src/log.js +1 -1
- package/package.json +2 -2
- package/packages/colgroup/index.ts +22 -22
- package/packages/column/index.ts +22 -22
- package/packages/components.ts +41 -44
- package/packages/grid/index.ts +18 -18
- package/packages/grid/src/emits.ts +5 -19
- package/packages/grid/src/grid.ts +2229 -1925
- package/packages/grid/src/props.ts +22 -23
- package/packages/index.ts +11 -11
- package/packages/locale/lang/fr-FR.ts +15 -15
- package/packages/locale/lang/it-IT.ts +4 -4
- package/packages/locale/lang/uk-UA.ts +1 -1
- package/packages/locale/lang/uz-UZ.ts +13 -13
- package/packages/locale/lang/zh-CN.ts +907 -907
- package/packages/table/index.ts +26 -26
- package/packages/table/module/custom/hook.ts +510 -503
- package/packages/table/module/custom/panel.ts +2002 -1743
- package/packages/table/module/edit/hook.ts +1224 -1131
- package/packages/table/module/export/export-panel.ts +697 -611
- package/packages/table/module/export/hook.ts +2160 -2059
- package/packages/table/module/export/import-panel.ts +319 -279
- package/packages/table/module/export/util.ts +25 -24
- package/packages/table/module/filter/hook.ts +519 -501
- package/packages/table/module/filter/panel.ts +368 -304
- package/packages/table/module/keyboard/hook.ts +498 -494
- package/packages/table/module/menu/hook.ts +330 -330
- package/packages/table/module/menu/panel.ts +272 -201
- package/packages/table/module/validator/hook.ts +653 -635
- package/packages/table/render/index.ts +1819 -1744
- package/packages/table/src/body.ts +1078 -955
- package/packages/table/src/cell.ts +1524 -1359
- package/packages/table/src/column.ts +192 -192
- package/packages/table/src/columnInfo.ts +232 -232
- package/packages/table/src/emits.ts +134 -134
- package/packages/table/src/footer.ts +425 -380
- package/packages/table/src/group.ts +67 -63
- package/packages/table/src/header.ts +642 -581
- package/packages/table/src/props.ts +336 -336
- package/packages/table/src/store.ts +14 -14
- package/packages/table/src/table.ts +16011 -15454
- package/packages/table/src/use/cell-view.ts +41 -44
- package/packages/table/src/use/index.ts +1 -1
- package/packages/table/src/util.ts +1206 -1216
- package/packages/toolbar/index.ts +18 -18
- package/packages/toolbar/src/toolbar.ts +768 -706
- package/packages/ui/index.ts +519 -520
- package/packages/ui/src/anime.ts +51 -52
- package/packages/ui/src/comp.ts +3 -3
- package/packages/ui/src/dom.ts +466 -463
- package/packages/ui/src/log.ts +19 -19
- package/packages/ui/src/utils.ts +66 -66
- package/packages/ui/src/vn.ts +55 -55
- package/packages/v-x-e-table/index.d.ts +3 -3
- package/packages/v-x-e-table/index.ts +3 -3
- package/types/all.d.ts +76 -76
- package/types/index.d.ts +4 -4
- /package/dist/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/dist/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
- /package/dist/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
- /package/es/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/es/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
- /package/es/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
- /package/lib/{iconfont.1793007753347.ttf → iconfont.1793009263429.ttf} +0 -0
- /package/lib/{iconfont.1793007753347.woff → iconfont.1793009263429.woff} +0 -0
- /package/lib/{iconfont.1793007753347.woff2 → iconfont.1793009263429.woff2} +0 -0
|
@@ -1,279 +1,319 @@
|
|
|
1
|
-
import { h, ref, Ref, computed, inject, reactive, nextTick, PropType } from 'vue'
|
|
2
|
-
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
|
-
import { VxeUI } from '@vxe-ui/core'
|
|
4
|
-
import XEUtils from 'xe-utils'
|
|
5
|
-
import { getDefaultConfig, parseFile } from '../../../ui/src/utils'
|
|
6
|
-
import { createComponentLog } from '../../../ui/src/log'
|
|
7
|
-
|
|
8
|
-
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines } from '../../../../types'
|
|
9
|
-
|
|
10
|
-
const { errLog } = createComponentLog('table')
|
|
11
|
-
|
|
12
|
-
const { getI18n, getIcon, renderEmptyElement } = VxeUI
|
|
13
|
-
|
|
14
|
-
export default defineVxeComponent({
|
|
15
|
-
name: 'VxeTableImportPanel',
|
|
16
|
-
props: {
|
|
17
|
-
defaultOptions: {
|
|
18
|
-
type: Object as PropType<VxeTableDefines.ImportParamsObj>,
|
|
19
|
-
default: () => ({} as VxeTableDefines.ImportParamsObj
|
|
20
|
-
},
|
|
21
|
-
storeData: {
|
|
22
|
-
type: Object as PropType<VxeTableDefines.ImportStoreObj>,
|
|
23
|
-
default: () => ({} as VxeTableDefines.ImportStoreObj
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setup
|
|
27
|
-
const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
|
|
28
|
-
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
|
|
29
|
-
const VxeUISelectComponent = VxeUI.getComponent('VxeSelect')
|
|
30
|
-
|
|
31
|
-
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
32
|
-
const { computeImportOpts } = $xeTable.getComputeMaps()
|
|
33
|
-
|
|
34
|
-
const reactData = reactive({
|
|
35
|
-
loading: false
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
const refFileBtn = ref() as Ref<HTMLButtonElement>
|
|
39
|
-
|
|
40
|
-
const computeSelectName = computed(() => {
|
|
41
|
-
const { storeData } = props
|
|
42
|
-
return `${storeData.filename}.${storeData.type}`
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const computeHasFile = computed(() => {
|
|
46
|
-
const { storeData } = props
|
|
47
|
-
return storeData.file && storeData.type
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const computeParseTypeLabel = computed(() => {
|
|
51
|
-
const { storeData } = props
|
|
52
|
-
const { type, typeList } = storeData
|
|
53
|
-
if (type) {
|
|
54
|
-
const selectItem = XEUtils.find(typeList, item => type === item.value)
|
|
55
|
-
return `${selectItem ? selectItem.label : '*.*'}`
|
|
56
|
-
}
|
|
57
|
-
return `*.${typeList.map((item) => item.value).join(', *.')}`
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
const clearFileEvent = () => {
|
|
61
|
-
const { storeData } = props
|
|
62
|
-
Object.assign(storeData, {
|
|
63
|
-
filename: '',
|
|
64
|
-
sheetName: '',
|
|
65
|
-
type: ''
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const selectFileEvent = () => {
|
|
70
|
-
const { storeData, defaultOptions } = props
|
|
71
|
-
$xeTable
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
1
|
+
import { h, ref, Ref, computed, inject, reactive, nextTick, PropType } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
3
|
+
import { VxeUI } from '@vxe-ui/core'
|
|
4
|
+
import XEUtils from 'xe-utils'
|
|
5
|
+
import { getDefaultConfig, parseFile } from '../../../ui/src/utils'
|
|
6
|
+
import { createComponentLog } from '../../../ui/src/log'
|
|
7
|
+
|
|
8
|
+
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines } from '../../../../types'
|
|
9
|
+
|
|
10
|
+
const { errLog } = createComponentLog('table')
|
|
11
|
+
|
|
12
|
+
const { getI18n, getIcon, renderEmptyElement } = VxeUI
|
|
13
|
+
|
|
14
|
+
export default defineVxeComponent({
|
|
15
|
+
name: 'VxeTableImportPanel',
|
|
16
|
+
props: {
|
|
17
|
+
defaultOptions: {
|
|
18
|
+
type: Object as PropType<VxeTableDefines.ImportParamsObj>,
|
|
19
|
+
default: () => ({}) as VxeTableDefines.ImportParamsObj
|
|
20
|
+
},
|
|
21
|
+
storeData: {
|
|
22
|
+
type: Object as PropType<VxeTableDefines.ImportStoreObj>,
|
|
23
|
+
default: () => ({}) as VxeTableDefines.ImportStoreObj
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(props) {
|
|
27
|
+
const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
|
|
28
|
+
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton')
|
|
29
|
+
const VxeUISelectComponent = VxeUI.getComponent('VxeSelect')
|
|
30
|
+
|
|
31
|
+
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods)
|
|
32
|
+
const { computeImportOpts } = $xeTable.getComputeMaps()
|
|
33
|
+
|
|
34
|
+
const reactData = reactive({
|
|
35
|
+
loading: false
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const refFileBtn = ref() as Ref<HTMLButtonElement>
|
|
39
|
+
|
|
40
|
+
const computeSelectName = computed(() => {
|
|
41
|
+
const { storeData } = props
|
|
42
|
+
return `${storeData.filename}.${storeData.type}`
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const computeHasFile = computed(() => {
|
|
46
|
+
const { storeData } = props
|
|
47
|
+
return storeData.file && storeData.type
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const computeParseTypeLabel = computed(() => {
|
|
51
|
+
const { storeData } = props
|
|
52
|
+
const { type, typeList } = storeData
|
|
53
|
+
if (type) {
|
|
54
|
+
const selectItem = XEUtils.find(typeList, (item) => type === item.value)
|
|
55
|
+
return `${selectItem ? selectItem.label : '*.*'}`
|
|
56
|
+
}
|
|
57
|
+
return `*.${typeList.map((item) => item.value).join(', *.')}`
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const clearFileEvent = () => {
|
|
61
|
+
const { storeData } = props
|
|
62
|
+
Object.assign(storeData, {
|
|
63
|
+
filename: '',
|
|
64
|
+
sheetName: '',
|
|
65
|
+
type: ''
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const selectFileEvent = () => {
|
|
70
|
+
const { storeData, defaultOptions } = props
|
|
71
|
+
$xeTable
|
|
72
|
+
.readFile(defaultOptions)
|
|
73
|
+
.then((params) => {
|
|
74
|
+
const { file } = params
|
|
75
|
+
Object.assign(storeData, parseFile(file), { file })
|
|
76
|
+
})
|
|
77
|
+
.catch(() => {})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const showEvent = () => {
|
|
81
|
+
nextTick(() => {
|
|
82
|
+
const targetElem = refFileBtn.value
|
|
83
|
+
if (targetElem) {
|
|
84
|
+
targetElem.focus()
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const cancelEvent = () => {
|
|
90
|
+
const { storeData } = props
|
|
91
|
+
storeData.visible = false
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const importEvent = () => {
|
|
95
|
+
const { storeData, defaultOptions } = props
|
|
96
|
+
const importOpts = computeImportOpts.value
|
|
97
|
+
reactData.loading = true
|
|
98
|
+
$xeTable
|
|
99
|
+
.importByFile(storeData.file, Object.assign({}, importOpts, defaultOptions))
|
|
100
|
+
.then(() => {
|
|
101
|
+
reactData.loading = false
|
|
102
|
+
storeData.visible = false
|
|
103
|
+
})
|
|
104
|
+
.catch(() => {
|
|
105
|
+
reactData.loading = false
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const renderVN = () => {
|
|
110
|
+
const $xeGrid = $xeTable.xeGrid
|
|
111
|
+
const $xeGantt = $xeTable.xeGantt
|
|
112
|
+
|
|
113
|
+
const { defaultOptions, storeData } = props
|
|
114
|
+
const selectName = computeSelectName.value
|
|
115
|
+
const hasFile = computeHasFile.value
|
|
116
|
+
const importOpts = computeImportOpts.value
|
|
117
|
+
const parseTypeLabel = computeParseTypeLabel.value
|
|
118
|
+
const modelOptions = importOpts.modelOptions || {}
|
|
119
|
+
const settingOptions = importOpts.settingOptions || {}
|
|
120
|
+
const slots = defaultOptions.slots || {}
|
|
121
|
+
const topSlot = slots.top
|
|
122
|
+
const bottomSlot = slots.bottom
|
|
123
|
+
const defaultSlot = slots.default
|
|
124
|
+
const footerSlot = slots.footer
|
|
125
|
+
return VxeUIModalComponent
|
|
126
|
+
? h(
|
|
127
|
+
VxeUIModalComponent,
|
|
128
|
+
{
|
|
129
|
+
id: 'VXE_IMPORT_MODAL',
|
|
130
|
+
modelValue: storeData.visible,
|
|
131
|
+
title: modelOptions.title || getI18n('vxe.import.impTitle'),
|
|
132
|
+
className: 'vxe-table-export-popup-wrapper',
|
|
133
|
+
width: modelOptions.width || 540,
|
|
134
|
+
height: modelOptions.height,
|
|
135
|
+
minWidth: modelOptions.minWidth || 360,
|
|
136
|
+
minHeight: modelOptions.minHeight || 240,
|
|
137
|
+
mask: getDefaultConfig(modelOptions.mask, true),
|
|
138
|
+
lockView: getDefaultConfig(modelOptions.lockView, true),
|
|
139
|
+
showFooter: true,
|
|
140
|
+
escClosable: true,
|
|
141
|
+
maskClosable: true,
|
|
142
|
+
position: modelOptions.position,
|
|
143
|
+
fullscreen: modelOptions.fullscreen,
|
|
144
|
+
remember: modelOptions.remember,
|
|
145
|
+
showMinimize: modelOptions.showMinimize,
|
|
146
|
+
showMaximize: getDefaultConfig(modelOptions.showMaximize, true),
|
|
147
|
+
resize: getDefaultConfig(modelOptions.resize, true),
|
|
148
|
+
loading: reactData.loading,
|
|
149
|
+
'onUpdate:modelValue'(value: any) {
|
|
150
|
+
storeData.visible = value
|
|
151
|
+
},
|
|
152
|
+
onShow: showEvent
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
default: () => {
|
|
156
|
+
const params = {
|
|
157
|
+
$table: $xeTable,
|
|
158
|
+
$grid: $xeGrid,
|
|
159
|
+
$gantt: $xeGantt,
|
|
160
|
+
options: defaultOptions,
|
|
161
|
+
params: defaultOptions.params as any
|
|
162
|
+
}
|
|
163
|
+
return h(
|
|
164
|
+
'div',
|
|
165
|
+
{
|
|
166
|
+
class: 'vxe-table-export--panel'
|
|
167
|
+
},
|
|
168
|
+
[
|
|
169
|
+
topSlot
|
|
170
|
+
? h(
|
|
171
|
+
'div',
|
|
172
|
+
{
|
|
173
|
+
class: 'vxe-table-export--panel-top'
|
|
174
|
+
},
|
|
175
|
+
$xeTable.callSlot(topSlot, params)
|
|
176
|
+
)
|
|
177
|
+
: renderEmptyElement($xeTable),
|
|
178
|
+
h(
|
|
179
|
+
'div',
|
|
180
|
+
{
|
|
181
|
+
class: 'vxe-table-export--panel-body'
|
|
182
|
+
},
|
|
183
|
+
defaultSlot
|
|
184
|
+
? $xeTable.callSlot(defaultSlot, params)
|
|
185
|
+
: [
|
|
186
|
+
h(
|
|
187
|
+
'table',
|
|
188
|
+
{
|
|
189
|
+
class: 'vxe-table-export--panel-table',
|
|
190
|
+
cellspacing: 0,
|
|
191
|
+
cellpadding: 0,
|
|
192
|
+
border: 0
|
|
193
|
+
},
|
|
194
|
+
[
|
|
195
|
+
h('tbody', [
|
|
196
|
+
h('tr', [
|
|
197
|
+
h('td', getI18n('vxe.import.impFile')),
|
|
198
|
+
h('td', [
|
|
199
|
+
hasFile
|
|
200
|
+
? h(
|
|
201
|
+
'div',
|
|
202
|
+
{
|
|
203
|
+
class: 'vxe-table-export--selected--file',
|
|
204
|
+
title: selectName
|
|
205
|
+
},
|
|
206
|
+
[
|
|
207
|
+
h('span', selectName),
|
|
208
|
+
h('i', {
|
|
209
|
+
class: getIcon().INPUT_CLEAR,
|
|
210
|
+
onClick: clearFileEvent
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
)
|
|
214
|
+
: h(
|
|
215
|
+
'button',
|
|
216
|
+
{
|
|
217
|
+
ref: refFileBtn,
|
|
218
|
+
class: 'vxe-table-export--select--file',
|
|
219
|
+
onClick: selectFileEvent
|
|
220
|
+
},
|
|
221
|
+
getI18n('vxe.import.impSelect')
|
|
222
|
+
)
|
|
223
|
+
])
|
|
224
|
+
]),
|
|
225
|
+
h('tr', [h('td', getI18n('vxe.import.impType')), h('td', parseTypeLabel)]),
|
|
226
|
+
settingOptions.showMode === false
|
|
227
|
+
? renderEmptyElement($xeTable)
|
|
228
|
+
: h('tr', [
|
|
229
|
+
h('td', getI18n('vxe.import.impMode')),
|
|
230
|
+
h('td', [
|
|
231
|
+
VxeUISelectComponent
|
|
232
|
+
? h(VxeUISelectComponent, {
|
|
233
|
+
modelValue: defaultOptions.mode,
|
|
234
|
+
options: storeData.modeList,
|
|
235
|
+
'onUpdate:modelValue'(value: any) {
|
|
236
|
+
defaultOptions.mode = value
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
: renderEmptyElement($xeTable)
|
|
240
|
+
])
|
|
241
|
+
])
|
|
242
|
+
])
|
|
243
|
+
]
|
|
244
|
+
)
|
|
245
|
+
]
|
|
246
|
+
),
|
|
247
|
+
bottomSlot
|
|
248
|
+
? h(
|
|
249
|
+
'div',
|
|
250
|
+
{
|
|
251
|
+
class: 'vxe-table-export--panel-bottom'
|
|
252
|
+
},
|
|
253
|
+
$xeTable.callSlot(bottomSlot, params)
|
|
254
|
+
)
|
|
255
|
+
: renderEmptyElement($xeTable)
|
|
256
|
+
]
|
|
257
|
+
)
|
|
258
|
+
},
|
|
259
|
+
footer() {
|
|
260
|
+
const params = {
|
|
261
|
+
$table: $xeTable,
|
|
262
|
+
$grid: $xeGrid,
|
|
263
|
+
$gantt: $xeGantt,
|
|
264
|
+
options: defaultOptions,
|
|
265
|
+
params: defaultOptions.params as any
|
|
266
|
+
}
|
|
267
|
+
return h(
|
|
268
|
+
'div',
|
|
269
|
+
{
|
|
270
|
+
class: 'vxe-table-export--panel-footer'
|
|
271
|
+
},
|
|
272
|
+
footerSlot
|
|
273
|
+
? $xeTable.callSlot(footerSlot, params)
|
|
274
|
+
: [
|
|
275
|
+
h(
|
|
276
|
+
'div',
|
|
277
|
+
{
|
|
278
|
+
class: 'vxe-table-export--panel-btns'
|
|
279
|
+
},
|
|
280
|
+
[
|
|
281
|
+
VxeUIButtonComponent
|
|
282
|
+
? h(VxeUIButtonComponent, {
|
|
283
|
+
content: getI18n('vxe.import.impCancel'),
|
|
284
|
+
onClick: cancelEvent
|
|
285
|
+
})
|
|
286
|
+
: renderEmptyElement($xeTable),
|
|
287
|
+
VxeUIButtonComponent
|
|
288
|
+
? h(VxeUIButtonComponent, {
|
|
289
|
+
status: 'primary',
|
|
290
|
+
disabled: !hasFile || reactData.loading,
|
|
291
|
+
content: getI18n('vxe.import.impConfirm'),
|
|
292
|
+
onClick: importEvent
|
|
293
|
+
})
|
|
294
|
+
: renderEmptyElement($xeTable)
|
|
295
|
+
]
|
|
296
|
+
)
|
|
297
|
+
]
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
: renderEmptyElement($xeTable)
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
nextTick(() => {
|
|
306
|
+
if (!VxeUIModalComponent) {
|
|
307
|
+
errLog('vxe.error.reqComp', ['vxe-modal'])
|
|
308
|
+
}
|
|
309
|
+
if (!VxeUIButtonComponent) {
|
|
310
|
+
errLog('vxe.error.reqComp', ['vxe-button'])
|
|
311
|
+
}
|
|
312
|
+
if (!VxeUISelectComponent) {
|
|
313
|
+
errLog('vxe.error.reqComp', ['vxe-select'])
|
|
314
|
+
}
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
return renderVN
|
|
318
|
+
}
|
|
319
|
+
})
|