@ximatai/muyun-web-app 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/dist/EmployeeDetailWorkspaceView-mtdcsqgF.js +14 -0
  2. package/dist/EmployeeManagementView-CKKvQZaC.js +1706 -0
  3. package/dist/MetadataOrchestrationView-CprWBocy.js +655 -0
  4. package/dist/ModuleActionManagementView-DNuAQUPE.js +597 -0
  5. package/dist/RoleAuthorizationView-CQtSAJoJ.js +592 -0
  6. package/dist/RoleDetailWorkspaceView-Dh8DXpyS.js +26 -0
  7. package/dist/RoleManagementView-BrqaFV7y.js +1927 -0
  8. package/dist/SystemUserDetailWorkspaceView-N-kvycAu.js +17 -0
  9. package/dist/SystemUserManagementView-BVS5moV5.js +761 -0
  10. package/dist/UserDetailWorkspaceView-Iek6xwix.js +17 -0
  11. package/dist/UserManagementView-BR_Jz8O-.js +965 -0
  12. package/dist/currentUserContext-B1lj1WgF.js +11 -0
  13. package/dist/index.css +2 -0
  14. package/dist/index.js +7127 -0
  15. package/dist/pageRealtime-sRtDYlQP.js +140 -0
  16. package/dist/platform-components-bC1gwhic.js +8412 -0
  17. package/dist/types/App.vue.d.ts +3 -0
  18. package/dist/types/app/ChangeOwnPasswordDialog.vue.d.ts +27 -0
  19. package/dist/types/app/LoginView.vue.d.ts +14 -0
  20. package/dist/types/app/appWorkbenchStartup.d.ts +3 -0
  21. package/dist/types/app/devWorkbenchStartup.d.ts +1 -0
  22. package/dist/types/app/loginTenant.d.ts +6 -0
  23. package/dist/types/app/platformMessage.d.ts +6 -0
  24. package/dist/types/app/query.d.ts +3 -0
  25. package/dist/types/app/router.d.ts +1 -0
  26. package/dist/types/app/workbenchStartup.d.ts +24 -0
  27. package/dist/types/consumer/PlatformAdminOutlet.vue.d.ts +7 -0
  28. package/dist/types/consumer/index.d.ts +15 -0
  29. package/dist/types/dynamic-page-runtime/DynamicModuleHost.vue.d.ts +7 -0
  30. package/dist/types/dynamic-page-runtime/DynamicModulePage.vue.d.ts +7 -0
  31. package/dist/types/dynamic-page-runtime/actionReactions.d.ts +16 -0
  32. package/dist/types/dynamic-page-runtime/index.d.ts +3 -0
  33. package/dist/types/dynamic-page-runtime/mockDescriptor.d.ts +2 -0
  34. package/dist/types/main.d.ts +2 -0
  35. package/dist/types/platform-admin-runtime/PlatformAdminOutlet.vue.d.ts +7 -0
  36. package/dist/types/platform-admin-runtime/WorkspaceViewDrawer.vue.d.ts +32 -0
  37. package/dist/types/platform-admin-runtime/WorkspaceViewOutlet.vue.d.ts +7 -0
  38. package/dist/types/platform-admin-runtime/authSession.d.ts +8 -0
  39. package/dist/types/platform-admin-runtime/backendHttp.d.ts +3 -0
  40. package/dist/types/platform-admin-runtime/currentUserContext.d.ts +4 -0
  41. package/dist/types/platform-admin-runtime/index.d.ts +12 -0
  42. package/dist/types/platform-admin-runtime/moduleOpenApi.d.ts +36 -0
  43. package/dist/types/platform-admin-runtime/pageRealtime.d.ts +61 -0
  44. package/dist/types/platform-admin-runtime/platformAdminRoutes.d.ts +21 -0
  45. package/dist/types/platform-admin-runtime/realtime.d.ts +20 -0
  46. package/dist/types/platform-admin-runtime/sessionRecovery.d.ts +3 -0
  47. package/dist/types/platform-admin-runtime/useWorkspaceViewPromotion.d.ts +24 -0
  48. package/dist/types/platform-admin-runtime/workspaceViewContract.d.ts +36 -0
  49. package/dist/types/platform-admin-runtime/workspaceViewContributions.d.ts +3 -0
  50. package/dist/types/platform-admin-runtime/workspaceViewHost.d.ts +10 -0
  51. package/dist/types/platform-admin-runtime/workspaceViewSessions.d.ts +18 -0
  52. package/dist/types/platform-admin-runtime/workspaceViews.d.ts +18 -0
  53. package/dist/types/platform-components/ApplicationScopeSwitcher.vue.d.ts +18 -0
  54. package/dist/types/platform-components/CrudRecordListExplorer.vue.d.ts +52 -0
  55. package/dist/types/platform-components/DateTimeText.vue.d.ts +15 -0
  56. package/dist/types/platform-components/DrawerOperationBar.vue.d.ts +18 -0
  57. package/dist/types/platform-components/EnabledSelect.vue.d.ts +14 -0
  58. package/dist/types/platform-components/ManagementExplorerColumn.vue.d.ts +13 -0
  59. package/dist/types/platform-components/ManagementWorkspace.vue.d.ts +19 -0
  60. package/dist/types/platform-components/ModuleActionButton.vue.d.ts +40 -0
  61. package/dist/types/platform-components/RecordActionBar.vue.d.ts +20 -0
  62. package/dist/types/platform-components/RecordDetailDrawer.vue.d.ts +37 -0
  63. package/dist/types/platform-components/RecordDetailFields.vue.d.ts +23 -0
  64. package/dist/types/platform-components/RecordDetailLayout.vue.d.ts +37 -0
  65. package/dist/types/platform-components/RecordDetailPanel.vue.d.ts +25 -0
  66. package/dist/types/platform-components/RecordExpandedSubtable.vue.d.ts +29 -0
  67. package/dist/types/platform-components/RecordExplorerPanel.vue.d.ts +39 -0
  68. package/dist/types/platform-components/RecordExternalChangeNotice.vue.d.ts +20 -0
  69. package/dist/types/platform-components/RecordFormFields.vue.d.ts +31 -0
  70. package/dist/types/platform-components/RecordListExplorer.vue.d.ts +42 -0
  71. package/dist/types/platform-components/RecordMetaSection.vue.d.ts +8 -0
  72. package/dist/types/platform-components/RecordModeDrawer.vue.d.ts +74 -0
  73. package/dist/types/platform-components/RecordPicker.vue.d.ts +35 -0
  74. package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +103 -0
  75. package/dist/types/platform-components/RecordStatusSwitch.vue.d.ts +18 -0
  76. package/dist/types/platform-components/RecordStatusTag.vue.d.ts +6 -0
  77. package/dist/types/platform-components/RecordTreeSelector.vue.d.ts +22 -0
  78. package/dist/types/platform-components/RecycleBinModeButton.vue.d.ts +16 -0
  79. package/dist/types/platform-components/StaticManagementLayout.vue.d.ts +44 -0
  80. package/dist/types/platform-components/TreeRecordExplorer.vue.d.ts +57 -0
  81. package/dist/types/platform-components/UserSessionExpandedSubtable.vue.d.ts +26 -0
  82. package/dist/types/platform-components/actionConfirmation.d.ts +3 -0
  83. package/dist/types/platform-components/crudRecordListModel.d.ts +10 -0
  84. package/dist/types/platform-components/drawerPromotion.d.ts +4 -0
  85. package/dist/types/platform-components/index.d.ts +76 -0
  86. package/dist/types/platform-components/optionFieldOptions.d.ts +10 -0
  87. package/dist/types/platform-components/pageLayoutContext.d.ts +6 -0
  88. package/dist/types/platform-components/platformActionResultFeedback.d.ts +12 -0
  89. package/dist/types/platform-components/platformActionResultReactions.d.ts +53 -0
  90. package/dist/types/platform-components/platformDateTime.d.ts +16 -0
  91. package/dist/types/platform-components/platformErrorFeedback.d.ts +15 -0
  92. package/dist/types/platform-components/platformTimeZoneContext.d.ts +3 -0
  93. package/dist/types/platform-components/recordActionBarModel.d.ts +27 -0
  94. package/dist/types/platform-components/recordDetailFieldModel.d.ts +7 -0
  95. package/dist/types/platform-components/recordDraftNormalizer.d.ts +1 -0
  96. package/dist/types/platform-components/recordEditorSessionState.d.ts +38 -0
  97. package/dist/types/platform-components/recordExplorerItemModel.d.ts +8 -0
  98. package/dist/types/platform-components/recordFormFieldModel.d.ts +57 -0
  99. package/dist/types/platform-components/recordPickerConstraints.d.ts +20 -0
  100. package/dist/types/platform-components/recordPickerModel.d.ts +2 -0
  101. package/dist/types/platform-components/recycleBinState.d.ts +39 -0
  102. package/dist/types/platform-components/scopedResourceTreeModuleContext.d.ts +6 -0
  103. package/dist/types/platform-components/scopedTreeModuleContext.d.ts +10 -0
  104. package/dist/types/platform-components/softDeletedConflictHandler.d.ts +75 -0
  105. package/dist/types/platform-components/staticCrudManagementState.d.ts +66 -0
  106. package/dist/types/platform-components/staticFormActionFlow.d.ts +39 -0
  107. package/dist/types/platform-components/staticTreeResourceModuleContext.d.ts +7 -0
  108. package/dist/types/platform-components/treeRecordModel.d.ts +17 -0
  109. package/dist/types/platform-components/useRecycleBinExplorerMode.d.ts +26 -0
  110. package/dist/types/platform-components/userSessionPresentation.d.ts +12 -0
  111. package/dist/types/platform-workbench/Workbench.vue.d.ts +46 -0
  112. package/dist/types/platform-workbench/WorkbenchMenu.vue.d.ts +23 -0
  113. package/dist/types/platform-workbench/WorkbenchMenuTree.vue.d.ts +13 -0
  114. package/dist/types/platform-workbench/WorkbenchOutlet.vue.d.ts +7 -0
  115. package/dist/types/platform-workbench/hosts/BusinessRouteHost.vue.d.ts +7 -0
  116. package/dist/types/platform-workbench/hosts/ExternalPageHost.vue.d.ts +7 -0
  117. package/dist/types/platform-workbench/hosts/PlatformRouteHost.vue.d.ts +7 -0
  118. package/dist/types/platform-workbench/index.d.ts +11 -0
  119. package/dist/types/platform-workbench/menuNavigation.d.ts +28 -0
  120. package/dist/types/platform-workbench/menuTreeModel.d.ts +20 -0
  121. package/dist/types/platform-workbench/pageHostRegistry.d.ts +3 -0
  122. package/dist/types/platform-workbench/realtimeStatus.d.ts +7 -0
  123. package/dist/types/platform-workbench/workbenchNavigation.d.ts +12 -0
  124. package/dist/types/views/ApplicationManagementView.vue.d.ts +3 -0
  125. package/dist/types/views/DepartmentManagementView.vue.d.ts +3 -0
  126. package/dist/types/views/DictionaryManagementView.vue.d.ts +3 -0
  127. package/dist/types/views/EmployeeDetailContent.vue.d.ts +64 -0
  128. package/dist/types/views/EmployeeDetailWorkspaceView.vue.d.ts +6 -0
  129. package/dist/types/views/EmployeeEmploymentDrawer.vue.d.ts +14 -0
  130. package/dist/types/views/EmployeeEmploymentTable.vue.d.ts +18 -0
  131. package/dist/types/views/EmployeeManagementView.vue.d.ts +7 -0
  132. package/dist/types/views/FieldSpecManagementView.vue.d.ts +3 -0
  133. package/dist/types/views/FieldUiControlManagementView.vue.d.ts +3 -0
  134. package/dist/types/views/HomeView.vue.d.ts +3 -0
  135. package/dist/types/views/MenuManagementView.vue.d.ts +3 -0
  136. package/dist/types/views/MetadataOrchestrationView.vue.d.ts +8 -0
  137. package/dist/types/views/ModuleActionManagementView.vue.d.ts +9 -0
  138. package/dist/types/views/ModuleManagementView.vue.d.ts +3 -0
  139. package/dist/types/views/ModuleOpenApiView.vue.d.ts +10 -0
  140. package/dist/types/views/OpenApiCatalogView.vue.d.ts +9 -0
  141. package/dist/types/views/OrganizationManagementView.vue.d.ts +3 -0
  142. package/dist/types/views/PasswordManagementView.vue.d.ts +3 -0
  143. package/dist/types/views/PositionManagementView.vue.d.ts +3 -0
  144. package/dist/types/views/RoleAccountGrantDrawer.vue.d.ts +16 -0
  145. package/dist/types/views/RoleAuthorizationView.vue.d.ts +12 -0
  146. package/dist/types/views/RoleDetailWorkspaceView.vue.d.ts +9 -0
  147. package/dist/types/views/RoleEmploymentGrantDrawer.vue.d.ts +16 -0
  148. package/dist/types/views/RoleGroupMemberSelector.vue.d.ts +18 -0
  149. package/dist/types/views/RoleManagementView.vue.d.ts +9 -0
  150. package/dist/types/views/SystemUserDetailWorkspaceView.vue.d.ts +7 -0
  151. package/dist/types/views/SystemUserManagementView.vue.d.ts +7 -0
  152. package/dist/types/views/TenantManagementView.vue.d.ts +3 -0
  153. package/dist/types/views/UserDetailContent.vue.d.ts +32 -0
  154. package/dist/types/views/UserDetailWorkspaceView.vue.d.ts +7 -0
  155. package/dist/types/views/UserManagementView.vue.d.ts +8 -0
  156. package/dist/types/views/applicationManagementState.d.ts +64 -0
  157. package/dist/types/views/departmentManagementState.d.ts +137 -0
  158. package/dist/types/views/dictionaryManagementState.d.ts +215 -0
  159. package/dist/types/views/employeeDetailStateModel.d.ts +39 -0
  160. package/dist/types/views/employeeDetailWorkspaceSession.d.ts +16 -0
  161. package/dist/types/views/employeeDetailWorkspaceView.d.ts +4 -0
  162. package/dist/types/views/fieldSpecManagementState.d.ts +80 -0
  163. package/dist/types/views/fieldUiControlManagementState.d.ts +76 -0
  164. package/dist/types/views/menuManagementState.d.ts +178 -0
  165. package/dist/types/views/metadataOrchestrationState.d.ts +278 -0
  166. package/dist/types/views/metadataOrchestrationWorkspaceView.d.ts +6 -0
  167. package/dist/types/views/moduleActionManagementWorkspaceView.d.ts +7 -0
  168. package/dist/types/views/moduleManagementState.d.ts +76 -0
  169. package/dist/types/views/organizationManagementState.d.ts +64 -0
  170. package/dist/types/views/positionManagementState.d.ts +218 -0
  171. package/dist/types/views/roleAuthorizationWorkspaceSession.d.ts +17 -0
  172. package/dist/types/views/roleAuthorizationWorkspaceView.d.ts +5 -0
  173. package/dist/types/views/roleDetailWorkspaceSession.d.ts +19 -0
  174. package/dist/types/views/roleDetailWorkspaceView.d.ts +8 -0
  175. package/dist/types/views/roleGrantClient.d.ts +59 -0
  176. package/dist/types/views/systemUserDetailWorkspaceSession.d.ts +12 -0
  177. package/dist/types/views/systemUserDetailWorkspaceView.d.ts +5 -0
  178. package/dist/types/views/tenantManagementState.d.ts +64 -0
  179. package/dist/types/views/useEmployeeEmploymentRows.d.ts +20 -0
  180. package/dist/types/views/useUserSessionRows.d.ts +28 -0
  181. package/dist/types/views/userDetailStateModel.d.ts +11 -0
  182. package/dist/types/views/userDetailWorkspaceSession.d.ts +14 -0
  183. package/dist/types/views/userDetailWorkspaceView.d.ts +4 -0
  184. package/dist/types/vue-ui-antdv/components/ActionBar.vue.d.ts +11 -0
  185. package/dist/types/vue-ui-antdv/components/DictionarySelect.vue.d.ts +14 -0
  186. package/dist/types/vue-ui-antdv/components/ReferenceSelect.vue.d.ts +16 -0
  187. package/dist/types/vue-ui-antdv/components/UiActionButton.vue.d.ts +37 -0
  188. package/dist/types/vue-ui-antdv/components/UiBadge.vue.d.ts +20 -0
  189. package/dist/types/vue-ui-antdv/components/UiButton.vue.d.ts +41 -0
  190. package/dist/types/vue-ui-antdv/components/UiCheckbox.vue.d.ts +30 -0
  191. package/dist/types/vue-ui-antdv/components/UiDataTable.vue.d.ts +71 -0
  192. package/dist/types/vue-ui-antdv/components/UiDropdown.vue.d.ts +29 -0
  193. package/dist/types/vue-ui-antdv/components/UiEmpty.vue.d.ts +6 -0
  194. package/dist/types/vue-ui-antdv/components/UiError.vue.d.ts +7 -0
  195. package/dist/types/vue-ui-antdv/components/UiForm.vue.d.ts +15 -0
  196. package/dist/types/vue-ui-antdv/components/UiIcon.vue.d.ts +7 -0
  197. package/dist/types/vue-ui-antdv/components/UiInput.vue.d.ts +25 -0
  198. package/dist/types/vue-ui-antdv/components/UiMenu.vue.d.ts +19 -0
  199. package/dist/types/vue-ui-antdv/components/UiModal.vue.d.ts +36 -0
  200. package/dist/types/vue-ui-antdv/components/UiRecordExplorerItem.vue.d.ts +26 -0
  201. package/dist/types/vue-ui-antdv/components/UiSearchInput.vue.d.ts +22 -0
  202. package/dist/types/vue-ui-antdv/components/UiSelect.vue.d.ts +30 -0
  203. package/dist/types/vue-ui-antdv/components/UiSidePanel.vue.d.ts +28 -0
  204. package/dist/types/vue-ui-antdv/components/UiSidePanelHost.vue.d.ts +13 -0
  205. package/dist/types/vue-ui-antdv/components/UiSpin.vue.d.ts +22 -0
  206. package/dist/types/vue-ui-antdv/components/UiSwitch.vue.d.ts +22 -0
  207. package/dist/types/vue-ui-antdv/components/UiTable.vue.d.ts +13 -0
  208. package/dist/types/vue-ui-antdv/components/UiTabs.vue.d.ts +14 -0
  209. package/dist/types/vue-ui-antdv/components/UiTextArea.vue.d.ts +20 -0
  210. package/dist/types/vue-ui-antdv/components/UiTooltip.vue.d.ts +19 -0
  211. package/dist/types/vue-ui-antdv/components/UiTree.vue.d.ts +17 -0
  212. package/dist/types/vue-ui-antdv/components/UiTreeSelect.vue.d.ts +30 -0
  213. package/dist/types/vue-ui-antdv/components/sidePanelHost.d.ts +3 -0
  214. package/dist/types/vue-ui-antdv/confirm.d.ts +5 -0
  215. package/dist/types/vue-ui-antdv/dataTableModel.d.ts +10 -0
  216. package/dist/types/vue-ui-antdv/dictionaries.d.ts +2 -0
  217. package/dist/types/vue-ui-antdv/feedback.d.ts +10 -0
  218. package/dist/types/vue-ui-antdv/index.d.ts +36 -0
  219. package/dist/types/vue-ui-antdv/references.d.ts +8 -0
  220. package/dist/types/vue-ui-antdv/registry.d.ts +3 -0
  221. package/dist/types/vue-ui-antdv/types.d.ts +65 -0
  222. package/dist/types/web-contracts/index.d.ts +862 -0
  223. package/dist/types/web-core/actionResult.d.ts +28 -0
  224. package/dist/types/web-core/clients.d.ts +23 -0
  225. package/dist/types/web-core/dataChanges.d.ts +15 -0
  226. package/dist/types/web-core/errors.d.ts +65 -0
  227. package/dist/types/web-core/http.d.ts +21 -0
  228. package/dist/types/web-core/index.d.ts +8 -0
  229. package/dist/types/web-core/mock.d.ts +6 -0
  230. package/dist/types/web-core/module/abilities.d.ts +21 -0
  231. package/dist/types/web-core/module/abilityCodes.d.ts +18 -0
  232. package/dist/types/web-core/module/index.d.ts +6 -0
  233. package/dist/types/web-core/module/moduleContext.d.ts +49 -0
  234. package/dist/types/web-core/module/recycleBin.d.ts +6 -0
  235. package/dist/types/web-core/module/runtimeContext.d.ts +65 -0
  236. package/dist/types/web-core/module/staticModuleClient.d.ts +45 -0
  237. package/dist/types/web-core/query.d.ts +16 -0
  238. package/dist/types/web-core/realtime.d.ts +104 -0
  239. package/dist/useUserSessionRows-CLM0ZvAF.js +128 -0
  240. package/dist/workspaceViewSessions-WsJU3OS7.js +1578 -0
  241. package/package.json +27 -0
