@ximatai/muyun-web-app 0.26.19 → 0.26.21

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 (56) hide show
  1. package/dist/{BusinessActivityLogView-DudCmeKP.js → BusinessActivityLogView-6L75GZVc.js} +2 -2
  2. package/dist/{BusinessLogListDrawer-CVUvUG48.js → BusinessLogListDrawer-C4iFnkE7.js} +95 -95
  3. package/dist/{CodeConfigurationView-ZjVgaZkD.js → CodeConfigurationView-D7sqbNCg.js} +515 -515
  4. package/dist/{ConfigurationTranslationView-Dl757QMl.js → ConfigurationTranslationView-ta82REbn.js} +21 -21
  5. package/dist/{LoginAuditLogView-Cj3PMvN5.js → LoginAuditLogView-B_RQ9JIX.js} +2 -2
  6. package/dist/ModuleActionManagementView-DtGF3NC_.js +755 -0
  7. package/dist/{ModuleGovernanceView-C3RxdgQN.js → ModuleGovernanceView-Cl6tkZ6M.js} +2659 -2651
  8. package/dist/{RequestErrorLogView-tmjMOeLE.js → RequestErrorLogView-BJDO3Scn.js} +2 -2
  9. package/dist/RoleDetailWorkspaceView-C0Ab3PEp.js +1435 -0
  10. package/dist/{RuntimeLogView-BkkgHcF0.js → RuntimeLogView-jP9ceuJD.js} +61 -61
  11. package/dist/WorkflowAdministrationView-BmNJQYtq.js +650 -0
  12. package/dist/{WorkflowConfigurationView-Bnjdrkdx.js → WorkflowConfigurationView-Dh6BKQm5.js} +309 -309
  13. package/dist/WorkflowWorkbenchView-BvPNKbuV.js +759 -0
  14. package/dist/{codeConfiguration-DERwCY-U.js → codeConfiguration-DhCBKbkc.js} +38 -38
  15. package/dist/index.css +1 -1
  16. package/dist/index.js +999 -618
  17. package/dist/moduleMenuWorkspace-BbVmNKZn.js +626 -0
  18. package/dist/{platform-components-wRXbnwMr.js → platform-components-i2ONyZ8r.js} +2989 -2746
  19. package/dist/{platform-workbench-Cm_0kmTT.js → platform-workbench-DhaREttd.js} +5400 -5384
  20. package/dist/types/consumer/index.d.ts +8 -0
  21. package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +2 -0
  22. package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +19 -29
  23. package/dist/types/dynamic-page-runtime/ModulePageRecordContent.vue.d.ts +2 -0
  24. package/dist/types/dynamic-page-runtime/ModulePageTenantNavigator.vue.d.ts +8 -0
  25. package/dist/types/dynamic-page-runtime/RecordFormSurface.vue.d.ts +1 -0
  26. package/dist/types/dynamic-page-runtime/recordSaveFeedback.d.ts +5 -0
  27. package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +1 -0
  28. package/dist/types/dynamic-page-runtime/useTenantScopeController.d.ts +1 -0
  29. package/dist/types/platform-components/EmployeePicker.vue.d.ts +1 -1
  30. package/dist/types/platform-components/QueryCriteriaComposer.vue.d.ts +3 -1
  31. package/dist/types/platform-components/ReadonlyRecordWorkspace.vue.d.ts +56 -0
  32. package/dist/types/platform-components/RecordAdaptiveDetailPanel.vue.d.ts +3 -1
  33. package/dist/types/platform-components/RecordFormFields.vue.d.ts +3 -0
  34. package/dist/types/platform-components/RecordQueryControls.vue.d.ts +21 -0
  35. package/dist/types/platform-components/RecordQueryFieldControls.vue.d.ts +32 -0
  36. package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +1 -1
  37. package/dist/types/platform-components/RecordQueryListSurface.vue.d.ts +2 -2
  38. package/dist/types/platform-components/ReferencePicker.vue.d.ts +1 -1
  39. package/dist/types/platform-components/UserPicker.vue.d.ts +1 -1
  40. package/dist/types/platform-components/queryCriteria.d.ts +7 -0
  41. package/dist/types/platform-components/referencePickerModel.d.ts +5 -1
  42. package/dist/types/views/metadataChangeSetSubmission.d.ts +3 -0
  43. package/dist/types/views/metadataModelChangeSetClient.d.ts +7 -1
  44. package/dist/types/web-contracts/index.d.ts +3 -0
  45. package/dist/types/web-core/index.d.ts +3 -0
  46. package/dist/types/web-core/recordReadEntry.d.ts +23 -0
  47. package/dist/types/web-core/recordReadView.d.ts +28 -0
  48. package/dist/types/web-core/useRecordReadSession.d.ts +27 -0
  49. package/dist/{useWorkflowConfigurationContext-BE_UjKgk.js → useWorkflowConfigurationContext-B_NxZFyz.js} +8 -8
  50. package/dist/{workspaceViews-D37OpJ7g.js → workspaceViews-MTwNg_aQ.js} +565 -565
  51. package/package.json +1 -1
  52. package/dist/ModuleActionManagementView-BuhQrVA3.js +0 -755
  53. package/dist/RoleDetailWorkspaceView-OhpBChaT.js +0 -1435
  54. package/dist/WorkflowAdministrationView-DOhA_5-M.js +0 -650
  55. package/dist/WorkflowWorkbenchView-Cf6yiofx.js +0 -759
  56. package/dist/moduleMenuWorkspace-DPmYGkS_.js +0 -626
