@jt-home/mfe-components 1.0.3 → 1.0.4

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