@ximatai/muyun-web-app 0.26.14 → 0.26.16

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 (312) hide show
  1. package/dist/BusinessActivityLogView-DVM_GB5y.js +18 -0
  2. package/dist/BusinessLogListDrawer-BciMLY9z.js +864 -0
  3. package/dist/ConfigurationTranslationView-B0FosDyz.js +197 -0
  4. package/dist/LoginAuditLogView-3tAozKlC.js +18 -0
  5. package/dist/ModuleActionManagementView-CJRNShGg.js +755 -0
  6. package/dist/ModuleGovernanceView-DsqR_Sj7.js +34098 -0
  7. package/dist/RequestErrorLogView-C4yH-TSX.js +18 -0
  8. package/dist/RoleDetailWorkspaceView-BpOoGUwS.js +1435 -0
  9. package/dist/RuntimeLogView-CoKKpJ39.js +316 -0
  10. package/dist/WorkflowAdministrationView-DmUV6vWS.js +650 -0
  11. package/dist/WorkflowConfigurationView-pghDbWEh.js +975 -0
  12. package/dist/WorkflowWorkbenchView-BwWxyDen.js +747 -0
  13. package/dist/es-BST-ixpj.js +22621 -0
  14. package/dist/index.css +1 -1
  15. package/dist/index.js +920 -738
  16. package/dist/moduleGovernanceWorkspaceView-DGEV3ZyT.js +667 -0
  17. package/dist/platform-components-Cl5ZZiuU.js +27139 -0
  18. package/dist/platform-workbench-CAHoriIf.js +20245 -0
  19. package/dist/rolldown-runtime-BAC7EHh5.js +20 -0
  20. package/dist/types/app/ChangeOwnPasswordDialog.vue.d.ts +1 -1
  21. package/dist/types/app/CurrentUserProfileDialog.vue.d.ts +2 -2
  22. package/dist/types/app/ThemeSkinPreferencesDialog.vue.d.ts +3 -0
  23. package/dist/types/app/businessNotificationNavigation.d.ts +4 -0
  24. package/dist/types/app/menuRouteCompiler.d.ts +3 -0
  25. package/dist/types/app/platformMessage.d.ts +3 -6
  26. package/dist/types/app/themeSkinPreference.d.ts +3 -2
  27. package/dist/types/app/useWorkbenchMenuRefresh.d.ts +4 -0
  28. package/dist/types/app/workbenchMenuRefresh.d.ts +14 -0
  29. package/dist/types/app/workbenchStartup.d.ts +8 -4
  30. package/dist/types/consumer/AppWorkbenchShell.vue.d.ts +5 -3
  31. package/dist/types/consumer/index.d.ts +3 -1
  32. package/dist/types/dynamic-page-runtime/ManagedDetailRelationInlineSurface.vue.d.ts +4 -4
  33. package/dist/types/dynamic-page-runtime/ManagedDetailRelationSurface.vue.d.ts +1 -1
  34. package/dist/types/dynamic-page-runtime/ModuleDataExchangeSurface.vue.d.ts +17 -0
  35. package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +464 -1240
  36. package/dist/types/dynamic-page-runtime/ModulePageDetailRelations.vue.d.ts +4 -3
  37. package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +859 -1566
  38. package/dist/types/dynamic-page-runtime/ModulePageListExpansionSurface.vue.d.ts +1 -0
  39. package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansion.vue.d.ts +2 -1
  40. package/dist/types/dynamic-page-runtime/ModulePageListRelationExpansions.vue.d.ts +1 -0
  41. package/dist/types/dynamic-page-runtime/ModulePageRecordContent.vue.d.ts +20 -3
  42. package/dist/types/dynamic-page-runtime/ModuleRecordDetailActions.vue.d.ts +7 -1
  43. package/dist/types/dynamic-page-runtime/NavigatorManagementEditor.vue.d.ts +1 -1
  44. package/dist/types/dynamic-page-runtime/NavigatorPanelActions.vue.d.ts +1 -1
  45. package/dist/types/dynamic-page-runtime/PageNavigatorExplorer.vue.d.ts +7 -5
  46. package/dist/types/dynamic-page-runtime/RecordFormSurface.vue.d.ts +2 -0
  47. package/dist/types/dynamic-page-runtime/TenantScopeExplorer.vue.d.ts +1 -1
  48. package/dist/types/dynamic-page-runtime/assistantBusinessScope.d.ts +3 -0
  49. package/dist/types/dynamic-page-runtime/assistantQueryCapabilities.d.ts +34 -0
  50. package/dist/types/dynamic-page-runtime/assistantRecordEditorPolicy.d.ts +2 -2
  51. package/dist/types/dynamic-page-runtime/composables/useModulePageBootstrap.d.ts +4 -3
  52. package/dist/types/dynamic-page-runtime/composables/useModulePageFormContributionRuntime.d.ts +2 -0
  53. package/dist/types/dynamic-page-runtime/composables/useNavigatorRuntime.d.ts +15 -1217
  54. package/dist/types/dynamic-page-runtime/formActionResult.d.ts +2 -1
  55. package/dist/types/dynamic-page-runtime/formComputeCoordinator.d.ts +2 -0
  56. package/dist/types/dynamic-page-runtime/formValidationCoordinator.d.ts +1 -1
  57. package/dist/types/dynamic-page-runtime/modulePageAssistantScope.d.ts +13 -1
  58. package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +13 -4
  59. package/dist/types/dynamic-page-runtime/modulePageUnsavedState.d.ts +3 -10
  60. package/dist/types/dynamic-page-runtime/pageActionInvocation.d.ts +2 -1
  61. package/dist/types/dynamic-page-runtime/pageActionPlacement.d.ts +2 -1
  62. package/dist/types/dynamic-page-runtime/pageNavigatorItemModel.d.ts +2 -1
  63. package/dist/types/dynamic-page-runtime/recordCreationReadiness.d.ts +18 -0
  64. package/dist/types/dynamic-page-runtime/recordDisplayProjection.d.ts +63 -0
  65. package/dist/types/dynamic-page-runtime/recordFormAssistantCapabilities.d.ts +60 -0
  66. package/dist/types/dynamic-page-runtime/recordFormDraftAccess.d.ts +36 -0
  67. package/dist/types/dynamic-page-runtime/recordMutationPayload.d.ts +2 -2
  68. package/dist/types/dynamic-page-runtime/recordReferenceDisplay.d.ts +8 -0
  69. package/dist/types/dynamic-page-runtime/recordSaveRecovery.d.ts +13 -0
  70. package/dist/types/dynamic-page-runtime/relationDraftAssistantCapabilities.d.ts +9 -0
  71. package/dist/types/dynamic-page-runtime/relationDraftController.d.ts +23 -0
  72. package/dist/types/dynamic-page-runtime/relationFormComputeCoordinator.d.ts +1 -0
  73. package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +246 -1227
  74. package/dist/types/dynamic-page-runtime/useModuleRecordDataChanges.d.ts +13 -0
  75. package/dist/types/formula/FormulaRuntime.d.ts +3 -1
  76. package/dist/types/platform-admin-runtime/backendHttp.d.ts +6 -1
  77. package/dist/types/platform-admin-runtime/index.d.ts +3 -1
  78. package/dist/types/platform-admin-runtime/module-menu/ModuleMenuEditor.vue.d.ts +17 -0
  79. package/dist/types/platform-admin-runtime/module-menu/ModuleMenuGovernanceSurface.vue.d.ts +6 -0
  80. package/dist/types/platform-admin-runtime/module-menu/moduleMenuClient.d.ts +8 -4
  81. package/dist/types/platform-admin-runtime/module-menu/moduleMenuReceiptStore.d.ts +6 -0
  82. package/dist/types/platform-admin-runtime/module-menu/moduleMenuSession.d.ts +65 -0
  83. package/dist/types/platform-admin-runtime/module-menu/moduleMenuWorkspace.d.ts +189 -0
  84. package/dist/types/platform-admin-runtime/moduleOpenApi.d.ts +4 -3
  85. package/dist/types/platform-admin-runtime/pageRealtime.d.ts +0 -1
  86. package/dist/types/platform-admin-runtime/realtime.d.ts +0 -3
  87. package/dist/types/platform-admin-runtime/role/roleScopeSelectionClient.d.ts +4 -1
  88. package/dist/types/platform-admin-runtime/sessionRecovery.d.ts +3 -1
  89. package/dist/types/platform-admin-runtime/user/useUserSessionRows.d.ts +2 -0
  90. package/dist/types/platform-admin-runtime/user/userOnlineStatusStore.d.ts +1 -5
  91. package/dist/types/platform-admin-runtime/workspaceViewSessions.d.ts +1 -1
  92. package/dist/types/platform-components/BusinessNotificationPanel.vue.d.ts +34 -1
  93. package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +7 -11
  94. package/dist/types/platform-components/DateTimeText.vue.d.ts +1 -1
  95. package/dist/types/platform-components/DetailRelationListPanel.vue.d.ts +1 -1
  96. package/dist/types/platform-components/DictionaryPicker.vue.d.ts +4 -2
  97. package/dist/types/platform-components/FileSizeText.vue.d.ts +1 -1
  98. package/dist/types/platform-components/FileTransferUploader.vue.d.ts +1 -1
  99. package/dist/types/platform-components/FormulaExpressionEditor.vue.d.ts +7 -7
  100. package/dist/types/platform-components/ManagementPanelHeader.vue.d.ts +6 -4
  101. package/dist/types/platform-components/ManagementTabs.vue.d.ts +20 -0
  102. package/dist/types/platform-components/ModuleActionButton.vue.d.ts +2 -2
  103. package/dist/types/platform-components/ObjectPickerInput.vue.d.ts +2 -0
  104. package/dist/types/platform-components/QueryCriteriaComposer.vue.d.ts +1 -1
  105. package/dist/types/platform-components/QueryCriteriaGroupEditor.vue.d.ts +1 -1
  106. package/dist/types/platform-components/QueryValueEditor.vue.d.ts +1 -1
  107. package/dist/types/platform-components/RecordActionBar.vue.d.ts +1 -1
  108. package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +2 -2
  109. package/dist/types/platform-components/RecordDetailFields.vue.d.ts +1 -1
  110. package/dist/types/platform-components/RecordExpandedSubtable.vue.d.ts +2 -2
  111. package/dist/types/platform-components/RecordExplorerPanel.vue.d.ts +15 -9
  112. package/dist/types/platform-components/RecordExplorerTools.vue.d.ts +27 -0
  113. package/dist/types/platform-components/RecordFileReferenceTransfer.vue.d.ts +1 -1
  114. package/dist/types/platform-components/RecordFormFields.vue.d.ts +6 -2
  115. package/dist/types/platform-components/RecordImageFileReferencePreview.vue.d.ts +1 -1
  116. package/dist/types/platform-components/RecordListExplorer.vue.d.ts +1 -1
  117. package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +6 -6
  118. package/dist/types/platform-components/RecordMultiPicker.vue.d.ts +3 -1
  119. package/dist/types/platform-components/RecordPanelButton.vue.d.ts +1 -1
  120. package/dist/types/platform-components/RecordPermissionDialog.vue.d.ts +1 -1
  121. package/dist/types/platform-components/RecordPicker.vue.d.ts +3 -1
  122. package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +7 -7
  123. package/dist/types/platform-components/RecordQueryListSurface.vue.d.ts +3 -3
  124. package/dist/types/platform-components/RecordRelationTabs.vue.d.ts +1 -0
  125. package/dist/types/platform-components/ReferencePicker.vue.d.ts +5 -3
  126. package/dist/types/platform-components/ReferenceRecordDetailBrowser.vue.d.ts +1 -1
  127. package/dist/types/platform-components/ScopedTreePicker.vue.d.ts +1 -1
  128. package/dist/types/platform-components/SingleImageFileReferenceField.vue.d.ts +1 -1
  129. package/dist/types/platform-components/StaticManagementLayout.vue.d.ts +2 -0
  130. package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +5 -5
  131. package/dist/types/platform-components/UserPicker.vue.d.ts +2 -2
  132. package/dist/types/platform-components/UserSessionExpandedSubtable.vue.d.ts +1 -1
  133. package/dist/types/platform-components/WorkflowBusinessTaskEditor.vue.d.ts +36 -0
  134. package/dist/types/platform-components/WorkflowDesignProperties.vue.d.ts +40 -0
  135. package/dist/types/platform-components/WorkflowDiagram.vue.d.ts +24 -0
  136. package/dist/types/platform-components/WorkflowParticipantEditor.vue.d.ts +18 -0
  137. package/dist/types/platform-components/WorkflowRecordPanel.vue.d.ts +30 -0
  138. package/dist/types/platform-components/WorkflowTimeline.vue.d.ts +19 -0
  139. package/dist/types/platform-components/crudRecordListModel.d.ts +2 -1
  140. package/dist/types/platform-components/fileTransferUpload.d.ts +10 -0
  141. package/dist/types/platform-components/index.d.ts +15 -4
  142. package/dist/types/platform-components/optionFieldOptionCache.d.ts +1 -1
  143. package/dist/types/platform-components/optionFieldOptions.d.ts +7 -2
  144. package/dist/types/platform-components/platformDateTime.d.ts +2 -0
  145. package/dist/types/platform-components/platformErrorFeedback.d.ts +2 -1
  146. package/dist/types/platform-components/queryNumericValue.d.ts +3 -0
  147. package/dist/types/platform-components/readonlyReferenceDisplay.d.ts +10 -2
  148. package/dist/types/platform-components/recordActionBarModel.d.ts +4 -1
  149. package/dist/types/platform-components/recordDetailFieldModel.d.ts +4 -0
  150. package/dist/types/platform-components/recordFormFieldModel.d.ts +23 -1
  151. package/dist/types/platform-components/recordPickerConstraints.d.ts +4 -1
  152. package/dist/types/platform-components/recordQueryListColumnModel.d.ts +6 -1
  153. package/dist/types/platform-components/recordQueryListQueryController.d.ts +19 -2
  154. package/dist/types/platform-components/recordQueryListStandardQuery.d.ts +3 -0
  155. package/dist/types/platform-components/recycleBinState.d.ts +20 -2
  156. package/dist/types/platform-components/referencePickerModel.d.ts +9 -0
  157. package/dist/types/platform-components/referencePickerReadError.d.ts +11 -3
  158. package/dist/types/platform-components/referenceRecordDetailBrowser.d.ts +2 -2
  159. package/dist/types/platform-components/softDeletedConflictHandler.d.ts +3 -1
  160. package/dist/types/platform-components/staticCrudManagementState.d.ts +9 -8
  161. package/dist/types/platform-components/treeRecordModel.d.ts +2 -1
  162. package/dist/types/platform-components/userSessionPresentation.d.ts +4 -3
  163. package/dist/types/platform-components/workflowAccountOptions.d.ts +4 -0
  164. package/dist/types/platform-components/workflowDesignEditing.d.ts +11 -0
  165. package/dist/types/platform-components/workflowDiagramModel.d.ts +41 -0
  166. package/dist/types/platform-components/workflowParticipantPolicy.d.ts +11 -0
  167. package/dist/types/platform-components/workflowPresentation.d.ts +11 -0
  168. package/dist/types/platform-workbench/ConstructionPlanCard.vue.d.ts +8 -0
  169. package/dist/types/platform-workbench/LanguageSelector.vue.d.ts +6 -0
  170. package/dist/types/platform-workbench/Workbench.vue.d.ts +9 -4
  171. package/dist/types/platform-workbench/WorkbenchAssistantPanel.vue.d.ts +7 -1
  172. package/dist/types/platform-workbench/WorkbenchMenu.vue.d.ts +1 -1
  173. package/dist/types/platform-workbench/assistantControlText.d.ts +19 -0
  174. package/dist/types/platform-workbench/configurationCollaboration.d.ts +23 -0
  175. package/dist/types/platform-workbench/constructionDelivery.d.ts +3 -0
  176. package/dist/types/platform-workbench/constructionFields.d.ts +5 -0
  177. package/dist/types/platform-workbench/constructionInitialization.d.ts +4 -0
  178. package/dist/types/platform-workbench/constructionPlanGuard.d.ts +22 -0
  179. package/dist/types/platform-workbench/constructionPlanSession.d.ts +103 -0
  180. package/dist/types/platform-workbench/constructionPresentation.d.ts +6 -0
  181. package/dist/types/platform-workbench/constructionReferenceDiscovery.d.ts +3 -0
  182. package/dist/types/platform-workbench/index.d.ts +2 -1
  183. package/dist/types/platform-workbench/menuNavigation.d.ts +7 -3
  184. package/dist/types/platform-workbench/menuTreeModel.d.ts +2 -1
  185. package/dist/types/platform-workbench/realtimeStatus.d.ts +2 -1
  186. package/dist/types/platform-workbench/useAssistantConversation.d.ts +452 -0
  187. package/dist/types/platform-workbench/useAssistantConversationArchive.d.ts +40 -0
  188. package/dist/types/platform-workbench/useWorkspaceViewUnsavedState.d.ts +1 -5
  189. package/dist/types/platform-workbench/workbenchAssistantCapabilities.d.ts +21 -1
  190. package/dist/types/platform-workbench/workbenchNavigation.d.ts +1 -0
  191. package/dist/types/platform-workbench/workspaceViewContract.d.ts +4 -0
  192. package/dist/types/platform-workbench/workspaceViewDiscardGuard.d.ts +5 -0
  193. package/dist/types/platform-workbench/workspaceViewHost.d.ts +1 -1
  194. package/dist/types/platform-workbench/workspaceViewUnsavedState.d.ts +1 -1
  195. package/dist/types/platform-workbench/workspaceViews.d.ts +3 -2
  196. package/dist/types/views/ConfigurationTranslationView.vue.d.ts +3 -0
  197. package/dist/types/views/MetadataSourceTree.vue.d.ts +7 -5
  198. package/dist/types/views/ModuleRuntimeActivationStatus.vue.d.ts +11 -0
  199. package/dist/types/views/PageCompositionDescriptorPreview.vue.d.ts +8 -8
  200. package/dist/types/views/PageCompositionEditor.vue.d.ts +10 -0
  201. package/dist/types/views/PageCompositionTree.vue.d.ts +19 -13
  202. package/dist/types/views/PageQuerySummaryEditor.vue.d.ts +2 -2
  203. package/dist/types/views/RoleAuthorizationView.vue.d.ts +1 -1
  204. package/dist/types/views/WorkflowAdministrationView.vue.d.ts +3 -0
  205. package/dist/types/views/WorkflowConfigurationView.vue.d.ts +7 -0
  206. package/dist/types/views/WorkflowWorkbenchView.vue.d.ts +3 -0
  207. package/dist/types/views/businessLogClient.d.ts +5 -2
  208. package/dist/types/views/businessRuleAssistantSurface.d.ts +7 -0
  209. package/dist/types/views/businessRuleEditor.d.ts +23 -0
  210. package/dist/types/views/businessRuleGovernance.d.ts +20 -4
  211. package/dist/types/views/businessRuleSession.d.ts +64 -0
  212. package/dist/types/views/businessRuleWorkspace.d.ts +148 -0
  213. package/dist/types/views/configurationEditorNavigation.d.ts +3 -0
  214. package/dist/types/views/configurationTranslationWorkspace.d.ts +69 -0
  215. package/dist/types/views/dictionaryRadioEligibility.d.ts +2 -1
  216. package/dist/types/views/metadataChangeSetSubmission.d.ts +11 -0
  217. package/dist/types/views/metadataEditorSession.d.ts +658 -0
  218. package/dist/types/views/metadataGovernanceAssistantSurface.d.ts +2 -120
  219. package/dist/types/views/metadataGovernanceEditor.d.ts +224 -0
  220. package/dist/types/views/metadataModelEditSession.d.ts +29 -3
  221. package/dist/types/views/metadataModelTree.d.ts +2 -1
  222. package/dist/types/views/metadataNaming.d.ts +10 -1
  223. package/dist/types/views/metadataOrchestrationState.d.ts +32 -9
  224. package/dist/types/views/metadataSourceTree.d.ts +3 -2
  225. package/dist/types/views/metadataWorkspace.d.ts +1323 -0
  226. package/dist/types/views/moduleGovernanceWorkspaceView.d.ts +1 -1
  227. package/dist/types/views/moduleRuntimeActivation.d.ts +11 -0
  228. package/dist/types/views/pageCompositionAssistantSurface.d.ts +29 -0
  229. package/dist/types/views/pageCompositionCandidate.d.ts +48 -0
  230. package/dist/types/views/pageCompositionComponents.d.ts +43 -0
  231. package/dist/types/views/pageCompositionDraftState.d.ts +297 -14
  232. package/dist/types/views/pageCompositionDragPayload.d.ts +7 -1
  233. package/dist/types/views/pageCompositionMode.d.ts +27 -3
  234. package/dist/types/views/pageCompositionPlacement.d.ts +6 -1
  235. package/dist/types/views/pageCompositionPublication.d.ts +39 -0
  236. package/dist/types/views/pageCompositionSession.d.ts +1374 -0
  237. package/dist/types/views/pageCompositionWorkspace.d.ts +2616 -0
  238. package/dist/types/views/roleAuthorizationWorkspaceSession.d.ts +1 -1
  239. package/dist/types/views/roleDetailWorkspaceSession.d.ts +1 -1
  240. package/dist/types/views/runtimeLogClient.d.ts +2 -2
  241. package/dist/types/views/usePageCompositionComponents.d.ts +69 -0
  242. package/dist/types/views/workflowConfigurationWorkspaceView.d.ts +5 -0
  243. package/dist/types/vue-ui-antdv/blockingOverlays.d.ts +9 -0
  244. package/dist/types/vue-ui-antdv/components/UiButton.vue.d.ts +1 -1
  245. package/dist/types/vue-ui-antdv/components/UiDataTable.vue.d.ts +2 -2
  246. package/dist/types/vue-ui-antdv/components/UiInput.vue.d.ts +1 -0
  247. package/dist/types/vue-ui-antdv/components/UiLanguageProvider.vue.d.ts +18 -0
  248. package/dist/types/vue-ui-antdv/components/UiModal.vue.d.ts +3 -3
  249. package/dist/types/vue-ui-antdv/components/UiRecordExplorerItem.vue.d.ts +2 -2
  250. package/dist/types/vue-ui-antdv/components/UiSearchInput.vue.d.ts +3 -1
  251. package/dist/types/vue-ui-antdv/components/UiSelect.vue.d.ts +3 -1
  252. package/dist/types/vue-ui-antdv/components/UiSidePanel.vue.d.ts +3 -0
  253. package/dist/types/vue-ui-antdv/components/UiTextArea.vue.d.ts +9 -7
  254. package/dist/types/vue-ui-antdv/components/UiTokenInput.vue.d.ts +7 -7
  255. package/dist/types/vue-ui-antdv/components/UiTree.vue.d.ts +1 -1
  256. package/dist/types/vue-ui-antdv/components/UiTreeSelect.vue.d.ts +3 -1
  257. package/dist/types/vue-ui-antdv/confirm.d.ts +3 -2
  258. package/dist/types/vue-ui-antdv/index.d.ts +3 -0
  259. package/dist/types/vue-ui-antdv/languageGlobalScope.d.ts +3 -0
  260. package/dist/types/vue-ui-antdv/languageLocales.d.ts +4 -0
  261. package/dist/types/vue-ui-antdv/theme.d.ts +2 -0
  262. package/dist/types/vue-ui-antdv/types.d.ts +6 -0
  263. package/dist/types/web-contracts/assistant.d.ts +29 -1
  264. package/dist/types/web-contracts/constructionPlan.d.ts +213 -0
  265. package/dist/types/web-contracts/index.d.ts +78 -0
  266. package/dist/types/web-contracts/operation.d.ts +33 -0
  267. package/dist/types/web-contracts/referenceTarget.d.ts +13 -0
  268. package/dist/types/web-contracts/workflow.d.ts +346 -0
  269. package/dist/types/web-core/actionResult.d.ts +3 -0
  270. package/dist/types/web-core/assistantCapabilityCatalog.d.ts +22 -0
  271. package/dist/types/web-core/assistantCatalogPage.d.ts +12 -0
  272. package/dist/types/web-core/assistantConfirmation.d.ts +24 -0
  273. package/dist/types/web-core/assistantConversationClient.d.ts +50 -0
  274. package/dist/types/web-core/assistantRuntime.d.ts +53 -7
  275. package/dist/types/web-core/assistantSurface.d.ts +80 -9
  276. package/dist/types/web-core/assistantTurnClient.d.ts +9 -1
  277. package/dist/types/web-core/constructionPlanClient.d.ts +55 -0
  278. package/dist/types/web-core/errors.d.ts +9 -3
  279. package/dist/types/web-core/http.d.ts +1 -0
  280. package/dist/types/web-core/index.d.ts +14 -0
  281. package/dist/types/web-core/language.d.ts +54 -0
  282. package/dist/types/web-core/languagePreference.d.ts +8 -0
  283. package/dist/types/web-core/module/dataExchangeClient.d.ts +54 -0
  284. package/dist/types/web-core/module/index.d.ts +2 -0
  285. package/dist/types/web-core/module/moduleContext.d.ts +4 -0
  286. package/dist/types/web-core/module/pageActionEntries.d.ts +3 -2
  287. package/dist/types/web-core/module/runtimeContext.d.ts +15 -2
  288. package/dist/types/web-core/module/staticModuleClient.d.ts +12 -2
  289. package/dist/types/web-core/operationConfirmation.d.ts +32 -0
  290. package/dist/types/web-core/operationErrors.d.ts +23 -0
  291. package/dist/types/web-core/operationReceipt.d.ts +10 -0
  292. package/dist/types/web-core/presentationTexts.d.ts +16 -0
  293. package/dist/types/web-core/sha256.d.ts +2 -0
  294. package/dist/types/web-core/uuid.d.ts +2 -0
  295. package/dist/types/web-core/workflow.d.ts +70 -0
  296. package/dist/types/web-core/workspaceUnsavedState.d.ts +6 -0
  297. package/dist/workspaceViews-BIYGPUAO.js +3437 -0
  298. package/package.json +2 -4
  299. package/dist/BusinessActivityLogView-BUg5WTm-.js +0 -16
  300. package/dist/BusinessLogListDrawer-BOTE_7aT.js +0 -825
  301. package/dist/LoginAuditLogView-DBNtvmIy.js +0 -16
  302. package/dist/ModuleActionManagementView-Bq1VO51Y.js +0 -673
  303. package/dist/ModuleGovernanceView-B8u4_erd.js +0 -29344
  304. package/dist/RequestErrorLogView-BrtH3ptj.js +0 -16
  305. package/dist/RoleDetailWorkspaceView-6LW3tLA1.js +0 -1397
  306. package/dist/RuntimeLogView-s3X5CdHB.js +0 -297
  307. package/dist/moduleGovernanceWorkspaceView-BRgJbUjJ.js +0 -40
  308. package/dist/platform-components-Dt859Hbr.js +0 -18627
  309. package/dist/platform-workbench-DfqFnlm-.js +0 -14701
  310. package/dist/rolldown-runtime-DPVXH0ON.js +0 -17
  311. package/dist/sse-mGbuCAax.js +0 -187
  312. package/dist/workspaceViews-DijY4n32.js +0 -3623
