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