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