@@ -0,0 +1,1706 @@
1
+ import { $ as e, Bt as t, C as n, Dt as r, Et as i, G as a, It as o, K as s, Kn as ee, L as te, Lt as ne, M as c, Pt as re, R as ie, S as ae, Vt as oe, W as se, X as ce, Yt as l, Z as u, _t as le, a as d, cn as f, cr as p, d as ue, en as m, et as de, f as fe, i as pe, it as me, m as he, rt as ge, tn as h, tt as g, u as _e, v as ve, w as ye, y as be } from "./platform-components-bC1gwhic.js";
2
+ import { g as xe, i as Se, n as Ce, p as we, r as Te, t as _ } from "./workspaceViewSessions-WsJU3OS7.js";
3
+ import { a as Ee, i as De, r as Oe } from "./pageRealtime-sRtDYlQP.js";
4
+ import { Fragment as ke, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, normalizeClass as Ae, onBeforeUnmount as je, onMounted as Me, openBlock as E, ref as D, renderList as Ne, toDisplayString as O, unref as k, watch as Pe, withCtx as A, withModifiers as j } from "vue";
5
+ //#region src/views/employeeDetailStateModel.ts
6
+ function Fe(e) {
7
+ return e.mode === "view" || e.loadingDetail || e.saving ? !0 : e.mode === "edit" && !e.selectedEmployeeId;
8
+ }
9
+ function Ie(e) {
10
+ return e.activeRequestSeq === e.requestSeq && e.selectedEmployeeKey === e.recordId;
11
+ }
12
+ function Le(e) {
13
+ return e.mode === "create" ? !0 : !e.loadingDetail && !e.loadFailed && !!e.selectedEmployeeId;
14
+ }
15
+ function Re(e) {
16
+ return !e.saving;
17
+ }
18
+ function ze(e) {
19
+ return e.mode !== "edit" || !e.selectedEmployeeId;
20
+ }
21
+ function Be(e) {
22
+ let t = e.filter((e) => e.visible && e.required && !M(e.value)).map((e) => e.label);
23
+ return t.length > 0 ? `请填写${t.join("、")}` : void 0;
24
+ }
25
+ function M(e) {
26
+ return typeof e == "string" ? e.trim().length > 0 : e != null;
27
+ }
28
+ //#endregion
29
+ //#region src/views/EmployeeEmploymentDrawer.vue?vue&type=script&setup=true&lang.ts
30
+ var N = { class: "employment-drawer" }, P = { class: "employment-drawer-header" }, F = { class: "employment-primary-field" }, I = ["checked", "disabled"], L = { key: 0 }, R = { class: "employment-editor-actions" }, z = {
31
+ key: 2,
32
+ class: "employment-state"
33
+ }, B = {
34
+ key: 3,
35
+ class: "employment-empty"
36
+ }, Ve = /*#__PURE__*/ h(/* @__PURE__ */ T({
37
+ name: "EmployeeEmploymentDrawer",
38
+ __name: "EmployeeEmploymentDrawer",
39
+ props: {
40
+ open: { type: Boolean },
41
+ employee: {}
42
+ },
43
+ emits: ["close", "saved"],
44
+ setup(e, { emit: n }) {
45
+ let a = e, s = n, ee = f({ moduleAlias: "iam.employee" }), te = f({ moduleAlias: "iam.organization" }), ie = f({ moduleAlias: "iam.department" }), ae = f({ moduleAlias: "iam.position" }), se = D([]), ce = D(!1), l = D(!1), u = D(!1), d = D(!1), p = D(ge()), ue = [
46
+ {
47
+ key: "position",
48
+ title: "岗位",
49
+ width: 150
50
+ },
51
+ {
52
+ key: "organization",
53
+ title: "机构",
54
+ width: 140
55
+ },
56
+ {
57
+ key: "department",
58
+ title: "部门",
59
+ width: 140
60
+ },
61
+ {
62
+ key: "primaryPosition",
63
+ title: "主岗位",
64
+ width: 80
65
+ }
66
+ ], fe = v(() => `任职管理 - ${h(a.employee)}`), pe = v(() => se.value), me = v(() => _e(ie, {
67
+ scopeFieldName: "organizationId",
68
+ scopeValue: p.value.organizationId,
69
+ treePath: "/iam.department/tree",
70
+ sortPath: "/iam.department/sort"
71
+ })), he = v(() => {
72
+ let e = a.employee;
73
+ return !!(e?.organizationId && e?.departmentId && e.organizationId === p.value.organizationId && e.departmentId === p.value.departmentId);
74
+ });
75
+ Pe(() => [a.open, a.employee?.id], ([e]) => {
76
+ e ? g() : ve();
77
+ }, { immediate: !0 });
78
+ function ge() {
79
+ return {
80
+ primaryPosition: !1,
81
+ enabled: !0
82
+ };
83
+ }
84
+ function h(e) {
85
+ return String(e?.title ?? e?.employeeNo ?? e?.id ?? "职员");
86
+ }
87
+ async function g() {
88
+ let e = a.employee?.id;
89
+ if (e) {
90
+ ce.value = !0, l.value = !1;
91
+ try {
92
+ se.value = (await ee.http.request({ path: `/iam.employee/${encodeURIComponent(e)}/employment-view` })).records;
93
+ } catch (e) {
94
+ l.value = !0, i(e, {
95
+ source: "employee-employment",
96
+ phase: "load"
97
+ });
98
+ } finally {
99
+ ce.value = !1;
100
+ }
101
+ }
102
+ }
103
+ function ve() {
104
+ d.value = !1, p.value = ge();
105
+ }
106
+ function be() {
107
+ p.value = {
108
+ organizationId: a.employee?.organizationId,
109
+ departmentId: a.employee?.departmentId,
110
+ primaryPosition: !1,
111
+ enabled: !0
112
+ }, d.value = !0;
113
+ }
114
+ function xe(e) {
115
+ p.value = { ...e }, d.value = !0;
116
+ }
117
+ function Se(e) {
118
+ let t = e !== p.value.organizationId;
119
+ p.value = {
120
+ ...p.value,
121
+ organizationId: e,
122
+ departmentId: t ? void 0 : p.value.departmentId,
123
+ primaryPosition: t ? !1 : p.value.primaryPosition
124
+ };
125
+ }
126
+ function Ce(e) {
127
+ let t = !!(p.value.primaryPosition && a.employee?.organizationId === p.value.organizationId && a.employee?.departmentId === e);
128
+ p.value = {
129
+ ...p.value,
130
+ departmentId: e,
131
+ primaryPosition: t
132
+ };
133
+ }
134
+ function we(e) {
135
+ if (e && !he.value) {
136
+ r("主岗必须与职员主机构、主部门一致", {
137
+ source: "employee-employment",
138
+ phase: "validation"
139
+ });
140
+ return;
141
+ }
142
+ p.value = {
143
+ ...p.value,
144
+ primaryPosition: e
145
+ };
146
+ }
147
+ function Te(e, t) {
148
+ let n = t;
149
+ return e.key === "position" ? n.positionTitle ?? n.positionId : e.key === "organization" ? n.organizationTitle ?? n.organizationId : e.key === "department" ? n.departmentTitle ?? n.departmentId : e.key === "primaryPosition" ? n.primaryPosition ? "是" : "否" : "";
150
+ }
151
+ function _(e) {
152
+ return e.enabled === !1;
153
+ }
154
+ function Ee(e) {
155
+ return [
156
+ ...e.primaryPosition ? [] : [{
157
+ key: "primary",
158
+ title: "设为主岗"
159
+ }],
160
+ {
161
+ key: e.enabled === !1 ? "enable" : "disable",
162
+ title: e.enabled === !1 ? "启用" : "停用"
163
+ },
164
+ {
165
+ key: "delete",
166
+ title: "删除",
167
+ danger: !0
168
+ }
169
+ ];
170
+ }
171
+ function De(e, t) {
172
+ (t === "primary" || t === "enable" || t === "disable" || t === "delete") && ke(e, t);
173
+ }
174
+ async function Oe() {
175
+ let e = a.employee?.id;
176
+ if (!e || !p.value.organizationId || !p.value.departmentId || !p.value.positionId) {
177
+ r("请选择机构、部门和岗位", {
178
+ source: "employee-employment",
179
+ phase: "validation"
180
+ });
181
+ return;
182
+ }
183
+ u.value = !0;
184
+ try {
185
+ let t = p.value.id;
186
+ await ee.http.request({
187
+ method: "POST",
188
+ path: t ? `/iam.employee/${encodeURIComponent(e)}/positions/${encodeURIComponent(t)}/update` : `/iam.employee/${encodeURIComponent(e)}/positions`,
189
+ body: {
190
+ ...p.value,
191
+ employeeId: e
192
+ }
193
+ }), ve(), await g(), s("saved", e), await le({
194
+ success: !0,
195
+ message: "任职已保存"
196
+ }, {
197
+ source: "employee-employment",
198
+ phase: "action"
199
+ });
200
+ } catch (e) {
201
+ i(e, {
202
+ source: "employee-employment",
203
+ phase: "action"
204
+ });
205
+ } finally {
206
+ u.value = !1;
207
+ }
208
+ }
209
+ async function ke(e, t) {
210
+ let n = a.employee?.id;
211
+ if (n && !(t === "delete" && !await re({
212
+ title: "删除任职",
213
+ content: "确认删除该任职?",
214
+ okText: "删除",
215
+ danger: !0
216
+ }))) {
217
+ u.value = !0;
218
+ try {
219
+ await ee.http.request({
220
+ method: "POST",
221
+ path: `/iam.employee/${encodeURIComponent(n)}/positions/${encodeURIComponent(e.id)}/${t}`
222
+ }), await g(), s("saved", n);
223
+ } catch (e) {
224
+ i(e, {
225
+ source: "employee-employment",
226
+ phase: "action"
227
+ });
228
+ } finally {
229
+ u.value = !1;
230
+ }
231
+ }
232
+ }
233
+ return (n, r) => (E(), y(k(de), {
234
+ open: e.open,
235
+ title: fe.value,
236
+ onClose: r[4] ||= (e) => s("close")
237
+ }, {
238
+ operation: A(() => [w(k(m), {
239
+ type: "text",
240
+ "icon-name": "reload",
241
+ disabled: ce.value || u.value,
242
+ onClick: g
243
+ }, {
244
+ default: A(() => [...r[5] ||= [C(" 刷新 ", -1)]]),
245
+ _: 1
246
+ }, 8, ["disabled"])]),
247
+ default: A(() => [S("div", N, [
248
+ S("div", P, [r[7] ||= S("div", null, [S("strong", null, "任职信息"), S("span", null, "角色授权按具体任职生效")], -1), w(k(m), {
249
+ type: "primary",
250
+ "icon-name": "plus",
251
+ disabled: u.value,
252
+ onClick: be
253
+ }, {
254
+ default: A(() => [...r[6] ||= [C("新增任职", -1)]]),
255
+ _: 1
256
+ }, 8, ["disabled"])]),
257
+ d.value ? (E(), x("form", {
258
+ key: 0,
259
+ class: "employment-editor",
260
+ onSubmit: j(Oe, ["prevent"])
261
+ }, [
262
+ S("label", null, [r[8] ||= S("span", null, "机构", -1), w(k(ye), {
263
+ value: p.value.organizationId,
264
+ context: k(te),
265
+ placeholder: "请选择机构",
266
+ constraints: [k(c)()],
267
+ disabled: u.value,
268
+ "onUpdate:value": Se
269
+ }, null, 8, [
270
+ "value",
271
+ "context",
272
+ "constraints",
273
+ "disabled"
274
+ ])]),
275
+ S("label", null, [r[9] ||= S("span", null, "部门", -1), w(k(ye), {
276
+ value: p.value.departmentId,
277
+ context: me.value,
278
+ placeholder: "请选择部门",
279
+ constraints: [k(c)()],
280
+ disabled: u.value || !p.value.organizationId,
281
+ "onUpdate:value": Ce
282
+ }, null, 8, [
283
+ "value",
284
+ "context",
285
+ "constraints",
286
+ "disabled"
287
+ ])]),
288
+ S("label", null, [r[10] ||= S("span", null, "岗位", -1), w(k(ye), {
289
+ value: p.value.positionId,
290
+ context: k(ae),
291
+ mode: "list",
292
+ placeholder: "请选择岗位",
293
+ constraints: [k(c)()],
294
+ disabled: u.value,
295
+ "onUpdate:value": r[0] ||= (e) => p.value.positionId = e ? String(e) : void 0
296
+ }, null, 8, [
297
+ "value",
298
+ "context",
299
+ "constraints",
300
+ "disabled"
301
+ ])]),
302
+ S("label", F, [
303
+ r[12] ||= S("span", null, "主岗位", -1),
304
+ S("span", null, [S("input", {
305
+ type: "checkbox",
306
+ checked: p.value.primaryPosition === !0,
307
+ disabled: u.value || !he.value,
308
+ onChange: r[1] ||= (e) => we(e.target.checked)
309
+ }, null, 40, I), r[11] ||= C(" 设为主岗 ", -1)]),
310
+ he.value ? b("v-if", !0) : (E(), x("small", L, "主岗必须与职员主机构、主部门一致"))
311
+ ]),
312
+ S("div", R, [w(k(m), {
313
+ disabled: u.value,
314
+ onClick: ve
315
+ }, {
316
+ default: A(() => [...r[13] ||= [C("取消", -1)]]),
317
+ _: 1
318
+ }, 8, ["disabled"]), w(k(m), {
319
+ type: "primary",
320
+ "html-type": "submit",
321
+ loading: u.value
322
+ }, {
323
+ default: A(() => [...r[14] ||= [C("保存任职", -1)]]),
324
+ _: 1
325
+ }, 8, ["loading"])])
326
+ ], 32)) : b("v-if", !0),
327
+ ce.value ? (E(), y(k(ne), {
328
+ key: 1,
329
+ class: "employment-state",
330
+ tip: "加载任职"
331
+ })) : l.value ? (E(), x("div", z, [w(k(o), {
332
+ title: "任职信息加载失败",
333
+ message: "无法加载任职信息,请重试"
334
+ }), w(k(m), {
335
+ type: "primary",
336
+ "icon-name": "reload",
337
+ onClick: g
338
+ }, {
339
+ default: A(() => [...r[15] ||= [C("重试", -1)]]),
340
+ _: 1
341
+ })])) : se.value.length === 0 ? (E(), x("p", B, "暂无任职信息")) : (E(), y(k(oe), {
342
+ key: 4,
343
+ class: "employment-table",
344
+ columns: ue,
345
+ rows: pe.value,
346
+ "row-key": "id",
347
+ pagination: !1,
348
+ "horizontal-scroll": "",
349
+ "show-action-column": "",
350
+ "action-column-width": "92",
351
+ "row-muted": _
352
+ }, {
353
+ cell: A(({ column: e, record: t }) => [C(O(Te(e, t)), 1)]),
354
+ rowActions: A(({ record: e }) => [S("div", {
355
+ class: "employment-table-row-actions",
356
+ onClick: r[2] ||= j(() => {}, ["stop"]),
357
+ onDblclick: r[3] ||= j(() => {}, ["stop"])
358
+ }, [w(k(m), {
359
+ type: "text",
360
+ disabled: u.value,
361
+ onClick: (t) => xe(e)
362
+ }, {
363
+ default: A(() => [...r[16] ||= [C(" 编辑 ", -1)]]),
364
+ _: 1
365
+ }, 8, ["disabled", "onClick"]), w(k(t), {
366
+ items: Ee(e),
367
+ trigger: "hover",
368
+ onSelect: (t) => De(e, t)
369
+ }, {
370
+ default: A(() => [w(k(m), {
371
+ type: "text",
372
+ "icon-name": "down",
373
+ title: "更多",
374
+ "aria-label": "更多",
375
+ disabled: u.value
376
+ }, null, 8, ["disabled"])]),
377
+ _: 1
378
+ }, 8, ["items", "onSelect"])], 32)]),
379
+ _: 1
380
+ }, 8, ["rows"]))
381
+ ])]),
382
+ _: 1
383
+ }, 8, ["open", "title"]));
384
+ }
385
+ }), [["__scopeId", "data-v-fd7522f0"]]), V = {
386
+ key: 1,
387
+ class: "employee-detail-state"
388
+ }, H = { class: "employee-account-section" }, He = { class: "employee-account-header" }, Ue = {
389
+ key: 1,
390
+ class: "employee-account-state"
391
+ }, U = { class: "employee-account-form-actions" }, W = {
392
+ key: 3,
393
+ class: "employee-account-empty"
394
+ }, G = {
395
+ key: 4,
396
+ class: "employee-account-card"
397
+ }, K = { class: "employee-account-status" }, q = { key: 0 }, We = { class: "employee-form-label" }, Ge = {
398
+ key: 0,
399
+ "aria-hidden": "true"
400
+ }, Ke = /*#__PURE__*/ h(/* @__PURE__ */ T({
401
+ name: "EmployeeDetailContent",
402
+ __name: "EmployeeDetailContent",
403
+ props: {
404
+ mode: {},
405
+ draft: {},
406
+ selectedEmployee: {},
407
+ selectedOrganization: {},
408
+ detailDepartment: {},
409
+ loading: { type: Boolean },
410
+ loadFailed: { type: Boolean },
411
+ formDisabled: { type: Boolean },
412
+ showContent: { type: Boolean },
413
+ fields: {},
414
+ fallback: {},
415
+ pickerConfigs: {},
416
+ displayOf: { type: Function },
417
+ visibleOf: { type: Function },
418
+ labelOf: { type: Function },
419
+ requiredOf: { type: Function },
420
+ externallyChanged: { type: Boolean },
421
+ account: {},
422
+ accountUser: {},
423
+ loadingAccounts: { type: Boolean },
424
+ accountsLoadFailed: { type: Boolean },
425
+ savingAccount: { type: Boolean },
426
+ canManageAccounts: { type: Boolean },
427
+ showAccountProvisionForm: { type: Boolean },
428
+ accountProvisionDraft: {},
429
+ accountUserTitle: {},
430
+ accountUserDescription: {},
431
+ accountStatusTitle: {},
432
+ optionContext: {}
433
+ },
434
+ emits: [
435
+ "retry",
436
+ "save",
437
+ "reloadExternal",
438
+ "dismissExternal",
439
+ "updateField",
440
+ "retryAccounts",
441
+ "startAccountProvision",
442
+ "cancelAccountProvision",
443
+ "provisionAccount",
444
+ "removeAccount",
445
+ "updateAccountProvisionField"
446
+ ],
447
+ setup(t, { emit: r }) {
448
+ let i = t, a = r;
449
+ return (t, r) => i.loading ? (E(), y(k(ne), {
450
+ key: 0,
451
+ class: "employee-detail-state",
452
+ tip: "加载职员详情"
453
+ })) : i.loadFailed ? (E(), x("div", V, [w(k(o), {
454
+ title: "详情加载失败",
455
+ message: "无法加载职员详情,请重试"
456
+ }), w(k(m), {
457
+ type: "primary",
458
+ "icon-name": "reload",
459
+ onClick: r[0] ||= (e) => a("retry")
460
+ }, {
461
+ default: A(() => [...r[12] ||= [C("重试", -1)]]),
462
+ _: 1
463
+ })])) : i.showContent ? (E(), x(ke, { key: 2 }, [i.mode === "view" ? (E(), x(ke, { key: 0 }, [
464
+ w(k(s), {
465
+ record: i.draft,
466
+ fields: i.fields,
467
+ fallback: i.fallback,
468
+ "picker-configs": i.pickerConfigs,
469
+ "display-of": i.displayOf
470
+ }, null, 8, [
471
+ "record",
472
+ "fields",
473
+ "fallback",
474
+ "picker-configs",
475
+ "display-of"
476
+ ]),
477
+ S("section", H, [S("div", He, [r[14] ||= S("strong", null, "登录账号", -1), !i.account && !i.showAccountProvisionForm ? (E(), y(k(m), {
478
+ key: 0,
479
+ type: "primary",
480
+ "icon-name": "plus",
481
+ disabled: !i.canManageAccounts,
482
+ onClick: r[1] ||= (e) => a("startAccountProvision")
483
+ }, {
484
+ default: A(() => [...r[13] ||= [C(" 设置账号 ", -1)]]),
485
+ _: 1
486
+ }, 8, ["disabled"])) : b("v-if", !0)]), i.loadingAccounts ? (E(), y(k(ne), {
487
+ key: 0,
488
+ class: "employee-account-state",
489
+ tip: "加载账号绑定"
490
+ })) : i.accountsLoadFailed ? (E(), x("div", Ue, [w(k(o), {
491
+ title: "账号绑定加载失败",
492
+ message: "无法加载职员账号绑定,请重试"
493
+ }), w(k(m), {
494
+ "icon-name": "reload",
495
+ onClick: r[2] ||= (e) => a("retryAccounts")
496
+ }, {
497
+ default: A(() => [...r[15] ||= [C("重试", -1)]]),
498
+ _: 1
499
+ })])) : i.showAccountProvisionForm ? (E(), x("form", {
500
+ key: 2,
501
+ class: "employee-account-form",
502
+ onSubmit: r[6] ||= j((e) => a("provisionAccount"), ["prevent"])
503
+ }, [
504
+ S("label", null, [r[16] ||= S("span", null, "账号", -1), w(k(l), {
505
+ value: i.accountProvisionDraft.username,
506
+ placeholder: "请输入登录账号",
507
+ disabled: i.savingAccount,
508
+ "onUpdate:value": r[3] ||= (e) => a("updateAccountProvisionField", "username", e)
509
+ }, null, 8, ["value", "disabled"])]),
510
+ S("label", null, [r[17] ||= S("span", null, "初始密码", -1), w(k(l), {
511
+ value: i.accountProvisionDraft.password,
512
+ type: "password",
513
+ placeholder: "请输入初始密码",
514
+ disabled: i.savingAccount,
515
+ "onUpdate:value": r[4] ||= (e) => a("updateAccountProvisionField", "password", e)
516
+ }, null, 8, ["value", "disabled"])]),
517
+ S("div", U, [w(k(m), {
518
+ disabled: i.savingAccount,
519
+ onClick: r[5] ||= (e) => a("cancelAccountProvision")
520
+ }, {
521
+ default: A(() => [...r[18] ||= [C("取消", -1)]]),
522
+ _: 1
523
+ }, 8, ["disabled"]), w(k(m), {
524
+ type: "primary",
525
+ "html-type": "submit",
526
+ "icon-name": "plus",
527
+ loading: i.savingAccount,
528
+ disabled: !i.canManageAccounts
529
+ }, {
530
+ default: A(() => [...r[19] ||= [C(" 创建账号并绑定 ", -1)]]),
531
+ _: 1
532
+ }, 8, ["loading", "disabled"])])
533
+ ], 32)) : i.account ? (E(), x("div", G, [
534
+ S("div", null, [S("strong", null, O(i.accountUserTitle), 1), S("span", null, O(i.accountUserDescription), 1)]),
535
+ S("span", K, O(i.accountStatusTitle), 1),
536
+ w(k(m), {
537
+ danger: "",
538
+ "icon-name": "delete",
539
+ disabled: i.savingAccount || !i.canManageAccounts,
540
+ onClick: r[7] ||= (e) => a("removeAccount")
541
+ }, {
542
+ default: A(() => [...r[21] ||= [C(" 移除账户 ", -1)]]),
543
+ _: 1
544
+ }, 8, ["disabled"])
545
+ ])) : (E(), x("div", W, [...r[20] ||= [S("span", null, "未设置登录账号", -1), S("small", null, "可从职员档案生成账号并自动完成一对一绑定。", -1)]]))]),
546
+ w(k(ae), {
547
+ record: i.draft,
548
+ "show-sort-order": ""
549
+ }, null, 8, ["record"])
550
+ ], 64)) : (E(), x(ke, { key: 1 }, [i.externallyChanged ? (E(), y(k(e), {
551
+ key: 0,
552
+ onReload: r[8] ||= (e) => a("reloadExternal"),
553
+ onDismiss: r[9] ||= (e) => a("dismissExternal")
554
+ })) : b("v-if", !0), S("form", {
555
+ class: "employee-form",
556
+ onSubmit: r[11] ||= j((e) => a("save"), ["prevent"])
557
+ }, [i.visibleOf("organizationId") ? (E(), x("label", q, [S("span", We, [C(O(i.labelOf("organizationId")) + " ", 1), i.requiredOf("organizationId") ? (E(), x("strong", Ge, "*")) : b("v-if", !0)]), w(k(l), {
558
+ value: i.selectedOrganization?.title ?? i.selectedOrganization?.id ?? "-",
559
+ disabled: ""
560
+ }, null, 8, ["value"])])) : b("v-if", !0), w(k(n), {
561
+ record: i.draft,
562
+ fields: i.fields,
563
+ "exclude-field-names": ["organizationId"],
564
+ fallback: i.fallback,
565
+ "picker-configs": i.pickerConfigs,
566
+ disabled: i.formDisabled,
567
+ "option-context": i.optionContext,
568
+ "onUpdate:field": r[10] ||= (e, t) => a("updateField", e, t)
569
+ }, null, 8, [
570
+ "record",
571
+ "fields",
572
+ "fallback",
573
+ "picker-configs",
574
+ "disabled",
575
+ "option-context"
576
+ ])], 32)], 64))], 64)) : b("v-if", !0);
577
+ }
578
+ }), [["__scopeId", "data-v-1e08bd36"]]);
579
+ //#endregion
580
+ //#region src/views/employeeDetailWorkspaceSession.ts
581
+ function qe(e, t) {
582
+ return _(we, e, {
583
+ ...t,
584
+ selectedEmployee: { ...t.selectedEmployee },
585
+ draft: { ...t.draft },
586
+ organization: t.organization ? { ...t.organization } : void 0,
587
+ department: t.department ? { ...t.department } : void 0,
588
+ account: t.account ? { ...t.account } : void 0,
589
+ accountUser: t.accountUser ? { ...t.accountUser } : void 0,
590
+ accountProvisionDraft: { ...t.accountProvisionDraft }
591
+ });
592
+ }
593
+ function Je(e, t) {
594
+ return Ce(we, e, t);
595
+ }
596
+ function Ye(e) {
597
+ return Te(we, e);
598
+ }
599
+ //#endregion
600
+ //#region src/views/useEmployeeEmploymentRows.ts
601
+ function Xe(e) {
602
+ let t = D([]), n = D({});
603
+ async function r(t) {
604
+ if (!(!t || e.context.can("employeePositions", t) === !1)) {
605
+ s(t, {
606
+ ...o(t),
607
+ loading: !0,
608
+ error: void 0
609
+ });
610
+ try {
611
+ s(t, {
612
+ records: (await e.context.http.request({ path: e.pathOf?.(t) ?? `/iam.employee/${encodeURIComponent(t)}/employment-view` })).records,
613
+ loading: !1,
614
+ error: void 0
615
+ });
616
+ } catch (n) {
617
+ let r = i(n, {
618
+ source: `${e.source}-employment-rows`,
619
+ phase: "load"
620
+ });
621
+ s(t, {
622
+ ...o(t),
623
+ loading: !1,
624
+ error: r.message
625
+ });
626
+ }
627
+ }
628
+ }
629
+ function a(e, n) {
630
+ let i = String(e.id ?? "");
631
+ i && (t.value = n ? Array.from(new Set([...t.value, i])) : t.value.filter((e) => e !== i), n && o(i).records.length === 0 && r(i));
632
+ }
633
+ function o(e) {
634
+ return e ? n.value[e] ?? {
635
+ records: [],
636
+ loading: !1
637
+ } : {
638
+ records: [],
639
+ loading: !1
640
+ };
641
+ }
642
+ function s(e, t) {
643
+ n.value = {
644
+ ...n.value,
645
+ [e]: t
646
+ };
647
+ }
648
+ function ee() {
649
+ t.value = [], n.value = {};
650
+ }
651
+ return {
652
+ expandedEmployeeKeys: t,
653
+ employmentRowState: o,
654
+ handleEmployeeRowExpand: a,
655
+ loadEmployeeEmploymentRows: r,
656
+ resetEmployeeEmploymentRows: ee
657
+ };
658
+ }
659
+ //#endregion
660
+ //#region src/views/EmployeeManagementView.vue?vue&type=script&setup=true&lang.ts
661
+ var Ze = { key: 0 }, Qe = {
662
+ key: 1,
663
+ class: "employee-row-employment-list"
664
+ }, $e = /*#__PURE__*/ h(/* @__PURE__ */ T({
665
+ name: "EmployeeManagementView",
666
+ __name: "EmployeeManagementView",
667
+ props: {
668
+ recordId: {},
669
+ mode: {}
670
+ },
671
+ setup(e) {
672
+ let t = e, n = [
673
+ "departmentId",
674
+ "employeeNo",
675
+ "title"
676
+ ], o = xe(), s = f({ moduleAlias: "iam.organization" }), ne = f({ moduleAlias: "iam.department" }), c = f({ moduleAlias: "iam.employee" }), ae = f({ moduleAlias: "iam.user" }), oe = D(u(void 0)), l = v(() => !!t.recordId), h = v(() => l.value && o?.presentation === "drawer"), ye = v(() => !l.value || h.value), Ce = D(""), Te = D(0), _ = D(0), T = D(), j = D(), M = D(), N = D(!1), P = D("view"), F = D(!1), I = D(!1), L = D(!1), R = D(0), z = D(Qt(void 0)), B = D(), V = D(), H = D(), He = D(!1), Ue = D(), U = D(!1), W = D(!1), G = D(!1), K = D(!1), q = D($t(void 0)), We = ve({
677
+ context: () => c,
678
+ listReloadKey: _,
679
+ canChange: X,
680
+ resetSelection: Ft
681
+ }), { expandedEmployeeKeys: Ge, employmentRowState: $e, handleEmployeeRowExpand: et, loadEmployeeEmploymentRows: tt, resetEmployeeEmploymentRows: nt } = Xe({
682
+ context: c,
683
+ source: "employee-management",
684
+ pathOf: (e) => We.active.value ? `/iam.employee/recycle-bin/${encodeURIComponent(e)}/employment-view` : `/iam.employee/${encodeURIComponent(e)}/employment-view`
685
+ }), J = De({
686
+ moduleAlias: "iam.employee",
687
+ recordId: () => M.value?.id,
688
+ editing: () => P.value === "edit",
689
+ saving: () => L.value
690
+ }), rt = Ee({
691
+ delay: 80,
692
+ load: async (e) => {
693
+ _.value += 1;
694
+ let t = M.value?.id;
695
+ N.value && P.value === "view" && t && e.keys.includes(t) && await Z({
696
+ ...z.value,
697
+ id: t
698
+ }, "view");
699
+ }
700
+ });
701
+ Oe({
702
+ moduleAlias: "iam.employee",
703
+ handler: (e, t) => {
704
+ let n = t.map((e) => e.recordId).filter((e) => !!e);
705
+ rt.enqueue(n.length > 0 ? n : "__collection__");
706
+ }
707
+ });
708
+ let it = v(() => c), Y = v(() => T.value?.id), at = v(() => _e(ne, {
709
+ scopeFieldName: "organizationId",
710
+ scopeValue: Y.value,
711
+ treePath: "/iam.department/tree",
712
+ sortPath: "/iam.department/sort"
713
+ })), ot = v(() => ({ departmentId: {
714
+ context: at.value,
715
+ reloadKey: Te.value,
716
+ placeholder: "请选择部门",
717
+ titleOf: (e) => wn(e)
718
+ } })), st = v(() => {
719
+ let e = Y.value;
720
+ if (e) return { departmentScope: {
721
+ organizationId: e,
722
+ includeChildren: !0
723
+ } };
724
+ }), ct = v(() => P.value === "create" ? "新建职员" : pn(M.value ?? z.value)), lt = v(() => P.value === "create" ? void 0 : mn(M.value ?? z.value)), ut = v(() => Fe({
725
+ mode: P.value,
726
+ loadingDetail: F.value,
727
+ saving: L.value,
728
+ selectedEmployeeId: M.value?.id
729
+ })), dt = v(() => Le({
730
+ mode: P.value,
731
+ loadingDetail: F.value,
732
+ loadFailed: I.value,
733
+ selectedEmployeeId: M.value?.id
734
+ })), ft = v(() => F.value ? !1 : P.value === "create" ? !!Y.value && c.can("create") === !0 : !!M.value?.id && c.can("update") === !0), pt = v(() => F.value || !M.value?.id ? !1 : c.can(hn(M.value)) === !0), mt = v(() => !M.value?.id || F.value || L.value ? !1 : c.can("employeeAccounts", M.value.id) !== !1), ht = v(() => P.value === "view" ? M.value?.id ? [{
735
+ key: "edit",
736
+ actionCode: "update",
737
+ title: "编辑",
738
+ iconName: "edit",
739
+ disabled: L.value
740
+ }, {
741
+ key: "delete",
742
+ actionCode: "delete",
743
+ title: "删除",
744
+ iconName: "delete",
745
+ danger: !0,
746
+ disabled: L.value
747
+ }] : [] : [{
748
+ key: "cancel",
749
+ title: "取消",
750
+ iconName: "close",
751
+ disabled: L.value
752
+ }, {
753
+ key: "save",
754
+ actionCode: P.value === "create" ? "create" : "update",
755
+ title: "保存",
756
+ iconName: "save",
757
+ primary: !0,
758
+ disabled: !ft.value,
759
+ loading: L.value
760
+ }]), gt = v(() => ht.value), _t = v(() => P.value === "view" ? M.value?.id ? [{
761
+ key: "edit",
762
+ actionCode: "update",
763
+ title: "编辑",
764
+ iconName: "edit",
765
+ disabled: L.value
766
+ }] : [] : P.value === "edit" ? [{
767
+ key: "cancel",
768
+ title: "取消",
769
+ iconName: "close",
770
+ disabled: L.value
771
+ }, {
772
+ key: "save",
773
+ actionCode: "update",
774
+ title: "保存",
775
+ iconName: "save",
776
+ primary: !0,
777
+ loading: L.value,
778
+ disabled: !ft.value
779
+ }] : []), vt = Se({
780
+ view: we,
781
+ input: v(() => {
782
+ let e = M.value?.id, t = P.value;
783
+ return e && (t === "view" || t === "edit") ? { recordId: e } : void 0;
784
+ }),
785
+ title: v(() => pn(M.value)),
786
+ eligibility: v(() => ({
787
+ hasStableIdentity: !!M.value?.id && !F.value,
788
+ busy: L.value || W.value || U.value
789
+ })),
790
+ beforePromote: async (e) => {
791
+ let t = M.value;
792
+ if (t) return await qe(e, {
793
+ selectedEmployee: t,
794
+ draft: z.value,
795
+ organization: T.value,
796
+ department: B.value,
797
+ account: V.value,
798
+ accountUser: H.value,
799
+ showAccountProvisionForm: K.value,
800
+ accountProvisionDraft: q.value,
801
+ mode: P.value === "edit" ? "edit" : "view"
802
+ }) === "accepted";
803
+ },
804
+ onPromoted: Wt
805
+ });
806
+ Pe(M, (e) => {
807
+ !l.value || !e || o?.setTitle(pn(e));
808
+ }, { immediate: !0 });
809
+ let yt;
810
+ Me(() => {
811
+ if (xt(), !t.recordId) return;
812
+ let e = { recordId: t.recordId };
813
+ h.value || (yt = Je(e, bt));
814
+ let n = Ye(e);
815
+ if (n) {
816
+ an(n);
817
+ return;
818
+ }
819
+ Z({ id: t.recordId }, t.mode ?? "view");
820
+ }), je(() => yt?.());
821
+ function bt(e) {
822
+ return P.value !== "view" || K.value ? !1 : (an(e), !0);
823
+ }
824
+ async function xt() {
825
+ try {
826
+ oe.value = u((await c.runtime.ready).uiDescriptor);
827
+ } catch (e) {
828
+ i(e, {
829
+ source: "employee-management",
830
+ phase: "load"
831
+ });
832
+ }
833
+ }
834
+ function St(e) {
835
+ return ce(e, {
836
+ fields: oe.value,
837
+ fallback: En
838
+ });
839
+ }
840
+ function Ct(e) {
841
+ return St(e).label;
842
+ }
843
+ function wt(e) {
844
+ return St(e).required;
845
+ }
846
+ function Tt(e) {
847
+ return St(e).visible;
848
+ }
849
+ function X() {
850
+ return Re({ saving: L.value });
851
+ }
852
+ function Et(e, t) {
853
+ z.value = {
854
+ ...z.value,
855
+ [e]: t
856
+ };
857
+ }
858
+ function Dt(e, t) {
859
+ q.value = {
860
+ ...q.value,
861
+ [e]: t
862
+ };
863
+ }
864
+ function Ot(e, t) {
865
+ if (e === "organizationId") return T.value?.title ?? T.value?.id ?? String(t ?? "");
866
+ if (e === "departmentId") {
867
+ let e = B.value;
868
+ return e && e.id === t ? wn(e) : void 0;
869
+ }
870
+ }
871
+ function kt(e) {
872
+ !T.value && e.length > 0 && (T.value = e[0]);
873
+ }
874
+ function At(e) {
875
+ X() && (T.value = e, j.value = void 0, M.value = void 0, J.clearExternalChanged(), F.value = !1, I.value = !1, B.value = void 0, $(), nt(), Wt());
876
+ }
877
+ function jt() {
878
+ Te.value += 1;
879
+ }
880
+ function Mt(e) {
881
+ if (!X()) return;
882
+ let t = String(e.id ?? ""), n = String(M.value?.id ?? z.value.id ?? "");
883
+ j.value = t, N.value && n !== t && (R.value += 1, F.value = !1, I.value = !1, B.value = void 0, $(), M.value = void 0, z.value = Qt(Y.value), J.clearExternalChanged(), N.value = !1, P.value = "view");
884
+ }
885
+ function Nt(e) {
886
+ X() && e.key === "create" && Ut();
887
+ }
888
+ function Pt(e) {
889
+ e === "recycleBin" ? We.enter() : We.leave();
890
+ }
891
+ function Ft() {
892
+ nt(), j.value = void 0, M.value = void 0, Wt();
893
+ }
894
+ function It() {
895
+ _.value += 1;
896
+ }
897
+ function Lt(e, t) {
898
+ if (X()) {
899
+ if (e.key === "employment") {
900
+ zt(t);
901
+ return;
902
+ }
903
+ if (e.key === "view") {
904
+ Z(t, "view");
905
+ return;
906
+ }
907
+ if (e.key === "edit") {
908
+ Z(t, "edit");
909
+ return;
910
+ }
911
+ e.key === "delete" && Zt(t);
912
+ }
913
+ }
914
+ function Rt(e) {
915
+ return [{
916
+ key: "employment",
917
+ actionCode: "employeePositions",
918
+ title: "任职",
919
+ after: "edit",
920
+ visible: !!e.id && c.can("employeePositions", String(e.id)) !== !1
921
+ }];
922
+ }
923
+ async function zt(e) {
924
+ let t = String(e.id ?? "");
925
+ if (t) try {
926
+ Ue.value = await c.crud.view(t), He.value = !0;
927
+ } catch (e) {
928
+ i(e, {
929
+ source: "employee-management",
930
+ phase: "load"
931
+ });
932
+ }
933
+ }
934
+ function Bt() {
935
+ He.value = !1;
936
+ }
937
+ function Vt(e) {
938
+ Ge.value.includes(e) && tt(e);
939
+ }
940
+ function Ht(e) {
941
+ X() && Z(e, "view");
942
+ }
943
+ function Ut() {
944
+ if (X()) {
945
+ if (!Y.value) {
946
+ r("请先选择机构", { phase: "validation" });
947
+ return;
948
+ }
949
+ z.value = Qt(Y.value), M.value = void 0, j.value = void 0, J.clearExternalChanged(), P.value = "create", F.value = !1, I.value = !1, R.value += 1, B.value = void 0, $(), N.value = !0;
950
+ }
951
+ }
952
+ function Wt() {
953
+ L.value || (R.value += 1, F.value = !1, I.value = !1, N.value = !1, P.value = "view", B.value = void 0, J.clearExternalChanged(), $(), z.value = M.value ? en(M.value) : Qt(Y.value), h.value && o?.dismiss());
954
+ }
955
+ function Gt() {
956
+ if (!L.value) {
957
+ if (ze({
958
+ mode: P.value,
959
+ selectedEmployeeId: M.value?.id
960
+ })) {
961
+ Wt();
962
+ return;
963
+ }
964
+ z.value = en(M.value), J.clearExternalChanged(), P.value = "view", F.value = !1, I.value = !1;
965
+ }
966
+ }
967
+ async function Z(e, t) {
968
+ if (!X()) return;
969
+ let n = String(e.id ?? "");
970
+ if (!n) return;
971
+ j.value = n, J.clearExternalChanged(), N.value = !0, P.value = t, M.value = void 0, z.value = en(e), B.value = void 0, $(), F.value = !0, I.value = !1;
972
+ let a = R.value + 1;
973
+ R.value = a;
974
+ let o = () => Ie({
975
+ activeRequestSeq: R.value,
976
+ requestSeq: a,
977
+ selectedEmployeeKey: j.value,
978
+ recordId: n
979
+ });
980
+ try {
981
+ let e = await c.crud.view(n);
982
+ if (!o()) return;
983
+ if (!e?.id) {
984
+ I.value = !0, r("未找到指定职员", {
985
+ source: "employee-management",
986
+ phase: "load"
987
+ });
988
+ return;
989
+ }
990
+ M.value = e, z.value = en(e), I.value = !1, await sn(e, a), await on(e, a), cn(e, a);
991
+ } catch (e) {
992
+ o() && (I.value = !0, i(e, {
993
+ source: "employee-management",
994
+ phase: "load"
995
+ }));
996
+ } finally {
997
+ o() && (F.value = !1);
998
+ }
999
+ }
1000
+ function Kt(e) {
1001
+ if (e.key === "cancel") {
1002
+ Gt();
1003
+ return;
1004
+ }
1005
+ if (e.key === "save") {
1006
+ Yt();
1007
+ return;
1008
+ }
1009
+ if (X()) {
1010
+ if (e.key === "edit") {
1011
+ if (!M.value || F.value) return;
1012
+ z.value = en(M.value), J.clearExternalChanged(), P.value = "edit";
1013
+ return;
1014
+ }
1015
+ e.key === "delete" && Zt(M.value);
1016
+ }
1017
+ }
1018
+ function qt() {
1019
+ if (!X()) return;
1020
+ let e = String(z.value.id ?? j.value ?? "");
1021
+ if (!e) return;
1022
+ let t = P.value === "create" ? "view" : P.value;
1023
+ Z({
1024
+ ...z.value,
1025
+ id: e
1026
+ }, t);
1027
+ }
1028
+ function Jt() {
1029
+ let e = String(J.externalChangedRecordId.value ?? z.value.id ?? j.value ?? "");
1030
+ e && (J.clearExternalChanged(), Z({
1031
+ ...z.value,
1032
+ id: e
1033
+ }, "edit"));
1034
+ }
1035
+ async function Yt() {
1036
+ await pe({
1037
+ loading: L,
1038
+ mode: P.value === "edit" ? "edit" : "create",
1039
+ source: "employee-management",
1040
+ validateContext: () => Y.value ? void 0 : "请先选择机构",
1041
+ canSave: () => ft.value,
1042
+ deniedMessage: "当前用户无权保存职员",
1043
+ createRecord: () => tn(z.value, Y.value ?? ""),
1044
+ validateRecord: nn,
1045
+ save: (e, t) => t === "edit" && M.value?.id ? c.crud.update(M.value.id, e) : c.crud.insert(e),
1046
+ actionErrorHandlers: [he({
1047
+ resourceLabel: "职员",
1048
+ onNavigateToRecycleBin: () => Pt("recycleBin")
1049
+ }), {
1050
+ code: p.conflictVersion,
1051
+ handle: (e, { mode: t, record: n }) => t === "edit" && J.markExternalRecordChanged(n.id)
1052
+ }],
1053
+ onSaved: ({ record: e }) => {
1054
+ let t = rn(e);
1055
+ _.value += 1, on(e, t);
1056
+ }
1057
+ });
1058
+ }
1059
+ async function Xt() {
1060
+ await d({
1061
+ loading: L,
1062
+ source: "employee-management",
1063
+ record: () => M.value && M.value.id ? M.value : void 0,
1064
+ canExecute: () => pt.value,
1065
+ deniedMessage: "当前用户无权变更职员启停状态",
1066
+ execute: (e) => e.enabled === !1 ? c.crud.enable(e.id, { version: e.version }) : c.crud.disable(e.id, { version: e.version }),
1067
+ onExecuted: async (e, t) => {
1068
+ let n = await c.crud.view(t.id);
1069
+ await on(n, rn(n)), _.value += 1;
1070
+ }
1071
+ });
1072
+ }
1073
+ async function Zt(e) {
1074
+ await d({
1075
+ loading: L,
1076
+ source: "employee-management",
1077
+ record: () => e?.id ? e : void 0,
1078
+ canExecute: () => c.can("delete") === !0,
1079
+ deniedMessage: "当前用户无权删除职员",
1080
+ confirm: (e) => re({
1081
+ title: "删除职员",
1082
+ content: `确认删除职员「${fn(e)}」?`,
1083
+ okText: "删除",
1084
+ danger: !0
1085
+ }),
1086
+ execute: (e) => c.crud.delete(String(e.id), { version: e.version }),
1087
+ onExecuted: (e, t) => {
1088
+ let n = String(t.id);
1089
+ j.value === n && (j.value = void 0, M.value = void 0, z.value = Qt(Y.value), J.clearExternalChanged(), F.value = !1, I.value = !1, R.value += 1, B.value = void 0, $(), N.value = !1, P.value = "view"), _.value += 1;
1090
+ }
1091
+ });
1092
+ }
1093
+ function Qt(e) {
1094
+ return {
1095
+ organizationId: e,
1096
+ enabled: !0,
1097
+ sortOrder: 100
1098
+ };
1099
+ }
1100
+ function $t(e) {
1101
+ return {
1102
+ username: yn(e),
1103
+ password: "",
1104
+ enabled: !0
1105
+ };
1106
+ }
1107
+ function en(e) {
1108
+ return { ...e };
1109
+ }
1110
+ function tn(e, t) {
1111
+ return ue(e, {
1112
+ organizationId: t,
1113
+ departmentId: e.departmentId?.trim(),
1114
+ employeeNo: e.employeeNo?.trim(),
1115
+ title: e.title?.trim(),
1116
+ gender: e.gender?.trim() || void 0,
1117
+ mobile: e.mobile?.trim() || void 0,
1118
+ email: e.email?.trim() || void 0,
1119
+ enabled: e.enabled !== !1
1120
+ });
1121
+ }
1122
+ function nn(e) {
1123
+ return Be(n.map((t) => {
1124
+ let n = St(t);
1125
+ return {
1126
+ fieldName: t,
1127
+ label: n.label,
1128
+ required: n.required,
1129
+ visible: n.visible,
1130
+ value: e[t]
1131
+ };
1132
+ }));
1133
+ }
1134
+ function rn(e) {
1135
+ M.value = e, z.value = en(e), j.value = e.id, P.value = "view", J.clearExternalChanged(), N.value = !0, F.value = !1, I.value = !1;
1136
+ let t = R.value + 1;
1137
+ return R.value = t, t;
1138
+ }
1139
+ function an(e) {
1140
+ M.value = e.selectedEmployee, j.value = e.selectedEmployee.id, T.value = e.organization, B.value = e.department, z.value = e.draft, P.value = e.mode, V.value = e.account, H.value = e.accountUser, K.value = e.showAccountProvisionForm, q.value = e.accountProvisionDraft, N.value = !0, F.value = !1, I.value = !1, G.value = !1, R.value += 1;
1141
+ }
1142
+ function Q(e, t) {
1143
+ return !!e && Ie({
1144
+ activeRequestSeq: R.value,
1145
+ requestSeq: t,
1146
+ selectedEmployeeKey: j.value,
1147
+ recordId: e ?? ""
1148
+ });
1149
+ }
1150
+ async function on(e, t = R.value) {
1151
+ B.value = void 0;
1152
+ let n = e.id, r = e.departmentId;
1153
+ if (r) try {
1154
+ let e = await ne.crud.view(r);
1155
+ Q(n, t) && (B.value = e);
1156
+ } catch (e) {
1157
+ Q(n, t) && i(e, {
1158
+ source: "employee-management",
1159
+ phase: "load"
1160
+ });
1161
+ }
1162
+ }
1163
+ async function sn(e, t = R.value) {
1164
+ let n = e.id, r = e.organizationId;
1165
+ if (r) try {
1166
+ let e = await s.crud.view(r);
1167
+ Q(n, t) && (T.value = e);
1168
+ } catch (e) {
1169
+ Q(n, t) && i(e, {
1170
+ source: "employee-management",
1171
+ phase: "load"
1172
+ });
1173
+ }
1174
+ }
1175
+ async function cn(e = M.value ?? z.value, t = R.value) {
1176
+ let n = e.id;
1177
+ if (!n) {
1178
+ $();
1179
+ return;
1180
+ }
1181
+ U.value = !0, G.value = !1;
1182
+ try {
1183
+ let e = await c.http.request({ path: `/iam.employee/${encodeURIComponent(n)}/account` });
1184
+ if (!Q(n, t)) return;
1185
+ V.value = e, await ln(e, n, t);
1186
+ } catch (e) {
1187
+ Q(n, t) && (G.value = !0, i(e, {
1188
+ source: "employee-management",
1189
+ phase: "load"
1190
+ }));
1191
+ } finally {
1192
+ Q(n, t) && (U.value = !1);
1193
+ }
1194
+ }
1195
+ async function ln(e, t, n) {
1196
+ let r = e?.userId;
1197
+ if (!r) {
1198
+ Q(t, n) && (H.value = void 0);
1199
+ return;
1200
+ }
1201
+ let a;
1202
+ try {
1203
+ a = await ae.crud.view(r);
1204
+ } catch (e) {
1205
+ i(e, {
1206
+ source: "employee-management",
1207
+ phase: "load"
1208
+ }), a = {
1209
+ id: r,
1210
+ username: r
1211
+ };
1212
+ }
1213
+ Q(t, n) && (H.value = a);
1214
+ }
1215
+ async function un() {
1216
+ let e = M.value, t = Sn(q.value);
1217
+ if (!e?.id || !mt.value) return;
1218
+ let n = Cn(t);
1219
+ if (n) {
1220
+ r(n, {
1221
+ source: "employee-management",
1222
+ phase: "validation"
1223
+ });
1224
+ return;
1225
+ }
1226
+ W.value = !0;
1227
+ try {
1228
+ let n = await c.http.request({
1229
+ method: "POST",
1230
+ path: `/iam.employee/${encodeURIComponent(e.id)}/account/provision`,
1231
+ body: t
1232
+ }), r = ee(n);
1233
+ V.value = r.binding, H.value = r.user, K.value = !1, q.value = $t(e), await le(n, {
1234
+ source: "employee-management",
1235
+ phase: "action"
1236
+ });
1237
+ } catch (e) {
1238
+ i(e, {
1239
+ source: "employee-management",
1240
+ phase: "action"
1241
+ });
1242
+ } finally {
1243
+ W.value = !1;
1244
+ }
1245
+ }
1246
+ async function dn() {
1247
+ let e = M.value;
1248
+ if (!(!e?.id || !V.value?.id || !mt.value) && await re({
1249
+ title: "移除账户",
1250
+ content: `确认移除账户「${gn()}」?该用户账号会同步删除。`,
1251
+ okText: "移除",
1252
+ danger: !0
1253
+ })) {
1254
+ W.value = !0;
1255
+ try {
1256
+ let t = await c.http.request({
1257
+ method: "POST",
1258
+ path: `/iam.employee/${encodeURIComponent(e.id)}/account/delete`
1259
+ });
1260
+ await cn(e, R.value), await le(t, {
1261
+ source: "employee-management",
1262
+ phase: "action"
1263
+ });
1264
+ } catch (e) {
1265
+ i(e, {
1266
+ source: "employee-management",
1267
+ phase: "action"
1268
+ });
1269
+ } finally {
1270
+ W.value = !1;
1271
+ }
1272
+ }
1273
+ }
1274
+ function $() {
1275
+ V.value = void 0, H.value = void 0, U.value = !1, W.value = !1, G.value = !1, K.value = !1, q.value = $t(M.value ?? z.value);
1276
+ }
1277
+ function fn(e) {
1278
+ return String(e?.title ?? e?.employeeNo ?? e?.id ?? "职员档案");
1279
+ }
1280
+ function pn(e) {
1281
+ return fn(e);
1282
+ }
1283
+ function mn(e) {
1284
+ let t = String(e?.employeeNo ?? "").trim();
1285
+ return t ? `工号:${t}` : void 0;
1286
+ }
1287
+ function hn(e) {
1288
+ return e.enabled === !1 ? "enable" : "disable";
1289
+ }
1290
+ function gn() {
1291
+ let e = V.value, t = H.value;
1292
+ return String(t?.username ?? e?.userId ?? "未设置账号");
1293
+ }
1294
+ function _n() {
1295
+ let e = H.value;
1296
+ return e?.id ? `账号ID ${e.id}` : "-";
1297
+ }
1298
+ function vn() {
1299
+ return H.value?.enabled === !1 ? "停用" : "启用";
1300
+ }
1301
+ function yn(e) {
1302
+ return String(e?.employeeNo ?? e?.mobile ?? "").trim().toLowerCase();
1303
+ }
1304
+ function bn() {
1305
+ q.value = $t(M.value ?? z.value), K.value = !0;
1306
+ }
1307
+ function xn() {
1308
+ K.value = !1, q.value = $t(M.value ?? z.value);
1309
+ }
1310
+ function Sn(e) {
1311
+ return {
1312
+ ...e,
1313
+ username: e.username?.trim(),
1314
+ password: e.password?.trim(),
1315
+ enabled: !0
1316
+ };
1317
+ }
1318
+ function Cn(e) {
1319
+ if (!e.username) return "请输入账号";
1320
+ if (!e.password) return "请输入初始密码";
1321
+ }
1322
+ function wn(e) {
1323
+ return e.title ?? e.code ?? e.id ?? "未命名部门";
1324
+ }
1325
+ function Tn(e) {
1326
+ return {
1327
+ title: e.title ?? e.code ?? e.id ?? "未命名机构",
1328
+ secondary: e.code ?? e.id,
1329
+ muted: e.enabled === !1
1330
+ };
1331
+ }
1332
+ let En = {
1333
+ organizationId: {
1334
+ label: "所属机构",
1335
+ required: !0,
1336
+ readOnly: !0,
1337
+ visible: !0
1338
+ },
1339
+ departmentId: {
1340
+ label: "所属部门",
1341
+ required: !0,
1342
+ readOnly: !1,
1343
+ visible: !0,
1344
+ controlType: "recordPicker"
1345
+ },
1346
+ employeeNo: {
1347
+ label: "职员编号",
1348
+ required: !0,
1349
+ readOnly: !1,
1350
+ visible: !0,
1351
+ placeholder: "请输入职员编号"
1352
+ },
1353
+ title: {
1354
+ label: "职员姓名",
1355
+ required: !0,
1356
+ readOnly: !1,
1357
+ visible: !0,
1358
+ placeholder: "请输入职员姓名"
1359
+ },
1360
+ gender: {
1361
+ label: "性别",
1362
+ required: !1,
1363
+ readOnly: !1,
1364
+ visible: !0,
1365
+ placeholder: "请输入性别"
1366
+ },
1367
+ mobile: {
1368
+ label: "手机号",
1369
+ required: !1,
1370
+ readOnly: !1,
1371
+ visible: !0,
1372
+ placeholder: "请输入手机号"
1373
+ },
1374
+ email: {
1375
+ label: "邮箱",
1376
+ required: !1,
1377
+ readOnly: !1,
1378
+ visible: !0,
1379
+ placeholder: "请输入邮箱"
1380
+ },
1381
+ enabled: {
1382
+ label: "启用状态",
1383
+ required: !1,
1384
+ readOnly: !1,
1385
+ visible: !0,
1386
+ controlType: "enabledStatus"
1387
+ }
1388
+ };
1389
+ return (e, t) => !l.value || h.value ? (E(), y(k(me), {
1390
+ key: 0,
1391
+ class: "employee-management-page"
1392
+ }, {
1393
+ default: A(() => [
1394
+ w(k(ge), null, {
1395
+ default: A(() => [w(k(ie), {
1396
+ class: "employee-scope-panel",
1397
+ title: "机构树",
1398
+ "refresh-title": "刷新机构树",
1399
+ "search-keyword": Ce.value,
1400
+ "search-placeholder": "搜索机构名称、编码或 ID",
1401
+ onRefresh: jt,
1402
+ "onUpdate:searchKeyword": t[0] ||= (e) => Ce.value = e
1403
+ }, {
1404
+ default: A(() => [w(k(fe), {
1405
+ context: k(s),
1406
+ "selected-id": T.value?.id,
1407
+ "reload-key": Te.value,
1408
+ keyword: Ce.value,
1409
+ "search-mode": "none",
1410
+ "search-trigger": "external",
1411
+ "empty-description": "暂无机构",
1412
+ "loading-tip": "加载机构树",
1413
+ "fallback-title": "未命名机构",
1414
+ "item-of": (e) => Tn(e),
1415
+ onLoaded: kt,
1416
+ onSelect: At
1417
+ }, null, 8, [
1418
+ "context",
1419
+ "selected-id",
1420
+ "reload-key",
1421
+ "keyword",
1422
+ "item-of"
1423
+ ])]),
1424
+ _: 1
1425
+ }, 8, ["search-keyword"])]),
1426
+ _: 1
1427
+ }),
1428
+ w(k(be), {
1429
+ class: "employee-list-panel",
1430
+ context: it.value,
1431
+ title: k(We).active.value ? "职员回收站" : "职员列表",
1432
+ mode: k(We).mode.value,
1433
+ "standard-crud-actions": "",
1434
+ "standard-crud-row-actions": "",
1435
+ "extra-row-actions-of": Rt,
1436
+ "selected-key": j.value,
1437
+ "expanded-row-keys": k(Ge),
1438
+ "reload-key": _.value,
1439
+ ready: !!T.value?.id,
1440
+ "external-query-values": st.value,
1441
+ "quick-search-placeholder": "搜索编号、姓名、手机号或邮箱",
1442
+ "empty-description": "当前机构暂无职员",
1443
+ "waiting-description": "请选择机构",
1444
+ onAction: Nt,
1445
+ onRowAction: Lt,
1446
+ onRowDblclick: Ht,
1447
+ onRowExpand: k(et),
1448
+ onSelect: Mt,
1449
+ onModeChange: Pt,
1450
+ onRestored: It
1451
+ }, {
1452
+ expandedRow: A(({ record: e }) => [w(k(se), {
1453
+ title: "任职信息",
1454
+ loading: k($e)(String(e.id ?? "")).loading,
1455
+ error: k($e)(String(e.id ?? "")).error,
1456
+ "loading-tip": "加载任职信息",
1457
+ "error-title": "任职信息加载失败"
1458
+ }, {
1459
+ actions: A(() => [w(k(m), {
1460
+ type: "text",
1461
+ "icon-name": "reload",
1462
+ disabled: k($e)(String(e.id ?? "")).loading,
1463
+ onClick: (t) => k(tt)(String(e.id ?? ""))
1464
+ }, {
1465
+ default: A(() => [...t[3] ||= [C(" 刷新 ", -1)]]),
1466
+ _: 1
1467
+ }, 8, ["disabled", "onClick"])]),
1468
+ default: A(() => [k($e)(String(e.id ?? "")).records.length === 0 ? (E(), x("p", Ze, "暂无任职信息")) : (E(), x("div", Qe, [t[4] ||= S("header", { class: "employee-row-employment-table-header" }, [
1469
+ S("span", null, "岗位"),
1470
+ S("span", null, "机构"),
1471
+ S("span", null, "部门"),
1472
+ S("span", null, "主岗位")
1473
+ ], -1), (E(!0), x(ke, null, Ne(k($e)(String(e.id ?? "")).records, (e) => (E(), x("article", {
1474
+ key: e.id,
1475
+ class: Ae({ "is-disabled": e.enabled === !1 })
1476
+ }, [
1477
+ S("strong", null, O(e.positionTitle ?? e.positionId), 1),
1478
+ S("span", null, O(e.organizationTitle ?? e.organizationId), 1),
1479
+ S("span", null, O(e.departmentTitle ?? e.departmentId), 1),
1480
+ S("span", null, O(e.primaryPosition ? "是" : "否"), 1)
1481
+ ], 2))), 128))]))]),
1482
+ _: 2
1483
+ }, 1032, ["loading", "error"])]),
1484
+ _: 1
1485
+ }, 8, [
1486
+ "context",
1487
+ "title",
1488
+ "mode",
1489
+ "selected-key",
1490
+ "expanded-row-keys",
1491
+ "reload-key",
1492
+ "ready",
1493
+ "external-query-values",
1494
+ "onRowExpand"
1495
+ ]),
1496
+ ye.value ? (E(), y(k(de), {
1497
+ key: 0,
1498
+ open: N.value,
1499
+ title: ct.value,
1500
+ subtitle: lt.value,
1501
+ "close-on-outside": P.value === "view",
1502
+ promotion: k(vt),
1503
+ onClose: Wt
1504
+ }, {
1505
+ status: A(() => [P.value === "view" && M.value ? (E(), y(k(te), {
1506
+ key: 0,
1507
+ enabled: M.value.enabled !== !1,
1508
+ disabled: L.value || !pt.value,
1509
+ loading: L.value,
1510
+ "show-label": !1,
1511
+ onChange: Xt
1512
+ }, null, 8, [
1513
+ "enabled",
1514
+ "disabled",
1515
+ "loading"
1516
+ ])) : b("v-if", !0)]),
1517
+ operation: A(() => [w(k(g), {
1518
+ context: it.value,
1519
+ actions: gt.value,
1520
+ onAction: Kt
1521
+ }, null, 8, ["context", "actions"])]),
1522
+ default: A(() => [w(Ke, {
1523
+ mode: P.value,
1524
+ draft: z.value,
1525
+ "selected-employee": M.value,
1526
+ "selected-organization": T.value,
1527
+ "detail-department": B.value,
1528
+ loading: F.value,
1529
+ "load-failed": I.value,
1530
+ "form-disabled": ut.value,
1531
+ "show-content": dt.value,
1532
+ fields: oe.value,
1533
+ fallback: En,
1534
+ "picker-configs": ot.value,
1535
+ "display-of": Ot,
1536
+ "visible-of": Tt,
1537
+ "label-of": Ct,
1538
+ "required-of": wt,
1539
+ "externally-changed": k(J).externallyChanged.value,
1540
+ account: V.value,
1541
+ "account-user": H.value,
1542
+ "loading-accounts": U.value,
1543
+ "accounts-load-failed": G.value,
1544
+ "saving-account": W.value,
1545
+ "can-manage-accounts": mt.value,
1546
+ "show-account-provision-form": K.value,
1547
+ "account-provision-draft": q.value,
1548
+ "account-user-title": gn(),
1549
+ "account-user-description": _n(),
1550
+ "account-status-title": vn(),
1551
+ "option-context": k(c),
1552
+ onRetry: qt,
1553
+ onSave: Yt,
1554
+ onReloadExternal: Jt,
1555
+ onDismissExternal: k(J).clearExternalChanged,
1556
+ onUpdateField: Et,
1557
+ onRetryAccounts: t[1] ||= (e) => cn(),
1558
+ onStartAccountProvision: bn,
1559
+ onCancelAccountProvision: xn,
1560
+ onProvisionAccount: un,
1561
+ onRemoveAccount: dn,
1562
+ onUpdateAccountProvisionField: Dt
1563
+ }, null, 8, [
1564
+ "mode",
1565
+ "draft",
1566
+ "selected-employee",
1567
+ "selected-organization",
1568
+ "detail-department",
1569
+ "loading",
1570
+ "load-failed",
1571
+ "form-disabled",
1572
+ "show-content",
1573
+ "fields",
1574
+ "picker-configs",
1575
+ "externally-changed",
1576
+ "account",
1577
+ "account-user",
1578
+ "loading-accounts",
1579
+ "accounts-load-failed",
1580
+ "saving-account",
1581
+ "can-manage-accounts",
1582
+ "show-account-provision-form",
1583
+ "account-provision-draft",
1584
+ "account-user-title",
1585
+ "account-user-description",
1586
+ "account-status-title",
1587
+ "option-context",
1588
+ "onDismissExternal"
1589
+ ])]),
1590
+ _: 1
1591
+ }, 8, [
1592
+ "open",
1593
+ "title",
1594
+ "subtitle",
1595
+ "close-on-outside",
1596
+ "promotion"
1597
+ ])) : b("v-if", !0),
1598
+ w(Ve, {
1599
+ open: He.value,
1600
+ employee: Ue.value,
1601
+ onClose: Bt,
1602
+ onSaved: Vt
1603
+ }, null, 8, ["open", "employee"])
1604
+ ]),
1605
+ _: 1
1606
+ })) : (E(), y(k(a), {
1607
+ key: 1,
1608
+ title: ct.value,
1609
+ subtitle: lt.value
1610
+ }, {
1611
+ status: A(() => [P.value === "view" && M.value ? (E(), y(k(te), {
1612
+ key: 0,
1613
+ enabled: M.value.enabled !== !1,
1614
+ disabled: L.value || !pt.value,
1615
+ loading: L.value,
1616
+ "show-label": !1,
1617
+ onChange: Xt
1618
+ }, null, 8, [
1619
+ "enabled",
1620
+ "disabled",
1621
+ "loading"
1622
+ ])) : b("v-if", !0)]),
1623
+ operation: A(() => [w(k(g), {
1624
+ context: k(c),
1625
+ actions: _t.value,
1626
+ "record-id": M.value?.id,
1627
+ onAction: Kt
1628
+ }, null, 8, [
1629
+ "context",
1630
+ "actions",
1631
+ "record-id"
1632
+ ])]),
1633
+ default: A(() => [w(Ke, {
1634
+ mode: P.value,
1635
+ draft: z.value,
1636
+ "selected-employee": M.value,
1637
+ "selected-organization": T.value,
1638
+ "detail-department": B.value,
1639
+ loading: F.value,
1640
+ "load-failed": I.value,
1641
+ "form-disabled": ut.value,
1642
+ "show-content": dt.value,
1643
+ fields: oe.value,
1644
+ fallback: En,
1645
+ "picker-configs": ot.value,
1646
+ "display-of": Ot,
1647
+ "visible-of": Tt,
1648
+ "label-of": Ct,
1649
+ "required-of": wt,
1650
+ "externally-changed": k(J).externallyChanged.value,
1651
+ account: V.value,
1652
+ "account-user": H.value,
1653
+ "loading-accounts": U.value,
1654
+ "accounts-load-failed": G.value,
1655
+ "saving-account": W.value,
1656
+ "can-manage-accounts": mt.value,
1657
+ "show-account-provision-form": K.value,
1658
+ "account-provision-draft": q.value,
1659
+ "account-user-title": gn(),
1660
+ "account-user-description": _n(),
1661
+ "account-status-title": vn(),
1662
+ "option-context": k(c),
1663
+ onRetry: qt,
1664
+ onSave: Yt,
1665
+ onReloadExternal: Jt,
1666
+ onDismissExternal: k(J).clearExternalChanged,
1667
+ onUpdateField: Et,
1668
+ onRetryAccounts: t[2] ||= (e) => cn(),
1669
+ onStartAccountProvision: bn,
1670
+ onCancelAccountProvision: xn,
1671
+ onProvisionAccount: un,
1672
+ onRemoveAccount: dn,
1673
+ onUpdateAccountProvisionField: Dt
1674
+ }, null, 8, [
1675
+ "mode",
1676
+ "draft",
1677
+ "selected-employee",
1678
+ "selected-organization",
1679
+ "detail-department",
1680
+ "loading",
1681
+ "load-failed",
1682
+ "form-disabled",
1683
+ "show-content",
1684
+ "fields",
1685
+ "picker-configs",
1686
+ "externally-changed",
1687
+ "account",
1688
+ "account-user",
1689
+ "loading-accounts",
1690
+ "accounts-load-failed",
1691
+ "saving-account",
1692
+ "can-manage-accounts",
1693
+ "show-account-provision-form",
1694
+ "account-provision-draft",
1695
+ "account-user-title",
1696
+ "account-user-description",
1697
+ "account-status-title",
1698
+ "option-context",
1699
+ "onDismissExternal"
1700
+ ])]),
1701
+ _: 1
1702
+ }, 8, ["title", "subtitle"]));
1703
+ }
1704
+ }), [["__scopeId", "data-v-8989b7cf"]]);
1705
+ //#endregion
1706
+ export { $e as t };