@ximatai/muyun-web-app 0.26.26 → 0.26.28

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 (69) hide show
  1. package/dist/{BusinessActivityLogView-BPnAoGim.js → BusinessActivityLogView-DlNB97pu.js} +2 -2
  2. package/dist/{BusinessLogListDrawer-CXabZOOM.js → BusinessLogListDrawer-ByiwQP1m.js} +163 -163
  3. package/dist/CodeConfigurationView-91B9dHjD.js +2333 -0
  4. package/dist/{ConfigurationTranslationView-BsWyLeRd.js → ConfigurationTranslationView-ClovkYJt.js} +22 -22
  5. package/dist/{LoginAuditLogView-D3TJdzWM.js → LoginAuditLogView-Blg9giRX.js} +2 -2
  6. package/dist/{ModuleActionManagementView-C9LiwMM3.js → ModuleActionManagementView-Chr_XTJ3.js} +193 -193
  7. package/dist/{ModuleGovernanceView-CYZzHLHa.js → ModuleGovernanceView-BNlRHqSj.js} +4054 -4072
  8. package/dist/{RequestErrorLogView-D85h_q4P.js → RequestErrorLogView-CGczIKQy.js} +2 -2
  9. package/dist/{RoleDetailWorkspaceView-VHvh-_Sj.js → RoleDetailWorkspaceView-CPH9cga9.js} +75 -75
  10. package/dist/{RuntimeLogView-D-MrVfT7.js → RuntimeLogView-DF-1k-9y.js} +60 -60
  11. package/dist/WorkflowAdministrationView-CCXry0G4.js +650 -0
  12. package/dist/WorkflowConfigurationView-BqSfYua2.js +2227 -0
  13. package/dist/{WorkflowWorkbenchView-BN3ckTHB.js → WorkflowWorkbenchView-DUFfO3Gf.js} +248 -248
  14. package/dist/{codeConfiguration-B5OjCYZ6.js → codeConfiguration-BRxveKen.js} +71 -54
  15. package/dist/configurationEditorNavigation-DeXvfJyr.js +15 -0
  16. package/dist/formulaReferences-CKkkdA_R.js +23 -0
  17. package/dist/index.css +1 -1
  18. package/dist/index.js +1239 -1131
  19. package/dist/{moduleMenuWorkspace-DhI4_LpA.js → moduleMenuWorkspace-D_A94ZgR.js} +218 -229
  20. package/dist/{platform-components-Ca8SikTY.js → platform-components-DSMqalgQ.js} +4660 -4538
  21. package/dist/{platform-workbench-DpXhb4F6.js → platform-workbench-B53hydzq.js} +6055 -5909
  22. package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +2 -0
  23. package/dist/types/dynamic-page-runtime/ModulePageHost.vue.d.ts +2 -0
  24. package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +37 -3
  25. package/dist/types/dynamic-page-runtime/ModulePageHostSession.vue.d.ts +2 -0
  26. package/dist/types/dynamic-page-runtime/ModuleReferenceRecordDetailBrowser.vue.d.ts +16 -4
  27. package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +2 -0
  28. package/dist/types/dynamic-page-runtime/recordFormAssistantCapabilities.d.ts +4 -2
  29. package/dist/types/dynamic-page-runtime/recordFormDraftAccess.d.ts +2 -0
  30. package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +1 -0
  31. package/dist/types/platform-admin-runtime/realtime.d.ts +3 -1
  32. package/dist/types/platform-components/BusinessNotificationPanel.vue.d.ts +2 -0
  33. package/dist/types/platform-components/ReferenceRecordDetailBrowser.vue.d.ts +11 -1
  34. package/dist/types/platform-components/index.d.ts +2 -2
  35. package/dist/types/platform-components/optionFieldOptionCache.d.ts +11 -1
  36. package/dist/types/platform-components/recordFormFieldModel.d.ts +1 -0
  37. package/dist/types/platform-components/referenceRecordDetailBrowser.d.ts +17 -2
  38. package/dist/types/platform-components/useWorkflowDesignSession.d.ts +141 -0
  39. package/dist/types/platform-components/workflowDesignEditing.d.ts +8 -7
  40. package/dist/types/platform-components/workflowDesignOperations.d.ts +107 -0
  41. package/dist/types/views/CodeRuleRecoveryPanel.vue.d.ts +20 -0
  42. package/dist/types/views/businessRuleGovernance.d.ts +1 -2
  43. package/dist/types/views/codeConfiguration.d.ts +29 -1
  44. package/dist/types/views/codeConfigurationAssistantSurface.d.ts +17 -0
  45. package/dist/types/views/codeRuleSaveRecovery.d.ts +12 -0
  46. package/dist/types/views/useCodeConfigurationAssistant.d.ts +10 -0
  47. package/dist/types/views/useCodeConfigurationSession.d.ts +16 -0
  48. package/dist/types/views/useWorkflowConfigurationAssistant.d.ts +16 -0
  49. package/dist/types/views/useWorkflowConfigurationContext.d.ts +16 -2
  50. package/dist/types/views/useWorkflowConfigurationSession.d.ts +146 -0
  51. package/dist/types/views/workflowConfigurationAssistantSurface.d.ts +169 -0
  52. package/dist/types/views/workflowSaveRecovery.d.ts +11 -0
  53. package/dist/types/vue-ui-antdv/components/sidePanelHost.d.ts +3 -1
  54. package/dist/types/vue-ui-antdv/index.d.ts +1 -0
  55. package/dist/types/web-contracts/operation.d.ts +7 -0
  56. package/dist/types/web-core/assistantConfirmation.d.ts +4 -4
  57. package/dist/types/web-core/assistantSurface.d.ts +2 -2
  58. package/dist/types/web-core/businessNotificationSession.d.ts +27 -0
  59. package/dist/types/web-core/formulaReferences.d.ts +2 -0
  60. package/dist/types/web-core/index.d.ts +1 -0
  61. package/dist/types/web-core/operationConfirmation.d.ts +13 -8
  62. package/dist/types/web-core/workflow.d.ts +11 -1
  63. package/dist/useWorkflowConfigurationContext-BuBDdUcQ.js +78 -0
  64. package/dist/{workspaceViews-CLOyLZMZ.js → workspaceViews-BSVtjZj1.js} +689 -689
  65. package/package.json +1 -1
  66. package/dist/CodeConfigurationView-B1Lgdnkj.js +0 -1667
  67. package/dist/WorkflowAdministrationView-DHPlIJXF.js +0 -650
  68. package/dist/WorkflowConfigurationView-BhQl7NjM.js +0 -980
  69. package/dist/useWorkflowConfigurationContext-DpzBpKa3.js +0 -66
