ele-admin-plus 1.4.1-beta.1 → 1.4.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-components.d.ts +2 -0
- package/es/core-components.js +104 -100
- package/es/ele-app/plus.d.ts +9 -1
- package/es/ele-app/plusx.d.ts +26 -13
- package/es/ele-backtop/index.js +7 -1
- package/es/ele-basic-select/components/select-view.d.ts +53 -22
- package/es/ele-basic-select/components/select-view.js +57 -20
- package/es/ele-basic-select/index.d.ts +39 -19
- package/es/ele-basic-select/index.js +62 -13
- package/es/ele-basic-select/props.d.ts +33 -21
- package/es/ele-basic-select/props.js +33 -21
- package/es/ele-basic-select/style/index.js +2 -0
- package/es/ele-basic-select/types.d.ts +1 -1
- package/es/ele-config-provider/components/receiver-view.d.ts +2 -0
- package/es/ele-config-provider/components/receiver-view.js +74 -72
- package/es/ele-config-provider/receiver.d.ts +2 -2
- package/es/ele-config-provider/receiver.js +5 -1
- package/es/ele-config-provider/types.d.ts +10 -1
- package/es/ele-copyable/index.d.ts +2 -4
- package/es/ele-cron-builder/index.d.ts +24 -0
- package/es/ele-cron-builder/index.js +81 -0
- package/es/ele-cron-builder/props.d.ts +31 -0
- package/es/ele-cron-builder/props.js +24 -0
- package/es/ele-cron-builder/style/index.d.ts +1 -0
- package/es/ele-cron-builder/style/index.js +4 -0
- package/es/ele-cron-builder/style/index.scss +6 -0
- package/es/ele-cron-builder/types.d.ts +8 -0
- package/es/ele-cron-panel/components/cron-day.d.ts +25 -0
- package/es/ele-cron-panel/components/cron-day.js +232 -0
- package/es/ele-cron-panel/components/cron-hour.d.ts +25 -0
- package/es/ele-cron-panel/components/cron-hour.js +174 -0
- package/es/ele-cron-panel/components/cron-minute.d.ts +25 -0
- package/es/ele-cron-panel/components/cron-minute.js +174 -0
- package/es/ele-cron-panel/components/cron-month.d.ts +25 -0
- package/es/ele-cron-panel/components/cron-month.js +174 -0
- package/es/ele-cron-panel/components/cron-second.d.ts +25 -0
- package/es/ele-cron-panel/components/cron-second.js +174 -0
- package/es/ele-cron-panel/components/cron-week.d.ts +25 -0
- package/es/ele-cron-panel/components/cron-week.js +229 -0
- package/es/ele-cron-panel/components/cron-year.d.ts +25 -0
- package/es/ele-cron-panel/components/cron-year.js +186 -0
- package/es/ele-cron-panel/index.d.ts +14 -0
- package/es/ele-cron-panel/index.js +348 -0
- package/es/ele-cron-panel/props.d.ts +20 -0
- package/es/ele-cron-panel/props.js +14 -0
- package/es/ele-cron-panel/style/index.d.ts +1 -0
- package/es/ele-cron-panel/style/index.js +7 -0
- package/es/ele-cron-panel/style/index.scss +282 -0
- package/es/ele-cron-panel/types.d.ts +118 -0
- package/es/ele-cron-panel/util.d.ts +23 -0
- package/es/ele-cron-panel/util.js +542 -0
- package/es/ele-cropper/components/cropper-tools.d.ts +2 -2
- package/es/ele-cropper-modal/index.d.ts +2 -4
- package/es/ele-crud/index.d.ts +3 -3
- package/es/ele-drawer/index.d.ts +9 -0
- package/es/ele-drawer/index.js +5 -1
- package/es/ele-drawer/props.d.ts +5 -0
- package/es/ele-drawer/props.js +6 -1
- package/es/ele-drawer/style/index.scss +11 -0
- package/es/ele-file-list/index.d.ts +3 -3
- package/es/ele-icon-select/components/icon-grid.d.ts +8 -3
- package/es/ele-icon-select/components/icon-grid.js +20 -12
- package/es/ele-icon-select/index.d.ts +58 -59
- package/es/ele-icon-select/index.js +92 -86
- package/es/ele-icon-select/props.d.ts +35 -35
- package/es/ele-icon-select/props.js +34 -34
- package/es/ele-icon-select/style/css-var.scss +1 -1
- package/es/ele-icon-select/style/index.scss +50 -18
- package/es/ele-icon-select/types.d.ts +13 -0
- package/es/ele-map-picker/index.d.ts +3 -3
- package/es/ele-modal/index.d.ts +4 -2
- package/es/ele-modal/index.js +9 -3
- package/es/ele-modal/props.d.ts +2 -0
- package/es/ele-modal/props.js +2 -0
- package/es/ele-modal/style/index.scss +16 -0
- package/es/ele-pro-form/components/item-type-data.js +39 -64
- package/es/ele-pro-form/index.d.ts +3 -3
- package/es/ele-pro-table/components/table-tools.d.ts +12 -97
- package/es/ele-pro-table/components/table-tools.js +118 -248
- package/es/ele-pro-table/components/tool-export.d.ts +5 -1
- package/es/ele-pro-table/components/tool-export.js +32 -20
- package/es/ele-pro-table/components/tool-print.d.ts +5 -1
- package/es/ele-pro-table/components/tool-print.js +37 -25
- package/es/ele-pro-table/exceljs-plugin.d.ts +12 -0
- package/es/ele-pro-table/exceljs-plugin.js +81 -0
- package/es/ele-pro-table/index.d.ts +6 -7
- package/es/ele-pro-table/index.js +117 -46
- package/es/ele-pro-table/types.d.ts +11 -0
- package/es/ele-split-panel/style/index.scss +1 -1
- package/es/ele-table-select/index.d.ts +2 -0
- package/es/ele-table-select/props.d.ts +2 -0
- package/es/ele-table-select/props.js +3 -1
- package/es/ele-tour/index.d.ts +3 -3
- package/es/ele-tree-select/index.d.ts +2 -0
- package/es/ele-upload-list/index.d.ts +3 -3
- package/es/ele-upload-list/index.js +25 -8
- package/es/ele-virtual-table/components/body-cell.d.ts +1 -1
- package/es/ele-watermark/index.d.ts +20 -7
- package/es/ele-watermark/index.js +253 -94
- package/es/ele-watermark/props.d.ts +10 -3
- package/es/ele-watermark/props.js +10 -3
- package/es/ele-watermark/types.d.ts +12 -0
- package/es/ele-watermark/util.d.ts +2 -9
- package/es/ele-watermark/util.js +10 -19
- package/es/lang/en_US.js +116 -0
- package/es/lang/zh_CN.js +116 -0
- package/es/lang/zh_TW.js +116 -0
- package/es/style/plus.scss +3 -1
- package/es/style/themes/default.scss +12 -3
- package/es/style/themes/rounded.scss +2 -1
- package/es/utils/theme-util.d.ts +1 -1
- package/lib/core-components.cjs +104 -100
- package/lib/core-components.d.ts +2 -0
- package/lib/ele-app/plus.d.ts +9 -1
- package/lib/ele-app/plusx.d.ts +26 -13
- package/lib/ele-backtop/index.cjs +6 -0
- package/lib/ele-basic-select/components/select-view.cjs +56 -19
- package/lib/ele-basic-select/components/select-view.d.ts +53 -22
- package/lib/ele-basic-select/index.cjs +61 -12
- package/lib/ele-basic-select/index.d.ts +39 -19
- package/lib/ele-basic-select/props.cjs +33 -21
- package/lib/ele-basic-select/props.d.ts +33 -21
- package/lib/ele-basic-select/style/index.cjs +2 -0
- package/lib/ele-basic-select/types.d.ts +1 -1
- package/lib/ele-config-provider/components/receiver-view.cjs +2 -2
- package/lib/ele-config-provider/components/receiver-view.d.ts +2 -0
- package/lib/ele-config-provider/receiver.cjs +5 -1
- package/lib/ele-config-provider/receiver.d.ts +2 -2
- package/lib/ele-config-provider/types.d.ts +10 -1
- package/lib/ele-copyable/index.d.ts +2 -4
- package/lib/ele-cron-builder/index.cjs +80 -0
- package/lib/ele-cron-builder/index.d.ts +24 -0
- package/lib/ele-cron-builder/props.cjs +24 -0
- package/lib/ele-cron-builder/props.d.ts +31 -0
- package/lib/ele-cron-builder/style/index.cjs +5 -0
- package/lib/ele-cron-builder/style/index.d.ts +1 -0
- package/lib/ele-cron-builder/style/index.scss +6 -0
- package/lib/ele-cron-builder/types.d.ts +8 -0
- package/lib/ele-cron-panel/components/cron-day.cjs +231 -0
- package/lib/ele-cron-panel/components/cron-day.d.ts +25 -0
- package/lib/ele-cron-panel/components/cron-hour.cjs +173 -0
- package/lib/ele-cron-panel/components/cron-hour.d.ts +25 -0
- package/lib/ele-cron-panel/components/cron-minute.cjs +173 -0
- package/lib/ele-cron-panel/components/cron-minute.d.ts +25 -0
- package/lib/ele-cron-panel/components/cron-month.cjs +173 -0
- package/lib/ele-cron-panel/components/cron-month.d.ts +25 -0
- package/lib/ele-cron-panel/components/cron-second.cjs +173 -0
- package/lib/ele-cron-panel/components/cron-second.d.ts +25 -0
- package/lib/ele-cron-panel/components/cron-week.cjs +228 -0
- package/lib/ele-cron-panel/components/cron-week.d.ts +25 -0
- package/lib/ele-cron-panel/components/cron-year.cjs +185 -0
- package/lib/ele-cron-panel/components/cron-year.d.ts +25 -0
- package/lib/ele-cron-panel/index.cjs +347 -0
- package/lib/ele-cron-panel/index.d.ts +14 -0
- package/lib/ele-cron-panel/props.cjs +14 -0
- package/lib/ele-cron-panel/props.d.ts +20 -0
- package/lib/ele-cron-panel/style/index.cjs +8 -0
- package/lib/ele-cron-panel/style/index.d.ts +1 -0
- package/lib/ele-cron-panel/style/index.scss +282 -0
- package/lib/ele-cron-panel/types.d.ts +118 -0
- package/lib/ele-cron-panel/util.cjs +542 -0
- package/lib/ele-cron-panel/util.d.ts +23 -0
- package/lib/ele-cropper/components/cropper-tools.d.ts +2 -2
- package/lib/ele-cropper-modal/index.d.ts +2 -4
- package/lib/ele-crud/index.d.ts +3 -3
- package/lib/ele-drawer/index.cjs +4 -0
- package/lib/ele-drawer/index.d.ts +9 -0
- package/lib/ele-drawer/props.cjs +6 -1
- package/lib/ele-drawer/props.d.ts +5 -0
- package/lib/ele-drawer/style/index.scss +11 -0
- package/lib/ele-file-list/index.d.ts +3 -3
- package/lib/ele-icon-select/components/icon-grid.cjs +19 -11
- package/lib/ele-icon-select/components/icon-grid.d.ts +8 -3
- package/lib/ele-icon-select/index.cjs +91 -85
- package/lib/ele-icon-select/index.d.ts +58 -59
- package/lib/ele-icon-select/props.cjs +34 -34
- package/lib/ele-icon-select/props.d.ts +35 -35
- package/lib/ele-icon-select/style/css-var.scss +1 -1
- package/lib/ele-icon-select/style/index.scss +50 -18
- package/lib/ele-icon-select/types.d.ts +13 -0
- package/lib/ele-map-picker/index.d.ts +3 -3
- package/lib/ele-modal/index.cjs +9 -3
- package/lib/ele-modal/index.d.ts +4 -2
- package/lib/ele-modal/props.cjs +2 -0
- package/lib/ele-modal/props.d.ts +2 -0
- package/lib/ele-modal/style/index.scss +16 -0
- package/lib/ele-pro-form/components/item-type-data.cjs +39 -64
- package/lib/ele-pro-form/index.d.ts +3 -3
- package/lib/ele-pro-table/components/table-tools.cjs +117 -247
- package/lib/ele-pro-table/components/table-tools.d.ts +12 -97
- package/lib/ele-pro-table/components/tool-export.cjs +32 -20
- package/lib/ele-pro-table/components/tool-export.d.ts +5 -1
- package/lib/ele-pro-table/components/tool-print.cjs +37 -25
- package/lib/ele-pro-table/components/tool-print.d.ts +5 -1
- package/lib/ele-pro-table/exceljs-plugin.cjs +81 -0
- package/lib/ele-pro-table/exceljs-plugin.d.ts +12 -0
- package/lib/ele-pro-table/index.cjs +143 -72
- package/lib/ele-pro-table/index.d.ts +6 -7
- package/lib/ele-pro-table/types.d.ts +11 -0
- package/lib/ele-split-panel/style/index.scss +1 -1
- package/lib/ele-table-select/index.d.ts +2 -0
- package/lib/ele-table-select/props.cjs +3 -1
- package/lib/ele-table-select/props.d.ts +2 -0
- package/lib/ele-tour/index.d.ts +3 -3
- package/lib/ele-tree-select/index.d.ts +2 -0
- package/lib/ele-upload-list/index.cjs +25 -8
- package/lib/ele-upload-list/index.d.ts +3 -3
- package/lib/ele-virtual-table/components/body-cell.d.ts +1 -1
- package/lib/ele-watermark/index.cjs +251 -92
- package/lib/ele-watermark/index.d.ts +20 -7
- package/lib/ele-watermark/props.cjs +10 -3
- package/lib/ele-watermark/props.d.ts +10 -3
- package/lib/ele-watermark/types.d.ts +12 -0
- package/lib/ele-watermark/util.cjs +10 -19
- package/lib/ele-watermark/util.d.ts +2 -9
- package/lib/lang/en_US.cjs +116 -0
- package/lib/lang/zh_CN.cjs +116 -0
- package/lib/lang/zh_TW.cjs +116 -0
- package/lib/style/plus.scss +3 -1
- package/lib/style/themes/default.scss +12 -3
- package/lib/style/themes/rounded.scss +2 -1
- package/lib/utils/theme-util.d.ts +1 -1
- package/package.json +1 -1
- package/typings/global.d.ts +2 -0
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, computed, markRaw, createElementBlock, openBlock, Fragment, renderList, createBlock, renderSlot, createCommentVNode, withCtx, createVNode, unref } from "vue";
|
|
2
2
|
import { ElIcon } from "element-plus";
|
|
3
3
|
import { SizeSlackOutlined, SizeMiddleOutlined, SizeCompactOutlined, ReloadOutlined, DownloadOutlined, PrinterOutlined, ColumnHeightOutlined, FullscreenExitOutlined, FullscreenOutlined } from "../../icons/index";
|
|
4
4
|
import EleDropdown from "../../ele-dropdown/index";
|
|
5
|
-
import { useLocale } from "../../ele-config-provider/receiver";
|
|
6
5
|
import { getSizeCacheKey } from "../util";
|
|
7
6
|
import EleTool from "../../ele-tool/index";
|
|
8
7
|
import ToolColumn from "./tool-column";
|
|
9
|
-
import ToolExport from "./tool-export";
|
|
10
|
-
import ToolPrint from "./tool-print";
|
|
11
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
9
|
__name: "table-tools",
|
|
13
10
|
props: {
|
|
@@ -29,44 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
26
|
/** 本地缓存的名称 */
|
|
30
27
|
cacheKey: String,
|
|
31
28
|
/** 国际化 */
|
|
32
|
-
|
|
33
|
-
/** 表格选中数据 */
|
|
34
|
-
selections: Array,
|
|
35
|
-
/** 表格当前页数据 */
|
|
36
|
-
pageData: Array,
|
|
37
|
-
/** 单元格合并行列方法 */
|
|
38
|
-
spanMethod: Function,
|
|
39
|
-
/** 表格是否有表头 */
|
|
40
|
-
tableHeader: Boolean,
|
|
41
|
-
/** 是否显示合计行 */
|
|
42
|
-
showSummary: Boolean,
|
|
43
|
-
/** 合计行文本 */
|
|
44
|
-
sumText: String,
|
|
45
|
-
/** 合计行自定义方法 */
|
|
46
|
-
summaryMethod: Function,
|
|
47
|
-
/** 自定义表格样式 */
|
|
48
|
-
tableStyle: Object,
|
|
49
|
-
/** 单元格样式 */
|
|
50
|
-
cellStyle: [Object, Function],
|
|
51
|
-
/** 单元格类名自定义 */
|
|
52
|
-
cellClassName: [String, Function],
|
|
53
|
-
/** 单元格样式 */
|
|
54
|
-
headerCellStyle: [Object, Function],
|
|
55
|
-
/** 单元格类名自定义 */
|
|
56
|
-
headerCellClassName: [String, Function],
|
|
57
|
-
/** 序号列起始索引 */
|
|
58
|
-
pageIndex: Number,
|
|
59
|
-
/** 树表字段名 */
|
|
60
|
-
treeProps: Object,
|
|
61
|
-
/** 表格请求数据方法 */
|
|
62
|
-
fetch: Function,
|
|
63
|
-
/** 导出配置 */
|
|
64
|
-
exportConfig: {
|
|
65
|
-
type: Object,
|
|
66
|
-
required: true
|
|
67
|
-
},
|
|
68
|
-
/** 打印配置 */
|
|
69
|
-
printConfig: {
|
|
29
|
+
lang: {
|
|
70
30
|
type: Object,
|
|
71
31
|
required: true
|
|
72
32
|
}
|
|
@@ -75,30 +35,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
35
|
reload: () => true,
|
|
76
36
|
"update:size": (_size) => true,
|
|
77
37
|
"update:columns": (_columns, _tableColumns, _isReset) => true,
|
|
78
|
-
"update:maximized": (_maximized) => true
|
|
38
|
+
"update:maximized": (_maximized) => true,
|
|
39
|
+
openExportModal: () => true,
|
|
40
|
+
openPrintModal: () => true
|
|
79
41
|
},
|
|
80
|
-
setup(__props, {
|
|
42
|
+
setup(__props, { emit: __emit }) {
|
|
81
43
|
const ownSlots = ["default", "printTop", "printBottom"];
|
|
82
44
|
const props = __props;
|
|
83
45
|
const emit = __emit;
|
|
84
|
-
const { lang } = useLocale("table", props);
|
|
85
|
-
const toolExportRef = ref(null);
|
|
86
|
-
const toolPrintRef = ref(null);
|
|
87
46
|
const placement = computed(() => props.maximized ? "bottom" : "top");
|
|
88
47
|
const sizeDropdownItems = computed(() => {
|
|
89
48
|
return [
|
|
90
49
|
{
|
|
91
|
-
title: lang.
|
|
50
|
+
title: props.lang.sizeLarge,
|
|
92
51
|
command: "large",
|
|
93
52
|
icon: markRaw(SizeSlackOutlined)
|
|
94
53
|
},
|
|
95
54
|
{
|
|
96
|
-
title: lang.
|
|
55
|
+
title: props.lang.sizeDefault,
|
|
97
56
|
command: "default",
|
|
98
57
|
icon: markRaw(SizeMiddleOutlined)
|
|
99
58
|
},
|
|
100
59
|
{
|
|
101
|
-
title: lang.
|
|
60
|
+
title: props.lang.sizeSmall,
|
|
102
61
|
command: "small",
|
|
103
62
|
icon: markRaw(SizeCompactOutlined)
|
|
104
63
|
}
|
|
@@ -120,208 +79,119 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
120
79
|
emit("update:maximized", !props.maximized);
|
|
121
80
|
};
|
|
122
81
|
const openExportModal = () => {
|
|
123
|
-
|
|
124
|
-
toolExportRef.value.openModal();
|
|
125
|
-
}
|
|
82
|
+
emit("openExportModal");
|
|
126
83
|
};
|
|
127
84
|
const openPrintModal = () => {
|
|
128
|
-
|
|
129
|
-
toolPrintRef.value.openModal();
|
|
130
|
-
}
|
|
85
|
+
emit("openPrintModal");
|
|
131
86
|
};
|
|
132
|
-
const printData = (params) => {
|
|
133
|
-
if (toolPrintRef.value) {
|
|
134
|
-
toolPrintRef.value.printData(params);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const exportData = (params) => {
|
|
138
|
-
if (toolExportRef.value) {
|
|
139
|
-
toolExportRef.value.exportData(params);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
__expose({
|
|
143
|
-
openPrintModal,
|
|
144
|
-
printData,
|
|
145
|
-
openExportModal,
|
|
146
|
-
exportData
|
|
147
|
-
});
|
|
148
87
|
return (_ctx, _cache) => {
|
|
149
|
-
return openBlock(), createElementBlock(Fragment, null,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
createVNode(unref(PrinterOutlined))
|
|
257
|
-
]),
|
|
258
|
-
_: 1
|
|
259
|
-
})
|
|
260
|
-
]),
|
|
261
|
-
_: 2
|
|
262
|
-
}, 1032, ["title", "placement"])) : tool === "size" ? (openBlock(), createBlock(EleTool, {
|
|
263
|
-
key: index + "-size",
|
|
264
|
-
placement: placement.value,
|
|
265
|
-
title: unref(lang).sizes
|
|
266
|
-
}, {
|
|
267
|
-
default: withCtx(() => [
|
|
268
|
-
createVNode(EleDropdown, {
|
|
269
|
-
trigger: "click",
|
|
270
|
-
placement: "bottom",
|
|
271
|
-
validateEvent: false,
|
|
272
|
-
popperClass: "ele-tool-size-popper",
|
|
273
|
-
modelValue: __props.size,
|
|
274
|
-
items: sizeDropdownItems.value,
|
|
275
|
-
popperOptions: {
|
|
276
|
-
modifiers: [{ name: "offset", options: { offset: [0, 10] } }]
|
|
277
|
-
},
|
|
278
|
-
onCommand: updateSize
|
|
279
|
-
}, {
|
|
280
|
-
default: withCtx(() => [
|
|
281
|
-
createVNode(unref(ElIcon), null, {
|
|
282
|
-
default: withCtx(() => [
|
|
283
|
-
createVNode(unref(ColumnHeightOutlined))
|
|
284
|
-
]),
|
|
285
|
-
_: 1
|
|
286
|
-
})
|
|
287
|
-
]),
|
|
288
|
-
_: 1
|
|
289
|
-
}, 8, ["modelValue", "items"])
|
|
290
|
-
]),
|
|
291
|
-
_: 2
|
|
292
|
-
}, 1032, ["placement", "title"])) : tool === "columns" ? (openBlock(), createBlock(ToolColumn, {
|
|
293
|
-
key: index + "-columns",
|
|
294
|
-
placement: placement.value,
|
|
295
|
-
locale: unref(lang),
|
|
296
|
-
columns: __props.columns,
|
|
297
|
-
sortable: __props.columnSortable,
|
|
298
|
-
allowFixed: __props.columnFixed,
|
|
299
|
-
cacheKey: __props.cacheKey,
|
|
300
|
-
"onUpdate:columns": updateColumns
|
|
301
|
-
}, null, 8, ["placement", "locale", "columns", "sortable", "allowFixed", "cacheKey"])) : tool === "maximized" ? (openBlock(), createBlock(EleTool, {
|
|
302
|
-
key: index + "-maximized",
|
|
303
|
-
placement: placement.value,
|
|
304
|
-
title: unref(lang).maximized,
|
|
305
|
-
clickHideTooltip: true,
|
|
306
|
-
onClick: toggleMaximized
|
|
307
|
-
}, {
|
|
308
|
-
default: withCtx(() => [
|
|
309
|
-
createVNode(unref(ElIcon), null, {
|
|
310
|
-
default: withCtx(() => [
|
|
311
|
-
__props.maximized ? (openBlock(), createBlock(unref(FullscreenExitOutlined), { key: 0 })) : (openBlock(), createBlock(unref(FullscreenOutlined), { key: 1 }))
|
|
312
|
-
]),
|
|
313
|
-
_: 1
|
|
314
|
-
})
|
|
315
|
-
]),
|
|
316
|
-
_: 2
|
|
317
|
-
}, 1032, ["placement", "title"])) : tool && !ownSlots.includes(tool) && _ctx.$slots[tool] ? renderSlot(_ctx.$slots, tool, {
|
|
318
|
-
key: 6,
|
|
319
|
-
pageIndex: __props.pageIndex,
|
|
320
|
-
fetch: __props.fetch
|
|
321
|
-
}) : createCommentVNode("", true)
|
|
322
|
-
], 64);
|
|
323
|
-
}), 256))
|
|
324
|
-
], 64);
|
|
88
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.tools, (tool, index) => {
|
|
89
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
90
|
+
tool === "reload" ? (openBlock(), createBlock(EleTool, {
|
|
91
|
+
key: index + "-reload",
|
|
92
|
+
placement: placement.value,
|
|
93
|
+
title: __props.lang.refresh,
|
|
94
|
+
onClick: reload
|
|
95
|
+
}, {
|
|
96
|
+
default: withCtx(() => [
|
|
97
|
+
createVNode(unref(ElIcon), null, {
|
|
98
|
+
default: withCtx(() => [
|
|
99
|
+
createVNode(unref(ReloadOutlined))
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
})
|
|
103
|
+
]),
|
|
104
|
+
_: 2
|
|
105
|
+
}, 1032, ["placement", "title"])) : tool === "export" ? (openBlock(), createBlock(EleTool, {
|
|
106
|
+
key: index + "-export",
|
|
107
|
+
title: __props.lang.export,
|
|
108
|
+
placement: placement.value,
|
|
109
|
+
clickHideTooltip: true,
|
|
110
|
+
onClick: openExportModal
|
|
111
|
+
}, {
|
|
112
|
+
default: withCtx(() => [
|
|
113
|
+
createVNode(unref(ElIcon), { style: { "transform": "scale(1.1)", "transform-origin": "bottom" } }, {
|
|
114
|
+
default: withCtx(() => [
|
|
115
|
+
createVNode(unref(DownloadOutlined))
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
})
|
|
119
|
+
]),
|
|
120
|
+
_: 2
|
|
121
|
+
}, 1032, ["title", "placement"])) : tool === "print" ? (openBlock(), createBlock(EleTool, {
|
|
122
|
+
key: index + "-print",
|
|
123
|
+
title: __props.lang.print,
|
|
124
|
+
placement: placement.value,
|
|
125
|
+
clickHideTooltip: true,
|
|
126
|
+
onClick: openPrintModal
|
|
127
|
+
}, {
|
|
128
|
+
default: withCtx(() => [
|
|
129
|
+
createVNode(unref(ElIcon), null, {
|
|
130
|
+
default: withCtx(() => [
|
|
131
|
+
createVNode(unref(PrinterOutlined))
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
})
|
|
135
|
+
]),
|
|
136
|
+
_: 2
|
|
137
|
+
}, 1032, ["title", "placement"])) : tool === "size" ? (openBlock(), createBlock(EleTool, {
|
|
138
|
+
key: index + "-size",
|
|
139
|
+
placement: placement.value,
|
|
140
|
+
title: __props.lang.sizes
|
|
141
|
+
}, {
|
|
142
|
+
default: withCtx(() => [
|
|
143
|
+
createVNode(EleDropdown, {
|
|
144
|
+
trigger: "click",
|
|
145
|
+
placement: "bottom",
|
|
146
|
+
validateEvent: false,
|
|
147
|
+
popperClass: "ele-tool-size-popper",
|
|
148
|
+
modelValue: __props.size,
|
|
149
|
+
items: sizeDropdownItems.value,
|
|
150
|
+
popperOptions: {
|
|
151
|
+
modifiers: [{ name: "offset", options: { offset: [0, 10] } }]
|
|
152
|
+
},
|
|
153
|
+
onCommand: updateSize
|
|
154
|
+
}, {
|
|
155
|
+
default: withCtx(() => [
|
|
156
|
+
createVNode(unref(ElIcon), null, {
|
|
157
|
+
default: withCtx(() => [
|
|
158
|
+
createVNode(unref(ColumnHeightOutlined))
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
})
|
|
162
|
+
]),
|
|
163
|
+
_: 1
|
|
164
|
+
}, 8, ["modelValue", "items"])
|
|
165
|
+
]),
|
|
166
|
+
_: 2
|
|
167
|
+
}, 1032, ["placement", "title"])) : tool === "columns" ? (openBlock(), createBlock(ToolColumn, {
|
|
168
|
+
key: index + "-columns",
|
|
169
|
+
placement: placement.value,
|
|
170
|
+
locale: __props.lang,
|
|
171
|
+
columns: __props.columns,
|
|
172
|
+
sortable: __props.columnSortable,
|
|
173
|
+
allowFixed: __props.columnFixed,
|
|
174
|
+
cacheKey: __props.cacheKey,
|
|
175
|
+
"onUpdate:columns": updateColumns
|
|
176
|
+
}, null, 8, ["placement", "locale", "columns", "sortable", "allowFixed", "cacheKey"])) : tool === "maximized" ? (openBlock(), createBlock(EleTool, {
|
|
177
|
+
key: index + "-maximized",
|
|
178
|
+
placement: placement.value,
|
|
179
|
+
title: __props.lang.maximized,
|
|
180
|
+
clickHideTooltip: true,
|
|
181
|
+
onClick: toggleMaximized
|
|
182
|
+
}, {
|
|
183
|
+
default: withCtx(() => [
|
|
184
|
+
createVNode(unref(ElIcon), null, {
|
|
185
|
+
default: withCtx(() => [
|
|
186
|
+
__props.maximized ? (openBlock(), createBlock(unref(FullscreenExitOutlined), { key: 0 })) : (openBlock(), createBlock(unref(FullscreenOutlined), { key: 1 }))
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
})
|
|
190
|
+
]),
|
|
191
|
+
_: 2
|
|
192
|
+
}, 1032, ["placement", "title"])) : tool && !ownSlots.includes(tool) && _ctx.$slots[tool] ? renderSlot(_ctx.$slots, tool, { key: 6 }) : createCommentVNode("", true)
|
|
193
|
+
], 64);
|
|
194
|
+
}), 256);
|
|
325
195
|
};
|
|
326
196
|
}
|
|
327
197
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { EleModalProps } from '../../ele-app/plus';
|
|
3
3
|
import { Columns, DataItem, SpanMethod, SummaryMethod, TreeProps } from '../../ele-data-table/types';
|
|
4
|
-
import { TableLocale, ExportDataType, BeforeExport, Datasource, FetchFunction, TableExportParams } from '../types';
|
|
4
|
+
import { TableLocale, ExportDataType, BeforeExport, ExportPlugin, Datasource, FetchFunction, TableExportParams } from '../types';
|
|
5
5
|
|
|
6
6
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
7
7
|
/** 表格国际化 */
|
|
@@ -56,6 +56,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
56
56
|
defaultShowTreeIndex: BooleanConstructor;
|
|
57
57
|
/** 导出前的钩子函数 */
|
|
58
58
|
beforeExport: PropType<BeforeExport>;
|
|
59
|
+
/** 导出插件 */
|
|
60
|
+
exportPlugin: PropType<ExportPlugin>;
|
|
59
61
|
}>, {
|
|
60
62
|
openModal: () => void;
|
|
61
63
|
closeModal: () => void;
|
|
@@ -113,6 +115,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
113
115
|
defaultShowTreeIndex: BooleanConstructor;
|
|
114
116
|
/** 导出前的钩子函数 */
|
|
115
117
|
beforeExport: PropType<BeforeExport>;
|
|
118
|
+
/** 导出插件 */
|
|
119
|
+
exportPlugin: PropType<ExportPlugin>;
|
|
116
120
|
}>> & Readonly<{}>, {
|
|
117
121
|
showSummary: boolean;
|
|
118
122
|
tableHeader: boolean;
|
|
@@ -62,7 +62,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
62
|
/** 默认是否勾选层级序号 */
|
|
63
63
|
defaultShowTreeIndex: Boolean,
|
|
64
64
|
/** 导出前的钩子函数 */
|
|
65
|
-
beforeExport: Function
|
|
65
|
+
beforeExport: Function,
|
|
66
|
+
/** 导出插件 */
|
|
67
|
+
exportPlugin: Function
|
|
66
68
|
},
|
|
67
69
|
setup(__props, { expose: __expose }) {
|
|
68
70
|
const props = __props;
|
|
@@ -139,30 +141,40 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
139
141
|
isShowTreeIndex,
|
|
140
142
|
isShowHeader
|
|
141
143
|
);
|
|
144
|
+
const exportParams = {
|
|
145
|
+
data: exportDataValue,
|
|
146
|
+
columns: exportColumns,
|
|
147
|
+
headerData,
|
|
148
|
+
bodyData,
|
|
149
|
+
footerData,
|
|
150
|
+
bodyCols,
|
|
151
|
+
fileName: exportFileName,
|
|
152
|
+
dataType: exportDataType,
|
|
153
|
+
hideLoading,
|
|
154
|
+
closeModal,
|
|
155
|
+
showHeader: isShowHeader,
|
|
156
|
+
showFooter: isShowFooter,
|
|
157
|
+
showTreeIndex: isShowTreeIndex,
|
|
158
|
+
tableColumns
|
|
159
|
+
};
|
|
142
160
|
if (typeof props.beforeExport === "function") {
|
|
143
|
-
const flag = props.beforeExport(
|
|
144
|
-
data: exportDataValue,
|
|
145
|
-
columns: exportColumns,
|
|
146
|
-
headerData,
|
|
147
|
-
bodyData,
|
|
148
|
-
footerData,
|
|
149
|
-
bodyCols,
|
|
150
|
-
fileName: exportFileName,
|
|
151
|
-
dataType: exportDataType,
|
|
152
|
-
hideLoading,
|
|
153
|
-
closeModal,
|
|
154
|
-
showHeader: isShowHeader,
|
|
155
|
-
showFooter: isShowFooter,
|
|
156
|
-
showTreeIndex: isShowTreeIndex,
|
|
157
|
-
tableColumns
|
|
158
|
-
});
|
|
161
|
+
const flag = props.beforeExport(exportParams);
|
|
159
162
|
if (flag === false) {
|
|
160
163
|
return;
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
if (props.exportPlugin == null) {
|
|
167
|
+
exportCSV(exportFileName, headerData, bodyData, footerData);
|
|
168
|
+
hideLoading();
|
|
169
|
+
closeModal();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
props.exportPlugin(exportParams).then(() => {
|
|
173
|
+
hideLoading();
|
|
174
|
+
closeModal();
|
|
175
|
+
}).catch(() => {
|
|
176
|
+
hideLoading();
|
|
177
|
+
});
|
|
166
178
|
};
|
|
167
179
|
const handleExport = () => {
|
|
168
180
|
var _a, _b;
|
|
@@ -2,7 +2,7 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import { StyleValue } from '../../ele-app/types';
|
|
3
3
|
import { EleModalProps, ElePrinterProps, EleTableProps } from '../../ele-app/plus';
|
|
4
4
|
import { Columns, DataItem, SpanMethod, SummaryMethod, CellStyle, CellClass, HeaderCellStyle, HeaderCellClass, TreeProps } from '../../ele-data-table/types';
|
|
5
|
-
import { TableLocale, ExportDataType, BeforeExport, Datasource, FetchFunction, TableExportParams } from '../types';
|
|
5
|
+
import { TableLocale, ExportDataType, BeforeExport, ExportPlugin, Datasource, FetchFunction, TableExportParams } from '../types';
|
|
6
6
|
|
|
7
7
|
declare function __VLS_template(): Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: {
|
|
8
8
|
row: DataItem | undefined;
|
|
@@ -78,6 +78,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
78
78
|
defaultShowTreeIndex: BooleanConstructor;
|
|
79
79
|
/** 打印前的钩子函数 */
|
|
80
80
|
beforePrint: PropType<BeforeExport>;
|
|
81
|
+
/** 打印插件 */
|
|
82
|
+
printPlugin: PropType<ExportPlugin>;
|
|
81
83
|
}>, {
|
|
82
84
|
openModal: () => void;
|
|
83
85
|
closeModal: () => void;
|
|
@@ -144,6 +146,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
144
146
|
defaultShowTreeIndex: BooleanConstructor;
|
|
145
147
|
/** 打印前的钩子函数 */
|
|
146
148
|
beforePrint: PropType<BeforeExport>;
|
|
149
|
+
/** 打印插件 */
|
|
150
|
+
printPlugin: PropType<ExportPlugin>;
|
|
147
151
|
}>> & Readonly<{}>, {
|
|
148
152
|
showSummary: boolean;
|
|
149
153
|
tableHeader: boolean;
|
|
@@ -84,7 +84,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
84
|
/** 默认是否勾选层级序号 */
|
|
85
85
|
defaultShowTreeIndex: Boolean,
|
|
86
86
|
/** 打印前的钩子函数 */
|
|
87
|
-
beforePrint: Function
|
|
87
|
+
beforePrint: Function,
|
|
88
|
+
/** 打印插件 */
|
|
89
|
+
printPlugin: Function
|
|
88
90
|
},
|
|
89
91
|
setup(__props, { expose: __expose }) {
|
|
90
92
|
const ownSlots = ["printTop", "printBottom"];
|
|
@@ -163,35 +165,45 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
163
165
|
isShowTreeIndex,
|
|
164
166
|
isShowHeader
|
|
165
167
|
);
|
|
168
|
+
const printParams = {
|
|
169
|
+
data: printDataValue,
|
|
170
|
+
columns: printColumns,
|
|
171
|
+
headerData,
|
|
172
|
+
bodyData,
|
|
173
|
+
footerData,
|
|
174
|
+
bodyCols,
|
|
175
|
+
dataType: printDataType,
|
|
176
|
+
hideLoading,
|
|
177
|
+
closeModal,
|
|
178
|
+
showHeader: isShowHeader,
|
|
179
|
+
showFooter: isShowFooter,
|
|
180
|
+
showTreeIndex: isShowTreeIndex,
|
|
181
|
+
tableColumns
|
|
182
|
+
};
|
|
166
183
|
if (typeof props.beforePrint === "function") {
|
|
167
|
-
const flag = props.beforePrint(
|
|
168
|
-
data: printDataValue,
|
|
169
|
-
columns: printColumns,
|
|
170
|
-
headerData,
|
|
171
|
-
bodyData,
|
|
172
|
-
footerData,
|
|
173
|
-
bodyCols,
|
|
174
|
-
dataType: printDataType,
|
|
175
|
-
hideLoading,
|
|
176
|
-
closeModal,
|
|
177
|
-
showHeader: isShowHeader,
|
|
178
|
-
showFooter: isShowFooter,
|
|
179
|
-
showTreeIndex: isShowTreeIndex,
|
|
180
|
-
tableColumns
|
|
181
|
-
});
|
|
184
|
+
const flag = props.beforePrint(printParams);
|
|
182
185
|
if (flag === false) {
|
|
183
186
|
return;
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
if (props.printPlugin == null) {
|
|
190
|
+
printOptions.data = printDataValue;
|
|
191
|
+
printOptions.headerData = headerData;
|
|
192
|
+
printOptions.bodyData = bodyData;
|
|
193
|
+
printOptions.footerData = footerData;
|
|
194
|
+
printOptions.hasHeader = !!printOptions.headerData.length;
|
|
195
|
+
printOptions.hasFooter = !!printOptions.footerData.length;
|
|
196
|
+
printOptions.bodyCols = bodyCols;
|
|
197
|
+
nextTick(() => {
|
|
198
|
+
printOptions.printing = true;
|
|
199
|
+
});
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
props.printPlugin(printParams).then(() => {
|
|
203
|
+
hideLoading();
|
|
204
|
+
closeModal();
|
|
205
|
+
}).catch(() => {
|
|
206
|
+
hideLoading();
|
|
195
207
|
});
|
|
196
208
|
};
|
|
197
209
|
const handlePrint = () => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as ExcelJS } from 'exceljs';
|
|
2
|
+
import { ExportPlugin, BeforeExportParams } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 导出生成 ExcelJS Workbook
|
|
6
|
+
* @param params 参数
|
|
7
|
+
*/
|
|
8
|
+
export declare function getExportWorkbook(params: BeforeExportParams): ExcelJS.Workbook;
|
|
9
|
+
/**
|
|
10
|
+
* 使用 ExcelJS 进行导出的插件
|
|
11
|
+
*/
|
|
12
|
+
export declare const exceljsPlugin: ExportPlugin;
|