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