@ximatai/muyun-web-app 0.26.17 → 0.26.19

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