ele-admin-plus 1.1.9 → 1.2.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/core-export.d.ts +1 -0
- package/es/core-export.js +1 -0
- package/es/ele-alert/index.d.ts +2 -2
- package/es/ele-alert/props.d.ts +1 -1
- package/es/ele-app/components/message-body.d.ts +39 -0
- package/es/ele-app/components/message-body.js +92 -0
- package/es/ele-app/el.d.ts +2 -0
- package/es/ele-app/style/message/css-var.scss +0 -4
- package/es/ele-app/style/message/index.scss +199 -77
- package/es/ele-app/style/overwrite/input/index.scss +2 -0
- package/es/ele-app/style/overwrite/message-box/index.scss +31 -0
- package/es/ele-app/style/overwrite/tag/css-var.scss +0 -16
- package/es/ele-app/style/overwrite/tag/index.scss +57 -14
- package/es/ele-app/types.d.ts +6 -1
- package/es/ele-config-provider/components/receiver-view.js +3 -3
- package/es/ele-config-provider/index.d.ts +8 -4
- package/es/ele-config-provider/index.js +19 -5
- package/es/ele-config-provider/props.d.ts +9 -4
- package/es/ele-config-provider/props.js +9 -5
- package/es/ele-config-provider/receiver.js +2 -2
- package/es/ele-config-provider/types.d.ts +22 -1
- package/es/ele-data-table/types.d.ts +2 -0
- package/es/ele-drawer/index.d.ts +2 -2
- package/es/ele-edit-tag/index.d.ts +9 -4
- package/es/ele-edit-tag/index.js +4 -2
- package/es/ele-edit-tag/props.d.ts +3 -1
- package/es/ele-edit-tag/props.js +2 -0
- package/es/ele-edit-tag/style/index.scss +11 -4
- package/es/ele-icon-select/index.d.ts +10 -12
- package/es/ele-icon-select/props.d.ts +1 -1
- package/es/ele-map-picker/index.d.ts +1 -1
- package/es/ele-menus/index.d.ts +2 -2
- package/es/ele-menus/index.js +11 -0
- package/es/ele-modal/index.d.ts +3 -3
- package/es/ele-modal/style/index.scss +2 -0
- package/es/ele-modal/util.d.ts +1 -1
- package/es/ele-modal/util.js +2 -4
- package/es/ele-popconfirm/index.d.ts +3 -3
- package/es/ele-popconfirm/props.d.ts +1 -1
- package/es/ele-popover/index.d.ts +2 -2
- package/es/ele-pro-layout/components/pro-header.d.ts +1 -1
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +1 -1
- package/es/ele-pro-layout/index.js +1 -1
- package/es/ele-pro-layout/types.d.ts +4 -4
- package/es/ele-pro-table/components/table-tools.d.ts +11 -2
- package/es/ele-pro-table/components/table-tools.js +14 -26
- package/es/ele-pro-table/components/tool-column.d.ts +1 -0
- package/es/ele-pro-table/components/tool-export.d.ts +29 -56
- package/es/ele-pro-table/components/tool-export.js +100 -52
- package/es/ele-pro-table/components/tool-print-body-cell.js +50 -6
- package/es/ele-pro-table/components/tool-print-header-cell.js +4 -1
- package/es/ele-pro-table/components/tool-print.d.ts +29 -50
- package/es/ele-pro-table/components/tool-print.js +174 -69
- package/es/ele-pro-table/index.js +59 -50
- package/es/ele-pro-table/style/index.scss +9 -0
- package/es/ele-pro-table/types.d.ts +32 -0
- package/es/ele-pro-table/util.d.ts +18 -3
- package/es/ele-pro-table/util.js +160 -28
- package/es/ele-table/style/index.scss +16 -0
- package/es/ele-tooltip/index.d.ts +3 -3
- package/es/ele-virtual-table/util.d.ts +3 -1
- package/es/ele-virtual-table/util.js +7 -2
- package/es/icons/LoadingOutlined.js +1 -1
- package/es/lang/en_US.js +7 -1
- package/es/lang/zh_CN.js +7 -1
- package/es/lang/zh_TW.js +7 -1
- package/es/style/themes/default.scss +82 -85
- package/es/style/themes/rounded.scss +11 -15
- package/es/utils/core.d.ts +7 -0
- package/es/utils/core.js +16 -2
- package/es/utils/message-box.d.ts +25 -0
- package/es/utils/message-box.js +71 -0
- package/es/utils/message.d.ts +44 -20
- package/es/utils/message.js +220 -37
- package/lib/core-export.cjs +8 -0
- package/lib/core-export.d.ts +1 -0
- package/lib/ele-alert/index.d.ts +2 -2
- package/lib/ele-alert/props.d.ts +1 -1
- package/lib/ele-app/components/message-body.cjs +91 -0
- package/lib/ele-app/components/message-body.d.ts +39 -0
- package/lib/ele-app/el.d.ts +2 -0
- package/lib/ele-app/style/message/css-var.scss +0 -4
- package/lib/ele-app/style/message/index.scss +199 -77
- package/lib/ele-app/style/overwrite/input/index.scss +2 -0
- package/lib/ele-app/style/overwrite/message-box/index.scss +31 -0
- package/lib/ele-app/style/overwrite/tag/css-var.scss +0 -16
- package/lib/ele-app/style/overwrite/tag/index.scss +57 -14
- package/lib/ele-app/types.d.ts +6 -1
- package/lib/ele-config-provider/components/receiver-view.cjs +1 -1
- package/lib/ele-config-provider/index.cjs +18 -4
- package/lib/ele-config-provider/index.d.ts +8 -4
- package/lib/ele-config-provider/props.cjs +9 -5
- package/lib/ele-config-provider/props.d.ts +9 -4
- package/lib/ele-config-provider/receiver.cjs +1 -1
- package/lib/ele-config-provider/types.d.ts +22 -1
- package/lib/ele-data-table/types.d.ts +2 -0
- package/lib/ele-drawer/index.d.ts +2 -2
- package/lib/ele-edit-tag/index.cjs +4 -2
- package/lib/ele-edit-tag/index.d.ts +9 -4
- package/lib/ele-edit-tag/props.cjs +2 -0
- package/lib/ele-edit-tag/props.d.ts +3 -1
- package/lib/ele-edit-tag/style/index.scss +11 -4
- package/lib/ele-icon-select/index.d.ts +10 -12
- package/lib/ele-icon-select/props.d.ts +1 -1
- package/lib/ele-map-picker/index.d.ts +1 -1
- package/lib/ele-menus/index.cjs +11 -0
- package/lib/ele-menus/index.d.ts +2 -2
- package/lib/ele-modal/index.d.ts +3 -3
- package/lib/ele-modal/style/index.scss +2 -0
- package/lib/ele-modal/util.cjs +1 -3
- package/lib/ele-modal/util.d.ts +1 -1
- package/lib/ele-popconfirm/index.d.ts +3 -3
- package/lib/ele-popconfirm/props.d.ts +1 -1
- package/lib/ele-popover/index.d.ts +2 -2
- package/lib/ele-pro-layout/components/pro-header.d.ts +1 -1
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +1 -1
- package/lib/ele-pro-layout/index.cjs +1 -1
- package/lib/ele-pro-layout/types.d.ts +4 -4
- package/lib/ele-pro-table/components/table-tools.cjs +14 -26
- package/lib/ele-pro-table/components/table-tools.d.ts +11 -2
- package/lib/ele-pro-table/components/tool-column.d.ts +1 -0
- package/lib/ele-pro-table/components/tool-export.cjs +99 -51
- package/lib/ele-pro-table/components/tool-export.d.ts +29 -56
- package/lib/ele-pro-table/components/tool-print-body-cell.cjs +49 -5
- package/lib/ele-pro-table/components/tool-print-header-cell.cjs +4 -1
- package/lib/ele-pro-table/components/tool-print.cjs +172 -67
- package/lib/ele-pro-table/components/tool-print.d.ts +29 -50
- package/lib/ele-pro-table/index.cjs +59 -50
- package/lib/ele-pro-table/style/index.scss +9 -0
- package/lib/ele-pro-table/types.d.ts +32 -0
- package/lib/ele-pro-table/util.cjs +160 -28
- package/lib/ele-pro-table/util.d.ts +18 -3
- package/lib/ele-table/style/index.scss +16 -0
- package/lib/ele-tooltip/index.d.ts +3 -3
- package/lib/ele-virtual-table/util.cjs +7 -2
- package/lib/ele-virtual-table/util.d.ts +3 -1
- package/lib/icons/LoadingOutlined.cjs +1 -1
- package/lib/lang/en_US.cjs +7 -1
- package/lib/lang/zh_CN.cjs +7 -1
- package/lib/lang/zh_TW.cjs +7 -1
- package/lib/style/themes/default.scss +82 -85
- package/lib/style/themes/rounded.scss +11 -15
- package/lib/utils/core.cjs +16 -2
- package/lib/utils/core.d.ts +7 -0
- package/lib/utils/message-box.cjs +71 -0
- package/lib/utils/message-box.d.ts +25 -0
- package/lib/utils/message.cjs +216 -33
- package/lib/utils/message.d.ts +44 -20
- package/package.json +14 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, reactive, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, mergeProps, createTextVNode, toDisplayString, withModifiers, createCommentVNode, createElementVNode } from "vue";
|
|
2
2
|
import { ElForm, ElFormItem, ElInput, ElSelect, ElOption, ElCheckbox, ElButton, ElIcon } from "element-plus";
|
|
3
3
|
import { DownloadOutlined } from "../../icons";
|
|
4
|
-
import { eachTree } from "../../utils/core";
|
|
4
|
+
import { findTree, eachTree } from "../../utils/core";
|
|
5
5
|
import EleTool from "../../ele-tool/index";
|
|
6
6
|
import EleModal from "../../ele-modal/index";
|
|
7
7
|
import { getColItems, columnsExportFilter, getCheckedColumns, getExportData, exportCSV } from "../util";
|
|
@@ -23,34 +23,13 @@ const _sfc_main = defineComponent({
|
|
|
23
23
|
ToolColumnList
|
|
24
24
|
},
|
|
25
25
|
props: {
|
|
26
|
-
/** 提示文字 */
|
|
27
|
-
title: String,
|
|
28
26
|
/** 提示位置 */
|
|
29
27
|
placement: String,
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
untitledText: String,
|
|
36
|
-
/** 文件名文字 */
|
|
37
|
-
fileNameText: String,
|
|
38
|
-
/** 文件名提示文字 */
|
|
39
|
-
fileNamePlaceholderText: String,
|
|
40
|
-
/** 选择数据文字 */
|
|
41
|
-
selectDataText: String,
|
|
42
|
-
/** 选择字段文字 */
|
|
43
|
-
selectColumnText: String,
|
|
44
|
-
/** 当前页数据文字 */
|
|
45
|
-
dataTypePageText: String,
|
|
46
|
-
/** 选中数据文字 */
|
|
47
|
-
dataTypeSelectedText: String,
|
|
48
|
-
/** 全部数据文字 */
|
|
49
|
-
dataTypeAllText: String,
|
|
50
|
-
/** 取消文字 */
|
|
51
|
-
cancelText: String,
|
|
52
|
-
/** 确定文字 */
|
|
53
|
-
okText: String,
|
|
28
|
+
/** 表格国际化 */
|
|
29
|
+
locale: {
|
|
30
|
+
type: Object,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
54
33
|
/** 弹窗参数 */
|
|
55
34
|
modalProps: Object,
|
|
56
35
|
/** 列数据 */
|
|
@@ -63,6 +42,8 @@ const _sfc_main = defineComponent({
|
|
|
63
42
|
datasource: [Array, Function],
|
|
64
43
|
/** 单元格合并行列方法 */
|
|
65
44
|
spanMethod: Function,
|
|
45
|
+
/** 表格是否有表头 */
|
|
46
|
+
tableHeader: Boolean,
|
|
66
47
|
/** 是否显示合计行 */
|
|
67
48
|
showSummary: Boolean,
|
|
68
49
|
/** 合计行文本 */
|
|
@@ -71,6 +52,8 @@ const _sfc_main = defineComponent({
|
|
|
71
52
|
summaryMethod: Function,
|
|
72
53
|
/** 序号列起始索引 */
|
|
73
54
|
pageIndex: Number,
|
|
55
|
+
/** 子级字段名 */
|
|
56
|
+
childrenField: String,
|
|
74
57
|
/** 表格请求数据方法 */
|
|
75
58
|
fetch: Function,
|
|
76
59
|
/** 默认文件名 */
|
|
@@ -96,7 +79,7 @@ const _sfc_main = defineComponent({
|
|
|
96
79
|
});
|
|
97
80
|
const fileNameRules = reactive({
|
|
98
81
|
required: true,
|
|
99
|
-
message: props.
|
|
82
|
+
message: props.locale.exportFileNamePlaceholder,
|
|
100
83
|
type: "string",
|
|
101
84
|
trigger: "blur"
|
|
102
85
|
});
|
|
@@ -104,6 +87,10 @@ const _sfc_main = defineComponent({
|
|
|
104
87
|
const colItems = ref([]);
|
|
105
88
|
const isCheckAll = ref(false);
|
|
106
89
|
const isIndeterminate = ref(false);
|
|
90
|
+
const showHeader = ref(true);
|
|
91
|
+
const showFooter = ref(false);
|
|
92
|
+
const showTreeIndex = ref(false);
|
|
93
|
+
const treeIndexDisabled = ref(true);
|
|
107
94
|
const openModal = () => {
|
|
108
95
|
visible.value = true;
|
|
109
96
|
};
|
|
@@ -129,9 +116,12 @@ const _sfc_main = defineComponent({
|
|
|
129
116
|
columns,
|
|
130
117
|
props.spanMethod,
|
|
131
118
|
props.pageIndex,
|
|
132
|
-
|
|
119
|
+
showFooter.value,
|
|
133
120
|
props.sumText,
|
|
134
|
-
props.summaryMethod
|
|
121
|
+
props.summaryMethod,
|
|
122
|
+
props.childrenField,
|
|
123
|
+
showTreeIndex.value,
|
|
124
|
+
showHeader.value
|
|
135
125
|
);
|
|
136
126
|
if (typeof props.beforeExport === "function") {
|
|
137
127
|
const flag = props.beforeExport({
|
|
@@ -187,7 +177,9 @@ const _sfc_main = defineComponent({
|
|
|
187
177
|
const initColItems = () => {
|
|
188
178
|
colItems.value = getColItems(
|
|
189
179
|
props.columns,
|
|
190
|
-
props.
|
|
180
|
+
props.locale.columnUntitled,
|
|
181
|
+
props.locale.columnIndex,
|
|
182
|
+
props.locale.columnExpand,
|
|
191
183
|
columnsExportFilter,
|
|
192
184
|
true,
|
|
193
185
|
true
|
|
@@ -208,11 +200,12 @@ const _sfc_main = defineComponent({
|
|
|
208
200
|
isCheckAll.value = colItems.value.length > 0 && checkAll;
|
|
209
201
|
isIndeterminate.value = !checkAll && indeterminate;
|
|
210
202
|
};
|
|
211
|
-
const onCheckedChange = (item, checked) => {
|
|
203
|
+
const onCheckedChange = (item, checked, type) => {
|
|
212
204
|
let checkAll = true;
|
|
213
205
|
let indeterminate = false;
|
|
214
206
|
eachTree(colItems.value, (d) => {
|
|
215
|
-
|
|
207
|
+
const flag = item == null ? type === d.type : d.uid === item.uid;
|
|
208
|
+
if (flag) {
|
|
216
209
|
d.checked = checked;
|
|
217
210
|
}
|
|
218
211
|
if (!d.checked && checkAll) {
|
|
@@ -221,7 +214,7 @@ const _sfc_main = defineComponent({
|
|
|
221
214
|
if (d.checked && !indeterminate) {
|
|
222
215
|
indeterminate = true;
|
|
223
216
|
}
|
|
224
|
-
if (
|
|
217
|
+
if (flag && !checkAll && indeterminate) {
|
|
225
218
|
return false;
|
|
226
219
|
}
|
|
227
220
|
});
|
|
@@ -252,19 +245,36 @@ const _sfc_main = defineComponent({
|
|
|
252
245
|
const onReset = () => {
|
|
253
246
|
initColItems();
|
|
254
247
|
};
|
|
248
|
+
const handleTreeIndexChange = (checked) => {
|
|
249
|
+
if (checked) {
|
|
250
|
+
onCheckedChange(void 0, false, "index");
|
|
251
|
+
}
|
|
252
|
+
};
|
|
255
253
|
watch(visible, (visible2) => {
|
|
256
254
|
var _a, _b;
|
|
257
255
|
if (visible2) {
|
|
258
256
|
form.fileName = props.defaultFileName;
|
|
259
257
|
dataType.value = props.defaultDataType;
|
|
260
258
|
initColItems();
|
|
259
|
+
showHeader.value = props.tableHeader;
|
|
260
|
+
showFooter.value = props.showSummary;
|
|
261
|
+
treeIndexDisabled.value = !(props.pageData && props.pageData.some(
|
|
262
|
+
(d) => {
|
|
263
|
+
var _a2;
|
|
264
|
+
return props.childrenField && ((_a2 = d[props.childrenField]) == null ? void 0 : _a2.length);
|
|
265
|
+
}
|
|
266
|
+
)) && findTree(colItems.value, (c) => c.type === "expand") == null;
|
|
267
|
+
if (treeIndexDisabled.value) {
|
|
268
|
+
showTreeIndex.value = false;
|
|
269
|
+
}
|
|
270
|
+
handleTreeIndexChange(showTreeIndex.value);
|
|
261
271
|
return;
|
|
262
272
|
}
|
|
263
273
|
loading.value = false;
|
|
264
274
|
(_b = (_a = formRef.value) == null ? void 0 : _a.clearValidate) == null ? void 0 : _b.call(_a);
|
|
265
275
|
});
|
|
266
276
|
watch(
|
|
267
|
-
() => props.
|
|
277
|
+
() => props.locale.exportFileNamePlaceholder,
|
|
268
278
|
(placeholder) => {
|
|
269
279
|
fileNameRules.message = placeholder;
|
|
270
280
|
}
|
|
@@ -279,13 +289,18 @@ const _sfc_main = defineComponent({
|
|
|
279
289
|
colItems,
|
|
280
290
|
isCheckAll,
|
|
281
291
|
isIndeterminate,
|
|
292
|
+
showHeader,
|
|
293
|
+
showFooter,
|
|
294
|
+
showTreeIndex,
|
|
295
|
+
treeIndexDisabled,
|
|
282
296
|
openModal,
|
|
283
297
|
closeModal,
|
|
284
298
|
handleExport,
|
|
285
299
|
onCheckedChange,
|
|
286
300
|
onSortChange,
|
|
287
301
|
onCheckAllChange,
|
|
288
|
-
onReset
|
|
302
|
+
onReset,
|
|
303
|
+
handleTreeIndexChange
|
|
289
304
|
};
|
|
290
305
|
}
|
|
291
306
|
});
|
|
@@ -299,6 +314,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
299
314
|
const _hoisted_1 = { class: "ele-tool-column is-sortable" };
|
|
300
315
|
const _hoisted_2 = { class: "ele-tool-column-header" };
|
|
301
316
|
const _hoisted_3 = { class: "ele-tool-column-label" };
|
|
317
|
+
const _hoisted_4 = { class: "ele-tool-form-options" };
|
|
302
318
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
303
319
|
const _component_DownloadOutlined = resolveComponent("DownloadOutlined");
|
|
304
320
|
const _component_ElIcon = resolveComponent("ElIcon");
|
|
@@ -313,7 +329,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
313
329
|
const _component_EleModal = resolveComponent("EleModal");
|
|
314
330
|
const _component_EleTool = resolveComponent("EleTool");
|
|
315
331
|
return openBlock(), createBlock(_component_EleTool, {
|
|
316
|
-
title: _ctx.
|
|
332
|
+
title: _ctx.locale.export,
|
|
317
333
|
placement: _ctx.placement,
|
|
318
334
|
onClick: _ctx.openModal
|
|
319
335
|
}, {
|
|
@@ -327,16 +343,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
327
343
|
createVNode(_component_EleModal, mergeProps({
|
|
328
344
|
form: true,
|
|
329
345
|
width: "460px",
|
|
330
|
-
title: _ctx.
|
|
346
|
+
title: _ctx.locale.export,
|
|
331
347
|
position: "center"
|
|
332
348
|
}, _ctx.modalProps || {}, {
|
|
333
349
|
modelValue: _ctx.visible,
|
|
334
|
-
"onUpdate:modelValue": _cache[
|
|
350
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => _ctx.visible = $event)
|
|
335
351
|
}), {
|
|
336
352
|
footer: withCtx(() => [
|
|
337
353
|
createVNode(_component_ElButton, { onClick: _ctx.closeModal }, {
|
|
338
354
|
default: withCtx(() => [
|
|
339
|
-
createTextVNode(toDisplayString(_ctx.
|
|
355
|
+
createTextVNode(toDisplayString(_ctx.locale.exportCancel), 1)
|
|
340
356
|
]),
|
|
341
357
|
_: 1
|
|
342
358
|
}, 8, ["onClick"]),
|
|
@@ -346,7 +362,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
346
362
|
onClick: _ctx.handleExport
|
|
347
363
|
}, {
|
|
348
364
|
default: withCtx(() => [
|
|
349
|
-
createTextVNode(toDisplayString(_ctx.
|
|
365
|
+
createTextVNode(toDisplayString(_ctx.locale.exportOk), 1)
|
|
350
366
|
]),
|
|
351
367
|
_: 1
|
|
352
368
|
}, 8, ["loading", "onClick"])
|
|
@@ -356,13 +372,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
356
372
|
ref: "formRef",
|
|
357
373
|
model: _ctx.form,
|
|
358
374
|
labelWidth: "80px",
|
|
359
|
-
onSubmit: _cache[
|
|
375
|
+
onSubmit: _cache[6] || (_cache[6] = withModifiers(() => {
|
|
360
376
|
}, ["prevent"])),
|
|
361
377
|
class: "ele-tool-export-form"
|
|
362
378
|
}, {
|
|
363
379
|
default: withCtx(() => [
|
|
364
380
|
createVNode(_component_ElFormItem, {
|
|
365
|
-
label: _ctx.
|
|
381
|
+
label: _ctx.locale.exportFileName,
|
|
366
382
|
prop: "fileName",
|
|
367
383
|
rules: _ctx.fileNameRules
|
|
368
384
|
}, {
|
|
@@ -372,33 +388,35 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
372
388
|
clearable: true,
|
|
373
389
|
modelValue: _ctx.form.fileName,
|
|
374
390
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.form.fileName = $event),
|
|
375
|
-
placeholder: _ctx.
|
|
391
|
+
placeholder: _ctx.locale.exportFileNamePlaceholder
|
|
376
392
|
}, null, 8, ["modelValue", "placeholder"])
|
|
377
393
|
]),
|
|
378
394
|
_: 1
|
|
379
395
|
}, 8, ["label", "rules"]),
|
|
380
|
-
createVNode(_component_ElFormItem, {
|
|
396
|
+
createVNode(_component_ElFormItem, {
|
|
397
|
+
label: _ctx.locale.exportSelectData
|
|
398
|
+
}, {
|
|
381
399
|
default: withCtx(() => [
|
|
382
400
|
createVNode(_component_ElSelect, {
|
|
383
401
|
modelValue: _ctx.dataType,
|
|
384
402
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.dataType = $event),
|
|
385
|
-
placeholder: _ctx.
|
|
403
|
+
placeholder: _ctx.locale.exportSelectData
|
|
386
404
|
}, {
|
|
387
405
|
default: withCtx(() => [
|
|
388
406
|
_ctx.pageData != null ? (openBlock(), createBlock(_component_ElOption, {
|
|
389
407
|
key: 0,
|
|
390
408
|
value: "pageData",
|
|
391
|
-
label: _ctx.
|
|
409
|
+
label: _ctx.locale.exportDataTypePage
|
|
392
410
|
}, null, 8, ["label"])) : createCommentVNode("", true),
|
|
393
411
|
_ctx.selections != null ? (openBlock(), createBlock(_component_ElOption, {
|
|
394
412
|
key: 1,
|
|
395
413
|
value: "selections",
|
|
396
|
-
label: _ctx.
|
|
414
|
+
label: _ctx.locale.exportDataTypeSelected
|
|
397
415
|
}, null, 8, ["label"])) : createCommentVNode("", true),
|
|
398
416
|
_ctx.datasource != null ? (openBlock(), createBlock(_component_ElOption, {
|
|
399
417
|
key: 2,
|
|
400
418
|
value: "data",
|
|
401
|
-
label: _ctx.
|
|
419
|
+
label: _ctx.locale.exportDataTypeAll
|
|
402
420
|
}, null, 8, ["label"])) : createCommentVNode("", true)
|
|
403
421
|
]),
|
|
404
422
|
_: 1
|
|
@@ -406,13 +424,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
406
424
|
]),
|
|
407
425
|
_: 1
|
|
408
426
|
}, 8, ["label"]),
|
|
409
|
-
createVNode(_component_ElFormItem, {
|
|
427
|
+
createVNode(_component_ElFormItem, {
|
|
428
|
+
label: _ctx.locale.exportSelectColumn
|
|
429
|
+
}, {
|
|
410
430
|
default: withCtx(() => [
|
|
411
431
|
createElementVNode("div", _hoisted_1, [
|
|
412
432
|
createElementVNode("div", _hoisted_2, [
|
|
413
433
|
createElementVNode("div", _hoisted_3, [
|
|
414
434
|
createVNode(_component_ElCheckbox, {
|
|
415
|
-
label: _ctx.
|
|
435
|
+
label: _ctx.locale.columnTitle,
|
|
416
436
|
modelValue: _ctx.isCheckAll,
|
|
417
437
|
indeterminate: _ctx.isIndeterminate,
|
|
418
438
|
"onUpdate:modelValue": _ctx.onCheckAllChange
|
|
@@ -421,7 +441,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
421
441
|
createElementVNode("div", {
|
|
422
442
|
class: "ele-tool-column-link",
|
|
423
443
|
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onReset && _ctx.onReset(...args))
|
|
424
|
-
}, toDisplayString(_ctx.
|
|
444
|
+
}, toDisplayString(_ctx.locale.columnReset), 1)
|
|
425
445
|
]),
|
|
426
446
|
createVNode(_component_ToolColumnList, {
|
|
427
447
|
data: _ctx.colItems,
|
|
@@ -432,6 +452,34 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
432
452
|
])
|
|
433
453
|
]),
|
|
434
454
|
_: 1
|
|
455
|
+
}, 8, ["label"]),
|
|
456
|
+
createVNode(_component_ElFormItem, {
|
|
457
|
+
label: _ctx.locale.exportOther
|
|
458
|
+
}, {
|
|
459
|
+
default: withCtx(() => [
|
|
460
|
+
createElementVNode("div", _hoisted_4, [
|
|
461
|
+
createVNode(_component_ElCheckbox, {
|
|
462
|
+
label: _ctx.locale.exportOtherHeader,
|
|
463
|
+
modelValue: _ctx.showHeader,
|
|
464
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.showHeader = $event),
|
|
465
|
+
disabled: !_ctx.tableHeader
|
|
466
|
+
}, null, 8, ["label", "modelValue", "disabled"]),
|
|
467
|
+
createVNode(_component_ElCheckbox, {
|
|
468
|
+
label: _ctx.locale.exportOtherFooter,
|
|
469
|
+
modelValue: _ctx.showFooter,
|
|
470
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.showFooter = $event),
|
|
471
|
+
disabled: !_ctx.showSummary
|
|
472
|
+
}, null, 8, ["label", "modelValue", "disabled"]),
|
|
473
|
+
createVNode(_component_ElCheckbox, {
|
|
474
|
+
label: _ctx.locale.exportOtherTreeIndex,
|
|
475
|
+
modelValue: _ctx.showTreeIndex,
|
|
476
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.showTreeIndex = $event),
|
|
477
|
+
disabled: _ctx.treeIndexDisabled,
|
|
478
|
+
onChange: _ctx.handleTreeIndexChange
|
|
479
|
+
}, null, 8, ["label", "modelValue", "disabled", "onChange"])
|
|
480
|
+
])
|
|
481
|
+
]),
|
|
482
|
+
_: 1
|
|
435
483
|
}, 8, ["label"])
|
|
436
484
|
]),
|
|
437
485
|
_: 1
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, Fragment, createTextVNode, toDisplayString, createBlock, withCtx, createVNode, createCommentVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { ElIcon } from "element-plus";
|
|
3
|
+
import { ArrowDown } from "../../icons";
|
|
2
4
|
import { CellRender } from "../../ele-virtual-table/util";
|
|
3
5
|
const _sfc_main = defineComponent({
|
|
4
6
|
name: "ToolPrintBodyCell",
|
|
5
|
-
components: { CellRender },
|
|
7
|
+
components: { ElIcon, ArrowDown, CellRender },
|
|
6
8
|
props: {
|
|
7
9
|
/** 列数据 */
|
|
8
10
|
col: {
|
|
@@ -20,8 +22,9 @@ const _sfc_main = defineComponent({
|
|
|
20
22
|
const renderOpt = computed(() => {
|
|
21
23
|
const { text, row, column, index: $index } = props.col;
|
|
22
24
|
const params = [{ row, column, $index }];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
const slotName = column ? column.printSlot || column.slot : void 0;
|
|
26
|
+
if (column && !["expand", "selection", "index"].includes(column.type || "") && slotName && typeof slots[slotName] === "function") {
|
|
27
|
+
return { render: slots[slotName], params };
|
|
25
28
|
}
|
|
26
29
|
return { render: () => text, params };
|
|
27
30
|
});
|
|
@@ -35,13 +38,16 @@ const _sfc_main = defineComponent({
|
|
|
35
38
|
});
|
|
36
39
|
const cellStyle = computed(() => {
|
|
37
40
|
if (typeof props.bodyCellStyle === "function") {
|
|
41
|
+
if (cellParam.value.column == null) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
38
44
|
return props.bodyCellStyle(cellParam.value);
|
|
39
45
|
}
|
|
40
46
|
return props.bodyCellStyle;
|
|
41
47
|
});
|
|
42
48
|
const cellClass = computed(() => {
|
|
43
49
|
const classes = [];
|
|
44
|
-
const column =
|
|
50
|
+
const column = cellParam.value.column;
|
|
45
51
|
if (column) {
|
|
46
52
|
if (column.align) {
|
|
47
53
|
classes.push("is-align-" + column.align);
|
|
@@ -72,6 +78,9 @@ const _export_sfc = (sfc, props) => {
|
|
|
72
78
|
};
|
|
73
79
|
const _hoisted_1 = ["colspan", "rowspan"];
|
|
74
80
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
81
|
+
var _a;
|
|
82
|
+
const _component_ArrowDown = resolveComponent("ArrowDown");
|
|
83
|
+
const _component_ElIcon = resolveComponent("ElIcon");
|
|
75
84
|
const _component_CellRender = resolveComponent("CellRender");
|
|
76
85
|
return openBlock(), createElementBlock("td", {
|
|
77
86
|
colspan: _ctx.col.colspan,
|
|
@@ -79,7 +88,42 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
79
88
|
style: normalizeStyle(_ctx.cellStyle),
|
|
80
89
|
class: normalizeClass(_ctx.cellClass)
|
|
81
90
|
}, [
|
|
82
|
-
|
|
91
|
+
"expand" === ((_a = _ctx.col.column) == null ? void 0 : _a.type) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
92
|
+
_ctx.col.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
93
|
+
createTextVNode(toDisplayString(_ctx.col.text), 1)
|
|
94
|
+
], 64)) : (openBlock(), createBlock(_component_ElIcon, {
|
|
95
|
+
key: 1,
|
|
96
|
+
style: { "vertical-align": "middle" },
|
|
97
|
+
class: "ele-print-expand-icon"
|
|
98
|
+
}, {
|
|
99
|
+
default: withCtx(() => [
|
|
100
|
+
createVNode(_component_ArrowDown)
|
|
101
|
+
]),
|
|
102
|
+
_: 1
|
|
103
|
+
}))
|
|
104
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
105
|
+
_ctx.col.isTreeCell ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
106
|
+
_ctx.col.indent ? (openBlock(), createElementBlock("span", {
|
|
107
|
+
key: 0,
|
|
108
|
+
style: normalizeStyle({ paddingLeft: `${_ctx.col.indent * 16}px` }),
|
|
109
|
+
class: "ele-print-tree-indent"
|
|
110
|
+
}, null, 4)) : createCommentVNode("", true),
|
|
111
|
+
createVNode(_component_ElIcon, {
|
|
112
|
+
style: normalizeStyle({
|
|
113
|
+
verticalAlign: "middle",
|
|
114
|
+
marginRight: "2px",
|
|
115
|
+
visibility: _ctx.col.isTreeLeaf ? "hidden" : void 0
|
|
116
|
+
}),
|
|
117
|
+
class: "ele-print-tree-icon"
|
|
118
|
+
}, {
|
|
119
|
+
default: withCtx(() => [
|
|
120
|
+
createVNode(_component_ArrowDown)
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["style"])
|
|
124
|
+
], 64)) : createCommentVNode("", true),
|
|
125
|
+
createVNode(_component_CellRender, normalizeProps(guardReactiveProps(_ctx.renderOpt)), null, 16)
|
|
126
|
+
], 64))
|
|
83
127
|
], 14, _hoisted_1);
|
|
84
128
|
}
|
|
85
129
|
const toolPrintBodyCell = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
@@ -34,13 +34,16 @@ const _sfc_main = defineComponent({
|
|
|
34
34
|
});
|
|
35
35
|
const cellStyle = computed(() => {
|
|
36
36
|
if (typeof props.headerCellStyle === "function") {
|
|
37
|
+
if (cellParam.value.column == null) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
37
40
|
return props.headerCellStyle(cellParam.value);
|
|
38
41
|
}
|
|
39
42
|
return props.headerCellStyle;
|
|
40
43
|
});
|
|
41
44
|
const cellClass = computed(() => {
|
|
42
45
|
const classes = [];
|
|
43
|
-
const column =
|
|
46
|
+
const column = cellParam.value.column;
|
|
44
47
|
if (column) {
|
|
45
48
|
const align = column.headerAlign || column.align;
|
|
46
49
|
if (align) {
|
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
import { ExportDataType, BeforeExport, Datasource, FetchFunction, ColItem, TablePrintOptions } from '../types';
|
|
1
|
+
import { TableLocale, ExportDataType, BeforeExport, Datasource, FetchFunction, ColItem, TablePrintOptions } from '../types';
|
|
2
2
|
import { Columns, DataItem } from '../../ele-data-table/types';
|
|
3
3
|
import { EleModalProps, ElePrinterProps, EleTableProps } from '../../ele-app/plus';
|
|
4
4
|
import { PropType } from 'vue';
|
|
5
5
|
|
|
6
6
|
declare const _default: import('vue').DefineComponent<{
|
|
7
|
-
/** 提示文字 */
|
|
8
|
-
title: StringConstructor;
|
|
9
7
|
/** 提示位置 */
|
|
10
8
|
placement: PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, import('element-plus').Placement, unknown> | undefined>;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
untitledText: StringConstructor;
|
|
17
|
-
/** 选择数据文字 */
|
|
18
|
-
selectDataText: StringConstructor;
|
|
19
|
-
/** 选择字段文字 */
|
|
20
|
-
selectColumnText: StringConstructor;
|
|
21
|
-
/** 当前页数据文字 */
|
|
22
|
-
dataTypePageText: StringConstructor;
|
|
23
|
-
/** 选中数据文字 */
|
|
24
|
-
dataTypeSelectedText: StringConstructor;
|
|
25
|
-
/** 全部数据文字 */
|
|
26
|
-
dataTypeAllText: StringConstructor;
|
|
27
|
-
/** 取消文字 */
|
|
28
|
-
cancelText: StringConstructor;
|
|
29
|
-
/** 确定文字 */
|
|
30
|
-
okText: StringConstructor;
|
|
9
|
+
/** 表格国际化 */
|
|
10
|
+
locale: {
|
|
11
|
+
type: PropType<TableLocale>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
31
14
|
/** 弹窗参数 */
|
|
32
15
|
modalProps: PropType<EleModalProps>;
|
|
33
16
|
/** 打印组件参数 */
|
|
@@ -45,14 +28,15 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
45
28
|
/** 单元格合并行列方法 */
|
|
46
29
|
spanMethod: PropType<((data: {
|
|
47
30
|
row: DataItem;
|
|
48
|
-
/**
|
|
49
|
-
rowIndex: number;
|
|
31
|
+
rowIndex: number; /** 序号列起始索引 */
|
|
50
32
|
column: import('element-plus').TableColumnCtx<DataItem>;
|
|
51
33
|
columnIndex: number;
|
|
52
34
|
}) => number[] | {
|
|
53
35
|
rowspan: number;
|
|
54
36
|
colspan: number;
|
|
55
37
|
} | undefined) | undefined>;
|
|
38
|
+
/** 表格是否有表头 */
|
|
39
|
+
tableHeader: BooleanConstructor;
|
|
56
40
|
/** 是否显示合计行 */
|
|
57
41
|
showSummary: BooleanConstructor;
|
|
58
42
|
/** 合计行文本 */
|
|
@@ -69,6 +53,8 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
69
53
|
headerCellClassName: PropType<import('element-plus').CellCls<DataItem> | undefined>;
|
|
70
54
|
/** 序号列起始索引 */
|
|
71
55
|
pageIndex: NumberConstructor;
|
|
56
|
+
/** 子级字段名 */
|
|
57
|
+
childrenField: StringConstructor;
|
|
72
58
|
/** 表格请求数据方法 */
|
|
73
59
|
fetch: PropType<FetchFunction>;
|
|
74
60
|
/** 默认数据类型 */
|
|
@@ -88,43 +74,32 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
88
74
|
checked?: boolean | undefined;
|
|
89
75
|
fixed?: string | boolean | undefined;
|
|
90
76
|
children?: any[] | undefined;
|
|
77
|
+
type?: string | undefined;
|
|
91
78
|
}[]>;
|
|
92
79
|
isCheckAll: import('vue').Ref<boolean>;
|
|
93
80
|
isIndeterminate: import('vue').Ref<boolean>;
|
|
81
|
+
showHeader: import('vue').Ref<boolean>;
|
|
82
|
+
showFooter: import('vue').Ref<boolean>;
|
|
83
|
+
showTreeIndex: import('vue').Ref<boolean>;
|
|
84
|
+
treeIndexDisabled: import('vue').Ref<boolean>;
|
|
94
85
|
printOptions: TablePrintOptions;
|
|
95
86
|
openModal: () => void;
|
|
96
87
|
closeModal: () => void;
|
|
97
88
|
onPrintDone: () => void;
|
|
98
89
|
handlePrint: () => void;
|
|
99
|
-
onCheckedChange: (item
|
|
90
|
+
onCheckedChange: (item?: ColItem, checked?: boolean, type?: string) => void;
|
|
100
91
|
onSortChange: (items: ColItem[], parent?: ColItem) => void;
|
|
101
92
|
onCheckAllChange: (checked: boolean) => void;
|
|
102
93
|
onReset: () => void;
|
|
94
|
+
handleTreeIndexChange: (checked?: boolean | string | number) => void;
|
|
103
95
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
104
|
-
/** 提示文字 */
|
|
105
|
-
title: StringConstructor;
|
|
106
96
|
/** 提示位置 */
|
|
107
97
|
placement: PropType<import('element-plus/es/utils/index').EpPropMergeType<StringConstructor, import('element-plus').Placement, unknown> | undefined>;
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
untitledText: StringConstructor;
|
|
114
|
-
/** 选择数据文字 */
|
|
115
|
-
selectDataText: StringConstructor;
|
|
116
|
-
/** 选择字段文字 */
|
|
117
|
-
selectColumnText: StringConstructor;
|
|
118
|
-
/** 当前页数据文字 */
|
|
119
|
-
dataTypePageText: StringConstructor;
|
|
120
|
-
/** 选中数据文字 */
|
|
121
|
-
dataTypeSelectedText: StringConstructor;
|
|
122
|
-
/** 全部数据文字 */
|
|
123
|
-
dataTypeAllText: StringConstructor;
|
|
124
|
-
/** 取消文字 */
|
|
125
|
-
cancelText: StringConstructor;
|
|
126
|
-
/** 确定文字 */
|
|
127
|
-
okText: StringConstructor;
|
|
98
|
+
/** 表格国际化 */
|
|
99
|
+
locale: {
|
|
100
|
+
type: PropType<TableLocale>;
|
|
101
|
+
required: true;
|
|
102
|
+
};
|
|
128
103
|
/** 弹窗参数 */
|
|
129
104
|
modalProps: PropType<EleModalProps>;
|
|
130
105
|
/** 打印组件参数 */
|
|
@@ -142,14 +117,15 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
142
117
|
/** 单元格合并行列方法 */
|
|
143
118
|
spanMethod: PropType<((data: {
|
|
144
119
|
row: DataItem;
|
|
145
|
-
/**
|
|
146
|
-
rowIndex: number;
|
|
120
|
+
rowIndex: number; /** 序号列起始索引 */
|
|
147
121
|
column: import('element-plus').TableColumnCtx<DataItem>;
|
|
148
122
|
columnIndex: number;
|
|
149
123
|
}) => number[] | {
|
|
150
124
|
rowspan: number;
|
|
151
125
|
colspan: number;
|
|
152
126
|
} | undefined) | undefined>;
|
|
127
|
+
/** 表格是否有表头 */
|
|
128
|
+
tableHeader: BooleanConstructor;
|
|
153
129
|
/** 是否显示合计行 */
|
|
154
130
|
showSummary: BooleanConstructor;
|
|
155
131
|
/** 合计行文本 */
|
|
@@ -166,6 +142,8 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
166
142
|
headerCellClassName: PropType<import('element-plus').CellCls<DataItem> | undefined>;
|
|
167
143
|
/** 序号列起始索引 */
|
|
168
144
|
pageIndex: NumberConstructor;
|
|
145
|
+
/** 子级字段名 */
|
|
146
|
+
childrenField: StringConstructor;
|
|
169
147
|
/** 表格请求数据方法 */
|
|
170
148
|
fetch: PropType<FetchFunction>;
|
|
171
149
|
/** 默认数据类型 */
|
|
@@ -177,6 +155,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
177
155
|
beforePrint: PropType<BeforeExport>;
|
|
178
156
|
}>>, {
|
|
179
157
|
showSummary: boolean;
|
|
158
|
+
tableHeader: boolean;
|
|
180
159
|
defaultDataType: ExportDataType;
|
|
181
160
|
}, {}>;
|
|
182
161
|
export default _default;
|