@dazhicheng/ui 1.6.50 → 1.6.52
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/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.d.ts +36 -25
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.js +54 -296
- package/dist/components/tt-custom-export-panel/index.d.ts +8 -0
- package/dist/components/tt-custom-export-panel/index.js +21 -0
- package/dist/components/tt-custom-export-panel/src/TtCustomExportPanel.vue.d.ts +19 -0
- package/dist/components/tt-custom-export-panel/src/TtCustomExportPanel.vue.js +289 -0
- package/dist/components/tt-custom-export-panel/src/TtCustomExportPanel.vue2.js +4 -0
- package/dist/components/tt-custom-export-panel/src/types/index.d.ts +6 -0
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +2 -2
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +1 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +8 -7
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +1 -1
- package/dist/components/tt-panel-select/src/index.vue.d.ts +3 -0
- package/dist/components/tt-panel-select/src/index.vue.js +17 -14
- package/dist/components/tt-panel-select/src/types.d.ts +4 -0
- package/dist/components/tt-table/index.d.ts +27 -0
- package/dist/components/tt-table/index.js +8 -5
- package/dist/components/tt-table/src/Table.vue.d.ts +9 -0
- package/dist/components/tt-table/src/TableForm.vue.d.ts +74 -90
- package/dist/components/tt-table/src/TableForm.vue.js +179 -175
- package/dist/components/tt-table/src/components/TableAction.vue.js +3 -2
- package/dist/components/tt-table/src/components/TableExportButton.vue.d.ts +12 -0
- package/dist/components/tt-table/src/components/TableExportButton.vue.js +44 -0
- package/dist/components/tt-table/src/components/TableExportButton.vue2.js +4 -0
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +36 -42
- package/dist/components/tt-table/src/props.d.ts +6 -0
- package/dist/components/tt-table/src/props.js +5 -0
- package/dist/components/tt-table/src/types/table.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +111 -107
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,37 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TtCustomExportPanelProps } from '../../tt-custom-export-panel';
|
|
2
2
|
import { TtCustomExportModalOpenOptions, TtCustomExportModalProps, ExportConfirmPayload, ReportAPI } from './types';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<TtCustomExportModalProps, {
|
|
4
|
-
/** 打开弹框并加载字段和模板;可传入本次打开的配置。 */
|
|
5
4
|
open: (options?: TtCustomExportModalOpenOptions) => Promise<void>;
|
|
6
|
-
/** 关闭弹框;下次打开时重新初始化。 */
|
|
7
5
|
close: () => void;
|
|
8
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
7
|
export: (payload: ExportConfirmPayload) => any;
|
|
10
8
|
templateChange: (template: ReportAPI.ExportTemplateCO | undefined) => any;
|
|
11
9
|
}, string, import('vue').PublicProps, Readonly<TtCustomExportModalProps> & Readonly<{
|
|
12
10
|
onExport?: ((payload: ExportConfirmPayload) => any) | undefined;
|
|
13
11
|
onTemplateChange?: ((template: ReportAPI.ExportTemplateCO | undefined) => any) | undefined;
|
|
14
|
-
}>, {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
12
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
13
|
+
panelRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<TtCustomExportPanelProps> & Readonly<{
|
|
14
|
+
onTemplateChange?: ((template: ReportAPI.ExportTemplateCO | undefined) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
reload: () => Promise<void>;
|
|
17
|
+
ready: import('vue').ShallowRef<Promise<void>, Promise<void>>;
|
|
18
|
+
confirm: () => ExportConfirmPayload | undefined;
|
|
19
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
20
|
+
fieldCount: import('vue').ComputedRef<number>;
|
|
21
|
+
selectedCount: import('vue').ComputedRef<number>;
|
|
22
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
23
|
+
templateChange: (template: ReportAPI.ExportTemplateCO | undefined) => any;
|
|
24
|
+
}, import('vue').PublicProps, {
|
|
25
|
+
listColumns: string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | import('vue').Ref<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').ShallowRef<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').WritableComputedRef<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').ComputedRef<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | (() => string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined);
|
|
26
26
|
businessCode: string;
|
|
27
|
-
})
|
|
28
|
-
|
|
27
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLElement, import('vue').ComponentProvideOptions, {
|
|
28
|
+
P: {};
|
|
29
|
+
B: {};
|
|
30
|
+
D: {};
|
|
31
|
+
C: {};
|
|
32
|
+
M: {};
|
|
33
|
+
Defaults: {};
|
|
34
|
+
}, Readonly<TtCustomExportPanelProps> & Readonly<{
|
|
35
|
+
onTemplateChange?: ((template: ReportAPI.ExportTemplateCO | undefined) => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
reload: () => Promise<void>;
|
|
38
|
+
ready: import('vue').ShallowRef<Promise<void>, Promise<void>>;
|
|
39
|
+
confirm: () => ExportConfirmPayload | undefined;
|
|
40
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
41
|
+
fieldCount: import('vue').ComputedRef<number>;
|
|
42
|
+
selectedCount: import('vue').ComputedRef<number>;
|
|
43
|
+
}, {}, {}, {}, {
|
|
44
|
+
listColumns: string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | import('vue').Ref<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').ShallowRef<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').WritableComputedRef<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').ComputedRef<string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined> | (() => string[] | import("vxe-table").VxeTableDefines.ColumnOptions<any>[] | undefined);
|
|
29
45
|
businessCode: string;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
setDefaultTemplateApi: (params: {
|
|
33
|
-
businessCode: string;
|
|
34
|
-
templateId: number;
|
|
35
|
-
}) => Promise<unknown>;
|
|
36
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
}> | null;
|
|
47
|
+
}, any>;
|
|
37
48
|
export default _default;
|
|
@@ -1,322 +1,80 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import "axios";
|
|
3
|
-
import { vLoading as ue, ElMessage as C, ElMessageBox as ce } from "element-plus";
|
|
4
|
-
import { isString as fe } from "../../../packages/utils/src/is.js";
|
|
5
|
-
import "dayjs";
|
|
6
|
-
import "numeral";
|
|
7
|
-
import "xe-utils";
|
|
8
|
-
import "dayjs/plugin/utc";
|
|
9
|
-
import "dayjs/plugin/timezone";
|
|
10
|
-
import { subtract as V, add as ve } from "../../../packages/utils/src/calc.js";
|
|
11
|
-
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
12
|
-
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
|
-
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
|
-
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
-
import "lodash-es";
|
|
1
|
+
import { defineComponent as R, shallowRef as i, computed as p, createBlock as C, openBlock as x, unref as y, withCtx as b, createCommentVNode as w, mergeProps as O, createElementVNode as r, toDisplayString as _, nextTick as h } from "vue";
|
|
16
2
|
import "../../tt-modal/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
import ye from "./components/TemplateManagerSection.vue.js";
|
|
21
|
-
import { useModalRender as xe } from "../../tt-modal/src/hooks/useModalRender.js";
|
|
22
|
-
const Te = { class: "flex flex-col gap-1 text-left" }, be = { class: "text-lg font-semibold leading-none text-(--el-text-color-primary)" }, Ae = { class: "text-xs text-(--el-text-color-secondary)" }, He = /* @__PURE__ */ oe({
|
|
3
|
+
import { TtCustomExportPanel as P } from "../../tt-custom-export-panel/index.js";
|
|
4
|
+
import { useModalRender as B } from "../../tt-modal/src/hooks/useModalRender.js";
|
|
5
|
+
const N = { class: "flex flex-col gap-1 text-left" }, V = { class: "text-lg font-semibold leading-none text-(--el-text-color-primary)" }, D = { class: "text-xs text-(--el-text-color-secondary)" }, j = /* @__PURE__ */ R({
|
|
23
6
|
name: "TtCustomExportModal",
|
|
24
7
|
__name: "TtCustomExportModal",
|
|
25
8
|
props: {
|
|
26
|
-
title: {
|
|
27
|
-
businessCode: {
|
|
28
|
-
availableFields: {
|
|
29
|
-
listColumns: {
|
|
30
|
-
fetchFieldsApi: { type: Function
|
|
31
|
-
fetchTemplatesApi: { type: Function
|
|
32
|
-
saveTemplateApi: { type: Function
|
|
33
|
-
deleteTemplateApi: { type: Function
|
|
34
|
-
setDefaultTemplateApi: { type: Function
|
|
9
|
+
title: {},
|
|
10
|
+
businessCode: {},
|
|
11
|
+
availableFields: {},
|
|
12
|
+
listColumns: {},
|
|
13
|
+
fetchFieldsApi: { type: Function },
|
|
14
|
+
fetchTemplatesApi: { type: Function },
|
|
15
|
+
saveTemplateApi: { type: Function },
|
|
16
|
+
deleteTemplateApi: { type: Function },
|
|
17
|
+
setDefaultTemplateApi: { type: Function }
|
|
35
18
|
},
|
|
36
19
|
emits: ["export", "templateChange"],
|
|
37
|
-
setup(
|
|
38
|
-
const n =
|
|
39
|
-
let o = Symbol();
|
|
40
|
-
const _ = T(o), [K, A] = xe({
|
|
20
|
+
setup(g, { expose: S, emit: F }) {
|
|
21
|
+
const a = g, c = F, o = i(), l = i({}), n = i(Symbol()), u = i(!1), [T, d] = B({
|
|
41
22
|
width: "1120px",
|
|
42
23
|
destroyOnClose: !0,
|
|
43
24
|
draggable: !0,
|
|
44
25
|
showFooter: !0,
|
|
45
26
|
onVisibleChange(e) {
|
|
46
|
-
e || (
|
|
27
|
+
u.value = e, e || (n.value = Symbol());
|
|
47
28
|
}
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const l = (t.fieldName ?? "").toLowerCase().includes(e), a = (t.fieldCode ?? "").toLowerCase().includes(e);
|
|
57
|
-
return l || a;
|
|
58
|
-
}) : s.value;
|
|
59
|
-
}), k = v(() => w.value.length === 0 ? !1 : w.value.every((e) => i.value.has(e.fieldCode || ""))), D = () => {
|
|
60
|
-
const e = u.value.find((t) => t.defaultTemplate);
|
|
61
|
-
if (c.value = e == null ? void 0 : e.id, e && e.fields && e.fields.length > 0) {
|
|
62
|
-
const t = /* @__PURE__ */ new Set();
|
|
63
|
-
[...e.fields].sort((l, a) => V(l.sortNo ?? 0, a.sortNo ?? 0)).forEach((l) => {
|
|
64
|
-
l.fieldCode && t.add(l.fieldCode);
|
|
65
|
-
}), s.value.forEach((l) => {
|
|
66
|
-
l.requiredSelected && l.fieldCode && t.add(l.fieldCode);
|
|
67
|
-
}), i.value = t;
|
|
68
|
-
}
|
|
69
|
-
}, H = async (e) => {
|
|
70
|
-
const t = S.value.availableFields || n.availableFields;
|
|
71
|
-
if (t && t.length > 0) {
|
|
72
|
-
s.value = [...t], F();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (n.fetchFieldsApi) {
|
|
76
|
-
try {
|
|
77
|
-
const l = await n.fetchFieldsApi({ businessCode: d.value });
|
|
78
|
-
if (e !== o) return;
|
|
79
|
-
s.value = l ?? [];
|
|
80
|
-
} catch {
|
|
81
|
-
if (e !== o) return;
|
|
82
|
-
s.value = [];
|
|
83
|
-
}
|
|
84
|
-
F();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (d.value) {
|
|
88
|
-
try {
|
|
89
|
-
const l = await he({
|
|
90
|
-
businessCode: d.value
|
|
91
|
-
});
|
|
92
|
-
if (e !== o) return;
|
|
93
|
-
s.value = l ?? [];
|
|
94
|
-
} catch {
|
|
95
|
-
if (e !== o) return;
|
|
96
|
-
s.value = [];
|
|
97
|
-
}
|
|
98
|
-
F();
|
|
99
|
-
}
|
|
100
|
-
}, x = async (e) => {
|
|
101
|
-
if (e === o) {
|
|
102
|
-
if (n.fetchTemplatesApi) {
|
|
103
|
-
try {
|
|
104
|
-
const t = await n.fetchTemplatesApi({ businessCode: d.value });
|
|
105
|
-
if (e !== o) return;
|
|
106
|
-
u.value = t ?? [];
|
|
107
|
-
} catch {
|
|
108
|
-
if (e !== o) return;
|
|
109
|
-
u.value = [];
|
|
110
|
-
}
|
|
111
|
-
D();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (d.value) {
|
|
115
|
-
try {
|
|
116
|
-
const t = await Se({
|
|
117
|
-
businessCode: d.value
|
|
118
|
-
});
|
|
119
|
-
if (e !== o) return;
|
|
120
|
-
u.value = t ?? [];
|
|
121
|
-
} catch {
|
|
122
|
-
if (e !== o) return;
|
|
123
|
-
u.value = [];
|
|
124
|
-
}
|
|
125
|
-
D();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}, F = () => {
|
|
129
|
-
const e = /* @__PURE__ */ new Set();
|
|
130
|
-
s.value.forEach((t) => {
|
|
131
|
-
(t.requiredSelected || t.defaultSelected) && t.fieldCode && e.add(t.fieldCode);
|
|
132
|
-
}), i.value = e;
|
|
133
|
-
}, L = (e) => {
|
|
134
|
-
if (c.value = e, !e) {
|
|
135
|
-
b("templateChange", void 0);
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const t = u.value.find((l) => l.id === e);
|
|
139
|
-
if (b("templateChange", t), t && t.fields && t.fields.length > 0) {
|
|
140
|
-
const l = /* @__PURE__ */ new Set();
|
|
141
|
-
[...t.fields].sort((a, m) => V(a.sortNo ?? 0, m.sortNo ?? 0)).forEach((a) => {
|
|
142
|
-
a.fieldCode && l.add(a.fieldCode);
|
|
143
|
-
}), s.value.forEach((a) => {
|
|
144
|
-
a.requiredSelected && a.fieldCode && l.add(a.fieldCode);
|
|
145
|
-
}), i.value = l;
|
|
146
|
-
}
|
|
147
|
-
}, J = async (e) => {
|
|
148
|
-
if (!d.value) return;
|
|
149
|
-
const t = o;
|
|
150
|
-
try {
|
|
151
|
-
if (n.setDefaultTemplateApi ? await n.setDefaultTemplateApi({
|
|
152
|
-
businessCode: d.value,
|
|
153
|
-
templateId: e
|
|
154
|
-
}) : await pe({
|
|
155
|
-
businessCode: d.value,
|
|
156
|
-
templateId: e
|
|
157
|
-
}), t !== o) return;
|
|
158
|
-
C.success("已设为默认模板"), await x(t);
|
|
159
|
-
} catch {
|
|
160
|
-
}
|
|
161
|
-
}, Q = async (e, t) => {
|
|
162
|
-
if (!d.value) return;
|
|
163
|
-
const l = o;
|
|
164
|
-
try {
|
|
165
|
-
if (await ce.confirm(`确定要删除导出模板「${t}」吗?`, "删除确认", {
|
|
166
|
-
type: "warning",
|
|
167
|
-
confirmButtonText: "确定删除",
|
|
168
|
-
cancelButtonText: "取消"
|
|
169
|
-
}), l !== o || (n.deleteTemplateApi ? await n.deleteTemplateApi({
|
|
170
|
-
businessCode: d.value,
|
|
171
|
-
templateId: e
|
|
172
|
-
}) : await me({
|
|
173
|
-
businessCode: d.value,
|
|
174
|
-
templateId: e
|
|
175
|
-
}), l !== o)) return;
|
|
176
|
-
C.success("模板删除成功"), c.value = void 0, await x(l);
|
|
177
|
-
} catch {
|
|
178
|
-
}
|
|
179
|
-
}, W = async (e) => {
|
|
180
|
-
if (p.value || h.value) return;
|
|
181
|
-
if (f.value.length === 0) {
|
|
182
|
-
C.warning("请至少勾选一个导出字段后再保存模板");
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
const t = o;
|
|
186
|
-
try {
|
|
187
|
-
h.value = !0;
|
|
188
|
-
const l = f.value.map((r, ae) => ({
|
|
189
|
-
fieldId: r.id,
|
|
190
|
-
customColumnName: r.fieldName,
|
|
191
|
-
sortNo: ve(ae, 1)
|
|
192
|
-
})), a = {
|
|
193
|
-
businessCode: d.value,
|
|
194
|
-
templateName: e,
|
|
195
|
-
fields: l
|
|
196
|
-
};
|
|
197
|
-
if (n.saveTemplateApi ? await n.saveTemplateApi(a) : await Ce(a), t !== o || (C.success(`模板「${e}」保存成功`), await x(t), t !== o)) return;
|
|
198
|
-
const m = u.value.find((r) => r.templateName === e);
|
|
199
|
-
m && L(m.id);
|
|
200
|
-
} catch {
|
|
201
|
-
} finally {
|
|
202
|
-
t === o && (h.value = !1);
|
|
203
|
-
}
|
|
204
|
-
}, X = (e) => {
|
|
205
|
-
if (e.requiredSelected || !e.fieldCode) return;
|
|
206
|
-
const t = new Set(i.value);
|
|
207
|
-
t.has(e.fieldCode) ? t.delete(e.fieldCode) : t.add(e.fieldCode), i.value = t;
|
|
208
|
-
}, Y = () => {
|
|
209
|
-
const e = new Set(i.value);
|
|
210
|
-
k.value ? w.value.forEach((t) => {
|
|
211
|
-
!t.requiredSelected && t.fieldCode && e.delete(t.fieldCode);
|
|
212
|
-
}) : w.value.forEach((t) => {
|
|
213
|
-
t.fieldCode && e.add(t.fieldCode);
|
|
214
|
-
}), i.value = e;
|
|
215
|
-
}, Z = () => {
|
|
216
|
-
const e = E();
|
|
217
|
-
if (e.length === 0) return;
|
|
218
|
-
const t = new Set(e), l = /* @__PURE__ */ new Set();
|
|
219
|
-
s.value.forEach((a) => {
|
|
220
|
-
a.fieldCode && (a.requiredSelected || t.has(a.fieldCode)) && l.add(a.fieldCode);
|
|
221
|
-
}), i.value = l, C.success("已同步表格当前展示列");
|
|
222
|
-
}, ee = () => {
|
|
223
|
-
const e = /* @__PURE__ */ new Set();
|
|
224
|
-
s.value.forEach((t) => {
|
|
225
|
-
t.requiredSelected && t.fieldCode && e.add(t.fieldCode);
|
|
226
|
-
}), i.value = e;
|
|
227
|
-
}, te = () => {
|
|
228
|
-
if (p.value || !A.state.visible) return;
|
|
229
|
-
if (f.value.length === 0) {
|
|
230
|
-
C.warning("请至少勾选一个导出字段");
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
const e = f.value, t = e.map((r) => r.fieldCode || "").filter(Boolean), l = e.map((r) => r.fieldName || r.fieldCode || "").filter(Boolean), a = u.value.find((r) => r.id === c.value), m = {
|
|
234
|
-
businessCode: d.value,
|
|
235
|
-
selectedFields: e,
|
|
236
|
-
selectedFieldCodes: t,
|
|
237
|
-
selectedFieldNames: l,
|
|
238
|
-
templateName: a == null ? void 0 : a.templateName,
|
|
239
|
-
templateId: a == null ? void 0 : a.id
|
|
29
|
+
}), m = p(() => l.value.title || a.title || ""), k = p(() => {
|
|
30
|
+
const { title: e, ...t } = a;
|
|
31
|
+
return {
|
|
32
|
+
...t,
|
|
33
|
+
businessCode: l.value.businessCode || a.businessCode || "BUSINESS_SALES_REPORT",
|
|
34
|
+
availableFields: l.value.availableFields || a.availableFields,
|
|
35
|
+
listColumns: l.value.listColumns ?? a.listColumns,
|
|
36
|
+
defaultSelectedCodes: l.value.defaultSelectedCodes
|
|
240
37
|
};
|
|
241
|
-
|
|
242
|
-
|
|
38
|
+
}), f = p(() => o.value ? o.value.selectedCount : 0), M = async (e) => {
|
|
39
|
+
var s;
|
|
243
40
|
const t = Symbol();
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
} finally {
|
|
254
|
-
t === o && (p.value = !1);
|
|
255
|
-
}
|
|
256
|
-
}, q = () => {
|
|
257
|
-
A.closeModal();
|
|
41
|
+
n.value = t, l.value = e || {}, d.openModal(), await h(), t === n.value && await ((s = o.value) == null ? void 0 : s.ready);
|
|
42
|
+
}, v = () => {
|
|
43
|
+
d.closeModal();
|
|
44
|
+
}, E = (e) => {
|
|
45
|
+
u.value && (c("export", e), h(v));
|
|
46
|
+
}, A = () => {
|
|
47
|
+
var t;
|
|
48
|
+
const e = (t = o.value) == null ? void 0 : t.confirm();
|
|
49
|
+
e && E(e);
|
|
258
50
|
};
|
|
259
|
-
return
|
|
260
|
-
|
|
261
|
-
}), P({
|
|
262
|
-
/** 打开弹框并加载字段和模板;可传入本次打开的配置。 */
|
|
263
|
-
open: le,
|
|
264
|
-
/** 关闭弹框;下次打开时重新初始化。 */
|
|
265
|
-
close: q
|
|
266
|
-
}), (e, t) => (R(), ne($(K), {
|
|
267
|
-
"ok-text": `确认导出(${f.value.length} 字段)`,
|
|
51
|
+
return S({ open: M, close: v }), (e, t) => (x(), C(y(T), {
|
|
52
|
+
"ok-text": `确认导出(${f.value} 字段)`,
|
|
268
53
|
"cancel-text": "取消",
|
|
269
|
-
"ok-button-props": { disabled:
|
|
270
|
-
onOk:
|
|
54
|
+
"ok-button-props": { disabled: !o.value || o.value.isLoading || f.value === 0 },
|
|
55
|
+
onOk: A
|
|
271
56
|
}, {
|
|
272
|
-
header:
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
57
|
+
header: b(() => [
|
|
58
|
+
r("div", N, [
|
|
59
|
+
r("h2", V, " 自定义导出模板" + _(m.value ? ` - ${m.value}` : ""), 1),
|
|
60
|
+
r("p", D, " 全量字段共 " + _(o.value ? o.value.fieldCount : 0) + " 项(与履约报表导出字段一致);可保存多个导出模板,并选定一个作为默认导出模板 ", 1)
|
|
276
61
|
])
|
|
277
62
|
]),
|
|
278
|
-
default:
|
|
279
|
-
|
|
280
|
-
key:
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
"
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
onSelectTemplate: L,
|
|
289
|
-
onSetDefault: J,
|
|
290
|
-
onDelete: Q,
|
|
291
|
-
onSave: W
|
|
292
|
-
}, null, 8, ["selected-template-id", "template-list", "is-saving"]),
|
|
293
|
-
N(ge, {
|
|
294
|
-
keyword: y.value,
|
|
295
|
-
"onUpdate:keyword": t[1] || (t[1] = (l) => y.value = l),
|
|
296
|
-
"is-all-selected": k.value,
|
|
297
|
-
"has-list-columns": z.value.length > 0,
|
|
298
|
-
onToggleSelectAll: Y,
|
|
299
|
-
onSelectByListColumns: Z,
|
|
300
|
-
onClearAll: ee
|
|
301
|
-
}, null, 8, ["keyword", "is-all-selected", "has-list-columns"]),
|
|
302
|
-
N(we, {
|
|
303
|
-
"filtered-fields": w.value,
|
|
304
|
-
"total-field-count": s.value.length,
|
|
305
|
-
"selected-code-set": i.value,
|
|
306
|
-
"selected-fields": f.value,
|
|
307
|
-
onReorder: t[2] || (t[2] = (l) => {
|
|
308
|
-
i.value = new Set(l);
|
|
309
|
-
}),
|
|
310
|
-
onToggleField: X
|
|
311
|
-
}, null, 8, ["filtered-fields", "total-field-count", "selected-code-set", "selected-fields"])
|
|
312
|
-
])), [
|
|
313
|
-
[$(ue), p.value]
|
|
314
|
-
])
|
|
63
|
+
default: b(() => [
|
|
64
|
+
u.value ? (x(), C(y(P), O({
|
|
65
|
+
key: n.value,
|
|
66
|
+
ref_key: "panelRef",
|
|
67
|
+
ref: o
|
|
68
|
+
}, k.value, {
|
|
69
|
+
onTemplateChange: t[0] || (t[0] = (s) => {
|
|
70
|
+
c("templateChange", s);
|
|
71
|
+
})
|
|
72
|
+
}), null, 16)) : w("", !0)
|
|
315
73
|
]),
|
|
316
74
|
_: 1
|
|
317
75
|
}, 8, ["ok-text", "ok-button-props"]));
|
|
318
76
|
}
|
|
319
77
|
});
|
|
320
78
|
export {
|
|
321
|
-
|
|
79
|
+
j as default
|
|
322
80
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { default as TtCustomExportPanelConstructor } from './src/TtCustomExportPanel.vue';
|
|
3
|
+
/** 可直接嵌入页面的导出字段与模板管理面板。 */
|
|
4
|
+
export declare const TtCustomExportPanel: typeof TtCustomExportPanelConstructor & Plugin;
|
|
5
|
+
/** 面板实例,可等待 ready、重新加载或由外部调用 confirm() 获取当前选择。 */
|
|
6
|
+
export type TtCustomExportPanelInstance = InstanceType<typeof TtCustomExportPanelConstructor>;
|
|
7
|
+
export type { TtCustomExportPanelProps } from './src/types';
|
|
8
|
+
export default TtCustomExportPanel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "axios";
|
|
2
|
+
import "element-plus";
|
|
3
|
+
import "dayjs";
|
|
4
|
+
import "vue";
|
|
5
|
+
import { withInstall as t } from "../../packages/utils/src/install.js";
|
|
6
|
+
import "numeral";
|
|
7
|
+
import "xe-utils";
|
|
8
|
+
import "dayjs/plugin/utc";
|
|
9
|
+
import "dayjs/plugin/timezone";
|
|
10
|
+
import "../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
11
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
12
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
|
+
import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
+
import "lodash-es";
|
|
16
|
+
import o from "./src/TtCustomExportPanel.vue.js";
|
|
17
|
+
const w = t(o);
|
|
18
|
+
export {
|
|
19
|
+
w as TtCustomExportPanel,
|
|
20
|
+
w as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
2
|
+
import { TtCustomExportPanelProps } from './types';
|
|
3
|
+
import { ExportConfirmPayload, ReportAPI } from '../../tt-custom-export-modal/src/types';
|
|
4
|
+
declare const _default: import('vue').DefineComponent<TtCustomExportPanelProps, {
|
|
5
|
+
reload: () => Promise<void>;
|
|
6
|
+
ready: import('vue').ShallowRef<Promise<void>, Promise<void>>;
|
|
7
|
+
confirm: () => ExportConfirmPayload | undefined;
|
|
8
|
+
isLoading: import('vue').Ref<boolean, boolean>;
|
|
9
|
+
fieldCount: import('vue').ComputedRef<number>;
|
|
10
|
+
selectedCount: import('vue').ComputedRef<number>;
|
|
11
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
12
|
+
templateChange: (template: ReportAPI.ExportTemplateCO | undefined) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<TtCustomExportPanelProps> & Readonly<{
|
|
14
|
+
onTemplateChange?: ((template: ReportAPI.ExportTemplateCO | undefined) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
listColumns: string[] | VxeTableDefines.ColumnOptions<any>[] | import('vue').Ref<string[] | VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').ShallowRef<string[] | VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').WritableComputedRef<string[] | VxeTableDefines.ColumnOptions<any>[] | undefined, string[] | VxeTableDefines.ColumnOptions<any>[] | undefined> | import('vue').ComputedRef<string[] | VxeTableDefines.ColumnOptions<any>[] | undefined> | (() => string[] | VxeTableDefines.ColumnOptions<any>[] | undefined);
|
|
17
|
+
businessCode: string;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
19
|
+
export default _default;
|