@jt-home/mfe-components 1.0.62 → 1.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/package/JtAttachmentPreview/index.cjs +2 -0
  2. package/dist/package/JtAttachmentPreview/index.mjs +907 -0
  3. package/dist/package/JtAttachmentPreview/style.css +1 -0
  4. package/dist/package/el-table-column-CdKtbSnU.js +9 -0
  5. package/dist/package/el-table-column-Cvm2mF29.cjs +1 -0
  6. package/dist/package/el-table-column.css +1 -0
  7. package/dist/package/globalInfo/index.cjs +4 -0
  8. package/dist/package/globalInfo/index.mjs +4039 -0
  9. package/dist/package/globalInfo/style.css +1 -0
  10. package/dist/package/index.cjs +3 -0
  11. package/dist/package/index.mjs +1679 -0
  12. package/dist/{locale → package/locale}/index.cjs +1 -1
  13. package/dist/{locale → package/locale}/index.mjs +1 -1
  14. package/dist/package/style.css +1 -0
  15. package/dist/{types → package/types}/components/JtAttachmentPreview/index.d.ts +3 -2
  16. package/dist/{types → package/types}/components/JtAttachmentPreview/types.d.ts +6 -4
  17. package/dist/{types → package/types}/components/JtButton/index.vue.d.ts +9 -3
  18. package/dist/package/types/components/JtCard/index.d.ts +1 -0
  19. package/dist/package/types/components/JtCard/index.vue.d.ts +21 -0
  20. package/dist/package/types/components/JtConfirmDialog/index.d.ts +8 -0
  21. package/dist/package/types/components/JtConfirmDialog/index.vue.d.ts +26 -0
  22. package/dist/package/types/components/JtConfirmDialog/types.d.ts +23 -0
  23. package/dist/package/types/components/JtDrawer/index.d.ts +1 -0
  24. package/dist/package/types/components/JtDrawer/index.vue.d.ts +50 -0
  25. package/dist/{types → package/types}/components/JtPageHeader/index.d.ts +1 -1
  26. package/dist/{types → package/types}/components/JtPageHeader/index.vue.d.ts +8 -3
  27. package/dist/{types → package/types}/components/JtPageHeader/types.d.ts +7 -3
  28. package/dist/package/types/components/JtTab/JtTabItem.vue.d.ts +16 -0
  29. package/dist/package/types/components/JtTab/index.d.ts +3 -0
  30. package/dist/package/types/components/JtTab/index.vue.d.ts +25 -0
  31. package/dist/package/types/components/JtTab/types.d.ts +28 -0
  32. package/dist/{types → package/types}/components/globalInfo/model/fieldUtils.d.ts +3 -19
  33. package/dist/{types → package/types}/components/globalInfo/model/slotIdentity.d.ts +1 -1
  34. package/dist/{types → package/types}/components/globalInfo/model/types.d.ts +2 -2
  35. package/dist/{types → package/types}/components/index.d.ts +6 -3
  36. package/dist/{types → package/types}/locale/types.d.ts +1 -1
  37. package/dist/package/types/main.d.ts +5 -0
  38. package/package.json +49 -25
  39. package/readme.md +713 -694
  40. package/dist/JtAttachmentPreview/index.cjs +0 -1
  41. package/dist/JtAttachmentPreview/index.mjs +0 -1120
  42. package/dist/JtAttachmentPreview/style.css +0 -1
  43. package/dist/index.cjs +0 -3
  44. package/dist/index.mjs +0 -5309
  45. package/dist/pdf-BmBuG7of.js +0 -18058
  46. package/dist/pdf-Da0bm_Ya.cjs +0 -55
  47. package/dist/pdf.worker.min-4PI-nNLo.js +0 -4
  48. package/dist/pdf.worker.min-BAJUPwg6.cjs +0 -1
  49. package/dist/style.css +0 -1
  50. package/dist/types/components/globalInfo/renderers/attachmentPreview.d.ts +0 -2
  51. package/dist/types/main.d.ts +0 -5
  52. package/dist/{types → package/types}/components/JtButton/index.d.ts +0 -0
  53. package/dist/{types → package/types}/components/form/JtFormItems.vue.d.ts +0 -0
  54. package/dist/{types → package/types}/components/form/index.d.ts +0 -0
  55. package/dist/{types → package/types}/components/form/item/JtCascader/cascaderProps.d.ts +0 -0
  56. package/dist/{types → package/types}/components/form/item/JtCascader/index.d.ts +0 -0
  57. package/dist/{types → package/types}/components/form/item/JtCascader/index.vue.d.ts +0 -0
  58. package/dist/{types → package/types}/components/form/item/JtDatePicker/index.d.ts +0 -0
  59. package/dist/{types → package/types}/components/form/item/JtDatePicker/index.vue.d.ts +0 -0
  60. package/dist/{types → package/types}/components/form/item/JtInput/index.d.ts +0 -0
  61. package/dist/{types → package/types}/components/form/item/JtInput/index.vue.d.ts +0 -0
  62. package/dist/{types → package/types}/components/form/item/JtSelect/index.d.ts +0 -0
  63. package/dist/{types → package/types}/components/form/item/JtSelect/index.vue.d.ts +0 -0
  64. package/dist/{types → package/types}/components/form/item/JtSelect/types.d.ts +0 -0
  65. package/dist/{types → package/types}/components/form/item/index.d.ts +0 -0
  66. package/dist/{types → package/types}/components/form/types.d.ts +0 -0
  67. package/dist/{types → package/types}/components/globalInfo/components/GlobalInfoGroup.vue.d.ts +0 -0
  68. package/dist/{types → package/types}/components/globalInfo/components/GlobalInfoLeftNav.vue.d.ts +0 -0
  69. package/dist/{types → package/types}/components/globalInfo/components/GlobalInfoProvider.vue.d.ts +0 -0
  70. package/dist/{types → package/types}/components/globalInfo/components/GlobalInfoSectionBlock.vue.d.ts +0 -0
  71. package/dist/{types → package/types}/components/globalInfo/components/GlobalInfoSectionOutlet.vue.d.ts +0 -0
  72. package/dist/{types → package/types}/components/globalInfo/components/GlobalInfoSections.vue.d.ts +0 -0
  73. package/dist/{types → package/types}/components/globalInfo/components/GlobalInfoSlotErrorBoundary.vue.d.ts +0 -0
  74. package/dist/{types → package/types}/components/globalInfo/controller/controllerFieldOptions.d.ts +0 -0
  75. package/dist/{types → package/types}/components/globalInfo/controller/controllerIdentity.d.ts +0 -0
  76. package/dist/{types → package/types}/components/globalInfo/controller/controllerRequests.d.ts +0 -0
  77. package/dist/{types → package/types}/components/globalInfo/controller/controllerSectionStore.d.ts +0 -0
  78. package/dist/{types → package/types}/components/globalInfo/controller/controllerStatus.d.ts +0 -0
  79. package/dist/{types → package/types}/components/globalInfo/controller/useGlobalInfoController.d.ts +0 -0
  80. package/dist/{types → package/types}/components/globalInfo/index.d.ts +0 -0
  81. package/dist/{types → package/types}/components/globalInfo/model/adapter.d.ts +0 -0
  82. package/dist/{types → package/types}/components/globalInfo/model/fieldValidation.d.ts +0 -0
  83. package/dist/{types → package/types}/components/globalInfo/model/requiredInfoSetValidation.d.ts +0 -0
  84. package/dist/{types → package/types}/components/globalInfo/model/valueListOptions.d.ts +0 -0
  85. package/dist/{types → package/types}/components/globalInfo/renderers/GlobalInfoAutoRenderer.vue.d.ts +0 -0
  86. package/dist/{types → package/types}/components/globalInfo/renderers/GlobalInfoDeleteConfirm.vue.d.ts +1 -1
  87. /package/dist/{types → package/types}/components/globalInfo/renderers/GlobalInfoFieldControl.vue.d.ts +0 -0
  88. /package/dist/{types → package/types}/components/globalInfo/renderers/GlobalInfoFieldValue.vue.d.ts +0 -0
  89. /package/dist/{types → package/types}/components/globalInfo/renderers/GlobalInfoFormRenderer.vue.d.ts +0 -0
  90. /package/dist/{types → package/types}/components/globalInfo/renderers/GlobalInfoMultiFormRenderer.vue.d.ts +0 -0
  91. /package/dist/{types → package/types}/components/globalInfo/renderers/GlobalInfoTableRenderer.vue.d.ts +0 -0
  92. /package/dist/{types → package/types}/components/globalInfo/renderers/optionPreload.d.ts +0 -0
  93. /package/dist/{types → package/types}/components/table/JtCrudTable.vue.d.ts +0 -0
  94. /package/dist/{types → package/types}/components/table/JtFilterBar.vue.d.ts +0 -0
  95. /package/dist/{types → package/types}/components/table/JtPagination.vue.d.ts +0 -0
  96. /package/dist/{types → package/types}/components/table/JtTable.vue.d.ts +0 -0
  97. /package/dist/{types → package/types}/components/table/index.d.ts +0 -0
  98. /package/dist/{types → package/types}/components/table/types.d.ts +0 -0
  99. /package/dist/{types → package/types}/components/table/useSearchDisabled.d.ts +0 -0
  100. /package/dist/{types → package/types}/locale/index.d.ts +0 -0
  101. /package/dist/{types → package/types}/locale/messages/de.d.ts +0 -0
  102. /package/dist/{types → package/types}/locale/messages/en.d.ts +0 -0
  103. /package/dist/{types → package/types}/locale/messages/es.d.ts +0 -0
  104. /package/dist/{types → package/types}/locale/messages/id.d.ts +0 -0
  105. /package/dist/{types → package/types}/locale/messages/index.d.ts +0 -0
  106. /package/dist/{types → package/types}/locale/messages/km.d.ts +0 -0
  107. /package/dist/{types → package/types}/locale/messages/pt.d.ts +0 -0
  108. /package/dist/{types → package/types}/locale/messages/th.d.ts +0 -0
  109. /package/dist/{types → package/types}/locale/messages/vi.d.ts +0 -0
  110. /package/dist/{types → package/types}/locale/messages/zh-cn.d.ts +0 -0
  111. /package/dist/{types → package/types}/locale/normalizeLocale.d.ts +0 -0
  112. /package/dist/{types → package/types}/utils/componentAttrs.d.ts +0 -0
