@rytass/bpm-core-react 0.15.0 → 0.17.0
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/CHANGELOG.md +86 -0
- package/README.md +54 -6
- package/dist/chunks/{FormBuilderView-CLg-JYmu.js → FormBuilderView-BYL42M0d.js} +13 -33
- package/dist/chunks/FormBuilderView-BYL42M0d.js.map +1 -0
- package/dist/chunks/FormBuilderView-aBcA-_tt.cjs +3 -0
- package/dist/chunks/FormBuilderView-aBcA-_tt.cjs.map +1 -0
- package/dist/chunks/FormRendererView-DRFi_IH7.cjs +4 -0
- package/dist/chunks/FormRendererView-DRFi_IH7.cjs.map +1 -0
- package/dist/chunks/{FormRendererView-DU9LLrOF.js → FormRendererView-cZGOOjU5.js} +319 -332
- package/dist/chunks/FormRendererView-cZGOOjU5.js.map +1 -0
- package/dist/chunks/{admin-pickers-DLlG_1du.js → admin-pickers-DxhzECkD.js} +52 -51
- package/dist/chunks/admin-pickers-DxhzECkD.js.map +1 -0
- package/dist/chunks/admin-pickers-qe3j--gX.cjs +2 -0
- package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +1 -0
- package/dist/chunks/approval-instance-list-page-CPXMP3PL.js.map +1 -1
- package/dist/chunks/approval-instance-list-page-ax0pm8bt.cjs.map +1 -1
- package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
- package/dist/chunks/auth-provider-B5oPmvk2.js.map +1 -1
- package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
- package/dist/chunks/bpm-form-field-Cao0rMol.js.map +1 -1
- package/dist/chunks/{categories-DGlxuC6X.js → categories-1gKxeEqw.js} +4 -10
- package/dist/chunks/categories-1gKxeEqw.js.map +1 -0
- package/dist/chunks/{categories-Yid05WAX.cjs → categories-DjENouRm.cjs} +2 -2
- package/dist/chunks/categories-DjENouRm.cjs.map +1 -0
- package/dist/chunks/{compose-BtQPBd1Q.js → compose-Crklayzy.js} +4 -4
- package/dist/chunks/compose-Crklayzy.js.map +1 -0
- package/dist/chunks/{compose-DZhTQOt4.cjs → compose-DZ7RKvUp.cjs} +2 -2
- package/dist/chunks/compose-DZ7RKvUp.cjs.map +1 -0
- package/dist/chunks/dashboard-page-BWQBSGDq.cjs +2 -0
- package/dist/chunks/dashboard-page-BWQBSGDq.cjs.map +1 -0
- package/dist/chunks/{dashboard-page-CeCLV1tp.js → dashboard-page-DdBvV6YI.js} +15 -16
- package/dist/chunks/dashboard-page-DdBvV6YI.js.map +1 -0
- package/dist/chunks/delegations-Ckf03icM.cjs +2 -0
- package/dist/chunks/delegations-Ckf03icM.cjs.map +1 -0
- package/dist/chunks/{delegations-DRupxJ4_.js → delegations-MxF3uJGW.js} +205 -215
- package/dist/chunks/delegations-MxF3uJGW.js.map +1 -0
- package/dist/chunks/delegations-V9HIe3_P.cjs +2 -0
- package/dist/chunks/delegations-V9HIe3_P.cjs.map +1 -0
- package/dist/chunks/{delegations-B8gLSt0i.js → delegations-xUt1tj8d.js} +168 -173
- package/dist/chunks/delegations-xUt1tj8d.js.map +1 -0
- package/dist/chunks/{designer-CrbBRPUU.js → designer-D9eFma1W.js} +1180 -1134
- package/dist/chunks/designer-D9eFma1W.js.map +1 -0
- package/dist/chunks/designer-sJGTGYOf.cjs +65 -0
- package/dist/chunks/designer-sJGTGYOf.cjs.map +1 -0
- package/dist/chunks/detail-DRCTnuKm.cjs +2 -0
- package/dist/chunks/detail-DRCTnuKm.cjs.map +1 -0
- package/dist/chunks/{detail-_c21WQla.js → detail-DScLf42P.js} +849 -836
- package/dist/chunks/detail-DScLf42P.js.map +1 -0
- package/dist/chunks/format-date-time-CB-LxzqT.js.map +1 -1
- package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
- package/dist/chunks/format-member-label-DudVI55w.js +13 -0
- package/dist/chunks/format-member-label-DudVI55w.js.map +1 -0
- package/dist/chunks/format-member-label-t7ANTF62.cjs +2 -0
- package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -0
- package/dist/chunks/login-AtVxZBsC.cjs.map +1 -1
- package/dist/chunks/login-C6qlTC6F.js.map +1 -1
- package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
- package/dist/chunks/notifications-DJ5wzCye.js.map +1 -1
- package/dist/chunks/{orgs-BpqVu5ka.js → orgs-CY0i1fie.js} +787 -766
- package/dist/chunks/orgs-CY0i1fie.js.map +1 -0
- package/dist/chunks/orgs-Dr0FFoZo.cjs +2 -0
- package/dist/chunks/orgs-Dr0FFoZo.cjs.map +1 -0
- package/dist/chunks/providers-DHtDZFNA.cjs.map +1 -1
- package/dist/chunks/providers-J5eyByQj.js.map +1 -1
- package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
- package/dist/chunks/router-adapter-DftlFTOd.js.map +1 -1
- package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
- package/dist/chunks/routes-config-yZbESPlw.js.map +1 -1
- package/dist/chunks/task-node-label-BF6UllxP.cjs.map +1 -1
- package/dist/chunks/task-node-label-CWZgOBj0.js.map +1 -1
- package/dist/chunks/use-bpm-member-D57LKe_u.js.map +1 -1
- package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
- package/dist/chunks/users-BCyePbwB.js +422 -0
- package/dist/chunks/users-BCyePbwB.js.map +1 -0
- package/dist/chunks/users-DVBJluFR.cjs +2 -0
- package/dist/chunks/users-DVBJluFR.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/format-member-label.d.ts +12 -0
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js.map +1 -1
- package/dist/next/workflow-chat-route.cjs.map +1 -1
- package/dist/next/workflow-chat-route.js.map +1 -1
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.cjs.map +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/admin/delegations/index.js.map +1 -1
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.cjs.map +1 -1
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/orgs/index.js.map +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.cjs.map +1 -1
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/admin/users/index.js.map +1 -1
- package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
- package/dist/pages/admin/webhook-endpoints/index.js.map +1 -1
- package/dist/pages/cc/index.cjs.map +1 -1
- package/dist/pages/cc/index.js.map +1 -1
- package/dist/pages/dashboard/index.cjs.map +1 -1
- package/dist/pages/dashboard/index.js.map +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.cjs.map +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/delegations/index.js.map +1 -1
- package/dist/pages/inbox/index.cjs.map +1 -1
- package/dist/pages/inbox/index.js.map +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.cjs.map +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/instances/detail/index.js.map +1 -1
- package/dist/pages/instances/new/index.cjs.map +1 -1
- package/dist/pages/instances/new/index.js.map +1 -1
- package/dist/pages/login/index.cjs.map +1 -1
- package/dist/pages/login/index.js.map +1 -1
- package/dist/pages/root/index.cjs.map +1 -1
- package/dist/pages/root/index.js.map +1 -1
- package/dist/pages/search/index.cjs.map +1 -1
- package/dist/pages/search/index.js.map +1 -1
- package/dist/pages/sent/index.cjs.map +1 -1
- package/dist/pages/sent/index.js.map +1 -1
- package/dist/pages/settings/notifications/index.cjs.map +1 -1
- package/dist/pages/settings/notifications/index.js.map +1 -1
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.cjs.map +1 -1
- package/dist/pages/templates/categories/index.js +1 -1
- package/dist/pages/templates/categories/index.js.map +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.cjs.map +1 -1
- package/dist/pages/templates/compose/index.js +1 -1
- package/dist/pages/templates/compose/index.js.map +1 -1
- package/dist/pages/templates/designer/index.cjs +1 -1
- package/dist/pages/templates/designer/index.cjs.map +1 -1
- package/dist/pages/templates/designer/index.js +1 -1
- package/dist/pages/templates/designer/index.js.map +1 -1
- package/dist/pages/templates/index.cjs.map +1 -1
- package/dist/pages/templates/index.js.map +1 -1
- package/dist/pages/templates/versions/index.cjs.map +1 -1
- package/dist/pages/templates/versions/index.js.map +1 -1
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -2
- package/dist/views/admin/index.cjs +1 -1
- package/dist/views/admin/index.js +3 -3
- package/dist/views/admin/orgs/index.cjs +1 -1
- package/dist/views/admin/orgs/index.js +1 -2
- package/dist/views/admin/users/MemberTaskReassignModal.d.ts +13 -0
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.js +1 -2
- package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
- package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
- package/dist/views/cc/index.cjs.map +1 -1
- package/dist/views/cc/index.js.map +1 -1
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.cjs.map +1 -1
- package/dist/views/dashboard/index.js +1 -1
- package/dist/views/dashboard/index.js.map +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -2
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -2
- package/dist/views/forms/renderer/index.cjs +1 -1
- package/dist/views/forms/renderer/index.js +1 -2
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +1 -5
- package/dist/views/inbox/index.js.map +1 -1
- package/dist/views/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -2
- package/dist/views/instances/index.js +1 -2
- package/dist/views/instances/new/index.cjs +1 -1
- package/dist/views/instances/new/index.cjs.map +1 -1
- package/dist/views/instances/new/index.js +4 -11
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/login/index.js +1 -2
- package/dist/views/search/index.cjs.map +1 -1
- package/dist/views/search/index.js.map +1 -1
- package/dist/views/sent/index.cjs.map +1 -1
- package/dist/views/sent/index.js.map +1 -1
- package/dist/views/settings/index.js +1 -2
- package/dist/views/settings/notifications/index.js +1 -2
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.js +1 -2
- package/dist/views/templates/compose/index.cjs +1 -1
- package/dist/views/templates/compose/index.js +1 -2
- package/dist/views/templates/designer/index.cjs +1 -1
- package/dist/views/templates/designer/index.js +1 -2
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.cjs.map +1 -1
- package/dist/views/templates/index.js +1 -1
- package/dist/views/templates/index.js.map +1 -1
- package/dist/views/templates/versions/index.cjs.map +1 -1
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunks/FormBuilderView-6bCbIkz6.cjs +0 -3
- package/dist/chunks/FormBuilderView-6bCbIkz6.cjs.map +0 -1
- package/dist/chunks/FormBuilderView-CLg-JYmu.js.map +0 -1
- package/dist/chunks/FormRendererView-DU9LLrOF.js.map +0 -1
- package/dist/chunks/FormRendererView-gctFIqwC.cjs +0 -4
- package/dist/chunks/FormRendererView-gctFIqwC.cjs.map +0 -1
- package/dist/chunks/admin-pickers-Btvij1at.cjs +0 -2
- package/dist/chunks/admin-pickers-Btvij1at.cjs.map +0 -1
- package/dist/chunks/admin-pickers-DLlG_1du.js.map +0 -1
- package/dist/chunks/categories-DGlxuC6X.js.map +0 -1
- package/dist/chunks/categories-Yid05WAX.cjs.map +0 -1
- package/dist/chunks/compose-BtQPBd1Q.js.map +0 -1
- package/dist/chunks/compose-DZhTQOt4.cjs.map +0 -1
- package/dist/chunks/dashboard-page-CeCLV1tp.js.map +0 -1
- package/dist/chunks/dashboard-page-DooFJsxM.cjs +0 -2
- package/dist/chunks/dashboard-page-DooFJsxM.cjs.map +0 -1
- package/dist/chunks/delegations-8LsxcQM4.cjs +0 -2
- package/dist/chunks/delegations-8LsxcQM4.cjs.map +0 -1
- package/dist/chunks/delegations-B8gLSt0i.js.map +0 -1
- package/dist/chunks/delegations-DRupxJ4_.js.map +0 -1
- package/dist/chunks/delegations-DlYwMiAW.cjs +0 -2
- package/dist/chunks/delegations-DlYwMiAW.cjs.map +0 -1
- package/dist/chunks/designer-CrbBRPUU.js.map +0 -1
- package/dist/chunks/designer-D3_lWmfa.cjs +0 -65
- package/dist/chunks/designer-D3_lWmfa.cjs.map +0 -1
- package/dist/chunks/detail-CVXb5Vy8.cjs +0 -2
- package/dist/chunks/detail-CVXb5Vy8.cjs.map +0 -1
- package/dist/chunks/detail-_c21WQla.js.map +0 -1
- package/dist/chunks/orgs-BpqVu5ka.js.map +0 -1
- package/dist/chunks/orgs-D0-5BaHT.cjs +0 -2
- package/dist/chunks/orgs-D0-5BaHT.cjs.map +0 -1
- package/dist/chunks/users-C9LA-Rd7.cjs +0 -2
- package/dist/chunks/users-C9LA-Rd7.cjs.map +0 -1
- package/dist/chunks/users-FWrb3ehW.js +0 -214
- package/dist/chunks/users-FWrb3ehW.js.map +0 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "./bpm-form-field-Cao0rMol.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t } from "./format-member-label-DudVI55w.js";
|
|
4
|
+
import { a as n, i as r, n as i, o as a, r as o, t as s } from "./admin-pickers-DxhzECkD.js";
|
|
4
5
|
import '../style.css';import '../orgs.css';/* empty css */
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { AutoComplete as
|
|
7
|
-
import { resolveMembers as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { FormFieldLayout as
|
|
10
|
-
import
|
|
11
|
-
import { CloseIcon as
|
|
12
|
-
import { commitOrgUnitTreeDraft as
|
|
13
|
-
import { Background as
|
|
14
|
-
import * as
|
|
6
|
+
import { forwardRef as c, useCallback as l, useEffect as u, useImperativeHandle as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
7
|
+
import { AutoComplete as h, Button as g, DatePicker as _, Filter as v, FilterArea as y, FilterLine as b, FormField as x, Input as S, Modal as C, PageHeader as w, Section as T, SectionGroup as E, Select as D, Tab as O, TabItem as k, Table as A, Typography as j } from "@mezzanine-ui/react";
|
|
8
|
+
import { resolveMembers as M } from "@rytass/bpm-core-client";
|
|
9
|
+
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
10
|
+
import { FormFieldLayout as I } from "@mezzanine-ui/core/form";
|
|
11
|
+
import L from "@mezzanine-ui/react/ContentHeader";
|
|
12
|
+
import { CloseIcon as R, EditIcon as ee, PlusIcon as z, SaveIcon as te } from "@mezzanine-ui/icons";
|
|
13
|
+
import { commitOrgUnitTreeDraft as ne, createManagerResolution as re, createMembership as ie, createOrgUnit as ae, createPosition as oe, deleteManagerResolution as se, deleteMembership as ce, deleteOrgUnit as le, deletePosition as ue, readOrgUnitRetirementImpact as de, readOrganizationDashboard as fe, updateManagerResolution as pe, updateMembership as me, updateOrgUnit as he, updatePosition as ge } from "@rytass/bpm-core-client/organization";
|
|
14
|
+
import { Background as _e, ConnectionMode as ve, Controls as ye, Handle as be, MiniMap as xe, Panel as Se, Position as B, ReactFlow as Ce, applyNodeChanges as we } from "@xyflow/react";
|
|
15
|
+
import * as Te from "dagre";
|
|
15
16
|
//#region src/lib/org-tree-draft.ts
|
|
16
|
-
function
|
|
17
|
+
function Ee(e) {
|
|
17
18
|
return new Map(e.map((e) => [e.id, e.parentId]));
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
let r = n === e ? e : n, i =
|
|
20
|
+
function De({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
21
|
+
let r = n === e ? e : n, i = ke({
|
|
21
22
|
orgUnitId: e,
|
|
22
23
|
parentDraft: t,
|
|
23
24
|
parentId: r
|
|
@@ -39,7 +40,7 @@ function Ce({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
|
39
40
|
status: "UPDATED"
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
+
function Oe({ orgUnits: e, parentDraft: t }) {
|
|
43
44
|
return e.map((e) => {
|
|
44
45
|
let n = t.get(e.id) ?? null;
|
|
45
46
|
return n === e.parentId ? null : {
|
|
@@ -49,14 +50,14 @@ function we({ orgUnits: e, parentDraft: t }) {
|
|
|
49
50
|
};
|
|
50
51
|
}).filter((e) => !!e);
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" :
|
|
53
|
+
function ke({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
54
|
+
return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" : Ae({
|
|
54
55
|
orgUnitId: e,
|
|
55
56
|
parentDraft: t,
|
|
56
57
|
parentId: n
|
|
57
58
|
}) ? "不可搬移到自己的下層組織。" : null : "找不到新的上層組織。" : null : "找不到要搬移的組織節點。";
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function Ae({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
60
61
|
let r = /* @__PURE__ */ new Set(), i = n;
|
|
61
62
|
for (; i;) {
|
|
62
63
|
if (i === e || r.has(i)) return !0;
|
|
@@ -64,7 +65,7 @@ function U({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
|
64
65
|
}
|
|
65
66
|
return !1;
|
|
66
67
|
}
|
|
67
|
-
var
|
|
68
|
+
var V = {
|
|
68
69
|
orgTreeEditor: "bpm_orgTreeEditor_TMOtD",
|
|
69
70
|
orgTreeSummary: "bpm_orgTreeSummary_vpcV8",
|
|
70
71
|
orgTreeChangeList: "bpm_orgTreeChangeList_EzmOv",
|
|
@@ -78,28 +79,28 @@ var W = {
|
|
|
78
79
|
orgTreeNodeHeader: "bpm_orgTreeNodeHeader_LEXl-",
|
|
79
80
|
orgTreeNodeBadge: "bpm_orgTreeNodeBadge_zLc7t",
|
|
80
81
|
orgTreeNodeActions: "bpm_orgTreeNodeActions_cMldI"
|
|
81
|
-
},
|
|
82
|
+
}, H = "__org-tree-root__", U = 232, je = 118, Me = 232, Ne = 86, Pe = 320, Fe = 1.4, Ie = .25, Le = .005, Re = 250, ze = 80, Be = .85, W = .7, Ve = 1200, He = 600, Ue = 96, We = {
|
|
82
83
|
COMPANY: "公司",
|
|
83
84
|
DEPARTMENT: "部門",
|
|
84
85
|
DIVISION: "事業群",
|
|
85
86
|
TEAM: "小組"
|
|
86
|
-
},
|
|
87
|
-
let [s,
|
|
87
|
+
}, Ge = { orgUnit: qe }, Ke = c(function({ onCreateChild: e, onCreateRoot: t, onEditOrgUnit: n, onSaveDraft: r, onStateChange: i, orgUnits: a }, o) {
|
|
88
|
+
let [s, c] = m(!1), [h, _] = m(null), [v, y] = m(null), [b, x] = m(() => Ee(a)), [S, C] = m(() => /* @__PURE__ */ new Set()), [w, T] = m(() => /* @__PURE__ */ new Map()), [E, D] = m([]), O = p(null), k = p(null), A = l((e) => {
|
|
88
89
|
k.current = e, C((t) => {
|
|
89
90
|
let n = new Set(t);
|
|
90
91
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
91
92
|
});
|
|
92
|
-
}, []), M =
|
|
93
|
-
k.current =
|
|
94
|
-
}, []),
|
|
95
|
-
k.current =
|
|
96
|
-
let e =
|
|
97
|
-
return new Set([...e.keys()].filter((e) => e !==
|
|
93
|
+
}, []), M = l(() => {
|
|
94
|
+
k.current = H, C(/* @__PURE__ */ new Set());
|
|
95
|
+
}, []), N = l(() => {
|
|
96
|
+
k.current = H, C(() => {
|
|
97
|
+
let e = Je(a, b);
|
|
98
|
+
return new Set([...e.keys()].filter((e) => e !== H));
|
|
98
99
|
});
|
|
99
|
-
}, [a, b]), I =
|
|
100
|
+
}, [a, b]), I = f(() => new Map(a.map((e) => [e.id, e])), [a]), L = f(() => Oe({
|
|
100
101
|
orgUnits: a,
|
|
101
102
|
parentDraft: b
|
|
102
|
-
}), [a, b]), R =
|
|
103
|
+
}), [a, b]), R = f(() => Xe({
|
|
103
104
|
collapsedIds: S,
|
|
104
105
|
isEditing: s,
|
|
105
106
|
measuredHeights: w,
|
|
@@ -110,14 +111,14 @@ var W = {
|
|
|
110
111
|
let t = I.get(e);
|
|
111
112
|
t && n(t);
|
|
112
113
|
},
|
|
113
|
-
onToggleCollapse:
|
|
114
|
+
onToggleCollapse: A,
|
|
114
115
|
orgUnits: a,
|
|
115
116
|
orgUnitsById: I,
|
|
116
117
|
parentDraft: b,
|
|
117
118
|
selectedOrgUnitId: v
|
|
118
119
|
}), [
|
|
119
120
|
S,
|
|
120
|
-
|
|
121
|
+
A,
|
|
121
122
|
s,
|
|
122
123
|
w,
|
|
123
124
|
e,
|
|
@@ -127,79 +128,75 @@ var W = {
|
|
|
127
128
|
I,
|
|
128
129
|
b,
|
|
129
130
|
v
|
|
130
|
-
]),
|
|
131
|
-
|
|
132
|
-
let
|
|
131
|
+
]), ee = p(R);
|
|
132
|
+
ee.current = R;
|
|
133
|
+
let z = L.length > 0, te = f(() => {
|
|
133
134
|
let e = Math.max(R.bounds.width, R.bounds.height);
|
|
134
|
-
return e <= 0 ?
|
|
135
|
-
}, [R.bounds.height, R.bounds.width]),
|
|
135
|
+
return e <= 0 ? Ie : Math.min(Ie, Math.max(Le, Re / e));
|
|
136
|
+
}, [R.bounds.height, R.bounds.width]), ne = a.length <= ze, re = l(() => {
|
|
136
137
|
let e = O.current;
|
|
137
138
|
if (!e) return;
|
|
138
|
-
let { bounds: t, rootCenter: n } =
|
|
139
|
-
if (!Number.isFinite(a) || a >=
|
|
139
|
+
let { bounds: t, rootCenter: n } = ee.current, r = t.width > 0 ? Ve / t.width : Infinity, i = t.height > 0 ? He / t.height : Infinity, a = Math.min(r, i);
|
|
140
|
+
if (!Number.isFinite(a) || a >= W) {
|
|
140
141
|
e.fitView({ padding: .18 });
|
|
141
142
|
return;
|
|
142
143
|
}
|
|
143
|
-
let o =
|
|
144
|
+
let o = He / (2 * Be);
|
|
144
145
|
e.setCenter(n.x, Math.min(t.height / 2, o), {
|
|
145
146
|
duration: 0,
|
|
146
|
-
zoom:
|
|
147
|
+
zoom: Be
|
|
147
148
|
});
|
|
148
|
-
}, []),
|
|
149
|
-
O.current = e,
|
|
150
|
-
}, [
|
|
151
|
-
|
|
152
|
-
cancelEditing:
|
|
153
|
-
saveDraft:
|
|
154
|
-
startEditing:
|
|
155
|
-
})),
|
|
149
|
+
}, []), ie = l((e) => {
|
|
150
|
+
O.current = e, re();
|
|
151
|
+
}, [re]);
|
|
152
|
+
d(o, () => ({
|
|
153
|
+
cancelEditing: ue,
|
|
154
|
+
saveDraft: de,
|
|
155
|
+
startEditing: le
|
|
156
|
+
})), u(() => {
|
|
156
157
|
i({
|
|
157
|
-
hasDraftChanges:
|
|
158
|
+
hasDraftChanges: z,
|
|
158
159
|
isEditing: s
|
|
159
160
|
});
|
|
160
161
|
}, [
|
|
161
|
-
|
|
162
|
+
z,
|
|
162
163
|
s,
|
|
163
164
|
i
|
|
164
|
-
]),
|
|
165
|
-
let e =
|
|
166
|
-
x(e), C(/* @__PURE__ */ new Set()), T(/* @__PURE__ */ new Map()), y(null), _(null),
|
|
167
|
-
}, [a]),
|
|
165
|
+
]), u(() => {
|
|
166
|
+
let e = Ee(a);
|
|
167
|
+
x(e), C(/* @__PURE__ */ new Set()), T(/* @__PURE__ */ new Map()), y(null), _(null), c(!1);
|
|
168
|
+
}, [a]), u(() => {
|
|
168
169
|
D(R.nodes);
|
|
169
|
-
}, [R.nodes]),
|
|
170
|
+
}, [R.nodes]), u(() => {
|
|
170
171
|
if (typeof window > "u") return () => void 0;
|
|
171
172
|
let e = window.requestAnimationFrame(() => {
|
|
172
|
-
|
|
173
|
+
re();
|
|
173
174
|
});
|
|
174
175
|
return () => window.cancelAnimationFrame(e);
|
|
175
|
-
}, [
|
|
176
|
+
}, [re, a]), u(() => {
|
|
176
177
|
let e = k.current;
|
|
177
178
|
if (!e) return;
|
|
178
179
|
k.current = null;
|
|
179
180
|
let t = O.current, n = R.nodes.find((t) => t.id === e);
|
|
180
|
-
t && n && t.setCenter(n.position.x + (n.width ??
|
|
181
|
+
t && n && t.setCenter(n.position.x + (n.width ?? U) / 2, n.position.y + (n.initialHeight ?? je) / 2, {
|
|
181
182
|
duration: 200,
|
|
182
183
|
zoom: t.getZoom()
|
|
183
184
|
});
|
|
184
185
|
}, [R.nodes]);
|
|
185
|
-
let
|
|
186
|
+
let ae = l((e, t) => {
|
|
186
187
|
x((n) => {
|
|
187
|
-
let r =
|
|
188
|
+
let r = De({
|
|
188
189
|
orgUnitId: e,
|
|
189
190
|
parentDraft: n,
|
|
190
191
|
parentId: t
|
|
191
192
|
});
|
|
192
193
|
return _(r.message), r.parentDraft;
|
|
193
194
|
});
|
|
194
|
-
}, []),
|
|
195
|
+
}, []), oe = l((e) => {
|
|
195
196
|
if (!s || !e.target || !e.source) return;
|
|
196
|
-
let t = e.source ===
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
re(e.target, t);
|
|
202
|
-
}, [re, s]), ae = c((e) => {
|
|
197
|
+
let t = e.source === H ? null : e.source;
|
|
198
|
+
e.target === H ? _("根節點不能搬移到其他節點下。") : ae(e.target, t);
|
|
199
|
+
}, [ae, s]), se = l((e) => {
|
|
203
200
|
let t = e.filter((e) => e.type === "dimensions" && e.dimensions);
|
|
204
201
|
t.length > 0 && T((e) => {
|
|
205
202
|
let n = new Map(e);
|
|
@@ -208,101 +205,93 @@ var W = {
|
|
|
208
205
|
let r = Math.ceil(t.dimensions.height);
|
|
209
206
|
return Math.abs((n.get(t.id) ?? 0) - r) <= 1 ? e : (n.set(t.id, r), !0);
|
|
210
207
|
}, !1) ? n : e;
|
|
211
|
-
}), s && D((t) =>
|
|
212
|
-
}, [s]),
|
|
213
|
-
if (!s || t.id ===
|
|
214
|
-
let r =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
re(t.id, r === G ? null : r);
|
|
220
|
-
}, [re, s]);
|
|
221
|
-
function se() {
|
|
222
|
-
m(!0), x(Se(a)), _("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
|
|
208
|
+
}), s && D((t) => we(e, [...t]));
|
|
209
|
+
}, [s]), ce = l((e, t, n) => {
|
|
210
|
+
if (!s || t.id === H) return;
|
|
211
|
+
let r = $e(e, t.id) ?? Qe(t, n);
|
|
212
|
+
r === void 0 ? _("拖曳到目標父節點附近,或從父節點拉線到子節點。") : ae(t.id, r === H ? null : r);
|
|
213
|
+
}, [ae, s]);
|
|
214
|
+
function le() {
|
|
215
|
+
c(!0), x(Ee(a)), _("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
|
|
223
216
|
}
|
|
224
|
-
function
|
|
225
|
-
|
|
217
|
+
function ue() {
|
|
218
|
+
c(!1), x(Ee(a)), _("已取消草稿變更。");
|
|
226
219
|
}
|
|
227
|
-
async function
|
|
228
|
-
|
|
229
|
-
_("批次儲存 API 尚未接上,草稿仍保留在前端。");
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
await r(L), m(!1), _("組織樹草稿已儲存。");
|
|
220
|
+
async function de() {
|
|
221
|
+
r ? (await r(L), c(!1), _("組織樹草稿已儲存。")) : _("批次儲存 API 尚未接上,草稿仍保留在前端。");
|
|
233
222
|
}
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
-
className:
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
-
className:
|
|
238
|
-
children: [/* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ F("div", {
|
|
224
|
+
className: V.orgTreeEditor,
|
|
225
|
+
children: [/* @__PURE__ */ F("div", {
|
|
226
|
+
className: V.orgTreeSummary,
|
|
227
|
+
children: [/* @__PURE__ */ P(j, {
|
|
239
228
|
color: "text-neutral",
|
|
240
229
|
variant: "caption",
|
|
241
|
-
children:
|
|
242
|
-
}),
|
|
243
|
-
className:
|
|
244
|
-
children: L.map((e) => /* @__PURE__ */
|
|
245
|
-
|
|
230
|
+
children: h ?? (z ? `目前有 ${L.length} 筆父子關係草稿變更。` : "目前沒有草稿變更。")
|
|
231
|
+
}), z ? /* @__PURE__ */ P("ul", {
|
|
232
|
+
className: V.orgTreeChangeList,
|
|
233
|
+
children: L.map((e) => /* @__PURE__ */ F("li", { children: [
|
|
234
|
+
at(e.orgUnitId, I),
|
|
246
235
|
":",
|
|
247
|
-
|
|
236
|
+
at(e.previousParentId, I),
|
|
248
237
|
" -> ",
|
|
249
|
-
|
|
238
|
+
at(e.parentId, I)
|
|
250
239
|
] }, e.orgUnitId))
|
|
251
240
|
}) : null]
|
|
252
|
-
}), /* @__PURE__ */
|
|
253
|
-
className:
|
|
254
|
-
children: /* @__PURE__ */
|
|
255
|
-
connectionMode:
|
|
241
|
+
}), /* @__PURE__ */ P("div", {
|
|
242
|
+
className: V.orgTreeCanvas,
|
|
243
|
+
children: /* @__PURE__ */ F(Ce, {
|
|
244
|
+
connectionMode: ve.Strict,
|
|
256
245
|
edges: [...R.edges],
|
|
257
246
|
fitViewOptions: {
|
|
258
|
-
minZoom:
|
|
247
|
+
minZoom: te,
|
|
259
248
|
padding: .18
|
|
260
249
|
},
|
|
261
|
-
isValidConnection: (e) =>
|
|
250
|
+
isValidConnection: (e) => it({
|
|
262
251
|
source: e.source,
|
|
263
252
|
target: e.target
|
|
264
253
|
}, b),
|
|
265
|
-
maxZoom:
|
|
266
|
-
minZoom:
|
|
267
|
-
nodeTypes:
|
|
254
|
+
maxZoom: Fe,
|
|
255
|
+
minZoom: te,
|
|
256
|
+
nodeTypes: Ge,
|
|
268
257
|
nodes: [...E],
|
|
269
258
|
nodesConnectable: s,
|
|
270
259
|
nodesDraggable: s,
|
|
271
|
-
onConnect:
|
|
272
|
-
onInit:
|
|
260
|
+
onConnect: oe,
|
|
261
|
+
onInit: ie,
|
|
273
262
|
onNodeClick: (e, t) => {
|
|
274
|
-
y(t.id ===
|
|
263
|
+
y(t.id === H ? null : t.id);
|
|
275
264
|
},
|
|
276
265
|
onNodeDoubleClick: (e, t) => {
|
|
277
|
-
if (t.id !==
|
|
266
|
+
if (t.id !== H) {
|
|
278
267
|
let e = I.get(t.id);
|
|
279
268
|
e && n(e);
|
|
280
269
|
}
|
|
281
270
|
},
|
|
282
|
-
onNodeDragStop:
|
|
283
|
-
onNodesChange:
|
|
271
|
+
onNodeDragStop: ce,
|
|
272
|
+
onNodesChange: se,
|
|
284
273
|
onPaneClick: () => y(null),
|
|
285
274
|
panOnDrag: !0,
|
|
286
275
|
proOptions: { hideAttribution: !0 },
|
|
287
276
|
children: [
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
className: `${
|
|
277
|
+
/* @__PURE__ */ P(_e, {}),
|
|
278
|
+
/* @__PURE__ */ P(ye, {}),
|
|
279
|
+
/* @__PURE__ */ F(Se, {
|
|
280
|
+
className: `${V.orgTreePanel} nopan nodrag`,
|
|
292
281
|
position: "top-right",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ P(g, {
|
|
294
283
|
onClick: M,
|
|
295
284
|
size: "sub",
|
|
296
285
|
variant: "base-secondary",
|
|
297
286
|
children: "全部展開"
|
|
298
|
-
}), /* @__PURE__ */
|
|
299
|
-
onClick:
|
|
287
|
+
}), /* @__PURE__ */ P(g, {
|
|
288
|
+
onClick: N,
|
|
300
289
|
size: "sub",
|
|
301
290
|
variant: "base-secondary",
|
|
302
291
|
children: "全部收合"
|
|
303
292
|
})]
|
|
304
293
|
}),
|
|
305
|
-
|
|
294
|
+
ne ? /* @__PURE__ */ P(xe, {
|
|
306
295
|
pannable: !0,
|
|
307
296
|
zoomable: !0
|
|
308
297
|
}) : null
|
|
@@ -311,42 +300,42 @@ var W = {
|
|
|
311
300
|
})]
|
|
312
301
|
});
|
|
313
302
|
});
|
|
314
|
-
function
|
|
315
|
-
return /* @__PURE__ */
|
|
303
|
+
function qe({ data: e, selected: t }) {
|
|
304
|
+
return /* @__PURE__ */ F("div", {
|
|
316
305
|
className: [
|
|
317
|
-
|
|
318
|
-
e.isSyntheticRoot ?
|
|
319
|
-
e.changed ?
|
|
320
|
-
e.deleted ?
|
|
321
|
-
t ?
|
|
306
|
+
V.orgTreeNode,
|
|
307
|
+
e.isSyntheticRoot ? V.orgTreeNodeRoot : "",
|
|
308
|
+
e.changed ? V.orgTreeNodeChanged : "",
|
|
309
|
+
e.deleted ? V.orgTreeNodeDeleted : "",
|
|
310
|
+
t ? V.orgTreeNodeSelected : ""
|
|
322
311
|
].filter(Boolean).join(" "),
|
|
323
312
|
children: [
|
|
324
|
-
e.isSyntheticRoot ? null : /* @__PURE__ */
|
|
313
|
+
e.isSyntheticRoot ? null : /* @__PURE__ */ P(be, {
|
|
325
314
|
id: "target",
|
|
326
315
|
isConnectable: e.isEditing,
|
|
327
|
-
position:
|
|
316
|
+
position: B.Top,
|
|
328
317
|
type: "target"
|
|
329
318
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ P(be, {
|
|
331
320
|
id: "source",
|
|
332
321
|
isConnectable: e.isEditing,
|
|
333
|
-
position:
|
|
322
|
+
position: B.Bottom,
|
|
334
323
|
type: "source"
|
|
335
324
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
className:
|
|
338
|
-
children: [/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ F("div", {
|
|
326
|
+
className: V.orgTreeNodeHeader,
|
|
327
|
+
children: [/* @__PURE__ */ P(j, {
|
|
339
328
|
component: "span",
|
|
340
329
|
ellipsis: !0,
|
|
341
330
|
title: e.name,
|
|
342
331
|
variant: "label-primary",
|
|
343
332
|
children: e.name
|
|
344
|
-
}), e.changed ? /* @__PURE__ */
|
|
345
|
-
className:
|
|
333
|
+
}), e.changed ? /* @__PURE__ */ P("span", {
|
|
334
|
+
className: V.orgTreeNodeBadge,
|
|
346
335
|
children: "草稿"
|
|
347
336
|
}) : null]
|
|
348
337
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ P(j, {
|
|
350
339
|
color: "text-neutral",
|
|
351
340
|
component: "span",
|
|
352
341
|
ellipsis: !0,
|
|
@@ -354,7 +343,7 @@ function He({ data: e, selected: t }) {
|
|
|
354
343
|
variant: "caption",
|
|
355
344
|
children: e.isSyntheticRoot ? "根節點容器" : `${e.typeLabel} · ${e.code}`
|
|
356
345
|
}),
|
|
357
|
-
e.isSyntheticRoot ? null : /* @__PURE__ */
|
|
346
|
+
e.isSyntheticRoot ? null : /* @__PURE__ */ F(j, {
|
|
358
347
|
color: "text-neutral",
|
|
359
348
|
component: "span",
|
|
360
349
|
ellipsis: !0,
|
|
@@ -362,24 +351,24 @@ function He({ data: e, selected: t }) {
|
|
|
362
351
|
variant: "caption",
|
|
363
352
|
children: ["上層:", e.parentLabel]
|
|
364
353
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
-
className: `${
|
|
367
|
-
children: [e.childCount > 0 ? /* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ F("div", {
|
|
355
|
+
className: `${V.orgTreeNodeActions} nodrag nopan`,
|
|
356
|
+
children: [e.childCount > 0 ? /* @__PURE__ */ P(g, {
|
|
368
357
|
onClick: (t) => {
|
|
369
|
-
t.stopPropagation(), e.onToggleCollapse(e.orgUnitId ??
|
|
358
|
+
t.stopPropagation(), e.onToggleCollapse(e.orgUnitId ?? H);
|
|
370
359
|
},
|
|
371
360
|
size: "sub",
|
|
372
361
|
variant: "base-secondary",
|
|
373
362
|
children: e.collapsed ? `展開 (${e.childCount})` : `收合 (${e.childCount})`
|
|
374
|
-
}) : null, e.isSyntheticRoot ? /* @__PURE__ */
|
|
363
|
+
}) : null, e.isSyntheticRoot ? /* @__PURE__ */ P(g, {
|
|
375
364
|
icon: z,
|
|
376
365
|
iconType: "leading",
|
|
377
366
|
onClick: () => e.onCreateChild(null),
|
|
378
367
|
size: "sub",
|
|
379
368
|
variant: "base-secondary",
|
|
380
369
|
children: "新增根節點"
|
|
381
|
-
}) : /* @__PURE__ */
|
|
382
|
-
icon:
|
|
370
|
+
}) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(g, {
|
|
371
|
+
icon: ee,
|
|
383
372
|
iconType: "leading",
|
|
384
373
|
onClick: () => {
|
|
385
374
|
e.orgUnitId && e.onEdit(e.orgUnitId);
|
|
@@ -387,7 +376,7 @@ function He({ data: e, selected: t }) {
|
|
|
387
376
|
size: "sub",
|
|
388
377
|
variant: "base-secondary",
|
|
389
378
|
children: "編輯"
|
|
390
|
-
}), /* @__PURE__ */
|
|
379
|
+
}), /* @__PURE__ */ P(g, {
|
|
391
380
|
icon: z,
|
|
392
381
|
iconType: "leading",
|
|
393
382
|
onClick: () => e.onCreateChild(e.orgUnitId),
|
|
@@ -399,57 +388,57 @@ function He({ data: e, selected: t }) {
|
|
|
399
388
|
]
|
|
400
389
|
});
|
|
401
390
|
}
|
|
402
|
-
function
|
|
391
|
+
function Je(e, t) {
|
|
403
392
|
let n = /* @__PURE__ */ new Map();
|
|
404
393
|
return e.forEach((e) => {
|
|
405
|
-
let r = t.get(e.id) ??
|
|
394
|
+
let r = t.get(e.id) ?? H;
|
|
406
395
|
n.set(r, [...n.get(r) ?? [], e.id]);
|
|
407
396
|
}), n;
|
|
408
397
|
}
|
|
409
|
-
function
|
|
398
|
+
function Ye({ childrenMap: e, collapsedIds: t }) {
|
|
410
399
|
let n = /* @__PURE__ */ new Set(), r = (i) => {
|
|
411
400
|
t.has(i) || (e.get(i) ?? []).forEach((e) => {
|
|
412
401
|
n.add(e), r(e);
|
|
413
402
|
});
|
|
414
403
|
};
|
|
415
|
-
return r(
|
|
404
|
+
return r(H), n;
|
|
416
405
|
}
|
|
417
|
-
function
|
|
418
|
-
let u =
|
|
406
|
+
function Xe({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild: r, onEditOrgUnit: i, onToggleCollapse: a, orgUnits: o, orgUnitsById: s, parentDraft: c, selectedOrgUnitId: l }) {
|
|
407
|
+
let u = Je(o, c), d = Ye({
|
|
419
408
|
childrenMap: u,
|
|
420
409
|
collapsedIds: e
|
|
421
|
-
}), f = o.filter((e) => d.has(e.id)), p = (e) => u.get(e)?.length ?? 0, m = (e, t) => Math.max(t, n.get(e) ?? 0), h = new
|
|
410
|
+
}), f = o.filter((e) => d.has(e.id)), p = (e) => u.get(e)?.length ?? 0, m = (e, t) => Math.max(t, n.get(e) ?? 0), h = new Te.graphlib.Graph();
|
|
422
411
|
h.setDefaultEdgeLabel(() => ({})), h.setGraph({
|
|
423
412
|
marginx: 36,
|
|
424
413
|
marginy: 36,
|
|
425
414
|
nodesep: 44,
|
|
426
415
|
rankdir: "TB",
|
|
427
|
-
ranksep:
|
|
428
|
-
}), h.setNode(
|
|
429
|
-
height: m(
|
|
430
|
-
width:
|
|
416
|
+
ranksep: Ue
|
|
417
|
+
}), h.setNode(H, {
|
|
418
|
+
height: m(H, Ne),
|
|
419
|
+
width: Me
|
|
431
420
|
}), f.forEach((e) => {
|
|
432
421
|
h.setNode(e.id, {
|
|
433
|
-
height: m(e.id,
|
|
434
|
-
width:
|
|
422
|
+
height: m(e.id, je),
|
|
423
|
+
width: U
|
|
435
424
|
});
|
|
436
425
|
}), f.forEach((e) => {
|
|
437
426
|
let t = c.get(e.id) ?? null;
|
|
438
|
-
h.setEdge(t ??
|
|
439
|
-
}),
|
|
427
|
+
h.setEdge(t ?? H, e.id);
|
|
428
|
+
}), Te.layout(h);
|
|
440
429
|
let g = h.graph(), _ = {
|
|
441
430
|
height: g.height ?? 0,
|
|
442
431
|
width: g.width ?? 0
|
|
443
|
-
}, v = h.node(
|
|
432
|
+
}, v = h.node(H), y = {
|
|
444
433
|
x: _.width > 0 ? _.width / 2 : v?.x ?? 0,
|
|
445
434
|
y: v?.y ?? 0
|
|
446
435
|
}, b = {
|
|
447
|
-
...
|
|
436
|
+
...Ze({
|
|
448
437
|
data: {
|
|
449
438
|
changed: !1,
|
|
450
|
-
childCount: p(
|
|
451
|
-
code:
|
|
452
|
-
collapsed: e.has(
|
|
439
|
+
childCount: p(H),
|
|
440
|
+
code: H,
|
|
441
|
+
collapsed: e.has(H),
|
|
453
442
|
deleted: !1,
|
|
454
443
|
isEditing: t,
|
|
455
444
|
isSyntheticRoot: !0,
|
|
@@ -463,18 +452,18 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
463
452
|
typeLabel: ""
|
|
464
453
|
},
|
|
465
454
|
graph: h,
|
|
466
|
-
height: m(
|
|
467
|
-
id:
|
|
455
|
+
height: m(H, Ne),
|
|
456
|
+
id: H,
|
|
468
457
|
selected: l === null,
|
|
469
|
-
width:
|
|
458
|
+
width: Me
|
|
470
459
|
}),
|
|
471
460
|
position: {
|
|
472
|
-
x: y.x -
|
|
473
|
-
y: y.y - m(
|
|
461
|
+
x: y.x - Me / 2,
|
|
462
|
+
y: y.y - m(H, Ne) / 2
|
|
474
463
|
}
|
|
475
464
|
}, x = f.map((n) => {
|
|
476
|
-
let o = c.get(n.id) ?? null, u =
|
|
477
|
-
return
|
|
465
|
+
let o = c.get(n.id) ?? null, u = at(o, s);
|
|
466
|
+
return Ze({
|
|
478
467
|
data: {
|
|
479
468
|
changed: o !== n.parentId,
|
|
480
469
|
childCount: p(n.id),
|
|
@@ -490,13 +479,13 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
490
479
|
orgUnitId: n.id,
|
|
491
480
|
parentLabel: u,
|
|
492
481
|
path: n.path,
|
|
493
|
-
typeLabel:
|
|
482
|
+
typeLabel: ot(n.type)
|
|
494
483
|
},
|
|
495
484
|
graph: h,
|
|
496
|
-
height: m(n.id,
|
|
485
|
+
height: m(n.id, je),
|
|
497
486
|
id: n.id,
|
|
498
487
|
selected: l === n.id,
|
|
499
|
-
width:
|
|
488
|
+
width: U
|
|
500
489
|
});
|
|
501
490
|
});
|
|
502
491
|
return {
|
|
@@ -507,7 +496,7 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
507
496
|
animated: t && r,
|
|
508
497
|
data: {},
|
|
509
498
|
id: `org-tree-edge-${n ?? "root"}-${e.id}`,
|
|
510
|
-
source: n ??
|
|
499
|
+
source: n ?? H,
|
|
511
500
|
sourceHandle: "source",
|
|
512
501
|
style: r ? {
|
|
513
502
|
stroke: "var(--mzn-color-primary, #0057ff)",
|
|
@@ -522,7 +511,7 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
522
511
|
rootCenter: y
|
|
523
512
|
};
|
|
524
513
|
}
|
|
525
|
-
function
|
|
514
|
+
function Ze({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
|
|
526
515
|
let o = t.node(r);
|
|
527
516
|
return {
|
|
528
517
|
data: e,
|
|
@@ -537,21 +526,21 @@ function Ke({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
|
|
|
537
526
|
y: 0
|
|
538
527
|
},
|
|
539
528
|
selected: i,
|
|
540
|
-
sourcePosition:
|
|
541
|
-
targetPosition:
|
|
529
|
+
sourcePosition: B.Bottom,
|
|
530
|
+
targetPosition: B.Top,
|
|
542
531
|
type: "orgUnit",
|
|
543
532
|
width: a
|
|
544
533
|
};
|
|
545
534
|
}
|
|
546
|
-
function
|
|
547
|
-
let n =
|
|
535
|
+
function Qe(e, t) {
|
|
536
|
+
let n = nt(e);
|
|
548
537
|
return t.filter((t) => t.id !== e.id).map((e) => ({
|
|
549
|
-
distance:
|
|
538
|
+
distance: rt(n, nt(e)),
|
|
550
539
|
id: e.id
|
|
551
|
-
})).filter((e) => e.distance <=
|
|
540
|
+
})).filter((e) => e.distance <= Pe).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
552
541
|
}
|
|
553
|
-
function
|
|
554
|
-
let n =
|
|
542
|
+
function $e(e, t) {
|
|
543
|
+
let n = et(e);
|
|
555
544
|
if (n) return Array.from(document.querySelectorAll(".react-flow__node[data-id]")).map((e) => {
|
|
556
545
|
let r = e.dataset.id;
|
|
557
546
|
if (!r || r === t) return null;
|
|
@@ -560,45 +549,45 @@ function Je(e, t) {
|
|
|
560
549
|
y: i.top + i.height / 2
|
|
561
550
|
};
|
|
562
551
|
return {
|
|
563
|
-
distance:
|
|
552
|
+
distance: rt(n, a),
|
|
564
553
|
id: r
|
|
565
554
|
};
|
|
566
|
-
}).filter((e) => !!e).filter((e) => e.distance <=
|
|
555
|
+
}).filter((e) => !!e).filter((e) => e.distance <= Pe).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
567
556
|
}
|
|
568
|
-
function
|
|
569
|
-
return
|
|
557
|
+
function et(e) {
|
|
558
|
+
return tt(e) ? {
|
|
570
559
|
x: e.clientX,
|
|
571
560
|
y: e.clientY
|
|
572
561
|
} : null;
|
|
573
562
|
}
|
|
574
|
-
function
|
|
563
|
+
function tt(e) {
|
|
575
564
|
return typeof e == "object" && !!e && "clientX" in e && "clientY" in e && typeof e.clientX == "number" && typeof e.clientY == "number";
|
|
576
565
|
}
|
|
577
|
-
function
|
|
566
|
+
function nt(e) {
|
|
578
567
|
return {
|
|
579
|
-
x: e.position.x + (e.width ??
|
|
580
|
-
y: e.position.y + (e.measured?.height ?? e.initialHeight ??
|
|
568
|
+
x: e.position.x + (e.width ?? U) / 2,
|
|
569
|
+
y: e.position.y + (e.measured?.height ?? e.initialHeight ?? je) / 2
|
|
581
570
|
};
|
|
582
571
|
}
|
|
583
|
-
function
|
|
572
|
+
function rt(e, t) {
|
|
584
573
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
585
574
|
}
|
|
586
|
-
function
|
|
587
|
-
return !e.source || !e.target || e.target ===
|
|
575
|
+
function it(e, t) {
|
|
576
|
+
return !e.source || !e.target || e.target === H ? !1 : ke({
|
|
588
577
|
orgUnitId: e.target,
|
|
589
578
|
parentDraft: t,
|
|
590
|
-
parentId: e.source ===
|
|
579
|
+
parentId: e.source === H ? null : e.source
|
|
591
580
|
}) === null;
|
|
592
581
|
}
|
|
593
|
-
function
|
|
582
|
+
function at(e, t) {
|
|
594
583
|
if (!e) return "根節點";
|
|
595
584
|
let n = t.get(e);
|
|
596
585
|
return n ? `${n.name} · ${n.code}` : "未知組織";
|
|
597
586
|
}
|
|
598
|
-
function
|
|
599
|
-
return
|
|
587
|
+
function ot(e) {
|
|
588
|
+
return We[e.toUpperCase()] ?? "未知類型";
|
|
600
589
|
}
|
|
601
|
-
var
|
|
590
|
+
var G = {
|
|
602
591
|
tableIntroActions: "bpm_tableIntroActions_WO4XU",
|
|
603
592
|
modalFields: "bpm_modalFields_juyv6",
|
|
604
593
|
tableIntro: "bpm_tableIntro_u3hcm",
|
|
@@ -606,10 +595,10 @@ var J = {
|
|
|
606
595
|
orgFilterArea: "bpm_orgFilterArea_Xjbbp",
|
|
607
596
|
membershipFilterArea: "bpm_membershipFilterArea_zob-Y",
|
|
608
597
|
scopeLabel: "bpm_scopeLabel_TLHMC"
|
|
609
|
-
},
|
|
598
|
+
}, K = {
|
|
610
599
|
hasDraftChanges: !1,
|
|
611
600
|
isEditing: !1
|
|
612
|
-
},
|
|
601
|
+
}, st = 100, q = [
|
|
613
602
|
{
|
|
614
603
|
id: "COMPANY",
|
|
615
604
|
name: "公司"
|
|
@@ -626,10 +615,10 @@ var J = {
|
|
|
626
615
|
id: "TEAM",
|
|
627
616
|
name: "小組"
|
|
628
617
|
}
|
|
629
|
-
],
|
|
618
|
+
], ct = {
|
|
630
619
|
id: "ALL",
|
|
631
620
|
name: "全部類型"
|
|
632
|
-
},
|
|
621
|
+
}, J = [ct, ...q], Y = [
|
|
633
622
|
{
|
|
634
623
|
id: "MEMBER",
|
|
635
624
|
name: "指定會員"
|
|
@@ -642,18 +631,18 @@ var J = {
|
|
|
642
631
|
id: "POSITION",
|
|
643
632
|
name: "指定職位"
|
|
644
633
|
}
|
|
645
|
-
],
|
|
634
|
+
], lt = {
|
|
646
635
|
id: "ALL",
|
|
647
636
|
name: "全部範圍"
|
|
648
|
-
},
|
|
637
|
+
}, ut = [lt, ...Y], dt = {
|
|
649
638
|
activeOnly: !1,
|
|
650
639
|
id: "ALL",
|
|
651
640
|
name: "全部狀態"
|
|
652
|
-
},
|
|
641
|
+
}, ft = [dt, {
|
|
653
642
|
activeOnly: !0,
|
|
654
643
|
id: "ACTIVE",
|
|
655
644
|
name: "目前有效"
|
|
656
|
-
}],
|
|
645
|
+
}], X = [{
|
|
657
646
|
id: "true",
|
|
658
647
|
name: "主要歸屬",
|
|
659
648
|
value: !0
|
|
@@ -661,107 +650,116 @@ var J = {
|
|
|
661
650
|
id: "false",
|
|
662
651
|
name: "一般歸屬",
|
|
663
652
|
value: !1
|
|
664
|
-
}],
|
|
653
|
+
}], pt = [
|
|
665
654
|
10,
|
|
666
655
|
20,
|
|
667
656
|
50
|
|
668
|
-
],
|
|
669
|
-
function
|
|
670
|
-
let [
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
}, [
|
|
674
|
-
|
|
675
|
-
|
|
657
|
+
], mt = 1368, ht = 948, gt = 1292, Z = 1124;
|
|
658
|
+
function _t() {
|
|
659
|
+
let [t, n] = m("ORG_UNITS"), [r, a] = m(null), [o, s] = m(null), [c, d] = m(null), [p, h] = m(!0), [g, _] = m(null), [v, y] = m(dt), [b, x] = m(1), [S, D] = m(10), [A, I] = m(lt), [R, ee] = m(0), [z, te] = m([]), [_e, ve] = m(null), [ye, be] = m(null), [xe, Se] = m(null), [B, Ce] = m(1), [we, Te] = m(10), [Ee, De] = m(null), [Oe, ke] = m(0), [Ae, V] = m(null), [H, U] = m(1), [je, Me] = m(10), [Ne, Pe] = m(""), [Fe, Ie] = m(0), [Le, Re] = m(ct), [ze, Be] = m("TABLE"), [W, Ve] = m([]), [He, Ue] = m([]), [We, Ge] = m([]), [Ke, qe] = m(null), [Je, Ye] = m(1), [Xe, Ze] = m(10), [Qe, $e] = m(""), [et, tt] = m(0), [nt, rt] = m([]), [it, at] = m([]), [ot, G] = m([]), [K, q] = m(!1), [J, Y] = m(null), [ut, ft] = m(null);
|
|
660
|
+
u(() => {
|
|
661
|
+
r && s(r);
|
|
662
|
+
}, [r]), u(() => {
|
|
663
|
+
let e = !1;
|
|
664
|
+
return Y(null), ft(null), r?.type === "ORG_UNIT" && de(r.id).then((t) => {
|
|
665
|
+
e || Y(t);
|
|
666
|
+
}).catch((t) => {
|
|
667
|
+
e || d(en(t));
|
|
668
|
+
}), () => {
|
|
669
|
+
e = !0;
|
|
670
|
+
};
|
|
671
|
+
}, [r]);
|
|
672
|
+
let X = r?.type === "ORG_UNIT", pt = X && J !== null && (J.openMembershipCount > 0 || J.openManagerResolutionCount > 0), mt = X && (J === null || J.childUnitCount > 0 || pt && !ut), ht = r ?? o, gt = l(async () => {
|
|
673
|
+
h(!0), d(null);
|
|
676
674
|
try {
|
|
677
|
-
let e = await
|
|
678
|
-
managerActiveOnly:
|
|
679
|
-
managerPage:
|
|
680
|
-
managerPageSize:
|
|
681
|
-
managerScopeType:
|
|
682
|
-
membershipActiveOnly:
|
|
683
|
-
membershipOrgUnitId:
|
|
684
|
-
membershipPage:
|
|
685
|
-
membershipPageSize:
|
|
686
|
-
membershipPositionId:
|
|
687
|
-
orgUnitPage:
|
|
688
|
-
orgUnitPageSize:
|
|
689
|
-
orgUnitSearchText:
|
|
690
|
-
orgUnitType:
|
|
691
|
-
positionPage:
|
|
692
|
-
positionPageSize:
|
|
693
|
-
positionSearchText:
|
|
694
|
-
}), t =
|
|
695
|
-
|
|
675
|
+
let e = await fe({
|
|
676
|
+
managerActiveOnly: v.activeOnly,
|
|
677
|
+
managerPage: b,
|
|
678
|
+
managerPageSize: S,
|
|
679
|
+
managerScopeType: A.id === "ALL" ? null : A.id,
|
|
680
|
+
membershipActiveOnly: _e?.activeOnly ?? !1,
|
|
681
|
+
membershipOrgUnitId: xe?.id ?? null,
|
|
682
|
+
membershipPage: B,
|
|
683
|
+
membershipPageSize: we,
|
|
684
|
+
membershipPositionId: Ee?.id ?? null,
|
|
685
|
+
orgUnitPage: H,
|
|
686
|
+
orgUnitPageSize: je,
|
|
687
|
+
orgUnitSearchText: Ne,
|
|
688
|
+
orgUnitType: Le.id === "ALL" ? null : Le.id,
|
|
689
|
+
positionPage: Je,
|
|
690
|
+
positionPageSize: Xe,
|
|
691
|
+
positionSearchText: Qe
|
|
692
|
+
}), t = Mt(e.memberships, e.managerResolutions), n = await M(t);
|
|
693
|
+
te(n), Ve(e.orgUnits), Ie(e.orgUnitCount), Ue(e.filteredOrgUnits), rt(e.positions), tt(e.positionCount), Ge(e.filteredPositions), ke(e.membershipCount), G(e.filteredMemberships), ee(e.managerResolutionCount), at(e.filteredManagerResolutions);
|
|
696
694
|
} catch (e) {
|
|
697
|
-
|
|
695
|
+
d(en(e));
|
|
698
696
|
} finally {
|
|
699
|
-
|
|
697
|
+
h(!1);
|
|
700
698
|
}
|
|
701
699
|
}, [
|
|
702
|
-
g,
|
|
703
700
|
v,
|
|
704
701
|
b,
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
ve,
|
|
709
|
-
ye,
|
|
702
|
+
S,
|
|
703
|
+
A,
|
|
704
|
+
_e,
|
|
710
705
|
xe,
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
706
|
+
B,
|
|
707
|
+
we,
|
|
708
|
+
Ee,
|
|
709
|
+
H,
|
|
714
710
|
je,
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
711
|
+
Ne,
|
|
712
|
+
Le,
|
|
713
|
+
Je,
|
|
714
|
+
Xe,
|
|
715
|
+
Qe
|
|
718
716
|
]);
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}, [
|
|
722
|
-
let
|
|
717
|
+
u(() => {
|
|
718
|
+
gt();
|
|
719
|
+
}, [gt]);
|
|
720
|
+
let Z = f(() => new Map(W.map((e) => [e.id, e])), [W]), _t = f(() => new Map(nt.map((e) => [e.id, e])), [nt]), Q = f(() => new Map(z.map((e) => [e.memberId, e])), [z]), St = f(() => He.map((e) => ({
|
|
723
721
|
...e,
|
|
724
722
|
key: e.id,
|
|
725
|
-
parentName: e.parentId ?
|
|
726
|
-
typeLabel:
|
|
727
|
-
})), [
|
|
723
|
+
parentName: e.parentId ? Ft(Z.get(e.parentId)) : "根節點",
|
|
724
|
+
typeLabel: It(e.type)
|
|
725
|
+
})), [He, Z]), Ct = f(() => We.map((e) => ({
|
|
728
726
|
...e,
|
|
729
727
|
key: e.id
|
|
730
|
-
})), [
|
|
728
|
+
})), [We]), wt = f(() => ot.map((e) => ({
|
|
731
729
|
...e,
|
|
732
730
|
key: e.id,
|
|
733
|
-
memberName:
|
|
734
|
-
orgUnitName:
|
|
735
|
-
positionName: e.positionId ?
|
|
731
|
+
memberName: Pt(Q.get(e.memberId)),
|
|
732
|
+
orgUnitName: Ft(Z.get(e.orgUnitId)),
|
|
733
|
+
positionName: e.positionId ? Lt(_t.get(e.positionId)) : "未指定"
|
|
736
734
|
})), [
|
|
735
|
+
Q,
|
|
736
|
+
ot,
|
|
737
737
|
Z,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
st
|
|
741
|
-
]), dt = d(() => Qe.map((e) => ({
|
|
738
|
+
_t
|
|
739
|
+
]), Tt = f(() => it.map((e) => ({
|
|
742
740
|
...e,
|
|
743
741
|
key: e.id,
|
|
744
|
-
managerName:
|
|
745
|
-
scopeLabel:
|
|
746
|
-
membersById:
|
|
747
|
-
orgUnitsById:
|
|
748
|
-
positionsById:
|
|
742
|
+
managerName: Pt(Q.get(e.managerMemberId)),
|
|
743
|
+
scopeLabel: Nt(e, {
|
|
744
|
+
membersById: Q,
|
|
745
|
+
orgUnitsById: Z,
|
|
746
|
+
positionsById: _t
|
|
749
747
|
})
|
|
750
748
|
})), [
|
|
751
|
-
|
|
749
|
+
it,
|
|
750
|
+
Q,
|
|
752
751
|
Z,
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
]), ft = d(() => ({
|
|
752
|
+
_t
|
|
753
|
+
]), At = f(() => ({
|
|
756
754
|
render: (e) => [{
|
|
757
755
|
name: "編輯",
|
|
758
|
-
onClick: () =>
|
|
756
|
+
onClick: () => V({
|
|
759
757
|
record: e,
|
|
760
758
|
type: "EDIT"
|
|
761
759
|
})
|
|
762
760
|
}, {
|
|
763
761
|
name: "停用",
|
|
764
|
-
onClick: () =>
|
|
762
|
+
onClick: () => a({
|
|
765
763
|
confirmText: "停用組織",
|
|
766
764
|
description: `停用「${e.name}」後,這個組織節點將不再出現在可用組織清單中。`,
|
|
767
765
|
id: e.id,
|
|
@@ -772,16 +770,16 @@ function mt() {
|
|
|
772
770
|
}],
|
|
773
771
|
variant: "base-secondary",
|
|
774
772
|
width: 128
|
|
775
|
-
}), []),
|
|
773
|
+
}), []), jt = f(() => ({
|
|
776
774
|
render: (e) => [{
|
|
777
775
|
name: "編輯",
|
|
778
|
-
onClick: () =>
|
|
776
|
+
onClick: () => qe({
|
|
779
777
|
record: e,
|
|
780
778
|
type: "EDIT"
|
|
781
779
|
})
|
|
782
780
|
}, {
|
|
783
781
|
name: "刪除",
|
|
784
|
-
onClick: () =>
|
|
782
|
+
onClick: () => a({
|
|
785
783
|
confirmText: "刪除職位",
|
|
786
784
|
description: `刪除職位「${e.name}」。若仍有會員歸屬、主管解析規則、簽核範本或進行中單據的加簽對象引用它,系統會拒絕刪除並說明原因。`,
|
|
787
785
|
id: e.id,
|
|
@@ -792,16 +790,16 @@ function mt() {
|
|
|
792
790
|
}],
|
|
793
791
|
variant: "base-secondary",
|
|
794
792
|
width: 128
|
|
795
|
-
}), []),
|
|
793
|
+
}), []), zt = f(() => ({
|
|
796
794
|
render: (e) => [{
|
|
797
795
|
name: "編輯",
|
|
798
|
-
onClick: () =>
|
|
796
|
+
onClick: () => be({
|
|
799
797
|
record: e,
|
|
800
798
|
type: "EDIT"
|
|
801
799
|
})
|
|
802
800
|
}, {
|
|
803
801
|
name: "刪除",
|
|
804
|
-
onClick: () =>
|
|
802
|
+
onClick: () => a({
|
|
805
803
|
confirmText: "刪除歸屬",
|
|
806
804
|
description: `刪除「${e.memberName}」在「${e.orgUnitName}」的會員歸屬。`,
|
|
807
805
|
id: e.id,
|
|
@@ -812,16 +810,16 @@ function mt() {
|
|
|
812
810
|
}],
|
|
813
811
|
variant: "base-secondary",
|
|
814
812
|
width: 128
|
|
815
|
-
}), []),
|
|
813
|
+
}), []), Bt = f(() => ({
|
|
816
814
|
render: (e) => [{
|
|
817
815
|
name: "編輯",
|
|
818
|
-
onClick: () =>
|
|
816
|
+
onClick: () => _({
|
|
819
817
|
record: e,
|
|
820
818
|
type: "EDIT"
|
|
821
819
|
})
|
|
822
820
|
}, {
|
|
823
821
|
name: "刪除",
|
|
824
|
-
onClick: () =>
|
|
822
|
+
onClick: () => a({
|
|
825
823
|
confirmText: "刪除主管規則",
|
|
826
824
|
description: `刪除「${e.scopeLabel}」指派給「${e.managerName}」的主管解析規則。`,
|
|
827
825
|
id: e.id,
|
|
@@ -833,303 +831,334 @@ function mt() {
|
|
|
833
831
|
variant: "base-secondary",
|
|
834
832
|
width: 128
|
|
835
833
|
}), []);
|
|
836
|
-
function
|
|
837
|
-
|
|
834
|
+
function Vt(e) {
|
|
835
|
+
U(1), Pe(e);
|
|
838
836
|
}
|
|
839
|
-
function
|
|
840
|
-
|
|
837
|
+
function Ht(e) {
|
|
838
|
+
U(1), Re(e);
|
|
841
839
|
}
|
|
842
|
-
function
|
|
843
|
-
|
|
840
|
+
function Ut(e) {
|
|
841
|
+
Ye(1), $e(e);
|
|
844
842
|
}
|
|
845
|
-
function
|
|
846
|
-
|
|
843
|
+
function Wt(e) {
|
|
844
|
+
Ce(1), ve(e);
|
|
847
845
|
}
|
|
848
|
-
function
|
|
849
|
-
|
|
846
|
+
function Gt(e) {
|
|
847
|
+
Ce(1), Se(e);
|
|
850
848
|
}
|
|
851
|
-
function
|
|
852
|
-
|
|
849
|
+
function Kt(e) {
|
|
850
|
+
Ce(1), De(e);
|
|
853
851
|
}
|
|
854
|
-
function
|
|
855
|
-
|
|
852
|
+
function qt(e) {
|
|
853
|
+
x(1), y(e);
|
|
856
854
|
}
|
|
857
|
-
function
|
|
858
|
-
|
|
855
|
+
function Jt(e) {
|
|
856
|
+
x(1), I(e);
|
|
859
857
|
}
|
|
860
|
-
function
|
|
861
|
-
|
|
858
|
+
function $() {
|
|
859
|
+
K || a(null);
|
|
862
860
|
}
|
|
863
|
-
async function
|
|
864
|
-
|
|
865
|
-
|
|
861
|
+
async function Yt() {
|
|
862
|
+
r && await Qt(async () => {
|
|
863
|
+
r.type === "ORG_UNIT" && await le(r.id, { transferToOrgUnitId: pt ? ut?.id ?? null : null }), r.type === "POSITION" && await ue(r.id), r.type === "MEMBERSHIP" && await ce(r.id), r.type === "MANAGER_RESOLUTION" && await se(r.id), a(null);
|
|
866
864
|
});
|
|
867
865
|
}
|
|
868
|
-
async function
|
|
869
|
-
|
|
866
|
+
async function Zt(e) {
|
|
867
|
+
q(!0), d(null);
|
|
870
868
|
try {
|
|
871
|
-
await
|
|
872
|
-
baseUpdatedAt:
|
|
869
|
+
await ne({ moves: e.map((e) => ({
|
|
870
|
+
baseUpdatedAt: Z.get(e.orgUnitId)?.updatedAt ?? "",
|
|
873
871
|
id: e.orgUnitId,
|
|
874
872
|
parentId: e.parentId
|
|
875
|
-
})) }), await
|
|
873
|
+
})) }), await gt();
|
|
876
874
|
} catch (e) {
|
|
877
|
-
throw
|
|
875
|
+
throw d(en(e)), e;
|
|
878
876
|
} finally {
|
|
879
|
-
|
|
877
|
+
q(!1);
|
|
880
878
|
}
|
|
881
879
|
}
|
|
882
|
-
async function
|
|
883
|
-
|
|
880
|
+
async function Qt(e) {
|
|
881
|
+
q(!0), d(null);
|
|
884
882
|
try {
|
|
885
|
-
await e(), await
|
|
883
|
+
await e(), await gt();
|
|
886
884
|
} catch (e) {
|
|
887
|
-
|
|
885
|
+
d(en(e));
|
|
888
886
|
} finally {
|
|
889
|
-
|
|
887
|
+
q(!1);
|
|
890
888
|
}
|
|
891
889
|
}
|
|
892
|
-
return /* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ F(N, { children: [
|
|
891
|
+
/* @__PURE__ */ P(w, { children: /* @__PURE__ */ P(L, {
|
|
894
892
|
description: "維護組織樹、職位、會員歸屬與簽核主管解析規則。",
|
|
895
893
|
title: "組織管理"
|
|
896
894
|
}) }),
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
tab: /* @__PURE__ */
|
|
899
|
-
activeKey:
|
|
900
|
-
onChange: (e) =>
|
|
895
|
+
/* @__PURE__ */ P(E, { children: /* @__PURE__ */ F(T, {
|
|
896
|
+
tab: /* @__PURE__ */ F(O, {
|
|
897
|
+
activeKey: t,
|
|
898
|
+
onChange: (e) => n(Rt(e)),
|
|
901
899
|
children: [
|
|
902
|
-
/* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ P(k, { children: "組織樹" }, "ORG_UNITS"),
|
|
901
|
+
/* @__PURE__ */ P(k, { children: "職位" }, "POSITIONS"),
|
|
902
|
+
/* @__PURE__ */ P(k, { children: "會員歸屬" }, "MEMBERSHIPS"),
|
|
903
|
+
/* @__PURE__ */ P(k, { children: "簽核主管" }, "MANAGERS")
|
|
906
904
|
]
|
|
907
905
|
}),
|
|
908
906
|
children: [
|
|
909
|
-
|
|
907
|
+
c ? /* @__PURE__ */ P(j, {
|
|
910
908
|
color: "text-error",
|
|
911
909
|
variant: "body",
|
|
912
|
-
children:
|
|
910
|
+
children: c
|
|
913
911
|
}) : null,
|
|
914
|
-
|
|
915
|
-
actions:
|
|
916
|
-
loading:
|
|
917
|
-
onCreate: () =>
|
|
912
|
+
t === "ORG_UNITS" ? /* @__PURE__ */ P(vt, {
|
|
913
|
+
actions: At,
|
|
914
|
+
loading: p,
|
|
915
|
+
onCreate: () => V({
|
|
918
916
|
parentId: null,
|
|
919
917
|
record: null,
|
|
920
918
|
type: "CREATE"
|
|
921
919
|
}),
|
|
922
|
-
onCreateChild: (e) =>
|
|
920
|
+
onCreateChild: (e) => V({
|
|
923
921
|
parentId: e,
|
|
924
922
|
record: null,
|
|
925
923
|
type: "CREATE"
|
|
926
924
|
}),
|
|
927
|
-
onEditOrgUnit: (e) =>
|
|
925
|
+
onEditOrgUnit: (e) => V({
|
|
928
926
|
record: e,
|
|
929
927
|
type: "EDIT"
|
|
930
928
|
}),
|
|
931
|
-
onPageChange:
|
|
932
|
-
onSaveDraft:
|
|
929
|
+
onPageChange: U,
|
|
930
|
+
onSaveDraft: Zt,
|
|
933
931
|
onPageSizeChange: (e) => {
|
|
934
|
-
|
|
932
|
+
U(1), Me(e);
|
|
935
933
|
},
|
|
936
|
-
onSearchTextChange:
|
|
937
|
-
onTypeFilterChange:
|
|
938
|
-
orgUnits:
|
|
939
|
-
page:
|
|
940
|
-
pageSize:
|
|
941
|
-
rows:
|
|
942
|
-
searchText:
|
|
943
|
-
saving:
|
|
944
|
-
total:
|
|
945
|
-
typeFilter:
|
|
946
|
-
viewMode:
|
|
947
|
-
onViewModeChange:
|
|
934
|
+
onSearchTextChange: Vt,
|
|
935
|
+
onTypeFilterChange: Ht,
|
|
936
|
+
orgUnits: W,
|
|
937
|
+
page: H,
|
|
938
|
+
pageSize: je,
|
|
939
|
+
rows: St,
|
|
940
|
+
searchText: Ne,
|
|
941
|
+
saving: K,
|
|
942
|
+
total: Fe,
|
|
943
|
+
typeFilter: Le,
|
|
944
|
+
viewMode: ze,
|
|
945
|
+
onViewModeChange: Be
|
|
948
946
|
}) : null,
|
|
949
|
-
|
|
950
|
-
actions:
|
|
951
|
-
loading:
|
|
952
|
-
onCreate: () =>
|
|
947
|
+
t === "POSITIONS" ? /* @__PURE__ */ P(yt, {
|
|
948
|
+
actions: jt,
|
|
949
|
+
loading: p,
|
|
950
|
+
onCreate: () => qe({
|
|
953
951
|
record: null,
|
|
954
952
|
type: "CREATE"
|
|
955
953
|
}),
|
|
956
|
-
onPageChange:
|
|
954
|
+
onPageChange: Ye,
|
|
957
955
|
onPageSizeChange: (e) => {
|
|
958
|
-
|
|
956
|
+
Ye(1), Ze(e);
|
|
959
957
|
},
|
|
960
|
-
onSearchTextChange:
|
|
961
|
-
page:
|
|
962
|
-
pageSize:
|
|
963
|
-
rows:
|
|
964
|
-
searchText:
|
|
965
|
-
total:
|
|
958
|
+
onSearchTextChange: Ut,
|
|
959
|
+
page: Je,
|
|
960
|
+
pageSize: Xe,
|
|
961
|
+
rows: Ct,
|
|
962
|
+
searchText: Qe,
|
|
963
|
+
total: et
|
|
966
964
|
}) : null,
|
|
967
|
-
|
|
968
|
-
actions:
|
|
969
|
-
loading:
|
|
970
|
-
onCreate: () =>
|
|
965
|
+
t === "MEMBERSHIPS" ? /* @__PURE__ */ P(bt, {
|
|
966
|
+
actions: zt,
|
|
967
|
+
loading: p,
|
|
968
|
+
onCreate: () => be({
|
|
971
969
|
record: null,
|
|
972
970
|
type: "CREATE"
|
|
973
971
|
}),
|
|
974
|
-
onActiveFilterChange:
|
|
975
|
-
onOrgUnitFilterChange:
|
|
976
|
-
onPageChange:
|
|
972
|
+
onActiveFilterChange: Wt,
|
|
973
|
+
onOrgUnitFilterChange: Gt,
|
|
974
|
+
onPageChange: Ce,
|
|
977
975
|
onPageSizeChange: (e) => {
|
|
978
|
-
|
|
976
|
+
Ce(1), Te(e);
|
|
979
977
|
},
|
|
980
|
-
onPositionFilterChange:
|
|
981
|
-
orgUnitFilter:
|
|
982
|
-
orgUnits:
|
|
983
|
-
page:
|
|
984
|
-
pageSize:
|
|
985
|
-
positionFilter:
|
|
986
|
-
positions:
|
|
987
|
-
rows:
|
|
988
|
-
statusFilter:
|
|
989
|
-
total:
|
|
978
|
+
onPositionFilterChange: Kt,
|
|
979
|
+
orgUnitFilter: xe,
|
|
980
|
+
orgUnits: W,
|
|
981
|
+
page: B,
|
|
982
|
+
pageSize: we,
|
|
983
|
+
positionFilter: Ee,
|
|
984
|
+
positions: nt,
|
|
985
|
+
rows: wt,
|
|
986
|
+
statusFilter: _e,
|
|
987
|
+
total: Oe
|
|
990
988
|
}) : null,
|
|
991
|
-
|
|
992
|
-
actions:
|
|
993
|
-
loading:
|
|
994
|
-
onCreate: () =>
|
|
989
|
+
t === "MANAGERS" ? /* @__PURE__ */ P(xt, {
|
|
990
|
+
actions: Bt,
|
|
991
|
+
loading: p,
|
|
992
|
+
onCreate: () => _({
|
|
995
993
|
record: null,
|
|
996
994
|
type: "CREATE"
|
|
997
995
|
}),
|
|
998
|
-
onActiveFilterChange:
|
|
999
|
-
onPageChange:
|
|
996
|
+
onActiveFilterChange: qt,
|
|
997
|
+
onPageChange: x,
|
|
1000
998
|
onPageSizeChange: (e) => {
|
|
1001
|
-
|
|
999
|
+
x(1), D(e);
|
|
1002
1000
|
},
|
|
1003
|
-
onScopeTypeFilterChange:
|
|
1004
|
-
page:
|
|
1005
|
-
pageSize:
|
|
1006
|
-
rows:
|
|
1007
|
-
scopeTypeFilter:
|
|
1008
|
-
statusFilter:
|
|
1009
|
-
total:
|
|
1001
|
+
onScopeTypeFilterChange: Jt,
|
|
1002
|
+
page: b,
|
|
1003
|
+
pageSize: S,
|
|
1004
|
+
rows: Tt,
|
|
1005
|
+
scopeTypeFilter: A,
|
|
1006
|
+
statusFilter: v,
|
|
1007
|
+
total: R
|
|
1010
1008
|
}) : null
|
|
1011
1009
|
]
|
|
1012
1010
|
}) }),
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
modal:
|
|
1015
|
-
onClose: () =>
|
|
1016
|
-
onSubmit: (e) =>
|
|
1017
|
-
|
|
1011
|
+
/* @__PURE__ */ P(Et, {
|
|
1012
|
+
modal: Ae,
|
|
1013
|
+
onClose: () => V(null),
|
|
1014
|
+
onSubmit: (e) => Qt(async () => {
|
|
1015
|
+
Ae?.type === "EDIT" && Ae.record ? await he({
|
|
1018
1016
|
...e,
|
|
1019
|
-
id:
|
|
1017
|
+
id: Ae.record.id,
|
|
1020
1018
|
metadataJson: null
|
|
1021
|
-
}) : await
|
|
1019
|
+
}) : await ae({
|
|
1022
1020
|
code: e.code ?? "",
|
|
1023
1021
|
metadataJson: "{}",
|
|
1024
1022
|
name: e.name ?? "",
|
|
1025
1023
|
parentId: e.parentId,
|
|
1026
1024
|
type: e.type ?? "DEPARTMENT"
|
|
1027
|
-
}),
|
|
1025
|
+
}), V(null);
|
|
1028
1026
|
}),
|
|
1029
|
-
orgUnits:
|
|
1030
|
-
saving:
|
|
1027
|
+
orgUnits: W,
|
|
1028
|
+
saving: K
|
|
1031
1029
|
}),
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
modal:
|
|
1034
|
-
onClose: () =>
|
|
1035
|
-
onSubmit: (e) =>
|
|
1036
|
-
|
|
1030
|
+
/* @__PURE__ */ P(Dt, {
|
|
1031
|
+
modal: Ke,
|
|
1032
|
+
onClose: () => qe(null),
|
|
1033
|
+
onSubmit: (e) => Qt(async () => {
|
|
1034
|
+
Ke?.type === "EDIT" && Ke.record ? await ge({
|
|
1037
1035
|
...e,
|
|
1038
|
-
id:
|
|
1036
|
+
id: Ke.record.id,
|
|
1039
1037
|
metadataJson: null
|
|
1040
|
-
}) : await
|
|
1038
|
+
}) : await oe({
|
|
1041
1039
|
code: e.code ?? "",
|
|
1042
1040
|
level: e.level ?? 0,
|
|
1043
1041
|
metadataJson: "{}",
|
|
1044
1042
|
name: e.name ?? ""
|
|
1045
|
-
}),
|
|
1043
|
+
}), qe(null);
|
|
1046
1044
|
}),
|
|
1047
|
-
saving:
|
|
1045
|
+
saving: K
|
|
1048
1046
|
}),
|
|
1049
|
-
/* @__PURE__ */
|
|
1050
|
-
membersById:
|
|
1051
|
-
modal:
|
|
1052
|
-
onClose: () =>
|
|
1053
|
-
onSubmit: (e) =>
|
|
1054
|
-
|
|
1047
|
+
/* @__PURE__ */ P(Ot, {
|
|
1048
|
+
membersById: Q,
|
|
1049
|
+
modal: ye,
|
|
1050
|
+
onClose: () => be(null),
|
|
1051
|
+
onSubmit: (e) => Qt(async () => {
|
|
1052
|
+
ye?.type === "EDIT" && ye.record ? await me({
|
|
1055
1053
|
...e,
|
|
1056
|
-
id:
|
|
1057
|
-
}) : await
|
|
1058
|
-
effectiveFrom: e.effectiveFrom ??
|
|
1054
|
+
id: ye.record.id
|
|
1055
|
+
}) : await ie({
|
|
1056
|
+
effectiveFrom: e.effectiveFrom ?? Xt(),
|
|
1059
1057
|
effectiveTo: e.effectiveTo,
|
|
1060
1058
|
isPrimary: e.isPrimary ?? !1,
|
|
1061
1059
|
memberId: e.memberId ?? "",
|
|
1062
1060
|
orgUnitId: e.orgUnitId ?? "",
|
|
1063
1061
|
positionId: e.positionId
|
|
1064
|
-
}),
|
|
1062
|
+
}), be(null);
|
|
1065
1063
|
}),
|
|
1066
|
-
orgUnits:
|
|
1067
|
-
positions:
|
|
1068
|
-
saving:
|
|
1064
|
+
orgUnits: W,
|
|
1065
|
+
positions: nt,
|
|
1066
|
+
saving: K
|
|
1069
1067
|
}),
|
|
1070
|
-
/* @__PURE__ */
|
|
1071
|
-
membersById:
|
|
1072
|
-
modal:
|
|
1073
|
-
onClose: () =>
|
|
1074
|
-
onSubmit: (e) =>
|
|
1075
|
-
|
|
1068
|
+
/* @__PURE__ */ P(kt, {
|
|
1069
|
+
membersById: Q,
|
|
1070
|
+
modal: g,
|
|
1071
|
+
onClose: () => _(null),
|
|
1072
|
+
onSubmit: (e) => Qt(async () => {
|
|
1073
|
+
g?.type === "EDIT" && g.record ? await pe({
|
|
1076
1074
|
...e,
|
|
1077
|
-
id:
|
|
1078
|
-
}) : await
|
|
1079
|
-
effectiveFrom: e.effectiveFrom ??
|
|
1075
|
+
id: g.record.id
|
|
1076
|
+
}) : await re({
|
|
1077
|
+
effectiveFrom: e.effectiveFrom ?? Xt(),
|
|
1080
1078
|
effectiveTo: e.effectiveTo,
|
|
1081
1079
|
managerMemberId: e.managerMemberId ?? "",
|
|
1082
|
-
priority: e.priority ??
|
|
1080
|
+
priority: e.priority ?? st,
|
|
1083
1081
|
scopeId: e.scopeId ?? "",
|
|
1084
1082
|
scopeType: e.scopeType ?? "MEMBER"
|
|
1085
|
-
}),
|
|
1083
|
+
}), _(null);
|
|
1086
1084
|
}),
|
|
1087
|
-
orgUnits:
|
|
1088
|
-
positions:
|
|
1089
|
-
saving:
|
|
1085
|
+
orgUnits: W,
|
|
1086
|
+
positions: nt,
|
|
1087
|
+
saving: K
|
|
1090
1088
|
}),
|
|
1091
|
-
/* @__PURE__ */
|
|
1089
|
+
/* @__PURE__ */ F(C, {
|
|
1092
1090
|
cancelText: "取消",
|
|
1093
|
-
confirmButtonProps: {
|
|
1094
|
-
|
|
1095
|
-
|
|
1091
|
+
confirmButtonProps: {
|
|
1092
|
+
disabled: mt,
|
|
1093
|
+
variant: "destructive-primary"
|
|
1094
|
+
},
|
|
1095
|
+
confirmText: pt ? "轉移並停用" : ht?.confirmText ?? "",
|
|
1096
|
+
loading: K,
|
|
1096
1097
|
modalStatusType: "error",
|
|
1097
1098
|
modalType: "standard",
|
|
1098
|
-
onCancel:
|
|
1099
|
-
onClose:
|
|
1100
|
-
onConfirm: () => void
|
|
1101
|
-
open: !!
|
|
1099
|
+
onCancel: $,
|
|
1100
|
+
onClose: $,
|
|
1101
|
+
onConfirm: () => void Yt(),
|
|
1102
|
+
open: !!r,
|
|
1102
1103
|
showModalFooter: !0,
|
|
1103
1104
|
showModalHeader: !0,
|
|
1104
1105
|
size: "regular",
|
|
1105
1106
|
supportingText: "此操作會立即套用,請確認後再繼續。",
|
|
1106
|
-
title:
|
|
1107
|
-
children: [
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1107
|
+
title: ht?.title ?? "",
|
|
1108
|
+
children: [
|
|
1109
|
+
/* @__PURE__ */ P(j, {
|
|
1110
|
+
color: "text-neutral",
|
|
1111
|
+
variant: "body",
|
|
1112
|
+
children: ht?.description ?? ""
|
|
1113
|
+
}),
|
|
1114
|
+
X && J === null && !c ? /* @__PURE__ */ P(j, {
|
|
1115
|
+
color: "text-neutral",
|
|
1116
|
+
variant: "body",
|
|
1117
|
+
children: "正在確認這個組織目前的歸屬與主管規則…"
|
|
1118
|
+
}) : null,
|
|
1119
|
+
X && J && J.childUnitCount > 0 ? /* @__PURE__ */ P(j, {
|
|
1120
|
+
color: "text-error",
|
|
1121
|
+
variant: "body",
|
|
1122
|
+
children: `這個組織底下還有 ${J.childUnitCount} 個子組織,請先移動或停用子組織。`
|
|
1123
|
+
}) : null,
|
|
1124
|
+
pt && J ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(j, {
|
|
1125
|
+
color: "text-neutral",
|
|
1126
|
+
variant: "body",
|
|
1127
|
+
children: `這個組織還有 ${J.openMembershipCount} 筆尚未結束的會員歸屬(含未來才生效的)、${J.openManagerResolutionCount} 筆簽核主管規則。請選擇承接組織:已生效的歸屬會在昨天結束,並自今天起改掛到承接組織,保留歷史;尚未生效的歸屬直接改掛;這個組織的簽核主管規則會一併結束。`
|
|
1128
|
+
}), /* @__PURE__ */ P(e, {
|
|
1129
|
+
label: "承接組織",
|
|
1130
|
+
name: "successorOrgUnitId",
|
|
1131
|
+
children: /* @__PURE__ */ P(i, {
|
|
1132
|
+
name: "successorOrgUnitId",
|
|
1133
|
+
onChange: ft,
|
|
1134
|
+
orgUnits: W.filter((e) => e.id !== r?.id),
|
|
1135
|
+
placeholder: "選擇承接組織",
|
|
1136
|
+
value: ut
|
|
1137
|
+
})
|
|
1138
|
+
})] }) : null,
|
|
1139
|
+
c ? /* @__PURE__ */ P(j, {
|
|
1140
|
+
color: "text-error",
|
|
1141
|
+
variant: "body",
|
|
1142
|
+
children: c
|
|
1143
|
+
}) : null
|
|
1144
|
+
]
|
|
1116
1145
|
})
|
|
1117
1146
|
] });
|
|
1118
1147
|
}
|
|
1119
|
-
function
|
|
1120
|
-
let
|
|
1121
|
-
isTreeMode:
|
|
1122
|
-
isTreeEditing:
|
|
1123
|
-
}),
|
|
1124
|
-
isTreeMode:
|
|
1125
|
-
isTreeEditing:
|
|
1126
|
-
}),
|
|
1127
|
-
hasDraftChanges:
|
|
1128
|
-
isTreeEditing:
|
|
1129
|
-
isTreeMode:
|
|
1148
|
+
function vt({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUnit: i, onPageChange: a, onSaveDraft: o, onPageSizeChange: s, onSearchTextChange: c, onTypeFilterChange: l, onViewModeChange: d, orgUnits: h, page: _, pageSize: C, rows: w, searchText: T, saving: E, total: O, typeFilter: k, viewMode: j }) {
|
|
1149
|
+
let M = p(null), [L, ee] = m(K), z = j === "TABLE" ? "FLOW" : "TABLE", te = j === "TABLE" ? "切換樹狀圖" : "切換表格", ne = j === "FLOW", re = St({
|
|
1150
|
+
isTreeMode: ne,
|
|
1151
|
+
isTreeEditing: L.isEditing
|
|
1152
|
+
}), ie = Ct({
|
|
1153
|
+
isTreeMode: ne,
|
|
1154
|
+
isTreeEditing: L.isEditing
|
|
1155
|
+
}), ae = wt({
|
|
1156
|
+
hasDraftChanges: L.hasDraftChanges,
|
|
1157
|
+
isTreeEditing: L.isEditing,
|
|
1158
|
+
isTreeMode: ne,
|
|
1130
1159
|
loading: t,
|
|
1131
|
-
saving:
|
|
1132
|
-
}),
|
|
1160
|
+
saving: E
|
|
1161
|
+
}), oe = f(() => [
|
|
1133
1162
|
{
|
|
1134
1163
|
dataIndex: "code",
|
|
1135
1164
|
key: "code",
|
|
@@ -1161,47 +1190,39 @@ function ht({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1161
1190
|
width: 420
|
|
1162
1191
|
}
|
|
1163
1192
|
], []);
|
|
1164
|
-
return
|
|
1165
|
-
j === "TABLE" &&
|
|
1166
|
-
}, [j]), /* @__PURE__ */
|
|
1167
|
-
actionDisabled:
|
|
1168
|
-
actionIcon:
|
|
1169
|
-
actionLabel:
|
|
1170
|
-
actions: /* @__PURE__ */
|
|
1171
|
-
onClick: () =>
|
|
1193
|
+
return u(() => {
|
|
1194
|
+
j === "TABLE" && ee(K);
|
|
1195
|
+
}, [j]), /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Tt, {
|
|
1196
|
+
actionDisabled: ae,
|
|
1197
|
+
actionIcon: ie,
|
|
1198
|
+
actionLabel: re,
|
|
1199
|
+
actions: /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(g, {
|
|
1200
|
+
onClick: () => d(z),
|
|
1172
1201
|
variant: "base-secondary",
|
|
1173
|
-
children:
|
|
1174
|
-
}),
|
|
1175
|
-
disabled:
|
|
1176
|
-
icon:
|
|
1202
|
+
children: te
|
|
1203
|
+
}), ne && L.isEditing ? /* @__PURE__ */ P(g, {
|
|
1204
|
+
disabled: E,
|
|
1205
|
+
icon: R,
|
|
1177
1206
|
iconType: "leading",
|
|
1178
|
-
onClick: () =>
|
|
1207
|
+
onClick: () => M.current?.cancelEditing(),
|
|
1179
1208
|
variant: "base-secondary",
|
|
1180
1209
|
children: "取消"
|
|
1181
1210
|
}) : null] }),
|
|
1182
1211
|
description: "組織節點使用 ltree path 維護階層,搬移節點會同步更新子節點 path。",
|
|
1183
1212
|
onCreate: () => {
|
|
1184
|
-
|
|
1185
|
-
n();
|
|
1186
|
-
return;
|
|
1187
|
-
}
|
|
1188
|
-
if (R.isEditing) {
|
|
1189
|
-
I.current?.saveDraft();
|
|
1190
|
-
return;
|
|
1191
|
-
}
|
|
1192
|
-
I.current?.startEditing();
|
|
1213
|
+
ne ? L.isEditing ? M.current?.saveDraft() : M.current?.startEditing() : n();
|
|
1193
1214
|
},
|
|
1194
1215
|
title: "組織樹"
|
|
1195
|
-
}), j === "TABLE" ? /* @__PURE__ */
|
|
1196
|
-
className:
|
|
1216
|
+
}), j === "TABLE" ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(y, {
|
|
1217
|
+
className: G.orgFilterArea,
|
|
1197
1218
|
size: "sub",
|
|
1198
|
-
children: /* @__PURE__ */
|
|
1219
|
+
children: /* @__PURE__ */ F(b, { children: [/* @__PURE__ */ P(v, {
|
|
1199
1220
|
span: 3,
|
|
1200
|
-
children: /* @__PURE__ */
|
|
1221
|
+
children: /* @__PURE__ */ P(x, {
|
|
1201
1222
|
fullWidth: !0,
|
|
1202
|
-
layout:
|
|
1223
|
+
layout: I.VERTICAL,
|
|
1203
1224
|
name: "orgUnitSearchText",
|
|
1204
|
-
children: /* @__PURE__ */
|
|
1225
|
+
children: /* @__PURE__ */ P(S, {
|
|
1205
1226
|
fullWidth: !0,
|
|
1206
1227
|
onChange: (e) => c(e.target.value),
|
|
1207
1228
|
placeholder: "搜尋組織名稱或代碼",
|
|
@@ -1210,53 +1231,53 @@ function ht({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1210
1231
|
variant: "base"
|
|
1211
1232
|
})
|
|
1212
1233
|
})
|
|
1213
|
-
}), /* @__PURE__ */
|
|
1234
|
+
}), /* @__PURE__ */ P(v, {
|
|
1214
1235
|
span: 2,
|
|
1215
|
-
children: /* @__PURE__ */
|
|
1236
|
+
children: /* @__PURE__ */ P(x, {
|
|
1216
1237
|
fullWidth: !0,
|
|
1217
|
-
layout:
|
|
1238
|
+
layout: I.VERTICAL,
|
|
1218
1239
|
name: "orgUnitTypeFilter",
|
|
1219
|
-
children: /* @__PURE__ */
|
|
1240
|
+
children: /* @__PURE__ */ P(D, {
|
|
1220
1241
|
clearable: !1,
|
|
1221
1242
|
fullWidth: !0,
|
|
1222
|
-
onChange: (e) =>
|
|
1223
|
-
options: [...
|
|
1243
|
+
onChange: (e) => l(Bt(e)),
|
|
1244
|
+
options: [...J],
|
|
1224
1245
|
placeholder: "類型",
|
|
1225
1246
|
size: "sub",
|
|
1226
|
-
value:
|
|
1247
|
+
value: k
|
|
1227
1248
|
})
|
|
1228
1249
|
})
|
|
1229
1250
|
})] })
|
|
1230
|
-
}), /* @__PURE__ */
|
|
1231
|
-
className:
|
|
1232
|
-
children: /* @__PURE__ */
|
|
1251
|
+
}), /* @__PURE__ */ P("div", {
|
|
1252
|
+
className: G.tableFrame,
|
|
1253
|
+
children: /* @__PURE__ */ P(A, {
|
|
1233
1254
|
actions: e,
|
|
1234
|
-
columns:
|
|
1255
|
+
columns: oe,
|
|
1235
1256
|
dataSource: [...w],
|
|
1236
1257
|
fullWidth: !0,
|
|
1237
1258
|
loading: t,
|
|
1238
|
-
pagination:
|
|
1259
|
+
pagination: Q({
|
|
1239
1260
|
onPageChange: a,
|
|
1240
1261
|
onPageSizeChange: s,
|
|
1241
|
-
page:
|
|
1262
|
+
page: _,
|
|
1242
1263
|
pageSize: C,
|
|
1243
1264
|
total: O
|
|
1244
1265
|
}),
|
|
1245
|
-
style: { minWidth:
|
|
1266
|
+
style: { minWidth: mt }
|
|
1246
1267
|
})
|
|
1247
|
-
})] }) : /* @__PURE__ */
|
|
1248
|
-
ref:
|
|
1268
|
+
})] }) : /* @__PURE__ */ P(Ke, {
|
|
1269
|
+
ref: M,
|
|
1249
1270
|
onCreateChild: r,
|
|
1250
1271
|
onCreateRoot: n,
|
|
1251
1272
|
onEditOrgUnit: i,
|
|
1252
1273
|
onSaveDraft: o,
|
|
1253
|
-
onStateChange:
|
|
1254
|
-
orgUnits:
|
|
1255
|
-
saving:
|
|
1274
|
+
onStateChange: ee,
|
|
1275
|
+
orgUnits: h,
|
|
1276
|
+
saving: E
|
|
1256
1277
|
})] });
|
|
1257
1278
|
}
|
|
1258
|
-
function
|
|
1259
|
-
let
|
|
1279
|
+
function yt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeChange: i, onSearchTextChange: a, page: o, pageSize: s, rows: c, searchText: l, total: u }) {
|
|
1280
|
+
let d = f(() => [
|
|
1260
1281
|
{
|
|
1261
1282
|
dataIndex: "code",
|
|
1262
1283
|
key: "code",
|
|
@@ -1282,23 +1303,23 @@ function gt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1282
1303
|
width: 220
|
|
1283
1304
|
}
|
|
1284
1305
|
], []);
|
|
1285
|
-
return /* @__PURE__ */
|
|
1286
|
-
/* @__PURE__ */
|
|
1306
|
+
return /* @__PURE__ */ F(N, { children: [
|
|
1307
|
+
/* @__PURE__ */ P(Tt, {
|
|
1287
1308
|
actionLabel: "新增職位",
|
|
1288
1309
|
description: "職位提供會員歸屬與主管解析規則使用。",
|
|
1289
1310
|
onCreate: n,
|
|
1290
1311
|
title: "職位"
|
|
1291
1312
|
}),
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
className:
|
|
1313
|
+
/* @__PURE__ */ P(y, {
|
|
1314
|
+
className: G.orgFilterArea,
|
|
1294
1315
|
size: "sub",
|
|
1295
|
-
children: /* @__PURE__ */
|
|
1316
|
+
children: /* @__PURE__ */ P(b, { children: /* @__PURE__ */ P(v, {
|
|
1296
1317
|
span: 3,
|
|
1297
|
-
children: /* @__PURE__ */
|
|
1318
|
+
children: /* @__PURE__ */ P(x, {
|
|
1298
1319
|
fullWidth: !0,
|
|
1299
|
-
layout:
|
|
1320
|
+
layout: I.VERTICAL,
|
|
1300
1321
|
name: "positionSearchText",
|
|
1301
|
-
children: /* @__PURE__ */
|
|
1322
|
+
children: /* @__PURE__ */ P(S, {
|
|
1302
1323
|
fullWidth: !0,
|
|
1303
1324
|
onChange: (e) => a(e.target.value),
|
|
1304
1325
|
placeholder: "搜尋職位名稱或代碼",
|
|
@@ -1309,28 +1330,28 @@ function gt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1309
1330
|
})
|
|
1310
1331
|
}) })
|
|
1311
1332
|
}),
|
|
1312
|
-
/* @__PURE__ */
|
|
1313
|
-
className:
|
|
1314
|
-
children: /* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ P("div", {
|
|
1334
|
+
className: G.tableFrame,
|
|
1335
|
+
children: /* @__PURE__ */ P(A, {
|
|
1315
1336
|
actions: e,
|
|
1316
|
-
columns:
|
|
1337
|
+
columns: d,
|
|
1317
1338
|
dataSource: [...c],
|
|
1318
1339
|
fullWidth: !0,
|
|
1319
1340
|
loading: t,
|
|
1320
|
-
pagination:
|
|
1341
|
+
pagination: Q({
|
|
1321
1342
|
onPageChange: r,
|
|
1322
1343
|
onPageSizeChange: i,
|
|
1323
1344
|
page: o,
|
|
1324
1345
|
pageSize: s,
|
|
1325
1346
|
total: u
|
|
1326
1347
|
}),
|
|
1327
|
-
style: { minWidth:
|
|
1348
|
+
style: { minWidth: ht }
|
|
1328
1349
|
})
|
|
1329
1350
|
})
|
|
1330
1351
|
] });
|
|
1331
1352
|
}
|
|
1332
|
-
function
|
|
1333
|
-
let T =
|
|
1353
|
+
function bt({ actions: e, loading: t, onCreate: r, onActiveFilterChange: i, onOrgUnitFilterChange: o, onPageChange: s, onPageSizeChange: c, onPositionFilterChange: l, orgUnitFilter: u, orgUnits: d, page: p, pageSize: m, positionFilter: g, positions: _, rows: S, statusFilter: C, total: w }) {
|
|
1354
|
+
let T = f(() => [
|
|
1334
1355
|
{
|
|
1335
1356
|
dataIndex: "memberName",
|
|
1336
1357
|
key: "memberName",
|
|
@@ -1367,25 +1388,25 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1367
1388
|
title: "結束日",
|
|
1368
1389
|
width: 140
|
|
1369
1390
|
}
|
|
1370
|
-
], []), E =
|
|
1371
|
-
return /* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1391
|
+
], []), E = f(() => d.map(n), [d]), D = f(() => _.map(a), [_]);
|
|
1392
|
+
return /* @__PURE__ */ F(N, { children: [
|
|
1393
|
+
/* @__PURE__ */ P(Tt, {
|
|
1373
1394
|
actionLabel: "新增歸屬",
|
|
1374
1395
|
description: "會員歸屬是 BPM 內部組織權限、主管解析與條件判斷的來源。",
|
|
1375
1396
|
onCreate: r,
|
|
1376
1397
|
title: "會員歸屬"
|
|
1377
1398
|
}),
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
className: [
|
|
1399
|
+
/* @__PURE__ */ P(y, {
|
|
1400
|
+
className: [G.orgFilterArea, G.membershipFilterArea].join(" "),
|
|
1380
1401
|
size: "sub",
|
|
1381
|
-
children: /* @__PURE__ */
|
|
1382
|
-
/* @__PURE__ */
|
|
1402
|
+
children: /* @__PURE__ */ F(b, { children: [
|
|
1403
|
+
/* @__PURE__ */ P(v, {
|
|
1383
1404
|
span: 2,
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1405
|
+
children: /* @__PURE__ */ P(x, {
|
|
1385
1406
|
fullWidth: !0,
|
|
1386
|
-
layout:
|
|
1407
|
+
layout: I.VERTICAL,
|
|
1387
1408
|
name: "membershipOrgUnitFilter",
|
|
1388
|
-
children: /* @__PURE__ */
|
|
1409
|
+
children: /* @__PURE__ */ P(h, {
|
|
1389
1410
|
disabledOptionsFilter: !0,
|
|
1390
1411
|
emptyText: "沒有符合的組織",
|
|
1391
1412
|
inputProps: {
|
|
@@ -1396,7 +1417,7 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1396
1417
|
},
|
|
1397
1418
|
mode: "single",
|
|
1398
1419
|
name: "membershipOrgUnitFilter",
|
|
1399
|
-
onChange: (e) => o(
|
|
1420
|
+
onChange: (e) => o(Gt(e)),
|
|
1400
1421
|
options: [...E],
|
|
1401
1422
|
placeholder: "全部組織",
|
|
1402
1423
|
size: "sub",
|
|
@@ -1404,13 +1425,13 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1404
1425
|
})
|
|
1405
1426
|
})
|
|
1406
1427
|
}),
|
|
1407
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ P(v, {
|
|
1408
1429
|
span: 2,
|
|
1409
|
-
children: /* @__PURE__ */
|
|
1430
|
+
children: /* @__PURE__ */ P(x, {
|
|
1410
1431
|
fullWidth: !0,
|
|
1411
|
-
layout:
|
|
1432
|
+
layout: I.VERTICAL,
|
|
1412
1433
|
name: "membershipPositionFilter",
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1434
|
+
children: /* @__PURE__ */ P(h, {
|
|
1414
1435
|
disabledOptionsFilter: !0,
|
|
1415
1436
|
emptyText: "沒有符合的職位",
|
|
1416
1437
|
inputProps: {
|
|
@@ -1421,7 +1442,7 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1421
1442
|
},
|
|
1422
1443
|
mode: "single",
|
|
1423
1444
|
name: "membershipPositionFilter",
|
|
1424
|
-
onChange: (e) => l(
|
|
1445
|
+
onChange: (e) => l(Kt(e)),
|
|
1425
1446
|
options: [...D],
|
|
1426
1447
|
placeholder: "全部職位",
|
|
1427
1448
|
size: "sub",
|
|
@@ -1429,13 +1450,13 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1429
1450
|
})
|
|
1430
1451
|
})
|
|
1431
1452
|
}),
|
|
1432
|
-
/* @__PURE__ */
|
|
1453
|
+
/* @__PURE__ */ P(v, {
|
|
1433
1454
|
span: 2,
|
|
1434
|
-
children: /* @__PURE__ */
|
|
1455
|
+
children: /* @__PURE__ */ P(x, {
|
|
1435
1456
|
fullWidth: !0,
|
|
1436
|
-
layout:
|
|
1457
|
+
layout: I.VERTICAL,
|
|
1437
1458
|
name: "membershipStatusFilter",
|
|
1438
|
-
children: /* @__PURE__ */
|
|
1459
|
+
children: /* @__PURE__ */ P(h, {
|
|
1439
1460
|
disabledOptionsFilter: !0,
|
|
1440
1461
|
emptyText: "沒有符合的狀態",
|
|
1441
1462
|
inputProps: {
|
|
@@ -1446,8 +1467,8 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1446
1467
|
},
|
|
1447
1468
|
mode: "single",
|
|
1448
1469
|
name: "membershipStatusFilter",
|
|
1449
|
-
onChange: (e) =>
|
|
1450
|
-
options: [...
|
|
1470
|
+
onChange: (e) => i(Wt(e)),
|
|
1471
|
+
options: [...ft],
|
|
1451
1472
|
placeholder: "全部狀態",
|
|
1452
1473
|
size: "sub",
|
|
1453
1474
|
value: C
|
|
@@ -1456,28 +1477,28 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1456
1477
|
})
|
|
1457
1478
|
] })
|
|
1458
1479
|
}),
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
className:
|
|
1461
|
-
children: /* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ P("div", {
|
|
1481
|
+
className: G.tableFrame,
|
|
1482
|
+
children: /* @__PURE__ */ P(A, {
|
|
1462
1483
|
actions: e,
|
|
1463
1484
|
columns: T,
|
|
1464
1485
|
dataSource: [...S],
|
|
1465
1486
|
fullWidth: !0,
|
|
1466
|
-
loading:
|
|
1467
|
-
pagination:
|
|
1487
|
+
loading: t,
|
|
1488
|
+
pagination: Q({
|
|
1468
1489
|
onPageChange: s,
|
|
1469
1490
|
onPageSizeChange: c,
|
|
1470
1491
|
page: p,
|
|
1471
|
-
pageSize:
|
|
1492
|
+
pageSize: m,
|
|
1472
1493
|
total: w
|
|
1473
1494
|
}),
|
|
1474
|
-
style: { minWidth:
|
|
1495
|
+
style: { minWidth: gt }
|
|
1475
1496
|
})
|
|
1476
1497
|
})
|
|
1477
1498
|
] });
|
|
1478
1499
|
}
|
|
1479
|
-
function
|
|
1480
|
-
let m =
|
|
1500
|
+
function xt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPageChange: i, onPageSizeChange: a, onScopeTypeFilterChange: o, page: s, pageSize: c, rows: l, scopeTypeFilter: u, statusFilter: d, total: p }) {
|
|
1501
|
+
let m = f(() => [
|
|
1481
1502
|
{
|
|
1482
1503
|
dataIndex: "scopeLabel",
|
|
1483
1504
|
key: "scopeLabel",
|
|
@@ -1509,106 +1530,106 @@ function vt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1509
1530
|
width: 140
|
|
1510
1531
|
}
|
|
1511
1532
|
], []);
|
|
1512
|
-
return /* @__PURE__ */
|
|
1513
|
-
/* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ F(N, { children: [
|
|
1534
|
+
/* @__PURE__ */ P(Tt, {
|
|
1514
1535
|
actionLabel: "新增主管規則",
|
|
1515
1536
|
description: "簽核主管規則獨立於組織樹 parent,解析優先序為會員、組織、職位。",
|
|
1516
1537
|
onCreate: n,
|
|
1517
1538
|
title: "簽核主管"
|
|
1518
1539
|
}),
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
className:
|
|
1540
|
+
/* @__PURE__ */ P(y, {
|
|
1541
|
+
className: G.orgFilterArea,
|
|
1521
1542
|
size: "sub",
|
|
1522
|
-
children: /* @__PURE__ */
|
|
1543
|
+
children: /* @__PURE__ */ F(b, { children: [/* @__PURE__ */ P(v, {
|
|
1523
1544
|
span: 3,
|
|
1524
|
-
children: /* @__PURE__ */
|
|
1545
|
+
children: /* @__PURE__ */ P(x, {
|
|
1525
1546
|
fullWidth: !0,
|
|
1526
|
-
layout:
|
|
1547
|
+
layout: I.VERTICAL,
|
|
1527
1548
|
name: "managerScopeTypeFilter",
|
|
1528
|
-
children: /* @__PURE__ */
|
|
1549
|
+
children: /* @__PURE__ */ P(D, {
|
|
1529
1550
|
clearable: !1,
|
|
1530
1551
|
fullWidth: !0,
|
|
1531
|
-
onChange: (e) => o(
|
|
1532
|
-
options: [...
|
|
1552
|
+
onChange: (e) => o(Ht(e)),
|
|
1553
|
+
options: [...ut],
|
|
1533
1554
|
placeholder: "套用範圍",
|
|
1534
1555
|
size: "sub",
|
|
1535
1556
|
value: u
|
|
1536
1557
|
})
|
|
1537
1558
|
})
|
|
1538
|
-
}), /* @__PURE__ */
|
|
1559
|
+
}), /* @__PURE__ */ P(v, {
|
|
1539
1560
|
span: 2,
|
|
1540
|
-
children: /* @__PURE__ */
|
|
1561
|
+
children: /* @__PURE__ */ P(x, {
|
|
1541
1562
|
fullWidth: !0,
|
|
1542
|
-
layout:
|
|
1563
|
+
layout: I.VERTICAL,
|
|
1543
1564
|
name: "managerStatusFilter",
|
|
1544
|
-
children: /* @__PURE__ */
|
|
1565
|
+
children: /* @__PURE__ */ P(D, {
|
|
1545
1566
|
clearable: !1,
|
|
1546
1567
|
fullWidth: !0,
|
|
1547
|
-
onChange: (e) => r(
|
|
1548
|
-
options: [...
|
|
1568
|
+
onChange: (e) => r(Ut(e)),
|
|
1569
|
+
options: [...ft],
|
|
1549
1570
|
placeholder: "狀態",
|
|
1550
1571
|
size: "sub",
|
|
1551
|
-
value:
|
|
1572
|
+
value: d
|
|
1552
1573
|
})
|
|
1553
1574
|
})
|
|
1554
1575
|
})] })
|
|
1555
1576
|
}),
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
className:
|
|
1558
|
-
children: /* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ P("div", {
|
|
1578
|
+
className: G.tableFrame,
|
|
1579
|
+
children: /* @__PURE__ */ P(A, {
|
|
1559
1580
|
actions: e,
|
|
1560
1581
|
columns: m,
|
|
1561
1582
|
dataSource: [...l],
|
|
1562
1583
|
fullWidth: !0,
|
|
1563
1584
|
loading: t,
|
|
1564
|
-
pagination:
|
|
1585
|
+
pagination: Q({
|
|
1565
1586
|
onPageChange: i,
|
|
1566
1587
|
onPageSizeChange: a,
|
|
1567
1588
|
page: s,
|
|
1568
1589
|
pageSize: c,
|
|
1569
1590
|
total: p
|
|
1570
1591
|
}),
|
|
1571
|
-
style: { minWidth:
|
|
1592
|
+
style: { minWidth: Z }
|
|
1572
1593
|
})
|
|
1573
1594
|
})
|
|
1574
1595
|
] });
|
|
1575
1596
|
}
|
|
1576
|
-
function
|
|
1597
|
+
function Q({ onPageChange: e, onPageSizeChange: t, page: n, pageSize: r, total: i }) {
|
|
1577
1598
|
return {
|
|
1578
1599
|
current: n,
|
|
1579
1600
|
onChange: e,
|
|
1580
1601
|
onChangePageSize: t,
|
|
1581
1602
|
pageSize: r,
|
|
1582
1603
|
pageSizeLabel: "每頁筆數",
|
|
1583
|
-
pageSizeOptions: [...
|
|
1604
|
+
pageSizeOptions: [...pt],
|
|
1584
1605
|
renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
|
|
1585
1606
|
showPageSizeOptions: !0,
|
|
1586
1607
|
total: i
|
|
1587
1608
|
};
|
|
1588
1609
|
}
|
|
1589
|
-
function
|
|
1610
|
+
function St({ isTreeEditing: e, isTreeMode: t }) {
|
|
1590
1611
|
return t ? e ? "儲存" : "開始編輯" : "新增組織";
|
|
1591
1612
|
}
|
|
1592
|
-
function
|
|
1593
|
-
return t ? e ?
|
|
1613
|
+
function Ct({ isTreeEditing: e, isTreeMode: t }) {
|
|
1614
|
+
return t ? e ? te : ee : z;
|
|
1594
1615
|
}
|
|
1595
|
-
function
|
|
1616
|
+
function wt({ hasDraftChanges: e, isTreeEditing: t, isTreeMode: n, loading: r, saving: i }) {
|
|
1596
1617
|
return n ? t ? !e || i : r : !1;
|
|
1597
1618
|
}
|
|
1598
|
-
function
|
|
1599
|
-
return /* @__PURE__ */
|
|
1600
|
-
className:
|
|
1601
|
-
children: [/* @__PURE__ */
|
|
1619
|
+
function Tt({ actionDisabled: e = !1, actionIcon: t = z, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
|
|
1620
|
+
return /* @__PURE__ */ F("div", {
|
|
1621
|
+
className: G.tableIntro,
|
|
1622
|
+
children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P(j, {
|
|
1602
1623
|
component: "h2",
|
|
1603
1624
|
variant: "h3",
|
|
1604
1625
|
children: o
|
|
1605
|
-
}), /* @__PURE__ */
|
|
1626
|
+
}), /* @__PURE__ */ P(j, {
|
|
1606
1627
|
color: "text-neutral",
|
|
1607
1628
|
variant: "body",
|
|
1608
1629
|
children: i
|
|
1609
|
-
})] }), /* @__PURE__ */
|
|
1610
|
-
className:
|
|
1611
|
-
children: [r, /* @__PURE__ */
|
|
1630
|
+
})] }), /* @__PURE__ */ F("div", {
|
|
1631
|
+
className: G.tableIntroActions,
|
|
1632
|
+
children: [r, /* @__PURE__ */ P(g, {
|
|
1612
1633
|
disabled: e,
|
|
1613
1634
|
icon: t,
|
|
1614
1635
|
iconType: "leading",
|
|
@@ -1618,80 +1639,80 @@ function Ct({ actionDisabled: e = !1, actionIcon: t = z, actionLabel: n, actions
|
|
|
1618
1639
|
})]
|
|
1619
1640
|
});
|
|
1620
1641
|
}
|
|
1621
|
-
function
|
|
1622
|
-
let [c,
|
|
1623
|
-
return
|
|
1624
|
-
if (!
|
|
1625
|
-
let e =
|
|
1626
|
-
|
|
1627
|
-
}, [
|
|
1642
|
+
function Et({ modal: t, onClose: r, onSubmit: a, orgUnits: o, saving: s }) {
|
|
1643
|
+
let [c, l] = m(""), [d, f] = m(""), [p, h] = m(null), [g, _] = m(q[2]);
|
|
1644
|
+
return u(() => {
|
|
1645
|
+
if (!t) return;
|
|
1646
|
+
let e = t.record, r = e?.parentId ?? t.parentId ?? null, i = r ? o.find((e) => e.id === r) ?? null : null;
|
|
1647
|
+
l(e?.code ?? ""), f(e?.name ?? ""), h(i ? n(i) : null), _(q.find((t) => t.id === e?.type) ?? q[2]);
|
|
1648
|
+
}, [t, o]), /* @__PURE__ */ P(C, {
|
|
1628
1649
|
cancelText: "取消",
|
|
1629
1650
|
confirmButtonProps: { disabled: !c || !d },
|
|
1630
|
-
confirmText:
|
|
1651
|
+
confirmText: t?.type === "EDIT" ? "儲存" : "建立",
|
|
1631
1652
|
loading: s,
|
|
1632
1653
|
modalType: "standard",
|
|
1633
|
-
onCancel:
|
|
1634
|
-
onClose:
|
|
1654
|
+
onCancel: r,
|
|
1655
|
+
onClose: r,
|
|
1635
1656
|
onConfirm: () => void a({
|
|
1636
1657
|
code: c,
|
|
1637
1658
|
name: d,
|
|
1638
|
-
parentId:
|
|
1659
|
+
parentId: p?.id ?? null,
|
|
1639
1660
|
type: g.id
|
|
1640
1661
|
}),
|
|
1641
|
-
open: !!
|
|
1662
|
+
open: !!t,
|
|
1642
1663
|
showModalFooter: !0,
|
|
1643
1664
|
showModalHeader: !0,
|
|
1644
1665
|
size: "regular",
|
|
1645
|
-
title:
|
|
1646
|
-
children: /* @__PURE__ */
|
|
1647
|
-
className:
|
|
1666
|
+
title: t?.type === "EDIT" ? "編輯組織" : "新增組織",
|
|
1667
|
+
children: /* @__PURE__ */ F("div", {
|
|
1668
|
+
className: G.modalFields,
|
|
1648
1669
|
children: [
|
|
1649
|
-
/* @__PURE__ */
|
|
1670
|
+
/* @__PURE__ */ P(At, {
|
|
1650
1671
|
label: "代碼",
|
|
1651
1672
|
name: "orgCode",
|
|
1652
|
-
onChange:
|
|
1673
|
+
onChange: l,
|
|
1653
1674
|
placeholder: "例如 FIN-TW",
|
|
1654
1675
|
value: c
|
|
1655
1676
|
}),
|
|
1656
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ P(At, {
|
|
1657
1678
|
label: "名稱",
|
|
1658
1679
|
name: "orgName",
|
|
1659
1680
|
onChange: f,
|
|
1660
1681
|
placeholder: "例如 財務部",
|
|
1661
1682
|
value: d
|
|
1662
1683
|
}),
|
|
1663
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ P(e, {
|
|
1664
1685
|
label: "類型",
|
|
1665
1686
|
name: "orgType",
|
|
1666
|
-
children: /* @__PURE__ */
|
|
1687
|
+
children: /* @__PURE__ */ P(D, {
|
|
1667
1688
|
clearable: !1,
|
|
1668
1689
|
fullWidth: !0,
|
|
1669
|
-
onChange: (e) => _(
|
|
1670
|
-
options: [...
|
|
1690
|
+
onChange: (e) => _(zt(e)),
|
|
1691
|
+
options: [...q],
|
|
1671
1692
|
placeholder: "選擇組織類型",
|
|
1672
1693
|
value: g
|
|
1673
1694
|
})
|
|
1674
1695
|
}),
|
|
1675
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ P(e, {
|
|
1676
1697
|
label: "上層組織",
|
|
1677
1698
|
name: "parentId",
|
|
1678
|
-
children: /* @__PURE__ */
|
|
1699
|
+
children: /* @__PURE__ */ P(i, {
|
|
1679
1700
|
name: "parentId",
|
|
1680
1701
|
onChange: h,
|
|
1681
|
-
orgUnits: o.filter((e) => e.id !==
|
|
1702
|
+
orgUnits: o.filter((e) => e.id !== t?.record?.id),
|
|
1682
1703
|
placeholder: "選擇上層組織",
|
|
1683
|
-
value:
|
|
1704
|
+
value: p
|
|
1684
1705
|
})
|
|
1685
1706
|
})
|
|
1686
1707
|
]
|
|
1687
1708
|
})
|
|
1688
1709
|
});
|
|
1689
1710
|
}
|
|
1690
|
-
function
|
|
1691
|
-
let [i, a] =
|
|
1692
|
-
return
|
|
1693
|
-
e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)),
|
|
1694
|
-
}, [e]), /* @__PURE__ */
|
|
1711
|
+
function Dt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
1712
|
+
let [i, a] = m(""), [o, s] = m("0"), [c, l] = m("");
|
|
1713
|
+
return u(() => {
|
|
1714
|
+
e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)), l(e.record?.name ?? ""));
|
|
1715
|
+
}, [e]), /* @__PURE__ */ P(C, {
|
|
1695
1716
|
cancelText: "取消",
|
|
1696
1717
|
confirmButtonProps: { disabled: !i || !c },
|
|
1697
1718
|
confirmText: e?.type === "EDIT" ? "儲存" : "建立",
|
|
@@ -1709,24 +1730,24 @@ function Tt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
|
1709
1730
|
showModalHeader: !0,
|
|
1710
1731
|
size: "regular",
|
|
1711
1732
|
title: e?.type === "EDIT" ? "編輯職位" : "新增職位",
|
|
1712
|
-
children: /* @__PURE__ */
|
|
1713
|
-
className:
|
|
1733
|
+
children: /* @__PURE__ */ F("div", {
|
|
1734
|
+
className: G.modalFields,
|
|
1714
1735
|
children: [
|
|
1715
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ P(At, {
|
|
1716
1737
|
label: "代碼",
|
|
1717
1738
|
name: "positionCode",
|
|
1718
1739
|
onChange: a,
|
|
1719
1740
|
placeholder: "例如 FIN-MGR",
|
|
1720
1741
|
value: i
|
|
1721
1742
|
}),
|
|
1722
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ P(At, {
|
|
1723
1744
|
label: "名稱",
|
|
1724
1745
|
name: "positionName",
|
|
1725
|
-
onChange:
|
|
1746
|
+
onChange: l,
|
|
1726
1747
|
placeholder: "例如 財務主管",
|
|
1727
1748
|
value: c
|
|
1728
1749
|
}),
|
|
1729
|
-
/* @__PURE__ */
|
|
1750
|
+
/* @__PURE__ */ P(At, {
|
|
1730
1751
|
label: "職等",
|
|
1731
1752
|
name: "positionLevel",
|
|
1732
1753
|
onChange: s,
|
|
@@ -1737,30 +1758,30 @@ function Tt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
|
1737
1758
|
})
|
|
1738
1759
|
});
|
|
1739
1760
|
}
|
|
1740
|
-
function
|
|
1741
|
-
let [g, _] =
|
|
1742
|
-
return
|
|
1761
|
+
function Ot({ membersById: t, modal: c, onClose: l, onSubmit: d, orgUnits: f, positions: p, saving: h }) {
|
|
1762
|
+
let [g, _] = m(Xt()), [v, y] = m(""), [b, x] = m(X[1]), [S, w] = m(null), [T, E] = m(null), [O, k] = m(null);
|
|
1763
|
+
return u(() => {
|
|
1743
1764
|
if (!c) return;
|
|
1744
|
-
let e = c.record,
|
|
1745
|
-
_(e?.effectiveFrom ??
|
|
1765
|
+
let e = c.record, i = e ? t.get(e.memberId) : null;
|
|
1766
|
+
_(e?.effectiveFrom ?? Xt()), y(e?.effectiveTo ?? ""), x(X.find((t) => t.value === e?.isPrimary) ?? X[1]), w(i ? r(i) : null), E(Yt(f.find((t) => t.id === e?.orgUnitId), n)), k(Yt(p.find((t) => t.id === e?.positionId), a));
|
|
1746
1767
|
}, [
|
|
1747
|
-
|
|
1768
|
+
t,
|
|
1748
1769
|
c,
|
|
1749
1770
|
f,
|
|
1750
|
-
|
|
1751
|
-
]), /* @__PURE__ */
|
|
1771
|
+
p
|
|
1772
|
+
]), /* @__PURE__ */ P(C, {
|
|
1752
1773
|
cancelText: "取消",
|
|
1753
|
-
confirmButtonProps: { disabled: !
|
|
1774
|
+
confirmButtonProps: { disabled: !S || !T },
|
|
1754
1775
|
confirmText: c?.type === "EDIT" ? "儲存" : "建立",
|
|
1755
1776
|
loading: h,
|
|
1756
1777
|
modalType: "standard",
|
|
1757
|
-
onCancel:
|
|
1758
|
-
onClose:
|
|
1778
|
+
onCancel: l,
|
|
1779
|
+
onClose: l,
|
|
1759
1780
|
onConfirm: () => void d({
|
|
1760
1781
|
effectiveFrom: g,
|
|
1761
1782
|
effectiveTo: v || null,
|
|
1762
1783
|
isPrimary: b.value,
|
|
1763
|
-
memberId:
|
|
1784
|
+
memberId: S?.id ?? null,
|
|
1764
1785
|
orgUnitId: T?.id ?? null,
|
|
1765
1786
|
positionId: O?.id ?? null
|
|
1766
1787
|
}),
|
|
@@ -1769,61 +1790,61 @@ function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1769
1790
|
showModalHeader: !0,
|
|
1770
1791
|
size: "regular",
|
|
1771
1792
|
title: c?.type === "EDIT" ? "編輯會員歸屬" : "新增會員歸屬",
|
|
1772
|
-
children: /* @__PURE__ */
|
|
1773
|
-
className:
|
|
1793
|
+
children: /* @__PURE__ */ F("div", {
|
|
1794
|
+
className: G.modalFields,
|
|
1774
1795
|
children: [
|
|
1775
|
-
/* @__PURE__ */
|
|
1796
|
+
/* @__PURE__ */ P(e, {
|
|
1776
1797
|
label: "會員",
|
|
1777
1798
|
name: "memberId",
|
|
1778
|
-
children: /* @__PURE__ */
|
|
1799
|
+
children: /* @__PURE__ */ P(s, {
|
|
1779
1800
|
name: "memberId",
|
|
1780
1801
|
onChange: w,
|
|
1781
1802
|
placeholder: "搜尋會員姓名或信箱",
|
|
1782
|
-
value:
|
|
1803
|
+
value: S
|
|
1783
1804
|
})
|
|
1784
1805
|
}),
|
|
1785
|
-
/* @__PURE__ */
|
|
1806
|
+
/* @__PURE__ */ P(e, {
|
|
1786
1807
|
label: "組織",
|
|
1787
1808
|
name: "orgUnitId",
|
|
1788
|
-
children: /* @__PURE__ */
|
|
1809
|
+
children: /* @__PURE__ */ P(i, {
|
|
1789
1810
|
name: "orgUnitId",
|
|
1790
|
-
onChange:
|
|
1811
|
+
onChange: E,
|
|
1791
1812
|
orgUnits: f,
|
|
1792
1813
|
placeholder: "選擇歸屬組織",
|
|
1793
1814
|
value: T
|
|
1794
1815
|
})
|
|
1795
1816
|
}),
|
|
1796
|
-
/* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ P(e, {
|
|
1797
1818
|
label: "職位",
|
|
1798
1819
|
name: "positionId",
|
|
1799
|
-
children: /* @__PURE__ */
|
|
1820
|
+
children: /* @__PURE__ */ P(o, {
|
|
1800
1821
|
name: "positionId",
|
|
1801
1822
|
onChange: k,
|
|
1802
1823
|
placeholder: "選擇職位",
|
|
1803
|
-
positions:
|
|
1824
|
+
positions: p,
|
|
1804
1825
|
value: O
|
|
1805
1826
|
})
|
|
1806
1827
|
}),
|
|
1807
|
-
/* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ P(e, {
|
|
1808
1829
|
label: "歸屬類型",
|
|
1809
1830
|
name: "isPrimary",
|
|
1810
|
-
children: /* @__PURE__ */
|
|
1831
|
+
children: /* @__PURE__ */ P(D, {
|
|
1811
1832
|
clearable: !1,
|
|
1812
1833
|
fullWidth: !0,
|
|
1813
|
-
onChange: (e) => x(
|
|
1814
|
-
options: [...
|
|
1834
|
+
onChange: (e) => x(qt(e)),
|
|
1835
|
+
options: [...X],
|
|
1815
1836
|
placeholder: "選擇歸屬類型",
|
|
1816
1837
|
value: b
|
|
1817
1838
|
})
|
|
1818
1839
|
}),
|
|
1819
|
-
/* @__PURE__ */
|
|
1840
|
+
/* @__PURE__ */ P(jt, {
|
|
1820
1841
|
label: "生效日",
|
|
1821
1842
|
name: "membershipEffectiveFrom",
|
|
1822
1843
|
onChange: _,
|
|
1823
1844
|
placeholder: "YYYY-MM-DD",
|
|
1824
1845
|
value: g
|
|
1825
1846
|
}),
|
|
1826
|
-
/* @__PURE__ */
|
|
1847
|
+
/* @__PURE__ */ P(jt, {
|
|
1827
1848
|
label: "結束日",
|
|
1828
1849
|
name: "membershipEffectiveTo",
|
|
1829
1850
|
onChange: y,
|
|
@@ -1834,69 +1855,69 @@ function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1834
1855
|
})
|
|
1835
1856
|
});
|
|
1836
1857
|
}
|
|
1837
|
-
function
|
|
1838
|
-
let [g, _] =
|
|
1839
|
-
|
|
1858
|
+
function kt({ membersById: t, modal: c, onClose: l, onSubmit: d, orgUnits: f, positions: p, saving: h }) {
|
|
1859
|
+
let [g, _] = m(Xt()), [v, y] = m(""), [b, x] = m(null), [S, w] = m(String(st)), [T, E] = m(null), [O, k] = m(null), [A, M] = m(null), [N, I] = m(Y[0]);
|
|
1860
|
+
u(() => {
|
|
1840
1861
|
if (!c) return;
|
|
1841
|
-
let e = c.record,
|
|
1842
|
-
_(e?.effectiveFrom ??
|
|
1862
|
+
let e = c.record, i = Y.find((t) => t.id === e?.scopeType) ?? Y[0];
|
|
1863
|
+
_(e?.effectiveFrom ?? Xt()), y(e?.effectiveTo ?? ""), x(Yt(e ? t.get(e.managerMemberId) : null, r)), w(String(e?.priority ?? st)), E(i.id === "MEMBER" ? Yt(e ? t.get(e.scopeId) : null, r) : null), k(i.id === "ORG_UNIT" ? Yt(f.find((t) => t.id === e?.scopeId), n) : null), M(i.id === "POSITION" ? Yt(p.find((t) => t.id === e?.scopeId), a) : null), I(i);
|
|
1843
1864
|
}, [
|
|
1844
|
-
|
|
1865
|
+
t,
|
|
1845
1866
|
c,
|
|
1846
1867
|
f,
|
|
1847
|
-
|
|
1868
|
+
p
|
|
1848
1869
|
]);
|
|
1849
|
-
let L =
|
|
1850
|
-
return /* @__PURE__ */
|
|
1870
|
+
let L = N.id === "MEMBER" ? T?.id : N.id === "ORG_UNIT" ? O?.id : A?.id, R = !!(N.id === "MEMBER" && T?.id && b?.id && T.id === b.id);
|
|
1871
|
+
return /* @__PURE__ */ P(C, {
|
|
1851
1872
|
cancelText: "取消",
|
|
1852
1873
|
confirmButtonProps: { disabled: !b || !L || R },
|
|
1853
1874
|
confirmText: c?.type === "EDIT" ? "儲存" : "建立",
|
|
1854
1875
|
loading: h,
|
|
1855
1876
|
modalType: "standard",
|
|
1856
|
-
onCancel:
|
|
1857
|
-
onClose:
|
|
1877
|
+
onCancel: l,
|
|
1878
|
+
onClose: l,
|
|
1858
1879
|
onConfirm: () => void d({
|
|
1859
1880
|
effectiveFrom: g,
|
|
1860
1881
|
effectiveTo: v || null,
|
|
1861
1882
|
managerMemberId: b?.id ?? null,
|
|
1862
|
-
priority: Number(
|
|
1883
|
+
priority: Number(S),
|
|
1863
1884
|
scopeId: L ?? null,
|
|
1864
|
-
scopeType:
|
|
1885
|
+
scopeType: N.id
|
|
1865
1886
|
}),
|
|
1866
1887
|
open: !!c,
|
|
1867
1888
|
showModalFooter: !0,
|
|
1868
1889
|
showModalHeader: !0,
|
|
1869
1890
|
size: "regular",
|
|
1870
1891
|
title: c?.type === "EDIT" ? "編輯主管規則" : "新增主管規則",
|
|
1871
|
-
children: /* @__PURE__ */
|
|
1872
|
-
className:
|
|
1892
|
+
children: /* @__PURE__ */ F("div", {
|
|
1893
|
+
className: G.modalFields,
|
|
1873
1894
|
children: [
|
|
1874
|
-
/* @__PURE__ */
|
|
1895
|
+
/* @__PURE__ */ P(e, {
|
|
1875
1896
|
label: "套用範圍",
|
|
1876
1897
|
name: "scopeType",
|
|
1877
|
-
children: /* @__PURE__ */
|
|
1898
|
+
children: /* @__PURE__ */ P(D, {
|
|
1878
1899
|
clearable: !1,
|
|
1879
1900
|
fullWidth: !0,
|
|
1880
|
-
onChange: (e) => I(
|
|
1881
|
-
options: [...
|
|
1901
|
+
onChange: (e) => I(Vt(e)),
|
|
1902
|
+
options: [...Y],
|
|
1882
1903
|
placeholder: "選擇套用範圍",
|
|
1883
|
-
value:
|
|
1904
|
+
value: N
|
|
1884
1905
|
})
|
|
1885
1906
|
}),
|
|
1886
|
-
|
|
1907
|
+
N.id === "MEMBER" ? /* @__PURE__ */ P(e, {
|
|
1887
1908
|
label: "會員",
|
|
1888
1909
|
name: "scopeMemberId",
|
|
1889
|
-
children: /* @__PURE__ */
|
|
1910
|
+
children: /* @__PURE__ */ P(s, {
|
|
1890
1911
|
name: "scopeMemberId",
|
|
1891
|
-
onChange:
|
|
1912
|
+
onChange: E,
|
|
1892
1913
|
placeholder: "搜尋套用會員",
|
|
1893
1914
|
value: T
|
|
1894
1915
|
})
|
|
1895
1916
|
}) : null,
|
|
1896
|
-
|
|
1917
|
+
N.id === "ORG_UNIT" ? /* @__PURE__ */ P(e, {
|
|
1897
1918
|
label: "組織",
|
|
1898
1919
|
name: "scopeOrgUnitId",
|
|
1899
|
-
children: /* @__PURE__ */
|
|
1920
|
+
children: /* @__PURE__ */ P(i, {
|
|
1900
1921
|
name: "scopeOrgUnitId",
|
|
1901
1922
|
onChange: k,
|
|
1902
1923
|
orgUnits: f,
|
|
@@ -1904,48 +1925,48 @@ function Dt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1904
1925
|
value: O
|
|
1905
1926
|
})
|
|
1906
1927
|
}) : null,
|
|
1907
|
-
|
|
1928
|
+
N.id === "POSITION" ? /* @__PURE__ */ P(e, {
|
|
1908
1929
|
label: "職位",
|
|
1909
1930
|
name: "scopePositionId",
|
|
1910
|
-
children: /* @__PURE__ */
|
|
1931
|
+
children: /* @__PURE__ */ P(o, {
|
|
1911
1932
|
name: "scopePositionId",
|
|
1912
1933
|
onChange: M,
|
|
1913
1934
|
placeholder: "選擇套用職位",
|
|
1914
|
-
positions:
|
|
1915
|
-
value:
|
|
1935
|
+
positions: p,
|
|
1936
|
+
value: A
|
|
1916
1937
|
})
|
|
1917
1938
|
}) : null,
|
|
1918
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ P(e, {
|
|
1919
1940
|
label: "簽核主管",
|
|
1920
1941
|
name: "managerMemberId",
|
|
1921
|
-
children: /* @__PURE__ */
|
|
1942
|
+
children: /* @__PURE__ */ P(s, {
|
|
1922
1943
|
name: "managerMemberId",
|
|
1923
1944
|
onChange: x,
|
|
1924
1945
|
placeholder: "搜尋簽核主管",
|
|
1925
1946
|
value: b
|
|
1926
1947
|
})
|
|
1927
1948
|
}),
|
|
1928
|
-
R ? /* @__PURE__ */
|
|
1949
|
+
R ? /* @__PURE__ */ P(j, {
|
|
1929
1950
|
color: "text-error",
|
|
1930
1951
|
variant: "caption",
|
|
1931
1952
|
children: "簽核主管不可設定為套用會員本人。"
|
|
1932
1953
|
}) : null,
|
|
1933
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ P(At, {
|
|
1934
1955
|
hintText: "數字越大越優先,同一位成員命中多條規則時只會採用最高的那一層。建議:指定到人 200、部門主管 100、全公司通用的墊底規則 10。",
|
|
1935
1956
|
label: "優先序",
|
|
1936
1957
|
name: "managerPriority",
|
|
1937
1958
|
onChange: w,
|
|
1938
1959
|
placeholder: "例如 100",
|
|
1939
|
-
value:
|
|
1960
|
+
value: S
|
|
1940
1961
|
}),
|
|
1941
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ P(jt, {
|
|
1942
1963
|
label: "生效日",
|
|
1943
1964
|
name: "managerEffectiveFrom",
|
|
1944
1965
|
onChange: _,
|
|
1945
1966
|
placeholder: "YYYY-MM-DD",
|
|
1946
1967
|
value: g
|
|
1947
1968
|
}),
|
|
1948
|
-
/* @__PURE__ */
|
|
1969
|
+
/* @__PURE__ */ P(jt, {
|
|
1949
1970
|
label: "結束日",
|
|
1950
1971
|
name: "managerEffectiveTo",
|
|
1951
1972
|
onChange: y,
|
|
@@ -1956,12 +1977,12 @@ function Dt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1956
1977
|
})
|
|
1957
1978
|
});
|
|
1958
1979
|
}
|
|
1959
|
-
function
|
|
1960
|
-
return /* @__PURE__ */
|
|
1980
|
+
function At({ hintText: t, label: n, name: r, onChange: i, placeholder: a, value: o }) {
|
|
1981
|
+
return /* @__PURE__ */ P(e, {
|
|
1961
1982
|
hintText: t,
|
|
1962
1983
|
label: n,
|
|
1963
1984
|
name: r,
|
|
1964
|
-
children: /* @__PURE__ */
|
|
1985
|
+
children: /* @__PURE__ */ P(S, {
|
|
1965
1986
|
fullWidth: !0,
|
|
1966
1987
|
name: r,
|
|
1967
1988
|
onChange: (e) => i(e.target.value),
|
|
@@ -1970,118 +1991,118 @@ function $({ hintText: t, label: n, name: r, onChange: i, placeholder: a, value:
|
|
|
1970
1991
|
})
|
|
1971
1992
|
});
|
|
1972
1993
|
}
|
|
1973
|
-
function
|
|
1974
|
-
return /* @__PURE__ */
|
|
1994
|
+
function jt({ label: t, name: n, onChange: r, placeholder: i, value: a }) {
|
|
1995
|
+
return /* @__PURE__ */ P(e, {
|
|
1975
1996
|
label: t,
|
|
1976
1997
|
name: n,
|
|
1977
|
-
children: /* @__PURE__ */
|
|
1998
|
+
children: /* @__PURE__ */ P(_, {
|
|
1978
1999
|
format: "YYYY-MM-DD",
|
|
1979
2000
|
fullWidth: !0,
|
|
1980
2001
|
inputProps: { name: n },
|
|
1981
|
-
onChange: (e) => r(
|
|
2002
|
+
onChange: (e) => r(Zt(e)),
|
|
1982
2003
|
placeholder: i,
|
|
1983
2004
|
value: a.trim() ? a : void 0
|
|
1984
2005
|
})
|
|
1985
2006
|
});
|
|
1986
2007
|
}
|
|
1987
|
-
function
|
|
2008
|
+
function Mt(e, t) {
|
|
1988
2009
|
return [.../* @__PURE__ */ new Set([
|
|
1989
2010
|
...e.map((e) => e.memberId),
|
|
1990
2011
|
...t.map((e) => e.managerMemberId),
|
|
1991
2012
|
...t.filter((e) => e.scopeType === "MEMBER").map((e) => e.scopeId)
|
|
1992
2013
|
])];
|
|
1993
2014
|
}
|
|
1994
|
-
function
|
|
1995
|
-
return e.scopeType === "MEMBER" ? `會員:${
|
|
2015
|
+
function Nt(e, t) {
|
|
2016
|
+
return e.scopeType === "MEMBER" ? `會員:${Pt(t.membersById.get(e.scopeId))}` : e.scopeType === "ORG_UNIT" ? `組織:${Ft(t.orgUnitsById.get(e.scopeId))}` : `職位:${Lt(t.positionsById.get(e.scopeId))}`;
|
|
1996
2017
|
}
|
|
1997
|
-
function
|
|
1998
|
-
return e ?
|
|
2018
|
+
function Pt(e) {
|
|
2019
|
+
return e ? t(e.name, e.email, "dot") : "未知會員";
|
|
1999
2020
|
}
|
|
2000
|
-
function
|
|
2021
|
+
function Ft(e) {
|
|
2001
2022
|
return e ? `${e.name} · ${e.code}` : "未知組織";
|
|
2002
2023
|
}
|
|
2003
|
-
function
|
|
2004
|
-
return
|
|
2024
|
+
function It(e) {
|
|
2025
|
+
return q.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
|
|
2005
2026
|
}
|
|
2006
|
-
function
|
|
2027
|
+
function Lt(e) {
|
|
2007
2028
|
return e ? `${e.name} · ${e.code}` : "未指定";
|
|
2008
2029
|
}
|
|
2009
|
-
function
|
|
2030
|
+
function Rt(e) {
|
|
2010
2031
|
return e === "MANAGERS" || e === "MEMBERSHIPS" || e === "POSITIONS" ? e : "ORG_UNITS";
|
|
2011
2032
|
}
|
|
2012
|
-
function
|
|
2013
|
-
let t =
|
|
2033
|
+
function zt(e) {
|
|
2034
|
+
let t = $(e) ? e : null;
|
|
2014
2035
|
if (typeof t?.id == "string") {
|
|
2015
2036
|
let e = t.id;
|
|
2016
|
-
return
|
|
2037
|
+
return q.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? q[2];
|
|
2017
2038
|
}
|
|
2018
|
-
return
|
|
2039
|
+
return q[2];
|
|
2019
2040
|
}
|
|
2020
|
-
function
|
|
2021
|
-
let t =
|
|
2041
|
+
function Bt(e) {
|
|
2042
|
+
let t = $(e) ? e : null;
|
|
2022
2043
|
if (typeof t?.id == "string") {
|
|
2023
2044
|
let e = t.id;
|
|
2024
|
-
return
|
|
2045
|
+
return J.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? ct;
|
|
2025
2046
|
}
|
|
2026
|
-
return
|
|
2047
|
+
return ct;
|
|
2027
2048
|
}
|
|
2028
|
-
function
|
|
2029
|
-
return
|
|
2049
|
+
function Vt(e) {
|
|
2050
|
+
return Jt(e, Y, Y[0]);
|
|
2030
2051
|
}
|
|
2031
|
-
function
|
|
2032
|
-
return
|
|
2052
|
+
function Ht(e) {
|
|
2053
|
+
return Jt(e, ut, lt);
|
|
2033
2054
|
}
|
|
2034
|
-
function
|
|
2035
|
-
return
|
|
2055
|
+
function Ut(e) {
|
|
2056
|
+
return Jt(e, ft, dt);
|
|
2036
2057
|
}
|
|
2037
|
-
function
|
|
2038
|
-
let t =
|
|
2039
|
-
return
|
|
2058
|
+
function Wt(e) {
|
|
2059
|
+
let t = $(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
|
|
2060
|
+
return ft.find((e) => e.id === n) ?? null;
|
|
2040
2061
|
}
|
|
2041
|
-
function
|
|
2042
|
-
let t =
|
|
2062
|
+
function Gt(e) {
|
|
2063
|
+
let t = $(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
2043
2064
|
return n && r ? {
|
|
2044
2065
|
id: n,
|
|
2045
2066
|
name: r
|
|
2046
2067
|
} : null;
|
|
2047
2068
|
}
|
|
2048
|
-
function
|
|
2049
|
-
let t =
|
|
2069
|
+
function Kt(e) {
|
|
2070
|
+
let t = $(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
2050
2071
|
return n && r ? {
|
|
2051
2072
|
id: n,
|
|
2052
2073
|
name: r
|
|
2053
2074
|
} : null;
|
|
2054
2075
|
}
|
|
2055
|
-
function
|
|
2056
|
-
return
|
|
2076
|
+
function qt(e) {
|
|
2077
|
+
return Jt(e, X, X[1]);
|
|
2057
2078
|
}
|
|
2058
|
-
function
|
|
2059
|
-
let r =
|
|
2079
|
+
function Jt(e, t, n) {
|
|
2080
|
+
let r = $(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
|
|
2060
2081
|
return t.find((e) => e.id === i) ?? n;
|
|
2061
2082
|
}
|
|
2062
|
-
function
|
|
2083
|
+
function $(e) {
|
|
2063
2084
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2064
2085
|
}
|
|
2065
|
-
function
|
|
2086
|
+
function Yt(e, t) {
|
|
2066
2087
|
return e ? t(e) : null;
|
|
2067
2088
|
}
|
|
2068
|
-
function
|
|
2069
|
-
return
|
|
2089
|
+
function Xt() {
|
|
2090
|
+
return Qt(/* @__PURE__ */ new Date());
|
|
2070
2091
|
}
|
|
2071
|
-
function
|
|
2092
|
+
function Zt(e) {
|
|
2072
2093
|
let t = e ? new Date(e) : null;
|
|
2073
|
-
return t && !Number.isNaN(t.getTime()) ?
|
|
2094
|
+
return t && !Number.isNaN(t.getTime()) ? Qt(t) : "";
|
|
2074
2095
|
}
|
|
2075
|
-
function
|
|
2076
|
-
return `${e.getFullYear()}-${
|
|
2096
|
+
function Qt(e) {
|
|
2097
|
+
return `${e.getFullYear()}-${$t(e.getMonth() + 1)}-${$t(e.getDate())}`;
|
|
2077
2098
|
}
|
|
2078
|
-
function
|
|
2099
|
+
function $t(e) {
|
|
2079
2100
|
return String(e).padStart(2, "0");
|
|
2080
2101
|
}
|
|
2081
|
-
function
|
|
2102
|
+
function en(e) {
|
|
2082
2103
|
return e instanceof Error ? e.message : "讀取組織資料失敗。";
|
|
2083
2104
|
}
|
|
2084
2105
|
//#endregion
|
|
2085
|
-
export {
|
|
2106
|
+
export { _t as t };
|
|
2086
2107
|
|
|
2087
|
-
//# sourceMappingURL=orgs-
|
|
2108
|
+
//# sourceMappingURL=orgs-CY0i1fie.js.map
|