@@ -1,3623 +0,0 @@
1
- import { n as e } from "./rolldown-runtime-DPVXH0ON.js";
2
- import { $t as t, C as n, F as r, Gn as i, Ht as a, I as o, Jn as s, Jt as c, Kn as l, Mt as u, O as d, On as f, Pt as p, Qn as m, T as h, Tn as g, Tr as _, Un as v, Ut as y, Vt as b, Wn as x, Wt as S, Xt as C, Yt as w, dn as T, f as E, fn as ee, gn as D, jt as te, mn as O, on as ne, ot as re, pn as ie, qt as k, sn as A, sr as j, u as ae, vn as M } from "./platform-components-Dt859Hbr.js";
3
- import { i as N, n as P } from "./sse-mGbuCAax.js";
4
- import { K as F, _ as oe, at as I, q as se, s as ce, t as le, u as ue } from "./platform-workbench-DfqFnlm-.js";
5
- import { n as de, r as L } from "./moduleGovernanceWorkspaceView-BRgJbUjJ.js";
6
- import { Fragment as R, computed as z, createBlock as B, createCommentVNode as V, createElementBlock as H, createElementVNode as U, createSlots as fe, createTextVNode as W, createVNode as G, defineAsyncComponent as pe, defineComponent as K, guardReactiveProps as me, mergeProps as he, nextTick as ge, normalizeClass as _e, normalizeProps as ve, onBeforeUnmount as ye, onMounted as be, onUnmounted as xe, openBlock as q, ref as J, renderList as Se, renderSlot as Ce, resolveDynamicComponent as we, toDisplayString as Y, toValue as Te, unref as X, watch as Z, withCtx as Q, withKeys as Ee, withModifiers as De } from "vue";
7
- //#region src/web-core/dataChanges.ts
8
- function Oe(e = {}) {
9
- let t = Math.max(1, e.maxHandledChangeSetIds ?? 1e3), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
10
- return {
11
- async dispatch(e) {
12
- let t = ke(e);
13
- return !t || n.has(t.changeSetId) ? !1 : (i(t.changeSetId), await Promise.allSettled([...r].map((e) => Promise.resolve().then(() => e(t)))), !0);
14
- },
15
- subscribe(e) {
16
- return r.add(e), { unsubscribe() {
17
- r.delete(e);
18
- } };
19
- },
20
- markHandled(e) {
21
- let t = Ae(e);
22
- t && i(t);
23
- }
24
- };
25
- function i(e) {
26
- for (n.delete(e), n.add(e); n.size > t;) {
27
- let e = n.values().next().value;
28
- if (!e) return;
29
- n.delete(e);
30
- }
31
- }
32
- }
33
- function ke(e) {
34
- let t = Ae(e?.changeSetId);
35
- if (t && Array.isArray(e?.changes)) return {
36
- changeSetId: t,
37
- changes: e.changes.filter(je)
38
- };
39
- }
40
- function Ae(e) {
41
- return e?.trim() || void 0;
42
- }
43
- function je(e) {
44
- if (!e || typeof e != "object") return !1;
45
- let t = e.type, n = e.moduleAlias;
46
- return typeof t == "string" && t.trim() !== "" && typeof n == "string" && n.trim() !== "";
47
- }
48
- //#endregion
49
- //#region src/views/roleDetailWorkspaceView.ts
50
- var Me = /* @__PURE__ */ new Set([
51
- "platform",
52
- "tenant",
53
- "organization"
54
- ]), Ne = L({
55
- type: "iam.role.detail",
56
- route: "/iam/role",
57
- moduleAlias: "iam.role",
58
- component: pe(() => import("./RoleDetailWorkspaceView-6LW3tLA1.js")),
59
- layout: "workspace",
60
- routeTitle: "角色管理",
61
- presentations: ["drawer", "tab"],
62
- titleOf: () => "角色详情",
63
- parentRouteQueryOf(e) {
64
- return e.scopeKind === "platform" ? { scopeKind: e.scopeKind } : {
65
- scopeKind: e.scopeKind,
66
- scopeId: e.scopeId
67
- };
68
- },
69
- parse(e) {
70
- let t = e.recordId, n = e.scopeKind, r = e.scopeId;
71
- if (!(typeof t != "string" || !t || typeof n != "string" || !Me.has(n) || (n === "platform" ? r !== void 0 : typeof r != "string" || !r))) return {
72
- recordId: t,
73
- scopeKind: n,
74
- ...typeof r == "string" ? { scopeId: r } : {}
75
- };
76
- }
77
- }), Pe = L({
78
- type: "iam.role.authorization",
79
- route: "/iam/role/authorization",
80
- moduleAlias: "iam.role",
81
- component: pe(() => Promise.resolve().then(() => Tr)),
82
- layout: "workspace",
83
- routeTitle: "角色授权",
84
- drawerProfile: "wide-work",
85
- presentations: ["drawer", "tab"],
86
- titleOf: () => "角色授权",
87
- parse(e) {
88
- let t = e.roleId;
89
- return typeof t == "string" && t ? { roleId: t } : void 0;
90
- }
91
- }), Fe = [Ne, Pe], Ie = L({
92
- type: "platform.module.actions",
93
- route: "/_platform/workspace/platform.module.actions",
94
- moduleAlias: "platform.module",
95
- component: pe(() => import("./ModuleActionManagementView-Bq1VO51Y.js").then((e) => e.n)),
96
- layout: "workspace",
97
- routeTitle: "模块管理",
98
- presentations: ["tab"],
99
- titleOf: (e) => `动作:${e.moduleTitle ?? e.moduleAlias}`,
100
- parentRouteQueryOf: () => ({}),
101
- parse(e) {
102
- let t = e.moduleAlias, n = e.moduleTitle;
103
- if (typeof t == "string" && t) return {
104
- moduleAlias: t,
105
- ...typeof n == "string" && n ? { moduleTitle: n } : {},
106
- ...e.moduleKind === "static" || e.moduleKind === "dynamic" ? { moduleKind: e.moduleKind } : {}
107
- };
108
- }
109
- });
110
- //#endregion
111
- //#region src/platform-admin-runtime/module-menu/moduleMenuClient.ts
112
- function Le(e) {
113
- let t = f(e, { moduleAlias: "platform.menu_scheme" });
114
- return {
115
- async schemes() {
116
- let e = [];
117
- for (let n = 1;; n++) {
118
- let r = await t.query({ page: {
119
- pageNum: n,
120
- pageSize: 100
121
- } });
122
- if (e.push(...r.records), e.length >= r.total || r.records.length === 0) return e;
123
- }
124
- },
125
- async tree(t) {
126
- return (await e.request({
127
- method: "POST",
128
- path: "/platform.menu/tree/query",
129
- headers: { "X-MuYun-Page-Context": JSON.stringify({ scheme: t }) },
130
- body: { externalQueryValues: { schemeId: t } }
131
- })).records;
132
- },
133
- insert(t, n) {
134
- return f(N(e, { "X-MuYun-Page-Context": JSON.stringify({ scheme: t }) }), { moduleAlias: "platform.menu" }).insert(n);
135
- },
136
- visible: () => I(e).mine().then((e) => e.records)
137
- };
138
- }
139
- function $(e, t = "") {
140
- return e.flatMap(({ record: e, children: n }) => {
141
- let r = t ? `${t} / ${e.title}` : e.title;
142
- return [{
143
- menu: e,
144
- path: r
145
- }, ...$(n, r)];
146
- });
147
- }
148
- function Re(e, t = !1) {
149
- return e.map(({ record: e, children: n }) => {
150
- let r = t || e.enabled === !1;
151
- return {
152
- value: e.id,
153
- title: e.title,
154
- disabled: r || !!e.moduleAlias,
155
- children: Re(n, r)
156
- };
157
- });
158
- }
159
- //#endregion
160
- //#region src/platform-admin-runtime/module-menu/ModuleMenuDrawer.vue?vue&type=script&setup=true&lang.ts
161
- var ze = { class: "module-menu-form" }, Be = { key: 0 }, Ve = {
162
- key: 1,
163
- class: "hint"
164
- }, He = {
165
- key: 1,
166
- class: "hint"
167
- }, Ue = {
168
- key: 2,
169
- role: "status"
170
- }, We = {
171
- key: 4,
172
- role: "alert"
173
- }, Ge = /*#__PURE__*/ M(/* @__PURE__ */ K({
174
- __name: "ModuleMenuDrawer",
175
- props: { context: {} },
176
- setup(e) {
177
- let t = e, n = ue(), r = Le(t.context.module.http), i = String(t.context.record?.alias ?? t.context.record?.id ?? ""), a = g({ moduleAlias: i }), o = J(""), s = J(!1), c = J(String(t.context.record?.title ?? i)), l = J([]), u = J(""), d = J("root"), f = J("tab"), p = J([]), m = J(!0), h = J(!1), _ = J(!1), v = J(""), y = J(), b = J(""), x = J(), S = J(!1), C = 0;
178
- ye(() => C++);
179
- let w = z(() => [{
180
- value: "root",
181
- title: "顶层",
182
- children: Re(p.value)
183
- }]), E = z(() => l.value.filter((e) => e.enabled !== !1).map((e) => {
184
- let t = e.title ?? e.alias ?? e.id, n = l.value.some((t) => t.id !== e.id && t.title === e.title), r = e.organizationId ?? e.tenantId ?? "系统";
185
- return {
186
- value: e.id,
187
- label: n ? `${t} · ${r}` : t
188
- };
189
- })), te = z(() => $(p.value).find(({ menu: e }) => e.moduleAlias === i && e.parentId === d.value)), O = z(() => !m.value && !_.value && !y.value && !!(i && u.value && c.value.trim()) && h.value && s.value);
190
- Z([
191
- O,
192
- _,
193
- y
194
- ], () => {
195
- t.context.setCloseBlocked(_.value), t.context.setTitleActions(y.value ? [] : [{
196
- key: "add-menu",
197
- label: "添加",
198
- emphasis: "primary",
199
- disabled: !O.value,
200
- loading: _.value,
201
- run: A
202
- }]);
203
- }, { immediate: !0 }), Z(u, () => void ie()), re();
204
- async function re() {
205
- s.value = !1, h.value = !1, m.value = !0, v.value = "";
206
- let e = ++C;
207
- try {
208
- let [t, n] = await Promise.all([r.schemes(), a.runtime.load()]);
209
- if (e !== C) return;
210
- if (f.value = n.entryType === "link" ? "window" : "tab", o.value = j(n), s.value = !o.value, l.value = t, !E.value.length) {
211
- v.value = "暂无可用菜单方案,请先在菜单管理中配置方案。", m.value = !1;
212
- return;
213
- }
214
- let i = await r.visible();
215
- if (e !== C) return;
216
- let c = i[0]?.record.schemeId, d = E.value.some((e) => e.value === c) ? c : String(E.value[0].value);
217
- u.value === d ? await ie() : u.value = d;
218
- } catch (t) {
219
- e === C && (v.value = ae(t), m.value = !1);
220
- }
221
- }
222
- async function ie() {
223
- let e = ++C;
224
- d.value = "root", p.value = [], h.value = !1, v.value = "", m.value = !0;
225
- try {
226
- let t = await r.tree(u.value);
227
- e === C && (p.value = t, h.value = !0);
228
- } catch (t) {
229
- e === C && (v.value = ae(t));
230
- } finally {
231
- e === C && (m.value = !1);
232
- }
233
- }
234
- async function k() {
235
- S.value = !1, v.value = "";
236
- try {
237
- let e = await (n?.refreshMenus?.() ?? r.visible());
238
- x.value = $(e).find(({ menu: e }) => e.id === y.value?.id)?.menu, S.value = !0;
239
- } catch {
240
- v.value = "菜单已添加,导航刷新失败。请重试刷新,无需重复添加。";
241
- }
242
- }
243
- async function A() {
244
- if (O.value) {
245
- _.value = !0, v.value = "";
246
- try {
247
- let e = await r.insert(u.value, {
248
- title: c.value.trim(),
249
- moduleAlias: i,
250
- schemeId: u.value,
251
- parentId: d.value,
252
- openMode: f.value,
253
- enabled: !0
254
- });
255
- y.value = e.record;
256
- let n = $(p.value).find(({ menu: e }) => e.id === d.value)?.path, a = l.value.find((e) => e.id === u.value);
257
- b.value = [
258
- a?.title,
259
- n,
260
- c.value.trim()
261
- ].filter(Boolean).join(" / "), t.context.refreshDetailExtensions(), await k();
262
- } catch (e) {
263
- v.value = ae(e);
264
- } finally {
265
- _.value = !1;
266
- }
267
- }
268
- }
269
- function j(e) {
270
- return e.entryType === "route" ? e.entryRoute ? "" : "该模块尚未配置页面地址,请返回模块补充。" : e.entryType === "link" ? e.entryExternalUrl ? "" : "该模块尚未配置链接地址,请返回模块补充。" : e.uiDescriptor?.page ? "" : "该模块尚无可用业务页面,请返回模块完成页面配置;使用草稿配置的页面需先发布。";
271
- }
272
- function ae(e) {
273
- return e instanceof Error ? e.message : "加载失败,请重试。";
274
- }
275
- function M() {
276
- x.value && n?.openMenu && (n.openMenu(x.value), t.context.close());
277
- }
278
- return (t, r) => (q(), H("div", ze, [
279
- y.value ? (q(), H(R, { key: 1 }, [
280
- r[12] ||= U("strong", null, "已添加到菜单", -1),
281
- U("p", null, Y(b.value), 1),
282
- x.value && X(n)?.openMenu ? (q(), B(X(D), {
283
- key: 0,
284
- type: "primary",
285
- onClick: M
286
- }, {
287
- default: Q(() => [...r[10] ||= [W("打开", -1)]]),
288
- _: 1
289
- })) : S.value ? (q(), H("p", He, " 当前用户的导航中暂不可见,请检查菜单方案适用范围、上级菜单状态及模块访问权限。 ")) : V("v-if", !0),
290
- v.value ? (q(), B(X(D), {
291
- key: 2,
292
- disabled: _.value,
293
- onClick: k
294
- }, {
295
- default: Q(() => [...r[11] ||= [W("刷新导航", -1)]]),
296
- _: 1
297
- }, 8, ["disabled"])) : V("v-if", !0)
298
- ], 64)) : (q(), H(R, { key: 0 }, [
299
- U("label", null, [r[5] ||= W("菜单名称", -1), G(X(T), {
300
- value: c.value,
301
- "onUpdate:value": r[0] ||= (e) => c.value = e,
302
- disabled: _.value,
303
- "aria-label": "菜单名称"
304
- }, null, 8, ["value", "disabled"])]),
305
- E.value.length > 1 ? (q(), H("label", Be, [r[6] ||= W("菜单方案 ", -1), G(X(ee), {
306
- value: u.value,
307
- options: E.value,
308
- "allow-clear": !1,
309
- disabled: _.value,
310
- "onUpdate:value": r[1] ||= (e) => u.value = String(e ?? "")
311
- }, null, 8, [
312
- "value",
313
- "options",
314
- "disabled"
315
- ])])) : V("v-if", !0),
316
- U("label", null, [r[7] ||= W("放置位置 ", -1), G(X(ne), {
317
- value: d.value,
318
- "tree-data": w.value,
319
- "allow-clear": !1,
320
- disabled: m.value || _.value,
321
- loading: m.value,
322
- "onUpdate:value": r[2] ||= (e) => d.value = String(e ?? "root")
323
- }, null, 8, [
324
- "value",
325
- "tree-data",
326
- "disabled",
327
- "loading"
328
- ])]),
329
- U("details", null, [r[9] ||= U("summary", null, "更多设置", -1), U("label", null, [r[8] ||= W("打开方式 ", -1), G(X(ee), {
330
- value: f.value,
331
- "allow-clear": !1,
332
- disabled: _.value,
333
- options: [{
334
- value: "tab",
335
- label: "页签内打开"
336
- }, {
337
- value: "window",
338
- label: "新窗口打开"
339
- }],
340
- "onUpdate:value": r[3] ||= (e) => f.value = e === "window" ? "window" : "tab"
341
- }, null, 8, ["value", "disabled"])])]),
342
- te.value ? (q(), H("p", Ve, "此位置已有「" + Y(te.value.menu.title) + "」,仍可添加另一个入口。", 1)) : V("v-if", !0)
343
- ], 64)),
344
- o.value ? (q(), H("p", Ue, Y(o.value), 1)) : V("v-if", !0),
345
- o.value ? (q(), B(X(D), {
346
- key: 3,
347
- onClick: r[4] ||= (t) => e.context.close()
348
- }, {
349
- default: Q(() => [...r[13] ||= [W("返回模块", -1)]]),
350
- _: 1
351
- })) : V("v-if", !0),
352
- v.value ? (q(), H("p", We, Y(v.value), 1)) : V("v-if", !0),
353
- v.value && !y.value && !h.value ? (q(), B(X(D), {
354
- key: 5,
355
- disabled: _.value,
356
- onClick: re
357
- }, {
358
- default: Q(() => [...r[14] ||= [W("重试", -1)]]),
359
- _: 1
360
- }, 8, ["disabled"])) : V("v-if", !0)
361
- ]));
362
- }
363
- }), [["__scopeId", "data-v-38eeb884"]]), Ke = { class: "module-menu-entries" }, qe = { key: 0 }, Je = {
364
- key: 1,
365
- role: "status"
366
- }, Ye = { key: 2 }, Xe = { key: 0 }, Ze = /*#__PURE__*/ M(/* @__PURE__ */ K({
367
- __name: "ModuleMenuEntriesSection",
368
- props: { context: {} },
369
- setup(e) {
370
- let t = e, n = ue(), r = J([]), i = J(/* @__PURE__ */ new Map()), a = J(!1), o = J(""), s = 0;
371
- ye(() => s++), Z(() => [t.context.record.id, t.context.refreshKey], () => void c(), { immediate: !0 });
372
- async function c() {
373
- let e = ++s, n = String(t.context.record.alias ?? t.context.record.id ?? ""), c = Le(t.context.module.http);
374
- a.value = !0, o.value = "", r.value = [], i.value = /* @__PURE__ */ new Map();
375
- try {
376
- let [t, a] = await Promise.all([c.schemes(), c.visible()]), o = await Promise.all(t.map(async (e) => $(await c.tree(e.id), e.title ?? e.alias ?? e.id).filter(({ menu: e }) => e.moduleAlias === n)));
377
- if (e !== s) return;
378
- r.value = o.flat(), i.value = new Map($(a).map(({ menu: e }) => [e.id, e]));
379
- } catch {
380
- e === s && (o.value = "暂时无法读取菜单入口,请确认有菜单管理权限后重试。");
381
- } finally {
382
- e === s && (a.value = !1);
383
- }
384
- }
385
- return (e, t) => (q(), H("div", Ke, [a.value ? (q(), H("span", qe, "正在加载…")) : o.value ? (q(), H("div", Je, [W(Y(o.value) + " ", 1), G(X(D), {
386
- type: "link",
387
- onClick: c
388
- }, {
389
- default: Q(() => [...t[0] ||= [W("重试", -1)]]),
390
- _: 1
391
- })])) : r.value.length ? V("v-if", !0) : (q(), H("span", Ye, "尚未添加到菜单,可通过上方“添加到菜单”设置入口。")), (q(!0), H(R, null, Se(r.value, (e) => (q(), H("div", {
392
- key: e.menu.id,
393
- class: "menu-entry"
394
- }, [U("span", null, [W(Y(e.path), 1), e.menu.enabled === !1 ? (q(), H("small", Xe, " · 已停用")) : V("v-if", !0)]), i.value.has(e.menu.id) && X(n)?.openMenu ? (q(), B(X(D), {
395
- key: 0,
396
- type: "link",
397
- onClick: (t) => X(n).openMenu(i.value.get(e.menu.id))
398
- }, {
399
- default: Q(() => [...t[1] ||= [U("span", null, "打开", -1)]]),
400
- _: 1
401
- }, 8, ["onClick"])) : V("v-if", !0)]))), 128))]));
402
- }
403
- }), [["__scopeId", "data-v-ff7756d2"]]), Qe = Ie, $e = de, et = {
404
- id: "platform-module-workspace-actions",
405
- target: { moduleAlias: "platform.module" },
406
- workspaceViews: [$e, Qe],
407
- detail: {
408
- sections: [{
409
- key: "module-menu-entries",
410
- title: "菜单入口",
411
- component: Ze
412
- }],
413
- actions: [
414
- {
415
- key: "module-add-to-menu",
416
- title: "添加到菜单",
417
- state: (e) => ({ visible: rt(e) !== void 0 }),
418
- run({ openDrawer: e }) {
419
- e({
420
- title: "添加到菜单",
421
- width: "narrow",
422
- component: Ge
423
- });
424
- }
425
- },
426
- {
427
- key: "module-actions-workspace",
428
- title: "动作",
429
- state: (e) => ({ visible: rt(e) !== void 0 }),
430
- run({ record: e, openWorkspaceTab: t }) {
431
- let n = rt(e);
432
- n && t(Qe, {
433
- moduleAlias: n,
434
- moduleTitle: it(e),
435
- moduleKind: at(e)
436
- });
437
- }
438
- },
439
- {
440
- key: "module-ui-orchestration-workspace",
441
- title: "低代码",
442
- state: (e) => ({ visible: rt(e) !== void 0 && at(e) === "dynamic" }),
443
- run({ record: e, openWorkspaceTab: t }) {
444
- let n = rt(e);
445
- n && at(e) === "dynamic" && t($e, {
446
- moduleAlias: n,
447
- moduleTitle: it(e),
448
- governanceTab: "overview"
449
- });
450
- }
451
- }
452
- ]
453
- }
454
- }, tt = {
455
- id: "dictionary-category-tree-parent-policy",
456
- target: { moduleAlias: "platform.dictionary_category" },
457
- navigator: { treeParentPolicy: {
458
- canUseAsParent: (e) => e.categoryKind === "folder",
459
- rejectionMessage: "字典类目只能挂在目录下"
460
- } }
461
- }, nt = {
462
- id: "platform-module-action-entry-scope",
463
- target: { moduleAlias: "platform.module_action" },
464
- navigator: {
465
- hidden: !0,
466
- lockedEntry: {
467
- navigatorKey: "module",
468
- unavailableDescription: "模块上下文不可用"
469
- }
470
- },
471
- standardActions: { disabled: ["create"] }
472
- };
473
- function rt(e) {
474
- return ot(e, "alias") ?? ot(e, "id");
475
- }
476
- function it(e) {
477
- return ot(e, "title");
478
- }
479
- function at(e) {
480
- let t = ot(e, "moduleKind");
481
- return t === "static" || t === "dynamic" ? t : void 0;
482
- }
483
- function ot(e, t) {
484
- let n = e[t];
485
- return typeof n == "string" && n.trim() ? n : void 0;
486
- }
487
- //#endregion
488
- //#region src/views/PasswordPolicyPreview.vue?vue&type=script&setup=true&lang.ts
489
- var st = { class: "password-policy-preview" }, ct = {
490
- key: 0,
491
- class: "preview-results"
492
- }, lt = {
493
- id: "iam-password-policy-preview",
494
- target: { moduleAlias: "iam.password_policy_rule" },
495
- card: { assistant: {
496
- component: /* @__PURE__ */ M(/* @__PURE__ */ K({
497
- name: "PasswordPolicyPreview",
498
- __name: "PasswordPolicyPreview",
499
- props: { context: {} },
500
- setup(e) {
501
- let t = e, n = J("CURRENT"), r = J(""), i = J(), a = J(!1), o = J(!1), s = 0, c = z(() => g(t.context.record)), l = z(() => t.context.mode !== "view" || b(c.value?.id) !== void 0), u = z(() => [{
502
- value: "CURRENT",
503
- label: "本规则",
504
- disabled: !l.value
505
- }, {
506
- value: "ALL",
507
- label: "全规则"
508
- }]);
509
- Z(l, (e) => {
510
- !e && n.value === "CURRENT" && (n.value = "ALL");
511
- }, { immediate: !0 });
512
- function d(e) {
513
- (e !== "CURRENT" || l.value) && (e === "CURRENT" || e === "ALL") && (n.value = e);
514
- }
515
- Z([n, () => t.context.formSessionKey], ([e]) => {
516
- e === "ALL" && f();
517
- }, { immediate: !0 });
518
- async function f() {
519
- let e = ++s;
520
- o.value = !0, a.value = !1, i.value = void 0;
521
- try {
522
- let n = await t.context.module.http.request({ path: "/iam.password_policy_rule/active-global-rules" });
523
- if (e !== s) return;
524
- i.value = Object.freeze(n.map((e) => Object.freeze({ ...e })));
525
- } catch {
526
- if (e !== s) return;
527
- a.value = !0;
528
- } finally {
529
- e === s && (o.value = !1);
530
- }
531
- }
532
- let p = z(() => {
533
- let e = l.value ? c.value : void 0;
534
- if (n.value === "CURRENT") return e ? [e] : [];
535
- if (!i.value) return [];
536
- let t = i.value.filter(S), r = b(e?.id);
537
- if (r) {
538
- let e = t.findIndex((e) => b(e.id) === r);
539
- e >= 0 && t.splice(e, 1);
540
- }
541
- return e && S(e) && t.push(e), t.length > 0 ? t.sort(v) : [];
542
- }), m = z(() => r.value ? p.value.map((e, t) => _(e, r.value, t)) : []), h = z(() => {
543
- if (!l.value && n.value === "CURRENT") return "请选择或新建一条规则";
544
- if (n.value === "ALL" && o.value) return "正在加载权威规则集";
545
- if (n.value === "ALL" && a.value) return "无法加载权威规则集";
546
- if (!r.value) return "输入测试密码后即时反馈";
547
- if (m.value.length === 0) return "当前没有参与试算的启用规则";
548
- let e = m.value.filter((e) => !e.passed).length;
549
- return e === 0 ? `全部通过(${m.value.length}/${m.value.length})` : `${e} 条规则未通过`;
550
- });
551
- function g(e) {
552
- if (e) return e;
553
- }
554
- function _(e, t, n) {
555
- let r = x(e.title, "未命名规则"), i = x(e.message, "未配置失败提示"), a = e.pattern;
556
- if (!a?.trim()) return {
557
- key: y(e, n),
558
- title: r,
559
- message: i,
560
- passed: !1,
561
- diagnostic: "正则表达式不能为空"
562
- };
563
- try {
564
- let o = RegExp(`^(?:${a})$`).test(t);
565
- return {
566
- key: y(e, n),
567
- title: r,
568
- message: i,
569
- passed: o
570
- };
571
- } catch {
572
- return {
573
- key: y(e, n),
574
- title: r,
575
- message: i,
576
- passed: !1,
577
- diagnostic: "当前浏览器不支持该正则语法;保存时仍由服务端 Java 正则校验"
578
- };
579
- }
580
- }
581
- function v(e, t) {
582
- return (e.sortOrder ?? 2 ** 53 - 1) - (t.sortOrder ?? 2 ** 53 - 1) || x(e.title, "").localeCompare(x(t.title, ""));
583
- }
584
- function y(e, t) {
585
- return b(e.id) ?? `draft:${t}`;
586
- }
587
- function b(e) {
588
- return e?.trim() || void 0;
589
- }
590
- function x(e, t) {
591
- return e?.trim() || t;
592
- }
593
- function S(e) {
594
- return e.enabled !== !1 && (e.scopeType == null || e.scopeType.toLowerCase() === "global");
595
- }
596
- return (e, t) => (q(), H("section", st, [
597
- U("header", null, [t[1] ||= U("h3", null, "密码试算", -1), U("span", { class: _e({ failed: m.value.some((e) => !e.passed) }) }, Y(h.value), 3)]),
598
- G(X(A), {
599
- class: "preview-scope",
600
- value: n.value,
601
- options: u.value,
602
- size: "small",
603
- "onUpdate:value": d
604
- }, null, 8, ["value", "options"]),
605
- G(X(T), {
606
- value: r.value,
607
- "onUpdate:value": t[0] ||= (e) => r.value = e,
608
- type: "text",
609
- autocomplete: "off",
610
- placeholder: "输入测试密码",
611
- "aria-label": "测试密码"
612
- }, null, 8, ["value"]),
613
- m.value.length ? (q(), H("ul", ct, [(q(!0), H(R, null, Se(m.value, (e) => (q(), H("li", {
614
- key: e.key,
615
- class: _e({
616
- passed: e.passed,
617
- failed: !e.passed
618
- })
619
- }, [U("strong", null, Y(e.title), 1), U("span", null, Y(e.diagnostic ?? (e.passed ? "通过" : e.message)), 1)], 2))), 128))])) : V("v-if", !0)
620
- ]));
621
- }
622
- }), [["__scopeId", "data-v-1ebdeb6e"]]),
623
- placement: {
624
- boundary: "outside",
625
- position: "bottom"
626
- }
627
- } }
628
- }, ut = { class: "tenant-applications-detail" }, dt = { class: "tenant-applications-summary" }, ft = {
629
- key: 0,
630
- class: "tenant-applications-status"
631
- }, pt = /*#__PURE__*/ M(/* @__PURE__ */ K({
632
- name: "TenantApplicationsDetailSection",
633
- __name: "TenantApplicationsDetailSection",
634
- props: { context: {} },
635
- setup(e) {
636
- let t = e, n = J([]), r = J(!1), i = 0, a = J(/* @__PURE__ */ new Map()), o = z(() => n.value.map((e) => e.applicationAlias).filter((e) => typeof e == "string" && e.length > 0).map((e) => ({
637
- key: e,
638
- label: a.value.get(e) ? `${a.value.get(e)} · ${e}` : e
639
- })));
640
- Z(() => [t.context.record.id, t.context.refreshKey], () => void s(), { immediate: !0 });
641
- async function s() {
642
- let e = String(t.context.record.id ?? ""), o = ++i;
643
- if (!e) {
644
- n.value = [], a.value = /* @__PURE__ */ new Map(), r.value = !1;
645
- return;
646
- }
647
- r.value = !0, n.value = [], a.value = /* @__PURE__ */ new Map();
648
- try {
649
- let [r, s] = await Promise.all([t.context.module.http.request({
650
- method: "POST",
651
- path: "/platform.application/query",
652
- body: { page: {
653
- pageNum: 1,
654
- pageSize: 200
655
- } }
656
- }), t.context.module.http.request({
657
- method: "POST",
658
- path: c(e, "query"),
659
- body: { page: {
660
- pageNum: 1,
661
- pageSize: 200
662
- } }
663
- })]);
664
- o === i && (a.value = new Map(r.records.filter((e) => e.alias && e.title).map((e) => [e.alias, e.title])), n.value = s.records);
665
- } catch (e) {
666
- o === i && u(e, {
667
- source: "tenant-applications-detail",
668
- phase: "load"
669
- });
670
- } finally {
671
- o === i && (r.value = !1);
672
- }
673
- }
674
- function c(e, t) {
675
- return `/iam.tenant/${encodeURIComponent(e)}/applications/${t}`;
676
- }
677
- return (e, t) => (q(), H("section", ut, [U("div", dt, [r.value ? (q(), H("span", ft, "正在加载…")) : (q(), B(X(O), {
678
- key: 1,
679
- items: o.value,
680
- "max-visible": 8,
681
- "empty-text": "暂无记录"
682
- }, null, 8, ["items"]))])]));
683
- }
684
- }), [["__scopeId", "data-v-2f879564"]]), mt = { class: "tenant-application-configuration" }, ht = /*#__PURE__*/ M(/* @__PURE__ */ K({
685
- name: "TenantApplicationConfigurationDrawer",
686
- __name: "TenantApplicationConfigurationDrawer",
687
- props: { context: {} },
688
- setup(e) {
689
- let t = e, n = J([]), r = J(/* @__PURE__ */ new Set()), i = J(!1), a = J(!1), o = [{
690
- key: "title",
691
- title: "应用名称",
692
- width: 260
693
- }, {
694
- key: "alias",
695
- title: "应用 alias",
696
- width: 220
697
- }], s = z(() => n.value), c = z(() => ({
698
- selectedRowKeys: [...r.value],
699
- preserveSelectedRowKeys: !0,
700
- disabledOf: (e) => a.value || e.alias === "iam",
701
- onChange: (e) => {
702
- r.value = new Set(e.map(String));
703
- }
704
- }));
705
- function l() {
706
- t.context.setCloseBlocked(a.value), t.context.setTitleActions([{
707
- key: "cancel",
708
- label: "取消",
709
- disabled: a.value,
710
- run: () => {
711
- a.value || t.context.close();
712
- }
713
- }, {
714
- key: "confirm",
715
- label: "确认",
716
- emphasis: "primary",
717
- disabled: a.value,
718
- loading: a.value,
719
- run: f
720
- }]);
721
- }
722
- be(() => {
723
- l(), d();
724
- }), Z(a, l);
725
- async function d() {
726
- let e = String(t.context.record?.id ?? "");
727
- if (e) {
728
- i.value = !0;
729
- try {
730
- let [i, a] = await Promise.all([t.context.module.http.request({
731
- method: "POST",
732
- path: "/platform.application/query",
733
- body: { page: {
734
- pageNum: 1,
735
- pageSize: 200
736
- } }
737
- }), t.context.module.http.request({
738
- method: "POST",
739
- path: p(e, "query"),
740
- body: { page: {
741
- pageNum: 1,
742
- pageSize: 200
743
- } }
744
- })]);
745
- n.value = i.records.filter((e) => e.enabled !== !1);
746
- let o = new Set(n.value.map((e) => e.alias).filter(Boolean));
747
- r.value = /* @__PURE__ */ new Set(["iam", ...a.records.map((e) => e.applicationAlias).filter((e) => typeof e == "string" && o.has(e))]);
748
- } catch (e) {
749
- u(e, {
750
- source: "tenant-application-configuration",
751
- phase: "load"
752
- });
753
- } finally {
754
- i.value = !1;
755
- }
756
- }
757
- }
758
- async function f() {
759
- let e = String(t.context.record?.id ?? "");
760
- if (e && !a.value) {
761
- a.value = !0;
762
- try {
763
- await t.context.module.http.request({
764
- method: "POST",
765
- path: p(e, "configure"),
766
- body: { applicationAliases: [...r.value] }
767
- }), t.context.refreshDetailExtensions(), t.context.refreshList(), t.context.close();
768
- } catch (e) {
769
- u(e, {
770
- source: "tenant-application-configuration",
771
- phase: "action"
772
- });
773
- } finally {
774
- a.value = !1;
775
- }
776
- }
777
- }
778
- function p(e, t) {
779
- return `/iam.tenant/${encodeURIComponent(e)}/applications/${t}`;
780
- }
781
- return (e, t) => (q(), H("section", mt, [t[0] ||= U("p", null, "勾选表示向当前租户开通应用;取消勾选将移除该租户的应用开通记录。", -1), G(X(k), {
782
- columns: o,
783
- rows: s.value,
784
- loading: i.value,
785
- pagination: !1,
786
- selection: c.value,
787
- "row-key": (e) => String(e.alias ?? e.id ?? ""),
788
- "empty-description": "暂无可配置应用"
789
- }, null, 8, [
790
- "rows",
791
- "loading",
792
- "selection",
793
- "row-key"
794
- ])]));
795
- }
796
- }), [["__scopeId", "data-v-2e68af88"]]), gt = {
797
- id: "iam-tenant-standard-page-enhancement",
798
- target: { moduleAlias: "iam.tenant" },
799
- form: {
800
- contributions: [],
801
- fieldPolicies: [
802
- {
803
- fieldName: "workbenchTitle",
804
- visible: ({ draft: e }) => e.workbenchBrandMode !== "logoOnly"
805
- },
806
- {
807
- fieldName: "workbenchSubtitle",
808
- visible: ({ draft: e }) => e.workbenchBrandMode !== "logoOnly"
809
- },
810
- ...["lightLogoAssetId", "darkLogoAssetId"].map((e) => ({
811
- fieldName: e,
812
- imageUploadHint: ({ draft: e }) => e.workbenchBrandMode === "logoOnly" ? "纯 Logo 模式支持横向或正方形图片(最大 512 KB)" : "Logo + 标题模式仅支持正方形图片(建议 128 × 128 px,最大 512 KB)",
813
- imageUploadAdvisory: ({ draft: e }) => e.workbenchBrandMode === "logoOnly" ? void 0 : _t
814
- }))
815
- ]
816
- },
817
- detail: {
818
- actions: [{
819
- key: "tenant-configure-applications",
820
- title: "配置应用",
821
- state: () => ({ visible: !0 }),
822
- run({ openDrawer: e }) {
823
- e({
824
- title: "配置应用",
825
- width: "wide",
826
- component: ht
827
- });
828
- }
829
- }],
830
- sections: [{
831
- key: "tenant-applications",
832
- title: "已开通应用",
833
- component: pt
834
- }]
835
- }
836
- };
837
- async function _t(e) {
838
- if (!e.type.startsWith("image/") || typeof Image > "u") return "Logo + 标题模式需要可读取的正方形图片。";
839
- try {
840
- let { width: t, height: n } = await vt(e), r = t / n;
841
- return r >= .9 && r <= 1.1 ? void 0 : `“${e.name}”为 ${t} × ${n} px;Logo + 标题模式仅允许上传正方形 Logo。`;
842
- } catch {
843
- return "无法读取图片尺寸,请选择正方形 PNG、JPG 或 GIF 图片。";
844
- }
845
- }
846
- function vt(e) {
847
- let t = URL.createObjectURL(e);
848
- return new Promise((e, n) => {
849
- let r = new Image();
850
- r.onload = () => {
851
- URL.revokeObjectURL(t), e({
852
- width: r.naturalWidth,
853
- height: r.naturalHeight
854
- });
855
- }, r.onerror = () => {
856
- URL.revokeObjectURL(t), n(/* @__PURE__ */ Error("无法读取图片尺寸"));
857
- }, r.src = t;
858
- });
859
- }
860
- //#endregion
861
- //#region src/platform-admin-runtime/employee/EmployeeAccountDrawer.vue?vue&type=script&setup=true&lang.ts
862
- var yt = {
863
- key: 1,
864
- class: "employee-account-drawer"
865
- }, bt = { class: "employee-account-existing-picker" }, xt = /*#__PURE__*/ M(/* @__PURE__ */ K({
866
- name: "EmployeeAccountDrawer",
867
- __name: "EmployeeAccountDrawer",
868
- props: { context: {} },
869
- setup(e) {
870
- let t = e, n = J(), r = J(), i = J(""), a = J(""), o = J(!1), s = J(!1);
871
- be(() => void c());
872
- async function c() {
873
- let e = x();
874
- if (e) {
875
- o.value = !0;
876
- try {
877
- n.value = await t.context.module.http.request({ path: `/iam.employee/${encodeURIComponent(e)}/account` });
878
- } catch (e) {
879
- u(e, {
880
- source: "employee-account",
881
- phase: "load"
882
- });
883
- } finally {
884
- o.value = !1;
885
- }
886
- }
887
- }
888
- async function l() {
889
- let e = x();
890
- if (!e || s.value) return;
891
- let r = i.value.trim();
892
- if (!r || !a.value) {
893
- p("请输入账号和初始密码。", {
894
- source: "employee-account",
895
- phase: "validation"
896
- });
897
- return;
898
- }
899
- s.value = !0;
900
- try {
901
- let i = await t.context.module.http.request({
902
- method: "POST",
903
- path: `/iam.employee/${encodeURIComponent(e)}/account/provision`,
904
- body: {
905
- username: r,
906
- password: a.value
907
- }
908
- });
909
- n.value = _(i).binding, a.value = "", t.context.refreshList();
910
- } catch (e) {
911
- u(e, {
912
- source: "employee-account",
913
- phase: "action"
914
- });
915
- } finally {
916
- s.value = !1;
917
- }
918
- }
919
- async function d(e) {
920
- let t = e[0];
921
- t && await f(t.id);
922
- }
923
- async function f(e) {
924
- let i = x();
925
- if (i && e && !s.value) {
926
- s.value = !0;
927
- try {
928
- n.value = await t.context.module.http.request({
929
- method: "POST",
930
- path: `/iam.employee/${encodeURIComponent(i)}/account`,
931
- body: { userId: e }
932
- }), r.value = void 0, t.context.refreshList(), p("账号已绑定到当前职员。", {
933
- source: "employee-account",
934
- phase: "action"
935
- });
936
- } catch (e) {
937
- u(e, {
938
- source: "employee-account",
939
- phase: "action"
940
- });
941
- } finally {
942
- s.value = !1;
943
- }
944
- }
945
- }
946
- async function m(e) {
947
- let n = x();
948
- if (!n) return {
949
- records: [],
950
- total: 0
951
- };
952
- let r = await t.context.module.http.request({
953
- method: "POST",
954
- path: `/iam.employee/${encodeURIComponent(n)}/account-candidates/query`,
955
- body: {
956
- keyword: e.keyword,
957
- page: {
958
- pageNum: e.pageNum,
959
- pageSize: e.pageSize
960
- }
961
- }
962
- });
963
- return {
964
- records: r.records.map(g),
965
- total: r.total
966
- };
967
- }
968
- async function h(e) {
969
- let n = x();
970
- return !n || e.length === 0 ? [] : (await t.context.module.http.request({
971
- method: "POST",
972
- path: `/iam.employee/${encodeURIComponent(n)}/account-candidates/query`,
973
- body: {
974
- ids: e,
975
- page: {
976
- pageNum: 1,
977
- pageSize: e.length
978
- }
979
- }
980
- })).records.map(g);
981
- }
982
- function g(e) {
983
- return {
984
- id: e.id,
985
- title: e.username ?? e.id,
986
- account: e.username ?? e.id,
987
- employeeName: e.employeeTitle,
988
- organizationId: e.organizationId,
989
- organizationName: e.organizationTitle,
990
- departmentId: e.departmentId,
991
- departmentName: e.departmentTitle
992
- };
993
- }
994
- async function v() {
995
- let e = x();
996
- if (e && n.value && !s.value && await b({
997
- title: "移除账户",
998
- content: "确认移除该职员的账户?该用户账号会同步删除。",
999
- okText: "移除",
1000
- danger: !0
1001
- })) {
1002
- s.value = !0;
1003
- try {
1004
- await t.context.module.http.request({
1005
- method: "POST",
1006
- path: `/iam.employee/${encodeURIComponent(e)}/account/delete`
1007
- }), n.value = void 0, t.context.refreshList();
1008
- } catch (e) {
1009
- u(e, {
1010
- source: "employee-account",
1011
- phase: "action"
1012
- });
1013
- } finally {
1014
- s.value = !1;
1015
- }
1016
- }
1017
- }
1018
- function x() {
1019
- let e = t.context.record?.id;
1020
- return e == null ? void 0 : String(e);
1021
- }
1022
- return (e, t) => o.value ? (q(), B(X(S), {
1023
- key: 0,
1024
- tip: "加载账号绑定"
1025
- })) : (q(), H("section", yt, [x() ? n.value ? (q(), H(R, { key: 1 }, [U("p", null, "当前已绑定用户:" + Y(n.value.userId ?? "-"), 1), G(X(D), {
1026
- danger: "",
1027
- "icon-name": "delete",
1028
- loading: s.value,
1029
- onClick: v
1030
- }, {
1031
- default: Q(() => [...t[3] ||= [W("移除账户", -1)]]),
1032
- _: 1
1033
- }, 8, ["loading"])], 64)) : (q(), H(R, { key: 2 }, [U("section", bt, [t[4] ||= U("p", null, "绑定已有用户账号;仅显示当前租户内启用且尚未绑定其他职员的账号。", -1), G(X(E), {
1034
- value: r.value,
1035
- disabled: s.value,
1036
- placeholder: "搜索并选择已有登录账号",
1037
- title: "选择已有登录账号",
1038
- "search-page": m,
1039
- "resolve-users": h,
1040
- "onUpdate:value": t[0] ||= (e) => r.value = typeof e == "string" ? e : void 0,
1041
- onSelect: d
1042
- }, null, 8, ["value", "disabled"])]), U("form", { onSubmit: De(l, ["prevent"]) }, [
1043
- t[8] ||= U("p", null, "也可直接创建登录账号并自动绑定到当前职员。", -1),
1044
- U("label", null, [t[5] ||= U("span", null, "账号", -1), G(X(T), {
1045
- value: i.value,
1046
- "onUpdate:value": t[1] ||= (e) => i.value = e,
1047
- disabled: s.value,
1048
- placeholder: "请输入登录账号"
1049
- }, null, 8, ["value", "disabled"])]),
1050
- U("label", null, [t[6] ||= U("span", null, "初始密码", -1), G(X(T), {
1051
- value: a.value,
1052
- "onUpdate:value": t[2] ||= (e) => a.value = e,
1053
- type: "password",
1054
- disabled: s.value,
1055
- placeholder: "请输入初始密码"
1056
- }, null, 8, ["value", "disabled"])]),
1057
- G(X(D), {
1058
- type: "primary",
1059
- "html-type": "submit",
1060
- "icon-name": "plus",
1061
- loading: s.value
1062
- }, {
1063
- default: Q(() => [...t[7] ||= [W(" 创建账号并绑定 ", -1)]]),
1064
- _: 1
1065
- }, 8, ["loading"])
1066
- ], 32)], 64)) : (q(), B(X(y), {
1067
- key: 0,
1068
- title: "职员不存在",
1069
- message: "请重新打开职员档案后再设置账号。"
1070
- }))]));
1071
- }
1072
- }), [["__scopeId", "data-v-aa8474e1"]]), St = {
1073
- id: "iam-employee-account-drawer",
1074
- target: { moduleAlias: "iam.employee" },
1075
- detail: { actions: [{
1076
- key: "employee-account",
1077
- title: "设置账号",
1078
- state: () => ({ visible: !0 }),
1079
- run({ module: e, record: t, openDrawer: n }) {
1080
- let r = t.id == null ? void 0 : String(t.id);
1081
- r && e.can("employeeAccounts", r) !== !1 && n({
1082
- title: "设置账号",
1083
- width: "standard",
1084
- component: xt
1085
- });
1086
- }
1087
- }] }
1088
- }, Ct = "muyun.auth.token", wt = "muyun.auth.sessionId";
1089
- function Tt(e) {
1090
- return Et() ?? jt(e);
1091
- }
1092
- function Et() {
1093
- if (!(typeof window > "u")) return jt(window.localStorage.getItem(Ct));
1094
- }
1095
- function Dt() {
1096
- if (!(typeof window > "u")) return jt(window.localStorage.getItem(wt));
1097
- }
1098
- function Ot(e) {
1099
- typeof window > "u" || window.localStorage.setItem(Ct, e);
1100
- }
1101
- function kt(e) {
1102
- if (typeof window > "u") return;
1103
- let t = jt(e);
1104
- if (t) {
1105
- window.localStorage.setItem(wt, t);
1106
- return;
1107
- }
1108
- window.localStorage.removeItem(wt);
1109
- }
1110
- function At() {
1111
- typeof window > "u" || (window.localStorage.removeItem(Ct), window.localStorage.removeItem(wt));
1112
- }
1113
- function jt(e) {
1114
- return e?.trim() || void 0;
1115
- }
1116
- function Mt(e, t) {
1117
- return !1;
1118
- }
1119
- //#endregion
1120
- //#region src/platform-admin-runtime/backendHttp.ts
1121
- function Nt(e = {}) {
1122
- return P({
1123
- baseUrl: void 0,
1124
- token: e.withAuth === !1 ? void 0 : Tt(void 0),
1125
- credentials: Pt(void 0),
1126
- onAuthenticationRequired: e.withAuth === !1 ? void 0 : (e, t) => Mt(e, t)
1127
- });
1128
- }
1129
- function Pt(e) {
1130
- return e === "include" || e === "omit" || e === "same-origin" ? e : void 0;
1131
- }
1132
- //#endregion
1133
- //#region src/platform-admin-runtime/realtime.ts
1134
- var Ft = Oe(), It = /* @__PURE__ */ new Map(), Lt = /* @__PURE__ */ new Set(), Rt, zt, Bt = 3e4;
1135
- function Vt(e = {}) {
1136
- return s({
1137
- baseUrl: e.baseUrl ?? void 0,
1138
- token: e.token ?? Tt(void 0),
1139
- onStateChange: (t) => {
1140
- e.onStateChange?.(t), t === "unauthorized" && e.onUnauthorized?.();
1141
- }
1142
- });
1143
- }
1144
- function Ht(e = {}) {
1145
- if (zt) throw Error("App realtime is already connected. Disconnect the active connection before reconnecting.");
1146
- let t = Vt(e);
1147
- Rt = t;
1148
- let n = i(t, Ft), r = l(t, (t) => {
1149
- e.onUserNotification?.(t);
1150
- }), a = x(t, (t) => {
1151
- e.onBusinessNotification?.(t);
1152
- }), o = v(t, (e) => {
1153
- for (let t of Lt) t(e);
1154
- }), s = Wt(t);
1155
- s.start(), Jt(t), t.connect();
1156
- let c = !1, u = { async disconnect() {
1157
- c || (c = !0, n.unsubscribe(), r.unsubscribe(), a.unsubscribe(), o.unsubscribe(), s.stop(), Yt(), zt === u && (zt = void 0), Rt === t && (Rt = void 0), await t.disconnect());
1158
- } };
1159
- return zt = u, u;
1160
- }
1161
- async function Ut() {
1162
- await zt?.disconnect();
1163
- }
1164
- function Wt(e) {
1165
- let t = 0, n = [
1166
- "pointermove",
1167
- "pointerdown",
1168
- "keydown",
1169
- "scroll"
1170
- ], r = () => a(!1), i = () => {
1171
- document.visibilityState === "visible" && a(!0);
1172
- };
1173
- return {
1174
- start() {
1175
- if (!(typeof window > "u" || typeof document > "u")) {
1176
- for (let e of n) window.addEventListener(e, r, { passive: !0 });
1177
- document.addEventListener("visibilitychange", i);
1178
- }
1179
- },
1180
- stop() {
1181
- if (!(typeof window > "u" || typeof document > "u")) {
1182
- for (let e of n) window.removeEventListener(e, r);
1183
- document.removeEventListener("visibilitychange", i);
1184
- }
1185
- }
1186
- };
1187
- function a(n) {
1188
- if (e.state() !== "connected") return;
1189
- let r = Date.now();
1190
- if (!(!n && r - t < Bt)) {
1191
- t = r;
1192
- try {
1193
- e.publish(j, { timestamp: new Date(r).toISOString() });
1194
- } catch {}
1195
- }
1196
- }
1197
- }
1198
- function Gt(e) {
1199
- let t = e.trim();
1200
- if (!t) throw Error("Module data change subscription requires a moduleAlias");
1201
- let n = It.get(t) ?? {
1202
- moduleAlias: t,
1203
- references: 0
1204
- };
1205
- return n.references += 1, It.set(t, n), !n.active && Rt && (n.active = Xt(Rt, t)), { unsubscribe() {
1206
- --n.references, !(n.references > 0) && (n.active?.unsubscribe(), n.active = void 0, It.delete(t));
1207
- } };
1208
- }
1209
- function Kt(e) {
1210
- return Ft.subscribe(e);
1211
- }
1212
- function qt(e) {
1213
- return Lt.add(e), { unsubscribe() {
1214
- Lt.delete(e);
1215
- } };
1216
- }
1217
- function Jt(e) {
1218
- for (let t of It.values()) t.active?.unsubscribe(), t.active = Xt(e, t.moduleAlias);
1219
- }
1220
- function Yt() {
1221
- for (let e of It.values()) e.active?.unsubscribe(), e.active = void 0;
1222
- }
1223
- function Xt(e, t) {
1224
- return e.subscribe(m(t), (e) => {
1225
- Ft.dispatch(e);
1226
- });
1227
- }
1228
- //#endregion
1229
- //#region src/platform-admin-runtime/user/userOnlineStatusStore.ts
1230
- var Zt = "iam.user.session.collectionChanged", Qt = J({}), $t = /* @__PURE__ */ new Set(), en = !1, tn = !1;
1231
- function nn() {
1232
- rn();
1233
- function e(e) {
1234
- e && !Qt.value[e] && ($t.add(e), an());
1235
- }
1236
- function t(e) {
1237
- return e ? Qt.value[e] : void 0;
1238
- }
1239
- function n(e) {
1240
- e && ($t.add(e), an());
1241
- }
1242
- return {
1243
- observe: e,
1244
- statusOf: t,
1245
- refresh: n
1246
- };
1247
- }
1248
- function rn() {
1249
- tn || (tn = !0, qt((e) => {
1250
- sn(e) && ($t.add(e.recordId), an());
1251
- }));
1252
- }
1253
- function an() {
1254
- en || (en = !0, queueMicrotask(() => {
1255
- en = !1, on();
1256
- }));
1257
- }
1258
- async function on() {
1259
- let e = Array.from($t);
1260
- if ($t.clear(), e.length !== 0) try {
1261
- let t = await Nt().request({
1262
- method: "POST",
1263
- path: "/iam.user/sessions/status",
1264
- body: { userIds: e }
1265
- });
1266
- Qt.value = {
1267
- ...Qt.value,
1268
- ...Object.fromEntries(t.map((e) => [e.userId, e]))
1269
- };
1270
- } catch (e) {
1271
- u(e, {
1272
- source: "iam-user-online-status",
1273
- phase: "load"
1274
- });
1275
- }
1276
- }
1277
- function sn(e) {
1278
- return e.type === Zt && e.moduleAlias === "iam.user" && !!e.recordId;
1279
- }
1280
- //#endregion
1281
- //#region src/platform-admin-runtime/user/UserOnlineStatusCell.vue
1282
- var cn = /*#__PURE__*/ M(/* @__PURE__ */ K({
1283
- name: "UserOnlineStatusCell",
1284
- __name: "UserOnlineStatusCell",
1285
- props: {
1286
- record: {},
1287
- column: {}
1288
- },
1289
- setup(e) {
1290
- let t = e, n = nn(), r = z(() => t.record.id == null ? void 0 : String(t.record.id)), i = z(() => n.statusOf(r.value)), a = z(() => {
1291
- let e = i.value;
1292
- if (!e) return "-";
1293
- if (e.present) {
1294
- let t = e.presentSessionCount ?? 0, n = e.idleSessionCount ?? 0;
1295
- return n >= t ? `闲置 (${t}/${e.activeSessionCount})` : `使用中 (${Math.max(0, t - n)}/${e.activeSessionCount})`;
1296
- }
1297
- return e.online ? `在线 (${e.activeSessionCount})` : "离线";
1298
- });
1299
- function o() {
1300
- n.observe(r.value);
1301
- }
1302
- return be(o), Z(r, o), (e, t) => (q(), H("span", { class: _e({
1303
- "user-online-status--present": i.value?.present,
1304
- "user-online-status--offline": i.value && !i.value.online
1305
- }) }, Y(a.value), 3));
1306
- }
1307
- }), [["__scopeId", "data-v-789ddd4a"]]), ln = {
1308
- key: 1,
1309
- class: "user-password-drawer"
1310
- }, un = { key: 0 }, dn = {
1311
- key: 1,
1312
- class: "user-password-reset"
1313
- }, fn = { key: 0 }, pn = /*#__PURE__*/ M(/* @__PURE__ */ K({
1314
- name: "UserPasswordDrawer",
1315
- __name: "UserPasswordDrawer",
1316
- props: { context: {} },
1317
- setup(e) {
1318
- let t = e, n = J(""), r = J(), i = J(!1), a = z(() => t.context.record?.id == null ? void 0 : String(t.context.record.id));
1319
- async function o() {
1320
- let e = a.value;
1321
- if (e && !i.value && t.context.module.can("changePassword", e) === !0) {
1322
- if (!n.value) {
1323
- p("请输入新密码。", {
1324
- source: "iam-user-password",
1325
- phase: "validation"
1326
- });
1327
- return;
1328
- }
1329
- i.value = !0, t.context.setCloseBlocked(!0);
1330
- try {
1331
- await t.context.module.http.request({
1332
- method: "POST",
1333
- path: `/iam.user/changePassword/${encodeURIComponent(e)}`,
1334
- body: { password: n.value }
1335
- }), n.value = "", p("密码已修改。", {
1336
- source: "iam-user-password",
1337
- phase: "action"
1338
- }), t.context.refreshList(), t.context.refreshDetailExtensions();
1339
- } catch (e) {
1340
- u(e, {
1341
- source: "iam-user-password",
1342
- phase: "action"
1343
- });
1344
- } finally {
1345
- t.context.setCloseBlocked(!1), i.value = !1;
1346
- }
1347
- }
1348
- }
1349
- async function s() {
1350
- let e = a.value;
1351
- if (e && !i.value && t.context.module.can("resetPassword", e) === !0) {
1352
- i.value = !0, t.context.setCloseBlocked(!0);
1353
- try {
1354
- r.value = await t.context.module.http.request({
1355
- method: "POST",
1356
- path: `/iam.user/resetPassword/${encodeURIComponent(e)}`
1357
- }), t.context.refreshList(), t.context.refreshDetailExtensions();
1358
- } catch (e) {
1359
- u(e, {
1360
- source: "iam-user-password",
1361
- phase: "action"
1362
- });
1363
- } finally {
1364
- t.context.setCloseBlocked(!1), i.value = !1;
1365
- }
1366
- }
1367
- }
1368
- return (t, c) => a.value ? (q(), H("section", ln, [e.context.module.can("changePassword", a.value) === !0 ? (q(), H("label", un, [
1369
- c[2] ||= U("span", null, "新密码", -1),
1370
- G(X(T), {
1371
- value: n.value,
1372
- "onUpdate:value": c[0] ||= (e) => n.value = e,
1373
- type: "password",
1374
- disabled: i.value,
1375
- placeholder: "请输入新密码"
1376
- }, null, 8, ["value", "disabled"]),
1377
- G(X(D), {
1378
- type: "primary",
1379
- loading: i.value,
1380
- onClick: o
1381
- }, {
1382
- default: Q(() => [...c[1] ||= [W("修改密码", -1)]]),
1383
- _: 1
1384
- }, 8, ["loading"])
1385
- ])) : V("v-if", !0), e.context.module.can("resetPassword", a.value) === !0 ? (q(), H("section", dn, [
1386
- c[6] ||= U("p", null, "由系统生成临时密码。请在安全渠道交付给用户,并提醒其尽快修改。", -1),
1387
- G(X(D), {
1388
- loading: i.value,
1389
- onClick: s
1390
- }, {
1391
- default: Q(() => [...c[3] ||= [W("生成临时密码", -1)]]),
1392
- _: 1
1393
- }, 8, ["loading"]),
1394
- r.value ? (q(), H("dl", fn, [U("div", null, [c[4] ||= U("dt", null, "临时密码", -1), U("dd", null, Y(r.value.temporaryPassword), 1)]), U("div", null, [c[5] ||= U("dt", null, "失效时间", -1), U("dd", null, Y(r.value.expiresAt ?? "-"), 1)])])) : V("v-if", !0)
1395
- ])) : V("v-if", !0)])) : (q(), B(X(y), {
1396
- key: 0,
1397
- title: "用户不存在",
1398
- message: "请重新打开用户详情后再管理密码。"
1399
- }));
1400
- }
1401
- }), [["__scopeId", "data-v-f6125048"]]);
1402
- //#endregion
1403
- //#region src/platform-admin-runtime/pageRealtime.ts
1404
- function mn(e) {
1405
- let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), r, i = 0, a = !0;
1406
- function o(n) {
1407
- if (!a) return;
1408
- let i = Array.isArray(n) ? n : [n];
1409
- for (let e of i) e && t.add(e);
1410
- t.size === 0 || r || (r = setTimeout(s, e.delay ?? 0));
1411
- }
1412
- function s() {
1413
- if (r = void 0, !a || t.size === 0) return;
1414
- let o = Array.from(t);
1415
- t.clear(), i += 1;
1416
- let s = i;
1417
- o.forEach((e) => n.set(e, s)), e.load({
1418
- keys: o,
1419
- isLatest: (e) => a && n.get(e) === s,
1420
- active: () => a
1421
- });
1422
- }
1423
- function c() {
1424
- a = !1, l();
1425
- }
1426
- function l() {
1427
- r &&= (clearTimeout(r), void 0), t.clear(), n.clear();
1428
- }
1429
- return {
1430
- enqueue: o,
1431
- reset: l,
1432
- dispose: c
1433
- };
1434
- }
1435
- //#endregion
1436
- //#region src/platform-admin-runtime/user/useUserSessionRows.ts
1437
- function hn(e) {
1438
- let t = J([]), n = J({}), r = mn({ load: async (e) => {
1439
- await Promise.all(e.keys.map((t) => a(t, e.isLatest)));
1440
- } });
1441
- function i(e) {
1442
- r.enqueue(e);
1443
- }
1444
- async function a(t, n) {
1445
- if (e.context.can("sessions", t) !== !1) {
1446
- d(t, {
1447
- ...c(t),
1448
- loading: !0,
1449
- error: void 0
1450
- });
1451
- try {
1452
- await e.context.recordActions(t);
1453
- let r = await e.context.http.request({
1454
- method: "GET",
1455
- path: `/iam.user/${encodeURIComponent(t)}/sessions`
1456
- });
1457
- n(t) && d(t, {
1458
- records: r,
1459
- loading: !1
1460
- });
1461
- } catch (r) {
1462
- if (!n(t)) return;
1463
- let i = u(r, {
1464
- source: `${e.source}-sessions`,
1465
- phase: "load"
1466
- });
1467
- d(t, {
1468
- ...c(t),
1469
- loading: !1,
1470
- error: i.message
1471
- });
1472
- }
1473
- }
1474
- }
1475
- function o(e, n) {
1476
- let r = String(e.id ?? "");
1477
- r && (t.value = n ? Array.from(/* @__PURE__ */ new Set([...t.value, r])) : t.value.filter((e) => e !== r), n && c(r).records.length === 0 && i(r));
1478
- }
1479
- function s(e) {
1480
- if (e.type !== "iam.user.session.collectionChanged" || e.moduleAlias !== "iam.user") return;
1481
- let n = String(e.recordId ?? "");
1482
- n && t.value.includes(n) && i(n);
1483
- }
1484
- function c(e) {
1485
- return e ? n.value[e] ?? {
1486
- records: [],
1487
- loading: !1
1488
- } : {
1489
- records: [],
1490
- loading: !1
1491
- };
1492
- }
1493
- function l() {
1494
- r.reset(), t.value = [], n.value = {};
1495
- }
1496
- function d(e, t) {
1497
- n.value = {
1498
- ...n.value,
1499
- [e]: t
1500
- };
1501
- }
1502
- return {
1503
- handleUserRowExpand: o,
1504
- handleUserSessionBusinessEvent: s,
1505
- loadUserSessions: i,
1506
- reset: l,
1507
- userSessionState: c
1508
- };
1509
- }
1510
- //#endregion
1511
- //#region src/platform-admin-runtime/userModulePageEnhancement.ts
1512
- var gn = {
1513
- id: "iam-user-standard-page-enhancement",
1514
- target: { moduleAlias: "iam.user" },
1515
- navigator: { emptyListScope: ({ currentUser: e, selectedNavigatorRecords: t }) => {
1516
- if (!(e?.system !== !0 || Object.values(t).some(Boolean))) return [{
1517
- fieldName: "tenantId",
1518
- operator: "NULL",
1519
- values: []
1520
- }];
1521
- } },
1522
- list: {
1523
- rowExpansion: {
1524
- key: "iam-user-sessions",
1525
- component: /* @__PURE__ */ K({
1526
- name: "UserSessionListExpansion",
1527
- __name: "UserSessionListExpansion",
1528
- props: { context: {} },
1529
- setup(e) {
1530
- let t = e, r = z(() => t.context.record.id == null ? void 0 : String(t.context.record.id)), i = hn({
1531
- context: t.context.module,
1532
- source: "iam-user-list-expansion"
1533
- }), a = z(() => i.userSessionState(r.value)), o = z(() => a.value.records.filter((e) => !e.current && t.context.module.can("revokeSession", r.value) === !0)), s = z(() => o.value.length > 1 && t.context.module.can("revokeSessions", r.value) === !0);
1534
- Z([r, () => t.context.expanded], ([e, t]) => {
1535
- e && i.handleUserRowExpand({ id: e }, t);
1536
- }, { immediate: !0 });
1537
- let c = qt((e) => i.handleUserSessionBusinessEvent(e));
1538
- xe(() => {
1539
- c.unsubscribe(), i.reset();
1540
- });
1541
- async function l(e) {
1542
- let n = r.value;
1543
- n && !e.current && t.context.module.can("revokeSession", n) === !0 && await b({
1544
- title: "下线登录会话",
1545
- content: "确认下线该登录会话?",
1546
- okText: "下线",
1547
- danger: !0
1548
- }) && (await t.context.module.http.request({
1549
- method: "POST",
1550
- path: `/iam.user/${encodeURIComponent(n)}/sessions/${encodeURIComponent(e.id)}/revoke`
1551
- }), i.loadUserSessions(n));
1552
- }
1553
- async function u() {
1554
- let e = r.value, n = o.value.map((e) => e.id);
1555
- e && n.length !== 0 && t.context.module.can("revokeSessions", e) === !0 && await b({
1556
- title: "全部下线",
1557
- content: `确认下线该用户的 ${n.length} 个登录会话?`,
1558
- okText: "全部下线",
1559
- danger: !0
1560
- }) && (await t.context.module.http.request({
1561
- method: "POST",
1562
- path: `/iam.user/${encodeURIComponent(e)}/sessions/revoke`,
1563
- body: { sessionIds: n }
1564
- }), i.loadUserSessions(e));
1565
- }
1566
- return (t, o) => (q(), B(X(n), {
1567
- embedded: "",
1568
- sessions: a.value.records,
1569
- loading: a.value.loading,
1570
- error: a.value.error,
1571
- "can-revoke": (t) => !t.current && e.context.module.can("revokeSession", r.value) === !0,
1572
- "can-revoke-all": s.value,
1573
- onRefresh: o[0] ||= (e) => X(i).loadUserSessions(r.value),
1574
- onRevoke: l,
1575
- onRevokeAll: u
1576
- }, null, 8, [
1577
- "sessions",
1578
- "loading",
1579
- "error",
1580
- "can-revoke",
1581
- "can-revoke-all"
1582
- ]));
1583
- }
1584
- })
1585
- },
1586
- columns: [{
1587
- key: "onlineStatus",
1588
- title: "在线状态",
1589
- width: "112px",
1590
- align: "center",
1591
- before: "enabled",
1592
- cell: cn
1593
- }]
1594
- },
1595
- detail: { actions: [{
1596
- key: "iam-user-password",
1597
- actionCode: "changePassword",
1598
- title: "密码管理",
1599
- iconName: "lock",
1600
- state: (e) => ({ visible: e.id != null }),
1601
- run({ openDrawer: e }) {
1602
- e({
1603
- title: "密码管理",
1604
- width: "narrow",
1605
- component: pn
1606
- });
1607
- }
1608
- }] }
1609
- }, _n = "/iam.role/scope-selection/descriptor", vn = "/iam.role/scope-selection/candidates";
1610
- function yn(e) {
1611
- return {
1612
- async descriptor() {
1613
- return bn(await e.request({ path: _n }));
1614
- },
1615
- async candidates(t) {
1616
- let n = Nn(t.pageNum) ?? 1, r = Nn(t.pageSize) ?? 100;
1617
- return xn(await e.request({
1618
- method: "POST",
1619
- path: vn,
1620
- body: {
1621
- navigationKey: An(t.navigationKey, "navigationKey"),
1622
- level: t.level,
1623
- keyword: kn(t.keyword),
1624
- parentId: kn(t.parentId),
1625
- page: {
1626
- pageNum: n,
1627
- pageSize: r
1628
- }
1629
- }
1630
- }), n);
1631
- }
1632
- };
1633
- }
1634
- function bn(e) {
1635
- let t = En(e);
1636
- return {
1637
- directSelections: Dn(t.directSelections).flatMap(Sn),
1638
- navigations: Dn(t.navigations).flatMap(Cn)
1639
- };
1640
- }
1641
- function xn(e, t) {
1642
- let n = En(e), r = Dn(n.records).flatMap(wn), i = Mn(n.pageNum) ?? t, a = Mn(n.pages), o = jn(n.totalKnown, !0) && a != null ? i < a : r.length > 0;
1643
- return {
1644
- records: r,
1645
- hasMore: o,
1646
- ...o ? { nextPage: i + 1 } : {}
1647
- };
1648
- }
1649
- function Sn(e) {
1650
- let t = En(e), n = On(t.selectionKey);
1651
- return n ? [{
1652
- selectionKey: n,
1653
- label: On(t.title ?? t.label) ?? n
1654
- }] : [];
1655
- }
1656
- function Cn(e) {
1657
- let t = En(e), n = On(t.navigationKey), r = Tn(t.level);
1658
- return !n || !r ? [] : [{
1659
- navigationKey: n,
1660
- level: r,
1661
- label: On(t.title ?? t.label) ?? n
1662
- }];
1663
- }
1664
- function wn(e) {
1665
- let t = En(e), n = On(t.id), r = On(t.selectionKey);
1666
- return !n || !r ? [] : [{
1667
- id: n,
1668
- selectionKey: r,
1669
- label: On(t.title ?? t.label) ?? r,
1670
- ...On(t.subtitle ?? t.secondaryLabel) ? { secondaryLabel: On(t.subtitle ?? t.secondaryLabel) } : {},
1671
- expandable: jn(t.expandable, !1)
1672
- }];
1673
- }
1674
- function Tn(e) {
1675
- return e === "TENANT" || e === "ORGANIZATION" ? e : void 0;
1676
- }
1677
- function En(e) {
1678
- return e && typeof e == "object" && !Array.isArray(e) ? e : {};
1679
- }
1680
- function Dn(e) {
1681
- return Array.isArray(e) ? e : [];
1682
- }
1683
- function On(e) {
1684
- return typeof e == "string" ? kn(e) : void 0;
1685
- }
1686
- function kn(e) {
1687
- return e?.trim() || void 0;
1688
- }
1689
- function An(e, t) {
1690
- let n = kn(e);
1691
- if (!n) throw Error(`角色归属范围${t}不能为空`);
1692
- return n;
1693
- }
1694
- function jn(e, t) {
1695
- return typeof e == "boolean" ? e : t;
1696
- }
1697
- function Mn(e) {
1698
- return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
1699
- }
1700
- function Nn(e) {
1701
- return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
1702
- }
1703
- //#endregion
1704
- //#region src/platform-admin-runtime/role/RoleScopeTree.vue
1705
- var Pn = /* @__PURE__ */ K({
1706
- name: "RoleScopeTree",
1707
- __name: "RoleScopeTree",
1708
- props: { context: {} },
1709
- setup(e) {
1710
- let t = e, n = yn(Nt()), i = J(), a = J(""), o = J(!1), s = J([]), c = J([]), l = J(0), d = J(/* @__PURE__ */ new Map()), f = z(() => t.context.selectionKey), p = z(() => i.value?.navigations.some((e) => e.level === "TENANT") === !0), m = z(() => i.value?.navigations.length !== 0), h = z(() => p.value ? "租户" : "机构"), g = C({
1711
- nodes: () => s.value,
1712
- loader: () => ne,
1713
- version: () => l.value
1714
- }), _ = g.nodes, v = g.states, y = 0, b;
1715
- be(() => void x()), ye(() => {
1716
- y += 1, b && clearTimeout(b);
1717
- }), Z(a, () => {
1718
- m.value && (b && clearTimeout(b), b = setTimeout(() => void E(), 240));
1719
- });
1720
- async function x() {
1721
- o.value = !0;
1722
- try {
1723
- i.value = await n.descriptor();
1724
- let e = i.value.directSelections[0];
1725
- !t.context.selectionKey && e && k({
1726
- key: e.selectionKey,
1727
- label: e.label
1728
- }), await T();
1729
- } catch (e) {
1730
- u(e, {
1731
- source: "role-scope-tree",
1732
- phase: "load"
1733
- });
1734
- } finally {
1735
- o.value = !1;
1736
- }
1737
- }
1738
- async function T(e = {}) {
1739
- let t = i.value;
1740
- if (!t) return;
1741
- let n = ++y;
1742
- if (!e.append) {
1743
- c.value = [], l.value += 1, o.value = !0;
1744
- try {
1745
- let e = ee(t);
1746
- if (n !== y) return;
1747
- d.value = /* @__PURE__ */ new Map(), re(e), s.value = e.map((e) => e.ui);
1748
- } catch (e) {
1749
- if (n !== y) return;
1750
- s.value = [], u(e, {
1751
- source: "role-scope-tree",
1752
- phase: "load"
1753
- });
1754
- } finally {
1755
- n === y && (o.value = !1);
1756
- }
1757
- }
1758
- }
1759
- async function E() {
1760
- if (await T(), !a.value.trim()) return;
1761
- let e = (i.value?.navigations ?? []).map((e) => `navigation:${e.navigationKey}`);
1762
- c.value = e, await ge(), await Promise.all(e.map((e) => g.request(e, "refresh")));
1763
- }
1764
- function ee(e) {
1765
- return [
1766
- ...e.directSelections.map((e) => ({
1767
- ui: {
1768
- key: e.selectionKey,
1769
- title: e.label,
1770
- isLeaf: !0
1771
- },
1772
- selection: {
1773
- key: e.selectionKey,
1774
- label: e.label
1775
- }
1776
- })),
1777
- ...e.navigations.filter((e) => e.level === "ORGANIZATION").map((e) => D(e)),
1778
- ...e.navigations.filter((e) => e.level === "TENANT").map((e) => D(e))
1779
- ];
1780
- }
1781
- function D(e) {
1782
- return {
1783
- ui: {
1784
- key: `navigation:${e.navigationKey}`,
1785
- title: e.label,
1786
- isLeaf: !1
1787
- },
1788
- children: {
1789
- navigationKey: e.navigationKey,
1790
- level: e.level
1791
- }
1792
- };
1793
- }
1794
- function te(e, t, n) {
1795
- let r = O(e, t, n);
1796
- return {
1797
- ui: {
1798
- key: e.selectionKey,
1799
- title: e.label,
1800
- secondary: e.secondaryLabel,
1801
- isLeaf: !r
1802
- },
1803
- selection: {
1804
- key: e.selectionKey,
1805
- label: e.label,
1806
- secondaryLabel: e.secondaryLabel
1807
- },
1808
- children: r
1809
- };
1810
- }
1811
- function O(e, t, n) {
1812
- return t === "TENANT" ? {
1813
- navigationKey: e.selectionKey,
1814
- level: "ORGANIZATION"
1815
- } : e.expandable ? {
1816
- navigationKey: n,
1817
- level: "ORGANIZATION",
1818
- parentId: e.id
1819
- } : void 0;
1820
- }
1821
- async function ne(e, t) {
1822
- let r = d.value.get(e.key);
1823
- if (!r?.children) throw Error("角色归属范围已失效");
1824
- try {
1825
- let e = await n.candidates({
1826
- ...r.children,
1827
- keyword: a.value.trim() || void 0,
1828
- pageNum: t.reason === "load-more" ? Number(t.cursor) : 1
1829
- });
1830
- t.signal.throwIfAborted();
1831
- let i = e.records.map((e) => te(e, r.children.level, r.children.navigationKey));
1832
- return re(i), {
1833
- mode: t.reason === "load-more" ? "append" : "replace",
1834
- nodes: i.map((e) => e.ui),
1835
- hasMore: e.hasMore,
1836
- nextCursor: e.nextPage == null ? void 0 : String(e.nextPage)
1837
- };
1838
- } catch (e) {
1839
- throw t.signal.aborted || u(e, {
1840
- source: "role-scope-tree",
1841
- phase: "load"
1842
- }), e;
1843
- }
1844
- }
1845
- function re(e) {
1846
- let t = new Map(d.value);
1847
- e.forEach((e) => t.set(e.ui.key, e)), d.value = t;
1848
- }
1849
- function ie(e) {
1850
- let t = d.value.get(e.key)?.selection;
1851
- t && k(t);
1852
- }
1853
- function k(e) {
1854
- t.context.selectSelectionKey(e.key, {
1855
- label: e.label,
1856
- secondaryLabel: e.secondaryLabel
1857
- });
1858
- }
1859
- function A() {
1860
- let e = i.value?.directSelections[0];
1861
- e && k({
1862
- key: e.selectionKey,
1863
- label: e.label
1864
- });
1865
- }
1866
- return (e, t) => (q(), B(X(r), {
1867
- class: "role-scope-tree",
1868
- title: h.value,
1869
- "refresh-title": "刷新角色归属范围",
1870
- "search-keyword": a.value,
1871
- "search-placeholder": "搜索名称、编码或标识",
1872
- searchable: m.value,
1873
- onRefresh: T,
1874
- "onUpdate:searchKeyword": t[3] ||= (e) => a.value = e
1875
- }, {
1876
- default: Q(() => [o.value ? (q(), B(X(S), {
1877
- key: 0,
1878
- tip: "加载角色归属范围"
1879
- })) : (q(), B(X(w), {
1880
- key: 1,
1881
- "expanded-keys": c.value,
1882
- "onUpdate:expandedKeys": t[0] ||= (e) => c.value = e,
1883
- nodes: X(_),
1884
- "selected-key": f.value,
1885
- "reload-key": l.value,
1886
- "load-strategy": "controlled",
1887
- "reload-on-reexpand": "",
1888
- "branch-states": X(v),
1889
- onLoadRequest: t[1] ||= (e) => X(g).request(e.node.key, e.reason, X(g).stateOf(e.node.key).status === "error"),
1890
- onSelect: ie,
1891
- onDeselect: A,
1892
- onUnloadChildren: t[2] ||= (e) => X(g).release(e.key)
1893
- }, null, 8, [
1894
- "expanded-keys",
1895
- "nodes",
1896
- "selected-key",
1897
- "reload-key",
1898
- "branch-states"
1899
- ]))]),
1900
- _: 1
1901
- }, 8, [
1902
- "title",
1903
- "search-keyword",
1904
- "searchable"
1905
- ]));
1906
- }
1907
- }), Fn = /* @__PURE__ */ K({
1908
- name: "RoleEnumTitleCell",
1909
- __name: "RoleEnumTitleCell",
1910
- props: {
1911
- record: {},
1912
- column: {}
1913
- },
1914
- setup(e) {
1915
- let t = e, n = z(() => {
1916
- let e = String(t.record[t.column?.key ?? ""] ?? "");
1917
- return {
1918
- account: "账号角色",
1919
- employment: "任职角色",
1920
- standard: "标准角色",
1921
- group: "角色组",
1922
- dataGrant: "数据授权角色",
1923
- system: "系统角色",
1924
- private: "私有",
1925
- ownerAndChildren: "本级及下级",
1926
- tenant: "租户公开",
1927
- platform: "全局公开"
1928
- }[e] ?? (e || "-");
1929
- });
1930
- return (e, t) => (q(), H("span", null, Y(n.value), 1));
1931
- }
1932
- });
1933
- //#endregion
1934
- //#region src/views/roleGrantClient.ts
1935
- function In(e) {
1936
- return {
1937
- accountRoleGrants(t, n) {
1938
- return e.request({
1939
- path: `/iam.role/${encodeURIComponent(t)}/account-grants`,
1940
- query: n ? { targetTenantId: n } : void 0
1941
- });
1942
- },
1943
- grantAccountRole(t, n) {
1944
- return e.request({
1945
- method: "POST",
1946
- path: `/iam.role/${encodeURIComponent(t)}/account-grants`,
1947
- body: n
1948
- });
1949
- },
1950
- deleteAccountRoleGrant(t, n, r) {
1951
- return e.request({
1952
- method: "POST",
1953
- path: `/iam.role/${encodeURIComponent(t)}/account-grants/${encodeURIComponent(n)}/delete`,
1954
- query: r ? { targetTenantId: r } : void 0
1955
- });
1956
- },
1957
- accountRoleCandidates(t, n) {
1958
- return e.request({
1959
- method: "POST",
1960
- path: `/iam.role/${encodeURIComponent(t)}/account-role-candidates/query`,
1961
- body: n
1962
- });
1963
- },
1964
- employmentRoleGrants(t) {
1965
- return e.request({ path: `/iam.role/${encodeURIComponent(t)}/employment-grants` });
1966
- },
1967
- grantEmploymentRole(t, n) {
1968
- return e.request({
1969
- method: "POST",
1970
- path: `/iam.role/${encodeURIComponent(t)}/employment-grants`,
1971
- body: { employeePositionId: n }
1972
- });
1973
- },
1974
- deleteEmploymentRoleGrant(t, n) {
1975
- return e.request({
1976
- method: "POST",
1977
- path: `/iam.role/${encodeURIComponent(t)}/employment-grants/${encodeURIComponent(n)}/delete`
1978
- });
1979
- },
1980
- employmentSelector(t, n) {
1981
- return e.request({
1982
- method: "POST",
1983
- path: `/iam.role/${encodeURIComponent(t)}/employment-selector/query`,
1984
- body: n
1985
- });
1986
- },
1987
- authorizationModules(t) {
1988
- return e.request({ path: `/iam.role/authorizationModules/${encodeURIComponent(t)}` });
1989
- },
1990
- permissionMatrix(t, n) {
1991
- return e.request({
1992
- method: "POST",
1993
- path: `/iam.role/permissionMatrix/${encodeURIComponent(t)}`,
1994
- body: { moduleAliases: n }
1995
- });
1996
- },
1997
- grantAction(t, n) {
1998
- return e.request({
1999
- method: "POST",
2000
- path: `/iam.role/grant/${encodeURIComponent(t)}`,
2001
- body: n
2002
- });
2003
- },
2004
- revokeAction(t, n, r) {
2005
- return e.request({
2006
- method: "POST",
2007
- path: `/iam.role/revoke/${encodeURIComponent(t)}`,
2008
- body: {
2009
- moduleAlias: n,
2010
- actionCode: r
2011
- }
2012
- });
2013
- },
2014
- replacePermissionMatrix(t, n) {
2015
- return e.request({
2016
- method: "POST",
2017
- path: `/iam.role/permissionMatrix/${encodeURIComponent(t)}/replace`,
2018
- body: { actions: n }
2019
- });
2020
- },
2021
- dataGrantActionMatrix(t) {
2022
- return e.request({ path: `/iam.role/dataGrantActionMatrix/${encodeURIComponent(t)}` });
2023
- },
2024
- dataScopePolicyCatalog(t, n) {
2025
- return e.request({
2026
- path: `/iam.role/dataScopePolicyCatalog/${encodeURIComponent(t)}`,
2027
- query: n ? { moduleAlias: n } : void 0
2028
- });
2029
- },
2030
- replaceDataGrantActions(t, n) {
2031
- return e.request({
2032
- method: "POST",
2033
- path: `/iam.role/dataGrantActions/${encodeURIComponent(t)}`,
2034
- body: { actions: n }
2035
- });
2036
- }
2037
- };
2038
- }
2039
- //#endregion
2040
- //#region src/views/RoleAccountGrantDrawer.vue?vue&type=script&setup=true&lang.ts
2041
- var Ln = {
2042
- key: 1,
2043
- class: "role-account-grant-drawer-state"
2044
- }, Rn = {
2045
- key: 0,
2046
- class: "role-account-grant-target-tenant"
2047
- }, zn = {
2048
- key: 1,
2049
- class: "role-account-grant-target-hint"
2050
- }, Bn = { class: "role-account-grant-search" }, Vn = {
2051
- key: 0,
2052
- class: "role-account-grant-selected"
2053
- }, Hn = { class: "role-account-grant-selected-title" }, Un = { class: "role-account-grant-selected-list" }, Wn = ["disabled", "onClick"], Gn = 20, Kn = /*#__PURE__*/ M(/* @__PURE__ */ K({
2054
- name: "RoleAccountGrantDrawer",
2055
- __name: "RoleAccountGrantDrawer",
2056
- props: {
2057
- open: { type: Boolean },
2058
- container: {},
2059
- embedded: { type: Boolean },
2060
- drawerContext: {},
2061
- context: {},
2062
- role: {}
2063
- },
2064
- emits: ["close", "saved"],
2065
- setup(e, { emit: t }) {
2066
- let n = e, r = t, i = J([]), s = J({}), c = J([]), l = J(/* @__PURE__ */ new Set()), d = J(/* @__PURE__ */ new Set()), f = J(""), p = J(""), m = J(1), h = J(0), _ = J(!1), v = J(!1), b = J(!1), x = J(!1), C = J(), w = z(() => In(n.context.http)), E = g({ moduleAlias: "iam.tenant" }), ee = z(() => n.role?.id), O = z(() => n.role ? `绑定用户 - ${je(n.role)}` : "绑定用户"), ne = z(() => n.embedded ? "section" : re), ie = z(() => n.embedded ? {} : {
2067
- open: n.open,
2068
- title: O.value,
2069
- renderMode: n.container ? "inline" : "portal",
2070
- closeTitle: "关闭",
2071
- onClose: ve
2072
- }), k = z(() => n.role?.ownerScopeType === "platform"), A = z(() => C.value?.id), j = z(() => !k.value || !!A.value), ae = z(() => E), M = z(() => {
2073
- let e = /* @__PURE__ */ new Map();
2074
- for (let t of i.value) t.userId && e.set(t.userId, t);
2075
- return e;
2076
- }), N = z(() => c.value.filter((e) => e.id).map((e) => ({
2077
- id: e.id,
2078
- username: ke(e),
2079
- employeeNo: e.employeeNo ?? "",
2080
- employeeTitle: e.employeeTitle ?? "",
2081
- organizationTitle: e.organizationTitle ?? e.organizationId ?? "",
2082
- departmentTitle: e.departmentTitle ?? e.departmentId ?? "",
2083
- boundTitle: d.value.has(e.id) ? "已绑定" : "未绑定"
2084
- }))), P = z(() => [...l.value].map((e) => s.value[e] ?? Oe(e))), F = z(() => [...l.value].filter((e) => !d.value.has(e))), oe = z(() => [...d.value].filter((e) => !l.value.has(e))), I = z(() => F.value.length > 0 || oe.value.length > 0), se = {
2085
- rowKey: "id",
2086
- columns: [
2087
- {
2088
- title: "用户账号",
2089
- key: "username",
2090
- width: 140
2091
- },
2092
- {
2093
- title: "职员姓名",
2094
- key: "employeeTitle",
2095
- width: 120
2096
- },
2097
- {
2098
- title: "职员工号",
2099
- key: "employeeNo",
2100
- width: 120
2101
- },
2102
- {
2103
- title: "所属机构",
2104
- key: "organizationTitle",
2105
- width: 140
2106
- },
2107
- {
2108
- title: "所属部门",
2109
- key: "departmentTitle",
2110
- width: 140
2111
- },
2112
- {
2113
- title: "状态",
2114
- key: "boundTitle",
2115
- width: 90
2116
- }
2117
- ]
2118
- }, ce = z(() => ({
2119
- selectedRowKeys: [...l.value],
2120
- preserveSelectedRowKeys: !0,
2121
- disabledOf: () => b.value,
2122
- onChange: (e) => {
2123
- l.value = new Set(e.map((e) => String(e)));
2124
- }
2125
- })), le = z(() => ({
2126
- current: m.value,
2127
- total: h.value,
2128
- pageSize: Gn,
2129
- showSizeChanger: !1,
2130
- showQuickJumper: !1,
2131
- onChange: (e) => void pe(e)
2132
- }));
2133
- Z(() => [n.open, n.role?.id], ([e]) => {
2134
- e ? L() : be();
2135
- }, { immediate: !0 }), Z([
2136
- () => n.embedded,
2137
- () => n.drawerContext,
2138
- l,
2139
- I,
2140
- j,
2141
- F,
2142
- oe,
2143
- b,
2144
- _
2145
- ], ue, { immediate: !0 }), ye(() => n.drawerContext?.setOperation(void 0));
2146
- function ue() {
2147
- let e = n.drawerContext;
2148
- n.embedded && e && (e.setSubtitle(`角色:${je(n.role ?? {})} · ${Me(n.role)}`), e.setOperation({
2149
- summary: de(),
2150
- actions: [{
2151
- key: "cancel-account-role-grants",
2152
- label: "取消",
2153
- disabled: b.value || _.value,
2154
- run: ve
2155
- }, {
2156
- key: "save-account-role-grants",
2157
- label: "确定",
2158
- emphasis: "primary",
2159
- disabled: _.value || !j.value || !I.value,
2160
- loading: b.value,
2161
- run: () => void ge()
2162
- }]
2163
- }));
2164
- }
2165
- function de() {
2166
- return j.value ? I.value ? `已选 ${l.value.size} 个用户 · 新增 ${F.value.length} · 移除 ${oe.value.length}` : `已选 ${l.value.size} 个用户` : "请选择目标租户";
2167
- }
2168
- async function L() {
2169
- let e = ee.value;
2170
- if (!e) {
2171
- be();
2172
- return;
2173
- }
2174
- if (!j.value) {
2175
- xe();
2176
- return;
2177
- }
2178
- _.value = !0, x.value = !1;
2179
- try {
2180
- let t = await w.value.accountRoleGrants(e, A.value);
2181
- i.value = t;
2182
- let n = new Set(t.map((e) => e.userId).filter((e) => !!e));
2183
- d.value = n, l.value = new Set(n), s.value = De([...t.map((e) => Oe(e.userId)).filter((e) => !!e)]), await pe(1);
2184
- } catch (e) {
2185
- x.value = !0, u(e, {
2186
- source: "role-account-grants",
2187
- phase: "load"
2188
- });
2189
- } finally {
2190
- _.value = !1;
2191
- }
2192
- }
2193
- async function pe(e) {
2194
- let t = ee.value;
2195
- if (t && j.value) {
2196
- v.value = !0;
2197
- try {
2198
- let n = await w.value.accountRoleCandidates(t, {
2199
- targetTenantId: A.value,
2200
- keyword: p.value,
2201
- enabledOnly: !0,
2202
- page: {
2203
- pageNum: Math.max(0, e),
2204
- pageSize: Gn
2205
- }
2206
- });
2207
- c.value = n.records, s.value = {
2208
- ...s.value,
2209
- ...De(n.records)
2210
- }, m.value = n.pageNum, h.value = n.total;
2211
- } catch (e) {
2212
- u(e, {
2213
- source: "role-account-grants",
2214
- phase: "load"
2215
- });
2216
- } finally {
2217
- v.value = !1;
2218
- }
2219
- }
2220
- }
2221
- function K() {
2222
- p.value = f.value.trim(), pe(0);
2223
- }
2224
- function me(e, t) {
2225
- let n = new Set(l.value);
2226
- t ? n.add(e) : n.delete(e), l.value = n;
2227
- }
2228
- async function ge() {
2229
- let e = ee.value;
2230
- if (e && j.value) {
2231
- if (!I.value) {
2232
- r("close");
2233
- return;
2234
- }
2235
- b.value = !0;
2236
- try {
2237
- for (let t of F.value) await w.value.grantAccountRole(e, {
2238
- userId: t,
2239
- targetTenantId: A.value
2240
- });
2241
- for (let t of oe.value) {
2242
- let n = M.value.get(t)?.id;
2243
- n && await w.value.deleteAccountRoleGrant(e, n, A.value);
2244
- }
2245
- await te({
2246
- success: !0,
2247
- message: "用户绑定已保存"
2248
- }, {
2249
- source: "role-account-grants",
2250
- phase: "action",
2251
- fallbackMessage: "用户绑定已保存"
2252
- }), r("saved"), r("close");
2253
- } catch (e) {
2254
- u(e, {
2255
- source: "role-account-grants",
2256
- phase: "action"
2257
- });
2258
- } finally {
2259
- b.value = !1;
2260
- }
2261
- }
2262
- }
2263
- function ve() {
2264
- b.value || r("close");
2265
- }
2266
- function be() {
2267
- C.value = void 0, xe();
2268
- }
2269
- function xe() {
2270
- i.value = [], s.value = {}, c.value = [], l.value = /* @__PURE__ */ new Set(), d.value = /* @__PURE__ */ new Set(), f.value = "", p.value = "", m.value = 1, h.value = 0, _.value = !1, v.value = !1, b.value = !1, x.value = !1;
2271
- }
2272
- async function Ce(e) {
2273
- if (!e) {
2274
- C.value = void 0, xe();
2275
- return;
2276
- }
2277
- let t = await E.crud.view(e);
2278
- C.value = t ?? {
2279
- id: e,
2280
- title: e
2281
- }, await L();
2282
- }
2283
- function Te(e) {
2284
- me(e, !1);
2285
- }
2286
- function De(e) {
2287
- let t = {};
2288
- for (let n of e) n.id && (t[n.id] = n);
2289
- return t;
2290
- }
2291
- function Oe(e) {
2292
- return e ? {
2293
- id: e,
2294
- username: e
2295
- } : void 0;
2296
- }
2297
- function ke(e) {
2298
- return String(e?.username ?? e?.id ?? "未知用户");
2299
- }
2300
- function Ae(e) {
2301
- return e.employeeTitle && e.employeeNo ? `${e.employeeTitle} / ${e.employeeNo}` : e.employeeTitle ?? e.employeeNo ?? e.employeeId ?? e.id;
2302
- }
2303
- function je(e) {
2304
- return String(e.title ?? e.id ?? "角色");
2305
- }
2306
- function Me(e) {
2307
- return e?.ownerScopeType === "platform" ? "平台范围" : e?.ownerScopeType === "organization" ? "机构范围" : "租户范围";
2308
- }
2309
- return (t, n) => (q(), B(we(ne.value), he(ie.value, { class: { "role-account-grant-drawer-surface": e.embedded } }), fe({
2310
- default: Q(() => [_.value ? (q(), B(X(S), {
2311
- key: 0,
2312
- class: "role-account-grant-drawer-state",
2313
- tip: "加载用户"
2314
- })) : x.value ? (q(), H("div", Ln, [G(X(y), {
2315
- title: "用户加载失败",
2316
- message: "无法加载当前角色的用户绑定"
2317
- }), G(X(D), {
2318
- type: "primary",
2319
- "icon-name": "reload",
2320
- onClick: L
2321
- }, {
2322
- default: Q(() => [...n[3] ||= [W("重试", -1)]]),
2323
- _: 1
2324
- })])) : (q(), H("section", {
2325
- key: 2,
2326
- class: _e(["role-account-grant-drawer-body", { "role-account-grant-drawer-body--target-tenant": k.value }])
2327
- }, [k.value ? (q(), H("label", Rn, [n[4] ||= U("span", null, "目标租户", -1), G(X(o), {
2328
- context: ae.value,
2329
- value: A.value,
2330
- mode: "list",
2331
- placeholder: "请选择角色下发的目标租户",
2332
- disabled: b.value || _.value,
2333
- "onUpdate:value": Ce
2334
- }, null, 8, [
2335
- "context",
2336
- "value",
2337
- "disabled"
2338
- ])])) : V("v-if", !0), j.value ? (q(), H(R, { key: 2 }, [
2339
- U("div", Bn, [G(X(T), {
2340
- value: f.value,
2341
- "allow-clear": "",
2342
- disabled: b.value,
2343
- placeholder: "搜索用户账号",
2344
- "onUpdate:value": n[0] ||= (e) => f.value = e,
2345
- onKeydown: Ee(K, ["enter"])
2346
- }, null, 8, ["value", "disabled"]), G(X(D), {
2347
- "icon-name": "search",
2348
- disabled: b.value,
2349
- onClick: K
2350
- }, {
2351
- default: Q(() => [...n[5] ||= [W("查询", -1)]]),
2352
- _: 1
2353
- }, 8, ["disabled"])]),
2354
- G(X(a), {
2355
- class: "role-account-grant-table",
2356
- size: "middle",
2357
- contract: se,
2358
- rows: N.value,
2359
- loading: v.value,
2360
- pagination: le.value,
2361
- selection: ce.value,
2362
- "fill-height": ""
2363
- }, null, 8, [
2364
- "rows",
2365
- "loading",
2366
- "pagination",
2367
- "selection"
2368
- ]),
2369
- P.value.length > 0 ? (q(), H("section", Vn, [U("div", Hn, [n[6] ||= U("strong", null, "已选用户", -1), U("span", null, Y(P.value.length) + " 个", 1)]), U("div", Un, [(q(!0), H(R, null, Se(P.value, (e) => (q(), H("button", {
2370
- key: e.id,
2371
- type: "button",
2372
- disabled: b.value,
2373
- onClick: (t) => Te(e.id)
2374
- }, [U("span", null, Y(ke(e)), 1), U("small", null, Y(Ae(e)), 1)], 8, Wn))), 128))])])) : V("v-if", !0)
2375
- ], 64)) : (q(), H("div", zn, " 平台共享角色需要先选择目标租户,再加载可绑定账号。 "))], 2))]),
2376
- _: 2
2377
- }, [e.embedded ? void 0 : {
2378
- name: "operation",
2379
- fn: Q(() => [G(X(D), {
2380
- disabled: b.value || _.value,
2381
- onClick: ve
2382
- }, {
2383
- default: Q(() => [...n[1] ||= [W("取消", -1)]]),
2384
- _: 1
2385
- }, 8, ["disabled"]), G(X(D), {
2386
- type: "primary",
2387
- loading: b.value,
2388
- disabled: _.value || !I.value,
2389
- onClick: ge
2390
- }, {
2391
- default: Q(() => [...n[2] ||= [W(" 确定 ", -1)]]),
2392
- _: 1
2393
- }, 8, ["loading", "disabled"])]),
2394
- key: "0"
2395
- }]), 1040, ["class"]));
2396
- }
2397
- }), [["__scopeId", "data-v-fc27c9ca"]]), qn = /* @__PURE__ */ K({
2398
- name: "RoleAccountGrantDrawerSurface",
2399
- __name: "RoleAccountGrantDrawerSurface",
2400
- props: { context: {} },
2401
- setup(e) {
2402
- let t = e, n = z(() => t.context.module), r = z(() => t.context.record);
2403
- return (e, i) => (q(), B(Kn, {
2404
- open: "",
2405
- embedded: "",
2406
- "drawer-context": t.context,
2407
- context: n.value,
2408
- role: r.value,
2409
- onClose: t.context.close,
2410
- onSaved: t.context.refreshList
2411
- }, null, 8, [
2412
- "drawer-context",
2413
- "context",
2414
- "role",
2415
- "onClose",
2416
- "onSaved"
2417
- ]));
2418
- }
2419
- }), Jn = /*#__PURE__*/ M(/* @__PURE__ */ K({
2420
- name: "EmployeeEmploymentTable",
2421
- __name: "EmployeeEmploymentTable",
2422
- props: {
2423
- rows: {},
2424
- selectedIds: { default: () => /* @__PURE__ */ new Set() },
2425
- selectable: {
2426
- type: Boolean,
2427
- default: !1
2428
- },
2429
- disabled: {
2430
- type: Boolean,
2431
- default: !1
2432
- },
2433
- pagination: {
2434
- type: [Boolean, Object],
2435
- default: !1
2436
- },
2437
- fillHeight: {
2438
- type: Boolean,
2439
- default: !1
2440
- }
2441
- },
2442
- emits: ["update:selectedIds"],
2443
- setup(e, { emit: t }) {
2444
- let n = e, r = t, i = J([]), a = [
2445
- {
2446
- key: "title",
2447
- title: "职员",
2448
- width: 160
2449
- },
2450
- {
2451
- key: "employeeNo",
2452
- title: "工号",
2453
- width: 140
2454
- },
2455
- {
2456
- key: "organizationTitle",
2457
- title: "所属机构",
2458
- width: 180
2459
- },
2460
- {
2461
- key: "employmentCount",
2462
- title: "任职",
2463
- width: 88,
2464
- align: "right"
2465
- },
2466
- {
2467
- key: "selectedCount",
2468
- title: "已选",
2469
- width: 88,
2470
- align: "right"
2471
- }
2472
- ], o = [
2473
- {
2474
- key: "position",
2475
- title: "岗位",
2476
- width: 160
2477
- },
2478
- {
2479
- key: "organization",
2480
- title: "机构",
2481
- width: 160
2482
- },
2483
- {
2484
- key: "department",
2485
- title: "部门",
2486
- width: 160
2487
- },
2488
- {
2489
- key: "primaryPosition",
2490
- title: "主岗位",
2491
- width: 88
2492
- }
2493
- ], s = z(() => {
2494
- let e = /* @__PURE__ */ new Map();
2495
- for (let t of n.rows) {
2496
- let n = t.employeeId ?? t.id, r = e.get(n) ?? {
2497
- employeeId: n,
2498
- title: t.employeeTitle ?? n,
2499
- employeeNo: t.employeeNo,
2500
- organizationTitle: t.organizationTitle,
2501
- positions: []
2502
- };
2503
- r.positions.push(t), e.set(n, r);
2504
- }
2505
- return [...e.values()];
2506
- }), c = z(() => s.value);
2507
- function l(e, t) {
2508
- let n = t;
2509
- return e.key === "title" ? n.title : e.key === "employeeNo" ? n.employeeNo ?? n.employeeId : e.key === "organizationTitle" ? n.organizationTitle ?? "-" : e.key === "employmentCount" ? `${n.positions.length} 项` : e.key === "selectedCount" ? `${d(n)} 项` : "";
2510
- }
2511
- function u(e, t) {
2512
- let n = t;
2513
- return e.key === "position" ? n.positionTitle ?? n.positionId : e.key === "organization" ? n.organizationTitle ?? n.organizationId : e.key === "department" ? n.departmentTitle ?? n.departmentId : e.key === "primaryPosition" ? n.primaryPosition ? "是" : "否" : "";
2514
- }
2515
- function d(e) {
2516
- return e.positions.filter((e) => n.selectedIds.has(e.id)).length;
2517
- }
2518
- function f(e) {
2519
- if (n.selectable) return {
2520
- selectedRowKeys: e.positions.filter((e) => n.selectedIds.has(e.id)).map((e) => e.id),
2521
- preserveSelectedRowKeys: !0,
2522
- disabledOf: () => n.disabled,
2523
- onChange: (t) => p(e, t)
2524
- };
2525
- }
2526
- function p(e, t) {
2527
- let i = new Set(n.selectedIds);
2528
- for (let t of e.positions) i.delete(t.id);
2529
- for (let e of t) i.add(String(e));
2530
- r("update:selectedIds", i);
2531
- }
2532
- function m(e, t) {
2533
- let n = e.employeeId;
2534
- i.value = t ? Array.from(/* @__PURE__ */ new Set([...i.value, n])) : i.value.filter((e) => e !== n);
2535
- }
2536
- function g(e) {
2537
- let t = e.employeeId;
2538
- m(e, !i.value.includes(t));
2539
- }
2540
- return (t, n) => (q(), B(X(k), {
2541
- class: "employee-employment-table",
2542
- columns: a,
2543
- rows: c.value,
2544
- "row-key": "employeeId",
2545
- pagination: e.pagination,
2546
- "expanded-row-keys": i.value,
2547
- "clickable-rows": "",
2548
- "horizontal-scroll": "",
2549
- "fill-height": e.fillHeight,
2550
- onRowExpand: m,
2551
- onRowDblclick: g
2552
- }, {
2553
- cell: Q(({ column: e, record: t }) => [W(Y(l(e, t)), 1)]),
2554
- expandedRow: Q(({ record: e }) => [G(X(h), { title: "任职信息" }, {
2555
- default: Q(() => [G(X(k), {
2556
- columns: o,
2557
- rows: e.positions,
2558
- "row-key": "id",
2559
- pagination: !1,
2560
- selection: f(e),
2561
- "horizontal-scroll": "",
2562
- "row-muted": (e) => e.enabled === !1
2563
- }, {
2564
- cell: Q(({ column: e, record: t }) => [W(Y(u(e, t)), 1)]),
2565
- _: 1
2566
- }, 8, [
2567
- "rows",
2568
- "selection",
2569
- "row-muted"
2570
- ])]),
2571
- _: 2
2572
- }, 1024)]),
2573
- _: 1
2574
- }, 8, [
2575
- "rows",
2576
- "pagination",
2577
- "expanded-row-keys",
2578
- "fill-height"
2579
- ]));
2580
- }
2581
- }), [["__scopeId", "data-v-21f1027e"]]), Yn = { key: 1 }, Xn = {
2582
- key: 2,
2583
- class: "role-employment-grant-body"
2584
- }, Zn = {
2585
- key: 0,
2586
- class: "role-employment-grant-selected"
2587
- }, Qn = { class: "role-employment-grant-selected-title" }, $n = { class: "role-employment-grant-selected-list" }, er = ["disabled", "onClick"], tr = /*#__PURE__*/ M(/* @__PURE__ */ K({
2588
- name: "RoleEmploymentGrantDrawer",
2589
- __name: "RoleEmploymentGrantDrawer",
2590
- props: {
2591
- open: { type: Boolean },
2592
- container: {},
2593
- embedded: { type: Boolean },
2594
- drawerContext: {},
2595
- context: {},
2596
- role: {}
2597
- },
2598
- emits: ["close", "saved"],
2599
- setup(e, { emit: t }) {
2600
- let n = e, r = t, i = J([]), a = J([]), o = J({}), s = J(/* @__PURE__ */ new Set()), c = J(/* @__PURE__ */ new Set()), l = J(!1), d = J(!1), f = J(!1), p = J(!1), m = J(1), h = J(0), g = J(""), _ = z(() => n.role?.id), v = z(() => In(n.context.http)), b = z(() => `绑定任职 - ${n.role?.title ?? n.role?.id ?? ""}`), x = z(() => n.embedded ? "section" : re), C = z(() => n.embedded ? {} : {
2601
- open: n.open,
2602
- title: b.value,
2603
- renderMode: n.container ? "inline" : "portal",
2604
- closeTitle: "关闭",
2605
- onClose: () => !f.value && r("close")
2606
- }), w = z(() => [...s.value].filter((e) => !c.value.has(e))), E = z(() => [...c.value].filter((e) => !s.value.has(e))), ee = z(() => new Map(i.value.map((e) => [e.employeePositionId, e]))), O = z(() => a.value.filter((e) => !g.value.trim() || M(e).includes(g.value.trim()))), ne = z(() => [...s.value].map((e) => o.value[e] ?? F(e))), ie = z(() => ({
2607
- current: m.value,
2608
- total: h.value,
2609
- pageSize: 50,
2610
- showSizeChanger: !1,
2611
- showQuickJumper: !1,
2612
- onChange: (e) => void A(e)
2613
- }));
2614
- Z(() => [n.open, n.role?.id], ([e]) => {
2615
- e ? A() : ae();
2616
- }, { immediate: !0 }), Z([
2617
- () => n.embedded,
2618
- () => n.drawerContext,
2619
- s,
2620
- w,
2621
- E,
2622
- f,
2623
- d
2624
- ], k, { immediate: !0 }), ye(() => n.drawerContext?.setOperation(void 0));
2625
- function k() {
2626
- let e = n.drawerContext;
2627
- n.embedded && e && (e.setSubtitle(`角色:${n.role?.title ?? n.role?.id ?? "角色"} · ${se(n.role)}`), e.setOperation({
2628
- summary: `已选 ${s.value.size} 个任职${w.value.length || E.value.length ? ` · 新增 ${w.value.length} · 移除 ${E.value.length}` : ""}`,
2629
- actions: [{
2630
- key: "cancel-employment-role-grants",
2631
- label: "取消",
2632
- disabled: f.value,
2633
- run: () => r("close")
2634
- }, {
2635
- key: "save-employment-role-grants",
2636
- label: "确定",
2637
- emphasis: "primary",
2638
- disabled: d.value || w.value.length === 0 && E.value.length === 0,
2639
- loading: f.value,
2640
- run: () => void j()
2641
- }]
2642
- }));
2643
- }
2644
- async function A(e = 1) {
2645
- let t = _.value;
2646
- if (t) {
2647
- d.value = !0, p.value = !1;
2648
- try {
2649
- let [n, r] = await Promise.all([v.value.employmentRoleGrants(t), v.value.employmentSelector(t, {
2650
- enabledOnly: !0,
2651
- page: {
2652
- pageNum: e,
2653
- pageSize: 50
2654
- }
2655
- })]);
2656
- i.value = n, c.value = new Set(n.map((e) => e.employeePositionId).filter((e) => !!e)), o.value = {
2657
- ...o.value,
2658
- ...P(r.records)
2659
- }, l.value ||= (s.value = new Set(c.value), !0), a.value = r.records, m.value = r.pageNum, h.value = r.total;
2660
- } catch (e) {
2661
- p.value = !0, u(e, {
2662
- source: "role-employment-grants",
2663
- phase: "load"
2664
- });
2665
- } finally {
2666
- d.value = !1;
2667
- }
2668
- }
2669
- }
2670
- async function j() {
2671
- let e = _.value;
2672
- if (e) {
2673
- f.value = !0;
2674
- try {
2675
- for (let t of w.value) await v.value.grantEmploymentRole(e, t);
2676
- for (let t of E.value) {
2677
- let n = ee.value.get(t)?.id;
2678
- n && await v.value.deleteEmploymentRoleGrant(e, n);
2679
- }
2680
- await te({
2681
- success: !0,
2682
- message: "任职角色授权已保存"
2683
- }, {
2684
- source: "role-employment-grants",
2685
- phase: "action"
2686
- }), r("saved"), r("close");
2687
- } catch (e) {
2688
- u(e, {
2689
- source: "role-employment-grants",
2690
- phase: "action"
2691
- });
2692
- } finally {
2693
- f.value = !1;
2694
- }
2695
- }
2696
- }
2697
- function ae() {
2698
- i.value = [], a.value = [], o.value = {}, s.value = /* @__PURE__ */ new Set(), c.value = /* @__PURE__ */ new Set(), l.value = !1, g.value = "", m.value = 1, h.value = 0, p.value = !1;
2699
- }
2700
- function M(e) {
2701
- return [
2702
- e.employeeTitle,
2703
- e.employeeNo,
2704
- e.organizationTitle,
2705
- e.departmentTitle,
2706
- e.positionTitle
2707
- ].filter(Boolean).join(" ");
2708
- }
2709
- function N(e) {
2710
- let t = new Set(s.value);
2711
- t.delete(e), s.value = t;
2712
- }
2713
- function P(e) {
2714
- let t = {};
2715
- for (let n of e) n.id && (t[n.id] = n);
2716
- return t;
2717
- }
2718
- function F(e) {
2719
- return {
2720
- id: e,
2721
- positionId: e
2722
- };
2723
- }
2724
- function oe(e) {
2725
- let t = e.positionTitle ?? e.positionId ?? e.id;
2726
- return e.employeeTitle ? `${e.employeeTitle} · ${t}` : t;
2727
- }
2728
- function I(e) {
2729
- return [
2730
- e.employeeNo,
2731
- e.organizationTitle ?? e.organizationId,
2732
- e.departmentTitle ?? e.departmentId
2733
- ].filter(Boolean).join(" / ") || e.id;
2734
- }
2735
- function se(e) {
2736
- return e?.ownerScopeType === "platform" ? "平台范围" : e?.ownerScopeType === "organization" ? "机构范围" : "租户范围";
2737
- }
2738
- return (t, n) => (q(), B(we(x.value), he(C.value, { class: { "role-employment-grant-drawer-surface": e.embedded } }), fe({
2739
- default: Q(() => [d.value ? (q(), B(X(S), {
2740
- key: 0,
2741
- tip: "加载任职"
2742
- })) : p.value ? (q(), H("div", Yn, [G(X(y), {
2743
- title: "任职加载失败",
2744
- message: "无法加载任职授权"
2745
- }), G(X(D), { onClick: n[1] ||= (e) => A() }, {
2746
- default: Q(() => [...n[6] ||= [W("重试", -1)]]),
2747
- _: 1
2748
- })])) : (q(), H("section", Xn, [
2749
- G(X(T), {
2750
- value: g.value,
2751
- "onUpdate:value": n[2] ||= (e) => g.value = e,
2752
- "allow-clear": "",
2753
- placeholder: "筛选职员、工号、机构、部门或岗位"
2754
- }, null, 8, ["value"]),
2755
- G(Jn, {
2756
- "selected-ids": s.value,
2757
- "onUpdate:selectedIds": n[3] ||= (e) => s.value = e,
2758
- rows: O.value,
2759
- selectable: "",
2760
- disabled: f.value,
2761
- pagination: ie.value,
2762
- "fill-height": ""
2763
- }, null, 8, [
2764
- "selected-ids",
2765
- "rows",
2766
- "disabled",
2767
- "pagination"
2768
- ]),
2769
- ne.value.length > 0 ? (q(), H("section", Zn, [U("div", Qn, [n[7] ||= U("strong", null, "已选任职", -1), U("span", null, Y(ne.value.length) + " 个", 1)]), U("div", $n, [(q(!0), H(R, null, Se(ne.value, (e) => (q(), H("button", {
2770
- key: e.id,
2771
- type: "button",
2772
- disabled: f.value,
2773
- onClick: (t) => N(e.id)
2774
- }, [U("span", null, Y(oe(e)), 1), U("small", null, Y(I(e)), 1)], 8, er))), 128))])])) : V("v-if", !0)
2775
- ]))]),
2776
- _: 2
2777
- }, [e.embedded ? void 0 : {
2778
- name: "operation",
2779
- fn: Q(() => [G(X(D), {
2780
- disabled: f.value,
2781
- onClick: n[0] ||= (e) => r("close")
2782
- }, {
2783
- default: Q(() => [...n[4] ||= [W("取消", -1)]]),
2784
- _: 1
2785
- }, 8, ["disabled"]), G(X(D), {
2786
- type: "primary",
2787
- loading: f.value,
2788
- disabled: d.value || w.value.length === 0 && E.value.length === 0,
2789
- onClick: j
2790
- }, {
2791
- default: Q(() => [...n[5] ||= [W(" 确定 ", -1)]]),
2792
- _: 1
2793
- }, 8, ["loading", "disabled"])]),
2794
- key: "0"
2795
- }]), 1040, ["class"]));
2796
- }
2797
- }), [["__scopeId", "data-v-06db3659"]]), nr = /* @__PURE__ */ K({
2798
- name: "RoleEmploymentGrantDrawerSurface",
2799
- __name: "RoleEmploymentGrantDrawerSurface",
2800
- props: { context: {} },
2801
- setup(e) {
2802
- let t = e, n = z(() => t.context.module), r = z(() => t.context.record);
2803
- return (e, i) => (q(), B(tr, {
2804
- open: "",
2805
- embedded: "",
2806
- "drawer-context": t.context,
2807
- context: n.value,
2808
- role: r.value,
2809
- onClose: t.context.close,
2810
- onSaved: t.context.refreshList
2811
- }, null, 8, [
2812
- "drawer-context",
2813
- "context",
2814
- "role",
2815
- "onClose",
2816
- "onSaved"
2817
- ]));
2818
- }
2819
- }), rr = /* @__PURE__ */ K({
2820
- name: "WorkspaceViewDrawer",
2821
- __name: "WorkspaceViewDrawer",
2822
- props: {
2823
- open: { type: Boolean },
2824
- title: {},
2825
- container: {},
2826
- subtitle: { default: void 0 },
2827
- profile: { default: "detail" },
2828
- promotion: { default: void 0 },
2829
- dismissal: { default: void 0 },
2830
- beforeClose: {
2831
- type: Function,
2832
- default: void 0
2833
- }
2834
- },
2835
- emits: ["close"],
2836
- setup(e, { emit: t }) {
2837
- let n = e, r = t, i = z(() => n.profile === "wide-work" ? "wide" : "standard");
2838
- return (t, n) => (q(), B(X(re), {
2839
- open: e.open,
2840
- title: e.title,
2841
- "render-mode": e.container ? "inline" : "portal",
2842
- subtitle: e.subtitle,
2843
- width: i.value,
2844
- promotion: e.promotion,
2845
- dismissal: e.dismissal,
2846
- "before-close": e.beforeClose,
2847
- onClose: n[0] ||= (e) => r("close")
2848
- }, fe({
2849
- default: Q(() => [Ce(t.$slots, "default")]),
2850
- _: 2
2851
- }, [t.$slots.operation ? {
2852
- name: "operation",
2853
- fn: Q(() => [Ce(t.$slots, "operation")]),
2854
- key: "0"
2855
- } : void 0]), 1032, [
2856
- "open",
2857
- "title",
2858
- "render-mode",
2859
- "subtitle",
2860
- "width",
2861
- "promotion",
2862
- "dismissal",
2863
- "before-close"
2864
- ]));
2865
- }
2866
- });
2867
- //#endregion
2868
- //#region src/platform-admin-runtime/useWorkspaceViewPromotion.ts
2869
- function ir(e) {
2870
- return e.hasStableIdentity && e.busy !== !0 && e.canChangeHost !== !1;
2871
- }
2872
- function ar(e) {
2873
- let t = ue();
2874
- return z(() => {
2875
- let n = Te(e.input);
2876
- if (n && ir(Te(e.eligibility)) && t) return {
2877
- title: "固定为页签",
2878
- promote: async () => {
2879
- if (await e.beforePromote?.(n) === !1) {
2880
- e.onPromotionRejected?.();
2881
- return;
2882
- }
2883
- let r = t.openPage(se(e.view, n, "tab", Te(e.title)));
2884
- e.onPromoted?.(r);
2885
- }
2886
- };
2887
- });
2888
- }
2889
- //#endregion
2890
- //#region src/platform-admin-runtime/workspaceViewSessions.ts
2891
- var or = /* @__PURE__ */ new Map(), sr = /* @__PURE__ */ new Map();
2892
- function cr(e, t) {
2893
- return `${e.type}:${fr(t)}`;
2894
- }
2895
- async function lr(e, t, n) {
2896
- let r = cr(e, t), i = sr.get(r), a = i && [...i].at(-1);
2897
- return a ? await a(pr(n)) ? "accepted" : "rejected" : (or.set(r, pr(n)), "accepted");
2898
- }
2899
- function ur(e, t, n) {
2900
- let r = cr(e, t), i = sr.get(r) ?? /* @__PURE__ */ new Set();
2901
- return i.add(n), sr.set(r, i), () => {
2902
- i.delete(n), i.size === 0 && sr.delete(r);
2903
- };
2904
- }
2905
- function dr(e, t) {
2906
- let n = cr(e, t), r = or.get(n);
2907
- return or.delete(n), r;
2908
- }
2909
- function fr(e) {
2910
- return Array.isArray(e) ? `[${e.map(fr).join(",")}]` : e && typeof e == "object" ? `{${Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => `${JSON.stringify(e)}:${fr(t)}`).join(",")}}` : JSON.stringify(e);
2911
- }
2912
- function pr(e) {
2913
- return JSON.parse(JSON.stringify(e));
2914
- }
2915
- //#endregion
2916
- //#region src/views/roleAuthorizationWorkspaceSession.ts
2917
- function mr(e, t) {
2918
- return lr(Pe, e, t);
2919
- }
2920
- function hr(e, t) {
2921
- return ur(Pe, e, t);
2922
- }
2923
- function gr(e) {
2924
- return dr(Pe, e);
2925
- }
2926
- //#endregion
2927
- //#region src/views/RoleAuthorizationView.vue?vue&type=script&setup=true&lang.ts
2928
- var _r = { class: "panel-title" }, vr = {
2929
- key: 0,
2930
- class: "authorization-column-header"
2931
- }, yr = {
2932
- key: 2,
2933
- class: "data-scope-editor"
2934
- }, br = { key: 0 }, xr = { key: 1 }, Sr = { key: 3 }, Cr = {
2935
- key: 4,
2936
- class: "not-applicable"
2937
- }, wr = /*@__PURE__*/ K({
2938
- name: "RoleAuthorizationView",
2939
- __name: "RoleAuthorizationView",
2940
- props: {
2941
- roleId: {},
2942
- moduleContext: {},
2943
- container: {},
2944
- drawer: { type: Boolean },
2945
- drawerContext: {}
2946
- },
2947
- emits: ["close"],
2948
- setup(e, { emit: n }) {
2949
- let i = e, a = n, o = g({ moduleAlias: "iam.role" }), s = i.moduleContext ?? o, l = In(s.http), f = i.roleId ?? new URLSearchParams(window.location.search).get("roleId") ?? "", m = ce(), h = i.roleId ? { roleId: i.roleId } : void 0, _ = h ? gr(h) : void 0, v = J(), x = J([]), C = J(), w = J(""), T = J([]), E = J(), O = J(), ne = J(!1), re = J(!1), A = J(!1), j = J(), M = J(), N = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), F = J(0), oe, I = z(() => v.value?.roleKind === "group"), se = z(() => v.value?.roleKind === "dataGrant"), ue = z(() => v.value?.assignmentType === "employment"), de = z(() => !!i.drawerContext), L = z(() => v.value?.title ?? f ?? "角色"), pe = z(() => `授权:${L.value}`), K = z(() => he.value ? `动作授权 - ${he.value.title}` : `动作授权 - ${L.value}`), he = z(() => x.value.find((e) => e.moduleAlias === C.value)), ge = z(() => {
2950
- let e = w.value.trim().toLocaleLowerCase(), t = new Set(e ? x.value.filter((t) => [
2951
- t.title,
2952
- t.moduleAlias,
2953
- t.applicationAlias
2954
- ].filter((e) => !!e).some((t) => t.toLocaleLowerCase().includes(e))).map((e) => e.moduleAlias) : x.value.map((e) => e.moduleAlias)), n = new Map(x.value.map((e) => [e.moduleAlias, e]));
2955
- for (let e of [...t]) {
2956
- let r = n.get(e)?.parentId;
2957
- for (; r && n.has(r) && !t.has(r);) t.add(r), r = n.get(r)?.parentId;
2958
- }
2959
- return x.value.filter((e) => t.has(e.moduleAlias)).map((e) => ({
2960
- id: e.moduleAlias,
2961
- parentId: e.parentId,
2962
- title: e.title,
2963
- secondary: e.applicationAlias
2964
- }));
2965
- }), xe = z(() => (O.value?.options ?? []).map((e) => ({
2966
- value: e.code,
2967
- label: e.title
2968
- }))), Se = z(() => (O.value?.referenceDependencies ?? []).map((e) => ({
2969
- value: e.referenceFieldId,
2970
- label: `${e.title} → ${e.targetModuleTitle}`
2971
- }))), Ce = z(() => new Map((O.value?.referenceDependencies ?? []).map((e) => [e.referenceFieldId, e]))), Te = z(() => ue.value && T.value.some((e) => !!e.dataAuth)), Ee = z(() => [
2972
- {
2973
- key: "title",
2974
- title: "动作",
2975
- width: 160
2976
- },
2977
- {
2978
- key: "granted",
2979
- title: "授权",
2980
- width: 104,
2981
- align: "center"
2982
- },
2983
- ...Te.value ? [{
2984
- key: "dataScopePolicy",
2985
- title: "数据范围",
2986
- width: 200
2987
- }] : []
2988
- ]), De = [
2989
- {
2990
- key: "title",
2991
- title: "标准动作",
2992
- width: 130
2993
- },
2994
- {
2995
- key: "configured",
2996
- title: "启用模板",
2997
- width: 104,
2998
- align: "center"
2999
- },
3000
- {
3001
- key: "dataScopePolicy",
3002
- title: "数据范围",
3003
- width: 160
3004
- }
3005
- ], Oe = z(() => T.value), ke = z(() => E.value?.actions ?? []), Ae = z(() => i.drawer === !0 || !!h && m?.presentation === "drawer"), je = z(() => !!h), Me = z(() => je.value && !de.value), Ne = z(() => de.value ? "div" : Ae.value ? rr : je.value ? d : "div"), Fe = z(() => Ae.value ? {
3006
- open: !0,
3007
- title: pe.value,
3008
- container: i.container ?? null,
3009
- profile: Pe.drawerProfile,
3010
- promotion: Ve.value,
3011
- dismissal: "guarded",
3012
- beforeClose: it,
3013
- onClose: at
3014
- } : Me.value ? { title: pe.value } : {}), Ie = z(() => {
3015
- let e = E.value;
3016
- return !e || M.value === void 0 ? !1 : JSON.stringify(e.actions) !== M.value;
3017
- }), Le = z(() => F.value >= 0 && [...N.entries()].some(([e, t]) => P.get(e) !== JSON.stringify(t))), $ = z(() => Ie.value || Le.value);
3018
- le("角色授权", () => $.value, () => A.value);
3019
- let Re = z(() => T.value.length > 0 && T.value.every((e) => e.granted)), ze = z(() => T.value.some((e) => e.granted) && !Re.value), Be = z(() => {
3020
- let e = he.value?.title ?? "未选择模块", t = T.value.filter((e) => e.granted).length, n = $.value ? "有未确认修改" : "未修改";
3021
- return `当前模块:${e} · 已授权 ${t}/${T.value.length} 项 · ${n}`;
3022
- }), Ve = ar({
3023
- view: Pe,
3024
- input: () => h,
3025
- title: pe,
3026
- eligibility: () => ({
3027
- hasStableIdentity: !!(f && v.value),
3028
- busy: A.value
3029
- }),
3030
- beforePromote: (e) => mr(e, {
3031
- selectedModuleAlias: C.value,
3032
- dataGrantMatrix: E.value,
3033
- actionDrafts: [...N.entries()].map(([e, t]) => ({
3034
- moduleAlias: e,
3035
- actions: t
3036
- })),
3037
- actionSnapshots: [...P.entries()].map(([e, t]) => ({
3038
- moduleAlias: e,
3039
- snapshot: t
3040
- }))
3041
- }).then((e) => e === "accepted"),
3042
- onPromoted: ot,
3043
- onPromotionRejected: () => p("目标页签存在未确认的授权配置;请先确认或关闭该页签后再固定当前抽屉。", {
3044
- source: "role-authorization",
3045
- phase: "validation"
3046
- })
3047
- });
3048
- be(() => {
3049
- h && !Ae.value && (oe = hr(h, st)), Ue();
3050
- }), Z(pe, (e) => {
3051
- je.value && m?.setTitle(e);
3052
- }, { immediate: !0 }), Z(C, () => void We()), Z([
3053
- L,
3054
- Be,
3055
- $,
3056
- A,
3057
- I,
3058
- se
3059
- ], He, { immediate: !0 }), be(() => window.addEventListener("beforeunload", lt)), ye(() => {
3060
- oe?.(), i.drawerContext?.setOperation(void 0), i.drawerContext?.setSubtitle(void 0), window.removeEventListener("beforeunload", lt);
3061
- });
3062
- function He() {
3063
- let e = i.drawerContext;
3064
- if (e) {
3065
- if (e.setSubtitle(`${L.value} · ${ut(v.value)}`), I.value) {
3066
- e.setOperation(void 0);
3067
- return;
3068
- }
3069
- e.setOperation({
3070
- summary: se.value ? $.value ? "有未确认修改" : "未修改" : Be.value,
3071
- actions: [{
3072
- key: "confirm-role-authorization",
3073
- label: "确认",
3074
- emphasis: "primary",
3075
- disabled: A.value || !$.value,
3076
- loading: A.value,
3077
- run: () => void rt()
3078
- }]
3079
- });
3080
- }
3081
- }
3082
- async function Ue() {
3083
- if (!f) {
3084
- j.value = "缺少角色标识,无法打开授权页。";
3085
- return;
3086
- }
3087
- ne.value = !0, j.value = void 0;
3088
- try {
3089
- if (v.value = await s.crud.view(f), v.value.roleKind === "group") return;
3090
- if (v.value.roleKind === "dataGrant") {
3091
- let [e, t] = await Promise.all([l.dataGrantActionMatrix(f), l.dataScopePolicyCatalog(f)]);
3092
- E.value = _?.dataGrantMatrix ?? e, O.value = t, M.value = JSON.stringify(e.actions);
3093
- return;
3094
- }
3095
- x.value = (await l.authorizationModules(f)).records, C.value = _?.selectedModuleAlias ?? x.value[0]?.moduleAlias;
3096
- } catch (e) {
3097
- j.value = "授权信息加载失败,请重试。", u(e, {
3098
- source: "role-authorization",
3099
- phase: "load"
3100
- });
3101
- } finally {
3102
- ne.value = !1;
3103
- }
3104
- }
3105
- async function We() {
3106
- let e = C.value;
3107
- if (!(!e || se.value || I.value)) {
3108
- re.value = !0;
3109
- try {
3110
- let [t, n] = await Promise.all([l.permissionMatrix(f, [e]), l.dataScopePolicyCatalog(f, e)]), r = (t.modules[0]?.actions ?? []).map(et), i = _?.actionDrafts?.find((t) => t.moduleAlias === e)?.actions, a = N.get(e) ?? i;
3111
- T.value = a ?? r, N.has(e) || (N.set(e, T.value), P.set(e, _?.actionSnapshots?.find((t) => t.moduleAlias === e)?.snapshot ?? JSON.stringify(r))), F.value += 1, O.value = n;
3112
- } catch (e) {
3113
- u(e, {
3114
- source: "role-authorization",
3115
- phase: "load"
3116
- });
3117
- } finally {
3118
- re.value = !1;
3119
- }
3120
- }
3121
- }
3122
- function Ge(e, t) {
3123
- t && e.dataAuth && ue.value && !e.dataScopePolicy && (e.dataScopePolicy = "inheritDataGrant"), t && e.dataScopePolicy === "referenceDependency" && !e.referenceFieldId && (e.dataScopePolicy = "inheritDataGrant"), e.granted = t, F.value += 1;
3124
- }
3125
- function Ke(e) {
3126
- T.value.forEach((t) => Ge(t, e));
3127
- }
3128
- function qe(e, t) {
3129
- if (e.dataScopePolicy = String(t || "none"), e.dataScopePolicy === "referenceDependency") {
3130
- e.referenceFieldId = void 0, e.referenceActionCode = void 0, F.value += 1;
3131
- return;
3132
- }
3133
- e.referenceFieldId = void 0, e.referenceActionCode = void 0, F.value += 1;
3134
- }
3135
- function Je(e, t) {
3136
- let n = Ce.value.get(String(t || ""));
3137
- e.referenceFieldId = n?.referenceFieldId, e.referenceActionCode = n?.referenceActionCode, F.value += 1;
3138
- }
3139
- function Ye(e) {
3140
- return Ce.value.get(String(e || ""));
3141
- }
3142
- function Xe(e) {
3143
- return typeof e == "string" || typeof e == "number" ? e : void 0;
3144
- }
3145
- function Ze(e) {
3146
- return e.dataScopePolicy ?? "inheritDataGrant";
3147
- }
3148
- function Qe(e) {
3149
- return !!e.dataAuth && ue.value;
3150
- }
3151
- function $e(e, t) {
3152
- return e.key === "dataScopePolicy" && Qe(t);
3153
- }
3154
- function et(e) {
3155
- return ue.value && e.dataAuth && e.dataScopePolicy === "none" ? {
3156
- ...e,
3157
- dataScopePolicy: "inheritDataGrant"
3158
- } : e;
3159
- }
3160
- async function tt() {
3161
- if (E.value) {
3162
- A.value = !0;
3163
- try {
3164
- let e = await l.replaceDataGrantActions(f, E.value.actions.map((e) => ({
3165
- actionCode: e.actionCode,
3166
- dataScopePolicy: e.dataScopePolicy,
3167
- enabled: e.configured
3168
- })));
3169
- await te(e, {
3170
- source: "role-authorization",
3171
- phase: "action",
3172
- fallbackMessage: "数据权限模板已保存"
3173
- }), M.value = JSON.stringify(E.value.actions);
3174
- } catch (e) {
3175
- u(e, {
3176
- source: "role-authorization",
3177
- phase: "action"
3178
- });
3179
- } finally {
3180
- A.value = !1;
3181
- }
3182
- }
3183
- }
3184
- async function nt() {
3185
- let e = [...N.entries()].filter(([e, t]) => P.get(e) !== JSON.stringify(t));
3186
- if (e.length) {
3187
- A.value = !0;
3188
- try {
3189
- let t = await l.replacePermissionMatrix(f, e.flatMap(([e, t]) => t.map((t) => ({
3190
- moduleAlias: e,
3191
- actionCode: t.actionCode,
3192
- granted: !!t.granted,
3193
- dataScopePolicy: t.granted && t.dataAuth && ue.value ? t.dataScopePolicy ?? "inheritDataGrant" : void 0,
3194
- referenceFieldId: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceFieldId : void 0,
3195
- referenceActionCode: t.granted && t.dataScopePolicy === "referenceDependency" ? t.referenceActionCode : void 0
3196
- }))));
3197
- await te(t, {
3198
- source: "role-authorization",
3199
- phase: "action",
3200
- fallbackMessage: "角色授权已保存"
3201
- }), e.forEach(([e, t]) => P.set(e, JSON.stringify(t))), F.value += 1;
3202
- } catch (e) {
3203
- u(e, {
3204
- source: "role-authorization",
3205
- phase: "action"
3206
- });
3207
- } finally {
3208
- A.value = !1;
3209
- }
3210
- }
3211
- }
3212
- async function rt() {
3213
- if (se.value) {
3214
- await tt();
3215
- return;
3216
- }
3217
- await nt();
3218
- }
3219
- async function it() {
3220
- return !$.value || b({
3221
- title: "放弃未确认的授权配置",
3222
- content: "当前修改尚未确认,关闭后将丢失这些修改。",
3223
- okText: "放弃修改",
3224
- danger: !0
3225
- });
3226
- }
3227
- function at() {
3228
- ct();
3229
- }
3230
- function ot() {
3231
- ct();
3232
- }
3233
- function st(e) {
3234
- return !$.value && (C.value = e.selectedModuleAlias, E.value = e.dataGrantMatrix, N.clear(), P.clear(), e.actionDrafts?.forEach(({ moduleAlias: e, actions: t }) => N.set(e, t)), e.actionSnapshots?.forEach(({ moduleAlias: e, snapshot: t }) => P.set(e, t)), F.value += 1, !0);
3235
- }
3236
- function ct() {
3237
- if (i.drawer === !0) {
3238
- a("close");
3239
- return;
3240
- }
3241
- m?.dismiss();
3242
- }
3243
- function lt(e) {
3244
- $.value && (e.preventDefault(), e.returnValue = "");
3245
- }
3246
- function ut(e) {
3247
- return e?.ownerScopeType === "platform" ? "平台范围" : e?.ownerScopeType === "organization" ? "机构范围" : "租户范围";
3248
- }
3249
- return (e, n) => (q(), B(we(Ne.value), ve(me(Fe.value)), fe({
3250
- default: Q(() => [U("section", { class: _e(["role-authorization-page", { "role-authorization-page--drawer": Ae.value || de.value }]) }, [ne.value ? (q(), B(X(S), {
3251
- key: 0,
3252
- tip: "加载授权信息"
3253
- })) : j.value ? (q(), B(X(y), {
3254
- key: 1,
3255
- title: "授权页加载失败",
3256
- message: j.value
3257
- }, null, 8, ["message"])) : I.value ? (q(), B(X(c), {
3258
- key: 2,
3259
- title: "角色组不独立授权",
3260
- description: "角色组只组合成员角色;请到成员角色分别配置动作和数据权限。"
3261
- })) : se.value && E.value ? (q(), B(X(r), {
3262
- key: 3,
3263
- class: "data-grant-content",
3264
- title: Me.value ? "数据权限模板" : `数据权限模板 - ${L.value}`,
3265
- searchable: !1,
3266
- onRefresh: Ue
3267
- }, {
3268
- default: Q(() => [U("header", _r, [n[4] ||= U("div", null, [U("h3", null, "标准动作的数据范围模板"), U("p", null, "模板只会在具体任职的普通角色动作选择“继承数据授权角色”时生效。")], -1), je.value ? V("v-if", !0) : (q(), B(X(D), {
3269
- key: 0,
3270
- type: "primary",
3271
- disabled: !$.value,
3272
- loading: A.value,
3273
- onClick: rt
3274
- }, {
3275
- default: Q(() => [...n[3] ||= [W(" 确认 ", -1)]]),
3276
- _: 1
3277
- }, 8, ["disabled", "loading"]))]), G(X(k), {
3278
- columns: De,
3279
- rows: ke.value,
3280
- "row-key": "actionCode",
3281
- "horizontal-scroll": ""
3282
- }, {
3283
- cell: Q(({ column: e, record: n }) => [e.key === "title" ? (q(), H(R, { key: 0 }, [U("strong", null, Y(n.title || n.actionCode), 1), U("small", null, Y(n.actionCode), 1)], 64)) : e.key === "configured" ? (q(), B(X(t), {
3284
- key: 1,
3285
- checked: !!n.configured,
3286
- disabled: A.value,
3287
- onChange: (e) => n.configured = e
3288
- }, null, 8, [
3289
- "checked",
3290
- "disabled",
3291
- "onChange"
3292
- ])) : (q(), B(X(ee), {
3293
- key: 2,
3294
- value: n.dataScopePolicy,
3295
- options: xe.value,
3296
- disabled: !n.configured || A.value,
3297
- placeholder: "请选择数据范围",
3298
- "allow-clear": !1,
3299
- "onUpdate:value": (e) => n.dataScopePolicy = String(e || "")
3300
- }, null, 8, [
3301
- "value",
3302
- "options",
3303
- "disabled",
3304
- "onUpdate:value"
3305
- ]))]),
3306
- _: 1
3307
- }, 8, ["rows"])]),
3308
- _: 1
3309
- }, 8, ["title"])) : (q(), H("section", {
3310
- key: 4,
3311
- class: _e(["authorization-layout", { "authorization-layout--compact-actions": !Te.value }])
3312
- }, [G(X(r), {
3313
- "search-keyword": w.value,
3314
- "onUpdate:searchKeyword": n[1] ||= (e) => w.value = e,
3315
- class: "module-panel",
3316
- title: "模块树",
3317
- "refresh-title": "刷新模块目录",
3318
- "search-placeholder": "搜索模块名称或别名",
3319
- onRefresh: Ue
3320
- }, {
3321
- default: Q(() => [G(X(ae), {
3322
- records: ge.value,
3323
- "selected-id": C.value,
3324
- onSelect: n[0] ||= (e) => C.value = e.id
3325
- }, null, 8, ["records", "selected-id"])]),
3326
- _: 1
3327
- }, 8, ["search-keyword"]), G(X(r), {
3328
- class: "action-panel",
3329
- title: K.value,
3330
- searchable: !1
3331
- }, fe({
3332
- default: Q(() => [re.value ? (q(), B(X(S), {
3333
- key: 0,
3334
- tip: "加载模块动作"
3335
- })) : C.value ? (q(), B(X(k), {
3336
- key: 2,
3337
- columns: Ee.value,
3338
- rows: Oe.value,
3339
- "row-key": "actionCode",
3340
- "fill-height": "",
3341
- "horizontal-scroll": ""
3342
- }, {
3343
- header: Q(({ column: e }) => [e.key === "granted" ? (q(), H("span", vr, [G(X(ie), {
3344
- checked: Re.value,
3345
- indeterminate: ze.value,
3346
- disabled: A.value || !T.value.length,
3347
- "aria-label": "全选当前模块动作授权",
3348
- onChange: Ke
3349
- }, null, 8, [
3350
- "checked",
3351
- "indeterminate",
3352
- "disabled"
3353
- ]), n[6] ||= W(" 授权 ", -1)])) : (q(), H(R, { key: 1 }, [W(Y(e.title), 1)], 64))]),
3354
- cell: Q(({ column: e, record: t }) => [e.key === "title" ? (q(), H(R, { key: 0 }, [U("strong", null, Y(t.title || t.actionCode), 1), U("small", null, Y(t.permissionActionCode || t.actionCode), 1)], 64)) : e.key === "granted" ? (q(), B(X(ie), {
3355
- key: 1,
3356
- checked: !!t.granted,
3357
- disabled: A.value,
3358
- onChange: (e) => Ge(t, e)
3359
- }, null, 8, [
3360
- "checked",
3361
- "disabled",
3362
- "onChange"
3363
- ])) : t.dataAuth && ue.value && t.granted ? (q(), H("div", yr, [G(X(ee), {
3364
- value: Ze(t),
3365
- options: xe.value,
3366
- disabled: A.value,
3367
- "allow-clear": !1,
3368
- "onUpdate:value": (e) => qe(t, e)
3369
- }, null, 8, [
3370
- "value",
3371
- "options",
3372
- "disabled",
3373
- "onUpdate:value"
3374
- ]), t.dataScopePolicy === "referenceDependency" ? (q(), H(R, { key: 0 }, [G(X(ee), {
3375
- value: Xe(t.referenceFieldId),
3376
- options: Se.value,
3377
- disabled: A.value,
3378
- placeholder: "请选择引用字段",
3379
- "allow-clear": !1,
3380
- "onUpdate:value": (e) => Je(t, e)
3381
- }, null, 8, [
3382
- "value",
3383
- "options",
3384
- "disabled",
3385
- "onUpdate:value"
3386
- ]), t.referenceFieldId ? (q(), H("small", br, " 依赖目标:" + Y(Ye(t.referenceFieldId)?.targetModuleTitle) + " · " + Y(Ye(t.referenceFieldId)?.referenceActionTitle), 1)) : (q(), H("small", xr, "请先选择引用字段,再开启该动作授权。"))], 64)) : V("v-if", !0)])) : $e(e, t) ? (q(), H("span", Sr, "—")) : (q(), H("span", Cr, "不适用"))]),
3387
- _: 1
3388
- }, 8, ["columns", "rows"])) : (q(), B(X(c), {
3389
- key: 1,
3390
- title: "请选择模块"
3391
- }))]),
3392
- _: 2
3393
- }, [je.value ? void 0 : {
3394
- name: "actions",
3395
- fn: Q(() => [G(X(D), {
3396
- type: "primary",
3397
- disabled: !$.value,
3398
- loading: A.value,
3399
- onClick: rt
3400
- }, {
3401
- default: Q(() => [...n[5] ||= [W(" 确认 ", -1)]]),
3402
- _: 1
3403
- }, 8, ["disabled", "loading"])]),
3404
- key: "0"
3405
- }]), 1032, ["title"])], 2))], 2)]),
3406
- _: 2
3407
- }, [Me.value && !I.value ? {
3408
- name: "operation",
3409
- fn: Q(() => [G(X(D), {
3410
- type: "primary",
3411
- disabled: !$.value,
3412
- loading: A.value,
3413
- onClick: rt
3414
- }, {
3415
- default: Q(() => [...n[2] ||= [W(" 确认 ", -1)]]),
3416
- _: 1
3417
- }, 8, ["disabled", "loading"])]),
3418
- key: "0"
3419
- } : void 0]), 1040));
3420
- }
3421
- }), Tr = /* @__PURE__ */ e({ default: () => Er }), Er = /*#__PURE__*/ M(wr, [["__scopeId", "data-v-ee79d1ea"]]), Dr = { class: "role-authorization-drawer-surface" }, Or = /*#__PURE__*/ M(/* @__PURE__ */ K({
3422
- name: "RoleAuthorizationDrawerSurface",
3423
- __name: "RoleAuthorizationDrawerSurface",
3424
- props: { context: {} },
3425
- setup(e) {
3426
- let t = e, n = t.context.module;
3427
- return (e, r) => (q(), H("section", Dr, [t.context.record?.id == null ? V("v-if", !0) : (q(), B(Er, {
3428
- key: 0,
3429
- "role-id": String(t.context.record.id),
3430
- "module-context": X(n),
3431
- "drawer-context": t.context
3432
- }, null, 8, [
3433
- "role-id",
3434
- "module-context",
3435
- "drawer-context"
3436
- ]))]));
3437
- }
3438
- }), [["__scopeId", "data-v-04d29709"]]), kr = {
3439
- key: 0,
3440
- class: "role-group-member-form-field"
3441
- }, Ar = {
3442
- id: "iam-role-scope-and-actions",
3443
- target: { moduleAlias: "iam.role" },
3444
- navigator: {
3445
- bypassListScope: !0,
3446
- extension: {
3447
- key: "iam-role-scope-tree",
3448
- component: Pn,
3449
- selection: { kind: "roleScope" }
3450
- }
3451
- },
3452
- list: { cellComponents: [
3453
- {
3454
- key: "assignmentType",
3455
- cell: Fn
3456
- },
3457
- {
3458
- key: "roleKind",
3459
- cell: Fn
3460
- },
3461
- {
3462
- key: "sharePolicy",
3463
- cell: Fn
3464
- }
3465
- ] },
3466
- form: {
3467
- contributions: [{
3468
- key: "role-group-members",
3469
- component: /* @__PURE__ */ M(/* @__PURE__ */ K({
3470
- name: "RoleGroupMemberFormField",
3471
- __name: "RoleGroupMemberFormField",
3472
- props: { context: {} },
3473
- setup(e) {
3474
- let t = e, n = J([]), r = J(!1), i = z(() => t.context.draft.roleKind === "group"), a = z(() => d(t.context.draft.memberRoleIds)), o = z(() => String(t.context.draft.id ?? "") || void 0), s = z(() => new Set(n.value.filter((e) => e.roleKind === "dataGrant" && e.id && a.value.includes(e.id)).map((e) => e.id))), c = z(() => n.value.filter((e) => e.id && e.id !== o.value).map((e) => ({
3475
- label: `${e.title ?? e.id} / ${e.roleKind === "dataGrant" ? "数据授权角色" : "标准角色"}`,
3476
- value: e.id,
3477
- disabled: e.roleKind === "dataGrant" && s.value.size > 0 && !a.value.includes(e.id)
3478
- })));
3479
- Z([i, () => t.context.formSessionKey], () => void l(), { immediate: !0 });
3480
- async function l() {
3481
- if (!i.value) {
3482
- n.value = [];
3483
- return;
3484
- }
3485
- r.value = !0;
3486
- try {
3487
- let e = await t.context.queryRecords({
3488
- page: {
3489
- pageNum: 1,
3490
- pageSize: 500
3491
- },
3492
- conditions: [
3493
- {
3494
- fieldName: "assignmentType",
3495
- operator: "EQ",
3496
- values: ["employment"]
3497
- },
3498
- {
3499
- fieldName: "roleKind",
3500
- operator: "IN",
3501
- values: ["standard", "dataGrant"]
3502
- },
3503
- {
3504
- fieldName: "enabled",
3505
- operator: "EQ",
3506
- values: [!0]
3507
- },
3508
- {
3509
- fieldName: "ownerScopeType",
3510
- operator: "EQ",
3511
- values: [t.context.draft.ownerScopeType]
3512
- },
3513
- ...t.context.draft.ownerScopeId ? [{
3514
- fieldName: "ownerScopeId",
3515
- operator: "EQ",
3516
- values: [t.context.draft.ownerScopeId]
3517
- }] : []
3518
- ],
3519
- sorts: [{ field: "sortOrder" }, { field: "title" }]
3520
- });
3521
- n.value = e.records;
3522
- } finally {
3523
- r.value = !1;
3524
- }
3525
- }
3526
- function u(e) {
3527
- let n = Array.isArray(e) ? e.map((e) => String(e).trim()).filter(Boolean) : [];
3528
- t.context.setField("memberRoleIds", n.length > 0 ? n.join(",") : void 0);
3529
- }
3530
- function d(e) {
3531
- return typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : [];
3532
- }
3533
- return (t, n) => i.value ? (q(), H("label", kr, [n[0] ||= U("span", null, "成员角色", -1), G(X(ee), {
3534
- mode: "multiple",
3535
- value: a.value,
3536
- options: c.value,
3537
- loading: r.value,
3538
- placeholder: "请选择成员角色",
3539
- disabled: e.context.mode === "view",
3540
- "allow-clear": "",
3541
- "onUpdate:value": u
3542
- }, null, 8, [
3543
- "value",
3544
- "options",
3545
- "loading",
3546
- "disabled"
3547
- ])])) : V("v-if", !0);
3548
- }
3549
- }), [["__scopeId", "data-v-665f4381"]]),
3550
- location: {
3551
- surface: "record-card",
3552
- fieldName: "memberRoleIds",
3553
- placement: "after"
3554
- }
3555
- }],
3556
- fieldPolicies: [{
3557
- fieldName: "memberRoleIds",
3558
- visible: () => !1
3559
- }]
3560
- },
3561
- recordActions: [
3562
- {
3563
- key: "role-bind-account",
3564
- actionCode: "accountRoleGrants",
3565
- title: "绑定",
3566
- state: (e) => ({
3567
- visible: e.assignmentType === "account",
3568
- disabled: e.systemManaged === !0
3569
- }),
3570
- run({ openDrawer: e }) {
3571
- e({
3572
- title: "绑定用户",
3573
- width: "extraWide",
3574
- component: qn
3575
- });
3576
- }
3577
- },
3578
- {
3579
- key: "role-bind-employment",
3580
- actionCode: "employmentRoleGrants",
3581
- title: "绑定",
3582
- state: (e) => ({
3583
- visible: e.assignmentType !== "account",
3584
- disabled: e.systemManaged === !0
3585
- }),
3586
- run({ openDrawer: e }) {
3587
- e({
3588
- title: "绑定任职",
3589
- width: "extraWide",
3590
- component: nr
3591
- });
3592
- }
3593
- },
3594
- {
3595
- key: "role-authorize",
3596
- actionCode: "rolePermissions",
3597
- title: "授权",
3598
- state: (e) => ({
3599
- visible: e.roleKind !== "group",
3600
- disabled: e.systemManaged === !0
3601
- }),
3602
- run({ openDrawer: e }) {
3603
- e({
3604
- title: "角色授权",
3605
- width: "wide",
3606
- component: Or
3607
- });
3608
- }
3609
- }
3610
- ]
3611
- };
3612
- F("platform-admin-runtime", Fe), oe("platform-admin-runtime", [
3613
- et,
3614
- tt,
3615
- nt,
3616
- lt,
3617
- gt,
3618
- St,
3619
- gn,
3620
- Ar
3621
- ]);
3622
- //#endregion
3623
- export { ke as C, Oe as S, kt as _, dr as a, Et as b, Kn as c, qt as d, Kt as f, Tt as g, At as h, ur as i, Ht as l, Nt as m, Tr as n, ar as o, Gt as p, lr as r, tr as s, Er as t, Ut as u, Ot as v, Ne as x, Dt as y };