@dazhicheng/ui 1.6.48 → 1.6.50
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.js +177 -177
- package/dist/components/tt-custom-export-modal/src/api.d.ts +12 -12
- package/dist/components/tt-custom-export-modal/src/api.js +23 -29
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.d.ts +2 -2
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue.d.ts +1 -1
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue.js +71 -54
- package/dist/components/tt-custom-export-modal/src/types/report.d.ts +8 -19
- package/dist/components/tt-drawer/index.d.ts +3 -3
- package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +1 -1
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +2 -2
- package/dist/components/tt-modal/index.d.ts +32 -32
- package/dist/components/tt-modal/src/RenderModal.vue.d.ts +22 -22
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.d.ts +2 -2
- package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +5 -5
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +1 -1
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.d.ts +1 -1
- package/dist/components/tt-panel-select/src/index.vue.d.ts +1 -1
- package/dist/components/tt-table/index.d.ts +17 -8
- package/dist/components/tt-table/src/Table.vue.d.ts +12 -6
- package/dist/components/tt-table/src/TableForm.vue.d.ts +9 -9
- package/dist/components/tt-table/src/TableForm.vue.js +68 -68
- package/dist/components/tt-table/src/hooks/useSideSlot.d.ts +4 -4
- package/dist/components/tt-table/src/props.d.ts +7 -4
- package/dist/components/tt-table/src/props.js +4 -4
- package/dist/components/tt-table/src/types/table.d.ts +6 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +0 -6
- package/dist/components/tt-upload/index.d.ts +11 -11
- package/dist/components/tt-upload/src/TtUpload.vue.d.ts +4 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as oe, shallowRef as T, ref as g, computed as v, toValue as se, onBeforeUnmount as ie, createBlock as ne, openBlock as R, unref as $, withCtx as O, withDirectives as de, createElementBlock as re, createVNode as N, createElementVNode as B, toDisplayString as U } from "vue";
|
|
2
2
|
import "axios";
|
|
3
|
-
import { vLoading as
|
|
4
|
-
import { isString as
|
|
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
5
|
import "dayjs";
|
|
6
6
|
import "numeral";
|
|
7
7
|
import "xe-utils";
|
|
8
8
|
import "dayjs/plugin/utc";
|
|
9
9
|
import "dayjs/plugin/timezone";
|
|
10
|
-
import { subtract as
|
|
10
|
+
import { subtract as V, add as ve } from "../../../packages/utils/src/calc.js";
|
|
11
11
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
12
12
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
13
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
14
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
15
|
import "lodash-es";
|
|
16
16
|
import "../../tt-modal/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { useModalRender as
|
|
22
|
-
const
|
|
17
|
+
import { setDefaultTemplatesExportApi as pe, deleteTemplatesExportApi as me, saveTemplatesExportApi as Ce, listTemplatesExportApi as Se, fieldsTemplatesExportApi as he } from "./api.js";
|
|
18
|
+
import we from "./components/FieldGridSection.vue.js";
|
|
19
|
+
import ge from "./components/FieldToolbarSection.vue.js";
|
|
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({
|
|
23
23
|
name: "TtCustomExportModal",
|
|
24
24
|
__name: "TtCustomExportModal",
|
|
25
25
|
props: {
|
|
@@ -34,283 +34,283 @@ const we = { class: "flex flex-col gap-1 text-left" }, ye = { class: "text-lg fo
|
|
|
34
34
|
setDefaultTemplateApi: { type: Function, default: void 0 }
|
|
35
35
|
},
|
|
36
36
|
emits: ["export", "templateChange"],
|
|
37
|
-
setup(
|
|
38
|
-
const
|
|
37
|
+
setup(I, { expose: P, emit: G }) {
|
|
38
|
+
const n = I, b = G;
|
|
39
39
|
let o = Symbol();
|
|
40
|
-
const [
|
|
40
|
+
const _ = T(o), [K, A] = xe({
|
|
41
41
|
width: "1120px",
|
|
42
42
|
destroyOnClose: !0,
|
|
43
43
|
draggable: !0,
|
|
44
44
|
showFooter: !0,
|
|
45
|
-
onVisibleChange(
|
|
46
|
-
|
|
45
|
+
onVisibleChange(e) {
|
|
46
|
+
e || (o = Symbol());
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
|
|
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) => {
|
|
48
|
+
}), S = g({}), p = g(!1), h = g(!1), s = T([]), u = T([]), c = g(void 0), y = g(""), i = T(/* @__PURE__ */ new Set()), j = v(() => new Map(s.value.map((e) => [e.fieldCode, e]))), f = v(() => [...i.value].map((e) => j.value.get(e)).filter((e) => !!e)), d = v(() => S.value.businessCode || n.businessCode || "BUSINESS_SALES_REPORT"), M = v(() => S.value.title || n.title || ""), E = (e = se(
|
|
49
|
+
S.value.listColumns ?? n.listColumns
|
|
50
|
+
)) => (e ?? []).flatMap((t) => {
|
|
54
51
|
var l;
|
|
55
|
-
return
|
|
56
|
-
}),
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
const l = (
|
|
52
|
+
return fe(t) ? [t] : t.visible === !1 ? [] : (l = t.children) != null && l.length ? E(t.children) : t.field ? [t.field] : [];
|
|
53
|
+
}), z = v(() => E()), w = v(() => {
|
|
54
|
+
const e = y.value.trim().toLowerCase();
|
|
55
|
+
return e ? s.value.filter((t) => {
|
|
56
|
+
const l = (t.fieldName ?? "").toLowerCase().includes(e), a = (t.fieldCode ?? "").toLowerCase().includes(e);
|
|
60
57
|
return l || a;
|
|
61
58
|
}) : s.value;
|
|
62
|
-
}),
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
[...
|
|
67
|
-
l.fieldCode &&
|
|
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);
|
|
68
65
|
}), s.value.forEach((l) => {
|
|
69
|
-
l.requiredSelected && l.fieldCode &&
|
|
70
|
-
}),
|
|
66
|
+
l.requiredSelected && l.fieldCode && t.add(l.fieldCode);
|
|
67
|
+
}), i.value = t;
|
|
71
68
|
}
|
|
72
|
-
},
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
s.value = [...
|
|
69
|
+
}, H = async (e) => {
|
|
70
|
+
const t = S.value.availableFields || n.availableFields;
|
|
71
|
+
if (t && t.length > 0) {
|
|
72
|
+
s.value = [...t], F();
|
|
76
73
|
return;
|
|
77
74
|
}
|
|
78
|
-
if (
|
|
75
|
+
if (n.fetchFieldsApi) {
|
|
79
76
|
try {
|
|
80
|
-
const l = await
|
|
81
|
-
if (
|
|
77
|
+
const l = await n.fetchFieldsApi({ businessCode: d.value });
|
|
78
|
+
if (e !== o) return;
|
|
82
79
|
s.value = l ?? [];
|
|
83
80
|
} catch {
|
|
84
|
-
if (
|
|
81
|
+
if (e !== o) return;
|
|
85
82
|
s.value = [];
|
|
86
83
|
}
|
|
87
|
-
|
|
84
|
+
F();
|
|
88
85
|
return;
|
|
89
86
|
}
|
|
90
87
|
if (d.value) {
|
|
91
88
|
try {
|
|
92
|
-
const l = await
|
|
89
|
+
const l = await he({
|
|
93
90
|
businessCode: d.value
|
|
94
91
|
});
|
|
95
|
-
if (
|
|
92
|
+
if (e !== o) return;
|
|
96
93
|
s.value = l ?? [];
|
|
97
94
|
} catch {
|
|
98
|
-
if (
|
|
95
|
+
if (e !== o) return;
|
|
99
96
|
s.value = [];
|
|
100
97
|
}
|
|
101
|
-
|
|
98
|
+
F();
|
|
102
99
|
}
|
|
103
|
-
}, x = async (
|
|
104
|
-
if (
|
|
105
|
-
if (
|
|
100
|
+
}, x = async (e) => {
|
|
101
|
+
if (e === o) {
|
|
102
|
+
if (n.fetchTemplatesApi) {
|
|
106
103
|
try {
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
u.value =
|
|
104
|
+
const t = await n.fetchTemplatesApi({ businessCode: d.value });
|
|
105
|
+
if (e !== o) return;
|
|
106
|
+
u.value = t ?? [];
|
|
110
107
|
} catch {
|
|
111
|
-
if (
|
|
108
|
+
if (e !== o) return;
|
|
112
109
|
u.value = [];
|
|
113
110
|
}
|
|
114
|
-
|
|
111
|
+
D();
|
|
115
112
|
return;
|
|
116
113
|
}
|
|
117
114
|
if (d.value) {
|
|
118
115
|
try {
|
|
119
|
-
const
|
|
116
|
+
const t = await Se({
|
|
120
117
|
businessCode: d.value
|
|
121
118
|
});
|
|
122
|
-
if (
|
|
123
|
-
u.value =
|
|
119
|
+
if (e !== o) return;
|
|
120
|
+
u.value = t ?? [];
|
|
124
121
|
} catch {
|
|
125
|
-
if (
|
|
122
|
+
if (e !== o) return;
|
|
126
123
|
u.value = [];
|
|
127
124
|
}
|
|
128
|
-
|
|
125
|
+
D();
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
|
-
},
|
|
132
|
-
const
|
|
133
|
-
s.value.forEach((
|
|
134
|
-
(
|
|
135
|
-
}),
|
|
136
|
-
}, L = (
|
|
137
|
-
if (
|
|
138
|
-
|
|
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);
|
|
139
136
|
return;
|
|
140
137
|
}
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
138
|
+
const t = u.value.find((l) => l.id === e);
|
|
139
|
+
if (b("templateChange", t), t && t.fields && t.fields.length > 0) {
|
|
143
140
|
const l = /* @__PURE__ */ new Set();
|
|
144
|
-
[...
|
|
141
|
+
[...t.fields].sort((a, m) => V(a.sortNo ?? 0, m.sortNo ?? 0)).forEach((a) => {
|
|
145
142
|
a.fieldCode && l.add(a.fieldCode);
|
|
146
143
|
}), s.value.forEach((a) => {
|
|
147
144
|
a.requiredSelected && a.fieldCode && l.add(a.fieldCode);
|
|
148
|
-
}),
|
|
145
|
+
}), i.value = l;
|
|
149
146
|
}
|
|
150
|
-
},
|
|
147
|
+
}, J = async (e) => {
|
|
151
148
|
if (!d.value) return;
|
|
152
|
-
const
|
|
149
|
+
const t = o;
|
|
153
150
|
try {
|
|
154
|
-
if (
|
|
151
|
+
if (n.setDefaultTemplateApi ? await n.setDefaultTemplateApi({
|
|
155
152
|
businessCode: d.value,
|
|
156
|
-
templateId:
|
|
157
|
-
}) : await
|
|
153
|
+
templateId: e
|
|
154
|
+
}) : await pe({
|
|
158
155
|
businessCode: d.value,
|
|
159
|
-
templateId:
|
|
160
|
-
}),
|
|
161
|
-
|
|
156
|
+
templateId: e
|
|
157
|
+
}), t !== o) return;
|
|
158
|
+
C.success("已设为默认模板"), await x(t);
|
|
162
159
|
} catch {
|
|
163
160
|
}
|
|
164
|
-
},
|
|
161
|
+
}, Q = async (e, t) => {
|
|
165
162
|
if (!d.value) return;
|
|
166
163
|
const l = o;
|
|
167
164
|
try {
|
|
168
|
-
if (await
|
|
165
|
+
if (await ce.confirm(`确定要删除导出模板「${t}」吗?`, "删除确认", {
|
|
169
166
|
type: "warning",
|
|
170
167
|
confirmButtonText: "确定删除",
|
|
171
168
|
cancelButtonText: "取消"
|
|
172
|
-
}), l !== o || (
|
|
169
|
+
}), l !== o || (n.deleteTemplateApi ? await n.deleteTemplateApi({
|
|
173
170
|
businessCode: d.value,
|
|
174
|
-
templateId:
|
|
175
|
-
}) : await
|
|
171
|
+
templateId: e
|
|
172
|
+
}) : await me({
|
|
176
173
|
businessCode: d.value,
|
|
177
|
-
templateId:
|
|
174
|
+
templateId: e
|
|
178
175
|
}), l !== o)) return;
|
|
179
|
-
|
|
176
|
+
C.success("模板删除成功"), c.value = void 0, await x(l);
|
|
180
177
|
} catch {
|
|
181
178
|
}
|
|
182
|
-
},
|
|
183
|
-
if (p.value ||
|
|
184
|
-
if (
|
|
185
|
-
|
|
179
|
+
}, W = async (e) => {
|
|
180
|
+
if (p.value || h.value) return;
|
|
181
|
+
if (f.value.length === 0) {
|
|
182
|
+
C.warning("请至少勾选一个导出字段后再保存模板");
|
|
186
183
|
return;
|
|
187
184
|
}
|
|
188
|
-
const
|
|
185
|
+
const t = o;
|
|
189
186
|
try {
|
|
190
|
-
|
|
191
|
-
const l =
|
|
187
|
+
h.value = !0;
|
|
188
|
+
const l = f.value.map((r, ae) => ({
|
|
192
189
|
fieldId: r.id,
|
|
193
190
|
customColumnName: r.fieldName,
|
|
194
|
-
sortNo:
|
|
191
|
+
sortNo: ve(ae, 1)
|
|
195
192
|
})), a = {
|
|
196
193
|
businessCode: d.value,
|
|
197
|
-
templateName:
|
|
194
|
+
templateName: e,
|
|
198
195
|
fields: l
|
|
199
196
|
};
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
|
|
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);
|
|
203
200
|
} catch {
|
|
204
201
|
} finally {
|
|
205
|
-
|
|
202
|
+
t === o && (h.value = !1);
|
|
206
203
|
}
|
|
207
|
-
},
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
|
|
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;
|
|
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;
|
|
230
208
|
}, Y = () => {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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("请至少勾选一个导出字段");
|
|
234
231
|
return;
|
|
235
232
|
}
|
|
236
|
-
const
|
|
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 = {
|
|
237
234
|
businessCode: d.value,
|
|
238
|
-
selectedFields:
|
|
239
|
-
selectedFieldCodes:
|
|
235
|
+
selectedFields: e,
|
|
236
|
+
selectedFieldCodes: t,
|
|
240
237
|
selectedFieldNames: l,
|
|
241
238
|
templateName: a == null ? void 0 : a.templateName,
|
|
242
239
|
templateId: a == null ? void 0 : a.id
|
|
243
240
|
};
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
const
|
|
247
|
-
o =
|
|
241
|
+
b("export", m), q();
|
|
242
|
+
}, le = async (e) => {
|
|
243
|
+
const t = Symbol();
|
|
244
|
+
o = t, S.value = e || {}, s.value = [], u.value = [], i.value = /* @__PURE__ */ new Set(), _.value = t, c.value = void 0, y.value = "", h.value = !1, p.value = !0, A.openModal();
|
|
248
245
|
try {
|
|
249
|
-
if (await
|
|
250
|
-
if (
|
|
251
|
-
const l = new Set(
|
|
246
|
+
if (await H(t), t !== o || (await x(t), t !== o)) return;
|
|
247
|
+
if (e != null && e.defaultSelectedCodes && e.defaultSelectedCodes.length > 0) {
|
|
248
|
+
const l = new Set(e.defaultSelectedCodes);
|
|
252
249
|
s.value.forEach((a) => {
|
|
253
250
|
a.requiredSelected && a.fieldCode && l.add(a.fieldCode);
|
|
254
|
-
}),
|
|
251
|
+
}), i.value = l;
|
|
255
252
|
}
|
|
256
253
|
} finally {
|
|
257
|
-
|
|
254
|
+
t === o && (p.value = !1);
|
|
258
255
|
}
|
|
259
|
-
},
|
|
260
|
-
|
|
256
|
+
}, q = () => {
|
|
257
|
+
A.closeModal();
|
|
261
258
|
};
|
|
262
|
-
return
|
|
259
|
+
return ie(() => {
|
|
263
260
|
o = Symbol();
|
|
264
|
-
}),
|
|
261
|
+
}), P({
|
|
265
262
|
/** 打开弹框并加载字段和模板;可传入本次打开的配置。 */
|
|
266
|
-
open:
|
|
263
|
+
open: le,
|
|
267
264
|
/** 关闭弹框;下次打开时重新初始化。 */
|
|
268
|
-
close:
|
|
269
|
-
}), (
|
|
270
|
-
"ok-text": `确认导出(${
|
|
265
|
+
close: q
|
|
266
|
+
}), (e, t) => (R(), ne($(K), {
|
|
267
|
+
"ok-text": `确认导出(${f.value.length} 字段)`,
|
|
271
268
|
"cancel-text": "取消",
|
|
272
|
-
"ok-button-props": { disabled: p.value ||
|
|
273
|
-
onOk:
|
|
269
|
+
"ok-button-props": { disabled: p.value || f.value.length === 0 },
|
|
270
|
+
onOk: te
|
|
274
271
|
}, {
|
|
275
|
-
header:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
272
|
+
header: O(() => [
|
|
273
|
+
B("div", Te, [
|
|
274
|
+
B("h2", be, " 自定义导出模板" + U(M.value ? ` - ${M.value}` : ""), 1),
|
|
275
|
+
B("p", Ae, " 全量字段共 " + U(s.value.length) + " 项(与履约报表导出字段一致);可保存多个导出模板,并选定一个作为默认导出模板 ", 1)
|
|
279
276
|
])
|
|
280
277
|
]),
|
|
281
|
-
default:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
278
|
+
default: O(() => [
|
|
279
|
+
de((R(), re("div", {
|
|
280
|
+
key: _.value,
|
|
281
|
+
class: "flex flex-col gap-3 py-1"
|
|
282
|
+
}, [
|
|
283
|
+
N(ye, {
|
|
284
|
+
"selected-template-id": c.value,
|
|
285
|
+
"onUpdate:selectedTemplateId": t[0] || (t[0] = (l) => c.value = l),
|
|
286
286
|
"template-list": u.value,
|
|
287
|
-
"is-saving":
|
|
287
|
+
"is-saving": h.value,
|
|
288
288
|
onSelectTemplate: L,
|
|
289
|
-
onSetDefault:
|
|
290
|
-
onDelete:
|
|
291
|
-
onSave:
|
|
289
|
+
onSetDefault: J,
|
|
290
|
+
onDelete: Q,
|
|
291
|
+
onSave: W
|
|
292
292
|
}, null, 8, ["selected-template-id", "template-list", "is-saving"]),
|
|
293
|
-
|
|
293
|
+
N(ge, {
|
|
294
294
|
keyword: y.value,
|
|
295
|
-
"onUpdate:keyword":
|
|
296
|
-
"is-all-selected":
|
|
297
|
-
"has-list-columns":
|
|
298
|
-
onToggleSelectAll:
|
|
299
|
-
onSelectByListColumns:
|
|
300
|
-
onClearAll:
|
|
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
301
|
}, null, 8, ["keyword", "is-all-selected", "has-list-columns"]),
|
|
302
|
-
|
|
303
|
-
"filtered-fields":
|
|
302
|
+
N(we, {
|
|
303
|
+
"filtered-fields": w.value,
|
|
304
304
|
"total-field-count": s.value.length,
|
|
305
|
-
"selected-code-set":
|
|
306
|
-
"selected-fields":
|
|
307
|
-
onReorder:
|
|
308
|
-
|
|
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
309
|
}),
|
|
310
|
-
onToggleField:
|
|
310
|
+
onToggleField: X
|
|
311
311
|
}, null, 8, ["filtered-fields", "total-field-count", "selected-code-set", "selected-fields"])
|
|
312
312
|
])), [
|
|
313
|
-
[
|
|
313
|
+
[$(ue), p.value]
|
|
314
314
|
])
|
|
315
315
|
]),
|
|
316
316
|
_: 1
|
|
@@ -318,5 +318,5 @@ const we = { class: "flex flex-col gap-1 text-left" }, ye = { class: "text-lg fo
|
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
320
|
export {
|
|
321
|
-
|
|
321
|
+
He as default
|
|
322
322
|
};
|
|
@@ -8,11 +8,11 @@ import { ReportAPI } from './types';
|
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* 查询当前用户在指定业务下的模板列表。
|
|
11
|
-
* @param
|
|
11
|
+
* @param body businessCode 为业务编码;列表接口不需要 templateId。
|
|
12
12
|
* @param options TtHttp 扩展请求配置,原样传给请求层。
|
|
13
13
|
* @returns 默认返回已解包的模板数组,包含默认标记和模板字段明细。
|
|
14
14
|
*/
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function listTemplatesExportApi(body: ReportAPI.BusinessCodeCmd, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO[]>;
|
|
16
16
|
/**
|
|
17
17
|
* 保存模板,同名覆盖由服务端处理。
|
|
18
18
|
* @param body 业务编码、模板名称及字段明细;fields 中的 sortNo 已由弹框按当前顺序生成。
|
|
@@ -22,36 +22,36 @@ export declare function templatesExportApi(params: ReportAPI.templatesExportApiP
|
|
|
22
22
|
export declare function saveTemplatesExportApi(body: ReportAPI.ExportTemplateSaveCmd, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO>;
|
|
23
23
|
/**
|
|
24
24
|
* 查询指定模板详情;保留原接口,当前弹框直接使用列表中的字段明细。
|
|
25
|
-
* @param
|
|
25
|
+
* @param body 业务编码和模板 ID。
|
|
26
26
|
* @param options TtHttp 扩展请求配置。
|
|
27
27
|
* @returns 默认返回已解包的单个模板。
|
|
28
28
|
*/
|
|
29
|
-
export declare function detailTemplatesExportApi(
|
|
29
|
+
export declare function detailTemplatesExportApi(body: ReportAPI.TemplateIdCmd, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO>;
|
|
30
30
|
/**
|
|
31
31
|
* 删除指定模板;用户确认在弹框组件中完成,本函数只执行请求。
|
|
32
|
-
* @param
|
|
32
|
+
* @param body 业务编码和待删除模板 ID。
|
|
33
33
|
* @param options TtHttp 扩展请求配置。
|
|
34
34
|
* @returns 删除请求结果;弹框不依赖响应字段,成功后重新查询列表。
|
|
35
35
|
*/
|
|
36
|
-
export declare function deleteTemplatesExportApi(
|
|
36
|
+
export declare function deleteTemplatesExportApi(body: ReportAPI.TemplateIdCmd, options?: ExtendedAxiosRequestConfig): Promise<any>;
|
|
37
37
|
/**
|
|
38
38
|
* 将指定模板设为当前业务的默认模板。
|
|
39
|
-
* @param
|
|
39
|
+
* @param body 业务编码和目标模板 ID。
|
|
40
40
|
* @param options TtHttp 扩展请求配置。
|
|
41
41
|
* @returns 设置请求结果;最新默认标记由后续列表查询取得。
|
|
42
42
|
*/
|
|
43
|
-
export declare function
|
|
43
|
+
export declare function setDefaultTemplatesExportApi(body: ReportAPI.TemplateIdCmd, options?: ExtendedAxiosRequestConfig): Promise<any>;
|
|
44
44
|
/**
|
|
45
45
|
* 单独查询业务的默认模板;当前弹框从列表的 defaultTemplate 标记中查找,不调用此方法。
|
|
46
|
-
* @param
|
|
46
|
+
* @param body businessCode 为业务编码,不需要传模板 ID。
|
|
47
47
|
* @param options TtHttp 扩展请求配置。
|
|
48
48
|
* @returns 默认返回已解包的默认模板。
|
|
49
49
|
*/
|
|
50
|
-
export declare function defaultTemplateTemplatesExportApi(
|
|
50
|
+
export declare function defaultTemplateTemplatesExportApi(body: ReportAPI.BusinessCodeCmd, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportTemplateCO>;
|
|
51
51
|
/**
|
|
52
52
|
* 查询字段元数据,提供编码、名称、必选/默认勾选标记等信息。
|
|
53
|
-
* @param
|
|
53
|
+
* @param body 业务编码和可选 keyword;弹框当前使用本地搜索,不传 keyword。
|
|
54
54
|
* @param options TtHttp 扩展请求配置。
|
|
55
55
|
* @returns 默认返回已解包的字段数组,作为左侧列表及导出字段查找的数据源。
|
|
56
56
|
*/
|
|
57
|
-
export declare function fieldsTemplatesExportApi(
|
|
57
|
+
export declare function fieldsTemplatesExportApi(body: ReportAPI.FieldsCmd, options?: ExtendedAxiosRequestConfig): Promise<ReportAPI.ExportFieldCO[]>;
|
|
@@ -1,44 +1,38 @@
|
|
|
1
|
-
import { request as
|
|
2
|
-
async function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
params: { ...t }
|
|
1
|
+
import { request as e } from "../../../utils/xhr.js";
|
|
2
|
+
async function o(t, p) {
|
|
3
|
+
return e.post({
|
|
4
|
+
url: "/report/api/export/templates/list",
|
|
5
|
+
data: t
|
|
7
6
|
});
|
|
8
7
|
}
|
|
9
|
-
async function a(t,
|
|
10
|
-
return
|
|
8
|
+
async function a(t, p) {
|
|
9
|
+
return e.post({
|
|
11
10
|
url: "/report/api/export/templates/save",
|
|
12
11
|
data: t
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
|
-
async function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
params: { ...t }
|
|
14
|
+
async function s(t, p) {
|
|
15
|
+
return e.post({
|
|
16
|
+
url: "/report/api/export/templates/delete",
|
|
17
|
+
data: t
|
|
20
18
|
});
|
|
21
19
|
}
|
|
22
|
-
async function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
params: { ...t }
|
|
20
|
+
async function i(t, p) {
|
|
21
|
+
return e.post({
|
|
22
|
+
url: "/report/api/export/templates/setDefault",
|
|
23
|
+
data: t
|
|
27
24
|
});
|
|
28
25
|
}
|
|
29
|
-
async function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
params: {
|
|
34
|
-
...t
|
|
35
|
-
}
|
|
26
|
+
async function n(t, p) {
|
|
27
|
+
return e.post({
|
|
28
|
+
url: "/report/api/export/templates/fields",
|
|
29
|
+
data: t
|
|
36
30
|
});
|
|
37
31
|
}
|
|
38
32
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
s as deleteTemplatesExportApi,
|
|
34
|
+
n as fieldsTemplatesExportApi,
|
|
35
|
+
o as listTemplatesExportApi,
|
|
42
36
|
a as saveTemplatesExportApi,
|
|
43
|
-
|
|
37
|
+
i as setDefaultTemplatesExportApi
|
|
44
38
|
};
|