@jt-home/mfe-components 1.0.10 → 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.
Files changed (30) hide show
  1. package/dist/JtAttachmentPreview/style.css +1 -1
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.mjs +2120 -1632
  4. package/dist/style.css +1 -1
  5. package/dist/types/components/form/item/JtCascader/cascaderProps.d.ts +11 -0
  6. package/dist/types/components/form/item/JtCascader/index.vue.d.ts +4 -6
  7. package/dist/types/components/form/item/JtSelect/index.vue.d.ts +4 -4
  8. package/dist/types/components/globalInfo/components/GlobalInfoGroup.vue.d.ts +8 -1
  9. package/dist/types/components/globalInfo/components/GlobalInfoProvider.vue.d.ts +2 -8
  10. package/dist/types/components/globalInfo/components/GlobalInfoSectionBlock.vue.d.ts +8 -1
  11. package/dist/types/components/globalInfo/components/GlobalInfoSectionOutlet.vue.d.ts +3 -1
  12. package/dist/types/components/globalInfo/components/GlobalInfoSections.vue.d.ts +5 -1
  13. package/dist/types/components/globalInfo/controller/controllerFieldOptions.d.ts +11 -0
  14. package/dist/types/components/globalInfo/controller/controllerIdentity.d.ts +10 -0
  15. package/dist/types/components/globalInfo/controller/controllerRequests.d.ts +37 -0
  16. package/dist/types/components/globalInfo/controller/controllerSectionStore.d.ts +21 -0
  17. package/dist/types/components/globalInfo/controller/controllerStatus.d.ts +2 -0
  18. package/dist/types/components/globalInfo/controller/useGlobalInfoController.d.ts +2 -1
  19. package/dist/types/components/globalInfo/index.d.ts +1 -1
  20. package/dist/types/components/globalInfo/model/fieldUtils.d.ts +14 -2
  21. package/dist/types/components/globalInfo/model/types.d.ts +135 -3
  22. package/dist/types/components/globalInfo/renderers/GlobalInfoAutoRenderer.vue.d.ts +2 -1
  23. package/dist/types/components/globalInfo/renderers/GlobalInfoFormRenderer.vue.d.ts +2 -1
  24. package/dist/types/components/globalInfo/renderers/GlobalInfoTableRenderer.vue.d.ts +4 -3
  25. package/dist/types/components/globalInfo/renderers/optionPreload.d.ts +4 -0
  26. package/dist/types/components/index.d.ts +1 -1
  27. package/dist/types/components/table/JtCrudTable.vue.d.ts +12 -12
  28. package/dist/types/components/table/JtFilterBar.vue.d.ts +2 -2
  29. package/dist/types/main.d.ts +1 -1
  30. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -1,35 +1,35 @@
1
1
  import './style.css';
