vxe-table 3.19.39 → 3.20.0-beta.1
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/es/index.css +1 -1
- package/es/index.esm.js +2 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +6 -4
- package/es/table/module/custom/panel.js +806 -799
- package/es/table/module/edit/mixin.js +43 -31
- package/es/table/module/export/export-panel.js +511 -458
- package/es/table/module/export/import-panel.js +224 -192
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/module/menu/panel.js +165 -161
- package/es/table/module/validator/mixin.js +255 -236
- package/es/table/src/body.js +2 -1
- package/es/table/src/cell.js +2 -2
- package/es/table/src/methods.js +33 -43
- package/es/table/src/table.js +13 -249
- package/es/table/src/util.js +242 -0
- package/es/table/style.css +23 -50
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/dom.js +22 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +23 -50
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.common.js +2 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +3640 -4790
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +6 -4
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +693 -685
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +47 -31
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +450 -384
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +200 -159
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +119 -114
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +271 -259
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/body.js +2 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +2 -2
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +33 -45
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +12 -248
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +243 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +23 -50
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +22 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +2 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +2 -1
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +2 -1
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +2 -1
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-table/index.js +2 -1
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +23 -50
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +2 -1
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-ui/index.js +2 -1
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +2 -1
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/mixin.ts +7 -4
- package/packages/table/module/custom/panel.ts +846 -839
- package/packages/table/module/edit/mixin.ts +55 -35
- package/packages/table/module/export/export-panel.ts +545 -469
- package/packages/table/module/export/import-panel.ts +245 -202
- package/packages/table/module/filter/panel.ts +4 -18
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/module/menu/panel.ts +171 -163
- package/packages/table/module/validator/mixin.ts +279 -240
- package/packages/table/src/body.ts +2 -1
- package/packages/table/src/cell.ts +2 -2
- package/packages/table/src/methods.ts +43 -45
- package/packages/table/src/table.ts +14 -260
- package/packages/table/src/util.ts +254 -0
- package/packages/ui/index.ts +1 -1
- package/packages/ui/src/dom.ts +22 -0
- package/styles/components/table.scss +5 -2
- package/styles/theme/base.scss +2 -1
- /package/es/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
- /package/es/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
- /package/es/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
- /package/lib/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
- /package/lib/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
- /package/lib/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { CreateElement } from 'vue'
|
|
1
|
+
import { CreateElement, PropType } from 'vue'
|
|
2
|
+
import { defineVxeComponent } from '../../../ui/src/comp'
|
|
2
3
|
import { VxeUI } from '../../../ui'
|
|
3
4
|
import XEUtils from 'xe-utils'
|
|
4
5
|
import { parseFile } from '../../../ui/src/utils'
|
|
5
6
|
import { errLog } from '../../../ui/src/log'
|
|
6
7
|
|
|
7
|
-
import type {
|
|
8
|
+
import type { VxeComponentSizeType } from 'vxe-pc-ui'
|
|
9
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines } from '../../../../types'
|
|
8
10
|
|
|
9
11
|
const { getI18n, getIcon, globalMixins, renderEmptyElement } = VxeUI
|
|
10
12
|
|
|
11
|
-
export default {
|
|
13
|
+
export default /* define-vxe-component start */ defineVxeComponent({
|
|
12
14
|
name: 'VxeTableImportPanel',
|
|
13
15
|
mixins: [
|
|
14
16
|
globalMixins.sizeMixin
|
|
15
17
|
],
|
|
16
18
|
props: {
|
|
17
|
-
defaultOptions:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
|
23
27
|
},
|
|
24
28
|
inject: {
|
|
25
29
|
$xeTable: {
|
|
@@ -27,28 +31,47 @@ export default {
|
|
|
27
31
|
}
|
|
28
32
|
},
|
|
29
33
|
data () {
|
|
30
|
-
|
|
34
|
+
const reactData = {
|
|
31
35
|
loading: false
|
|
32
36
|
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
reactData
|
|
40
|
+
}
|
|
33
41
|
},
|
|
34
42
|
computed: {
|
|
35
|
-
|
|
36
|
-
|
|
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}`
|
|
37
53
|
},
|
|
38
|
-
|
|
39
|
-
|
|
54
|
+
computeHasFile () {
|
|
55
|
+
const $xeImportPanel = this
|
|
56
|
+
const props = $xeImportPanel
|
|
57
|
+
|
|
58
|
+
const { storeData } = props
|
|
59
|
+
return storeData.file && storeData.type
|
|
40
60
|
},
|
|
41
|
-
|
|
42
|
-
const
|
|
61
|
+
computeParseTypeLabel () {
|
|
62
|
+
const $xeImportPanel = this
|
|
63
|
+
const props = $xeImportPanel
|
|
64
|
+
|
|
65
|
+
const { storeData } = props
|
|
43
66
|
const { type, typeList } = storeData
|
|
44
67
|
if (type) {
|
|
45
68
|
const selectItem = XEUtils.find(typeList, item => type === item.value)
|
|
46
|
-
return selectItem ? selectItem.label : '*.*'
|
|
69
|
+
return `${selectItem ? selectItem.label : '*.*'}`
|
|
47
70
|
}
|
|
48
|
-
return `*.${typeList.map((item
|
|
71
|
+
return `*.${typeList.map((item) => item.value).join(', *.')}`
|
|
49
72
|
}
|
|
50
|
-
}
|
|
51
|
-
created (
|
|
73
|
+
},
|
|
74
|
+
created () {
|
|
52
75
|
const $xeTableImportPanel = this
|
|
53
76
|
|
|
54
77
|
const VxeUIModalComponent = VxeUI.getComponent('VxeModal')
|
|
@@ -67,172 +90,6 @@ export default {
|
|
|
67
90
|
}
|
|
68
91
|
})
|
|
69
92
|
},
|
|
70
|
-
render (this: any, h: CreateElement) {
|
|
71
|
-
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
72
|
-
const $xeGrid = $xeTable.$xeGrid
|
|
73
|
-
const $xeGantt = $xeTable.$xeGantt
|
|
74
|
-
|
|
75
|
-
const { hasFile, loading, parseTypeLabel, defaultOptions, storeData, selectName } = this
|
|
76
|
-
const slots = defaultOptions.slots || {}
|
|
77
|
-
const topSlot = slots.top
|
|
78
|
-
const bottomSlot = slots.bottom
|
|
79
|
-
const defaultSlot = slots.default
|
|
80
|
-
const footerSlot = slots.footer
|
|
81
|
-
|
|
82
|
-
return h('vxe-modal', {
|
|
83
|
-
ref: 'modal',
|
|
84
|
-
props: {
|
|
85
|
-
id: 'VXE_IMPORT_MODAL',
|
|
86
|
-
value: storeData.visible,
|
|
87
|
-
title: getI18n('vxe.import.impTitle'),
|
|
88
|
-
width: 540,
|
|
89
|
-
minWidth: 360,
|
|
90
|
-
minHeight: 240,
|
|
91
|
-
mask: true,
|
|
92
|
-
lockView: true,
|
|
93
|
-
showFooter: true,
|
|
94
|
-
escClosable: true,
|
|
95
|
-
maskClosable: true,
|
|
96
|
-
showMaximize: true,
|
|
97
|
-
resize: true,
|
|
98
|
-
loading
|
|
99
|
-
},
|
|
100
|
-
on: {
|
|
101
|
-
input (value: any) {
|
|
102
|
-
storeData.visible = value
|
|
103
|
-
},
|
|
104
|
-
show: this.showEvent
|
|
105
|
-
},
|
|
106
|
-
scopedSlots: {
|
|
107
|
-
default: () => {
|
|
108
|
-
const params = {
|
|
109
|
-
$table: $xeTable,
|
|
110
|
-
$grid: $xeGrid,
|
|
111
|
-
$gantt: $xeGantt,
|
|
112
|
-
options: defaultOptions,
|
|
113
|
-
params: defaultOptions.params as any
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return h('div', {
|
|
117
|
-
class: 'vxe-table-export--panel'
|
|
118
|
-
}, [
|
|
119
|
-
topSlot
|
|
120
|
-
? h('div', {
|
|
121
|
-
class: 'vxe-table-export--panel-top'
|
|
122
|
-
}, $xeTable.callSlot(topSlot, params, h))
|
|
123
|
-
: renderEmptyElement(this),
|
|
124
|
-
h('div', {
|
|
125
|
-
class: 'vxe-table-export--panel-body'
|
|
126
|
-
}, defaultSlot
|
|
127
|
-
? $xeTable.callSlot(defaultSlot, params, h)
|
|
128
|
-
: [
|
|
129
|
-
h('table', {
|
|
130
|
-
class: 'vxe-table-export--panel-table',
|
|
131
|
-
attrs: {
|
|
132
|
-
cellspacing: 0,
|
|
133
|
-
cellpadding: 0,
|
|
134
|
-
border: 0
|
|
135
|
-
}
|
|
136
|
-
}, [
|
|
137
|
-
h('tbody', [
|
|
138
|
-
h('tr', [
|
|
139
|
-
h('td', getI18n('vxe.import.impFile')),
|
|
140
|
-
h('td', [
|
|
141
|
-
hasFile
|
|
142
|
-
? h('div', {
|
|
143
|
-
class: 'vxe-table-export--selected--file',
|
|
144
|
-
attrs: {
|
|
145
|
-
title: selectName
|
|
146
|
-
}
|
|
147
|
-
}, [
|
|
148
|
-
h('span', selectName),
|
|
149
|
-
h('i', {
|
|
150
|
-
class: getIcon().INPUT_CLEAR,
|
|
151
|
-
on: {
|
|
152
|
-
click: this.clearFileEvent
|
|
153
|
-
}
|
|
154
|
-
})
|
|
155
|
-
])
|
|
156
|
-
: h('button', {
|
|
157
|
-
ref: 'fileBtn',
|
|
158
|
-
class: 'vxe-table-export--select--file',
|
|
159
|
-
attrs: {
|
|
160
|
-
type: 'button'
|
|
161
|
-
},
|
|
162
|
-
on: {
|
|
163
|
-
click: this.selectFileEvent
|
|
164
|
-
}
|
|
165
|
-
}, getI18n('vxe.import.impSelect'))
|
|
166
|
-
])
|
|
167
|
-
]),
|
|
168
|
-
h('tr', [
|
|
169
|
-
h('td', getI18n('vxe.import.impType')),
|
|
170
|
-
h('td', parseTypeLabel)
|
|
171
|
-
]),
|
|
172
|
-
h('tr', [
|
|
173
|
-
h('td', getI18n('vxe.import.impMode')),
|
|
174
|
-
h('td', [
|
|
175
|
-
h('vxe-select', {
|
|
176
|
-
props: {
|
|
177
|
-
value: defaultOptions.mode,
|
|
178
|
-
options: storeData.modeList
|
|
179
|
-
},
|
|
180
|
-
on: {
|
|
181
|
-
modelValue (value: any) {
|
|
182
|
-
defaultOptions.mode = value
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
})
|
|
186
|
-
])
|
|
187
|
-
])
|
|
188
|
-
])
|
|
189
|
-
])
|
|
190
|
-
]
|
|
191
|
-
),
|
|
192
|
-
bottomSlot
|
|
193
|
-
? h('div', {
|
|
194
|
-
class: 'vxe-table-export--panel-bottom'
|
|
195
|
-
}, $xeTable.callSlot(bottomSlot, params, h))
|
|
196
|
-
: renderEmptyElement(this)
|
|
197
|
-
])
|
|
198
|
-
},
|
|
199
|
-
footer: () => {
|
|
200
|
-
const params = {
|
|
201
|
-
$table: $xeTable,
|
|
202
|
-
$grid: $xeGrid,
|
|
203
|
-
$gantt: $xeGantt,
|
|
204
|
-
options: defaultOptions,
|
|
205
|
-
params: defaultOptions.params as any
|
|
206
|
-
}
|
|
207
|
-
return h('div', {
|
|
208
|
-
class: 'vxe-table-export--panel-footer'
|
|
209
|
-
}, footerSlot
|
|
210
|
-
? $xeTable.callSlot(footerSlot, params, h)
|
|
211
|
-
: [
|
|
212
|
-
h('div', {
|
|
213
|
-
class: 'vxe-table-export--panel-btns'
|
|
214
|
-
}, [
|
|
215
|
-
h('vxe-button', {
|
|
216
|
-
on: {
|
|
217
|
-
click: this.cancelEvent
|
|
218
|
-
}
|
|
219
|
-
}, getI18n('vxe.import.impCancel')),
|
|
220
|
-
h('vxe-button', {
|
|
221
|
-
props: {
|
|
222
|
-
status: 'primary',
|
|
223
|
-
disabled: !hasFile || loading
|
|
224
|
-
},
|
|
225
|
-
on: {
|
|
226
|
-
click: this.importEvent
|
|
227
|
-
}
|
|
228
|
-
}, getI18n('vxe.import.impConfirm'))
|
|
229
|
-
])
|
|
230
|
-
]
|
|
231
|
-
)
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
})
|
|
235
|
-
},
|
|
236
93
|
methods: {
|
|
237
94
|
clearFileEvent () {
|
|
238
95
|
Object.assign(this.storeData, {
|
|
@@ -242,35 +99,221 @@ export default {
|
|
|
242
99
|
})
|
|
243
100
|
},
|
|
244
101
|
selectFileEvent () {
|
|
245
|
-
const $
|
|
102
|
+
const $xeImportPanel = this
|
|
103
|
+
const props = $xeImportPanel
|
|
104
|
+
const $xeTable = $xeImportPanel.$xeTable
|
|
246
105
|
|
|
247
|
-
|
|
106
|
+
const { storeData, defaultOptions } = props
|
|
107
|
+
$xeTable.readFile(defaultOptions).then((params) => {
|
|
248
108
|
const { file } = params
|
|
249
|
-
Object.assign(
|
|
250
|
-
}).catch((
|
|
109
|
+
Object.assign(storeData, parseFile(file), { file })
|
|
110
|
+
}).catch(() => {})
|
|
251
111
|
},
|
|
252
112
|
showEvent () {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const targetElem = $refs.fileBtn
|
|
113
|
+
const $xeImportPanel = this
|
|
114
|
+
$xeImportPanel.$nextTick(() => {
|
|
115
|
+
const targetElem = $xeImportPanel.$refs.fileBtn as HTMLButtonElement
|
|
256
116
|
if (targetElem) {
|
|
257
117
|
targetElem.focus()
|
|
258
118
|
}
|
|
259
119
|
})
|
|
260
120
|
},
|
|
261
121
|
cancelEvent () {
|
|
262
|
-
|
|
122
|
+
const $xeImportPanel = this
|
|
123
|
+
const props = $xeImportPanel
|
|
124
|
+
|
|
125
|
+
const { storeData } = props
|
|
126
|
+
storeData.visible = false
|
|
263
127
|
},
|
|
264
128
|
importEvent () {
|
|
265
|
-
const $
|
|
129
|
+
const $xeImportPanel = this
|
|
130
|
+
const props = $xeImportPanel
|
|
131
|
+
const reactData = $xeImportPanel.reactData
|
|
132
|
+
const $xeTable = $xeImportPanel.$xeTable
|
|
266
133
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
|
271
140
|
}).catch(() => {
|
|
272
|
-
|
|
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
|
+
}
|
|
273
313
|
})
|
|
274
314
|
}
|
|
275
|
-
}
|
|
276
|
-
|
|
315
|
+
},
|
|
316
|
+
render (h: CreateElement) {
|
|
317
|
+
return (this as any).renderVN(h)
|
|
318
|
+
}
|
|
319
|
+
}) /* define-vxe-component end */
|
|
@@ -34,22 +34,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
34
34
|
],
|
|
35
35
|
props: {
|
|
36
36
|
filterStore: {
|
|
37
|
-
type: Object as PropType<
|
|
38
|
-
|
|
39
|
-
isIndeterminate: boolean
|
|
40
|
-
style: any
|
|
41
|
-
column: VxeTableDefines.ColumnInfo | null | undefined
|
|
42
|
-
visible: boolean
|
|
43
|
-
maxHeight: number | string | null
|
|
44
|
-
}>,
|
|
45
|
-
default: () => ({} as {
|
|
46
|
-
isAllSelected: boolean
|
|
47
|
-
isIndeterminate: boolean
|
|
48
|
-
style: any
|
|
49
|
-
column: VxeTableDefines.ColumnInfo | null | undefined
|
|
50
|
-
visible: boolean
|
|
51
|
-
maxHeight: number | string | null
|
|
52
|
-
})
|
|
37
|
+
type: Object as PropType<VxeTableDefines.FilterStoreObj>,
|
|
38
|
+
default: () => ({} as VxeTableDefines.FilterStoreObj)
|
|
53
39
|
}
|
|
54
40
|
},
|
|
55
41
|
inject: {
|
|
@@ -337,7 +323,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
337
323
|
}, filterStore.visible && (destroyOnClose ? visible : true) && column ? ($xeFilterPanel as any).renderOptions(h, filterRender, compConf).concat(($xeFilterPanel as any).renderFooter(h)) : [])
|
|
338
324
|
}
|
|
339
325
|
},
|
|
340
|
-
render (
|
|
341
|
-
return this.renderVN(h)
|
|
326
|
+
render (h: CreateElement) {
|
|
327
|
+
return (this as any).renderVN(h)
|
|
342
328
|
}
|
|
343
329
|
}) /* define-vxe-component end */
|
|
@@ -487,8 +487,8 @@ export default {
|
|
|
487
487
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
488
488
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
489
489
|
const editOpts = $xeTable.computeEditOpts
|
|
490
|
-
if (mouseConfig && mouseOpts.area && $xeTable.
|
|
491
|
-
return $xeTable.
|
|
490
|
+
if (mouseConfig && mouseOpts.area && $xeTable.triggerClAreaModnEvent) {
|
|
491
|
+
return $xeTable.triggerClAreaModnEvent(evnt, params)
|
|
492
492
|
} else {
|
|
493
493
|
if (checkboxConfig && checkboxOpts.range) {
|
|
494
494
|
handleCheckboxRangeEvent($xeTable, evnt, params)
|