@@ -0,0 +1,4039 @@
1
+ import './style.css';
2
+ import '../el-table-column.css';
3
+ import { ref as Te, shallowRef as Ve, computed as P, watch as qe, onMounted as jt, defineComponent as Se, renderSlot as ae, normalizeProps as ke, guardReactiveProps as Ee, unref as te, onBeforeUnmount as zt, openBlock as L, createBlock as re, mergeProps as he, withCtx as X, createElementBlock as U, Fragment as be, renderList as ve, createElementVNode as le, toDisplayString as ie, createCommentVNode as ge, normalizeClass as je, useSlots as Ae, normalizeStyle as Dn, createVNode as Oe, createTextVNode as Xe, createSlots as Re, resolveComponent as Ln, onErrorCaptured as En } from "vue";
4
+ import { t as ee } from "../locale/index.mjs";
5
+ import { ElSelect as Nn, ElOption as Vn, ElDatePicker as Kn, ElInputNumber as Rn, ElSwitch as qn, ElInput as An, ElForm as Gn, ElFormItem as Bn, ElPopconfirm as Pn, ElTable as Yn, ElTableColumn as jn, ElButton as Ht, ElIcon as zn, ElSkeleton as Hn } from "element-plus/es";
6
+ import { _ as Ne } from "../el-table-column-CdKtbSnU.js";
7
+ function Un(e, t) {
8
+ t = t || (() => "default-use-once-sync");
9
+ const n = /* @__PURE__ */ new Map();
10
+ async function o(...a) {
11
+ const i = t(...a);
12
+ if (n.get(i))
13
+ return n.get(i);
14
+ try {
15
+ const r = e(...a).then((p) => p).catch((p) => {
16
+ throw p;
17
+ });
18
+ return n.set(i, r), r;
19
+ } catch (r) {
20
+ throw n.set(i, null), r;
21
+ }
22
+ }
23
+ return o.bind(e);
24
+ }
25
+ function Ut(e, t) {
26
+ t = t || (() => "default-use-queue-sync");
27
+ const n = /* @__PURE__ */ new Map();
28
+ async function o(...a) {
29
+ const i = t(...a), r = Symbol("single");
30
+ return n.set(i, r), new Promise((p, s) => {
31
+ e(...a).then((l) => {
32
+ n.get(i) === r && p(l);
33
+ }).catch((l) => {
34
+ n.get(i) === r && s(l);
35
+ });
36
+ });
37
+ }
38
+ return o.bind(e);
39
+ }
40
+ var ft = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
41
+ function mt(e) {
42
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
43
+ }
44
+ var Zt = { exports: {} };
45
+ (function(e, t) {
46
+ (function(n, o) {
47
+ e.exports = o();
48
+ })(ft, function() {
49
+ var n = 1e3, o = 6e4, a = 36e5, i = "millisecond", r = "second", p = "minute", s = "hour", l = "day", u = "week", h = "month", v = "quarter", D = "year", N = "date", M = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, O = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, q = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(k) {
50
+ var T = ["th", "st", "nd", "rd"], d = k % 100;
51
+ return "[" + k + (T[(d - 20) % 10] || T[d] || T[0]) + "]";
52
+ } }, A = function(k, T, d) {
53
+ var g = String(k);
54
+ return !g || g.length >= T ? k : "" + Array(T + 1 - g.length).join(d) + k;
55
+ }, Z = { s: A, z: function(k) {
56
+ var T = -k.utcOffset(), d = Math.abs(T), g = Math.floor(d / 60), S = d % 60;
57
+ return (T <= 0 ? "+" : "-") + A(g, 2, "0") + ":" + A(S, 2, "0");
58
+ }, m: function k(T, d) {
59
+ if (T.date() < d.date()) return -k(d, T);
60
+ var g = 12 * (d.year() - T.year()) + (d.month() - T.month()), S = T.clone().add(g, h), c = d - S < 0, y = T.clone().add(g + (c ? -1 : 1), h);
61
+ return +(-(g + (d - S) / (c ? S - y : y - S)) || 0);
62
+ }, a: function(k) {
63
+ return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
64
+ }, p: function(k) {
65
+ return { M: h, y: D, w: u, d: l, D: N, h: s, m: p, s: r, ms: i, Q: v }[k] || String(k || "").toLowerCase().replace(/s$/, "");
66
+ }, u: function(k) {
67
+ return k === void 0;
68
+ } }, j = "en", w = {};
69
+ w[j] = q;
70
+ var F = "$isDayjsObject", E = function(k) {
71
+ return k instanceof W || !(!k || !k[F]);
72
+ }, R = function k(T, d, g) {
73
+ var S;
74
+ if (!T) return j;
75
+ if (typeof T == "string") {
76
+ var c = T.toLowerCase();
77
+ w[c] && (S = c), d && (w[c] = d, S = c);
78
+ var y = T.split("-");
79
+ if (!S && y.length > 1) return k(y[0]);
80
+ } else {
81
+ var _ = T.name;
82
+ w[_] = T, S = _;
83
+ }
84
+ return !g && S && (j = S), S || !g && j;
85
+ }, I = function(k, T) {
86
+ if (E(k)) return k.clone();
87
+ var d = typeof T == "object" ? T : {};
88
+ return d.date = k, d.args = arguments, new W(d);
89
+ }, C = Z;
90
+ C.l = R, C.i = E, C.w = function(k, T) {
91
+ return I(k, { locale: T.$L, utc: T.$u, x: T.$x, $offset: T.$offset });
92
+ };
93
+ var W = function() {
94
+ function k(d) {
95
+ this.$L = R(d.locale, null, !0), this.parse(d), this.$x = this.$x || d.x || {}, this[F] = !0;
96
+ }
97
+ var T = k.prototype;
98
+ return T.parse = function(d) {
99
+ this.$d = function(g) {
100
+ var S = g.date, c = g.utc;
101
+ if (S === null) return /* @__PURE__ */ new Date(NaN);
102
+ if (C.u(S)) return /* @__PURE__ */ new Date();
103
+ if (S instanceof Date) return new Date(S);
104
+ if (typeof S == "string" && !/Z$/i.test(S)) {
105
+ var y = S.match($);
106
+ if (y) {
107
+ var _ = y[2] - 1 || 0, V = (y[7] || "0").substring(0, 3);
108
+ return c ? new Date(Date.UTC(y[1], _, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, V)) : new Date(y[1], _, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, V);
109
+ }
110
+ }
111
+ return new Date(S);
112
+ }(d), this.init();
113
+ }, T.init = function() {
114
+ var d = this.$d;
115
+ this.$y = d.getFullYear(), this.$M = d.getMonth(), this.$D = d.getDate(), this.$W = d.getDay(), this.$H = d.getHours(), this.$m = d.getMinutes(), this.$s = d.getSeconds(), this.$ms = d.getMilliseconds();
116
+ }, T.$utils = function() {
117
+ return C;
118
+ }, T.isValid = function() {
119
+ return this.$d.toString() !== M;
120
+ }, T.isSame = function(d, g) {
121
+ var S = I(d);
122
+ return this.startOf(g) <= S && S <= this.endOf(g);
123
+ }, T.isAfter = function(d, g) {
124
+ return I(d) < this.startOf(g);
125
+ }, T.isBefore = function(d, g) {
126
+ return this.endOf(g) < I(d);
127
+ }, T.$g = function(d, g, S) {
128
+ return C.u(d) ? this[g] : this.set(S, d);
129
+ }, T.unix = function() {
130
+ return Math.floor(this.valueOf() / 1e3);
131
+ }, T.valueOf = function() {
132
+ return this.$d.getTime();
133
+ }, T.startOf = function(d, g) {
134
+ var S = this, c = !!C.u(g) || g, y = C.p(d), _ = function(fe, ue) {
135
+ var ye = C.w(S.$u ? Date.UTC(S.$y, ue, fe) : new Date(S.$y, ue, fe), S);
136
+ return c ? ye : ye.endOf(l);
137
+ }, V = function(fe, ue) {
138
+ return C.w(S.toDate()[fe].apply(S.toDate("s"), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ue)), S);
139
+ }, K = this.$W, H = this.$M, G = this.$D, Y = "set" + (this.$u ? "UTC" : "");
140
+ switch (y) {
141
+ case D:
142
+ return c ? _(1, 0) : _(31, 11);
143
+ case h:
144
+ return c ? _(1, H) : _(0, H + 1);
145
+ case u:
146
+ var Q = this.$locale().weekStart || 0, oe = (K < Q ? K + 7 : K) - Q;
147
+ return _(c ? G - oe : G + (6 - oe), H);
148
+ case l:
149
+ case N:
150
+ return V(Y + "Hours", 0);
151
+ case s:
152
+ return V(Y + "Minutes", 1);
153
+ case p:
154
+ return V(Y + "Seconds", 2);
155
+ case r:
156
+ return V(Y + "Milliseconds", 3);
157
+ default:
158
+ return this.clone();
159
+ }
160
+ }, T.endOf = function(d) {
161
+ return this.startOf(d, !1);
162
+ }, T.$set = function(d, g) {
163
+ var S, c = C.p(d), y = "set" + (this.$u ? "UTC" : ""), _ = (S = {}, S[l] = y + "Date", S[N] = y + "Date", S[h] = y + "Month", S[D] = y + "FullYear", S[s] = y + "Hours", S[p] = y + "Minutes", S[r] = y + "Seconds", S[i] = y + "Milliseconds", S)[c], V = c === l ? this.$D + (g - this.$W) : g;
164
+ if (c === h || c === D) {
165
+ var K = this.clone().set(N, 1);
166
+ K.$d[_](V), K.init(), this.$d = K.set(N, Math.min(this.$D, K.daysInMonth())).$d;
167
+ } else _ && this.$d[_](V);
168
+ return this.init(), this;
169
+ }, T.set = function(d, g) {
170
+ return this.clone().$set(d, g);
171
+ }, T.get = function(d) {
172
+ return this[C.p(d)]();
173
+ }, T.add = function(d, g) {
174
+ var S, c = this;
175
+ d = Number(d);
176
+ var y = C.p(g), _ = function(H) {
177
+ var G = I(c);
178
+ return C.w(G.date(G.date() + Math.round(H * d)), c);
179
+ };
180
+ if (y === h) return this.set(h, this.$M + d);
181
+ if (y === D) return this.set(D, this.$y + d);
182
+ if (y === l) return _(1);
183
+ if (y === u) return _(7);
184
+ var V = (S = {}, S[p] = o, S[s] = a, S[r] = n, S)[y] || 1, K = this.$d.getTime() + d * V;
185
+ return C.w(K, this);
186
+ }, T.subtract = function(d, g) {
187
+ return this.add(-1 * d, g);
188
+ }, T.format = function(d) {
189
+ var g = this, S = this.$locale();
190
+ if (!this.isValid()) return S.invalidDate || M;
191
+ var c = d || "YYYY-MM-DDTHH:mm:ssZ", y = C.z(this), _ = this.$H, V = this.$m, K = this.$M, H = S.weekdays, G = S.months, Y = S.meridiem, Q = function(ue, ye, Me, Ce) {
192
+ return ue && (ue[ye] || ue(g, c)) || Me[ye].slice(0, Ce);
193
+ }, oe = function(ue) {
194
+ return C.s(_ % 12 || 12, ue, "0");
195
+ }, fe = Y || function(ue, ye, Me) {
196
+ var Ce = ue < 12 ? "AM" : "PM";
197
+ return Me ? Ce.toLowerCase() : Ce;
198
+ };
199
+ return c.replace(O, function(ue, ye) {
200
+ return ye || function(Me) {
201
+ switch (Me) {
202
+ case "YY":
203
+ return String(g.$y).slice(-2);
204
+ case "YYYY":
205
+ return C.s(g.$y, 4, "0");
206
+ case "M":
207
+ return K + 1;
208
+ case "MM":
209
+ return C.s(K + 1, 2, "0");
210
+ case "MMM":
211
+ return Q(S.monthsShort, K, G, 3);
212
+ case "MMMM":
213
+ return Q(G, K);
214
+ case "D":
215
+ return g.$D;
216
+ case "DD":
217
+ return C.s(g.$D, 2, "0");
218
+ case "d":
219
+ return String(g.$W);
220
+ case "dd":
221
+ return Q(S.weekdaysMin, g.$W, H, 2);
222
+ case "ddd":
223
+ return Q(S.weekdaysShort, g.$W, H, 3);
224
+ case "dddd":
225
+ return H[g.$W];
226
+ case "H":
227
+ return String(_);
228
+ case "HH":
229
+ return C.s(_, 2, "0");
230
+ case "h":
231
+ return oe(1);
232
+ case "hh":
233
+ return oe(2);
234
+ case "a":
235
+ return fe(_, V, !0);
236
+ case "A":
237
+ return fe(_, V, !1);
238
+ case "m":
239
+ return String(V);
240
+ case "mm":
241
+ return C.s(V, 2, "0");
242
+ case "s":
243
+ return String(g.$s);
244
+ case "ss":
245
+ return C.s(g.$s, 2, "0");
246
+ case "SSS":
247
+ return C.s(g.$ms, 3, "0");
248
+ case "Z":
249
+ return y;
250
+ }
251
+ return null;
252
+ }(ue) || y.replace(":", "");
253
+ });
254
+ }, T.utcOffset = function() {
255
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
256
+ }, T.diff = function(d, g, S) {
257
+ var c, y = this, _ = C.p(g), V = I(d), K = (V.utcOffset() - this.utcOffset()) * o, H = this - V, G = function() {
258
+ return C.m(y, V);
259
+ };
260
+ switch (_) {
261
+ case D:
262
+ c = G() / 12;
263
+ break;
264
+ case h:
265
+ c = G();
266
+ break;
267
+ case v:
268
+ c = G() / 3;
269
+ break;
270
+ case u:
271
+ c = (H - K) / 6048e5;
272
+ break;
273
+ case l:
274
+ c = (H - K) / 864e5;
275
+ break;
276
+ case s:
277
+ c = H / a;
278
+ break;
279
+ case p:
280
+ c = H / o;
281
+ break;
282
+ case r:
283
+ c = H / n;
284
+ break;
285
+ default:
286
+ c = H;
287
+ }
288
+ return S ? c : C.a(c);
289
+ }, T.daysInMonth = function() {
290
+ return this.endOf(h).$D;
291
+ }, T.$locale = function() {
292
+ return w[this.$L];
293
+ }, T.locale = function(d, g) {
294
+ if (!d) return this.$L;
295
+ var S = this.clone(), c = R(d, g, !0);
296
+ return c && (S.$L = c), S;
297
+ }, T.clone = function() {
298
+ return C.w(this.$d, this);
299
+ }, T.toDate = function() {
300
+ return new Date(this.valueOf());
301
+ }, T.toJSON = function() {
302
+ return this.isValid() ? this.toISOString() : null;
303
+ }, T.toISOString = function() {
304
+ return this.$d.toISOString();
305
+ }, T.toString = function() {
306
+ return this.$d.toUTCString();
307
+ }, k;
308
+ }(), J = W.prototype;
309
+ return I.prototype = J, [["$ms", i], ["$s", r], ["$m", p], ["$H", s], ["$W", l], ["$M", h], ["$y", D], ["$D", N]].forEach(function(k) {
310
+ J[k[1]] = function(T) {
311
+ return this.$g(T, k[0], k[1]);
312
+ };
313
+ }), I.extend = function(k, T) {
314
+ return k.$i || (k(T, W, I), k.$i = !0), I;
315
+ }, I.locale = R, I.isDayjs = E, I.unix = function(k) {
316
+ return I(1e3 * k);
317
+ }, I.en = w[j], I.Ls = w, I.p = {}, I;
318
+ });
319
+ })(Zt);
320
+ var Zn = Zt.exports;
321
+ const $t = /* @__PURE__ */ mt(Zn);
322
+ var Wt = { exports: {} };
323
+ (function(e, t) {
324
+ (function(n, o) {
325
+ e.exports = o();
326
+ })(ft, function() {
327
+ var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, o = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, a = /\d/, i = /\d\d/, r = /\d\d?/, p = /\d*[^-_:/,()\s\d]+/, s = {}, l = function($) {
328
+ return ($ = +$) + ($ > 68 ? 1900 : 2e3);
329
+ }, u = function($) {
330
+ return function(O) {
331
+ this[$] = +O;
332
+ };
333
+ }, h = [/[+-]\d\d:?(\d\d)?|Z/, function($) {
334
+ (this.zone || (this.zone = {})).offset = function(O) {
335
+ if (!O || O === "Z") return 0;
336
+ var q = O.match(/([+-]|\d\d)/g), A = 60 * q[1] + (+q[2] || 0);
337
+ return A === 0 ? 0 : q[0] === "+" ? -A : A;
338
+ }($);
339
+ }], v = function($) {
340
+ var O = s[$];
341
+ return O && (O.indexOf ? O : O.s.concat(O.f));
342
+ }, D = function($, O) {
343
+ var q, A = s.meridiem;
344
+ if (A) {
345
+ for (var Z = 1; Z <= 24; Z += 1) if ($.indexOf(A(Z, 0, O)) > -1) {
346
+ q = Z > 12;
347
+ break;
348
+ }
349
+ } else q = $ === (O ? "pm" : "PM");
350
+ return q;
351
+ }, N = { A: [p, function($) {
352
+ this.afternoon = D($, !1);
353
+ }], a: [p, function($) {
354
+ this.afternoon = D($, !0);
355
+ }], Q: [a, function($) {
356
+ this.month = 3 * ($ - 1) + 1;
357
+ }], S: [a, function($) {
358
+ this.milliseconds = 100 * +$;
359
+ }], SS: [i, function($) {
360
+ this.milliseconds = 10 * +$;
361
+ }], SSS: [/\d{3}/, function($) {
362
+ this.milliseconds = +$;
363
+ }], s: [r, u("seconds")], ss: [r, u("seconds")], m: [r, u("minutes")], mm: [r, u("minutes")], H: [r, u("hours")], h: [r, u("hours")], HH: [r, u("hours")], hh: [r, u("hours")], D: [r, u("day")], DD: [i, u("day")], Do: [p, function($) {
364
+ var O = s.ordinal, q = $.match(/\d+/);
365
+ if (this.day = q[0], O) for (var A = 1; A <= 31; A += 1) O(A).replace(/\[|\]/g, "") === $ && (this.day = A);
366
+ }], w: [r, u("week")], ww: [i, u("week")], M: [r, u("month")], MM: [i, u("month")], MMM: [p, function($) {
367
+ var O = v("months"), q = (v("monthsShort") || O.map(function(A) {
368
+ return A.slice(0, 3);
369
+ })).indexOf($) + 1;
370
+ if (q < 1) throw new Error();
371
+ this.month = q % 12 || q;
372
+ }], MMMM: [p, function($) {
373
+ var O = v("months").indexOf($) + 1;
374
+ if (O < 1) throw new Error();
375
+ this.month = O % 12 || O;
376
+ }], Y: [/[+-]?\d+/, u("year")], YY: [i, function($) {
377
+ this.year = l($);
378
+ }], YYYY: [/\d{4}/, u("year")], Z: h, ZZ: h };
379
+ function M($) {
380
+ var O, q;
381
+ O = $, q = s && s.formats;
382
+ for (var A = ($ = O.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(I, C, W) {
383
+ var J = W && W.toUpperCase();
384
+ return C || q[W] || n[W] || q[J].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(k, T, d) {
385
+ return T || d.slice(1);
386
+ });
387
+ })).match(o), Z = A.length, j = 0; j < Z; j += 1) {
388
+ var w = A[j], F = N[w], E = F && F[0], R = F && F[1];
389
+ A[j] = R ? { regex: E, parser: R } : w.replace(/^\[|\]$/g, "");
390
+ }
391
+ return function(I) {
392
+ for (var C = {}, W = 0, J = 0; W < Z; W += 1) {
393
+ var k = A[W];
394
+ if (typeof k == "string") J += k.length;
395
+ else {
396
+ var T = k.regex, d = k.parser, g = I.slice(J), S = T.exec(g)[0];
397
+ d.call(C, S), I = I.replace(S, "");
398
+ }
399
+ }
400
+ return function(c) {
401
+ var y = c.afternoon;
402
+ if (y !== void 0) {
403
+ var _ = c.hours;
404
+ y ? _ < 12 && (c.hours += 12) : _ === 12 && (c.hours = 0), delete c.afternoon;
405
+ }
406
+ }(C), C;
407
+ };
408
+ }
409
+ return function($, O, q) {
410
+ q.p.customParseFormat = !0, $ && $.parseTwoDigitYear && (l = $.parseTwoDigitYear);
411
+ var A = O.prototype, Z = A.parse;
412
+ A.parse = function(j) {
413
+ var w = j.date, F = j.utc, E = j.args;
414
+ this.$u = F;
415
+ var R = E[1];
416
+ if (typeof R == "string") {
417
+ var I = E[2] === !0, C = E[3] === !0, W = I || C, J = E[2];
418
+ C && (J = E[2]), s = this.$locale(), !I && J && (s = q.Ls[J]), this.$d = function(g, S, c, y) {
419
+ try {
420
+ if (["x", "X"].indexOf(S) > -1) return new Date((S === "X" ? 1e3 : 1) * g);
421
+ var _ = M(S)(g), V = _.year, K = _.month, H = _.day, G = _.hours, Y = _.minutes, Q = _.seconds, oe = _.milliseconds, fe = _.zone, ue = _.week, ye = /* @__PURE__ */ new Date(), Me = H || (V || K ? 1 : ye.getDate()), Ce = V || ye.getFullYear(), Fe = 0;
422
+ V && !K || (Fe = K > 0 ? K - 1 : ye.getMonth());
423
+ var Pe, Ue = G || 0, Ze = Y || 0, st = Q || 0, Ye = oe || 0;
424
+ return fe ? new Date(Date.UTC(Ce, Fe, Me, Ue, Ze, st, Ye + 60 * fe.offset * 1e3)) : c ? new Date(Date.UTC(Ce, Fe, Me, Ue, Ze, st, Ye)) : (Pe = new Date(Ce, Fe, Me, Ue, Ze, st, Ye), ue && (Pe = y(Pe).week(ue).toDate()), Pe);
425
+ } catch {
426
+ return /* @__PURE__ */ new Date("");
427
+ }
428
+ }(w, R, F, q), this.init(), J && J !== !0 && (this.$L = this.locale(J).$L), W && w != this.format(R) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
429
+ } else if (R instanceof Array) for (var k = R.length, T = 1; T <= k; T += 1) {
430
+ E[1] = R[T - 1];
431
+ var d = q.apply(this, E);
432
+ if (d.isValid()) {
433
+ this.$d = d.$d, this.$L = d.$L, this.init();
434
+ break;
435
+ }
436
+ T === k && (this.$d = /* @__PURE__ */ new Date(""));
437
+ }
438
+ else Z.call(this, j);
439
+ };
440
+ };
441
+ });
442
+ })(Wt);
443
+ var Wn = Wt.exports;
444
+ const xn = /* @__PURE__ */ mt(Wn);
445
+ var xt = { exports: {} };
446
+ (function(e, t) {
447
+ (function(n, o) {
448
+ e.exports = o();
449
+ })(ft, function() {
450
+ var n = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, o = {};
451
+ return function(a, i, r) {
452
+ var p, s = function(v, D, N) {
453
+ N === void 0 && (N = {});
454
+ var M = new Date(v), $ = function(O, q) {
455
+ q === void 0 && (q = {});
456
+ var A = q.timeZoneName || "short", Z = O + "|" + A, j = o[Z];
457
+ return j || (j = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: O, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: A }), o[Z] = j), j;
458
+ }(D, N);
459
+ return $.formatToParts(M);
460
+ }, l = function(v, D) {
461
+ for (var N = s(v, D), M = [], $ = 0; $ < N.length; $ += 1) {
462
+ var O = N[$], q = O.type, A = O.value, Z = n[q];
463
+ Z >= 0 && (M[Z] = parseInt(A, 10));
464
+ }
465
+ var j = M[3], w = j === 24 ? 0 : j, F = M[0] + "-" + M[1] + "-" + M[2] + " " + w + ":" + M[4] + ":" + M[5] + ":000", E = +v;
466
+ return (r.utc(F).valueOf() - (E -= E % 1e3)) / 6e4;
467
+ }, u = i.prototype;
468
+ u.tz = function(v, D) {
469
+ v === void 0 && (v = p);
470
+ var N, M = this.utcOffset(), $ = this.toDate(), O = $.toLocaleString("en-US", { timeZone: v }), q = Math.round(($ - new Date(O)) / 1e3 / 60), A = 15 * -Math.round($.getTimezoneOffset() / 15) - q;
471
+ if (!Number(A)) N = this.utcOffset(0, D);
472
+ else if (N = r(O, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(A, !0), D) {
473
+ var Z = N.utcOffset();
474
+ N = N.add(M - Z, "minute");
475
+ }
476
+ return N.$x.$timezone = v, N;
477
+ }, u.offsetName = function(v) {
478
+ var D = this.$x.$timezone || r.tz.guess(), N = s(this.valueOf(), D, { timeZoneName: v }).find(function(M) {
479
+ return M.type.toLowerCase() === "timezonename";
480
+ });
481
+ return N && N.value;
482
+ };
483
+ var h = u.startOf;
484
+ u.startOf = function(v, D) {
485
+ if (!this.$x || !this.$x.$timezone) return h.call(this, v, D);
486
+ var N = r(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
487
+ return h.call(N, v, D).tz(this.$x.$timezone, !0);
488
+ }, r.tz = function(v, D, N) {
489
+ var M = N && D, $ = N || D || p, O = l(+r(), $);
490
+ if (typeof v != "string") return r(v).tz($);
491
+ var q = function(w, F, E) {
492
+ var R = w - 60 * F * 1e3, I = l(R, E);
493
+ if (F === I) return [R, F];
494
+ var C = l(R -= 60 * (I - F) * 1e3, E);
495
+ return I === C ? [R, I] : [w - 60 * Math.min(I, C) * 1e3, Math.max(I, C)];
496
+ }(r.utc(v, M).valueOf(), O, $), A = q[0], Z = q[1], j = r(A).utcOffset(Z);
497
+ return j.$x.$timezone = $, j;
498
+ }, r.tz.guess = function() {
499
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
500
+ }, r.tz.setDefault = function(v) {
501
+ p = v;
502
+ };
503
+ };
504
+ });
505
+ })(xt);
506
+ var Jn = xt.exports;
507
+ const Qn = /* @__PURE__ */ mt(Jn);
508
+ var Jt = { exports: {} };
509
+ (function(e, t) {
510
+ (function(n, o) {
511
+ e.exports = o();
512
+ })(ft, function() {
513
+ var n = "minute", o = /[+-]\d\d(?::?\d\d)?/g, a = /([+-]|\d\d)/g;
514
+ return function(i, r, p) {
515
+ var s = r.prototype;
516
+ p.utc = function(M) {
517
+ var $ = { date: M, utc: !0, args: arguments };
518
+ return new r($);
519
+ }, s.utc = function(M) {
520
+ var $ = p(this.toDate(), { locale: this.$L, utc: !0 });
521
+ return M ? $.add(this.utcOffset(), n) : $;
522
+ }, s.local = function() {
523
+ return p(this.toDate(), { locale: this.$L, utc: !1 });
524
+ };
525
+ var l = s.parse;
526
+ s.parse = function(M) {
527
+ M.utc && (this.$u = !0), this.$utils().u(M.$offset) || (this.$offset = M.$offset), l.call(this, M);
528
+ };
529
+ var u = s.init;
530
+ s.init = function() {
531
+ if (this.$u) {
532
+ var M = this.$d;
533
+ this.$y = M.getUTCFullYear(), this.$M = M.getUTCMonth(), this.$D = M.getUTCDate(), this.$W = M.getUTCDay(), this.$H = M.getUTCHours(), this.$m = M.getUTCMinutes(), this.$s = M.getUTCSeconds(), this.$ms = M.getUTCMilliseconds();
534
+ } else u.call(this);
535
+ };
536
+ var h = s.utcOffset;
537
+ s.utcOffset = function(M, $) {
538
+ var O = this.$utils().u;
539
+ if (O(M)) return this.$u ? 0 : O(this.$offset) ? h.call(this) : this.$offset;
540
+ if (typeof M == "string" && (M = function(j) {
541
+ j === void 0 && (j = "");
542
+ var w = j.match(o);
543
+ if (!w) return null;
544
+ var F = ("" + w[0]).match(a) || ["-", 0, 0], E = F[0], R = 60 * +F[1] + +F[2];
545
+ return R === 0 ? 0 : E === "+" ? R : -R;
546
+ }(M), M === null)) return this;
547
+ var q = Math.abs(M) <= 16 ? 60 * M : M;
548
+ if (q === 0) return this.utc($);
549
+ var A = this.clone();
550
+ if ($) return A.$offset = q, A.$u = !1, A;
551
+ var Z = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
552
+ return (A = this.local().add(q + Z, n)).$offset = q, A.$x.$localOffset = Z, A;
553
+ };
554
+ var v = s.format;
555
+ s.format = function(M) {
556
+ var $ = M || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
557
+ return v.call(this, $);
558
+ }, s.valueOf = function() {
559
+ var M = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
560
+ return this.$d.valueOf() - 6e4 * M;
561
+ }, s.isUTC = function() {
562
+ return !!this.$u;
563
+ }, s.toISOString = function() {
564
+ return this.toDate().toISOString();
565
+ }, s.toString = function() {
566
+ return this.toDate().toUTCString();
567
+ };
568
+ var D = s.toDate;
569
+ s.toDate = function(M) {
570
+ return M === "s" && this.$offset ? p(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : D.call(this);
571
+ };
572
+ var N = s.diff;
573
+ s.diff = function(M, $, O) {
574
+ if (M && this.$u === M.$u) return N.call(this, M, $, O);
575
+ var q = this.local(), A = p(M).local();
576
+ return N.call(q, A, $, O);
577
+ };
578
+ };
579
+ });
580
+ })(Jt);
581
+ var Xn = Jt.exports;
582
+ const eo = /* @__PURE__ */ mt(Xn);
583
+ $t.extend(eo);
584
+ $t.extend(Qn);
585
+ $t.extend(xn);
586
+ const yt = /\$\{([^}]+)\}/g;
587
+ function He(e) {
588
+ if (!e)
589
+ return [];
590
+ const t = /* @__PURE__ */ new Set();
591
+ return (e.cascadeDependFields ?? []).forEach((n) => {
592
+ const o = String(n ?? "").trim();
593
+ o && t.add(o);
594
+ }), to(e.interface).forEach(
595
+ (n) => t.add(n)
596
+ ), [...t];
597
+ }
598
+ function to(e) {
599
+ if (!e || typeof e != "object")
600
+ return [];
601
+ const t = e.params;
602
+ if (!t || typeof t != "object" || Array.isArray(t))
603
+ return [];
604
+ const n = /* @__PURE__ */ new Set();
605
+ return bt(t, n), [...n];
606
+ }
607
+ function bt(e, t) {
608
+ if (typeof e == "string") {
609
+ yt.lastIndex = 0;
610
+ let n = yt.exec(e);
611
+ for (; n !== null; ) {
612
+ const o = String(n[1] ?? "").trim();
613
+ o && t.add(o), n = yt.exec(e);
614
+ }
615
+ return;
616
+ }
617
+ if (Array.isArray(e)) {
618
+ e.forEach((n) => bt(n, t));
619
+ return;
620
+ }
621
+ !e || typeof e != "object" || Object.values(e).forEach(
622
+ (n) => bt(n, t)
623
+ );
624
+ }
625
+ function Tt(e) {
626
+ return Nt(
627
+ e.type || e.fieldType || e.frontInputType
628
+ ) || Nt(e.renderType) || "text";
629
+ }
630
+ function Mt(e) {
631
+ return Vt(
632
+ e.type || e.fieldType || e.frontInputType
633
+ ) || Vt(e.renderType) || "text";
634
+ }
635
+ function pt(e) {
636
+ return rn(e).some(
637
+ (t) => t === "select_remote" || t === "select_remote_descr"
638
+ );
639
+ }
640
+ function no(e) {
641
+ return rn(e).some(
642
+ (t) => t === "select_remote_descr"
643
+ );
644
+ }
645
+ function pe(e) {
646
+ if (e == null) return !0;
647
+ if (typeof e == "string") return e.trim() === "";
648
+ if (Array.isArray(e))
649
+ return e.length === 0 || e.every((t) => pe(t));
650
+ if (e instanceof Date) return Number.isNaN(e.getTime());
651
+ if (typeof File < "u" && e instanceof File)
652
+ return e.name.trim() === "";
653
+ if (typeof e == "object") {
654
+ const t = Object.entries(e).filter(
655
+ ([n]) => !n.startsWith("__")
656
+ );
657
+ return t.length === 0 || t.every(([, n]) => pe(n));
658
+ }
659
+ return !1;
660
+ }
661
+ function Qt(e) {
662
+ if (e instanceof Error) return !0;
663
+ if (!e || typeof e != "object") return !1;
664
+ const t = e;
665
+ return typeof t.message == "string" && (typeof t.stack == "string" || t.name === "Error");
666
+ }
667
+ function Xt(e, t, n = "-") {
668
+ const o = Mt(e);
669
+ return o === "empty" || pe(t) ? n : Qt(t) ? (console.error("[globalInfo] field value render failed", t), n) : o === "select" ? fo(e, t, n) : o === "switch" ? en(t) ? ee("common.是") : ee("common.否") : o === "file" ? mo(t, n) : o === "multi-row" ? po(t, n) : String(t);
670
+ }
671
+ function gt(e, t) {
672
+ return Array.isArray(t) ? t : vt(e) ? typeof t == "string" ? t.split(",").map((n) => n.trim()).filter(Boolean) : pe(t) ? [] : [t] : [t];
673
+ }
674
+ function oo(e, t) {
675
+ return vt(e) ? gt(e, t) : t;
676
+ }
677
+ function ro(e, t) {
678
+ return !vt(e) || !Array.isArray(t) ? pe(t) ? "" : t : t.map((n) => String(n ?? "").trim()).filter(Boolean).join(",");
679
+ }
680
+ function en(e) {
681
+ if (typeof e == "boolean") return e;
682
+ if (typeof e == "number") return e !== 0;
683
+ const t = String(e ?? "").trim().toLowerCase();
684
+ return ["true", "1", "y", "yes", "t", ee("common.是")].includes(t);
685
+ }
686
+ function tt(e, t) {
687
+ if (pe(t)) return !1;
688
+ const n = e.raw && typeof e.raw == "object" ? e.raw : {};
689
+ return [
690
+ e.value,
691
+ e.code,
692
+ n.fieldvalue,
693
+ n.value,
694
+ n.code,
695
+ n.emplid
696
+ ].some(
697
+ (o) => !pe(o) && (o === t || String(o) === String(t))
698
+ );
699
+ }
700
+ function ze(e, t, n, o = {}) {
701
+ const a = lo(o);
702
+ return e.filter((i) => i.visible ? !co(
703
+ i,
704
+ t,
705
+ n,
706
+ a,
707
+ o.rows
708
+ ) : !1);
709
+ }
710
+ function Lt(e) {
711
+ return nn(e).some(
712
+ (n) => [
713
+ ee("common.序号"),
714
+ "index",
715
+ "idx",
716
+ "seq",
717
+ "seqno",
718
+ "serial",
719
+ "order",
720
+ "rownum",
721
+ "row_no"
722
+ ].includes(n)
723
+ );
724
+ }
725
+ function Et(e) {
726
+ return nn(e).includes("seqno");
727
+ }
728
+ function ao(e) {
729
+ return [
730
+ e.type,
731
+ e.fieldType,
732
+ e.frontInputType,
733
+ e.raw?.type,
734
+ e.raw?.fieldType,
735
+ e.raw?.frontInputType
736
+ ].some((t) => on(t) === "attach");
737
+ }
738
+ function tn(e, t, n = "-") {
739
+ return !ao(e) || pe(t) ? [] : (Array.isArray(t) ? t : [t]).map(
740
+ (a, i) => io(a, i, n)
741
+ ).filter((a) => !!a);
742
+ }
743
+ function io(e, t, n) {
744
+ if (pe(e)) return null;
745
+ if (typeof e == "string") {
746
+ const o = e.trim();
747
+ return o ? {
748
+ key: String(t),
749
+ text: o
750
+ } : null;
751
+ }
752
+ if (typeof File < "u" && e instanceof File)
753
+ return {
754
+ key: String(t),
755
+ text: e.name || n
756
+ };
757
+ if (e && typeof e == "object") {
758
+ const a = so(e, n);
759
+ return {
760
+ key: String(t),
761
+ text: a
762
+ };
763
+ }
764
+ return {
765
+ key: String(t),
766
+ text: String(e).trim() || n
767
+ };
768
+ }
769
+ function so(e, t) {
770
+ return Je(e.name) || Je(e.fileName) || Je(e.filename) || Je(e.url) || Je(e.fileId) || t;
771
+ }
772
+ function Je(e) {
773
+ return String(e ?? "").trim();
774
+ }
775
+ function Nt(e) {
776
+ const t = String(e ?? "").toLowerCase();
777
+ return t === "upload" || t === "attachment" || t === "attach" ? "file" : t === "radio" || t === "checkbox" ? "select" : t === "text" || t === "textarea" || t === "select" || t === "select_remote" || t === "select_remote_descr" || t === "date" || t === "number" || t === "switch" || t === "file" || t === "html" || t === "code" || t === "multi-row" || t === "empty" ? t === "select_remote_descr" ? "select_remote" : t : "";
778
+ }
779
+ function Vt(e) {
780
+ const t = String(e ?? "").toLowerCase();
781
+ return t === "upload" || t === "attachment" || t === "attach" ? "file" : t === "radio" || t === "checkbox" || t === "select_remote" || t === "select_remote_descr" ? "select" : 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" : "";
782
+ }
783
+ function lo(e) {
784
+ return e.rows?.length ? e.rows : [e.values ?? {}];
785
+ }
786
+ function co(e, t, n, o, a) {
787
+ const i = n?.hiddenRule;
788
+ return i ? o.some((r) => {
789
+ try {
790
+ const p = r[e.code];
791
+ return i({
792
+ field: e,
793
+ section: t,
794
+ values: r,
795
+ allValues: r,
796
+ value: p,
797
+ currentValue: p,
798
+ rows: a
799
+ });
800
+ } catch (p) {
801
+ return console.error("[globalInfo] hidden rule failed", p), !1;
802
+ }
803
+ }) : !1;
804
+ }
805
+ function nn(e) {
806
+ return uo([e.code]);
807
+ }
808
+ function uo(e) {
809
+ return Array.from(
810
+ new Set(e.map((t) => on(t)).filter(Boolean))
811
+ );
812
+ }
813
+ function on(e) {
814
+ return String(e ?? "").trim().toLowerCase();
815
+ }
816
+ function fo(e, t, n) {
817
+ const o = vt(e);
818
+ if (Array.isArray(t) || o) {
819
+ const a = gt(e, t).map((r) => Kt(e, r) || String(r ?? "").trim()).filter(Boolean), i = o ? "," : "、";
820
+ return a.length > 0 ? a.join(i) : n;
821
+ }
822
+ return Kt(e, t) || String(t).trim() || n;
823
+ }
824
+ function vt(e) {
825
+ return !!e.props?.multiple && (Tt(e) === "select" || Mt(e) === "select");
826
+ }
827
+ function Kt(e, t) {
828
+ return e.options?.find(
829
+ (o) => tt(o, t)
830
+ )?.label ?? "";
831
+ }
832
+ function rn(e) {
833
+ const t = e.raw && typeof e.raw == "object" ? e.raw : {};
834
+ return [
835
+ e.type,
836
+ e.fieldType,
837
+ e.frontInputType,
838
+ t.type,
839
+ t.fieldType,
840
+ t.frontInputType
841
+ ].map(
842
+ (n) => String(n ?? "").trim().toLowerCase()
843
+ ).filter(Boolean);
844
+ }
845
+ function mo(e, t) {
846
+ if (Array.isArray(e)) {
847
+ const n = e.map((o) => Rt(o)).filter(Boolean);
848
+ return n.length > 0 ? n.join("、") : t;
849
+ }
850
+ return Rt(e) || t;
851
+ }
852
+ function Rt(e) {
853
+ if (typeof File < "u" && e instanceof File) return e.name;
854
+ if (e && typeof e == "object") {
855
+ const t = e;
856
+ return String(
857
+ t.name ?? t.fileName ?? t.filename ?? t.url ?? ""
858
+ ).trim();
859
+ }
860
+ return String(e ?? "").trim();
861
+ }
862
+ function po(e, t) {
863
+ return Array.isArray(e) ? e.map((o) => Qt(o) ? (console.error("[globalInfo] multi-row field item render failed", o), "") : pe(o) ? "" : o && typeof o == "object" ? JSON.stringify(o) : String(o).trim()).filter(Boolean).join(`
864
+ `) || t : String(e).trim() || t;
865
+ }
866
+ function go(e, t, n, o) {
867
+ const a = qt(n.valueListType), i = bo(n.enumValues);
868
+ return e.map((r) => {
869
+ const p = qt(
870
+ r.valueListType,
871
+ a
872
+ );
873
+ return p === "ENUMS" ? {
874
+ ...r,
875
+ valueListType: p,
876
+ // ENUMS 的候选项在 data.enumValues 根级,key 只按字段 code 匹配。
877
+ options: o(
878
+ vo(r, i) ?? r.options
879
+ )
880
+ } : { ...r, valueListType: p };
881
+ });
882
+ }
883
+ function qt(e, t = "REST") {
884
+ const n = an(e).toUpperCase();
885
+ return !n || n === "NULL" ? t : n;
886
+ }
887
+ function vo(e, t) {
888
+ for (const n of ho(e)) {
889
+ const o = t[n];
890
+ if (Array.isArray(o))
891
+ return o;
892
+ }
893
+ return null;
894
+ }
895
+ function ho(e) {
896
+ return yo([e.code]);
897
+ }
898
+ function yo(e) {
899
+ return Array.from(new Set(e.map(an).filter(Boolean)));
900
+ }
901
+ function bo(e) {
902
+ return e && typeof e == "object" ? e : {};
903
+ }
904
+ function an(e) {
905
+ return e == null ? "" : String(e);
906
+ }
907
+ function So(e = null) {
908
+ return {
909
+ scheme: null,
910
+ node: null,
911
+ topNodes: [],
912
+ treeNodes: [],
913
+ activeNode: null,
914
+ activeSection: null,
915
+ sections: [],
916
+ sectionMap: {},
917
+ raw: e
918
+ };
919
+ }
920
+ function At(e) {
921
+ const t = fn(e), n = dn(t), o = Do(t).flatMap(
922
+ (a) => un(a, n)
923
+ );
924
+ return {
925
+ ...So(e),
926
+ scheme: n,
927
+ topNodes: o,
928
+ treeNodes: o
929
+ };
930
+ }
931
+ function sn(e, t, n) {
932
+ return e.map((o) => o.key === t || o.tagId === t || o.id === t ? { ...o, children: n, loaded: !0 } : {
933
+ ...o,
934
+ children: sn(o.children, t, n)
935
+ });
936
+ }
937
+ function wo(e, t = {}, n = null) {
938
+ const o = fn(e), a = dn(o, t), i = $o(o, t, n), r = Object.fromEntries(
939
+ i.map((p) => [p.key, p])
940
+ );
941
+ return {
942
+ scheme: a,
943
+ node: n,
944
+ topNodes: [],
945
+ treeNodes: [],
946
+ activeNode: n,
947
+ activeSection: i[0] ?? null,
948
+ sections: i,
949
+ sectionMap: r,
950
+ raw: e
951
+ };
952
+ }
953
+ function Io(e) {
954
+ return e.multRow || e.htmlDisplay === "T" ? "table" : "form";
955
+ }
956
+ function _o(e, t = {}) {
957
+ const n = e.renderType === "table" || e.renderType === "multi-form" ? e.rows.map(
958
+ (s) => St(wt(s))
959
+ ) : [St(wt(e.model))], o = ce(e.operationInfo), a = ce(o.editInfoSet), i = ce(a.params), r = ce(o.queryInfoSet), p = ce(r.params);
960
+ return {
961
+ ...t,
962
+ infSchmId: t.infSchmId ?? se(e.raw.infSchmId),
963
+ emplid: t.emplid ?? se(e.raw.emplid),
964
+ // 保存优先使用接口出参里的信息集挂载 tagId,其次才回退到请求节点 tagId。
965
+ tagId: x(
966
+ e.tagId || i.tagId || p.tagId || t.tagId || e.requestTagId
967
+ ),
968
+ infSetId: t.infSetId ?? e.infSetId,
969
+ setId: t.setId ?? e.setId,
970
+ // 保存时只把当前编辑出来的业务行数据放进 infSetValues,避免把详情模板参数一并带走。
971
+ infSetValues: n,
972
+ section: e
973
+ };
974
+ }
975
+ function St(e) {
976
+ return Object.fromEntries(
977
+ Object.entries(e).map(([t, n]) => [
978
+ t,
979
+ ln(n)
980
+ ])
981
+ );
982
+ }
983
+ function ln(e) {
984
+ return e === "" ? null : Array.isArray(e) ? e.map(ln) : e && typeof e == "object" ? St(e) : e;
985
+ }
986
+ function fa(e) {
987
+ const t = e;
988
+ return !!(t && typeof t == "object" && typeof t.key == "string" && typeof t.tagId == "string");
989
+ }
990
+ function kt(e) {
991
+ const t = mn(e);
992
+ return (Array.isArray(t) ? t : nt(ce(t), ["options", "list", "records", "data"])).map((o) => {
993
+ const a = ce(o), i = a.fieldvalue, r = i ?? a.value ?? a.code ?? a.emplid;
994
+ return {
995
+ id: a.id,
996
+ code: i ?? a.value ?? a.code ?? a.emplid,
997
+ // fieldname 在 md-options 中是字段标识,不是用户可读文案;展示文案只接受明确的 label/descr/name。
998
+ label: x(
999
+ a.label ?? a.descr ?? a.name
1000
+ ),
1001
+ labelDescr: se(a.labelDescr),
1002
+ name: se(a.name),
1003
+ value: r,
1004
+ raw: o
1005
+ };
1006
+ });
1007
+ }
1008
+ function $o(e, t, n) {
1009
+ const o = nt(e, ["sections"]);
1010
+ return o.length > 0 ? o.map(
1011
+ (a) => Gt(a, t, n)
1012
+ ) : e.infSetMark || e.infSetFields ? [Gt(e, t, n)] : [];
1013
+ }
1014
+ function Gt(e, t, n) {
1015
+ const o = ce(e), a = To(o.infSetMark ?? o), i = o.infSetValues, r = go(
1016
+ Mo(o.infSetFields ?? []),
1017
+ i,
1018
+ o,
1019
+ kt
1020
+ ), p = Io(a), s = Co(
1021
+ i,
1022
+ r,
1023
+ p
1024
+ ), l = p === "form" && s.length > 1 ? "multi-form" : p, u = s[0] ? wt(s[0]) : cn(r), h = ce(o.tag), v = x(o.tagId ?? o.infTagId ?? h.tagId ?? h.infTagId), D = x(t.tagId ?? n?.tagId), N = x(n?.key), M = a.setId || x(o.setId), $ = x(o.infSetId) || M, O = M || $, q = a.code || x(o.code), A = O || q || $ || v, Z = {
1025
+ key: A,
1026
+ id: A,
1027
+ setId: O,
1028
+ code: q,
1029
+ tagId: v,
1030
+ requestTagId: D || void 0,
1031
+ ownerNodeKey: N || void 0,
1032
+ infSetId: $,
1033
+ title: a.name || x(o.name ?? A),
1034
+ renderType: l,
1035
+ mark: a,
1036
+ fields: r,
1037
+ model: u,
1038
+ rows: s,
1039
+ operationInfo: ht(
1040
+ t.operationInfo ?? o.operationInfo
1041
+ ),
1042
+ raw: o
1043
+ };
1044
+ return Z.renderType === "form" && s.length === 0 && (Z.rows = [{ ...u, __rowKey: `${A}-0` }]), Z;
1045
+ }
1046
+ function To(e) {
1047
+ const t = ce(e), n = x(t.htmlDisplay || "F");
1048
+ return {
1049
+ name: x(t.name ?? t.title),
1050
+ parentName: se(t.parentName),
1051
+ value: se(t.value),
1052
+ type: se(t.type),
1053
+ code: x(t.code),
1054
+ setId: x(t.setId),
1055
+ htmlDisplay: n,
1056
+ multRow: $e(t.multRow),
1057
+ isRequired: $e(t.isRequired),
1058
+ raw: t
1059
+ };
1060
+ }
1061
+ function Mo(e) {
1062
+ return (Array.isArray(e) ? e : []).map((n, o) => ko(n, o));
1063
+ }
1064
+ function ko(e, t) {
1065
+ const n = ce(e), o = x(n.code), a = x(n.name ?? n.label ?? o), i = pn(
1066
+ n.interfaceField ?? n.interface
1067
+ ), r = Bt(n.cascadeDependFields);
1068
+ return {
1069
+ id: o || `field_${t}`,
1070
+ key: o || `field_${t}`,
1071
+ code: o,
1072
+ label: a,
1073
+ value: n.value ?? "",
1074
+ type: No(n),
1075
+ fieldType: se(n.fieldType),
1076
+ frontInputType: se(n.frontInputType),
1077
+ renderType: Eo(n),
1078
+ required: $e(n.isRequired),
1079
+ readonly: $e(n.disabled),
1080
+ visible: n.visibled === void 0 ? !0 : $e(n.visibled),
1081
+ htmlDisplay: $e(n.htmlDisplay),
1082
+ multRow: $e(n.multRow),
1083
+ isRequired: $e(n.isRequired),
1084
+ disabled: n.disabled === void 0 ? void 0 : $e(n.disabled),
1085
+ span: hn(n.span),
1086
+ width: Pt(n.width),
1087
+ minWidth: Pt(n.minWidth),
1088
+ placeholder: se(n.placeholder),
1089
+ options: kt(n.options),
1090
+ valueListType: se(n.valueListType),
1091
+ interface: i,
1092
+ cascadeClearFields: Bt(n.cascadeClearFields),
1093
+ cascadeDependFields: He({
1094
+ cascadeDependFields: r,
1095
+ interface: i
1096
+ }),
1097
+ props: Vo(n),
1098
+ formItemProps: gn(n.formItemProps),
1099
+ raw: n
1100
+ };
1101
+ }
1102
+ function Co(e, t, n) {
1103
+ if (Array.isArray(e) && e.some((i) => {
1104
+ const r = ce(i);
1105
+ return t.some(
1106
+ (p) => r[p.code] !== void 0
1107
+ );
1108
+ }))
1109
+ return e.map((i, r) => ({
1110
+ ...ce(i),
1111
+ // 行身份只接受前端固化的 __rowKey;后端未声明行主键时退回当前索引。
1112
+ __rowKey: x(ce(i).__rowKey) || String(r)
1113
+ }));
1114
+ const o = cn(t);
1115
+ return n === "form" && Object.keys(o).length ? [{ ...o, __rowKey: "0" }] : [];
1116
+ }
1117
+ function cn(e) {
1118
+ return e.reduce((t, n) => (n.code && (t[n.code] = n.value), t), {});
1119
+ }
1120
+ function un(e, t, n = "") {
1121
+ const o = ce(e), a = nt(o, ["children", "list", "tags"]).flatMap(
1122
+ (r) => un(
1123
+ r,
1124
+ t,
1125
+ x(o.tagId)
1126
+ )
1127
+ ), i = Lo(o.infSetList);
1128
+ return a.length === 0 && i.length > 0 ? i.map(
1129
+ (r, p) => Fo(o, r, t, n, p)
1130
+ ) : [Oo(o, t, n, a)];
1131
+ }
1132
+ function Oo(e, t, n, o) {
1133
+ const a = x(e.tagId), i = x(e.tagName) || a;
1134
+ return {
1135
+ key: a,
1136
+ id: a,
1137
+ tagId: a,
1138
+ tagName: i,
1139
+ label: i,
1140
+ tagLevel: se(e.tagLevel ?? e.level) ?? null,
1141
+ level: vn(e.tagLevel ?? e.level),
1142
+ parentTagId: se(
1143
+ e.parentTagId ?? e.parentId ?? n
1144
+ ),
1145
+ parentId: se(e.parentTagId ?? e.parentId ?? n) ?? null,
1146
+ infSchmId: se(e.infSchmId ?? t?.infSchmId),
1147
+ schemeId: x(e.infSchmId ?? t?.infSchmId),
1148
+ infSetId: se(e.infSetId),
1149
+ setId: void 0,
1150
+ code: se(e.code),
1151
+ children: o,
1152
+ infSetList: [],
1153
+ operationInfo: ht(e.operationInfo),
1154
+ loaded: o.length > 0,
1155
+ raw: e
1156
+ };
1157
+ }
1158
+ function Fo(e, t, n, o, a) {
1159
+ const i = x(e.tagId), r = x(e.tagName) || i, p = t.infSetId, s = t.setId, l = p || `${i}-${a}`, u = t.code || se(e.code);
1160
+ return {
1161
+ key: l,
1162
+ id: l,
1163
+ tagId: i,
1164
+ tagName: r,
1165
+ label: r,
1166
+ tagLevel: se(e.tagLevel ?? e.level) ?? null,
1167
+ level: vn(e.tagLevel ?? e.level),
1168
+ parentTagId: se(
1169
+ e.parentTagId ?? e.parentId ?? o
1170
+ ),
1171
+ parentId: se(e.parentTagId ?? e.parentId ?? o) ?? null,
1172
+ infSchmId: se(e.infSchmId ?? n?.infSchmId),
1173
+ schemeId: x(e.infSchmId ?? n?.infSchmId),
1174
+ infSetId: p,
1175
+ setId: s,
1176
+ code: u,
1177
+ children: [],
1178
+ infSetList: [t],
1179
+ operationInfo: ht(e.operationInfo),
1180
+ loaded: !0,
1181
+ raw: {
1182
+ ...e,
1183
+ infSetId: p,
1184
+ setId: s,
1185
+ infSetList: [t.raw]
1186
+ }
1187
+ };
1188
+ }
1189
+ function dn(e, t = {}) {
1190
+ const n = ce(
1191
+ e.globalInfoSchmMark ?? e.scheme ?? e
1192
+ ), o = x(n.infSchmId ?? t.infSchmId), a = x(n.emplid ?? t.emplid);
1193
+ return !o && !a && Object.keys(n).length === 0 ? null : {
1194
+ infSchmId: o,
1195
+ emplid: a,
1196
+ id: o,
1197
+ mark: x(n.globalInfoSchmMark ?? e.globalInfoSchmMark),
1198
+ config: Array.isArray(e.globalInfoSchmConfig) ? "" : x(n.globalInfoSchmConfig ?? e.globalInfoSchmConfig),
1199
+ raw: n
1200
+ };
1201
+ }
1202
+ function Do(e) {
1203
+ if (Array.isArray(e.globalInfoSchmConfig))
1204
+ return e.globalInfoSchmConfig;
1205
+ const t = ce(e.globalInfoSchmConfig), n = nt(t, ["children", "tree", "list", "tags"]);
1206
+ return n.length ? n : nt(e, ["children", "tree", "list", "tags", "records"]);
1207
+ }
1208
+ function Lo(e) {
1209
+ return Array.isArray(e) ? e.map((t) => {
1210
+ const n = ce(t);
1211
+ return {
1212
+ // infSetList 子项协议只要求 infSetId;setId/id 不能反推成 infSetId。
1213
+ infSetId: x(n.infSetId),
1214
+ setId: void 0,
1215
+ // 信息集列表里的 code 是页面 section 插槽接管点,必须从树接口阶段保留下来。
1216
+ code: se(n.code),
1217
+ operationInfo: ht(
1218
+ n.operationInfo
1219
+ ),
1220
+ raw: n
1221
+ };
1222
+ }) : [];
1223
+ }
1224
+ function fn(e) {
1225
+ return ce(mn(e));
1226
+ }
1227
+ function mn(e) {
1228
+ const t = ce(e);
1229
+ return t.data ?? t.result ?? e;
1230
+ }
1231
+ function nt(e, t) {
1232
+ for (const n of t) {
1233
+ const o = e[n];
1234
+ if (Array.isArray(o))
1235
+ return o;
1236
+ }
1237
+ return [];
1238
+ }
1239
+ function wt(e) {
1240
+ const t = { ...e };
1241
+ return delete t.__rowKey, delete t.fields, t;
1242
+ }
1243
+ function pn(e) {
1244
+ const t = ce(e);
1245
+ if (!(!t.method && !t.url && !t.params))
1246
+ return {
1247
+ ...t,
1248
+ method: se(t.method),
1249
+ url: se(t.url),
1250
+ params: gn(t.params)
1251
+ };
1252
+ }
1253
+ function ht(e) {
1254
+ const t = ce(e);
1255
+ if (Object.keys(t).length !== 0)
1256
+ return Object.fromEntries(
1257
+ Object.entries(t).map(([n, o]) => [
1258
+ n,
1259
+ pn(o) ?? o
1260
+ ])
1261
+ );
1262
+ }
1263
+ function Bt(e) {
1264
+ if (!Array.isArray(e))
1265
+ return;
1266
+ const t = e.map((n) => x(n)).filter(Boolean);
1267
+ return t.length ? t : void 0;
1268
+ }
1269
+ function Eo(e) {
1270
+ if ($e(e.htmlDisplay)) return "html";
1271
+ if ($e(e.multRow)) return "multi-row";
1272
+ const t = x(e.renderType).toLowerCase();
1273
+ return t === "code" || t === "empty" ? t : "text";
1274
+ }
1275
+ function No(e) {
1276
+ const t = x(
1277
+ e.fieldType ?? e.type ?? e.frontInputType ?? e.renderType
1278
+ ).toLowerCase();
1279
+ return ["dtpicker", "date"].includes(t) ? "date" : t === "select_remote" || t === "select_remote_descr" ? "select_remote" : ["select", "enum", "radio", "checkbox"].includes(t) ? "select" : ["number", "int", "integer"].includes(t) ? "number" : ["bool", "boolean", "switch"].includes(t) ? "switch" : ["file", "upload", "attachment", "attach"].includes(t) ? "file" : ["textarea", "text_area"].includes(t) ? "textarea" : "text";
1280
+ }
1281
+ function gn(e) {
1282
+ const t = ce(e);
1283
+ return Object.keys(t).length ? t : void 0;
1284
+ }
1285
+ function Vo(e) {
1286
+ const t = {
1287
+ ...ce(e.props)
1288
+ };
1289
+ return e.multiple !== void 0 && (t.multiple = $e(e.multiple)), Object.keys(t).length ? t : void 0;
1290
+ }
1291
+ function Pt(e) {
1292
+ return typeof e == "string" || typeof e == "number" ? e : void 0;
1293
+ }
1294
+ function ce(e) {
1295
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
1296
+ }
1297
+ function x(e) {
1298
+ return e == null ? "" : String(e).trim();
1299
+ }
1300
+ function se(e) {
1301
+ return x(e) || void 0;
1302
+ }
1303
+ function vn(e) {
1304
+ const t = hn(e);
1305
+ return t === void 0 ? null : t;
1306
+ }
1307
+ function hn(e) {
1308
+ if (e == null || e === "") return;
1309
+ const t = Number(e);
1310
+ return Number.isFinite(t) ? t : void 0;
1311
+ }
1312
+ function $e(e) {
1313
+ return typeof e == "string" ? ["true", "1", "y", "yes", "t", ee("common.是")].includes(
1314
+ e.toLowerCase()
1315
+ ) : !!e;
1316
+ }
1317
+ const Ke = (e) => e.code, _e = (e) => e.key || e.setId, Ko = (e) => String(e ?? "").trim(), it = (e) => Array.from(new Set(e.map(Ko).filter(Boolean))), Qe = (e) => !!(e && typeof e == "object" && "children" in e), ot = (e) => it([
1318
+ e?.key,
1319
+ e?.id,
1320
+ e?.setId,
1321
+ e?.infSetId,
1322
+ e?.tagId,
1323
+ e?.code,
1324
+ ...(e?.infSetList ?? []).map((t) => t.infSetId),
1325
+ ...(e?.infSetList ?? []).map((t) => t.setId)
1326
+ ]), Ro = (e) => it([
1327
+ e.key,
1328
+ e.id,
1329
+ e.setId,
1330
+ e.infSetId,
1331
+ e.tagId,
1332
+ e.code
1333
+ ]);
1334
+ function yn(e, t, n) {
1335
+ const o = Ro(e), a = it([n, ...ot(t)]);
1336
+ return a.length === 0 ? !1 : a.some((i) => o.includes(i));
1337
+ }
1338
+ function qo(e, t, n) {
1339
+ return it([n, ...ot(t)]).length === 0 ? e : e.filter((a) => yn(a, t, n));
1340
+ }
1341
+ function Ao(e, t, n = {}) {
1342
+ const o = Object.keys(n).length > 0 ? n : e.model, a = typeof t == "string" ? t : Ke(t), i = typeof t == "string" ? e.fields.find((s) => Ke(s) === a || s.code === a) : t, p = He(i).some((s) => {
1343
+ if (s === "searchText" && Object.prototype.hasOwnProperty.call(o, s) || s !== "searchText" && !Bo(e, s))
1344
+ return !1;
1345
+ const l = o[s];
1346
+ return l == null || l === "";
1347
+ });
1348
+ return {
1349
+ fieldKey: a,
1350
+ currentField: i,
1351
+ sourceModel: o,
1352
+ sourceRow: e.renderType === "table" ? o : void 0,
1353
+ missingDependField: p
1354
+ };
1355
+ }
1356
+ function Go(e) {
1357
+ return !!(e && !pt(e) && He(e).length === 0 && (e.options ?? []).length > 0);
1358
+ }
1359
+ function Bo(e, t) {
1360
+ return e.fields.some((n) => n.code === t);
1361
+ }
1362
+ function Po(e) {
1363
+ return kt(e);
1364
+ }
1365
+ const Ie = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : {}, ct = (e) => {
1366
+ const t = Ie(e);
1367
+ return !!(t.url || t.method || t.params);
1368
+ };
1369
+ function Yo(e) {
1370
+ const t = Ie(e.operationInfo).openTag;
1371
+ return ct(t) ? t : void 0;
1372
+ }
1373
+ function jo(e, t, n) {
1374
+ const o = Ie(e?.operationInfo).queryInfoSet;
1375
+ if (ct(o))
1376
+ return o;
1377
+ const a = t?.infSetList.find((r) => r.infSetId === n), i = Ie(a?.operationInfo).queryInfoSet;
1378
+ return ct(i) ? i : void 0;
1379
+ }
1380
+ function zo(e) {
1381
+ const t = Ie(e.operationInfo).editInfoSet;
1382
+ return ct(t) ? t : void 0;
1383
+ }
1384
+ async function bn(e) {
1385
+ const t = e.params === void 0 ? void 0 : Ie(e.params);
1386
+ return !e.formatter || !Ho(e) ? t : e.formatter({
1387
+ operation: e.operation,
1388
+ interfaceOperation: e.field?.interface,
1389
+ type: e.type,
1390
+ requestSource: e.requestSource,
1391
+ tagId: e.tagId,
1392
+ model: {
1393
+ ...Ie(e.section?.model),
1394
+ ...Ie(e.model)
1395
+ },
1396
+ row: e.row,
1397
+ section: e.section,
1398
+ field: e.field,
1399
+ node: e.node,
1400
+ viewModel: e.viewModel,
1401
+ sections: e.sections,
1402
+ activeNode: e.activeNode,
1403
+ activeSection: e.activeSection,
1404
+ searchText: e.searchText,
1405
+ params: t
1406
+ });
1407
+ }
1408
+ function Ho(e) {
1409
+ return e.requestSource === "inner" || e.requestSource === "sidebar" && e.type === "openTag";
1410
+ }
1411
+ async function Uo(e) {
1412
+ if (!e.service.requestOperation)
1413
+ throw new Error("[GlobalInfo] service.requestOperation is required for operationInfo");
1414
+ const t = e.operation.params === void 0 ? void 0 : Ie(e.operation.params), n = Zo(t, e.context), o = await bn({
1415
+ formatter: e.formatter,
1416
+ params: n,
1417
+ operation: e.operation,
1418
+ type: e.context?.type,
1419
+ requestSource: e.context?.requestSource,
1420
+ tagId: e.context?.tagId,
1421
+ section: e.context?.section,
1422
+ field: e.context?.field,
1423
+ model: e.context?.model,
1424
+ row: e.context?.row,
1425
+ node: e.context?.node,
1426
+ viewModel: e.viewModel,
1427
+ sections: e.sections,
1428
+ activeNode: e.activeNode,
1429
+ activeSection: e.activeSection,
1430
+ searchText: e.context?.searchText
1431
+ });
1432
+ return e.service.requestOperation(
1433
+ { ...e.operation, params: o },
1434
+ e.context ? { ...e.context, params: o } : e.context
1435
+ );
1436
+ }
1437
+ function Zo(e, t) {
1438
+ if (t?.params === void 0)
1439
+ return e;
1440
+ const n = Ie(t.params);
1441
+ return t.type === "openTag" && t.requestSource === "sidebar" ? {
1442
+ ...n,
1443
+ ...Ie(e)
1444
+ } : n;
1445
+ }
1446
+ function et(e = {}) {
1447
+ return {
1448
+ // loading:当前 section 是否正在拉详情。
1449
+ loading: !1,
1450
+ // saving:当前 section 是否正在保存。
1451
+ saving: !1,
1452
+ // error:当前 section 最近一次加载或保存错误。
1453
+ error: null,
1454
+ // loaded:当前 section 是否已经成功完成过详情加载。
1455
+ loaded: !1,
1456
+ // editing:当前 section 是否处于编辑态。
1457
+ editing: !1,
1458
+ // status 覆盖默认值,用于局部状态补丁。
1459
+ ...e
1460
+ };
1461
+ }
1462
+ function Wo(e) {
1463
+ const t = { ...e.currentMap }, n = { ...e.currentAliasMap }, o = [...e.currentOrder], a = { ...e.currentStatusMap }, i = qo(e.nextViewModel.sections, e.node, e.targetKey), r = it([e.targetKey, ...ot(e.node)]).length > 0, p = i.find((s) => yn(s, e.node, e.targetKey)) ?? (r ? null : e.nextViewModel.activeSection ?? i[0] ?? e.activeSection ?? null);
1464
+ return i.forEach((s) => {
1465
+ const l = _e(s);
1466
+ t[l] = s, o.includes(l) || o.push(l), a[l] = et({
1467
+ ...a[l],
1468
+ loaded: !0,
1469
+ loading: !1,
1470
+ error: null,
1471
+ editing: e.editingSectionKeys.includes(l)
1472
+ });
1473
+ }), e.targetKey && p ? n[e.targetKey] = _e(p) : e.targetKey && (n[e.targetKey] = ""), e.targetKey && (a[e.targetKey] = et({
1474
+ ...a[e.targetKey],
1475
+ loaded: !0,
1476
+ loading: !1,
1477
+ error: null,
1478
+ editing: !!(p && e.editingSectionKeys.includes(_e(p)))
1479
+ })), {
1480
+ sectionMap: t,
1481
+ sectionAliasMap: n,
1482
+ sectionOrder: o,
1483
+ sectionStatusMap: a,
1484
+ matchedSection: p,
1485
+ targetSections: i
1486
+ };
1487
+ }
1488
+ const Sn = ee(
1489
+ "common.信息集不能为空,最后一条数据不可删除"
1490
+ );
1491
+ function xo(e, t = [], n = {}) {
1492
+ return !e.mark.isRequired || t.length > 0 ? null : Jo(n.emptyMessage, {
1493
+ section: e,
1494
+ infSetValues: t
1495
+ }) || Sn;
1496
+ }
1497
+ function Jo(e, t) {
1498
+ return typeof e == "function" ? e(t) : typeof e == "string" ? e : Sn;
1499
+ }
1500
+ function ut(e, t) {
1501
+ const n = Xo(e);
1502
+ return typeof t == "number" ? `${t}:${n}` : n;
1503
+ }
1504
+ function wn(e, t, n, o, a = {}) {
1505
+ return It(
1506
+ e,
1507
+ t,
1508
+ n,
1509
+ o,
1510
+ a
1511
+ ) !== null;
1512
+ }
1513
+ function It(e, t, n, o, a = {}) {
1514
+ const i = n?.requiredRule?.({
1515
+ field: e,
1516
+ section: t,
1517
+ values: o,
1518
+ value: o[e.code],
1519
+ row: a.row,
1520
+ rowIndex: a.rowIndex,
1521
+ rows: a.rows
1522
+ });
1523
+ return typeof i == "string" ? i : i === !0 ? Yt(e) : i === !1 ? null : e.required || e.isRequired ? Yt(e) : null;
1524
+ }
1525
+ function Qo(e, t) {
1526
+ const n = {};
1527
+ if (e.renderType === "table" || e.renderType === "multi-form")
1528
+ e.rows.forEach((o, a) => {
1529
+ ze(
1530
+ e.fields,
1531
+ e,
1532
+ t,
1533
+ // 保存校验按单元格执行;表格列结构可以稳定存在,但隐藏的当前行字段不参与必填。
1534
+ { values: o }
1535
+ ).forEach((r) => {
1536
+ const p = It(
1537
+ r,
1538
+ e,
1539
+ t,
1540
+ o,
1541
+ { row: o, rowIndex: a, rows: e.rows }
1542
+ );
1543
+ !p || !pe(o[r.code]) || (n[ut(r, a)] = p);
1544
+ });
1545
+ });
1546
+ else {
1547
+ const o = e.model;
1548
+ ze(
1549
+ e.fields,
1550
+ e,
1551
+ t,
1552
+ { values: o }
1553
+ ).forEach((i) => {
1554
+ const r = It(
1555
+ i,
1556
+ e,
1557
+ t,
1558
+ o
1559
+ );
1560
+ !r || !pe(o[i.code]) || (n[ut(i)] = r);
1561
+ });
1562
+ }
1563
+ return {
1564
+ fieldErrors: n,
1565
+ firstMessage: Object.values(n)[0] ?? null
1566
+ };
1567
+ }
1568
+ function Yt(e) {
1569
+ const t = e.raw?.requiredMessage ?? e.raw?.emptyMessage;
1570
+ return typeof t == "string" && t.trim() ? t : `${e.label || e.name || e.code || "字段"}不能为空`;
1571
+ }
1572
+ function Xo(e) {
1573
+ return e.code;
1574
+ }
1575
+ const Ge = (e) => new Error(`[GlobalInfo] ${e}`), er = (e) => [
1576
+ String(e.method ?? "").toLowerCase(),
1577
+ String(e.url ?? ""),
1578
+ _t(Ie(e.params))
1579
+ ].join("::");
1580
+ function _t(e) {
1581
+ return Array.isArray(e) ? `[${e.map((t) => _t(t)).join(",")}]` : e && typeof e == "object" ? `{${Object.entries(e).sort(([n], [o]) => n.localeCompare(o)).map(([n, o]) => `${JSON.stringify(n)}:${_t(o)}`).join(",")}}` : JSON.stringify(e);
1582
+ }
1583
+ const tr = (e) => {
1584
+ const t = Te(!1), n = Te(!1), o = Te(!1), a = Ve(null), i = Ve([]), r = Ve(null), p = Ve(null), s = Ve(null), l = Ve({}), u = Ve({}), h = Te([]), v = Ve({}), D = Te([]), N = P(
1585
+ () => {
1586
+ const f = h.value.map((b) => l.value[b]).filter((b) => !!b), m = Object.entries(l.value).filter(([b]) => !h.value.includes(b)).map(([, b]) => b);
1587
+ return [...f, ...m];
1588
+ }
1589
+ ), M = P(() => ({
1590
+ // 整棵树是否正在加载。
1591
+ loading: t.value,
1592
+ // 当前详情是否正在加载。
1593
+ detailLoading: n.value,
1594
+ // 当前是否正在保存。
1595
+ saving: o.value,
1596
+ // 当前所有编辑中的 section key。
1597
+ editingSectionKeys: D.value,
1598
+ // 已加载 section 映射。
1599
+ sectionMap: l.value,
1600
+ // section 状态映射;这里把 alias 后的编辑态也同步进去。
1601
+ sectionStatusMap: Object.fromEntries(
1602
+ Object.entries(v.value).map(([f, m]) => [
1603
+ f,
1604
+ {
1605
+ // 保留原状态字段。
1606
+ ...m,
1607
+ // 编辑态以 editingSectionKeys 为准,避免状态对象里 editing 值残留。
1608
+ editing: D.value.includes(
1609
+ u.value[f] ?? f
1610
+ )
1611
+ }
1612
+ ])
1613
+ ),
1614
+ // 最近一次全局错误。
1615
+ error: a.value
1616
+ })), $ = () => ({
1617
+ // adaptScene 透传给新接口形态。
1618
+ adaptScene: e.adaptScene,
1619
+ // emplid 是当前人员标识,树和详情接口都需要它。
1620
+ emplid: e.emplid
1621
+ }), O = (f) => ({
1622
+ // 复用基础参数,保证人员和场景一致。
1623
+ ...$(),
1624
+ // infSchmId 指定当前模板方案。
1625
+ infSchmId: f.infSchmId,
1626
+ // tagId 指定要展开的树节点。
1627
+ tagId: f.tagId,
1628
+ // tagLevel 告诉后端当前节点层级。
1629
+ tagLevel: f.tagLevel,
1630
+ // parentTagId 保留父子关系上下文。
1631
+ parentTagId: f.parentTagId
1632
+ }), q = (f = p.value, m = s.value) => ({
1633
+ // 详情接口同样需要基础人员和场景参数。
1634
+ ...$(),
1635
+ // 当前节点所属模板方案。
1636
+ infSchmId: f?.infSchmId,
1637
+ // 当前点击或加载的树节点 id。
1638
+ tagId: f?.tagId,
1639
+ // 保存或刷新指定 section 时优先使用 section 自己的信息集 id。
1640
+ infSetId: m?.infSetId ?? f?.infSetId,
1641
+ // setId 同样优先取 section,避免保存时拿错节点 setId。
1642
+ setId: m?.setId ?? f?.setId
1643
+ }), A = async (f, m) => Uo({
1644
+ service: e.service,
1645
+ formatter: e.formatOperationParams,
1646
+ operation: f,
1647
+ context: m,
1648
+ viewModel: r.value,
1649
+ sections: N.value,
1650
+ activeNode: p.value,
1651
+ activeSection: s.value
1652
+ }), Z = Un(
1653
+ async (f, m) => {
1654
+ if (!e.service.requestOperation)
1655
+ throw Ge("service.requestOperation is required");
1656
+ return e.service.requestOperation(f, m);
1657
+ },
1658
+ (f) => er(f)
1659
+ ), j = async (f, m) => {
1660
+ const b = await bn({
1661
+ formatter: e.formatOperationParams,
1662
+ params: m?.params,
1663
+ operation: f,
1664
+ type: m?.type,
1665
+ requestSource: m?.requestSource,
1666
+ tagId: m?.tagId,
1667
+ section: m?.section,
1668
+ field: m?.field,
1669
+ model: m?.model,
1670
+ row: m?.row,
1671
+ node: m?.node,
1672
+ viewModel: r.value,
1673
+ sections: N.value,
1674
+ activeNode: p.value,
1675
+ activeSection: s.value,
1676
+ searchText: m?.searchText
1677
+ }), B = { ...f, params: b }, z = m && { ...m, params: b };
1678
+ return Z(B, z);
1679
+ }, w = (f, m) => {
1680
+ if (!m)
1681
+ return f[0] ?? null;
1682
+ for (const b of f) {
1683
+ if (ot(b).includes(m))
1684
+ return b;
1685
+ const B = w(b.children, m);
1686
+ if (B)
1687
+ return B;
1688
+ }
1689
+ return null;
1690
+ }, F = (f = s.value) => {
1691
+ if (f)
1692
+ return typeof f == "string" ? f : Qe(f) ? I(f) : _e(f);
1693
+ }, E = (f = s.value) => {
1694
+ const m = F(f);
1695
+ if (!m)
1696
+ return null;
1697
+ const b = u.value[m] ?? m;
1698
+ return l.value[b] ?? null;
1699
+ }, R = (f = s.value) => {
1700
+ const m = F(f);
1701
+ if (m)
1702
+ return u.value[m] ?? m;
1703
+ }, I = (f = s.value) => {
1704
+ if (f)
1705
+ return typeof f == "string" ? f : Qe(f) ? f.setId ?? f.infSetId ?? f.key : _e(f);
1706
+ }, C = (f = s.value) => {
1707
+ if (Qe(f))
1708
+ return f;
1709
+ if (typeof f == "string") {
1710
+ const m = w(i.value, f);
1711
+ if (m)
1712
+ return m;
1713
+ const b = E(f);
1714
+ return b?.ownerNodeKey ? w(i.value, b.ownerNodeKey) ?? p.value : b || p.value && ot(p.value).includes(f) ? p.value : null;
1715
+ }
1716
+ return f?.ownerNodeKey ? w(i.value, f.ownerNodeKey) ?? p.value : p.value;
1717
+ }, W = (f = s.value) => !f || Qe(f) ? null : E(f), J = (f = s.value) => {
1718
+ const m = I(f);
1719
+ if (!m)
1720
+ return et();
1721
+ const b = u.value[m] ?? m;
1722
+ return et({
1723
+ ...v.value[m],
1724
+ ...v.value[b],
1725
+ // 编辑态始终从 editingSectionKeys 计算,避免状态对象过期。
1726
+ editing: D.value.includes(
1727
+ b
1728
+ )
1729
+ });
1730
+ }, k = (f, m) => {
1731
+ const b = I(f);
1732
+ b && (v.value = {
1733
+ ...v.value,
1734
+ [b]: et({
1735
+ // 保留已有状态。
1736
+ ...v.value[b],
1737
+ // 合并本次状态补丁。
1738
+ ...m,
1739
+ // 编辑态仍以 editingSectionKeys 为准。
1740
+ editing: D.value.includes(b)
1741
+ })
1742
+ });
1743
+ }, T = (f = s.value) => {
1744
+ const m = R(f);
1745
+ m && k(m, { fieldErrors: {} });
1746
+ }, d = (f = r.value?.raw ?? null, m = p.value) => {
1747
+ const b = N.value, B = s.value && b.find(
1748
+ (z) => _e(z) === _e(s.value)
1749
+ ) ? s.value : null;
1750
+ r.value = {
1751
+ // 保留原 scheme。
1752
+ scheme: r.value?.scheme ?? null,
1753
+ // 当前节点。
1754
+ node: m,
1755
+ // 顶层节点和树节点都来自 nodes。
1756
+ topNodes: i.value,
1757
+ treeNodes: i.value,
1758
+ // 当前激活节点。
1759
+ activeNode: m,
1760
+ // 当前激活 section。
1761
+ activeSection: B,
1762
+ // 当前所有已加载 section。
1763
+ sections: b,
1764
+ // 当前 section 缓存。
1765
+ sectionMap: l.value,
1766
+ // 保留原始接口数据。
1767
+ raw: f
1768
+ }, s.value = B;
1769
+ }, g = (f, m = p.value, b) => {
1770
+ const B = Wo({
1771
+ currentMap: l.value,
1772
+ currentAliasMap: u.value,
1773
+ currentOrder: h.value,
1774
+ currentStatusMap: v.value,
1775
+ editingSectionKeys: D.value,
1776
+ nextViewModel: f,
1777
+ node: m,
1778
+ targetKey: b,
1779
+ activeSection: s.value
1780
+ });
1781
+ return l.value = B.sectionMap, u.value = B.sectionAliasMap, h.value = B.sectionOrder, v.value = B.sectionStatusMap, r.value = {
1782
+ ...f,
1783
+ scheme: f.scheme ?? r.value?.scheme ?? null,
1784
+ topNodes: i.value,
1785
+ treeNodes: i.value,
1786
+ activeNode: m,
1787
+ activeSection: B.matchedSection,
1788
+ sections: B.targetSections,
1789
+ sectionMap: l.value
1790
+ }, s.value = B.matchedSection, B.matchedSection;
1791
+ }, S = (f, m) => {
1792
+ const b = R(f), B = b ? l.value[b] : null;
1793
+ if (!b || !B)
1794
+ return;
1795
+ const z = m(B);
1796
+ l.value = {
1797
+ ...l.value,
1798
+ [b]: z
1799
+ }, s.value = _e(s.value ?? z) === b ? z : s.value, d();
1800
+ }, c = async (f = s.value ?? p.value) => {
1801
+ const m = W(f), b = C(f) ?? p.value, B = I(f);
1802
+ if (!b)
1803
+ return null;
1804
+ if (!e.service.requestOperation)
1805
+ throw Ge("service.requestOperation is required");
1806
+ n.value = !0, a.value = null, k(B ?? b, { loading: !0, error: null });
1807
+ try {
1808
+ const z = m ? [{ infSetId: m.infSetId, setId: m.setId, operationInfo: m.operationInfo, raw: m.raw }] : b.infSetList;
1809
+ if (z.length === 0)
1810
+ throw Ge("node.infSetList is required");
1811
+ const we = await Promise.all(z.map(async (ne) => {
1812
+ const de = jo(m, b, ne.infSetId), De = m?.requestTagId ?? m?.tagId ?? b.tagId, lt = {
1813
+ ...q(b, m),
1814
+ tagId: De,
1815
+ infSetId: ne.infSetId,
1816
+ setId: ne.setId,
1817
+ operationInfo: ne.operationInfo
1818
+ };
1819
+ if (de) {
1820
+ const We = await A(de, {
1821
+ type: "queryInfoSet",
1822
+ requestSource: "inner",
1823
+ tagId: De,
1824
+ node: b,
1825
+ section: m,
1826
+ params: lt
1827
+ });
1828
+ return wo(We, lt, b);
1829
+ }
1830
+ throw Ge("infoSet.operationInfo.queryInfoSet is required");
1831
+ })), me = {
1832
+ ...we[0],
1833
+ sections: we.flatMap((ne) => ne.sections),
1834
+ sectionMap: Object.fromEntries(we.flatMap((ne) => ne.sections).map((ne) => [ne.key, ne]))
1835
+ };
1836
+ return g(me, b, B);
1837
+ } catch (z) {
1838
+ throw a.value = z, k(B ?? b, { loading: !1, error: z }), z;
1839
+ } finally {
1840
+ n.value = !1, k(B ?? b, { loading: !1 });
1841
+ }
1842
+ }, y = (f = s.value) => c(f), _ = (f = s.value) => {
1843
+ if (!f)
1844
+ return null;
1845
+ if (!Qe(f) && typeof f != "string")
1846
+ return E(f);
1847
+ const m = I(f);
1848
+ return m ? l.value[u.value[m] ?? m] ?? null : null;
1849
+ }, V = async (f = p.value) => f ? (await c(f), r.value) : (r.value = null, s.value = null, l.value = {}, u.value = {}, h.value = [], v.value = {}, null), K = async (f) => {
1850
+ const m = Yo(f);
1851
+ if (!m)
1852
+ return f.children;
1853
+ const b = O(f), B = await A(m, {
1854
+ type: "openTag",
1855
+ requestSource: "sidebar",
1856
+ tagId: f.tagId,
1857
+ node: f,
1858
+ params: b
1859
+ });
1860
+ return At(B).treeNodes;
1861
+ }, H = async (f) => {
1862
+ if (f.loaded)
1863
+ return f.children;
1864
+ const m = await K(f);
1865
+ return m.length > 0 && (i.value = sn(i.value, f.key, m)), m;
1866
+ }, G = async (f) => {
1867
+ const m = typeof f == "string" ? w(i.value, f) : f;
1868
+ return m ? (p.value = m, s.value = null, D.value = [], await H(m), d(r.value?.raw, m), m) : null;
1869
+ }, Y = async () => {
1870
+ const f = e.service.templateTree;
1871
+ if (!f)
1872
+ throw Ge("service.templateTree is required");
1873
+ t.value = !0, a.value = null;
1874
+ try {
1875
+ const m = await f($()), b = At(m), B = await Promise.all(
1876
+ b.treeNodes.map(async (we) => {
1877
+ const me = await K(we);
1878
+ return {
1879
+ ...we,
1880
+ children: me,
1881
+ loaded: me.length > 0 || we.loaded
1882
+ };
1883
+ })
1884
+ );
1885
+ i.value = B, s.value = null, l.value = {}, u.value = {}, h.value = [], v.value = {}, D.value = [];
1886
+ const z = w(B, e.initialActiveNodeKey) ?? w(B);
1887
+ return p.value = z, r.value = {
1888
+ ...b,
1889
+ treeNodes: B,
1890
+ activeNode: z,
1891
+ sectionMap: l.value,
1892
+ sections: N.value
1893
+ }, i.value;
1894
+ } catch (m) {
1895
+ throw a.value = m, m;
1896
+ } finally {
1897
+ t.value = !1;
1898
+ }
1899
+ }, Q = async () => {
1900
+ const f = F();
1901
+ await y(s.value ?? p.value);
1902
+ const m = N.value.find(
1903
+ (b) => _e(b) === f
1904
+ );
1905
+ return m && (s.value = m), d(), r.value;
1906
+ }, oe = (f = s.value) => {
1907
+ const m = R(f);
1908
+ return !!(m && D.value.includes(m));
1909
+ }, fe = (f = s.value) => {
1910
+ const m = R(f);
1911
+ !m || oe(m) || (D.value = [...D.value, m], k(m, { editing: !0 }));
1912
+ }, ue = (f = s.value) => {
1913
+ const m = R(f);
1914
+ m && (D.value = D.value.filter(
1915
+ (b) => b !== m
1916
+ ), k(m, { editing: !1 }));
1917
+ }, ye = (f, m, b) => {
1918
+ const B = typeof m == "string" ? m : Ke(m);
1919
+ S(f, (z) => {
1920
+ const me = (typeof m == "string" ? z.fields.find((de) => Ke(de) === B || de.code === B) : m)?.cascadeClearFields ?? [], ne = {
1921
+ ...z.model,
1922
+ [B]: b
1923
+ };
1924
+ return me.forEach((de) => {
1925
+ ne[de] = "";
1926
+ }), {
1927
+ // 保留 section 其它元数据。
1928
+ ...z,
1929
+ // 更新表单 model。
1930
+ model: ne,
1931
+ // 表单类型同步更新第一行 rows,方便保存时统一从 rows 构造 payload。
1932
+ rows: z.renderType === "form" ? [{ ...z.rows[0], ...ne }] : z.rows,
1933
+ // 同步 fields.value,保证只读 renderer 立即显示新值。
1934
+ fields: z.fields.map((de) => {
1935
+ const De = Ke(de);
1936
+ return De === B || de.code === B ? { ...de, value: b } : me.includes(De) || me.includes(de.code) ? { ...de, value: "" } : de;
1937
+ })
1938
+ };
1939
+ }), T(f);
1940
+ }, Me = async (f, m, b = {}, B = {}) => {
1941
+ const z = E(f);
1942
+ if (!z)
1943
+ return [];
1944
+ const we = {
1945
+ ...b,
1946
+ ...B.searchText !== void 0 ? { searchText: B.searchText } : {}
1947
+ }, {
1948
+ fieldKey: me,
1949
+ currentField: ne,
1950
+ sourceModel: de,
1951
+ sourceRow: De,
1952
+ missingDependField: lt
1953
+ } = Ao(z, m, we), We = ne?.interface;
1954
+ if (!ne || !We)
1955
+ return ne?.options ?? [];
1956
+ if (String(ne.valueListType ?? "").toUpperCase() === "ENUMS")
1957
+ return ne.options ?? [];
1958
+ if (Go(ne))
1959
+ return ne.options ?? [];
1960
+ if (lt)
1961
+ return S(z, (xe) => ({
1962
+ ...xe,
1963
+ fields: xe.fields.map(
1964
+ (Le) => Ke(Le) === me || Le.code === me ? { ...Le, options: [] } : Le
1965
+ )
1966
+ })), [];
1967
+ const Fn = await j(
1968
+ {
1969
+ ...We
1970
+ },
1971
+ {
1972
+ type: "fieldOptions",
1973
+ requestSource: "inner",
1974
+ tagId: z.requestTagId ?? z.tagId,
1975
+ node: C(z),
1976
+ section: z,
1977
+ field: ne,
1978
+ params: Ie(We.params),
1979
+ // searchText 参与本次查询时,需要一并透传到 model 上,避免被依赖检查视为缺失并提前截断请求。
1980
+ model: de,
1981
+ row: De,
1982
+ searchText: B.searchText
1983
+ }
1984
+ ), Dt = Po(Fn);
1985
+ return S(z, (xe) => ({
1986
+ ...xe,
1987
+ fields: xe.fields.map(
1988
+ (Le) => Ke(Le) === me || Le.code === me ? { ...Le, options: Dt } : Le
1989
+ )
1990
+ })), Dt;
1991
+ }, Ce = (f, m) => {
1992
+ if (Array.isArray(m)) {
1993
+ Fe(f, m);
1994
+ return;
1995
+ }
1996
+ S(f, (b) => ({
1997
+ ...b,
1998
+ // 替换当前 model。
1999
+ model: m,
2000
+ // 表单类型同步合并到第一行 rows。
2001
+ rows: b.renderType === "form" ? [{ ...b.rows[0], ...m }] : b.rows,
2002
+ // fields.value 也同步成 model 中的值。
2003
+ fields: b.fields.map((B) => ({
2004
+ ...B,
2005
+ value: m[Ke(B)]
2006
+ }))
2007
+ })), T(f);
2008
+ }, Fe = (f, m) => {
2009
+ S(f, (b) => ({
2010
+ ...b,
2011
+ rows: m,
2012
+ data: m
2013
+ })), T(f);
2014
+ }, Pe = (f, m = {}, b = -1) => {
2015
+ const z = [...E(f)?.rows ?? []];
2016
+ z.splice(b >= 0 ? b : z.length, b >= 0 ? 1 : 0, m), Fe(f, z);
2017
+ }, Ue = (f, m) => {
2018
+ const b = E(f), B = typeof m == "string" ? Number(m) : m, z = (b?.rows ?? []).filter(
2019
+ (we, me) => me !== B
2020
+ );
2021
+ Fe(f, z);
2022
+ }, Ze = async (f, m) => {
2023
+ const b = e.renderConfig?.onBeforeSave;
2024
+ if (!b) return;
2025
+ const B = await b({
2026
+ section: f,
2027
+ node: p.value,
2028
+ model: f.model,
2029
+ rows: f.rows,
2030
+ payload: m,
2031
+ state: M.value,
2032
+ actions: Ye
2033
+ });
2034
+ if (B instanceof Error) throw B;
2035
+ if (typeof B == "string" && B.trim()) throw new Error(B);
2036
+ if (B === !1) throw Ge("save cancelled by onBeforeSave");
2037
+ }, Ye = {
2038
+ // 加载模板树。
2039
+ loadTree: Y,
2040
+ // 选中树节点。
2041
+ selectNode: G,
2042
+ // 加载当前节点详情。
2043
+ loadDetail: V,
2044
+ // 刷新当前详情。
2045
+ reloadActiveSection: Q,
2046
+ // 加载指定节点或 section。
2047
+ loadSection: c,
2048
+ // 重新加载指定节点或 section。
2049
+ reloadSection: y,
2050
+ // 获取指定节点或 section 的缓存数据。
2051
+ getSection: _,
2052
+ // 获取指定节点或 section 的状态。
2053
+ getSectionStatus: J,
2054
+ // 开启编辑。
2055
+ startEdit: fe,
2056
+ // 取消编辑。
2057
+ cancelEdit: ue,
2058
+ // 更新单字段。
2059
+ updateField: ye,
2060
+ // 加载字段动态选项。
2061
+ loadFieldOptions: Me,
2062
+ // 批量更新 model。
2063
+ updateModel: Ce,
2064
+ // 更新表格行。
2065
+ updateTableRows: Fe,
2066
+ // 保存单行到本地缓存。
2067
+ saveRow: Pe,
2068
+ // 删除单行本地缓存。
2069
+ deleteRow: Ue,
2070
+ // 调用接口保存 section。
2071
+ saveSection: async (f = s.value) => {
2072
+ const m = F(f), b = E(f);
2073
+ if (!b)
2074
+ return null;
2075
+ const B = zo(b);
2076
+ if (!B)
2077
+ throw Ge("section.operationInfo.editInfoSet is required");
2078
+ o.value = !0, a.value = null, m && m !== _e(b) && k(m, { saving: !0, error: null }), k(b, { saving: !0, error: null });
2079
+ try {
2080
+ const {
2081
+ tagId: z,
2082
+ ...we
2083
+ } = q(p.value, b), me = _o(b, we), ne = xo(
2084
+ b,
2085
+ me.infSetValues ?? [],
2086
+ {
2087
+ emptyMessage: e.renderConfig?.requiredInfoSetEmptyMessage
2088
+ }
2089
+ );
2090
+ if (ne)
2091
+ throw new Error(ne);
2092
+ const de = Qo(
2093
+ b,
2094
+ e.renderConfig
2095
+ );
2096
+ if (k(b, {
2097
+ fieldErrors: de.fieldErrors
2098
+ }), de.firstMessage)
2099
+ throw new Error(de.firstMessage);
2100
+ await Ze(b, me);
2101
+ const De = await A(
2102
+ // 保存时保留后端给的 method/url,但不再把 editOperation.params 混入实际提交数据。
2103
+ B,
2104
+ {
2105
+ type: "editInfoSet",
2106
+ requestSource: "inner",
2107
+ tagId: b.requestTagId ?? b.tagId,
2108
+ node: p.value,
2109
+ section: b,
2110
+ params: me,
2111
+ model: b.model
2112
+ }
2113
+ );
2114
+ return ue(b), await y(b), De;
2115
+ } catch (z) {
2116
+ throw a.value = z, m && m !== _e(b) && k(m, { saving: !1, error: z }), k(b, { saving: !1, error: z }), z;
2117
+ } finally {
2118
+ o.value = !1, m && m !== _e(b) && k(m, { saving: !1 }), k(b, { saving: !1 });
2119
+ }
2120
+ },
2121
+ // 判断编辑态。
2122
+ isEditing: oe
2123
+ };
2124
+ return qe(
2125
+ // 监听当前人员 id。
2126
+ () => e.emplid,
2127
+ () => {
2128
+ (e.autoLoad ?? !0) && Y();
2129
+ }
2130
+ ), jt(() => {
2131
+ (e.autoLoad ?? !0) && Y();
2132
+ }), {
2133
+ // 当前 viewModel。
2134
+ viewModel: r,
2135
+ // 当前模板树节点。
2136
+ nodes: i,
2137
+ // 当前已加载 section 列表。
2138
+ sections: N,
2139
+ // 当前 section 缓存。
2140
+ sectionMap: l,
2141
+ // 当前 section 状态缓存。
2142
+ sectionStatusMap: v,
2143
+ // 当前激活节点。
2144
+ activeNode: p,
2145
+ // 当前激活 section。
2146
+ activeSection: s,
2147
+ // 给页面消费的状态快照。
2148
+ state: M,
2149
+ // 给页面消费的操作集合。
2150
+ actions: Ye
2151
+ };
2152
+ }, ma = /* @__PURE__ */ Se({
2153
+ name: "GlobalInfoProvider",
2154
+ __name: "GlobalInfoProvider",
2155
+ props: {
2156
+ service: {},
2157
+ adaptScene: {},
2158
+ emplid: {},
2159
+ autoLoad: { type: Boolean, default: !0 },
2160
+ initialActiveNodeKey: {},
2161
+ renderConfig: {},
2162
+ formatOperationParams: {}
2163
+ },
2164
+ setup(e) {
2165
+ const t = e, n = tr(t), { viewModel: o, nodes: a, sections: i, activeNode: r, activeSection: p, state: s, actions: l } = n;
2166
+ return (u, h) => ae(u.$slots, "default", ke(Ee({
2167
+ viewModel: te(o),
2168
+ nodes: te(a),
2169
+ sections: te(i),
2170
+ activeNode: te(r),
2171
+ activeSection: te(p),
2172
+ state: te(s),
2173
+ actions: te(l),
2174
+ renderConfig: t.renderConfig
2175
+ })));
2176
+ }
2177
+ }), nr = {
2178
+ key: 0,
2179
+ class: "global-info-field-control__option"
2180
+ }, or = { class: "global-info-field-control__option-label" }, rr = {
2181
+ key: 0,
2182
+ class: "global-info-field-control__option-descr"
2183
+ }, ar = ["disabled", "accept", "multiple"], ir = {
2184
+ key: 0,
2185
+ class: "global-info-field-control__file-list"
2186
+ }, sr = { class: "global-info-field-control__file-text" }, lr = {
2187
+ key: 0,
2188
+ class: "global-info-field-control__file-separator"
2189
+ }, cr = {
2190
+ key: 1,
2191
+ class: "global-info-field-control__file-text"
2192
+ }, ur = {
2193
+ key: 2,
2194
+ class: "global-info-field-control__file-upload"
2195
+ }, dr = /* @__PURE__ */ Se({
2196
+ name: "GlobalInfoFieldControl",
2197
+ __name: "GlobalInfoFieldControl",
2198
+ props: {
2199
+ field: {},
2200
+ modelValue: {},
2201
+ disabled: { type: Boolean, default: !1 }
2202
+ },
2203
+ emits: ["update:modelValue", "change", "loadOptions"],
2204
+ setup(e, { emit: t }) {
2205
+ const n = e, o = t, a = [
2206
+ "textarea",
2207
+ "html",
2208
+ "code",
2209
+ "multi-row"
2210
+ ], i = Te(null), r = P(
2211
+ () => Tt(n.field)
2212
+ ), p = P(
2213
+ () => pt(n.field)
2214
+ ), s = P(
2215
+ () => no(n.field)
2216
+ ), l = P(
2217
+ () => n.disabled || n.field.disabled || n.field.readonly
2218
+ ), u = P(() => !!n.field.props?.multiple), h = P(
2219
+ () => n.modelValue === void 0 || n.modelValue === null ? "" : String(n.modelValue)
2220
+ ), v = P(
2221
+ () => a.includes(r.value) ? n.field.props?.resize ?? "vertical" : void 0
2222
+ ), D = P(() => {
2223
+ if (n.modelValue === void 0 || n.modelValue === null || n.modelValue === "")
2224
+ return;
2225
+ const g = typeof n.modelValue == "number" ? n.modelValue : Number(n.modelValue);
2226
+ return Number.isFinite(g) ? g : void 0;
2227
+ }), N = P(
2228
+ () => oo(n.field, n.modelValue)
2229
+ ), M = P(
2230
+ () => (n.field.options ?? []).map((g) => ({
2231
+ ...g,
2232
+ value: R(g)
2233
+ }))
2234
+ ), $ = P(() => {
2235
+ const g = n.field.props?.popperClass ?? n.field.props?.["popper-class"];
2236
+ return s.value ? [g, "global-info-field-control__descr-popper"].filter(Boolean).join(" ") : g;
2237
+ }), O = P(() => {
2238
+ const g = n.field.props?.teleported;
2239
+ return g === void 0 ? !0 : g;
2240
+ }), q = P(() => {
2241
+ const g = n.field.props?.activeValue ?? n.field.props?.["active-value"], S = n.field.props?.inactiveValue ?? n.field.props?.["inactive-value"];
2242
+ return g !== void 0 || S !== void 0 ? n.modelValue ?? S ?? !1 : en(n.modelValue);
2243
+ }), A = P(() => r.value === "code" ? 5 : 1), Z = P(
2244
+ () => r.value === "file" && !pe(n.modelValue)
2245
+ ), j = P(
2246
+ () => Xt(
2247
+ n.field,
2248
+ n.modelValue,
2249
+ ee("common.请选择文件")
2250
+ )
2251
+ ), w = P(
2252
+ () => tn(
2253
+ n.field,
2254
+ n.modelValue,
2255
+ ee("common.请选择文件")
2256
+ )
2257
+ ), F = P(() => n.field.placeholder ? n.field.placeholder : p.value ? ee("common.请输入关键词") : r.value === "select" ? ee("common.请选择") : r.value === "date" ? ee("common.请选择日期") : r.value === "file" ? ee("common.请选择文件") : ee("common.请输入"));
2258
+ let E;
2259
+ function R(g) {
2260
+ if (Array.isArray(N.value)) {
2261
+ const S = N.value.find(
2262
+ (c) => tt(g, c)
2263
+ );
2264
+ if (S !== void 0) return S;
2265
+ }
2266
+ return tt(g, N.value) ? N.value : g.value;
2267
+ }
2268
+ function I(g) {
2269
+ o("update:modelValue", W(g));
2270
+ }
2271
+ function C(g) {
2272
+ o("change", W(g));
2273
+ }
2274
+ function W(g) {
2275
+ return r.value === "select" || r.value === "select_remote" ? ro(n.field, g) : g;
2276
+ }
2277
+ function J(g) {
2278
+ g && o("loadOptions", p.value ? { searchText: "" } : void 0);
2279
+ }
2280
+ function k(g) {
2281
+ p.value && (E && clearTimeout(E), E = setTimeout(() => {
2282
+ o("loadOptions", { searchText: g });
2283
+ }, 300));
2284
+ }
2285
+ function T() {
2286
+ l.value || i.value?.click();
2287
+ }
2288
+ zt(() => {
2289
+ E && clearTimeout(E);
2290
+ });
2291
+ function d(g) {
2292
+ const S = g.target, c = Array.from(S.files ?? []), y = n.field.props?.multiple ? c : c[0] ?? null;
2293
+ I(y), C(y);
2294
+ }
2295
+ return (g, S) => {
2296
+ const c = Vn, y = Nn, _ = Kn, V = Rn, K = qn, H = An;
2297
+ return r.value === "select" || r.value === "select_remote" ? (L(), re(y, he({
2298
+ key: 0,
2299
+ class: ["global-info-field-control", { "global-info-field-control--select-descr": s.value }]
2300
+ }, g.field.props, {
2301
+ "popper-class": $.value,
2302
+ teleported: O.value,
2303
+ "model-value": N.value,
2304
+ placeholder: F.value,
2305
+ disabled: l.value,
2306
+ "collapse-tags": u.value,
2307
+ "collapse-tags-tooltip": u.value,
2308
+ "max-collapse-tags": 1,
2309
+ filterable: p.value || !!g.field.props?.filterable,
2310
+ remote: p.value || !!g.field.props?.remote,
2311
+ "remote-method": p.value ? k : g.field.props?.remoteMethod,
2312
+ clearable: "",
2313
+ onVisibleChange: J,
2314
+ "onUpdate:modelValue": I,
2315
+ onChange: C
2316
+ }), {
2317
+ default: X(() => [
2318
+ (L(!0), U(be, null, ve(M.value, (G) => (L(), re(c, {
2319
+ key: String(G.value),
2320
+ label: G.label,
2321
+ value: G.value
2322
+ }, {
2323
+ default: X(() => [
2324
+ s.value ? (L(), U("div", nr, [
2325
+ le("div", or, ie(G.label), 1),
2326
+ G.labelDescr ? (L(), U("div", rr, ie(G.labelDescr), 1)) : ge("", !0)
2327
+ ])) : ge("", !0)
2328
+ ]),
2329
+ _: 2
2330
+ }, 1032, ["label", "value"]))), 128))
2331
+ ]),
2332
+ _: 1
2333
+ }, 16, ["class", "popper-class", "teleported", "model-value", "placeholder", "disabled", "collapse-tags", "collapse-tags-tooltip", "filterable", "remote", "remote-method"])) : r.value === "date" ? (L(), re(_, he({
2334
+ key: 1,
2335
+ class: "global-info-field-control"
2336
+ }, g.field.props, {
2337
+ "model-value": g.modelValue,
2338
+ placeholder: F.value,
2339
+ disabled: l.value,
2340
+ type: "date",
2341
+ "value-format": "YYYY-MM-DD",
2342
+ "onUpdate:modelValue": I,
2343
+ onChange: C
2344
+ }), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "number" ? (L(), re(V, he({
2345
+ key: 2,
2346
+ class: "global-info-field-control"
2347
+ }, g.field.props, {
2348
+ "model-value": D.value,
2349
+ placeholder: F.value,
2350
+ disabled: l.value,
2351
+ "controls-position": "right",
2352
+ "onUpdate:modelValue": I,
2353
+ onChange: C
2354
+ }), null, 16, ["model-value", "placeholder", "disabled"])) : r.value === "switch" ? (L(), re(K, he({
2355
+ key: 3,
2356
+ class: "global-info-field-control global-info-field-control--switch"
2357
+ }, g.field.props, {
2358
+ "model-value": q.value,
2359
+ disabled: l.value,
2360
+ "onUpdate:modelValue": I,
2361
+ onChange: C
2362
+ }), null, 16, ["model-value", "disabled"])) : r.value === "file" ? (L(), U("div", {
2363
+ key: 4,
2364
+ class: je(["global-info-field-control global-info-field-control--file", {
2365
+ "is-disabled": l.value,
2366
+ "is-empty": !Z.value,
2367
+ "is-filled": Z.value
2368
+ }]),
2369
+ onClick: T
2370
+ }, [
2371
+ le("input", {
2372
+ ref_key: "fileInputRef",
2373
+ ref: i,
2374
+ class: "global-info-field-control__file-input",
2375
+ type: "file",
2376
+ disabled: l.value,
2377
+ accept: String(g.field.props?.accept ?? ""),
2378
+ multiple: !!g.field.props?.multiple,
2379
+ onChange: d
2380
+ }, null, 40, ar),
2381
+ w.value.length ? (L(), U("span", ir, [
2382
+ (L(!0), U(be, null, ve(w.value, (G, Y) => (L(), U(be, {
2383
+ key: G.key
2384
+ }, [
2385
+ le("span", sr, ie(G.text), 1),
2386
+ Y < w.value.length - 1 ? (L(), U("span", lr, "、")) : ge("", !0)
2387
+ ], 64))), 128))
2388
+ ])) : Z.value ? (L(), U("span", cr, ie(j.value), 1)) : (L(), U("span", ur, ie(te(ee)("common.上传")), 1))
2389
+ ], 2)) : r.value === "empty" ? (L(), re(H, {
2390
+ key: 5,
2391
+ class: "global-info-field-control",
2392
+ "model-value": "",
2393
+ disabled: "",
2394
+ placeholder: "-"
2395
+ })) : (L(), re(H, he({
2396
+ key: 6,
2397
+ class: ["global-info-field-control", {
2398
+ "global-info-field-control--textarea": a.includes(r.value),
2399
+ "global-info-field-control--code": r.value === "code"
2400
+ }]
2401
+ }, g.field.props, {
2402
+ "model-value": h.value,
2403
+ placeholder: F.value,
2404
+ disabled: l.value,
2405
+ type: a.includes(r.value) ? "textarea" : "text",
2406
+ rows: a.includes(r.value) ? A.value : void 0,
2407
+ resize: v.value,
2408
+ "onUpdate:modelValue": I,
2409
+ onChange: C
2410
+ }), null, 16, ["class", "model-value", "placeholder", "disabled", "type", "rows", "resize"]));
2411
+ };
2412
+ }
2413
+ }), In = /* @__PURE__ */ Ne(dr, [["__scopeId", "data-v-61dd00ca"]]), fr = ["innerHTML"], mr = {
2414
+ key: 1,
2415
+ class: "global-info-field-value global-info-field-value--code"
2416
+ }, pr = {
2417
+ key: 2,
2418
+ class: "global-info-field-value global-info-field-value--file"
2419
+ }, gr = { key: 0 }, vr = /* @__PURE__ */ Se({
2420
+ name: "GlobalInfoFieldValue",
2421
+ __name: "GlobalInfoFieldValue",
2422
+ props: {
2423
+ field: {},
2424
+ value: {},
2425
+ emptyText: { default: "-" }
2426
+ },
2427
+ setup(e) {
2428
+ const t = e, n = P(() => Mt(t.field)), o = P(() => n.value === "empty" || pe(t.value)), a = P(() => Xt(t.field, t.value, t.emptyText)), i = P(() => tn(t.field, t.value, t.emptyText));
2429
+ return (r, p) => n.value === "html" && !o.value ? (L(), U("span", {
2430
+ key: 0,
2431
+ class: "global-info-field-value global-info-field-value--html",
2432
+ innerHTML: a.value
2433
+ }, null, 8, fr)) : n.value === "code" && !o.value ? (L(), U("pre", mr, ie(a.value), 1)) : i.value.length ? (L(), U("span", pr, [
2434
+ (L(!0), U(be, null, ve(i.value, (s, l) => (L(), U(be, {
2435
+ key: s.key
2436
+ }, [
2437
+ le("span", null, ie(s.text), 1),
2438
+ l < i.value.length - 1 ? (L(), U("span", gr, "、")) : ge("", !0)
2439
+ ], 64))), 128))
2440
+ ])) : (L(), U("span", {
2441
+ key: 3,
2442
+ class: je(["global-info-field-value", {
2443
+ "global-info-field-value--multi-row": n.value === "multi-row",
2444
+ "global-info-field-value--file": n.value === "file" && !o.value
2445
+ }])
2446
+ }, ie(a.value), 3));
2447
+ }
2448
+ }), _n = /* @__PURE__ */ Ne(vr, [["__scopeId", "data-v-49f9d4e5"]]);
2449
+ function hr(e) {
2450
+ const t = Tt(e);
2451
+ return (t === "select" || t === "select_remote") && !!e.interface;
2452
+ }
2453
+ function Be(e, t, n = {}, o = "") {
2454
+ const a = t.code, r = He(t).map((p) => `${p}:${String(n[p] ?? "")}`).join("|");
2455
+ return [e, o, a, r].join("::");
2456
+ }
2457
+ function rt(e, t, n) {
2458
+ return Array.isArray(e.options) && e.options.length > 0 ? t === n ? !0 : !t && He(e).length === 0 : !1;
2459
+ }
2460
+ function $n(e = {}) {
2461
+ return Object.prototype.hasOwnProperty.call(e, "searchText");
2462
+ }
2463
+ function Tn(e, t) {
2464
+ const n = new Set(
2465
+ [t.code].map((o) => String(o ?? "").trim()).filter(Boolean)
2466
+ );
2467
+ return n.size === 0 ? !1 : He(e).some((o) => n.has(o));
2468
+ }
2469
+ function Ct(e, t, n) {
2470
+ return hr(e) ? n ? !0 : (pt(e), !pe(t)) : !1;
2471
+ }
2472
+ function at(e, t) {
2473
+ const n = t[e.code];
2474
+ return pe(n) ? e.value : n;
2475
+ }
2476
+ function Ot(e, t) {
2477
+ return pt(e) ? {
2478
+ searchText: t == null ? "" : String(t)
2479
+ } : {};
2480
+ }
2481
+ async function Mn(e) {
2482
+ const t = [];
2483
+ e.fields.forEach((n) => {
2484
+ const o = at(n, e.model);
2485
+ if (!Ct(n, o, !1)) return;
2486
+ const a = [
2487
+ Be(e.sectionKey, n, e.model, e.rowKey),
2488
+ `value:${String(o ?? "")}`
2489
+ ].join("::"), i = yr(n, e.rowKey), r = e.getCachedPreloadKey(i);
2490
+ if (rt(n, r, a)) {
2491
+ e.setCachedPreloadKey(i, a);
2492
+ return;
2493
+ }
2494
+ r !== a && t.push(
2495
+ Promise.resolve(e.loadFieldOptions(n, Ot(n, o), o)).then(() => {
2496
+ e.setCachedPreloadKey(i, a);
2497
+ })
2498
+ );
2499
+ }), await Promise.allSettled(t);
2500
+ }
2501
+ function yr(e, t = "") {
2502
+ const n = e.code;
2503
+ return t ? `${t}:${n}` : n;
2504
+ }
2505
+ const br = { class: "global-info-form-renderer__grid" }, Sr = { class: "global-info-form-renderer__label" }, wr = {
2506
+ key: 0,
2507
+ class: "global-info-form-renderer__required"
2508
+ }, Ir = /* @__PURE__ */ Se({
2509
+ name: "GlobalInfoFormRenderer",
2510
+ __name: "GlobalInfoFormRenderer",
2511
+ props: {
2512
+ section: {},
2513
+ node: {},
2514
+ editing: { type: Boolean },
2515
+ state: {},
2516
+ actions: {},
2517
+ model: {},
2518
+ onUpdateModel: { type: Function },
2519
+ rowIndex: {},
2520
+ rows: {},
2521
+ renderConfig: {}
2522
+ },
2523
+ setup(e) {
2524
+ const t = e, n = Ae(), o = P(() => t.model ?? t.section.model), a = /* @__PURE__ */ new Map(), i = P(() => ze(
2525
+ t.section.fields,
2526
+ t.section,
2527
+ t.renderConfig,
2528
+ { values: o.value }
2529
+ )), r = Ut(
2530
+ async (w, F, E) => t.actions.loadFieldOptions(t.section, w, F, E),
2531
+ (w) => `${t.section.key}:${q(w)}`
2532
+ );
2533
+ function p(w, F) {
2534
+ const E = { ...o.value, [w.code]: F };
2535
+ (w.cascadeClearFields ?? []).forEach((R) => {
2536
+ E[R] = "";
2537
+ }), t.onUpdateModel?.(E), t.onUpdateModel || t.actions.updateField(t.section, w, F), s(w, F, E), D(E, w);
2538
+ }
2539
+ function s(w, F, E) {
2540
+ const R = t.renderConfig?.onFieldBusinessChange;
2541
+ if (R)
2542
+ try {
2543
+ const I = l(w, F), C = {
2544
+ field: w,
2545
+ value: F,
2546
+ section: t.section,
2547
+ model: E,
2548
+ values: E,
2549
+ row: t.rowIndex === void 0 ? void 0 : E,
2550
+ rowIndex: t.rowIndex,
2551
+ rows: t.rows,
2552
+ node: t.node,
2553
+ activeNode: t.node,
2554
+ sections: u(),
2555
+ sectionValues: h(t.section, E),
2556
+ actions: t.actions,
2557
+ selectedOption: I[0],
2558
+ selectedOptions: I
2559
+ };
2560
+ Promise.resolve(R(C)).catch((W) => {
2561
+ console.error("[GlobalInfoFormRenderer] field business change failed", W);
2562
+ });
2563
+ } catch (I) {
2564
+ console.error("[GlobalInfoFormRenderer] field business change failed", I);
2565
+ }
2566
+ }
2567
+ function l(w, F) {
2568
+ const E = gt(w, F);
2569
+ return (w.options ?? []).filter((R) => E.some((I) => tt(R, I)));
2570
+ }
2571
+ function u() {
2572
+ return Object.values(t.state.sectionMap);
2573
+ }
2574
+ function h(w, F) {
2575
+ const R = u().flatMap((I) => {
2576
+ const C = I.key === w.key ? t.rows ?? F : I.renderType === "table" || I.renderType === "multi-form" ? I.rows : I.model;
2577
+ return [I.key, I.id, I.setId, I.infSetId, I.code].filter(Boolean).map((W) => [String(W), C]);
2578
+ });
2579
+ return Object.fromEntries(R);
2580
+ }
2581
+ async function v(w, F = {}, E = o.value) {
2582
+ const R = E, I = q(w), C = Be(t.section.key, w, R), W = a.get(I);
2583
+ if (!$n(F) && rt(w, W, C)) {
2584
+ a.set(I, C);
2585
+ return;
2586
+ }
2587
+ try {
2588
+ if (F.searchText !== void 0) {
2589
+ await r(w, R, F);
2590
+ return;
2591
+ }
2592
+ await t.actions.loadFieldOptions(t.section, w, R, F), a.set(I, C);
2593
+ } catch (k) {
2594
+ console.error("[GlobalInfoFormRenderer] load field options failed", k);
2595
+ }
2596
+ }
2597
+ async function D(w = o.value, F) {
2598
+ const E = [];
2599
+ for (const R of i.value) {
2600
+ if (F && !Tn(R, F)) continue;
2601
+ const I = at(R, w);
2602
+ if (!A(R, I)) continue;
2603
+ const C = Be(t.section.key, R, w), W = q(R), J = a.get(W);
2604
+ if (rt(R, J, C)) {
2605
+ a.set(W, C);
2606
+ continue;
2607
+ }
2608
+ J !== C && E.push(v(R, Ot(R, I), w));
2609
+ }
2610
+ await Promise.allSettled(E);
2611
+ }
2612
+ qe(
2613
+ () => t.section.key,
2614
+ () => {
2615
+ a.clear();
2616
+ }
2617
+ ), qe(
2618
+ () => $(),
2619
+ () => {
2620
+ Mn({
2621
+ sectionKey: t.section.key,
2622
+ fields: i.value,
2623
+ model: o.value,
2624
+ getCachedPreloadKey: (w) => a.get(w),
2625
+ setCachedPreloadKey: (w, F) => a.set(w, F),
2626
+ loadFieldOptions: async (w, F) => {
2627
+ if (F.searchText !== void 0) {
2628
+ await r(w, o.value, F);
2629
+ return;
2630
+ }
2631
+ await t.actions.loadFieldOptions(t.section, w, o.value, F);
2632
+ }
2633
+ });
2634
+ },
2635
+ { immediate: !0 }
2636
+ );
2637
+ function N(w) {
2638
+ const F = o.value[w.code];
2639
+ return {
2640
+ field: w,
2641
+ section: t.section,
2642
+ sectionView: t.section,
2643
+ node: t.node,
2644
+ editing: t.editing,
2645
+ modelValue: F,
2646
+ value: F,
2647
+ state: t.state,
2648
+ actions: t.actions,
2649
+ updateModelValue: (E) => p(w, E)
2650
+ };
2651
+ }
2652
+ function M(w) {
2653
+ const F = String(w.code || "").trim(), E = F ? `field-${F}` : "";
2654
+ if (E && n[E]) return E;
2655
+ const R = E.toLowerCase();
2656
+ if (R !== E && n[R]) return R;
2657
+ const I = String(w.raw?.type || w.fieldType || w.type || "").trim(), C = I ? `field-type-${I}` : "";
2658
+ if (C && n[C]) return C;
2659
+ const W = C.toLowerCase();
2660
+ return W !== C && n[W] ? W : "";
2661
+ }
2662
+ function $() {
2663
+ return i.value.map((w) => [
2664
+ q(w),
2665
+ String(at(w, o.value) ?? ""),
2666
+ Be(t.section.key, w, o.value)
2667
+ ].join(":")).join("|");
2668
+ }
2669
+ function O(w) {
2670
+ return w.span ? Math.min(Math.max(w.span, 1), 24) : 6;
2671
+ }
2672
+ function q(w) {
2673
+ return w.code;
2674
+ }
2675
+ function A(w, F) {
2676
+ return Ct(w, F, t.editing);
2677
+ }
2678
+ function Z(w) {
2679
+ return wn(
2680
+ w,
2681
+ t.section,
2682
+ t.renderConfig,
2683
+ o.value,
2684
+ {
2685
+ row: t.rowIndex === void 0 ? void 0 : o.value,
2686
+ rowIndex: t.rowIndex,
2687
+ rows: t.rows
2688
+ }
2689
+ );
2690
+ }
2691
+ function j(w) {
2692
+ const F = ut(w, t.rowIndex);
2693
+ return t.actions.getSectionStatus(t.section).fieldErrors?.[F] ?? "";
2694
+ }
2695
+ return (w, F) => {
2696
+ const E = Bn, R = Gn;
2697
+ return L(), re(R, {
2698
+ class: "global-info-form-renderer",
2699
+ model: o.value,
2700
+ "label-position": "top"
2701
+ }, {
2702
+ default: X(() => [
2703
+ le("div", br, [
2704
+ (L(!0), U(be, null, ve(i.value, (I) => (L(), U("div", {
2705
+ key: q(I),
2706
+ class: "global-info-form-renderer__grid-item",
2707
+ style: Dn({ gridColumn: `span ${O(I)}` })
2708
+ }, [
2709
+ Oe(E, he({
2710
+ prop: I.code,
2711
+ error: j(I),
2712
+ ref_for: !0
2713
+ }, I.formItemProps), {
2714
+ label: X(() => [
2715
+ le("span", Sr, [
2716
+ Z(I) ? (L(), U("span", wr, "*")) : ge("", !0),
2717
+ Xe(" " + ie(I.label), 1)
2718
+ ])
2719
+ ]),
2720
+ default: X(() => [
2721
+ M(I) ? ae(w.$slots, M(I), he({
2722
+ key: 0,
2723
+ ref_for: !0
2724
+ }, N(I)), void 0, !0) : w.editing && !I.readonly ? (L(), re(In, {
2725
+ key: 1,
2726
+ field: I,
2727
+ "model-value": o.value[I.code],
2728
+ section: w.section,
2729
+ onLoadOptions: (C) => v(I, C),
2730
+ "onUpdate:modelValue": (C) => p(I, C)
2731
+ }, null, 8, ["field", "model-value", "section", "onLoadOptions", "onUpdate:modelValue"])) : (L(), re(_n, {
2732
+ key: 2,
2733
+ field: I,
2734
+ value: o.value[I.code],
2735
+ section: w.section
2736
+ }, null, 8, ["field", "value", "section"]))
2737
+ ]),
2738
+ _: 2
2739
+ }, 1040, ["prop", "error"])
2740
+ ], 4))), 128))
2741
+ ])
2742
+ ]),
2743
+ _: 3
2744
+ }, 8, ["model"]);
2745
+ };
2746
+ }
2747
+ }), kn = /* @__PURE__ */ Ne(Ir, [["__scopeId", "data-v-2b00ccac"]]), _r = { class: "global-info-multi-form-renderer" }, $r = /* @__PURE__ */ Se({
2748
+ name: "GlobalInfoMultiFormRenderer",
2749
+ __name: "GlobalInfoMultiFormRenderer",
2750
+ props: {
2751
+ section: {},
2752
+ node: {},
2753
+ editing: { type: Boolean },
2754
+ state: {},
2755
+ actions: {},
2756
+ renderConfig: {},
2757
+ resolveRowSection: { type: Function },
2758
+ onUpdateRows: { type: Function }
2759
+ },
2760
+ setup(e) {
2761
+ const t = e, n = Ae();
2762
+ function o(r, p) {
2763
+ const s = t.section.rows.slice();
2764
+ if (s[r] = {
2765
+ ...s[r],
2766
+ ...p
2767
+ }, t.onUpdateRows) {
2768
+ t.onUpdateRows(s, { section: t.section, rowIndex: r, model: p });
2769
+ return;
2770
+ }
2771
+ t.actions.updateTableRows(t.section, s);
2772
+ }
2773
+ function a(r, p) {
2774
+ return t.resolveRowSection?.(t.section, r, p) ?? t.section;
2775
+ }
2776
+ function i(r, p) {
2777
+ return String(r.__rowKey ?? p);
2778
+ }
2779
+ return (r, p) => (L(), U("div", _r, [
2780
+ (L(!0), U(be, null, ve(r.section.rows, (s, l) => (L(), U("div", {
2781
+ key: i(s, l),
2782
+ class: "global-info-multi-form-renderer__item"
2783
+ }, [
2784
+ ae(r.$slots, "itemHeader", {
2785
+ section: a(s, l),
2786
+ sourceSection: r.section,
2787
+ row: s,
2788
+ rowIndex: l,
2789
+ editing: r.editing,
2790
+ state: r.state,
2791
+ actions: r.actions
2792
+ }, void 0, !0),
2793
+ Oe(kn, {
2794
+ section: a(s, l),
2795
+ node: r.node,
2796
+ editing: r.editing,
2797
+ state: r.state,
2798
+ actions: r.actions,
2799
+ model: s,
2800
+ "row-index": l,
2801
+ rows: r.section.rows,
2802
+ "render-config": r.renderConfig,
2803
+ "on-update-model": (u) => o(l, u)
2804
+ }, Re({ _: 2 }, [
2805
+ ve(te(n), (u, h) => ({
2806
+ name: h,
2807
+ fn: X((v) => [
2808
+ ae(r.$slots, h, he({ ref_for: !0 }, v), void 0, !0)
2809
+ ])
2810
+ }))
2811
+ ]), 1032, ["section", "node", "editing", "state", "actions", "model", "row-index", "rows", "render-config", "on-update-model"])
2812
+ ]))), 128))
2813
+ ]));
2814
+ }
2815
+ }), Tr = /* @__PURE__ */ Ne($r, [["__scopeId", "data-v-fd65a86c"]]), Mr = /* @__PURE__ */ Se({
2816
+ name: "GlobalInfoDeleteConfirm",
2817
+ __name: "GlobalInfoDeleteConfirm",
2818
+ props: {
2819
+ title: { default: ee("common.确认删除吗?") },
2820
+ confirmText: { default: ee("common.确认") },
2821
+ cancelText: { default: ee("common.取消") }
2822
+ },
2823
+ emits: ["confirm", "cancel"],
2824
+ setup(e) {
2825
+ return (t, n) => {
2826
+ const o = Pn;
2827
+ return L(), re(o, {
2828
+ title: t.title,
2829
+ "confirm-button-text": t.confirmText,
2830
+ "cancel-button-text": t.cancelText,
2831
+ width: "240",
2832
+ "popper-class": "global-info-delete-confirm",
2833
+ onConfirm: n[0] || (n[0] = (a) => t.$emit("confirm")),
2834
+ onCancel: n[1] || (n[1] = (a) => t.$emit("cancel"))
2835
+ }, {
2836
+ reference: X(() => [
2837
+ ae(t.$slots, "default")
2838
+ ]),
2839
+ _: 3
2840
+ }, 8, ["title", "confirm-button-text", "cancel-button-text"]);
2841
+ };
2842
+ }
2843
+ }), kr = { class: "global-info-table-renderer__table-scroll" }, Cr = { class: "global-info-table-renderer__header" }, Or = {
2844
+ key: 0,
2845
+ class: "global-info-table-renderer__required"
2846
+ }, Fr = {
2847
+ key: 3,
2848
+ class: "global-info-table-renderer__field-error"
2849
+ }, Dr = /* @__PURE__ */ Se({
2850
+ name: "GlobalInfoTableRenderer",
2851
+ __name: "GlobalInfoTableRenderer",
2852
+ props: {
2853
+ section: {},
2854
+ node: {},
2855
+ editing: { type: Boolean },
2856
+ state: {},
2857
+ actions: {},
2858
+ showAdd: { type: Boolean, default: !0 },
2859
+ showDelete: { type: Boolean, default: !0 },
2860
+ renderConfig: {}
2861
+ },
2862
+ setup(e) {
2863
+ const t = e, n = Ae(), o = P(
2864
+ () => t.section.fields.some((c) => Et(c))
2865
+ ), a = P(() => o.value), i = P(
2866
+ () => t.renderConfig?.sequenceLabel ?? ee("common.序号")
2867
+ ), r = P(
2868
+ () => t.renderConfig?.sequenceWidth ?? 56
2869
+ ), p = P(() => {
2870
+ const c = t.renderConfig?.sequenceStart;
2871
+ return typeof c == "number" && Number.isFinite(c) ? c : 1;
2872
+ }), s = P(() => {
2873
+ const c = ze(
2874
+ t.section.fields,
2875
+ t.section,
2876
+ t.renderConfig,
2877
+ { rows: t.section.rows, values: t.section.model }
2878
+ );
2879
+ return a.value ? c.filter((y) => !W(y)) : c;
2880
+ }), l = /* @__PURE__ */ new Map(), u = Ut(
2881
+ async (c, y, _) => t.actions.loadFieldOptions(t.section, c, y, _),
2882
+ (c, y) => `${t.section.key}:${T(y)}:${I(c)}`
2883
+ );
2884
+ function h(c) {
2885
+ t.actions.deleteRow(t.section, c);
2886
+ }
2887
+ function v(c, y) {
2888
+ const _ = t.renderConfig?.rowDeleteVisibleRule;
2889
+ return t.showDelete && (typeof _ == "function" ? _({
2890
+ section: t.section,
2891
+ row: c,
2892
+ rowIndex: y,
2893
+ node: t.node,
2894
+ state: t.state,
2895
+ actions: t.actions
2896
+ }) : c.allowDelete !== !1);
2897
+ }
2898
+ function D(c, y, _, V) {
2899
+ const K = t.section.rows.slice(), H = _.cascadeClearFields ?? [], G = {
2900
+ ...c,
2901
+ __rowKey: T(c),
2902
+ [_.code]: V
2903
+ };
2904
+ H.forEach((Y) => {
2905
+ G[Y] = "";
2906
+ }), K[y] = {
2907
+ ...G
2908
+ }, t.actions.updateTableRows(t.section, K), N(_, V, G, y, K), A(_, G);
2909
+ }
2910
+ function N(c, y, _, V, K) {
2911
+ const H = t.renderConfig?.onFieldBusinessChange;
2912
+ if (H)
2913
+ try {
2914
+ const G = M(c, y), Y = { ...t.section.model, ..._ }, Q = {
2915
+ field: c,
2916
+ value: y,
2917
+ section: t.section,
2918
+ model: Y,
2919
+ values: Y,
2920
+ row: _,
2921
+ rowIndex: V,
2922
+ rows: K,
2923
+ node: t.node,
2924
+ activeNode: t.node,
2925
+ sections: $(),
2926
+ sectionValues: O(t.section, K),
2927
+ actions: t.actions,
2928
+ selectedOption: G[0],
2929
+ selectedOptions: G
2930
+ };
2931
+ Promise.resolve(H(Q)).catch((oe) => {
2932
+ console.error(
2933
+ "[GlobalInfoTableRenderer] field business change failed",
2934
+ oe
2935
+ );
2936
+ });
2937
+ } catch (G) {
2938
+ console.error(
2939
+ "[GlobalInfoTableRenderer] field business change failed",
2940
+ G
2941
+ );
2942
+ }
2943
+ }
2944
+ function M(c, y) {
2945
+ const _ = gt(c, y);
2946
+ return (c.options ?? []).filter(
2947
+ (V) => _.some((K) => tt(V, K))
2948
+ );
2949
+ }
2950
+ function $() {
2951
+ return Object.values(t.state.sectionMap);
2952
+ }
2953
+ function O(c, y) {
2954
+ const V = $().flatMap((K) => {
2955
+ const H = K.key === c.key ? y : K.renderType === "table" ? K.rows : K.model;
2956
+ return [
2957
+ K.key,
2958
+ K.id,
2959
+ K.setId,
2960
+ K.infSetId,
2961
+ K.code
2962
+ ].filter(Boolean).map((G) => [String(G), H]);
2963
+ });
2964
+ return Object.fromEntries(V);
2965
+ }
2966
+ async function q(c, y, _ = {}, V = y) {
2967
+ const K = T(V), H = `${K}:${I(c)}`, G = Be(
2968
+ t.section.key,
2969
+ c,
2970
+ V,
2971
+ K
2972
+ ), Y = l.get(H);
2973
+ if (!$n(_) && rt(c, Y, G)) {
2974
+ l.set(H, G);
2975
+ return;
2976
+ }
2977
+ try {
2978
+ if (_.searchText !== void 0) {
2979
+ await u(c, V, _);
2980
+ return;
2981
+ }
2982
+ await t.actions.loadFieldOptions(
2983
+ t.section,
2984
+ c,
2985
+ V,
2986
+ _
2987
+ ), l.set(H, G);
2988
+ } catch (oe) {
2989
+ console.error("[GlobalInfoTableRenderer] load field options failed", oe);
2990
+ }
2991
+ }
2992
+ async function A(c, y) {
2993
+ const _ = y ? [y] : t.section.rows, V = [];
2994
+ for (const K of _) {
2995
+ const H = T(K);
2996
+ for (const G of s.value) {
2997
+ if (c && !Tn(G, c))
2998
+ continue;
2999
+ const Y = at(G, K);
3000
+ if (!F(G, Y)) continue;
3001
+ const Q = Be(
3002
+ t.section.key,
3003
+ G,
3004
+ K,
3005
+ H
3006
+ ), oe = `${H}:${I(G)}`, fe = l.get(oe);
3007
+ if (rt(G, fe, Q)) {
3008
+ l.set(oe, Q);
3009
+ continue;
3010
+ }
3011
+ fe !== Q && V.push(q(
3012
+ G,
3013
+ K,
3014
+ Ot(G, Y)
3015
+ ));
3016
+ }
3017
+ }
3018
+ await Promise.allSettled(V);
3019
+ }
3020
+ function Z(c, y, _) {
3021
+ const V = y[c.code];
3022
+ return {
3023
+ field: c,
3024
+ section: t.section,
3025
+ sectionView: t.section,
3026
+ node: t.node,
3027
+ row: y,
3028
+ rowIndex: _,
3029
+ editing: t.editing,
3030
+ modelValue: V,
3031
+ value: V,
3032
+ state: t.state,
3033
+ actions: t.actions,
3034
+ updateModelValue: (K) => D(y, _, c, K)
3035
+ };
3036
+ }
3037
+ function j(c) {
3038
+ const y = String(c.code || "").trim(), _ = y ? `field-${y}` : "";
3039
+ if (_ && n[_]) return _;
3040
+ const V = _.toLowerCase();
3041
+ if (V !== _ && n[V]) return V;
3042
+ const K = String(c.raw?.type || c.fieldType || c.type || "").trim(), H = K ? `field-type-${K}` : "";
3043
+ if (H && n[H]) return H;
3044
+ const G = H.toLowerCase();
3045
+ return G !== H && n[G] ? G : "";
3046
+ }
3047
+ function w(c) {
3048
+ return !c.readonly && !c.disabled;
3049
+ }
3050
+ function F(c, y) {
3051
+ return Ct(c, y, t.editing);
3052
+ }
3053
+ function E(c) {
3054
+ return c.width ?? (Lt(c) ? 56 : void 0);
3055
+ }
3056
+ function R(c) {
3057
+ if (!c.width)
3058
+ return c.minWidth ?? (Lt(c) ? 56 : void 0);
3059
+ }
3060
+ function I(c) {
3061
+ return c.code;
3062
+ }
3063
+ function C(c) {
3064
+ return p.value + c;
3065
+ }
3066
+ function W(c) {
3067
+ return Et(c);
3068
+ }
3069
+ let J = 0;
3070
+ const k = /* @__PURE__ */ new WeakMap();
3071
+ function T(c) {
3072
+ const y = c.__rowKey;
3073
+ if (y != null && y !== "")
3074
+ return String(y);
3075
+ const _ = c, V = k.get(_);
3076
+ if (V) return V;
3077
+ J += 1;
3078
+ const K = `local-${J}`;
3079
+ return k.set(_, K), K;
3080
+ }
3081
+ function d(c) {
3082
+ return t.section.rows.some(
3083
+ (y, _) => wn(c, t.section, t.renderConfig, y, {
3084
+ row: y,
3085
+ rowIndex: _,
3086
+ rows: t.section.rows
3087
+ })
3088
+ );
3089
+ }
3090
+ function g(c, y) {
3091
+ const _ = ut(c, y);
3092
+ return t.actions.getSectionStatus(t.section).fieldErrors?.[_] ?? "";
3093
+ }
3094
+ qe(
3095
+ () => t.section.key,
3096
+ () => {
3097
+ l.clear();
3098
+ }
3099
+ ), qe(
3100
+ () => S(),
3101
+ () => {
3102
+ t.section.rows.forEach((c) => {
3103
+ const y = T(c);
3104
+ Mn({
3105
+ sectionKey: t.section.key,
3106
+ fields: s.value,
3107
+ model: c,
3108
+ rowKey: y,
3109
+ getCachedPreloadKey: (_) => l.get(_),
3110
+ setCachedPreloadKey: (_, V) => l.set(_, V),
3111
+ loadFieldOptions: async (_, V) => {
3112
+ if (V.searchText !== void 0) {
3113
+ await u(_, c, V);
3114
+ return;
3115
+ }
3116
+ await t.actions.loadFieldOptions(t.section, _, c, V);
3117
+ }
3118
+ });
3119
+ });
3120
+ },
3121
+ { immediate: !0 }
3122
+ );
3123
+ function S() {
3124
+ return t.section.rows.map((c) => {
3125
+ const y = T(c);
3126
+ return s.value.map((_) => [
3127
+ y,
3128
+ I(_),
3129
+ String(at(_, c) ?? ""),
3130
+ Be(t.section.key, _, c, y)
3131
+ ].join(":")).join("|");
3132
+ }).join("||");
3133
+ }
3134
+ return (c, y) => {
3135
+ const _ = jn, V = Ln("Delete"), K = zn, H = Ht, G = Yn;
3136
+ return L(), U("div", {
3137
+ class: je(["global-info-table-renderer", { "global-info-table-renderer--editing": c.editing }])
3138
+ }, [
3139
+ le("div", kr, [
3140
+ Oe(G, {
3141
+ class: "global-info-table-renderer__table",
3142
+ data: c.section.rows,
3143
+ fit: !0,
3144
+ "table-layout": "auto",
3145
+ "row-key": T
3146
+ }, {
3147
+ default: X(() => [
3148
+ a.value ? (L(), re(_, {
3149
+ key: 0,
3150
+ type: "index",
3151
+ label: i.value,
3152
+ width: r.value,
3153
+ index: C
3154
+ }, null, 8, ["label", "width"])) : ge("", !0),
3155
+ (L(!0), U(be, null, ve(s.value, (Y) => (L(), re(_, {
3156
+ key: I(Y),
3157
+ prop: Y.code,
3158
+ label: Y.label,
3159
+ width: E(Y),
3160
+ "min-width": R(Y)
3161
+ }, {
3162
+ header: X(() => [
3163
+ le("span", Cr, [
3164
+ d(Y) ? (L(), U("span", Or, "*")) : ge("", !0),
3165
+ le("span", null, ie(Y.label), 1)
3166
+ ])
3167
+ ]),
3168
+ default: X(({ row: Q, $index: oe }) => [
3169
+ le("div", {
3170
+ class: je(["global-info-table-renderer__field", { "is-error": !!g(Y, oe) }])
3171
+ }, [
3172
+ j(Y) ? ae(c.$slots, j(Y), he({
3173
+ key: 0,
3174
+ ref_for: !0
3175
+ }, Z(Y, Q, oe)), void 0, !0) : c.editing && w(Y) ? (L(), re(In, {
3176
+ key: 1,
3177
+ field: Y,
3178
+ "model-value": Q[Y.code],
3179
+ section: c.section,
3180
+ row: Q,
3181
+ "row-index": oe,
3182
+ onLoadOptions: (fe) => q(Y, Q, fe),
3183
+ "onUpdate:modelValue": (fe) => D(Q, oe, Y, fe)
3184
+ }, null, 8, ["field", "model-value", "section", "row", "row-index", "onLoadOptions", "onUpdate:modelValue"])) : (L(), re(_n, {
3185
+ key: 2,
3186
+ field: Y,
3187
+ value: Q[Y.code],
3188
+ section: c.section,
3189
+ row: Q,
3190
+ "row-index": oe
3191
+ }, null, 8, ["field", "value", "section", "row", "row-index"])),
3192
+ g(Y, oe) ? (L(), U("div", Fr, ie(g(Y, oe)), 1)) : ge("", !0)
3193
+ ], 2)
3194
+ ]),
3195
+ _: 2
3196
+ }, 1032, ["prop", "label", "width", "min-width"]))), 128)),
3197
+ c.editing ? (L(), re(_, {
3198
+ key: 1,
3199
+ label: te(ee)("common.操作"),
3200
+ width: "104",
3201
+ fixed: "right"
3202
+ }, {
3203
+ default: X(({ row: Y, $index: Q }) => [
3204
+ v(Y, Q) ? (L(), re(Mr, {
3205
+ key: 0,
3206
+ onConfirm: (oe) => h(Q)
3207
+ }, {
3208
+ default: X(() => [
3209
+ Oe(H, {
3210
+ class: "global-info-table-renderer__delete",
3211
+ link: "",
3212
+ type: "danger"
3213
+ }, {
3214
+ default: X(() => [
3215
+ Oe(K, { class: "global-info-table-renderer__delete-icon" }, {
3216
+ default: X(() => [
3217
+ Oe(V)
3218
+ ]),
3219
+ _: 1
3220
+ }),
3221
+ Xe(ie(te(ee)("common.删除")), 1)
3222
+ ]),
3223
+ _: 1
3224
+ })
3225
+ ]),
3226
+ _: 2
3227
+ }, 1032, ["onConfirm"])) : ge("", !0)
3228
+ ]),
3229
+ _: 1
3230
+ }, 8, ["label"])) : ge("", !0)
3231
+ ]),
3232
+ _: 3
3233
+ }, 8, ["data"])
3234
+ ])
3235
+ ], 2);
3236
+ };
3237
+ }
3238
+ }), Lr = /* @__PURE__ */ Ne(Dr, [["__scopeId", "data-v-ddec99d6"]]), Er = /* @__PURE__ */ Se({
3239
+ name: "GlobalInfoAutoRenderer",
3240
+ __name: "GlobalInfoAutoRenderer",
3241
+ props: {
3242
+ section: {},
3243
+ node: {},
3244
+ editing: { type: Boolean },
3245
+ state: {},
3246
+ actions: {},
3247
+ renderConfig: {}
3248
+ },
3249
+ setup(e) {
3250
+ const t = Ae();
3251
+ return (n, o) => n.section.renderType === "table" ? (L(), re(Lr, {
3252
+ key: 0,
3253
+ section: n.section,
3254
+ node: n.node,
3255
+ editing: n.editing,
3256
+ state: n.state,
3257
+ actions: n.actions,
3258
+ "render-config": n.renderConfig
3259
+ }, Re({ _: 2 }, [
3260
+ ve(te(t), (a, i) => ({
3261
+ name: i,
3262
+ fn: X((r) => [
3263
+ ae(n.$slots, i, ke(Ee(r)))
3264
+ ])
3265
+ }))
3266
+ ]), 1032, ["section", "node", "editing", "state", "actions", "render-config"])) : n.section.renderType === "multi-form" ? (L(), re(Tr, {
3267
+ key: 1,
3268
+ section: n.section,
3269
+ node: n.node,
3270
+ editing: n.editing,
3271
+ state: n.state,
3272
+ actions: n.actions,
3273
+ "render-config": n.renderConfig
3274
+ }, Re({ _: 2 }, [
3275
+ ve(te(t), (a, i) => ({
3276
+ name: i,
3277
+ fn: X((r) => [
3278
+ ae(n.$slots, i, ke(Ee(r)))
3279
+ ])
3280
+ }))
3281
+ ]), 1032, ["section", "node", "editing", "state", "actions", "render-config"])) : (L(), re(kn, {
3282
+ key: 2,
3283
+ section: n.section,
3284
+ node: n.node,
3285
+ editing: n.editing,
3286
+ state: n.state,
3287
+ actions: n.actions,
3288
+ "render-config": n.renderConfig
3289
+ }, Re({ _: 2 }, [
3290
+ ve(te(t), (a, i) => ({
3291
+ name: i,
3292
+ fn: X((r) => [
3293
+ ae(n.$slots, i, ke(Ee(r)))
3294
+ ])
3295
+ }))
3296
+ ]), 1032, ["section", "node", "editing", "state", "actions", "render-config"]));
3297
+ }
3298
+ });
3299
+ function Cn(e) {
3300
+ return dt(e.code);
3301
+ }
3302
+ function On(e, t) {
3303
+ const n = Cn(e);
3304
+ return Nr(n, e) ? dt(t?.code) : n || dt(t?.code);
3305
+ }
3306
+ function Ft(e, t, n) {
3307
+ if (!n) return "";
3308
+ const o = `${t}-${n}`;
3309
+ if (e[o]) return o;
3310
+ const a = o.toLowerCase();
3311
+ return a !== o && e[a] ? a : "";
3312
+ }
3313
+ function dt(e) {
3314
+ return typeof e == "string" ? e.trim() : "";
3315
+ }
3316
+ function Nr(e, t) {
3317
+ return !!(e && [t.infSetId, t.setId].map(dt).includes(e));
3318
+ }
3319
+ const Vr = /* @__PURE__ */ Se({
3320
+ name: "GlobalInfoSectionOutlet",
3321
+ __name: "GlobalInfoSectionOutlet",
3322
+ props: {
3323
+ section: {},
3324
+ node: {},
3325
+ editing: { type: Boolean },
3326
+ state: {},
3327
+ actions: {},
3328
+ renderConfig: {}
3329
+ },
3330
+ setup(e) {
3331
+ const t = e, n = Ae(), o = P(() => ze(
3332
+ t.section.fields,
3333
+ t.section,
3334
+ t.renderConfig,
3335
+ {
3336
+ values: t.section.model,
3337
+ rows: t.section.renderType === "table" ? t.section.rows : void 0
3338
+ }
3339
+ )), a = P(() => t.editing ?? t.actions.isEditing(t.section)), i = P(() => t.section.renderType === "table" && t.section.rows.length === 0 || o.value.length === 0), r = P(() => {
3340
+ const u = Ft(
3341
+ n,
3342
+ "section",
3343
+ On(t.node ?? {}, t.section)
3344
+ ), h = s(t.section.renderType);
3345
+ return [
3346
+ u,
3347
+ h,
3348
+ "default"
3349
+ ].find((v) => !!(v && n[v])) ?? "";
3350
+ }), p = P(() => Object.fromEntries(
3351
+ Object.entries(n).filter(([u]) => !l(u))
3352
+ ));
3353
+ function s(u) {
3354
+ return u === "form" || u === "table" ? u : "";
3355
+ }
3356
+ function l(u) {
3357
+ return u === "default" || u === "form" || u === "table" || u.startsWith("section-");
3358
+ }
3359
+ return (u, h) => r.value ? ae(u.$slots, r.value, {
3360
+ key: 0,
3361
+ section: u.section,
3362
+ sectionView: u.section,
3363
+ node: u.node,
3364
+ editing: a.value,
3365
+ isEmpty: i.value,
3366
+ empty: i.value,
3367
+ fields: o.value,
3368
+ renderConfig: u.renderConfig,
3369
+ state: u.state,
3370
+ actions: u.actions
3371
+ }) : (L(), re(Er, {
3372
+ key: 1,
3373
+ section: u.section,
3374
+ node: u.node,
3375
+ editing: a.value,
3376
+ state: u.state,
3377
+ actions: u.actions,
3378
+ "render-config": u.renderConfig
3379
+ }, Re({ _: 2 }, [
3380
+ ve(p.value, (v, D) => ({
3381
+ name: D,
3382
+ fn: X((N) => [
3383
+ ae(u.$slots, D, ke(Ee(N)))
3384
+ ])
3385
+ }))
3386
+ ]), 1032, ["section", "node", "editing", "state", "actions", "render-config"]));
3387
+ }
3388
+ }), Kr = Se({
3389
+ name: "GlobalInfoSlotErrorBoundary",
3390
+ props: {
3391
+ boundaryKey: {
3392
+ type: [String, Number],
3393
+ default: ""
3394
+ },
3395
+ label: {
3396
+ type: String,
3397
+ default: ""
3398
+ }
3399
+ },
3400
+ emits: {
3401
+ error: (e) => !0
3402
+ },
3403
+ setup(e, { emit: t, slots: n }) {
3404
+ const o = Te(!1);
3405
+ qe(
3406
+ () => e.boundaryKey,
3407
+ () => {
3408
+ o.value = !1;
3409
+ }
3410
+ ), En((i) => (a(i), !1));
3411
+ function a(i) {
3412
+ o.value = !0, console.error(`[GlobalInfoSlotErrorBoundary] ${e.label || "section"} slot render failed`, i), t("error", i);
3413
+ }
3414
+ return () => {
3415
+ if (o.value)
3416
+ return n.fallback?.() ?? null;
3417
+ try {
3418
+ return n.default?.() ?? null;
3419
+ } catch (i) {
3420
+ return a(i), n.fallback?.() ?? null;
3421
+ }
3422
+ };
3423
+ }
3424
+ }), Rr = {
3425
+ key: 0,
3426
+ class: "global-info-section-block__header"
3427
+ }, qr = { class: "global-info-section-block__title-wrap" }, Ar = { class: "global-info-section-block__title" }, Gr = {
3428
+ key: 0,
3429
+ class: "global-info-section-block__actions"
3430
+ }, Br = {
3431
+ key: 1,
3432
+ class: "global-info-section-block__loading-placeholder"
3433
+ }, Pr = { class: "global-info-section-block__status" }, Yr = { class: "global-info-section-block__status" }, jr = /* @__PURE__ */ Se({
3434
+ name: "GlobalInfoSectionBlock",
3435
+ __name: "GlobalInfoSectionBlock",
3436
+ props: {
3437
+ node: {},
3438
+ state: {},
3439
+ actions: {},
3440
+ hideHeader: { type: Boolean },
3441
+ loadOnVisible: { type: Boolean },
3442
+ renderConfig: {},
3443
+ onEdit: { type: Function },
3444
+ onCancel: { type: Function },
3445
+ onSave: { type: Function }
3446
+ },
3447
+ setup(e) {
3448
+ const t = e, n = Ae(), o = Te(null), a = Te(!1), i = Te(null), r = Te(null), p = Te(!1);
3449
+ let s = null, l = null;
3450
+ const u = P(() => !!t.hideHeader), h = P(() => t.actions.getSectionStatus(t.node)), v = P(
3451
+ () => t.actions.getSection(t.node) ?? r.value
3452
+ ), D = P(() => {
3453
+ const d = v.value;
3454
+ return d ? ze(
3455
+ d.fields,
3456
+ d,
3457
+ t.renderConfig,
3458
+ {
3459
+ values: d.model,
3460
+ rows: d.renderType === "table" ? d.rows : void 0
3461
+ }
3462
+ ) : [];
3463
+ }), N = P(
3464
+ () => v.value?.title || t.node.tagName || t.node.label || "-"
3465
+ ), M = P(
3466
+ () => !!(v.value && t.actions.isEditing(v.value))
3467
+ ), $ = P(
3468
+ () => v.value?.renderType === "table"
3469
+ ), O = P(
3470
+ () => !!(t.loadOnVisible && !p.value && !v.value)
3471
+ ), q = P(() => a.value || h.value.loading || O.value), A = P(
3472
+ () => w(i.value || h.value.error)
3473
+ ), Z = P(() => {
3474
+ const d = v.value;
3475
+ return d ? d.renderType === "table" && d.rows.length === 0 || D.value.length === 0 : !0;
3476
+ }), j = P(() => ({
3477
+ node: t.node,
3478
+ section: v.value,
3479
+ sectionView: v.value,
3480
+ fields: D.value,
3481
+ renderConfig: t.renderConfig,
3482
+ title: N.value,
3483
+ editing: M.value,
3484
+ loading: q.value,
3485
+ error: i.value || h.value.error,
3486
+ errorMessage: A.value,
3487
+ isEmpty: Z.value,
3488
+ empty: Z.value,
3489
+ sectionStatus: h.value,
3490
+ state: t.state,
3491
+ actions: t.actions,
3492
+ reload: W,
3493
+ handleEdit: F,
3494
+ handleCancel: E,
3495
+ handleAddTableRow: R,
3496
+ handleSave: I
3497
+ }));
3498
+ function w(d) {
3499
+ return d ? d instanceof Error ? d.message : String(d) : "";
3500
+ }
3501
+ async function F() {
3502
+ const d = v.value;
3503
+ d && (await t.onEdit?.(d, t.node), t.onEdit || t.actions.startEdit(d));
3504
+ }
3505
+ async function E() {
3506
+ const d = v.value;
3507
+ d && (await t.onCancel?.(d, t.node), t.onCancel || t.actions.cancelEdit(d));
3508
+ }
3509
+ function R() {
3510
+ const d = v.value;
3511
+ if (!d) return;
3512
+ const g = d.fields.reduce(
3513
+ (S, c) => (S[c.code] = c.value ?? "", S),
3514
+ { __rowKey: `new-${Date.now()}` }
3515
+ );
3516
+ t.actions.saveRow(d, g, -1);
3517
+ }
3518
+ async function I() {
3519
+ const d = v.value;
3520
+ if (d)
3521
+ try {
3522
+ if (t.onSave) {
3523
+ await t.onSave(d, t.node);
3524
+ return;
3525
+ }
3526
+ await t.actions.saveSection(d);
3527
+ } catch (g) {
3528
+ i.value = g, console.error("[GlobalInfoSectionBlock] save section failed", g);
3529
+ }
3530
+ }
3531
+ function C(d) {
3532
+ i.value = d;
3533
+ }
3534
+ async function W() {
3535
+ p.value = !0, k(), a.value = !0, i.value = null, r.value = null;
3536
+ try {
3537
+ r.value = await t.actions.loadSection(t.node);
3538
+ } catch (d) {
3539
+ i.value = d, console.error("[GlobalInfoSectionBlock] load section failed", d);
3540
+ } finally {
3541
+ a.value = !1;
3542
+ }
3543
+ }
3544
+ function J() {
3545
+ if (k(), !t.loadOnVisible) {
3546
+ W();
3547
+ return;
3548
+ }
3549
+ const d = o.value;
3550
+ if (!d || typeof IntersectionObserver > "u") {
3551
+ W();
3552
+ return;
3553
+ }
3554
+ if (T(d)) {
3555
+ W();
3556
+ return;
3557
+ }
3558
+ s = new IntersectionObserver((g) => {
3559
+ g.some((S) => S.isIntersecting) && W();
3560
+ }, {
3561
+ root: null,
3562
+ rootMargin: "0px 0px 160px 0px",
3563
+ threshold: 0
3564
+ }), s.observe(d), l = setTimeout(() => {
3565
+ W();
3566
+ }, 120);
3567
+ }
3568
+ function k() {
3569
+ s?.disconnect(), s = null, l && (clearTimeout(l), l = null);
3570
+ }
3571
+ function T(d) {
3572
+ const g = d.getBoundingClientRect(), S = window.innerHeight || document.documentElement.clientHeight;
3573
+ return g.top <= S + 160 && g.bottom >= -160;
3574
+ }
3575
+ return jt(() => {
3576
+ J();
3577
+ }), zt(() => {
3578
+ k();
3579
+ }), qe(
3580
+ () => t.node.key,
3581
+ () => {
3582
+ p.value = !1, J();
3583
+ }
3584
+ ), qe(
3585
+ () => t.loadOnVisible,
3586
+ () => {
3587
+ p.value || J();
3588
+ }
3589
+ ), (d, g) => {
3590
+ const S = Ht, c = Hn;
3591
+ return L(), U("section", {
3592
+ ref_key: "sectionRef",
3593
+ ref: o,
3594
+ class: "global-info-section-block"
3595
+ }, [
3596
+ u.value ? ge("", !0) : (L(), U("header", Rr, [
3597
+ ae(d.$slots, "header", ke(Ee(j.value)), () => [
3598
+ le("div", qr, [
3599
+ g[0] || (g[0] = le("span", { class: "global-info-section-block__marker" }, null, -1)),
3600
+ le("h3", Ar, ie(N.value), 1)
3601
+ ]),
3602
+ ae(d.$slots, "actions", ke(Ee(j.value)), () => [
3603
+ v.value ? (L(), U("div", Gr, [
3604
+ M.value ? (L(), U(be, { key: 1 }, [
3605
+ Oe(S, {
3606
+ class: "global-info-section-block__cancel",
3607
+ disabled: h.value.saving,
3608
+ onClick: E
3609
+ }, {
3610
+ default: X(() => [
3611
+ Xe(ie(te(ee)("common.取消")), 1)
3612
+ ]),
3613
+ _: 1
3614
+ }, 8, ["disabled"]),
3615
+ $.value ? (L(), re(S, {
3616
+ key: 0,
3617
+ class: "global-info-section-block__add",
3618
+ disabled: h.value.saving,
3619
+ onClick: R
3620
+ }, {
3621
+ default: X(() => [
3622
+ Xe(ie(te(ee)("common.新增")), 1)
3623
+ ]),
3624
+ _: 1
3625
+ }, 8, ["disabled"])) : ge("", !0),
3626
+ Oe(S, {
3627
+ class: "global-info-section-block__confirm",
3628
+ loading: h.value.saving,
3629
+ onClick: I
3630
+ }, {
3631
+ default: X(() => [
3632
+ Xe(ie($.value ? te(ee)("common.确认") : te(ee)("common.保存")), 1)
3633
+ ]),
3634
+ _: 1
3635
+ }, 8, ["loading"])
3636
+ ], 64)) : (L(), re(S, {
3637
+ key: 0,
3638
+ class: "global-info-section-block__edit",
3639
+ disabled: h.value.saving || q.value,
3640
+ onClick: F
3641
+ }, {
3642
+ default: X(() => [
3643
+ g[1] || (g[1] = le("svg", {
3644
+ class: "global-info-section-block__edit-icon",
3645
+ viewBox: "0 0 12 12",
3646
+ "aria-hidden": "true",
3647
+ focusable: "false"
3648
+ }, [
3649
+ le("path", {
3650
+ d: "M0.437665 12C0.316763 11.9845 0.205604 11.9251 0.125029 11.8329C0.0444551 11.7407 0 11.622 0 11.499C0 11.3761 0.0444551 11.2574 0.125029 11.1652C0.205604 11.0729 0.316763 11.0135 0.437665 10.998H11.5623C11.6832 11.0135 11.7944 11.0729 11.875 11.1652C11.9555 11.2574 12 11.3761 12 11.499C12 11.622 11.9555 11.7407 11.875 11.8329C11.7944 11.9251 11.6832 11.9845 11.5623 12H0.437665ZM9.59963 0.233088L10.72 1.36329C10.868 1.51347 10.9511 1.71663 10.9511 1.92839C10.9511 2.14015 10.868 2.34331 10.72 2.49349L3.61614 9.6354C3.54189 9.70969 3.45384 9.76846 3.35702 9.80835C3.26021 9.84824 3.15654 9.86846 3.05196 9.86785H1.57397C1.4686 9.86785 1.36754 9.82562 1.29303 9.75046C1.21852 9.6753 1.17666 9.57336 1.17666 9.46707V7.93609C1.17606 7.8306 1.1961 7.72602 1.23564 7.62836C1.27519 7.5307 1.33345 7.44188 1.4071 7.36698L8.47921 0.233088C8.62809 0.0837965 8.82949 0 9.03942 0C9.24935 0 9.45074 0.0837965 9.59963 0.233088ZM2.16993 8.01624V8.8659H3.01223L9.88569 1.9324L9.04339 1.07473L2.16993 8.01624Z",
3651
+ fill: "currentColor"
3652
+ })
3653
+ ], -1)),
3654
+ le("span", null, ie(te(ee)("common.编辑")), 1)
3655
+ ]),
3656
+ _: 1
3657
+ }, 8, ["disabled"]))
3658
+ ])) : ge("", !0)
3659
+ ], !0)
3660
+ ], !0)
3661
+ ])),
3662
+ Oe(c, {
3663
+ class: "global-info-section-block__body",
3664
+ loading: q.value,
3665
+ animated: ""
3666
+ }, {
3667
+ template: X(() => [
3668
+ d.$slots.loading ? ae(d.$slots, "loading", ke(he({ key: 0 }, j.value)), void 0, !0) : (L(), U("div", Br))
3669
+ ]),
3670
+ default: X(() => [
3671
+ !v.value || Z.value ? ae(d.$slots, "empty", ke(he({ key: 0 }, j.value)), () => [
3672
+ le("div", Pr, ie(te(ee)("common.暂无数据")), 1)
3673
+ ], !0) : (L(), re(Kr, {
3674
+ key: 1,
3675
+ "boundary-key": d.node.key,
3676
+ label: N.value,
3677
+ onError: C
3678
+ }, {
3679
+ fallback: X(() => [
3680
+ ae(d.$slots, "empty", ke(Ee(j.value)), () => [
3681
+ le("div", Yr, ie(te(ee)("common.暂无数据")), 1)
3682
+ ], !0)
3683
+ ]),
3684
+ default: X(() => [
3685
+ Oe(Vr, {
3686
+ section: v.value,
3687
+ node: d.node,
3688
+ editing: M.value,
3689
+ state: d.state,
3690
+ actions: d.actions,
3691
+ "render-config": d.renderConfig
3692
+ }, Re({ _: 2 }, [
3693
+ ve(te(n), (y, _) => ({
3694
+ name: _,
3695
+ fn: X((V) => [
3696
+ ae(d.$slots, _, ke(Ee({ ...j.value, ...V })), void 0, !0)
3697
+ ])
3698
+ }))
3699
+ ]), 1032, ["section", "node", "editing", "state", "actions", "render-config"])
3700
+ ]),
3701
+ _: 3
3702
+ }, 8, ["boundary-key", "label"]))
3703
+ ]),
3704
+ _: 3
3705
+ }, 8, ["loading"])
3706
+ ], 512);
3707
+ };
3708
+ }
3709
+ }), zr = /* @__PURE__ */ Ne(jr, [["__scopeId", "data-v-2a3bc405"]]), Hr = { class: "global-info-group" }, Ur = { class: "global-info-group__header" }, Zr = { class: "global-info-group__title" }, Wr = { class: "global-info-group__body" }, xr = ["id"], Jr = { class: "global-info-group__empty" }, Qr = /* @__PURE__ */ Se({
3710
+ name: "GlobalInfoGroup",
3711
+ __name: "GlobalInfoGroup",
3712
+ props: {
3713
+ group: {},
3714
+ children: {},
3715
+ state: {},
3716
+ actions: {},
3717
+ index: {},
3718
+ loadOnVisible: { type: Boolean },
3719
+ renderConfig: {}
3720
+ },
3721
+ setup(e) {
3722
+ const t = e, n = Ae(), o = P(
3723
+ () => t.group.tagName || t.group.label || "-"
3724
+ ), a = P(() => t.children.length <= 1);
3725
+ function i(l, u) {
3726
+ const h = t.actions.getSection(l);
3727
+ return {
3728
+ node: l,
3729
+ group: t.group,
3730
+ sectionNode: l,
3731
+ section: h,
3732
+ sectionView: h,
3733
+ state: t.state,
3734
+ actions: t.actions,
3735
+ renderConfig: t.renderConfig,
3736
+ index: u,
3737
+ editing: !!(h && t.actions.isEditing(h)),
3738
+ sectionStatus: t.actions.getSectionStatus(l),
3739
+ isSelfSection: p(l, 0) === p(t.group, 0),
3740
+ handleEdit: () => t.actions.startEdit(l),
3741
+ handleCancel: () => t.actions.cancelEdit(l),
3742
+ handleSave: () => t.actions.saveSection(l.key)
3743
+ };
3744
+ }
3745
+ function r(l) {
3746
+ const u = t.actions.getSection(l);
3747
+ return Ft(
3748
+ n,
3749
+ "section",
3750
+ On(l, u)
3751
+ );
3752
+ }
3753
+ function p(l, u) {
3754
+ return l.key || l.id || l.infSetId || l.tagId || `${u}`;
3755
+ }
3756
+ function s(l) {
3757
+ return `global-info-section-${p(l, 0)}`;
3758
+ }
3759
+ return (l, u) => (L(), U("section", Hr, [
3760
+ ae(l.$slots, "header", {
3761
+ group: l.group,
3762
+ children: l.children,
3763
+ state: l.state,
3764
+ actions: l.actions,
3765
+ renderConfig: l.renderConfig,
3766
+ title: o.value,
3767
+ index: l.index,
3768
+ isEmpty: l.children.length === 0
3769
+ }, () => [
3770
+ le("header", Ur, [
3771
+ u[0] || (u[0] = le("span", { class: "global-info-group__marker" }, null, -1)),
3772
+ le("h2", Zr, ie(o.value), 1)
3773
+ ])
3774
+ ], !0),
3775
+ le("div", Wr, [
3776
+ te(n).default ? ae(l.$slots, "default", {
3777
+ key: 0,
3778
+ group: l.group,
3779
+ children: l.children,
3780
+ state: l.state,
3781
+ actions: l.actions,
3782
+ renderConfig: l.renderConfig,
3783
+ index: l.index,
3784
+ isEmpty: l.children.length === 0
3785
+ }, void 0, !0) : (L(), U(be, { key: 1 }, [
3786
+ (L(!0), U(be, null, ve(l.children, (h, v) => (L(), U("div", {
3787
+ id: s(h),
3788
+ key: p(h, v),
3789
+ class: "global-info-group__section"
3790
+ }, [
3791
+ r(h) ? ae(l.$slots, r(h), he({
3792
+ key: 0,
3793
+ ref_for: !0
3794
+ }, i(h, v)), void 0, !0) : te(n).section ? ae(l.$slots, "section", he({
3795
+ key: 1,
3796
+ ref_for: !0
3797
+ }, i(h, v)), void 0, !0) : (L(), re(zr, {
3798
+ key: 2,
3799
+ node: h,
3800
+ state: l.state,
3801
+ actions: l.actions,
3802
+ "hide-header": a.value,
3803
+ "load-on-visible": l.loadOnVisible,
3804
+ "render-config": l.renderConfig
3805
+ }, Re({ _: 2 }, [
3806
+ ve(te(n), (D, N) => ({
3807
+ name: N,
3808
+ fn: X((M) => [
3809
+ ae(l.$slots, N, he({ ref_for: !0 }, M), void 0, !0)
3810
+ ])
3811
+ }))
3812
+ ]), 1032, ["node", "state", "actions", "hide-header", "load-on-visible", "render-config"]))
3813
+ ], 8, xr))), 128)),
3814
+ l.children.length === 0 ? ae(l.$slots, "empty", {
3815
+ key: 0,
3816
+ node: null,
3817
+ group: l.group,
3818
+ sectionNode: null,
3819
+ state: l.state,
3820
+ actions: l.actions,
3821
+ index: -1,
3822
+ renderConfig: l.renderConfig
3823
+ }, () => [
3824
+ le("div", Jr, ie(te(ee)("common.暂无数据")), 1)
3825
+ ], !0) : ge("", !0)
3826
+ ], 64))
3827
+ ])
3828
+ ]));
3829
+ }
3830
+ }), Xr = /* @__PURE__ */ Ne(Qr, [["__scopeId", "data-v-08c94b28"]]), ea = { class: "global-info-sections" }, ta = /* @__PURE__ */ Se({
3831
+ name: "GlobalInfoSections",
3832
+ __name: "GlobalInfoSections",
3833
+ props: {
3834
+ nodes: {},
3835
+ state: {},
3836
+ actions: {},
3837
+ loadOnVisible: { type: Boolean },
3838
+ renderConfig: {}
3839
+ },
3840
+ setup(e) {
3841
+ const t = e, n = Ae(), o = P(() => {
3842
+ const u = t.nodes.filter(
3843
+ (O) => a(O).length > 0
3844
+ ), h = t.nodes.filter((O) => a(O).length === 0), v = h.filter((O) => i(O)), D = h.filter((O) => !i(O)), N = u.map((O) => ({
3845
+ group: O,
3846
+ children: a(O)
3847
+ })), M = v.map((O) => ({
3848
+ group: O,
3849
+ children: [O]
3850
+ }));
3851
+ if (N.length === 0)
3852
+ return v.length > 0 ? M : l(D);
3853
+ const $ = l(D);
3854
+ return [...N, ...M, ...$];
3855
+ });
3856
+ function a(u) {
3857
+ return u.children ?? [];
3858
+ }
3859
+ function i(u) {
3860
+ return !String(u.parentId || u.parentTagId || "").trim();
3861
+ }
3862
+ function r(u) {
3863
+ return Ft(n, "group", Cn(u));
3864
+ }
3865
+ function p(u, h) {
3866
+ return u.key || u.id || u.tagId || `${h}`;
3867
+ }
3868
+ function s(u) {
3869
+ const h = u[0], v = h?.raw ?? {}, D = String(
3870
+ v.parentTagName || v.parentName || v.parentLabel || h?.parentId || ee("common.信息")
3871
+ );
3872
+ return {
3873
+ ...h,
3874
+ key: `${h?.parentId || h?.parentTagId || h?.key || "global-info"}-group`,
3875
+ id: String(
3876
+ h?.parentId || h?.parentTagId || h?.id || "global-info-group"
3877
+ ),
3878
+ tagId: String(
3879
+ h?.parentTagId || h?.parentId || h?.tagId || "global-info-group"
3880
+ ),
3881
+ tagName: D,
3882
+ label: D,
3883
+ children: u
3884
+ };
3885
+ }
3886
+ function l(u) {
3887
+ const h = /* @__PURE__ */ new Map();
3888
+ return u.forEach((v) => {
3889
+ const D = String(
3890
+ v.parentId || v.parentTagId || "global-info-flat"
3891
+ ), N = h.get(D) ?? [];
3892
+ N.push(v), h.set(D, N);
3893
+ }), Array.from(h.values()).map((v) => ({
3894
+ group: s(v),
3895
+ children: v
3896
+ }));
3897
+ }
3898
+ return (u, h) => (L(), U("div", ea, [
3899
+ (L(!0), U(be, null, ve(o.value, (v, D) => (L(), U(be, {
3900
+ key: p(v.group, D)
3901
+ }, [
3902
+ r(v.group) ? ae(u.$slots, r(v.group), {
3903
+ key: 0,
3904
+ group: v.group,
3905
+ children: v.children,
3906
+ state: u.state,
3907
+ actions: u.actions,
3908
+ renderConfig: u.renderConfig,
3909
+ index: D,
3910
+ isEmpty: v.children.length === 0
3911
+ }, void 0, !0) : te(n).group ? ae(u.$slots, "group", {
3912
+ key: 1,
3913
+ group: v.group,
3914
+ children: v.children,
3915
+ state: u.state,
3916
+ actions: u.actions,
3917
+ renderConfig: u.renderConfig,
3918
+ index: D,
3919
+ isEmpty: v.children.length === 0
3920
+ }, void 0, !0) : (L(), re(Xr, {
3921
+ key: 2,
3922
+ group: v.group,
3923
+ children: v.children,
3924
+ state: u.state,
3925
+ actions: u.actions,
3926
+ "render-config": u.renderConfig,
3927
+ "load-on-visible": u.loadOnVisible,
3928
+ index: D
3929
+ }, Re({ _: 2 }, [
3930
+ ve(te(n), (N, M) => ({
3931
+ name: M,
3932
+ fn: X(($) => [
3933
+ ae(u.$slots, M, he({ ref_for: !0 }, $), void 0, !0)
3934
+ ])
3935
+ }))
3936
+ ]), 1032, ["group", "children", "state", "actions", "render-config", "load-on-visible", "index"]))
3937
+ ], 64))), 128))
3938
+ ]));
3939
+ }
3940
+ }), pa = /* @__PURE__ */ Ne(ta, [["__scopeId", "data-v-3952a5a0"]]), na = ["disabled", "onClick"], oa = {
3941
+ key: 0,
3942
+ class: "global-info-left-nav__time"
3943
+ }, ra = {
3944
+ key: 1,
3945
+ class: "global-info-left-nav__icon"
3946
+ }, aa = { class: "global-info-left-nav__label" }, ia = {
3947
+ key: 2,
3948
+ class: "global-info-left-nav__tag"
3949
+ }, sa = /* @__PURE__ */ Se({
3950
+ name: "GlobalInfoLeftNav",
3951
+ __name: "GlobalInfoLeftNav",
3952
+ props: {
3953
+ items: {},
3954
+ activeKey: { default: "" },
3955
+ mode: { default: "anchor" },
3956
+ itemMeta: {}
3957
+ },
3958
+ emits: ["update:activeKey", "select"],
3959
+ setup(e, { emit: t }) {
3960
+ const n = e, o = t;
3961
+ function a(s, l) {
3962
+ const u = i(s, l);
3963
+ if (u.disabled) return;
3964
+ const h = r(s, l);
3965
+ o("update:activeKey", h), o("select", s, h), n.mode === "anchor" && document.getElementById(u.targetId || h)?.scrollIntoView({
3966
+ behavior: "smooth",
3967
+ block: "start"
3968
+ });
3969
+ }
3970
+ function i(s, l) {
3971
+ const u = n.itemMeta?.(s, l) ?? {};
3972
+ return {
3973
+ ...u,
3974
+ label: u.label || p(s, l),
3975
+ disabled: u.disabled ?? !1
3976
+ };
3977
+ }
3978
+ function r(s, l) {
3979
+ const u = n.itemMeta?.(s, l)?.key;
3980
+ return String(
3981
+ u || s.key || s.id || ("setId" in s ? s.setId : s.tagId) || l
3982
+ );
3983
+ }
3984
+ function p(s, l) {
3985
+ return String(
3986
+ ("title" in s ? s.title : s.label || s.tagName) || s.code || l + 1
3987
+ );
3988
+ }
3989
+ return (s, l) => (L(), U("nav", {
3990
+ class: je(["global-info-left-nav", `global-info-left-nav--${s.mode}`])
3991
+ }, [
3992
+ (L(!0), U(be, null, ve(s.items, (u, h) => (L(), U("button", {
3993
+ key: r(u, h),
3994
+ class: je(["global-info-left-nav__item", {
3995
+ "is-active": r(u, h) === s.activeKey,
3996
+ "is-disabled": i(u, h).disabled
3997
+ }]),
3998
+ type: "button",
3999
+ disabled: i(u, h).disabled,
4000
+ onClick: (v) => a(u, h)
4001
+ }, [
4002
+ i(u, h).time ? (L(), U("span", oa, ie(i(u, h).time), 1)) : ge("", !0),
4003
+ i(u, h).icon ? (L(), U("span", ra, ie(i(u, h).icon), 1)) : ge("", !0),
4004
+ le("span", aa, ie(i(u, h).label), 1),
4005
+ i(u, h).tag ? (L(), U("span", ia, ie(i(u, h).tag), 1)) : ge("", !0)
4006
+ ], 10, na))), 128))
4007
+ ], 2));
4008
+ }
4009
+ }), ga = /* @__PURE__ */ Ne(sa, [["__scopeId", "data-v-61379e78"]]);
4010
+ export {
4011
+ Sn as DEFAULT_GLOBAL_INFO_REQUIRED_INFO_SET_EMPTY_MESSAGE,
4012
+ Er as GlobalInfoAutoRenderer,
4013
+ Mr as GlobalInfoDeleteConfirm,
4014
+ In as GlobalInfoFieldControl,
4015
+ _n as GlobalInfoFieldValue,
4016
+ kn as GlobalInfoFormRenderer,
4017
+ Xr as GlobalInfoGroup,
4018
+ ga as GlobalInfoLeftNav,
4019
+ Tr as GlobalInfoMultiFormRenderer,
4020
+ ma as GlobalInfoProvider,
4021
+ zr as GlobalInfoSectionBlock,
4022
+ Vr as GlobalInfoSectionOutlet,
4023
+ pa as GlobalInfoSections,
4024
+ Lr as GlobalInfoTableRenderer,
4025
+ _o as buildGlobalInfoUpdatePayload,
4026
+ So as createEmptyGlobalInfoViewModel,
4027
+ ut as getGlobalInfoFieldErrorKey,
4028
+ wn as isGlobalInfoFieldRequired,
4029
+ fa as isGlobalInfoNode,
4030
+ sn as mergeGlobalInfoChildren,
4031
+ wo as normalizeGlobalInfoDetail,
4032
+ kt as normalizeGlobalInfoOptions,
4033
+ At as normalizeGlobalInfoTree,
4034
+ It as resolveGlobalInfoFieldRequiredMessage,
4035
+ Io as resolveGlobalInfoRenderType,
4036
+ tr as useGlobalInfoController,
4037
+ Qo as validateGlobalInfoRequiredFields,
4038
+ xo as validateGlobalInfoRequiredInfoSet
4039
+ };