@rytass/bpm-core-react 0.3.1 → 0.3.2
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 +131 -0
- package/dist/chunks/app-navigation-BSkMsEhy.js +268 -0
- package/dist/chunks/app-navigation-BSkMsEhy.js.map +1 -0
- package/dist/chunks/app-navigation-KnlJCUp1.cjs +2 -0
- package/dist/chunks/app-navigation-KnlJCUp1.cjs.map +1 -0
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs +2 -0
- package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs.map +1 -0
- package/dist/chunks/{approval-instance-list-page-nmzMrj0b.js → approval-instance-list-page-CqNdoZqx.js} +73 -72
- package/dist/chunks/approval-instance-list-page-CqNdoZqx.js.map +1 -0
- package/dist/chunks/builder-CMlJfQHE.cjs +3 -0
- package/dist/chunks/builder-CMlJfQHE.cjs.map +1 -0
- package/dist/chunks/{builder-DqZskyXC.js → builder-D950gct_.js} +492 -491
- package/dist/chunks/builder-D950gct_.js.map +1 -0
- package/dist/chunks/categories-5yEM3p3N.cjs +2 -0
- package/dist/chunks/categories-5yEM3p3N.cjs.map +1 -0
- package/dist/chunks/{categories-DTEl182t.js → categories-BIpOG451.js} +115 -114
- package/dist/chunks/categories-BIpOG451.js.map +1 -0
- package/dist/chunks/dashboard-page-1K_jQXQk.cjs +2 -0
- package/dist/chunks/dashboard-page-1K_jQXQk.cjs.map +1 -0
- package/dist/chunks/dashboard-page-R_T2OEiE.js +122 -0
- package/dist/chunks/dashboard-page-R_T2OEiE.js.map +1 -0
- package/dist/chunks/{delegations-C5PzZ5Kn.js → delegations-B2j-wNEO.js} +193 -192
- package/dist/chunks/delegations-B2j-wNEO.js.map +1 -0
- package/dist/chunks/delegations-CsB9ozLu.cjs +2 -0
- package/dist/chunks/delegations-CsB9ozLu.cjs.map +1 -0
- package/dist/chunks/delegations-CvtwTXNP.cjs +2 -0
- package/dist/chunks/delegations-CvtwTXNP.cjs.map +1 -0
- package/dist/chunks/{delegations-C-ZrwzvU.js → delegations-dKodb0WW.js} +175 -174
- package/dist/chunks/delegations-dKodb0WW.js.map +1 -0
- package/dist/chunks/{detail-CfFyU5zC.js → detail-BcGAqJ_R.js} +465 -464
- package/dist/chunks/detail-BcGAqJ_R.js.map +1 -0
- package/dist/chunks/detail-CqjqLd65.cjs +2 -0
- package/dist/chunks/detail-CqjqLd65.cjs.map +1 -0
- package/dist/chunks/{format-date-time-isOa3e9q.cjs → format-date-time-26_pFvv4.cjs} +2 -2
- package/dist/chunks/{format-date-time-isOa3e9q.cjs.map → format-date-time-26_pFvv4.cjs.map} +1 -1
- package/dist/chunks/notifications-2swRqDPF.js +198 -0
- package/dist/chunks/notifications-2swRqDPF.js.map +1 -0
- package/dist/chunks/notifications-BaYDebFt.cjs +2 -0
- package/dist/chunks/notifications-BaYDebFt.cjs.map +1 -0
- package/dist/chunks/{orgs-xrdhb3hS.js → orgs-CuHxxd_n.js} +608 -607
- package/dist/chunks/orgs-CuHxxd_n.js.map +1 -0
- package/dist/chunks/orgs-YMiVLNvL.cjs +2 -0
- package/dist/chunks/orgs-YMiVLNvL.cjs.map +1 -0
- package/dist/chunks/routes-config-2aKbWq2H.cjs +2 -0
- package/dist/chunks/routes-config-2aKbWq2H.cjs.map +1 -0
- package/dist/chunks/routes-config-dxahImVe.js +43 -0
- package/dist/chunks/routes-config-dxahImVe.js.map +1 -0
- package/dist/chunks/templates-DTkbSgFY.cjs +2 -0
- package/dist/chunks/templates-DTkbSgFY.cjs.map +1 -0
- package/dist/chunks/templates-DoDWM68t.js +384 -0
- package/dist/chunks/templates-DoDWM68t.js.map +1 -0
- package/dist/chunks/users-3ySyUW4u.cjs +2 -0
- package/dist/chunks/users-3ySyUW4u.cjs.map +1 -0
- package/dist/chunks/{users-CY4-NK3j.js → users-sMfrSjRQ.js} +75 -74
- package/dist/chunks/users-sMfrSjRQ.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +101 -99
- package/dist/index.js.map +1 -1
- package/dist/lib/routes-config.d.ts +96 -0
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.ts +1 -0
- package/dist/next/index.js +22 -21
- package/dist/next/index.js.map +1 -1
- package/dist/pages/admin/delegations/index.cjs +1 -1
- package/dist/pages/admin/delegations/index.js +1 -1
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.js +1 -1
- package/dist/pages/admin/users/index.cjs +1 -1
- package/dist/pages/admin/users/index.js +1 -1
- package/dist/pages/delegations/index.cjs +1 -1
- package/dist/pages/delegations/index.js +1 -1
- package/dist/pages/forms/builder/index.cjs +1 -1
- package/dist/pages/forms/builder/index.js +1 -1
- package/dist/pages/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/settings/notifications/index.cjs +1 -1
- package/dist/pages/settings/notifications/index.js +1 -1
- package/dist/pages/templates/categories/index.cjs +1 -1
- package/dist/pages/templates/categories/index.js +1 -1
- package/dist/pages/templates/index.cjs +1 -1
- package/dist/pages/templates/index.js +1 -1
- package/dist/views/admin/delegations/index.cjs +1 -1
- package/dist/views/admin/delegations/index.js +1 -1
- 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 -1
- package/dist/views/admin/users/index.cjs +1 -1
- package/dist/views/admin/users/index.js +1 -1
- package/dist/views/cc/index.cjs +1 -1
- package/dist/views/cc/index.js +1 -1
- package/dist/views/dashboard/index.cjs +1 -1
- package/dist/views/dashboard/index.js +1 -1
- package/dist/views/delegations/index.cjs +1 -1
- package/dist/views/delegations/index.js +1 -1
- package/dist/views/forms/builder/index.cjs +1 -1
- package/dist/views/forms/builder/index.js +1 -1
- package/dist/views/forms/index.cjs +1 -1
- package/dist/views/forms/index.cjs.map +1 -1
- package/dist/views/forms/index.js +78 -77
- package/dist/views/forms/index.js.map +1 -1
- package/dist/views/inbox/index.cjs +1 -1
- package/dist/views/inbox/index.cjs.map +1 -1
- package/dist/views/inbox/index.js +106 -105
- 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 -1
- 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 +90 -89
- package/dist/views/instances/new/index.js.map +1 -1
- package/dist/views/search/index.cjs +1 -1
- package/dist/views/search/index.js +1 -1
- package/dist/views/sent/index.cjs +1 -1
- package/dist/views/sent/index.js +1 -1
- package/dist/views/settings/index.cjs +1 -1
- package/dist/views/settings/index.js +1 -1
- package/dist/views/settings/notifications/index.cjs +1 -1
- package/dist/views/settings/notifications/index.js +1 -1
- package/dist/views/templates/categories/index.cjs +1 -1
- package/dist/views/templates/categories/index.js +1 -1
- package/dist/views/templates/designer/index.cjs +6 -6
- package/dist/views/templates/designer/index.cjs.map +1 -1
- package/dist/views/templates/designer/index.js +589 -588
- package/dist/views/templates/designer/index.js.map +1 -1
- package/dist/views/templates/index.cjs +1 -1
- package/dist/views/templates/index.js +2 -2
- package/dist/views/templates/versions/index.cjs +1 -1
- package/dist/views/templates/versions/index.cjs.map +1 -1
- package/dist/views/templates/versions/index.js +44 -43
- package/dist/views/templates/versions/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/app-navigation-C_mbz7jx.cjs +0 -2
- package/dist/chunks/app-navigation-C_mbz7jx.cjs.map +0 -1
- package/dist/chunks/app-navigation-uwbNEw9P.js +0 -262
- package/dist/chunks/app-navigation-uwbNEw9P.js.map +0 -1
- package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs +0 -2
- package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs.map +0 -1
- package/dist/chunks/approval-instance-list-page-nmzMrj0b.js.map +0 -1
- package/dist/chunks/builder-DPhAH381.cjs +0 -3
- package/dist/chunks/builder-DPhAH381.cjs.map +0 -1
- package/dist/chunks/builder-DqZskyXC.js.map +0 -1
- package/dist/chunks/categories-DEijUOnw.cjs +0 -2
- package/dist/chunks/categories-DEijUOnw.cjs.map +0 -1
- package/dist/chunks/categories-DTEl182t.js.map +0 -1
- package/dist/chunks/dashboard-page-DCmuB0Rw.cjs +0 -2
- package/dist/chunks/dashboard-page-DCmuB0Rw.cjs.map +0 -1
- package/dist/chunks/dashboard-page-Dx5PeEeN.js +0 -117
- package/dist/chunks/dashboard-page-Dx5PeEeN.js.map +0 -1
- package/dist/chunks/delegations-C-ZrwzvU.js.map +0 -1
- package/dist/chunks/delegations-C5PzZ5Kn.js.map +0 -1
- package/dist/chunks/delegations-DOGDvybX.cjs +0 -2
- package/dist/chunks/delegations-DOGDvybX.cjs.map +0 -1
- package/dist/chunks/delegations-DkDBWOQ7.cjs +0 -2
- package/dist/chunks/delegations-DkDBWOQ7.cjs.map +0 -1
- package/dist/chunks/detail-B2gcOPkd.cjs +0 -2
- package/dist/chunks/detail-B2gcOPkd.cjs.map +0 -1
- package/dist/chunks/detail-CfFyU5zC.js.map +0 -1
- package/dist/chunks/notifications-CPQ-nVar.cjs +0 -2
- package/dist/chunks/notifications-CPQ-nVar.cjs.map +0 -1
- package/dist/chunks/notifications-DweexUVy.js +0 -197
- package/dist/chunks/notifications-DweexUVy.js.map +0 -1
- package/dist/chunks/orgs-DgZ0DQ3-.cjs +0 -2
- package/dist/chunks/orgs-DgZ0DQ3-.cjs.map +0 -1
- package/dist/chunks/orgs-xrdhb3hS.js.map +0 -1
- package/dist/chunks/templates-PK_VYvcy.js +0 -383
- package/dist/chunks/templates-PK_VYvcy.js.map +0 -1
- package/dist/chunks/templates-x1OJZmsG.cjs +0 -2
- package/dist/chunks/templates-x1OJZmsG.cjs.map +0 -1
- package/dist/chunks/users-CY4-NK3j.js.map +0 -1
- package/dist/chunks/users-DHnu_056.cjs +0 -2
- package/dist/chunks/users-DHnu_056.cjs.map +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./app-navigation-
|
|
3
|
-
import {
|
|
4
|
-
import { t as s } from "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import ne from "@mezzanine-ui/
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
2
|
+
import { t as e } from "./app-navigation-BSkMsEhy.js";
|
|
3
|
+
import { r as t } from "./routes-config-dxahImVe.js";
|
|
4
|
+
import { a as n, i as r, n as i, o as a, r as o, t as s } from "./admin-pickers-DLlG_1du.js";
|
|
5
|
+
import { t as c } from "./bpm-form-field-Cao0rMol.js";
|
|
6
|
+
import { forwardRef as l, useCallback as u, useEffect as d, useImperativeHandle as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
7
|
+
import { AutoComplete as g, Button as _, DatePicker as v, Filter as y, FilterArea as b, FilterLine as x, FormField as S, Input as C, Modal as w, PageHeader as T, Section as E, SectionGroup as D, Select as O, Tab as k, TabItem as A, Table as j, Typography as M } from "@mezzanine-ui/react";
|
|
8
|
+
import { resolveMembers as N } from "@rytass/bpm-core-client";
|
|
9
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
10
|
+
import { CloseIcon as ee, EditIcon as te, PlusIcon as ne, SaveIcon as re } from "@mezzanine-ui/icons";
|
|
11
|
+
import ie from "@mezzanine-ui/react/ContentHeader";
|
|
12
|
+
import { FormFieldLayout as L } from "@mezzanine-ui/core/form";
|
|
13
|
+
import { commitOrgUnitTreeDraft as ae, createManagerResolution as oe, createMembership as se, createOrgUnit as ce, createPosition as le, deleteManagerResolution as ue, deleteMembership as de, deleteOrgUnit as fe, readOrganizationDashboard as pe, updateManagerResolution as me, updateMembership as he, updateOrgUnit as ge, updatePosition as _e } from "@rytass/bpm-core-client/organization";
|
|
14
|
+
import { Background as ve, ConnectionMode as ye, Controls as be, Handle as xe, MiniMap as Se, Position as R, ReactFlow as Ce, applyNodeChanges as we } from "@xyflow/react";
|
|
15
|
+
import * as z from "dagre";
|
|
15
16
|
import '../orgs.css';//#region src/lib/org-tree-draft.ts
|
|
16
|
-
function
|
|
17
|
+
function B(e) {
|
|
17
18
|
return new Map(e.map((e) => [e.id, e.parentId]));
|
|
18
19
|
}
|
|
19
20
|
function Te({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
@@ -64,7 +65,7 @@ function Oe({ 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",
|
|
@@ -77,16 +78,16 @@ var B = {
|
|
|
77
78
|
orgTreeNodeHeader: "bpm_orgTreeNodeHeader_LEXl-",
|
|
78
79
|
orgTreeNodeBadge: "bpm_orgTreeNodeBadge_zLc7t",
|
|
79
80
|
orgTreeNodeActions: "bpm_orgTreeNodeActions_cMldI"
|
|
80
|
-
},
|
|
81
|
+
}, H = "__org-tree-root__", U = 232, ke = 118, Ae = 232, je = 86, Me = 320, Ne = {
|
|
81
82
|
COMPANY: "公司",
|
|
82
83
|
DEPARTMENT: "部門",
|
|
83
84
|
DIVISION: "事業群",
|
|
84
85
|
TEAM: "小組"
|
|
85
|
-
}, Pe = { orgUnit: Ie }, Fe =
|
|
86
|
-
let [s, c] =
|
|
86
|
+
}, Pe = { orgUnit: Ie }, Fe = l(function({ onCreateChild: e, onCreateRoot: t, onEditOrgUnit: n, onSaveDraft: r, onStateChange: i, orgUnits: a }, o) {
|
|
87
|
+
let [s, c] = h(!1), [l, m] = h(null), [g, _] = h(null), [v, y] = h(() => B(a)), [b, x] = h([]), S = p(() => new Map(a.map((e) => [e.id, e])), [a]), C = p(() => Ee({
|
|
87
88
|
orgUnits: a,
|
|
88
89
|
parentDraft: v
|
|
89
|
-
}), [a, v]), w =
|
|
90
|
+
}), [a, v]), w = p(() => Le({
|
|
90
91
|
isEditing: s,
|
|
91
92
|
onCreateChild: (n) => {
|
|
92
93
|
n ? e(n) : t();
|
|
@@ -109,11 +110,11 @@ var B = {
|
|
|
109
110
|
v,
|
|
110
111
|
g
|
|
111
112
|
]), T = C.length > 0;
|
|
112
|
-
|
|
113
|
-
cancelEditing:
|
|
113
|
+
f(o, () => ({
|
|
114
|
+
cancelEditing: j,
|
|
114
115
|
saveDraft: N,
|
|
115
116
|
startEditing: A
|
|
116
|
-
})),
|
|
117
|
+
})), d(() => {
|
|
117
118
|
i({
|
|
118
119
|
hasDraftChanges: T,
|
|
119
120
|
isEditing: s
|
|
@@ -122,74 +123,74 @@ var B = {
|
|
|
122
123
|
T,
|
|
123
124
|
s,
|
|
124
125
|
i
|
|
125
|
-
]),
|
|
126
|
-
y(
|
|
127
|
-
}, [a]),
|
|
126
|
+
]), d(() => {
|
|
127
|
+
y(B(a)), _(null), m(null), c(!1);
|
|
128
|
+
}, [a]), d(() => {
|
|
128
129
|
x(w.nodes);
|
|
129
130
|
}, [w.nodes]);
|
|
130
|
-
let E =
|
|
131
|
+
let E = u((e, t) => {
|
|
131
132
|
y((n) => {
|
|
132
133
|
let r = Te({
|
|
133
134
|
orgUnitId: e,
|
|
134
135
|
parentDraft: n,
|
|
135
136
|
parentId: t
|
|
136
137
|
});
|
|
137
|
-
return
|
|
138
|
+
return m(r.message), r.parentDraft;
|
|
138
139
|
});
|
|
139
|
-
}, []), D =
|
|
140
|
+
}, []), D = u((e) => {
|
|
140
141
|
if (!s || !e.target || !e.source) return;
|
|
141
|
-
let t = e.source ===
|
|
142
|
-
if (e.target ===
|
|
143
|
-
|
|
142
|
+
let t = e.source === H ? null : e.source;
|
|
143
|
+
if (e.target === H) {
|
|
144
|
+
m("根節點不能搬移到其他節點下。");
|
|
144
145
|
return;
|
|
145
146
|
}
|
|
146
147
|
E(e.target, t);
|
|
147
|
-
}, [E, s]), O =
|
|
148
|
-
s && x((t) =>
|
|
149
|
-
}, [s]), k =
|
|
150
|
-
if (!s || t.id ===
|
|
151
|
-
let r =
|
|
148
|
+
}, [E, s]), O = u((e) => {
|
|
149
|
+
s && x((t) => we(e, [...t]));
|
|
150
|
+
}, [s]), k = u((e, t, n) => {
|
|
151
|
+
if (!s || t.id === H) return;
|
|
152
|
+
let r = Be(e, t.id) ?? ze(t, n);
|
|
152
153
|
if (r === void 0) {
|
|
153
|
-
|
|
154
|
+
m("拖曳到目標父節點附近,或從父節點拉線到子節點。");
|
|
154
155
|
return;
|
|
155
156
|
}
|
|
156
|
-
E(t.id, r ===
|
|
157
|
+
E(t.id, r === H ? null : r);
|
|
157
158
|
}, [E, s]);
|
|
158
159
|
function A() {
|
|
159
|
-
c(!0), y(
|
|
160
|
+
c(!0), y(B(a)), m("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
-
c(!1), y(
|
|
162
|
+
function j() {
|
|
163
|
+
c(!1), y(B(a)), m("已取消草稿變更。");
|
|
163
164
|
}
|
|
164
165
|
async function N() {
|
|
165
166
|
if (!r) {
|
|
166
|
-
|
|
167
|
+
m("批次儲存 API 尚未接上,草稿仍保留在前端。");
|
|
167
168
|
return;
|
|
168
169
|
}
|
|
169
|
-
await r(C), c(!1),
|
|
170
|
+
await r(C), c(!1), m("組織樹草稿已儲存。");
|
|
170
171
|
}
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
className:
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
-
className:
|
|
175
|
-
children: [/* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ I("div", {
|
|
173
|
+
className: V.orgTreeEditor,
|
|
174
|
+
children: [/* @__PURE__ */ I("div", {
|
|
175
|
+
className: V.orgTreeSummary,
|
|
176
|
+
children: [/* @__PURE__ */ F(M, {
|
|
176
177
|
color: "text-neutral",
|
|
177
178
|
variant: "caption",
|
|
178
|
-
children:
|
|
179
|
-
}), T ? /* @__PURE__ */
|
|
180
|
-
className:
|
|
181
|
-
children: C.map((e) => /* @__PURE__ */
|
|
182
|
-
|
|
179
|
+
children: l ?? (T ? `目前有 ${C.length} 筆父子關係草稿變更。` : "目前沒有草稿變更。")
|
|
180
|
+
}), T ? /* @__PURE__ */ F("ul", {
|
|
181
|
+
className: V.orgTreeChangeList,
|
|
182
|
+
children: C.map((e) => /* @__PURE__ */ I("li", { children: [
|
|
183
|
+
Ge(e.orgUnitId, S),
|
|
183
184
|
":",
|
|
184
|
-
|
|
185
|
+
Ge(e.previousParentId, S),
|
|
185
186
|
" -> ",
|
|
186
|
-
|
|
187
|
+
Ge(e.parentId, S)
|
|
187
188
|
] }, e.orgUnitId))
|
|
188
189
|
}) : null]
|
|
189
|
-
}), /* @__PURE__ */
|
|
190
|
-
className:
|
|
191
|
-
children: /* @__PURE__ */
|
|
192
|
-
connectionMode:
|
|
190
|
+
}), /* @__PURE__ */ F("div", {
|
|
191
|
+
className: V.orgTreeCanvas,
|
|
192
|
+
children: /* @__PURE__ */ I(Ce, {
|
|
193
|
+
connectionMode: ye.Strict,
|
|
193
194
|
edges: [...w.edges],
|
|
194
195
|
fitView: !0,
|
|
195
196
|
fitViewOptions: { padding: .18 },
|
|
@@ -205,10 +206,10 @@ var B = {
|
|
|
205
206
|
nodesDraggable: s,
|
|
206
207
|
onConnect: D,
|
|
207
208
|
onNodeClick: (e, t) => {
|
|
208
|
-
_(t.id ===
|
|
209
|
+
_(t.id === H ? null : t.id);
|
|
209
210
|
},
|
|
210
211
|
onNodeDoubleClick: (e, t) => {
|
|
211
|
-
if (t.id !==
|
|
212
|
+
if (t.id !== H) {
|
|
212
213
|
let e = S.get(t.id);
|
|
213
214
|
e && n(e);
|
|
214
215
|
}
|
|
@@ -219,9 +220,9 @@ var B = {
|
|
|
219
220
|
panOnDrag: !0,
|
|
220
221
|
proOptions: { hideAttribution: !0 },
|
|
221
222
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ F(ve, {}),
|
|
224
|
+
/* @__PURE__ */ F(be, {}),
|
|
225
|
+
/* @__PURE__ */ F(Se, {
|
|
225
226
|
pannable: !0,
|
|
226
227
|
zoomable: !0
|
|
227
228
|
})
|
|
@@ -231,41 +232,41 @@ var B = {
|
|
|
231
232
|
});
|
|
232
233
|
});
|
|
233
234
|
function Ie({ data: e, selected: t }) {
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ I("div", {
|
|
235
236
|
className: [
|
|
236
|
-
|
|
237
|
-
e.isSyntheticRoot ?
|
|
238
|
-
e.changed ?
|
|
239
|
-
e.deleted ?
|
|
240
|
-
t ?
|
|
237
|
+
V.orgTreeNode,
|
|
238
|
+
e.isSyntheticRoot ? V.orgTreeNodeRoot : "",
|
|
239
|
+
e.changed ? V.orgTreeNodeChanged : "",
|
|
240
|
+
e.deleted ? V.orgTreeNodeDeleted : "",
|
|
241
|
+
t ? V.orgTreeNodeSelected : ""
|
|
241
242
|
].filter(Boolean).join(" "),
|
|
242
243
|
children: [
|
|
243
|
-
e.isSyntheticRoot ? null : /* @__PURE__ */
|
|
244
|
+
e.isSyntheticRoot ? null : /* @__PURE__ */ F(xe, {
|
|
244
245
|
id: "target",
|
|
245
246
|
isConnectable: e.isEditing,
|
|
246
|
-
position:
|
|
247
|
+
position: R.Top,
|
|
247
248
|
type: "target"
|
|
248
249
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ F(xe, {
|
|
250
251
|
id: "source",
|
|
251
252
|
isConnectable: e.isEditing,
|
|
252
|
-
position:
|
|
253
|
+
position: R.Bottom,
|
|
253
254
|
type: "source"
|
|
254
255
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
className:
|
|
257
|
-
children: [/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ I("div", {
|
|
257
|
+
className: V.orgTreeNodeHeader,
|
|
258
|
+
children: [/* @__PURE__ */ F(M, {
|
|
258
259
|
component: "span",
|
|
259
260
|
ellipsis: !0,
|
|
260
261
|
title: e.name,
|
|
261
262
|
variant: "label-primary",
|
|
262
263
|
children: e.name
|
|
263
|
-
}), e.changed ? /* @__PURE__ */
|
|
264
|
-
className:
|
|
264
|
+
}), e.changed ? /* @__PURE__ */ F("span", {
|
|
265
|
+
className: V.orgTreeNodeBadge,
|
|
265
266
|
children: "草稿"
|
|
266
267
|
}) : null]
|
|
267
268
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ F(M, {
|
|
269
270
|
color: "text-neutral",
|
|
270
271
|
component: "span",
|
|
271
272
|
ellipsis: !0,
|
|
@@ -273,7 +274,7 @@ function Ie({ data: e, selected: t }) {
|
|
|
273
274
|
variant: "caption",
|
|
274
275
|
children: e.isSyntheticRoot ? "根節點容器" : `${e.typeLabel} · ${e.code}`
|
|
275
276
|
}),
|
|
276
|
-
e.isSyntheticRoot ? null : /* @__PURE__ */
|
|
277
|
+
e.isSyntheticRoot ? null : /* @__PURE__ */ I(M, {
|
|
277
278
|
color: "text-neutral",
|
|
278
279
|
component: "span",
|
|
279
280
|
ellipsis: !0,
|
|
@@ -281,17 +282,17 @@ function Ie({ data: e, selected: t }) {
|
|
|
281
282
|
variant: "caption",
|
|
282
283
|
children: ["上層:", e.parentLabel]
|
|
283
284
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
className:
|
|
286
|
-
children: e.isSyntheticRoot ? /* @__PURE__ */
|
|
287
|
-
icon:
|
|
285
|
+
/* @__PURE__ */ F("div", {
|
|
286
|
+
className: V.orgTreeNodeActions,
|
|
287
|
+
children: e.isSyntheticRoot ? /* @__PURE__ */ F(_, {
|
|
288
|
+
icon: ne,
|
|
288
289
|
iconType: "leading",
|
|
289
290
|
onClick: () => e.onCreateChild(null),
|
|
290
291
|
size: "sub",
|
|
291
292
|
variant: "base-secondary",
|
|
292
293
|
children: "新增根節點"
|
|
293
|
-
}) : /* @__PURE__ */
|
|
294
|
-
icon:
|
|
294
|
+
}) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(_, {
|
|
295
|
+
icon: te,
|
|
295
296
|
iconType: "leading",
|
|
296
297
|
onClick: () => {
|
|
297
298
|
e.orgUnitId && e.onEdit(e.orgUnitId);
|
|
@@ -299,8 +300,8 @@ function Ie({ data: e, selected: t }) {
|
|
|
299
300
|
size: "sub",
|
|
300
301
|
variant: "base-secondary",
|
|
301
302
|
children: "編輯"
|
|
302
|
-
}), /* @__PURE__ */
|
|
303
|
-
icon:
|
|
303
|
+
}), /* @__PURE__ */ F(_, {
|
|
304
|
+
icon: ne,
|
|
304
305
|
iconType: "leading",
|
|
305
306
|
onClick: () => e.onCreateChild(e.orgUnitId),
|
|
306
307
|
size: "sub",
|
|
@@ -312,28 +313,28 @@ function Ie({ data: e, selected: t }) {
|
|
|
312
313
|
});
|
|
313
314
|
}
|
|
314
315
|
function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, orgUnitsById: i, parentDraft: a, selectedOrgUnitId: o }) {
|
|
315
|
-
let s = new
|
|
316
|
+
let s = new z.graphlib.Graph();
|
|
316
317
|
s.setDefaultEdgeLabel(() => ({})), s.setGraph({
|
|
317
318
|
marginx: 36,
|
|
318
319
|
marginy: 36,
|
|
319
320
|
nodesep: 44,
|
|
320
321
|
rankdir: "TB"
|
|
321
|
-
}), s.setNode(
|
|
322
|
+
}), s.setNode(H, {
|
|
322
323
|
height: je,
|
|
323
324
|
width: Ae
|
|
324
325
|
}), r.forEach((e) => {
|
|
325
326
|
s.setNode(e.id, {
|
|
326
327
|
height: ke,
|
|
327
|
-
width:
|
|
328
|
+
width: U
|
|
328
329
|
});
|
|
329
330
|
}), r.forEach((e) => {
|
|
330
331
|
let t = a.get(e.id) ?? null;
|
|
331
|
-
s.setEdge(t ??
|
|
332
|
-
}),
|
|
332
|
+
s.setEdge(t ?? H, e.id);
|
|
333
|
+
}), z.layout(s);
|
|
333
334
|
let c = Re({
|
|
334
335
|
data: {
|
|
335
336
|
changed: !1,
|
|
336
|
-
code:
|
|
337
|
+
code: H,
|
|
337
338
|
deleted: !1,
|
|
338
339
|
isEditing: e,
|
|
339
340
|
isSyntheticRoot: !0,
|
|
@@ -347,11 +348,11 @@ function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
|
|
|
347
348
|
},
|
|
348
349
|
graph: s,
|
|
349
350
|
height: je,
|
|
350
|
-
id:
|
|
351
|
+
id: H,
|
|
351
352
|
selected: o === null,
|
|
352
353
|
width: Ae
|
|
353
354
|
}), l = r.map((r) => {
|
|
354
|
-
let c = a.get(r.id) ?? null, l =
|
|
355
|
+
let c = a.get(r.id) ?? null, l = Ge(c, i);
|
|
355
356
|
return Re({
|
|
356
357
|
data: {
|
|
357
358
|
changed: c !== r.parentId,
|
|
@@ -365,13 +366,13 @@ function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
|
|
|
365
366
|
orgUnitId: r.id,
|
|
366
367
|
parentLabel: l,
|
|
367
368
|
path: r.path,
|
|
368
|
-
typeLabel:
|
|
369
|
+
typeLabel: Ke(r.type)
|
|
369
370
|
},
|
|
370
371
|
graph: s,
|
|
371
372
|
height: ke,
|
|
372
373
|
id: r.id,
|
|
373
374
|
selected: o === r.id,
|
|
374
|
-
width:
|
|
375
|
+
width: U
|
|
375
376
|
});
|
|
376
377
|
});
|
|
377
378
|
return {
|
|
@@ -381,7 +382,7 @@ function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
|
|
|
381
382
|
animated: e && r,
|
|
382
383
|
data: {},
|
|
383
384
|
id: `org-tree-edge-${n ?? "root"}-${t.id}`,
|
|
384
|
-
source: n ??
|
|
385
|
+
source: n ?? H,
|
|
385
386
|
sourceHandle: "source",
|
|
386
387
|
style: r ? {
|
|
387
388
|
stroke: "var(--mzn-color-primary, #0057ff)",
|
|
@@ -411,21 +412,21 @@ function Re({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
|
|
|
411
412
|
y: 0
|
|
412
413
|
},
|
|
413
414
|
selected: i,
|
|
414
|
-
sourcePosition:
|
|
415
|
-
targetPosition:
|
|
415
|
+
sourcePosition: R.Bottom,
|
|
416
|
+
targetPosition: R.Top,
|
|
416
417
|
type: "orgUnit",
|
|
417
418
|
width: a
|
|
418
419
|
};
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
+
function ze(e, t) {
|
|
421
422
|
let n = He(e);
|
|
422
423
|
return t.filter((t) => t.id !== e.id).map((e) => ({
|
|
423
424
|
distance: Ue(n, He(e)),
|
|
424
425
|
id: e.id
|
|
425
426
|
})).filter((e) => e.distance <= Me).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
426
427
|
}
|
|
427
|
-
function
|
|
428
|
-
let n =
|
|
428
|
+
function Be(e, t) {
|
|
429
|
+
let n = W(e);
|
|
429
430
|
if (n) return Array.from(document.querySelectorAll(".react-flow__node[data-id]")).map((e) => {
|
|
430
431
|
let r = e.dataset.id;
|
|
431
432
|
if (!r || r === t) return null;
|
|
@@ -439,7 +440,7 @@ function ze(e, t) {
|
|
|
439
440
|
};
|
|
440
441
|
}).filter((e) => !!e).filter((e) => e.distance <= Me).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
+
function W(e) {
|
|
443
444
|
return Ve(e) ? {
|
|
444
445
|
x: e.clientX,
|
|
445
446
|
y: e.clientY
|
|
@@ -450,7 +451,7 @@ function Ve(e) {
|
|
|
450
451
|
}
|
|
451
452
|
function He(e) {
|
|
452
453
|
return {
|
|
453
|
-
x: e.position.x + (e.width ??
|
|
454
|
+
x: e.position.x + (e.width ?? U) / 2,
|
|
454
455
|
y: e.position.y + (e.height ?? ke) / 2
|
|
455
456
|
};
|
|
456
457
|
}
|
|
@@ -458,18 +459,18 @@ function Ue(e, t) {
|
|
|
458
459
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
459
460
|
}
|
|
460
461
|
function We(e, t) {
|
|
461
|
-
return !e.source || !e.target || e.target ===
|
|
462
|
+
return !e.source || !e.target || e.target === H ? !1 : De({
|
|
462
463
|
orgUnitId: e.target,
|
|
463
464
|
parentDraft: t,
|
|
464
|
-
parentId: e.source ===
|
|
465
|
+
parentId: e.source === H ? null : e.source
|
|
465
466
|
}) === null;
|
|
466
467
|
}
|
|
467
|
-
function
|
|
468
|
+
function Ge(e, t) {
|
|
468
469
|
if (!e) return "根節點";
|
|
469
470
|
let n = t.get(e);
|
|
470
471
|
return n ? `${n.name} · ${n.code}` : "未知組織";
|
|
471
472
|
}
|
|
472
|
-
function
|
|
473
|
+
function Ke(e) {
|
|
473
474
|
return Ne[e.toUpperCase()] ?? "未知類型";
|
|
474
475
|
}
|
|
475
476
|
var G = {
|
|
@@ -480,7 +481,7 @@ var G = {
|
|
|
480
481
|
orgFilterArea: "bpm_orgFilterArea_Xjbbp",
|
|
481
482
|
membershipFilterArea: "bpm_membershipFilterArea_zob-Y",
|
|
482
483
|
scopeLabel: "bpm_scopeLabel_TLHMC"
|
|
483
|
-
},
|
|
484
|
+
}, qe = {
|
|
484
485
|
hasDraftChanges: !1,
|
|
485
486
|
isEditing: !1
|
|
486
487
|
}, K = [
|
|
@@ -500,10 +501,10 @@ var G = {
|
|
|
500
501
|
id: "TEAM",
|
|
501
502
|
name: "小組"
|
|
502
503
|
}
|
|
503
|
-
],
|
|
504
|
+
], Je = {
|
|
504
505
|
id: "ALL",
|
|
505
506
|
name: "全部類型"
|
|
506
|
-
},
|
|
507
|
+
}, Ye = [Je, ...K], q = [
|
|
507
508
|
{
|
|
508
509
|
id: "MEMBER",
|
|
509
510
|
name: "指定會員"
|
|
@@ -516,14 +517,14 @@ var G = {
|
|
|
516
517
|
id: "POSITION",
|
|
517
518
|
name: "指定職位"
|
|
518
519
|
}
|
|
519
|
-
],
|
|
520
|
+
], Xe = {
|
|
520
521
|
id: "ALL",
|
|
521
522
|
name: "全部範圍"
|
|
522
|
-
},
|
|
523
|
+
}, Ze = [Xe, ...q], Qe = {
|
|
523
524
|
activeOnly: !1,
|
|
524
525
|
id: "ALL",
|
|
525
526
|
name: "全部狀態"
|
|
526
|
-
},
|
|
527
|
+
}, $e = [Qe, {
|
|
527
528
|
activeOnly: !0,
|
|
528
529
|
id: "ACTIVE",
|
|
529
530
|
name: "目前有效"
|
|
@@ -535,107 +536,107 @@ var G = {
|
|
|
535
536
|
id: "false",
|
|
536
537
|
name: "一般歸屬",
|
|
537
538
|
value: !1
|
|
538
|
-
}],
|
|
539
|
+
}], et = [
|
|
539
540
|
10,
|
|
540
541
|
20,
|
|
541
542
|
50
|
|
542
|
-
],
|
|
543
|
-
function
|
|
544
|
-
let
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}, [
|
|
548
|
-
let
|
|
549
|
-
|
|
543
|
+
], tt = 1368, nt = 908, rt = 1292, it = 1124;
|
|
544
|
+
function at({ activeHref: n } = {}) {
|
|
545
|
+
let r = t(), i = n ?? r.adminOrgs(), [a, o] = h("ORG_UNITS"), [s, c] = h(null), [l, f] = h(null), [m, g] = h(null), [_, v] = h(!0), [y, b] = h(null), [x, S] = h(Qe), [C, O] = h(1), [j, P] = h(10), [ee, te] = h(Xe), [ne, re] = h(0), [L, ve] = h([]), [ye, be] = h(null), [xe, Se] = h(null), [R, Ce] = h(null), [we, z] = h(1), [B, Te] = h(10), [Ee, De] = h(null), [Oe, V] = h(0), [H, U] = h(null), [ke, Ae] = h(1), [je, Me] = h(10), [Ne, Pe] = h(""), [Fe, Ie] = h(0), [Le, Re] = h(Je), [ze, Be] = h("TABLE"), [W, Ve] = h([]), [He, Ue] = h([]), [We, Ge] = h([]), [Ke, G] = h(null), [qe, K] = h(1), [Ye, q] = h(10), [Ze, $e] = h(""), [J, et] = h(0), [tt, nt] = h([]), [rt, it] = h([]), [at, ut] = h([]), [Y, dt] = h(!1);
|
|
546
|
+
d(() => {
|
|
547
|
+
s && f(s);
|
|
548
|
+
}, [s]);
|
|
549
|
+
let ft = s ?? l, X = u(async () => {
|
|
550
|
+
v(!0), g(null);
|
|
550
551
|
try {
|
|
551
|
-
let e = await
|
|
552
|
-
managerActiveOnly:
|
|
553
|
-
managerPage:
|
|
554
|
-
managerPageSize:
|
|
555
|
-
managerScopeType:
|
|
556
|
-
membershipActiveOnly:
|
|
557
|
-
membershipOrgUnitId:
|
|
558
|
-
membershipPage:
|
|
559
|
-
membershipPageSize:
|
|
560
|
-
membershipPositionId:
|
|
561
|
-
orgUnitPage:
|
|
562
|
-
orgUnitPageSize:
|
|
563
|
-
orgUnitSearchText:
|
|
564
|
-
orgUnitType:
|
|
565
|
-
positionPage:
|
|
566
|
-
positionPageSize:
|
|
567
|
-
positionSearchText:
|
|
552
|
+
let e = await pe({
|
|
553
|
+
managerActiveOnly: x.activeOnly,
|
|
554
|
+
managerPage: C,
|
|
555
|
+
managerPageSize: j,
|
|
556
|
+
managerScopeType: ee.id === "ALL" ? null : ee.id,
|
|
557
|
+
membershipActiveOnly: ye?.activeOnly ?? !1,
|
|
558
|
+
membershipOrgUnitId: R?.id ?? null,
|
|
559
|
+
membershipPage: we,
|
|
560
|
+
membershipPageSize: B,
|
|
561
|
+
membershipPositionId: Ee?.id ?? null,
|
|
562
|
+
orgUnitPage: ke,
|
|
563
|
+
orgUnitPageSize: je,
|
|
564
|
+
orgUnitSearchText: Ne,
|
|
565
|
+
orgUnitType: Le.id === "ALL" ? null : Le.id,
|
|
566
|
+
positionPage: qe,
|
|
567
|
+
positionPageSize: Ye,
|
|
568
|
+
positionSearchText: Ze
|
|
568
569
|
});
|
|
569
|
-
|
|
570
|
+
ve(await N(_t(e.memberships, e.managerResolutions))), Ve(e.orgUnits), Ie(e.orgUnitCount), Ue(e.filteredOrgUnits), nt(e.positions), et(e.positionCount), Ge(e.filteredPositions), V(e.membershipCount), ut(e.filteredMemberships), re(e.managerResolutionCount), it(e.filteredManagerResolutions);
|
|
570
571
|
} catch (e) {
|
|
571
|
-
|
|
572
|
+
g(zt(e));
|
|
572
573
|
} finally {
|
|
573
|
-
|
|
574
|
+
v(!1);
|
|
574
575
|
}
|
|
575
576
|
}, [
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
R,
|
|
577
|
+
x,
|
|
578
|
+
C,
|
|
579
|
+
j,
|
|
580
|
+
ee,
|
|
581
581
|
ye,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
582
|
+
R,
|
|
583
|
+
we,
|
|
584
|
+
B,
|
|
585
|
+
Ee,
|
|
586
586
|
ke,
|
|
587
587
|
je,
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
588
|
+
Ne,
|
|
589
|
+
Le,
|
|
590
|
+
qe,
|
|
591
|
+
Ye,
|
|
592
|
+
Ze
|
|
592
593
|
]);
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}, [
|
|
596
|
-
let Z =
|
|
594
|
+
d(() => {
|
|
595
|
+
X();
|
|
596
|
+
}, [X]);
|
|
597
|
+
let Z = p(() => new Map(W.map((e) => [e.id, e])), [W]), Q = p(() => new Map(tt.map((e) => [e.id, e])), [tt]), $ = p(() => new Map(L.map((e) => [e.memberId, e])), [L]), wt = p(() => He.map((e) => ({
|
|
597
598
|
...e,
|
|
598
599
|
key: e.id,
|
|
599
|
-
parentName: e.parentId ?
|
|
600
|
-
typeLabel:
|
|
601
|
-
})), [
|
|
600
|
+
parentName: e.parentId ? bt(Z.get(e.parentId)) : "根節點",
|
|
601
|
+
typeLabel: xt(e.type)
|
|
602
|
+
})), [He, Z]), Tt = p(() => We.map((e) => ({
|
|
602
603
|
...e,
|
|
603
604
|
key: e.id
|
|
604
|
-
})), [
|
|
605
|
+
})), [We]), Et = p(() => at.map((e) => ({
|
|
605
606
|
...e,
|
|
606
607
|
key: e.id,
|
|
607
|
-
memberName:
|
|
608
|
-
orgUnitName:
|
|
609
|
-
positionName: e.positionId ?
|
|
608
|
+
memberName: yt($.get(e.memberId)),
|
|
609
|
+
orgUnitName: bt(Z.get(e.orgUnitId)),
|
|
610
|
+
positionName: e.positionId ? St(Q.get(e.positionId)) : "未指定"
|
|
610
611
|
})), [
|
|
611
612
|
$,
|
|
612
|
-
|
|
613
|
+
at,
|
|
613
614
|
Z,
|
|
614
615
|
Q
|
|
615
|
-
]),
|
|
616
|
+
]), Dt = p(() => rt.map((e) => ({
|
|
616
617
|
...e,
|
|
617
618
|
key: e.id,
|
|
618
|
-
managerName:
|
|
619
|
-
scopeLabel:
|
|
619
|
+
managerName: yt($.get(e.managerMemberId)),
|
|
620
|
+
scopeLabel: vt(e, {
|
|
620
621
|
membersById: $,
|
|
621
622
|
orgUnitsById: Z,
|
|
622
623
|
positionsById: Q
|
|
623
624
|
})
|
|
624
625
|
})), [
|
|
625
|
-
|
|
626
|
+
rt,
|
|
626
627
|
$,
|
|
627
628
|
Z,
|
|
628
629
|
Q
|
|
629
|
-
]),
|
|
630
|
+
]), Ot = p(() => ({
|
|
630
631
|
render: (e) => [{
|
|
631
632
|
name: "編輯",
|
|
632
|
-
onClick: () =>
|
|
633
|
+
onClick: () => U({
|
|
633
634
|
record: e,
|
|
634
635
|
type: "EDIT"
|
|
635
636
|
})
|
|
636
637
|
}, {
|
|
637
638
|
name: "停用",
|
|
638
|
-
onClick: () =>
|
|
639
|
+
onClick: () => c({
|
|
639
640
|
confirmText: "停用組織",
|
|
640
641
|
description: `停用「${e.name}」後,這個組織節點將不再出現在可用組織清單中。`,
|
|
641
642
|
id: e.id,
|
|
@@ -646,26 +647,26 @@ function Y({ activeHref: t = "/admin/orgs" } = {}) {
|
|
|
646
647
|
}],
|
|
647
648
|
variant: "base-secondary",
|
|
648
649
|
width: 128
|
|
649
|
-
}), []),
|
|
650
|
+
}), []), kt = p(() => ({
|
|
650
651
|
render: (e) => [{
|
|
651
652
|
name: "編輯",
|
|
652
|
-
onClick: () =>
|
|
653
|
+
onClick: () => G({
|
|
653
654
|
record: e,
|
|
654
655
|
type: "EDIT"
|
|
655
656
|
})
|
|
656
657
|
}],
|
|
657
658
|
variant: "base-secondary",
|
|
658
659
|
width: 88
|
|
659
|
-
}), []),
|
|
660
|
+
}), []), At = p(() => ({
|
|
660
661
|
render: (e) => [{
|
|
661
662
|
name: "編輯",
|
|
662
|
-
onClick: () =>
|
|
663
|
+
onClick: () => Se({
|
|
663
664
|
record: e,
|
|
664
665
|
type: "EDIT"
|
|
665
666
|
})
|
|
666
667
|
}, {
|
|
667
668
|
name: "刪除",
|
|
668
|
-
onClick: () =>
|
|
669
|
+
onClick: () => c({
|
|
669
670
|
confirmText: "刪除歸屬",
|
|
670
671
|
description: `刪除「${e.memberName}」在「${e.orgUnitName}」的會員歸屬。`,
|
|
671
672
|
id: e.id,
|
|
@@ -676,16 +677,16 @@ function Y({ activeHref: t = "/admin/orgs" } = {}) {
|
|
|
676
677
|
}],
|
|
677
678
|
variant: "base-secondary",
|
|
678
679
|
width: 128
|
|
679
|
-
}), []),
|
|
680
|
+
}), []), jt = p(() => ({
|
|
680
681
|
render: (e) => [{
|
|
681
682
|
name: "編輯",
|
|
682
|
-
onClick: () =>
|
|
683
|
+
onClick: () => b({
|
|
683
684
|
record: e,
|
|
684
685
|
type: "EDIT"
|
|
685
686
|
})
|
|
686
687
|
}, {
|
|
687
688
|
name: "刪除",
|
|
688
|
-
onClick: () =>
|
|
689
|
+
onClick: () => c({
|
|
689
690
|
confirmText: "刪除主管規則",
|
|
690
691
|
description: `刪除「${e.scopeLabel}」指派給「${e.managerName}」的主管解析規則。`,
|
|
691
692
|
id: e.id,
|
|
@@ -697,302 +698,302 @@ function Y({ activeHref: t = "/admin/orgs" } = {}) {
|
|
|
697
698
|
variant: "base-secondary",
|
|
698
699
|
width: 128
|
|
699
700
|
}), []);
|
|
700
|
-
function kt(e) {
|
|
701
|
-
H(1), Me(e);
|
|
702
|
-
}
|
|
703
|
-
function At(e) {
|
|
704
|
-
H(1), Ie(e);
|
|
705
|
-
}
|
|
706
|
-
function jt(e) {
|
|
707
|
-
G(1), q(e);
|
|
708
|
-
}
|
|
709
701
|
function Mt(e) {
|
|
710
|
-
|
|
702
|
+
Ae(1), Pe(e);
|
|
711
703
|
}
|
|
712
704
|
function Nt(e) {
|
|
713
|
-
|
|
705
|
+
Ae(1), Re(e);
|
|
714
706
|
}
|
|
715
|
-
function
|
|
716
|
-
|
|
707
|
+
function Pt(e) {
|
|
708
|
+
K(1), $e(e);
|
|
717
709
|
}
|
|
718
710
|
function It(e) {
|
|
719
|
-
|
|
711
|
+
z(1), be(e);
|
|
720
712
|
}
|
|
721
713
|
function Lt(e) {
|
|
722
|
-
|
|
714
|
+
z(1), Ce(e);
|
|
715
|
+
}
|
|
716
|
+
function Rt(e) {
|
|
717
|
+
z(1), De(e);
|
|
723
718
|
}
|
|
724
|
-
function
|
|
725
|
-
|
|
719
|
+
function Bt(e) {
|
|
720
|
+
O(1), S(e);
|
|
726
721
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
722
|
+
function Vt(e) {
|
|
723
|
+
O(1), te(e);
|
|
724
|
+
}
|
|
725
|
+
function Ht() {
|
|
726
|
+
Y || c(null);
|
|
727
|
+
}
|
|
728
|
+
async function Ut() {
|
|
729
|
+
s && await Gt(async () => {
|
|
730
|
+
s.type === "ORG_UNIT" && await fe(s.id), s.type === "MEMBERSHIP" && await de(s.id), s.type === "MANAGER_RESOLUTION" && await ue(s.id), c(null);
|
|
730
731
|
});
|
|
731
732
|
}
|
|
732
|
-
async function
|
|
733
|
-
|
|
733
|
+
async function Wt(e) {
|
|
734
|
+
dt(!0), g(null);
|
|
734
735
|
try {
|
|
735
|
-
await
|
|
736
|
+
await ae({ moves: e.map((e) => ({
|
|
736
737
|
baseUpdatedAt: Z.get(e.orgUnitId)?.updatedAt ?? "",
|
|
737
738
|
id: e.orgUnitId,
|
|
738
739
|
parentId: e.parentId
|
|
739
|
-
})) }), await
|
|
740
|
+
})) }), await X();
|
|
740
741
|
} catch (e) {
|
|
741
|
-
throw
|
|
742
|
+
throw g(zt(e)), e;
|
|
742
743
|
} finally {
|
|
743
|
-
|
|
744
|
+
dt(!1);
|
|
744
745
|
}
|
|
745
746
|
}
|
|
746
|
-
async function
|
|
747
|
-
|
|
747
|
+
async function Gt(e) {
|
|
748
|
+
dt(!0), g(null);
|
|
748
749
|
try {
|
|
749
|
-
await e(), await
|
|
750
|
+
await e(), await X();
|
|
750
751
|
} catch (e) {
|
|
751
|
-
|
|
752
|
+
g(zt(e));
|
|
752
753
|
} finally {
|
|
753
|
-
|
|
754
|
+
dt(!1);
|
|
754
755
|
}
|
|
755
756
|
}
|
|
756
|
-
return /* @__PURE__ */
|
|
757
|
-
activeHref:
|
|
757
|
+
return /* @__PURE__ */ I(e, {
|
|
758
|
+
activeHref: i,
|
|
758
759
|
children: [
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ F(T, { children: /* @__PURE__ */ F(ie, {
|
|
760
761
|
description: "維護組織樹、職位、會員歸屬與簽核主管解析規則。",
|
|
761
762
|
title: "組織管理"
|
|
762
763
|
}) }),
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
tab: /* @__PURE__ */
|
|
765
|
-
activeKey:
|
|
766
|
-
onChange: (e) =>
|
|
764
|
+
/* @__PURE__ */ F(D, { children: /* @__PURE__ */ I(E, {
|
|
765
|
+
tab: /* @__PURE__ */ I(k, {
|
|
766
|
+
activeKey: a,
|
|
767
|
+
onChange: (e) => o(Ct(e)),
|
|
767
768
|
children: [
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ F(A, { children: "組織樹" }, "ORG_UNITS"),
|
|
770
|
+
/* @__PURE__ */ F(A, { children: "職位" }, "POSITIONS"),
|
|
771
|
+
/* @__PURE__ */ F(A, { children: "會員歸屬" }, "MEMBERSHIPS"),
|
|
772
|
+
/* @__PURE__ */ F(A, { children: "簽核主管" }, "MANAGERS")
|
|
772
773
|
]
|
|
773
774
|
}),
|
|
774
775
|
children: [
|
|
775
|
-
|
|
776
|
+
m ? /* @__PURE__ */ F(M, {
|
|
776
777
|
color: "text-error",
|
|
777
778
|
variant: "body",
|
|
778
|
-
children:
|
|
779
|
+
children: m
|
|
779
780
|
}) : null,
|
|
780
|
-
|
|
781
|
-
actions:
|
|
782
|
-
loading:
|
|
783
|
-
onCreate: () =>
|
|
781
|
+
a === "ORG_UNITS" ? /* @__PURE__ */ F(ot, {
|
|
782
|
+
actions: Ot,
|
|
783
|
+
loading: _,
|
|
784
|
+
onCreate: () => U({
|
|
784
785
|
parentId: null,
|
|
785
786
|
record: null,
|
|
786
787
|
type: "CREATE"
|
|
787
788
|
}),
|
|
788
|
-
onCreateChild: (e) =>
|
|
789
|
+
onCreateChild: (e) => U({
|
|
789
790
|
parentId: e,
|
|
790
791
|
record: null,
|
|
791
792
|
type: "CREATE"
|
|
792
793
|
}),
|
|
793
|
-
onEditOrgUnit: (e) =>
|
|
794
|
+
onEditOrgUnit: (e) => U({
|
|
794
795
|
record: e,
|
|
795
796
|
type: "EDIT"
|
|
796
797
|
}),
|
|
797
|
-
onPageChange:
|
|
798
|
-
onSaveDraft:
|
|
798
|
+
onPageChange: Ae,
|
|
799
|
+
onSaveDraft: Wt,
|
|
799
800
|
onPageSizeChange: (e) => {
|
|
800
|
-
|
|
801
|
+
Ae(1), Me(e);
|
|
801
802
|
},
|
|
802
|
-
onSearchTextChange:
|
|
803
|
-
onTypeFilterChange:
|
|
804
|
-
orgUnits:
|
|
805
|
-
page:
|
|
806
|
-
pageSize:
|
|
807
|
-
rows:
|
|
808
|
-
searchText:
|
|
803
|
+
onSearchTextChange: Mt,
|
|
804
|
+
onTypeFilterChange: Nt,
|
|
805
|
+
orgUnits: W,
|
|
806
|
+
page: ke,
|
|
807
|
+
pageSize: je,
|
|
808
|
+
rows: wt,
|
|
809
|
+
searchText: Ne,
|
|
809
810
|
saving: Y,
|
|
810
|
-
total:
|
|
811
|
-
typeFilter:
|
|
812
|
-
viewMode:
|
|
813
|
-
onViewModeChange:
|
|
811
|
+
total: Fe,
|
|
812
|
+
typeFilter: Le,
|
|
813
|
+
viewMode: ze,
|
|
814
|
+
onViewModeChange: Be
|
|
814
815
|
}) : null,
|
|
815
|
-
|
|
816
|
-
actions:
|
|
817
|
-
loading:
|
|
818
|
-
onCreate: () =>
|
|
816
|
+
a === "POSITIONS" ? /* @__PURE__ */ F(st, {
|
|
817
|
+
actions: kt,
|
|
818
|
+
loading: _,
|
|
819
|
+
onCreate: () => G({
|
|
819
820
|
record: null,
|
|
820
821
|
type: "CREATE"
|
|
821
822
|
}),
|
|
822
|
-
onPageChange:
|
|
823
|
+
onPageChange: K,
|
|
823
824
|
onPageSizeChange: (e) => {
|
|
824
|
-
|
|
825
|
+
K(1), q(e);
|
|
825
826
|
},
|
|
826
|
-
onSearchTextChange:
|
|
827
|
-
page:
|
|
828
|
-
pageSize:
|
|
829
|
-
rows:
|
|
830
|
-
searchText:
|
|
831
|
-
total:
|
|
827
|
+
onSearchTextChange: Pt,
|
|
828
|
+
page: qe,
|
|
829
|
+
pageSize: Ye,
|
|
830
|
+
rows: Tt,
|
|
831
|
+
searchText: Ze,
|
|
832
|
+
total: J
|
|
832
833
|
}) : null,
|
|
833
|
-
|
|
834
|
-
actions:
|
|
835
|
-
loading:
|
|
836
|
-
onCreate: () =>
|
|
834
|
+
a === "MEMBERSHIPS" ? /* @__PURE__ */ F(ct, {
|
|
835
|
+
actions: At,
|
|
836
|
+
loading: _,
|
|
837
|
+
onCreate: () => Se({
|
|
837
838
|
record: null,
|
|
838
839
|
type: "CREATE"
|
|
839
840
|
}),
|
|
840
|
-
onActiveFilterChange:
|
|
841
|
-
onOrgUnitFilterChange:
|
|
842
|
-
onPageChange:
|
|
841
|
+
onActiveFilterChange: It,
|
|
842
|
+
onOrgUnitFilterChange: Lt,
|
|
843
|
+
onPageChange: z,
|
|
843
844
|
onPageSizeChange: (e) => {
|
|
844
|
-
|
|
845
|
+
z(1), Te(e);
|
|
845
846
|
},
|
|
846
|
-
onPositionFilterChange:
|
|
847
|
-
orgUnitFilter:
|
|
848
|
-
orgUnits:
|
|
849
|
-
page:
|
|
850
|
-
pageSize:
|
|
851
|
-
positionFilter:
|
|
852
|
-
positions:
|
|
853
|
-
rows:
|
|
854
|
-
statusFilter:
|
|
855
|
-
total:
|
|
847
|
+
onPositionFilterChange: Rt,
|
|
848
|
+
orgUnitFilter: R,
|
|
849
|
+
orgUnits: W,
|
|
850
|
+
page: we,
|
|
851
|
+
pageSize: B,
|
|
852
|
+
positionFilter: Ee,
|
|
853
|
+
positions: tt,
|
|
854
|
+
rows: Et,
|
|
855
|
+
statusFilter: ye,
|
|
856
|
+
total: Oe
|
|
856
857
|
}) : null,
|
|
857
|
-
|
|
858
|
-
actions:
|
|
859
|
-
loading:
|
|
860
|
-
onCreate: () =>
|
|
858
|
+
a === "MANAGERS" ? /* @__PURE__ */ F(lt, {
|
|
859
|
+
actions: jt,
|
|
860
|
+
loading: _,
|
|
861
|
+
onCreate: () => b({
|
|
861
862
|
record: null,
|
|
862
863
|
type: "CREATE"
|
|
863
864
|
}),
|
|
864
|
-
onActiveFilterChange:
|
|
865
|
-
onPageChange:
|
|
865
|
+
onActiveFilterChange: Bt,
|
|
866
|
+
onPageChange: O,
|
|
866
867
|
onPageSizeChange: (e) => {
|
|
867
|
-
|
|
868
|
+
O(1), P(e);
|
|
868
869
|
},
|
|
869
|
-
onScopeTypeFilterChange:
|
|
870
|
-
page:
|
|
871
|
-
pageSize:
|
|
872
|
-
rows:
|
|
873
|
-
scopeTypeFilter:
|
|
874
|
-
statusFilter:
|
|
875
|
-
total:
|
|
870
|
+
onScopeTypeFilterChange: Vt,
|
|
871
|
+
page: C,
|
|
872
|
+
pageSize: j,
|
|
873
|
+
rows: Dt,
|
|
874
|
+
scopeTypeFilter: ee,
|
|
875
|
+
statusFilter: x,
|
|
876
|
+
total: ne
|
|
876
877
|
}) : null
|
|
877
878
|
]
|
|
878
879
|
}) }),
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
modal:
|
|
881
|
-
onClose: () =>
|
|
882
|
-
onSubmit: (e) =>
|
|
883
|
-
|
|
880
|
+
/* @__PURE__ */ F(pt, {
|
|
881
|
+
modal: H,
|
|
882
|
+
onClose: () => U(null),
|
|
883
|
+
onSubmit: (e) => Gt(async () => {
|
|
884
|
+
H?.type === "EDIT" && H.record ? await ge({
|
|
884
885
|
...e,
|
|
885
|
-
id:
|
|
886
|
+
id: H.record.id,
|
|
886
887
|
metadataJson: null
|
|
887
|
-
}) : await
|
|
888
|
+
}) : await ce({
|
|
888
889
|
code: e.code ?? "",
|
|
889
890
|
metadataJson: "{}",
|
|
890
891
|
name: e.name ?? "",
|
|
891
892
|
parentId: e.parentId,
|
|
892
893
|
type: e.type ?? "DEPARTMENT"
|
|
893
|
-
}),
|
|
894
|
+
}), U(null);
|
|
894
895
|
}),
|
|
895
|
-
orgUnits:
|
|
896
|
+
orgUnits: W,
|
|
896
897
|
saving: Y
|
|
897
898
|
}),
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
modal:
|
|
900
|
-
onClose: () =>
|
|
901
|
-
onSubmit: (e) =>
|
|
902
|
-
|
|
899
|
+
/* @__PURE__ */ F(mt, {
|
|
900
|
+
modal: Ke,
|
|
901
|
+
onClose: () => G(null),
|
|
902
|
+
onSubmit: (e) => Gt(async () => {
|
|
903
|
+
Ke?.type === "EDIT" && Ke.record ? await _e({
|
|
903
904
|
...e,
|
|
904
|
-
id:
|
|
905
|
+
id: Ke.record.id,
|
|
905
906
|
metadataJson: null
|
|
906
|
-
}) : await
|
|
907
|
+
}) : await le({
|
|
907
908
|
code: e.code ?? "",
|
|
908
909
|
level: e.level ?? 0,
|
|
909
910
|
metadataJson: "{}",
|
|
910
911
|
name: e.name ?? ""
|
|
911
|
-
}),
|
|
912
|
+
}), G(null);
|
|
912
913
|
}),
|
|
913
914
|
saving: Y
|
|
914
915
|
}),
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ F(ht, {
|
|
916
917
|
membersById: $,
|
|
917
|
-
modal:
|
|
918
|
-
onClose: () =>
|
|
919
|
-
onSubmit: (e) =>
|
|
920
|
-
|
|
918
|
+
modal: xe,
|
|
919
|
+
onClose: () => Se(null),
|
|
920
|
+
onSubmit: (e) => Gt(async () => {
|
|
921
|
+
xe?.type === "EDIT" && xe.record ? await he({
|
|
921
922
|
...e,
|
|
922
|
-
id:
|
|
923
|
-
}) : await
|
|
924
|
-
effectiveFrom: e.effectiveFrom ??
|
|
923
|
+
id: xe.record.id
|
|
924
|
+
}) : await se({
|
|
925
|
+
effectiveFrom: e.effectiveFrom ?? Ft(),
|
|
925
926
|
effectiveTo: e.effectiveTo,
|
|
926
927
|
isPrimary: e.isPrimary ?? !1,
|
|
927
928
|
memberId: e.memberId ?? "",
|
|
928
929
|
orgUnitId: e.orgUnitId ?? "",
|
|
929
930
|
positionId: e.positionId
|
|
930
|
-
}),
|
|
931
|
+
}), Se(null);
|
|
931
932
|
}),
|
|
932
|
-
orgUnits:
|
|
933
|
-
positions:
|
|
933
|
+
orgUnits: W,
|
|
934
|
+
positions: tt,
|
|
934
935
|
saving: Y
|
|
935
936
|
}),
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ F(gt, {
|
|
937
938
|
membersById: $,
|
|
938
|
-
modal:
|
|
939
|
-
onClose: () =>
|
|
940
|
-
onSubmit: (e) =>
|
|
941
|
-
|
|
939
|
+
modal: y,
|
|
940
|
+
onClose: () => b(null),
|
|
941
|
+
onSubmit: (e) => Gt(async () => {
|
|
942
|
+
y?.type === "EDIT" && y.record ? await me({
|
|
942
943
|
...e,
|
|
943
|
-
id:
|
|
944
|
-
}) : await
|
|
945
|
-
effectiveFrom: e.effectiveFrom ??
|
|
944
|
+
id: y.record.id
|
|
945
|
+
}) : await oe({
|
|
946
|
+
effectiveFrom: e.effectiveFrom ?? Ft(),
|
|
946
947
|
effectiveTo: e.effectiveTo,
|
|
947
948
|
managerMemberId: e.managerMemberId ?? "",
|
|
948
949
|
priority: e.priority ?? 0,
|
|
949
950
|
scopeId: e.scopeId ?? "",
|
|
950
951
|
scopeType: e.scopeType ?? "MEMBER"
|
|
951
|
-
}),
|
|
952
|
+
}), b(null);
|
|
952
953
|
}),
|
|
953
|
-
orgUnits:
|
|
954
|
-
positions:
|
|
954
|
+
orgUnits: W,
|
|
955
|
+
positions: tt,
|
|
955
956
|
saving: Y
|
|
956
957
|
}),
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
+
/* @__PURE__ */ F(w, {
|
|
958
959
|
cancelText: "取消",
|
|
959
960
|
confirmButtonProps: { variant: "destructive-primary" },
|
|
960
|
-
confirmText:
|
|
961
|
+
confirmText: ft?.confirmText ?? "",
|
|
961
962
|
loading: Y,
|
|
962
963
|
modalStatusType: "error",
|
|
963
964
|
modalType: "standard",
|
|
964
|
-
onCancel:
|
|
965
|
-
onClose:
|
|
966
|
-
onConfirm: () => void
|
|
967
|
-
open: !!
|
|
965
|
+
onCancel: Ht,
|
|
966
|
+
onClose: Ht,
|
|
967
|
+
onConfirm: () => void Ut(),
|
|
968
|
+
open: !!s,
|
|
968
969
|
showModalFooter: !0,
|
|
969
970
|
showModalHeader: !0,
|
|
970
971
|
size: "regular",
|
|
971
972
|
supportingText: "此操作會立即套用,請確認後再繼續。",
|
|
972
|
-
title:
|
|
973
|
-
children: /* @__PURE__ */
|
|
973
|
+
title: ft?.title ?? "",
|
|
974
|
+
children: /* @__PURE__ */ F(M, {
|
|
974
975
|
color: "text-neutral",
|
|
975
976
|
variant: "body",
|
|
976
|
-
children:
|
|
977
|
+
children: ft?.description ?? ""
|
|
977
978
|
})
|
|
978
979
|
})
|
|
979
980
|
]
|
|
980
981
|
});
|
|
981
982
|
}
|
|
982
|
-
function
|
|
983
|
-
let M =
|
|
984
|
-
isTreeMode:
|
|
985
|
-
isTreeEditing:
|
|
986
|
-
}),
|
|
987
|
-
isTreeMode:
|
|
988
|
-
isTreeEditing:
|
|
989
|
-
}),
|
|
990
|
-
hasDraftChanges:
|
|
991
|
-
isTreeEditing:
|
|
992
|
-
isTreeMode:
|
|
983
|
+
function ot({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUnit: i, onPageChange: a, onSaveDraft: o, onPageSizeChange: s, onSearchTextChange: c, onTypeFilterChange: l, onViewModeChange: u, orgUnits: f, page: g, pageSize: v, rows: w, searchText: T, saving: E, total: D, typeFilter: k, viewMode: A }) {
|
|
984
|
+
let M = m(null), [N, te] = h(qe), ne = A === "TABLE" ? "FLOW" : "TABLE", re = A === "TABLE" ? "切換樹狀圖" : "切換表格", ie = A === "FLOW", ae = Y({
|
|
985
|
+
isTreeMode: ie,
|
|
986
|
+
isTreeEditing: N.isEditing
|
|
987
|
+
}), oe = dt({
|
|
988
|
+
isTreeMode: ie,
|
|
989
|
+
isTreeEditing: N.isEditing
|
|
990
|
+
}), se = ft({
|
|
991
|
+
hasDraftChanges: N.hasDraftChanges,
|
|
992
|
+
isTreeEditing: N.isEditing,
|
|
993
|
+
isTreeMode: ie,
|
|
993
994
|
loading: t,
|
|
994
995
|
saving: E
|
|
995
|
-
}),
|
|
996
|
+
}), ce = p(() => [
|
|
996
997
|
{
|
|
997
998
|
dataIndex: "code",
|
|
998
999
|
key: "code",
|
|
@@ -1024,17 +1025,17 @@ function it({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1024
1025
|
width: 420
|
|
1025
1026
|
}
|
|
1026
1027
|
], []);
|
|
1027
|
-
return
|
|
1028
|
-
|
|
1029
|
-
}, [
|
|
1030
|
-
actionDisabled:
|
|
1031
|
-
actionIcon:
|
|
1032
|
-
actionLabel:
|
|
1033
|
-
actions: /* @__PURE__ */
|
|
1034
|
-
onClick: () =>
|
|
1028
|
+
return d(() => {
|
|
1029
|
+
A === "TABLE" && te(qe);
|
|
1030
|
+
}, [A]), /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(X, {
|
|
1031
|
+
actionDisabled: se,
|
|
1032
|
+
actionIcon: oe,
|
|
1033
|
+
actionLabel: ae,
|
|
1034
|
+
actions: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(_, {
|
|
1035
|
+
onClick: () => u(ne),
|
|
1035
1036
|
variant: "base-secondary",
|
|
1036
|
-
children:
|
|
1037
|
-
}),
|
|
1037
|
+
children: re
|
|
1038
|
+
}), ie && N.isEditing ? /* @__PURE__ */ F(_, {
|
|
1038
1039
|
disabled: E,
|
|
1039
1040
|
icon: ee,
|
|
1040
1041
|
iconType: "leading",
|
|
@@ -1044,27 +1045,27 @@ function it({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1044
1045
|
}) : null] }),
|
|
1045
1046
|
description: "組織節點使用 ltree path 維護階層,搬移節點會同步更新子節點 path。",
|
|
1046
1047
|
onCreate: () => {
|
|
1047
|
-
if (!
|
|
1048
|
+
if (!ie) {
|
|
1048
1049
|
n();
|
|
1049
1050
|
return;
|
|
1050
1051
|
}
|
|
1051
|
-
if (
|
|
1052
|
+
if (N.isEditing) {
|
|
1052
1053
|
M.current?.saveDraft();
|
|
1053
1054
|
return;
|
|
1054
1055
|
}
|
|
1055
1056
|
M.current?.startEditing();
|
|
1056
1057
|
},
|
|
1057
1058
|
title: "組織樹"
|
|
1058
|
-
}),
|
|
1059
|
+
}), A === "TABLE" ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(b, {
|
|
1059
1060
|
className: G.orgFilterArea,
|
|
1060
1061
|
size: "sub",
|
|
1061
|
-
children: /* @__PURE__ */
|
|
1062
|
+
children: /* @__PURE__ */ I(x, { children: [/* @__PURE__ */ F(y, {
|
|
1062
1063
|
span: 3,
|
|
1063
|
-
children: /* @__PURE__ */
|
|
1064
|
+
children: /* @__PURE__ */ F(S, {
|
|
1064
1065
|
fullWidth: !0,
|
|
1065
|
-
layout:
|
|
1066
|
+
layout: L.VERTICAL,
|
|
1066
1067
|
name: "orgUnitSearchText",
|
|
1067
|
-
children: /* @__PURE__ */
|
|
1068
|
+
children: /* @__PURE__ */ F(C, {
|
|
1068
1069
|
fullWidth: !0,
|
|
1069
1070
|
onChange: (e) => c(e.target.value),
|
|
1070
1071
|
placeholder: "搜尋組織名稱或代碼",
|
|
@@ -1073,53 +1074,53 @@ function it({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1073
1074
|
variant: "base"
|
|
1074
1075
|
})
|
|
1075
1076
|
})
|
|
1076
|
-
}), /* @__PURE__ */
|
|
1077
|
+
}), /* @__PURE__ */ F(y, {
|
|
1077
1078
|
span: 2,
|
|
1078
|
-
children: /* @__PURE__ */
|
|
1079
|
+
children: /* @__PURE__ */ F(S, {
|
|
1079
1080
|
fullWidth: !0,
|
|
1080
|
-
layout:
|
|
1081
|
+
layout: L.VERTICAL,
|
|
1081
1082
|
name: "orgUnitTypeFilter",
|
|
1082
|
-
children: /* @__PURE__ */
|
|
1083
|
+
children: /* @__PURE__ */ F(O, {
|
|
1083
1084
|
clearable: !1,
|
|
1084
1085
|
fullWidth: !0,
|
|
1085
|
-
onChange: (e) => l(
|
|
1086
|
-
options: [...
|
|
1086
|
+
onChange: (e) => l(wt(e)),
|
|
1087
|
+
options: [...Ye],
|
|
1087
1088
|
placeholder: "類型",
|
|
1088
1089
|
size: "sub",
|
|
1089
1090
|
value: k
|
|
1090
1091
|
})
|
|
1091
1092
|
})
|
|
1092
1093
|
})] })
|
|
1093
|
-
}), /* @__PURE__ */
|
|
1094
|
+
}), /* @__PURE__ */ F("div", {
|
|
1094
1095
|
className: G.tableFrame,
|
|
1095
|
-
children: /* @__PURE__ */
|
|
1096
|
+
children: /* @__PURE__ */ F(j, {
|
|
1096
1097
|
actions: e,
|
|
1097
|
-
columns:
|
|
1098
|
+
columns: ce,
|
|
1098
1099
|
dataSource: [...w],
|
|
1099
1100
|
fullWidth: !0,
|
|
1100
1101
|
loading: t,
|
|
1101
|
-
pagination:
|
|
1102
|
+
pagination: ut({
|
|
1102
1103
|
onPageChange: a,
|
|
1103
1104
|
onPageSizeChange: s,
|
|
1104
|
-
page:
|
|
1105
|
-
pageSize:
|
|
1106
|
-
total:
|
|
1105
|
+
page: g,
|
|
1106
|
+
pageSize: v,
|
|
1107
|
+
total: D
|
|
1107
1108
|
}),
|
|
1108
|
-
style: { minWidth:
|
|
1109
|
+
style: { minWidth: tt }
|
|
1109
1110
|
})
|
|
1110
|
-
})] }) : /* @__PURE__ */
|
|
1111
|
+
})] }) : /* @__PURE__ */ F(Fe, {
|
|
1111
1112
|
ref: M,
|
|
1112
1113
|
onCreateChild: r,
|
|
1113
1114
|
onCreateRoot: n,
|
|
1114
1115
|
onEditOrgUnit: i,
|
|
1115
1116
|
onSaveDraft: o,
|
|
1116
|
-
onStateChange:
|
|
1117
|
-
orgUnits:
|
|
1117
|
+
onStateChange: te,
|
|
1118
|
+
orgUnits: f,
|
|
1118
1119
|
saving: E
|
|
1119
1120
|
})] });
|
|
1120
1121
|
}
|
|
1121
|
-
function
|
|
1122
|
-
let d =
|
|
1122
|
+
function st({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeChange: i, onSearchTextChange: a, page: o, pageSize: s, rows: c, searchText: l, total: u }) {
|
|
1123
|
+
let d = p(() => [
|
|
1123
1124
|
{
|
|
1124
1125
|
dataIndex: "code",
|
|
1125
1126
|
key: "code",
|
|
@@ -1145,23 +1146,23 @@ function at({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1145
1146
|
width: 220
|
|
1146
1147
|
}
|
|
1147
1148
|
], []);
|
|
1148
|
-
return /* @__PURE__ */
|
|
1149
|
-
/* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ I(P, { children: [
|
|
1150
|
+
/* @__PURE__ */ F(X, {
|
|
1150
1151
|
actionLabel: "新增職位",
|
|
1151
1152
|
description: "職位提供會員歸屬與主管解析規則使用。",
|
|
1152
1153
|
onCreate: n,
|
|
1153
1154
|
title: "職位"
|
|
1154
1155
|
}),
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ F(b, {
|
|
1156
1157
|
className: G.orgFilterArea,
|
|
1157
1158
|
size: "sub",
|
|
1158
|
-
children: /* @__PURE__ */
|
|
1159
|
+
children: /* @__PURE__ */ F(x, { children: /* @__PURE__ */ F(y, {
|
|
1159
1160
|
span: 3,
|
|
1160
|
-
children: /* @__PURE__ */
|
|
1161
|
+
children: /* @__PURE__ */ F(S, {
|
|
1161
1162
|
fullWidth: !0,
|
|
1162
|
-
layout:
|
|
1163
|
+
layout: L.VERTICAL,
|
|
1163
1164
|
name: "positionSearchText",
|
|
1164
|
-
children: /* @__PURE__ */
|
|
1165
|
+
children: /* @__PURE__ */ F(C, {
|
|
1165
1166
|
fullWidth: !0,
|
|
1166
1167
|
onChange: (e) => a(e.target.value),
|
|
1167
1168
|
placeholder: "搜尋職位名稱或代碼",
|
|
@@ -1172,28 +1173,28 @@ function at({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1172
1173
|
})
|
|
1173
1174
|
}) })
|
|
1174
1175
|
}),
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ F("div", {
|
|
1176
1177
|
className: G.tableFrame,
|
|
1177
|
-
children: /* @__PURE__ */
|
|
1178
|
+
children: /* @__PURE__ */ F(j, {
|
|
1178
1179
|
actions: e,
|
|
1179
1180
|
columns: d,
|
|
1180
1181
|
dataSource: [...c],
|
|
1181
1182
|
fullWidth: !0,
|
|
1182
1183
|
loading: t,
|
|
1183
|
-
pagination:
|
|
1184
|
+
pagination: ut({
|
|
1184
1185
|
onPageChange: r,
|
|
1185
1186
|
onPageSizeChange: i,
|
|
1186
1187
|
page: o,
|
|
1187
1188
|
pageSize: s,
|
|
1188
1189
|
total: u
|
|
1189
1190
|
}),
|
|
1190
|
-
style: { minWidth:
|
|
1191
|
+
style: { minWidth: nt }
|
|
1191
1192
|
})
|
|
1192
1193
|
})
|
|
1193
1194
|
] });
|
|
1194
1195
|
}
|
|
1195
|
-
function
|
|
1196
|
-
let T =
|
|
1196
|
+
function ct({ actions: e, loading: t, onCreate: r, onActiveFilterChange: i, onOrgUnitFilterChange: o, onPageChange: s, onPageSizeChange: c, onPositionFilterChange: l, orgUnitFilter: u, orgUnits: d, page: f, pageSize: m, positionFilter: h, positions: _, rows: v, statusFilter: C, total: w }) {
|
|
1197
|
+
let T = p(() => [
|
|
1197
1198
|
{
|
|
1198
1199
|
dataIndex: "memberName",
|
|
1199
1200
|
key: "memberName",
|
|
@@ -1230,25 +1231,25 @@ function ot({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1230
1231
|
title: "結束日",
|
|
1231
1232
|
width: 140
|
|
1232
1233
|
}
|
|
1233
|
-
], []), E =
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1234
|
+
], []), E = p(() => d.map(n), [d]), D = p(() => _.map(a), [_]);
|
|
1235
|
+
return /* @__PURE__ */ I(P, { children: [
|
|
1236
|
+
/* @__PURE__ */ F(X, {
|
|
1236
1237
|
actionLabel: "新增歸屬",
|
|
1237
1238
|
description: "會員歸屬是 BPM 內部組織權限、主管解析與條件判斷的來源。",
|
|
1238
1239
|
onCreate: r,
|
|
1239
1240
|
title: "會員歸屬"
|
|
1240
1241
|
}),
|
|
1241
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ F(b, {
|
|
1242
1243
|
className: [G.orgFilterArea, G.membershipFilterArea].join(" "),
|
|
1243
1244
|
size: "sub",
|
|
1244
|
-
children: /* @__PURE__ */
|
|
1245
|
-
/* @__PURE__ */
|
|
1245
|
+
children: /* @__PURE__ */ I(x, { children: [
|
|
1246
|
+
/* @__PURE__ */ F(y, {
|
|
1246
1247
|
span: 2,
|
|
1247
|
-
children: /* @__PURE__ */
|
|
1248
|
+
children: /* @__PURE__ */ F(S, {
|
|
1248
1249
|
fullWidth: !0,
|
|
1249
|
-
layout:
|
|
1250
|
+
layout: L.VERTICAL,
|
|
1250
1251
|
name: "membershipOrgUnitFilter",
|
|
1251
|
-
children: /* @__PURE__ */
|
|
1252
|
+
children: /* @__PURE__ */ F(g, {
|
|
1252
1253
|
disabledOptionsFilter: !0,
|
|
1253
1254
|
emptyText: "沒有符合的組織",
|
|
1254
1255
|
inputProps: {
|
|
@@ -1259,7 +1260,7 @@ function ot({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1259
1260
|
},
|
|
1260
1261
|
mode: "single",
|
|
1261
1262
|
name: "membershipOrgUnitFilter",
|
|
1262
|
-
onChange: (e) => o(
|
|
1263
|
+
onChange: (e) => o(kt(e)),
|
|
1263
1264
|
options: [...E],
|
|
1264
1265
|
placeholder: "全部組織",
|
|
1265
1266
|
size: "sub",
|
|
@@ -1267,13 +1268,13 @@ function ot({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1267
1268
|
})
|
|
1268
1269
|
})
|
|
1269
1270
|
}),
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ F(y, {
|
|
1271
1272
|
span: 2,
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1273
|
+
children: /* @__PURE__ */ F(S, {
|
|
1273
1274
|
fullWidth: !0,
|
|
1274
|
-
layout:
|
|
1275
|
+
layout: L.VERTICAL,
|
|
1275
1276
|
name: "membershipPositionFilter",
|
|
1276
|
-
children: /* @__PURE__ */
|
|
1277
|
+
children: /* @__PURE__ */ F(g, {
|
|
1277
1278
|
disabledOptionsFilter: !0,
|
|
1278
1279
|
emptyText: "沒有符合的職位",
|
|
1279
1280
|
inputProps: {
|
|
@@ -1284,21 +1285,21 @@ function ot({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1284
1285
|
},
|
|
1285
1286
|
mode: "single",
|
|
1286
1287
|
name: "membershipPositionFilter",
|
|
1287
|
-
onChange: (e) => l(
|
|
1288
|
+
onChange: (e) => l(At(e)),
|
|
1288
1289
|
options: [...D],
|
|
1289
1290
|
placeholder: "全部職位",
|
|
1290
1291
|
size: "sub",
|
|
1291
|
-
value:
|
|
1292
|
+
value: h
|
|
1292
1293
|
})
|
|
1293
1294
|
})
|
|
1294
1295
|
}),
|
|
1295
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ F(y, {
|
|
1296
1297
|
span: 2,
|
|
1297
|
-
children: /* @__PURE__ */
|
|
1298
|
+
children: /* @__PURE__ */ F(S, {
|
|
1298
1299
|
fullWidth: !0,
|
|
1299
|
-
layout:
|
|
1300
|
+
layout: L.VERTICAL,
|
|
1300
1301
|
name: "membershipStatusFilter",
|
|
1301
|
-
children: /* @__PURE__ */
|
|
1302
|
+
children: /* @__PURE__ */ F(g, {
|
|
1302
1303
|
disabledOptionsFilter: !0,
|
|
1303
1304
|
emptyText: "沒有符合的狀態",
|
|
1304
1305
|
inputProps: {
|
|
@@ -1309,8 +1310,8 @@ function ot({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1309
1310
|
},
|
|
1310
1311
|
mode: "single",
|
|
1311
1312
|
name: "membershipStatusFilter",
|
|
1312
|
-
onChange: (e) =>
|
|
1313
|
-
options: [
|
|
1313
|
+
onChange: (e) => i(Ot(e)),
|
|
1314
|
+
options: [...$e],
|
|
1314
1315
|
placeholder: "全部狀態",
|
|
1315
1316
|
size: "sub",
|
|
1316
1317
|
value: C
|
|
@@ -1319,28 +1320,28 @@ function ot({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1319
1320
|
})
|
|
1320
1321
|
] })
|
|
1321
1322
|
}),
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ F("div", {
|
|
1323
1324
|
className: G.tableFrame,
|
|
1324
|
-
children: /* @__PURE__ */
|
|
1325
|
+
children: /* @__PURE__ */ F(j, {
|
|
1325
1326
|
actions: e,
|
|
1326
1327
|
columns: T,
|
|
1327
|
-
dataSource: [...
|
|
1328
|
+
dataSource: [...v],
|
|
1328
1329
|
fullWidth: !0,
|
|
1329
|
-
loading:
|
|
1330
|
-
pagination:
|
|
1330
|
+
loading: t,
|
|
1331
|
+
pagination: ut({
|
|
1331
1332
|
onPageChange: s,
|
|
1332
1333
|
onPageSizeChange: c,
|
|
1333
|
-
page:
|
|
1334
|
+
page: f,
|
|
1334
1335
|
pageSize: m,
|
|
1335
1336
|
total: w
|
|
1336
1337
|
}),
|
|
1337
|
-
style: { minWidth:
|
|
1338
|
+
style: { minWidth: rt }
|
|
1338
1339
|
})
|
|
1339
1340
|
})
|
|
1340
1341
|
] });
|
|
1341
1342
|
}
|
|
1342
|
-
function
|
|
1343
|
-
let m =
|
|
1343
|
+
function lt({ 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: f }) {
|
|
1344
|
+
let m = p(() => [
|
|
1344
1345
|
{
|
|
1345
1346
|
dataIndex: "scopeLabel",
|
|
1346
1347
|
key: "scopeLabel",
|
|
@@ -1372,43 +1373,43 @@ function st({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1372
1373
|
width: 140
|
|
1373
1374
|
}
|
|
1374
1375
|
], []);
|
|
1375
|
-
return /* @__PURE__ */
|
|
1376
|
-
/* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ I(P, { children: [
|
|
1377
|
+
/* @__PURE__ */ F(X, {
|
|
1377
1378
|
actionLabel: "新增主管規則",
|
|
1378
1379
|
description: "簽核主管規則獨立於組織樹 parent,解析優先序為會員、組織、職位。",
|
|
1379
1380
|
onCreate: n,
|
|
1380
1381
|
title: "簽核主管"
|
|
1381
1382
|
}),
|
|
1382
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ F(b, {
|
|
1383
1384
|
className: G.orgFilterArea,
|
|
1384
1385
|
size: "sub",
|
|
1385
|
-
children: /* @__PURE__ */
|
|
1386
|
+
children: /* @__PURE__ */ I(x, { children: [/* @__PURE__ */ F(y, {
|
|
1386
1387
|
span: 3,
|
|
1387
|
-
children: /* @__PURE__ */
|
|
1388
|
+
children: /* @__PURE__ */ F(S, {
|
|
1388
1389
|
fullWidth: !0,
|
|
1389
|
-
layout:
|
|
1390
|
+
layout: L.VERTICAL,
|
|
1390
1391
|
name: "managerScopeTypeFilter",
|
|
1391
|
-
children: /* @__PURE__ */
|
|
1392
|
+
children: /* @__PURE__ */ F(O, {
|
|
1392
1393
|
clearable: !1,
|
|
1393
1394
|
fullWidth: !0,
|
|
1394
|
-
onChange: (e) => o(
|
|
1395
|
-
options: [...
|
|
1395
|
+
onChange: (e) => o(Et(e)),
|
|
1396
|
+
options: [...Ze],
|
|
1396
1397
|
placeholder: "套用範圍",
|
|
1397
1398
|
size: "sub",
|
|
1398
1399
|
value: u
|
|
1399
1400
|
})
|
|
1400
1401
|
})
|
|
1401
|
-
}), /* @__PURE__ */
|
|
1402
|
+
}), /* @__PURE__ */ F(y, {
|
|
1402
1403
|
span: 2,
|
|
1403
|
-
children: /* @__PURE__ */
|
|
1404
|
+
children: /* @__PURE__ */ F(S, {
|
|
1404
1405
|
fullWidth: !0,
|
|
1405
|
-
layout:
|
|
1406
|
+
layout: L.VERTICAL,
|
|
1406
1407
|
name: "managerStatusFilter",
|
|
1407
|
-
children: /* @__PURE__ */
|
|
1408
|
+
children: /* @__PURE__ */ F(O, {
|
|
1408
1409
|
clearable: !1,
|
|
1409
1410
|
fullWidth: !0,
|
|
1410
|
-
onChange: (e) => r(
|
|
1411
|
-
options: [
|
|
1411
|
+
onChange: (e) => r(Dt(e)),
|
|
1412
|
+
options: [...$e],
|
|
1412
1413
|
placeholder: "狀態",
|
|
1413
1414
|
size: "sub",
|
|
1414
1415
|
value: d
|
|
@@ -1416,62 +1417,62 @@ function st({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1416
1417
|
})
|
|
1417
1418
|
})] })
|
|
1418
1419
|
}),
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ F("div", {
|
|
1420
1421
|
className: G.tableFrame,
|
|
1421
|
-
children: /* @__PURE__ */
|
|
1422
|
+
children: /* @__PURE__ */ F(j, {
|
|
1422
1423
|
actions: e,
|
|
1423
1424
|
columns: m,
|
|
1424
1425
|
dataSource: [...l],
|
|
1425
1426
|
fullWidth: !0,
|
|
1426
1427
|
loading: t,
|
|
1427
|
-
pagination:
|
|
1428
|
+
pagination: ut({
|
|
1428
1429
|
onPageChange: i,
|
|
1429
1430
|
onPageSizeChange: a,
|
|
1430
1431
|
page: s,
|
|
1431
1432
|
pageSize: c,
|
|
1432
|
-
total:
|
|
1433
|
+
total: f
|
|
1433
1434
|
}),
|
|
1434
|
-
style: { minWidth:
|
|
1435
|
+
style: { minWidth: it }
|
|
1435
1436
|
})
|
|
1436
1437
|
})
|
|
1437
1438
|
] });
|
|
1438
1439
|
}
|
|
1439
|
-
function
|
|
1440
|
+
function ut({ onPageChange: e, onPageSizeChange: t, page: n, pageSize: r, total: i }) {
|
|
1440
1441
|
return {
|
|
1441
1442
|
current: n,
|
|
1442
1443
|
onChange: e,
|
|
1443
1444
|
onChangePageSize: t,
|
|
1444
1445
|
pageSize: r,
|
|
1445
1446
|
pageSizeLabel: "每頁筆數",
|
|
1446
|
-
pageSizeOptions: [
|
|
1447
|
+
pageSizeOptions: [...et],
|
|
1447
1448
|
renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
|
|
1448
1449
|
showPageSizeOptions: !0,
|
|
1449
1450
|
total: i
|
|
1450
1451
|
};
|
|
1451
1452
|
}
|
|
1452
|
-
function
|
|
1453
|
+
function Y({ isTreeEditing: e, isTreeMode: t }) {
|
|
1453
1454
|
return t ? e ? "儲存" : "開始編輯" : "新增組織";
|
|
1454
1455
|
}
|
|
1455
|
-
function
|
|
1456
|
-
return t ? e ?
|
|
1456
|
+
function dt({ isTreeEditing: e, isTreeMode: t }) {
|
|
1457
|
+
return t ? e ? re : te : ne;
|
|
1457
1458
|
}
|
|
1458
|
-
function
|
|
1459
|
+
function ft({ hasDraftChanges: e, isTreeEditing: t, isTreeMode: n, loading: r, saving: i }) {
|
|
1459
1460
|
return n ? t ? !e || i : r : !1;
|
|
1460
1461
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return /* @__PURE__ */
|
|
1462
|
+
function X({ actionDisabled: e = !1, actionIcon: t = ne, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
|
|
1463
|
+
return /* @__PURE__ */ I("div", {
|
|
1463
1464
|
className: G.tableIntro,
|
|
1464
|
-
children: [/* @__PURE__ */
|
|
1465
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(M, {
|
|
1465
1466
|
component: "h2",
|
|
1466
1467
|
variant: "h3",
|
|
1467
1468
|
children: o
|
|
1468
|
-
}), /* @__PURE__ */
|
|
1469
|
+
}), /* @__PURE__ */ F(M, {
|
|
1469
1470
|
color: "text-neutral",
|
|
1470
1471
|
variant: "body",
|
|
1471
1472
|
children: i
|
|
1472
|
-
})] }), /* @__PURE__ */
|
|
1473
|
+
})] }), /* @__PURE__ */ I("div", {
|
|
1473
1474
|
className: G.tableIntroActions,
|
|
1474
|
-
children: [r, /* @__PURE__ */
|
|
1475
|
+
children: [r, /* @__PURE__ */ F(_, {
|
|
1475
1476
|
disabled: e,
|
|
1476
1477
|
icon: t,
|
|
1477
1478
|
iconType: "leading",
|
|
@@ -1481,23 +1482,23 @@ function Q({ actionDisabled: e = !1, actionIcon: t = L, actionLabel: n, actions:
|
|
|
1481
1482
|
})]
|
|
1482
1483
|
});
|
|
1483
1484
|
}
|
|
1484
|
-
function
|
|
1485
|
-
let [
|
|
1486
|
-
return
|
|
1485
|
+
function pt({ modal: e, onClose: t, onSubmit: r, orgUnits: a, saving: o }) {
|
|
1486
|
+
let [s, l] = h(""), [u, f] = h(""), [p, m] = h(null), [g, _] = h(K[2]);
|
|
1487
|
+
return d(() => {
|
|
1487
1488
|
if (!e) return;
|
|
1488
|
-
let
|
|
1489
|
-
l(
|
|
1490
|
-
}, [e, a]), /* @__PURE__ */
|
|
1489
|
+
let t = e.record, r = t?.parentId ?? e.parentId ?? null, i = r ? a.find((e) => e.id === r) ?? null : null;
|
|
1490
|
+
l(t?.code ?? ""), f(t?.name ?? ""), m(i ? n(i) : null), _(K.find((e) => e.id === t?.type) ?? K[2]);
|
|
1491
|
+
}, [e, a]), /* @__PURE__ */ F(w, {
|
|
1491
1492
|
cancelText: "取消",
|
|
1492
|
-
confirmButtonProps: { disabled: !
|
|
1493
|
+
confirmButtonProps: { disabled: !s || !u },
|
|
1493
1494
|
confirmText: e?.type === "EDIT" ? "儲存" : "建立",
|
|
1494
1495
|
loading: o,
|
|
1495
1496
|
modalType: "standard",
|
|
1496
|
-
onCancel:
|
|
1497
|
-
onClose:
|
|
1498
|
-
onConfirm: () => void
|
|
1499
|
-
code:
|
|
1500
|
-
name:
|
|
1497
|
+
onCancel: t,
|
|
1498
|
+
onClose: t,
|
|
1499
|
+
onConfirm: () => void r({
|
|
1500
|
+
code: s,
|
|
1501
|
+
name: u,
|
|
1501
1502
|
parentId: p?.id ?? null,
|
|
1502
1503
|
type: g.id
|
|
1503
1504
|
}),
|
|
@@ -1506,41 +1507,41 @@ function ut({ modal: e, onClose: n, onSubmit: i, orgUnits: a, saving: o }) {
|
|
|
1506
1507
|
showModalHeader: !0,
|
|
1507
1508
|
size: "regular",
|
|
1508
1509
|
title: e?.type === "EDIT" ? "編輯組織" : "新增組織",
|
|
1509
|
-
children: /* @__PURE__ */
|
|
1510
|
+
children: /* @__PURE__ */ I("div", {
|
|
1510
1511
|
className: G.modalFields,
|
|
1511
1512
|
children: [
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ F(Z, {
|
|
1513
1514
|
label: "代碼",
|
|
1514
1515
|
name: "orgCode",
|
|
1515
1516
|
onChange: l,
|
|
1516
1517
|
placeholder: "例如 FIN-TW",
|
|
1517
|
-
value:
|
|
1518
|
+
value: s
|
|
1518
1519
|
}),
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
+
/* @__PURE__ */ F(Z, {
|
|
1520
1521
|
label: "名稱",
|
|
1521
1522
|
name: "orgName",
|
|
1522
1523
|
onChange: f,
|
|
1523
1524
|
placeholder: "例如 財務部",
|
|
1524
|
-
value:
|
|
1525
|
+
value: u
|
|
1525
1526
|
}),
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
+
/* @__PURE__ */ F(c, {
|
|
1527
1528
|
label: "類型",
|
|
1528
1529
|
name: "orgType",
|
|
1529
|
-
children: /* @__PURE__ */
|
|
1530
|
+
children: /* @__PURE__ */ F(O, {
|
|
1530
1531
|
clearable: !1,
|
|
1531
1532
|
fullWidth: !0,
|
|
1532
|
-
onChange: (e) => _(
|
|
1533
|
+
onChange: (e) => _($(e)),
|
|
1533
1534
|
options: [...K],
|
|
1534
1535
|
placeholder: "選擇組織類型",
|
|
1535
1536
|
value: g
|
|
1536
1537
|
})
|
|
1537
1538
|
}),
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ F(c, {
|
|
1539
1540
|
label: "上層組織",
|
|
1540
1541
|
name: "parentId",
|
|
1541
|
-
children: /* @__PURE__ */
|
|
1542
|
+
children: /* @__PURE__ */ F(i, {
|
|
1542
1543
|
name: "parentId",
|
|
1543
|
-
onChange:
|
|
1544
|
+
onChange: m,
|
|
1544
1545
|
orgUnits: a.filter((t) => t.id !== e?.record?.id),
|
|
1545
1546
|
placeholder: "選擇上層組織",
|
|
1546
1547
|
value: p
|
|
@@ -1550,11 +1551,11 @@ function ut({ modal: e, onClose: n, onSubmit: i, orgUnits: a, saving: o }) {
|
|
|
1550
1551
|
})
|
|
1551
1552
|
});
|
|
1552
1553
|
}
|
|
1553
|
-
function
|
|
1554
|
-
let [i, a] =
|
|
1555
|
-
return
|
|
1554
|
+
function mt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
1555
|
+
let [i, a] = h(""), [o, s] = h("0"), [c, l] = h("");
|
|
1556
|
+
return d(() => {
|
|
1556
1557
|
e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)), l(e.record?.name ?? ""));
|
|
1557
|
-
}, [e]), /* @__PURE__ */
|
|
1558
|
+
}, [e]), /* @__PURE__ */ F(w, {
|
|
1558
1559
|
cancelText: "取消",
|
|
1559
1560
|
confirmButtonProps: { disabled: !i || !c },
|
|
1560
1561
|
confirmText: e?.type === "EDIT" ? "儲存" : "建立",
|
|
@@ -1572,24 +1573,24 @@ function dt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
|
1572
1573
|
showModalHeader: !0,
|
|
1573
1574
|
size: "regular",
|
|
1574
1575
|
title: e?.type === "EDIT" ? "編輯職位" : "新增職位",
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1576
|
+
children: /* @__PURE__ */ I("div", {
|
|
1576
1577
|
className: G.modalFields,
|
|
1577
1578
|
children: [
|
|
1578
|
-
/* @__PURE__ */
|
|
1579
|
+
/* @__PURE__ */ F(Z, {
|
|
1579
1580
|
label: "代碼",
|
|
1580
1581
|
name: "positionCode",
|
|
1581
1582
|
onChange: a,
|
|
1582
1583
|
placeholder: "例如 FIN-MGR",
|
|
1583
1584
|
value: i
|
|
1584
1585
|
}),
|
|
1585
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ F(Z, {
|
|
1586
1587
|
label: "名稱",
|
|
1587
1588
|
name: "positionName",
|
|
1588
1589
|
onChange: l,
|
|
1589
1590
|
placeholder: "例如 財務主管",
|
|
1590
1591
|
value: c
|
|
1591
1592
|
}),
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
+
/* @__PURE__ */ F(Z, {
|
|
1593
1594
|
label: "職等",
|
|
1594
1595
|
name: "positionLevel",
|
|
1595
1596
|
onChange: s,
|
|
@@ -1600,55 +1601,55 @@ function dt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
|
1600
1601
|
})
|
|
1601
1602
|
});
|
|
1602
1603
|
}
|
|
1603
|
-
function
|
|
1604
|
-
let [g, _] =
|
|
1605
|
-
return
|
|
1606
|
-
if (!
|
|
1607
|
-
let
|
|
1608
|
-
_(
|
|
1604
|
+
function ht({ membersById: e, modal: t, onClose: l, onSubmit: u, orgUnits: f, positions: p, saving: m }) {
|
|
1605
|
+
let [g, _] = h(Ft()), [v, y] = h(""), [b, x] = h(J[1]), [S, C] = h(null), [T, E] = h(null), [D, k] = h(null);
|
|
1606
|
+
return d(() => {
|
|
1607
|
+
if (!t) return;
|
|
1608
|
+
let i = t.record, o = i ? e.get(i.memberId) : null;
|
|
1609
|
+
_(i?.effectiveFrom ?? Ft()), y(i?.effectiveTo ?? ""), x(J.find((e) => e.value === i?.isPrimary) ?? J[1]), C(o ? r(o) : null), E(Pt(f.find((e) => e.id === i?.orgUnitId), n)), k(Pt(p.find((e) => e.id === i?.positionId), a));
|
|
1609
1610
|
}, [
|
|
1610
1611
|
e,
|
|
1611
|
-
|
|
1612
|
+
t,
|
|
1612
1613
|
f,
|
|
1613
1614
|
p
|
|
1614
|
-
]), /* @__PURE__ */
|
|
1615
|
+
]), /* @__PURE__ */ F(w, {
|
|
1615
1616
|
cancelText: "取消",
|
|
1616
1617
|
confirmButtonProps: { disabled: !S || !T },
|
|
1617
|
-
confirmText:
|
|
1618
|
-
loading:
|
|
1618
|
+
confirmText: t?.type === "EDIT" ? "儲存" : "建立",
|
|
1619
|
+
loading: m,
|
|
1619
1620
|
modalType: "standard",
|
|
1620
1621
|
onCancel: l,
|
|
1621
1622
|
onClose: l,
|
|
1622
|
-
onConfirm: () => void
|
|
1623
|
+
onConfirm: () => void u({
|
|
1623
1624
|
effectiveFrom: g,
|
|
1624
1625
|
effectiveTo: v || null,
|
|
1625
1626
|
isPrimary: b.value,
|
|
1626
1627
|
memberId: S?.id ?? null,
|
|
1627
1628
|
orgUnitId: T?.id ?? null,
|
|
1628
|
-
positionId:
|
|
1629
|
+
positionId: D?.id ?? null
|
|
1629
1630
|
}),
|
|
1630
|
-
open: !!
|
|
1631
|
+
open: !!t,
|
|
1631
1632
|
showModalFooter: !0,
|
|
1632
1633
|
showModalHeader: !0,
|
|
1633
1634
|
size: "regular",
|
|
1634
|
-
title:
|
|
1635
|
-
children: /* @__PURE__ */
|
|
1635
|
+
title: t?.type === "EDIT" ? "編輯會員歸屬" : "新增會員歸屬",
|
|
1636
|
+
children: /* @__PURE__ */ I("div", {
|
|
1636
1637
|
className: G.modalFields,
|
|
1637
1638
|
children: [
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ F(c, {
|
|
1639
1640
|
label: "會員",
|
|
1640
1641
|
name: "memberId",
|
|
1641
|
-
children: /* @__PURE__ */
|
|
1642
|
+
children: /* @__PURE__ */ F(s, {
|
|
1642
1643
|
name: "memberId",
|
|
1643
|
-
onChange:
|
|
1644
|
+
onChange: C,
|
|
1644
1645
|
placeholder: "搜尋會員姓名或信箱",
|
|
1645
1646
|
value: S
|
|
1646
1647
|
})
|
|
1647
1648
|
}),
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ F(c, {
|
|
1649
1650
|
label: "組織",
|
|
1650
1651
|
name: "orgUnitId",
|
|
1651
|
-
children: /* @__PURE__ */
|
|
1652
|
+
children: /* @__PURE__ */ F(i, {
|
|
1652
1653
|
name: "orgUnitId",
|
|
1653
1654
|
onChange: E,
|
|
1654
1655
|
orgUnits: f,
|
|
@@ -1656,37 +1657,37 @@ function ft({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
|
|
|
1656
1657
|
value: T
|
|
1657
1658
|
})
|
|
1658
1659
|
}),
|
|
1659
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ F(c, {
|
|
1660
1661
|
label: "職位",
|
|
1661
1662
|
name: "positionId",
|
|
1662
|
-
children: /* @__PURE__ */
|
|
1663
|
+
children: /* @__PURE__ */ F(o, {
|
|
1663
1664
|
name: "positionId",
|
|
1664
1665
|
onChange: k,
|
|
1665
1666
|
placeholder: "選擇職位",
|
|
1666
1667
|
positions: p,
|
|
1667
|
-
value:
|
|
1668
|
+
value: D
|
|
1668
1669
|
})
|
|
1669
1670
|
}),
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ F(c, {
|
|
1671
1672
|
label: "歸屬類型",
|
|
1672
1673
|
name: "isPrimary",
|
|
1673
|
-
children: /* @__PURE__ */
|
|
1674
|
+
children: /* @__PURE__ */ F(O, {
|
|
1674
1675
|
clearable: !1,
|
|
1675
1676
|
fullWidth: !0,
|
|
1676
|
-
onChange: (e) => x(
|
|
1677
|
+
onChange: (e) => x(jt(e)),
|
|
1677
1678
|
options: [...J],
|
|
1678
1679
|
placeholder: "選擇歸屬類型",
|
|
1679
1680
|
value: b
|
|
1680
1681
|
})
|
|
1681
1682
|
}),
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ F(Q, {
|
|
1683
1684
|
label: "生效日",
|
|
1684
1685
|
name: "membershipEffectiveFrom",
|
|
1685
1686
|
onChange: _,
|
|
1686
1687
|
placeholder: "YYYY-MM-DD",
|
|
1687
1688
|
value: g
|
|
1688
1689
|
}),
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ F(Q, {
|
|
1690
1691
|
label: "結束日",
|
|
1691
1692
|
name: "membershipEffectiveTo",
|
|
1692
1693
|
onChange: y,
|
|
@@ -1697,117 +1698,117 @@ function ft({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
|
|
|
1697
1698
|
})
|
|
1698
1699
|
});
|
|
1699
1700
|
}
|
|
1700
|
-
function
|
|
1701
|
-
let [g, _] =
|
|
1702
|
-
|
|
1703
|
-
if (!
|
|
1704
|
-
let
|
|
1705
|
-
_(
|
|
1701
|
+
function gt({ membersById: e, modal: t, onClose: l, onSubmit: u, orgUnits: f, positions: p, saving: m }) {
|
|
1702
|
+
let [g, _] = h(Ft()), [v, y] = h(""), [b, x] = h(null), [S, C] = h("0"), [T, E] = h(null), [D, k] = h(null), [A, j] = h(null), [N, P] = h(q[0]);
|
|
1703
|
+
d(() => {
|
|
1704
|
+
if (!t) return;
|
|
1705
|
+
let i = t.record, o = q.find((e) => e.id === i?.scopeType) ?? q[0];
|
|
1706
|
+
_(i?.effectiveFrom ?? Ft()), y(i?.effectiveTo ?? ""), x(Pt(i ? e.get(i.managerMemberId) : null, r)), C(String(i?.priority ?? 0)), E(o.id === "MEMBER" ? Pt(i ? e.get(i.scopeId) : null, r) : null), k(o.id === "ORG_UNIT" ? Pt(f.find((e) => e.id === i?.scopeId), n) : null), j(o.id === "POSITION" ? Pt(p.find((e) => e.id === i?.scopeId), a) : null), P(o);
|
|
1706
1707
|
}, [
|
|
1707
1708
|
e,
|
|
1708
|
-
|
|
1709
|
+
t,
|
|
1709
1710
|
f,
|
|
1710
1711
|
p
|
|
1711
1712
|
]);
|
|
1712
|
-
let
|
|
1713
|
-
return /* @__PURE__ */
|
|
1713
|
+
let ee = N.id === "MEMBER" ? T?.id : N.id === "ORG_UNIT" ? D?.id : A?.id, te = !!(N.id === "MEMBER" && T?.id && b?.id && T.id === b.id);
|
|
1714
|
+
return /* @__PURE__ */ F(w, {
|
|
1714
1715
|
cancelText: "取消",
|
|
1715
|
-
confirmButtonProps: { disabled: !b || !
|
|
1716
|
-
confirmText:
|
|
1717
|
-
loading:
|
|
1716
|
+
confirmButtonProps: { disabled: !b || !ee || te },
|
|
1717
|
+
confirmText: t?.type === "EDIT" ? "儲存" : "建立",
|
|
1718
|
+
loading: m,
|
|
1718
1719
|
modalType: "standard",
|
|
1719
1720
|
onCancel: l,
|
|
1720
1721
|
onClose: l,
|
|
1721
|
-
onConfirm: () => void
|
|
1722
|
+
onConfirm: () => void u({
|
|
1722
1723
|
effectiveFrom: g,
|
|
1723
1724
|
effectiveTo: v || null,
|
|
1724
1725
|
managerMemberId: b?.id ?? null,
|
|
1725
1726
|
priority: Number(S),
|
|
1726
|
-
scopeId:
|
|
1727
|
+
scopeId: ee ?? null,
|
|
1727
1728
|
scopeType: N.id
|
|
1728
1729
|
}),
|
|
1729
|
-
open: !!
|
|
1730
|
+
open: !!t,
|
|
1730
1731
|
showModalFooter: !0,
|
|
1731
1732
|
showModalHeader: !0,
|
|
1732
1733
|
size: "regular",
|
|
1733
|
-
title:
|
|
1734
|
-
children: /* @__PURE__ */
|
|
1734
|
+
title: t?.type === "EDIT" ? "編輯主管規則" : "新增主管規則",
|
|
1735
|
+
children: /* @__PURE__ */ I("div", {
|
|
1735
1736
|
className: G.modalFields,
|
|
1736
1737
|
children: [
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
+
/* @__PURE__ */ F(c, {
|
|
1738
1739
|
label: "套用範圍",
|
|
1739
1740
|
name: "scopeType",
|
|
1740
|
-
children: /* @__PURE__ */
|
|
1741
|
+
children: /* @__PURE__ */ F(O, {
|
|
1741
1742
|
clearable: !1,
|
|
1742
1743
|
fullWidth: !0,
|
|
1743
|
-
onChange: (e) =>
|
|
1744
|
+
onChange: (e) => P(Tt(e)),
|
|
1744
1745
|
options: [...q],
|
|
1745
1746
|
placeholder: "選擇套用範圍",
|
|
1746
1747
|
value: N
|
|
1747
1748
|
})
|
|
1748
1749
|
}),
|
|
1749
|
-
N.id === "MEMBER" ? /* @__PURE__ */
|
|
1750
|
+
N.id === "MEMBER" ? /* @__PURE__ */ F(c, {
|
|
1750
1751
|
label: "會員",
|
|
1751
1752
|
name: "scopeMemberId",
|
|
1752
|
-
children: /* @__PURE__ */
|
|
1753
|
+
children: /* @__PURE__ */ F(s, {
|
|
1753
1754
|
name: "scopeMemberId",
|
|
1754
1755
|
onChange: E,
|
|
1755
1756
|
placeholder: "搜尋套用會員",
|
|
1756
1757
|
value: T
|
|
1757
1758
|
})
|
|
1758
1759
|
}) : null,
|
|
1759
|
-
N.id === "ORG_UNIT" ? /* @__PURE__ */
|
|
1760
|
+
N.id === "ORG_UNIT" ? /* @__PURE__ */ F(c, {
|
|
1760
1761
|
label: "組織",
|
|
1761
1762
|
name: "scopeOrgUnitId",
|
|
1762
|
-
children: /* @__PURE__ */
|
|
1763
|
+
children: /* @__PURE__ */ F(i, {
|
|
1763
1764
|
name: "scopeOrgUnitId",
|
|
1764
1765
|
onChange: k,
|
|
1765
1766
|
orgUnits: f,
|
|
1766
1767
|
placeholder: "選擇套用組織",
|
|
1767
|
-
value:
|
|
1768
|
+
value: D
|
|
1768
1769
|
})
|
|
1769
1770
|
}) : null,
|
|
1770
|
-
N.id === "POSITION" ? /* @__PURE__ */
|
|
1771
|
+
N.id === "POSITION" ? /* @__PURE__ */ F(c, {
|
|
1771
1772
|
label: "職位",
|
|
1772
1773
|
name: "scopePositionId",
|
|
1773
|
-
children: /* @__PURE__ */
|
|
1774
|
+
children: /* @__PURE__ */ F(o, {
|
|
1774
1775
|
name: "scopePositionId",
|
|
1775
|
-
onChange:
|
|
1776
|
+
onChange: j,
|
|
1776
1777
|
placeholder: "選擇套用職位",
|
|
1777
1778
|
positions: p,
|
|
1778
1779
|
value: A
|
|
1779
1780
|
})
|
|
1780
1781
|
}) : null,
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
+
/* @__PURE__ */ F(c, {
|
|
1782
1783
|
label: "簽核主管",
|
|
1783
1784
|
name: "managerMemberId",
|
|
1784
|
-
children: /* @__PURE__ */
|
|
1785
|
+
children: /* @__PURE__ */ F(s, {
|
|
1785
1786
|
name: "managerMemberId",
|
|
1786
1787
|
onChange: x,
|
|
1787
1788
|
placeholder: "搜尋簽核主管",
|
|
1788
1789
|
value: b
|
|
1789
1790
|
})
|
|
1790
1791
|
}),
|
|
1791
|
-
|
|
1792
|
+
te ? /* @__PURE__ */ F(M, {
|
|
1792
1793
|
color: "text-error",
|
|
1793
1794
|
variant: "caption",
|
|
1794
1795
|
children: "簽核主管不可設定為套用會員本人。"
|
|
1795
1796
|
}) : null,
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
+
/* @__PURE__ */ F(Z, {
|
|
1797
1798
|
label: "優先序",
|
|
1798
1799
|
name: "managerPriority",
|
|
1799
|
-
onChange:
|
|
1800
|
+
onChange: C,
|
|
1800
1801
|
placeholder: "例如 10",
|
|
1801
1802
|
value: S
|
|
1802
1803
|
}),
|
|
1803
|
-
/* @__PURE__ */
|
|
1804
|
+
/* @__PURE__ */ F(Q, {
|
|
1804
1805
|
label: "生效日",
|
|
1805
1806
|
name: "managerEffectiveFrom",
|
|
1806
1807
|
onChange: _,
|
|
1807
1808
|
placeholder: "YYYY-MM-DD",
|
|
1808
1809
|
value: g
|
|
1809
1810
|
}),
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ F(Q, {
|
|
1811
1812
|
label: "結束日",
|
|
1812
1813
|
name: "managerEffectiveTo",
|
|
1813
1814
|
onChange: y,
|
|
@@ -1818,11 +1819,11 @@ function pt({ membersById: e, modal: c, onClose: l, onSubmit: d, orgUnits: f, po
|
|
|
1818
1819
|
})
|
|
1819
1820
|
});
|
|
1820
1821
|
}
|
|
1821
|
-
function
|
|
1822
|
-
return /* @__PURE__ */
|
|
1822
|
+
function Z({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
|
|
1823
|
+
return /* @__PURE__ */ F(c, {
|
|
1823
1824
|
label: e,
|
|
1824
1825
|
name: t,
|
|
1825
|
-
children: /* @__PURE__ */
|
|
1826
|
+
children: /* @__PURE__ */ F(C, {
|
|
1826
1827
|
fullWidth: !0,
|
|
1827
1828
|
name: t,
|
|
1828
1829
|
onChange: (e) => n(e.target.value),
|
|
@@ -1831,118 +1832,118 @@ function $({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
|
|
|
1831
1832
|
})
|
|
1832
1833
|
});
|
|
1833
1834
|
}
|
|
1834
|
-
function
|
|
1835
|
-
return /* @__PURE__ */
|
|
1835
|
+
function Q({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
|
|
1836
|
+
return /* @__PURE__ */ F(c, {
|
|
1836
1837
|
label: e,
|
|
1837
1838
|
name: t,
|
|
1838
|
-
children: /* @__PURE__ */
|
|
1839
|
+
children: /* @__PURE__ */ F(v, {
|
|
1839
1840
|
format: "YYYY-MM-DD",
|
|
1840
1841
|
fullWidth: !0,
|
|
1841
1842
|
inputProps: { name: t },
|
|
1842
|
-
onChange: (e) => n(
|
|
1843
|
+
onChange: (e) => n(It(e)),
|
|
1843
1844
|
placeholder: r,
|
|
1844
1845
|
value: i.trim() ? i : void 0
|
|
1845
1846
|
})
|
|
1846
1847
|
});
|
|
1847
1848
|
}
|
|
1848
|
-
function
|
|
1849
|
+
function _t(e, t) {
|
|
1849
1850
|
return [...new Set([
|
|
1850
1851
|
...e.map((e) => e.memberId),
|
|
1851
1852
|
...t.map((e) => e.managerMemberId),
|
|
1852
1853
|
...t.filter((e) => e.scopeType === "MEMBER").map((e) => e.scopeId)
|
|
1853
1854
|
])];
|
|
1854
1855
|
}
|
|
1855
|
-
function
|
|
1856
|
-
return e.scopeType === "MEMBER" ? `會員:${
|
|
1856
|
+
function vt(e, t) {
|
|
1857
|
+
return e.scopeType === "MEMBER" ? `會員:${yt(t.membersById.get(e.scopeId))}` : e.scopeType === "ORG_UNIT" ? `組織:${bt(t.orgUnitsById.get(e.scopeId))}` : `職位:${St(t.positionsById.get(e.scopeId))}`;
|
|
1857
1858
|
}
|
|
1858
|
-
function
|
|
1859
|
+
function yt(e) {
|
|
1859
1860
|
return e ? `${e.name} · ${e.email}` : "未知會員";
|
|
1860
1861
|
}
|
|
1861
|
-
function
|
|
1862
|
+
function bt(e) {
|
|
1862
1863
|
return e ? `${e.name} · ${e.code}` : "未知組織";
|
|
1863
1864
|
}
|
|
1864
|
-
function
|
|
1865
|
+
function xt(e) {
|
|
1865
1866
|
return K.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
|
|
1866
1867
|
}
|
|
1867
|
-
function
|
|
1868
|
+
function St(e) {
|
|
1868
1869
|
return e ? `${e.name} · ${e.code}` : "未指定";
|
|
1869
1870
|
}
|
|
1870
|
-
function
|
|
1871
|
+
function Ct(e) {
|
|
1871
1872
|
return e === "MANAGERS" || e === "MEMBERSHIPS" || e === "POSITIONS" ? e : "ORG_UNITS";
|
|
1872
1873
|
}
|
|
1873
|
-
function
|
|
1874
|
-
let t =
|
|
1874
|
+
function $(e) {
|
|
1875
|
+
let t = Nt(e) ? e : null;
|
|
1875
1876
|
if (typeof t?.id == "string") {
|
|
1876
1877
|
let e = t.id;
|
|
1877
1878
|
return K.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? K[2];
|
|
1878
1879
|
}
|
|
1879
1880
|
return K[2];
|
|
1880
1881
|
}
|
|
1881
|
-
function
|
|
1882
|
-
let t =
|
|
1882
|
+
function wt(e) {
|
|
1883
|
+
let t = Nt(e) ? e : null;
|
|
1883
1884
|
if (typeof t?.id == "string") {
|
|
1884
1885
|
let e = t.id;
|
|
1885
|
-
return
|
|
1886
|
+
return Ye.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? Je;
|
|
1886
1887
|
}
|
|
1887
|
-
return
|
|
1888
|
-
}
|
|
1889
|
-
function wt(e) {
|
|
1890
|
-
return jt(e, q, q[0]);
|
|
1888
|
+
return Je;
|
|
1891
1889
|
}
|
|
1892
1890
|
function Tt(e) {
|
|
1893
|
-
return
|
|
1891
|
+
return Mt(e, q, q[0]);
|
|
1894
1892
|
}
|
|
1895
1893
|
function Et(e) {
|
|
1896
|
-
return
|
|
1894
|
+
return Mt(e, Ze, Xe);
|
|
1897
1895
|
}
|
|
1898
1896
|
function Dt(e) {
|
|
1899
|
-
|
|
1900
|
-
return Qe.find((e) => e.id === n) ?? null;
|
|
1897
|
+
return Mt(e, $e, Qe);
|
|
1901
1898
|
}
|
|
1902
1899
|
function Ot(e) {
|
|
1903
|
-
let t =
|
|
1900
|
+
let t = Nt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
|
|
1901
|
+
return $e.find((e) => e.id === n) ?? null;
|
|
1902
|
+
}
|
|
1903
|
+
function kt(e) {
|
|
1904
|
+
let t = Nt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
1904
1905
|
return n && r ? {
|
|
1905
1906
|
id: n,
|
|
1906
1907
|
name: r
|
|
1907
1908
|
} : null;
|
|
1908
1909
|
}
|
|
1909
|
-
function
|
|
1910
|
-
let t =
|
|
1910
|
+
function At(e) {
|
|
1911
|
+
let t = Nt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
1911
1912
|
return n && r ? {
|
|
1912
1913
|
id: n,
|
|
1913
1914
|
name: r
|
|
1914
1915
|
} : null;
|
|
1915
1916
|
}
|
|
1916
|
-
function
|
|
1917
|
-
return
|
|
1917
|
+
function jt(e) {
|
|
1918
|
+
return Mt(e, J, J[1]);
|
|
1918
1919
|
}
|
|
1919
|
-
function
|
|
1920
|
-
let r =
|
|
1920
|
+
function Mt(e, t, n) {
|
|
1921
|
+
let r = Nt(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
|
|
1921
1922
|
return t.find((e) => e.id === i) ?? n;
|
|
1922
1923
|
}
|
|
1923
|
-
function
|
|
1924
|
+
function Nt(e) {
|
|
1924
1925
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1925
1926
|
}
|
|
1926
|
-
function
|
|
1927
|
+
function Pt(e, t) {
|
|
1927
1928
|
return e ? t(e) : null;
|
|
1928
1929
|
}
|
|
1929
|
-
function
|
|
1930
|
-
return
|
|
1931
|
-
}
|
|
1932
|
-
function Ft(e) {
|
|
1933
|
-
let t = e ? new Date(e) : null;
|
|
1934
|
-
return t && !Number.isNaN(t.getTime()) ? It(t) : "";
|
|
1930
|
+
function Ft() {
|
|
1931
|
+
return Lt(/* @__PURE__ */ new Date());
|
|
1935
1932
|
}
|
|
1936
1933
|
function It(e) {
|
|
1937
|
-
|
|
1934
|
+
let t = e ? new Date(e) : null;
|
|
1935
|
+
return t && !Number.isNaN(t.getTime()) ? Lt(t) : "";
|
|
1938
1936
|
}
|
|
1939
1937
|
function Lt(e) {
|
|
1940
|
-
return
|
|
1938
|
+
return `${e.getFullYear()}-${Rt(e.getMonth() + 1)}-${Rt(e.getDate())}`;
|
|
1941
1939
|
}
|
|
1942
1940
|
function Rt(e) {
|
|
1941
|
+
return String(e).padStart(2, "0");
|
|
1942
|
+
}
|
|
1943
|
+
function zt(e) {
|
|
1943
1944
|
return e instanceof Error ? e.message : "讀取組織資料失敗。";
|
|
1944
1945
|
}
|
|
1945
1946
|
//#endregion
|
|
1946
|
-
export {
|
|
1947
|
+
export { at as t };
|
|
1947
1948
|
|
|
1948
|
-
//# sourceMappingURL=orgs-
|
|
1949
|
+
//# sourceMappingURL=orgs-CuHxxd_n.js.map
|