@ximatai/muyun-web-app 0.26.10 → 0.26.12

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 (172) hide show
  1. package/dist/ModuleActionManagementView-BHEooZ5L.js +672 -0
  2. package/dist/ModuleGovernanceView-DB3TWlMy.js +28521 -0
  3. package/dist/RoleDetailWorkspaceView-D6X7pAj5.js +1379 -0
  4. package/dist/index.css +1 -1
  5. package/dist/index.js +1929 -351
  6. package/dist/moduleGovernanceWorkspaceView-C5pqJOEJ.js +40 -0
  7. package/dist/platform-workbench-DJj42YQP.js +22911 -0
  8. package/dist/rolldown-runtime-DPVXH0ON.js +17 -0
  9. package/dist/types/app/CurrentUserProfileDialog.vue.d.ts +0 -2
  10. package/dist/types/app/LoginView.vue.d.ts +1 -1
  11. package/dist/types/app/workbenchRouteSync.d.ts +10 -1
  12. package/dist/types/app/workbenchSessionTabs.d.ts +22 -0
  13. package/dist/types/app/workbenchStartup.d.ts +7 -0
  14. package/dist/types/consumer/AppWorkbenchShell.vue.d.ts +4 -1
  15. package/dist/types/consumer/index.d.ts +2 -1
  16. package/dist/types/dynamic-page-runtime/ModulePageDetailRelations.vue.d.ts +1 -1
  17. package/dist/types/dynamic-page-runtime/ModulePageHost.vue.d.ts +12 -1
  18. package/dist/types/dynamic-page-runtime/ModuleRecordDetailActions.vue.d.ts +17 -0
  19. package/dist/types/dynamic-page-runtime/NavigatorPanelActions.vue.d.ts +22 -0
  20. package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +11 -11
  21. package/dist/types/dynamic-page-runtime/childAggregateContext.d.ts +11 -0
  22. package/dist/types/dynamic-page-runtime/composables/useModulePageDetailExtensionRuntime.d.ts +3 -1
  23. package/dist/types/dynamic-page-runtime/composables/useModulePageFormContributionRuntime.d.ts +5 -3
  24. package/dist/types/dynamic-page-runtime/composables/useNavigatorRuntime.d.ts +82 -28
  25. package/dist/types/dynamic-page-runtime/composables/useRecordEditingSession.d.ts +1 -1
  26. package/dist/types/dynamic-page-runtime/formActionResult.d.ts +5 -0
  27. package/dist/types/dynamic-page-runtime/formComputeCoordinator.d.ts +7 -4
  28. package/dist/types/dynamic-page-runtime/formValidationCoordinator.d.ts +17 -0
  29. package/dist/types/dynamic-page-runtime/index.d.ts +1 -2
  30. package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +75 -1
  31. package/dist/types/dynamic-page-runtime/pageActionInvocation.d.ts +7 -0
  32. package/dist/types/dynamic-page-runtime/pageActionPlacement.d.ts +14 -0
  33. package/dist/types/dynamic-page-runtime/recordMutationPayload.d.ts +3 -0
  34. package/dist/types/formula/FormulaRuntime.d.ts +9 -0
  35. package/dist/types/{dynamic-page-runtime/DynamicModuleHost.vue.d.ts → platform-admin-runtime/module-menu/ModuleMenuDrawer.vue.d.ts} +2 -2
  36. package/dist/types/platform-admin-runtime/module-menu/ModuleMenuEntriesSection.vue.d.ts +7 -0
  37. package/dist/types/platform-admin-runtime/module-menu/moduleMenuClient.d.ts +16 -0
  38. package/dist/types/platform-admin-runtime/platformModulePageEnhancement.d.ts +2 -0
  39. package/dist/types/platform-admin-runtime/role/RoleAccountGrantDrawerSurface.vue.d.ts +7 -0
  40. package/dist/types/platform-admin-runtime/role/RoleAuthorizationDrawerSurface.vue.d.ts +7 -0
  41. package/dist/types/platform-admin-runtime/role/RoleEmploymentGrantDrawerSurface.vue.d.ts +7 -0
  42. package/dist/types/platform-admin-runtime/role/RoleEnumTitleCell.vue.d.ts +8 -0
  43. package/dist/types/platform-admin-runtime/role/RoleGroupMemberFormField.vue.d.ts +7 -0
  44. package/dist/types/platform-admin-runtime/role/RoleScopeTree.vue.d.ts +7 -0
  45. package/dist/types/platform-admin-runtime/roleModulePageEnhancement.d.ts +7 -0
  46. package/dist/types/platform-components/AdaptiveHeaderActionBar.vue.d.ts +24 -0
  47. package/dist/types/platform-components/BusinessNotificationPanel.vue.d.ts +15 -1
  48. package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +9 -4
  49. package/dist/types/platform-components/DetailRelationListPanel.vue.d.ts +1 -1
  50. package/dist/types/platform-components/DrawerOperationBar.vue.d.ts +4 -2
  51. package/dist/types/platform-components/FormulaExpressionEditor.vue.d.ts +54 -0
  52. package/dist/types/platform-components/ManagementExplorerColumn.vue.d.ts +15 -3
  53. package/dist/types/platform-components/ManagementPanelHeader.vue.d.ts +5 -3
  54. package/dist/types/platform-components/ManagementWorkspace.vue.d.ts +11 -0
  55. package/dist/types/platform-components/ModuleActionButton.vue.d.ts +3 -3
  56. package/dist/types/platform-components/QueryGroupedSummary.vue.d.ts +21 -0
  57. package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +1 -0
  58. package/dist/types/platform-components/RecordDetailExtensionSection.vue.d.ts +2 -0
  59. package/dist/types/platform-components/RecordDetailFields.vue.d.ts +41 -2
  60. package/dist/types/platform-components/RecordDetailLayout.vue.d.ts +8 -3
  61. package/dist/types/platform-components/RecordDetailPanel.vue.d.ts +2 -0
  62. package/dist/types/platform-components/RecordExplorerCreateButton.vue.d.ts +16 -0
  63. package/dist/types/platform-components/RecordExplorerPanel.vue.d.ts +16 -5
  64. package/dist/types/platform-components/RecordFieldLabel.vue.d.ts +16 -0
  65. package/dist/types/platform-components/RecordFormFields.vue.d.ts +21 -2
  66. package/dist/types/platform-components/RecordFormGrid.vue.d.ts +24 -0
  67. package/dist/types/platform-components/RecordListExplorer.vue.d.ts +23 -1
  68. package/dist/types/platform-components/RecordMultiPicker.vue.d.ts +2 -2
  69. package/dist/types/platform-components/RecordPanelButton.vue.d.ts +9 -3
  70. package/dist/types/platform-components/RecordPermissionDialog.vue.d.ts +15 -0
  71. package/dist/types/platform-components/RecordPicker.vue.d.ts +2 -2
  72. package/dist/types/platform-components/RecordQueryEnumFilter.vue.d.ts +17 -0
  73. package/dist/types/platform-components/RecordQueryListCell.vue.d.ts +12 -0
  74. package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +110 -64
  75. package/dist/types/platform-components/RecordQueryListSurface.vue.d.ts +124 -0
  76. package/dist/types/platform-components/RecordRelationTable.vue.d.ts +62 -0
  77. package/dist/types/platform-components/RecordRelationValue.vue.d.ts +9 -0
  78. package/dist/types/platform-components/RecordStatusSwitch.vue.d.ts +3 -3
  79. package/dist/types/platform-components/StaticManagementLayout.vue.d.ts +2 -0
  80. package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +15 -4
  81. package/dist/types/platform-components/adaptiveHeaderActionLayout.d.ts +22 -0
  82. package/dist/types/platform-components/formulaExpressionTokens.d.ts +18 -0
  83. package/dist/types/platform-components/index.d.ts +20 -1
  84. package/dist/types/platform-components/managementExplorerContext.d.ts +11 -0
  85. package/dist/types/platform-components/managementWorkspaceContext.d.ts +20 -0
  86. package/dist/types/platform-components/managementWorkspaceLayout.d.ts +14 -0
  87. package/dist/types/platform-components/optionFieldOptionCache.d.ts +1 -1
  88. package/dist/types/platform-components/recordActionBarModel.d.ts +3 -0
  89. package/dist/types/platform-components/recordQueryListColumnModel.d.ts +42 -0
  90. package/dist/types/platform-components/scopedTreeModuleContext.d.ts +2 -2
  91. package/dist/types/platform-components/selectionRefresh.d.ts +9 -0
  92. package/dist/types/platform-components/sortPartitionKey.d.ts +5 -0
  93. package/dist/types/platform-components/staticTreeResourceModuleContext.d.ts +3 -3
  94. package/dist/types/platform-workbench/index.d.ts +2 -0
  95. package/dist/types/platform-workbench/useWorkspaceViewUnsavedState.d.ts +5 -0
  96. package/dist/types/platform-workbench/workbenchNavigation.d.ts +5 -1
  97. package/dist/types/platform-workbench/workspaceViewContract.d.ts +5 -0
  98. package/dist/types/platform-workbench/workspaceViewHost.d.ts +5 -0
  99. package/dist/types/platform-workbench/workspaceViewNavigation.d.ts +9 -0
  100. package/dist/types/platform-workbench/workspaceViewUnsavedState.d.ts +3 -0
  101. package/dist/types/views/BusinessRuleGovernanceSurface.vue.d.ts +10 -0
  102. package/dist/types/views/EmployeeEmploymentTable.vue.d.ts +5 -0
  103. package/dist/types/views/{UserDetailRouteView.vue.d.ts → MetadataGovernanceSurface.vue.d.ts} +3 -3
  104. package/dist/types/views/MetadataSourceTree.vue.d.ts +44 -0
  105. package/dist/types/views/ModuleBusinessPreview.vue.d.ts +7 -0
  106. package/dist/types/views/ModuleExperienceProfileOverview.vue.d.ts +7 -0
  107. package/dist/types/views/ModuleGovernanceView.vue.d.ts +9 -0
  108. package/dist/types/views/PageCompositionDescriptorPreview.vue.d.ts +54 -0
  109. package/dist/types/views/PageCompositionTree.vue.d.ts +103 -0
  110. package/dist/types/views/PageCompositionWorkspace.vue.d.ts +7 -0
  111. package/dist/types/views/PageQuerySummaryEditor.vue.d.ts +48 -0
  112. package/dist/types/views/RoleAccountGrantDrawer.vue.d.ts +6 -2
  113. package/dist/types/views/RoleAuthorizationView.vue.d.ts +7 -0
  114. package/dist/types/views/RoleEmploymentGrantDrawer.vue.d.ts +5 -1
  115. package/dist/types/views/businessRuleGovernance.d.ts +201 -0
  116. package/dist/types/views/metadataModelEditSession.d.ts +75 -0
  117. package/dist/types/views/metadataModelTree.d.ts +40 -0
  118. package/dist/types/views/metadataNaming.d.ts +7 -0
  119. package/dist/types/views/metadataOrchestrationState.d.ts +161 -6
  120. package/dist/types/views/metadataSourceTree.d.ts +10 -0
  121. package/dist/types/views/moduleGovernanceWorkspaceView.d.ts +9 -0
  122. package/dist/types/views/pageCompositionDraftState.d.ts +375 -0
  123. package/dist/types/views/pageCompositionDragPayload.d.ts +26 -0
  124. package/dist/types/views/pageCompositionMode.d.ts +86 -0
  125. package/dist/types/views/pageCompositionPlacement.d.ts +48 -0
  126. package/dist/types/views/pageCompositionTransport.d.ts +9 -0
  127. package/dist/types/views/roleGrantClient.d.ts +8 -5
  128. package/dist/types/views/usePageCompositionActionPreviewDrag.d.ts +41 -0
  129. package/dist/types/views/usePageCompositionPreviewDrag.d.ts +48 -0
  130. package/dist/types/vue-ui-antdv/components/UiActionButton.vue.d.ts +2 -2
  131. package/dist/types/vue-ui-antdv/components/UiButton.vue.d.ts +6 -3
  132. package/dist/types/vue-ui-antdv/components/UiDataTable.vue.d.ts +5 -2
  133. package/dist/types/vue-ui-antdv/components/UiIcon.vue.d.ts +1 -1
  134. package/dist/types/vue-ui-antdv/components/UiPopover.vue.d.ts +22 -0
  135. package/dist/types/vue-ui-antdv/components/UiRecordExplorerItem.vue.d.ts +1 -1
  136. package/dist/types/vue-ui-antdv/components/UiSelect.vue.d.ts +5 -1
  137. package/dist/types/vue-ui-antdv/components/UiSwitch.vue.d.ts +1 -1
  138. package/dist/types/vue-ui-antdv/components/UiTable.vue.d.ts +1 -0
  139. package/dist/types/vue-ui-antdv/components/UiTextArea.vue.d.ts +38 -1
  140. package/dist/types/vue-ui-antdv/components/UiTokenInput.vue.d.ts +62 -0
  141. package/dist/types/vue-ui-antdv/components/UiTree.vue.d.ts +76 -3
  142. package/dist/types/vue-ui-antdv/components/UiTreeSelect.vue.d.ts +1 -1
  143. package/dist/types/vue-ui-antdv/index.d.ts +6 -1
  144. package/dist/types/vue-ui-antdv/treeStructure.d.ts +18 -0
  145. package/dist/types/vue-ui-antdv/types.d.ts +70 -0
  146. package/dist/types/vue-ui-antdv/useTreeLoader.d.ts +21 -0
  147. package/dist/types/vue-ui-antdv/useTreeMotion.d.ts +9 -0
  148. package/dist/types/vue-ui-antdv/useUiTreeDrag.d.ts +32 -0
  149. package/dist/types/web-contracts/index.d.ts +75 -8
  150. package/dist/types/web-core/module/index.d.ts +1 -0
  151. package/dist/types/web-core/module/moduleContext.d.ts +15 -0
  152. package/dist/types/web-core/module/pageActionEntries.d.ts +21 -0
  153. package/dist/types/web-core/module/runtimeContext.d.ts +7 -3
  154. package/dist/types/web-core/module/staticModuleClient.d.ts +29 -6
  155. package/dist/workspaceViews-DI_1vYX9.js +3518 -0
  156. package/package.json +1 -1
  157. package/dist/MetadataOrchestrationView-BhtVwJII.js +0 -661
  158. package/dist/ModuleActionManagementView-DpZS-xAD.js +0 -597
  159. package/dist/RoleAuthorizationView-8lilhtMB.js +0 -646
  160. package/dist/RoleDetailWorkspaceView-CFha6JHn.js +0 -26
  161. package/dist/RoleManagementView-0_KDrzgh.js +0 -1948
  162. package/dist/platform-components-oRIsIoxu.js +0 -12371
  163. package/dist/types/dynamic-page-runtime/DynamicRecordDetailActions.vue.d.ts +0 -39
  164. package/dist/types/dynamic-page-runtime/dynamicModuleDetailStateModel.d.ts +0 -5
  165. package/dist/types/views/UserDetailContent.vue.d.ts +0 -32
  166. package/dist/types/views/UserManagementListView.vue.d.ts +0 -3
  167. package/dist/types/views/UserManagementView.vue.d.ts +0 -3
  168. package/dist/types/views/metadataOrchestrationWorkspaceView.d.ts +0 -6
  169. package/dist/types/views/useUserSessionRows.d.ts +0 -28
  170. package/dist/types/views/userDetailStateModel.d.ts +0 -9
  171. package/dist/types/views/userManagementRouteState.d.ts +0 -11
  172. package/dist/workspaceViews-D-RiJ64o.js +0 -9078