2
- import { defineComponent as x, useAttrs as Xt, computed as _, openBlock as y, createBlock as V, mergeProps as K, toHandlers as Fe, withCtx as M, renderSlot as j, resolveDynamicComponent as vt, createCommentVNode as Q, withKeys as en, createElementBlock as L, Fragment as de, renderList as oe, normalizeStyle as gt, nextTick as tn, ref as ne, useSlots as ve, watch as Re, normalizeClass as De, createVNode as re, withModifiers as nn, unref as q, createSlots as we, createElementVNode as J, toDisplayString as ee, normalizeProps as ce, guardReactiveProps as me, useModel as He, withDirectives as on, mergeModels as ot, shallowRef as ye, onMounted as ht, createTextVNode as Ee, resolveComponent as an, onErrorCaptured as ln } from "vue";
3
- import { ElButton as Xe, ElIcon as yt, ElCascader as rn, ElDatePicker as bt, ElInput as St, ElSelect as _t, ElOption as It, ElFormItem as wt, ElForm as kt, ElTable as Ct, ElTableColumn as $t, ElPagination as sn, ElLoadingDirective as un, ElInputNumber as cn, ElSwitch as dn, ElRow as pn, ElCol as fn, ElPopconfirm as mn } from "element-plus/es";
4
- import { JtAttachmentPreview as Ia, JtAttachmentPreviewByParams as wa, setupJtAttachmentPreview as ka } from "./JtAttachmentPreview/index.mjs";
5
- import { cascaderEmits as at, inputEmits as lt, selectEmits as rt } from "element-plus";
6
- const Ye = 2, vn = 3;
7
- function gn(t) {
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 Tt(t) {
11
- if (!t.startsWith("on") || t.length <= Ye)
10
+ function Ot(t) {
11
+ if (!t.startsWith("on") || t.length <= at)
12
12
  return !1;
13
- const e = t.charCodeAt(Ye);
13
+ const e = t.charCodeAt(at);
14
14
  return e < 97 || e > 122;
15
15
  }
16
- function hn(t) {
16
+ function kn(t) {
17
17
  if (t.startsWith("on-"))
18
- return t.slice(vn);
19
- const [e, n] = t.slice(Ye).split(":"), o = gn(e);
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 Bt(t, e = /* @__PURE__ */ new Set()) {
22
+ function Rt(t, e = /* @__PURE__ */ new Set()) {
23
23
  return Object.fromEntries(
24
- Object.entries(t).filter(([n, o]) => !e.has(n) && Tt(n) && typeof o == "function").map(([n, o]) => [hn(n), o])
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 Et(t, e = /* @__PURE__ */ new Set()) {
27
+ function jt(t, e = /* @__PURE__ */ new Set()) {
28
28
  return Object.fromEntries(
29
- Object.entries(t).filter(([n]) => !e.has(n) && !Tt(n))
29
+ Object.entries(t).filter(([n]) => !e.has(n) && !Ot(n))
30
30
  );
31
31
  }
32
- const yn = /* @__PURE__ */ x({
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 = Xt(), o = _(() => {
58
- const { icon: r, ...v } = e;
57
+ const e = t, n = rn(), o = I(() => {
58
+ const { icon: r, ...s } = e;
59
59
  return {
60
- ...Et(n),
61
- ...v
60
+ ...jt(n),
61
+ ...s
62
62
  };
63
- }), a = _(() => Bt(n));
64
- return (r, v) => {
65
- const p = yt, u = Xe;
66
- return y(), V(u, K({ class: "jt-button" }, o.value, Fe(a.value)), {
67
- default: M(() => [
68
- r.$slots.icon ? (y(), V(p, {
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: M(() => [
73
- j(r.$slots, "icon", {}, void 0, !0)
72
+ default: L(() => [
73
+ K(r.$slots, "icon", {}, void 0, !0)
74
74
  ]),
75
75
  _: 3
76
- })) : e.icon ? (y(), V(p, {
76
+ })) : e.icon ? (b(), V(l, {
77
77
  key: 1,
78
78
  class: "jt-button__icon"
79
79
  }, {
80
- default: M(() => [
81
- (y(), V(vt(e.icon)))
80
+ default: L(() => [
81
+ (b(), V(Ct(e.icon)))
82
82
  ]),
83
83
  _: 1
84
- })) : Q("", !0),
85
- j(r.$slots, "default", {}, void 0, !0)
84
+ })) : te("", !0),
85
+ K(r.$slots, "default", {}, void 0, !0)
86
86
  ]),
87
87
  _: 3
88
88
  }, 16);
89
89
  };
90
90
  }
91
- }), X = (t, e) => {
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
- }, ze = /* @__PURE__ */ X(yn, [["__scopeId", "data-v-a8344276"]]), bn = /* @__PURE__ */ x({
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: { default: "请选择" },
119
+ placeholder: {},
102
120
  disabled: { type: Boolean },
103
- clearable: { type: Boolean, default: !0 },
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: { default: () => [] }
137
- },
138
- emits: at,
154
+ options: {}
155
+ }, Tn),
156
+ emits: wn,
139
157
  setup(t, { emit: e }) {
140
- const n = t, o = e, a = _(() => Object.fromEntries(
141
- Object.keys(at).map((r) => [
142
- r,
143
- (...v) => o(r, ...v)
144
- ])
145
- ));
146
- return (r, v) => {
147
- const p = rn;
148
- return y(), V(p, K({ class: "jt-cascader" }, n, Fe(a.value)), null, 16);
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
- }), Sn = /* @__PURE__ */ X(bn, [["__scopeId", "data-v-4c43f27e"]]), _n = /* @__PURE__ */ x({
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 v = bt;
214
- return y(), V(v, K({ class: "jt-date-picker" }, n.value, {
215
- "onUpdate:modelValue": r[0] || (r[0] = (p) => a.$emit("update:modelValue", p))
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
- }), In = /* @__PURE__ */ X(_n, [["__scopeId", "data-v-7aa4706e"]]), wn = /* @__PURE__ */ x({
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
- ...lt,
316
+ ...dt,
259
317
  enter: () => !0
260
318
  },
261
319
  setup(t, { emit: e }) {
262
- const n = t, o = e, a = _(() => Object.fromEntries(
263
- Object.keys(lt).map((r) => [
320
+ const n = t, o = e, a = I(() => Object.fromEntries(
321
+ Object.keys(dt).map((r) => [
264
322
  r,
265
- (...v) => o(r, ...v)
323
+ (...s) => o(r, ...s)
266
324
  ])
267
325
  ));
268
- return (r, v) => {
269
- const p = St;
270
- return y(), V(p, K({ class: "jt-input" }, n, Fe(a.value), {
271
- onKeyup: v[0] || (v[0] = en((u) => o("enter"), ["enter"]))
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
- }), xe = /* @__PURE__ */ X(wn, [["__scopeId", "data-v-031428a1"]]), kn = /* @__PURE__ */ x({
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: rt,
390
+ emits: ft,
333
391
  setup(t, { emit: e }) {
334
- const n = t, o = _(() => {
335
- const { options: v, ...p } = n;
336
- return p;
337
- }), a = e, r = _(() => Object.fromEntries(
338
- Object.keys(rt).map((v) => [
339
- v,
340
- (...p) => a(v, ...p)
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 (v, p) => {
344
- const u = It, b = _t;
345
- return y(), V(b, K({ class: "jt-select" }, o.value, Fe(r.value)), {
346
- default: M(() => [
347
- (y(!0), L(de, null, oe(v.options ?? [], (E) => (y(), V(u, K({
348
- key: E.value,
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
- }, E), null, 16))), 128))
408
+ }, M), null, 16))), 128))
351
409
  ]),
352
410
  _: 1
353
411
  }, 16);
354
412
  };
355
413
  }
356
- }), Cn = /* @__PURE__ */ X(kn, [["__scopeId", "data-v-c67cfa84"]]), $n = { class: "jt-form-items" }, We = 4, Tn = /* @__PURE__ */ x({
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: xe,
367
- select: Cn,
368
- cascader: Sn,
369
- "date-picker": In
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), v = /* @__PURE__ */ new Map(), p = _(() => e.configs.filter((g) => g.show !== !1)), u = (g) => {
377
- const { itemType: I } = g;
378
- if (!I) return xe;
379
- if (typeof I != "string") return I;
380
- const N = o[I] ?? I;
381
- return r.includes(N) ? n[N] : (console.error(
382
- `[JtFormItems] 不支持的 itemType: "${I}",支持的类型: ${r.join(", ")}`
383
- ), xe);
384
- }, b = (g) => {
385
- const I = Et(g, a);
386
- return g.itemType === "select" || g.itemType === "remote-select" || g.itemType === "cascader" ? {
387
- ...I,
388
- options: g.options
389
- } : i(g.itemType) ? {
390
- ...I,
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
- } : I;
393
- }, E = (g) => Bt(g, a), m = (g) => ({
394
- rules: g.rules,
395
- ...g.formItemProps
396
- }), d = (g, I) => {
397
- e.formData[g] = I;
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(g) {
400
- return (I) => {
401
- if (I) {
402
- v.set(g, I);
457
+ function p(c) {
458
+ return (v) => {
459
+ if (v) {
460
+ s.set(c, v);
403
461
  return;
404
462
  }
405
- v.delete(g);
463
+ s.delete(c);
406
464
  };
407
465
  }
408
- function h(g, I) {
409
- tn(() => {
410
- v.get(g)?.validate(I).catch(() => {
466
+ function w(c, v) {
467
+ cn(() => {
468
+ s.get(c)?.validate(v).catch(() => {
411
469
  });
412
470
  });
413
471
  }
414
- const k = (g) => Math.min(Math.max(Math.trunc(g || 1), 1), 4), G = _(() => {
415
- const I = p.value.reduce(
416
- (N, w) => N + k(e.span || w.span),
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
- ) % We;
419
- return I === 0 ? {
420
- gridColumn: `1 / span ${We}`
476
+ ) % ot;
477
+ return v === 0 ? {
478
+ gridColumn: `1 / span ${ot}`
421
479
  } : {
422
- gridColumn: `${I + 1} / span ${We - I}`
480
+ gridColumn: `${v + 1} / span ${ot - v}`
423
481
  };
424
- }), B = (g) => ({
425
- gridColumn: `span ${k(e.span || g.span)}`
482
+ }), F = (c) => ({
483
+ gridColumn: `span ${C(e.span || c.span)}`
426
484
  });
427
- function i(g) {
428
- return g === "daterange" || g === "date-range" || g === "dateRange";
429
- }
430
- return (g, I) => {
431
- const N = wt;
432
- return y(), L("div", $n, [
433
- (y(!0), L(de, null, oe(p.value, (w) => (y(), V(N, K({
434
- key: w.prop,
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: c(w.prop),
494
+ ref: p(S.prop),
437
495
  class: "jt-form-items__item",
438
- style: B(w),
439
- label: w.label,
440
- prop: w.prop
441
- }, m(w)), {
442
- default: M(() => [
443
- w.showSlot ? j(g.$slots, w.prop, { key: 0 }, void 0, !0) : (y(), V(vt(u(w)), K({
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": g.formData[w.prop],
503
+ "model-value": c.formData[S.prop],
446
504
  ref_for: !0
447
- }, b(w), Fe(E(w)), {
448
- "onUpdate:modelValue": (S) => d(w.prop, S),
449
- onChange: () => h(w.prop, "change"),
450
- onBlur: () => h(w.prop, "blur")
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
- g.$slots.actions ? (y(), V(N, {
513
+ c.$slots.actions ? (b(), V(T, {
456
514
  key: 0,
457
515
  class: "jt-form-items__actions",
458
- style: gt(G.value)
516
+ style: kt(P.value)
459
517
  }, {
460
- default: M(() => [
461
- j(g.$slots, "actions", {}, void 0, !0)
518
+ default: L(() => [
519
+ K(c.$slots, "actions", {}, void 0, !0)
462
520
  ]),
463
521
  _: 3
464
- }, 8, ["style"])) : Q("", !0)
522
+ }, 8, ["style"])) : te("", !0)
465
523
  ]);
466
524
  };
467
525
  }
468
- }), Bn = /* @__PURE__ */ X(Tn, [["__scopeId", "data-v-d7aa2097"]]);
469
- function En() {
470
- const t = ne(!1);
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 Fn = "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", Mn = "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", Vn = "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", Pn = { class: "jt-filter-bar__btns" }, Nn = ["src"], Ln = ["src"], Rn = ["src"], jn = /* @__PURE__ */ x({
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 = ne(), v = ve(), p = ne({}), {
494
- searchDisabled: u,
495
- searchLoading: b,
496
- searchDone: E
497
- } = En(), m = _(() => o.option), d = ne(m.value.searchCollapsed ?? !1), c = _(() => o.columns.filter(($) => $.search === !0)), h = _(
498
- () => Math.max(1, m.value.searchSpan ?? 4)
499
- ), k = _(() => Math.max(1, m.value.searchCollapsedRows ?? 1)), G = _(() => Math.max(1, h.value - 1)), B = _(
500
- () => Math.max(1, G.value * k.value)
501
- ), i = _(() => _e(m.value.searchLabelWidth ?? 84)), g = _(() => m.value.searchLabelPosition ?? "top"), I = _(() => $e(m.value.searchGutter, 14)), N = _(() => $e(m.value.searchRowGap, 14)), w = _(() => Ve(m.value.searchPadding ?? "18px 4px 0")), S = _(() => m.value.searchCollapse === !1 ? !1 : qe(c.value) > B.value), P = _(() => {
502
- if (!S.value || !d.value) return c.value;
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 c.value.filter((U) => {
505
- const Y = Se(U);
506
- return $ + Y > B.value ? !1 : ($ += Y, !0);
562
+ return p.value.filter((Z) => {
563
+ const ae = X(Z);
564
+ return $ + ae > F.value ? !1 : ($ += ae, !0);
507
565
  });
508
- }), C = _(
509
- () => P.value.filter(($) => !!v[`${$.prop}-search`])
510
- ), A = _(
511
- () => P.value.map(($) => pe($))
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
- Re(
514
- () => m.value.searchCollapsed,
577
+ be(
578
+ () => f.value.searchCollapsed,
515
579
  ($) => {
516
- typeof $ == "boolean" && (d.value = $);
580
+ typeof $ == "boolean" && (y.value = $);
517
581
  }
518
- ), Re(
582
+ ), be(
519
583
  () => o.modelValue,
520
584
  ($) => {
521
- p.value = { ...$ };
585
+ l.value = { ...$ };
522
586
  },
523
587
  { deep: !0, immediate: !0 }
524
588
  );
525
- function ae($, U) {
526
- if (u.value) return;
527
- const Y = { ...p.value, [$]: U };
528
- p.value = Y, a("update:modelValue", Y);
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 pe($) {
531
- const U = $.searchProps ?? {};
594
+ function N($) {
595
+ const Z = $.searchProps ?? {};
532
596
  return {
533
- ...U,
597
+ ...Z,
534
598
  prop: $.prop,
535
599
  label: $.searchLabel ?? $.label,
536
- span: Se($),
600
+ span: X($),
537
601
  itemType: $.searchType ?? "input",
538
602
  // 外部提供 `${prop}-search` 时交给插槽渲染,保持旧版 JtFilterBar 的自定义能力。
539
- showSlot: !!v[`${$.prop}-search`],
540
- options: U.options ?? $.searchOptions ?? $.dicData,
541
- placeholder: U.placeholder ?? $.searchPlaceholder,
542
- valueFormat: U.valueFormat ?? $.searchValueFormat,
543
- disabled: u.value || U.disabled === !0,
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: (...Y) => {
550
- ke(U.onEnter, ...Y), Ce();
613
+ onEnter: (...ae) => {
614
+ O(Z.onEnter, ...ae), z();
551
615
  },
552
616
  // JtFormItems 内部会修改 filterModel,这里继续按旧接口向外 emit update:modelValue。
553
- "onUpdate:modelValue": (Y) => {
554
- ke(U["onUpdate:modelValue"], Y), ae($.prop, Y);
617
+ "onUpdate:modelValue": (ae) => {
618
+ O(Z["onUpdate:modelValue"], ae), h($.prop, ae);
555
619
  }
556
620
  };
557
621
  }
558
- function ke($, ...U) {
622
+ function O($, ...Z) {
559
623
  if (Array.isArray($)) {
560
- $.forEach((Y) => ke(Y, ...U));
624
+ $.forEach((ae) => O(ae, ...Z));
561
625
  return;
562
626
  }
563
- typeof $ == "function" && $(...U);
627
+ typeof $ == "function" && $(...Z);
564
628
  }
565
- async function Ce() {
566
- if (!u.value) {
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 Me() {
577
- u.value || a("reset");
640
+ function A() {
641
+ d.value || a("reset");
578
642
  }
579
- function le() {
580
- d.value = !d.value;
643
+ function oe() {
644
+ y.value = !y.value;
581
645
  }
582
- function Se($) {
583
- return Math.min(h.value, Math.max(1, $.searchSpan ?? 1));
646
+ function X($) {
647
+ return Math.min(w.value, Math.max(1, $.searchSpan ?? 1));
584
648
  }
585
- function qe($) {
586
- return $.reduce((U, Y) => U + Se(Y), 0);
649
+ function x($) {
650
+ return $.reduce((Z, ae) => Z + X(ae), 0);
587
651
  }
588
- function _e($) {
652
+ function ce($) {
589
653
  return typeof $ == "number" ? `${$}px` : $;
590
654
  }
591
- function $e($, U) {
592
- return typeof $ == "number" ? $ : U;
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: u,
665
+ searchDisabled: d,
602
666
  /** 开启筛选表单禁用。 */
603
- searchLoading: b,
667
+ searchLoading: m,
604
668
  /** 关闭筛选表单禁用。 */
605
- searchDone: E
606
- }), ($, U) => {
607
- const Y = kt;
608
- return y(), L("div", {
609
- class: De(["jt-filter-bar", `is-label-${g.value}`]),
610
- style: gt({
611
- "--jt-filter-columns": h.value,
612
- "--jt-filter-label-width": i.value,
613
- "--jt-filter-column-gap": `${I.value}px`,
614
- "--jt-filter-row-gap": `${N.value}px`,
615
- "--jt-filter-padding": w.value
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
- re(Y, {
685
+ pe(ae, {
619
686
  ref_key: "formRef",
620
687
  ref: r,
621
688
  class: "jt-filter-bar__form",
622
- model: p.value,
623
- "label-position": g.value,
624
- "label-width": i.value,
625
- disabled: q(u),
626
- onSubmit: U[0] || (U[0] = nn(() => {
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: M(() => [
630
- re(q(Bn), {
631
- configs: A.value,
632
- "form-data": p.value
633
- }, we({
634
- actions: M(() => [
635
- J("div", Pn, [
636
- j($.$slots, "search-menu", {
637
- search: Ce,
638
- reset: Me,
639
- disabled: q(u),
640
- collapsed: d.value,
641
- toggleCollapse: le
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
- S.value ? (y(), V(q(ze), {
710
+ _.value ? (b(), V(J(xe), {
644
711
  key: 0,
645
712
  class: "jt-filter-bar__btn-collapse",
646
- onClick: le
713
+ onClick: oe
647
714
  }, {
648
- icon: M(() => [
649
- J("img", {
650
- class: De(["jt-filter-bar__icon-arrow", { "is-collapsed": d.value }]),
651
- src: q(Fn),
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, Nn)
720
+ }, null, 10, zn)
654
721
  ]),
655
- default: M(() => [
656
- J("span", null, ee(d.value ? "展 开" : "收 起"), 1)
722
+ default: L(() => [
723
+ D("span", null, se(y.value ? "展 开" : "收 起"), 1)
657
724
  ]),
658
725
  _: 1
659
- })) : Q("", !0),
660
- re(q(ze), {
726
+ })) : te("", !0),
727
+ pe(J(xe), {
661
728
  class: "jt-filter-bar__btn-reset",
662
- disabled: q(u),
663
- onClick: Me
729
+ disabled: J(d),
730
+ onClick: A
664
731
  }, {
665
- icon: M(() => [
666
- J("img", {
667
- src: q(Mn),
732
+ icon: L(() => [
733
+ D("img", {
734
+ src: J(An),
668
735
  alt: ""
669
- }, null, 8, Ln)
736
+ }, null, 8, Dn)
670
737
  ]),
671
- default: M(() => [
672
- J("span", null, ee(m.value.resetBtnText ?? "重 置"), 1)
738
+ default: L(() => [
739
+ D("span", null, se(f.value.resetBtnText ?? "重 置"), 1)
673
740
  ]),
674
741
  _: 1
675
742
  }, 8, ["disabled"]),
676
- re(q(ze), {
743
+ pe(J(xe), {
677
744
  class: "jt-filter-bar__btn-query",
678
745
  type: "primary",
679
- disabled: q(u),
680
- onClick: Ce
746
+ disabled: J(d),
747
+ onClick: z
681
748
  }, {
682
- icon: M(() => [
683
- J("img", {
684
- src: q(Vn),
749
+ icon: L(() => [
750
+ D("img", {
751
+ src: J(Kn),
685
752
  alt: ""
686
- }, null, 8, Rn)
753
+ }, null, 8, xn)
687
754
  ]),
688
- default: M(() => [
689
- J("span", null, ee(m.value.searchBtnText ?? "查 询"), 1)
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
- oe(C.value, (Ie) => ({
699
- name: Ie.prop,
700
- fn: M(() => [
701
- j($.$slots, `${Ie.prop}-search`, {
702
- value: p.value[Ie.prop],
703
- column: Ie,
704
- setValue: (Je) => ae(Ie.prop, Je),
705
- search: Ce,
706
- reset: Me,
707
- disabled: q(u)
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
- }), Gn = /* @__PURE__ */ X(jn, [["__scopeId", "data-v-a6a4f467"]]), On = { key: 1 }, An = { key: 2 }, zn = { key: 3 }, Dn = /* @__PURE__ */ x({
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 = ve(), a = ne(), r = _(() => n.option ?? {}), v = _(() => n.columns.filter((c) => !c.hide));
729
- function p(c) {
730
- return !!o[`${c}-header`];
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 u(c) {
733
- return !!o[`${c}-data`];
799
+ function d(p) {
800
+ return !!o[`${p}-data`];
734
801
  }
735
- function b(c) {
802
+ function m(p) {
736
803
  return {
737
- width: c.width,
738
- minWidth: c.minWidth,
739
- align: c.align,
740
- fixed: c.fixed,
741
- sortable: c.sortable,
742
- showOverflowTooltip: c.showOverflowTooltip,
743
- ...c.columnOptions
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 E(c) {
747
- return !m(c.columnOptions?.type);
813
+ function M(p) {
814
+ return !f(p.columnOptions?.type);
748
815
  }
749
- function m(c) {
750
- return c === "selection" || c === "index" || c === "expand";
816
+ function f(p) {
817
+ return p === "selection" || p === "index" || p === "expand";
751
818
  }
752
- function d(c, h) {
753
- return c.find((k) => k.value === h)?.label ?? String(h ?? "");
819
+ function y(p, w) {
820
+ return p.find((C) => C.value === w)?.label ?? String(w ?? "");
754
821
  }
755
- return e({ tableRef: a }), (c, h) => {
756
- const k = $t, G = Ct;
757
- return y(), V(G, K({
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: c.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, Fe(c.tableEvents)), {
767
- default: M(() => [
768
- r.value.selection ? (y(), V(k, {
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
- })) : Q("", !0),
774
- r.value.index ? (y(), V(k, {
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"])) : Q("", !0),
781
- (y(!0), L(de, null, oe(v.value, (B) => (y(), V(k, K({
782
- key: B.prop,
783
- prop: B.prop,
784
- label: B.label,
785
- formatter: !u(B.prop) && !B.dicData ? B.formatter : void 0,
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
- }, b(B)), we({ _: 2 }, [
788
- p(B.prop) ? {
854
+ }, m(F)), Me({ _: 2 }, [
855
+ l(F.prop) ? {
789
856
  name: "header",
790
- fn: M((i) => [
791
- j(c.$slots, `${B.prop}-header`, K({ ref_for: !0 }, i), void 0, !0)
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
- E(B) ? {
862
+ M(F) ? {
796
863
  name: "default",
797
- fn: M((i) => [
798
- u(B.prop) ? j(c.$slots, `${B.prop}-data`, K({
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
- }, i), void 0, !0) : B.dicData ? (y(), L("span", On, ee(d(B.dicData, i.row[B.prop])), 1)) : B.formatter ? (y(), L("span", An, ee(B.formatter(i.row, i.column, i.row[B.prop], i.$index)), 1)) : (y(), L("span", zn, ee(i.row[B.prop]), 1))
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 ? (y(), V(k, {
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: M((B) => [
815
- j(c.$slots, "menu", ce(me(B)), void 0, !0)
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"])) : Q("", !0)
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
- }), Kn = /* @__PURE__ */ X(Dn, [["__scopeId", "data-v-513fa12d"]]), qn = { class: "jt-pagination" }, Jn = { class: "jt-pagination__count" }, Un = /* @__PURE__ */ x({
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 = _(() => n.option ?? {}), a = e;
836
- function r(v) {
837
- a("current-change", v), a("page-change", v);
838
- }
839
- return (v, p) => {
840
- const u = sn;
841
- return y(), L("div", qn, [
842
- re(u, {
843
- "current-page": v.currentPage,
844
- "page-size": v.pageSize,
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: v.total,
913
+ total: s.total,
847
914
  layout: o.value.paginationLayout ?? "sizes, prev, pager, next, jumper",
848
- "onUpdate:currentPage": p[0] || (p[0] = (b) => v.$emit("update:currentPage", b)),
849
- "onUpdate:pageSize": p[1] || (p[1] = (b) => v.$emit("update:pageSize", b)),
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: p[2] || (p[2] = (b) => v.$emit("size-change", b))
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
- J("span", Jn, "共" + ee(v.total) + "条记录", 1)
920
+ D("span", eo, "共" + se(s.total) + "条记录", 1)
854
921
  ]);
855
922
  };
856
923
  }
857
- }), Hn = /* @__PURE__ */ X(Un, [["__scopeId", "data-v-746af6aa"]]), xn = { class: "jt-crud-table" }, Wn = {
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
- }, Yn = /* @__PURE__ */ x({
927
+ }, ro = /* @__PURE__ */ ee({
861
928
  name: "JtCrudTable",
862
929
  __name: "JtCrudTable",
863
- props: /* @__PURE__ */ ot({
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__ */ ot(["search", "reset", "page-change", "size-change"], ["update:currentPage", "update:pageSize", "update:searchModel"]),
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 = He(t, "currentPage"), v = He(t, "pageSize"), p = He(t, "searchModel"), u = ve(), b = ne(), E = ne(), m = _(() => o.option), d = _(() => m.value.searchShow !== !1), c = _(() => m.value.paginationShow !== !1), h = _(
880
- () => o.columns.filter((w) => w.search && !!u[`${w.prop}-search`])
881
- ), k = _(
882
- () => o.columns.filter((w) => !w.hide && !!u[`${w.prop}-header`])
883
- ), G = _(
884
- () => o.columns.filter((w) => !w.hide && !!u[`${w.prop}-data`])
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 B() {
887
- const w = {};
888
- return o.columns.forEach((S) => {
889
- S.search && (w[S.prop] = void 0);
890
- }), w;
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 i() {
893
- a("search", { ...p.value });
959
+ function q() {
960
+ a("search", { ...l.value });
894
961
  }
895
- function g() {
896
- p.value = B(), a("reset");
962
+ function c() {
963
+ l.value = F(), a("reset");
897
964
  }
898
- function I() {
899
- E.value?.searchLoading();
965
+ function v() {
966
+ M.value?.searchLoading();
900
967
  }
901
- function N() {
902
- E.value?.searchDone();
968
+ function T() {
969
+ M.value?.searchDone();
903
970
  }
904
971
  return e({
905
972
  /** 获取内部 el-table 实例 */
906
- tableRef: _(() => b.value?.tableRef),
973
+ tableRef: I(() => m.value?.tableRef),
907
974
  /** 获取内部筛选条实例 */
908
- filterBarRef: E,
975
+ filterBarRef: M,
909
976
  /** 开启筛选表单禁用。 */
910
- searchLoading: I,
977
+ searchLoading: v,
911
978
  /** 关闭筛选表单禁用。 */
912
- searchDone: N
913
- }), (w, S) => {
914
- const P = un;
915
- return y(), L("div", xn, [
916
- j(w.$slots, "header", {}, void 0, !0),
917
- d.value ? (y(), V(Gn, {
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: E,
921
- modelValue: p.value,
922
- "onUpdate:modelValue": S[0] || (S[0] = (C) => p.value = C),
923
- columns: w.columns,
924
- option: m.value,
925
- onSearch: i,
926
- onReset: g
927
- }, we({ _: 2 }, [
928
- oe(h.value, (C) => ({
929
- name: `${C.prop}-search`,
930
- fn: M((A) => [
931
- j(w.$slots, `${C.prop}-search`, ce(me(A)), void 0, !0)
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"])) : Q("", !0),
935
- q(u).toolbar ? (y(), L("div", Wn, [
936
- j(w.$slots, "toolbar", {}, void 0, !0)
937
- ])) : Q("", !0),
938
- on((y(), V(Kn, {
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: b,
941
- data: w.data,
942
- columns: w.columns,
943
- option: m.value,
944
- "table-events": w.tableEvents
945
- }, we({ _: 2 }, [
946
- oe(k.value, (C) => ({
947
- name: `${C.prop}-header`,
948
- fn: M((A) => [
949
- j(w.$slots, `${C.prop}-header`, ce(me(A)), void 0, !0)
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
- oe(G.value, (C) => ({
953
- name: `${C.prop}-data`,
954
- fn: M((A) => [
955
- j(w.$slots, `${C.prop}-data`, ce(me(A)), void 0, !0)
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
- m.value.menu ? {
1025
+ f.value.menu ? {
959
1026
  name: "menu",
960
- fn: M((C) => [
961
- j(w.$slots, "menu", ce(me(C)), void 0, !0)
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
- [P, m.value.loading]
1033
+ [k, f.value.loading]
967
1034
  ]),
968
- c.value ? (y(), V(Hn, {
1035
+ p.value ? (b(), V(no, {
969
1036
  key: 2,
970
1037
  "current-page": r.value,
971
- "onUpdate:currentPage": S[1] || (S[1] = (C) => r.value = C),
972
- "page-size": v.value,
973
- "onUpdate:pageSize": S[2] || (S[2] = (C) => v.value = C),
974
- total: w.total,
975
- option: m.value,
976
- onPageChange: S[3] || (S[3] = (C) => w.$emit("page-change", C)),
977
- onSizeChange: S[4] || (S[4] = (C) => w.$emit("size-change", C))
978
- }, null, 8, ["current-page", "page-size", "total", "option"])) : Q("", !0)
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
- }), va = /* @__PURE__ */ X(Yn, [["__scopeId", "data-v-ad466273"]]), Zn = { class: "jt-page-header__title" }, Qn = { key: 0 }, Xn = {
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
- }, eo = /* @__PURE__ */ x({
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 = ve(), r = _(() => n.operates.length > 0 || !!a.operates);
996
- function v(p, u) {
997
- p.onClick?.(p, u), o("operate-click", p, u);
998
- }
999
- return (p, u) => (y(), L("div", K({
1000
- class: ["jt-page-header", `jt-page-header--${p.type}`]
1001
- }, p.$attrs), [
1002
- J("div", Zn, [
1003
- j(p.$slots, "title", {}, () => [
1004
- p.title ? (y(), L("span", Qn, ee(p.title), 1)) : Q("", !0)
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 ? (y(), L("div", Xn, [
1008
- j(p.$slots, "operates", { operates: p.operates }, () => [
1009
- (y(!0), L(de, null, oe(p.operates, (b) => (y(), V(q(ze), K({
1010
- key: b.key ?? b.label,
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
- }, b.buttonProps, {
1013
- type: b.type,
1014
- disabled: b.disabled,
1015
- loading: b.loading,
1016
- plain: b.plain,
1017
- text: b.text,
1018
- link: b.link,
1019
- icon: b.icon,
1020
- onClick: (E) => v(b, E)
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: M(() => [
1023
- J("span", null, ee(b.label), 1)
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
- ])) : Q("", !0)
1095
+ ])) : te("", !0)
1029
1096
  ], 16));
1030
1097
  }
1031
- }), ga = /* @__PURE__ */ X(eo, [["__scopeId", "data-v-9e6bb356"]]);
1032
- function to(t = null) {
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 st(t) {
1046
- const e = Lt(t), n = Nt(e), o = fo(e).flatMap((a) => Pt(a, n));
1112
+ function mt(t) {
1113
+ const e = Dt(t), n = zt(e), o = wo(e).flatMap((a) => qt(a, n));
1047
1114
  return {
1048
- ...to(t),
1115
+ ...uo(t),
1049
1116
  scheme: n,
1050
1117
  topNodes: o,
1051
1118
  treeNodes: o
1052
1119
  };
1053
1120
  }
1054
- function Ft(t, e, n) {
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: Ft(o.children, e, n)
1124
+ children: Gt(o.children, e, n)
1058
1125
  });
1059
1126
  }
1060
- function no(t, e = {}, n = null) {
1061
- const o = Lt(t), a = Nt(o, e), r = lo(o, e, n), v = Object.fromEntries(r.map((p) => [p.key, p]));
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: v,
1137
+ sectionMap: s,
1071
1138
  raw: t
1072
1139
  };
1073
1140
  }
1074
- function oo(t) {
1141
+ function po(t) {
1075
1142
  return t.multRow || t.htmlDisplay === "T" ? "table" : "form";
1076
1143
  }
1077
- function ao(t, e = {}) {
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 ?? H(t.raw.infSchmId),
1081
- emplid: e.emplid ?? H(t.raw.emplid),
1082
- tagId: e.tagId ?? t.requestTagId ?? t.tagId,
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
- infSetFields: t.renderType === "table" ? t.rows.map(Ze) : [Ze(t.model)],
1156
+ // 保存时只把当前编辑出来的业务行数据放进 infSetValues,避免把详情模板参数一并带走。
1157
+ infSetValues: n,
1086
1158
  section: t
1087
1159
  };
1088
1160
  }
1089
- function ha(t) {
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 Mt(t) {
1094
- const e = Rt(t);
1095
- return (Array.isArray(e) ? e : je(Z(e), ["options", "list", "records", "data"])).map((o) => {
1096
- const a = Z(o);
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: R(a.label ?? a.name ?? a.descr ?? a.text ?? a.value ?? a.code),
1101
- name: H(a.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 lo(t, e, n) {
1108
- const o = je(t, ["sections", "sets", "list"]);
1109
- return o.length > 0 ? o.map((a) => it(a, e, n, o.length === 1)) : t.infSetMark || t.infSetFields || t.fields ? [it(t, e, n, !0)] : [];
1110
- }
1111
- function it(t, e, n, o) {
1112
- const a = Z(t), r = ro(a.infSetMark ?? a), v = so(a.infSetFields ?? a.fields ?? []), p = uo(a.infSetValues ?? a.rows ?? a.data, v), u = p[0] ? Ze(p[0]) : Vt(v), b = Z(a.tag), E = R(a.tagId ?? a.infTagId ?? b.tagId), m = R(e.tagId ?? n?.tagId), d = R(n?.key), c = o ? e.infSetId ?? n?.infSetId : void 0, h = o ? e.setId : void 0, k = o ? n?.code : void 0, G = r.setId || R(a.setId), B = R(a.infSetId) || G || R(c), i = G || R(h ?? B), g = r.code || R(a.code ?? k ?? i), I = i || g || B || E, N = {
1113
- key: I,
1114
- id: I,
1115
- setId: i,
1116
- code: g,
1117
- tagId: E,
1118
- requestTagId: m || void 0,
1119
- ownerNodeKey: d || void 0,
1120
- infSetId: B,
1121
- title: r.name || R(a.name ?? n?.tagName ?? I),
1122
- renderType: oo(r),
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: v,
1125
- model: u,
1126
- rows: p,
1127
- operationInfo: Ke(e.operationInfo ?? a.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 N.renderType === "form" && p.length === 0 && (N.rows = [{ ...u, __rowKey: `${I}-0` }]), N;
1204
+ return T.renderType === "form" && l.length === 0 && (T.rows = [{ ...d, __rowKey: `${v}-0` }]), T;
1131
1205
  }
1132
- function ro(t) {
1133
- const e = Z(t), n = R(e.htmlDisplay || "F");
1206
+ function go(t) {
1207
+ const e = W(t), n = j(e.htmlDisplay || "F");
1134
1208
  return {
1135
- name: R(e.name ?? e.title),
1136
- parentName: H(e.parentName),
1137
- value: H(e.value),
1138
- type: H(e.type),
1139
- code: R(e.code),
1140
- setId: R(e.setId ?? e.id ?? e.key),
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: ue(e.multRow),
1143
- isRequired: ue(e.isRequired),
1216
+ multRow: ve(e.multRow),
1217
+ isRequired: ve(e.isRequired),
1144
1218
  raw: e
1145
1219
  };
1146
1220
  }
1147
- function so(t) {
1148
- return (Array.isArray(t) ? t : []).map((n, o) => io(n, o));
1221
+ function yo(t) {
1222
+ return (Array.isArray(t) ? t : []).map((n, o) => ho(n, o));
1149
1223
  }
1150
- function io(t, e) {
1151
- const n = Z(t), o = R(n.code ?? n.fieldCode ?? n.prop ?? n.key ?? `field_${e}`), a = R(n.label ?? n.name ?? n.tagName ?? o);
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: R(n.id ?? n.key ?? n.prop ?? o),
1154
- key: R(n.key ?? n.prop ?? o),
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: go(n),
1159
- fieldType: H(n.fieldType),
1160
- renderType: vo(n),
1161
- required: ue(n.required ?? n.isRequired),
1162
- readonly: ue(n.readonly ?? n.disabled),
1163
- visible: n.visible === void 0 ? ue(n.visibled ?? !0) : ue(n.visible),
1164
- htmlDisplay: ue(n.htmlDisplay),
1165
- multRow: ue(n.multRow),
1166
- isRequired: ue(n.isRequired),
1167
- disabled: n.disabled === void 0 ? void 0 : ue(n.disabled),
1168
- span: Ot(n.span ?? n.colSpan),
1169
- width: ct(n.width),
1170
- minWidth: ct(n.minWidth),
1171
- placeholder: H(n.placeholder),
1172
- options: Mt(n.options),
1173
- interface: jt(n.interface),
1174
- cascadeClearFields: ut(n.cascadeClearFields),
1175
- cascadeDependFields: ut(n.cascadeDependFields),
1176
- props: Qe(n.props),
1177
- formItemProps: Qe(n.formItemProps),
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 uo(t, e) {
1256
+ function bo(t, e) {
1182
1257
  if (Array.isArray(t) && t.some((a) => {
1183
- const r = Z(a);
1184
- return e.some((v) => r[v.code] !== void 0 || r[v.key] !== void 0);
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) => ({ ...Z(a), __rowKey: R(Z(a).__rowKey ?? Z(a).key ?? r) }));
1187
- const n = Vt(e);
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 Vt(t) {
1265
+ function Kt(t) {
1191
1266
  return t.reduce((e, n) => (e[n.code || n.key] = n.value, e), {});
1192
1267
  }
1193
- function Pt(t, e, n = "") {
1194
- const o = Z(t), a = je(o, ["children", "list", "tags"]).flatMap((v) => Pt(v, e, R(o.tagId ?? o.id ?? o.key))), r = mo(o.infSetList);
1195
- return a.length === 0 && r.length > 0 ? r.map((v, p) => po(o, v, e, n, p)) : [co(o, e, n, a)];
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 co(t, e, n, o) {
1198
- const a = R(t.tagId ?? t.id ?? t.key), r = R(t.tagName ?? t.name ?? t.label ?? 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: R(t.key ?? a),
1275
+ key: j(t.key ?? a),
1201
1276
  id: a,
1202
1277
  tagId: a,
1203
1278
  tagName: r,
1204
1279
  label: r,
1205
- tagLevel: H(t.tagLevel ?? t.level) ?? null,
1206
- level: Gt(t.tagLevel ?? t.level),
1207
- parentTagId: H(t.parentTagId ?? t.parentId ?? n),
1208
- parentId: H(t.parentTagId ?? t.parentId ?? n) ?? null,
1209
- infSchmId: H(t.infSchmId ?? e?.infSchmId),
1210
- schemeId: R(t.infSchmId ?? e?.infSchmId),
1211
- infSetId: H(t.infSetId ?? t.setId),
1212
- setId: H(t.setId),
1213
- code: H(t.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: Ke(t.operationInfo),
1291
+ operationInfo: We(t.operationInfo),
1217
1292
  loaded: o.length > 0,
1218
1293
  raw: t
1219
1294
  };
1220
1295
  }
1221
- function po(t, e, n, o, a) {
1222
- const r = R(t.tagId ?? t.id ?? t.key), v = R(t.tagName ?? t.name ?? t.label ?? r), p = e.infSetId || R(e.setId), u = e.setId || p, b = p || `${r}-${a}`;
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: b,
1225
- id: b,
1299
+ key: m,
1300
+ id: m,
1226
1301
  tagId: r,
1227
- tagName: v,
1228
- label: v,
1229
- tagLevel: H(t.tagLevel ?? t.level) ?? null,
1230
- level: Gt(t.tagLevel ?? t.level),
1231
- parentTagId: H(t.parentTagId ?? t.parentId ?? o),
1232
- parentId: H(t.parentTagId ?? t.parentId ?? o) ?? null,
1233
- infSchmId: H(t.infSchmId ?? n?.infSchmId),
1234
- schemeId: R(t.infSchmId ?? n?.infSchmId),
1235
- infSetId: p,
1236
- setId: u,
1237
- code: H(t.code ?? p),
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: Ke(t.operationInfo),
1315
+ operationInfo: We(t.operationInfo),
1241
1316
  loaded: !0,
1242
1317
  raw: {
1243
1318
  ...t,
1244
- infSetId: p,
1245
- setId: u,
1319
+ infSetId: l,
1320
+ setId: d,
1246
1321
  infSetList: [e.raw]
1247
1322
  }
1248
1323
  };
1249
1324
  }
1250
- function Nt(t, e = {}) {
1251
- const n = Z(t.globalInfoSchmMark ?? t.scheme ?? t), o = R(n.infSchmId ?? e.infSchmId), a = R(n.emplid ?? e.emplid);
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: R(n.globalInfoSchmMark ?? t.globalInfoSchmMark),
1257
- config: Array.isArray(t.globalInfoSchmConfig) ? "" : R(n.globalInfoSchmConfig ?? 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 fo(t) {
1336
+ function wo(t) {
1262
1337
  if (Array.isArray(t.globalInfoSchmConfig))
1263
1338
  return t.globalInfoSchmConfig;
1264
- const e = Z(t.globalInfoSchmConfig), n = je(e, ["children", "tree", "list", "tags"]);
1265
- return n.length ? n : je(t, ["children", "tree", "list", "tags", "records"]);
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 mo(t) {
1342
+ function _o(t) {
1268
1343
  return Array.isArray(t) ? t.map((e) => {
1269
- const n = Z(e);
1344
+ const n = W(e);
1270
1345
  return {
1271
- infSetId: R(n.infSetId ?? n.setId ?? n.id),
1272
- setId: H(n.setId),
1273
- operationInfo: Ke(n.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 Lt(t) {
1279
- return Z(Rt(t));
1353
+ function Dt(t) {
1354
+ return W(xt(t));
1280
1355
  }
1281
- function Rt(t) {
1282
- const e = Z(t);
1356
+ function xt(t) {
1357
+ const e = W(t);
1283
1358
  return e.data ?? e.result ?? t;
1284
1359
  }
1285
- function je(t, e) {
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 Ze(t) {
1368
+ function rt(t) {
1294
1369
  const e = { ...t };
1295
1370
  return delete e.__rowKey, delete e.fields, e;
1296
1371
  }
1297
- function jt(t) {
1298
- const e = Z(t);
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: H(e.method),
1303
- url: H(e.url),
1304
- params: Qe(e.params)
1377
+ method: Y(e.method),
1378
+ url: Y(e.url),
1379
+ params: Ht(e.params)
1305
1380
  };
1306
1381
  }
1307
- function Ke(t) {
1308
- const e = Z(t);
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, jt(o) ?? o])
1386
+ Object.entries(e).map(([n, o]) => [n, Jt(o) ?? o])
1312
1387
  );
1313
1388
  }
1314
- function ut(t) {
1389
+ function gt(t) {
1315
1390
  if (!Array.isArray(t))
1316
1391
  return;
1317
- const e = t.map((n) => R(n)).filter(Boolean);
1392
+ const e = t.map((n) => j(n)).filter(Boolean);
1318
1393
  return e.length ? e : void 0;
1319
1394
  }
1320
- function vo(t) {
1321
- if (ue(t.htmlDisplay)) return "html";
1322
- if (ue(t.multRow)) return "multi-row";
1323
- const e = R(t.renderType).toLowerCase();
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 go(t) {
1327
- const e = R(t.fieldType ?? t.type ?? t.renderType).toLowerCase();
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 Qe(t) {
1331
- const e = Z(t);
1405
+ function Ht(t) {
1406
+ const e = W(t);
1332
1407
  return Object.keys(e).length ? e : void 0;
1333
1408
  }
1334
- function ct(t) {
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 Z(t) {
1418
+ function W(t) {
1338
1419
  return t && typeof t == "object" && !Array.isArray(t) ? t : {};
1339
1420
  }
1340
- function R(t) {
1421
+ function j(t) {
1341
1422
  return t == null ? "" : String(t).trim();
1342
1423
  }
1343
- function H(t) {
1344
- return R(t) || void 0;
1424
+ function Y(t) {
1425
+ return j(t) || void 0;
1345
1426
  }
1346
- function Gt(t) {
1347
- const e = Ot(t);
1427
+ function Ut(t) {
1428
+ const e = Wt(t);
1348
1429
  return e === void 0 ? null : e;
1349
1430
  }
1350
- function Ot(t) {
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 ue(t) {
1436
+ function ve(t) {
1356
1437
  return typeof t == "string" ? ["true", "1", "y", "yes", "t", "是"].includes(t.toLowerCase()) : !!t;
1357
1438
  }
1358
- const be = (t) => t.key || t.code, ie = (t) => t.key || t.setId, Te = (t) => new Error(`[GlobalInfo] ${t}`), Be = (t) => t && typeof t == "object" && !Array.isArray(t) ? t : {}, Ae = (t) => {
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
- ]), yo = (t) => Ge([
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
- ]), Pe = (t = {}) => ({
1378
- // loading:当前 section 是否正在拉详情。
1379
- loading: !1,
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
- }, bo = (t, e, n) => Ge([n, ...Le(e)]).length === 0 ? t : t.filter((a) => At(a, e, n)), So = (t) => {
1394
- const e = ne(!1), n = ne(!1), o = ne(!1), a = ye(null), r = ye([]), v = ye(null), p = ye(null), u = ye(null), b = ye({}), E = ye({}), m = ne([]), d = ye({}), c = ne([]), h = _(
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 s = m.value.map((f) => b.value[f]).filter((f) => !!f), l = Object.entries(b.value).filter(([f]) => !m.value.includes(f)).map(([, f]) => f);
1397
- return [...s, ...l];
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
- ), k = _(() => ({
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: c.value,
1605
+ editingSectionKeys: p.value,
1408
1606
  // 已加载 section 映射。
1409
- sectionMap: b.value,
1607
+ sectionMap: m.value,
1410
1608
  // section 状态映射;这里把 alias 后的编辑态也同步进去。
1411
1609
  sectionStatusMap: Object.fromEntries(
1412
- Object.entries(d.value).map(([s, l]) => [
1413
- s,
1610
+ Object.entries(y.value).map(([i, u]) => [
1611
+ i,
1414
1612
  {
1415
1613
  // 保留原状态字段。
1416
- ...l,
1614
+ ...u,
1417
1615
  // 编辑态以 editingSectionKeys 为准,避免状态对象里 editing 值残留。
1418
- editing: c.value.includes(
1419
- E.value[s] ?? s
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
- })), G = () => ({
1624
+ })), P = () => ({
1427
1625
  // adaptScene 透传给新接口形态。
1428
1626
  adaptScene: t.adaptScene,
1429
1627
  // emplid 是当前人员标识,树和详情接口都需要它。
1430
1628
  emplid: t.emplid
1431
- }), B = (s) => ({
1629
+ }), F = (i) => ({
1432
1630
  // 复用基础参数,保证人员和场景一致。
1433
- ...G(),
1631
+ ...P(),
1434
1632
  // infSchmId 指定当前模板方案。
1435
- infSchmId: s.infSchmId,
1633
+ infSchmId: i.infSchmId,
1436
1634
  // tagId 指定要展开的树节点。
1437
- tagId: s.tagId,
1635
+ tagId: i.tagId,
1438
1636
  // tagLevel 告诉后端当前节点层级。
1439
- tagLevel: s.tagLevel,
1637
+ tagLevel: i.tagLevel,
1440
1638
  // parentTagId 保留父子关系上下文。
1441
- parentTagId: s.parentTagId
1442
- }), i = (s = p.value, l = u.value) => ({
1639
+ parentTagId: i.parentTagId
1640
+ }), q = (i = l.value, u = d.value) => ({
1443
1641
  // 详情接口同样需要基础人员和场景参数。
1444
- ...G(),
1642
+ ...P(),
1445
1643
  // 当前节点所属模板方案。
1446
- infSchmId: s?.infSchmId,
1644
+ infSchmId: i?.infSchmId,
1447
1645
  // 当前点击或加载的树节点 id。
1448
- tagId: s?.tagId,
1646
+ tagId: i?.tagId,
1449
1647
  // 保存或刷新指定 section 时优先使用 section 自己的信息集 id。
1450
- infSetId: l?.infSetId ?? s?.infSetId,
1648
+ infSetId: u?.infSetId ?? i?.infSetId,
1451
1649
  // setId 同样优先取 section,避免保存时拿错节点 setId。
1452
- setId: l?.setId ?? s?.setId
1453
- }), g = async (s, l) => {
1454
- if (!t.service.requestOperation)
1455
- throw Te("service.requestOperation is required for operationInfo");
1456
- return t.service.requestOperation(s, l);
1457
- }, I = (s, l = {}, f) => {
1458
- const T = Be(s.params), F = f?.cascadeDependFields ?? [];
1459
- let z = 0;
1460
- return Object.fromEntries(
1461
- Object.entries(T).map(([O, D]) => {
1462
- if (D !== "")
1463
- return [O, D];
1464
- if (l[O] !== void 0)
1465
- return [O, l[O]];
1466
- const W = F[z];
1467
- return z += 1, [O, W ? l[W] ?? "" : D];
1468
- })
1469
- );
1470
- }, N = (s) => {
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
- }, C = (s = u.value) => {
1494
- if (s)
1495
- return typeof s == "string" ? s : Ne(s) ? pe(s) : ie(s);
1496
- }, A = (s = u.value) => {
1497
- const l = C(s);
1498
- if (!l)
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 f = E.value[l] ?? l;
1501
- return b.value[f] ?? null;
1502
- }, ae = (s = u.value) => {
1503
- const l = C(s);
1504
- if (l)
1505
- return E.value[l] ?? l;
1506
- }, pe = (s = u.value) => {
1507
- if (s)
1508
- return typeof s == "string" ? s : Ne(s) ? s.setId ?? s.infSetId ?? s.key : ie(s);
1509
- }, ke = (s = u.value) => {
1510
- if (Ne(s))
1511
- return s;
1512
- if (typeof s == "string") {
1513
- const l = P(r.value, s);
1514
- if (l)
1515
- return l;
1516
- const f = A(s);
1517
- return f?.ownerNodeKey ? P(r.value, f.ownerNodeKey) ?? p.value : f || p.value && Le(p.value).includes(s) ? p.value : null;
1518
- }
1519
- return s?.ownerNodeKey ? P(r.value, s.ownerNodeKey) ?? p.value : p.value;
1520
- }, Ce = (s = u.value) => !s || Ne(s) ? null : A(s), Me = (s = u.value) => {
1521
- const l = pe(s);
1522
- if (!l)
1523
- return Pe();
1524
- const f = E.value[l] ?? l;
1525
- return Pe({
1526
- ...d.value[l],
1527
- ...d.value[f],
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: c.value.includes(
1530
- f
1707
+ editing: p.value.includes(
1708
+ g
1531
1709
  )
1532
1710
  });
1533
- }, le = (s, l) => {
1534
- const f = pe(s);
1535
- f && (d.value = {
1536
- ...d.value,
1537
- [f]: Pe({
1711
+ }, Q = (i, u) => {
1712
+ const g = k(i);
1713
+ g && (y.value = {
1714
+ ...y.value,
1715
+ [g]: je({
1538
1716
  // 保留已有状态。
1539
- ...d.value[f],
1717
+ ...y.value[g],
1540
1718
  // 合并本次状态补丁。
1541
- ...l,
1719
+ ...u,
1542
1720
  // 编辑态仍以 editingSectionKeys 为准。
1543
- editing: c.value.includes(f)
1721
+ editing: p.value.includes(g)
1544
1722
  })
1545
1723
  });
1546
- }, Se = (s = v.value?.raw ?? null, l = p.value) => {
1547
- const f = h.value, T = u.value && f.find(
1548
- (F) => ie(F) === ie(u.value)
1549
- ) ? u.value : null;
1550
- v.value = {
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: v.value?.scheme ?? null,
1730
+ scheme: s.value?.scheme ?? null,
1553
1731
  // 当前节点。
1554
- node: l,
1732
+ node: u,
1555
1733
  // 顶层节点和树节点都来自 nodes。
1556
1734
  topNodes: r.value,
1557
1735
  treeNodes: r.value,
1558
1736
  // 当前激活节点。
1559
- activeNode: l,
1737
+ activeNode: u,
1560
1738
  // 当前激活 section。
1561
- activeSection: T,
1739
+ activeSection: E,
1562
1740
  // 当前所有已加载 section。
1563
- sections: f,
1741
+ sections: g,
1564
1742
  // 当前 section 缓存。
1565
- sectionMap: b.value,
1743
+ sectionMap: m.value,
1566
1744
  // 保留原始接口数据。
1567
- raw: s
1568
- }, u.value = T;
1569
- }, qe = (s, l = p.value, f) => {
1570
- const T = { ...b.value }, F = { ...E.value }, z = [...m.value], O = { ...d.value }, D = bo(s.sections, l, f), W = Ge([f, ...Le(l)]).length > 0, te = D.find((he) => At(he, l, f)) ?? (W ? null : s.activeSection ?? D[0] ?? u.value ?? null);
1571
- return D.forEach((he) => {
1572
- const ge = ie(he);
1573
- T[ge] = he, z.includes(ge) || z.push(ge), O[ge] = Pe({
1574
- ...O[ge],
1575
- loaded: !0,
1576
- loading: !1,
1577
- error: null,
1578
- editing: c.value.includes(ge)
1579
- });
1580
- }), f && te ? F[f] = ie(te) : f && (F[f] = ""), f && (O[f] = Pe({
1581
- ...O[f],
1582
- loaded: !0,
1583
- loading: !1,
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: l,
1592
- activeSection: te,
1593
- sections: D,
1594
- sectionMap: b.value
1595
- }, u.value = te, te;
1596
- }, _e = (s, l) => {
1597
- const f = ae(s), T = f ? b.value[f] : null;
1598
- if (!f || !T)
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 F = l(T);
1601
- b.value = {
1602
- ...b.value,
1603
- [f]: F
1604
- }, u.value = ie(u.value ?? F) === f ? F : u.value, Se();
1605
- }, $e = async (s = u.value ?? p.value) => {
1606
- const l = Ce(s), f = ke(s) ?? p.value, T = pe(s);
1607
- if (!f)
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 Te("service.requestOperation is required");
1611
- n.value = !0, a.value = null, le(T ?? f, { loading: !0, error: 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 F = l ? [{ infSetId: l.infSetId, setId: l.setId, operationInfo: l.operationInfo, raw: l.raw }] : f.infSetList;
1614
- if (F.length === 0)
1615
- throw Te("node.infSetList is required");
1616
- const z = await Promise.all(F.map(async (D) => {
1617
- const W = w(l, f, D.infSetId), te = {
1618
- ...i(f, l),
1619
- infSetId: D.infSetId,
1620
- setId: D.setId,
1621
- operationInfo: D.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 (W) {
1624
- const he = await g(W, {
1796
+ if (ue) {
1797
+ const et = await c(ue, {
1625
1798
  type: "queryInfoSet",
1626
- node: f,
1627
- section: l,
1628
- params: te
1799
+ requestSource: "inner",
1800
+ tagId: u?.requestTagId ?? u?.tagId ?? g.tagId,
1801
+ node: g,
1802
+ section: u,
1803
+ params: ke
1629
1804
  });
1630
- return no(he, te, f);
1805
+ return fo(et, ke, g);
1631
1806
  }
1632
- throw Te("infoSet.operationInfo.queryInfoSet is required");
1633
- })), O = {
1634
- ...z[0],
1635
- sections: z.flatMap((D) => D.sections),
1636
- sectionMap: Object.fromEntries(z.flatMap((D) => D.sections).map((D) => [D.key, D]))
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 qe(O, f, T);
1639
- } catch (F) {
1640
- throw a.value = F, le(T ?? f, { loading: !1, error: F }), F;
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, le(T ?? f, { loading: !1 });
1817
+ n.value = !1, Q(E ?? g, { loading: !1 });
1643
1818
  }
1644
- }, Ve = (s = u.value) => $e(s), $ = (s = u.value) => {
1645
- if (!s)
1819
+ }, O = (i = d.value) => N(i), z = (i = d.value) => {
1820
+ if (!i)
1646
1821
  return null;
1647
- if (!Ne(s) && typeof s != "string")
1648
- return A(s);
1649
- const l = pe(s);
1650
- return l ? b.value[E.value[l] ?? l] ?? null : null;
1651
- }, U = async (s = p.value) => s ? (await $e(s), v.value) : (v.value = null, u.value = null, b.value = {}, E.value = {}, m.value = [], d.value = {}, null), Y = async (s) => {
1652
- const l = N(s);
1653
- if (!l)
1654
- return s.children;
1655
- const f = B(s), T = await g(l, { type: "openTag", node: s, params: f });
1656
- return st(T).treeNodes;
1657
- }, Ie = async (s) => {
1658
- if (s.loaded)
1659
- return s.children;
1660
- const l = await Y(s);
1661
- return l.length > 0 && (r.value = Ft(r.value, s.key, l)), l;
1662
- }, Je = async (s) => {
1663
- const l = typeof s == "string" ? P(r.value, s) : s;
1664
- return l ? (p.value = l, u.value = null, c.value = [], await Ie(l), Se(v.value?.raw, l), l) : null;
1665
- }, Ue = async () => {
1666
- const s = t.service.templateTree;
1667
- if (!s)
1668
- throw Te("service.templateTree is required");
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 l = await s(G()), f = st(l), T = await Promise.all(
1672
- f.treeNodes.map(async (z) => {
1673
- const O = await Y(z);
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
- ...z,
1676
- children: O,
1677
- loaded: O.length > 0 || z.loaded
1856
+ ...re,
1857
+ children: fe,
1858
+ loaded: fe.length > 0 || re.loaded
1678
1859
  };
1679
1860
  })
1680
1861
  );
1681
- r.value = T, u.value = null, b.value = {}, E.value = {}, m.value = [], d.value = {}, c.value = [];
1682
- const F = P(T, t.initialActiveNodeKey) ?? P(T);
1683
- return p.value = F, v.value = {
1684
- ...f,
1685
- treeNodes: T,
1686
- activeNode: F,
1687
- sectionMap: b.value,
1688
- sections: h.value
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 (l) {
1691
- throw a.value = l, l;
1871
+ } catch (u) {
1872
+ throw a.value = u, u;
1692
1873
  } finally {
1693
1874
  e.value = !1;
1694
1875
  }
1695
- }, Ht = async () => {
1696
- const s = C();
1697
- await Ve(u.value ?? p.value);
1698
- const l = h.value.find(
1699
- (f) => ie(f) === s
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 l && (u.value = l), Se(), v.value;
1702
- }, tt = (s = u.value) => {
1703
- const l = ae(s);
1704
- return !!(l && c.value.includes(l));
1705
- }, xt = (s = u.value) => {
1706
- const l = ae(s);
1707
- !l || tt(l) || (c.value = [...c.value, l], le(l, { editing: !0 }));
1708
- }, nt = (s = u.value) => {
1709
- const l = ae(s);
1710
- l && (c.value = c.value.filter(
1711
- (f) => f !== l
1712
- ), le(l, { editing: !1 }));
1713
- }, Wt = (s, l, f) => {
1714
- const T = typeof l == "string" ? l : be(l);
1715
- _e(s, (F) => {
1716
- const O = (typeof l == "string" ? F.fields.find((W) => be(W) === T || W.code === T) : l)?.cascadeClearFields ?? [], D = {
1717
- ...F.model,
1718
- [T]: f
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 O.forEach((W) => {
1721
- D[W] = "";
1901
+ return fe.forEach((ue) => {
1902
+ ne[ue] = "";
1722
1903
  }), {
1723
1904
  // 保留 section 其它元数据。
1724
- ...F,
1905
+ ...R,
1725
1906
  // 更新表单 model。
1726
- model: D,
1907
+ model: ne,
1727
1908
  // 表单类型同步更新第一行 rows,方便保存时统一从 rows 构造 payload。
1728
- rows: F.renderType === "form" ? [{ ...F.rows[0], ...D }] : F.rows,
1909
+ rows: R.renderType === "form" ? [{ ...R.rows[0], ...ne }] : R.rows,
1729
1910
  // 同步 fields.value,保证只读 renderer 立即显示新值。
1730
- fields: F.fields.map((W) => {
1731
- const te = be(W);
1732
- return te === T || W.code === T ? { ...W, value: f } : O.includes(te) || O.includes(W.code) ? { ...W, value: "" } : W;
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
- }, Yt = async (s, l, f = {}) => {
1737
- const T = A(s);
1738
- if (!T)
1917
+ }, Ee = async (i, u, g = {}) => {
1918
+ const E = S(i);
1919
+ if (!E)
1739
1920
  return [];
1740
- const F = Object.keys(f).length > 0 ? f : T.model, z = typeof l == "string" ? l : be(l), O = typeof l == "string" ? T.fields.find((fe) => be(fe) === z || fe.code === z) : l, D = O?.interface;
1741
- if (!O || !D)
1742
- return O?.options ?? [];
1743
- if ((O.cascadeDependFields ?? []).some((fe) => {
1744
- const se = F[fe];
1745
- return se == null || se === "";
1746
- }))
1747
- return _e(T, (fe) => ({
1748
- ...fe,
1749
- fields: fe.fields.map(
1750
- (se) => be(se) === z || se.code === z ? { ...se, options: [] } : se
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 te = I(D, F, O), he = await g(
1939
+ const et = await c(
1754
1940
  {
1755
- ...D,
1756
- params: te
1941
+ ...ke
1757
1942
  },
1758
1943
  {
1759
1944
  type: "fieldOptions",
1760
- node: ke(T),
1761
- section: T,
1762
- field: O,
1763
- params: te
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
- ), ge = Mt(he);
1766
- return _e(T, (fe) => ({
1767
- ...fe,
1768
- fields: fe.fields.map(
1769
- (se) => be(se) === z || se.code === z ? { ...se, options: ge } : se
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
- })), ge;
1772
- }, Zt = (s, l) => {
1773
- if (Array.isArray(l)) {
1774
- Oe(s, l);
1960
+ })), ct;
1961
+ }, Xe = (i, u) => {
1962
+ if (Array.isArray(u)) {
1963
+ De(i, u);
1775
1964
  return;
1776
1965
  }
1777
- _e(s, (f) => ({
1778
- ...f,
1966
+ h(i, (g) => ({
1967
+ ...g,
1779
1968
  // 替换当前 model。
1780
- model: l,
1969
+ model: u,
1781
1970
  // 表单类型同步合并到第一行 rows。
1782
- rows: f.renderType === "form" ? [{ ...f.rows[0], ...l }] : f.rows,
1971
+ rows: g.renderType === "form" ? [{ ...g.rows[0], ...u }] : g.rows,
1783
1972
  // fields.value 也同步成 model 中的值。
1784
- fields: f.fields.map((T) => ({
1785
- ...T,
1786
- value: l[be(T)]
1973
+ fields: g.fields.map((E) => ({
1974
+ ...E,
1975
+ value: u[Fe(E)]
1787
1976
  }))
1788
1977
  }));
1789
- }, Oe = (s, l) => {
1790
- _e(s, (f) => ({
1791
- ...f,
1792
- rows: l,
1793
- data: l
1978
+ }, De = (i, u) => {
1979
+ h(i, (g) => ({
1980
+ ...g,
1981
+ rows: u,
1982
+ data: u
1794
1983
  }));
1795
- }, Qt = {
1984
+ }, an = {
1796
1985
  // 加载模板树。
1797
- loadTree: Ue,
1986
+ loadTree: ce,
1798
1987
  // 选中树节点。
1799
- selectNode: Je,
1988
+ selectNode: x,
1800
1989
  // 加载当前节点详情。
1801
- loadDetail: U,
1990
+ loadDetail: A,
1802
1991
  // 刷新当前详情。
1803
- reloadActiveSection: Ht,
1992
+ reloadActiveSection: Ie,
1804
1993
  // 加载指定节点或 section。
1805
- loadSection: $e,
1994
+ loadSection: N,
1806
1995
  // 重新加载指定节点或 section。
1807
- reloadSection: Ve,
1996
+ reloadSection: O,
1808
1997
  // 获取指定节点或 section 的缓存数据。
1809
- getSection: $,
1998
+ getSection: z,
1810
1999
  // 获取指定节点或 section 的状态。
1811
- getSectionStatus: Me,
2000
+ getSectionStatus: me,
1812
2001
  // 开启编辑。
1813
- startEdit: xt,
2002
+ startEdit: $,
1814
2003
  // 取消编辑。
1815
- cancelEdit: nt,
2004
+ cancelEdit: Z,
1816
2005
  // 更新单字段。
1817
- updateField: Wt,
2006
+ updateField: ae,
1818
2007
  // 加载字段动态选项。
1819
- loadFieldOptions: Yt,
2008
+ loadFieldOptions: Ee,
1820
2009
  // 批量更新 model。
1821
- updateModel: Zt,
2010
+ updateModel: Xe,
1822
2011
  // 更新表格行。
1823
- updateTableRows: Oe,
2012
+ updateTableRows: De,
1824
2013
  // 保存单行到本地缓存。
1825
- saveRow: (s, l = {}, f = -1) => {
1826
- const F = [...A(s)?.rows ?? []];
1827
- F.splice(f >= 0 ? f : F.length, f >= 0 ? 1 : 0, l), Oe(s, F);
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: (s, l) => {
1831
- const f = A(s), T = typeof l == "string" ? Number(l) : l, F = (f?.rows ?? []).filter(
1832
- (z, O) => O !== T
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
- Oe(s, F);
2023
+ De(i, R);
1835
2024
  },
1836
2025
  // 调用接口保存 section。
1837
- saveSection: async (s = u.value) => {
1838
- const l = C(s), f = A(s);
1839
- if (!f)
2026
+ saveSection: async (i = d.value) => {
2027
+ const u = T(i), g = S(i);
2028
+ if (!g)
1840
2029
  return null;
1841
- const T = S(f);
1842
- if (!T)
1843
- throw Te("section.operationInfo.editInfoSet is required");
1844
- o.value = !0, a.value = null, l && l !== ie(f) && le(l, { saving: !0, error: null }), le(f, { saving: !0, error: 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 F = i(p.value, f), z = ao(f, F), O = await g(
1847
- {
1848
- ...T,
1849
- params: {
1850
- ...I(T, f.model),
1851
- ...z
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
- node: p.value,
1857
- section: f,
1858
- params: z
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 nt(f), await Ve(f), O;
1862
- } catch (F) {
1863
- throw a.value = F, l && l !== ie(f) && le(l, { saving: !1, error: F }), le(f, { saving: !1, error: F }), F;
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, l && l !== ie(f) && le(l, { saving: !1 }), le(f, { saving: !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: tt
2059
+ isEditing: Ve
1870
2060
  };
1871
- return Re(
2061
+ return be(
1872
2062
  // 监听当前人员 id。
1873
2063
  () => t.emplid,
1874
2064
  () => {
1875
- (t.autoLoad ?? !0) && Ue();
2065
+ (t.autoLoad ?? !0) && ce();
1876
2066
  }
1877
- ), ht(() => {
1878
- (t.autoLoad ?? !0) && Ue();
2067
+ ), $t(() => {
2068
+ (t.autoLoad ?? !0) && ce();
1879
2069
  }), {
1880
2070
  // 当前 viewModel。
1881
- viewModel: v,
2071
+ viewModel: s,
1882
2072
  // 当前模板树节点。
1883
2073
  nodes: r,
1884
2074
  // 当前已加载 section 列表。
1885
- sections: h,
2075
+ sections: w,
1886
2076
  // 当前 section 缓存。
1887
- sectionMap: b,
2077
+ sectionMap: m,
1888
2078
  // 当前 section 状态缓存。
1889
- sectionStatusMap: d,
2079
+ sectionStatusMap: y,
1890
2080
  // 当前激活节点。
1891
- activeNode: p,
2081
+ activeNode: l,
1892
2082
  // 当前激活 section。
1893
- activeSection: u,
2083
+ activeSection: d,
1894
2084
  // 给页面消费的状态快照。
1895
- state: k,
2085
+ state: C,
1896
2086
  // 给页面消费的操作集合。
1897
- actions: Qt
2087
+ actions: an
1898
2088
  };
1899
- }, ya = /* @__PURE__ */ x({
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 = So(t), { viewModel: o, nodes: a, sections: r, activeNode: v, activeSection: p, state: u, actions: b } = n;
1911
- return (E, m) => j(E.$slots, "default", ce(me({
1912
- viewModel: q(o),
1913
- nodes: q(a),
1914
- sections: q(r),
1915
- activeNode: q(v),
1916
- activeSection: q(p),
1917
- state: q(u),
1918
- actions: q(b)
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 _o(t) {
1923
- return dt(t.type || t.fieldType) || dt(t.renderType) || "text";
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 zt(t) {
1926
- return pt(t.type || t.fieldType) || pt(t.renderType) || "text";
2118
+ function it(t) {
2119
+ return It(t.type || t.fieldType || t.frontInputType) || It(t.renderType) || "text";
1927
2120
  }
1928
- function et(t) {
1929
- return t == null || t === "" || Array.isArray(t) && t.length === 0;
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 Dt(t) {
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 Kt(t, e, n = "-") {
1938
- const o = zt(t);
1939
- return o === "empty" || et(e) ? n : Dt(e) ? (console.error("[globalInfo] field value render failed", e), n) : o === "select" ? Io(t, e, n) : o === "switch" ? qt(e) ? "是" : "否" : o === "file" ? wo(e, n) : o === "multi-row" ? ko(e) : String(e);
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 qt(t) {
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 dt(t) {
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 pt(t) {
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 Io(t, e, n) {
1956
- if (Array.isArray(e)) {
1957
- const o = e.map((a) => ft(t, a) || String(a ?? "").trim()).filter(Boolean);
1958
- return o.length > 0 ? o.join("、") : n;
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 ft(t, e) || String(e);
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 ft(t, e) {
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 wo(t, e) {
2228
+ function Uo(t, e) {
1966
2229
  if (Array.isArray(t)) {
1967
- const n = t.map((o) => mt(o)).filter(Boolean);
2230
+ const n = t.map((o) => _t(o)).filter(Boolean);
1968
2231
  return n.length > 0 ? n.join("、") : e;
1969
2232
  }
1970
- return mt(t) || e;
2233
+ return _t(t) || e;
1971
2234
  }
1972
- function mt(t) {
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 ko(t) {
1981
- return Array.isArray(t) ? t.map((e) => Dt(e) ? (console.error("[globalInfo] multi-row field item render failed", e), "") : e && typeof e == "object" ? JSON.stringify(e) : String(e)).filter(Boolean).join(`
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 Co = ["disabled", "accept", "multiple"], $o = {
2247
+ const Zo = ["disabled", "accept", "multiple"], Yo = {
1985
2248
  key: 0,
1986
2249
  class: "global-info-field-control__file-text"
1987
- }, To = {
2250
+ }, Qo = {
1988
2251
  key: 1,
1989
2252
  class: "global-info-field-control__file-upload"
1990
- }, Bo = /* @__PURE__ */ x({
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 = _(() => _o(n.field)), v = _(() => n.disabled || n.field.disabled || n.field.readonly), p = _(() => n.modelValue === void 0 || n.modelValue === null ? "" : String(n.modelValue)), u = _(() => {
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 i = typeof n.modelValue == "number" ? n.modelValue : Number(n.modelValue);
2003
- return Number.isFinite(i) ? i : void 0;
2004
- }), b = _(() => {
2005
- const i = n.field.props?.activeValue ?? n.field.props?.["active-value"], g = n.field.props?.inactiveValue ?? n.field.props?.["inactive-value"];
2006
- return i !== void 0 || g !== void 0 ? n.modelValue ?? g ?? !1 : qt(n.modelValue);
2007
- }), E = _(() => r.value === "code" ? 5 : 3), m = _(() => r.value === "file" && !et(n.modelValue)), d = _(() => Kt(n.field, n.modelValue, "请选择文件")), c = _(() => n.field.placeholder ? n.field.placeholder : r.value === "select" ? "请选择" : r.value === "date" ? "请选择日期" : r.value === "file" ? "请选择文件" : "请输入");
2008
- function h(i) {
2009
- o("update:modelValue", i);
2010
- }
2011
- function k(i) {
2012
- o("change", i);
2013
- }
2014
- function G(i) {
2015
- i && o("loadOptions");
2016
- }
2017
- function B(i) {
2018
- const g = i.target, I = Array.from(g.files ?? []), N = n.field.props?.multiple ? I : I[0] ?? null;
2019
- h(N), k(N);
2020
- }
2021
- return (i, g) => {
2022
- const I = It, N = _t, w = bt, S = cn, P = dn, C = St;
2023
- return r.value === "select" ? (y(), V(N, K({
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
- }, i.field.props, {
2027
- "model-value": i.modelValue,
2028
- placeholder: c.value,
2029
- disabled: v.value,
2292
+ }, v.field.props, {
2293
+ "model-value": m.value,
2294
+ placeholder: w.value,
2295
+ disabled: s.value,
2030
2296
  clearable: "",
2031
- onVisibleChange: G,
2032
- "onUpdate:modelValue": h,
2033
- onChange: k
2297
+ onVisibleChange: q,
2298
+ "onUpdate:modelValue": C,
2299
+ onChange: P
2034
2300
  }), {
2035
- default: M(() => [
2036
- (y(!0), L(de, null, oe(i.field.options || [], (A) => (y(), V(I, {
2037
- key: String(A.value),
2038
- label: A.label,
2039
- value: A.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" ? (y(), V(w, K({
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
- }, i.field.props, {
2047
- "model-value": i.modelValue,
2048
- placeholder: c.value,
2049
- disabled: v.value,
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": h,
2053
- onChange: k
2054
- }), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "number" ? (y(), V(S, K({
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
- }, i.field.props, {
2058
- "model-value": u.value,
2059
- placeholder: c.value,
2060
- disabled: v.value,
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": h,
2063
- onChange: k
2064
- }), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "switch" ? (y(), V(P, K({
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
- }, i.field.props, {
2068
- "model-value": b.value,
2069
- disabled: v.value,
2070
- "onUpdate:modelValue": h,
2071
- onChange: k
2072
- }), null, 16, ["model-value", "disabled"])) : r.value === "file" ? (y(), L("label", {
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: De(["global-info-field-control global-info-field-control--file", {
2075
- "is-disabled": v.value,
2076
- "is-empty": !m.value,
2077
- "is-filled": m.value
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
- J("input", {
2346
+ D("input", {
2081
2347
  class: "global-info-field-control__file-input",
2082
2348
  type: "file",
2083
- disabled: v.value,
2084
- accept: String(i.field.props?.accept ?? ""),
2085
- multiple: !!i.field.props?.multiple,
2086
- onChange: B
2087
- }, null, 40, Co),
2088
- m.value ? (y(), L("span", $o, ee(d.value), 1)) : (y(), L("span", To, "上 传"))
2089
- ], 2)) : r.value === "empty" ? (y(), V(C, {
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
- })) : (y(), V(C, K({
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
- }, i.field.props, {
2099
- "model-value": p.value,
2100
- placeholder: c.value,
2101
- disabled: v.value,
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) ? E.value : void 0,
2104
- "onUpdate:modelValue": h,
2105
- onChange: k
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
- }), Jt = /* @__PURE__ */ X(Bo, [["__scopeId", "data-v-7f04d1b2"]]), Eo = ["innerHTML"], Fo = {
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
- }, Mo = /* @__PURE__ */ x({
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 = _(() => zt(e.field)), o = _(() => n.value === "empty" || et(e.value)), a = _(() => Kt(e.field, e.value, e.emptyText));
2122
- return (r, v) => n.value === "html" && !o.value ? (y(), L("span", {
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, Eo)) : n.value === "code" && !o.value ? (y(), L("pre", Fo, ee(a.value), 1)) : (y(), L("span", {
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: De(["global-info-field-value", {
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
- }, ee(a.value), 3));
2398
+ }, se(a.value), 3));
2133
2399
  }
2134
- }), Ut = /* @__PURE__ */ X(Mo, [["__scopeId", "data-v-08b37e58"]]), Vo = { class: "global-info-form-renderer__label" }, Po = {
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
- }, No = /* @__PURE__ */ x({
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 = ve(), o = _(() => e.section.fields.filter((d) => d.visible)), a = _(() => e.model ?? e.section.model);
2151
- function r(d, c) {
2152
- const h = { ...a.value, [d.code]: c };
2153
- (d.cascadeClearFields ?? []).forEach((k) => {
2154
- h[k] = "";
2155
- }), e.onUpdateModel?.(h), e.onUpdateModel || e.actions.updateField(e.section, d, c);
2156
- }
2157
- async function v(d) {
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, d, a.value);
2160
- } catch (c) {
2161
- console.error("[GlobalInfoFormRenderer] load field options failed", c);
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 p(d) {
2165
- const c = a.value[d.code];
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: d,
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: c,
2173
- value: c,
2523
+ modelValue: v,
2524
+ value: v,
2174
2525
  state: e.state,
2175
2526
  actions: e.actions,
2176
- updateModelValue: (h) => r(d, h)
2527
+ updateModelValue: (T) => s(c, T)
2177
2528
  };
2178
2529
  }
2179
- function u(d) {
2180
- const c = String(d.id || d.key || d.code || "").trim(), h = c ? `field-${c}` : "";
2181
- if (h && n[h]) return h;
2182
- const k = h.toLowerCase();
2183
- return k !== h && n[k] ? k : "";
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 b(d) {
2186
- return d.span ? Math.min(Math.max(d.span, 1), 24) : 6;
2536
+ function C(c) {
2537
+ return c.span ? Math.min(Math.max(c.span, 1), 24) : 6;
2187
2538
  }
2188
- function E(d) {
2189
- return d.key || d.id || d.code;
2539
+ function P(c) {
2540
+ return c.key || c.id || c.code;
2190
2541
  }
2191
- function m(d) {
2192
- return d.required || d.isRequired;
2542
+ function F(c, v) {
2543
+ return He(c) ? e.editing ? !0 : !Te(v) : !1;
2193
2544
  }
2194
- return (d, c) => {
2195
- const h = wt, k = fn, G = pn, B = kt;
2196
- return y(), V(B, {
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: a.value,
2552
+ model: o.value,
2199
2553
  "label-position": "top"
2200
2554
  }, {
2201
- default: M(() => [
2202
- re(G, { gutter: 24 }, {
2203
- default: M(() => [
2204
- (y(!0), L(de, null, oe(o.value, (i) => (y(), V(k, {
2205
- key: E(i),
2206
- span: b(i)
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: M(() => [
2209
- re(h, K({
2210
- prop: i.code,
2562
+ default: L(() => [
2563
+ pe(T, H({
2564
+ prop: _.code,
2211
2565
  ref_for: !0
2212
- }, i.formItemProps), {
2213
- label: M(() => [
2214
- J("span", Vo, [
2215
- m(i) ? (y(), L("span", Po, "*")) : Q("", !0),
2216
- Ee(" " + ee(i.label), 1)
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: M(() => [
2220
- u(i) ? j(d.$slots, u(i), K({
2573
+ default: L(() => [
2574
+ w(_) ? K(c.$slots, w(_), H({
2221
2575
  key: 0,
2222
2576
  ref_for: !0
2223
- }, p(i)), void 0, !0) : d.editing && !i.readonly ? (y(), V(Jt, {
2577
+ }, p(_)), void 0, !0) : c.editing && !_.readonly ? (b(), V(tn, {
2224
2578
  key: 1,
2225
- field: i,
2226
- "model-value": a.value[i.code],
2227
- section: d.section,
2228
- onLoadOptions: () => v(i),
2229
- "onUpdate:modelValue": (g) => r(i, g)
2230
- }, null, 8, ["field", "model-value", "section", "onLoadOptions", "onUpdate:modelValue"])) : (y(), V(Ut, {
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: i,
2233
- value: a.value[i.code],
2234
- section: d.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
- }), Lo = /* @__PURE__ */ X(No, [["__scopeId", "data-v-3c8d26e1"]]), Ro = /* @__PURE__ */ x({
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 = mn;
2262
- return y(), V(o, {
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: M(() => [
2272
- j(e.$slots, "default")
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
- }), jo = { class: "global-info-table-renderer" }, Go = { class: "global-info-table-renderer__table-scroll" }, Oo = { class: "global-info-table-renderer__header" }, Ao = {
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
- }, zo = /* @__PURE__ */ x({
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 = ve(), o = _(() => e.section.fields.filter((i) => i.visible));
2295
- function a(i) {
2296
- e.actions.deleteRow(e.section, i);
2297
- }
2298
- function r(i, g, I, N) {
2299
- const w = e.section.rows.slice(), S = I.cascadeClearFields ?? [], P = {
2300
- ...i,
2301
- __rowKey: G(i),
2302
- [I.code]: N
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
- S.forEach((C) => {
2305
- P[C] = "";
2306
- }), w[g] = {
2307
- ...P
2308
- }, e.actions.updateTableRows(e.section, w);
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
- async function v(i, g) {
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, i, g);
2313
- } catch (I) {
2314
- console.error("[GlobalInfoTableRenderer] load field options failed", I);
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 p(i, g, I) {
2318
- const N = g[i.code];
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: i,
2743
+ field: h,
2321
2744
  section: e.section,
2322
2745
  sectionView: e.section,
2323
2746
  node: e.node,
2324
- row: g,
2325
- rowIndex: I,
2747
+ row: N,
2748
+ rowIndex: O,
2326
2749
  editing: e.editing,
2327
- modelValue: N,
2328
- value: N,
2750
+ modelValue: z,
2751
+ value: z,
2329
2752
  state: e.state,
2330
2753
  actions: e.actions,
2331
- updateModelValue: (w) => r(g, I, i, w)
2754
+ updateModelValue: (A) => f(N, O, h, A)
2332
2755
  };
2333
2756
  }
2334
- function u(i) {
2335
- const g = String(i.id || i.key || i.code || "").trim(), I = g ? `field-${g}` : "";
2336
- if (I && n[I]) return I;
2337
- const N = I.toLowerCase();
2338
- return N !== I && n[N] ? N : "";
2339
- }
2340
- function b(i) {
2341
- return !i.readonly && !i.disabled;
2342
- }
2343
- function E(i) {
2344
- return i.width ?? (c(i) ? 56 : void 0);
2345
- }
2346
- function m(i) {
2347
- if (!i.width)
2348
- return i.minWidth ?? (c(i) ? 56 : void 0);
2349
- }
2350
- function d(i) {
2351
- return i.key || i.id || i.code;
2352
- }
2353
- function c(i) {
2354
- return [i.label, i.name, i.code, i.key, i.id].map((I) => String(I ?? "").trim().toLowerCase()).some((I) => ["序号", "index", "idx", "seq", "serial", "order", "rownum", "row_no"].includes(I));
2355
- }
2356
- let h = 0;
2357
- const k = /* @__PURE__ */ new WeakMap();
2358
- function G(i) {
2359
- const g = i.__rowKey ?? i.key ?? i.id ?? i.setId ?? i.infSetId;
2360
- if (g != null && g !== "") return String(g);
2361
- const I = i, N = k.get(I);
2362
- if (N) return N;
2363
- h += 1;
2364
- const w = `local-${h}`;
2365
- return k.set(I, w), w;
2366
- }
2367
- function B(i) {
2368
- return i.required || i.isRequired;
2369
- }
2370
- return (i, g) => {
2371
- const I = $t, N = an("Delete"), w = yt, S = Xe, P = Ct;
2372
- return y(), L("div", jo, [
2373
- J("div", Go, [
2374
- re(P, {
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: i.section.rows,
2377
- "row-key": G
2823
+ data: h.section.rows,
2824
+ fit: !0,
2825
+ "table-layout": "auto",
2826
+ "row-key": ge
2378
2827
  }, {
2379
- default: M(() => [
2380
- (y(!0), L(de, null, oe(o.value, (C) => (y(), V(I, {
2381
- key: d(C),
2382
- prop: C.code,
2383
- label: C.label,
2384
- width: E(C),
2385
- "min-width": m(C)
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: M(() => [
2388
- J("span", Oo, [
2389
- B(C) ? (y(), L("span", Ao, "*")) : Q("", !0),
2390
- J("span", null, ee(C.label), 1)
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: M(({ row: A, $index: ae }) => [
2394
- u(C) ? j(i.$slots, u(C), K({
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
- }, p(C, A, ae)), void 0, !0) : i.editing && b(C) ? (y(), V(Jt, {
2853
+ }, q(x, ce, Ie)), void 0, !0) : h.editing && v(x) ? (b(), V(tn, {
2398
2854
  key: 1,
2399
- field: C,
2400
- "model-value": A[C.code],
2401
- section: i.section,
2402
- row: A,
2403
- "row-index": ae,
2404
- onLoadOptions: () => v(C, A),
2405
- "onUpdate:modelValue": (pe) => r(A, ae, C, pe)
2406
- }, null, 8, ["field", "model-value", "section", "row", "row-index", "onLoadOptions", "onUpdate:modelValue"])) : (y(), V(Ut, {
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: C,
2409
- value: A[C.code],
2410
- section: i.section,
2411
- row: A,
2412
- "row-index": ae
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
- i.editing ? (y(), V(I, {
2418
- key: 0,
2873
+ h.editing ? (b(), V(O, {
2874
+ key: 1,
2419
2875
  label: "操作",
2420
2876
  width: "104",
2421
2877
  fixed: "right"
2422
2878
  }, {
2423
- default: M(({ $index: C }) => [
2424
- i.showDelete ? (y(), V(Ro, {
2879
+ default: L(({ $index: x }) => [
2880
+ h.showDelete ? (b(), V(sa, {
2425
2881
  key: 0,
2426
- onConfirm: (A) => a(C)
2882
+ onConfirm: (ce) => M(x)
2427
2883
  }, {
2428
- default: M(() => [
2429
- re(S, {
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: M(() => [
2435
- re(w, { class: "global-info-table-renderer__delete-icon" }, {
2436
- default: M(() => [
2437
- re(N)
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
- g[0] || (g[0] = Ee(" 删除 "))
2897
+ N[0] || (N[0] = Re(" 删除 "))
2442
2898
  ]),
2443
2899
  _: 1
2444
2900
  })
2445
2901
  ]),
2446
2902
  _: 2
2447
- }, 1032, ["onConfirm"])) : Q("", !0)
2903
+ }, 1032, ["onConfirm"])) : te("", !0)
2448
2904
  ]),
2449
2905
  _: 1
2450
- })) : Q("", !0)
2906
+ })) : te("", !0)
2451
2907
  ]),
2452
2908
  _: 3
2453
2909
  }, 8, ["data"])
2454
2910
  ])
2455
- ]);
2911
+ ], 2);
2456
2912
  };
2457
2913
  }
2458
- }), Do = /* @__PURE__ */ X(zo, [["__scopeId", "data-v-d05669dd"]]), Ko = /* @__PURE__ */ x({
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" ? (y(), V(Do, {
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
- }, null, 8, ["section", "node", "editing", "state", "actions"])) : (y(), V(Lo, {
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
- }, null, 8, ["section", "node", "editing", "state", "actions"]));
2940
+ actions: e.actions,
2941
+ "render-config": e.renderConfig
2942
+ }, null, 8, ["section", "node", "editing", "state", "actions", "render-config"]));
2484
2943
  }
2485
- }), qo = /* @__PURE__ */ x({
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 = ve(), o = _(() => e.editing ?? e.actions.isEditing(e.section)), a = _(() => e.section.renderType === "table" ? e.section.rows.length === 0 : e.section.fields.length === 0), r = _(() => {
2497
- const u = v(e.section.id || e.section.key), b = p(e.section.renderType);
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
- u,
2500
- b,
2967
+ m,
2968
+ M,
2501
2969
  "default"
2502
- ].find((E) => !!(E && n[E])) ?? "";
2970
+ ].find((f) => !!(f && n[f])) ?? "";
2503
2971
  });
2504
- function v(u) {
2505
- const b = String(u ?? "").trim();
2506
- return b ? `section-${b}` : "";
2972
+ function l(m) {
2973
+ const M = String(m ?? "").trim();
2974
+ return M ? `section-${M}` : "";
2507
2975
  }
2508
- function p(u) {
2509
- return u === "form" || u === "table" ? u : "";
2976
+ function d(m) {
2977
+ return m === "form" || m === "table" ? m : "";
2510
2978
  }
2511
- return (u, b) => r.value ? j(u.$slots, r.value, {
2979
+ return (m, M) => s.value ? K(m.$slots, s.value, {
2512
2980
  key: 0,
2513
- section: u.section,
2514
- sectionView: u.section,
2515
- node: u.node,
2516
- editing: o.value,
2517
- isEmpty: a.value,
2518
- empty: a.value,
2519
- fields: u.section.fields,
2520
- state: u.state,
2521
- actions: u.actions
2522
- }) : (y(), V(Ko, {
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: u.section,
2525
- node: u.node,
2526
- editing: o.value,
2527
- state: u.state,
2528
- actions: u.actions
2529
- }, null, 8, ["section", "node", "editing", "state", "actions"]));
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
- }), Jo = x({
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 = ne(!1);
2548
- Re(
3017
+ const o = le(!1);
3018
+ be(
2549
3019
  () => t.boundaryKey,
2550
3020
  () => {
2551
3021
  o.value = !1;
2552
3022
  }
2553
- ), ln((r) => (a(r), !1));
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
- }), Uo = { class: "global-info-section-block" }, Ho = {
3037
+ }), ga = { class: "global-info-section-block" }, ya = {
2568
3038
  key: 0,
2569
3039
  class: "global-info-section-block__header"
2570
- }, xo = { class: "global-info-section-block__title-wrap" }, Wo = { class: "global-info-section-block__title" }, Yo = {
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
- }, Zo = { class: "global-info-section-block__body" }, Qo = /* @__PURE__ */ x({
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 = ve(), o = ne(!1), a = ne(null), r = ne(null), v = _(() => !!e.hideHeader), p = _(() => e.actions.getSectionStatus(e.node)), u = _(() => e.actions.getSection(e.node) ?? r.value), b = _(() => u.value?.title || e.node.tagName || e.node.label || "-"), E = _(() => !!(u.value && e.actions.isEditing(u.value))), m = _(() => u.value?.renderType === "table"), d = _(() => o.value || p.value.loading), c = _(() => G(a.value || p.value.error)), h = _(() => {
2587
- const S = u.value;
2588
- return S ? S.renderType === "table" ? S.rows.length === 0 : S.fields.length === 0 : !0;
2589
- }), k = _(() => ({
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: u.value,
2592
- sectionView: u.value,
2593
- fields: u.value?.fields ?? [],
2594
- title: b.value,
2595
- editing: E.value,
2596
- loading: d.value,
2597
- error: a.value || p.value.error,
2598
- errorMessage: c.value,
2599
- isEmpty: h.value,
2600
- empty: h.value,
2601
- sectionStatus: p.value,
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: w,
2605
- handleEdit: B,
2606
- handleCancel: i,
2607
- handleAddTableRow: g,
2608
- handleSave: I
3082
+ reload: B,
3083
+ handleEdit: q,
3084
+ handleCancel: c,
3085
+ handleAddTableRow: v,
3086
+ handleSave: T
2609
3087
  }));
2610
- function G(S) {
2611
- return S ? S instanceof Error ? S.message : String(S) : "";
2612
- }
2613
- async function B() {
2614
- const S = u.value;
2615
- S && (await e.onEdit?.(S, e.node), e.onEdit || e.actions.startEdit(S));
2616
- }
2617
- async function i() {
2618
- const S = u.value;
2619
- S && (await e.onCancel?.(S, e.node), e.onCancel || e.actions.cancelEdit(S));
2620
- }
2621
- function g() {
2622
- const S = u.value;
2623
- if (!S) return;
2624
- const P = S.fields.reduce((C, A) => (C[A.code] = A.value ?? "", C), { __rowKey: `new-${Date.now()}` });
2625
- e.actions.saveRow(S, P, -1);
2626
- }
2627
- async function I() {
2628
- const S = u.value;
2629
- if (S)
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(S, e.node);
3110
+ await e.onSave(k, e.node);
2633
3111
  return;
2634
3112
  }
2635
- await e.actions.saveSection(S);
2636
- } catch (P) {
2637
- a.value = P, console.error("[GlobalInfoSectionBlock] save section failed", P);
3113
+ await e.actions.saveSection(k);
3114
+ } catch (_) {
3115
+ a.value = _, console.error("[GlobalInfoSectionBlock] save section failed", _);
2638
3116
  }
2639
3117
  }
2640
- function N(S) {
2641
- a.value = S;
3118
+ function S(k) {
3119
+ a.value = k;
2642
3120
  }
2643
- async function w() {
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 (S) {
2648
- a.value = S, console.error("[GlobalInfoSectionBlock] load section failed", S);
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 ht(() => {
2654
- w();
2655
- }), Re(
3131
+ return $t(() => {
3132
+ B();
3133
+ }), be(
2656
3134
  () => e.node.key,
2657
3135
  () => {
2658
- w();
3136
+ B();
2659
3137
  }
2660
- ), (S, P) => {
2661
- const C = Xe;
2662
- return y(), L("section", Uo, [
2663
- v.value ? Q("", !0) : (y(), L("header", Ho, [
2664
- j(S.$slots, "header", ce(me(k.value)), () => [
2665
- J("div", xo, [
2666
- P[0] || (P[0] = J("span", { class: "global-info-section-block__marker" }, null, -1)),
2667
- J("h3", Wo, ee(b.value), 1)
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
- j(S.$slots, "actions", ce(me(k.value)), () => [
2670
- u.value ? (y(), L("div", Yo, [
2671
- E.value ? (y(), L(de, { key: 1 }, [
2672
- re(C, {
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
- link: "",
2675
- disabled: p.value.saving,
2676
- onClick: i
3152
+ disabled: l.value.saving,
3153
+ onClick: c
2677
3154
  }, {
2678
- default: M(() => P[2] || (P[2] = [
2679
- Ee(" 取消 ")
3155
+ default: L(() => _[2] || (_[2] = [
3156
+ Re(" 取消 ")
2680
3157
  ])),
2681
3158
  _: 1
2682
3159
  }, 8, ["disabled"]),
2683
- m.value ? (y(), V(C, {
3160
+ y.value ? (b(), V(U, {
2684
3161
  key: 0,
2685
3162
  class: "global-info-section-block__add",
2686
- link: "",
2687
- disabled: p.value.saving,
2688
- onClick: g
3163
+ disabled: l.value.saving,
3164
+ onClick: v
2689
3165
  }, {
2690
- default: M(() => P[3] || (P[3] = [
2691
- Ee(" 新增 ")
3166
+ default: L(() => _[3] || (_[3] = [
3167
+ Re(" 新增 ")
2692
3168
  ])),
2693
3169
  _: 1
2694
- }, 8, ["disabled"])) : Q("", !0),
2695
- re(C, {
3170
+ }, 8, ["disabled"])) : te("", !0),
3171
+ pe(U, {
2696
3172
  class: "global-info-section-block__confirm",
2697
- link: "",
2698
- type: "primary",
2699
- loading: p.value.saving,
2700
- onClick: I
3173
+ loading: l.value.saving,
3174
+ onClick: T
2701
3175
  }, {
2702
- default: M(() => [
2703
- Ee(ee(m.value ? "确认" : "保存"), 1)
3176
+ default: L(() => [
3177
+ Re(se(y.value ? "确认" : "保存"), 1)
2704
3178
  ]),
2705
3179
  _: 1
2706
3180
  }, 8, ["loading"])
2707
- ], 64)) : (y(), V(C, {
3181
+ ], 64)) : (b(), V(U, {
2708
3182
  key: 0,
2709
3183
  class: "global-info-section-block__edit",
2710
- link: "",
2711
- type: "primary",
2712
- disabled: p.value.saving || d.value,
2713
- onClick: B
3184
+ disabled: l.value.saving || p.value,
3185
+ onClick: q
2714
3186
  }, {
2715
- default: M(() => P[1] || (P[1] = [
2716
- Ee(" 编辑 ")
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
- ])) : Q("", !0)
3197
+ ])) : te("", !0)
2721
3198
  ], !0)
2722
3199
  ], !0)
2723
3200
  ])),
2724
- J("div", Zo, [
2725
- d.value ? j(S.$slots, "loading", ce(K({ key: 0 }, k.value)), () => [
2726
- P[4] || (P[4] = J("div", { class: "global-info-section-block__status" }, "加载中...", -1))
2727
- ], !0) : !u.value || h.value || c.value ? j(S.$slots, "empty", ce(K({ key: 1 }, k.value)), () => [
2728
- P[5] || (P[5] = J("div", { class: "global-info-section-block__status" }, "暂无数据", -1))
2729
- ], !0) : (y(), V(Jo, {
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": S.node.key,
2732
- label: b.value,
2733
- onError: N
3208
+ "boundary-key": k.node.key,
3209
+ label: M.value,
3210
+ onError: S
2734
3211
  }, {
2735
- fallback: M(() => [
2736
- j(S.$slots, "empty", ce(me(k.value)), () => [
2737
- P[6] || (P[6] = J("div", { class: "global-info-section-block__status" }, "暂无数据", -1))
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: M(() => [
2741
- re(qo, {
2742
- section: u.value,
2743
- node: S.node,
2744
- editing: E.value,
2745
- state: S.state,
2746
- actions: S.actions
2747
- }, we({ _: 2 }, [
2748
- oe(q(n), (A, ae) => ({
2749
- name: ae,
2750
- fn: M((pe) => [
2751
- j(S.$slots, ae, ce(me({ ...k.value, ...pe })), void 0, !0)
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
- }), Xo = /* @__PURE__ */ X(Qo, [["__scopeId", "data-v-07953e28"]]), ea = { class: "global-info-group" }, ta = { class: "global-info-group__header" }, na = { class: "global-info-group__title" }, oa = { class: "global-info-group__body" }, aa = ["id"], la = /* @__PURE__ */ x({
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 = ve(), o = _(() => e.group.tagName || e.group.label || "-"), a = _(() => e.children.length <= 1);
2774
- function r(m, d) {
2775
- const c = e.actions.getSection(m);
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: m,
3256
+ node: f,
2778
3257
  group: e.group,
2779
- sectionNode: m,
2780
- section: c,
2781
- sectionView: c,
3258
+ sectionNode: f,
3259
+ section: p,
3260
+ sectionView: p,
2782
3261
  state: e.state,
2783
3262
  actions: e.actions,
2784
- index: d,
2785
- editing: !!(c && e.actions.isEditing(c)),
2786
- sectionStatus: e.actions.getSectionStatus(m),
2787
- isSelfSection: b(m, 0) === b(e.group, 0),
2788
- handleEdit: () => e.actions.startEdit(m),
2789
- handleCancel: () => e.actions.cancelEdit(m),
2790
- handleSave: () => e.actions.saveSection(m.key)
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 v(m) {
2794
- return p("section", u(m));
3273
+ function s(f) {
3274
+ return l("section", d(f));
2795
3275
  }
2796
- function p(m, d) {
2797
- if (!d) return "";
2798
- const c = `${m}-${d}`;
2799
- if (n[c]) return c;
2800
- const h = c.toLowerCase();
2801
- return h !== c && n[h] ? h : "";
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 u(m) {
2804
- return String(m.id || m.infSetId || m.tagId || m.key || m.code || "").trim();
3283
+ function d(f) {
3284
+ return String(f.id || f.infSetId || f.tagId || f.key || f.code || "").trim();
2805
3285
  }
2806
- function b(m, d) {
2807
- return m.key || m.id || m.infSetId || m.tagId || `${d}`;
3286
+ function m(f, y) {
3287
+ return f.key || f.id || f.infSetId || f.tagId || `${y}`;
2808
3288
  }
2809
- function E(m) {
2810
- return `global-info-section-${b(m, 0)}`;
3289
+ function M(f) {
3290
+ return `global-info-section-${m(f, 0)}`;
2811
3291
  }
2812
- return (m, d) => (y(), L("section", ea, [
2813
- j(m.$slots, "header", {
2814
- group: m.group,
2815
- children: m.children,
2816
- state: m.state,
2817
- actions: m.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: m.index,
2820
- isEmpty: m.children.length === 0
3300
+ index: f.index,
3301
+ isEmpty: f.children.length === 0
2821
3302
  }, () => [
2822
- J("header", ta, [
2823
- d[0] || (d[0] = J("span", { class: "global-info-group__marker" }, null, -1)),
2824
- J("h2", na, ee(o.value), 1)
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
- J("div", oa, [
2828
- q(n).default ? j(m.$slots, "default", {
3308
+ D("div", Ba, [
3309
+ J(n).default ? K(f.$slots, "default", {
2829
3310
  key: 0,
2830
- group: m.group,
2831
- children: m.children,
2832
- state: m.state,
2833
- actions: m.actions,
2834
- index: m.index,
2835
- isEmpty: m.children.length === 0
2836
- }, void 0, !0) : (y(), L(de, { key: 1 }, [
2837
- (y(!0), L(de, null, oe(m.children, (c, h) => (y(), L("div", {
2838
- id: E(c),
2839
- key: b(c, h),
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
- v(c) ? j(m.$slots, v(c), K({
3324
+ s(p) ? K(f.$slots, s(p), H({
2843
3325
  key: 0,
2844
3326
  ref_for: !0
2845
- }, r(c, h)), void 0, !0) : q(n).section ? j(m.$slots, "section", K({
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(c, h)), void 0, !0) : (y(), V(Xo, {
3330
+ }, r(p, w)), void 0, !0) : (b(), V(Ca, {
2849
3331
  key: 2,
2850
- node: c,
2851
- state: m.state,
2852
- actions: m.actions,
2853
- "hide-header": a.value
2854
- }, we({ _: 2 }, [
2855
- oe(q(n), (k, G) => ({
2856
- name: G,
2857
- fn: M((B) => [
2858
- j(m.$slots, G, K({ ref_for: !0 }, B), void 0, !0)
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, aa))), 128)),
2863
- m.children.length === 0 ? j(m.$slots, "empty", {
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: m.group,
3349
+ group: f.group,
2867
3350
  sectionNode: null,
2868
- state: m.state,
2869
- actions: m.actions,
2870
- index: -1
3351
+ state: f.state,
3352
+ actions: f.actions,
3353
+ index: -1,
3354
+ renderConfig: f.renderConfig
2871
3355
  }, () => [
2872
- d[1] || (d[1] = J("div", { class: "global-info-group__empty" }, "暂无数据", -1))
2873
- ], !0) : Q("", !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
- }), ra = /* @__PURE__ */ X(la, [["__scopeId", "data-v-7bca662c"]]), sa = { class: "global-info-sections" }, ia = /* @__PURE__ */ x({
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 = ve(), o = _(() => {
2888
- const d = e.nodes.filter((g) => a(g).length > 0), c = e.nodes.filter((g) => a(g).length === 0), h = c.filter((g) => r(g)), k = c.filter((g) => !r(g)), G = d.map((g) => ({ group: g, children: a(g) })), B = h.map((g) => ({ group: g, children: [g] }));
2889
- if (G.length === 0)
2890
- return h.length > 0 ? B : m(k);
2891
- const i = m(k);
2892
- return [...G, ...B, ...i];
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(d) {
2895
- return d.children ?? [];
3379
+ function a(y) {
3380
+ return y.children ?? [];
2896
3381
  }
2897
- function r(d) {
2898
- return !String(d.parentId || d.parentTagId || "").trim();
3382
+ function r(y) {
3383
+ return !String(y.parentId || y.parentTagId || "").trim();
2899
3384
  }
2900
- function v(d) {
2901
- return p("group", u(d));
3385
+ function s(y) {
3386
+ return l("group", d(y));
2902
3387
  }
2903
- function p(d, c) {
2904
- if (!c) return "";
2905
- const h = `${d}-${c}`;
2906
- if (n[h]) return h;
2907
- const k = h.toLowerCase();
2908
- return k !== h && n[k] ? k : "";
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 u(d) {
2911
- return String(d.id || d.tagId || d.key || d.code || "").trim();
3395
+ function d(y) {
3396
+ return String(y.id || y.tagId || y.key || y.code || "").trim();
2912
3397
  }
2913
- function b(d, c) {
2914
- return d.key || d.id || d.tagId || `${c}`;
3398
+ function m(y, p) {
3399
+ return y.key || y.id || y.tagId || `${p}`;
2915
3400
  }
2916
- function E(d) {
2917
- const c = d[0], h = c?.raw ?? {}, k = String(h.parentTagName || h.parentName || h.parentLabel || c?.parentId || "信息");
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
- ...c,
2920
- key: `${c?.parentId || c?.parentTagId || c?.key || "global-info"}-group`,
2921
- id: String(c?.parentId || c?.parentTagId || c?.id || "global-info-group"),
2922
- tagId: String(c?.parentTagId || c?.parentId || c?.tagId || "global-info-group"),
2923
- tagName: k,
2924
- label: k,
2925
- children: d
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 m(d) {
2929
- const c = /* @__PURE__ */ new Map();
2930
- return d.forEach((h) => {
2931
- const k = String(h.parentId || h.parentTagId || "global-info-flat"), G = c.get(k) ?? [];
2932
- G.push(h), c.set(k, G);
2933
- }), Array.from(c.values()).map((h) => ({
2934
- group: E(h),
2935
- children: h
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 (d, c) => (y(), L("div", sa, [
2939
- (y(!0), L(de, null, oe(o.value, (h, k) => (y(), L(de, {
2940
- key: b(h.group, k)
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
- v(h.group) ? j(d.$slots, v(h.group), {
3427
+ s(w.group) ? K(y.$slots, s(w.group), {
2943
3428
  key: 0,
2944
- group: h.group,
2945
- children: h.children,
2946
- state: d.state,
2947
- actions: d.actions,
2948
- index: k,
2949
- isEmpty: h.children.length === 0
2950
- }, void 0, !0) : q(n).group ? j(d.$slots, "group", {
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: h.group,
2953
- children: h.children,
2954
- state: d.state,
2955
- actions: d.actions,
2956
- index: k,
2957
- isEmpty: h.children.length === 0
2958
- }, void 0, !0) : (y(), V(ra, {
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: h.group,
2961
- children: h.children,
2962
- state: d.state,
2963
- actions: d.actions,
2964
- index: k
2965
- }, we({ _: 2 }, [
2966
- oe(q(n), (G, B) => ({
2967
- name: B,
2968
- fn: M((i) => [
2969
- j(d.$slots, B, K({ ref_for: !0 }, i), void 0, !0)
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
- }), ba = /* @__PURE__ */ X(ia, [["__scopeId", "data-v-33354916"]]);
3464
+ }), Da = /* @__PURE__ */ ie(Pa, [["__scopeId", "data-v-c0d12f5e"]]);
2977
3465
  export {
2978
- Ko as GlobalInfoAutoRenderer,
2979
- Ro as GlobalInfoDeleteConfirm,
2980
- Jt as GlobalInfoFieldControl,
2981
- Ut as GlobalInfoFieldValue,
2982
- Lo as GlobalInfoFormRenderer,
2983
- ra as GlobalInfoGroup,
2984
- ya as GlobalInfoProvider,
2985
- Xo as GlobalInfoSectionBlock,
2986
- qo as GlobalInfoSectionOutlet,
2987
- ba as GlobalInfoSections,
2988
- Do as GlobalInfoTableRenderer,
2989
- Ia as JtAttachmentPreview,
2990
- wa as JtAttachmentPreviewByParams,
2991
- ze as JtButton,
2992
- Sn as JtCascader,
2993
- va as JtCrudTable,
2994
- In as JtDatePicker,
2995
- Gn as JtFilterBar,
2996
- Bn as JtFormItems,
2997
- xe as JtInput,
2998
- ga as JtPageHeader,
2999
- Hn as JtPagination,
3000
- Cn as JtSelect,
3001
- Kn as JtTable,
3002
- ao as buildGlobalInfoUpdatePayload,
3003
- to as createEmptyGlobalInfoViewModel,
3004
- ha as isGlobalInfoNode,
3005
- Ft as mergeGlobalInfoChildren,
3006
- no as normalizeGlobalInfoDetail,
3007
- st as normalizeGlobalInfoTree,
3008
- oo as resolveGlobalInfoRenderType,
3009
- ka as setupJtAttachmentPreview,
3010
- So as useGlobalInfoController
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
  };