vxe-table 3.9.0-rc.8 → 3.9.0
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/README.md +1 -1
- package/es/grid/src/grid.js +120 -66
- package/es/grid/style.css +0 -1
- package/es/grid/style.min.css +1 -1
- package/es/index.esm.js +22 -3
- package/es/locale/lang/en-US.js +2 -8
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/hu-HU.d.ts +2 -0
- package/es/locale/lang/hu-HU.js +497 -501
- package/es/locale/lang/ja-JP.js +2 -8
- package/es/locale/lang/ko-KR.d.ts +2 -0
- package/es/locale/lang/ko-KR.js +2 -8
- package/es/locale/lang/pt-BR.js +2 -8
- package/es/locale/lang/ru-RU.d.ts +2 -0
- package/es/locale/lang/ru-RU.js +497 -503
- package/es/locale/lang/uk-UA.d.ts +2 -0
- package/es/locale/lang/uk-UA.js +667 -0
- package/es/locale/lang/vi-VN.js +2 -8
- package/es/locale/lang/zh-CHT.d.ts +2 -0
- package/es/locale/lang/zh-CHT.js +667 -0
- package/es/locale/lang/zh-CN.js +2 -8
- package/es/locale/lang/zh-HK.js +2 -2
- package/es/locale/lang/zh-MO.js +2 -2
- package/es/locale/lang/zh-TC.js +2 -673
- package/es/locale/lang/zh-TW.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +183 -173
- package/es/table/module/edit/mixin.js +33 -24
- package/es/table/module/export/export-panel.js +32 -4
- package/es/table/module/export/import-panel.js +25 -6
- package/es/table/module/export/mixin.js +11 -11
- package/es/table/module/menu/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +4 -4
- package/es/table/render/index.js +17 -11
- package/es/table/src/body.js +1 -0
- package/es/table/src/columnInfo.js +3 -3
- package/es/table/src/methods.js +54 -42
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +175 -60
- package/es/table/src/util.js +3 -2
- package/es/table/style.css +37 -48
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +21 -7
- package/es/toolbar/style.css +0 -1
- package/es/toolbar/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-grid/style.css +0 -1
- package/es/vxe-grid/style.min.css +1 -1
- package/es/vxe-table/style.css +37 -48
- package/es/vxe-table/style.min.css +1 -1
- package/es/vxe-toolbar/style.css +0 -1
- package/es/vxe-toolbar/style.min.css +1 -1
- package/lib/colgroup/index.js +3 -3
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +3 -3
- package/lib/column/index.min.js +1 -1
- package/lib/components.js +9 -11
- package/lib/components.min.js +1 -1
- package/lib/grid/index.js +3 -3
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +581 -491
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/index.common.js +3 -4
- package/lib/index.umd.js +9212 -17224
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -8
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -8
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/hu-HU.d.ts +2 -0
- package/lib/locale/lang/hu-HU.js +497 -501
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +687 -0
- package/lib/locale/lang/ja-JP.js +2 -8
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -8
- package/lib/locale/lang/ko-KR.d.ts +2 -0
- package/lib/locale/lang/ko-KR.js +2 -8
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +687 -0
- package/lib/locale/lang/pt-BR.js +2 -8
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -8
- package/lib/locale/lang/ru-RU.d.ts +2 -0
- package/lib/locale/lang/ru-RU.js +497 -503
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +687 -0
- package/lib/locale/lang/uk-UA.d.ts +2 -0
- package/lib/locale/lang/uk-UA.js +673 -0
- package/lib/locale/lang/uk-UA.min.js +1 -0
- package/lib/locale/lang/uk-UA.umd.js +687 -0
- package/lib/locale/lang/vi-VN.js +2 -8
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.d.ts +2 -0
- package/lib/locale/lang/zh-CHT.js +673 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -0
- package/lib/locale/lang/zh-CHT.umd.js +687 -0
- package/lib/locale/lang/zh-CN.js +2 -8
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -8
- package/lib/locale/lang/zh-HK.js +2 -2
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +7 -677
- package/lib/locale/lang/zh-MO.js +2 -2
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +7 -677
- package/lib/locale/lang/zh-TC.js +3 -673
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +7 -677
- package/lib/locale/lang/zh-TW.js +2 -2
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +7 -677
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +4 -4
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/mixin.js +53 -44
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +310 -239
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +436 -371
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +136 -106
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +75 -54
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +592 -597
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +6 -4
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/module/filter/mixin.js +147 -118
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +86 -65
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +163 -151
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +125 -114
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +36 -34
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +225 -214
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +401 -297
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +411 -349
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +470 -344
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -10
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +46 -55
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +157 -132
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +1 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +170 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +2758 -2478
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +33 -74
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +519 -397
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +143 -131
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +37 -48
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/index.js +3 -3
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +332 -284
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +0 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/ui/index.js +50 -41
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +2 -3
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +29 -28
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +6 -4
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +7 -7
- package/lib/v-x-e-table/index.js +3 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +3 -4
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +3 -4
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +3 -4
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-grid/style/style.css +0 -1
- package/lib/vxe-grid/style/style.min.css +1 -1
- package/lib/vxe-table/index.js +3 -4
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +37 -48
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +3 -4
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-toolbar/style/style.css +0 -1
- package/lib/vxe-toolbar/style/style.min.css +1 -1
- package/lib/vxe-ui/index.js +3 -4
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +3 -4
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +5 -4
- package/packages/grid/src/grid.ts +127 -65
- package/packages/locale/lang/en-US.ts +2 -10
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +497 -503
- package/packages/locale/lang/ja-JP.ts +2 -10
- package/packages/locale/lang/ko-KR.ts +2 -10
- package/packages/locale/lang/pt-BR.ts +2 -10
- package/packages/locale/lang/ru-RU.ts +497 -505
- package/packages/locale/lang/uk-UA.ts +667 -0
- package/packages/locale/lang/vi-VN.ts +2 -10
- package/packages/locale/lang/zh-CHT.ts +667 -0
- package/packages/locale/lang/zh-CN.ts +2 -10
- package/packages/locale/lang/zh-HK.ts +2 -2
- package/packages/locale/lang/zh-MO.ts +2 -2
- package/packages/locale/lang/zh-TC.ts +2 -674
- package/packages/locale/lang/zh-TW.ts +2 -2
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +32 -23
- package/packages/table/module/export/export-panel.ts +36 -4
- package/packages/table/module/export/import-panel.ts +29 -6
- package/packages/table/module/export/mixin.ts +11 -11
- package/packages/table/module/menu/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +4 -4
- package/packages/table/render/index.ts +20 -11
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/columnInfo.ts +3 -3
- package/packages/table/src/methods.ts +53 -42
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +183 -57
- package/packages/table/src/util.ts +3 -2
- package/packages/toolbar/src/toolbar.ts +21 -7
- package/packages/ui/index.ts +3 -1
- package/styles/components/table.scss +82 -17
- package/types/all.d.ts +1 -0
- /package/es/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/es/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/es/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
- /package/lib/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/lib/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/lib/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
|
@@ -7,12 +7,16 @@ exports.default = void 0;
|
|
|
7
7
|
var _ui = require("../../../ui");
|
|
8
8
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
9
9
|
var _utils = require("../../../ui/src/utils");
|
|
10
|
+
var _log = require("../../../ui/src/log");
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
getIcon
|
|
12
|
+
const {
|
|
13
|
+
getI18n,
|
|
14
|
+
getIcon,
|
|
15
|
+
globalMixins
|
|
16
|
+
} = _ui.VxeUI;
|
|
14
17
|
var _default = exports.default = {
|
|
15
18
|
name: 'VxeTableImportPanel',
|
|
19
|
+
mixins: [globalMixins.sizeMixin],
|
|
16
20
|
props: {
|
|
17
21
|
defaultOptions: Object,
|
|
18
22
|
storeData: Object
|
|
@@ -21,48 +25,66 @@ var _default = exports.default = {
|
|
|
21
25
|
// VxeModal,
|
|
22
26
|
// VxeRadio
|
|
23
27
|
},
|
|
24
|
-
data
|
|
28
|
+
data() {
|
|
25
29
|
return {
|
|
26
30
|
loading: false
|
|
27
31
|
};
|
|
28
32
|
},
|
|
29
33
|
computed: {
|
|
30
|
-
|
|
31
|
-
return this.
|
|
34
|
+
selectName() {
|
|
35
|
+
return `${this.storeData.filename}.${this.storeData.type}`;
|
|
32
36
|
},
|
|
33
|
-
|
|
34
|
-
return "".concat(this.storeData.filename, ".").concat(this.storeData.type);
|
|
35
|
-
},
|
|
36
|
-
hasFile: function hasFile() {
|
|
37
|
+
hasFile() {
|
|
37
38
|
return this.storeData.file && this.storeData.type;
|
|
38
39
|
},
|
|
39
|
-
parseTypeLabel
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
parseTypeLabel() {
|
|
41
|
+
const {
|
|
42
|
+
storeData
|
|
43
|
+
} = this;
|
|
44
|
+
const {
|
|
45
|
+
type,
|
|
46
|
+
typeList
|
|
47
|
+
} = storeData;
|
|
43
48
|
if (type) {
|
|
44
|
-
|
|
45
|
-
return type === item.value;
|
|
46
|
-
});
|
|
49
|
+
const selectItem = _xeUtils.default.find(typeList, item => type === item.value);
|
|
47
50
|
return selectItem ? selectItem.label : '*.*';
|
|
48
51
|
}
|
|
49
|
-
return
|
|
50
|
-
return item.value;
|
|
51
|
-
}).join(', *.'));
|
|
52
|
+
return `*.${typeList.map(item => item.value).join(', *.')}`;
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
created() {
|
|
56
|
+
const $xeTableImportPanel = this;
|
|
57
|
+
if (process.env.NODE_ENV === 'development') {
|
|
58
|
+
const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
|
|
59
|
+
const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
|
|
60
|
+
const VxeUISelectComponent = _ui.VxeUI.getComponent('VxeSelect');
|
|
61
|
+
$xeTableImportPanel.$nextTick(() => {
|
|
62
|
+
if (!VxeUIModalComponent) {
|
|
63
|
+
(0, _log.errLog)('vxe.error.reqComp', ['vxe-modal']);
|
|
64
|
+
}
|
|
65
|
+
if (!VxeUIButtonComponent) {
|
|
66
|
+
(0, _log.errLog)('vxe.error.reqComp', ['vxe-button']);
|
|
67
|
+
}
|
|
68
|
+
if (!VxeUISelectComponent) {
|
|
69
|
+
(0, _log.errLog)('vxe.error.reqComp', ['vxe-select']);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
render(h) {
|
|
75
|
+
const {
|
|
76
|
+
hasFile,
|
|
77
|
+
parseTypeLabel,
|
|
78
|
+
defaultOptions,
|
|
79
|
+
storeData,
|
|
80
|
+
selectName
|
|
81
|
+
} = this;
|
|
60
82
|
return h('vxe-modal', {
|
|
61
83
|
ref: 'modal',
|
|
62
84
|
props: {
|
|
63
85
|
value: storeData.visible,
|
|
64
86
|
title: getI18n('vxe.import.impTitle'),
|
|
65
|
-
width:
|
|
87
|
+
width: 540,
|
|
66
88
|
mask: true,
|
|
67
89
|
lockView: true,
|
|
68
90
|
showFooter: false,
|
|
@@ -71,7 +93,7 @@ var _default = exports.default = {
|
|
|
71
93
|
loading: this.loading
|
|
72
94
|
},
|
|
73
95
|
on: {
|
|
74
|
-
input
|
|
96
|
+
input(value) {
|
|
75
97
|
storeData.visible = value;
|
|
76
98
|
},
|
|
77
99
|
show: this.showEvent
|
|
@@ -109,7 +131,7 @@ var _default = exports.default = {
|
|
|
109
131
|
options: storeData.modeList
|
|
110
132
|
},
|
|
111
133
|
on: {
|
|
112
|
-
input
|
|
134
|
+
input(value) {
|
|
113
135
|
defaultOptions.mode = value;
|
|
114
136
|
}
|
|
115
137
|
}
|
|
@@ -130,47 +152,46 @@ var _default = exports.default = {
|
|
|
130
152
|
}, getI18n('vxe.import.impConfirm'))])])]);
|
|
131
153
|
},
|
|
132
154
|
methods: {
|
|
133
|
-
clearFileEvent
|
|
155
|
+
clearFileEvent() {
|
|
134
156
|
Object.assign(this.storeData, {
|
|
135
157
|
filename: '',
|
|
136
158
|
sheetName: '',
|
|
137
159
|
type: ''
|
|
138
160
|
});
|
|
139
161
|
},
|
|
140
|
-
selectFileEvent
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
162
|
+
selectFileEvent() {
|
|
163
|
+
const $xetable = this.$parent;
|
|
164
|
+
$xetable.readFile(this.defaultOptions).then(params => {
|
|
165
|
+
const {
|
|
166
|
+
file
|
|
167
|
+
} = params;
|
|
168
|
+
Object.assign(this.storeData, (0, _utils.parseFile)(file), {
|
|
169
|
+
file
|
|
147
170
|
});
|
|
148
|
-
}).catch(
|
|
149
|
-
return e;
|
|
150
|
-
});
|
|
171
|
+
}).catch(e => e);
|
|
151
172
|
},
|
|
152
|
-
showEvent
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
173
|
+
showEvent() {
|
|
174
|
+
this.$nextTick(() => {
|
|
175
|
+
const {
|
|
176
|
+
$refs
|
|
177
|
+
} = this;
|
|
178
|
+
const targetElem = $refs.fileBtn;
|
|
157
179
|
if (targetElem) {
|
|
158
180
|
targetElem.focus();
|
|
159
181
|
}
|
|
160
182
|
});
|
|
161
183
|
},
|
|
162
|
-
cancelEvent
|
|
184
|
+
cancelEvent() {
|
|
163
185
|
this.storeData.visible = false;
|
|
164
186
|
},
|
|
165
|
-
importEvent
|
|
166
|
-
|
|
167
|
-
var $xetable = this.$parent;
|
|
187
|
+
importEvent() {
|
|
188
|
+
const $xetable = this.$parent;
|
|
168
189
|
this.loading = true;
|
|
169
|
-
$xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}).catch(
|
|
173
|
-
|
|
190
|
+
$xetable.importByFile(this.storeData.file, Object.assign({}, $xetable.importOpts, this.defaultOptions)).then(() => {
|
|
191
|
+
this.loading = false;
|
|
192
|
+
this.storeData.visible = false;
|
|
193
|
+
}).catch(() => {
|
|
194
|
+
this.loading = false;
|
|
174
195
|
});
|
|
175
196
|
}
|
|
176
197
|
}
|
|
@@ -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");function _interopRequireDefault(
|
|
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:"VxeTableImportPanel",mixins:[globalMixins.sizeMixin],props:{defaultOptions:Object,storeData:Object},components:{},data(){return{loading:!1}},computed:{selectName(){return this.storeData.filename+"."+this.storeData.type},hasFile(){return this.storeData.file&&this.storeData.type},parseTypeLabel(){var e=this.storeData;let{type:t,typeList:i}=e;return t?(e=_xeUtils.default.find(i,e=>t===e.value))?e.label:"*.*":"*."+i.map(e=>e.value).join(", *.")}},created(){if("development"===process.env.NODE_ENV){let e=_ui.VxeUI.getComponent("VxeModal"),t=_ui.VxeUI.getComponent("VxeButton"),i=_ui.VxeUI.getComponent("VxeSelect");this.$nextTick(()=>{e||(0,_log.errLog)("vxe.error.reqComp",["vxe-modal"]),t||(0,_log.errLog)("vxe.error.reqComp",["vxe-button"]),i||(0,_log.errLog)("vxe.error.reqComp",["vxe-select"])})}},render(e){let{hasFile:t,parseTypeLabel:i,defaultOptions:s,storeData:l,selectName:o}=this;return e("vxe-modal",{ref:"modal",props:{value:l.visible,title:getI18n("vxe.import.impTitle"),width:540,mask:!0,lockView:!0,showFooter:!1,escClosable:!0,maskClosable:!0,loading:this.loading},on:{input(e){l.visible=e},show:this.showEvent}},[e("div",{class:"vxe-export--panel"},[e("table",{attrs:{cellspacing:0,cellpadding:0,border:0}},[e("tbody",[e("tr",[e("td",getI18n("vxe.import.impFile")),e("td",[t?e("div",{class:"vxe-import-selected--file",attrs:{title:o}},[e("span",o),e("i",{class:getIcon().INPUT_CLEAR,on:{click:this.clearFileEvent}})]):e("button",{ref:"fileBtn",class:"vxe-import-select--file",attrs:{type:"button"},on:{click:this.selectFileEvent}},getI18n("vxe.import.impSelect"))])]),e("tr",[e("td",getI18n("vxe.import.impType")),e("td",i)]),e("tr",[e("td",getI18n("vxe.import.impMode")),e("td",[e("vxe-select",{props:{value:s.mode,options:l.modeList},on:{input(e){s.mode=e}}})])])])]),e("div",{class:"vxe-export--panel-btns"},[e("vxe-button",{on:{click:this.cancelEvent}},getI18n("vxe.import.impCancel")),e("vxe-button",{props:{status:"primary",disabled:!t},on:{click:this.importEvent}},getI18n("vxe.import.impConfirm"))])])])},methods:{clearFileEvent(){Object.assign(this.storeData,{filename:"",sheetName:"",type:""})},selectFileEvent(){this.$parent.readFile(this.defaultOptions).then(e=>{e=e.file;Object.assign(this.storeData,(0,_utils.parseFile)(e),{file:e})}).catch(e=>e)},showEvent(){this.$nextTick(()=>{var e=this.$refs,e=e.fileBtn;e&&e.focus()})},cancelEvent(){this.storeData.visible=!1},importEvent(){var e=this.$parent;this.loading=!0,e.importByFile(this.storeData.file,Object.assign({},e.importOpts,this.defaultOptions)).then(()=>{this.loading=!1,this.storeData.visible=!1}).catch(()=>{this.loading=!1})}}};
|