@@ -0,0 +1,2333 @@
1
+ import { n as e } from "./rolldown-runtime-BAC7EHh5.js";
2
+ import { ft as t, m as n, y as r } from "./platform-workbench-B53hydzq.js";
3
+ import { Aa as i, An as a, Ca as o, En as s, G as c, Gn as l, Gt as u, Ia as d, In as ee, Kt as te, Na as ne, Qr as re, Rn as ie, Rr as ae, Sa as oe, Sn as se, Ur as ce, Va as le, Wa as ue, Xn as f, Zi as p, _r as m, ao as de, at as fe, ba as h, br as g, ci as pe, dr as _, hr as me, ia as v, in as he, jn as ge, la as _e, lo as ve, mr as y, no as ye, nr as b, ot as be, pa as xe, qt as Se, r as Ce, rn as we, ti as Te, tr as Ee, ua as De, v as Oe, vr as x, yt as ke, zn as Ae } from "./platform-components-DSMqalgQ.js";
4
+ import { a as je, c as Me, d as Ne, f as Pe, g as Fe, i as Ie, l as Le, m as S, n as Re, o as ze, p as Be, r as Ve, s as He, t as Ue, u as We } from "./codeConfiguration-BRxveKen.js";
5
+ import { t as Ge } from "./configurationEditorNavigation-DeXvfJyr.js";
6
+ import { Fragment as Ke, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createSlots as qe, createTextVNode as O, createVNode as k, defineComponent as Je, inject as Ye, isRef as Xe, mergeModels as Ze, nextTick as Qe, normalizeClass as $e, onActivated as et, onBeforeUnmount as tt, onDeactivated as nt, onMounted as A, onUnmounted as j, openBlock as M, ref as N, renderList as rt, toDisplayString as P, toRaw as it, unref as F, useModel as at, vShow as ot, watch as st, withCtx as I, withDirectives as ct } from "vue";
7
+ //#region src/views/codeRuleSaveRecovery.ts
8
+ function lt(e, t) {
9
+ let n = `muyun.code-rule-save.${e}`, r = () => {
10
+ let e = t.getItem(n);
11
+ if (!e) return;
12
+ let r = JSON.parse(e);
13
+ if (!r || Object.keys(r).some((e) => ![
14
+ "requestId",
15
+ "moduleAlias",
16
+ "entityAlias",
17
+ "fieldName",
18
+ "ruleId"
19
+ ].includes(e)) || typeof r.requestId != "string" || !/^[a-zA-Z0-9-]{16,80}$/.test(r.requestId) || [
20
+ r.moduleAlias,
21
+ r.entityAlias,
22
+ r.fieldName
23
+ ].some((e) => typeof e != "string" || !e || e.length > 128) || r.ruleId !== void 0 && (typeof r.ruleId != "string" || r.ruleId.length > 64)) throw Error("原编号保存查询引用无效");
24
+ return r;
25
+ };
26
+ return {
27
+ restore: r,
28
+ save(e) {
29
+ if (r()) throw Error("请先核实原编号保存结果");
30
+ t.setItem(n, JSON.stringify(e));
31
+ },
32
+ clear(e) {
33
+ r()?.requestId === e && t.removeItem(n);
34
+ }
35
+ };
36
+ }
37
+ //#endregion
38
+ //#region src/views/useCodeConfigurationSession.ts
39
+ function ut(e) {
40
+ let t = N(), n = N(""), r = N(!0), i = N(!1);
41
+ et(() => {
42
+ r.value = !0;
43
+ }), nt(() => {
44
+ r.value = !1;
45
+ }), tt(() => {
46
+ r.value = !1;
47
+ });
48
+ let a = C(() => !!t.value && JSON.stringify(t.value) !== n.value);
49
+ function o(e) {
50
+ t.value = e ? JSON.parse(JSON.stringify(e)) : void 0, n.value = t.value ? JSON.stringify(t.value) : "";
51
+ }
52
+ function s(n, o, s) {
53
+ if (!t.value) throw new v("请先打开编号规则");
54
+ let c = JSON.stringify(t.value), l = JSON.parse(c), u = [
55
+ "title",
56
+ "mode",
57
+ "linkedUpdate",
58
+ "allowRecycle",
59
+ "segments",
60
+ "sequencePolicy"
61
+ ];
62
+ if (!Object.keys(n).length || Object.keys(n).some((e) => !u.includes(e))) throw new v("只能调整规则名称、编号方式、格式与流水策略");
63
+ if ("title" in n && (typeof n.title != "string" || n.title.length > 200)) throw new v("规则名称无效");
64
+ if ("mode" in n && (typeof n.mode != "string" || ![
65
+ "AUTO",
66
+ "MANUAL",
67
+ "AUTO_WITH_MANUAL_EDIT"
68
+ ].includes(n.mode))) throw new v("编号方式无效");
69
+ for (let e of ["linkedUpdate", "allowRecycle"]) if (e in n && typeof n[e] != "boolean") throw new v("策略必须为布尔值");
70
+ function d(e, t) {
71
+ if (!e || typeof e != "object" || Array.isArray(e) || Object.keys(e).some((e) => !t.includes(e))) throw new v("格式只能包含声明的配置字段,不能覆盖持久标识");
72
+ return e;
73
+ }
74
+ if ("segments" in n) {
75
+ if (!Array.isArray(n.segments) || n.segments.length > 40) throw new v("编号片段最多40项");
76
+ for (let e of n.segments) {
77
+ let t = d(e, [
78
+ "segmentType",
79
+ "sourceRef",
80
+ "fixedValue",
81
+ "formulaExpr",
82
+ "dateFormat",
83
+ "length",
84
+ "padMode",
85
+ "padChar",
86
+ "separator",
87
+ "sequenceBasis",
88
+ "nullPolicy",
89
+ "truncatePolicy",
90
+ "sortOrder",
91
+ "mappings"
92
+ ]);
93
+ if (typeof t.segmentType != "string" || ![
94
+ "CONSTANT",
95
+ "FIELD_VALUE",
96
+ "CONTEXT_VAR",
97
+ "SYSTEM_TIME",
98
+ "SEQUENCE",
99
+ "VALUE_MAPPING",
100
+ "FORMULA"
101
+ ].includes(t.segmentType)) throw new v("编号片段类型无效");
102
+ if (!Array.isArray(t.mappings) || t.mappings.length > 100) throw new v("片段映射无效");
103
+ for (let e of t.mappings) {
104
+ let t = d(e, [
105
+ "sourceValue",
106
+ "targetValue",
107
+ "defaultMapping",
108
+ "enabled"
109
+ ]);
110
+ if (typeof t.sourceValue != "string" || typeof t.targetValue != "string" || typeof t.defaultMapping != "boolean" || typeof t.enabled != "boolean") throw new v("映射值无效");
111
+ }
112
+ for (let e of [
113
+ "sourceRef",
114
+ "fixedValue",
115
+ "formulaExpr",
116
+ "dateFormat",
117
+ "padMode",
118
+ "padChar",
119
+ "separator",
120
+ "nullPolicy",
121
+ "truncatePolicy"
122
+ ]) if (t[e] != null && typeof t[e] != "string") throw new v("片段文本无效");
123
+ if (t.sequenceBasis != null && typeof t.sequenceBasis != "boolean") throw new v("计数依据无效");
124
+ }
125
+ }
126
+ if (n.sequencePolicy != null) {
127
+ let e = d(n.sequencePolicy, [
128
+ "startValue",
129
+ "stepValue",
130
+ "sequenceLength",
131
+ "maxValue",
132
+ "resetPolicy",
133
+ "overflowPolicy"
134
+ ]);
135
+ if (typeof e.resetPolicy != "string" || typeof e.overflowPolicy != "string" || ![
136
+ "NONE",
137
+ "DAY",
138
+ "MONTH",
139
+ "YEAR"
140
+ ].includes(e.resetPolicy) || !["ERROR", "RESET"].includes(e.overflowPolicy)) throw new v("流水周期或溢出策略无效");
141
+ }
142
+ let ee = new Set(o.sources.map((e) => e.fieldName));
143
+ if (l.segments.some((e) => !Re(e, ee)) && ("segments" in n || "mode" in n && n.mode !== l.mode)) throw new v("当前格式含目录之外来源,请人工维护格式和编号方式");
144
+ if (Object.assign(l, n), S(l, e), "segments" in n && l.segments.some((e) => !Re(e, ee))) throw new v("片段只能引用当前可见来源字段");
145
+ return () => {
146
+ if (!s() || !r.value || i.value || JSON.stringify(t.value) !== c) throw new v("编码草稿已变化,请重新读取");
147
+ return t.value = l, {
148
+ changedFields: Object.keys(n),
149
+ unsaved: a.value,
150
+ saved: !1
151
+ };
152
+ };
153
+ }
154
+ return {
155
+ draft: t,
156
+ original: n,
157
+ active: r,
158
+ dirty: a,
159
+ recoveryRequired: i,
160
+ reset: o,
161
+ prepare: s
162
+ };
163
+ }
164
+ //#endregion
165
+ //#region src/views/codeConfigurationAssistantSurface.ts
166
+ function dt(e, t) {
167
+ let n = () => {
168
+ let t = e.state();
169
+ if (!t.ready || !t.draft || !t.target) throw new v("请先打开已授权的编号规则");
170
+ return {
171
+ ...t,
172
+ draft: t.draft,
173
+ target: t.target
174
+ };
175
+ }, r = {
176
+ effect: "read",
177
+ descriptor: {
178
+ code: "code-rule.describe-draft",
179
+ description: "读取当前人工编辑器的编号规则、字段声明和可见来源。未保存草稿不会影响发号。预览不预留号码。",
180
+ inputSchema: _e()
181
+ },
182
+ parseInput: De,
183
+ async execute() {
184
+ let e = n(), t = new Set(e.target.sources.map((e) => e.fieldName)), r = {
185
+ ...e.draft,
186
+ segments: e.draft.segments.map((e) => Re(e, t) ? e : {
187
+ segmentType: e.segmentType,
188
+ restricted: !0,
189
+ message: "此片段含当前目录之外的来源,请人工维护;修改其他配置时保留。"
190
+ })
191
+ }, i = JSON.stringify({
192
+ rule: r,
193
+ target: e.target,
194
+ unsaved: e.dirty,
195
+ recoveryRequired: e.recoveryRequired
196
+ });
197
+ return i.length > 16e3 ? {
198
+ truncated: !0,
199
+ message: "规则较大,请在页面检查完整配置;不能据此推断规则或来源不存在。",
200
+ title: e.draft.title,
201
+ unsaved: e.dirty
202
+ } : JSON.parse(i);
203
+ }
204
+ }, i = {
205
+ effect: "configuration-draft",
206
+ descriptor: {
207
+ code: "code-rule.revise-draft",
208
+ description: "调整当前共享编号草稿。仅名称、编号方式、换号/回收策略及格式与流水策略;不改变字段声明、目标、启停、组织或生效区间。格式片段和流水策略替换时须提供完整候选,不携带ID或版本。完成后人工审阅保存。",
209
+ inputSchema: {
210
+ type: "object",
211
+ additionalProperties: !1,
212
+ properties: {
213
+ title: { type: "string" },
214
+ mode: {
215
+ type: "string",
216
+ enum: [
217
+ "AUTO",
218
+ "MANUAL",
219
+ "AUTO_WITH_MANUAL_EDIT"
220
+ ]
221
+ },
222
+ linkedUpdate: { type: "boolean" },
223
+ allowRecycle: { type: "boolean" },
224
+ segments: {
225
+ type: "array",
226
+ maxItems: 40,
227
+ items: {
228
+ type: "object",
229
+ additionalProperties: !1,
230
+ required: ["segmentType", "mappings"],
231
+ properties: {
232
+ segmentType: {
233
+ type: "string",
234
+ enum: [
235
+ "CONSTANT",
236
+ "FIELD_VALUE",
237
+ "CONTEXT_VAR",
238
+ "SYSTEM_TIME",
239
+ "SEQUENCE",
240
+ "VALUE_MAPPING",
241
+ "FORMULA"
242
+ ]
243
+ },
244
+ ...Object.fromEntries([
245
+ "sourceRef",
246
+ "fixedValue",
247
+ "formulaExpr",
248
+ "dateFormat",
249
+ "padMode",
250
+ "padChar",
251
+ "separator",
252
+ "nullPolicy",
253
+ "truncatePolicy"
254
+ ].map((e) => [e, { type: ["string", "null"] }])),
255
+ length: { type: ["integer", "null"] },
256
+ sortOrder: { type: "integer" },
257
+ sequenceBasis: { type: "boolean" },
258
+ mappings: {
259
+ type: "array",
260
+ maxItems: 100,
261
+ items: {
262
+ type: "object",
263
+ additionalProperties: !1,
264
+ required: [
265
+ "sourceValue",
266
+ "targetValue",
267
+ "defaultMapping",
268
+ "enabled"
269
+ ],
270
+ properties: {
271
+ sourceValue: { type: "string" },
272
+ targetValue: { type: "string" },
273
+ defaultMapping: { type: "boolean" },
274
+ enabled: { type: "boolean" }
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }
280
+ },
281
+ sequencePolicy: {
282
+ type: ["object", "null"],
283
+ additionalProperties: !1,
284
+ properties: {
285
+ ...Object.fromEntries([
286
+ "startValue",
287
+ "stepValue",
288
+ "sequenceLength",
289
+ "maxValue"
290
+ ].map((e) => [e, { type: ["integer", "null"] }])),
291
+ resetPolicy: {
292
+ type: "string",
293
+ enum: [
294
+ "NONE",
295
+ "DAY",
296
+ "MONTH",
297
+ "YEAR"
298
+ ]
299
+ },
300
+ overflowPolicy: {
301
+ type: "string",
302
+ enum: ["ERROR", "RESET"]
303
+ }
304
+ }
305
+ }
306
+ }
307
+ }
308
+ },
309
+ parseInput(e) {
310
+ if (!e || typeof e != "object" || Array.isArray(e) || JSON.stringify(e).length > 16e3) throw new v("编号草稿参数无效");
311
+ return e;
312
+ },
313
+ async execute(t, r) {
314
+ if (!n().editable) throw new v("当前编号规则不可编辑");
315
+ try {
316
+ return r.applyEffect(e.prepare(t, r.isCurrent));
317
+ } catch (e) {
318
+ throw e instanceof v ? e : new v("编号候选格式不完整,请核对后重新准备");
319
+ }
320
+ },
321
+ present() {
322
+ return {
323
+ title: "编号规则草稿已调整",
324
+ lines: ["请在页面核对编号格式、流水与换号回收策略,再由人工保存。尚未改变正式发号规则。"]
325
+ };
326
+ }
327
+ }, a = {
328
+ effect: "read",
329
+ descriptor: {
330
+ code: "code-rule.preview-draft",
331
+ description: "使用页面当前明确填写的样例与流水值调用后端同源试算;不分配流水、不占用号码。缺少样例时请用户在试算区补充。",
332
+ inputSchema: _e()
333
+ },
334
+ parseInput: De,
335
+ async execute(t, r) {
336
+ let i = n();
337
+ if (i.busy || i.recoveryRequired || i.previewable === !1) throw new v("请先完成当前操作或恢复核对");
338
+ let a = new Set(i.target.sources.map((e) => e.fieldName));
339
+ if (i.draft.segments.some((e) => !Re(e, a))) throw new v("当前规则含目录之外来源,请在页面人工试算");
340
+ return {
341
+ ...await e.trial(r.signal, r.isCurrent),
342
+ reserved: !1,
343
+ saved: !1
344
+ };
345
+ }
346
+ };
347
+ return {
348
+ requestTurn: t,
349
+ describe: () => {
350
+ let t = e.state();
351
+ return {
352
+ surface: "code-configuration",
353
+ facts: {
354
+ ready: t.ready,
355
+ editable: t.editable,
356
+ unsaved: t.dirty,
357
+ recoveryRequired: t.recoveryRequired,
358
+ delivery: "人工和助手共享编号草稿;人工审阅保存,试算不占号。"
359
+ }
360
+ };
361
+ },
362
+ capabilities: () => {
363
+ let t = e.state();
364
+ return t.ready ? [r, ...!t.busy && !t.recoveryRequired ? [...t.previewable === !1 ? [] : [a], ...t.editable ? [i] : []] : []] : [];
365
+ }
366
+ };
367
+ }
368
+ //#endregion
369
+ //#region src/views/useCodeConfigurationAssistant.ts
370
+ function ft(e) {
371
+ let t = xe(), n = N(!1), r = N(!1), i = N(!1), a = N(!1), o = 0, s, c;
372
+ function l() {
373
+ o++, n.value = r.value = i.value = a.value = !1, s?.(), s = void 0;
374
+ }
375
+ async function u() {
376
+ if (l(), !t || !e.active()) return;
377
+ let s = o, c = e.scope();
378
+ a.value = !0;
379
+ try {
380
+ let t = await re({
381
+ http: e.scopedHttp(),
382
+ moduleAlias: "platform.code_rule",
383
+ runtimeAccess: "VIEW"
384
+ }).runtime.ready;
385
+ if (s !== o || c !== e.scope() || !e.active()) return;
386
+ let a = (e) => t.actions.some((t) => t.actionCode === e && t.authorized === !0);
387
+ r.value = a("configurationQuery") && a("viewTree"), i.value = r.value && a("saveTree"), n.value = r.value && a("preview");
388
+ } catch {} finally {
389
+ s === o && (a.value = !1, d());
390
+ }
391
+ }
392
+ function d() {
393
+ if (!t || s || !e.active() || (c ??= t.activePageInstanceKey(), !c)) return;
394
+ let o = {
395
+ ...e.adapter,
396
+ state: () => {
397
+ let t = e.adapter.state();
398
+ return {
399
+ ...t,
400
+ ready: t.ready && r.value,
401
+ previewable: n.value,
402
+ editable: t.editable && i.value,
403
+ busy: t.busy || a.value
404
+ };
405
+ }
406
+ };
407
+ s = t.registry.register({
408
+ pageInstanceKey: c,
409
+ executionScopeKey: e.scope,
410
+ contextRevision: () => JSON.stringify([
411
+ e.revision(),
412
+ r.value,
413
+ i.value,
414
+ n.value,
415
+ a.value
416
+ ]),
417
+ interactionRevision: e.revision,
418
+ settle: (e) => Ge(() => !o.state().busy, e),
419
+ surface: dt(o, p(e.http))
420
+ });
421
+ }
422
+ st(e.scope, () => {
423
+ l(), e.active() && u();
424
+ }, { flush: "sync" }), A(() => {
425
+ u();
426
+ }), et(() => {
427
+ u();
428
+ }), nt(l), tt(l);
429
+ }
430
+ //#endregion
431
+ //#region src/views/CodeRuleFormatEditor.vue?vue&type=script&setup=true&lang.ts
432
+ var pt = { class: "code-format" }, mt = {
433
+ class: "code-format__segments",
434
+ role: "list"
435
+ }, L = { class: "code-format__segment-heading" }, R = { class: "code-format__segment-number" }, ht = { class: "code-format__segment-actions" }, z = {
436
+ key: 0,
437
+ class: "code-format__grid"
438
+ }, gt = {
439
+ key: 0,
440
+ class: "code-format__field"
441
+ }, B = {
442
+ key: 1,
443
+ class: "code-format__field"
444
+ }, V = {
445
+ key: 2,
446
+ class: "code-format__field"
447
+ }, _t = {
448
+ key: 3,
449
+ class: "code-format__field"
450
+ }, vt = {
451
+ key: 4,
452
+ class: "code-format__field code-format__wide"
453
+ }, H = {
454
+ key: 5,
455
+ class: "code-format__field"
456
+ }, yt = { class: "code-format__advanced" }, U = { key: 0 }, bt = { class: "code-format__grid" }, xt = {
457
+ key: 0,
458
+ class: "code-format__help code-format__wide"
459
+ }, St = {
460
+ key: 1,
461
+ class: "code-format__field"
462
+ }, W = {
463
+ key: 2,
464
+ class: "code-format__field"
465
+ }, Ct = {
466
+ key: 3,
467
+ class: "code-format__field"
468
+ }, wt = {
469
+ key: 4,
470
+ class: "code-format__field"
471
+ }, Tt = { class: "code-format__field" }, G = {
472
+ key: 5,
473
+ class: "code-format__field"
474
+ }, Et = {
475
+ key: 6,
476
+ class: "code-format__field"
477
+ }, Dt = {
478
+ key: 0,
479
+ class: "code-format__help"
480
+ }, Ot = {
481
+ key: 1,
482
+ class: "code-format__mapping"
483
+ }, K = {
484
+ key: 0,
485
+ class: "code-format__grid"
486
+ }, kt = { class: "code-format__field" }, At = { class: "code-format__field" }, jt = { class: "code-format__sequence-advanced code-format__wide" }, Mt = { class: "code-format__grid" }, q = { class: "code-format__field" }, J = { class: "code-format__field" }, Nt = { class: "code-format__field" }, Pt = {
487
+ key: 0,
488
+ class: "code-format__help"
489
+ }, Ft = { class: "code-format__field" }, It = /*#__PURE__*/ g(/* @__PURE__ */ Je({
490
+ __name: "CodeRuleFormatEditor",
491
+ props: /*@__PURE__*/ Ze({
492
+ sources: {},
493
+ editable: { type: Boolean },
494
+ trigger: {}
495
+ }, {
496
+ rule: { required: !0 },
497
+ ruleModifiers: {}
498
+ }),
499
+ emits: ["update:rule"],
500
+ setup(e) {
501
+ let t = e, n = at(e, "rule"), r = de(), i = (e, t) => r.t(`platform.code.config.${e}`, t), a = C(() => t.sources.map((e) => ({
502
+ value: e.fieldName,
503
+ label: Ie(e, r)
504
+ }))), o = C(() => t.sources.map((e) => ({
505
+ name: e.fieldName,
506
+ label: Ie(e, r),
507
+ valueType: e.type
508
+ }))), s = {
509
+ CONSTANT: "固定文字",
510
+ FIELD_VALUE: "业务字段",
511
+ CONTEXT_VAR: "动作上下文",
512
+ SYSTEM_TIME: "业务时间",
513
+ SEQUENCE: "流水号",
514
+ VALUE_MAPPING: "值映射",
515
+ FORMULA: "公式"
516
+ }, c = C(() => Ve.map((e) => ({
517
+ value: e,
518
+ label: i(`segment.${e}`, s[e])
519
+ }))), l = (e, t) => Object.entries(t).map(([t, n]) => ({
520
+ value: t,
521
+ label: i(`enum.${e}.${t}`, n)
522
+ })), u = [
523
+ "YY",
524
+ "YYYY",
525
+ "YYMM",
526
+ "YYYYMM",
527
+ "YYMMDD",
528
+ "YYYYMMDD",
529
+ "YYYY_MM",
530
+ "YYYY_MM_DD",
531
+ "YYYY_MM_DD_HH_MM_SS",
532
+ "HHMMSS"
533
+ ], d = /* @__PURE__ */ new WeakMap(), ee = 0, te = /* @__PURE__ */ new WeakMap(), ne = null;
534
+ st(() => n.value, () => {
535
+ ne = null;
536
+ });
537
+ function re(e) {
538
+ return e = it(e), d.has(e) || d.set(e, ++ee), d.get(e);
539
+ }
540
+ function ie(e) {
541
+ return [
542
+ "FIELD_VALUE",
543
+ "CONTEXT_VAR",
544
+ "VALUE_MAPPING",
545
+ "FORMULA"
546
+ ].includes(e.segmentType);
547
+ }
548
+ function ae(e) {
549
+ return !!n.value.sequencePolicy && !["CONSTANT", "SEQUENCE"].includes(e.segmentType);
550
+ }
551
+ let oe = C(() => r.t("platform.code.config.inherited-sequence-length", "继承流水长度:{length}", { length: n.value.sequencePolicy?.sequenceLength ?? "—" })), se = C(() => {
552
+ let e = n.value.sequencePolicy?.sequenceLength;
553
+ return e == null || !Number.isInteger(e) || e < 1 || e > 18 ? "" : r.t("platform.code.config.sequence-limit-hint", "按 {length} 位流水,最大 {maximum}", {
554
+ length: e,
555
+ maximum: "9".repeat(e)
556
+ });
557
+ });
558
+ function ce(e) {
559
+ return e.length != null || !!e.separator || (e.padMode ?? "NONE") !== "NONE" || (e.truncatePolicy ?? "NONE") !== "NONE" || (e.nullPolicy ?? "ERROR") !== "ERROR" || !!e.sequenceBasis;
560
+ }
561
+ function le(e) {
562
+ return e.segmentType === "SEQUENCE" && e.length != null ? r.t("platform.code.config.sequence-length-override-summary", "长度覆盖 {length} 位", { length: e.length }) : i("configured", "已配置");
563
+ }
564
+ let ue = C(() => {
565
+ let e = n.value.sequencePolicy;
566
+ if (!e) return "";
567
+ let t = [
568
+ e.startValue != null && e.startValue !== 1 ? `${i("start", "起始值")} ${e.startValue}` : "",
569
+ e.stepValue != null && e.stepValue !== 1 ? `${i("step", "递增步长")} ${e.stepValue}` : "",
570
+ e.maxValue == null ? "" : `${i("maximum", "流水上限")} ${e.maxValue}`,
571
+ e.overflowPolicy === "RESET" ? i("enum.overflow.RESET", "从起点重新尝试") : ""
572
+ ].filter(Boolean);
573
+ return t.length ? t.join(" · ") : i("defaults", "默认设置");
574
+ });
575
+ function f(e) {
576
+ return e === "" || e == null ? null : Number(e);
577
+ }
578
+ function p() {
579
+ n.value && (n.value.segments.some((e) => e.segmentType === "SEQUENCE") ? n.value.sequencePolicy ??= ne ?? Ne() : (ne = n.value.sequencePolicy ?? ne, n.value.sequencePolicy = null));
580
+ }
581
+ function m(e, t) {
582
+ if (!n.value) return;
583
+ let r = n.value.segments[e];
584
+ if (r.segmentType === t) return;
585
+ let i = te.get(it(r)) ?? /* @__PURE__ */ new Map();
586
+ i.set(r.segmentType, JSON.parse(JSON.stringify(r)));
587
+ let a = {
588
+ ...i.get(t) ?? We(t),
589
+ id: r.id,
590
+ version: r.version
591
+ };
592
+ d.set(a, re(r)), te.set(a, i), n.value.segments[e] = a, p();
593
+ }
594
+ function fe() {
595
+ n.value && (n.value.segments.push(We()), p());
596
+ }
597
+ function h(e, t) {
598
+ let r = n.value?.segments;
599
+ if (!r || e + t < 0 || e + t >= r.length) return;
600
+ let [i] = r.splice(e, 1);
601
+ i && r.splice(e + t, 0, i);
602
+ }
603
+ function g(e) {
604
+ n.value?.segments.splice(e, 1), p();
605
+ }
606
+ return (r, s) => (M(), E("section", pt, [
607
+ k(F(Se), { title: i("format", "编码格式") }, null, 8, ["title"]),
608
+ D("ol", mt, [(M(!0), E(Ke, null, rt(n.value.segments, (r, d) => (M(), E("li", { key: re(r) }, [
609
+ D("div", L, [
610
+ D("span", R, P(d + 1), 1),
611
+ k(F(y), {
612
+ "aria-label": i("segment-type", "片段类型"),
613
+ value: r.segmentType,
614
+ disabled: !e.editable,
615
+ options: c.value,
616
+ "onUpdate:value": (e) => m(d, e)
617
+ }, null, 8, [
618
+ "aria-label",
619
+ "value",
620
+ "disabled",
621
+ "options",
622
+ "onUpdate:value"
623
+ ]),
624
+ ["FORMULA", "CONTEXT_VAR"].includes(r.segmentType) ? (M(), w(F(Ee), {
625
+ key: 0,
626
+ label: i("bounded-help-title", "片段长度说明")
627
+ }, {
628
+ default: I(() => [O(P(i("bounded-help", "为公式或外部上下文设置长度与截取方式,确保编码不超出目标字段长度。")), 1)]),
629
+ _: 1
630
+ }, 8, ["label"])) : T("v-if", !0),
631
+ D("div", ht, [
632
+ k(F(x), {
633
+ type: "text",
634
+ "icon-name": "up",
635
+ "icon-only": "",
636
+ size: "small",
637
+ title: i("up", "上移"),
638
+ "aria-label": i("up", "上移"),
639
+ disabled: !e.editable || d === 0,
640
+ onClick: (e) => h(d, -1)
641
+ }, null, 8, [
642
+ "title",
643
+ "aria-label",
644
+ "disabled",
645
+ "onClick"
646
+ ]),
647
+ k(F(x), {
648
+ type: "text",
649
+ "icon-name": "down",
650
+ "icon-only": "",
651
+ size: "small",
652
+ title: i("down", "下移"),
653
+ "aria-label": i("down", "下移"),
654
+ disabled: !e.editable || d === n.value.segments.length - 1,
655
+ onClick: (e) => h(d, 1)
656
+ }, null, 8, [
657
+ "title",
658
+ "aria-label",
659
+ "disabled",
660
+ "onClick"
661
+ ]),
662
+ k(F(x), {
663
+ type: "text",
664
+ "icon-name": "delete",
665
+ "icon-only": "",
666
+ size: "small",
667
+ title: i("remove", "删除"),
668
+ "aria-label": i("remove", "删除"),
669
+ disabled: !e.editable,
670
+ onClick: (e) => g(d)
671
+ }, null, 8, [
672
+ "title",
673
+ "aria-label",
674
+ "disabled",
675
+ "onClick"
676
+ ])
677
+ ])
678
+ ]),
679
+ r.segmentType === "SEQUENCE" ? T("v-if", !0) : (M(), E("div", z, [
680
+ r.segmentType === "CONSTANT" ? (M(), E("label", gt, [O(P(i("constant", "固定文字")), 1), k(F(_), {
681
+ value: r.fixedValue,
682
+ "onUpdate:value": (e) => r.fixedValue = e,
683
+ disabled: !e.editable
684
+ }, null, 8, [
685
+ "value",
686
+ "onUpdate:value",
687
+ "disabled"
688
+ ])])) : T("v-if", !0),
689
+ ["FIELD_VALUE", "VALUE_MAPPING"].includes(r.segmentType) ? (M(), E("label", B, [O(P(i("source", "来源字段")), 1), k(F(y), {
690
+ value: r.sourceRef,
691
+ "onUpdate:value": (e) => r.sourceRef = e,
692
+ disabled: !e.editable,
693
+ options: a.value
694
+ }, null, 8, [
695
+ "value",
696
+ "onUpdate:value",
697
+ "disabled",
698
+ "options"
699
+ ])])) : T("v-if", !0),
700
+ r.segmentType === "CONTEXT_VAR" ? (M(), E("label", V, [O(P(i("context", "动作传入的上下文名称")), 1), (t.trigger ?? n.value.fieldTrigger ?? "SAVE") === "EXPLICIT" ? (M(), w(F(_), {
701
+ key: 1,
702
+ value: r.sourceRef,
703
+ "onUpdate:value": (e) => r.sourceRef = e,
704
+ disabled: !e.editable
705
+ }, null, 8, [
706
+ "value",
707
+ "onUpdate:value",
708
+ "disabled"
709
+ ])) : (M(), w(F(y), {
710
+ key: 0,
711
+ value: r.sourceRef,
712
+ "onUpdate:value": (e) => r.sourceRef = e,
713
+ disabled: !e.editable,
714
+ options: a.value
715
+ }, null, 8, [
716
+ "value",
717
+ "onUpdate:value",
718
+ "disabled",
719
+ "options"
720
+ ]))])) : T("v-if", !0),
721
+ r.segmentType === "SYSTEM_TIME" ? (M(), E("label", _t, [O(P(i("date-format", "时间格式")), 1), k(F(y), {
722
+ value: r.dateFormat,
723
+ "onUpdate:value": (e) => r.dateFormat = e,
724
+ disabled: !e.editable,
725
+ options: u.map((e) => ({
726
+ value: e,
727
+ label: e
728
+ }))
729
+ }, null, 8, [
730
+ "value",
731
+ "onUpdate:value",
732
+ "disabled",
733
+ "options"
734
+ ])])) : T("v-if", !0),
735
+ r.segmentType === "FORMULA" ? (M(), E("label", vt, [O(P(i("formula", "返回编码片段的公式")), 1), k(F(ge), {
736
+ value: r.formulaExpr ?? "",
737
+ "onUpdate:value": (e) => r.formulaExpr = e,
738
+ disabled: !e.editable,
739
+ fields: o.value
740
+ }, null, 8, [
741
+ "value",
742
+ "onUpdate:value",
743
+ "disabled",
744
+ "fields"
745
+ ])])) : T("v-if", !0),
746
+ ["FORMULA", "CONTEXT_VAR"].includes(r.segmentType) ? (M(), E("label", H, [O(P(i("length", "片段长度")) + " ", 1), k(F(_), {
747
+ value: r.length ?? void 0,
748
+ type: "number",
749
+ disabled: !e.editable,
750
+ "onUpdate:value": (e) => r.length = f(e)
751
+ }, null, 8, [
752
+ "value",
753
+ "disabled",
754
+ "onUpdate:value"
755
+ ])])) : T("v-if", !0)
756
+ ])),
757
+ D("details", yt, [D("summary", null, [O(P(i("advanced-format", "高级设置")), 1), ce(r) ? (M(), E("span", U, " · " + P(le(r)), 1)) : T("v-if", !0)]), D("div", bt, [
758
+ r.segmentType !== "SEQUENCE" && !r.length ? (M(), E("p", xt, P(i("length-dependent-hint", "设置片段长度后,补位与超长截取才会生效。")), 1)) : T("v-if", !0),
759
+ ["FORMULA", "CONTEXT_VAR"].includes(r.segmentType) ? T("v-if", !0) : (M(), E("label", St, [O(P(r.segmentType === "SEQUENCE" ? i("sequence-length-override", "片段长度(覆盖流水长度)") : i("length", "片段长度")), 1), k(F(_), {
760
+ value: r.length ?? void 0,
761
+ placeholder: r.segmentType === "SEQUENCE" ? oe.value : void 0,
762
+ type: "number",
763
+ disabled: !e.editable,
764
+ "onUpdate:value": (e) => r.length = f(e)
765
+ }, null, 8, [
766
+ "value",
767
+ "placeholder",
768
+ "disabled",
769
+ "onUpdate:value"
770
+ ])])),
771
+ r.segmentType !== "SEQUENCE" || (r.padMode ?? "NONE") !== "NONE" ? (M(), E("label", W, [O(P(i("padding", "补位")), 1), k(F(y), {
772
+ value: r.padMode,
773
+ "onUpdate:value": (e) => r.padMode = e,
774
+ disabled: !e.editable,
775
+ options: l("padding", {
776
+ NONE: "不补位",
777
+ LEFT: "左侧补位",
778
+ RIGHT: "右侧补位"
779
+ })
780
+ }, null, 8, [
781
+ "value",
782
+ "onUpdate:value",
783
+ "disabled",
784
+ "options"
785
+ ])])) : T("v-if", !0),
786
+ (r.padMode ?? "NONE") === "NONE" ? T("v-if", !0) : (M(), E("label", Ct, [O(P(i("pad-char", "补位字符")), 1), k(F(_), {
787
+ value: r.padChar,
788
+ "onUpdate:value": (e) => r.padChar = e,
789
+ disabled: !e.editable
790
+ }, null, 8, [
791
+ "value",
792
+ "onUpdate:value",
793
+ "disabled"
794
+ ])])),
795
+ r.segmentType !== "SEQUENCE" || (r.truncatePolicy ?? "NONE") !== "NONE" ? (M(), E("label", wt, [O(P(i("truncate", "超长截取")), 1), k(F(y), {
796
+ value: r.truncatePolicy,
797
+ "onUpdate:value": (e) => r.truncatePolicy = e,
798
+ disabled: !e.editable,
799
+ options: l("truncate", {
800
+ NONE: "保留原值",
801
+ LEFT: "截去左侧",
802
+ RIGHT: "截去右侧"
803
+ })
804
+ }, null, 8, [
805
+ "value",
806
+ "onUpdate:value",
807
+ "disabled",
808
+ "options"
809
+ ])])) : T("v-if", !0),
810
+ D("label", Tt, [O(P(i("separator", "片段后分隔符")), 1), k(F(_), {
811
+ value: r.separator,
812
+ "onUpdate:value": (e) => r.separator = e,
813
+ disabled: !e.editable
814
+ }, null, 8, [
815
+ "value",
816
+ "onUpdate:value",
817
+ "disabled"
818
+ ])]),
819
+ ie(r) || (r.nullPolicy ?? "ERROR") !== "ERROR" ? (M(), E("label", G, [O(P(i("null-policy", "来源为空时")), 1), k(F(y), {
820
+ value: r.nullPolicy,
821
+ "onUpdate:value": (e) => r.nullPolicy = e,
822
+ disabled: !e.editable,
823
+ options: l("null", {
824
+ ERROR: "拒绝生成",
825
+ SKIP_SEGMENT: "跳过该片段",
826
+ USE_DEFAULT: "使用默认文字"
827
+ }).map((e) => r.segmentType === "VALUE_MAPPING" && e.value === "USE_DEFAULT" ? {
828
+ ...e,
829
+ label: i("use-default-source", "使用来源默认值")
830
+ } : e)
831
+ }, null, 8, [
832
+ "value",
833
+ "onUpdate:value",
834
+ "disabled",
835
+ "options"
836
+ ])])) : T("v-if", !0),
837
+ r.nullPolicy === "USE_DEFAULT" && r.segmentType !== "CONSTANT" ? (M(), E("label", Et, [
838
+ O(P(r.segmentType === "VALUE_MAPPING" ? i("mapping-fallback", "来源默认值") : i("default-text", "默认文字")), 1),
839
+ k(F(_), {
840
+ value: r.fixedValue,
841
+ "onUpdate:value": (e) => r.fixedValue = e,
842
+ disabled: !e.editable
843
+ }, null, 8, [
844
+ "value",
845
+ "onUpdate:value",
846
+ "disabled"
847
+ ]),
848
+ r.segmentType === "VALUE_MAPPING" ? (M(), E("span", Dt, P(i("mapping-fallback-hint", "默认值仍需匹配下方映射。")), 1)) : T("v-if", !0)
849
+ ])) : T("v-if", !0),
850
+ ae(r) || r.sequenceBasis ? (M(), w(F(me), {
851
+ key: 7,
852
+ class: "code-format__basis code-format__wide",
853
+ checked: r.sequenceBasis,
854
+ "onUpdate:checked": (e) => r.sequenceBasis = e,
855
+ disabled: !e.editable
856
+ }, {
857
+ default: I(() => [O(P(i("basis", "按该片段分别计数")), 1)]),
858
+ _: 1
859
+ }, 8, [
860
+ "checked",
861
+ "onUpdate:checked",
862
+ "disabled"
863
+ ])) : T("v-if", !0)
864
+ ])]),
865
+ r.segmentType === "VALUE_MAPPING" ? (M(), E("div", Ot, [(M(!0), E(Ke, null, rt(r.mappings, (t, n) => (M(), E("div", {
866
+ key: n,
867
+ class: "code-format__mapping-row"
868
+ }, [
869
+ k(F(_), {
870
+ value: t.sourceValue,
871
+ "onUpdate:value": (e) => t.sourceValue = e,
872
+ placeholder: i("mapping-source", "原值"),
873
+ "aria-label": i("mapping-source", "原值"),
874
+ disabled: !e.editable || t.defaultMapping
875
+ }, null, 8, [
876
+ "value",
877
+ "onUpdate:value",
878
+ "placeholder",
879
+ "aria-label",
880
+ "disabled"
881
+ ]),
882
+ s[6] ||= D("span", null, "→", -1),
883
+ k(F(_), {
884
+ value: t.targetValue,
885
+ "onUpdate:value": (e) => t.targetValue = e,
886
+ placeholder: i("mapping-target", "编码文字"),
887
+ "aria-label": i("mapping-target", "编码文字"),
888
+ disabled: !e.editable
889
+ }, null, 8, [
890
+ "value",
891
+ "onUpdate:value",
892
+ "placeholder",
893
+ "aria-label",
894
+ "disabled"
895
+ ]),
896
+ k(F(me), {
897
+ class: "code-format__mapping-default",
898
+ checked: t.defaultMapping,
899
+ "onUpdate:checked": (e) => t.defaultMapping = e,
900
+ disabled: !e.editable
901
+ }, {
902
+ default: I(() => [O(P(i("mapping-default", "其他值")), 1)]),
903
+ _: 1
904
+ }, 8, [
905
+ "checked",
906
+ "onUpdate:checked",
907
+ "disabled"
908
+ ]),
909
+ k(F(x), {
910
+ class: "code-format__mapping-remove",
911
+ disabled: !e.editable,
912
+ onClick: (e) => r.mappings.splice(n, 1)
913
+ }, {
914
+ default: I(() => [O(P(i("remove", "删除")), 1)]),
915
+ _: 1
916
+ }, 8, ["disabled", "onClick"])
917
+ ]))), 128)), k(F(x), {
918
+ disabled: !e.editable,
919
+ onClick: (e) => r.mappings.push({
920
+ sourceValue: "",
921
+ targetValue: "",
922
+ defaultMapping: !1,
923
+ enabled: !0
924
+ })
925
+ }, {
926
+ default: I(() => [O(P(i("add-mapping", "增加映射")), 1)]),
927
+ _: 1
928
+ }, 8, ["disabled", "onClick"])])) : T("v-if", !0)
929
+ ]))), 128))]),
930
+ k(F(x), {
931
+ type: "dashed",
932
+ "icon-name": "plus",
933
+ "aria-label": i("add-segment", "增加片段"),
934
+ disabled: !e.editable,
935
+ onClick: fe
936
+ }, {
937
+ default: I(() => [O(P(i("add-segment", "增加片段")), 1)]),
938
+ _: 1
939
+ }, 8, ["aria-label", "disabled"]),
940
+ n.value.sequencePolicy ? (M(), E("div", K, [
941
+ k(F(Se), {
942
+ class: "code-format__wide",
943
+ title: i("sequence", "流水策略")
944
+ }, null, 8, ["title"]),
945
+ D("label", kt, [O(P(i("sequence-length", "流水长度")), 1), k(F(_), {
946
+ value: n.value.sequencePolicy.sequenceLength ?? void 0,
947
+ type: "number",
948
+ disabled: !e.editable,
949
+ "onUpdate:value": s[0] ||= (e) => n.value.sequencePolicy.sequenceLength = f(e)
950
+ }, null, 8, ["value", "disabled"])]),
951
+ D("label", At, [O(P(i("reset", "计数周期")), 1), k(F(y), {
952
+ value: n.value.sequencePolicy.resetPolicy,
953
+ "onUpdate:value": s[1] ||= (e) => n.value.sequencePolicy.resetPolicy = e,
954
+ disabled: !e.editable,
955
+ options: l("reset", {
956
+ NONE: "持续计数",
957
+ DAY: "每天重置",
958
+ MONTH: "每月重置",
959
+ YEAR: "每年重置"
960
+ })
961
+ }, null, 8, [
962
+ "value",
963
+ "disabled",
964
+ "options"
965
+ ])]),
966
+ D("details", jt, [D("summary", null, [O(P(i("sequence-advanced", "流水高级设置")), 1), D("span", null, " · " + P(ue.value), 1)]), D("div", Mt, [
967
+ D("label", q, [O(P(i("start", "起始值")), 1), k(F(_), {
968
+ value: n.value.sequencePolicy.startValue ?? void 0,
969
+ type: "number",
970
+ disabled: !e.editable,
971
+ "onUpdate:value": s[2] ||= (e) => n.value.sequencePolicy.startValue = f(e)
972
+ }, null, 8, ["value", "disabled"])]),
973
+ D("label", J, [O(P(i("step", "递增步长")), 1), k(F(_), {
974
+ value: n.value.sequencePolicy.stepValue ?? void 0,
975
+ type: "number",
976
+ disabled: !e.editable,
977
+ "onUpdate:value": s[3] ||= (e) => n.value.sequencePolicy.stepValue = f(e)
978
+ }, null, 8, ["value", "disabled"])]),
979
+ D("label", Nt, [
980
+ O(P(i("maximum", "流水上限")), 1),
981
+ k(F(_), {
982
+ value: n.value.sequencePolicy.maxValue ?? void 0,
983
+ type: "number",
984
+ disabled: !e.editable,
985
+ "onUpdate:value": s[4] ||= (e) => n.value.sequencePolicy.maxValue = f(e)
986
+ }, null, 8, ["value", "disabled"]),
987
+ se.value ? (M(), E("span", Pt, P(se.value), 1)) : T("v-if", !0)
988
+ ]),
989
+ D("label", Ft, [O(P(i("overflow", "达到上限后")), 1), k(F(y), {
990
+ value: n.value.sequencePolicy.overflowPolicy,
991
+ "onUpdate:value": s[5] ||= (e) => n.value.sequencePolicy.overflowPolicy = e,
992
+ disabled: !e.editable,
993
+ options: l("overflow", {
994
+ ERROR: "拒绝生成",
995
+ RESET: "从起点重新尝试"
996
+ })
997
+ }, null, 8, [
998
+ "value",
999
+ "disabled",
1000
+ "options"
1001
+ ])])
1002
+ ])])
1003
+ ])) : T("v-if", !0)
1004
+ ]));
1005
+ }
1006
+ }), [["__scopeId", "data-v-cccc510e"]]), Y = {
1007
+ role: "alert",
1008
+ class: "code-config__recovery"
1009
+ }, X = { key: 0 }, Lt = { key: 0 }, Rt = { key: 1 }, zt = /* @__PURE__ */ Je({
1010
+ __name: "CodeRuleRecoveryPanel",
1011
+ props: {
1012
+ rule: {},
1013
+ target: {},
1014
+ busy: { type: Boolean },
1015
+ resolved: { type: Boolean },
1016
+ feedback: {},
1017
+ error: {}
1018
+ },
1019
+ emits: [
1020
+ "check",
1021
+ "abandon",
1022
+ "adopt"
1023
+ ],
1024
+ setup(e) {
1025
+ let t = e, n = de(), r = (e, t) => n.t(`platform.code.config.${e}`, t), i = C(() => t.rule ? JSON.parse(JSON.stringify(t.rule)) : void 0);
1026
+ return (t, n) => (M(), E("div", Y, [
1027
+ D("p", null, P(r("save-unknown", "原编号保存结果待核实。当前草稿保留;刷新只恢复查询引用,不恢复未保存草稿。")), 1),
1028
+ k(F(x), {
1029
+ disabled: e.busy,
1030
+ onClick: n[0] ||= (e) => t.$emit("check")
1031
+ }, {
1032
+ default: I(() => [O(P(r("check-save", "核实原保存结果")), 1)]),
1033
+ _: 1
1034
+ }, 8, ["disabled"]),
1035
+ k(F(x), {
1036
+ disabled: e.busy || e.resolved,
1037
+ onClick: n[1] ||= (e) => t.$emit("abandon")
1038
+ }, {
1039
+ default: I(() => [O(P(r("abandon-save", "终止原请求并核对")), 1)]),
1040
+ _: 1
1041
+ }, 8, ["disabled"]),
1042
+ D("p", null, P(r("abandon-help", "终止不会撤销已提交内容;尚未执行的请求将被阻止。")), 1),
1043
+ k(F(x), {
1044
+ disabled: e.busy || !e.resolved,
1045
+ onClick: n[2] ||= (e) => t.$emit("adopt")
1046
+ }, {
1047
+ default: I(() => [O(P(r("adopt-current", "采用当前规则并放弃本地候选")), 1)]),
1048
+ _: 1
1049
+ }, 8, ["disabled"]),
1050
+ i.value ? (M(), E("details", X, [
1051
+ D("summary", null, P(i.value.title), 1),
1052
+ D("p", null, P(i.value.mode === "MANUAL" ? r("manual", "手工编号") : i.value.mode === "AUTO" ? r("auto", "自动编号") : r("auto-manual", "自动生成后可修改")) + " · " + P(i.value.enabled ? r("enabled", "已启用") : r("disabled", "已停用")) + " · " + P(i.value.orgScopeType === "GLOBAL" ? r("all-orgs", "全部机构") : r("specific-org", "指定机构")) + " " + P(i.value.orgScopeId), 1),
1053
+ D("p", null, P(i.value.effectiveFrom) + " — " + P(i.value.effectiveTo), 1),
1054
+ D("p", null, P(r("linked-short", "来源变化时换号")) + ": " + P(i.value.linkedUpdate) + " · " + P(r("recycle-short", "旧号可复用")) + ": " + P(i.value.allowRecycle), 1),
1055
+ k(It, {
1056
+ rule: i.value,
1057
+ sources: e.target?.sources ?? [],
1058
+ editable: !1,
1059
+ trigger: e.target?.fields.find((e) => e.fieldName === i.value?.fieldName)?.trigger ?? "SAVE"
1060
+ }, null, 8, [
1061
+ "rule",
1062
+ "sources",
1063
+ "trigger"
1064
+ ]),
1065
+ i.value.sequencePolicy ? (M(), E("p", Lt, P(r("start", "起始值")) + " " + P(i.value.sequencePolicy.startValue) + " · " + P(r("step", "递增步长")) + " " + P(i.value.sequencePolicy.stepValue) + " · " + P(r("sequence-length", "流水长度")) + " " + P(i.value.sequencePolicy.sequenceLength) + " · " + P(r("reset", "计数周期")) + " " + P(i.value.sequencePolicy.resetPolicy) + " · " + P(r("overflow", "溢出策略")) + " " + P(i.value.sequencePolicy.overflowPolicy), 1)) : T("v-if", !0)
1066
+ ])) : T("v-if", !0),
1067
+ e.feedback ? (M(), E("p", Rt, P(e.feedback), 1)) : T("v-if", !0),
1068
+ e.error ? (M(), w(F(ie), {
1069
+ key: 2,
1070
+ message: e.error
1071
+ }, null, 8, ["message"])) : T("v-if", !0)
1072
+ ]));
1073
+ }
1074
+ }), Bt = Symbol("module-runtime-activation-refresh");
1075
+ function Vt(e, t = ye) {
1076
+ let n = e.status === "PENDING" || e.installedRevision !== e.desiredRevision;
1077
+ return { message: {
1078
+ text: e.status === "UNTRACKED" ? t.t("platform.screen.moduleRuntimeActivation.no-module-runtime-activation-has-been-recorded", "尚无模块运行配置生效记录") : e.status === "FAILED" ? t.t("platform.screen.moduleRuntimeActivation.module-runtime-configuration-saved-activation-failed", "模块运行配置已保存,生效失败") : e.status === "PENDING" ? t.t("platform.screen.moduleRuntimeActivation.module-runtime-configuration-saved-activation-is-in-progress", "模块运行配置已保存,正在生效") : e.installedRevision === e.desiredRevision ? e.status === "INACTIVE" ? t.t("platform.screen.moduleRuntimeActivation.module-runtime-configuration-activated-business-runtime-entry-points-are-disabled", "模块运行配置已生效,业务运行入口已停用") : t.t("platform.screen.moduleRuntimeActivation.module-runtime-configuration-activated", "模块运行配置已生效") : t.t("platform.screen.moduleRuntimeActivation.module-runtime-configuration-saved-this-node-has-not-confirmed-activation", "模块运行配置已保存,当前节点尚未确认生效"),
1079
+ type: e.status === "FAILED" ? "WARNING" : n || e.status === "UNTRACKED" ? "INFO" : "SUCCESS"
1080
+ } };
1081
+ }
1082
+ //#endregion
1083
+ //#region src/views/ModuleRuntimeActivationStatus.vue?vue&type=script&setup=true&lang.ts
1084
+ var Ht = ["aria-label"], Ut = { class: "module-runtime-activation__summary" }, Wt = { class: "module-runtime-activation__label" }, Gt = { class: "module-runtime-activation__guidance" }, Kt = { class: "module-runtime-activation__actions" }, qt = { class: "module-runtime-activation__details" }, Jt = { class: "module-runtime-activation__scope" }, Yt = { key: 0 }, Xt = {
1085
+ key: 1,
1086
+ class: "module-runtime-activation__failure"
1087
+ }, Z = { key: 2 }, Q = {
1088
+ key: 3,
1089
+ class: "module-runtime-activation__versions"
1090
+ }, Zt = /*#__PURE__*/ g(/* @__PURE__ */ Je({
1091
+ __name: "ModuleRuntimeActivationStatus",
1092
+ props: {
1093
+ moduleAlias: {},
1094
+ reloadKey: {}
1095
+ },
1096
+ setup(e, { expose: t }) {
1097
+ let n = de(), r = e, i = Te({ moduleAlias: "platform.module" }), a = N(), s = N(!1), c = N(!1), l = N(!1), d = 0, ee = !0, te, ne = C(() => {
1098
+ let e = a.value;
1099
+ return !(!e || e.status === "UNTRACKED" || e.status === "FAILED" || e.status !== "PENDING" && e.installedRevision === e.desiredRevision);
1100
+ }), re = C(() => l.value || a.value?.status === "FAILED" || ne.value), ie = C(() => l.value ? n.t("platform.screen.ModuleRuntimeActivationStatus.unknown-status", "状态未知") : a.value?.status === "FAILED" ? n.t("platform.screen.ModuleRuntimeActivationStatus.activation-failed", "生效失败") : n.t("platform.screen.ModuleRuntimeActivationStatus.applying-changes", "正在应用修改")), ae = C(() => l.value ? "NEUTRAL" : a.value?.status === "FAILED" ? "DANGER" : "WARNING"), oe = C(() => l.value ? n.t("platform.screen.ModuleRuntimeActivationStatus.cannot-check-the-status-right-now-try-again-later", "暂时无法查询,请稍后重试。") : a.value?.status === "FAILED" ? n.t("platform.screen.ModuleRuntimeActivationStatus.the-changes-were-saved-but-activation-failed", "修改已保存,但未能生效。") : n.t("platform.screen.ModuleRuntimeActivationStatus.this-notice-will-close-when-activation-completes", "完成后将自动关闭提示。")), ce = C(() => a.value?.desiredRevision != null && (a.value.status === "FAILED" || a.value.status === "PENDING" || a.value.installedRevision !== a.value.desiredRevision) && i.can("retryRuntimeActivation") === !0);
1101
+ st(() => [r.moduleAlias, r.reloadKey], () => {
1102
+ d++, a.value = void 0, c.value = !1, f();
1103
+ }, { immediate: !0 });
1104
+ function le() {
1105
+ clearTimeout(te), te = void 0;
1106
+ }
1107
+ function ue() {
1108
+ le(), ee && ne.value && !l.value && (te = setTimeout(() => void f(), 2e3));
1109
+ }
1110
+ nt(() => {
1111
+ ee = !1, d++, le();
1112
+ }), et(() => {
1113
+ ee || (ee = !0, c.value = !1, f());
1114
+ }), j(() => {
1115
+ ee = !1, d++, le();
1116
+ });
1117
+ async function f() {
1118
+ if (!ee || c.value) return;
1119
+ le();
1120
+ let e = ++d, t = r.moduleAlias;
1121
+ l.value = !1, s.value = !0;
1122
+ try {
1123
+ let r = await i.http.request({
1124
+ method: "GET",
1125
+ path: `/platform.module/${encodeURIComponent(t)}/runtime/activation`
1126
+ });
1127
+ if (e === d) return a.value = r, Vt(r, n);
1128
+ } catch {
1129
+ if (e !== d) return;
1130
+ l.value = !0;
1131
+ } finally {
1132
+ e === d && (s.value = !1, ue());
1133
+ }
1134
+ }
1135
+ async function p() {
1136
+ if (!ce.value || c.value) return;
1137
+ le();
1138
+ let e = ++d, t = r.moduleAlias, s = a.value.desiredRevision;
1139
+ c.value = !0;
1140
+ try {
1141
+ let n = await i.http.request({
1142
+ method: "POST",
1143
+ path: `/platform.module/${encodeURIComponent(t)}/runtime/activation/retry?expectedRevision=${s}`
1144
+ });
1145
+ e === d && (a.value = o(n), l.value = !1);
1146
+ } catch (t) {
1147
+ if (e !== d) return;
1148
+ se(t, {
1149
+ language: n,
1150
+ source: "runtime-activation",
1151
+ phase: "action"
1152
+ }), c.value = !1, await f();
1153
+ } finally {
1154
+ e === d && (c.value = !1, ue());
1155
+ }
1156
+ }
1157
+ return t({ refresh: f }), (t, r) => re.value ? (M(), E("section", {
1158
+ key: 0,
1159
+ class: "module-runtime-activation",
1160
+ "aria-label": F(n).t("platform.screen.ModuleRuntimeActivationStatus.module-runtime-configuration-activation-status", "模块运行配置生效状态"),
1161
+ "aria-live": "polite"
1162
+ }, [D("div", Ut, [
1163
+ D("span", Wt, P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.runtime-configuration", "运行配置")), 1),
1164
+ k(F(u), {
1165
+ enabled: !0,
1166
+ "enabled-label": ie.value,
1167
+ "enabled-tone": ae.value
1168
+ }, null, 8, ["enabled-label", "enabled-tone"]),
1169
+ D("span", Gt, P(oe.value), 1)
1170
+ ]), D("div", Kt, [
1171
+ ce.value ? (M(), w(F(m), {
1172
+ key: 0,
1173
+ density: "compact",
1174
+ disabled: s.value || c.value,
1175
+ loading: c.value,
1176
+ onClick: p
1177
+ }, {
1178
+ default: I(() => [O(P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.retry-activation", "重试生效")), 1)]),
1179
+ _: 1
1180
+ }, 8, ["disabled", "loading"])) : T("v-if", !0),
1181
+ l.value ? (M(), w(F(m), {
1182
+ key: 1,
1183
+ density: "compact",
1184
+ disabled: s.value || c.value,
1185
+ "icon-name": "reload",
1186
+ onClick: f
1187
+ }, {
1188
+ default: I(() => [O(P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.check-again", "重新查询")), 1)]),
1189
+ _: 1
1190
+ }, 8, ["disabled"])) : T("v-if", !0),
1191
+ (M(), w(F(b), {
1192
+ key: e.moduleAlias,
1193
+ placement: "bottomRight"
1194
+ }, {
1195
+ content: I(() => [D("div", qt, [
1196
+ D("strong", null, P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.diagnostics", "诊断信息")), 1),
1197
+ D("p", Jt, P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.activation-status-of-the-module-runtime-configuration", "模块运行配置的生效情况")), 1),
1198
+ l.value ? (M(), E("p", Yt, P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.failed-to-check-the-status-check-again", "状态查询失败,请重新查询。")), 1)) : a.value?.status === "FAILED" ? (M(), E("p", Xt, P(a.value.failureMessage || F(n).t("platform.screen.ModuleRuntimeActivationStatus.no-failure-reason-is-available-retry-or-contact-an-administrator", "暂未提供失败原因,请重试或联系管理员。")), 1)) : ne.value ? (M(), E("p", Z, P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.the-service-is-loading-the-latest-configuration-the-status-will", "服务正在加载最新配置,状态将自动更新。")), 1)) : T("v-if", !0),
1199
+ a.value ? (M(), E("dl", Q, [
1200
+ D("dt", null, P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.configuration-revision", "配置版本")), 1),
1201
+ D("dd", null, P(a.value.desiredRevision ?? "—"), 1),
1202
+ D("dt", null, P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.loaded-revision", "已加载版本")), 1),
1203
+ D("dd", null, P(a.value.installedRevision ?? "—"), 1)
1204
+ ])) : T("v-if", !0),
1205
+ k(F(m), {
1206
+ density: "compact",
1207
+ emphasis: "quiet",
1208
+ "icon-name": "reload",
1209
+ disabled: s.value || c.value,
1210
+ onClick: f
1211
+ }, {
1212
+ default: I(() => [O(P(F(n).t("platform.screen.ModuleRuntimeActivationStatus.refresh-status", "刷新状态")), 1)]),
1213
+ _: 1
1214
+ }, 8, ["disabled"])
1215
+ ])]),
1216
+ default: I(() => [k(F(m), {
1217
+ density: "compact",
1218
+ emphasis: "quiet",
1219
+ title: F(n).t("platform.screen.WorkbenchAssistantPanel.show-diagnostics", "查看诊断信息")
1220
+ }, {
1221
+ default: I(() => [O(P(a.value?.status === "FAILED" ? F(n).t("platform.screen.ModuleRuntimeActivationStatus.view-reason", "查看原因") : F(n).t("platform.screen.ModuleRuntimeActivationStatus.diagnostics", "诊断信息")), 1)]),
1222
+ _: 1
1223
+ }, 8, ["title"])]),
1224
+ _: 1
1225
+ }))
1226
+ ])], 8, Ht)) : T("v-if", !0);
1227
+ }
1228
+ }), [["__scopeId", "data-v-35af1777"]]), Qt = { class: "code-config" }, $t = {
1229
+ key: 1,
1230
+ class: "code-config__error",
1231
+ role: "alert"
1232
+ }, en = {
1233
+ key: 2,
1234
+ role: "status"
1235
+ }, tn = { class: "code-config__content" }, nn = {
1236
+ key: 2,
1237
+ class: "code-config__unavailable"
1238
+ }, rn = {
1239
+ key: 0,
1240
+ class: "code-config__actions"
1241
+ }, an = {
1242
+ key: 4,
1243
+ class: "code-config__overview"
1244
+ }, on = { class: "code-config__directory-fields" }, sn = { class: "code-config__field" }, cn = {
1245
+ key: 0,
1246
+ class: "code-config__field"
1247
+ }, ln = {
1248
+ key: 0,
1249
+ class: "code-config__binding-summary"
1250
+ }, un = { class: "code-config__identity" }, dn = { class: "code-config__binding-fields" }, fn = { class: "code-config__field" }, pn = { class: "code-config__field" }, mn = {
1251
+ key: 0,
1252
+ class: "code-config__actions"
1253
+ }, hn = { key: 1 }, gn = {
1254
+ key: 0,
1255
+ class: "code-config__table-control"
1256
+ }, _n = { class: "code-config__cell-label" }, vn = { key: 1 }, yn = { key: 1 }, bn = { key: 1 }, xn = {
1257
+ key: 4,
1258
+ class: "code-config__row-actions"
1259
+ }, Sn = {
1260
+ key: 1,
1261
+ role: "status"
1262
+ }, Cn = {
1263
+ key: 3,
1264
+ class: "code-config__editor-content"
1265
+ }, wn = { class: "code-config__editor-main" }, Tn = { class: "code-config__basic" }, En = { class: "code-config__field" }, Dn = { class: "code-config__field" }, On = {
1266
+ key: 0,
1267
+ class: "code-config__muted"
1268
+ }, kn = { key: 0 }, An = { class: "code-config__checks code-config__policy-options" }, jn = {
1269
+ key: 0,
1270
+ class: "code-config__policy-option"
1271
+ }, Mn = { class: "code-config__policy-option" }, Nn = ["aria-label"], Pn = { class: "code-config__muted" }, Fn = { class: "code-config__preview" }, In = { class: "code-config__preview-heading" }, Ln = ["aria-label"], Rn = {
1272
+ key: 2,
1273
+ class: "code-config__muted"
1274
+ }, zn = {
1275
+ key: 0,
1276
+ class: "code-config__trial-extra"
1277
+ }, Bn = { class: "code-config__field" }, Vn = { class: "code-config__cell-label" }, Hn = { class: "code-config__trial-fields" }, Un = {
1278
+ key: 0,
1279
+ class: "code-config__field"
1280
+ }, Wn = {
1281
+ key: 1,
1282
+ class: "code-config__muted"
1283
+ }, Gn = ["aria-label"], Kn = /*@__PURE__*/ Je({
1284
+ name: "CodeConfigurationView",
1285
+ __name: "CodeConfigurationView",
1286
+ props: {
1287
+ moduleAlias: {},
1288
+ moduleTitle: {},
1289
+ embedded: { type: Boolean }
1290
+ },
1291
+ setup(e) {
1292
+ let o = e, u = de(), p = (e, t) => u.t(`platform.code.config.${e}`, t);
1293
+ function m(e) {
1294
+ return e instanceof h ? oe(e, u) : d(ne(e), u);
1295
+ }
1296
+ let g = Te({ moduleAlias: "platform.code_rule" }), v = n(), ge = N(), _e = C(() => {
1297
+ switch (ge.value) {
1298
+ case "no-model": return p("reason.no-model", "尚未关联业务数据模型,请先配置模型,再设置编号规则。");
1299
+ case "no-fields": return p("reason.no-fields", "当前数据模型没有可用于编号的字段,请先检查字段配置。");
1300
+ case "not-declared": return p("reason.not-declared", "该静态模块尚未声明可配置的编号字段,需由开发者在业务模型中声明。");
1301
+ default: return o.moduleAlias ? p("reason.unavailable", "当前模块没有可配置的编号字段,请返回模块管理检查配置。") : p("no-modules", "没有可配置业务编码的模块。");
1302
+ }
1303
+ });
1304
+ function ye() {
1305
+ let e = o.moduleAlias ?? j.value;
1306
+ e && v?.openPage(t(Fe, {
1307
+ moduleAlias: e,
1308
+ moduleTitle: o.moduleTitle ?? Y.value?.moduleTitle,
1309
+ governanceTab: "metadata"
1310
+ }));
1311
+ }
1312
+ let b = r(), xe = N(b?.value?.tenantId ?? ""), De = N(0), S = N(!1), Re = C(() => !!xe.value), Ve = C(() => xe.value && b?.value?.system ? ve(g.http, { "X-MuYun-Tenant-Id": xe.value }) : g.http), Ge = C(() => Me(Ve.value, u)), Je = C(() => b?.value?.system ? re({
1313
+ http: g.http,
1314
+ language: u,
1315
+ moduleAlias: "iam.tenant",
1316
+ runtimeAccess: "REFERENCE"
1317
+ }) : void 0), Ze = C(() => Re.value ? re({
1318
+ http: Ve.value,
1319
+ language: u,
1320
+ moduleAlias: "iam.organization",
1321
+ runtimeAccess: "REFERENCE"
1322
+ }) : void 0), et = C(() => Re.value && g.can("saveTree") === !0), nt = C(() => g.can("configureBinding") === !0 && !B.value), A = N([]), j = N(o.moduleAlias ?? ""), it = N(""), at = C(() => {
1323
+ let e = /* @__PURE__ */ new Map();
1324
+ for (let t of A.value) t.fields.length && (e.has(t.moduleAlias) || e.set(t.moduleAlias, {
1325
+ id: t.moduleAlias,
1326
+ title: le(t.moduleTitle || t.moduleAlias, t.moduleTitleText, u),
1327
+ code: t.moduleAlias
1328
+ }));
1329
+ return [...e.values()];
1330
+ }), dt = C(() => Re.value && !o.moduleAlias), pt = C(() => A.value.filter((e) => e.moduleAlias === j.value)), mt = N(""), L = N(""), R = N([]), ht = ut(u), { draft: z, original: gt, recoveryRequired: B } = ht, V = N(), _t = N(), vt = N(!1), H = () => JSON.stringify([
1331
+ b?.value?.userId,
1332
+ b?.value?.tenantId,
1333
+ b?.value?.organizationId,
1334
+ b?.value?.system,
1335
+ xe.value,
1336
+ o.moduleAlias
1337
+ ]), yt = () => lt(H(), window.sessionStorage), U = N(), bt = N(""), xt = N(!1), St = N(!1), W = N(!1), Ct = N(!1), wt = N(!1), Tt = N([]), G = N(""), Et = N(""), Dt = N(), Ot = N(), K = N("");
1338
+ st(H, (e, t) => {
1339
+ t !== void 0 && (W.value = !1);
1340
+ try {
1341
+ V.value = yt().restore(), B.value = !!V.value;
1342
+ } catch (e) {
1343
+ V.value = void 0, B.value = !0, G.value = m(e);
1344
+ }
1345
+ _t.value = void 0, vt.value = !1;
1346
+ }, {
1347
+ immediate: !0,
1348
+ flush: "sync"
1349
+ });
1350
+ let kt = N(), At = N(), jt = N({}), Mt = N(""), q = N("NORMAL"), J = N("SAVE"), Nt = N(), Pt = Ye(Bt, void 0), Ft = (e) => `${e.moduleAlias}/${e.entityAlias}`, Y = C(() => A.value.find((e) => Ft(e) === mt.value)), X = C(() => Y.value?.fields.find((e) => e.fieldName === L.value)), Lt = C(() => [p(`enum.${q.value}`, q.value === "PRIMARY" ? "主编码" : "业务编码"), p(`enum.${J.value}`, J.value === "SAVE" ? "首次保存" : "业务操作时生成")].join(" · ")), Rt = C(() => !!z.value && Ue(z.value)), Vt = C(() => [Rt.value && z.value?.linkedUpdate ? p("linked-short", "来源变化时换号") : "", z.value?.allowRecycle ? p("recycle-short", "旧号可复用") : ""].filter(Boolean).join(" · ")), Ht = C(() => R.value.filter((e) => e.fieldName === L.value)), Ut = C(() => Ht.value.map((e) => ({ ...e }))), Wt = N({}), Gt = 0;
1351
+ st(() => [Ve.value, Ht.value.map((e) => e.orgScopeType === "ORG" ? e.orgScopeId : "").join(",")], async ([e]) => {
1352
+ let t = ++Gt;
1353
+ Wt.value = {};
1354
+ let n = [...new Set(Ht.value.filter((e) => e.orgScopeType === "ORG").map((e) => e.orgScopeId).filter((e) => !!e))];
1355
+ if (Re.value && n.length) try {
1356
+ let r = await pe(e, { moduleAlias: "iam.organization" }).translate(n);
1357
+ t === Gt && (Wt.value = Object.fromEntries(r.records.map((e) => [String(e.id), ue(e, "title", u) ?? p("specific-org", "指定机构")])));
1358
+ } catch {}
1359
+ });
1360
+ function Kt(e) {
1361
+ return e.orgScopeType === "GLOBAL" ? p("all-orgs", "全部机构") : Wt.value[e.orgScopeId ?? ""] ?? p("specific-org", "指定机构");
1362
+ }
1363
+ let qt = C(() => [
1364
+ {
1365
+ fieldName: "title",
1366
+ title: p("rule-title", "规则名称"),
1367
+ width: 150
1368
+ },
1369
+ {
1370
+ fieldName: "scope",
1371
+ title: p("scope", "适用范围"),
1372
+ width: 152
1373
+ },
1374
+ {
1375
+ fieldName: "organization",
1376
+ title: p("organization", "适用组织"),
1377
+ width: 120
1378
+ },
1379
+ {
1380
+ fieldName: "effectiveFrom",
1381
+ title: p("effective-from-short", "开始生效时间"),
1382
+ width: 180
1383
+ },
1384
+ {
1385
+ fieldName: "effectiveTo",
1386
+ title: p("effective-to-short", "结束生效时间"),
1387
+ width: 180
1388
+ },
1389
+ {
1390
+ fieldName: "enabled",
1391
+ title: p("enable-rule", "启用规则"),
1392
+ width: 64
1393
+ },
1394
+ {
1395
+ fieldName: "actions",
1396
+ title: p("actions", "操作"),
1397
+ width: 112
1398
+ }
1399
+ ]), Jt = C(() => U.value != null && JSON.stringify(U.value) !== bt.value), Yt = C(() => Y.value?.source === "DYNAMIC" && X.value?.role != null && (q.value !== X.value.role || J.value !== (X.value.trigger ?? "SAVE"))), Xt = C(() => Jt.value || Yt.value || z.value != null && JSON.stringify(z.value) !== gt.value), Z = C(() => xt.value || W.value);
1400
+ ae(() => p("title", "业务编码"), () => Xt.value, () => Z.value);
1401
+ let Q = C(() => et.value && !Z.value && !ht.recoveryRequired.value), Kn = C(() => Y.value ? He(Y.value, z.value) : []), qn = C(() => Y.value?.sources.filter((e) => !Kn.value.some((t) => t.fieldName === e.fieldName)) ?? []), Jn = C(() => [...Kn.value, ...qn.value.filter((e) => Tt.value.includes(e.fieldName))]), Yn = 0, Xn, Zn, Qn = C(() => S.value && z.value?.mode !== "MANUAL" && !!z.value && !!Y.value && !Z.value && g.can("preview")), $n = C(() => {
1402
+ if (!Qn.value || !z.value) return "";
1403
+ let e = z.value;
1404
+ return JSON.stringify([
1405
+ e.id,
1406
+ e.moduleAlias,
1407
+ e.entityAlias,
1408
+ e.fieldName,
1409
+ e.fieldRole,
1410
+ e.fieldTrigger,
1411
+ e.mode,
1412
+ e.linkedUpdate,
1413
+ e.orgScopeId,
1414
+ e.segments,
1415
+ e.sequencePolicy,
1416
+ Jn.value.map((e) => [
1417
+ e.fieldName,
1418
+ e.type,
1419
+ jt.value[e.fieldName]
1420
+ ]),
1421
+ Mt.value
1422
+ ]);
1423
+ });
1424
+ function er() {
1425
+ Xn != null && clearTimeout(Xn), Xn = void 0, wt.value = !1, Zn?.abort(), Zn = void 0, Ct.value = !1, ++Yn;
1426
+ }
1427
+ st($n, (e) => {
1428
+ er(), kt.value = void 0, Et.value = "", e && (wt.value = !0, Xn = setTimeout(() => {
1429
+ Or();
1430
+ }, 500));
1431
+ }, { flush: "sync" }), tt(er);
1432
+ let tr = () => JSON.stringify([
1433
+ b?.value,
1434
+ xe.value,
1435
+ mt.value,
1436
+ L.value
1437
+ ]);
1438
+ ft({
1439
+ http: g.http,
1440
+ scopedHttp: () => Ve.value,
1441
+ scope: tr,
1442
+ active: () => ht.active.value,
1443
+ revision: () => JSON.stringify([
1444
+ tr(),
1445
+ S.value,
1446
+ z.value,
1447
+ U.value,
1448
+ q.value,
1449
+ J.value,
1450
+ jt.value,
1451
+ Mt.value,
1452
+ Z.value,
1453
+ Q.value,
1454
+ ht.recoveryRequired.value
1455
+ ]),
1456
+ adapter: {
1457
+ state: () => ({
1458
+ ready: ht.active.value && S.value && !!z.value && !!Y.value && g.can("viewTree") === !0,
1459
+ editable: Q.value && !Yt.value && !U.value,
1460
+ busy: Z.value,
1461
+ dirty: Xt.value,
1462
+ recoveryRequired: ht.recoveryRequired.value,
1463
+ draft: z.value,
1464
+ target: Y.value
1465
+ }),
1466
+ prepare: (e, t) => ht.prepare(e, Y.value, () => t() && Q.value && S.value && !Yt.value && !U.value),
1467
+ trial: async (e, t) => {
1468
+ if (!Qn.value || !z.value || !Y.value) throw new h("当前规则不可试算");
1469
+ let n = await Ge.value.preview(z.value, je(Jn.value, jt.value, u), Mt.value.trim() === "" ? z.value.sequencePolicy?.startValue ?? 1 : Number(Mt.value), e);
1470
+ if (!t()) throw new h("编码草稿或试算输入已变化,请重新试算");
1471
+ return n;
1472
+ }
1473
+ }
1474
+ });
1475
+ let nr = (e) => Object.entries(e).map(([e, t]) => ({
1476
+ value: e,
1477
+ label: p(`enum.${e}`, t)
1478
+ })), rr = 0;
1479
+ function $(e) {
1480
+ U.value = void 0, bt.value = "", Mt.value = "", e || (S.value = !1), ht.reset(e), X.value?.role || (q.value = e?.fieldRole ?? "NORMAL", J.value = e?.fieldTrigger ?? "SAVE"), gt.value = z.value == null ? "" : JSON.stringify(z.value);
1481
+ }
1482
+ st([q, J], () => {
1483
+ S.value && !X.value?.role && z.value && (z.value.fieldRole = q.value, z.value.fieldTrigger = J.value);
1484
+ }, { flush: "sync" });
1485
+ function ir() {
1486
+ q.value = X.value?.role ?? "NORMAL", J.value = X.value?.trigger ?? "SAVE";
1487
+ }
1488
+ function ar() {
1489
+ return B.value ? (G.value = p("recovery-needed", "请先核实原编号保存结果。"), !1) : Xt.value ? (G.value = p("unsaved", "请先保存或取消当前修改。"), !1) : !Z.value;
1490
+ }
1491
+ function or(e) {
1492
+ ar() && (L.value = e, jt.value = {}, Tt.value = [], ir(), $(Ht.value[0]), G.value = "", K.value = "");
1493
+ }
1494
+ async function sr(e) {
1495
+ if (!ar() || !at.value.some((t) => t.id === e)) return;
1496
+ j.value = e, it.value = "", K.value = "";
1497
+ let t = pt.value.find((e) => e.fields.length) ?? pt.value[0];
1498
+ await cr(t ? Ft(t) : "");
1499
+ }
1500
+ async function cr(e, t = !1) {
1501
+ if (!t && !ar()) return;
1502
+ let n = ++rr;
1503
+ mt.value = e, jt.value = {}, Tt.value = [], L.value = "", R.value = [], $(), G.value = "", xt.value = !0;
1504
+ try {
1505
+ let e = Y.value;
1506
+ if (!e) return;
1507
+ let t = Re.value ? await Ge.value.rules(e) : [];
1508
+ if (n !== rr) return;
1509
+ R.value = t, L.value = V.value?.fieldName ?? e.fields.find((e) => e.role != null)?.fieldName ?? e.fields[0]?.fieldName ?? "", ir(), $(V.value?.ruleId ? Ht.value.find((e) => e.id === V.value?.ruleId) : Ht.value[0]);
1510
+ } catch (e) {
1511
+ n === rr && (G.value = m(e));
1512
+ } finally {
1513
+ n === rr && (xt.value = !1);
1514
+ }
1515
+ }
1516
+ async function lr() {
1517
+ let e = ++rr;
1518
+ if (St.value = !1, !Re.value) {
1519
+ xt.value = !1, G.value = "";
1520
+ return;
1521
+ }
1522
+ xt.value = !0, ge.value = void 0, G.value = "";
1523
+ try {
1524
+ V.value = yt().restore(), B.value = !!V.value;
1525
+ let t = await Ge.value.targets(o.moduleAlias);
1526
+ if (e !== rr) return;
1527
+ if (A.value = t, o.moduleAlias && !t.some((e) => e.fields.length)) {
1528
+ try {
1529
+ let t = await Be(Ve.value, o.moduleAlias);
1530
+ if (e !== rr) return;
1531
+ ge.value = t.reason;
1532
+ } catch {}
1533
+ if (e !== rr) return;
1534
+ }
1535
+ xt.value = !1, V.value && (j.value = V.value.moduleAlias), at.value.some((e) => e.id === j.value) || (j.value = "");
1536
+ let n = V.value ? pt.value.find((e) => e.entityAlias === V.value.entityAlias) : pt.value.find((e) => e.fields.length) ?? pt.value[0];
1537
+ await cr(n ? Ft(n) : "", !!V.value);
1538
+ } catch (t) {
1539
+ e === rr && (G.value = m(t), St.value = !0);
1540
+ } finally {
1541
+ e === rr && (xt.value = !1);
1542
+ }
1543
+ }
1544
+ st(() => o.moduleAlias, () => {
1545
+ j.value = o.moduleAlias ?? "", it.value = "", $(), L.value = "", mt.value = "", A.value = [], R.value = [], lr();
1546
+ }, { immediate: !0 }), st(() => [
1547
+ b?.value?.userId,
1548
+ b?.value?.tenantId,
1549
+ b?.value?.organizationId,
1550
+ b?.value?.system
1551
+ ], () => {
1552
+ xe.value = b?.value?.tenantId ?? "", j.value = o.moduleAlias ?? "", it.value = "", $(), A.value = [], R.value = [], L.value = "", mt.value = "", lr();
1553
+ });
1554
+ async function ur(e) {
1555
+ ar() && (xe.value = e ?? "", j.value = o.moduleAlias ?? "", it.value = "", A.value = [], R.value = [], L.value = "", mt.value = "", $(), await lr());
1556
+ }
1557
+ function dr(e, t, n) {
1558
+ t && n === 1 && e.length === 1 && !xe.value && ur(String(e[0].id));
1559
+ }
1560
+ async function fr() {
1561
+ return Z.value || B.value ? !1 : !Xt.value || await ee({
1562
+ title: p("discard-rule", "放弃未保存的编号规则修改?"),
1563
+ content: p("discard-rule-help", "当前修改尚未保存,放弃后将恢复已保存的规则。"),
1564
+ okText: p("discard", "放弃修改"),
1565
+ danger: !0
1566
+ }, u);
1567
+ }
1568
+ function pr() {
1569
+ B.value || Z.value || (gr(), S.value = !1);
1570
+ }
1571
+ function mr(e) {
1572
+ ar() && (ir(), $(e), S.value = !0, G.value = "", K.value = "");
1573
+ }
1574
+ function hr() {
1575
+ if (ar() && Y.value && X.value) {
1576
+ let e = Le(Y.value, X.value);
1577
+ e.fieldRole = q.value, e.fieldTrigger = J.value, $(e), S.value = !0, G.value = "", K.value = "";
1578
+ }
1579
+ }
1580
+ function gr() {
1581
+ B.value || Z.value || (ir(), $(z.value?.id ? R.value.find((e) => e.id === z.value?.id) : void 0), G.value = "");
1582
+ }
1583
+ function _r() {
1584
+ B.value || Z.value || (ir(), G.value = "", K.value = "");
1585
+ }
1586
+ async function vr() {
1587
+ if (!Y.value || !X.value || W.value || B.value) return;
1588
+ let e = H();
1589
+ W.value = !0, G.value = "", K.value = "";
1590
+ try {
1591
+ let t = await Ge.value.bind(Y.value, X.value, q.value, J.value);
1592
+ if (H() !== e || (A.value = A.value.map((e) => Ft(e) === Ft(t) ? t : e), ir(), Pt ? await Pt(t.moduleAlias) : await Nt.value?.refresh(), H() !== e)) return;
1593
+ K.value = p("binding-saved", "字段配置已保存,请查看运行态生效状态。");
1594
+ } catch (t) {
1595
+ if (H() !== e) return;
1596
+ G.value = m(t), t instanceof h || se(t, {
1597
+ language: u,
1598
+ source: "business-code",
1599
+ phase: "action"
1600
+ });
1601
+ } finally {
1602
+ H() === e && (W.value = !1);
1603
+ }
1604
+ }
1605
+ async function yr(e) {
1606
+ let t = Y.value?.source === "DYNAMIC" && !X.value?.role;
1607
+ if (B.value) throw new h("请先核实原编号保存结果");
1608
+ let n = Pe(e, u), r = {
1609
+ requestId: ce(),
1610
+ moduleAlias: e.moduleAlias,
1611
+ entityAlias: e.entityAlias,
1612
+ fieldName: e.fieldName,
1613
+ ...e.id ? { ruleId: e.id } : {}
1614
+ }, a = yt(), s = H(), c = Ge.value;
1615
+ a.save(r), V.value = r;
1616
+ let l;
1617
+ try {
1618
+ l = await c.save(n, r.requestId), a.clear(r.requestId);
1619
+ } catch (e) {
1620
+ if (e instanceof i && [
1621
+ 400,
1622
+ 401,
1623
+ 403,
1624
+ 404,
1625
+ 422
1626
+ ].includes(e.status ?? 0)) {
1627
+ try {
1628
+ a.clear(r.requestId);
1629
+ } catch (e) {
1630
+ throw H() === s && (B.value = !0), e;
1631
+ }
1632
+ H() === s && (V.value = void 0);
1633
+ } else H() === s && (B.value = !0);
1634
+ throw e;
1635
+ }
1636
+ if (H() !== s) throw new h("编号执行范围已变化,请重新读取");
1637
+ if (V.value = void 0, R.value = [...R.value.filter((e) => e.id !== l.id), l], t && l.enabled) try {
1638
+ let e = await c.targets(o.moduleAlias);
1639
+ if (H() !== s) throw new h("编号执行范围已变化,请重新读取");
1640
+ A.value = e, ir(), Pt ? await Pt(l.moduleAlias) : await Nt.value?.refresh();
1641
+ } catch {
1642
+ if (H() !== s) throw new h("编号执行范围已变化,请重新读取");
1643
+ G.value = p("saved-refresh-failed", "规则已保存,但状态刷新失败,请刷新页面确认。");
1644
+ }
1645
+ if (H() !== s) throw new h("编号执行范围已变化,请重新读取");
1646
+ return l;
1647
+ }
1648
+ async function br(e = !1) {
1649
+ if (!V.value || Z.value) return;
1650
+ let t = V.value, n = H(), r = Ge.value;
1651
+ W.value = !0, vt.value = !1, _t.value = void 0;
1652
+ try {
1653
+ let i = await (e ? r.abandon(t) : r.receipt(t));
1654
+ if (n !== H()) return;
1655
+ let a = i.committed || i.cancelled, o = i.ruleId ?? t.ruleId, s = o && a ? await r.view(o) : void 0;
1656
+ if (o && a && !s) throw new h("当前编号规则不可读取,请重新核实");
1657
+ if (n !== H()) return;
1658
+ _t.value = s || void 0, vt.value = a, K.value = i.committed ? "已确认原请求提交成功,请核对当前规则。" : i.cancelled ? "原请求已终止,迟到请求不会写入。" : "尚未查到回执,结果仍不确定;可稍后查询或显式终止原请求。";
1659
+ } catch (e) {
1660
+ n === H() && (G.value = m(e));
1661
+ } finally {
1662
+ n === H() && (W.value = !1);
1663
+ }
1664
+ }
1665
+ function xr() {
1666
+ if (!V.value || !vt.value || Z.value) return;
1667
+ try {
1668
+ yt().clear(V.value.requestId);
1669
+ } catch (e) {
1670
+ G.value = m(e);
1671
+ return;
1672
+ }
1673
+ let e = _t.value;
1674
+ V.value = void 0, B.value = !1, vt.value = !1, e && (R.value = [...R.value.filter((t) => t.id !== e.id), e]), $(e), S.value = !!e;
1675
+ }
1676
+ async function Sr() {
1677
+ if (!z.value || W.value || B.value) return;
1678
+ let e = H();
1679
+ W.value = !0, G.value = "", K.value = "";
1680
+ try {
1681
+ let e = await yr(z.value);
1682
+ $(e), K.value = e.enabled ? p("active", "规则已启用,后续业务按适用范围匹配规则。") : p("saved-disabled", "规则已保存,可在规则列表中启用。");
1683
+ } catch (t) {
1684
+ if (H() !== e) return;
1685
+ G.value = m(t), t instanceof h || se(t, {
1686
+ language: u,
1687
+ source: "business-code",
1688
+ phase: "action"
1689
+ });
1690
+ } finally {
1691
+ H() === e && (W.value = !1), await Qe(), Ot.value?.scrollIntoView?.({
1692
+ block: "nearest",
1693
+ behavior: "smooth"
1694
+ });
1695
+ }
1696
+ }
1697
+ async function Cr(e, t) {
1698
+ if (U.value || !ar() || !et.value || t && !X.value?.role && !nt.value) return;
1699
+ let n = H();
1700
+ W.value = !0, G.value = "";
1701
+ try {
1702
+ let n = await yr({
1703
+ ...e,
1704
+ ...!X.value?.role && t ? {
1705
+ fieldRole: q.value,
1706
+ fieldTrigger: J.value
1707
+ } : {},
1708
+ enabled: t
1709
+ });
1710
+ z.value?.id === n.id && $(n), K.value = n.enabled ? p("active", "规则已启用,后续业务按适用范围匹配规则。") : p("rule-stopped", "规则已停用,已有编码保持不变。");
1711
+ } catch (e) {
1712
+ if (H() !== n) return;
1713
+ G.value = m(e);
1714
+ } finally {
1715
+ H() === n && (W.value = !1);
1716
+ }
1717
+ }
1718
+ function wr(e) {
1719
+ ar() && ($(), U.value = JSON.parse(JSON.stringify(e)), bt.value = JSON.stringify(U.value), G.value = "", K.value = "");
1720
+ }
1721
+ function Tr() {
1722
+ U.value = void 0, bt.value = "", G.value = "";
1723
+ }
1724
+ async function Er() {
1725
+ if (!U.value || !et.value || Z.value) return;
1726
+ let e = H();
1727
+ W.value = !0, G.value = "", K.value = "";
1728
+ try {
1729
+ $(await yr(U.value)), K.value = p("usage-saved", "适用配置已保存。");
1730
+ } catch (t) {
1731
+ if (H() !== e) return;
1732
+ G.value = m(t);
1733
+ } finally {
1734
+ H() === e && (W.value = !1);
1735
+ }
1736
+ }
1737
+ function Dr(e) {
1738
+ z.value && (z.value.mode = e, e !== "MANUAL" && z.value.segments.length === 0 && (z.value.segments = [We(), We("SEQUENCE")], z.value.sequencePolicy = Ne()));
1739
+ }
1740
+ async function Or(e = !1) {
1741
+ if (!z.value || !Y.value || !Qn.value) return;
1742
+ er();
1743
+ let t = ++Yn, n = new AbortController();
1744
+ Zn = n, Ct.value = !0, Et.value = "", kt.value = void 0;
1745
+ try {
1746
+ let r = await Ge.value.preview(z.value, je(Jn.value, jt.value, u), Mt.value.trim() === "" ? z.value.sequencePolicy?.startValue ?? 1 : Number(Mt.value), n.signal);
1747
+ t === Yn && (kt.value = r, e && (await Qe(), t === Yn && At.value?.scrollIntoView?.({
1748
+ block: "nearest",
1749
+ behavior: "smooth"
1750
+ })));
1751
+ } catch (r) {
1752
+ t === Yn && !n.signal.aborted && (Et.value = m(r), e && (await Qe(), t === Yn && (Dt.value?.scrollIntoView?.({
1753
+ block: "nearest",
1754
+ behavior: "smooth"
1755
+ }), Dt.value?.focus({ preventScroll: !0 }))));
1756
+ } finally {
1757
+ t === Yn && (Ct.value = !1, Zn = void 0);
1758
+ }
1759
+ }
1760
+ return (t, n) => (M(), E("section", Qt, [
1761
+ F(B) && !S.value ? (M(), w(zt, {
1762
+ key: 0,
1763
+ rule: _t.value,
1764
+ target: Y.value,
1765
+ busy: Z.value,
1766
+ resolved: vt.value,
1767
+ feedback: K.value,
1768
+ error: G.value,
1769
+ onCheck: n[0] ||= (e) => br(),
1770
+ onAbandon: n[1] ||= (e) => br(!0),
1771
+ onAdopt: xr
1772
+ }, null, 8, [
1773
+ "rule",
1774
+ "target",
1775
+ "busy",
1776
+ "resolved",
1777
+ "feedback",
1778
+ "error"
1779
+ ])) : T("v-if", !0),
1780
+ G.value && !S.value ? (M(), E("div", $t, [k(F(ie), {
1781
+ title: p("request-failed", "操作未完成"),
1782
+ message: G.value
1783
+ }, null, 8, ["title", "message"]), St.value ? (M(), w(F(x), {
1784
+ key: 0,
1785
+ disabled: Z.value,
1786
+ onClick: lr
1787
+ }, {
1788
+ default: I(() => [O(P(p("retry", "重试加载")), 1)]),
1789
+ _: 1
1790
+ }, 8, ["disabled"])) : T("v-if", !0)])) : T("v-if", !0),
1791
+ K.value && !S.value ? (M(), E("p", en, P(K.value), 1)) : T("v-if", !0),
1792
+ k(F(he), {
1793
+ class: "code-config__layout",
1794
+ "explorer-count": (F(b)?.system && Je.value ? 1 : 0) + +!!dt.value,
1795
+ editing: Z.value || Xt.value || !!U.value
1796
+ }, {
1797
+ default: I(() => [
1798
+ F(b)?.system && Je.value ? (M(), w(F(we), {
1799
+ key: 0,
1800
+ collapsible: "",
1801
+ title: p("tenant-short", "租户"),
1802
+ "has-selection": !!xe.value
1803
+ }, {
1804
+ default: I(() => [F(b)?.system && Je.value ? (M(), w(F(Ce), {
1805
+ key: 0,
1806
+ context: Je.value,
1807
+ "selected-id": xe.value || void 0,
1808
+ "reload-key": De.value,
1809
+ disabled: Z.value || Xt.value,
1810
+ onSelect: n[2] ||= (e) => ur(String(e.id)),
1811
+ onDeselect: n[3] ||= (e) => ur(),
1812
+ onLoaded: dr,
1813
+ onRefresh: n[4] ||= (e) => De.value++
1814
+ }, null, 8, [
1815
+ "context",
1816
+ "selected-id",
1817
+ "reload-key",
1818
+ "disabled"
1819
+ ])) : T("v-if", !0)]),
1820
+ _: 1
1821
+ }, 8, ["title", "has-selection"])) : T("v-if", !0),
1822
+ dt.value ? (M(), w(F(we), {
1823
+ key: 1,
1824
+ collapsible: "",
1825
+ title: p("module", "所属模块"),
1826
+ "has-selection": !!j.value
1827
+ }, {
1828
+ default: I(() => [k(F(fe), {
1829
+ title: p("module", "所属模块"),
1830
+ "refresh-disabled": Z.value || Xt.value,
1831
+ "search-keyword": it.value,
1832
+ onRefresh: lr,
1833
+ "onUpdate:searchKeyword": n[6] ||= (e) => it.value = e
1834
+ }, {
1835
+ default: I(() => [k(F(s), {
1836
+ records: at.value,
1837
+ "selected-id": j.value || void 0,
1838
+ keyword: it.value,
1839
+ "empty-description": p("no-modules", "没有可配置业务编码的模块。"),
1840
+ onSelect: n[5] ||= (e) => sr(String(e.id))
1841
+ }, null, 8, [
1842
+ "records",
1843
+ "selected-id",
1844
+ "keyword",
1845
+ "empty-description"
1846
+ ])]),
1847
+ _: 1
1848
+ }, 8, [
1849
+ "title",
1850
+ "refresh-disabled",
1851
+ "search-keyword"
1852
+ ])]),
1853
+ _: 1
1854
+ }, 8, ["title", "has-selection"])) : T("v-if", !0),
1855
+ D("div", tn, [Re.value ? xt.value ? (M(), w(F(Ae), {
1856
+ key: 1,
1857
+ spinning: !0
1858
+ }, {
1859
+ default: I(() => [D("p", null, P(p("loading", "正在读取编码配置…")), 1)]),
1860
+ _: 1
1861
+ })) : !G.value && at.value.length === 0 ? (M(), E("div", nn, [k(F(l), { description: _e.value }, null, 8, ["description"]), F(v) ? (M(), E("div", rn, [ge.value === "no-model" || ge.value === "no-fields" ? (M(), w(F(x), {
1862
+ key: 0,
1863
+ type: "primary",
1864
+ onClick: ye
1865
+ }, {
1866
+ default: I(() => [O(P(p("configure-model", "配置模型")), 1)]),
1867
+ _: 1
1868
+ })) : T("v-if", !0), k(F(x), { onClick: n[7] ||= (e) => F(v).openRoute("/platform/module") }, {
1869
+ default: I(() => [O(P(p("back-to-modules", "返回模块管理")), 1)]),
1870
+ _: 1
1871
+ })])) : T("v-if", !0)])) : !j.value && A.value.length ? (M(), w(F(l), {
1872
+ key: 3,
1873
+ description: p("select-module", "选择模块后,配置业务对象的编码规则。")
1874
+ }, null, 8, ["description"])) : j.value && pt.value.length ? (M(), E("div", an, [k(F(fe), {
1875
+ class: "code-config__directory",
1876
+ title: p("binding-title", "编码对象"),
1877
+ "refresh-disabled": Z.value || Xt.value,
1878
+ searchable: !1,
1879
+ onRefresh: lr
1880
+ }, {
1881
+ actions: I(() => [!e.embedded && Y.value?.source === "DYNAMIC" ? (M(), w(Zt, {
1882
+ key: 0,
1883
+ ref_key: "localActivation",
1884
+ ref: Nt,
1885
+ "module-alias": Y.value.moduleAlias
1886
+ }, null, 8, ["module-alias"])) : T("v-if", !0)]),
1887
+ default: I(() => [D("div", on, [
1888
+ D("label", sn, [O(P(p("entity", "业务对象")), 1), k(F(y), {
1889
+ value: mt.value,
1890
+ disabled: Z.value,
1891
+ options: pt.value.map((e) => ({
1892
+ value: Ft(e),
1893
+ label: e.title
1894
+ })),
1895
+ "onUpdate:value": n[8] ||= (e) => cr(String(e))
1896
+ }, null, 8, [
1897
+ "value",
1898
+ "disabled",
1899
+ "options"
1900
+ ])]),
1901
+ Y.value?.fields.length ? (M(), E("label", cn, [O(P(p("field", "编码字段")), 1), k(F(y), {
1902
+ value: L.value,
1903
+ disabled: Z.value,
1904
+ options: Y.value?.fields.map((e) => ({
1905
+ value: e.fieldName,
1906
+ label: e.title
1907
+ })) ?? [],
1908
+ "onUpdate:value": n[9] ||= (e) => or(String(e))
1909
+ }, null, 8, [
1910
+ "value",
1911
+ "disabled",
1912
+ "options"
1913
+ ])])) : T("v-if", !0),
1914
+ Y.value && !X.value ? (M(), E(Ke, { key: 1 }, [k(F(l), { description: p("reason.no-fields", "当前数据模型没有可用于编号的字段,请先检查字段配置。") }, null, 8, ["description"]), F(v) && Y.value.source === "DYNAMIC" ? (M(), w(F(x), {
1915
+ key: 0,
1916
+ onClick: ye
1917
+ }, {
1918
+ default: I(() => [O(P(p("configure-model", "配置模型")), 1)]),
1919
+ _: 1
1920
+ })) : T("v-if", !0)], 64)) : T("v-if", !0),
1921
+ X.value ? (M(), E(Ke, { key: 2 }, [Y.value?.source === "STATIC" ? (M(), E("div", ln, [D("span", null, P(Lt.value), 1), k(F(Ee), { label: p("binding-info", "字段设置说明") }, {
1922
+ default: I(() => [D("p", null, P(p("java-declaration", "字段角色和生成时机由业务模型预设。")), 1), D("dl", un, [
1923
+ D("dt", null, P(p("module", "所属模块")), 1),
1924
+ D("dd", null, P(Y.value.moduleAlias), 1),
1925
+ D("dt", null, P(p("entity", "业务对象")), 1),
1926
+ D("dd", null, P(Y.value.entityAlias), 1),
1927
+ D("dt", null, P(p("field", "编码字段")), 1),
1928
+ D("dd", null, P(X.value.fieldName), 1)
1929
+ ])]),
1930
+ _: 1
1931
+ }, 8, ["label"])])) : (M(), E("section", {
1932
+ key: `${mt.value}/${L.value}`,
1933
+ class: "code-config__binding"
1934
+ }, [D("div", dn, [
1935
+ D("label", fn, [O(P(p("role", "编码角色")), 1), k(F(y), {
1936
+ value: q.value,
1937
+ "onUpdate:value": n[10] ||= (e) => q.value = e,
1938
+ disabled: Z.value || (X.value.role ? !nt.value : !et.value),
1939
+ options: nr({
1940
+ NORMAL: "业务编码",
1941
+ PRIMARY: "主编码"
1942
+ })
1943
+ }, null, 8, [
1944
+ "value",
1945
+ "disabled",
1946
+ "options"
1947
+ ])]),
1948
+ D("label", pn, [O(P(p("trigger", "生成时机")), 1), k(F(y), {
1949
+ value: J.value,
1950
+ "onUpdate:value": n[11] ||= (e) => J.value = e,
1951
+ disabled: Z.value || (X.value.role ? !nt.value : !et.value),
1952
+ options: nr({
1953
+ SAVE: "首次保存",
1954
+ EXPLICIT: "业务操作时生成"
1955
+ })
1956
+ }, null, 8, [
1957
+ "value",
1958
+ "disabled",
1959
+ "options"
1960
+ ])]),
1961
+ X.value.role && Yt.value ? (M(), E("div", mn, [k(F(x), {
1962
+ disabled: !nt.value || Z.value,
1963
+ onClick: vr
1964
+ }, {
1965
+ default: I(() => [O(P(p("save-binding", "保存字段配置")), 1)]),
1966
+ _: 1
1967
+ }, 8, ["disabled"]), k(F(x), {
1968
+ disabled: Z.value,
1969
+ onClick: _r
1970
+ }, {
1971
+ default: I(() => [O(P(p("cancel-settings", "取消修改")), 1)]),
1972
+ _: 1
1973
+ }, 8, ["disabled"])])) : T("v-if", !0)
1974
+ ])])), X.value ? (M(), w(F(ke), {
1975
+ key: 2,
1976
+ title: p("rules", "编号规则"),
1977
+ kind: "relation"
1978
+ }, {
1979
+ actions: I(() => [k(F(c), {
1980
+ "icon-name": "plus",
1981
+ title: p("new-rule", "新增规则"),
1982
+ "aria-label": p("new-rule", "新增规则"),
1983
+ disabled: !et.value || Z.value,
1984
+ onClick: hr
1985
+ }, null, 8, [
1986
+ "title",
1987
+ "aria-label",
1988
+ "disabled"
1989
+ ])]),
1990
+ default: I(() => [k(F(Oe), {
1991
+ class: "code-config__rules-table",
1992
+ columns: qt.value,
1993
+ rows: Ut.value,
1994
+ density: "compact"
1995
+ }, {
1996
+ cell: I(({ row: e, column: t }) => [t.fieldName === "title" ? (M(), w(F(x), {
1997
+ key: 0,
1998
+ type: "link",
1999
+ class: "code-config__rule-name",
2000
+ disabled: Z.value,
2001
+ onClick: (t) => mr(e)
2002
+ }, {
2003
+ default: I(() => [O(P(e.title), 1)]),
2004
+ _: 2
2005
+ }, 1032, ["disabled", "onClick"])) : t.fieldName === "scope" ? (M(), E(Ke, { key: 1 }, [U.value && U.value.id === e.id ? (M(), w(F(y), {
2006
+ key: 0,
2007
+ value: U.value.orgScopeType,
2008
+ "onUpdate:value": n[12] ||= (e) => U.value.orgScopeType = e,
2009
+ "aria-label": p("scope", "适用范围"),
2010
+ disabled: !Q.value,
2011
+ options: nr({
2012
+ GLOBAL: "当前租户全部组织",
2013
+ ORG: "指定组织及其下级"
2014
+ })
2015
+ }, null, 8, [
2016
+ "value",
2017
+ "aria-label",
2018
+ "disabled",
2019
+ "options"
2020
+ ])) : (M(), E("span", hn, P(e.orgScopeType === "GLOBAL" ? p("all-orgs", "全部机构") : p("enum.ORG", "指定组织及其下级")), 1))], 64)) : t.fieldName === "organization" ? (M(), E(Ke, { key: 2 }, [U.value && U.value.id === e.id && U.value.orgScopeType === "ORG" ? (M(), E("label", gn, [D("span", _n, P(p("organization", "适用组织")), 1), Ze.value ? (M(), w(F(be), {
2021
+ key: 0,
2022
+ value: U.value.orgScopeId ?? void 0,
2023
+ context: Ze.value,
2024
+ mode: "tree",
2025
+ disabled: !Q.value,
2026
+ "onUpdate:value": n[13] ||= (e) => U.value.orgScopeId = e
2027
+ }, null, 8, [
2028
+ "value",
2029
+ "context",
2030
+ "disabled"
2031
+ ])) : (M(), E("span", vn, P(p("tenant-required", "请使用租户身份选择组织。")), 1))])) : (M(), E("span", yn, P((U.value && U.value.id === e.id ? U.value.orgScopeType : e.orgScopeType) === "GLOBAL" ? "—" : Kt(e)), 1))], 64)) : t.fieldName === "effectiveFrom" || t.fieldName === "effectiveTo" ? (M(), E(Ke, { key: 3 }, [U.value && U.value.id === e.id ? (M(), w(F(_), {
2032
+ key: 0,
2033
+ value: U.value[t.fieldName],
2034
+ "onUpdate:value": (e) => U.value[t.fieldName] = e,
2035
+ "aria-label": t.title,
2036
+ type: "datetime-local",
2037
+ step: 60,
2038
+ disabled: !Q.value
2039
+ }, null, 8, [
2040
+ "value",
2041
+ "onUpdate:value",
2042
+ "aria-label",
2043
+ "disabled"
2044
+ ])) : (M(), E("span", bn, P(F(a)(e[t.fieldName], {
2045
+ language: F(u),
2046
+ precision: "minute",
2047
+ emptyText: p("unlimited", "不限")
2048
+ }).text), 1))], 64)) : t.fieldName === "actions" ? (M(), E("div", xn, [U.value && U.value.id === e.id ? (M(), E(Ke, { key: 0 }, [k(F(x), {
2049
+ type: "link",
2050
+ disabled: !et.value || Z.value || !Jt.value,
2051
+ onClick: Er
2052
+ }, {
2053
+ default: I(() => [O(P(p("save", "保存")), 1)]),
2054
+ _: 1
2055
+ }, 8, ["disabled"]), k(F(x), {
2056
+ type: "link",
2057
+ disabled: Z.value,
2058
+ onClick: Tr
2059
+ }, {
2060
+ default: I(() => [O(P(p("cancel-settings", "取消修改")), 1)]),
2061
+ _: 1
2062
+ }, 8, ["disabled"])], 64)) : (M(), w(F(x), {
2063
+ key: 1,
2064
+ type: "link",
2065
+ class: "code-config__edit-usage",
2066
+ "aria-label": p("edit-usage", "编辑适用配置") + ":" + e.title,
2067
+ disabled: !et.value || Z.value,
2068
+ onClick: (t) => wr(e)
2069
+ }, {
2070
+ default: I(() => [O(P(p("edit", "编辑")), 1)]),
2071
+ _: 1
2072
+ }, 8, [
2073
+ "aria-label",
2074
+ "disabled",
2075
+ "onClick"
2076
+ ]))])) : t.fieldName === "enabled" ? (M(), w(F(f), {
2077
+ key: 5,
2078
+ "aria-label": F(u).t("platform.code.config.rule-switch", "启用规则:{name}", { name: e.title }),
2079
+ checked: e.enabled,
2080
+ disabled: !et.value || Z.value || Xt.value || !!U.value || !e.enabled && !X.value.role && !nt.value,
2081
+ onChange: (t) => Cr(e, t)
2082
+ }, null, 8, [
2083
+ "aria-label",
2084
+ "checked",
2085
+ "disabled",
2086
+ "onChange"
2087
+ ])) : T("v-if", !0)]),
2088
+ empty: I(() => [O(P(p("no-rules", "暂无编号规则")), 1)]),
2089
+ _: 1
2090
+ }, 8, ["columns", "rows"])]),
2091
+ _: 1
2092
+ }, 8, ["title"])) : T("v-if", !0)], 64)) : T("v-if", !0)
2093
+ ])]),
2094
+ _: 1
2095
+ }, 8, ["title", "refresh-disabled"])])) : T("v-if", !0) : (M(), w(F(l), {
2096
+ key: 0,
2097
+ description: p("select-tenant", "选择规则所属租户后,可维护该租户的编号规则。")
2098
+ }, null, 8, ["description"]))])
2099
+ ]),
2100
+ _: 1
2101
+ }, 8, ["explorer-count", "editing"]),
2102
+ S.value ? (M(), w(F(te), {
2103
+ key: 3,
2104
+ open: S.value,
2105
+ width: "wide",
2106
+ "before-close": fr,
2107
+ onClose: pr,
2108
+ class: "code-config__editor",
2109
+ title: F(z)?.id ? p("rules", "编号规则") : p("create-rule-title", "新增编号规则"),
2110
+ subtitle: [Y.value?.title, X.value?.title].filter(Boolean).join(" · ")
2111
+ }, qe({
2112
+ default: I(() => [
2113
+ F(B) ? (M(), w(zt, {
2114
+ key: 0,
2115
+ rule: _t.value,
2116
+ target: Y.value,
2117
+ busy: Z.value,
2118
+ resolved: vt.value,
2119
+ feedback: K.value,
2120
+ error: G.value,
2121
+ onCheck: n[14] ||= (e) => br(),
2122
+ onAbandon: n[15] ||= (e) => br(!0),
2123
+ onAdopt: xr
2124
+ }, null, 8, [
2125
+ "rule",
2126
+ "target",
2127
+ "busy",
2128
+ "resolved",
2129
+ "feedback",
2130
+ "error"
2131
+ ])) : T("v-if", !0),
2132
+ G.value || K.value ? (M(), E("div", {
2133
+ key: 1,
2134
+ ref_key: "editorFeedback",
2135
+ ref: Ot
2136
+ }, [G.value ? (M(), w(F(ie), {
2137
+ key: 0,
2138
+ title: p("request-failed", "操作未完成"),
2139
+ message: G.value
2140
+ }, null, 8, ["title", "message"])) : T("v-if", !0), K.value ? (M(), E("p", Sn, P(K.value), 1)) : T("v-if", !0)], 512)) : T("v-if", !0),
2141
+ F(z) ? (M(), E("div", Cn, [D("div", { class: $e(["code-config__editor-grid", { "code-config__editor-grid--manual": F(z).mode === "MANUAL" }]) }, [D("div", wn, [
2142
+ D("div", Tn, [D("label", En, [O(P(p("rule-title", "规则名称")), 1), k(F(_), {
2143
+ value: F(z).title,
2144
+ "onUpdate:value": n[16] ||= (e) => F(z).title = e,
2145
+ disabled: !Q.value
2146
+ }, null, 8, ["value", "disabled"])]), D("label", Dn, [O(P(p("mode", "编号方式")), 1), k(F(y), {
2147
+ value: F(z).mode,
2148
+ disabled: !Q.value,
2149
+ options: nr({
2150
+ AUTO: "自动编号",
2151
+ MANUAL: "人工编号",
2152
+ AUTO_WITH_MANUAL_EDIT: "自动编号,允许人工调整"
2153
+ }),
2154
+ "onUpdate:value": n[17] ||= (e) => Dr(e)
2155
+ }, null, 8, [
2156
+ "value",
2157
+ "disabled",
2158
+ "options"
2159
+ ])])]),
2160
+ F(z).mode === "MANUAL" ? (M(), E("p", On, P(p("manual-description", "人工填写编号,无需设置编码格式。")), 1)) : T("v-if", !0),
2161
+ ct(k(It, {
2162
+ rule: F(z),
2163
+ "onUpdate:rule": n[18] ||= (e) => Xe(z) ? z.value = e : null,
2164
+ sources: Y.value?.sources ?? [],
2165
+ trigger: X.value?.trigger ?? J.value,
2166
+ editable: Q.value
2167
+ }, null, 8, [
2168
+ "rule",
2169
+ "sources",
2170
+ "trigger",
2171
+ "editable"
2172
+ ]), [[ot, F(z).mode !== "MANUAL"]]),
2173
+ (M(), E("details", {
2174
+ key: F(z).id ?? "new",
2175
+ class: "code-config__policy"
2176
+ }, [D("summary", null, [O(P(p("numbering-policy", "编号策略")), 1), Vt.value ? (M(), E("span", kn, " · " + P(Vt.value), 1)) : T("v-if", !0)]), D("div", An, [Rt.value ? (M(), E("div", jn, [k(F(me), {
2177
+ checked: F(z).linkedUpdate,
2178
+ "onUpdate:checked": n[19] ||= (e) => F(z).linkedUpdate = e,
2179
+ disabled: !Q.value
2180
+ }, {
2181
+ default: I(() => [O(P(p("linked", "修改编号来源后自动换号")), 1)]),
2182
+ _: 1
2183
+ }, 8, ["checked", "disabled"]), k(F(Ee), { label: p("linked-help-title", "自动换号说明") }, {
2184
+ default: I(() => [D("p", null, P(p("linked-help", "已生成编号后,修改参与编号的业务字段并保存,将重新生成整个编号;包含流水号时会重新取号。未勾选则保留原编号,修改其他字段不受影响。")), 1), D("p", null, P(p("linked-example", "例如编号由“采购类别 + 流水号”组成:类别从“设备”改为“耗材”,编号会从 SB-0001 换为 HC-0002(示例)。")), 1)]),
2185
+ _: 1
2186
+ }, 8, ["label"])])) : T("v-if", !0), D("div", Mn, [k(F(me), {
2187
+ checked: F(z).allowRecycle,
2188
+ "onUpdate:checked": n[20] ||= (e) => F(z).allowRecycle = e,
2189
+ disabled: !Q.value
2190
+ }, {
2191
+ default: I(() => [O(P(p("recycle-short-label", "允许复用旧号")), 1)]),
2192
+ _: 1
2193
+ }, 8, ["checked", "disabled"]), k(F(Ee), { label: p("recycle-help-title", "旧号复用说明") }, {
2194
+ default: I(() => [D("p", null, P(p("recycle-help", "记录彻底删除或更换编号后,释放的旧号允许再次分配。移入回收站仍会占用原编号;取消勾选后,旧号不再分配给其他记录。")), 1)]),
2195
+ _: 1
2196
+ }, 8, ["label"])])])]))
2197
+ ]), F(z).mode === "MANUAL" ? T("v-if", !0) : (M(), E("aside", {
2198
+ key: 0,
2199
+ class: "code-config__trial",
2200
+ "aria-label": p("trial", "草稿试算")
2201
+ }, [
2202
+ k(F(Se), { title: p("trial", "草稿试算") }, null, 8, ["title"]),
2203
+ D("p", Pn, P(p("auto-trial-short", "自动试算,不占号")), 1),
2204
+ D("div", Fn, [D("div", In, [D("span", null, P(p("trial-result", "试算结果")), 1), k(F(x), {
2205
+ type: "text",
2206
+ "icon-name": "reload",
2207
+ "icon-only": "",
2208
+ size: "small",
2209
+ title: p("refresh-trial", "刷新试算"),
2210
+ "aria-label": p("refresh-trial", "刷新试算"),
2211
+ disabled: !Qn.value || Ct.value,
2212
+ loading: Ct.value,
2213
+ onClick: n[21] ||= (e) => Or(!0)
2214
+ }, null, 8, [
2215
+ "title",
2216
+ "aria-label",
2217
+ "disabled",
2218
+ "loading"
2219
+ ])]), Et.value ? (M(), E("div", {
2220
+ key: 0,
2221
+ ref_key: "trialErrorElement",
2222
+ ref: Dt,
2223
+ tabindex: "-1",
2224
+ class: "code-config__trial-error"
2225
+ }, [k(F(ie), {
2226
+ title: p("trial-failed", "试算未完成"),
2227
+ message: Et.value
2228
+ }, null, 8, ["title", "message"])], 512)) : kt.value ? (M(), E("output", {
2229
+ key: 1,
2230
+ ref_key: "previewElement",
2231
+ ref: At,
2232
+ "aria-label": p("trial-result", "试算结果")
2233
+ }, [D("strong", null, P(kt.value.value), 1)], 8, Ln)) : (M(), E("p", Rn, P(wt.value || Ct.value ? p("trial-updating", "正在更新…") : p("auto-trial-placeholder", "修改配置后自动更新")), 1))]),
2234
+ qn.value.length ? (M(), E("details", zn, [D("summary", null, P(p("trial-extra-short", "补充试算来源")), 1), D("label", Bn, [D("span", Vn, P(p("trial-extra-short", "补充试算来源")), 1), k(F(y), {
2235
+ value: Tt.value,
2236
+ "onUpdate:value": n[22] ||= (e) => Tt.value = e,
2237
+ mode: "multiple",
2238
+ "show-search": "",
2239
+ disabled: Z.value,
2240
+ options: qn.value.map((e) => ({
2241
+ value: e.fieldName,
2242
+ label: F(Ie)(e, F(u))
2243
+ }))
2244
+ }, null, 8, [
2245
+ "value",
2246
+ "disabled",
2247
+ "options"
2248
+ ])])])) : T("v-if", !0),
2249
+ D("div", Hn, [(M(!0), E(Ke, null, rt(Jn.value, (e) => (M(), E("label", {
2250
+ class: "code-config__field",
2251
+ key: e.fieldName
2252
+ }, [O(P(F(Ie)(e, F(u))), 1), F(ze)(e) === "boolean" ? (M(), w(F(y), {
2253
+ key: 0,
2254
+ value: jt.value[e.fieldName],
2255
+ "onUpdate:value": (t) => jt.value[e.fieldName] = t,
2256
+ "allow-clear": "",
2257
+ disabled: Z.value,
2258
+ options: [{
2259
+ value: "true",
2260
+ label: p("boolean-true", "是")
2261
+ }, {
2262
+ value: "false",
2263
+ label: p("boolean-false", "否")
2264
+ }]
2265
+ }, null, 8, [
2266
+ "value",
2267
+ "onUpdate:value",
2268
+ "disabled",
2269
+ "options"
2270
+ ])) : (M(), w(F(_), {
2271
+ key: 1,
2272
+ value: jt.value[e.fieldName],
2273
+ "onUpdate:value": (t) => jt.value[e.fieldName] = t,
2274
+ step: F(ze)(e) === "number" ? "any" : void 0,
2275
+ type: F(ze)(e) === "datetime" ? "datetime-local" : F(ze)(e) === "number" ? "number" : F(ze)(e) === "date" ? "date" : "text",
2276
+ disabled: Z.value
2277
+ }, null, 8, [
2278
+ "value",
2279
+ "onUpdate:value",
2280
+ "step",
2281
+ "type",
2282
+ "disabled"
2283
+ ]))]))), 128)), F(z).sequencePolicy ? (M(), E("label", Un, [O(P(p("trial-sequence", "试算流水值")), 1), k(F(_), {
2284
+ value: Mt.value,
2285
+ "onUpdate:value": n[23] ||= (e) => Mt.value = e,
2286
+ type: "number",
2287
+ placeholder: String(F(z).sequencePolicy?.startValue ?? 1),
2288
+ disabled: Z.value
2289
+ }, null, 8, [
2290
+ "value",
2291
+ "placeholder",
2292
+ "disabled"
2293
+ ])])) : T("v-if", !0)]),
2294
+ kt.value?.segments.length ? (M(), E("p", Wn, P(p("segment-results", "片段结果(不含分隔符)")), 1)) : T("v-if", !0),
2295
+ kt.value?.segments.length ? (M(), E("ol", {
2296
+ key: 2,
2297
+ class: "code-config__preview-segments",
2298
+ "aria-label": p("segment-results", "片段结果(不含分隔符)")
2299
+ }, [(M(!0), E(Ke, null, rt(kt.value.segments, (e, t) => (M(), E("li", { key: t }, [D("span", null, P(p(`segment.${e.segmentType}`, e.segmentType)), 1), D("code", null, P(e.value), 1)]))), 128))], 8, Gn)) : T("v-if", !0)
2300
+ ], 8, Nn))], 2)])) : (M(), w(F(l), {
2301
+ key: 2,
2302
+ description: p("choose-rule", "选择或新增编号规则。")
2303
+ }, null, 8, ["description"]))
2304
+ ]),
2305
+ _: 2
2306
+ }, [F(z) ? {
2307
+ name: "header-actions",
2308
+ fn: I(() => [k(F(x), {
2309
+ disabled: Z.value || F(B),
2310
+ onClick: pr
2311
+ }, {
2312
+ default: I(() => [O(P(p("cancel", "取消修改")), 1)]),
2313
+ _: 1
2314
+ }, 8, ["disabled"]), k(F(x), {
2315
+ type: "primary",
2316
+ disabled: !Q.value || Yt.value,
2317
+ loading: W.value,
2318
+ onClick: Sr
2319
+ }, {
2320
+ default: I(() => [O(P(p("save-rule", "保存规则")), 1)]),
2321
+ _: 1
2322
+ }, 8, ["disabled", "loading"])]),
2323
+ key: "0"
2324
+ } : void 0]), 1032, [
2325
+ "open",
2326
+ "title",
2327
+ "subtitle"
2328
+ ])) : T("v-if", !0)
2329
+ ]));
2330
+ }
2331
+ }), qn = /* @__PURE__ */ e({ default: () => Jn }), Jn = /*#__PURE__*/ g(Kn, [["__scopeId", "data-v-ebfc847c"]]);
2332
+ //#endregion
2333
+ export { Bt as i, qn as n, Zt as r, Jn as t };