@dazhicheng/ui 1.6.46 → 1.6.48
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/index.d.ts +8 -0
- package/dist/components/tt-custom-export-modal/index.js +21 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.d.ts +37 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.js +322 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/api.d.ts +57 -0
- package/dist/components/tt-custom-export-modal/src/api.js +44 -0
- package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +8 -0
- package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +7 -0
- package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +11 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.d.ts +275 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +7 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue2.js +321 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue.d.ts +28 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue.js +65 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue.d.ts +31 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue.js +152 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/types/index.d.ts +74 -0
- package/dist/components/tt-custom-export-modal/src/types/report.d.ts +129 -0
- package/dist/components/tt-panel-select/src/index.vue.d.ts +2 -0
- package/dist/components/tt-panel-select/src/index.vue.js +53 -49
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/TableForm.vue.d.ts +143 -0
- package/dist/components/tt-table/src/TableForm.vue.js +223 -198
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +11 -0
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +33 -25
- package/dist/components/tt-table/src/hooks/useTableForm.js +13 -12
- package/dist/components/tt-table/src/props.d.ts +5 -0
- package/dist/components/tt-table/src/props.js +4 -0
- package/dist/components/tt-table/src/toolProps.d.ts +5 -0
- package/dist/components/tt-table/src/toolProps.js +5 -0
- package/dist/components/tt-table/src/types/table.d.ts +2 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +6 -0
- package/dist/components/tt-table/src/types/tableTools.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -99
- package/dist/packages/utils/src/calc.js +26 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { default as TtCustomExportModalConstructor } from './src/TtCustomExportModal.vue';
|
|
3
|
+
/** 自定义导出字段与模板管理弹窗。 */
|
|
4
|
+
export declare const TtCustomExportModal: typeof TtCustomExportModalConstructor & Plugin;
|
|
5
|
+
/** 弹窗实例,通过 open 打开、close 关闭。 */
|
|
6
|
+
export type TtCustomExportModalInstance = InstanceType<typeof TtCustomExportModalConstructor>;
|
|
7
|
+
export type * from './src/types';
|
|
8
|
+
export default TtCustomExportModal;
|
|
@@ -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/TtCustomExportModal.vue.js";
|
|
17
|
+
const w = t(o);
|
|
18
|
+
export {
|
|
19
|
+
w as TtCustomExportModal,
|
|
20
|
+
w as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VxeTableDefines } from 'vxe-table';
|
|
2
|
+
import { TtCustomExportModalOpenOptions, TtCustomExportModalProps, ExportConfirmPayload, ReportAPI } from './types';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<TtCustomExportModalProps, {
|
|
4
|
+
/** 打开弹框并加载字段和模板;可传入本次打开的配置。 */
|
|
5
|
+
open: (options?: TtCustomExportModalOpenOptions) => Promise<void>;
|
|
6
|
+
/** 关闭弹框;下次打开时重新初始化。 */
|
|
7
|
+
close: () => void;
|
|
8
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
9
|
+
export: (payload: ExportConfirmPayload) => any;
|
|
10
|
+
templateChange: (template: ReportAPI.ExportTemplateCO | undefined) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<TtCustomExportModalProps> & Readonly<{
|
|
12
|
+
onExport?: ((payload: ExportConfirmPayload) => any) | undefined;
|
|
13
|
+
onTemplateChange?: ((template: ReportAPI.ExportTemplateCO | undefined) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
title: string;
|
|
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
|
+
availableFields: ReportAPI.ExportFieldCO[];
|
|
19
|
+
fetchFieldsApi: (params?: {
|
|
20
|
+
businessCode?: string;
|
|
21
|
+
}) => Promise<ReportAPI.ExportFieldCO[] | unknown>;
|
|
22
|
+
fetchTemplatesApi: (params?: {
|
|
23
|
+
businessCode?: string;
|
|
24
|
+
}) => Promise<ReportAPI.ExportTemplateCO[] | unknown>;
|
|
25
|
+
saveTemplateApi: (data: ReportAPI.ExportTemplateSaveCmd & {
|
|
26
|
+
businessCode: string;
|
|
27
|
+
}) => Promise<unknown>;
|
|
28
|
+
deleteTemplateApi: (params: {
|
|
29
|
+
businessCode: string;
|
|
30
|
+
templateId: number;
|
|
31
|
+
}) => Promise<unknown>;
|
|
32
|
+
setDefaultTemplateApi: (params: {
|
|
33
|
+
businessCode: string;
|
|
34
|
+
templateId: number;
|
|
35
|
+
}) => Promise<unknown>;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { defineComponent as te, ref as c, computed as S, toValue as le, onBeforeUnmount as ae, createBlock as oe, openBlock as D, unref as q, withCtx as R, withDirectives as se, createElementBlock as ie, createVNode as F, createElementVNode as N, toDisplayString as $ } from "vue";
|
|
2
|
+
import "axios";
|
|
3
|
+
import { vLoading as ne, ElMessage as h, ElMessageBox as de } from "element-plus";
|
|
4
|
+
import { isString as re } 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 O, add as ue } 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";
|
|
16
|
+
import "../../tt-modal/index.js";
|
|
17
|
+
import { defaultTemplatesExportApi as ce, deleteTemplatesExportApi as fe, saveTemplatesExportApi as ve, templatesExportApi as pe, fieldsTemplatesExportApi as me } from "./api.js";
|
|
18
|
+
import Ce from "./components/FieldGridSection.vue.js";
|
|
19
|
+
import Se from "./components/FieldToolbarSection.vue.js";
|
|
20
|
+
import he from "./components/TemplateManagerSection.vue.js";
|
|
21
|
+
import { useModalRender as ge } from "../../tt-modal/src/hooks/useModalRender.js";
|
|
22
|
+
const we = { class: "flex flex-col gap-1 text-left" }, ye = { class: "text-lg font-semibold leading-none text-(--el-text-color-primary)" }, xe = { class: "text-xs text-(--el-text-color-secondary)" }, Te = { class: "flex flex-col gap-3 py-1" }, je = /* @__PURE__ */ te({
|
|
23
|
+
name: "TtCustomExportModal",
|
|
24
|
+
__name: "TtCustomExportModal",
|
|
25
|
+
props: {
|
|
26
|
+
title: { default: "" },
|
|
27
|
+
businessCode: { default: "BUSINESS_SALES_REPORT" },
|
|
28
|
+
availableFields: { default: void 0 },
|
|
29
|
+
listColumns: { default: () => [] },
|
|
30
|
+
fetchFieldsApi: { type: Function, default: void 0 },
|
|
31
|
+
fetchTemplatesApi: { type: Function, default: void 0 },
|
|
32
|
+
saveTemplateApi: { type: Function, default: void 0 },
|
|
33
|
+
deleteTemplateApi: { type: Function, default: void 0 },
|
|
34
|
+
setDefaultTemplateApi: { type: Function, default: void 0 }
|
|
35
|
+
},
|
|
36
|
+
emits: ["export", "templateChange"],
|
|
37
|
+
setup(U, { expose: V, emit: I }) {
|
|
38
|
+
const i = U, T = I;
|
|
39
|
+
let o = Symbol();
|
|
40
|
+
const [P, b] = ge({
|
|
41
|
+
width: "1120px",
|
|
42
|
+
destroyOnClose: !0,
|
|
43
|
+
draggable: !0,
|
|
44
|
+
showFooter: !0,
|
|
45
|
+
onVisibleChange(t) {
|
|
46
|
+
t || (o = Symbol());
|
|
47
|
+
}
|
|
48
|
+
}), g = c({}), p = c(!1), w = c(!1), s = c([]), u = c([]), f = c(void 0), y = c(""), n = c(/* @__PURE__ */ new Set()), v = S(() => {
|
|
49
|
+
const t = new Map(s.value.map((e) => [e.fieldCode, e]));
|
|
50
|
+
return [...n.value].map((e) => t.get(e)).filter((e) => !!e);
|
|
51
|
+
}), d = S(() => g.value.businessCode || i.businessCode || "BUSINESS_SALES_REPORT"), _ = S(() => g.value.title || i.title || ""), A = (t = le(
|
|
52
|
+
g.value.listColumns ?? i.listColumns
|
|
53
|
+
)) => (t ?? []).flatMap((e) => {
|
|
54
|
+
var l;
|
|
55
|
+
return re(e) ? [e] : e.visible === !1 ? [] : (l = e.children) != null && l.length ? A(e.children) : e.field ? [e.field] : [];
|
|
56
|
+
}), G = S(() => A()), m = S(() => {
|
|
57
|
+
const t = y.value.trim().toLowerCase();
|
|
58
|
+
return t ? s.value.filter((e) => {
|
|
59
|
+
const l = (e.fieldName ?? "").toLowerCase().includes(t), a = (e.fieldCode ?? "").toLowerCase().includes(t);
|
|
60
|
+
return l || a;
|
|
61
|
+
}) : s.value;
|
|
62
|
+
}), B = S(() => m.value.length === 0 ? !1 : m.value.filter((e) => n.value.has(e.fieldCode || "")).length === m.value.length), M = () => {
|
|
63
|
+
const t = u.value.find((e) => e.defaultTemplate);
|
|
64
|
+
if (f.value = t == null ? void 0 : t.id, t && t.fields && t.fields.length > 0) {
|
|
65
|
+
const e = /* @__PURE__ */ new Set();
|
|
66
|
+
[...t.fields].sort((l, a) => O(l.sortNo ?? 0, a.sortNo ?? 0)).forEach((l) => {
|
|
67
|
+
l.fieldCode && e.add(l.fieldCode);
|
|
68
|
+
}), s.value.forEach((l) => {
|
|
69
|
+
l.requiredSelected && l.fieldCode && e.add(l.fieldCode);
|
|
70
|
+
}), n.value = e;
|
|
71
|
+
}
|
|
72
|
+
}, K = async (t) => {
|
|
73
|
+
const e = g.value.availableFields || i.availableFields;
|
|
74
|
+
if (e && e.length > 0) {
|
|
75
|
+
s.value = [...e], E();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (i.fetchFieldsApi) {
|
|
79
|
+
try {
|
|
80
|
+
const l = await i.fetchFieldsApi({ businessCode: d.value });
|
|
81
|
+
if (t !== o) return;
|
|
82
|
+
s.value = l ?? [];
|
|
83
|
+
} catch {
|
|
84
|
+
if (t !== o) return;
|
|
85
|
+
s.value = [];
|
|
86
|
+
}
|
|
87
|
+
E();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (d.value) {
|
|
91
|
+
try {
|
|
92
|
+
const l = await me({
|
|
93
|
+
businessCode: d.value
|
|
94
|
+
});
|
|
95
|
+
if (t !== o) return;
|
|
96
|
+
s.value = l ?? [];
|
|
97
|
+
} catch {
|
|
98
|
+
if (t !== o) return;
|
|
99
|
+
s.value = [];
|
|
100
|
+
}
|
|
101
|
+
E();
|
|
102
|
+
}
|
|
103
|
+
}, x = async (t) => {
|
|
104
|
+
if (t === o) {
|
|
105
|
+
if (i.fetchTemplatesApi) {
|
|
106
|
+
try {
|
|
107
|
+
const e = await i.fetchTemplatesApi({ businessCode: d.value });
|
|
108
|
+
if (t !== o) return;
|
|
109
|
+
u.value = e ?? [];
|
|
110
|
+
} catch {
|
|
111
|
+
if (t !== o) return;
|
|
112
|
+
u.value = [];
|
|
113
|
+
}
|
|
114
|
+
M();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (d.value) {
|
|
118
|
+
try {
|
|
119
|
+
const e = await pe({
|
|
120
|
+
businessCode: d.value
|
|
121
|
+
});
|
|
122
|
+
if (t !== o) return;
|
|
123
|
+
u.value = e ?? [];
|
|
124
|
+
} catch {
|
|
125
|
+
if (t !== o) return;
|
|
126
|
+
u.value = [];
|
|
127
|
+
}
|
|
128
|
+
M();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}, E = () => {
|
|
132
|
+
const t = /* @__PURE__ */ new Set();
|
|
133
|
+
s.value.forEach((e) => {
|
|
134
|
+
(e.requiredSelected || e.defaultSelected) && e.fieldCode && t.add(e.fieldCode);
|
|
135
|
+
}), n.value = t;
|
|
136
|
+
}, L = (t) => {
|
|
137
|
+
if (f.value = t, !t) {
|
|
138
|
+
T("templateChange", void 0);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const e = u.value.find((l) => l.id === t);
|
|
142
|
+
if (T("templateChange", e), e && e.fields && e.fields.length > 0) {
|
|
143
|
+
const l = /* @__PURE__ */ new Set();
|
|
144
|
+
[...e.fields].sort((a, C) => O(a.sortNo ?? 0, C.sortNo ?? 0)).forEach((a) => {
|
|
145
|
+
a.fieldCode && l.add(a.fieldCode);
|
|
146
|
+
}), s.value.forEach((a) => {
|
|
147
|
+
a.requiredSelected && a.fieldCode && l.add(a.fieldCode);
|
|
148
|
+
}), n.value = l;
|
|
149
|
+
}
|
|
150
|
+
}, j = async (t) => {
|
|
151
|
+
if (!d.value) return;
|
|
152
|
+
const e = o;
|
|
153
|
+
try {
|
|
154
|
+
if (i.setDefaultTemplateApi ? await i.setDefaultTemplateApi({
|
|
155
|
+
businessCode: d.value,
|
|
156
|
+
templateId: t
|
|
157
|
+
}) : await ce({
|
|
158
|
+
businessCode: d.value,
|
|
159
|
+
templateId: t
|
|
160
|
+
}), e !== o) return;
|
|
161
|
+
h.success("已设为默认模板"), await x(e);
|
|
162
|
+
} catch {
|
|
163
|
+
}
|
|
164
|
+
}, z = async (t, e) => {
|
|
165
|
+
if (!d.value) return;
|
|
166
|
+
const l = o;
|
|
167
|
+
try {
|
|
168
|
+
if (await de.confirm(`确定要删除导出模板「${e}」吗?`, "删除确认", {
|
|
169
|
+
type: "warning",
|
|
170
|
+
confirmButtonText: "确定删除",
|
|
171
|
+
cancelButtonText: "取消"
|
|
172
|
+
}), l !== o || (i.deleteTemplateApi ? await i.deleteTemplateApi({
|
|
173
|
+
businessCode: d.value,
|
|
174
|
+
templateId: t
|
|
175
|
+
}) : await fe({
|
|
176
|
+
businessCode: d.value,
|
|
177
|
+
templateId: t
|
|
178
|
+
}), l !== o)) return;
|
|
179
|
+
h.success("模板删除成功"), f.value = void 0, await x(l);
|
|
180
|
+
} catch {
|
|
181
|
+
}
|
|
182
|
+
}, H = async (t) => {
|
|
183
|
+
if (p.value || w.value) return;
|
|
184
|
+
if (v.value.length === 0) {
|
|
185
|
+
h.warning("请至少勾选一个导出字段后再保存模板");
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const e = o;
|
|
189
|
+
try {
|
|
190
|
+
w.value = !0;
|
|
191
|
+
const l = v.value.map((r, ee) => ({
|
|
192
|
+
fieldId: r.id,
|
|
193
|
+
customColumnName: r.fieldName,
|
|
194
|
+
sortNo: ue(ee, 1)
|
|
195
|
+
})), a = {
|
|
196
|
+
businessCode: d.value,
|
|
197
|
+
templateName: t,
|
|
198
|
+
fields: l
|
|
199
|
+
};
|
|
200
|
+
if (i.saveTemplateApi ? await i.saveTemplateApi(a) : await ve(a), e !== o || (h.success(`模板「${t}」保存成功`), await x(e), e !== o)) return;
|
|
201
|
+
const C = u.value.find((r) => r.templateName === t);
|
|
202
|
+
C && L(C.id);
|
|
203
|
+
} catch {
|
|
204
|
+
} finally {
|
|
205
|
+
e === o && (w.value = !1);
|
|
206
|
+
}
|
|
207
|
+
}, J = (t) => {
|
|
208
|
+
if (t.requiredSelected || !t.fieldCode) return;
|
|
209
|
+
const e = new Set(n.value);
|
|
210
|
+
e.has(t.fieldCode) ? e.delete(t.fieldCode) : e.add(t.fieldCode), n.value = e;
|
|
211
|
+
}, Q = () => {
|
|
212
|
+
const t = new Set(n.value);
|
|
213
|
+
B.value ? m.value.forEach((e) => {
|
|
214
|
+
!e.requiredSelected && e.fieldCode && t.delete(e.fieldCode);
|
|
215
|
+
}) : m.value.forEach((e) => {
|
|
216
|
+
e.fieldCode && t.add(e.fieldCode);
|
|
217
|
+
}), n.value = t;
|
|
218
|
+
}, W = () => {
|
|
219
|
+
const t = A();
|
|
220
|
+
if (t.length === 0) return;
|
|
221
|
+
const e = new Set(t), l = /* @__PURE__ */ new Set();
|
|
222
|
+
s.value.forEach((a) => {
|
|
223
|
+
a.fieldCode && (a.requiredSelected || e.has(a.fieldCode)) && l.add(a.fieldCode);
|
|
224
|
+
}), n.value = l, h.success("已同步表格当前展示列");
|
|
225
|
+
}, X = () => {
|
|
226
|
+
const t = /* @__PURE__ */ new Set();
|
|
227
|
+
s.value.forEach((e) => {
|
|
228
|
+
e.requiredSelected && e.fieldCode && t.add(e.fieldCode);
|
|
229
|
+
}), n.value = t;
|
|
230
|
+
}, Y = () => {
|
|
231
|
+
if (p.value || !b.state.visible) return;
|
|
232
|
+
if (v.value.length === 0) {
|
|
233
|
+
h.warning("请至少勾选一个导出字段");
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const t = v.value, e = t.map((r) => r.fieldCode || "").filter(Boolean), l = t.map((r) => r.fieldName || r.fieldCode || "").filter(Boolean), a = u.value.find((r) => r.id === f.value), C = {
|
|
237
|
+
businessCode: d.value,
|
|
238
|
+
selectedFields: t,
|
|
239
|
+
selectedFieldCodes: e,
|
|
240
|
+
selectedFieldNames: l,
|
|
241
|
+
templateName: a == null ? void 0 : a.templateName,
|
|
242
|
+
templateId: a == null ? void 0 : a.id
|
|
243
|
+
};
|
|
244
|
+
T("export", C), k();
|
|
245
|
+
}, Z = async (t) => {
|
|
246
|
+
const e = Symbol();
|
|
247
|
+
o = e, g.value = t || {}, f.value = void 0, y.value = "", w.value = !1, b.openModal(), p.value = !0;
|
|
248
|
+
try {
|
|
249
|
+
if (await K(e), e !== o || (await x(e), e !== o)) return;
|
|
250
|
+
if (t != null && t.defaultSelectedCodes && t.defaultSelectedCodes.length > 0) {
|
|
251
|
+
const l = new Set(t.defaultSelectedCodes);
|
|
252
|
+
s.value.forEach((a) => {
|
|
253
|
+
a.requiredSelected && a.fieldCode && l.add(a.fieldCode);
|
|
254
|
+
}), n.value = l;
|
|
255
|
+
}
|
|
256
|
+
} finally {
|
|
257
|
+
e === o && (p.value = !1);
|
|
258
|
+
}
|
|
259
|
+
}, k = () => {
|
|
260
|
+
b.closeModal();
|
|
261
|
+
};
|
|
262
|
+
return ae(() => {
|
|
263
|
+
o = Symbol();
|
|
264
|
+
}), V({
|
|
265
|
+
/** 打开弹框并加载字段和模板;可传入本次打开的配置。 */
|
|
266
|
+
open: Z,
|
|
267
|
+
/** 关闭弹框;下次打开时重新初始化。 */
|
|
268
|
+
close: k
|
|
269
|
+
}), (t, e) => (D(), oe(q(P), {
|
|
270
|
+
"ok-text": `确认导出(${v.value.length} 字段)`,
|
|
271
|
+
"cancel-text": "取消",
|
|
272
|
+
"ok-button-props": { disabled: p.value || v.value.length === 0 },
|
|
273
|
+
onOk: Y
|
|
274
|
+
}, {
|
|
275
|
+
header: R(() => [
|
|
276
|
+
N("div", we, [
|
|
277
|
+
N("h2", ye, " 自定义导出模板" + $(_.value ? ` - ${_.value}` : ""), 1),
|
|
278
|
+
N("p", xe, " 全量字段共 " + $(s.value.length) + " 项(与履约报表导出字段一致);可保存多个导出模板,并选定一个作为默认导出模板 ", 1)
|
|
279
|
+
])
|
|
280
|
+
]),
|
|
281
|
+
default: R(() => [
|
|
282
|
+
se((D(), ie("div", Te, [
|
|
283
|
+
F(he, {
|
|
284
|
+
"selected-template-id": f.value,
|
|
285
|
+
"onUpdate:selectedTemplateId": e[0] || (e[0] = (l) => f.value = l),
|
|
286
|
+
"template-list": u.value,
|
|
287
|
+
"is-saving": w.value,
|
|
288
|
+
onSelectTemplate: L,
|
|
289
|
+
onSetDefault: j,
|
|
290
|
+
onDelete: z,
|
|
291
|
+
onSave: H
|
|
292
|
+
}, null, 8, ["selected-template-id", "template-list", "is-saving"]),
|
|
293
|
+
F(Se, {
|
|
294
|
+
keyword: y.value,
|
|
295
|
+
"onUpdate:keyword": e[1] || (e[1] = (l) => y.value = l),
|
|
296
|
+
"is-all-selected": B.value,
|
|
297
|
+
"has-list-columns": G.value.length > 0,
|
|
298
|
+
onToggleSelectAll: Q,
|
|
299
|
+
onSelectByListColumns: W,
|
|
300
|
+
onClearAll: X
|
|
301
|
+
}, null, 8, ["keyword", "is-all-selected", "has-list-columns"]),
|
|
302
|
+
F(Ce, {
|
|
303
|
+
"filtered-fields": m.value,
|
|
304
|
+
"total-field-count": s.value.length,
|
|
305
|
+
"selected-code-set": n.value,
|
|
306
|
+
"selected-fields": v.value,
|
|
307
|
+
onReorder: e[2] || (e[2] = (l) => {
|
|
308
|
+
n.value = new Set(l);
|
|
309
|
+
}),
|
|
310
|
+
onToggleField: J
|
|
311
|
+
}, null, 8, ["filtered-fields", "total-field-count", "selected-code-set", "selected-fields"])
|
|
312
|
+
])), [
|
|
313
|
+
[q(ne), p.value]
|
|
314
|
+
])
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}, 8, ["ok-text", "ok-button-props"]));
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
export {
|
|
321
|
+
je as default
|
|
322
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ExtendedAxiosRequestConfig } from '../../../../../utils/src';
|
|
2
|
+
import { ReportAPI } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 沿用 OpenAPI 生成的方法名,供弹框在未传自定义接口回调时使用。
|
|
5
|
+
* request 来自组件库 setXHR 注入的 TtHttp:默认已解包业务数据,调用方不要再取 res.data。
|
|
6
|
+
* options 沿用请求层配置,只有显式传 responseAllData 时才返回完整响应。
|
|
7
|
+
* 模板归属由 businessCode 决定,具体操作记录由 templateId 定位。
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 查询当前用户在指定业务下的模板列表。
|
|
11
|
+
* @param params businessCode 为业务编码;列表接口不需要 templateId。
|
|
12
|
+
* @param options TtHttp 扩展请求配置,原样传给请求层。
|
|
13
|
+
* @returns 默认返回已解包的模板数组,包含默认标记和模板字段明细。
|
|
14
|
+
*/
|
|
15
|
+
export declare function templatesExportApi(params: ReportAPI.templatesExportApiParams, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO[]>;
|
|
16
|
+
/**
|
|
17
|
+
* 保存模板,同名覆盖由服务端处理。
|
|
18
|
+
* @param body 业务编码、模板名称及字段明细;fields 中的 sortNo 已由弹框按当前顺序生成。
|
|
19
|
+
* @param options TtHttp 扩展请求配置。
|
|
20
|
+
* @returns 默认返回保存后的模板;弹框随后重新查询列表以刷新选项。
|
|
21
|
+
*/
|
|
22
|
+
export declare function saveTemplatesExportApi(body: ReportAPI.ExportTemplateSaveCmd, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO>;
|
|
23
|
+
/**
|
|
24
|
+
* 查询指定模板详情;保留原接口,当前弹框直接使用列表中的字段明细。
|
|
25
|
+
* @param params 业务编码和模板 ID。
|
|
26
|
+
* @param options TtHttp 扩展请求配置。
|
|
27
|
+
* @returns 默认返回已解包的单个模板。
|
|
28
|
+
*/
|
|
29
|
+
export declare function detailTemplatesExportApi(params: ReportAPI.detailTemplatesExportApiParams, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO>;
|
|
30
|
+
/**
|
|
31
|
+
* 删除指定模板;用户确认在弹框组件中完成,本函数只执行请求。
|
|
32
|
+
* @param params 业务编码和待删除模板 ID。
|
|
33
|
+
* @param options TtHttp 扩展请求配置。
|
|
34
|
+
* @returns 删除请求结果;弹框不依赖响应字段,成功后重新查询列表。
|
|
35
|
+
*/
|
|
36
|
+
export declare function deleteTemplatesExportApi(params: ReportAPI.deleteTemplatesExportApiParams, options?: ExtendedAxiosRequestConfig): Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* 将指定模板设为当前业务的默认模板。
|
|
39
|
+
* @param params 业务编码和目标模板 ID。
|
|
40
|
+
* @param options TtHttp 扩展请求配置。
|
|
41
|
+
* @returns 设置请求结果;最新默认标记由后续列表查询取得。
|
|
42
|
+
*/
|
|
43
|
+
export declare function defaultTemplatesExportApi(params: ReportAPI.defaultTemplatesExportApiParams, options?: ExtendedAxiosRequestConfig): Promise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* 单独查询业务的默认模板;当前弹框从列表的 defaultTemplate 标记中查找,不调用此方法。
|
|
46
|
+
* @param params businessCode 为业务编码,不需要传模板 ID。
|
|
47
|
+
* @param options TtHttp 扩展请求配置。
|
|
48
|
+
* @returns 默认返回已解包的默认模板。
|
|
49
|
+
*/
|
|
50
|
+
export declare function defaultTemplateTemplatesExportApi(params: ReportAPI.defaultTemplateTemplatesExportApiParams, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO>;
|
|
51
|
+
/**
|
|
52
|
+
* 查询字段元数据,提供编码、名称、必选/默认勾选标记等信息。
|
|
53
|
+
* @param params 业务编码和可选 keyword;弹框当前使用本地搜索,不传 keyword。
|
|
54
|
+
* @param options TtHttp 扩展请求配置。
|
|
55
|
+
* @returns 默认返回已解包的字段数组,作为左侧列表及导出字段查找的数据源。
|
|
56
|
+
*/
|
|
57
|
+
export declare function fieldsTemplatesExportApi(params: ReportAPI.fieldsTemplatesExportApiParams, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportFieldCO[]>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { request as p } from "../../../utils/xhr.js";
|
|
2
|
+
async function n(t, o) {
|
|
3
|
+
const { businessCode: e } = t;
|
|
4
|
+
return p.get({
|
|
5
|
+
url: `/report/api/export/templates/${e}`,
|
|
6
|
+
params: { ...t }
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
async function a(t, o) {
|
|
10
|
+
return p.post({
|
|
11
|
+
url: "/report/api/export/templates/save",
|
|
12
|
+
data: t
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async function i(t, o) {
|
|
16
|
+
const { businessCode: e, templateId: s } = t;
|
|
17
|
+
return p.del({
|
|
18
|
+
url: `/report/api/export/templates/delete/${e}/${s}`,
|
|
19
|
+
params: { ...t }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function l(t, o) {
|
|
23
|
+
const { businessCode: e, templateId: s } = t;
|
|
24
|
+
return p.put({
|
|
25
|
+
url: `/report/api/export/templates/${e}/${s}/default`,
|
|
26
|
+
params: { ...t }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async function u(t, o) {
|
|
30
|
+
const { businessCode: e } = t;
|
|
31
|
+
return p.get({
|
|
32
|
+
url: `/report/api/export/templates/${e}/fields`,
|
|
33
|
+
params: {
|
|
34
|
+
...t
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
l as defaultTemplatesExportApi,
|
|
40
|
+
i as deleteTemplatesExportApi,
|
|
41
|
+
u as fieldsTemplatesExportApi,
|
|
42
|
+
a as saveTemplatesExportApi,
|
|
43
|
+
n as templatesExportApi
|
|
44
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const e = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
3
|
+
<path d="m21 21-4.3-4.3"></path>
|
|
4
|
+
</svg>
|
|
5
|
+
`;
|
|
6
|
+
export {
|
|
7
|
+
e as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const o = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
|
|
3
|
+
</svg>
|
|
4
|
+
`;
|
|
5
|
+
export {
|
|
6
|
+
o as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const n = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<path d="M3 6h18"></path>
|
|
3
|
+
<path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path>
|
|
4
|
+
<path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path>
|
|
5
|
+
<line x1="10" y1="11" x2="10" y2="17"></line>
|
|
6
|
+
<line x1="14" y1="11" x2="14" y2="17"></line>
|
|
7
|
+
</svg>
|
|
8
|
+
`;
|
|
9
|
+
export {
|
|
10
|
+
n as default
|
|
11
|
+
};
|