vxe-table 3.10.0-beta.2 → 3.10.0-beta.4
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/locale/lang/en-US.js +1 -0
- package/es/locale/lang/es-ES.js +1 -0
- package/es/locale/lang/hu-HU.js +1 -0
- package/es/locale/lang/ja-JP.js +1 -0
- package/es/locale/lang/ko-KR.js +1 -0
- package/es/locale/lang/pt-BR.js +1 -0
- package/es/locale/lang/ru-RU.js +1 -0
- package/es/locale/lang/uk-UA.js +1 -0
- package/es/locale/lang/vi-VN.js +1 -0
- package/es/locale/lang/zh-CHT.js +1 -0
- package/es/locale/lang/zh-CN.js +1 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/export/export-panel.js +325 -258
- package/es/table/module/export/import-panel.js +138 -81
- package/es/table/module/export/mixin.js +14 -0
- package/es/table/src/body.js +1 -1
- package/es/table/src/methods.js +10 -3
- package/es/table/style.css +48 -47
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +48 -47
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.umd.js +368 -243
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +1 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +1 -0
- package/lib/locale/lang/es-ES.js +1 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +1 -0
- package/lib/locale/lang/hu-HU.js +1 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -0
- package/lib/locale/lang/ja-JP.js +1 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +1 -0
- package/lib/locale/lang/ko-KR.js +1 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -0
- package/lib/locale/lang/pt-BR.js +1 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +1 -0
- package/lib/locale/lang/ru-RU.js +1 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +1 -0
- package/lib/locale/lang/uk-UA.js +1 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -0
- package/lib/locale/lang/vi-VN.js +1 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +1 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +1 -0
- package/lib/locale/lang/zh-CN.js +1 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +1 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/export-panel.js +239 -185
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +99 -52
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +14 -0
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/body.js +1 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +12 -3
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +48 -47
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +48 -47
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/en-US.ts +1 -0
- package/packages/locale/lang/es-ES.ts +1 -0
- package/packages/locale/lang/hu-HU.ts +1 -0
- package/packages/locale/lang/ja-JP.ts +1 -0
- package/packages/locale/lang/ko-KR.ts +1 -0
- package/packages/locale/lang/pt-BR.ts +1 -0
- package/packages/locale/lang/ru-RU.ts +1 -0
- package/packages/locale/lang/uk-UA.ts +1 -0
- package/packages/locale/lang/vi-VN.ts +1 -0
- package/packages/locale/lang/zh-CHT.ts +1 -0
- package/packages/locale/lang/zh-CN.ts +1 -0
- package/packages/table/module/export/export-panel.ts +323 -253
- package/packages/table/module/export/import-panel.ts +141 -79
- package/packages/table/module/export/mixin.ts +15 -0
- package/packages/table/src/body.ts +1 -1
- package/packages/table/src/methods.ts +11 -3
- package/styles/components/table-module/export.scss +17 -14
- /package/es/{iconfont.1730365807487.ttf → iconfont.1730454529299.ttf} +0 -0
- /package/es/{iconfont.1730365807487.woff → iconfont.1730454529299.woff} +0 -0
- /package/es/{iconfont.1730365807487.woff2 → iconfont.1730454529299.woff2} +0 -0
- /package/lib/{iconfont.1730365807487.ttf → iconfont.1730454529299.ttf} +0 -0
- /package/lib/{iconfont.1730365807487.woff → iconfont.1730454529299.woff} +0 -0
- /package/lib/{iconfont.1730365807487.woff2 → iconfont.1730454529299.woff2} +0 -0
|
@@ -12,7 +12,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
const {
|
|
13
13
|
getI18n,
|
|
14
14
|
getIcon,
|
|
15
|
-
globalMixins
|
|
15
|
+
globalMixins,
|
|
16
|
+
renderEmptyElement
|
|
16
17
|
} = _ui.VxeUI;
|
|
17
18
|
var _default = exports.default = {
|
|
18
19
|
name: 'VxeTableExportPanel',
|
|
@@ -28,6 +29,11 @@ var _default = exports.default = {
|
|
|
28
29
|
// VxeSelect,
|
|
29
30
|
// VxeOption
|
|
30
31
|
},
|
|
32
|
+
inject: {
|
|
33
|
+
$xeTable: {
|
|
34
|
+
default: null
|
|
35
|
+
}
|
|
36
|
+
},
|
|
31
37
|
data() {
|
|
32
38
|
return {
|
|
33
39
|
isAll: false,
|
|
@@ -84,6 +90,8 @@ var _default = exports.default = {
|
|
|
84
90
|
}
|
|
85
91
|
},
|
|
86
92
|
render(h) {
|
|
93
|
+
const $xeTable = this.$xeTable;
|
|
94
|
+
const exportOpts = $xeTable.exportOpts;
|
|
87
95
|
const {
|
|
88
96
|
_e,
|
|
89
97
|
checkedAll,
|
|
@@ -99,20 +107,27 @@ var _default = exports.default = {
|
|
|
99
107
|
hasTree,
|
|
100
108
|
hasMerge,
|
|
101
109
|
isPrint,
|
|
102
|
-
hasColgroup
|
|
110
|
+
hasColgroup,
|
|
111
|
+
columns
|
|
103
112
|
} = storeData;
|
|
104
113
|
const {
|
|
105
114
|
isHeader
|
|
106
115
|
} = defaultOptions;
|
|
116
|
+
const slots = exportOpts.slots || {};
|
|
117
|
+
const topSlot = slots.top;
|
|
118
|
+
const bottomSlot = slots.bottom;
|
|
119
|
+
const defaultSlot = slots.default;
|
|
120
|
+
const footerSlot = slots.footer;
|
|
121
|
+
const parameterSlot = slots.parameter;
|
|
107
122
|
const cols = [];
|
|
108
|
-
_xeUtils.default.eachTree(
|
|
123
|
+
_xeUtils.default.eachTree(columns, column => {
|
|
109
124
|
const colTitle = (0, _utils.formatText)(column.getTitle(), 1);
|
|
110
125
|
const isColGroup = column.children && column.children.length;
|
|
111
126
|
const isChecked = column.checked;
|
|
112
127
|
const indeterminate = column.halfChecked;
|
|
113
128
|
const isHtml = column.type === 'html';
|
|
114
129
|
cols.push(h('li', {
|
|
115
|
-
class: ['vxe-export--panel-column-option', `level--${column.level}`, {
|
|
130
|
+
class: ['vxe-table-export--panel-column-option', `level--${column.level}`, {
|
|
116
131
|
'is--group': isColGroup,
|
|
117
132
|
'is--checked': isChecked,
|
|
118
133
|
'is--indeterminate': indeterminate,
|
|
@@ -144,14 +159,19 @@ var _default = exports.default = {
|
|
|
144
159
|
return h('vxe-modal', {
|
|
145
160
|
ref: 'modal',
|
|
146
161
|
props: {
|
|
162
|
+
id: 'VXE_EXPORT_MODAL',
|
|
147
163
|
value: storeData.visible,
|
|
148
164
|
title: getI18n(isPrint ? 'vxe.export.printTitle' : 'vxe.export.expTitle'),
|
|
149
165
|
width: 660,
|
|
166
|
+
minWidth: 500,
|
|
167
|
+
minHeight: 400,
|
|
150
168
|
mask: true,
|
|
151
169
|
lockView: true,
|
|
152
|
-
showFooter:
|
|
170
|
+
showFooter: true,
|
|
153
171
|
escClosable: true,
|
|
154
172
|
maskClosable: true,
|
|
173
|
+
showMaximize: true,
|
|
174
|
+
resize: true,
|
|
155
175
|
loading: this.loading
|
|
156
176
|
},
|
|
157
177
|
on: {
|
|
@@ -159,187 +179,220 @@ var _default = exports.default = {
|
|
|
159
179
|
storeData.visible = value;
|
|
160
180
|
},
|
|
161
181
|
show: this.showEvent
|
|
162
|
-
}
|
|
163
|
-
}, [h('div', {
|
|
164
|
-
class: 'vxe-export--panel'
|
|
165
|
-
}, [h('table', {
|
|
166
|
-
attrs: {
|
|
167
|
-
cellspacing: 0,
|
|
168
|
-
cellpadding: 0,
|
|
169
|
-
border: 0
|
|
170
|
-
}
|
|
171
|
-
}, [h('tbody', [[isPrint ? _e() : h('tr', [h('td', getI18n('vxe.export.expName')), h('td', [h('vxe-input', {
|
|
172
|
-
ref: 'filename',
|
|
173
|
-
props: {
|
|
174
|
-
value: defaultOptions.filename,
|
|
175
|
-
type: 'text',
|
|
176
|
-
clearable: true,
|
|
177
|
-
placeholder: getI18n('vxe.export.expNamePlaceholder')
|
|
178
|
-
},
|
|
179
|
-
on: {
|
|
180
|
-
modelValue(value) {
|
|
181
|
-
defaultOptions.filename = value;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
})])]), isPrint ? _e() : h('tr', [h('td', getI18n('vxe.export.expType')), h('td', [h('vxe-select', {
|
|
185
|
-
props: {
|
|
186
|
-
value: defaultOptions.type,
|
|
187
|
-
options: storeData.typeList
|
|
188
|
-
},
|
|
189
|
-
on: {
|
|
190
|
-
input(value) {
|
|
191
|
-
defaultOptions.type = value;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
})])]), isPrint || showSheet ? h('tr', [h('td', getI18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
|
|
195
|
-
ref: 'sheetname',
|
|
196
|
-
props: {
|
|
197
|
-
value: defaultOptions.sheetName,
|
|
198
|
-
type: 'text',
|
|
199
|
-
clearable: true,
|
|
200
|
-
placeholder: getI18n('vxe.export.expSheetNamePlaceholder')
|
|
201
|
-
},
|
|
202
|
-
on: {
|
|
203
|
-
modelValue(value) {
|
|
204
|
-
defaultOptions.sheetName = value;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
})])]) : _e(), h('tr', [h('td', getI18n('vxe.export.expMode')), h('td', [h('vxe-select', {
|
|
208
|
-
props: {
|
|
209
|
-
value: defaultOptions.mode,
|
|
210
|
-
options: storeData.modeList
|
|
211
|
-
},
|
|
212
|
-
on: {
|
|
213
|
-
input(value) {
|
|
214
|
-
defaultOptions.mode = value;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
})])]), h('tr', [h('td', [getI18n('vxe.export.expColumn')]), h('td', [h('div', {
|
|
218
|
-
class: 'vxe-export--panel-column'
|
|
219
|
-
}, [h('ul', {
|
|
220
|
-
class: 'vxe-export--panel-column-header'
|
|
221
|
-
}, [h('li', {
|
|
222
|
-
class: ['vxe-export--panel-column-option', {
|
|
223
|
-
'is--checked': isAllChecked,
|
|
224
|
-
'is--indeterminate': isAllIndeterminate
|
|
225
|
-
}],
|
|
226
|
-
attrs: {
|
|
227
|
-
title: getI18n('vxe.table.allTitle')
|
|
228
|
-
},
|
|
229
|
-
on: {
|
|
230
|
-
click: this.allColumnEvent
|
|
231
|
-
}
|
|
232
|
-
}, [h('span', {
|
|
233
|
-
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
234
|
-
}), h('span', {
|
|
235
|
-
class: 'vxe-checkbox--label'
|
|
236
|
-
}, getI18n('vxe.export.expCurrentColumn'))])]), h('ul', {
|
|
237
|
-
class: 'vxe-export--panel-column-body'
|
|
238
|
-
}, cols)])])]), h('tr', [h('td', getI18n('vxe.export.expOpts')), h('td', [h('div', {
|
|
239
|
-
class: 'vxe-export--panel-option-row'
|
|
240
|
-
}, [h('vxe-checkbox', {
|
|
241
|
-
props: {
|
|
242
|
-
value: isHeader,
|
|
243
|
-
title: getI18n('vxe.export.expHeaderTitle'),
|
|
244
|
-
content: getI18n('vxe.export.expOptHeader')
|
|
245
|
-
},
|
|
246
|
-
on: {
|
|
247
|
-
input(value) {
|
|
248
|
-
defaultOptions.isHeader = value;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}), h('vxe-checkbox', {
|
|
252
|
-
props: {
|
|
253
|
-
value: defaultOptions.isFooter,
|
|
254
|
-
disabled: !storeData.hasFooter,
|
|
255
|
-
title: getI18n('vxe.export.expFooterTitle'),
|
|
256
|
-
content: getI18n('vxe.export.expOptFooter')
|
|
257
|
-
},
|
|
258
|
-
on: {
|
|
259
|
-
input(value) {
|
|
260
|
-
defaultOptions.isFooter = value;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}), h('vxe-checkbox', {
|
|
264
|
-
props: {
|
|
265
|
-
value: defaultOptions.original,
|
|
266
|
-
title: getI18n('vxe.export.expOriginalTitle'),
|
|
267
|
-
content: getI18n('vxe.export.expOptOriginal')
|
|
268
|
-
},
|
|
269
|
-
on: {
|
|
270
|
-
input(value) {
|
|
271
|
-
defaultOptions.original = value;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
})]), h('div', {
|
|
275
|
-
class: 'vxe-export--panel-option-row'
|
|
276
|
-
}, [h('vxe-checkbox', {
|
|
277
|
-
props: {
|
|
278
|
-
value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
|
|
279
|
-
disabled: !isHeader || !hasColgroup || !supportMerge,
|
|
280
|
-
title: getI18n('vxe.export.expColgroupTitle'),
|
|
281
|
-
content: getI18n('vxe.export.expOptColgroup')
|
|
282
|
-
},
|
|
283
|
-
on: {
|
|
284
|
-
input(value) {
|
|
285
|
-
defaultOptions.isColgroup = value;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}), h('vxe-checkbox', {
|
|
289
|
-
props: {
|
|
290
|
-
value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
|
|
291
|
-
disabled: !hasMerge || !supportMerge || !checkedAll,
|
|
292
|
-
title: getI18n('vxe.export.expMergeTitle'),
|
|
293
|
-
content: getI18n('vxe.export.expOptMerge')
|
|
294
|
-
},
|
|
295
|
-
on: {
|
|
296
|
-
input(value) {
|
|
297
|
-
defaultOptions.isMerge = value;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}), isPrint ? _e() : h('vxe-checkbox', {
|
|
301
|
-
props: {
|
|
302
|
-
value: supportStyle ? defaultOptions.useStyle : false,
|
|
303
|
-
disabled: !supportStyle,
|
|
304
|
-
title: getI18n('vxe.export.expUseStyleTitle'),
|
|
305
|
-
content: getI18n('vxe.export.expOptUseStyle')
|
|
306
|
-
},
|
|
307
|
-
on: {
|
|
308
|
-
input(value) {
|
|
309
|
-
defaultOptions.useStyle = value;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}), h('vxe-checkbox', {
|
|
313
|
-
props: {
|
|
314
|
-
value: hasTree ? defaultOptions.isAllExpand : false,
|
|
315
|
-
disabled: !hasTree,
|
|
316
|
-
title: getI18n('vxe.export.expAllExpandTitle'),
|
|
317
|
-
content: getI18n('vxe.export.expOptAllExpand')
|
|
318
182
|
},
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
183
|
+
scopedSlots: {
|
|
184
|
+
default: () => {
|
|
185
|
+
const params = {
|
|
186
|
+
$table: $xeTable,
|
|
187
|
+
$grid: $xeTable.xegrid,
|
|
188
|
+
options: exportOpts,
|
|
189
|
+
columns,
|
|
190
|
+
params: exportOpts.params
|
|
191
|
+
};
|
|
192
|
+
return h('div', {
|
|
193
|
+
class: 'vxe-table-export--panel'
|
|
194
|
+
}, [topSlot ? h('div', {
|
|
195
|
+
class: 'vxe-table-export--panel-top'
|
|
196
|
+
}, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement(this), h('div', {
|
|
197
|
+
class: 'vxe-table-export--panel-body'
|
|
198
|
+
}, defaultSlot ? $xeTable.callSlot(defaultSlot, params, h) : [h('table', {
|
|
199
|
+
attrs: {
|
|
200
|
+
class: 'vxe-table-export--panel-table',
|
|
201
|
+
cellspacing: 0,
|
|
202
|
+
cellpadding: 0,
|
|
203
|
+
border: 0
|
|
204
|
+
}
|
|
205
|
+
}, [h('tbody', [[isPrint ? _e() : h('tr', [h('td', getI18n('vxe.export.expName')), h('td', [h('vxe-input', {
|
|
206
|
+
ref: 'filename',
|
|
207
|
+
props: {
|
|
208
|
+
value: defaultOptions.filename,
|
|
209
|
+
type: 'text',
|
|
210
|
+
clearable: true,
|
|
211
|
+
placeholder: getI18n('vxe.export.expNamePlaceholder')
|
|
212
|
+
},
|
|
213
|
+
on: {
|
|
214
|
+
modelValue(value) {
|
|
215
|
+
defaultOptions.filename = value;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
})])]), isPrint ? _e() : h('tr', [h('td', getI18n('vxe.export.expType')), h('td', [h('vxe-select', {
|
|
219
|
+
props: {
|
|
220
|
+
value: defaultOptions.type,
|
|
221
|
+
options: storeData.typeList
|
|
222
|
+
},
|
|
223
|
+
on: {
|
|
224
|
+
input(value) {
|
|
225
|
+
defaultOptions.type = value;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
})])]), isPrint || showSheet ? h('tr', [h('td', getI18n('vxe.export.expSheetName')), h('td', [h('vxe-input', {
|
|
229
|
+
ref: 'sheetname',
|
|
230
|
+
props: {
|
|
231
|
+
value: defaultOptions.sheetName,
|
|
232
|
+
type: 'text',
|
|
233
|
+
clearable: true,
|
|
234
|
+
placeholder: getI18n('vxe.export.expSheetNamePlaceholder')
|
|
235
|
+
},
|
|
236
|
+
on: {
|
|
237
|
+
modelValue(value) {
|
|
238
|
+
defaultOptions.sheetName = value;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
})])]) : _e(), h('tr', [h('td', getI18n('vxe.export.expMode')), h('td', [h('vxe-select', {
|
|
242
|
+
props: {
|
|
243
|
+
value: defaultOptions.mode,
|
|
244
|
+
options: storeData.modeList
|
|
245
|
+
},
|
|
246
|
+
on: {
|
|
247
|
+
input(value) {
|
|
248
|
+
defaultOptions.mode = value;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
})])]), h('tr', [h('td', [getI18n('vxe.export.expColumn')]), h('td', [h('div', {
|
|
252
|
+
class: 'vxe-table-export--panel-column'
|
|
253
|
+
}, [h('ul', {
|
|
254
|
+
class: 'vxe-table-export--panel-column-header'
|
|
255
|
+
}, [h('li', {
|
|
256
|
+
class: ['vxe-table-export--panel-column-option', {
|
|
257
|
+
'is--checked': isAllChecked,
|
|
258
|
+
'is--indeterminate': isAllIndeterminate
|
|
259
|
+
}],
|
|
260
|
+
attrs: {
|
|
261
|
+
title: getI18n('vxe.table.allTitle')
|
|
262
|
+
},
|
|
263
|
+
on: {
|
|
264
|
+
click: this.allColumnEvent
|
|
265
|
+
}
|
|
266
|
+
}, [h('span', {
|
|
267
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
268
|
+
}), h('span', {
|
|
269
|
+
class: 'vxe-checkbox--label'
|
|
270
|
+
}, getI18n('vxe.export.expCurrentColumn'))])]), h('ul', {
|
|
271
|
+
class: 'vxe-table-export--panel-column-body'
|
|
272
|
+
}, cols)])])]), h('tr', [h('td', getI18n('vxe.export.expOpts')), parameterSlot ? h('td', [h('div', {
|
|
273
|
+
class: 'vxe-table-export--panel-option-row'
|
|
274
|
+
}, $xeTable.callSlot(parameterSlot, params))]) : h('td', [h('div', {
|
|
275
|
+
class: 'vxe-table-export--panel-option-row'
|
|
276
|
+
}, [h('vxe-checkbox', {
|
|
277
|
+
props: {
|
|
278
|
+
value: isHeader,
|
|
279
|
+
title: getI18n('vxe.export.expHeaderTitle'),
|
|
280
|
+
content: getI18n('vxe.export.expOptHeader')
|
|
281
|
+
},
|
|
282
|
+
on: {
|
|
283
|
+
input(value) {
|
|
284
|
+
defaultOptions.isHeader = value;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}), h('vxe-checkbox', {
|
|
288
|
+
props: {
|
|
289
|
+
value: defaultOptions.isFooter,
|
|
290
|
+
disabled: !storeData.hasFooter,
|
|
291
|
+
title: getI18n('vxe.export.expFooterTitle'),
|
|
292
|
+
content: getI18n('vxe.export.expOptFooter')
|
|
293
|
+
},
|
|
294
|
+
on: {
|
|
295
|
+
input(value) {
|
|
296
|
+
defaultOptions.isFooter = value;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}), h('vxe-checkbox', {
|
|
300
|
+
props: {
|
|
301
|
+
value: defaultOptions.original,
|
|
302
|
+
title: getI18n('vxe.export.expOriginalTitle'),
|
|
303
|
+
content: getI18n('vxe.export.expOptOriginal')
|
|
304
|
+
},
|
|
305
|
+
on: {
|
|
306
|
+
input(value) {
|
|
307
|
+
defaultOptions.original = value;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
})]), h('div', {
|
|
311
|
+
class: 'vxe-table-export--panel-option-row'
|
|
312
|
+
}, [h('vxe-checkbox', {
|
|
313
|
+
props: {
|
|
314
|
+
value: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
|
|
315
|
+
disabled: !isHeader || !hasColgroup || !supportMerge,
|
|
316
|
+
title: getI18n('vxe.export.expColgroupTitle'),
|
|
317
|
+
content: getI18n('vxe.export.expOptColgroup')
|
|
318
|
+
},
|
|
319
|
+
on: {
|
|
320
|
+
input(value) {
|
|
321
|
+
defaultOptions.isColgroup = value;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}), h('vxe-checkbox', {
|
|
325
|
+
props: {
|
|
326
|
+
value: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
|
|
327
|
+
disabled: !hasMerge || !supportMerge || !checkedAll,
|
|
328
|
+
title: getI18n('vxe.export.expMergeTitle'),
|
|
329
|
+
content: getI18n('vxe.export.expOptMerge')
|
|
330
|
+
},
|
|
331
|
+
on: {
|
|
332
|
+
input(value) {
|
|
333
|
+
defaultOptions.isMerge = value;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}), isPrint ? _e() : h('vxe-checkbox', {
|
|
337
|
+
props: {
|
|
338
|
+
value: supportStyle ? defaultOptions.useStyle : false,
|
|
339
|
+
disabled: !supportStyle,
|
|
340
|
+
title: getI18n('vxe.export.expUseStyleTitle'),
|
|
341
|
+
content: getI18n('vxe.export.expOptUseStyle')
|
|
342
|
+
},
|
|
343
|
+
on: {
|
|
344
|
+
input(value) {
|
|
345
|
+
defaultOptions.useStyle = value;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}), h('vxe-checkbox', {
|
|
349
|
+
props: {
|
|
350
|
+
value: hasTree ? defaultOptions.isAllExpand : false,
|
|
351
|
+
disabled: !hasTree,
|
|
352
|
+
title: getI18n('vxe.export.expAllExpandTitle'),
|
|
353
|
+
content: getI18n('vxe.export.expOptAllExpand')
|
|
354
|
+
},
|
|
355
|
+
on: {
|
|
356
|
+
input(value) {
|
|
357
|
+
defaultOptions.isAllExpand = value;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
})])])])]])])]), bottomSlot ? h('div', {
|
|
361
|
+
class: 'vxe-table-export--panel-bottom'
|
|
362
|
+
}, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement(this)]);
|
|
363
|
+
},
|
|
364
|
+
footer: () => {
|
|
365
|
+
const params = {
|
|
366
|
+
$table: $xeTable,
|
|
367
|
+
$grid: $xeTable.xegrid,
|
|
368
|
+
options: exportOpts,
|
|
369
|
+
columns,
|
|
370
|
+
params: exportOpts.params
|
|
371
|
+
};
|
|
372
|
+
return h('div', {
|
|
373
|
+
class: 'vxe-table-export--panel-footer'
|
|
374
|
+
}, footerSlot ? $xeTable.callSlot(footerSlot, params) : [h('div', {
|
|
375
|
+
class: 'vxe-table-export--panel-btns'
|
|
376
|
+
}, [h('vxe-button', {
|
|
377
|
+
props: {
|
|
378
|
+
content: getI18n('vxe.export.expCancel')
|
|
379
|
+
},
|
|
380
|
+
on: {
|
|
381
|
+
click: this.cancelEvent
|
|
382
|
+
}
|
|
383
|
+
}), h('vxe-button', {
|
|
384
|
+
ref: 'confirmBtn',
|
|
385
|
+
props: {
|
|
386
|
+
status: 'primary',
|
|
387
|
+
content: getI18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
|
|
388
|
+
},
|
|
389
|
+
on: {
|
|
390
|
+
click: this.confirmEvent
|
|
391
|
+
}
|
|
392
|
+
})])]);
|
|
322
393
|
}
|
|
323
394
|
}
|
|
324
|
-
})
|
|
325
|
-
class: 'vxe-export--panel-btns'
|
|
326
|
-
}, [h('vxe-button', {
|
|
327
|
-
props: {
|
|
328
|
-
content: getI18n('vxe.export.expCancel')
|
|
329
|
-
},
|
|
330
|
-
on: {
|
|
331
|
-
click: this.cancelEvent
|
|
332
|
-
}
|
|
333
|
-
}), h('vxe-button', {
|
|
334
|
-
ref: 'confirmBtn',
|
|
335
|
-
props: {
|
|
336
|
-
status: 'primary',
|
|
337
|
-
content: getI18n(isPrint ? 'vxe.export.expPrint' : 'vxe.export.expConfirm')
|
|
338
|
-
},
|
|
339
|
-
on: {
|
|
340
|
-
click: this.confirmEvent
|
|
341
|
-
}
|
|
342
|
-
})])])]);
|
|
395
|
+
});
|
|
343
396
|
},
|
|
344
397
|
methods: {
|
|
345
398
|
changeOption(column) {
|
|
@@ -429,9 +482,10 @@ var _default = exports.default = {
|
|
|
429
482
|
$xetable.print(Object.assign({}, $xetable.printOpts, this.getExportOption()));
|
|
430
483
|
},
|
|
431
484
|
exportEvent() {
|
|
432
|
-
const $
|
|
485
|
+
const $xeTable = this.$xeTable;
|
|
486
|
+
const exportOpts = $xeTable.exportOpts;
|
|
433
487
|
this.loading = true;
|
|
434
|
-
$
|
|
488
|
+
$xeTable.exportData(Object.assign({}, exportOpts, this.getExportOption())).then(() => {
|
|
435
489
|
this.loading = false;
|
|
436
490
|
this.storeData.visible = false;
|
|
437
491
|
}).catch(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils")),_utils=require("../../../ui/src/utils"),_log=require("../../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{getI18n,getIcon,globalMixins}=_ui.VxeUI;var _default=exports.default={name:"VxeTableExportPanel",mixins:[globalMixins.sizeMixin],props:{defaultOptions:Object,storeData:Object},components:{},data(){return{isAll:!1,isIndeterminate:!1,loading:!1}},computed:{checkedAll(){return this.storeData.columns.every(e=>e.checked)},showSheet(){return-1<["html","xml","xlsx","pdf"].indexOf(this.defaultOptions.type)},supportMerge(){var{storeData:e,defaultOptions:t}=this;return!t.original&&"current"===t.mode&&(e.isPrint||-1<["html","xlsx"].indexOf(t.type))},supportStyle(){var e=this.defaultOptions;return!e.original&&-1<["xlsx"].indexOf(e.type)}},created(){if("development"===process.env.NODE_ENV){let e=_ui.VxeUI.getComponent("VxeModal"),t=_ui.VxeUI.getComponent("VxeButton"),
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _ui=require("../../../ui"),_xeUtils=_interopRequireDefault(require("xe-utils")),_utils=require("../../../ui/src/utils"),_log=require("../../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{getI18n,getIcon,globalMixins,renderEmptyElement}=_ui.VxeUI;var _default=exports.default={name:"VxeTableExportPanel",mixins:[globalMixins.sizeMixin],props:{defaultOptions:Object,storeData:Object},components:{},inject:{$xeTable:{default:null}},data(){return{isAll:!1,isIndeterminate:!1,loading:!1}},computed:{checkedAll(){return this.storeData.columns.every(e=>e.checked)},showSheet(){return-1<["html","xml","xlsx","pdf"].indexOf(this.defaultOptions.type)},supportMerge(){var{storeData:e,defaultOptions:t}=this;return!t.original&&"current"===t.mode&&(e.isPrint||-1<["html","xlsx"].indexOf(t.type))},supportStyle(){var e=this.defaultOptions;return!e.original&&-1<["xlsx"].indexOf(e.type)}},created(){if("development"===process.env.NODE_ENV){let e=_ui.VxeUI.getComponent("VxeModal"),t=_ui.VxeUI.getComponent("VxeButton"),l=_ui.VxeUI.getComponent("VxeSelect"),o=_ui.VxeUI.getComponent("VxeInput"),r=_ui.VxeUI.getComponent("VxeCheckbox");this.$nextTick(()=>{e||(0,_log.errLog)("vxe.error.reqComp",["vxe-modal"]),t||(0,_log.errLog)("vxe.error.reqComp",["vxe-button"]),l||(0,_log.errLog)("vxe.error.reqComp",["vxe-select"]),o||(0,_log.errLog)("vxe.error.reqComp",["vxe-input"]),r||(0,_log.errLog)("vxe.error.reqComp",["vxe-checkbox"])})}},render(n){let t=this.$xeTable,l=t.exportOpts,{_e:o,checkedAll:r,isAll:i,isIndeterminate:s,showSheet:a,supportMerge:p,supportStyle:x,defaultOptions:c,storeData:d}=this,{hasTree:h,hasMerge:v,isPrint:u,hasColgroup:g,columns:m}=d,b=c.isHeader;var e=l.slots||{};let E=e.top,k=e.bottom,C=e.default,f=e.footer,I=e.parameter,O=[];return _xeUtils.default.eachTree(m,e=>{var t=(0,_utils.formatText)(e.getTitle(),1),l=e.children&&e.children.length,o=e.checked,r=e.halfChecked,i="html"===e.type;O.push(n("li",{class:["vxe-table-export--panel-column-option","level--"+e.level,{"is--group":l,"is--checked":o,"is--indeterminate":r,"is--disabled":e.disabled}],attrs:{title:t},on:{click:()=>{e.disabled||this.changeOption(e)}}},[n("span",{class:["vxe-checkbox--icon",r?getIcon().TABLE_CHECKBOX_INDETERMINATE:o?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]}),i?n("span",{key:"1",class:"vxe-checkbox--label",domProps:{innerHTML:t}}):n("span",{key:"0",class:"vxe-checkbox--label"},t)]))}),n("vxe-modal",{ref:"modal",props:{id:"VXE_EXPORT_MODAL",value:d.visible,title:getI18n(u?"vxe.export.printTitle":"vxe.export.expTitle"),width:660,minWidth:500,minHeight:400,mask:!0,lockView:!0,showFooter:!0,escClosable:!0,maskClosable:!0,showMaximize:!0,resize:!0,loading:this.loading},on:{input(e){d.visible=e},show:this.showEvent},scopedSlots:{default:()=>{var e={$table:t,$grid:t.xegrid,options:l,columns:m,params:l.params};return n("div",{class:"vxe-table-export--panel"},[E?n("div",{class:"vxe-table-export--panel-top"},t.callSlot(E,e,n)):renderEmptyElement(this),n("div",{class:"vxe-table-export--panel-body"},C?t.callSlot(C,e,n):[n("table",{attrs:{class:"vxe-table-export--panel-table",cellspacing:0,cellpadding:0,border:0}},[n("tbody",[[u?o():n("tr",[n("td",getI18n("vxe.export.expName")),n("td",[n("vxe-input",{ref:"filename",props:{value:c.filename,type:"text",clearable:!0,placeholder:getI18n("vxe.export.expNamePlaceholder")},on:{modelValue(e){c.filename=e}}})])]),u?o():n("tr",[n("td",getI18n("vxe.export.expType")),n("td",[n("vxe-select",{props:{value:c.type,options:d.typeList},on:{input(e){c.type=e}}})])]),u||a?n("tr",[n("td",getI18n("vxe.export.expSheetName")),n("td",[n("vxe-input",{ref:"sheetname",props:{value:c.sheetName,type:"text",clearable:!0,placeholder:getI18n("vxe.export.expSheetNamePlaceholder")},on:{modelValue(e){c.sheetName=e}}})])]):o(),n("tr",[n("td",getI18n("vxe.export.expMode")),n("td",[n("vxe-select",{props:{value:c.mode,options:d.modeList},on:{input(e){c.mode=e}}})])]),n("tr",[n("td",[getI18n("vxe.export.expColumn")]),n("td",[n("div",{class:"vxe-table-export--panel-column"},[n("ul",{class:"vxe-table-export--panel-column-header"},[n("li",{class:["vxe-table-export--panel-column-option",{"is--checked":i,"is--indeterminate":s}],attrs:{title:getI18n("vxe.table.allTitle")},on:{click:this.allColumnEvent}},[n("span",{class:["vxe-checkbox--icon",s?getIcon().TABLE_CHECKBOX_INDETERMINATE:i?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]}),n("span",{class:"vxe-checkbox--label"},getI18n("vxe.export.expCurrentColumn"))])]),n("ul",{class:"vxe-table-export--panel-column-body"},O)])])]),n("tr",[n("td",getI18n("vxe.export.expOpts")),I?n("td",[n("div",{class:"vxe-table-export--panel-option-row"},t.callSlot(I,e))]):n("td",[n("div",{class:"vxe-table-export--panel-option-row"},[n("vxe-checkbox",{props:{value:b,title:getI18n("vxe.export.expHeaderTitle"),content:getI18n("vxe.export.expOptHeader")},on:{input(e){c.isHeader=e}}}),n("vxe-checkbox",{props:{value:c.isFooter,disabled:!d.hasFooter,title:getI18n("vxe.export.expFooterTitle"),content:getI18n("vxe.export.expOptFooter")},on:{input(e){c.isFooter=e}}}),n("vxe-checkbox",{props:{value:c.original,title:getI18n("vxe.export.expOriginalTitle"),content:getI18n("vxe.export.expOptOriginal")},on:{input(e){c.original=e}}})]),n("div",{class:"vxe-table-export--panel-option-row"},[n("vxe-checkbox",{props:{value:!!(b&&g&&p)&&c.isColgroup,disabled:!b||!g||!p,title:getI18n("vxe.export.expColgroupTitle"),content:getI18n("vxe.export.expOptColgroup")},on:{input(e){c.isColgroup=e}}}),n("vxe-checkbox",{props:{value:!!(v&&p&&r)&&c.isMerge,disabled:!v||!p||!r,title:getI18n("vxe.export.expMergeTitle"),content:getI18n("vxe.export.expOptMerge")},on:{input(e){c.isMerge=e}}}),u?o():n("vxe-checkbox",{props:{value:!!x&&c.useStyle,disabled:!x,title:getI18n("vxe.export.expUseStyleTitle"),content:getI18n("vxe.export.expOptUseStyle")},on:{input(e){c.useStyle=e}}}),n("vxe-checkbox",{props:{value:!!h&&c.isAllExpand,disabled:!h,title:getI18n("vxe.export.expAllExpandTitle"),content:getI18n("vxe.export.expOptAllExpand")},on:{input(e){c.isAllExpand=e}}})])])])]])])]),k?n("div",{class:"vxe-table-export--panel-bottom"},t.callSlot(k,e,n)):renderEmptyElement(this)])},footer:()=>{var e={$table:t,$grid:t.xegrid,options:l,columns:m,params:l.params};return n("div",{class:"vxe-table-export--panel-footer"},f?t.callSlot(f,e):[n("div",{class:"vxe-table-export--panel-btns"},[n("vxe-button",{props:{content:getI18n("vxe.export.expCancel")},on:{click:this.cancelEvent}}),n("vxe-button",{ref:"confirmBtn",props:{status:"primary",content:getI18n(u?"vxe.export.expPrint":"vxe.export.expConfirm")},on:{click:this.confirmEvent}})])])}}})},methods:{changeOption(e){let t=!e.checked;_xeUtils.default.eachTree([e],e=>{e.checked=t,e.halfChecked=!1}),this.handleOptionCheck(e),this.checkStatus()},handleOptionCheck(t){var e=_xeUtils.default.findTree(this.storeData.columns,e=>e===t);e&&e.parent&&(e=e.parent,e.children)&&e.children.length&&(e.checked=e.children.every(e=>e.checked),e.halfChecked=!e.checked&&e.children.some(e=>e.checked||e.halfChecked),this.handleOptionCheck(e))},checkStatus(){var e=this.storeData.columns;this.isAll=e.every(e=>e.disabled||e.checked),this.isIndeterminate=!this.isAll&&e.some(e=>!e.disabled&&(e.checked||e.halfChecked))},allColumnEvent(){let t=!this.isAll;_xeUtils.default.eachTree(this.storeData.columns,e=>{e.disabled||(e.checked=t,e.halfChecked=!1)}),this.isAll=t,this.checkStatus()},showEvent(){this.$nextTick(()=>{var e=this.$refs,e=e.filename||e.sheetname||e.confirmBtn;e&&e.focus()}),this.checkStatus()},getExportOption(){var{checkedAll:e,storeData:t,defaultOptions:l,supportMerge:o}=this,{hasMerge:t,columns:r}=t,r=_xeUtils.default.searchTree(r,e=>e.checked,{children:"children",mapChildren:"childNodes",original:!0});return Object.assign({},l,{columns:r,isMerge:!!(t&&o&&e)&&l.isMerge})},cancelEvent(){this.storeData.visible=!1},confirmEvent(e){this.storeData.isPrint?this.printEvent(e):this.exportEvent(e)},printEvent(){var e=this.$parent;this.storeData.visible=!1,e.print(Object.assign({},e.printOpts,this.getExportOption()))},exportEvent(){var e=this.$xeTable,t=e.exportOpts;this.loading=!0,e.exportData(Object.assign({},t,this.getExportOption())).then(()=>{this.loading=!1,this.storeData.visible=!1}).catch(()=>{this.loading=!1})}}};
|