@@ -1,626 +0,0 @@
1
- import { ht as e, m as t, vt as n, xt as r } from "./platform-workbench-Cm_0kmTT.js";
2
- import { $n as i, Da as a, Gn as o, Ka as s, Wr as c, Xn as l, aa as u, ar as d, ea as f, ga as p, ia as m, oi as h, pa as g, ra as _, rr as v, ya as y, za as b } from "./platform-components-wRXbnwMr.js";
3
- import { Fragment as x, computed as S, createBlock as C, createCommentVNode as w, createElementBlock as T, createElementVNode as E, createTextVNode as D, createVNode as O, defineComponent as k, inject as A, nextTick as j, openBlock as M, ref as N, shallowRef as P, toDisplayString as F, unref as I, watch as L, withCtx as R } from "vue";
4
- //#region src/platform-admin-runtime/module-menu/moduleMenuClient.ts
5
- function z(e) {
6
- let t = c(e, { moduleAlias: "platform.menu_scheme" });
7
- return {
8
- async schemes() {
9
- let e = [];
10
- for (let n = 1;; n++) {
11
- let r = await t.query({ page: {
12
- pageNum: n,
13
- pageSize: 100
14
- } });
15
- if (e.push(...r.records), e.length >= r.total || r.records.length === 0) return e;
16
- }
17
- },
18
- async tree(t) {
19
- return (await e.request({
20
- method: "POST",
21
- path: "/platform.menu/tree/query",
22
- headers: { "X-MuYun-Page-Context": JSON.stringify({ scheme: t }) },
23
- body: { externalQueryValues: { schemeId: t } }
24
- })).records;
25
- },
26
- context(t) {
27
- return e.request({ path: `/platform.module/${encodeURIComponent(t)}/context` });
28
- },
29
- insert(t, n, r) {
30
- return c(s(e, { "X-MuYun-Page-Context": JSON.stringify({ scheme: t }) }), { moduleAlias: "platform.menu" }).insert(n, { requestId: r });
31
- },
32
- view(t, n) {
33
- return c(s(e, { "X-MuYun-Page-Context": JSON.stringify({ scheme: t }) }), { moduleAlias: "platform.menu" }).view(n);
34
- },
35
- receipt(t, n) {
36
- return c(s(e, { "X-MuYun-Page-Context": JSON.stringify({ scheme: t }) }), { moduleAlias: "platform.menu" }).saveReceipt(n);
37
- },
38
- visible: () => r(e).mine().then((e) => e.records)
39
- };
40
- }
41
- function B(e, t = b) {
42
- return e ? e.scopeType === "system" ? t.t("platform.screen.moduleMenuClient.system-configuration-users", "系统配置用户") : e.organizationId ? t.t("platform.screen.moduleMenuClient.users-in-organization-value", "机构 {value1} 的用户", { value1: e.organizationId }) : e.tenantId ? t.t("platform.screen.moduleMenuClient.users-in-tenant-value", "租户 {value1} 的用户", { value1: e.tenantId }) : t.t("platform.screen.moduleMenuClient.audience-not-declared", "尚未声明适用范围") : t.t("platform.screen.moduleMenuClient.not-yet-determined", "尚未确定");
43
- }
44
- function V(e, t = "", n = b) {
45
- return e.flatMap(({ record: e, children: r }) => {
46
- let i = a(e, "title", n) ?? e.title, o = t ? `${t} / ${i}` : i;
47
- return [{
48
- menu: e,
49
- path: o
50
- }, ...V(r, o, n)];
51
- });
52
- }
53
- function ee(e, t = !1, n = b) {
54
- return e.map(({ record: e, children: r }) => {
55
- let i = t || e.enabled === !1;
56
- return {
57
- value: e.id,
58
- title: a(e, "title", n) ?? e.title,
59
- disabled: i || !!e.moduleAlias,
60
- children: ee(r, i, n)
61
- };
62
- });
63
- }
64
- //#endregion
65
- //#region src/platform-admin-runtime/module-menu/ModuleMenuEditor.vue?vue&type=script&setup=true&lang.ts
66
- var H = { class: "module-menu-form" }, U = { key: 0 }, W = {
67
- key: 1,
68
- class: "hint"
69
- }, G = { class: "hint" }, K = {
70
- key: 2,
71
- role: "status"
72
- }, te = { class: "hint" }, q = {
73
- key: 1,
74
- class: "hint"
75
- }, J = {
76
- key: 2,
77
- role: "status"
78
- }, Y = {
79
- key: 3,
80
- role: "status"
81
- }, ne = {
82
- key: 5,
83
- role: "alert"
84
- }, X = /*#__PURE__*/ d(/* @__PURE__ */ k({
85
- __name: "ModuleMenuEditor",
86
- props: {
87
- session: {},
88
- showSave: { type: Boolean }
89
- },
90
- emits: ["saved", "opened"],
91
- setup(e, { expose: n, emit: r }) {
92
- let s = e, c = r, u = s.session, d = u.language, f = t();
93
- async function p() {
94
- try {
95
- await u.startAnother();
96
- } catch (e) {
97
- u.reportFailure(e instanceof Error ? e : m(d, "platform.screen.ModuleMenuEditor.cannot-start-a-new-entry-right-now", "暂时无法开始新入口"));
98
- }
99
- }
100
- let h = S(() => u.loading.value || u.saving.value || u.resultUnknown.value || !u.authorized.value), g = S(() => h.value || u.updating.value), _ = S(() => u.options.value.map((e) => ({
101
- value: e.id,
102
- label: `${a(e, "title", d) ?? e.alias ?? e.id} · ${B(e, d)}`
103
- }))), y = S(() => [{
104
- value: "root",
105
- title: d.t("platform.screen.moduleMenuWorkspace.top-level", "顶层"),
106
- children: ee(u.tree.value, !1, d)
107
- }]);
108
- async function b() {
109
- try {
110
- await (await u.prepare()).execute(), c("saved");
111
- } catch (e) {
112
- u.resultUnknown.value || u.reportFailure(e instanceof Error ? e : m(d, "platform.screen.ModuleMenuEditor.cannot-add-the-entry-right-now", "暂时无法添加入口"));
113
- }
114
- }
115
- async function k() {
116
- try {
117
- await u.lookupPending() && c("saved");
118
- } catch {
119
- u.reportFailure(m(d, "platform.screen.ModuleMenuEditor.the-result-cannot-be-verified-right-now-retry-the-lookup", "结果暂时无法核实,请重试查询,勿重复添加。"));
120
- }
121
- }
122
- async function A() {
123
- await u.refreshVisibility(), u.visibleMenu.value && f?.openMenu && (f.openMenu(u.visibleMenu.value), c("opened"));
124
- }
125
- return n({ save: b }), (t, n) => (M(), T("div", H, [
126
- I(u).saved.value ? (M(), T(x, { key: 1 }, [
127
- E("strong", null, F(I(d).t("platform.screen.ModuleMenuEditor.added-to-menu", "已添加到菜单")), 1),
128
- E("p", null, F(I(u).savedPath.value), 1),
129
- E("p", te, F(I(d).t("platform.screen.ModuleMenuEditor.audience", "适用范围:")) + F(I(u).savedAudience.value), 1),
130
- I(u).visibleMenu.value && I(f)?.openMenu ? (M(), C(I(v), {
131
- key: 0,
132
- type: "primary",
133
- onClick: A
134
- }, {
135
- default: R(() => [D(F(I(d).t("platform.screen.ModuleMenuEntriesSection.open", "打开")), 1)]),
136
- _: 1
137
- })) : I(u).visibilityChecked.value ? (M(), T("p", q, F(I(d).t("platform.screen.ModuleMenuEditor.the-entry-was-saved-but-is-not-visible-in-navigation", "入口已保存,当前登录身份的导航暂不可见。请由适用范围内的使用者核实;若其也看不到,再检查上级菜单状态和业务访问权限。")), 1)) : w("v-if", !0),
138
- O(I(v), {
139
- disabled: I(u).saving.value,
140
- onClick: p
141
- }, {
142
- default: R(() => [D(F(I(d).t("platform.screen.ModuleMenuEditor.add-another-entry", "另加一个入口")), 1)]),
143
- _: 1
144
- }, 8, ["disabled"]),
145
- I(u).error.value ? (M(), C(I(v), {
146
- key: 2,
147
- disabled: I(u).saving.value,
148
- onClick: I(u).refreshVisibility
149
- }, {
150
- default: R(() => [D(F(I(d).t("platform.screen.ModuleMenuEditor.refresh-navigation", "刷新导航")), 1)]),
151
- _: 1
152
- }, 8, ["disabled", "onClick"])) : w("v-if", !0)
153
- ], 64)) : (M(), T(x, { key: 0 }, [
154
- E("label", null, [D(F(I(d).t("platform.screen.ModuleMenuEditor.menu-name", "菜单名称")), 1), O(I(l), {
155
- value: I(u).title.value,
156
- disabled: g.value,
157
- "aria-label": I(d).t("platform.screen.ModuleMenuEditor.menu-name", "菜单名称"),
158
- "onUpdate:value": n[0] ||= (e) => I(u).update({ title: String(e ?? "") })
159
- }, null, 8, [
160
- "value",
161
- "disabled",
162
- "aria-label"
163
- ])]),
164
- _.value.length > 1 ? (M(), T("label", U, [D(F(I(d).t("platform.screen.ModuleMenuEditor.menu-scheme", "菜单方案")), 1), O(I(i), {
165
- value: I(u).schemeId.value,
166
- options: _.value,
167
- "allow-clear": !1,
168
- disabled: h.value,
169
- "onUpdate:value": n[1] ||= (e) => I(u).update({ schemeId: String(e ?? "") })
170
- }, null, 8, [
171
- "value",
172
- "options",
173
- "disabled"
174
- ])])) : w("v-if", !0),
175
- E("label", null, [D(F(I(d).t("platform.screen.ModuleMenuEditor.position", "放置位置")), 1), O(I(o), {
176
- value: I(u).parentId.value,
177
- "tree-data": y.value,
178
- "allow-clear": !1,
179
- disabled: g.value,
180
- loading: I(u).loading.value || I(u).updating.value,
181
- "onUpdate:value": n[2] ||= (e) => I(u).update({ parentId: String(e ?? "root") })
182
- }, null, 8, [
183
- "value",
184
- "tree-data",
185
- "disabled",
186
- "loading"
187
- ])]),
188
- E("label", null, [D(F(I(d).t("platform.screen.ModuleMenuEditor.open-mode", "打开方式")), 1), O(I(i), {
189
- value: I(u).openMode.value,
190
- "allow-clear": !1,
191
- disabled: g.value,
192
- options: [{
193
- value: "tab",
194
- label: I(d).t("platform.screen.ModuleMenuEditor.open-in-a-workbench-tab", "页签内打开")
195
- }, {
196
- value: "window",
197
- label: I(d).t("platform.screen.ModuleMenuEditor.open-in-a-new-window", "新窗口打开")
198
- }],
199
- "onUpdate:value": n[3] ||= (e) => I(u).update({ openMode: e === "window" ? "window" : "tab" })
200
- }, null, 8, [
201
- "value",
202
- "disabled",
203
- "options"
204
- ])]),
205
- I(u).duplicate.value ? (M(), T("p", W, F(I(d).t("platform.screen.ModuleMenuEditor.duplicate-position", "此位置已有「{title}」,仍可另加入口。", { title: I(a)(I(u).duplicate.value.menu, "title", I(d)) })), 1)) : w("v-if", !0),
206
- E("p", G, F(I(d).t("platform.screen.ModuleMenuEditor.adds-an-access-entry-only-it-does-not-activate-applications", "只添加访问入口,不开通应用或授予业务权限。")), 1),
207
- I(u).updating.value ? (M(), T("p", K, F(I(d).t("platform.screen.ModuleMenuEditor.loading-the-menu-scheme-wait-for-the-candidate-to-be", "正在读取菜单方案,请等待候选就绪。")), 1)) : w("v-if", !0),
208
- e.showSave && !I(u).resultUnknown.value ? (M(), C(I(v), {
209
- key: 3,
210
- type: "primary",
211
- disabled: !I(u).canSave.value,
212
- loading: I(u).saving.value,
213
- onClick: b
214
- }, {
215
- default: R(() => [D(F(I(d).t("platform.screen.ModuleMenuEditor.add-entry", "添加入口")), 1)]),
216
- _: 1
217
- }, 8, ["disabled", "loading"])) : w("v-if", !0),
218
- I(u).resultUnknown.value ? (M(), C(I(v), {
219
- key: 4,
220
- onClick: k
221
- }, {
222
- default: R(() => [D(F(I(d).t("platform.screen.ModuleMenuEditor.check-save-result", "查询保存结果")), 1)]),
223
- _: 1
224
- })) : w("v-if", !0)
225
- ], 64)),
226
- I(u).entryIssue.value ? (M(), T("p", J, F(I(u).entryIssue.value), 1)) : w("v-if", !0),
227
- I(u).ready.value && !I(u).authorized.value ? (M(), T("p", Y, F(I(d).t("platform.screen.ModuleMenuEditor.you-do-not-have-permission-to-add-menu-entries", "当前没有添加菜单入口权限。")), 1)) : w("v-if", !0),
228
- I(u).error.value && I(u).ready.value && !I(u).saved.value && !I(u).resultUnknown.value ? (M(), C(I(v), {
229
- key: 4,
230
- disabled: I(u).saving.value,
231
- onClick: I(u).load
232
- }, {
233
- default: R(() => [D(F(I(d).t("platform.screen.ModuleMenuEditor.reload-candidate", "重新读取候选")), 1)]),
234
- _: 1
235
- }, 8, ["disabled", "onClick"])) : w("v-if", !0),
236
- I(u).error.value ? (M(), T("p", ne, F(I(u).error.value), 1)) : w("v-if", !0),
237
- I(u).error.value && !I(u).ready.value && !I(u).resultUnknown.value ? (M(), C(I(v), {
238
- key: 6,
239
- disabled: I(u).saving.value,
240
- onClick: I(u).load
241
- }, {
242
- default: R(() => [D(F(I(d).t("platform.screen.WorkflowWorkbenchView.retry", "重试")), 1)]),
243
- _: 1
244
- }, 8, ["disabled", "onClick"])) : w("v-if", !0)
245
- ]));
246
- }
247
- }), [["__scopeId", "data-v-1081a9ba"]]);
248
- //#endregion
249
- //#region src/platform-admin-runtime/module-menu/moduleMenuReceiptStore.ts
250
- function Z(e, t, n, r = h, i, a = b) {
251
- let o = `muyun.menu-pending.${JSON.stringify([e, t])}`, s = { persistence: "backend" }, c;
252
- function l() {
253
- if (!n()) throw new _(m(a, "platform.screen.moduleMenuReceiptStore.the-menu-editing-identity-has-changed", "菜单编辑身份已变化"));
254
- return i ?? window.sessionStorage;
255
- }
256
- function u(e) {
257
- if (!/^[a-zA-Z0-9-]{16,80}$/.test(e)) throw new _(m(a, "platform.screen.moduleMenuReceiptStore.the-original-entry-lookup-reference-is-invalid", "原入口查询标识无效"));
258
- return `menu.pending.r${e.toLowerCase().replaceAll("-", "")}`;
259
- }
260
- return {
261
- async restore() {
262
- if (c = l().getItem(o) ?? void 0, !c) return;
263
- let e = await r.restore(u(c), void 0, s);
264
- if (!e) throw new _(m(a, "platform.screen.moduleMenuReceiptStore.the-original-entry-lookup-reference-cannot-be-read-right-now", "原入口查询引用暂不可读取,请核实后重试"));
265
- return e;
266
- },
267
- async save(e) {
268
- if (e.kind !== "record-save") throw new _(m(a, "platform.screen.moduleMenuReceiptStore.the-original-entry-lookup-reference-is-invalid", "原入口查询标识无效"));
269
- let t = l();
270
- c = e.requestId, await r.set(u(c), e, s), l(), t.setItem(o, c);
271
- },
272
- async clear() {
273
- let e = l(), t = c;
274
- t && (await r.remove(u(t), s), l(), e.getItem(o) === t && e.removeItem(o), c === t && (c = void 0));
275
- }
276
- };
277
- }
278
- //#endregion
279
- //#region src/platform-admin-runtime/module-menu/moduleMenuSession.ts
280
- function re(t, r, i, o, s = t.visible, c = b) {
281
- let l = N(0), d = N(!1), h = N(!1), v = N(!1), x = P(), C = S(() => x.value ? x.value instanceof _ || x.value instanceof f ? u(x.value, c) : y(p(x.value), c) : "");
282
- function w(e) {
283
- x.value = e instanceof Error ? e : new _(e);
284
- }
285
- function T(e) {
286
- w(e instanceof Error ? e : m(c, "platform.screen.moduleMenuSession.the-operation-is-temporarily-unavailable-retry", "操作暂不可用,请重试。"));
287
- }
288
- let E = P(), D = S(() => E.value ? oe(E.value, c) : ""), O = N(""), k = N(""), A = N("root"), j = N("tab"), M = P([]), F = P([]), I = P(), L = N(""), R = P(), z = N(""), ee = S(() => R.value ? B(R.value, c) : z.value), H = P(), U = N(!1), W = N(!1), G = N(!1), K = N(!1), te = !1, q = 0, J = 0, Y, ne = !1, X = () => !te && i.valid(), Z = S(() => M.value.filter((e) => e.enabled !== !1 && e.id)), re = S(() => ae(F.value, c)), le = S(() => X() && G.value && W.value && !d.value && !h.value && !v.value && !Y && !I.value && !D.value && !!O.value.trim()), ue = S(() => V(F.value, "", c).find(({ menu: e }) => e.moduleAlias === r && e.parentId === A.value));
289
- function Q() {
290
- if (!X()) throw new _(m(c, "platform.screen.moduleMenuSession.the-menu-editing-scope-has-changed-reopen-the-editor", "菜单编辑范围已变化,请重新打开"));
291
- }
292
- function $(e = !1) {
293
- if (Q(), !G.value || !W.value || d.value || v.value || Y || I.value || !e && h.value) throw new _(m(c, "platform.screen.moduleMenuSession.wait-for-the-menu-candidate-to-be-ready-or-check", "请先等待菜单候选就绪,或查询未确定的保存结果"));
294
- }
295
- async function de() {
296
- if (Q(), I.value || Y && G.value) return;
297
- J++, h.value = !1;
298
- let e = ++q;
299
- d.value = !0, G.value = !1, x.value = void 0;
300
- try {
301
- if (!ne) {
302
- let t = await o.restore();
303
- if (!X() || e !== q) return;
304
- if (t) {
305
- let e = n(t);
306
- if (e.kind !== "record-save" || e.moduleAlias !== "platform.menu" || !e.pageContext?.scheme) throw new _(m(c, "platform.screen.moduleMenuSession.the-original-entry-lookup-scope-is-invalid-verify-the-save", "原入口查询范围无效,请核实保存结果后继续"));
307
- Y = {
308
- requestId: e.requestId,
309
- schemeId: e.pageContext.scheme
310
- }, K.value = !0;
311
- }
312
- ne = !0;
313
- }
314
- let [i, a, s, u] = await Promise.all([
315
- t.schemes(),
316
- t.context(r),
317
- t.context("platform.menu"),
318
- t.visible()
319
- ]);
320
- if (!X() || e !== q) return;
321
- W.value = s.actions.some((e) => e.actionCode === "create" && e.authorized), E.value = a, M.value = i, O.value ||= a.title ?? r, j.value = a.entryType === "link" ? "window" : "tab";
322
- let d = u[0]?.record.schemeId, f = Z.value.find((e) => e.id === (Y?.schemeId ?? k.value)) ?? Z.value.find((e) => e.id === d) ?? Z.value[0];
323
- if (!f?.id) throw new _(m(c, "platform.screen.moduleMenuSession.no-menu-schemes-are-available-configure-an-applicable-scheme-first", "暂无可用菜单方案,请先配置适用的菜单方案"));
324
- let p = await t.tree(f.id);
325
- if (!X() || e !== q) return;
326
- k.value = f.id, F.value = p, A.value = "root", G.value = !0, l.value++;
327
- } catch (t) {
328
- X() && e === q && T(t);
329
- } finally {
330
- X() && e === q && (d.value = !1);
331
- }
332
- }
333
- function fe(e) {
334
- let n = e.schemeId ?? k.value;
335
- if (!Z.value.some((e) => e.id === n)) throw new _(m(c, "platform.screen.moduleMenuSession.select-an-available-menu-scheme", "请选择当前可用的菜单方案"));
336
- let r = e.title ?? O.value;
337
- if ([...r].length > 120) throw new _(m(c, "platform.screen.moduleMenuSession.the-menu-name-must-not-exceed-120-characters", "菜单名称不能超过120个字符"));
338
- let i = e.parentId ?? (n === k.value ? A.value : "root"), a = e.openMode ?? j.value, o = (e) => {
339
- if (i !== "root" && !ae(e).some((e) => e.menu.id === i)) throw new _(m(c, "platform.screen.moduleMenuSession.select-an-enabled-directory-in-the-current-scheme", "请选择当前方案中的启用目录"));
340
- return {
341
- schemeId: n,
342
- nodes: e,
343
- parentId: i,
344
- title: r,
345
- openMode: a
346
- };
347
- };
348
- return n === k.value ? o(F.value) : t.tree(n).then(o);
349
- }
350
- function pe(e) {
351
- k.value = e.schemeId, F.value = e.nodes, A.value = e.parentId, O.value = e.title, j.value = e.openMode, l.value++;
352
- }
353
- async function me(e) {
354
- $();
355
- let t = l.value, n = await fe(e);
356
- return () => {
357
- if ($(), t !== l.value) throw new _(m(c, "platform.screen.moduleMenuSession.the-menu-candidate-has-changed-reload-it", "菜单候选已变化,请重新读取"));
358
- pe(n);
359
- };
360
- }
361
- async function he(e) {
362
- let t;
363
- try {
364
- $(!0), t = ++J, h.value = !0;
365
- let n = ++l.value;
366
- x.value = void 0;
367
- let r = fe(e), i = "then" in r ? await r : r;
368
- if (!X() || t !== J) return;
369
- if ($(!0), n !== l.value) throw new _(m(c, "platform.screen.moduleMenuSession.the-menu-candidate-has-changed-reload-it", "菜单候选已变化,请重新读取"));
370
- pe(i), x.value = void 0;
371
- } catch (e) {
372
- X() && (t === void 0 || t === J) && T(e);
373
- } finally {
374
- t === J && (h.value = !1);
375
- }
376
- }
377
- async function ge() {
378
- Q();
379
- let e = I.value?.id;
380
- if (e) {
381
- U.value = !1, H.value = void 0;
382
- try {
383
- let t = await s();
384
- if (!X() || I.value?.id !== e) return;
385
- H.value = V(t).find(({ menu: t }) => t.id === e)?.menu, U.value = !0, x.value = void 0;
386
- } catch {
387
- X() && w(m(c, "platform.screen.moduleMenuSession.the-menu-was-added-but-navigation-could-not-be-refreshed", "菜单已添加,导航刷新失败。请查询或刷新导航,无需重复添加。"));
388
- }
389
- }
390
- }
391
- async function _e(e, n) {
392
- if (X()) {
393
- let r = Y, i = n ?? (r.record ? {
394
- ...r.record,
395
- id: e
396
- } : await t.view(r.schemeId, e));
397
- Q(), I.value = i;
398
- let s = r.audienceScheme ?? Z.value.find((e) => e.id === i.schemeId);
399
- R.value = s ? { ...s } : void 0, z.value = r.audience ?? "", L.value = r.path ?? [
400
- (() => {
401
- let e = Z.value.find((e) => e.id === i.schemeId);
402
- return e && a(e, "title", c);
403
- })(),
404
- V(F.value, "", c).find(({ menu: e }) => e.id === i.parentId)?.path,
405
- i.title
406
- ].filter(Boolean).join(" / "), Y = void 0, K.value = !1, l.value++, await o.clear().catch(() => {}), X() && await ge();
407
- }
408
- return {
409
- title: c.t("platform.screen.moduleMenuSession.menu-entry-saved", "菜单入口已保存"),
410
- lines: X() ? [L.value, U.value ? H.value ? c.t("platform.screen.moduleMenuSession.visible-to-the-current-user-the-business-page-can-be", "当前用户可见,可打开业务页面。") : c.t("platform.screen.moduleMenuSession.the-entry-was-saved-but-is-not-visible-to-the", "入口已保存;当前登录身份暂不可见,请由适用范围内的使用者核实导航。") : c.t("platform.screen.moduleMenuSession.navigation-visibility-has-not-been-verified-do-not-add-the", "导航可见性尚未核实;不要重复添加。")] : [c.t("platform.screen.moduleMenuSession.the-save-completed-verify-the-entry-in-its-original-scope", "保存已完成,请在原范围核实入口。")]
411
- };
412
- }
413
- async function ve(e, n) {
414
- let [i, o, s, l] = await Promise.all([
415
- t.context(r),
416
- t.context("platform.menu"),
417
- t.schemes(),
418
- t.tree(e.schemeId)
419
- ]);
420
- if (Q(), !o.actions.some((e) => e.actionCode === "create" && e.authorized)) throw new f(m(c, "platform.screen.moduleMenuSession.you-do-not-have-permission-to-add-menu-entries", "当前没有添加菜单入口权限"));
421
- let u = se(i, c);
422
- if (u) throw new f(u);
423
- let d = s.find((t) => t.id === e.schemeId && t.enabled !== !1);
424
- if (!d) throw new f(m(c, "platform.screen.moduleMenuSession.the-menu-scheme-is-no-longer-available", "菜单方案已不可用"));
425
- if (e.parentId !== "root" && !ae(l).some((t) => t.menu.id === e.parentId)) throw new f(m(c, "platform.screen.moduleMenuSession.the-target-directory-is-no-longer-available-review-the-entry", "放置目录已不可用,请重新审阅"));
426
- let p = e.parentId === "root" ? [] : ie(l, e.parentId), h = JSON.stringify([
427
- d.id,
428
- d.alias ?? null,
429
- d.title ?? null,
430
- d.scopeType ?? null,
431
- d.tenantId ?? null,
432
- d.organizationId ?? null,
433
- p.map((e) => [e.id, e.title])
434
- ]);
435
- if (n && h !== n) throw new f(m(c, "platform.screen.moduleMenuSession.the-menu-scheme-audience-or-directory-has-changed-reload-and", "菜单方案适用范围或目录已变化,请重新读取候选并审阅"));
436
- return {
437
- scheme: d,
438
- signature: h,
439
- path: [
440
- a(d, "title", c) ?? d.alias,
441
- ...p.map((e) => a(e, "title", c)),
442
- e.title
443
- ].filter(Boolean).join(" / ")
444
- };
445
- }
446
- async function ye() {
447
- if ($(), !le.value) throw new _(m(c, "platform.screen.moduleMenuSession.provide-a-menu-name-and-an-available-business-page", "请补齐菜单名称及可用业务页面"));
448
- let n = l.value, s = {
449
- moduleAlias: r,
450
- schemeId: k.value,
451
- parentId: A.value,
452
- title: O.value.trim(),
453
- openMode: j.value,
454
- enabled: !0
455
- }, u = await ve(s);
456
- if ($(), l.value !== n) throw new _(m(c, "platform.screen.moduleMenuSession.the-menu-candidate-has-changed-review-it-again", "菜单候选已变化,请重新审阅"));
457
- let d = u.path, p = e(), y = () => X() && i.active() && G.value && W.value && !h.value && !Y && !I.value && l.value === n, b = {
458
- kind: "record-save",
459
- moduleAlias: "platform.menu",
460
- requestId: p,
461
- pageContext: { scheme: s.schemeId }
462
- };
463
- return {
464
- receiptReference: b,
465
- presentation: {
466
- title: c.t("platform.screen.moduleMenuSession.add-a-business-entry", "添加业务入口"),
467
- lines: [
468
- d,
469
- c.t("platform.screen.moduleMenuSession.audience-value", "适用范围:{value1}", { value1: B(u.scheme, c) }),
470
- c.t("platform.screen.moduleMenuSession.open-mode-value", "打开方式:{value1}", { value1: s.openMode === "window" ? c.t("platform.screen.moduleMenuSession.new-window", "新窗口") : c.t("platform.screen.moduleMenuSession.workbench-tab", "页签内") }),
471
- c.t("platform.screen.moduleMenuSession.adds-an-entry-only-it-does-not-activate-applications-or", "只添加入口,不开通应用或授予业务权限。"),
472
- ...ue.value ? [c.t("platform.screen.moduleMenuSession.this-position-already-contains-value-another-entry-will-be-added", "此位置已有「{value1}」,本次将另加一个入口。", { value1: a(ue.value.menu, "title", c) })] : []
473
- ],
474
- details: {
475
- title: c.t("platform.screen.moduleMenuSession.view-target-module", "查看目标模块"),
476
- lines: [r]
477
- }
478
- },
479
- confirmLabel: c.t("platform.screen.moduleMenuSession.confirm-entry-creation", "确认添加入口"),
480
- expiresAt: Date.now() + 3e5,
481
- isCurrent: y,
482
- async execute() {
483
- if (!y() || v.value) throw new f(m(c, "platform.screen.moduleMenuSession.the-menu-candidate-or-editing-scope-has-changed-review-it", "菜单候选或编辑范围已变化,请重新审阅"));
484
- v.value = !0, x.value = void 0;
485
- let e = !1;
486
- try {
487
- if (await ve(s, u.signature), !y() || (Y = {
488
- requestId: p,
489
- schemeId: s.schemeId,
490
- record: s,
491
- path: d,
492
- audience: B(u.scheme, c),
493
- audienceScheme: { ...u.scheme }
494
- }, await o.save(b), !X() || !i.active() || l.value !== n)) throw new f(m(c, "platform.screen.moduleMenuSession.the-menu-candidate-or-editing-scope-has-changed-review-it", "菜单候选或编辑范围已变化,请重新审阅"));
495
- e = !0;
496
- let r = await t.insert(s.schemeId, s, p);
497
- return await _e(r.record.id, r.record);
498
- } catch (t) {
499
- if (X()) {
500
- if (!e || t instanceof f || t instanceof g && [
501
- 400,
502
- 401,
503
- 403,
504
- 404,
505
- 409,
506
- 422
507
- ].includes(t.status ?? 0)) {
508
- try {
509
- Y && await o.clear(), Y = void 0;
510
- } catch {
511
- Y && (Y.rejected = !0), K.value = !0, w(m(c, "platform.screen.moduleMenuSession.the-operation-was-not-submitted-but-the-original-request-reference", "操作未提交,但原请求标识尚未清除,请先查询结果。"));
512
- }
513
- throw new f(ce(t, c));
514
- }
515
- Y && (K.value = !0, l.value++), Y ? w(m(c, "platform.screen.moduleMenuSession.the-save-result-is-unresolved-check-the-original-request-result", "保存结果尚未确定,请查询原请求结果,勿重复添加。")) : T(t);
516
- }
517
- throw t;
518
- } finally {
519
- X() && (v.value = !1);
520
- }
521
- },
522
- lookup: be
523
- };
524
- }
525
- async function be() {
526
- if (Q(), !Y || v.value) return;
527
- let e = Y;
528
- if (e.rejected) return await o.clear(), Q(), Y === e ? (Y = void 0, K.value = !1, x.value = void 0, l.value++, {
529
- title: c.t("platform.operation.not-submitted", "操作未提交"),
530
- lines: [c.t("platform.screen.moduleMenuSession.the-recovery-reference-was-cleared-you-can-review-and-add", "恢复标识已清除,可以重新审阅并添加入口。")]
531
- }) : void 0;
532
- let n = await t.receipt(e.schemeId, e.requestId);
533
- if (Q(), Y === e && n.committed && n.recordId) return _e(n.recordId);
534
- }
535
- return {
536
- moduleAlias: r,
537
- language: c,
538
- revision: l,
539
- loading: d,
540
- updating: h,
541
- saving: v,
542
- error: C,
543
- reportFailure: w,
544
- failureCause: () => x.value,
545
- entryIssue: D,
546
- title: O,
547
- schemeId: k,
548
- parentId: A,
549
- openMode: j,
550
- schemes: M,
551
- tree: F,
552
- options: Z,
553
- directories: re,
554
- saved: I,
555
- savedPath: L,
556
- savedAudience: ee,
557
- visibleMenu: H,
558
- visibilityChecked: U,
559
- authorized: W,
560
- ready: G,
561
- resultUnknown: K,
562
- canSave: le,
563
- duplicate: ue,
564
- load: de,
565
- update: he,
566
- planRevision: me,
567
- prepare: ye,
568
- lookupPending: be,
569
- refreshVisibility: ge,
570
- async startAnother() {
571
- if (Q(), !I.value || v.value || Y) throw new _(m(c, "platform.screen.moduleMenuSession.verify-the-current-entry-save-result-first", "请先核实当前入口保存结果"));
572
- await o.clear(), Q(), I.value = void 0, L.value = "", R.value = void 0, z.value = "", H.value = void 0, U.value = !1, G.value = !1, l.value++, await de();
573
- },
574
- dispose() {
575
- te = !0, q++, J++, h.value = !1, l.value++;
576
- },
577
- invalidate() {
578
- J++, h.value = !1, l.value++;
579
- }
580
- };
581
- }
582
- function ie(e, t, n = []) {
583
- for (let r of e) {
584
- let e = [...n, r.record];
585
- if (r.record.id === t) return e;
586
- let i = ie(r.children, t, e);
587
- if (i.length) return i;
588
- }
589
- return [];
590
- }
591
- function ae(e, t = b) {
592
- let n = (e) => e.filter(({ record: e }) => e.enabled !== !1).map((e) => ({
593
- ...e,
594
- children: n(e.children)
595
- }));
596
- return V(n(e), "", t).filter(({ menu: e }) => !e.moduleAlias);
597
- }
598
- function oe(e, t = b) {
599
- return se(e, t)?.message ?? "";
600
- }
601
- function se(e, t) {
602
- return e.entryType === "route" ? e.entryRoute ? void 0 : m(t, "platform.screen.moduleMenuSession.this-module-has-no-page-address-return-to-its-configuration", "该模块尚未配置页面地址,请返回模块补充。") : e.entryType === "link" ? e.entryExternalUrl ? void 0 : m(t, "platform.screen.moduleMenuSession.this-module-has-no-link-address-return-to-its-configuration", "该模块尚未配置链接地址,请返回模块补充。") : e.uiDescriptor?.page ? void 0 : m(t, "platform.screen.moduleMenuSession.this-module-has-no-available-business-page-publish-its-page", "该模块尚无可用业务页面,请先发布页面配置。");
603
- }
604
- function ce(e, t = b) {
605
- return e instanceof _ || e instanceof f ? e.textMessage ?? e.message : e instanceof Error ? e.message : m(t, "platform.screen.moduleMenuSession.the-operation-is-temporarily-unavailable-retry", "操作暂不可用,请重试。");
606
- }
607
- //#endregion
608
- //#region src/views/configurationEditorNavigation.ts
609
- async function le(e, t, n = b) {
610
- if (t?.aborted || (e() || await new Promise((r, i) => {
611
- let a = (e) => {
612
- s(), clearTimeout(c), t?.removeEventListener("abort", o), e ? i(e) : r();
613
- }, o = () => a(new DOMException("Navigation cancelled", "AbortError")), s = L(e, (e) => {
614
- e && a();
615
- }, { flush: "post" }), c = setTimeout(() => a(new _(m(n, "platform.screen.configurationEditorNavigation.the-configuration-page-is-not-ready-reopen-it-before-continuing", "配置页面尚未就绪,请重新打开后继续。"))), 15e3);
616
- t?.addEventListener("abort", o, { once: !0 });
617
- }), await j(), t?.aborted)) throw new DOMException("Navigation cancelled", "AbortError");
618
- }
619
- //#endregion
620
- //#region src/platform-admin-runtime/module-menu/moduleMenuWorkspace.ts
621
- var ue = Symbol("module-menu-workspace");
622
- function Q() {
623
- return A(ue, void 0);
624
- }
625
- //#endregion
626
- export { X as a, Z as i, le as n, z as o, re as r, V as s, Q as t };