@@ -1,646 +0,0 @@
1
- import { It as e, Mt as t, Nt as n, Rt as r, St as i, T as a, V as ee, Wt as te, _t as ne, at as o, dr as s, ft as re, it as ie, pt as ae, st as oe, u as se, ut as ce, v as c, vt as le } from "./platform-components-oRIsIoxu.js";
2
- import { A as ue, N as de, v as l, w as u } from "./workspaceViews-D-RiJ64o.js";
3
- import { Fragment as d, computed as f, createBlock as p, createCommentVNode as fe, createElementBlock as m, createElementVNode as h, createSlots as g, createTextVNode as _, createVNode as v, defineComponent as y, guardReactiveProps as pe, normalizeClass as me, normalizeProps as he, onBeforeUnmount as ge, onMounted as _e, openBlock as b, ref as x, renderSlot as S, resolveDynamicComponent as ve, toDisplayString as C, toValue as w, unref as T, watch as ye, withCtx as E } from "vue";
4
- //#endregion
5
- //#region src/platform-admin-runtime/WorkspaceViewDrawer.vue
6
- var be = /* @__PURE__ */ y({
7
- name: "WorkspaceViewDrawer",
8
- __name: "WorkspaceViewDrawer",
9
- props: {
10
- open: { type: Boolean },
11
- title: {},
12
- container: {},
13
- subtitle: { default: void 0 },
14
- profile: { default: "detail" },
15
- promotion: { default: void 0 }
16
- },
17
- emits: ["close"],
18
- setup(e, { emit: t }) {
19
- let n = e, r = t, i = f(() => n.profile === "wide-work" ? "min(600px, 100vw)" : 520);
20
- return (t, n) => (b(), p(T(ee), {
21
- open: e.open,
22
- title: e.title,
23
- "render-mode": e.container ? "inline" : "portal",
24
- subtitle: e.subtitle,
25
- width: i.value,
26
- promotion: e.promotion,
27
- onClose: n[0] ||= (e) => r("close")
28
- }, g({
29
- default: E(() => [S(t.$slots, "default")]),
30
- _: 2
31
- }, [t.$slots.operation ? {
32
- name: "operation",
33
- fn: E(() => [S(t.$slots, "operation")]),
34
- key: "0"
35
- } : void 0]), 1032, [
36
- "open",
37
- "title",
38
- "render-mode",
39
- "subtitle",
40
- "width",
41
- "promotion"
42
- ]));
43
- }
44
- });
45
- //#endregion
46
- //#region src/platform-admin-runtime/useWorkspaceViewPromotion.ts
47
- function D(e) {
48
- return e.hasStableIdentity && e.busy !== !0 && e.canChangeHost !== !1;
49
- }
50
- function xe(e) {
51
- let t = de();
52
- return f(() => {
53
- let n = w(e.input);
54
- if (!(!n || !D(w(e.eligibility)) || !t)) return {
55
- title: "固定为页签",
56
- promote: async () => {
57
- if (await e.beforePromote?.(n) === !1) {
58
- e.onPromotionRejected?.();
59
- return;
60
- }
61
- let r = t.openPage(u(e.view, n, "tab", w(e.title)));
62
- e.onPromoted?.(r);
63
- }
64
- };
65
- });
66
- }
67
- //#endregion
68
- //#region src/views/roleGrantClient.ts
69
- function Se(e) {
70
- return {
71
- accountRoleGrants(t) {
72
- return e.request({ path: `/iam.role/${encodeURIComponent(t)}/account-grants` });
73
- },
74
- grantAccountRole(t, n) {
75
- return e.request({
76
- method: "POST",
77
- path: `/iam.role/${encodeURIComponent(t)}/account-grants`,
78
- body: n
79
- });
80
- },
81
- deleteAccountRoleGrant(t, n) {
82
- return e.request({
83
- method: "POST",
84
- path: `/iam.role/${encodeURIComponent(t)}/account-grants/${encodeURIComponent(n)}/delete`
85
- });
86
- },
87
- userSelector(t) {
88
- return e.request({
89
- method: "POST",
90
- path: "/iam.user/selector/query",
91
- body: t
92
- });
93
- },
94
- employmentRoleGrants(t) {
95
- return e.request({ path: `/iam.role/${encodeURIComponent(t)}/employment-grants` });
96
- },
97
- grantEmploymentRole(t, n) {
98
- return e.request({
99
- method: "POST",
100
- path: `/iam.role/${encodeURIComponent(t)}/employment-grants`,
101
- body: { employeePositionId: n }
102
- });
103
- },
104
- deleteEmploymentRoleGrant(t, n) {
105
- return e.request({
106
- method: "POST",
107
- path: `/iam.role/${encodeURIComponent(t)}/employment-grants/${encodeURIComponent(n)}/delete`
108
- });
109
- },
110
- employmentSelector(t, n) {
111
- return e.request({
112
- method: "POST",
113
- path: `/iam.role/${encodeURIComponent(t)}/employment-selector/query`,
114
- body: n
115
- });
116
- },
117
- authorizationModules(t) {
118
- return e.request({ path: `/iam.role/authorizationModules/${encodeURIComponent(t)}` });
119
- },
120
- permissionMatrix(t, n) {
121
- return e.request({
122
- method: "POST",
123
- path: `/iam.role/permissionMatrix/${encodeURIComponent(t)}`,
124
- body: { moduleAliases: n }
125
- });
126
- },
127
- grantAction(t, n) {
128
- return e.request({
129
- method: "POST",
130
- path: `/iam.role/grant/${encodeURIComponent(t)}`,
131
- body: n
132
- });
133
- },
134
- revokeAction(t, n, r) {
135
- return e.request({
136
- method: "POST",
137
- path: `/iam.role/revoke/${encodeURIComponent(t)}`,
138
- body: {
139
- moduleAlias: n,
140
- actionCode: r
141
- }
142
- });
143
- },
144
- replacePermissionMatrix(t, n) {
145
- return e.request({
146
- method: "POST",
147
- path: `/iam.role/permissionMatrix/${encodeURIComponent(t)}/replace`,
148
- body: { actions: n }
149
- });
150
- },
151
- dataGrantActionMatrix(t) {
152
- return e.request({ path: `/iam.role/dataGrantActionMatrix/${encodeURIComponent(t)}` });
153
- },
154
- dataScopePolicyCatalog(t, n) {
155
- return e.request({
156
- path: `/iam.role/dataScopePolicyCatalog/${encodeURIComponent(t)}`,
157
- query: n ? { moduleAlias: n } : void 0
158
- });
159
- },
160
- replaceDataGrantActions(t, n) {
161
- return e.request({
162
- method: "POST",
163
- path: `/iam.role/dataGrantActions/${encodeURIComponent(t)}`,
164
- body: { actions: n }
165
- });
166
- }
167
- };
168
- }
169
- //#endregion
170
- //#region src/platform-admin-runtime/workspaceViewSessions.ts
171
- var O = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
172
- function A(e, t) {
173
- return `${e.type}:${P(t)}`;
174
- }
175
- async function j(e, t, n) {
176
- let r = A(e, t), i = k.get(r), a = i && [...i].at(-1);
177
- return a ? await a(F(n)) ? "accepted" : "rejected" : (O.set(r, F(n)), "accepted");
178
- }
179
- function M(e, t, n) {
180
- let r = A(e, t), i = k.get(r) ?? /* @__PURE__ */ new Set();
181
- return i.add(n), k.set(r, i), () => {
182
- i.delete(n), i.size === 0 && k.delete(r);
183
- };
184
- }
185
- function N(e, t) {
186
- let n = A(e, t), r = O.get(n);
187
- return O.delete(n), r;
188
- }
189
- function P(e) {
190
- return Array.isArray(e) ? `[${e.map(P).join(",")}]` : e && typeof e == "object" ? `{${Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${JSON.stringify(e)}:${P(t)}`).join(",")}}` : JSON.stringify(e);
191
- }
192
- function F(e) {
193
- return JSON.parse(JSON.stringify(e));
194
- }
195
- //#endregion
196
- //#region src/views/roleAuthorizationWorkspaceSession.ts
197
- function Ce(e, t) {
198
- return j(l, e, t);
199
- }
200
- function we(e, t) {
201
- return M(l, e, t);
202
- }
203
- function Te(e) {
204
- return N(l, e);
205
- }
206
- //#endregion
207
- //#region src/views/RoleAuthorizationView.vue?vue&type=script&setup=true&lang.ts
208
- var Ee = { class: "panel-title" }, De = {
209
- key: 4,
210
- class: "authorization-layout"
211
- }, Oe = {
212
- key: 0,
213
- class: "authorization-column-header"
214
- }, ke = {
215
- key: 2,
216
- class: "data-scope-editor"
217
- }, Ae = { key: 0 }, je = { key: 1 }, Me = { key: 3 }, Ne = {
218
- key: 4,
219
- class: "not-applicable"
220
- }, I = /*@__PURE__*/ y({
221
- name: "RoleAuthorizationView",
222
- __name: "RoleAuthorizationView",
223
- props: {
224
- roleId: {},
225
- container: {},
226
- drawer: { type: Boolean }
227
- },
228
- emits: ["close"],
229
- setup(r, { emit: ee }) {
230
- let s = r, de = ee, u = te({ moduleAlias: "iam.role" }), y = Se(u.http), S = s.roleId ?? new URLSearchParams(window.location.search).get("roleId") ?? "", w = ue(), D = s.roleId ? { roleId: s.roleId } : void 0, O = D ? Te(D) : void 0, k = x(), A = x([]), j = x(), M = x([]), N = x(), P = x(), F = x(!1), I = x(!1), L = x(!1), R = x(), z = x(), B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map(), H = x(0), Pe, U = f(() => k.value?.roleKind === "group"), W = f(() => k.value?.roleKind === "dataGrant"), G = f(() => k.value?.assignmentType === "employment"), K = f(() => k.value?.title ?? S ?? "角色"), q = f(() => `授权:${K.value}`), Fe = f(() => Ie.value ? `动作授权 - ${Ie.value.title}` : `动作授权 - ${K.value}`), Ie = f(() => A.value.find((e) => e.moduleAlias === j.value)), Le = f(() => A.value.map((e) => ({
231
- id: e.moduleAlias,
232
- parentId: e.parentId,
233
- title: e.title,
234
- secondary: e.applicationAlias
235
- }))), Re = f(() => (P.value?.options ?? []).map((e) => ({
236
- value: e.code,
237
- label: e.title
238
- }))), ze = f(() => (P.value?.referenceDependencies ?? []).map((e) => ({
239
- value: e.referenceFieldId,
240
- label: `${e.title} → ${e.targetModuleTitle}`
241
- }))), Be = f(() => new Map((P.value?.referenceDependencies ?? []).map((e) => [e.referenceFieldId, e]))), Ve = [
242
- {
243
- key: "title",
244
- title: "动作",
245
- width: 130
246
- },
247
- {
248
- key: "granted",
249
- title: "授权",
250
- width: 88,
251
- align: "center"
252
- },
253
- {
254
- key: "dataScopePolicy",
255
- title: "数据范围",
256
- width: 160
257
- }
258
- ], He = [
259
- {
260
- key: "title",
261
- title: "标准动作",
262
- width: 130
263
- },
264
- {
265
- key: "configured",
266
- title: "启用模板",
267
- width: 104,
268
- align: "center"
269
- },
270
- {
271
- key: "dataScopePolicy",
272
- title: "数据范围",
273
- width: 160
274
- }
275
- ], Ue = f(() => M.value), We = f(() => N.value?.actions ?? []), J = f(() => s.drawer === !0 || !!D && w?.presentation === "drawer"), Y = f(() => !!D), Ge = f(() => J.value ? be : Y.value ? a : "div"), Ke = f(() => J.value ? {
276
- open: !0,
277
- title: q.value,
278
- container: s.container ?? null,
279
- profile: l.drawerProfile,
280
- promotion: Ze.value,
281
- onClose: ut
282
- } : Y.value ? { title: q.value } : {}), qe = f(() => {
283
- let e = N.value;
284
- return !e || z.value === void 0 ? !1 : JSON.stringify(e.actions) !== z.value;
285
- }), Je = f(() => H.value >= 0 && [...B.entries()].some(([e, t]) => V.get(e) !== JSON.stringify(t))), X = f(() => qe.value || Je.value), Ye = f(() => M.value.length > 0 && M.value.every((e) => e.granted)), Xe = f(() => M.value.some((e) => e.granted) && !Ye.value), Ze = xe({
286
- view: l,
287
- input: () => D,
288
- title: q,
289
- eligibility: () => ({
290
- hasStableIdentity: !!(S && k.value),
291
- busy: L.value
292
- }),
293
- beforePromote: (e) => Ce(e, {
294
- selectedModuleAlias: j.value,
295
- dataGrantMatrix: N.value,
296
- actionDrafts: [...B.entries()].map(([e, t]) => ({
297
- moduleAlias: e,
298
- actions: t
299
- })),
300
- actionSnapshots: [...V.entries()].map(([e, t]) => ({
301
- moduleAlias: e,
302
- snapshot: t
303
- }))
304
- }).then((e) => e === "accepted"),
305
- onPromoted: dt,
306
- onPromotionRejected: () => oe("目标页签存在未确认的授权配置;请先确认或关闭该页签后再固定当前抽屉。", {
307
- source: "role-authorization",
308
- phase: "validation"
309
- })
310
- });
311
- _e(() => {
312
- D && !J.value && (Pe = we(D, ft)), Z();
313
- }), ye(q, (e) => {
314
- Y.value && w?.setTitle(e);
315
- }, { immediate: !0 }), ye(j, () => void Qe()), _e(() => window.addEventListener("beforeunload", mt)), ge(() => {
316
- Pe?.(), window.removeEventListener("beforeunload", mt);
317
- });
318
- async function Z() {
319
- if (!S) {
320
- R.value = "缺少角色标识,无法打开授权页。";
321
- return;
322
- }
323
- F.value = !0, R.value = void 0;
324
- try {
325
- if (k.value = await u.crud.view(S), k.value.roleKind === "group") return;
326
- if (k.value.roleKind === "dataGrant") {
327
- let [e, t] = await Promise.all([y.dataGrantActionMatrix(S), y.dataScopePolicyCatalog(S)]);
328
- N.value = O?.dataGrantMatrix ?? e, P.value = t, z.value = JSON.stringify(e.actions);
329
- return;
330
- }
331
- A.value = (await y.authorizationModules(S)).records, j.value = O?.selectedModuleAlias ?? A.value[0]?.moduleAlias;
332
- } catch (e) {
333
- R.value = "授权信息加载失败,请重试。", o(e, {
334
- source: "role-authorization",
335
- phase: "load"
336
- });
337
- } finally {
338
- F.value = !1;
339
- }
340
- }
341
- async function Qe() {
342
- let e = j.value;
343
- if (!(!e || W.value || U.value)) {
344
- I.value = !0;
345
- try {
346
- let [t, n] = await Promise.all([y.permissionMatrix(S, [e]), y.dataScopePolicyCatalog(S, e)]), r = (t.modules[0]?.actions ?? []).map(st), i = O?.actionDrafts?.find((t) => t.moduleAlias === e)?.actions;
347
- M.value = B.get(e) ?? i ?? r, B.has(e) || (B.set(e, M.value), V.set(e, O?.actionSnapshots?.find((t) => t.moduleAlias === e)?.snapshot ?? JSON.stringify(r))), H.value += 1, P.value = n;
348
- } catch (e) {
349
- o(e, {
350
- source: "role-authorization",
351
- phase: "load"
352
- });
353
- } finally {
354
- I.value = !1;
355
- }
356
- }
357
- }
358
- function Q(e, t) {
359
- t && e.dataAuth && G.value && !e.dataScopePolicy && (e.dataScopePolicy = "inheritDataGrant"), t && e.dataScopePolicy === "referenceDependency" && !e.referenceFieldId && (e.dataScopePolicy = "inheritDataGrant"), e.granted = t, H.value += 1;
360
- }
361
- function $e(e) {
362
- M.value.forEach((t) => Q(t, e));
363
- }
364
- function et(e, t) {
365
- if (e.dataScopePolicy = String(t || "none"), e.dataScopePolicy === "referenceDependency") {
366
- e.referenceFieldId = void 0, e.referenceActionCode = void 0, H.value += 1;
367
- return;
368
- }
369
- e.referenceFieldId = void 0, e.referenceActionCode = void 0, H.value += 1;
370
- }
371
- function tt(e, t) {
372
- let n = Be.value.get(String(t || ""));
373
- e.referenceFieldId = n?.referenceFieldId, e.referenceActionCode = n?.referenceActionCode, H.value += 1;
374
- }
375
- function nt(e) {
376
- return Be.value.get(String(e || ""));
377
- }
378
- function rt(e) {
379
- return typeof e == "string" || typeof e == "number" ? e : void 0;
380
- }
381
- function it(e) {
382
- return e.dataScopePolicy ?? "inheritDataGrant";
383
- }
384
- function at(e) {
385
- return !!e.dataAuth && G.value;
386
- }
387
- function ot(e, t) {
388
- return e.key === "dataScopePolicy" && at(t);
389
- }
390
- function st(e) {
391
- return G.value && e.dataAuth && e.dataScopePolicy === "none" ? {
392
- ...e,
393
- dataScopePolicy: "inheritDataGrant"
394
- } : e;
395
- }
396
- async function ct() {
397
- if (N.value) {
398
- L.value = !0;
399
- try {
400
- await ie(await y.replaceDataGrantActions(S, N.value.actions.map((e) => ({
401
- actionCode: e.actionCode,
402
- dataScopePolicy: e.dataScopePolicy,
403
- enabled: e.configured
404
- }))), {
405
- source: "role-authorization",
406
- phase: "action",
407
- fallbackMessage: "数据权限模板已保存"
408
- }), z.value = JSON.stringify(N.value.actions);
409
- } catch (e) {
410
- o(e, {
411
- source: "role-authorization",
412
- phase: "action"
413
- });
414
- } finally {
415
- L.value = !1;
416
- }
417
- }
418
- }
419
- async function lt() {
420
- let e = [...B.entries()].filter(([e, t]) => V.get(e) !== JSON.stringify(t));
421
- if (e.length) {
422
- L.value = !0;
423
- try {
424
- await ie(await y.replacePermissionMatrix(S, e.flatMap(([e, t]) => t.map((t) => ({
425
- moduleAlias: e,
426
- actionCode: t.actionCode,
427
- granted: !!t.granted,
428
- dataScopePolicy: t.granted && t.dataAuth && G.value ? t.dataScopePolicy ?? "inheritDataGrant" : void 0,
429
- referenceFieldId: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceFieldId : void 0,
430
- referenceActionCode: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceActionCode : void 0
431
- })))), {
432
- source: "role-authorization",
433
- phase: "action",
434
- fallbackMessage: "角色授权已保存"
435
- }), e.forEach(([e, t]) => V.set(e, JSON.stringify(t))), H.value += 1;
436
- } catch (e) {
437
- o(e, {
438
- source: "role-authorization",
439
- phase: "action"
440
- });
441
- } finally {
442
- L.value = !1;
443
- }
444
- }
445
- }
446
- async function $() {
447
- if (W.value) {
448
- await ct();
449
- return;
450
- }
451
- await lt();
452
- }
453
- async function ut() {
454
- X.value && !await ce({
455
- title: "放弃未确认的授权配置",
456
- content: "当前修改尚未确认,关闭后将丢失这些修改。",
457
- okText: "放弃修改",
458
- danger: !0
459
- }) || pt();
460
- }
461
- function dt() {
462
- pt();
463
- }
464
- function ft(e) {
465
- return X.value ? !1 : (j.value = e.selectedModuleAlias, N.value = e.dataGrantMatrix, B.clear(), V.clear(), e.actionDrafts?.forEach(({ moduleAlias: e, actions: t }) => B.set(e, t)), e.actionSnapshots?.forEach(({ moduleAlias: e, snapshot: t }) => V.set(e, t)), H.value += 1, !0);
466
- }
467
- function pt() {
468
- if (s.drawer === !0) {
469
- de("close");
470
- return;
471
- }
472
- w?.dismiss();
473
- }
474
- function mt(e) {
475
- X.value && (e.preventDefault(), e.returnValue = "");
476
- }
477
- return (r, a) => (b(), p(ve(Ge.value), he(pe(Ke.value)), g({
478
- default: E(() => [h("section", { class: me(["role-authorization-page", { "role-authorization-page--drawer": J.value }]) }, [F.value ? (b(), p(T(ae), {
479
- key: 0,
480
- tip: "加载授权信息"
481
- })) : R.value ? (b(), p(T(re), {
482
- key: 1,
483
- title: "授权页加载失败",
484
- message: R.value
485
- }, null, 8, ["message"])) : U.value ? (b(), p(T(le), {
486
- key: 2,
487
- title: "角色组不独立授权",
488
- description: "角色组只组合成员角色;请到成员角色分别配置动作和数据权限。"
489
- })) : W.value && N.value ? (b(), p(T(c), {
490
- key: 3,
491
- class: "data-grant-content",
492
- title: Y.value ? "数据权限模板" : `数据权限模板 - ${K.value}`,
493
- searchable: !1,
494
- onRefresh: Z
495
- }, {
496
- default: E(() => [h("header", Ee, [a[3] ||= h("div", null, [h("h3", null, "标准动作的数据范围模板"), h("p", null, "模板只会在具体任职的普通角色动作选择“继承数据授权角色”时生效。")], -1), Y.value ? fe("v-if", !0) : (b(), p(T(e), {
497
- key: 0,
498
- type: "primary",
499
- disabled: !X.value,
500
- loading: L.value,
501
- onClick: $
502
- }, {
503
- default: E(() => [...a[2] ||= [_(" 确认 ", -1)]]),
504
- _: 1
505
- }, 8, ["disabled", "loading"]))]), v(T(ne), {
506
- columns: He,
507
- rows: We.value,
508
- "row-key": "actionCode",
509
- "horizontal-scroll": ""
510
- }, {
511
- cell: E(({ column: e, record: n }) => [e.key === "title" ? (b(), m(d, { key: 0 }, [h("strong", null, C(n.title || n.actionCode), 1), h("small", null, C(n.actionCode), 1)], 64)) : e.key === "configured" ? (b(), p(T(i), {
512
- key: 1,
513
- checked: !!n.configured,
514
- disabled: L.value,
515
- onChange: (e) => n.configured = e
516
- }, null, 8, [
517
- "checked",
518
- "disabled",
519
- "onChange"
520
- ])) : (b(), p(T(t), {
521
- key: 2,
522
- value: n.dataScopePolicy,
523
- options: Re.value,
524
- disabled: !n.configured || L.value,
525
- placeholder: "请选择数据范围",
526
- "allow-clear": !1,
527
- "onUpdate:value": (e) => n.dataScopePolicy = String(e || "")
528
- }, null, 8, [
529
- "value",
530
- "options",
531
- "disabled",
532
- "onUpdate:value"
533
- ]))]),
534
- _: 1
535
- }, 8, ["rows"])]),
536
- _: 1
537
- }, 8, ["title"])) : (b(), m("section", De, [v(T(c), {
538
- class: "module-panel",
539
- title: "模块树",
540
- "refresh-title": "刷新模块目录",
541
- searchable: !1,
542
- onRefresh: Z
543
- }, {
544
- default: E(() => [v(T(se), {
545
- records: Le.value,
546
- "selected-id": j.value,
547
- onSelect: a[0] ||= (e) => j.value = e.id
548
- }, null, 8, ["records", "selected-id"])]),
549
- _: 1
550
- }), v(T(c), {
551
- class: "action-panel",
552
- title: Fe.value,
553
- searchable: !1
554
- }, g({
555
- default: E(() => [I.value ? (b(), p(T(ae), {
556
- key: 0,
557
- tip: "加载模块动作"
558
- })) : j.value ? (b(), p(T(ne), {
559
- key: 2,
560
- columns: Ve,
561
- rows: Ue.value,
562
- "row-key": "actionCode",
563
- "fill-height": "",
564
- "horizontal-scroll": ""
565
- }, {
566
- header: E(({ column: e }) => [e.key === "granted" ? (b(), m("span", Oe, [v(T(n), {
567
- checked: Ye.value,
568
- indeterminate: Xe.value,
569
- disabled: L.value || !M.value.length,
570
- "aria-label": "全选当前模块动作授权",
571
- onChange: $e
572
- }, null, 8, [
573
- "checked",
574
- "indeterminate",
575
- "disabled"
576
- ]), a[5] ||= _(" 授权 ", -1)])) : (b(), m(d, { key: 1 }, [_(C(e.title), 1)], 64))]),
577
- cell: E(({ column: e, record: r }) => [e.key === "title" ? (b(), m(d, { key: 0 }, [h("strong", null, C(r.title || r.actionCode), 1), h("small", null, C(r.permissionActionCode || r.actionCode), 1)], 64)) : e.key === "granted" ? (b(), p(T(n), {
578
- key: 1,
579
- checked: !!r.granted,
580
- disabled: L.value,
581
- onChange: (e) => Q(r, e)
582
- }, null, 8, [
583
- "checked",
584
- "disabled",
585
- "onChange"
586
- ])) : r.dataAuth && G.value && r.granted ? (b(), m("div", ke, [v(T(t), {
587
- value: it(r),
588
- options: Re.value,
589
- disabled: L.value,
590
- "allow-clear": !1,
591
- "onUpdate:value": (e) => et(r, e)
592
- }, null, 8, [
593
- "value",
594
- "options",
595
- "disabled",
596
- "onUpdate:value"
597
- ]), r.dataScopePolicy === "referenceDependency" ? (b(), m(d, { key: 0 }, [v(T(t), {
598
- value: rt(r.referenceFieldId),
599
- options: ze.value,
600
- disabled: L.value,
601
- placeholder: "请选择引用字段",
602
- "allow-clear": !1,
603
- "onUpdate:value": (e) => tt(r, e)
604
- }, null, 8, [
605
- "value",
606
- "options",
607
- "disabled",
608
- "onUpdate:value"
609
- ]), r.referenceFieldId ? (b(), m("small", Ae, " 依赖目标:" + C(nt(r.referenceFieldId)?.targetModuleTitle) + " · " + C(nt(r.referenceFieldId)?.referenceActionTitle), 1)) : (b(), m("small", je, "请先选择引用字段,再开启该动作授权。"))], 64)) : fe("v-if", !0)])) : ot(e, r) ? (b(), m("span", Me, "—")) : (b(), m("span", Ne, "不适用"))]),
610
- _: 1
611
- }, 8, ["rows"])) : (b(), p(T(le), {
612
- key: 1,
613
- title: "请选择模块"
614
- }))]),
615
- _: 2
616
- }, [Y.value ? void 0 : {
617
- name: "actions",
618
- fn: E(() => [v(T(e), {
619
- type: "primary",
620
- disabled: !X.value,
621
- loading: L.value,
622
- onClick: $
623
- }, {
624
- default: E(() => [...a[4] ||= [_(" 确认 ", -1)]]),
625
- _: 1
626
- }, 8, ["disabled", "loading"])]),
627
- key: "0"
628
- }]), 1032, ["title"])]))], 2)]),
629
- _: 2
630
- }, [Y.value && !U.value ? {
631
- name: "operation",
632
- fn: E(() => [v(T(e), {
633
- type: "primary",
634
- disabled: !X.value,
635
- loading: L.value,
636
- onClick: $
637
- }, {
638
- default: E(() => [...a[1] ||= [_(" 确认 ", -1)]]),
639
- _: 1
640
- }, 8, ["disabled", "loading"])]),
641
- key: "0"
642
- } : void 0]), 1040));
643
- }
644
- }), L = /* @__PURE__ */ s({ default: () => R }), R = /*#__PURE__*/ r(I, [["__scopeId", "data-v-8b9dc5d9"]]);
645
- //#endregion
646
- export { N as a, M as i, L as n, Se as o, j as r, xe as s, R as t };
@@ -1,26 +0,0 @@
1
- import { t as e } from "./RoleManagementView-0_KDrzgh.js";
2
- import { createBlock as t, defineComponent as n, openBlock as r } from "vue";
3
- //#endregion
4
- //#region src/views/RoleDetailWorkspaceView.vue
5
- var i = /* @__PURE__ */ n({
6
- name: "RoleDetailWorkspaceView",
7
- __name: "RoleDetailWorkspaceView",
8
- props: {
9
- recordId: {},
10
- scopeKind: {},
11
- scopeId: {}
12
- },
13
- setup(n) {
14
- return (i, a) => (r(), t(e, {
15
- "record-id": n.recordId,
16
- "scope-kind": n.scopeKind,
17
- "scope-id": n.scopeId
18
- }, null, 8, [
19
- "record-id",
20
- "scope-kind",
21
- "scope-id"
22
- ]));
23
- }
24
- });
25
- //#endregion
26
- export { i as default };