@jt-home/mfe-components 1.0.9 → 1.0.11
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/JtAttachmentPreview/style.css +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2120 -1632
- package/dist/style.css +1 -1
- package/dist/types/components/form/item/JtCascader/cascaderProps.d.ts +11 -0
- package/dist/types/components/form/item/JtCascader/index.vue.d.ts +4 -6
- package/dist/types/components/form/item/JtSelect/index.vue.d.ts +4 -4
- package/dist/types/components/globalInfo/components/GlobalInfoGroup.vue.d.ts +8 -1
- package/dist/types/components/globalInfo/components/GlobalInfoProvider.vue.d.ts +2 -8
- package/dist/types/components/globalInfo/components/GlobalInfoSectionBlock.vue.d.ts +8 -1
- package/dist/types/components/globalInfo/components/GlobalInfoSectionOutlet.vue.d.ts +3 -1
- package/dist/types/components/globalInfo/components/GlobalInfoSections.vue.d.ts +5 -1
- package/dist/types/components/globalInfo/controller/controllerFieldOptions.d.ts +11 -0
- package/dist/types/components/globalInfo/controller/controllerIdentity.d.ts +10 -0
- package/dist/types/components/globalInfo/controller/controllerRequests.d.ts +37 -0
- package/dist/types/components/globalInfo/controller/controllerSectionStore.d.ts +21 -0
- package/dist/types/components/globalInfo/controller/controllerStatus.d.ts +2 -0
- package/dist/types/components/globalInfo/controller/useGlobalInfoController.d.ts +2 -1
- package/dist/types/components/globalInfo/index.d.ts +1 -1
- package/dist/types/components/globalInfo/model/fieldUtils.d.ts +14 -2
- package/dist/types/components/globalInfo/model/types.d.ts +135 -3
- package/dist/types/components/globalInfo/renderers/GlobalInfoAutoRenderer.vue.d.ts +2 -1
- package/dist/types/components/globalInfo/renderers/GlobalInfoFormRenderer.vue.d.ts +2 -1
- package/dist/types/components/globalInfo/renderers/GlobalInfoTableRenderer.vue.d.ts +4 -3
- package/dist/types/components/globalInfo/renderers/optionPreload.d.ts +4 -0
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/table/JtCrudTable.vue.d.ts +12 -12
- package/dist/types/components/table/JtFilterBar.vue.d.ts +2 -2
- package/dist/types/main.d.ts +1 -1
- package/package.json +87 -87
- package/readme.md +663 -663
package/dist/index.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ElButton as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
function
|
|
2
|
+
import { defineComponent as ee, useAttrs as rn, computed as I, openBlock as b, createBlock as V, mergeProps as H, toHandlers as qe, withCtx as L, renderSlot as K, resolveDynamicComponent as Ct, createCommentVNode as te, ref as le, watch as be, mergeDefaults as ln, withKeys as sn, createElementBlock as G, Fragment as Se, renderList as de, normalizeStyle as kt, nextTick as cn, useSlots as Ce, normalizeClass as Ge, createVNode as pe, withModifiers as un, unref as J, createSlots as Me, createElementVNode as D, toDisplayString as se, normalizeProps as he, guardReactiveProps as _e, useModel as tt, withDirectives as dn, mergeModels as ut, shallowRef as Be, onMounted as $t, createTextVNode as Re, resolveComponent as fn, onErrorCaptured as pn } from "vue";
|
|
3
|
+
import { ElButton as lt, ElIcon as Tt, ElCascader as mn, ElDatePicker as Bt, ElInput as Ft, ElSelect as Et, ElOption as Mt, ElFormItem as Vt, ElForm as Pt, ElTable as Lt, ElTableColumn as Nt, ElPagination as vn, ElLoadingDirective as gn, ElInputNumber as yn, ElSwitch as hn, ElRow as bn, ElCol as Sn, ElPopconfirm as In } from "element-plus/es";
|
|
4
|
+
import { cascaderEmits as wn, inputEmits as dt, selectEmits as ft } from "element-plus";
|
|
5
|
+
import { JtAttachmentPreview as Ha, JtAttachmentPreviewByParams as Ua, setupJtAttachmentPreview as Wa } from "./JtAttachmentPreview/index.mjs";
|
|
6
|
+
const at = 2, _n = 3;
|
|
7
|
+
function Cn(t) {
|
|
8
8
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
if (!t.startsWith("on") || t.length <=
|
|
10
|
+
function Ot(t) {
|
|
11
|
+
if (!t.startsWith("on") || t.length <= at)
|
|
12
12
|
return !1;
|
|
13
|
-
const e = t.charCodeAt(
|
|
13
|
+
const e = t.charCodeAt(at);
|
|
14
14
|
return e < 97 || e > 122;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function kn(t) {
|
|
17
17
|
if (t.startsWith("on-"))
|
|
18
|
-
return t.slice(
|
|
19
|
-
const [e, n] = t.slice(
|
|
18
|
+
return t.slice(_n);
|
|
19
|
+
const [e, n] = t.slice(at).split(":"), o = Cn(e);
|
|
20
20
|
return n ? `${o}:${n}` : o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Rt(t, e = /* @__PURE__ */ new Set()) {
|
|
23
23
|
return Object.fromEntries(
|
|
24
|
-
Object.entries(t).filter(([n, o]) => !e.has(n) &&
|
|
24
|
+
Object.entries(t).filter(([n, o]) => !e.has(n) && Ot(n) && typeof o == "function").map(([n, o]) => [kn(n), o])
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function jt(t, e = /* @__PURE__ */ new Set()) {
|
|
28
28
|
return Object.fromEntries(
|
|
29
|
-
Object.entries(t).filter(([n]) => !e.has(n) && !
|
|
29
|
+
Object.entries(t).filter(([n]) => !e.has(n) && !Ot(n))
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const $n = /* @__PURE__ */ ee({
|
|
33
33
|
name: "JtButton",
|
|
34
34
|
__name: "index",
|
|
35
35
|
props: {
|
|
@@ -54,56 +54,74 @@ const yn = /* @__PURE__ */ x({
|
|
|
54
54
|
tag: {}
|
|
55
55
|
},
|
|
56
56
|
setup(t) {
|
|
57
|
-
const e = t, n =
|
|
58
|
-
const { icon: r, ...
|
|
57
|
+
const e = t, n = rn(), o = I(() => {
|
|
58
|
+
const { icon: r, ...s } = e;
|
|
59
59
|
return {
|
|
60
|
-
...
|
|
61
|
-
...
|
|
60
|
+
...jt(n),
|
|
61
|
+
...s
|
|
62
62
|
};
|
|
63
|
-
}), a =
|
|
64
|
-
return (r,
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
default:
|
|
68
|
-
r.$slots.icon ? (
|
|
63
|
+
}), a = I(() => Rt(n));
|
|
64
|
+
return (r, s) => {
|
|
65
|
+
const l = Tt, d = lt;
|
|
66
|
+
return b(), V(d, H({ class: "jt-button" }, o.value, qe(a.value)), {
|
|
67
|
+
default: L(() => [
|
|
68
|
+
r.$slots.icon ? (b(), V(l, {
|
|
69
69
|
key: 0,
|
|
70
70
|
class: "jt-button__icon"
|
|
71
71
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
|
|
72
|
+
default: L(() => [
|
|
73
|
+
K(r.$slots, "icon", {}, void 0, !0)
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
76
|
-
})) : e.icon ? (
|
|
76
|
+
})) : e.icon ? (b(), V(l, {
|
|
77
77
|
key: 1,
|
|
78
78
|
class: "jt-button__icon"
|
|
79
79
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
(
|
|
80
|
+
default: L(() => [
|
|
81
|
+
(b(), V(Ct(e.icon)))
|
|
82
82
|
]),
|
|
83
83
|
_: 1
|
|
84
|
-
})) :
|
|
85
|
-
|
|
84
|
+
})) : te("", !0),
|
|
85
|
+
K(r.$slots, "default", {}, void 0, !0)
|
|
86
86
|
]),
|
|
87
87
|
_: 3
|
|
88
88
|
}, 16);
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
}),
|
|
91
|
+
}), ie = (t, e) => {
|
|
92
92
|
const n = t.__vccOpts || t;
|
|
93
93
|
for (const [o, a] of e)
|
|
94
94
|
n[o] = a;
|
|
95
95
|
return n;
|
|
96
|
-
},
|
|
96
|
+
}, xe = /* @__PURE__ */ ie($n, [["__scopeId", "data-v-a8344276"]]), Tn = {
|
|
97
|
+
// 默认值只补组件缺省体验,显式传入的 false、null 和空字符串仍由归一化逻辑保留。
|
|
98
|
+
options: () => [],
|
|
99
|
+
placeholder: "请选择",
|
|
100
|
+
clearable: !0,
|
|
101
|
+
persistent: !0
|
|
102
|
+
};
|
|
103
|
+
function pt(t) {
|
|
104
|
+
return Object.fromEntries(
|
|
105
|
+
Object.entries(t).filter(([, e]) => e !== void 0)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function Bn(t) {
|
|
109
|
+
const e = pt(t);
|
|
110
|
+
return e.props && (e.props = pt(
|
|
111
|
+
e.props
|
|
112
|
+
)), e;
|
|
113
|
+
}
|
|
114
|
+
const Fn = /* @__PURE__ */ ee({
|
|
97
115
|
name: "JtCascader",
|
|
98
116
|
__name: "index",
|
|
99
|
-
props: {
|
|
117
|
+
props: /* @__PURE__ */ ln({
|
|
100
118
|
size: {},
|
|
101
|
-
placeholder: {
|
|
119
|
+
placeholder: {},
|
|
102
120
|
disabled: { type: Boolean },
|
|
103
|
-
clearable: { type: Boolean
|
|
121
|
+
clearable: { type: Boolean },
|
|
104
122
|
clearIcon: {},
|
|
105
123
|
filterable: { type: Boolean },
|
|
106
|
-
filterMethod: {},
|
|
124
|
+
filterMethod: { type: Function },
|
|
107
125
|
separator: {},
|
|
108
126
|
showAllLevels: { type: Boolean },
|
|
109
127
|
collapseTags: { type: Boolean },
|
|
@@ -111,7 +129,7 @@ const yn = /* @__PURE__ */ x({
|
|
|
111
129
|
collapseTagsTooltip: { type: Boolean },
|
|
112
130
|
maxCollapseTagsTooltipHeight: {},
|
|
113
131
|
debounce: {},
|
|
114
|
-
beforeFilter: {},
|
|
132
|
+
beforeFilter: { type: Function },
|
|
115
133
|
placement: {},
|
|
116
134
|
fallbackPlacements: {},
|
|
117
135
|
popperClass: {},
|
|
@@ -133,22 +151,62 @@ const yn = /* @__PURE__ */ x({
|
|
|
133
151
|
height: {},
|
|
134
152
|
emptyValues: {},
|
|
135
153
|
valueOnClear: { type: [String, Number, Boolean, Function, null] },
|
|
136
|
-
options: {
|
|
137
|
-
},
|
|
138
|
-
emits:
|
|
154
|
+
options: {}
|
|
155
|
+
}, Tn),
|
|
156
|
+
emits: wn,
|
|
139
157
|
setup(t, { emit: e }) {
|
|
140
|
-
const n = t, o =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
158
|
+
const n = t, o = I(() => Bn(n)), a = le(n.modelValue);
|
|
159
|
+
be(
|
|
160
|
+
() => n.modelValue,
|
|
161
|
+
(C) => {
|
|
162
|
+
a.value = C;
|
|
163
|
+
},
|
|
164
|
+
{ deep: !0 }
|
|
165
|
+
);
|
|
166
|
+
const r = e;
|
|
167
|
+
function s(C, ...P) {
|
|
168
|
+
r(C, ...P);
|
|
169
|
+
}
|
|
170
|
+
function l(C) {
|
|
171
|
+
a.value = C, s("update:modelValue", C);
|
|
172
|
+
}
|
|
173
|
+
function d(C) {
|
|
174
|
+
s("change", C);
|
|
175
|
+
}
|
|
176
|
+
function m(C) {
|
|
177
|
+
s("focus", C);
|
|
178
|
+
}
|
|
179
|
+
function M(C) {
|
|
180
|
+
s("blur", C);
|
|
181
|
+
}
|
|
182
|
+
function f() {
|
|
183
|
+
s("clear");
|
|
184
|
+
}
|
|
185
|
+
function y(C) {
|
|
186
|
+
s("visibleChange", C);
|
|
187
|
+
}
|
|
188
|
+
function p(C) {
|
|
189
|
+
s("expandChange", C);
|
|
190
|
+
}
|
|
191
|
+
function w(C) {
|
|
192
|
+
s("removeTag", C);
|
|
193
|
+
}
|
|
194
|
+
return (C, P) => {
|
|
195
|
+
const F = mn;
|
|
196
|
+
return b(), V(F, H({ class: "jt-cascader" }, o.value, {
|
|
197
|
+
"model-value": a.value,
|
|
198
|
+
"onUpdate:modelValue": l,
|
|
199
|
+
onChange: d,
|
|
200
|
+
onFocus: m,
|
|
201
|
+
onBlur: M,
|
|
202
|
+
onClear: f,
|
|
203
|
+
onVisibleChange: y,
|
|
204
|
+
onExpandChange: p,
|
|
205
|
+
onRemoveTag: w
|
|
206
|
+
}), null, 16, ["model-value"]);
|
|
149
207
|
};
|
|
150
208
|
}
|
|
151
|
-
}),
|
|
209
|
+
}), En = /* @__PURE__ */ ee({
|
|
152
210
|
name: "JtDatePicker",
|
|
153
211
|
__name: "index",
|
|
154
212
|
props: {
|
|
@@ -201,7 +259,7 @@ const yn = /* @__PURE__ */ x({
|
|
|
201
259
|
isRange: { type: Boolean }
|
|
202
260
|
},
|
|
203
261
|
setup(t) {
|
|
204
|
-
const e = t, n =
|
|
262
|
+
const e = t, n = I(() => ({
|
|
205
263
|
...e,
|
|
206
264
|
startPlaceholder: e.startPlaceholder ?? (o(e.type) ? "开始日期" : void 0),
|
|
207
265
|
endPlaceholder: e.endPlaceholder ?? (o(e.type) ? "结束日期" : void 0)
|
|
@@ -210,13 +268,13 @@ const yn = /* @__PURE__ */ x({
|
|
|
210
268
|
return a?.includes("range") ?? !1;
|
|
211
269
|
}
|
|
212
270
|
return (a, r) => {
|
|
213
|
-
const
|
|
214
|
-
return
|
|
215
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
271
|
+
const s = Bt;
|
|
272
|
+
return b(), V(s, H({ class: "jt-date-picker" }, n.value, {
|
|
273
|
+
"onUpdate:modelValue": r[0] || (r[0] = (l) => a.$emit("update:modelValue", l))
|
|
216
274
|
}), null, 16);
|
|
217
275
|
};
|
|
218
276
|
}
|
|
219
|
-
}),
|
|
277
|
+
}), Mn = /* @__PURE__ */ ie(En, [["__scopeId", "data-v-7aa4706e"]]), Vn = /* @__PURE__ */ ee({
|
|
220
278
|
name: "JtInput",
|
|
221
279
|
__name: "index",
|
|
222
280
|
props: {
|
|
@@ -255,24 +313,24 @@ const yn = /* @__PURE__ */ x({
|
|
|
255
313
|
countGraphemes: {}
|
|
256
314
|
},
|
|
257
315
|
emits: {
|
|
258
|
-
...
|
|
316
|
+
...dt,
|
|
259
317
|
enter: () => !0
|
|
260
318
|
},
|
|
261
319
|
setup(t, { emit: e }) {
|
|
262
|
-
const n = t, o = e, a =
|
|
263
|
-
Object.keys(
|
|
320
|
+
const n = t, o = e, a = I(() => Object.fromEntries(
|
|
321
|
+
Object.keys(dt).map((r) => [
|
|
264
322
|
r,
|
|
265
|
-
(...
|
|
323
|
+
(...s) => o(r, ...s)
|
|
266
324
|
])
|
|
267
325
|
));
|
|
268
|
-
return (r,
|
|
269
|
-
const
|
|
270
|
-
return
|
|
271
|
-
onKeyup:
|
|
326
|
+
return (r, s) => {
|
|
327
|
+
const l = Ft;
|
|
328
|
+
return b(), V(l, H({ class: "jt-input" }, n, qe(a.value), {
|
|
329
|
+
onKeyup: s[0] || (s[0] = sn((d) => o("enter"), ["enter"]))
|
|
272
330
|
}), null, 16);
|
|
273
331
|
};
|
|
274
332
|
}
|
|
275
|
-
}),
|
|
333
|
+
}), nt = /* @__PURE__ */ ie(Vn, [["__scopeId", "data-v-031428a1"]]), Pn = /* @__PURE__ */ ee({
|
|
276
334
|
name: "JtSelect",
|
|
277
335
|
__name: "index",
|
|
278
336
|
props: {
|
|
@@ -329,31 +387,31 @@ const yn = /* @__PURE__ */ x({
|
|
|
329
387
|
appendTo: {},
|
|
330
388
|
props: {}
|
|
331
389
|
},
|
|
332
|
-
emits:
|
|
390
|
+
emits: ft,
|
|
333
391
|
setup(t, { emit: e }) {
|
|
334
|
-
const n = t, o =
|
|
335
|
-
const { options:
|
|
336
|
-
return
|
|
337
|
-
}), a = e, r =
|
|
338
|
-
Object.keys(
|
|
339
|
-
|
|
340
|
-
(...
|
|
392
|
+
const n = t, o = I(() => {
|
|
393
|
+
const { options: s, ...l } = n;
|
|
394
|
+
return l;
|
|
395
|
+
}), a = e, r = I(() => Object.fromEntries(
|
|
396
|
+
Object.keys(ft).map((s) => [
|
|
397
|
+
s,
|
|
398
|
+
(...l) => a(s, ...l)
|
|
341
399
|
])
|
|
342
400
|
));
|
|
343
|
-
return (
|
|
344
|
-
const
|
|
345
|
-
return
|
|
346
|
-
default:
|
|
347
|
-
(
|
|
348
|
-
key:
|
|
401
|
+
return (s, l) => {
|
|
402
|
+
const d = Mt, m = Et;
|
|
403
|
+
return b(), V(m, H({ class: "jt-select" }, o.value, qe(r.value)), {
|
|
404
|
+
default: L(() => [
|
|
405
|
+
(b(!0), G(Se, null, de(s.options ?? [], (M) => (b(), V(d, H({
|
|
406
|
+
key: M.value,
|
|
349
407
|
ref_for: !0
|
|
350
|
-
},
|
|
408
|
+
}, M), null, 16))), 128))
|
|
351
409
|
]),
|
|
352
410
|
_: 1
|
|
353
411
|
}, 16);
|
|
354
412
|
};
|
|
355
413
|
}
|
|
356
|
-
}),
|
|
414
|
+
}), Ln = /* @__PURE__ */ ie(Pn, [["__scopeId", "data-v-c67cfa84"]]), Nn = { class: "jt-form-items" }, ot = 4, On = /* @__PURE__ */ ee({
|
|
357
415
|
name: "JTFormItems",
|
|
358
416
|
__name: "JtFormItems",
|
|
359
417
|
props: {
|
|
@@ -363,111 +421,111 @@ const yn = /* @__PURE__ */ x({
|
|
|
363
421
|
},
|
|
364
422
|
setup(t) {
|
|
365
423
|
const e = t, n = {
|
|
366
|
-
input:
|
|
367
|
-
select:
|
|
368
|
-
cascader:
|
|
369
|
-
"date-picker":
|
|
424
|
+
input: nt,
|
|
425
|
+
select: Ln,
|
|
426
|
+
cascader: Fn,
|
|
427
|
+
"date-picker": Mn
|
|
370
428
|
}, o = {
|
|
371
429
|
"remote-select": "select",
|
|
372
430
|
date: "date-picker",
|
|
373
431
|
daterange: "date-picker",
|
|
374
432
|
"date-range": "date-picker",
|
|
375
433
|
dateRange: "date-picker"
|
|
376
|
-
}, a = /* @__PURE__ */ new Set(["prop", "label", "itemType", "span", "options", "rules", "formItemProps", "showSlot", "show"]), r = Object.keys(n),
|
|
377
|
-
const { itemType:
|
|
378
|
-
if (!
|
|
379
|
-
if (typeof
|
|
380
|
-
const
|
|
381
|
-
return r.includes(
|
|
382
|
-
`[JtFormItems] 不支持的 itemType: "${
|
|
383
|
-
),
|
|
384
|
-
},
|
|
385
|
-
const
|
|
386
|
-
return
|
|
387
|
-
...
|
|
388
|
-
options:
|
|
389
|
-
} :
|
|
390
|
-
...
|
|
434
|
+
}, a = /* @__PURE__ */ new Set(["prop", "label", "itemType", "span", "options", "rules", "formItemProps", "showSlot", "show"]), r = Object.keys(n), s = /* @__PURE__ */ new Map(), l = I(() => e.configs.filter((c) => c.show !== !1)), d = (c) => {
|
|
435
|
+
const { itemType: v } = c;
|
|
436
|
+
if (!v) return nt;
|
|
437
|
+
if (typeof v != "string") return v;
|
|
438
|
+
const T = o[v] ?? v;
|
|
439
|
+
return r.includes(T) ? n[T] : (console.error(
|
|
440
|
+
`[JtFormItems] 不支持的 itemType: "${v}",支持的类型: ${r.join(", ")}`
|
|
441
|
+
), nt);
|
|
442
|
+
}, m = (c) => {
|
|
443
|
+
const v = jt(c, a);
|
|
444
|
+
return c.itemType === "select" || c.itemType === "remote-select" || c.itemType === "cascader" ? {
|
|
445
|
+
...v,
|
|
446
|
+
options: c.options
|
|
447
|
+
} : q(c.itemType) ? {
|
|
448
|
+
...v,
|
|
391
449
|
type: "daterange"
|
|
392
|
-
} :
|
|
393
|
-
},
|
|
394
|
-
rules:
|
|
395
|
-
...
|
|
396
|
-
}),
|
|
397
|
-
e.formData[
|
|
450
|
+
} : v;
|
|
451
|
+
}, M = (c) => Rt(c, a), f = (c) => ({
|
|
452
|
+
rules: c.rules,
|
|
453
|
+
...c.formItemProps
|
|
454
|
+
}), y = (c, v) => {
|
|
455
|
+
e.formData[c] = v;
|
|
398
456
|
};
|
|
399
|
-
function c
|
|
400
|
-
return (
|
|
401
|
-
if (
|
|
402
|
-
|
|
457
|
+
function p(c) {
|
|
458
|
+
return (v) => {
|
|
459
|
+
if (v) {
|
|
460
|
+
s.set(c, v);
|
|
403
461
|
return;
|
|
404
462
|
}
|
|
405
|
-
|
|
463
|
+
s.delete(c);
|
|
406
464
|
};
|
|
407
465
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
410
|
-
|
|
466
|
+
function w(c, v) {
|
|
467
|
+
cn(() => {
|
|
468
|
+
s.get(c)?.validate(v).catch(() => {
|
|
411
469
|
});
|
|
412
470
|
});
|
|
413
471
|
}
|
|
414
|
-
const
|
|
415
|
-
const
|
|
416
|
-
(
|
|
472
|
+
const C = (c) => Math.min(Math.max(Math.trunc(c || 1), 1), 4), P = I(() => {
|
|
473
|
+
const v = l.value.reduce(
|
|
474
|
+
(T, S) => T + C(e.span || S.span),
|
|
417
475
|
0
|
|
418
|
-
) %
|
|
419
|
-
return
|
|
420
|
-
gridColumn: `1 / span ${
|
|
476
|
+
) % ot;
|
|
477
|
+
return v === 0 ? {
|
|
478
|
+
gridColumn: `1 / span ${ot}`
|
|
421
479
|
} : {
|
|
422
|
-
gridColumn: `${
|
|
480
|
+
gridColumn: `${v + 1} / span ${ot - v}`
|
|
423
481
|
};
|
|
424
|
-
}),
|
|
425
|
-
gridColumn: `span ${
|
|
482
|
+
}), F = (c) => ({
|
|
483
|
+
gridColumn: `span ${C(e.span || c.span)}`
|
|
426
484
|
});
|
|
427
|
-
function
|
|
428
|
-
return
|
|
429
|
-
}
|
|
430
|
-
return (
|
|
431
|
-
const
|
|
432
|
-
return
|
|
433
|
-
(
|
|
434
|
-
key:
|
|
485
|
+
function q(c) {
|
|
486
|
+
return c === "daterange" || c === "date-range" || c === "dateRange";
|
|
487
|
+
}
|
|
488
|
+
return (c, v) => {
|
|
489
|
+
const T = Vt;
|
|
490
|
+
return b(), G("div", Nn, [
|
|
491
|
+
(b(!0), G(Se, null, de(l.value, (S) => (b(), V(T, H({
|
|
492
|
+
key: S.prop,
|
|
435
493
|
ref_for: !0,
|
|
436
|
-
ref:
|
|
494
|
+
ref: p(S.prop),
|
|
437
495
|
class: "jt-form-items__item",
|
|
438
|
-
style:
|
|
439
|
-
label:
|
|
440
|
-
prop:
|
|
441
|
-
},
|
|
442
|
-
default:
|
|
443
|
-
|
|
496
|
+
style: F(S),
|
|
497
|
+
label: S.label,
|
|
498
|
+
prop: S.prop
|
|
499
|
+
}, f(S)), {
|
|
500
|
+
default: L(() => [
|
|
501
|
+
S.showSlot ? K(c.$slots, S.prop, { key: 0 }, void 0, !0) : (b(), V(Ct(d(S)), H({
|
|
444
502
|
key: 1,
|
|
445
|
-
"model-value":
|
|
503
|
+
"model-value": c.formData[S.prop],
|
|
446
504
|
ref_for: !0
|
|
447
|
-
},
|
|
448
|
-
"onUpdate:modelValue": (
|
|
449
|
-
onChange: () =>
|
|
450
|
-
onBlur: () =>
|
|
505
|
+
}, m(S), qe(M(S)), {
|
|
506
|
+
"onUpdate:modelValue": (B) => y(S.prop, B),
|
|
507
|
+
onChange: () => w(S.prop, "change"),
|
|
508
|
+
onBlur: () => w(S.prop, "blur")
|
|
451
509
|
}), null, 16, ["model-value", "onUpdate:modelValue", "onChange", "onBlur"]))
|
|
452
510
|
]),
|
|
453
511
|
_: 2
|
|
454
512
|
}, 1040, ["style", "label", "prop"]))), 128)),
|
|
455
|
-
|
|
513
|
+
c.$slots.actions ? (b(), V(T, {
|
|
456
514
|
key: 0,
|
|
457
515
|
class: "jt-form-items__actions",
|
|
458
|
-
style:
|
|
516
|
+
style: kt(P.value)
|
|
459
517
|
}, {
|
|
460
|
-
default:
|
|
461
|
-
|
|
518
|
+
default: L(() => [
|
|
519
|
+
K(c.$slots, "actions", {}, void 0, !0)
|
|
462
520
|
]),
|
|
463
521
|
_: 3
|
|
464
|
-
}, 8, ["style"])) :
|
|
522
|
+
}, 8, ["style"])) : te("", !0)
|
|
465
523
|
]);
|
|
466
524
|
};
|
|
467
525
|
}
|
|
468
|
-
}),
|
|
469
|
-
function
|
|
470
|
-
const t =
|
|
526
|
+
}), Rn = /* @__PURE__ */ ie(On, [["__scopeId", "data-v-cb82fcfc"]]);
|
|
527
|
+
function jn() {
|
|
528
|
+
const t = le(!1);
|
|
471
529
|
function e() {
|
|
472
530
|
t.value = !0;
|
|
473
531
|
}
|
|
@@ -480,7 +538,7 @@ function En() {
|
|
|
480
538
|
searchDone: n
|
|
481
539
|
};
|
|
482
540
|
}
|
|
483
|
-
const
|
|
541
|
+
const Gn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='-0.5'%20width='11'%20height='11'%20rx='5.5'%20transform='matrix(1%200%200%20-1%201%2012)'%20stroke='%23999999'/%3e%3cpath%20d='M10%208.16064L7%205.16064L4%208.16064'%20stroke='%23999999'/%3e%3c/svg%3e", An = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.375%207.00017C2.375%207.27631%202.59886%207.50017%202.875%207.50017C3.15114%207.50017%203.375%207.27631%203.375%207.00017H2.875H2.375ZM2.875%207.00017H3.375C3.375%204.46334%205.41801%202.41406%207.93713%202.41406V1.91406V1.41406C4.86127%201.41406%202.375%203.91551%202.375%207.00017H2.875ZM7.93713%201.91406V2.41406C10.4563%202.41406%2012.4993%204.46334%2012.4993%207.00017H12.9993H13.4993C13.4993%203.91551%2011.013%201.41406%207.93713%201.41406V1.91406ZM12.9993%207.00017H12.4993C12.4993%209.537%2010.4563%2011.5863%207.93713%2011.5863V12.0863V12.5863C11.013%2012.5863%2013.4993%2010.0848%2013.4993%207.00017H12.9993ZM7.93713%2012.0863V11.5863C6.68975%2011.5863%205.55663%2011.0806%204.72892%2010.2635L4.37765%2010.6193L4.02638%2010.9752C5.0317%2011.9676%206.41366%2012.5863%207.93713%2012.5863V12.0863Z'%20fill='%23999999'/%3e%3cpath%20d='M4.75131%206.0102L2.88631%207.88403L1%205.99414'%20stroke='%23999999'%20stroke-miterlimit='10'/%3e%3c/svg%3e", Kn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.60938%2012.1099C9.64694%2012.1099%2012.1094%209.64743%2012.1094%206.60986C12.1094%203.5723%209.64694%201.10986%206.60938%201.10986C3.57181%201.10986%201.10938%203.5723%201.10938%206.60986C1.10938%209.64743%203.57181%2012.1099%206.60938%2012.1099Z'%20stroke='white'%20stroke-miterlimit='10'/%3e%3cpath%20d='M12.4993%2012.5002L10.2832%2010.3301'%20stroke='white'%20stroke-miterlimit='10'/%3e%3c/svg%3e", qn = { class: "jt-filter-bar__btns" }, zn = ["src"], Dn = ["src"], xn = ["src"], Jn = /* @__PURE__ */ ee({
|
|
484
542
|
name: "JtFilterBar",
|
|
485
543
|
__name: "JtFilterBar",
|
|
486
544
|
props: {
|
|
@@ -490,80 +548,86 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
490
548
|
},
|
|
491
549
|
emits: ["update:modelValue", "search", "reset"],
|
|
492
550
|
setup(t, { expose: e, emit: n }) {
|
|
493
|
-
const o = t, a = n, r =
|
|
494
|
-
searchDisabled:
|
|
495
|
-
searchLoading:
|
|
496
|
-
searchDone:
|
|
497
|
-
} =
|
|
498
|
-
() => Math.max(1,
|
|
499
|
-
),
|
|
500
|
-
() => Math.max(1,
|
|
501
|
-
),
|
|
502
|
-
if (!
|
|
551
|
+
const o = t, a = n, r = le(), s = Ce(), l = le({}), {
|
|
552
|
+
searchDisabled: d,
|
|
553
|
+
searchLoading: m,
|
|
554
|
+
searchDone: M
|
|
555
|
+
} = jn(), f = I(() => o.option), y = le(f.value.searchCollapsed ?? !1), p = I(() => o.columns.filter(($) => $.search === !0)), w = I(
|
|
556
|
+
() => Math.max(1, f.value.searchSpan ?? 4)
|
|
557
|
+
), C = I(() => Math.max(1, f.value.searchCollapsedRows ?? 1)), P = I(() => w.value), F = I(
|
|
558
|
+
() => Math.max(1, P.value * C.value)
|
|
559
|
+
), q = I(() => w.value), c = I(() => _.value ? "264px" : "174px"), v = I(() => ce(f.value.searchLabelWidth ?? 84)), T = I(() => f.value.searchLabelPosition ?? "top"), S = I(() => Ie(f.value.searchGutter, 14)), B = I(() => Ie(f.value.searchRowGap, 14)), k = I(() => Ve(f.value.searchPadding ?? "18px 4px 0")), _ = I(() => f.value.searchCollapse === !1 ? !1 : x(p.value) > F.value), U = I(() => {
|
|
560
|
+
if (!_.value || !y.value) return p.value;
|
|
503
561
|
let $ = 0;
|
|
504
|
-
return
|
|
505
|
-
const
|
|
506
|
-
return $ +
|
|
562
|
+
return p.value.filter((Z) => {
|
|
563
|
+
const ae = X(Z);
|
|
564
|
+
return $ + ae > F.value ? !1 : ($ += ae, !0);
|
|
507
565
|
});
|
|
508
|
-
}),
|
|
509
|
-
() =>
|
|
510
|
-
),
|
|
511
|
-
|
|
566
|
+
}), me = I(
|
|
567
|
+
() => U.value.filter(($) => !!s[`${$.prop}-search`])
|
|
568
|
+
), Q = I(() => {
|
|
569
|
+
const [$] = U.value;
|
|
570
|
+
return !!$ && U.value.length === 1 && X($) < w.value;
|
|
571
|
+
}), ge = I(() => {
|
|
572
|
+
const [$] = U.value;
|
|
573
|
+
return `${Math.min(w.value, $ ? X($) + 1 : 1)}`;
|
|
574
|
+
}), Pe = I(
|
|
575
|
+
() => U.value.map(($) => N($))
|
|
512
576
|
);
|
|
513
|
-
|
|
514
|
-
() =>
|
|
577
|
+
be(
|
|
578
|
+
() => f.value.searchCollapsed,
|
|
515
579
|
($) => {
|
|
516
|
-
typeof $ == "boolean" && (
|
|
580
|
+
typeof $ == "boolean" && (y.value = $);
|
|
517
581
|
}
|
|
518
|
-
),
|
|
582
|
+
), be(
|
|
519
583
|
() => o.modelValue,
|
|
520
584
|
($) => {
|
|
521
|
-
|
|
585
|
+
l.value = { ...$ };
|
|
522
586
|
},
|
|
523
587
|
{ deep: !0, immediate: !0 }
|
|
524
588
|
);
|
|
525
|
-
function
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
|
|
589
|
+
function h($, Z) {
|
|
590
|
+
if (d.value) return;
|
|
591
|
+
const ae = { ...l.value, [$]: Z };
|
|
592
|
+
l.value = ae, a("update:modelValue", ae);
|
|
529
593
|
}
|
|
530
|
-
function
|
|
531
|
-
const
|
|
594
|
+
function N($) {
|
|
595
|
+
const Z = $.searchProps ?? {};
|
|
532
596
|
return {
|
|
533
|
-
...
|
|
597
|
+
...Z,
|
|
534
598
|
prop: $.prop,
|
|
535
599
|
label: $.searchLabel ?? $.label,
|
|
536
|
-
span:
|
|
600
|
+
span: X($),
|
|
537
601
|
itemType: $.searchType ?? "input",
|
|
538
602
|
// 外部提供 `${prop}-search` 时交给插槽渲染,保持旧版 JtFilterBar 的自定义能力。
|
|
539
|
-
showSlot: !!
|
|
540
|
-
options:
|
|
541
|
-
placeholder:
|
|
542
|
-
valueFormat:
|
|
543
|
-
disabled:
|
|
603
|
+
showSlot: !!s[`${$.prop}-search`],
|
|
604
|
+
options: Z.options ?? $.searchOptions ?? $.dicData,
|
|
605
|
+
placeholder: Z.placeholder ?? $.searchPlaceholder,
|
|
606
|
+
valueFormat: Z.valueFormat ?? $.searchValueFormat,
|
|
607
|
+
disabled: d.value || Z.disabled === !0,
|
|
544
608
|
formItemProps: {
|
|
545
609
|
required: $.searchRequired,
|
|
546
610
|
class: ["jt-filter-bar__item", { "is-required": $.searchRequired }]
|
|
547
611
|
},
|
|
548
612
|
// 保留原来输入框回车触发查询的行为,同时不吞掉使用方在 searchProps 中传入的 onEnter。
|
|
549
|
-
onEnter: (...
|
|
550
|
-
|
|
613
|
+
onEnter: (...ae) => {
|
|
614
|
+
O(Z.onEnter, ...ae), z();
|
|
551
615
|
},
|
|
552
616
|
// JtFormItems 内部会修改 filterModel,这里继续按旧接口向外 emit update:modelValue。
|
|
553
|
-
"onUpdate:modelValue": (
|
|
554
|
-
|
|
617
|
+
"onUpdate:modelValue": (ae) => {
|
|
618
|
+
O(Z["onUpdate:modelValue"], ae), h($.prop, ae);
|
|
555
619
|
}
|
|
556
620
|
};
|
|
557
621
|
}
|
|
558
|
-
function
|
|
622
|
+
function O($, ...Z) {
|
|
559
623
|
if (Array.isArray($)) {
|
|
560
|
-
$.forEach((
|
|
624
|
+
$.forEach((ae) => O(ae, ...Z));
|
|
561
625
|
return;
|
|
562
626
|
}
|
|
563
|
-
typeof $ == "function" && $(...
|
|
627
|
+
typeof $ == "function" && $(...Z);
|
|
564
628
|
}
|
|
565
|
-
async function
|
|
566
|
-
if (!
|
|
629
|
+
async function z() {
|
|
630
|
+
if (!d.value) {
|
|
567
631
|
if (r.value)
|
|
568
632
|
try {
|
|
569
633
|
await r.value.validate();
|
|
@@ -573,23 +637,23 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
573
637
|
a("search");
|
|
574
638
|
}
|
|
575
639
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
640
|
+
function A() {
|
|
641
|
+
d.value || a("reset");
|
|
578
642
|
}
|
|
579
|
-
function
|
|
580
|
-
|
|
643
|
+
function oe() {
|
|
644
|
+
y.value = !y.value;
|
|
581
645
|
}
|
|
582
|
-
function
|
|
583
|
-
return Math.min(
|
|
646
|
+
function X($) {
|
|
647
|
+
return Math.min(w.value, Math.max(1, $.searchSpan ?? 1));
|
|
584
648
|
}
|
|
585
|
-
function
|
|
586
|
-
return $.reduce((
|
|
649
|
+
function x($) {
|
|
650
|
+
return $.reduce((Z, ae) => Z + X(ae), 0);
|
|
587
651
|
}
|
|
588
|
-
function
|
|
652
|
+
function ce($) {
|
|
589
653
|
return typeof $ == "number" ? `${$}px` : $;
|
|
590
654
|
}
|
|
591
|
-
function
|
|
592
|
-
return typeof $ == "number" ? $ :
|
|
655
|
+
function Ie($, Z) {
|
|
656
|
+
return typeof $ == "number" ? $ : Z;
|
|
593
657
|
}
|
|
594
658
|
function Ve($) {
|
|
595
659
|
return typeof $ == "number" ? `${$}px` : $;
|
|
@@ -598,95 +662,98 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
598
662
|
/** 内部 Element Plus Form 实例,保留给业务侧做校验、重置等原生表单操作。 */
|
|
599
663
|
formRef: r,
|
|
600
664
|
/** 当前筛选表单禁用态。 */
|
|
601
|
-
searchDisabled:
|
|
665
|
+
searchDisabled: d,
|
|
602
666
|
/** 开启筛选表单禁用。 */
|
|
603
|
-
searchLoading:
|
|
667
|
+
searchLoading: m,
|
|
604
668
|
/** 关闭筛选表单禁用。 */
|
|
605
|
-
searchDone:
|
|
606
|
-
}), ($,
|
|
607
|
-
const
|
|
608
|
-
return
|
|
609
|
-
class:
|
|
610
|
-
style:
|
|
611
|
-
"--jt-filter-columns":
|
|
612
|
-
"--jt-filter-
|
|
613
|
-
"--jt-filter-
|
|
614
|
-
"--jt-filter-
|
|
615
|
-
"--jt-filter-
|
|
669
|
+
searchDone: M
|
|
670
|
+
}), ($, Z) => {
|
|
671
|
+
const ae = Pt;
|
|
672
|
+
return b(), G("div", {
|
|
673
|
+
class: Ge(["jt-filter-bar", [`is-label-${T.value}`, { "is-single-filter": Q.value }]]),
|
|
674
|
+
style: kt({
|
|
675
|
+
"--jt-filter-columns": w.value,
|
|
676
|
+
"--jt-filter-field-columns": q.value,
|
|
677
|
+
"--jt-filter-btns-width": c.value,
|
|
678
|
+
"--jt-filter-actions-start": ge.value,
|
|
679
|
+
"--jt-filter-label-width": v.value,
|
|
680
|
+
"--jt-filter-column-gap": `${S.value}px`,
|
|
681
|
+
"--jt-filter-row-gap": `${B.value}px`,
|
|
682
|
+
"--jt-filter-padding": k.value
|
|
616
683
|
})
|
|
617
684
|
}, [
|
|
618
|
-
|
|
685
|
+
pe(ae, {
|
|
619
686
|
ref_key: "formRef",
|
|
620
687
|
ref: r,
|
|
621
688
|
class: "jt-filter-bar__form",
|
|
622
|
-
model:
|
|
623
|
-
"label-position":
|
|
624
|
-
"label-width":
|
|
625
|
-
disabled:
|
|
626
|
-
onSubmit:
|
|
689
|
+
model: l.value,
|
|
690
|
+
"label-position": T.value,
|
|
691
|
+
"label-width": v.value,
|
|
692
|
+
disabled: J(d),
|
|
693
|
+
onSubmit: Z[0] || (Z[0] = un(() => {
|
|
627
694
|
}, ["prevent"]))
|
|
628
695
|
}, {
|
|
629
|
-
default:
|
|
630
|
-
|
|
631
|
-
configs:
|
|
632
|
-
"form-data":
|
|
633
|
-
},
|
|
634
|
-
actions:
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
search:
|
|
638
|
-
reset:
|
|
639
|
-
disabled:
|
|
640
|
-
collapsed:
|
|
641
|
-
toggleCollapse:
|
|
696
|
+
default: L(() => [
|
|
697
|
+
pe(J(Rn), {
|
|
698
|
+
configs: Pe.value,
|
|
699
|
+
"form-data": l.value
|
|
700
|
+
}, Me({
|
|
701
|
+
actions: L(() => [
|
|
702
|
+
D("div", qn, [
|
|
703
|
+
K($.$slots, "search-menu", {
|
|
704
|
+
search: z,
|
|
705
|
+
reset: A,
|
|
706
|
+
disabled: J(d),
|
|
707
|
+
collapsed: y.value,
|
|
708
|
+
toggleCollapse: oe
|
|
642
709
|
}, () => [
|
|
643
|
-
|
|
710
|
+
_.value ? (b(), V(J(xe), {
|
|
644
711
|
key: 0,
|
|
645
712
|
class: "jt-filter-bar__btn-collapse",
|
|
646
|
-
onClick:
|
|
713
|
+
onClick: oe
|
|
647
714
|
}, {
|
|
648
|
-
icon:
|
|
649
|
-
|
|
650
|
-
class:
|
|
651
|
-
src:
|
|
715
|
+
icon: L(() => [
|
|
716
|
+
D("img", {
|
|
717
|
+
class: Ge(["jt-filter-bar__icon-arrow", { "is-collapsed": y.value }]),
|
|
718
|
+
src: J(Gn),
|
|
652
719
|
alt: ""
|
|
653
|
-
}, null, 10,
|
|
720
|
+
}, null, 10, zn)
|
|
654
721
|
]),
|
|
655
|
-
default:
|
|
656
|
-
|
|
722
|
+
default: L(() => [
|
|
723
|
+
D("span", null, se(y.value ? "展 开" : "收 起"), 1)
|
|
657
724
|
]),
|
|
658
725
|
_: 1
|
|
659
|
-
})) :
|
|
660
|
-
|
|
726
|
+
})) : te("", !0),
|
|
727
|
+
pe(J(xe), {
|
|
661
728
|
class: "jt-filter-bar__btn-reset",
|
|
662
|
-
disabled:
|
|
663
|
-
onClick:
|
|
729
|
+
disabled: J(d),
|
|
730
|
+
onClick: A
|
|
664
731
|
}, {
|
|
665
|
-
icon:
|
|
666
|
-
|
|
667
|
-
src:
|
|
732
|
+
icon: L(() => [
|
|
733
|
+
D("img", {
|
|
734
|
+
src: J(An),
|
|
668
735
|
alt: ""
|
|
669
|
-
}, null, 8,
|
|
736
|
+
}, null, 8, Dn)
|
|
670
737
|
]),
|
|
671
|
-
default:
|
|
672
|
-
|
|
738
|
+
default: L(() => [
|
|
739
|
+
D("span", null, se(f.value.resetBtnText ?? "重 置"), 1)
|
|
673
740
|
]),
|
|
674
741
|
_: 1
|
|
675
742
|
}, 8, ["disabled"]),
|
|
676
|
-
|
|
743
|
+
pe(J(xe), {
|
|
677
744
|
class: "jt-filter-bar__btn-query",
|
|
678
745
|
type: "primary",
|
|
679
|
-
disabled:
|
|
680
|
-
onClick:
|
|
746
|
+
disabled: J(d),
|
|
747
|
+
onClick: z
|
|
681
748
|
}, {
|
|
682
|
-
icon:
|
|
683
|
-
|
|
684
|
-
src:
|
|
749
|
+
icon: L(() => [
|
|
750
|
+
D("img", {
|
|
751
|
+
src: J(Kn),
|
|
685
752
|
alt: ""
|
|
686
|
-
}, null, 8,
|
|
753
|
+
}, null, 8, xn)
|
|
687
754
|
]),
|
|
688
|
-
default:
|
|
689
|
-
|
|
755
|
+
default: L(() => [
|
|
756
|
+
D("span", null, se(f.value.searchBtnText ?? "查 询"), 1)
|
|
690
757
|
]),
|
|
691
758
|
_: 1
|
|
692
759
|
}, 8, ["disabled"])
|
|
@@ -695,16 +762,16 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
695
762
|
]),
|
|
696
763
|
_: 2
|
|
697
764
|
}, [
|
|
698
|
-
|
|
699
|
-
name:
|
|
700
|
-
fn:
|
|
701
|
-
|
|
702
|
-
value:
|
|
703
|
-
column:
|
|
704
|
-
setValue: (
|
|
705
|
-
search:
|
|
706
|
-
reset:
|
|
707
|
-
disabled:
|
|
765
|
+
de(me.value, (Ee) => ({
|
|
766
|
+
name: Ee.prop,
|
|
767
|
+
fn: L(() => [
|
|
768
|
+
K($.$slots, `${Ee.prop}-search`, {
|
|
769
|
+
value: l.value[Ee.prop],
|
|
770
|
+
column: Ee,
|
|
771
|
+
setValue: (Xe) => h(Ee.prop, Xe),
|
|
772
|
+
search: z,
|
|
773
|
+
reset: A,
|
|
774
|
+
disabled: J(d)
|
|
708
775
|
}, void 0, !0)
|
|
709
776
|
])
|
|
710
777
|
}))
|
|
@@ -715,7 +782,7 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
715
782
|
], 6);
|
|
716
783
|
};
|
|
717
784
|
}
|
|
718
|
-
}),
|
|
785
|
+
}), Hn = /* @__PURE__ */ ie(Jn, [["__scopeId", "data-v-1f6fdc4e"]]), Un = { key: 1 }, Wn = { key: 2 }, Zn = { key: 3 }, Yn = /* @__PURE__ */ ee({
|
|
719
786
|
name: "JtTable",
|
|
720
787
|
__name: "JtTable",
|
|
721
788
|
props: {
|
|
@@ -725,85 +792,85 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
725
792
|
tableEvents: {}
|
|
726
793
|
},
|
|
727
794
|
setup(t, { expose: e }) {
|
|
728
|
-
const n = t, o =
|
|
729
|
-
function p
|
|
730
|
-
return !!o[`${
|
|
795
|
+
const n = t, o = Ce(), a = le(), r = I(() => n.option ?? {}), s = I(() => n.columns.filter((p) => !p.hide));
|
|
796
|
+
function l(p) {
|
|
797
|
+
return !!o[`${p}-header`];
|
|
731
798
|
}
|
|
732
|
-
function
|
|
733
|
-
return !!o[`${
|
|
799
|
+
function d(p) {
|
|
800
|
+
return !!o[`${p}-data`];
|
|
734
801
|
}
|
|
735
|
-
function
|
|
802
|
+
function m(p) {
|
|
736
803
|
return {
|
|
737
|
-
width:
|
|
738
|
-
minWidth:
|
|
739
|
-
align:
|
|
740
|
-
fixed:
|
|
741
|
-
sortable:
|
|
742
|
-
showOverflowTooltip:
|
|
743
|
-
...
|
|
804
|
+
width: p.width,
|
|
805
|
+
minWidth: p.minWidth,
|
|
806
|
+
align: p.align,
|
|
807
|
+
fixed: p.fixed,
|
|
808
|
+
sortable: p.sortable,
|
|
809
|
+
showOverflowTooltip: p.showOverflowTooltip,
|
|
810
|
+
...p.columnOptions
|
|
744
811
|
};
|
|
745
812
|
}
|
|
746
|
-
function
|
|
747
|
-
return !
|
|
813
|
+
function M(p) {
|
|
814
|
+
return !f(p.columnOptions?.type);
|
|
748
815
|
}
|
|
749
|
-
function
|
|
750
|
-
return
|
|
816
|
+
function f(p) {
|
|
817
|
+
return p === "selection" || p === "index" || p === "expand";
|
|
751
818
|
}
|
|
752
|
-
function
|
|
753
|
-
return
|
|
819
|
+
function y(p, w) {
|
|
820
|
+
return p.find((C) => C.value === w)?.label ?? String(w ?? "");
|
|
754
821
|
}
|
|
755
|
-
return e({ tableRef: a }), (
|
|
756
|
-
const
|
|
757
|
-
return
|
|
822
|
+
return e({ tableRef: a }), (p, w) => {
|
|
823
|
+
const C = Nt, P = Lt;
|
|
824
|
+
return b(), V(P, H({
|
|
758
825
|
ref_key: "tableRef",
|
|
759
826
|
ref: a,
|
|
760
|
-
data:
|
|
827
|
+
data: p.data,
|
|
761
828
|
"row-key": r.value.rowKey ?? "id",
|
|
762
829
|
height: r.value.height,
|
|
763
830
|
"max-height": r.value.maxHeight,
|
|
764
831
|
"empty-text": r.value.emptyText,
|
|
765
832
|
class: "jt-table"
|
|
766
|
-
}, r.value.tableProps,
|
|
767
|
-
default:
|
|
768
|
-
r.value.selection ? (
|
|
833
|
+
}, r.value.tableProps, qe(p.tableEvents)), {
|
|
834
|
+
default: L(() => [
|
|
835
|
+
r.value.selection ? (b(), V(C, {
|
|
769
836
|
key: 0,
|
|
770
837
|
type: "selection",
|
|
771
838
|
width: "55",
|
|
772
839
|
align: "center"
|
|
773
|
-
})) :
|
|
774
|
-
r.value.index ? (
|
|
840
|
+
})) : te("", !0),
|
|
841
|
+
r.value.index ? (b(), V(C, {
|
|
775
842
|
key: 1,
|
|
776
843
|
type: "index",
|
|
777
844
|
label: r.value.indexLabel ?? "序号",
|
|
778
845
|
width: "60",
|
|
779
846
|
align: "center"
|
|
780
|
-
}, null, 8, ["label"])) :
|
|
781
|
-
(
|
|
782
|
-
key:
|
|
783
|
-
prop:
|
|
784
|
-
label:
|
|
785
|
-
formatter: !
|
|
847
|
+
}, null, 8, ["label"])) : te("", !0),
|
|
848
|
+
(b(!0), G(Se, null, de(s.value, (F) => (b(), V(C, H({
|
|
849
|
+
key: F.prop,
|
|
850
|
+
prop: F.prop,
|
|
851
|
+
label: F.label,
|
|
852
|
+
formatter: !d(F.prop) && !F.dicData ? F.formatter : void 0,
|
|
786
853
|
ref_for: !0
|
|
787
|
-
},
|
|
788
|
-
|
|
854
|
+
}, m(F)), Me({ _: 2 }, [
|
|
855
|
+
l(F.prop) ? {
|
|
789
856
|
name: "header",
|
|
790
|
-
fn:
|
|
791
|
-
|
|
857
|
+
fn: L((q) => [
|
|
858
|
+
K(p.$slots, `${F.prop}-header`, H({ ref_for: !0 }, q), void 0, !0)
|
|
792
859
|
]),
|
|
793
860
|
key: "0"
|
|
794
861
|
} : void 0,
|
|
795
|
-
|
|
862
|
+
M(F) ? {
|
|
796
863
|
name: "default",
|
|
797
|
-
fn:
|
|
798
|
-
|
|
864
|
+
fn: L((q) => [
|
|
865
|
+
d(F.prop) ? K(p.$slots, `${F.prop}-data`, H({
|
|
799
866
|
key: 0,
|
|
800
867
|
ref_for: !0
|
|
801
|
-
},
|
|
868
|
+
}, q), void 0, !0) : F.dicData ? (b(), G("span", Un, se(y(F.dicData, q.row[F.prop])), 1)) : F.formatter ? (b(), G("span", Wn, se(F.formatter(q.row, q.column, q.row[F.prop], q.$index)), 1)) : (b(), G("span", Zn, se(q.row[F.prop]), 1))
|
|
802
869
|
]),
|
|
803
870
|
key: "1"
|
|
804
871
|
} : void 0
|
|
805
872
|
]), 1040, ["prop", "label", "formatter"]))), 128)),
|
|
806
|
-
r.value.menu ? (
|
|
873
|
+
r.value.menu ? (b(), V(C, {
|
|
807
874
|
key: 2,
|
|
808
875
|
label: r.value.menuLabel ?? "操作",
|
|
809
876
|
width: r.value.menuWidth,
|
|
@@ -811,17 +878,17 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
811
878
|
align: r.value.menuAlign ?? "center",
|
|
812
879
|
fixed: r.value.menuFixed
|
|
813
880
|
}, {
|
|
814
|
-
default:
|
|
815
|
-
|
|
881
|
+
default: L((F) => [
|
|
882
|
+
K(p.$slots, "menu", he(_e(F)), void 0, !0)
|
|
816
883
|
]),
|
|
817
884
|
_: 3
|
|
818
|
-
}, 8, ["label", "width", "min-width", "align", "fixed"])) :
|
|
885
|
+
}, 8, ["label", "width", "min-width", "align", "fixed"])) : te("", !0)
|
|
819
886
|
]),
|
|
820
887
|
_: 3
|
|
821
888
|
}, 16, ["data", "row-key", "height", "max-height", "empty-text"]);
|
|
822
889
|
};
|
|
823
890
|
}
|
|
824
|
-
}),
|
|
891
|
+
}), Qn = /* @__PURE__ */ ie(Yn, [["__scopeId", "data-v-513fa12d"]]), Xn = { class: "jt-pagination" }, eo = { class: "jt-pagination__count" }, to = /* @__PURE__ */ ee({
|
|
825
892
|
name: "JtPagination",
|
|
826
893
|
__name: "JtPagination",
|
|
827
894
|
props: {
|
|
@@ -832,35 +899,35 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
832
899
|
},
|
|
833
900
|
emits: ["update:currentPage", "update:pageSize", "current-change", "page-change", "size-change"],
|
|
834
901
|
setup(t, { emit: e }) {
|
|
835
|
-
const n = t, o =
|
|
836
|
-
function r(
|
|
837
|
-
a("current-change",
|
|
838
|
-
}
|
|
839
|
-
return (
|
|
840
|
-
const
|
|
841
|
-
return
|
|
842
|
-
|
|
843
|
-
"current-page":
|
|
844
|
-
"page-size":
|
|
902
|
+
const n = t, o = I(() => n.option ?? {}), a = e;
|
|
903
|
+
function r(s) {
|
|
904
|
+
a("current-change", s), a("page-change", s);
|
|
905
|
+
}
|
|
906
|
+
return (s, l) => {
|
|
907
|
+
const d = vn;
|
|
908
|
+
return b(), G("div", Xn, [
|
|
909
|
+
pe(d, {
|
|
910
|
+
"current-page": s.currentPage,
|
|
911
|
+
"page-size": s.pageSize,
|
|
845
912
|
"page-sizes": o.value.pageSizes ?? [10, 20, 50, 100],
|
|
846
|
-
total:
|
|
913
|
+
total: s.total,
|
|
847
914
|
layout: o.value.paginationLayout ?? "sizes, prev, pager, next, jumper",
|
|
848
|
-
"onUpdate:currentPage":
|
|
849
|
-
"onUpdate:pageSize":
|
|
915
|
+
"onUpdate:currentPage": l[0] || (l[0] = (m) => s.$emit("update:currentPage", m)),
|
|
916
|
+
"onUpdate:pageSize": l[1] || (l[1] = (m) => s.$emit("update:pageSize", m)),
|
|
850
917
|
onCurrentChange: r,
|
|
851
|
-
onSizeChange:
|
|
918
|
+
onSizeChange: l[2] || (l[2] = (m) => s.$emit("size-change", m))
|
|
852
919
|
}, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout"]),
|
|
853
|
-
|
|
920
|
+
D("span", eo, "共" + se(s.total) + "条记录", 1)
|
|
854
921
|
]);
|
|
855
922
|
};
|
|
856
923
|
}
|
|
857
|
-
}),
|
|
924
|
+
}), no = /* @__PURE__ */ ie(to, [["__scopeId", "data-v-746af6aa"]]), oo = { class: "jt-crud-table" }, ao = {
|
|
858
925
|
key: 1,
|
|
859
926
|
class: "jt-crud-table__toolbar"
|
|
860
|
-
},
|
|
927
|
+
}, ro = /* @__PURE__ */ ee({
|
|
861
928
|
name: "JtCrudTable",
|
|
862
929
|
__name: "JtCrudTable",
|
|
863
|
-
props: /* @__PURE__ */
|
|
930
|
+
props: /* @__PURE__ */ ut({
|
|
864
931
|
columns: {},
|
|
865
932
|
option: { default: () => ({}) },
|
|
866
933
|
data: {},
|
|
@@ -874,115 +941,115 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
874
941
|
searchModel: { default: () => ({}) },
|
|
875
942
|
searchModelModifiers: {}
|
|
876
943
|
}),
|
|
877
|
-
emits: /* @__PURE__ */
|
|
944
|
+
emits: /* @__PURE__ */ ut(["search", "reset", "page-change", "size-change"], ["update:currentPage", "update:pageSize", "update:searchModel"]),
|
|
878
945
|
setup(t, { expose: e, emit: n }) {
|
|
879
|
-
const o = t, a = n, r =
|
|
880
|
-
() => o.columns.filter((
|
|
881
|
-
),
|
|
882
|
-
() => o.columns.filter((
|
|
883
|
-
),
|
|
884
|
-
() => o.columns.filter((
|
|
946
|
+
const o = t, a = n, r = tt(t, "currentPage"), s = tt(t, "pageSize"), l = tt(t, "searchModel"), d = Ce(), m = le(), M = le(), f = I(() => o.option), y = I(() => f.value.searchShow !== !1), p = I(() => f.value.paginationShow !== !1), w = I(
|
|
947
|
+
() => o.columns.filter((S) => S.search && !!d[`${S.prop}-search`])
|
|
948
|
+
), C = I(
|
|
949
|
+
() => o.columns.filter((S) => !S.hide && !!d[`${S.prop}-header`])
|
|
950
|
+
), P = I(
|
|
951
|
+
() => o.columns.filter((S) => !S.hide && !!d[`${S.prop}-data`])
|
|
885
952
|
);
|
|
886
|
-
function
|
|
887
|
-
const
|
|
888
|
-
return o.columns.forEach((
|
|
889
|
-
|
|
890
|
-
}),
|
|
953
|
+
function F() {
|
|
954
|
+
const S = {};
|
|
955
|
+
return o.columns.forEach((B) => {
|
|
956
|
+
B.search && (S[B.prop] = void 0);
|
|
957
|
+
}), S;
|
|
891
958
|
}
|
|
892
|
-
function
|
|
893
|
-
a("search", { ...
|
|
959
|
+
function q() {
|
|
960
|
+
a("search", { ...l.value });
|
|
894
961
|
}
|
|
895
|
-
function
|
|
896
|
-
|
|
962
|
+
function c() {
|
|
963
|
+
l.value = F(), a("reset");
|
|
897
964
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
965
|
+
function v() {
|
|
966
|
+
M.value?.searchLoading();
|
|
900
967
|
}
|
|
901
|
-
function
|
|
902
|
-
|
|
968
|
+
function T() {
|
|
969
|
+
M.value?.searchDone();
|
|
903
970
|
}
|
|
904
971
|
return e({
|
|
905
972
|
/** 获取内部 el-table 实例 */
|
|
906
|
-
tableRef:
|
|
973
|
+
tableRef: I(() => m.value?.tableRef),
|
|
907
974
|
/** 获取内部筛选条实例 */
|
|
908
|
-
filterBarRef:
|
|
975
|
+
filterBarRef: M,
|
|
909
976
|
/** 开启筛选表单禁用。 */
|
|
910
|
-
searchLoading:
|
|
977
|
+
searchLoading: v,
|
|
911
978
|
/** 关闭筛选表单禁用。 */
|
|
912
|
-
searchDone:
|
|
913
|
-
}), (
|
|
914
|
-
const
|
|
915
|
-
return
|
|
916
|
-
|
|
917
|
-
|
|
979
|
+
searchDone: T
|
|
980
|
+
}), (S, B) => {
|
|
981
|
+
const k = gn;
|
|
982
|
+
return b(), G("div", oo, [
|
|
983
|
+
K(S.$slots, "header", {}, void 0, !0),
|
|
984
|
+
y.value ? (b(), V(Hn, {
|
|
918
985
|
key: 0,
|
|
919
986
|
ref_key: "filterBarRef",
|
|
920
|
-
ref:
|
|
921
|
-
modelValue:
|
|
922
|
-
"onUpdate:modelValue":
|
|
923
|
-
columns:
|
|
924
|
-
option:
|
|
925
|
-
onSearch:
|
|
926
|
-
onReset:
|
|
927
|
-
},
|
|
928
|
-
|
|
929
|
-
name: `${
|
|
930
|
-
fn:
|
|
931
|
-
|
|
987
|
+
ref: M,
|
|
988
|
+
modelValue: l.value,
|
|
989
|
+
"onUpdate:modelValue": B[0] || (B[0] = (_) => l.value = _),
|
|
990
|
+
columns: S.columns,
|
|
991
|
+
option: f.value,
|
|
992
|
+
onSearch: q,
|
|
993
|
+
onReset: c
|
|
994
|
+
}, Me({ _: 2 }, [
|
|
995
|
+
de(w.value, (_) => ({
|
|
996
|
+
name: `${_.prop}-search`,
|
|
997
|
+
fn: L((U) => [
|
|
998
|
+
K(S.$slots, `${_.prop}-search`, he(_e(U)), void 0, !0)
|
|
932
999
|
])
|
|
933
1000
|
}))
|
|
934
|
-
]), 1032, ["modelValue", "columns", "option"])) :
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
])) :
|
|
938
|
-
|
|
1001
|
+
]), 1032, ["modelValue", "columns", "option"])) : te("", !0),
|
|
1002
|
+
J(d).toolbar ? (b(), G("div", ao, [
|
|
1003
|
+
K(S.$slots, "toolbar", {}, void 0, !0)
|
|
1004
|
+
])) : te("", !0),
|
|
1005
|
+
dn((b(), V(Qn, {
|
|
939
1006
|
ref_key: "jtTableRef",
|
|
940
|
-
ref:
|
|
941
|
-
data:
|
|
942
|
-
columns:
|
|
943
|
-
option:
|
|
944
|
-
"table-events":
|
|
945
|
-
},
|
|
946
|
-
|
|
947
|
-
name: `${
|
|
948
|
-
fn:
|
|
949
|
-
|
|
1007
|
+
ref: m,
|
|
1008
|
+
data: S.data,
|
|
1009
|
+
columns: S.columns,
|
|
1010
|
+
option: f.value,
|
|
1011
|
+
"table-events": S.tableEvents
|
|
1012
|
+
}, Me({ _: 2 }, [
|
|
1013
|
+
de(C.value, (_) => ({
|
|
1014
|
+
name: `${_.prop}-header`,
|
|
1015
|
+
fn: L((U) => [
|
|
1016
|
+
K(S.$slots, `${_.prop}-header`, he(_e(U)), void 0, !0)
|
|
950
1017
|
])
|
|
951
1018
|
})),
|
|
952
|
-
|
|
953
|
-
name: `${
|
|
954
|
-
fn:
|
|
955
|
-
|
|
1019
|
+
de(P.value, (_) => ({
|
|
1020
|
+
name: `${_.prop}-data`,
|
|
1021
|
+
fn: L((U) => [
|
|
1022
|
+
K(S.$slots, `${_.prop}-data`, he(_e(U)), void 0, !0)
|
|
956
1023
|
])
|
|
957
1024
|
})),
|
|
958
|
-
|
|
1025
|
+
f.value.menu ? {
|
|
959
1026
|
name: "menu",
|
|
960
|
-
fn:
|
|
961
|
-
|
|
1027
|
+
fn: L((_) => [
|
|
1028
|
+
K(S.$slots, "menu", he(_e(_)), void 0, !0)
|
|
962
1029
|
]),
|
|
963
1030
|
key: "0"
|
|
964
1031
|
} : void 0
|
|
965
1032
|
]), 1032, ["data", "columns", "option", "table-events"])), [
|
|
966
|
-
[
|
|
1033
|
+
[k, f.value.loading]
|
|
967
1034
|
]),
|
|
968
|
-
|
|
1035
|
+
p.value ? (b(), V(no, {
|
|
969
1036
|
key: 2,
|
|
970
1037
|
"current-page": r.value,
|
|
971
|
-
"onUpdate:currentPage":
|
|
972
|
-
"page-size":
|
|
973
|
-
"onUpdate:pageSize":
|
|
974
|
-
total:
|
|
975
|
-
option:
|
|
976
|
-
onPageChange:
|
|
977
|
-
onSizeChange:
|
|
978
|
-
}, null, 8, ["current-page", "page-size", "total", "option"])) :
|
|
1038
|
+
"onUpdate:currentPage": B[1] || (B[1] = (_) => r.value = _),
|
|
1039
|
+
"page-size": s.value,
|
|
1040
|
+
"onUpdate:pageSize": B[2] || (B[2] = (_) => s.value = _),
|
|
1041
|
+
total: S.total,
|
|
1042
|
+
option: f.value,
|
|
1043
|
+
onPageChange: B[3] || (B[3] = (_) => S.$emit("page-change", _)),
|
|
1044
|
+
onSizeChange: B[4] || (B[4] = (_) => S.$emit("size-change", _))
|
|
1045
|
+
}, null, 8, ["current-page", "page-size", "total", "option"])) : te("", !0)
|
|
979
1046
|
]);
|
|
980
1047
|
};
|
|
981
1048
|
}
|
|
982
|
-
}),
|
|
1049
|
+
}), Aa = /* @__PURE__ */ ie(ro, [["__scopeId", "data-v-ad466273"]]), lo = { class: "jt-page-header__title" }, so = { key: 0 }, io = {
|
|
983
1050
|
key: 0,
|
|
984
1051
|
class: "jt-page-header__operates"
|
|
985
|
-
},
|
|
1052
|
+
}, co = /* @__PURE__ */ ee({
|
|
986
1053
|
name: "JtPageHeader",
|
|
987
1054
|
__name: "index",
|
|
988
1055
|
props: {
|
|
@@ -992,44 +1059,44 @@ const Fn = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%20
|
|
|
992
1059
|
},
|
|
993
1060
|
emits: ["operate-click"],
|
|
994
1061
|
setup(t, { emit: e }) {
|
|
995
|
-
const n = t, o = e, a =
|
|
996
|
-
function
|
|
997
|
-
|
|
998
|
-
}
|
|
999
|
-
return (
|
|
1000
|
-
class: ["jt-page-header", `jt-page-header--${
|
|
1001
|
-
},
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1062
|
+
const n = t, o = e, a = Ce(), r = I(() => n.operates.length > 0 || !!a.operates);
|
|
1063
|
+
function s(l, d) {
|
|
1064
|
+
l.onClick?.(l, d), o("operate-click", l, d);
|
|
1065
|
+
}
|
|
1066
|
+
return (l, d) => (b(), G("div", H({
|
|
1067
|
+
class: ["jt-page-header", `jt-page-header--${l.type}`]
|
|
1068
|
+
}, l.$attrs), [
|
|
1069
|
+
D("div", lo, [
|
|
1070
|
+
K(l.$slots, "title", {}, () => [
|
|
1071
|
+
l.title ? (b(), G("span", so, se(l.title), 1)) : te("", !0)
|
|
1005
1072
|
], !0)
|
|
1006
1073
|
]),
|
|
1007
|
-
r.value ? (
|
|
1008
|
-
|
|
1009
|
-
(
|
|
1010
|
-
key:
|
|
1074
|
+
r.value ? (b(), G("div", io, [
|
|
1075
|
+
K(l.$slots, "operates", { operates: l.operates }, () => [
|
|
1076
|
+
(b(!0), G(Se, null, de(l.operates, (m) => (b(), V(J(xe), H({
|
|
1077
|
+
key: m.key ?? m.label,
|
|
1011
1078
|
ref_for: !0
|
|
1012
|
-
},
|
|
1013
|
-
type:
|
|
1014
|
-
disabled:
|
|
1015
|
-
loading:
|
|
1016
|
-
plain:
|
|
1017
|
-
text:
|
|
1018
|
-
link:
|
|
1019
|
-
icon:
|
|
1020
|
-
onClick: (
|
|
1079
|
+
}, m.buttonProps, {
|
|
1080
|
+
type: m.type,
|
|
1081
|
+
disabled: m.disabled,
|
|
1082
|
+
loading: m.loading,
|
|
1083
|
+
plain: m.plain,
|
|
1084
|
+
text: m.text,
|
|
1085
|
+
link: m.link,
|
|
1086
|
+
icon: m.icon,
|
|
1087
|
+
onClick: (M) => s(m, M)
|
|
1021
1088
|
}), {
|
|
1022
|
-
default:
|
|
1023
|
-
|
|
1089
|
+
default: L(() => [
|
|
1090
|
+
D("span", null, se(m.label), 1)
|
|
1024
1091
|
]),
|
|
1025
1092
|
_: 2
|
|
1026
1093
|
}, 1040, ["type", "disabled", "loading", "plain", "text", "link", "icon", "onClick"]))), 128))
|
|
1027
1094
|
], !0)
|
|
1028
|
-
])) :
|
|
1095
|
+
])) : te("", !0)
|
|
1029
1096
|
], 16));
|
|
1030
1097
|
}
|
|
1031
|
-
}),
|
|
1032
|
-
function
|
|
1098
|
+
}), Ka = /* @__PURE__ */ ie(co, [["__scopeId", "data-v-9e6bb356"]]);
|
|
1099
|
+
function uo(t = null) {
|
|
1033
1100
|
return {
|
|
1034
1101
|
scheme: null,
|
|
1035
1102
|
node: null,
|
|
@@ -1042,23 +1109,23 @@ function to(t = null) {
|
|
|
1042
1109
|
raw: t
|
|
1043
1110
|
};
|
|
1044
1111
|
}
|
|
1045
|
-
function
|
|
1046
|
-
const e =
|
|
1112
|
+
function mt(t) {
|
|
1113
|
+
const e = Dt(t), n = zt(e), o = wo(e).flatMap((a) => qt(a, n));
|
|
1047
1114
|
return {
|
|
1048
|
-
...
|
|
1115
|
+
...uo(t),
|
|
1049
1116
|
scheme: n,
|
|
1050
1117
|
topNodes: o,
|
|
1051
1118
|
treeNodes: o
|
|
1052
1119
|
};
|
|
1053
1120
|
}
|
|
1054
|
-
function
|
|
1121
|
+
function Gt(t, e, n) {
|
|
1055
1122
|
return t.map((o) => o.key === e || o.tagId === e || o.id === e ? { ...o, children: n, loaded: !0 } : {
|
|
1056
1123
|
...o,
|
|
1057
|
-
children:
|
|
1124
|
+
children: Gt(o.children, e, n)
|
|
1058
1125
|
});
|
|
1059
1126
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const o =
|
|
1127
|
+
function fo(t, e = {}, n = null) {
|
|
1128
|
+
const o = Dt(t), a = zt(o, e), r = vo(o, e, n), s = Object.fromEntries(r.map((l) => [l.key, l]));
|
|
1062
1129
|
return {
|
|
1063
1130
|
scheme: a,
|
|
1064
1131
|
node: n,
|
|
@@ -1067,222 +1134,230 @@ function no(t, e = {}, n = null) {
|
|
|
1067
1134
|
activeNode: n,
|
|
1068
1135
|
activeSection: r[0] ?? null,
|
|
1069
1136
|
sections: r,
|
|
1070
|
-
sectionMap:
|
|
1137
|
+
sectionMap: s,
|
|
1071
1138
|
raw: t
|
|
1072
1139
|
};
|
|
1073
1140
|
}
|
|
1074
|
-
function
|
|
1141
|
+
function po(t) {
|
|
1075
1142
|
return t.multRow || t.htmlDisplay === "T" ? "table" : "form";
|
|
1076
1143
|
}
|
|
1077
|
-
function
|
|
1144
|
+
function mo(t, e = {}) {
|
|
1145
|
+
const n = t.renderType === "table" ? t.rows.map(rt) : [rt(t.model)], o = W(t.operationInfo), a = W(o.editInfoSet), r = W(a.params), s = W(o.queryInfoSet), l = W(s.params);
|
|
1078
1146
|
return {
|
|
1079
1147
|
...e,
|
|
1080
|
-
infSchmId: e.infSchmId ??
|
|
1081
|
-
emplid: e.emplid ??
|
|
1082
|
-
|
|
1148
|
+
infSchmId: e.infSchmId ?? Y(t.raw.infSchmId),
|
|
1149
|
+
emplid: e.emplid ?? Y(t.raw.emplid),
|
|
1150
|
+
// 保存优先使用接口出参里的信息集挂载 tagId,其次才回退到请求节点 tagId。
|
|
1151
|
+
tagId: j(
|
|
1152
|
+
t.tagId || r.tagId || l.tagId || e.tagId || t.requestTagId
|
|
1153
|
+
),
|
|
1083
1154
|
infSetId: e.infSetId ?? t.infSetId,
|
|
1084
1155
|
setId: e.setId ?? t.setId,
|
|
1085
|
-
|
|
1156
|
+
// 保存时只把当前编辑出来的业务行数据放进 infSetValues,避免把详情模板参数一并带走。
|
|
1157
|
+
infSetValues: n,
|
|
1086
1158
|
section: t
|
|
1087
1159
|
};
|
|
1088
1160
|
}
|
|
1089
|
-
function
|
|
1161
|
+
function qa(t) {
|
|
1090
1162
|
const e = t;
|
|
1091
1163
|
return !!(e && typeof e == "object" && typeof e.key == "string" && typeof e.tagId == "string");
|
|
1092
1164
|
}
|
|
1093
|
-
function
|
|
1094
|
-
const e =
|
|
1095
|
-
return (Array.isArray(e) ? e :
|
|
1096
|
-
const a =
|
|
1165
|
+
function At(t) {
|
|
1166
|
+
const e = xt(t);
|
|
1167
|
+
return (Array.isArray(e) ? e : Ae(W(e), ["options", "list", "records", "data"])).map((o) => {
|
|
1168
|
+
const a = W(o), r = a.fieldvalue ?? a.fieldValue;
|
|
1097
1169
|
return {
|
|
1098
1170
|
id: a.id,
|
|
1099
|
-
code: a.code,
|
|
1100
|
-
label:
|
|
1101
|
-
name:
|
|
1102
|
-
value: a.value ?? a.code ?? a.id ?? a.label ?? a.name,
|
|
1171
|
+
code: a.code ?? r ?? a.value ?? a.id,
|
|
1172
|
+
label: j(a.label ?? a.name ?? a.descr ?? a.descrshort ?? a.text ?? r ?? a.value ?? a.code),
|
|
1173
|
+
name: Y(a.name),
|
|
1174
|
+
value: a.value ?? r ?? a.code ?? a.id ?? a.label ?? a.name,
|
|
1103
1175
|
raw: o
|
|
1104
1176
|
};
|
|
1105
1177
|
});
|
|
1106
1178
|
}
|
|
1107
|
-
function
|
|
1108
|
-
const o =
|
|
1109
|
-
return o.length > 0 ? o.map((a) =>
|
|
1110
|
-
}
|
|
1111
|
-
function
|
|
1112
|
-
const a =
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1179
|
+
function vo(t, e, n) {
|
|
1180
|
+
const o = Ae(t, ["sections", "sets", "list"]);
|
|
1181
|
+
return o.length > 0 ? o.map((a) => vt(a, e, n, o.length === 1)) : t.infSetMark || t.infSetFields || t.fields ? [vt(t, e, n, !0)] : [];
|
|
1182
|
+
}
|
|
1183
|
+
function vt(t, e, n, o) {
|
|
1184
|
+
const a = W(t), r = go(a.infSetMark ?? a), s = yo(a.infSetFields ?? a.fields ?? []), l = bo(a.infSetValues ?? a.rows ?? a.data, s), d = l[0] ? rt(l[0]) : Kt(s), m = W(a.tag), M = j(
|
|
1185
|
+
a.tagId ?? a.infTagId ?? m.tagId ?? m.infTagId ?? r.raw.tagId ?? r.raw.infTagId
|
|
1186
|
+
), f = j(e.tagId ?? n?.tagId), y = j(n?.key), p = o ? e.infSetId ?? n?.infSetId : void 0, w = o ? e.setId : void 0, C = o ? n?.code : void 0, P = r.setId || j(a.setId), F = j(a.infSetId) || P || j(p), q = P || j(w ?? F), c = r.code || j(a.code ?? C ?? q), v = q || c || F || M, T = {
|
|
1187
|
+
key: v,
|
|
1188
|
+
id: v,
|
|
1189
|
+
setId: q,
|
|
1190
|
+
code: c,
|
|
1191
|
+
tagId: M,
|
|
1192
|
+
requestTagId: f || void 0,
|
|
1193
|
+
ownerNodeKey: y || void 0,
|
|
1194
|
+
infSetId: F,
|
|
1195
|
+
title: r.name || j(a.name ?? n?.tagName ?? v),
|
|
1196
|
+
renderType: po(r),
|
|
1123
1197
|
mark: r,
|
|
1124
|
-
fields:
|
|
1125
|
-
model:
|
|
1126
|
-
rows:
|
|
1127
|
-
operationInfo:
|
|
1198
|
+
fields: s,
|
|
1199
|
+
model: d,
|
|
1200
|
+
rows: l,
|
|
1201
|
+
operationInfo: We(e.operationInfo ?? a.operationInfo),
|
|
1128
1202
|
raw: a
|
|
1129
1203
|
};
|
|
1130
|
-
return
|
|
1204
|
+
return T.renderType === "form" && l.length === 0 && (T.rows = [{ ...d, __rowKey: `${v}-0` }]), T;
|
|
1131
1205
|
}
|
|
1132
|
-
function
|
|
1133
|
-
const e =
|
|
1206
|
+
function go(t) {
|
|
1207
|
+
const e = W(t), n = j(e.htmlDisplay || "F");
|
|
1134
1208
|
return {
|
|
1135
|
-
name:
|
|
1136
|
-
parentName:
|
|
1137
|
-
value:
|
|
1138
|
-
type:
|
|
1139
|
-
code:
|
|
1140
|
-
setId:
|
|
1209
|
+
name: j(e.name ?? e.title),
|
|
1210
|
+
parentName: Y(e.parentName),
|
|
1211
|
+
value: Y(e.value),
|
|
1212
|
+
type: Y(e.type),
|
|
1213
|
+
code: j(e.code),
|
|
1214
|
+
setId: j(e.setId ?? e.id ?? e.key),
|
|
1141
1215
|
htmlDisplay: n,
|
|
1142
|
-
multRow:
|
|
1143
|
-
isRequired:
|
|
1216
|
+
multRow: ve(e.multRow),
|
|
1217
|
+
isRequired: ve(e.isRequired),
|
|
1144
1218
|
raw: e
|
|
1145
1219
|
};
|
|
1146
1220
|
}
|
|
1147
|
-
function
|
|
1148
|
-
return (Array.isArray(t) ? t : []).map((n, o) =>
|
|
1221
|
+
function yo(t) {
|
|
1222
|
+
return (Array.isArray(t) ? t : []).map((n, o) => ho(n, o));
|
|
1149
1223
|
}
|
|
1150
|
-
function
|
|
1151
|
-
const n =
|
|
1224
|
+
function ho(t, e) {
|
|
1225
|
+
const n = W(t), o = j(n.code ?? n.fieldCode ?? n.prop ?? n.key ?? `field_${e}`), a = j(n.label ?? n.name ?? n.tagName ?? o);
|
|
1152
1226
|
return {
|
|
1153
|
-
id:
|
|
1154
|
-
key:
|
|
1227
|
+
id: j(n.id ?? n.key ?? n.prop ?? o),
|
|
1228
|
+
key: j(n.key ?? n.prop ?? o),
|
|
1155
1229
|
code: o,
|
|
1156
1230
|
label: a,
|
|
1157
1231
|
value: n.value ?? n.defaultValue ?? "",
|
|
1158
|
-
type:
|
|
1159
|
-
fieldType:
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1232
|
+
type: ko(n),
|
|
1233
|
+
fieldType: Y(n.fieldType),
|
|
1234
|
+
frontInputType: Y(n.frontInputType),
|
|
1235
|
+
renderType: Co(n),
|
|
1236
|
+
required: ve(n.required ?? n.isRequired),
|
|
1237
|
+
readonly: ve(n.readonly ?? n.disabled),
|
|
1238
|
+
visible: n.visible === void 0 ? ve(n.visibled ?? !0) : ve(n.visible),
|
|
1239
|
+
htmlDisplay: ve(n.htmlDisplay),
|
|
1240
|
+
multRow: ve(n.multRow),
|
|
1241
|
+
isRequired: ve(n.isRequired),
|
|
1242
|
+
disabled: n.disabled === void 0 ? void 0 : ve(n.disabled),
|
|
1243
|
+
span: Wt(n.span ?? n.colSpan),
|
|
1244
|
+
width: yt(n.width),
|
|
1245
|
+
minWidth: yt(n.minWidth),
|
|
1246
|
+
placeholder: Y(n.placeholder),
|
|
1247
|
+
options: At(n.options),
|
|
1248
|
+
interface: Jt(n.interface ?? n.interfaceField),
|
|
1249
|
+
cascadeClearFields: gt(n.cascadeClearFields),
|
|
1250
|
+
cascadeDependFields: gt(n.cascadeDependFields),
|
|
1251
|
+
props: $o(n),
|
|
1252
|
+
formItemProps: Ht(n.formItemProps),
|
|
1178
1253
|
raw: n
|
|
1179
1254
|
};
|
|
1180
1255
|
}
|
|
1181
|
-
function
|
|
1256
|
+
function bo(t, e) {
|
|
1182
1257
|
if (Array.isArray(t) && t.some((a) => {
|
|
1183
|
-
const r =
|
|
1184
|
-
return e.some((
|
|
1258
|
+
const r = W(a);
|
|
1259
|
+
return e.some((s) => r[s.code] !== void 0 || r[s.key] !== void 0);
|
|
1185
1260
|
}))
|
|
1186
|
-
return t.map((a, r) => ({ ...
|
|
1187
|
-
const n =
|
|
1261
|
+
return t.map((a, r) => ({ ...W(a), __rowKey: j(W(a).__rowKey ?? W(a).key ?? r) }));
|
|
1262
|
+
const n = Kt(e);
|
|
1188
1263
|
return Object.keys(n).length ? [{ ...n, __rowKey: "0" }] : [];
|
|
1189
1264
|
}
|
|
1190
|
-
function
|
|
1265
|
+
function Kt(t) {
|
|
1191
1266
|
return t.reduce((e, n) => (e[n.code || n.key] = n.value, e), {});
|
|
1192
1267
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const o =
|
|
1195
|
-
return a.length === 0 && r.length > 0 ? r.map((
|
|
1268
|
+
function qt(t, e, n = "") {
|
|
1269
|
+
const o = W(t), a = Ae(o, ["children", "list", "tags"]).flatMap((s) => qt(s, e, j(o.tagId ?? o.id ?? o.key))), r = _o(o.infSetList);
|
|
1270
|
+
return a.length === 0 && r.length > 0 ? r.map((s, l) => Io(o, s, e, n, l)) : [So(o, e, n, a)];
|
|
1196
1271
|
}
|
|
1197
|
-
function
|
|
1198
|
-
const a =
|
|
1272
|
+
function So(t, e, n, o) {
|
|
1273
|
+
const a = j(t.tagId ?? t.id ?? t.key), r = j(t.tagName ?? t.name ?? t.label ?? a);
|
|
1199
1274
|
return {
|
|
1200
|
-
key:
|
|
1275
|
+
key: j(t.key ?? a),
|
|
1201
1276
|
id: a,
|
|
1202
1277
|
tagId: a,
|
|
1203
1278
|
tagName: r,
|
|
1204
1279
|
label: r,
|
|
1205
|
-
tagLevel:
|
|
1206
|
-
level:
|
|
1207
|
-
parentTagId:
|
|
1208
|
-
parentId:
|
|
1209
|
-
infSchmId:
|
|
1210
|
-
schemeId:
|
|
1211
|
-
infSetId:
|
|
1212
|
-
setId:
|
|
1213
|
-
code:
|
|
1280
|
+
tagLevel: Y(t.tagLevel ?? t.level) ?? null,
|
|
1281
|
+
level: Ut(t.tagLevel ?? t.level),
|
|
1282
|
+
parentTagId: Y(t.parentTagId ?? t.parentId ?? n),
|
|
1283
|
+
parentId: Y(t.parentTagId ?? t.parentId ?? n) ?? null,
|
|
1284
|
+
infSchmId: Y(t.infSchmId ?? e?.infSchmId),
|
|
1285
|
+
schemeId: j(t.infSchmId ?? e?.infSchmId),
|
|
1286
|
+
infSetId: Y(t.infSetId ?? t.setId),
|
|
1287
|
+
setId: Y(t.setId),
|
|
1288
|
+
code: Y(t.code),
|
|
1214
1289
|
children: o,
|
|
1215
1290
|
infSetList: [],
|
|
1216
|
-
operationInfo:
|
|
1291
|
+
operationInfo: We(t.operationInfo),
|
|
1217
1292
|
loaded: o.length > 0,
|
|
1218
1293
|
raw: t
|
|
1219
1294
|
};
|
|
1220
1295
|
}
|
|
1221
|
-
function
|
|
1222
|
-
const r =
|
|
1296
|
+
function Io(t, e, n, o, a) {
|
|
1297
|
+
const r = j(t.tagId ?? t.id ?? t.key), s = j(t.tagName ?? t.name ?? t.label ?? r), l = e.infSetId || j(e.setId), d = e.setId || l, m = l || `${r}-${a}`;
|
|
1223
1298
|
return {
|
|
1224
|
-
key:
|
|
1225
|
-
id:
|
|
1299
|
+
key: m,
|
|
1300
|
+
id: m,
|
|
1226
1301
|
tagId: r,
|
|
1227
|
-
tagName:
|
|
1228
|
-
label:
|
|
1229
|
-
tagLevel:
|
|
1230
|
-
level:
|
|
1231
|
-
parentTagId:
|
|
1232
|
-
parentId:
|
|
1233
|
-
infSchmId:
|
|
1234
|
-
schemeId:
|
|
1235
|
-
infSetId:
|
|
1236
|
-
setId:
|
|
1237
|
-
code:
|
|
1302
|
+
tagName: s,
|
|
1303
|
+
label: s,
|
|
1304
|
+
tagLevel: Y(t.tagLevel ?? t.level) ?? null,
|
|
1305
|
+
level: Ut(t.tagLevel ?? t.level),
|
|
1306
|
+
parentTagId: Y(t.parentTagId ?? t.parentId ?? o),
|
|
1307
|
+
parentId: Y(t.parentTagId ?? t.parentId ?? o) ?? null,
|
|
1308
|
+
infSchmId: Y(t.infSchmId ?? n?.infSchmId),
|
|
1309
|
+
schemeId: j(t.infSchmId ?? n?.infSchmId),
|
|
1310
|
+
infSetId: l,
|
|
1311
|
+
setId: d,
|
|
1312
|
+
code: Y(t.code ?? l),
|
|
1238
1313
|
children: [],
|
|
1239
1314
|
infSetList: [e],
|
|
1240
|
-
operationInfo:
|
|
1315
|
+
operationInfo: We(t.operationInfo),
|
|
1241
1316
|
loaded: !0,
|
|
1242
1317
|
raw: {
|
|
1243
1318
|
...t,
|
|
1244
|
-
infSetId:
|
|
1245
|
-
setId:
|
|
1319
|
+
infSetId: l,
|
|
1320
|
+
setId: d,
|
|
1246
1321
|
infSetList: [e.raw]
|
|
1247
1322
|
}
|
|
1248
1323
|
};
|
|
1249
1324
|
}
|
|
1250
|
-
function
|
|
1251
|
-
const n =
|
|
1325
|
+
function zt(t, e = {}) {
|
|
1326
|
+
const n = W(t.globalInfoSchmMark ?? t.scheme ?? t), o = j(n.infSchmId ?? e.infSchmId), a = j(n.emplid ?? e.emplid);
|
|
1252
1327
|
return !o && !a && Object.keys(n).length === 0 ? null : {
|
|
1253
1328
|
infSchmId: o,
|
|
1254
1329
|
emplid: a,
|
|
1255
1330
|
id: o,
|
|
1256
|
-
mark:
|
|
1257
|
-
config: Array.isArray(t.globalInfoSchmConfig) ? "" :
|
|
1331
|
+
mark: j(n.globalInfoSchmMark ?? t.globalInfoSchmMark),
|
|
1332
|
+
config: Array.isArray(t.globalInfoSchmConfig) ? "" : j(n.globalInfoSchmConfig ?? t.globalInfoSchmConfig),
|
|
1258
1333
|
raw: n
|
|
1259
1334
|
};
|
|
1260
1335
|
}
|
|
1261
|
-
function
|
|
1336
|
+
function wo(t) {
|
|
1262
1337
|
if (Array.isArray(t.globalInfoSchmConfig))
|
|
1263
1338
|
return t.globalInfoSchmConfig;
|
|
1264
|
-
const e =
|
|
1265
|
-
return n.length ? n :
|
|
1339
|
+
const e = W(t.globalInfoSchmConfig), n = Ae(e, ["children", "tree", "list", "tags"]);
|
|
1340
|
+
return n.length ? n : Ae(t, ["children", "tree", "list", "tags", "records"]);
|
|
1266
1341
|
}
|
|
1267
|
-
function
|
|
1342
|
+
function _o(t) {
|
|
1268
1343
|
return Array.isArray(t) ? t.map((e) => {
|
|
1269
|
-
const n =
|
|
1344
|
+
const n = W(e);
|
|
1270
1345
|
return {
|
|
1271
|
-
infSetId:
|
|
1272
|
-
setId:
|
|
1273
|
-
operationInfo:
|
|
1346
|
+
infSetId: j(n.infSetId ?? n.setId ?? n.id),
|
|
1347
|
+
setId: Y(n.setId),
|
|
1348
|
+
operationInfo: We(n.operationInfo),
|
|
1274
1349
|
raw: n
|
|
1275
1350
|
};
|
|
1276
1351
|
}) : [];
|
|
1277
1352
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return
|
|
1353
|
+
function Dt(t) {
|
|
1354
|
+
return W(xt(t));
|
|
1280
1355
|
}
|
|
1281
|
-
function
|
|
1282
|
-
const e =
|
|
1356
|
+
function xt(t) {
|
|
1357
|
+
const e = W(t);
|
|
1283
1358
|
return e.data ?? e.result ?? t;
|
|
1284
1359
|
}
|
|
1285
|
-
function
|
|
1360
|
+
function Ae(t, e) {
|
|
1286
1361
|
for (const n of e) {
|
|
1287
1362
|
const o = t[n];
|
|
1288
1363
|
if (Array.isArray(o))
|
|
@@ -1290,75 +1365,78 @@ function je(t, e) {
|
|
|
1290
1365
|
}
|
|
1291
1366
|
return [];
|
|
1292
1367
|
}
|
|
1293
|
-
function
|
|
1368
|
+
function rt(t) {
|
|
1294
1369
|
const e = { ...t };
|
|
1295
1370
|
return delete e.__rowKey, delete e.fields, e;
|
|
1296
1371
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const e =
|
|
1372
|
+
function Jt(t) {
|
|
1373
|
+
const e = W(t);
|
|
1299
1374
|
if (!(!e.method && !e.url && !e.params))
|
|
1300
1375
|
return {
|
|
1301
1376
|
...e,
|
|
1302
|
-
method:
|
|
1303
|
-
url:
|
|
1304
|
-
params:
|
|
1377
|
+
method: Y(e.method),
|
|
1378
|
+
url: Y(e.url),
|
|
1379
|
+
params: Ht(e.params)
|
|
1305
1380
|
};
|
|
1306
1381
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const e =
|
|
1382
|
+
function We(t) {
|
|
1383
|
+
const e = W(t);
|
|
1309
1384
|
if (Object.keys(e).length !== 0)
|
|
1310
1385
|
return Object.fromEntries(
|
|
1311
|
-
Object.entries(e).map(([n, o]) => [n,
|
|
1386
|
+
Object.entries(e).map(([n, o]) => [n, Jt(o) ?? o])
|
|
1312
1387
|
);
|
|
1313
1388
|
}
|
|
1314
|
-
function
|
|
1389
|
+
function gt(t) {
|
|
1315
1390
|
if (!Array.isArray(t))
|
|
1316
1391
|
return;
|
|
1317
|
-
const e = t.map((n) =>
|
|
1392
|
+
const e = t.map((n) => j(n)).filter(Boolean);
|
|
1318
1393
|
return e.length ? e : void 0;
|
|
1319
1394
|
}
|
|
1320
|
-
function
|
|
1321
|
-
if (
|
|
1322
|
-
if (
|
|
1323
|
-
const e =
|
|
1395
|
+
function Co(t) {
|
|
1396
|
+
if (ve(t.htmlDisplay)) return "html";
|
|
1397
|
+
if (ve(t.multRow)) return "multi-row";
|
|
1398
|
+
const e = j(t.renderType).toLowerCase();
|
|
1324
1399
|
return e === "code" || e === "empty" ? e : "text";
|
|
1325
1400
|
}
|
|
1326
|
-
function
|
|
1327
|
-
const e =
|
|
1328
|
-
return e.includes("date") ? "date" : e.includes("select") || e.includes("enum") ? "select" : e.includes("number") || e.includes("int") ? "number" : e.includes("bool") || e.includes("switch") ? "switch" : e.includes("file") || e.includes("upload") || e.includes("attachment") ? "file" : e.includes("textarea") || e.includes("text_area") ? "textarea" : "text";
|
|
1401
|
+
function ko(t) {
|
|
1402
|
+
const e = j(t.fieldType ?? t.type ?? t.frontInputType ?? t.renderType).toLowerCase();
|
|
1403
|
+
return e.includes("date") ? "date" : e.includes("select") || e.includes("enum") || e.includes("radio") || e.includes("checkbox") ? "select" : e.includes("number") || e.includes("int") ? "number" : e.includes("bool") || e.includes("switch") ? "switch" : e.includes("file") || e.includes("upload") || e.includes("attachment") ? "file" : e.includes("textarea") || e.includes("text_area") ? "textarea" : "text";
|
|
1329
1404
|
}
|
|
1330
|
-
function
|
|
1331
|
-
const e =
|
|
1405
|
+
function Ht(t) {
|
|
1406
|
+
const e = W(t);
|
|
1332
1407
|
return Object.keys(e).length ? e : void 0;
|
|
1333
1408
|
}
|
|
1334
|
-
function
|
|
1409
|
+
function $o(t) {
|
|
1410
|
+
const e = {
|
|
1411
|
+
...W(t.props)
|
|
1412
|
+
};
|
|
1413
|
+
return t.multiple !== void 0 && (e.multiple = ve(t.multiple)), Object.keys(e).length ? e : void 0;
|
|
1414
|
+
}
|
|
1415
|
+
function yt(t) {
|
|
1335
1416
|
return typeof t == "string" || typeof t == "number" ? t : void 0;
|
|
1336
1417
|
}
|
|
1337
|
-
function
|
|
1418
|
+
function W(t) {
|
|
1338
1419
|
return t && typeof t == "object" && !Array.isArray(t) ? t : {};
|
|
1339
1420
|
}
|
|
1340
|
-
function
|
|
1421
|
+
function j(t) {
|
|
1341
1422
|
return t == null ? "" : String(t).trim();
|
|
1342
1423
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return
|
|
1424
|
+
function Y(t) {
|
|
1425
|
+
return j(t) || void 0;
|
|
1345
1426
|
}
|
|
1346
|
-
function
|
|
1347
|
-
const e =
|
|
1427
|
+
function Ut(t) {
|
|
1428
|
+
const e = Wt(t);
|
|
1348
1429
|
return e === void 0 ? null : e;
|
|
1349
1430
|
}
|
|
1350
|
-
function
|
|
1431
|
+
function Wt(t) {
|
|
1351
1432
|
if (t == null || t === "") return;
|
|
1352
1433
|
const e = Number(t);
|
|
1353
1434
|
return Number.isFinite(e) ? e : void 0;
|
|
1354
1435
|
}
|
|
1355
|
-
function
|
|
1436
|
+
function ve(t) {
|
|
1356
1437
|
return typeof t == "string" ? ["true", "1", "y", "yes", "t", "是"].includes(t.toLowerCase()) : !!t;
|
|
1357
1438
|
}
|
|
1358
|
-
const
|
|
1359
|
-
const e = Be(t);
|
|
1360
|
-
return !!(e.url || e.method || e.params);
|
|
1361
|
-
}, ho = (t) => String(t ?? "").trim(), Ge = (t) => Array.from(new Set(t.map(ho).filter(Boolean))), Le = (t) => Ge([
|
|
1439
|
+
const Fe = (t) => t.key || t.code, ye = (t) => t.key || t.setId, To = (t) => String(t ?? "").trim(), ze = (t) => Array.from(new Set(t.map(To).filter(Boolean))), Ne = (t) => !!(t && typeof t == "object" && "children" in t), Ke = (t) => ze([
|
|
1362
1440
|
t?.key,
|
|
1363
1441
|
t?.id,
|
|
1364
1442
|
t?.setId,
|
|
@@ -1367,36 +1445,156 @@ const be = (t) => t.key || t.code, ie = (t) => t.key || t.setId, Te = (t) => new
|
|
|
1367
1445
|
t?.code,
|
|
1368
1446
|
...(t?.infSetList ?? []).map((e) => e.infSetId),
|
|
1369
1447
|
...(t?.infSetList ?? []).map((e) => e.setId)
|
|
1370
|
-
]),
|
|
1448
|
+
]), Bo = (t) => ze([
|
|
1371
1449
|
t.key,
|
|
1372
1450
|
t.id,
|
|
1373
1451
|
t.setId,
|
|
1374
1452
|
t.infSetId,
|
|
1375
1453
|
t.tagId,
|
|
1376
1454
|
t.code
|
|
1377
|
-
])
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
// saving:当前 section 是否正在保存。
|
|
1381
|
-
saving: !1,
|
|
1382
|
-
// error:当前 section 最近一次加载/保存错误。
|
|
1383
|
-
error: null,
|
|
1384
|
-
// loaded:当前 section 是否已经成功完成过详情加载。
|
|
1385
|
-
loaded: !1,
|
|
1386
|
-
// editing:当前 section 是否处于编辑态。
|
|
1387
|
-
editing: !1,
|
|
1388
|
-
// status 覆盖默认值,用于局部状态补丁。
|
|
1389
|
-
...t
|
|
1390
|
-
}), Ne = (t) => !!(t && typeof t == "object" && "children" in t), At = (t, e, n) => {
|
|
1391
|
-
const o = yo(t), a = Ge([n, ...Le(e)]);
|
|
1455
|
+
]);
|
|
1456
|
+
function Zt(t, e, n) {
|
|
1457
|
+
const o = Bo(t), a = ze([n, ...Ke(e)]);
|
|
1392
1458
|
return a.length === 0 ? !1 : a.some((r) => o.includes(r));
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1459
|
+
}
|
|
1460
|
+
function Fo(t, e, n) {
|
|
1461
|
+
return ze([n, ...Ke(e)]).length === 0 ? t : t.filter((a) => Zt(a, e, n));
|
|
1462
|
+
}
|
|
1463
|
+
function Eo(t, e, n = {}) {
|
|
1464
|
+
const o = Object.keys(n).length > 0 ? n : t.model, a = typeof e == "string" ? e : Fe(e), r = typeof e == "string" ? t.fields.find((l) => Fe(l) === a || l.code === a) : e, s = (r?.cascadeDependFields ?? []).some((l) => {
|
|
1465
|
+
const d = o[l];
|
|
1466
|
+
return d == null || d === "";
|
|
1467
|
+
});
|
|
1468
|
+
return {
|
|
1469
|
+
fieldKey: a,
|
|
1470
|
+
currentField: r,
|
|
1471
|
+
sourceModel: o,
|
|
1472
|
+
sourceRow: t.renderType === "table" ? o : void 0,
|
|
1473
|
+
missingDependField: s
|
|
1474
|
+
};
|
|
1475
|
+
}
|
|
1476
|
+
function Mo(t) {
|
|
1477
|
+
return !!(t && (t.cascadeDependFields ?? []).length === 0 && (t.options ?? []).length > 0);
|
|
1478
|
+
}
|
|
1479
|
+
function Vo(t) {
|
|
1480
|
+
return At(t);
|
|
1481
|
+
}
|
|
1482
|
+
const we = (t) => t && typeof t == "object" && !Array.isArray(t) ? t : {}, Je = (t) => {
|
|
1483
|
+
const e = we(t);
|
|
1484
|
+
return !!(e.url || e.method || e.params);
|
|
1485
|
+
};
|
|
1486
|
+
function Po(t) {
|
|
1487
|
+
const e = we(t.operationInfo).openTag;
|
|
1488
|
+
return Je(e) ? e : void 0;
|
|
1489
|
+
}
|
|
1490
|
+
function Lo(t, e, n) {
|
|
1491
|
+
const o = we(t?.operationInfo).queryInfoSet;
|
|
1492
|
+
if (Je(o))
|
|
1493
|
+
return o;
|
|
1494
|
+
const a = e?.infSetList.find((s) => s.infSetId === n), r = we(a?.operationInfo).queryInfoSet;
|
|
1495
|
+
return Je(r) ? r : void 0;
|
|
1496
|
+
}
|
|
1497
|
+
function No(t) {
|
|
1498
|
+
const e = we(t.operationInfo).editInfoSet;
|
|
1499
|
+
return Je(e) ? e : void 0;
|
|
1500
|
+
}
|
|
1501
|
+
async function Oo(t) {
|
|
1502
|
+
const e = t.params === void 0 ? void 0 : we(t.params);
|
|
1503
|
+
return !t.formatter || t.requestSource !== "inner" ? e : t.formatter({
|
|
1504
|
+
operation: t.operation,
|
|
1505
|
+
interfaceOperation: t.field?.interface,
|
|
1506
|
+
type: t.type,
|
|
1507
|
+
requestSource: t.requestSource,
|
|
1508
|
+
tagId: t.tagId,
|
|
1509
|
+
model: {
|
|
1510
|
+
...we(t.section?.model),
|
|
1511
|
+
...we(t.model)
|
|
1512
|
+
},
|
|
1513
|
+
row: t.row,
|
|
1514
|
+
section: t.section,
|
|
1515
|
+
field: t.field,
|
|
1516
|
+
node: t.node,
|
|
1517
|
+
viewModel: t.viewModel,
|
|
1518
|
+
sections: t.sections,
|
|
1519
|
+
activeNode: t.activeNode,
|
|
1520
|
+
activeSection: t.activeSection,
|
|
1521
|
+
params: e
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
async function Ro(t) {
|
|
1525
|
+
if (!t.service.requestOperation)
|
|
1526
|
+
throw new Error("[GlobalInfo] service.requestOperation is required for operationInfo");
|
|
1527
|
+
const e = t.operation.params === void 0 ? void 0 : we(t.operation.params), n = t.context?.params === void 0 ? e : we(t.context.params), o = await Oo({
|
|
1528
|
+
formatter: t.formatter,
|
|
1529
|
+
params: n,
|
|
1530
|
+
operation: t.operation,
|
|
1531
|
+
type: t.context?.type,
|
|
1532
|
+
requestSource: t.context?.requestSource,
|
|
1533
|
+
tagId: t.context?.tagId,
|
|
1534
|
+
section: t.context?.section,
|
|
1535
|
+
field: t.context?.field,
|
|
1536
|
+
model: t.context?.model,
|
|
1537
|
+
row: t.context?.row,
|
|
1538
|
+
node: t.context?.node,
|
|
1539
|
+
viewModel: t.viewModel,
|
|
1540
|
+
sections: t.sections,
|
|
1541
|
+
activeNode: t.activeNode,
|
|
1542
|
+
activeSection: t.activeSection
|
|
1543
|
+
});
|
|
1544
|
+
return t.service.requestOperation(
|
|
1545
|
+
{ ...t.operation, params: o },
|
|
1546
|
+
t.context ? { ...t.context, params: o } : t.context
|
|
1547
|
+
);
|
|
1548
|
+
}
|
|
1549
|
+
function je(t = {}) {
|
|
1550
|
+
return {
|
|
1551
|
+
// loading:当前 section 是否正在拉详情。
|
|
1552
|
+
loading: !1,
|
|
1553
|
+
// saving:当前 section 是否正在保存。
|
|
1554
|
+
saving: !1,
|
|
1555
|
+
// error:当前 section 最近一次加载或保存错误。
|
|
1556
|
+
error: null,
|
|
1557
|
+
// loaded:当前 section 是否已经成功完成过详情加载。
|
|
1558
|
+
loaded: !1,
|
|
1559
|
+
// editing:当前 section 是否处于编辑态。
|
|
1560
|
+
editing: !1,
|
|
1561
|
+
// status 覆盖默认值,用于局部状态补丁。
|
|
1562
|
+
...t
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
function jo(t) {
|
|
1566
|
+
const e = { ...t.currentMap }, n = { ...t.currentAliasMap }, o = [...t.currentOrder], a = { ...t.currentStatusMap }, r = Fo(t.nextViewModel.sections, t.node, t.targetKey), s = ze([t.targetKey, ...Ke(t.node)]).length > 0, l = r.find((d) => Zt(d, t.node, t.targetKey)) ?? (s ? null : t.nextViewModel.activeSection ?? r[0] ?? t.activeSection ?? null);
|
|
1567
|
+
return r.forEach((d) => {
|
|
1568
|
+
const m = ye(d);
|
|
1569
|
+
e[m] = d, o.includes(m) || o.push(m), a[m] = je({
|
|
1570
|
+
...a[m],
|
|
1571
|
+
loaded: !0,
|
|
1572
|
+
loading: !1,
|
|
1573
|
+
error: null,
|
|
1574
|
+
editing: t.editingSectionKeys.includes(m)
|
|
1575
|
+
});
|
|
1576
|
+
}), t.targetKey && l ? n[t.targetKey] = ye(l) : t.targetKey && (n[t.targetKey] = ""), t.targetKey && (a[t.targetKey] = je({
|
|
1577
|
+
...a[t.targetKey],
|
|
1578
|
+
loaded: !0,
|
|
1579
|
+
loading: !1,
|
|
1580
|
+
error: null,
|
|
1581
|
+
editing: !!(l && t.editingSectionKeys.includes(ye(l)))
|
|
1582
|
+
})), {
|
|
1583
|
+
sectionMap: e,
|
|
1584
|
+
sectionAliasMap: n,
|
|
1585
|
+
sectionOrder: o,
|
|
1586
|
+
sectionStatusMap: a,
|
|
1587
|
+
matchedSection: l,
|
|
1588
|
+
targetSections: r
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
const Oe = (t) => new Error(`[GlobalInfo] ${t}`), Go = (t) => {
|
|
1592
|
+
const e = le(!1), n = le(!1), o = le(!1), a = Be(null), r = Be([]), s = Be(null), l = Be(null), d = Be(null), m = Be({}), M = Be({}), f = le([]), y = Be({}), p = le([]), w = I(
|
|
1395
1593
|
() => {
|
|
1396
|
-
const
|
|
1397
|
-
return [...
|
|
1594
|
+
const i = f.value.map((g) => m.value[g]).filter((g) => !!g), u = Object.entries(m.value).filter(([g]) => !f.value.includes(g)).map(([, g]) => g);
|
|
1595
|
+
return [...i, ...u];
|
|
1398
1596
|
}
|
|
1399
|
-
),
|
|
1597
|
+
), C = I(() => ({
|
|
1400
1598
|
// 整棵树是否正在加载。
|
|
1401
1599
|
loading: e.value,
|
|
1402
1600
|
// 当前详情是否正在加载。
|
|
@@ -1404,499 +1602,491 @@ const be = (t) => t.key || t.code, ie = (t) => t.key || t.setId, Te = (t) => new
|
|
|
1404
1602
|
// 当前是否正在保存。
|
|
1405
1603
|
saving: o.value,
|
|
1406
1604
|
// 当前所有编辑中的 section key。
|
|
1407
|
-
editingSectionKeys:
|
|
1605
|
+
editingSectionKeys: p.value,
|
|
1408
1606
|
// 已加载 section 映射。
|
|
1409
|
-
sectionMap:
|
|
1607
|
+
sectionMap: m.value,
|
|
1410
1608
|
// section 状态映射;这里把 alias 后的编辑态也同步进去。
|
|
1411
1609
|
sectionStatusMap: Object.fromEntries(
|
|
1412
|
-
Object.entries(
|
|
1413
|
-
|
|
1610
|
+
Object.entries(y.value).map(([i, u]) => [
|
|
1611
|
+
i,
|
|
1414
1612
|
{
|
|
1415
1613
|
// 保留原状态字段。
|
|
1416
|
-
...
|
|
1614
|
+
...u,
|
|
1417
1615
|
// 编辑态以 editingSectionKeys 为准,避免状态对象里 editing 值残留。
|
|
1418
|
-
editing:
|
|
1419
|
-
|
|
1616
|
+
editing: p.value.includes(
|
|
1617
|
+
M.value[i] ?? i
|
|
1420
1618
|
)
|
|
1421
1619
|
}
|
|
1422
1620
|
])
|
|
1423
1621
|
),
|
|
1424
1622
|
// 最近一次全局错误。
|
|
1425
1623
|
error: a.value
|
|
1426
|
-
})),
|
|
1624
|
+
})), P = () => ({
|
|
1427
1625
|
// adaptScene 透传给新接口形态。
|
|
1428
1626
|
adaptScene: t.adaptScene,
|
|
1429
1627
|
// emplid 是当前人员标识,树和详情接口都需要它。
|
|
1430
1628
|
emplid: t.emplid
|
|
1431
|
-
}),
|
|
1629
|
+
}), F = (i) => ({
|
|
1432
1630
|
// 复用基础参数,保证人员和场景一致。
|
|
1433
|
-
...
|
|
1631
|
+
...P(),
|
|
1434
1632
|
// infSchmId 指定当前模板方案。
|
|
1435
|
-
infSchmId:
|
|
1633
|
+
infSchmId: i.infSchmId,
|
|
1436
1634
|
// tagId 指定要展开的树节点。
|
|
1437
|
-
tagId:
|
|
1635
|
+
tagId: i.tagId,
|
|
1438
1636
|
// tagLevel 告诉后端当前节点层级。
|
|
1439
|
-
tagLevel:
|
|
1637
|
+
tagLevel: i.tagLevel,
|
|
1440
1638
|
// parentTagId 保留父子关系上下文。
|
|
1441
|
-
parentTagId:
|
|
1442
|
-
}),
|
|
1639
|
+
parentTagId: i.parentTagId
|
|
1640
|
+
}), q = (i = l.value, u = d.value) => ({
|
|
1443
1641
|
// 详情接口同样需要基础人员和场景参数。
|
|
1444
|
-
...
|
|
1642
|
+
...P(),
|
|
1445
1643
|
// 当前节点所属模板方案。
|
|
1446
|
-
infSchmId:
|
|
1644
|
+
infSchmId: i?.infSchmId,
|
|
1447
1645
|
// 当前点击或加载的树节点 id。
|
|
1448
|
-
tagId:
|
|
1646
|
+
tagId: i?.tagId,
|
|
1449
1647
|
// 保存或刷新指定 section 时优先使用 section 自己的信息集 id。
|
|
1450
|
-
infSetId:
|
|
1648
|
+
infSetId: u?.infSetId ?? i?.infSetId,
|
|
1451
1649
|
// setId 同样优先取 section,避免保存时拿错节点 setId。
|
|
1452
|
-
setId:
|
|
1453
|
-
}),
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
return
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
const f = Be(s.operationInfo).openTag;
|
|
1472
|
-
return Ae(f) ? f : void 0;
|
|
1473
|
-
}, w = (s, l, f) => {
|
|
1474
|
-
const T = Be(s?.operationInfo).queryInfoSet;
|
|
1475
|
-
if (Ae(T))
|
|
1476
|
-
return T;
|
|
1477
|
-
const F = l?.infSetList.find((O) => O.infSetId === f), z = Be(F?.operationInfo).queryInfoSet;
|
|
1478
|
-
return Ae(z) ? z : void 0;
|
|
1479
|
-
}, S = (s) => {
|
|
1480
|
-
const l = Be(s.operationInfo).editInfoSet;
|
|
1481
|
-
return Ae(l) ? l : void 0;
|
|
1482
|
-
}, P = (s, l) => {
|
|
1483
|
-
if (!l)
|
|
1484
|
-
return s[0] ?? null;
|
|
1485
|
-
for (const f of s) {
|
|
1486
|
-
if (Le(f).includes(l))
|
|
1487
|
-
return f;
|
|
1488
|
-
const T = P(f.children, l);
|
|
1489
|
-
if (T)
|
|
1490
|
-
return T;
|
|
1650
|
+
setId: u?.setId ?? i?.setId
|
|
1651
|
+
}), c = async (i, u) => Ro({
|
|
1652
|
+
service: t.service,
|
|
1653
|
+
formatter: t.formatOperationParams,
|
|
1654
|
+
operation: i,
|
|
1655
|
+
context: u,
|
|
1656
|
+
viewModel: s.value,
|
|
1657
|
+
sections: w.value,
|
|
1658
|
+
activeNode: l.value,
|
|
1659
|
+
activeSection: d.value
|
|
1660
|
+
}), v = (i, u) => {
|
|
1661
|
+
if (!u)
|
|
1662
|
+
return i[0] ?? null;
|
|
1663
|
+
for (const g of i) {
|
|
1664
|
+
if (Ke(g).includes(u))
|
|
1665
|
+
return g;
|
|
1666
|
+
const E = v(g.children, u);
|
|
1667
|
+
if (E)
|
|
1668
|
+
return E;
|
|
1491
1669
|
}
|
|
1492
1670
|
return null;
|
|
1493
|
-
},
|
|
1494
|
-
if (
|
|
1495
|
-
return typeof
|
|
1496
|
-
},
|
|
1497
|
-
const
|
|
1498
|
-
if (!
|
|
1671
|
+
}, T = (i = d.value) => {
|
|
1672
|
+
if (i)
|
|
1673
|
+
return typeof i == "string" ? i : Ne(i) ? k(i) : ye(i);
|
|
1674
|
+
}, S = (i = d.value) => {
|
|
1675
|
+
const u = T(i);
|
|
1676
|
+
if (!u)
|
|
1499
1677
|
return null;
|
|
1500
|
-
const
|
|
1501
|
-
return
|
|
1502
|
-
},
|
|
1503
|
-
const
|
|
1504
|
-
if (
|
|
1505
|
-
return
|
|
1506
|
-
},
|
|
1507
|
-
if (
|
|
1508
|
-
return typeof
|
|
1509
|
-
},
|
|
1510
|
-
if (Ne(
|
|
1511
|
-
return
|
|
1512
|
-
if (typeof
|
|
1513
|
-
const
|
|
1514
|
-
if (
|
|
1515
|
-
return
|
|
1516
|
-
const
|
|
1517
|
-
return
|
|
1518
|
-
}
|
|
1519
|
-
return
|
|
1520
|
-
},
|
|
1521
|
-
const
|
|
1522
|
-
if (!
|
|
1523
|
-
return
|
|
1524
|
-
const
|
|
1525
|
-
return
|
|
1526
|
-
...
|
|
1527
|
-
...
|
|
1678
|
+
const g = M.value[u] ?? u;
|
|
1679
|
+
return m.value[g] ?? null;
|
|
1680
|
+
}, B = (i = d.value) => {
|
|
1681
|
+
const u = T(i);
|
|
1682
|
+
if (u)
|
|
1683
|
+
return M.value[u] ?? u;
|
|
1684
|
+
}, k = (i = d.value) => {
|
|
1685
|
+
if (i)
|
|
1686
|
+
return typeof i == "string" ? i : Ne(i) ? i.setId ?? i.infSetId ?? i.key : ye(i);
|
|
1687
|
+
}, _ = (i = d.value) => {
|
|
1688
|
+
if (Ne(i))
|
|
1689
|
+
return i;
|
|
1690
|
+
if (typeof i == "string") {
|
|
1691
|
+
const u = v(r.value, i);
|
|
1692
|
+
if (u)
|
|
1693
|
+
return u;
|
|
1694
|
+
const g = S(i);
|
|
1695
|
+
return g?.ownerNodeKey ? v(r.value, g.ownerNodeKey) ?? l.value : g || l.value && Ke(l.value).includes(i) ? l.value : null;
|
|
1696
|
+
}
|
|
1697
|
+
return i?.ownerNodeKey ? v(r.value, i.ownerNodeKey) ?? l.value : l.value;
|
|
1698
|
+
}, U = (i = d.value) => !i || Ne(i) ? null : S(i), me = (i = d.value) => {
|
|
1699
|
+
const u = k(i);
|
|
1700
|
+
if (!u)
|
|
1701
|
+
return je();
|
|
1702
|
+
const g = M.value[u] ?? u;
|
|
1703
|
+
return je({
|
|
1704
|
+
...y.value[u],
|
|
1705
|
+
...y.value[g],
|
|
1528
1706
|
// 编辑态始终从 editingSectionKeys 计算,避免状态对象过期。
|
|
1529
|
-
editing:
|
|
1530
|
-
|
|
1707
|
+
editing: p.value.includes(
|
|
1708
|
+
g
|
|
1531
1709
|
)
|
|
1532
1710
|
});
|
|
1533
|
-
},
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1536
|
-
...
|
|
1537
|
-
[
|
|
1711
|
+
}, Q = (i, u) => {
|
|
1712
|
+
const g = k(i);
|
|
1713
|
+
g && (y.value = {
|
|
1714
|
+
...y.value,
|
|
1715
|
+
[g]: je({
|
|
1538
1716
|
// 保留已有状态。
|
|
1539
|
-
...
|
|
1717
|
+
...y.value[g],
|
|
1540
1718
|
// 合并本次状态补丁。
|
|
1541
|
-
...
|
|
1719
|
+
...u,
|
|
1542
1720
|
// 编辑态仍以 editingSectionKeys 为准。
|
|
1543
|
-
editing:
|
|
1721
|
+
editing: p.value.includes(g)
|
|
1544
1722
|
})
|
|
1545
1723
|
});
|
|
1546
|
-
},
|
|
1547
|
-
const
|
|
1548
|
-
(
|
|
1549
|
-
) ?
|
|
1550
|
-
|
|
1724
|
+
}, ge = (i = s.value?.raw ?? null, u = l.value) => {
|
|
1725
|
+
const g = w.value, E = d.value && g.find(
|
|
1726
|
+
(R) => ye(R) === ye(d.value)
|
|
1727
|
+
) ? d.value : null;
|
|
1728
|
+
s.value = {
|
|
1551
1729
|
// 保留原 scheme。
|
|
1552
|
-
scheme:
|
|
1730
|
+
scheme: s.value?.scheme ?? null,
|
|
1553
1731
|
// 当前节点。
|
|
1554
|
-
node:
|
|
1732
|
+
node: u,
|
|
1555
1733
|
// 顶层节点和树节点都来自 nodes。
|
|
1556
1734
|
topNodes: r.value,
|
|
1557
1735
|
treeNodes: r.value,
|
|
1558
1736
|
// 当前激活节点。
|
|
1559
|
-
activeNode:
|
|
1737
|
+
activeNode: u,
|
|
1560
1738
|
// 当前激活 section。
|
|
1561
|
-
activeSection:
|
|
1739
|
+
activeSection: E,
|
|
1562
1740
|
// 当前所有已加载 section。
|
|
1563
|
-
sections:
|
|
1741
|
+
sections: g,
|
|
1564
1742
|
// 当前 section 缓存。
|
|
1565
|
-
sectionMap:
|
|
1743
|
+
sectionMap: m.value,
|
|
1566
1744
|
// 保留原始接口数据。
|
|
1567
|
-
raw:
|
|
1568
|
-
},
|
|
1569
|
-
},
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
})
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
error: null,
|
|
1585
|
-
editing: !!(te && c.value.includes(ie(te)))
|
|
1586
|
-
})), b.value = T, E.value = F, m.value = z, d.value = O, v.value = {
|
|
1587
|
-
...s,
|
|
1588
|
-
scheme: s.scheme ?? v.value?.scheme ?? null,
|
|
1745
|
+
raw: i
|
|
1746
|
+
}, d.value = E;
|
|
1747
|
+
}, Pe = (i, u = l.value, g) => {
|
|
1748
|
+
const E = jo({
|
|
1749
|
+
currentMap: m.value,
|
|
1750
|
+
currentAliasMap: M.value,
|
|
1751
|
+
currentOrder: f.value,
|
|
1752
|
+
currentStatusMap: y.value,
|
|
1753
|
+
editingSectionKeys: p.value,
|
|
1754
|
+
nextViewModel: i,
|
|
1755
|
+
node: u,
|
|
1756
|
+
targetKey: g,
|
|
1757
|
+
activeSection: d.value
|
|
1758
|
+
});
|
|
1759
|
+
return m.value = E.sectionMap, M.value = E.sectionAliasMap, f.value = E.sectionOrder, y.value = E.sectionStatusMap, s.value = {
|
|
1760
|
+
...i,
|
|
1761
|
+
scheme: i.scheme ?? s.value?.scheme ?? null,
|
|
1589
1762
|
topNodes: r.value,
|
|
1590
1763
|
treeNodes: r.value,
|
|
1591
|
-
activeNode:
|
|
1592
|
-
activeSection:
|
|
1593
|
-
sections:
|
|
1594
|
-
sectionMap:
|
|
1595
|
-
},
|
|
1596
|
-
},
|
|
1597
|
-
const
|
|
1598
|
-
if (!
|
|
1764
|
+
activeNode: u,
|
|
1765
|
+
activeSection: E.matchedSection,
|
|
1766
|
+
sections: E.targetSections,
|
|
1767
|
+
sectionMap: m.value
|
|
1768
|
+
}, d.value = E.matchedSection, E.matchedSection;
|
|
1769
|
+
}, h = (i, u) => {
|
|
1770
|
+
const g = B(i), E = g ? m.value[g] : null;
|
|
1771
|
+
if (!g || !E)
|
|
1599
1772
|
return;
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
...
|
|
1603
|
-
[
|
|
1604
|
-
},
|
|
1605
|
-
},
|
|
1606
|
-
const
|
|
1607
|
-
if (!
|
|
1773
|
+
const R = u(E);
|
|
1774
|
+
m.value = {
|
|
1775
|
+
...m.value,
|
|
1776
|
+
[g]: R
|
|
1777
|
+
}, d.value = ye(d.value ?? R) === g ? R : d.value, ge();
|
|
1778
|
+
}, N = async (i = d.value ?? l.value) => {
|
|
1779
|
+
const u = U(i), g = _(i) ?? l.value, E = k(i);
|
|
1780
|
+
if (!g)
|
|
1608
1781
|
return null;
|
|
1609
1782
|
if (!t.service.requestOperation)
|
|
1610
|
-
throw
|
|
1611
|
-
n.value = !0, a.value = null,
|
|
1783
|
+
throw Oe("service.requestOperation is required");
|
|
1784
|
+
n.value = !0, a.value = null, Q(E ?? g, { loading: !0, error: null });
|
|
1612
1785
|
try {
|
|
1613
|
-
const
|
|
1614
|
-
if (
|
|
1615
|
-
throw
|
|
1616
|
-
const
|
|
1617
|
-
const
|
|
1618
|
-
...
|
|
1619
|
-
infSetId:
|
|
1620
|
-
setId:
|
|
1621
|
-
operationInfo:
|
|
1786
|
+
const R = u ? [{ infSetId: u.infSetId, setId: u.setId, operationInfo: u.operationInfo, raw: u.raw }] : g.infSetList;
|
|
1787
|
+
if (R.length === 0)
|
|
1788
|
+
throw Oe("node.infSetList is required");
|
|
1789
|
+
const re = await Promise.all(R.map(async (ne) => {
|
|
1790
|
+
const ue = Lo(u, g, ne.infSetId), ke = {
|
|
1791
|
+
...q(g, u),
|
|
1792
|
+
infSetId: ne.infSetId,
|
|
1793
|
+
setId: ne.setId,
|
|
1794
|
+
operationInfo: ne.operationInfo
|
|
1622
1795
|
};
|
|
1623
|
-
if (
|
|
1624
|
-
const
|
|
1796
|
+
if (ue) {
|
|
1797
|
+
const et = await c(ue, {
|
|
1625
1798
|
type: "queryInfoSet",
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1799
|
+
requestSource: "inner",
|
|
1800
|
+
tagId: u?.requestTagId ?? u?.tagId ?? g.tagId,
|
|
1801
|
+
node: g,
|
|
1802
|
+
section: u,
|
|
1803
|
+
params: ke
|
|
1629
1804
|
});
|
|
1630
|
-
return
|
|
1805
|
+
return fo(et, ke, g);
|
|
1631
1806
|
}
|
|
1632
|
-
throw
|
|
1633
|
-
})),
|
|
1634
|
-
...
|
|
1635
|
-
sections:
|
|
1636
|
-
sectionMap: Object.fromEntries(
|
|
1807
|
+
throw Oe("infoSet.operationInfo.queryInfoSet is required");
|
|
1808
|
+
})), fe = {
|
|
1809
|
+
...re[0],
|
|
1810
|
+
sections: re.flatMap((ne) => ne.sections),
|
|
1811
|
+
sectionMap: Object.fromEntries(re.flatMap((ne) => ne.sections).map((ne) => [ne.key, ne]))
|
|
1637
1812
|
};
|
|
1638
|
-
return
|
|
1639
|
-
} catch (
|
|
1640
|
-
throw a.value =
|
|
1813
|
+
return Pe(fe, g, E);
|
|
1814
|
+
} catch (R) {
|
|
1815
|
+
throw a.value = R, Q(E ?? g, { loading: !1, error: R }), R;
|
|
1641
1816
|
} finally {
|
|
1642
|
-
n.value = !1,
|
|
1817
|
+
n.value = !1, Q(E ?? g, { loading: !1 });
|
|
1643
1818
|
}
|
|
1644
|
-
},
|
|
1645
|
-
if (!
|
|
1819
|
+
}, O = (i = d.value) => N(i), z = (i = d.value) => {
|
|
1820
|
+
if (!i)
|
|
1646
1821
|
return null;
|
|
1647
|
-
if (!Ne(
|
|
1648
|
-
return
|
|
1649
|
-
const
|
|
1650
|
-
return
|
|
1651
|
-
},
|
|
1652
|
-
const
|
|
1653
|
-
if (!
|
|
1654
|
-
return
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1668
|
-
|
|
1822
|
+
if (!Ne(i) && typeof i != "string")
|
|
1823
|
+
return S(i);
|
|
1824
|
+
const u = k(i);
|
|
1825
|
+
return u ? m.value[M.value[u] ?? u] ?? null : null;
|
|
1826
|
+
}, A = async (i = l.value) => i ? (await N(i), s.value) : (s.value = null, d.value = null, m.value = {}, M.value = {}, f.value = [], y.value = {}, null), oe = async (i) => {
|
|
1827
|
+
const u = Po(i);
|
|
1828
|
+
if (!u)
|
|
1829
|
+
return i.children;
|
|
1830
|
+
const g = F(i), E = await c(u, {
|
|
1831
|
+
type: "openTag",
|
|
1832
|
+
requestSource: "sidebar",
|
|
1833
|
+
tagId: i.tagId,
|
|
1834
|
+
node: i,
|
|
1835
|
+
params: g
|
|
1836
|
+
});
|
|
1837
|
+
return mt(E).treeNodes;
|
|
1838
|
+
}, X = async (i) => {
|
|
1839
|
+
if (i.loaded)
|
|
1840
|
+
return i.children;
|
|
1841
|
+
const u = await oe(i);
|
|
1842
|
+
return u.length > 0 && (r.value = Gt(r.value, i.key, u)), u;
|
|
1843
|
+
}, x = async (i) => {
|
|
1844
|
+
const u = typeof i == "string" ? v(r.value, i) : i;
|
|
1845
|
+
return u ? (l.value = u, d.value = null, p.value = [], await X(u), ge(s.value?.raw, u), u) : null;
|
|
1846
|
+
}, ce = async () => {
|
|
1847
|
+
const i = t.service.templateTree;
|
|
1848
|
+
if (!i)
|
|
1849
|
+
throw Oe("service.templateTree is required");
|
|
1669
1850
|
e.value = !0, a.value = null;
|
|
1670
1851
|
try {
|
|
1671
|
-
const
|
|
1672
|
-
|
|
1673
|
-
const
|
|
1852
|
+
const u = await i(P()), g = mt(u), E = await Promise.all(
|
|
1853
|
+
g.treeNodes.map(async (re) => {
|
|
1854
|
+
const fe = await oe(re);
|
|
1674
1855
|
return {
|
|
1675
|
-
...
|
|
1676
|
-
children:
|
|
1677
|
-
loaded:
|
|
1856
|
+
...re,
|
|
1857
|
+
children: fe,
|
|
1858
|
+
loaded: fe.length > 0 || re.loaded
|
|
1678
1859
|
};
|
|
1679
1860
|
})
|
|
1680
1861
|
);
|
|
1681
|
-
r.value =
|
|
1682
|
-
const
|
|
1683
|
-
return
|
|
1684
|
-
...
|
|
1685
|
-
treeNodes:
|
|
1686
|
-
activeNode:
|
|
1687
|
-
sectionMap:
|
|
1688
|
-
sections:
|
|
1862
|
+
r.value = E, d.value = null, m.value = {}, M.value = {}, f.value = [], y.value = {}, p.value = [];
|
|
1863
|
+
const R = v(E, t.initialActiveNodeKey) ?? v(E);
|
|
1864
|
+
return l.value = R, s.value = {
|
|
1865
|
+
...g,
|
|
1866
|
+
treeNodes: E,
|
|
1867
|
+
activeNode: R,
|
|
1868
|
+
sectionMap: m.value,
|
|
1869
|
+
sections: w.value
|
|
1689
1870
|
}, r.value;
|
|
1690
|
-
} catch (
|
|
1691
|
-
throw a.value =
|
|
1871
|
+
} catch (u) {
|
|
1872
|
+
throw a.value = u, u;
|
|
1692
1873
|
} finally {
|
|
1693
1874
|
e.value = !1;
|
|
1694
1875
|
}
|
|
1695
|
-
},
|
|
1696
|
-
const
|
|
1697
|
-
await
|
|
1698
|
-
const
|
|
1699
|
-
(
|
|
1876
|
+
}, Ie = async () => {
|
|
1877
|
+
const i = T();
|
|
1878
|
+
await O(d.value ?? l.value);
|
|
1879
|
+
const u = w.value.find(
|
|
1880
|
+
(g) => ye(g) === i
|
|
1700
1881
|
);
|
|
1701
|
-
return
|
|
1702
|
-
},
|
|
1703
|
-
const
|
|
1704
|
-
return !!(
|
|
1705
|
-
},
|
|
1706
|
-
const
|
|
1707
|
-
!
|
|
1708
|
-
},
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
(
|
|
1712
|
-
),
|
|
1713
|
-
},
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1716
|
-
const
|
|
1717
|
-
...
|
|
1718
|
-
[
|
|
1882
|
+
return u && (d.value = u), ge(), s.value;
|
|
1883
|
+
}, Ve = (i = d.value) => {
|
|
1884
|
+
const u = B(i);
|
|
1885
|
+
return !!(u && p.value.includes(u));
|
|
1886
|
+
}, $ = (i = d.value) => {
|
|
1887
|
+
const u = B(i);
|
|
1888
|
+
!u || Ve(u) || (p.value = [...p.value, u], Q(u, { editing: !0 }));
|
|
1889
|
+
}, Z = (i = d.value) => {
|
|
1890
|
+
const u = B(i);
|
|
1891
|
+
u && (p.value = p.value.filter(
|
|
1892
|
+
(g) => g !== u
|
|
1893
|
+
), Q(u, { editing: !1 }));
|
|
1894
|
+
}, ae = (i, u, g) => {
|
|
1895
|
+
const E = typeof u == "string" ? u : Fe(u);
|
|
1896
|
+
h(i, (R) => {
|
|
1897
|
+
const fe = (typeof u == "string" ? R.fields.find((ue) => Fe(ue) === E || ue.code === E) : u)?.cascadeClearFields ?? [], ne = {
|
|
1898
|
+
...R.model,
|
|
1899
|
+
[E]: g
|
|
1719
1900
|
};
|
|
1720
|
-
return
|
|
1721
|
-
|
|
1901
|
+
return fe.forEach((ue) => {
|
|
1902
|
+
ne[ue] = "";
|
|
1722
1903
|
}), {
|
|
1723
1904
|
// 保留 section 其它元数据。
|
|
1724
|
-
...
|
|
1905
|
+
...R,
|
|
1725
1906
|
// 更新表单 model。
|
|
1726
|
-
model:
|
|
1907
|
+
model: ne,
|
|
1727
1908
|
// 表单类型同步更新第一行 rows,方便保存时统一从 rows 构造 payload。
|
|
1728
|
-
rows:
|
|
1909
|
+
rows: R.renderType === "form" ? [{ ...R.rows[0], ...ne }] : R.rows,
|
|
1729
1910
|
// 同步 fields.value,保证只读 renderer 立即显示新值。
|
|
1730
|
-
fields:
|
|
1731
|
-
const
|
|
1732
|
-
return
|
|
1911
|
+
fields: R.fields.map((ue) => {
|
|
1912
|
+
const ke = Fe(ue);
|
|
1913
|
+
return ke === E || ue.code === E ? { ...ue, value: g } : fe.includes(ke) || fe.includes(ue.code) ? { ...ue, value: "" } : ue;
|
|
1733
1914
|
})
|
|
1734
1915
|
};
|
|
1735
1916
|
});
|
|
1736
|
-
},
|
|
1737
|
-
const
|
|
1738
|
-
if (!
|
|
1917
|
+
}, Ee = async (i, u, g = {}) => {
|
|
1918
|
+
const E = S(i);
|
|
1919
|
+
if (!E)
|
|
1739
1920
|
return [];
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
})
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1921
|
+
const {
|
|
1922
|
+
fieldKey: R,
|
|
1923
|
+
currentField: re,
|
|
1924
|
+
sourceModel: fe,
|
|
1925
|
+
sourceRow: ne,
|
|
1926
|
+
missingDependField: ue
|
|
1927
|
+
} = Eo(E, u, g), ke = re?.interface;
|
|
1928
|
+
if (!re || !ke)
|
|
1929
|
+
return re?.options ?? [];
|
|
1930
|
+
if (Mo(re))
|
|
1931
|
+
return re.options ?? [];
|
|
1932
|
+
if (ue)
|
|
1933
|
+
return h(E, (Le) => ({
|
|
1934
|
+
...Le,
|
|
1935
|
+
fields: Le.fields.map(
|
|
1936
|
+
($e) => Fe($e) === R || $e.code === R ? { ...$e, options: [] } : $e
|
|
1751
1937
|
)
|
|
1752
1938
|
})), [];
|
|
1753
|
-
const
|
|
1939
|
+
const et = await c(
|
|
1754
1940
|
{
|
|
1755
|
-
...
|
|
1756
|
-
params: te
|
|
1941
|
+
...ke
|
|
1757
1942
|
},
|
|
1758
1943
|
{
|
|
1759
1944
|
type: "fieldOptions",
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1945
|
+
requestSource: "inner",
|
|
1946
|
+
tagId: E.requestTagId ?? E.tagId,
|
|
1947
|
+
node: _(E),
|
|
1948
|
+
section: E,
|
|
1949
|
+
field: re,
|
|
1950
|
+
params: we(ke.params),
|
|
1951
|
+
model: fe,
|
|
1952
|
+
row: ne
|
|
1764
1953
|
}
|
|
1765
|
-
),
|
|
1766
|
-
return
|
|
1767
|
-
...
|
|
1768
|
-
fields:
|
|
1769
|
-
(
|
|
1954
|
+
), ct = Vo(et);
|
|
1955
|
+
return h(E, (Le) => ({
|
|
1956
|
+
...Le,
|
|
1957
|
+
fields: Le.fields.map(
|
|
1958
|
+
($e) => Fe($e) === R || $e.code === R ? { ...$e, options: ct } : $e
|
|
1770
1959
|
)
|
|
1771
|
-
})),
|
|
1772
|
-
},
|
|
1773
|
-
if (Array.isArray(
|
|
1774
|
-
|
|
1960
|
+
})), ct;
|
|
1961
|
+
}, Xe = (i, u) => {
|
|
1962
|
+
if (Array.isArray(u)) {
|
|
1963
|
+
De(i, u);
|
|
1775
1964
|
return;
|
|
1776
1965
|
}
|
|
1777
|
-
|
|
1778
|
-
...
|
|
1966
|
+
h(i, (g) => ({
|
|
1967
|
+
...g,
|
|
1779
1968
|
// 替换当前 model。
|
|
1780
|
-
model:
|
|
1969
|
+
model: u,
|
|
1781
1970
|
// 表单类型同步合并到第一行 rows。
|
|
1782
|
-
rows:
|
|
1971
|
+
rows: g.renderType === "form" ? [{ ...g.rows[0], ...u }] : g.rows,
|
|
1783
1972
|
// fields.value 也同步成 model 中的值。
|
|
1784
|
-
fields:
|
|
1785
|
-
...
|
|
1786
|
-
value:
|
|
1973
|
+
fields: g.fields.map((E) => ({
|
|
1974
|
+
...E,
|
|
1975
|
+
value: u[Fe(E)]
|
|
1787
1976
|
}))
|
|
1788
1977
|
}));
|
|
1789
|
-
},
|
|
1790
|
-
|
|
1791
|
-
...
|
|
1792
|
-
rows:
|
|
1793
|
-
data:
|
|
1978
|
+
}, De = (i, u) => {
|
|
1979
|
+
h(i, (g) => ({
|
|
1980
|
+
...g,
|
|
1981
|
+
rows: u,
|
|
1982
|
+
data: u
|
|
1794
1983
|
}));
|
|
1795
|
-
},
|
|
1984
|
+
}, an = {
|
|
1796
1985
|
// 加载模板树。
|
|
1797
|
-
loadTree:
|
|
1986
|
+
loadTree: ce,
|
|
1798
1987
|
// 选中树节点。
|
|
1799
|
-
selectNode:
|
|
1988
|
+
selectNode: x,
|
|
1800
1989
|
// 加载当前节点详情。
|
|
1801
|
-
loadDetail:
|
|
1990
|
+
loadDetail: A,
|
|
1802
1991
|
// 刷新当前详情。
|
|
1803
|
-
reloadActiveSection:
|
|
1992
|
+
reloadActiveSection: Ie,
|
|
1804
1993
|
// 加载指定节点或 section。
|
|
1805
|
-
loadSection:
|
|
1994
|
+
loadSection: N,
|
|
1806
1995
|
// 重新加载指定节点或 section。
|
|
1807
|
-
reloadSection:
|
|
1996
|
+
reloadSection: O,
|
|
1808
1997
|
// 获取指定节点或 section 的缓存数据。
|
|
1809
|
-
getSection:
|
|
1998
|
+
getSection: z,
|
|
1810
1999
|
// 获取指定节点或 section 的状态。
|
|
1811
|
-
getSectionStatus:
|
|
2000
|
+
getSectionStatus: me,
|
|
1812
2001
|
// 开启编辑。
|
|
1813
|
-
startEdit:
|
|
2002
|
+
startEdit: $,
|
|
1814
2003
|
// 取消编辑。
|
|
1815
|
-
cancelEdit:
|
|
2004
|
+
cancelEdit: Z,
|
|
1816
2005
|
// 更新单字段。
|
|
1817
|
-
updateField:
|
|
2006
|
+
updateField: ae,
|
|
1818
2007
|
// 加载字段动态选项。
|
|
1819
|
-
loadFieldOptions:
|
|
2008
|
+
loadFieldOptions: Ee,
|
|
1820
2009
|
// 批量更新 model。
|
|
1821
|
-
updateModel:
|
|
2010
|
+
updateModel: Xe,
|
|
1822
2011
|
// 更新表格行。
|
|
1823
|
-
updateTableRows:
|
|
2012
|
+
updateTableRows: De,
|
|
1824
2013
|
// 保存单行到本地缓存。
|
|
1825
|
-
saveRow: (
|
|
1826
|
-
const
|
|
1827
|
-
|
|
2014
|
+
saveRow: (i, u = {}, g = -1) => {
|
|
2015
|
+
const R = [...S(i)?.rows ?? []];
|
|
2016
|
+
R.splice(g >= 0 ? g : R.length, g >= 0 ? 1 : 0, u), De(i, R);
|
|
1828
2017
|
},
|
|
1829
2018
|
// 删除单行本地缓存。
|
|
1830
|
-
deleteRow: (
|
|
1831
|
-
const
|
|
1832
|
-
(
|
|
2019
|
+
deleteRow: (i, u) => {
|
|
2020
|
+
const g = S(i), E = typeof u == "string" ? Number(u) : u, R = (g?.rows ?? []).filter(
|
|
2021
|
+
(re, fe) => fe !== E
|
|
1833
2022
|
);
|
|
1834
|
-
|
|
2023
|
+
De(i, R);
|
|
1835
2024
|
},
|
|
1836
2025
|
// 调用接口保存 section。
|
|
1837
|
-
saveSection: async (
|
|
1838
|
-
const
|
|
1839
|
-
if (!
|
|
2026
|
+
saveSection: async (i = d.value) => {
|
|
2027
|
+
const u = T(i), g = S(i);
|
|
2028
|
+
if (!g)
|
|
1840
2029
|
return null;
|
|
1841
|
-
const
|
|
1842
|
-
if (!
|
|
1843
|
-
throw
|
|
1844
|
-
o.value = !0, a.value = null,
|
|
2030
|
+
const E = No(g);
|
|
2031
|
+
if (!E)
|
|
2032
|
+
throw Oe("section.operationInfo.editInfoSet is required");
|
|
2033
|
+
o.value = !0, a.value = null, u && u !== ye(g) && Q(u, { saving: !0, error: null }), Q(g, { saving: !0, error: null });
|
|
1845
2034
|
try {
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
}
|
|
1853
|
-
},
|
|
2035
|
+
const {
|
|
2036
|
+
tagId: R,
|
|
2037
|
+
...re
|
|
2038
|
+
} = q(l.value, g), fe = mo(g, re), ne = await c(
|
|
2039
|
+
// 保存时保留后端给的 method/url,但不再把 editOperation.params 混入实际提交数据。
|
|
2040
|
+
E,
|
|
1854
2041
|
{
|
|
1855
2042
|
type: "editInfoSet",
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
2043
|
+
requestSource: "inner",
|
|
2044
|
+
tagId: g.requestTagId ?? g.tagId,
|
|
2045
|
+
node: l.value,
|
|
2046
|
+
section: g,
|
|
2047
|
+
params: fe,
|
|
2048
|
+
model: g.model
|
|
1859
2049
|
}
|
|
1860
2050
|
);
|
|
1861
|
-
return
|
|
1862
|
-
} catch (
|
|
1863
|
-
throw a.value =
|
|
2051
|
+
return Z(g), await O(g), ne;
|
|
2052
|
+
} catch (R) {
|
|
2053
|
+
throw a.value = R, u && u !== ye(g) && Q(u, { saving: !1, error: R }), Q(g, { saving: !1, error: R }), R;
|
|
1864
2054
|
} finally {
|
|
1865
|
-
o.value = !1,
|
|
2055
|
+
o.value = !1, u && u !== ye(g) && Q(u, { saving: !1 }), Q(g, { saving: !1 });
|
|
1866
2056
|
}
|
|
1867
2057
|
},
|
|
1868
2058
|
// 判断编辑态。
|
|
1869
|
-
isEditing:
|
|
2059
|
+
isEditing: Ve
|
|
1870
2060
|
};
|
|
1871
|
-
return
|
|
2061
|
+
return be(
|
|
1872
2062
|
// 监听当前人员 id。
|
|
1873
2063
|
() => t.emplid,
|
|
1874
2064
|
() => {
|
|
1875
|
-
(t.autoLoad ?? !0) &&
|
|
2065
|
+
(t.autoLoad ?? !0) && ce();
|
|
1876
2066
|
}
|
|
1877
|
-
),
|
|
1878
|
-
(t.autoLoad ?? !0) &&
|
|
2067
|
+
), $t(() => {
|
|
2068
|
+
(t.autoLoad ?? !0) && ce();
|
|
1879
2069
|
}), {
|
|
1880
2070
|
// 当前 viewModel。
|
|
1881
|
-
viewModel:
|
|
2071
|
+
viewModel: s,
|
|
1882
2072
|
// 当前模板树节点。
|
|
1883
2073
|
nodes: r,
|
|
1884
2074
|
// 当前已加载 section 列表。
|
|
1885
|
-
sections:
|
|
2075
|
+
sections: w,
|
|
1886
2076
|
// 当前 section 缓存。
|
|
1887
|
-
sectionMap:
|
|
2077
|
+
sectionMap: m,
|
|
1888
2078
|
// 当前 section 状态缓存。
|
|
1889
|
-
sectionStatusMap:
|
|
2079
|
+
sectionStatusMap: y,
|
|
1890
2080
|
// 当前激活节点。
|
|
1891
|
-
activeNode:
|
|
2081
|
+
activeNode: l,
|
|
1892
2082
|
// 当前激活 section。
|
|
1893
|
-
activeSection:
|
|
2083
|
+
activeSection: d,
|
|
1894
2084
|
// 给页面消费的状态快照。
|
|
1895
|
-
state:
|
|
2085
|
+
state: C,
|
|
1896
2086
|
// 给页面消费的操作集合。
|
|
1897
|
-
actions:
|
|
2087
|
+
actions: an
|
|
1898
2088
|
};
|
|
1899
|
-
},
|
|
2089
|
+
}, za = /* @__PURE__ */ ee({
|
|
1900
2090
|
name: "GlobalInfoProvider",
|
|
1901
2091
|
__name: "GlobalInfoProvider",
|
|
1902
2092
|
props: {
|
|
@@ -1904,72 +2094,145 @@ const be = (t) => t.key || t.code, ie = (t) => t.key || t.setId, Te = (t) => new
|
|
|
1904
2094
|
adaptScene: {},
|
|
1905
2095
|
emplid: {},
|
|
1906
2096
|
autoLoad: { type: Boolean, default: !0 },
|
|
1907
|
-
initialActiveNodeKey: {}
|
|
2097
|
+
initialActiveNodeKey: {},
|
|
2098
|
+
renderConfig: {},
|
|
2099
|
+
formatOperationParams: {}
|
|
1908
2100
|
},
|
|
1909
2101
|
setup(t) {
|
|
1910
|
-
const n =
|
|
1911
|
-
return (
|
|
1912
|
-
viewModel:
|
|
1913
|
-
nodes:
|
|
1914
|
-
sections:
|
|
1915
|
-
activeNode:
|
|
1916
|
-
activeSection:
|
|
1917
|
-
state:
|
|
1918
|
-
actions:
|
|
2102
|
+
const e = t, n = Go(e), { viewModel: o, nodes: a, sections: r, activeNode: s, activeSection: l, state: d, actions: m } = n;
|
|
2103
|
+
return (M, f) => K(M.$slots, "default", he(_e({
|
|
2104
|
+
viewModel: J(o),
|
|
2105
|
+
nodes: J(a),
|
|
2106
|
+
sections: J(r),
|
|
2107
|
+
activeNode: J(s),
|
|
2108
|
+
activeSection: J(l),
|
|
2109
|
+
state: J(d),
|
|
2110
|
+
actions: J(m),
|
|
2111
|
+
renderConfig: e.renderConfig
|
|
1919
2112
|
})));
|
|
1920
2113
|
}
|
|
1921
|
-
});
|
|
1922
|
-
function
|
|
1923
|
-
return
|
|
2114
|
+
}), Ao = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.437665%2012C0.316763%2011.9845%200.205604%2011.9251%200.125029%2011.8329C0.0444551%2011.7407%200%2011.622%200%2011.499C0%2011.3761%200.0444551%2011.2574%200.125029%2011.1652C0.205604%2011.0729%200.316763%2011.0135%200.437665%2010.998H11.5623C11.6832%2011.0135%2011.7944%2011.0729%2011.875%2011.1652C11.9555%2011.2574%2012%2011.3761%2012%2011.499C12%2011.622%2011.9555%2011.7407%2011.875%2011.8329C11.7944%2011.9251%2011.6832%2011.9845%2011.5623%2012H0.437665ZM9.59963%200.233088L10.72%201.36329C10.868%201.51347%2010.9511%201.71663%2010.9511%201.92839C10.9511%202.14015%2010.868%202.34331%2010.72%202.49349L3.61614%209.6354C3.54189%209.70969%203.45384%209.76846%203.35702%209.80835C3.26021%209.84824%203.15654%209.86846%203.05196%209.86785H1.57397C1.4686%209.86785%201.36754%209.82562%201.29303%209.75046C1.21852%209.6753%201.17666%209.57336%201.17666%209.46707V7.93609C1.17606%207.8306%201.1961%207.72602%201.23564%207.62836C1.27519%207.5307%201.33345%207.44188%201.4071%207.36698L8.47921%200.233088C8.62809%200.0837965%208.82949%200%209.03942%200C9.24935%200%209.45074%200.0837965%209.59963%200.233088ZM2.16993%208.01624V8.8659H3.01223L9.88569%201.9324L9.04339%201.07473L2.16993%208.01624Z'%20fill='%23E60000'/%3e%3c/svg%3e";
|
|
2115
|
+
function st(t) {
|
|
2116
|
+
return St(t.type || t.fieldType || t.frontInputType) || St(t.renderType) || "text";
|
|
1924
2117
|
}
|
|
1925
|
-
function
|
|
1926
|
-
return
|
|
2118
|
+
function it(t) {
|
|
2119
|
+
return It(t.type || t.fieldType || t.frontInputType) || It(t.renderType) || "text";
|
|
1927
2120
|
}
|
|
1928
|
-
function
|
|
1929
|
-
|
|
2121
|
+
function Te(t) {
|
|
2122
|
+
if (t == null) return !0;
|
|
2123
|
+
if (typeof t == "string") return t.trim() === "";
|
|
2124
|
+
if (Array.isArray(t)) return t.length === 0 || t.every((e) => Te(e));
|
|
2125
|
+
if (t instanceof Date) return Number.isNaN(t.getTime());
|
|
2126
|
+
if (typeof File < "u" && t instanceof File) return t.name.trim() === "";
|
|
2127
|
+
if (typeof t == "object") {
|
|
2128
|
+
const e = Object.entries(t).filter(([n]) => !n.startsWith("__"));
|
|
2129
|
+
return e.length === 0 || e.every(([, n]) => Te(n));
|
|
2130
|
+
}
|
|
2131
|
+
return !1;
|
|
1930
2132
|
}
|
|
1931
|
-
function
|
|
2133
|
+
function Yt(t) {
|
|
1932
2134
|
if (t instanceof Error) return !0;
|
|
1933
2135
|
if (!t || typeof t != "object") return !1;
|
|
1934
2136
|
const e = t;
|
|
1935
2137
|
return typeof e.message == "string" && (typeof e.stack == "string" || e.name === "Error");
|
|
1936
2138
|
}
|
|
1937
|
-
function
|
|
1938
|
-
const o =
|
|
1939
|
-
return o === "empty" ||
|
|
2139
|
+
function Qt(t, e, n = "-") {
|
|
2140
|
+
const o = it(t);
|
|
2141
|
+
return o === "empty" || Te(e) ? n : Yt(e) ? (console.error("[globalInfo] field value render failed", e), n) : o === "select" ? Ho(t, e, n) : o === "switch" ? Xt(e) ? "是" : "否" : o === "file" ? Uo(e, n) : o === "multi-row" ? Wo(e, n) : String(e);
|
|
2142
|
+
}
|
|
2143
|
+
function Ze(t, e) {
|
|
2144
|
+
return Array.isArray(e) ? e : Qe(t) ? typeof e == "string" ? e.split(",").map((n) => n.trim()).filter(Boolean) : Te(e) ? [] : [e] : [e];
|
|
2145
|
+
}
|
|
2146
|
+
function Ko(t, e) {
|
|
2147
|
+
return Qe(t) ? Ze(t, e) : e;
|
|
1940
2148
|
}
|
|
1941
|
-
function
|
|
2149
|
+
function qo(t, e) {
|
|
2150
|
+
return Qe(t) ? Array.isArray(e) ? e.map((n) => String(n ?? "").trim()).filter(Boolean).join(",") : e ?? "" : e;
|
|
2151
|
+
}
|
|
2152
|
+
function Xt(t) {
|
|
1942
2153
|
if (typeof t == "boolean") return t;
|
|
1943
2154
|
if (typeof t == "number") return t !== 0;
|
|
1944
2155
|
const e = String(t ?? "").trim().toLowerCase();
|
|
1945
2156
|
return ["true", "1", "y", "yes", "t", "是"].includes(e);
|
|
1946
2157
|
}
|
|
1947
|
-
function
|
|
2158
|
+
function Ye(t, e, n, o = {}) {
|
|
2159
|
+
const a = zo(o);
|
|
2160
|
+
return t.filter((r) => r.visible ? !Do(r, e, n, a, o.rows) : !1);
|
|
2161
|
+
}
|
|
2162
|
+
function ht(t) {
|
|
2163
|
+
return en(t).some((n) => ["序号", "index", "idx", "seq", "seqno", "serial", "order", "rownum", "row_no"].includes(n));
|
|
2164
|
+
}
|
|
2165
|
+
function bt(t) {
|
|
2166
|
+
return en(t).includes("seqno");
|
|
2167
|
+
}
|
|
2168
|
+
function St(t) {
|
|
1948
2169
|
const e = String(t ?? "").toLowerCase();
|
|
1949
|
-
return e === "upload" || e === "attachment" ? "file" : e === "text" || e === "textarea" || e === "select" || e === "date" || e === "number" || e === "switch" || e === "file" || e === "html" || e === "code" || e === "multi-row" || e === "empty" ? e : "";
|
|
2170
|
+
return e === "upload" || e === "attachment" ? "file" : e === "radio" || e === "checkbox" ? "select" : e === "text" || e === "textarea" || e === "select" || e === "date" || e === "number" || e === "switch" || e === "file" || e === "html" || e === "code" || e === "multi-row" || e === "empty" ? e : "";
|
|
1950
2171
|
}
|
|
1951
|
-
function
|
|
2172
|
+
function It(t) {
|
|
1952
2173
|
const e = String(t ?? "").toLowerCase();
|
|
1953
|
-
return e === "upload" || e === "attachment" ? "file" : e === "select" || e === "switch" || e === "file" || e === "html" || e === "code" || e === "multi-row" || e === "empty" ? e : e === "textarea" || e === "date" || e === "number" || e === "text" ? "text" : "";
|
|
2174
|
+
return e === "upload" || e === "attachment" ? "file" : e === "radio" || e === "checkbox" ? "select" : e === "select" || e === "switch" || e === "file" || e === "html" || e === "code" || e === "multi-row" || e === "empty" ? e : e === "textarea" || e === "date" || e === "number" || e === "text" ? "text" : "";
|
|
1954
2175
|
}
|
|
1955
|
-
function
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2176
|
+
function zo(t) {
|
|
2177
|
+
return t.rows?.length ? t.rows : [t.values ?? {}];
|
|
2178
|
+
}
|
|
2179
|
+
function Do(t, e, n, o, a) {
|
|
2180
|
+
const r = n?.hiddenRule;
|
|
2181
|
+
return r ? o.some((s) => {
|
|
2182
|
+
try {
|
|
2183
|
+
const l = s[t.code];
|
|
2184
|
+
return r({
|
|
2185
|
+
field: t,
|
|
2186
|
+
section: e,
|
|
2187
|
+
values: s,
|
|
2188
|
+
allValues: s,
|
|
2189
|
+
value: l,
|
|
2190
|
+
currentValue: l,
|
|
2191
|
+
rows: a
|
|
2192
|
+
});
|
|
2193
|
+
} catch (l) {
|
|
2194
|
+
return console.error("[globalInfo] hidden rule failed", l), !1;
|
|
2195
|
+
}
|
|
2196
|
+
}) : !1;
|
|
2197
|
+
}
|
|
2198
|
+
function en(t) {
|
|
2199
|
+
return xo([
|
|
2200
|
+
t.id,
|
|
2201
|
+
t.key,
|
|
2202
|
+
t.code,
|
|
2203
|
+
t.name,
|
|
2204
|
+
t.label,
|
|
2205
|
+
t.prop
|
|
2206
|
+
]);
|
|
2207
|
+
}
|
|
2208
|
+
function xo(t) {
|
|
2209
|
+
return Array.from(new Set(t.map((e) => Jo(e)).filter(Boolean)));
|
|
2210
|
+
}
|
|
2211
|
+
function Jo(t) {
|
|
2212
|
+
return String(t ?? "").trim().toLowerCase();
|
|
2213
|
+
}
|
|
2214
|
+
function Ho(t, e, n) {
|
|
2215
|
+
const o = Qe(t);
|
|
2216
|
+
if (Array.isArray(e) || o) {
|
|
2217
|
+
const a = Ze(t, e).map((s) => wt(t, s) || String(s ?? "").trim()).filter(Boolean), r = o ? "," : "、";
|
|
2218
|
+
return a.length > 0 ? a.join(r) : n;
|
|
1959
2219
|
}
|
|
1960
|
-
return
|
|
2220
|
+
return wt(t, e) || String(e).trim() || n;
|
|
2221
|
+
}
|
|
2222
|
+
function Qe(t) {
|
|
2223
|
+
return !!t.props?.multiple && (st(t) === "select" || it(t) === "select");
|
|
1961
2224
|
}
|
|
1962
|
-
function
|
|
2225
|
+
function wt(t, e) {
|
|
1963
2226
|
return t.options?.find((o) => o.value === e || String(o.value) === String(e))?.label ?? "";
|
|
1964
2227
|
}
|
|
1965
|
-
function
|
|
2228
|
+
function Uo(t, e) {
|
|
1966
2229
|
if (Array.isArray(t)) {
|
|
1967
|
-
const n = t.map((o) =>
|
|
2230
|
+
const n = t.map((o) => _t(o)).filter(Boolean);
|
|
1968
2231
|
return n.length > 0 ? n.join("、") : e;
|
|
1969
2232
|
}
|
|
1970
|
-
return
|
|
2233
|
+
return _t(t) || e;
|
|
1971
2234
|
}
|
|
1972
|
-
function
|
|
2235
|
+
function _t(t) {
|
|
1973
2236
|
if (typeof File < "u" && t instanceof File) return t.name;
|
|
1974
2237
|
if (t && typeof t == "object") {
|
|
1975
2238
|
const e = t;
|
|
@@ -1977,17 +2240,17 @@ function mt(t) {
|
|
|
1977
2240
|
}
|
|
1978
2241
|
return String(t ?? "").trim();
|
|
1979
2242
|
}
|
|
1980
|
-
function
|
|
1981
|
-
return Array.isArray(t) ? t.map((
|
|
1982
|
-
`) : String(t);
|
|
2243
|
+
function Wo(t, e) {
|
|
2244
|
+
return Array.isArray(t) ? t.map((o) => Yt(o) ? (console.error("[globalInfo] multi-row field item render failed", o), "") : Te(o) ? "" : o && typeof o == "object" ? JSON.stringify(o) : String(o).trim()).filter(Boolean).join(`
|
|
2245
|
+
`) || e : String(t).trim() || e;
|
|
1983
2246
|
}
|
|
1984
|
-
const
|
|
2247
|
+
const Zo = ["disabled", "accept", "multiple"], Yo = {
|
|
1985
2248
|
key: 0,
|
|
1986
2249
|
class: "global-info-field-control__file-text"
|
|
1987
|
-
},
|
|
2250
|
+
}, Qo = {
|
|
1988
2251
|
key: 1,
|
|
1989
2252
|
class: "global-info-field-control__file-upload"
|
|
1990
|
-
},
|
|
2253
|
+
}, Xo = /* @__PURE__ */ ee({
|
|
1991
2254
|
name: "GlobalInfoFieldControl",
|
|
1992
2255
|
__name: "GlobalInfoFieldControl",
|
|
1993
2256
|
props: {
|
|
@@ -1997,119 +2260,122 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
1997
2260
|
},
|
|
1998
2261
|
emits: ["update:modelValue", "change", "loadOptions"],
|
|
1999
2262
|
setup(t, { emit: e }) {
|
|
2000
|
-
const n = t, o = e, a = ["textarea", "html", "code", "multi-row"], r =
|
|
2263
|
+
const n = t, o = e, a = ["textarea", "html", "code", "multi-row"], r = I(() => st(n.field)), s = I(() => n.disabled || n.field.disabled || n.field.readonly), l = I(() => n.modelValue === void 0 || n.modelValue === null ? "" : String(n.modelValue)), d = I(() => {
|
|
2001
2264
|
if (n.modelValue === void 0 || n.modelValue === null || n.modelValue === "") return;
|
|
2002
|
-
const
|
|
2003
|
-
return Number.isFinite(
|
|
2004
|
-
}),
|
|
2005
|
-
const
|
|
2006
|
-
return
|
|
2007
|
-
}),
|
|
2008
|
-
function
|
|
2009
|
-
o("update:modelValue",
|
|
2010
|
-
}
|
|
2011
|
-
function
|
|
2012
|
-
o("change",
|
|
2013
|
-
}
|
|
2014
|
-
function
|
|
2015
|
-
|
|
2016
|
-
}
|
|
2017
|
-
function
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2265
|
+
const v = typeof n.modelValue == "number" ? n.modelValue : Number(n.modelValue);
|
|
2266
|
+
return Number.isFinite(v) ? v : void 0;
|
|
2267
|
+
}), m = I(() => Ko(n.field, n.modelValue)), M = I(() => {
|
|
2268
|
+
const v = n.field.props?.activeValue ?? n.field.props?.["active-value"], T = n.field.props?.inactiveValue ?? n.field.props?.["inactive-value"];
|
|
2269
|
+
return v !== void 0 || T !== void 0 ? n.modelValue ?? T ?? !1 : Xt(n.modelValue);
|
|
2270
|
+
}), f = I(() => r.value === "code" ? 5 : 3), y = I(() => r.value === "file" && !Te(n.modelValue)), p = I(() => Qt(n.field, n.modelValue, "请选择文件")), w = I(() => n.field.placeholder ? n.field.placeholder : r.value === "select" ? "请选择" : r.value === "date" ? "请选择日期" : r.value === "file" ? "请选择文件" : "请输入");
|
|
2271
|
+
function C(v) {
|
|
2272
|
+
o("update:modelValue", F(v));
|
|
2273
|
+
}
|
|
2274
|
+
function P(v) {
|
|
2275
|
+
o("change", F(v));
|
|
2276
|
+
}
|
|
2277
|
+
function F(v) {
|
|
2278
|
+
return r.value === "select" ? qo(n.field, v) : v;
|
|
2279
|
+
}
|
|
2280
|
+
function q(v) {
|
|
2281
|
+
v && o("loadOptions");
|
|
2282
|
+
}
|
|
2283
|
+
function c(v) {
|
|
2284
|
+
const T = v.target, S = Array.from(T.files ?? []), B = n.field.props?.multiple ? S : S[0] ?? null;
|
|
2285
|
+
C(B), P(B);
|
|
2286
|
+
}
|
|
2287
|
+
return (v, T) => {
|
|
2288
|
+
const S = Mt, B = Et, k = Bt, _ = yn, U = hn, me = Ft;
|
|
2289
|
+
return r.value === "select" ? (b(), V(B, H({
|
|
2024
2290
|
key: 0,
|
|
2025
2291
|
class: "global-info-field-control"
|
|
2026
|
-
},
|
|
2027
|
-
"model-value":
|
|
2028
|
-
placeholder:
|
|
2029
|
-
disabled:
|
|
2292
|
+
}, v.field.props, {
|
|
2293
|
+
"model-value": m.value,
|
|
2294
|
+
placeholder: w.value,
|
|
2295
|
+
disabled: s.value,
|
|
2030
2296
|
clearable: "",
|
|
2031
|
-
onVisibleChange:
|
|
2032
|
-
"onUpdate:modelValue":
|
|
2033
|
-
onChange:
|
|
2297
|
+
onVisibleChange: q,
|
|
2298
|
+
"onUpdate:modelValue": C,
|
|
2299
|
+
onChange: P
|
|
2034
2300
|
}), {
|
|
2035
|
-
default:
|
|
2036
|
-
(
|
|
2037
|
-
key: String(
|
|
2038
|
-
label:
|
|
2039
|
-
value:
|
|
2301
|
+
default: L(() => [
|
|
2302
|
+
(b(!0), G(Se, null, de(v.field.options || [], (Q) => (b(), V(S, {
|
|
2303
|
+
key: String(Q.value),
|
|
2304
|
+
label: Q.label,
|
|
2305
|
+
value: Q.value
|
|
2040
2306
|
}, null, 8, ["label", "value"]))), 128))
|
|
2041
2307
|
]),
|
|
2042
2308
|
_: 1
|
|
2043
|
-
}, 16, ["model-value", "placeholder", "disabled"])) : r.value === "date" ? (
|
|
2309
|
+
}, 16, ["model-value", "placeholder", "disabled"])) : r.value === "date" ? (b(), V(k, H({
|
|
2044
2310
|
key: 1,
|
|
2045
2311
|
class: "global-info-field-control"
|
|
2046
|
-
},
|
|
2047
|
-
"model-value":
|
|
2048
|
-
placeholder:
|
|
2049
|
-
disabled:
|
|
2312
|
+
}, v.field.props, {
|
|
2313
|
+
"model-value": v.modelValue,
|
|
2314
|
+
placeholder: w.value,
|
|
2315
|
+
disabled: s.value,
|
|
2050
2316
|
type: "date",
|
|
2051
2317
|
"value-format": "YYYY-MM-DD",
|
|
2052
|
-
"onUpdate:modelValue":
|
|
2053
|
-
onChange:
|
|
2054
|
-
}), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "number" ? (
|
|
2318
|
+
"onUpdate:modelValue": C,
|
|
2319
|
+
onChange: P
|
|
2320
|
+
}), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "number" ? (b(), V(_, H({
|
|
2055
2321
|
key: 2,
|
|
2056
2322
|
class: "global-info-field-control"
|
|
2057
|
-
},
|
|
2058
|
-
"model-value":
|
|
2059
|
-
placeholder:
|
|
2060
|
-
disabled:
|
|
2323
|
+
}, v.field.props, {
|
|
2324
|
+
"model-value": d.value,
|
|
2325
|
+
placeholder: w.value,
|
|
2326
|
+
disabled: s.value,
|
|
2061
2327
|
"controls-position": "right",
|
|
2062
|
-
"onUpdate:modelValue":
|
|
2063
|
-
onChange:
|
|
2064
|
-
}), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "switch" ? (
|
|
2328
|
+
"onUpdate:modelValue": C,
|
|
2329
|
+
onChange: P
|
|
2330
|
+
}), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "switch" ? (b(), V(U, H({
|
|
2065
2331
|
key: 3,
|
|
2066
2332
|
class: "global-info-field-control global-info-field-control--switch"
|
|
2067
|
-
},
|
|
2068
|
-
"model-value":
|
|
2069
|
-
disabled:
|
|
2070
|
-
"onUpdate:modelValue":
|
|
2071
|
-
onChange:
|
|
2072
|
-
}), null, 16, ["model-value", "disabled"])) : r.value === "file" ? (
|
|
2333
|
+
}, v.field.props, {
|
|
2334
|
+
"model-value": M.value,
|
|
2335
|
+
disabled: s.value,
|
|
2336
|
+
"onUpdate:modelValue": C,
|
|
2337
|
+
onChange: P
|
|
2338
|
+
}), null, 16, ["model-value", "disabled"])) : r.value === "file" ? (b(), G("label", {
|
|
2073
2339
|
key: 4,
|
|
2074
|
-
class:
|
|
2075
|
-
"is-disabled":
|
|
2076
|
-
"is-empty": !
|
|
2077
|
-
"is-filled":
|
|
2340
|
+
class: Ge(["global-info-field-control global-info-field-control--file", {
|
|
2341
|
+
"is-disabled": s.value,
|
|
2342
|
+
"is-empty": !y.value,
|
|
2343
|
+
"is-filled": y.value
|
|
2078
2344
|
}])
|
|
2079
2345
|
}, [
|
|
2080
|
-
|
|
2346
|
+
D("input", {
|
|
2081
2347
|
class: "global-info-field-control__file-input",
|
|
2082
2348
|
type: "file",
|
|
2083
|
-
disabled:
|
|
2084
|
-
accept: String(
|
|
2085
|
-
multiple: !!
|
|
2086
|
-
onChange:
|
|
2087
|
-
}, null, 40,
|
|
2088
|
-
|
|
2089
|
-
], 2)) : r.value === "empty" ? (
|
|
2349
|
+
disabled: s.value,
|
|
2350
|
+
accept: String(v.field.props?.accept ?? ""),
|
|
2351
|
+
multiple: !!v.field.props?.multiple,
|
|
2352
|
+
onChange: c
|
|
2353
|
+
}, null, 40, Zo),
|
|
2354
|
+
y.value ? (b(), G("span", Yo, se(p.value), 1)) : (b(), G("span", Qo, "上 传"))
|
|
2355
|
+
], 2)) : r.value === "empty" ? (b(), V(me, {
|
|
2090
2356
|
key: 5,
|
|
2091
2357
|
class: "global-info-field-control",
|
|
2092
2358
|
"model-value": "",
|
|
2093
2359
|
disabled: "",
|
|
2094
2360
|
placeholder: "-"
|
|
2095
|
-
})) : (
|
|
2361
|
+
})) : (b(), V(me, H({
|
|
2096
2362
|
key: 6,
|
|
2097
2363
|
class: ["global-info-field-control", { "global-info-field-control--code": r.value === "code" }]
|
|
2098
|
-
},
|
|
2099
|
-
"model-value":
|
|
2100
|
-
placeholder:
|
|
2101
|
-
disabled:
|
|
2364
|
+
}, v.field.props, {
|
|
2365
|
+
"model-value": l.value,
|
|
2366
|
+
placeholder: w.value,
|
|
2367
|
+
disabled: s.value,
|
|
2102
2368
|
type: a.includes(r.value) ? "textarea" : "text",
|
|
2103
|
-
rows: a.includes(r.value) ?
|
|
2104
|
-
"onUpdate:modelValue":
|
|
2105
|
-
onChange:
|
|
2369
|
+
rows: a.includes(r.value) ? f.value : void 0,
|
|
2370
|
+
"onUpdate:modelValue": C,
|
|
2371
|
+
onChange: P
|
|
2106
2372
|
}), null, 16, ["class", "model-value", "placeholder", "disabled", "type", "rows"]));
|
|
2107
2373
|
};
|
|
2108
2374
|
}
|
|
2109
|
-
}),
|
|
2375
|
+
}), tn = /* @__PURE__ */ ie(Xo, [["__scopeId", "data-v-cc5c8aa9"]]), ea = ["innerHTML"], ta = {
|
|
2110
2376
|
key: 1,
|
|
2111
2377
|
class: "global-info-field-value global-info-field-value--code"
|
|
2112
|
-
},
|
|
2378
|
+
}, na = /* @__PURE__ */ ee({
|
|
2113
2379
|
name: "GlobalInfoFieldValue",
|
|
2114
2380
|
__name: "GlobalInfoFieldValue",
|
|
2115
2381
|
props: {
|
|
@@ -2118,23 +2384,34 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2118
2384
|
emptyText: { default: "-" }
|
|
2119
2385
|
},
|
|
2120
2386
|
setup(t) {
|
|
2121
|
-
const e = t, n =
|
|
2122
|
-
return (r,
|
|
2387
|
+
const e = t, n = I(() => it(e.field)), o = I(() => n.value === "empty" || Te(e.value)), a = I(() => Qt(e.field, e.value, e.emptyText));
|
|
2388
|
+
return (r, s) => n.value === "html" && !o.value ? (b(), G("span", {
|
|
2123
2389
|
key: 0,
|
|
2124
2390
|
class: "global-info-field-value global-info-field-value--html",
|
|
2125
2391
|
innerHTML: a.value
|
|
2126
|
-
}, null, 8,
|
|
2392
|
+
}, null, 8, ea)) : n.value === "code" && !o.value ? (b(), G("pre", ta, se(a.value), 1)) : (b(), G("span", {
|
|
2127
2393
|
key: 2,
|
|
2128
|
-
class:
|
|
2394
|
+
class: Ge(["global-info-field-value", {
|
|
2129
2395
|
"global-info-field-value--multi-row": n.value === "multi-row",
|
|
2130
2396
|
"global-info-field-value--file": n.value === "file" && !o.value
|
|
2131
2397
|
}])
|
|
2132
|
-
},
|
|
2398
|
+
}, se(a.value), 3));
|
|
2133
2399
|
}
|
|
2134
|
-
}),
|
|
2400
|
+
}), nn = /* @__PURE__ */ ie(na, [["__scopeId", "data-v-08b37e58"]]);
|
|
2401
|
+
function He(t) {
|
|
2402
|
+
return st(t) === "select" && !!t.interface;
|
|
2403
|
+
}
|
|
2404
|
+
function Ue(t, e, n = {}, o = "") {
|
|
2405
|
+
const a = e.key || e.id || e.code, r = (e.cascadeDependFields ?? []).map((s) => `${s}:${String(n[s] ?? "")}`).join("|");
|
|
2406
|
+
return [t, o, a, r].join("::");
|
|
2407
|
+
}
|
|
2408
|
+
function on(t, e, n) {
|
|
2409
|
+
return Array.isArray(t.options) && t.options.length > 0 ? e === n ? !0 : !e && (t.cascadeDependFields ?? []).length === 0 : !1;
|
|
2410
|
+
}
|
|
2411
|
+
const oa = { class: "global-info-form-renderer__label" }, aa = {
|
|
2135
2412
|
key: 0,
|
|
2136
2413
|
class: "global-info-form-renderer__required"
|
|
2137
|
-
},
|
|
2414
|
+
}, ra = /* @__PURE__ */ ee({
|
|
2138
2415
|
name: "GlobalInfoFormRenderer",
|
|
2139
2416
|
__name: "GlobalInfoFormRenderer",
|
|
2140
2417
|
props: {
|
|
@@ -2144,94 +2421,171 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2144
2421
|
state: {},
|
|
2145
2422
|
actions: {},
|
|
2146
2423
|
model: {},
|
|
2147
|
-
onUpdateModel: { type: Function }
|
|
2424
|
+
onUpdateModel: { type: Function },
|
|
2425
|
+
renderConfig: {}
|
|
2148
2426
|
},
|
|
2149
2427
|
setup(t) {
|
|
2150
|
-
const e = t, n =
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2428
|
+
const e = t, n = Ce(), o = I(() => e.model ?? e.section.model), a = /* @__PURE__ */ new Map(), r = I(() => Ye(
|
|
2429
|
+
e.section.fields,
|
|
2430
|
+
e.section,
|
|
2431
|
+
e.renderConfig,
|
|
2432
|
+
{ values: o.value }
|
|
2433
|
+
));
|
|
2434
|
+
function s(c, v) {
|
|
2435
|
+
const T = { ...o.value, [c.code]: v };
|
|
2436
|
+
(c.cascadeClearFields ?? []).forEach((S) => {
|
|
2437
|
+
T[S] = "";
|
|
2438
|
+
}), e.onUpdateModel?.(T), e.onUpdateModel || e.actions.updateField(e.section, c, v), l(c, v, T);
|
|
2439
|
+
}
|
|
2440
|
+
function l(c, v, T) {
|
|
2441
|
+
const S = e.renderConfig?.onFieldBusinessChange;
|
|
2442
|
+
if (S)
|
|
2443
|
+
try {
|
|
2444
|
+
const B = d(c, v), k = {
|
|
2445
|
+
field: c,
|
|
2446
|
+
value: v,
|
|
2447
|
+
section: e.section,
|
|
2448
|
+
model: T,
|
|
2449
|
+
values: T,
|
|
2450
|
+
node: e.node,
|
|
2451
|
+
activeNode: e.node,
|
|
2452
|
+
sections: m(),
|
|
2453
|
+
sectionValues: M(e.section, T),
|
|
2454
|
+
actions: e.actions,
|
|
2455
|
+
selectedOption: B[0],
|
|
2456
|
+
selectedOptions: B
|
|
2457
|
+
};
|
|
2458
|
+
Promise.resolve(S(k)).catch((_) => {
|
|
2459
|
+
console.error("[GlobalInfoFormRenderer] field business change failed", _);
|
|
2460
|
+
});
|
|
2461
|
+
} catch (B) {
|
|
2462
|
+
console.error("[GlobalInfoFormRenderer] field business change failed", B);
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
function d(c, v) {
|
|
2466
|
+
const T = Ze(c, v);
|
|
2467
|
+
return (c.options ?? []).filter((S) => T.some((B) => S.value === B || String(S.value) === String(B)));
|
|
2468
|
+
}
|
|
2469
|
+
function m() {
|
|
2470
|
+
return Object.values(e.state.sectionMap);
|
|
2471
|
+
}
|
|
2472
|
+
function M(c, v) {
|
|
2473
|
+
const S = m().flatMap((B) => {
|
|
2474
|
+
const k = B.key === c.key ? v : B.renderType === "table" ? B.rows : B.model;
|
|
2475
|
+
return [B.key, B.id, B.setId, B.infSetId, B.code].filter(Boolean).map((_) => [String(_), k]);
|
|
2476
|
+
});
|
|
2477
|
+
return Object.fromEntries(S);
|
|
2478
|
+
}
|
|
2479
|
+
async function f(c) {
|
|
2158
2480
|
try {
|
|
2159
|
-
await e.actions.loadFieldOptions(e.section,
|
|
2160
|
-
} catch (
|
|
2161
|
-
console.error("[GlobalInfoFormRenderer] load field options failed",
|
|
2481
|
+
await e.actions.loadFieldOptions(e.section, c, o.value);
|
|
2482
|
+
} catch (v) {
|
|
2483
|
+
console.error("[GlobalInfoFormRenderer] load field options failed", v);
|
|
2162
2484
|
}
|
|
2163
2485
|
}
|
|
2164
|
-
function
|
|
2165
|
-
const c
|
|
2486
|
+
async function y() {
|
|
2487
|
+
for (const c of r.value) {
|
|
2488
|
+
const v = o.value[c.code];
|
|
2489
|
+
if (!F(c, v)) continue;
|
|
2490
|
+
const T = Ue(e.section.key, c, o.value), S = P(c), B = a.get(S);
|
|
2491
|
+
if (on(c, B, T)) {
|
|
2492
|
+
a.set(S, T);
|
|
2493
|
+
continue;
|
|
2494
|
+
}
|
|
2495
|
+
B !== T && (a.set(S, T), await f(c));
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
be(
|
|
2499
|
+
() => e.section.key,
|
|
2500
|
+
() => {
|
|
2501
|
+
a.clear();
|
|
2502
|
+
}
|
|
2503
|
+
), be(
|
|
2504
|
+
() => e.editing,
|
|
2505
|
+
() => {
|
|
2506
|
+
y();
|
|
2507
|
+
},
|
|
2508
|
+
{ immediate: !0 }
|
|
2509
|
+
), be(
|
|
2510
|
+
() => r.value.filter((c) => He(c)).map((c) => Ue(e.section.key, c, o.value)).join("||"),
|
|
2511
|
+
() => {
|
|
2512
|
+
y();
|
|
2513
|
+
}
|
|
2514
|
+
);
|
|
2515
|
+
function p(c) {
|
|
2516
|
+
const v = o.value[c.code];
|
|
2166
2517
|
return {
|
|
2167
|
-
field:
|
|
2518
|
+
field: c,
|
|
2168
2519
|
section: e.section,
|
|
2169
2520
|
sectionView: e.section,
|
|
2170
2521
|
node: e.node,
|
|
2171
2522
|
editing: e.editing,
|
|
2172
|
-
modelValue:
|
|
2173
|
-
value:
|
|
2523
|
+
modelValue: v,
|
|
2524
|
+
value: v,
|
|
2174
2525
|
state: e.state,
|
|
2175
2526
|
actions: e.actions,
|
|
2176
|
-
updateModelValue: (
|
|
2527
|
+
updateModelValue: (T) => s(c, T)
|
|
2177
2528
|
};
|
|
2178
2529
|
}
|
|
2179
|
-
function
|
|
2180
|
-
const
|
|
2181
|
-
if (
|
|
2182
|
-
const
|
|
2183
|
-
return
|
|
2530
|
+
function w(c) {
|
|
2531
|
+
const v = String(c.id || c.key || c.code || "").trim(), T = v ? `field-${v}` : "";
|
|
2532
|
+
if (T && n[T]) return T;
|
|
2533
|
+
const S = T.toLowerCase();
|
|
2534
|
+
return S !== T && n[S] ? S : "";
|
|
2184
2535
|
}
|
|
2185
|
-
function
|
|
2186
|
-
return
|
|
2536
|
+
function C(c) {
|
|
2537
|
+
return c.span ? Math.min(Math.max(c.span, 1), 24) : 6;
|
|
2187
2538
|
}
|
|
2188
|
-
function
|
|
2189
|
-
return
|
|
2539
|
+
function P(c) {
|
|
2540
|
+
return c.key || c.id || c.code;
|
|
2190
2541
|
}
|
|
2191
|
-
function
|
|
2192
|
-
return
|
|
2542
|
+
function F(c, v) {
|
|
2543
|
+
return He(c) ? e.editing ? !0 : !Te(v) : !1;
|
|
2193
2544
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2545
|
+
function q(c) {
|
|
2546
|
+
return c.required || c.isRequired;
|
|
2547
|
+
}
|
|
2548
|
+
return (c, v) => {
|
|
2549
|
+
const T = Vt, S = Sn, B = bn, k = Pt;
|
|
2550
|
+
return b(), V(k, {
|
|
2197
2551
|
class: "global-info-form-renderer",
|
|
2198
|
-
model:
|
|
2552
|
+
model: o.value,
|
|
2199
2553
|
"label-position": "top"
|
|
2200
2554
|
}, {
|
|
2201
|
-
default:
|
|
2202
|
-
|
|
2203
|
-
default:
|
|
2204
|
-
(
|
|
2205
|
-
key:
|
|
2206
|
-
span:
|
|
2555
|
+
default: L(() => [
|
|
2556
|
+
pe(B, { gutter: 24 }, {
|
|
2557
|
+
default: L(() => [
|
|
2558
|
+
(b(!0), G(Se, null, de(r.value, (_) => (b(), V(S, {
|
|
2559
|
+
key: P(_),
|
|
2560
|
+
span: C(_)
|
|
2207
2561
|
}, {
|
|
2208
|
-
default:
|
|
2209
|
-
|
|
2210
|
-
prop:
|
|
2562
|
+
default: L(() => [
|
|
2563
|
+
pe(T, H({
|
|
2564
|
+
prop: _.code,
|
|
2211
2565
|
ref_for: !0
|
|
2212
|
-
},
|
|
2213
|
-
label:
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2566
|
+
}, _.formItemProps), {
|
|
2567
|
+
label: L(() => [
|
|
2568
|
+
D("span", oa, [
|
|
2569
|
+
q(_) ? (b(), G("span", aa, "*")) : te("", !0),
|
|
2570
|
+
Re(" " + se(_.label), 1)
|
|
2217
2571
|
])
|
|
2218
2572
|
]),
|
|
2219
|
-
default:
|
|
2220
|
-
|
|
2573
|
+
default: L(() => [
|
|
2574
|
+
w(_) ? K(c.$slots, w(_), H({
|
|
2221
2575
|
key: 0,
|
|
2222
2576
|
ref_for: !0
|
|
2223
|
-
}, p(
|
|
2577
|
+
}, p(_)), void 0, !0) : c.editing && !_.readonly ? (b(), V(tn, {
|
|
2224
2578
|
key: 1,
|
|
2225
|
-
field:
|
|
2226
|
-
"model-value":
|
|
2227
|
-
section:
|
|
2228
|
-
onLoadOptions: () =>
|
|
2229
|
-
"onUpdate:modelValue": (
|
|
2230
|
-
}, null, 8, ["field", "model-value", "section", "onLoadOptions", "onUpdate:modelValue"])) : (
|
|
2579
|
+
field: _,
|
|
2580
|
+
"model-value": o.value[_.code],
|
|
2581
|
+
section: c.section,
|
|
2582
|
+
onLoadOptions: () => f(_),
|
|
2583
|
+
"onUpdate:modelValue": (U) => s(_, U)
|
|
2584
|
+
}, null, 8, ["field", "model-value", "section", "onLoadOptions", "onUpdate:modelValue"])) : (b(), V(nn, {
|
|
2231
2585
|
key: 2,
|
|
2232
|
-
field:
|
|
2233
|
-
value:
|
|
2234
|
-
section:
|
|
2586
|
+
field: _,
|
|
2587
|
+
value: o.value[_.code],
|
|
2588
|
+
section: c.section
|
|
2235
2589
|
}, null, 8, ["field", "value", "section"]))
|
|
2236
2590
|
]),
|
|
2237
2591
|
_: 2
|
|
@@ -2247,7 +2601,7 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2247
2601
|
}, 8, ["model"]);
|
|
2248
2602
|
};
|
|
2249
2603
|
}
|
|
2250
|
-
}),
|
|
2604
|
+
}), la = /* @__PURE__ */ ie(ra, [["__scopeId", "data-v-b049423d"]]), sa = /* @__PURE__ */ ee({
|
|
2251
2605
|
name: "GlobalInfoDeleteConfirm",
|
|
2252
2606
|
__name: "GlobalInfoDeleteConfirm",
|
|
2253
2607
|
props: {
|
|
@@ -2258,8 +2612,8 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2258
2612
|
emits: ["confirm", "cancel"],
|
|
2259
2613
|
setup(t) {
|
|
2260
2614
|
return (e, n) => {
|
|
2261
|
-
const o =
|
|
2262
|
-
return
|
|
2615
|
+
const o = In;
|
|
2616
|
+
return b(), V(o, {
|
|
2263
2617
|
title: e.title,
|
|
2264
2618
|
"confirm-button-text": e.confirmText,
|
|
2265
2619
|
"cancel-button-text": e.cancelText,
|
|
@@ -2268,17 +2622,17 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2268
2622
|
onConfirm: n[0] || (n[0] = (a) => e.$emit("confirm")),
|
|
2269
2623
|
onCancel: n[1] || (n[1] = (a) => e.$emit("cancel"))
|
|
2270
2624
|
}, {
|
|
2271
|
-
reference:
|
|
2272
|
-
|
|
2625
|
+
reference: L(() => [
|
|
2626
|
+
K(e.$slots, "default")
|
|
2273
2627
|
]),
|
|
2274
2628
|
_: 3
|
|
2275
2629
|
}, 8, ["title", "confirm-button-text", "cancel-button-text"]);
|
|
2276
2630
|
};
|
|
2277
2631
|
}
|
|
2278
|
-
}),
|
|
2632
|
+
}), ia = { class: "global-info-table-renderer__table-scroll" }, ca = { class: "global-info-table-renderer__header" }, ua = {
|
|
2279
2633
|
key: 0,
|
|
2280
2634
|
class: "global-info-table-renderer__required"
|
|
2281
|
-
},
|
|
2635
|
+
}, da = /* @__PURE__ */ ee({
|
|
2282
2636
|
name: "GlobalInfoTableRenderer",
|
|
2283
2637
|
__name: "GlobalInfoTableRenderer",
|
|
2284
2638
|
props: {
|
|
@@ -2288,174 +2642,276 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2288
2642
|
state: {},
|
|
2289
2643
|
actions: {},
|
|
2290
2644
|
showAdd: { type: Boolean, default: !0 },
|
|
2291
|
-
showDelete: { type: Boolean, default: !0 }
|
|
2645
|
+
showDelete: { type: Boolean, default: !0 },
|
|
2646
|
+
renderConfig: {}
|
|
2292
2647
|
},
|
|
2293
2648
|
setup(t) {
|
|
2294
|
-
const e = t, n =
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2649
|
+
const e = t, n = Ce(), o = I(() => e.section.fields.some((h) => bt(h))), a = I(() => o.value), r = I(() => e.renderConfig?.sequenceLabel ?? "序号"), s = I(() => e.renderConfig?.sequenceWidth ?? 56), l = I(() => {
|
|
2650
|
+
const h = e.renderConfig?.sequenceStart;
|
|
2651
|
+
return typeof h == "number" && Number.isFinite(h) ? h : 1;
|
|
2652
|
+
}), d = I(() => {
|
|
2653
|
+
const h = Ye(
|
|
2654
|
+
e.section.fields,
|
|
2655
|
+
e.section,
|
|
2656
|
+
e.renderConfig,
|
|
2657
|
+
{ rows: e.section.rows, values: e.section.model }
|
|
2658
|
+
);
|
|
2659
|
+
return a.value ? h.filter((N) => !U(N)) : h;
|
|
2660
|
+
}), m = /* @__PURE__ */ new Map();
|
|
2661
|
+
function M(h) {
|
|
2662
|
+
e.actions.deleteRow(e.section, h);
|
|
2663
|
+
}
|
|
2664
|
+
function f(h, N, O, z) {
|
|
2665
|
+
const A = e.section.rows.slice(), oe = O.cascadeClearFields ?? [], X = {
|
|
2666
|
+
...h,
|
|
2667
|
+
__rowKey: ge(h),
|
|
2668
|
+
[O.code]: z
|
|
2303
2669
|
};
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
}),
|
|
2307
|
-
...
|
|
2308
|
-
}, e.actions.updateTableRows(e.section,
|
|
2670
|
+
oe.forEach((x) => {
|
|
2671
|
+
X[x] = "";
|
|
2672
|
+
}), A[N] = {
|
|
2673
|
+
...X
|
|
2674
|
+
}, e.actions.updateTableRows(e.section, A), y(O, z, X, N, A);
|
|
2675
|
+
}
|
|
2676
|
+
function y(h, N, O, z, A) {
|
|
2677
|
+
const oe = e.renderConfig?.onFieldBusinessChange;
|
|
2678
|
+
if (oe)
|
|
2679
|
+
try {
|
|
2680
|
+
const X = p(h, N), x = { ...e.section.model, ...O }, ce = {
|
|
2681
|
+
field: h,
|
|
2682
|
+
value: N,
|
|
2683
|
+
section: e.section,
|
|
2684
|
+
model: x,
|
|
2685
|
+
values: x,
|
|
2686
|
+
row: O,
|
|
2687
|
+
rowIndex: z,
|
|
2688
|
+
rows: A,
|
|
2689
|
+
node: e.node,
|
|
2690
|
+
activeNode: e.node,
|
|
2691
|
+
sections: w(),
|
|
2692
|
+
sectionValues: C(e.section, A),
|
|
2693
|
+
actions: e.actions,
|
|
2694
|
+
selectedOption: X[0],
|
|
2695
|
+
selectedOptions: X
|
|
2696
|
+
};
|
|
2697
|
+
Promise.resolve(oe(ce)).catch((Ie) => {
|
|
2698
|
+
console.error("[GlobalInfoTableRenderer] field business change failed", Ie);
|
|
2699
|
+
});
|
|
2700
|
+
} catch (X) {
|
|
2701
|
+
console.error("[GlobalInfoTableRenderer] field business change failed", X);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
function p(h, N) {
|
|
2705
|
+
const O = Ze(h, N);
|
|
2706
|
+
return (h.options ?? []).filter((z) => O.some((A) => z.value === A || String(z.value) === String(A)));
|
|
2707
|
+
}
|
|
2708
|
+
function w() {
|
|
2709
|
+
return Object.values(e.state.sectionMap);
|
|
2309
2710
|
}
|
|
2310
|
-
|
|
2711
|
+
function C(h, N) {
|
|
2712
|
+
const z = w().flatMap((A) => {
|
|
2713
|
+
const oe = A.key === h.key ? N : A.renderType === "table" ? A.rows : A.model;
|
|
2714
|
+
return [A.key, A.id, A.setId, A.infSetId, A.code].filter(Boolean).map((X) => [String(X), oe]);
|
|
2715
|
+
});
|
|
2716
|
+
return Object.fromEntries(z);
|
|
2717
|
+
}
|
|
2718
|
+
async function P(h, N) {
|
|
2311
2719
|
try {
|
|
2312
|
-
await e.actions.loadFieldOptions(e.section,
|
|
2313
|
-
} catch (
|
|
2314
|
-
console.error("[GlobalInfoTableRenderer] load field options failed",
|
|
2720
|
+
await e.actions.loadFieldOptions(e.section, h, N);
|
|
2721
|
+
} catch (O) {
|
|
2722
|
+
console.error("[GlobalInfoTableRenderer] load field options failed", O);
|
|
2315
2723
|
}
|
|
2316
2724
|
}
|
|
2317
|
-
function
|
|
2318
|
-
const
|
|
2725
|
+
async function F() {
|
|
2726
|
+
for (const h of e.section.rows) {
|
|
2727
|
+
const N = ge(h);
|
|
2728
|
+
for (const O of d.value) {
|
|
2729
|
+
const z = h[O.code];
|
|
2730
|
+
if (!T(O, z)) continue;
|
|
2731
|
+
const A = Ue(e.section.key, O, h, N), oe = `${N}:${k(O)}`, X = m.get(oe);
|
|
2732
|
+
if (on(O, X, A)) {
|
|
2733
|
+
m.set(oe, A);
|
|
2734
|
+
continue;
|
|
2735
|
+
}
|
|
2736
|
+
X !== A && (m.set(oe, A), await P(O, h));
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
function q(h, N, O) {
|
|
2741
|
+
const z = N[h.code];
|
|
2319
2742
|
return {
|
|
2320
|
-
field:
|
|
2743
|
+
field: h,
|
|
2321
2744
|
section: e.section,
|
|
2322
2745
|
sectionView: e.section,
|
|
2323
2746
|
node: e.node,
|
|
2324
|
-
row:
|
|
2325
|
-
rowIndex:
|
|
2747
|
+
row: N,
|
|
2748
|
+
rowIndex: O,
|
|
2326
2749
|
editing: e.editing,
|
|
2327
|
-
modelValue:
|
|
2328
|
-
value:
|
|
2750
|
+
modelValue: z,
|
|
2751
|
+
value: z,
|
|
2329
2752
|
state: e.state,
|
|
2330
2753
|
actions: e.actions,
|
|
2331
|
-
updateModelValue: (
|
|
2754
|
+
updateModelValue: (A) => f(N, O, h, A)
|
|
2332
2755
|
};
|
|
2333
2756
|
}
|
|
2334
|
-
function
|
|
2335
|
-
const
|
|
2336
|
-
if (
|
|
2337
|
-
const
|
|
2338
|
-
return
|
|
2339
|
-
}
|
|
2340
|
-
function
|
|
2341
|
-
return !
|
|
2342
|
-
}
|
|
2343
|
-
function
|
|
2344
|
-
return
|
|
2345
|
-
}
|
|
2346
|
-
function
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
}
|
|
2353
|
-
function
|
|
2354
|
-
return
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2757
|
+
function c(h) {
|
|
2758
|
+
const N = String(h.id || h.key || h.code || "").trim(), O = N ? `field-${N}` : "";
|
|
2759
|
+
if (O && n[O]) return O;
|
|
2760
|
+
const z = O.toLowerCase();
|
|
2761
|
+
return z !== O && n[z] ? z : "";
|
|
2762
|
+
}
|
|
2763
|
+
function v(h) {
|
|
2764
|
+
return !h.readonly && !h.disabled;
|
|
2765
|
+
}
|
|
2766
|
+
function T(h, N) {
|
|
2767
|
+
return He(h) ? e.editing ? !0 : !Te(N) : !1;
|
|
2768
|
+
}
|
|
2769
|
+
function S(h) {
|
|
2770
|
+
return h.width ?? (ht(h) ? 56 : void 0);
|
|
2771
|
+
}
|
|
2772
|
+
function B(h) {
|
|
2773
|
+
if (!h.width)
|
|
2774
|
+
return h.minWidth ?? (ht(h) ? 56 : void 0);
|
|
2775
|
+
}
|
|
2776
|
+
function k(h) {
|
|
2777
|
+
return h.key || h.id || h.code;
|
|
2778
|
+
}
|
|
2779
|
+
function _(h) {
|
|
2780
|
+
return l.value + h;
|
|
2781
|
+
}
|
|
2782
|
+
function U(h) {
|
|
2783
|
+
return bt(h);
|
|
2784
|
+
}
|
|
2785
|
+
let me = 0;
|
|
2786
|
+
const Q = /* @__PURE__ */ new WeakMap();
|
|
2787
|
+
function ge(h) {
|
|
2788
|
+
const N = h.__rowKey ?? h.key ?? h.id ?? h.setId ?? h.infSetId;
|
|
2789
|
+
if (N != null && N !== "") return String(N);
|
|
2790
|
+
const O = h, z = Q.get(O);
|
|
2791
|
+
if (z) return z;
|
|
2792
|
+
me += 1;
|
|
2793
|
+
const A = `local-${me}`;
|
|
2794
|
+
return Q.set(O, A), A;
|
|
2795
|
+
}
|
|
2796
|
+
function Pe(h) {
|
|
2797
|
+
return h.required || h.isRequired;
|
|
2798
|
+
}
|
|
2799
|
+
return be(
|
|
2800
|
+
() => e.section.key,
|
|
2801
|
+
() => {
|
|
2802
|
+
m.clear();
|
|
2803
|
+
}
|
|
2804
|
+
), be(
|
|
2805
|
+
() => e.editing,
|
|
2806
|
+
() => {
|
|
2807
|
+
F();
|
|
2808
|
+
},
|
|
2809
|
+
{ immediate: !0 }
|
|
2810
|
+
), be(
|
|
2811
|
+
() => e.section.rows.flatMap((h) => d.value.filter((N) => He(N)).map((N) => Ue(e.section.key, N, h, ge(h)))).join("||"),
|
|
2812
|
+
() => {
|
|
2813
|
+
F();
|
|
2814
|
+
}
|
|
2815
|
+
), (h, N) => {
|
|
2816
|
+
const O = Nt, z = fn("Delete"), A = Tt, oe = lt, X = Lt;
|
|
2817
|
+
return b(), G("div", {
|
|
2818
|
+
class: Ge(["global-info-table-renderer", { "global-info-table-renderer--editing": h.editing }])
|
|
2819
|
+
}, [
|
|
2820
|
+
D("div", ia, [
|
|
2821
|
+
pe(X, {
|
|
2375
2822
|
class: "global-info-table-renderer__table",
|
|
2376
|
-
data:
|
|
2377
|
-
|
|
2823
|
+
data: h.section.rows,
|
|
2824
|
+
fit: !0,
|
|
2825
|
+
"table-layout": "auto",
|
|
2826
|
+
"row-key": ge
|
|
2378
2827
|
}, {
|
|
2379
|
-
default:
|
|
2380
|
-
|
|
2381
|
-
key:
|
|
2382
|
-
|
|
2383
|
-
label:
|
|
2384
|
-
width:
|
|
2385
|
-
|
|
2828
|
+
default: L(() => [
|
|
2829
|
+
a.value ? (b(), V(O, {
|
|
2830
|
+
key: 0,
|
|
2831
|
+
type: "index",
|
|
2832
|
+
label: r.value,
|
|
2833
|
+
width: s.value,
|
|
2834
|
+
index: _
|
|
2835
|
+
}, null, 8, ["label", "width"])) : te("", !0),
|
|
2836
|
+
(b(!0), G(Se, null, de(d.value, (x) => (b(), V(O, {
|
|
2837
|
+
key: k(x),
|
|
2838
|
+
prop: x.code,
|
|
2839
|
+
label: x.label,
|
|
2840
|
+
width: S(x),
|
|
2841
|
+
"min-width": B(x)
|
|
2386
2842
|
}, {
|
|
2387
|
-
header:
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2843
|
+
header: L(() => [
|
|
2844
|
+
D("span", ca, [
|
|
2845
|
+
Pe(x) ? (b(), G("span", ua, "*")) : te("", !0),
|
|
2846
|
+
D("span", null, se(x.label), 1)
|
|
2391
2847
|
])
|
|
2392
2848
|
]),
|
|
2393
|
-
default:
|
|
2394
|
-
|
|
2849
|
+
default: L(({ row: ce, $index: Ie }) => [
|
|
2850
|
+
c(x) ? K(h.$slots, c(x), H({
|
|
2395
2851
|
key: 0,
|
|
2396
2852
|
ref_for: !0
|
|
2397
|
-
},
|
|
2853
|
+
}, q(x, ce, Ie)), void 0, !0) : h.editing && v(x) ? (b(), V(tn, {
|
|
2398
2854
|
key: 1,
|
|
2399
|
-
field:
|
|
2400
|
-
"model-value":
|
|
2401
|
-
section:
|
|
2402
|
-
row:
|
|
2403
|
-
"row-index":
|
|
2404
|
-
onLoadOptions: () =>
|
|
2405
|
-
"onUpdate:modelValue": (
|
|
2406
|
-
}, null, 8, ["field", "model-value", "section", "row", "row-index", "onLoadOptions", "onUpdate:modelValue"])) : (
|
|
2855
|
+
field: x,
|
|
2856
|
+
"model-value": ce[x.code],
|
|
2857
|
+
section: h.section,
|
|
2858
|
+
row: ce,
|
|
2859
|
+
"row-index": Ie,
|
|
2860
|
+
onLoadOptions: () => P(x, ce),
|
|
2861
|
+
"onUpdate:modelValue": (Ve) => f(ce, Ie, x, Ve)
|
|
2862
|
+
}, null, 8, ["field", "model-value", "section", "row", "row-index", "onLoadOptions", "onUpdate:modelValue"])) : (b(), V(nn, {
|
|
2407
2863
|
key: 2,
|
|
2408
|
-
field:
|
|
2409
|
-
value:
|
|
2410
|
-
section:
|
|
2411
|
-
row:
|
|
2412
|
-
"row-index":
|
|
2864
|
+
field: x,
|
|
2865
|
+
value: ce[x.code],
|
|
2866
|
+
section: h.section,
|
|
2867
|
+
row: ce,
|
|
2868
|
+
"row-index": Ie
|
|
2413
2869
|
}, null, 8, ["field", "value", "section", "row", "row-index"]))
|
|
2414
2870
|
]),
|
|
2415
2871
|
_: 2
|
|
2416
2872
|
}, 1032, ["prop", "label", "width", "min-width"]))), 128)),
|
|
2417
|
-
|
|
2418
|
-
key:
|
|
2873
|
+
h.editing ? (b(), V(O, {
|
|
2874
|
+
key: 1,
|
|
2419
2875
|
label: "操作",
|
|
2420
2876
|
width: "104",
|
|
2421
2877
|
fixed: "right"
|
|
2422
2878
|
}, {
|
|
2423
|
-
default:
|
|
2424
|
-
|
|
2879
|
+
default: L(({ $index: x }) => [
|
|
2880
|
+
h.showDelete ? (b(), V(sa, {
|
|
2425
2881
|
key: 0,
|
|
2426
|
-
onConfirm: (
|
|
2882
|
+
onConfirm: (ce) => M(x)
|
|
2427
2883
|
}, {
|
|
2428
|
-
default:
|
|
2429
|
-
|
|
2884
|
+
default: L(() => [
|
|
2885
|
+
pe(oe, {
|
|
2430
2886
|
class: "global-info-table-renderer__delete",
|
|
2431
2887
|
link: "",
|
|
2432
2888
|
type: "danger"
|
|
2433
2889
|
}, {
|
|
2434
|
-
default:
|
|
2435
|
-
|
|
2436
|
-
default:
|
|
2437
|
-
|
|
2890
|
+
default: L(() => [
|
|
2891
|
+
pe(A, { class: "global-info-table-renderer__delete-icon" }, {
|
|
2892
|
+
default: L(() => [
|
|
2893
|
+
pe(z)
|
|
2438
2894
|
]),
|
|
2439
2895
|
_: 1
|
|
2440
2896
|
}),
|
|
2441
|
-
|
|
2897
|
+
N[0] || (N[0] = Re(" 删除 "))
|
|
2442
2898
|
]),
|
|
2443
2899
|
_: 1
|
|
2444
2900
|
})
|
|
2445
2901
|
]),
|
|
2446
2902
|
_: 2
|
|
2447
|
-
}, 1032, ["onConfirm"])) :
|
|
2903
|
+
}, 1032, ["onConfirm"])) : te("", !0)
|
|
2448
2904
|
]),
|
|
2449
2905
|
_: 1
|
|
2450
|
-
})) :
|
|
2906
|
+
})) : te("", !0)
|
|
2451
2907
|
]),
|
|
2452
2908
|
_: 3
|
|
2453
2909
|
}, 8, ["data"])
|
|
2454
2910
|
])
|
|
2455
|
-
]);
|
|
2911
|
+
], 2);
|
|
2456
2912
|
};
|
|
2457
2913
|
}
|
|
2458
|
-
}),
|
|
2914
|
+
}), fa = /* @__PURE__ */ ie(da, [["__scopeId", "data-v-5a2ec852"]]), pa = /* @__PURE__ */ ee({
|
|
2459
2915
|
name: "GlobalInfoAutoRenderer",
|
|
2460
2916
|
__name: "GlobalInfoAutoRenderer",
|
|
2461
2917
|
props: {
|
|
@@ -2463,26 +2919,29 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2463
2919
|
node: {},
|
|
2464
2920
|
editing: { type: Boolean },
|
|
2465
2921
|
state: {},
|
|
2466
|
-
actions: {}
|
|
2922
|
+
actions: {},
|
|
2923
|
+
renderConfig: {}
|
|
2467
2924
|
},
|
|
2468
2925
|
setup(t) {
|
|
2469
|
-
return (e, n) => e.section.renderType === "table" ? (
|
|
2926
|
+
return (e, n) => e.section.renderType === "table" ? (b(), V(fa, {
|
|
2470
2927
|
key: 0,
|
|
2471
2928
|
section: e.section,
|
|
2472
2929
|
node: e.node,
|
|
2473
2930
|
editing: e.editing,
|
|
2474
2931
|
state: e.state,
|
|
2475
|
-
actions: e.actions
|
|
2476
|
-
|
|
2932
|
+
actions: e.actions,
|
|
2933
|
+
"render-config": e.renderConfig
|
|
2934
|
+
}, null, 8, ["section", "node", "editing", "state", "actions", "render-config"])) : (b(), V(la, {
|
|
2477
2935
|
key: 1,
|
|
2478
2936
|
section: e.section,
|
|
2479
2937
|
node: e.node,
|
|
2480
2938
|
editing: e.editing,
|
|
2481
2939
|
state: e.state,
|
|
2482
|
-
actions: e.actions
|
|
2483
|
-
|
|
2940
|
+
actions: e.actions,
|
|
2941
|
+
"render-config": e.renderConfig
|
|
2942
|
+
}, null, 8, ["section", "node", "editing", "state", "actions", "render-config"]));
|
|
2484
2943
|
}
|
|
2485
|
-
}),
|
|
2944
|
+
}), ma = /* @__PURE__ */ ee({
|
|
2486
2945
|
name: "GlobalInfoSectionOutlet",
|
|
2487
2946
|
__name: "GlobalInfoSectionOutlet",
|
|
2488
2947
|
props: {
|
|
@@ -2490,45 +2949,56 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2490
2949
|
node: {},
|
|
2491
2950
|
editing: { type: Boolean },
|
|
2492
2951
|
state: {},
|
|
2493
|
-
actions: {}
|
|
2952
|
+
actions: {},
|
|
2953
|
+
renderConfig: {}
|
|
2494
2954
|
},
|
|
2495
2955
|
setup(t) {
|
|
2496
|
-
const e = t, n =
|
|
2497
|
-
|
|
2956
|
+
const e = t, n = Ce(), o = I(() => Ye(
|
|
2957
|
+
e.section.fields,
|
|
2958
|
+
e.section,
|
|
2959
|
+
e.renderConfig,
|
|
2960
|
+
{
|
|
2961
|
+
values: e.section.model,
|
|
2962
|
+
rows: e.section.renderType === "table" ? e.section.rows : void 0
|
|
2963
|
+
}
|
|
2964
|
+
)), a = I(() => e.editing ?? e.actions.isEditing(e.section)), r = I(() => e.section.renderType === "table" && e.section.rows.length === 0 || o.value.length === 0), s = I(() => {
|
|
2965
|
+
const m = l(e.section.id || e.section.key), M = d(e.section.renderType);
|
|
2498
2966
|
return [
|
|
2499
|
-
|
|
2500
|
-
|
|
2967
|
+
m,
|
|
2968
|
+
M,
|
|
2501
2969
|
"default"
|
|
2502
|
-
].find((
|
|
2970
|
+
].find((f) => !!(f && n[f])) ?? "";
|
|
2503
2971
|
});
|
|
2504
|
-
function
|
|
2505
|
-
const
|
|
2506
|
-
return
|
|
2972
|
+
function l(m) {
|
|
2973
|
+
const M = String(m ?? "").trim();
|
|
2974
|
+
return M ? `section-${M}` : "";
|
|
2507
2975
|
}
|
|
2508
|
-
function
|
|
2509
|
-
return
|
|
2976
|
+
function d(m) {
|
|
2977
|
+
return m === "form" || m === "table" ? m : "";
|
|
2510
2978
|
}
|
|
2511
|
-
return (
|
|
2979
|
+
return (m, M) => s.value ? K(m.$slots, s.value, {
|
|
2512
2980
|
key: 0,
|
|
2513
|
-
section:
|
|
2514
|
-
sectionView:
|
|
2515
|
-
node:
|
|
2516
|
-
editing:
|
|
2517
|
-
isEmpty:
|
|
2518
|
-
empty:
|
|
2519
|
-
fields:
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2981
|
+
section: m.section,
|
|
2982
|
+
sectionView: m.section,
|
|
2983
|
+
node: m.node,
|
|
2984
|
+
editing: a.value,
|
|
2985
|
+
isEmpty: r.value,
|
|
2986
|
+
empty: r.value,
|
|
2987
|
+
fields: o.value,
|
|
2988
|
+
renderConfig: m.renderConfig,
|
|
2989
|
+
state: m.state,
|
|
2990
|
+
actions: m.actions
|
|
2991
|
+
}) : (b(), V(pa, {
|
|
2523
2992
|
key: 1,
|
|
2524
|
-
section:
|
|
2525
|
-
node:
|
|
2526
|
-
editing:
|
|
2527
|
-
state:
|
|
2528
|
-
actions:
|
|
2529
|
-
|
|
2993
|
+
section: m.section,
|
|
2994
|
+
node: m.node,
|
|
2995
|
+
editing: a.value,
|
|
2996
|
+
state: m.state,
|
|
2997
|
+
actions: m.actions,
|
|
2998
|
+
"render-config": m.renderConfig
|
|
2999
|
+
}, null, 8, ["section", "node", "editing", "state", "actions", "render-config"]));
|
|
2530
3000
|
}
|
|
2531
|
-
}),
|
|
3001
|
+
}), va = ee({
|
|
2532
3002
|
name: "GlobalInfoSlotErrorBoundary",
|
|
2533
3003
|
props: {
|
|
2534
3004
|
boundaryKey: {
|
|
@@ -2544,13 +3014,13 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2544
3014
|
error: (t) => !0
|
|
2545
3015
|
},
|
|
2546
3016
|
setup(t, { emit: e, slots: n }) {
|
|
2547
|
-
const o =
|
|
2548
|
-
|
|
3017
|
+
const o = le(!1);
|
|
3018
|
+
be(
|
|
2549
3019
|
() => t.boundaryKey,
|
|
2550
3020
|
() => {
|
|
2551
3021
|
o.value = !1;
|
|
2552
3022
|
}
|
|
2553
|
-
),
|
|
3023
|
+
), pn((r) => (a(r), !1));
|
|
2554
3024
|
function a(r) {
|
|
2555
3025
|
o.value = !0, console.error(`[GlobalInfoSlotErrorBoundary] ${t.label || "section"} slot render failed`, r), e("error", r);
|
|
2556
3026
|
}
|
|
@@ -2564,13 +3034,13 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2564
3034
|
}
|
|
2565
3035
|
};
|
|
2566
3036
|
}
|
|
2567
|
-
}),
|
|
3037
|
+
}), ga = { class: "global-info-section-block" }, ya = {
|
|
2568
3038
|
key: 0,
|
|
2569
3039
|
class: "global-info-section-block__header"
|
|
2570
|
-
},
|
|
3040
|
+
}, ha = { class: "global-info-section-block__title-wrap" }, ba = { class: "global-info-section-block__title" }, Sa = {
|
|
2571
3041
|
key: 0,
|
|
2572
3042
|
class: "global-info-section-block__actions"
|
|
2573
|
-
},
|
|
3043
|
+
}, Ia = ["src"], wa = { class: "global-info-section-block__body" }, _a = /* @__PURE__ */ ee({
|
|
2574
3044
|
name: "GlobalInfoSectionBlock",
|
|
2575
3045
|
__name: "GlobalInfoSectionBlock",
|
|
2576
3046
|
props: {
|
|
@@ -2578,180 +3048,188 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2578
3048
|
state: {},
|
|
2579
3049
|
actions: {},
|
|
2580
3050
|
hideHeader: { type: Boolean },
|
|
3051
|
+
renderConfig: {},
|
|
2581
3052
|
onEdit: { type: Function },
|
|
2582
3053
|
onCancel: { type: Function },
|
|
2583
3054
|
onSave: { type: Function }
|
|
2584
3055
|
},
|
|
2585
3056
|
setup(t) {
|
|
2586
|
-
const e = t, n =
|
|
2587
|
-
const
|
|
2588
|
-
return
|
|
2589
|
-
|
|
3057
|
+
const e = t, n = Ce(), o = le(!1), a = le(null), r = le(null), s = I(() => !!e.hideHeader), l = I(() => e.actions.getSectionStatus(e.node)), d = I(() => e.actions.getSection(e.node) ?? r.value), m = I(() => {
|
|
3058
|
+
const k = d.value;
|
|
3059
|
+
return k ? Ye(k.fields, k, e.renderConfig, {
|
|
3060
|
+
values: k.model,
|
|
3061
|
+
rows: k.renderType === "table" ? k.rows : void 0
|
|
3062
|
+
}) : [];
|
|
3063
|
+
}), M = I(() => d.value?.title || e.node.tagName || e.node.label || "-"), f = I(() => !!(d.value && e.actions.isEditing(d.value))), y = I(() => d.value?.renderType === "table"), p = I(() => o.value || l.value.loading), w = I(() => F(a.value || l.value.error)), C = I(() => {
|
|
3064
|
+
const k = d.value;
|
|
3065
|
+
return k ? k.renderType === "table" && k.rows.length === 0 || m.value.length === 0 : !0;
|
|
3066
|
+
}), P = I(() => ({
|
|
2590
3067
|
node: e.node,
|
|
2591
|
-
section:
|
|
2592
|
-
sectionView:
|
|
2593
|
-
fields:
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
3068
|
+
section: d.value,
|
|
3069
|
+
sectionView: d.value,
|
|
3070
|
+
fields: m.value,
|
|
3071
|
+
renderConfig: e.renderConfig,
|
|
3072
|
+
title: M.value,
|
|
3073
|
+
editing: f.value,
|
|
3074
|
+
loading: p.value,
|
|
3075
|
+
error: a.value || l.value.error,
|
|
3076
|
+
errorMessage: w.value,
|
|
3077
|
+
isEmpty: C.value,
|
|
3078
|
+
empty: C.value,
|
|
3079
|
+
sectionStatus: l.value,
|
|
2602
3080
|
state: e.state,
|
|
2603
3081
|
actions: e.actions,
|
|
2604
|
-
reload:
|
|
2605
|
-
handleEdit:
|
|
2606
|
-
handleCancel:
|
|
2607
|
-
handleAddTableRow:
|
|
2608
|
-
handleSave:
|
|
3082
|
+
reload: B,
|
|
3083
|
+
handleEdit: q,
|
|
3084
|
+
handleCancel: c,
|
|
3085
|
+
handleAddTableRow: v,
|
|
3086
|
+
handleSave: T
|
|
2609
3087
|
}));
|
|
2610
|
-
function
|
|
2611
|
-
return
|
|
2612
|
-
}
|
|
2613
|
-
async function
|
|
2614
|
-
const
|
|
2615
|
-
|
|
2616
|
-
}
|
|
2617
|
-
async function
|
|
2618
|
-
const
|
|
2619
|
-
|
|
2620
|
-
}
|
|
2621
|
-
function
|
|
2622
|
-
const
|
|
2623
|
-
if (!
|
|
2624
|
-
const
|
|
2625
|
-
e.actions.saveRow(
|
|
2626
|
-
}
|
|
2627
|
-
async function
|
|
2628
|
-
const
|
|
2629
|
-
if (
|
|
3088
|
+
function F(k) {
|
|
3089
|
+
return k ? k instanceof Error ? k.message : String(k) : "";
|
|
3090
|
+
}
|
|
3091
|
+
async function q() {
|
|
3092
|
+
const k = d.value;
|
|
3093
|
+
k && (await e.onEdit?.(k, e.node), e.onEdit || e.actions.startEdit(k));
|
|
3094
|
+
}
|
|
3095
|
+
async function c() {
|
|
3096
|
+
const k = d.value;
|
|
3097
|
+
k && (await e.onCancel?.(k, e.node), e.onCancel || e.actions.cancelEdit(k));
|
|
3098
|
+
}
|
|
3099
|
+
function v() {
|
|
3100
|
+
const k = d.value;
|
|
3101
|
+
if (!k) return;
|
|
3102
|
+
const _ = k.fields.reduce((U, me) => (U[me.code] = me.value ?? "", U), { __rowKey: `new-${Date.now()}` });
|
|
3103
|
+
e.actions.saveRow(k, _, -1);
|
|
3104
|
+
}
|
|
3105
|
+
async function T() {
|
|
3106
|
+
const k = d.value;
|
|
3107
|
+
if (k)
|
|
2630
3108
|
try {
|
|
2631
3109
|
if (e.onSave) {
|
|
2632
|
-
await e.onSave(
|
|
3110
|
+
await e.onSave(k, e.node);
|
|
2633
3111
|
return;
|
|
2634
3112
|
}
|
|
2635
|
-
await e.actions.saveSection(
|
|
2636
|
-
} catch (
|
|
2637
|
-
a.value =
|
|
3113
|
+
await e.actions.saveSection(k);
|
|
3114
|
+
} catch (_) {
|
|
3115
|
+
a.value = _, console.error("[GlobalInfoSectionBlock] save section failed", _);
|
|
2638
3116
|
}
|
|
2639
3117
|
}
|
|
2640
|
-
function
|
|
2641
|
-
a.value =
|
|
3118
|
+
function S(k) {
|
|
3119
|
+
a.value = k;
|
|
2642
3120
|
}
|
|
2643
|
-
async function
|
|
3121
|
+
async function B() {
|
|
2644
3122
|
o.value = !0, a.value = null, r.value = null;
|
|
2645
3123
|
try {
|
|
2646
3124
|
r.value = await e.actions.loadSection(e.node);
|
|
2647
|
-
} catch (
|
|
2648
|
-
a.value =
|
|
3125
|
+
} catch (k) {
|
|
3126
|
+
a.value = k, console.error("[GlobalInfoSectionBlock] load section failed", k);
|
|
2649
3127
|
} finally {
|
|
2650
3128
|
o.value = !1;
|
|
2651
3129
|
}
|
|
2652
3130
|
}
|
|
2653
|
-
return
|
|
2654
|
-
|
|
2655
|
-
}),
|
|
3131
|
+
return $t(() => {
|
|
3132
|
+
B();
|
|
3133
|
+
}), be(
|
|
2656
3134
|
() => e.node.key,
|
|
2657
3135
|
() => {
|
|
2658
|
-
|
|
3136
|
+
B();
|
|
2659
3137
|
}
|
|
2660
|
-
), (
|
|
2661
|
-
const
|
|
2662
|
-
return
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
3138
|
+
), (k, _) => {
|
|
3139
|
+
const U = lt;
|
|
3140
|
+
return b(), G("section", ga, [
|
|
3141
|
+
s.value ? te("", !0) : (b(), G("header", ya, [
|
|
3142
|
+
K(k.$slots, "header", he(_e(P.value)), () => [
|
|
3143
|
+
D("div", ha, [
|
|
3144
|
+
_[0] || (_[0] = D("span", { class: "global-info-section-block__marker" }, null, -1)),
|
|
3145
|
+
D("h3", ba, se(M.value), 1)
|
|
2668
3146
|
]),
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
3147
|
+
K(k.$slots, "actions", he(_e(P.value)), () => [
|
|
3148
|
+
d.value ? (b(), G("div", Sa, [
|
|
3149
|
+
f.value ? (b(), G(Se, { key: 1 }, [
|
|
3150
|
+
pe(U, {
|
|
2673
3151
|
class: "global-info-section-block__cancel",
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
onClick: i
|
|
3152
|
+
disabled: l.value.saving,
|
|
3153
|
+
onClick: c
|
|
2677
3154
|
}, {
|
|
2678
|
-
default:
|
|
2679
|
-
|
|
3155
|
+
default: L(() => _[2] || (_[2] = [
|
|
3156
|
+
Re(" 取消 ")
|
|
2680
3157
|
])),
|
|
2681
3158
|
_: 1
|
|
2682
3159
|
}, 8, ["disabled"]),
|
|
2683
|
-
|
|
3160
|
+
y.value ? (b(), V(U, {
|
|
2684
3161
|
key: 0,
|
|
2685
3162
|
class: "global-info-section-block__add",
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
onClick: g
|
|
3163
|
+
disabled: l.value.saving,
|
|
3164
|
+
onClick: v
|
|
2689
3165
|
}, {
|
|
2690
|
-
default:
|
|
2691
|
-
|
|
3166
|
+
default: L(() => _[3] || (_[3] = [
|
|
3167
|
+
Re(" 新增 ")
|
|
2692
3168
|
])),
|
|
2693
3169
|
_: 1
|
|
2694
|
-
}, 8, ["disabled"])) :
|
|
2695
|
-
|
|
3170
|
+
}, 8, ["disabled"])) : te("", !0),
|
|
3171
|
+
pe(U, {
|
|
2696
3172
|
class: "global-info-section-block__confirm",
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
loading: p.value.saving,
|
|
2700
|
-
onClick: I
|
|
3173
|
+
loading: l.value.saving,
|
|
3174
|
+
onClick: T
|
|
2701
3175
|
}, {
|
|
2702
|
-
default:
|
|
2703
|
-
|
|
3176
|
+
default: L(() => [
|
|
3177
|
+
Re(se(y.value ? "确认" : "保存"), 1)
|
|
2704
3178
|
]),
|
|
2705
3179
|
_: 1
|
|
2706
3180
|
}, 8, ["loading"])
|
|
2707
|
-
], 64)) : (
|
|
3181
|
+
], 64)) : (b(), V(U, {
|
|
2708
3182
|
key: 0,
|
|
2709
3183
|
class: "global-info-section-block__edit",
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
disabled: p.value.saving || d.value,
|
|
2713
|
-
onClick: B
|
|
3184
|
+
disabled: l.value.saving || p.value,
|
|
3185
|
+
onClick: q
|
|
2714
3186
|
}, {
|
|
2715
|
-
default:
|
|
2716
|
-
|
|
2717
|
-
|
|
3187
|
+
default: L(() => [
|
|
3188
|
+
D("img", {
|
|
3189
|
+
class: "global-info-section-block__edit-icon",
|
|
3190
|
+
src: J(Ao),
|
|
3191
|
+
alt: ""
|
|
3192
|
+
}, null, 8, Ia),
|
|
3193
|
+
_[1] || (_[1] = D("span", null, "编辑", -1))
|
|
3194
|
+
]),
|
|
2718
3195
|
_: 1
|
|
2719
3196
|
}, 8, ["disabled"]))
|
|
2720
|
-
])) :
|
|
3197
|
+
])) : te("", !0)
|
|
2721
3198
|
], !0)
|
|
2722
3199
|
], !0)
|
|
2723
3200
|
])),
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
], !0) : !
|
|
2728
|
-
|
|
2729
|
-
], !0) : (
|
|
3201
|
+
D("div", wa, [
|
|
3202
|
+
p.value ? K(k.$slots, "loading", he(H({ key: 0 }, P.value)), () => [
|
|
3203
|
+
_[4] || (_[4] = D("div", { class: "global-info-section-block__status" }, "加载中...", -1))
|
|
3204
|
+
], !0) : !d.value || C.value ? K(k.$slots, "empty", he(H({ key: 1 }, P.value)), () => [
|
|
3205
|
+
_[5] || (_[5] = D("div", { class: "global-info-section-block__status" }, "暂无数据", -1))
|
|
3206
|
+
], !0) : (b(), V(va, {
|
|
2730
3207
|
key: 2,
|
|
2731
|
-
"boundary-key":
|
|
2732
|
-
label:
|
|
2733
|
-
onError:
|
|
3208
|
+
"boundary-key": k.node.key,
|
|
3209
|
+
label: M.value,
|
|
3210
|
+
onError: S
|
|
2734
3211
|
}, {
|
|
2735
|
-
fallback:
|
|
2736
|
-
|
|
2737
|
-
|
|
3212
|
+
fallback: L(() => [
|
|
3213
|
+
K(k.$slots, "empty", he(_e(P.value)), () => [
|
|
3214
|
+
_[6] || (_[6] = D("div", { class: "global-info-section-block__status" }, "暂无数据", -1))
|
|
2738
3215
|
], !0)
|
|
2739
3216
|
]),
|
|
2740
|
-
default:
|
|
2741
|
-
|
|
2742
|
-
section:
|
|
2743
|
-
node:
|
|
2744
|
-
editing:
|
|
2745
|
-
state:
|
|
2746
|
-
actions:
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
3217
|
+
default: L(() => [
|
|
3218
|
+
pe(ma, {
|
|
3219
|
+
section: d.value,
|
|
3220
|
+
node: k.node,
|
|
3221
|
+
editing: f.value,
|
|
3222
|
+
state: k.state,
|
|
3223
|
+
actions: k.actions,
|
|
3224
|
+
"render-config": k.renderConfig
|
|
3225
|
+
}, Me({ _: 2 }, [
|
|
3226
|
+
de(J(n), (me, Q) => ({
|
|
3227
|
+
name: Q,
|
|
3228
|
+
fn: L((ge) => [
|
|
3229
|
+
K(k.$slots, Q, he(_e({ ...P.value, ...ge })), void 0, !0)
|
|
2752
3230
|
])
|
|
2753
3231
|
}))
|
|
2754
|
-
]), 1032, ["section", "node", "editing", "state", "actions"])
|
|
3232
|
+
]), 1032, ["section", "node", "editing", "state", "actions", "render-config"])
|
|
2755
3233
|
]),
|
|
2756
3234
|
_: 3
|
|
2757
3235
|
}, 8, ["boundary-key", "label"]))
|
|
@@ -2759,7 +3237,7 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2759
3237
|
]);
|
|
2760
3238
|
};
|
|
2761
3239
|
}
|
|
2762
|
-
}),
|
|
3240
|
+
}), Ca = /* @__PURE__ */ ie(_a, [["__scopeId", "data-v-6c47a274"]]), ka = { class: "global-info-group" }, $a = { class: "global-info-group__header" }, Ta = { class: "global-info-group__title" }, Ba = { class: "global-info-group__body" }, Fa = ["id"], Ea = /* @__PURE__ */ ee({
|
|
2763
3241
|
name: "GlobalInfoGroup",
|
|
2764
3242
|
__name: "GlobalInfoGroup",
|
|
2765
3243
|
props: {
|
|
@@ -2767,245 +3245,255 @@ const Co = ["disabled", "accept", "multiple"], $o = {
|
|
|
2767
3245
|
children: {},
|
|
2768
3246
|
state: {},
|
|
2769
3247
|
actions: {},
|
|
2770
|
-
index: {}
|
|
3248
|
+
index: {},
|
|
3249
|
+
renderConfig: {}
|
|
2771
3250
|
},
|
|
2772
3251
|
setup(t) {
|
|
2773
|
-
const e = t, n =
|
|
2774
|
-
function r(
|
|
2775
|
-
const
|
|
3252
|
+
const e = t, n = Ce(), o = I(() => e.group.tagName || e.group.label || "-"), a = I(() => e.children.length <= 1);
|
|
3253
|
+
function r(f, y) {
|
|
3254
|
+
const p = e.actions.getSection(f);
|
|
2776
3255
|
return {
|
|
2777
|
-
node:
|
|
3256
|
+
node: f,
|
|
2778
3257
|
group: e.group,
|
|
2779
|
-
sectionNode:
|
|
2780
|
-
section:
|
|
2781
|
-
sectionView:
|
|
3258
|
+
sectionNode: f,
|
|
3259
|
+
section: p,
|
|
3260
|
+
sectionView: p,
|
|
2782
3261
|
state: e.state,
|
|
2783
3262
|
actions: e.actions,
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
3263
|
+
renderConfig: e.renderConfig,
|
|
3264
|
+
index: y,
|
|
3265
|
+
editing: !!(p && e.actions.isEditing(p)),
|
|
3266
|
+
sectionStatus: e.actions.getSectionStatus(f),
|
|
3267
|
+
isSelfSection: m(f, 0) === m(e.group, 0),
|
|
3268
|
+
handleEdit: () => e.actions.startEdit(f),
|
|
3269
|
+
handleCancel: () => e.actions.cancelEdit(f),
|
|
3270
|
+
handleSave: () => e.actions.saveSection(f.key)
|
|
2791
3271
|
};
|
|
2792
3272
|
}
|
|
2793
|
-
function
|
|
2794
|
-
return
|
|
3273
|
+
function s(f) {
|
|
3274
|
+
return l("section", d(f));
|
|
2795
3275
|
}
|
|
2796
|
-
function
|
|
2797
|
-
if (!
|
|
2798
|
-
const
|
|
2799
|
-
if (n[
|
|
2800
|
-
const
|
|
2801
|
-
return
|
|
3276
|
+
function l(f, y) {
|
|
3277
|
+
if (!y) return "";
|
|
3278
|
+
const p = `${f}-${y}`;
|
|
3279
|
+
if (n[p]) return p;
|
|
3280
|
+
const w = p.toLowerCase();
|
|
3281
|
+
return w !== p && n[w] ? w : "";
|
|
2802
3282
|
}
|
|
2803
|
-
function
|
|
2804
|
-
return String(
|
|
3283
|
+
function d(f) {
|
|
3284
|
+
return String(f.id || f.infSetId || f.tagId || f.key || f.code || "").trim();
|
|
2805
3285
|
}
|
|
2806
|
-
function
|
|
2807
|
-
return
|
|
3286
|
+
function m(f, y) {
|
|
3287
|
+
return f.key || f.id || f.infSetId || f.tagId || `${y}`;
|
|
2808
3288
|
}
|
|
2809
|
-
function
|
|
2810
|
-
return `global-info-section-${
|
|
3289
|
+
function M(f) {
|
|
3290
|
+
return `global-info-section-${m(f, 0)}`;
|
|
2811
3291
|
}
|
|
2812
|
-
return (
|
|
2813
|
-
|
|
2814
|
-
group:
|
|
2815
|
-
children:
|
|
2816
|
-
state:
|
|
2817
|
-
actions:
|
|
3292
|
+
return (f, y) => (b(), G("section", ka, [
|
|
3293
|
+
K(f.$slots, "header", {
|
|
3294
|
+
group: f.group,
|
|
3295
|
+
children: f.children,
|
|
3296
|
+
state: f.state,
|
|
3297
|
+
actions: f.actions,
|
|
3298
|
+
renderConfig: f.renderConfig,
|
|
2818
3299
|
title: o.value,
|
|
2819
|
-
index:
|
|
2820
|
-
isEmpty:
|
|
3300
|
+
index: f.index,
|
|
3301
|
+
isEmpty: f.children.length === 0
|
|
2821
3302
|
}, () => [
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
3303
|
+
D("header", $a, [
|
|
3304
|
+
y[0] || (y[0] = D("span", { class: "global-info-group__marker" }, null, -1)),
|
|
3305
|
+
D("h2", Ta, se(o.value), 1)
|
|
2825
3306
|
])
|
|
2826
3307
|
], !0),
|
|
2827
|
-
|
|
2828
|
-
|
|
3308
|
+
D("div", Ba, [
|
|
3309
|
+
J(n).default ? K(f.$slots, "default", {
|
|
2829
3310
|
key: 0,
|
|
2830
|
-
group:
|
|
2831
|
-
children:
|
|
2832
|
-
state:
|
|
2833
|
-
actions:
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
3311
|
+
group: f.group,
|
|
3312
|
+
children: f.children,
|
|
3313
|
+
state: f.state,
|
|
3314
|
+
actions: f.actions,
|
|
3315
|
+
renderConfig: f.renderConfig,
|
|
3316
|
+
index: f.index,
|
|
3317
|
+
isEmpty: f.children.length === 0
|
|
3318
|
+
}, void 0, !0) : (b(), G(Se, { key: 1 }, [
|
|
3319
|
+
(b(!0), G(Se, null, de(f.children, (p, w) => (b(), G("div", {
|
|
3320
|
+
id: M(p),
|
|
3321
|
+
key: m(p, w),
|
|
2840
3322
|
class: "global-info-group__section"
|
|
2841
3323
|
}, [
|
|
2842
|
-
|
|
3324
|
+
s(p) ? K(f.$slots, s(p), H({
|
|
2843
3325
|
key: 0,
|
|
2844
3326
|
ref_for: !0
|
|
2845
|
-
}, r(
|
|
3327
|
+
}, r(p, w)), void 0, !0) : J(n).section ? K(f.$slots, "section", H({
|
|
2846
3328
|
key: 1,
|
|
2847
3329
|
ref_for: !0
|
|
2848
|
-
}, r(
|
|
3330
|
+
}, r(p, w)), void 0, !0) : (b(), V(Ca, {
|
|
2849
3331
|
key: 2,
|
|
2850
|
-
node:
|
|
2851
|
-
state:
|
|
2852
|
-
actions:
|
|
2853
|
-
"hide-header": a.value
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
3332
|
+
node: p,
|
|
3333
|
+
state: f.state,
|
|
3334
|
+
actions: f.actions,
|
|
3335
|
+
"hide-header": a.value,
|
|
3336
|
+
"render-config": f.renderConfig
|
|
3337
|
+
}, Me({ _: 2 }, [
|
|
3338
|
+
de(J(n), (C, P) => ({
|
|
3339
|
+
name: P,
|
|
3340
|
+
fn: L((F) => [
|
|
3341
|
+
K(f.$slots, P, H({ ref_for: !0 }, F), void 0, !0)
|
|
2859
3342
|
])
|
|
2860
3343
|
}))
|
|
2861
|
-
]), 1032, ["node", "state", "actions", "hide-header"]))
|
|
2862
|
-
], 8,
|
|
2863
|
-
|
|
3344
|
+
]), 1032, ["node", "state", "actions", "hide-header", "render-config"]))
|
|
3345
|
+
], 8, Fa))), 128)),
|
|
3346
|
+
f.children.length === 0 ? K(f.$slots, "empty", {
|
|
2864
3347
|
key: 0,
|
|
2865
3348
|
node: null,
|
|
2866
|
-
group:
|
|
3349
|
+
group: f.group,
|
|
2867
3350
|
sectionNode: null,
|
|
2868
|
-
state:
|
|
2869
|
-
actions:
|
|
2870
|
-
index: -1
|
|
3351
|
+
state: f.state,
|
|
3352
|
+
actions: f.actions,
|
|
3353
|
+
index: -1,
|
|
3354
|
+
renderConfig: f.renderConfig
|
|
2871
3355
|
}, () => [
|
|
2872
|
-
|
|
2873
|
-
], !0) :
|
|
3356
|
+
y[1] || (y[1] = D("div", { class: "global-info-group__empty" }, "暂无数据", -1))
|
|
3357
|
+
], !0) : te("", !0)
|
|
2874
3358
|
], 64))
|
|
2875
3359
|
])
|
|
2876
3360
|
]));
|
|
2877
3361
|
}
|
|
2878
|
-
}),
|
|
3362
|
+
}), Ma = /* @__PURE__ */ ie(Ea, [["__scopeId", "data-v-c90b8de0"]]), Va = { class: "global-info-sections" }, Pa = /* @__PURE__ */ ee({
|
|
2879
3363
|
name: "GlobalInfoSections",
|
|
2880
3364
|
__name: "GlobalInfoSections",
|
|
2881
3365
|
props: {
|
|
2882
3366
|
nodes: {},
|
|
2883
3367
|
state: {},
|
|
2884
|
-
actions: {}
|
|
3368
|
+
actions: {},
|
|
3369
|
+
renderConfig: {}
|
|
2885
3370
|
},
|
|
2886
3371
|
setup(t) {
|
|
2887
|
-
const e = t, n =
|
|
2888
|
-
const
|
|
2889
|
-
if (
|
|
2890
|
-
return
|
|
2891
|
-
const
|
|
2892
|
-
return [...
|
|
3372
|
+
const e = t, n = Ce(), o = I(() => {
|
|
3373
|
+
const y = e.nodes.filter((c) => a(c).length > 0), p = e.nodes.filter((c) => a(c).length === 0), w = p.filter((c) => r(c)), C = p.filter((c) => !r(c)), P = y.map((c) => ({ group: c, children: a(c) })), F = w.map((c) => ({ group: c, children: [c] }));
|
|
3374
|
+
if (P.length === 0)
|
|
3375
|
+
return w.length > 0 ? F : f(C);
|
|
3376
|
+
const q = f(C);
|
|
3377
|
+
return [...P, ...F, ...q];
|
|
2893
3378
|
});
|
|
2894
|
-
function a(
|
|
2895
|
-
return
|
|
3379
|
+
function a(y) {
|
|
3380
|
+
return y.children ?? [];
|
|
2896
3381
|
}
|
|
2897
|
-
function r(
|
|
2898
|
-
return !String(
|
|
3382
|
+
function r(y) {
|
|
3383
|
+
return !String(y.parentId || y.parentTagId || "").trim();
|
|
2899
3384
|
}
|
|
2900
|
-
function
|
|
2901
|
-
return
|
|
3385
|
+
function s(y) {
|
|
3386
|
+
return l("group", d(y));
|
|
2902
3387
|
}
|
|
2903
|
-
function
|
|
2904
|
-
if (!
|
|
2905
|
-
const
|
|
2906
|
-
if (n[
|
|
2907
|
-
const
|
|
2908
|
-
return
|
|
3388
|
+
function l(y, p) {
|
|
3389
|
+
if (!p) return "";
|
|
3390
|
+
const w = `${y}-${p}`;
|
|
3391
|
+
if (n[w]) return w;
|
|
3392
|
+
const C = w.toLowerCase();
|
|
3393
|
+
return C !== w && n[C] ? C : "";
|
|
2909
3394
|
}
|
|
2910
|
-
function
|
|
2911
|
-
return String(
|
|
3395
|
+
function d(y) {
|
|
3396
|
+
return String(y.id || y.tagId || y.key || y.code || "").trim();
|
|
2912
3397
|
}
|
|
2913
|
-
function
|
|
2914
|
-
return
|
|
3398
|
+
function m(y, p) {
|
|
3399
|
+
return y.key || y.id || y.tagId || `${p}`;
|
|
2915
3400
|
}
|
|
2916
|
-
function
|
|
2917
|
-
const
|
|
3401
|
+
function M(y) {
|
|
3402
|
+
const p = y[0], w = p?.raw ?? {}, C = String(w.parentTagName || w.parentName || w.parentLabel || p?.parentId || "信息");
|
|
2918
3403
|
return {
|
|
2919
|
-
...
|
|
2920
|
-
key: `${
|
|
2921
|
-
id: String(
|
|
2922
|
-
tagId: String(
|
|
2923
|
-
tagName:
|
|
2924
|
-
label:
|
|
2925
|
-
children:
|
|
3404
|
+
...p,
|
|
3405
|
+
key: `${p?.parentId || p?.parentTagId || p?.key || "global-info"}-group`,
|
|
3406
|
+
id: String(p?.parentId || p?.parentTagId || p?.id || "global-info-group"),
|
|
3407
|
+
tagId: String(p?.parentTagId || p?.parentId || p?.tagId || "global-info-group"),
|
|
3408
|
+
tagName: C,
|
|
3409
|
+
label: C,
|
|
3410
|
+
children: y
|
|
2926
3411
|
};
|
|
2927
3412
|
}
|
|
2928
|
-
function
|
|
2929
|
-
const
|
|
2930
|
-
return
|
|
2931
|
-
const
|
|
2932
|
-
|
|
2933
|
-
}), Array.from(
|
|
2934
|
-
group:
|
|
2935
|
-
children:
|
|
3413
|
+
function f(y) {
|
|
3414
|
+
const p = /* @__PURE__ */ new Map();
|
|
3415
|
+
return y.forEach((w) => {
|
|
3416
|
+
const C = String(w.parentId || w.parentTagId || "global-info-flat"), P = p.get(C) ?? [];
|
|
3417
|
+
P.push(w), p.set(C, P);
|
|
3418
|
+
}), Array.from(p.values()).map((w) => ({
|
|
3419
|
+
group: M(w),
|
|
3420
|
+
children: w
|
|
2936
3421
|
}));
|
|
2937
3422
|
}
|
|
2938
|
-
return (
|
|
2939
|
-
(
|
|
2940
|
-
key:
|
|
3423
|
+
return (y, p) => (b(), G("div", Va, [
|
|
3424
|
+
(b(!0), G(Se, null, de(o.value, (w, C) => (b(), G(Se, {
|
|
3425
|
+
key: m(w.group, C)
|
|
2941
3426
|
}, [
|
|
2942
|
-
|
|
3427
|
+
s(w.group) ? K(y.$slots, s(w.group), {
|
|
2943
3428
|
key: 0,
|
|
2944
|
-
group:
|
|
2945
|
-
children:
|
|
2946
|
-
state:
|
|
2947
|
-
actions:
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
3429
|
+
group: w.group,
|
|
3430
|
+
children: w.children,
|
|
3431
|
+
state: y.state,
|
|
3432
|
+
actions: y.actions,
|
|
3433
|
+
renderConfig: y.renderConfig,
|
|
3434
|
+
index: C,
|
|
3435
|
+
isEmpty: w.children.length === 0
|
|
3436
|
+
}, void 0, !0) : J(n).group ? K(y.$slots, "group", {
|
|
2951
3437
|
key: 1,
|
|
2952
|
-
group:
|
|
2953
|
-
children:
|
|
2954
|
-
state:
|
|
2955
|
-
actions:
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
3438
|
+
group: w.group,
|
|
3439
|
+
children: w.children,
|
|
3440
|
+
state: y.state,
|
|
3441
|
+
actions: y.actions,
|
|
3442
|
+
renderConfig: y.renderConfig,
|
|
3443
|
+
index: C,
|
|
3444
|
+
isEmpty: w.children.length === 0
|
|
3445
|
+
}, void 0, !0) : (b(), V(Ma, {
|
|
2959
3446
|
key: 2,
|
|
2960
|
-
group:
|
|
2961
|
-
children:
|
|
2962
|
-
state:
|
|
2963
|
-
actions:
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
3447
|
+
group: w.group,
|
|
3448
|
+
children: w.children,
|
|
3449
|
+
state: y.state,
|
|
3450
|
+
actions: y.actions,
|
|
3451
|
+
"render-config": y.renderConfig,
|
|
3452
|
+
index: C
|
|
3453
|
+
}, Me({ _: 2 }, [
|
|
3454
|
+
de(J(n), (P, F) => ({
|
|
3455
|
+
name: F,
|
|
3456
|
+
fn: L((q) => [
|
|
3457
|
+
K(y.$slots, F, H({ ref_for: !0 }, q), void 0, !0)
|
|
2970
3458
|
])
|
|
2971
3459
|
}))
|
|
2972
|
-
]), 1032, ["group", "children", "state", "actions", "index"]))
|
|
3460
|
+
]), 1032, ["group", "children", "state", "actions", "render-config", "index"]))
|
|
2973
3461
|
], 64))), 128))
|
|
2974
3462
|
]));
|
|
2975
3463
|
}
|
|
2976
|
-
}),
|
|
3464
|
+
}), Da = /* @__PURE__ */ ie(Pa, [["__scopeId", "data-v-c0d12f5e"]]);
|
|
2977
3465
|
export {
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3466
|
+
pa as GlobalInfoAutoRenderer,
|
|
3467
|
+
sa as GlobalInfoDeleteConfirm,
|
|
3468
|
+
tn as GlobalInfoFieldControl,
|
|
3469
|
+
nn as GlobalInfoFieldValue,
|
|
3470
|
+
la as GlobalInfoFormRenderer,
|
|
3471
|
+
Ma as GlobalInfoGroup,
|
|
3472
|
+
za as GlobalInfoProvider,
|
|
3473
|
+
Ca as GlobalInfoSectionBlock,
|
|
3474
|
+
ma as GlobalInfoSectionOutlet,
|
|
3475
|
+
Da as GlobalInfoSections,
|
|
3476
|
+
fa as GlobalInfoTableRenderer,
|
|
3477
|
+
Ha as JtAttachmentPreview,
|
|
3478
|
+
Ua as JtAttachmentPreviewByParams,
|
|
3479
|
+
xe as JtButton,
|
|
3480
|
+
Fn as JtCascader,
|
|
3481
|
+
Aa as JtCrudTable,
|
|
3482
|
+
Mn as JtDatePicker,
|
|
3483
|
+
Hn as JtFilterBar,
|
|
3484
|
+
Rn as JtFormItems,
|
|
3485
|
+
nt as JtInput,
|
|
3486
|
+
Ka as JtPageHeader,
|
|
3487
|
+
no as JtPagination,
|
|
3488
|
+
Ln as JtSelect,
|
|
3489
|
+
Qn as JtTable,
|
|
3490
|
+
mo as buildGlobalInfoUpdatePayload,
|
|
3491
|
+
uo as createEmptyGlobalInfoViewModel,
|
|
3492
|
+
qa as isGlobalInfoNode,
|
|
3493
|
+
Gt as mergeGlobalInfoChildren,
|
|
3494
|
+
fo as normalizeGlobalInfoDetail,
|
|
3495
|
+
mt as normalizeGlobalInfoTree,
|
|
3496
|
+
po as resolveGlobalInfoRenderType,
|
|
3497
|
+
Wa as setupJtAttachmentPreview,
|
|
3498
|
+
Go as useGlobalInfoController
|
|
3011
3499
|
};
|