@rytass/bpm-core-react 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/chunks/orgs-Bz8hBMoQ.cjs +2 -0
- package/dist/chunks/orgs-Bz8hBMoQ.cjs.map +1 -0
- package/dist/chunks/{orgs-B930facb.js → orgs-Cr_7zsAD.js} +343 -329
- package/dist/chunks/orgs-Cr_7zsAD.js.map +1 -0
- package/dist/pages/admin/orgs/index.cjs +1 -1
- package/dist/pages/admin/orgs/index.js +1 -1
- 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/package.json +3 -3
- package/dist/chunks/orgs-B930facb.js.map +0 -1
- package/dist/chunks/orgs-BefGgeyc.cjs +0 -2
- package/dist/chunks/orgs-BefGgeyc.cjs.map +0 -1
|
@@ -9,15 +9,15 @@ import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
|
9
9
|
import { FormFieldLayout as F } from "@mezzanine-ui/core/form";
|
|
10
10
|
import I from "@mezzanine-ui/react/ContentHeader";
|
|
11
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,
|
|
13
|
-
import { Background as
|
|
14
|
-
import * as
|
|
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, deletePosition as se, readOrganizationDashboard as ce, updateManagerResolution as le, updateMembership as ue, updateOrgUnit as de, updatePosition as fe } from "@rytass/bpm-core-client/organization";
|
|
13
|
+
import { Background as pe, ConnectionMode as me, Controls as he, Handle as ge, MiniMap as _e, Panel as ve, Position as H, ReactFlow as ye, applyNodeChanges as be } from "@xyflow/react";
|
|
14
|
+
import * as xe from "dagre";
|
|
15
15
|
//#region src/lib/org-tree-draft.ts
|
|
16
|
-
function
|
|
16
|
+
function Se(e) {
|
|
17
17
|
return new Map(e.map((e) => [e.id, e.parentId]));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let r = n === e ? e : n, i =
|
|
19
|
+
function Ce({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
20
|
+
let r = n === e ? e : n, i = Te({
|
|
21
21
|
orgUnitId: e,
|
|
22
22
|
parentDraft: t,
|
|
23
23
|
parentId: r
|
|
@@ -39,7 +39,7 @@ function Se({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
|
39
39
|
status: "UPDATED"
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function we({ orgUnits: e, parentDraft: t }) {
|
|
43
43
|
return e.map((e) => {
|
|
44
44
|
let n = t.get(e.id) ?? null;
|
|
45
45
|
return n === e.parentId ? null : {
|
|
@@ -49,7 +49,7 @@ function Ce({ orgUnits: e, parentDraft: t }) {
|
|
|
49
49
|
};
|
|
50
50
|
}).filter((e) => !!e);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Te({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
53
53
|
return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" : U({
|
|
54
54
|
orgUnitId: e,
|
|
55
55
|
parentDraft: t,
|
|
@@ -78,13 +78,13 @@ var W = {
|
|
|
78
78
|
orgTreeNodeHeader: "bpm_orgTreeNodeHeader_LEXl-",
|
|
79
79
|
orgTreeNodeBadge: "bpm_orgTreeNodeBadge_zLc7t",
|
|
80
80
|
orgTreeNodeActions: "bpm_orgTreeNodeActions_cMldI"
|
|
81
|
-
}, G = "__org-tree-root__", K = 232,
|
|
81
|
+
}, G = "__org-tree-root__", K = 232, Ee = 118, De = 232, Oe = 86, ke = 320, Ae = 1.4, je = .25, Me = .005, Ne = 250, Pe = 80, q = .85, Fe = .7, Ie = 1200, Le = 600, Re = 96, ze = {
|
|
82
82
|
COMPANY: "公司",
|
|
83
83
|
DEPARTMENT: "部門",
|
|
84
84
|
DIVISION: "事業群",
|
|
85
85
|
TEAM: "小組"
|
|
86
|
-
},
|
|
87
|
-
let [s, m] = p(!1), [g, _] = p(null), [v, y] = p(null), [b, x] = p(() =>
|
|
86
|
+
}, Be = { orgUnit: He }, Ve = 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(() => Se(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
88
|
k.current = e, C((t) => {
|
|
89
89
|
let n = new Set(t);
|
|
90
90
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
@@ -93,13 +93,13 @@ var W = {
|
|
|
93
93
|
k.current = G, C(/* @__PURE__ */ new Set());
|
|
94
94
|
}, []), F = c(() => {
|
|
95
95
|
k.current = G, C(() => {
|
|
96
|
-
let e =
|
|
96
|
+
let e = Ue(a, b);
|
|
97
97
|
return new Set([...e.keys()].filter((e) => e !== G));
|
|
98
98
|
});
|
|
99
|
-
}, [a, b]), I = d(() => new Map(a.map((e) => [e.id, e])), [a]), L = d(() =>
|
|
99
|
+
}, [a, b]), I = d(() => new Map(a.map((e) => [e.id, e])), [a]), L = d(() => we({
|
|
100
100
|
orgUnits: a,
|
|
101
101
|
parentDraft: b
|
|
102
|
-
}), [a, b]), R = d(() =>
|
|
102
|
+
}), [a, b]), R = d(() => Ge({
|
|
103
103
|
collapsedIds: S,
|
|
104
104
|
isEditing: s,
|
|
105
105
|
measuredHeights: w,
|
|
@@ -131,16 +131,16 @@ var W = {
|
|
|
131
131
|
z.current = R;
|
|
132
132
|
let B = L.length > 0, ee = d(() => {
|
|
133
133
|
let e = Math.max(R.bounds.width, R.bounds.height);
|
|
134
|
-
return e <= 0 ?
|
|
135
|
-
}, [R.bounds.height, R.bounds.width]), V = a.length <=
|
|
134
|
+
return e <= 0 ? je : Math.min(je, Math.max(Me, Ne / e));
|
|
135
|
+
}, [R.bounds.height, R.bounds.width]), V = a.length <= Pe, te = c(() => {
|
|
136
136
|
let e = O.current;
|
|
137
137
|
if (!e) return;
|
|
138
|
-
let { bounds: t, rootCenter: n } = z.current, r = t.width > 0 ?
|
|
139
|
-
if (!Number.isFinite(a) || a >=
|
|
138
|
+
let { bounds: t, rootCenter: n } = z.current, r = t.width > 0 ? Ie / t.width : Infinity, i = t.height > 0 ? Le / t.height : Infinity, a = Math.min(r, i);
|
|
139
|
+
if (!Number.isFinite(a) || a >= Fe) {
|
|
140
140
|
e.fitView({ padding: .18 });
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
let o =
|
|
143
|
+
let o = Le / (2 * q);
|
|
144
144
|
e.setCenter(n.x, Math.min(t.height / 2, o), {
|
|
145
145
|
duration: 0,
|
|
146
146
|
zoom: q
|
|
@@ -162,7 +162,7 @@ var W = {
|
|
|
162
162
|
s,
|
|
163
163
|
i
|
|
164
164
|
]), l(() => {
|
|
165
|
-
let e =
|
|
165
|
+
let e = Se(a);
|
|
166
166
|
x(e), C(/* @__PURE__ */ new Set()), T(/* @__PURE__ */ new Map()), y(null), _(null), m(!1);
|
|
167
167
|
}, [a]), l(() => {
|
|
168
168
|
D(R.nodes);
|
|
@@ -177,14 +177,14 @@ var W = {
|
|
|
177
177
|
if (!e) return;
|
|
178
178
|
k.current = null;
|
|
179
179
|
let t = O.current, n = R.nodes.find((t) => t.id === e);
|
|
180
|
-
!t || !n || t.setCenter(n.position.x + (n.width ?? K) / 2, n.position.y + (n.initialHeight ??
|
|
180
|
+
!t || !n || t.setCenter(n.position.x + (n.width ?? K) / 2, n.position.y + (n.initialHeight ?? Ee) / 2, {
|
|
181
181
|
duration: 200,
|
|
182
182
|
zoom: t.getZoom()
|
|
183
183
|
});
|
|
184
184
|
}, [R.nodes]);
|
|
185
185
|
let re = c((e, t) => {
|
|
186
186
|
x((n) => {
|
|
187
|
-
let r =
|
|
187
|
+
let r = Ce({
|
|
188
188
|
orgUnitId: e,
|
|
189
189
|
parentDraft: n,
|
|
190
190
|
parentId: t
|
|
@@ -208,10 +208,10 @@ var W = {
|
|
|
208
208
|
let r = Math.ceil(t.dimensions.height);
|
|
209
209
|
return Math.abs((n.get(t.id) ?? 0) - r) <= 1 ? e : (n.set(t.id, r), !0);
|
|
210
210
|
}, !1) ? n : e;
|
|
211
|
-
}), s && D((t) =>
|
|
211
|
+
}), s && D((t) => be(e, [...t]));
|
|
212
212
|
}, [s]), oe = c((e, t, n) => {
|
|
213
213
|
if (!s || t.id === G) return;
|
|
214
|
-
let r =
|
|
214
|
+
let r = Je(e, t.id) ?? qe(t, n);
|
|
215
215
|
if (r === void 0) {
|
|
216
216
|
_("拖曳到目標父節點附近,或從父節點拉線到子節點。");
|
|
217
217
|
return;
|
|
@@ -219,10 +219,10 @@ var W = {
|
|
|
219
219
|
re(t.id, r === G ? null : r);
|
|
220
220
|
}, [re, s]);
|
|
221
221
|
function se() {
|
|
222
|
-
m(!0), x(
|
|
222
|
+
m(!0), x(Se(a)), _("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
|
|
223
223
|
}
|
|
224
224
|
function ce() {
|
|
225
|
-
m(!1), x(
|
|
225
|
+
m(!1), x(Se(a)), _("已取消草稿變更。");
|
|
226
226
|
}
|
|
227
227
|
async function le() {
|
|
228
228
|
if (!r) {
|
|
@@ -242,29 +242,29 @@ var W = {
|
|
|
242
242
|
}), B ? /* @__PURE__ */ N("ul", {
|
|
243
243
|
className: W.orgTreeChangeList,
|
|
244
244
|
children: L.map((e) => /* @__PURE__ */ P("li", { children: [
|
|
245
|
-
|
|
245
|
+
et(e.orgUnitId, I),
|
|
246
246
|
":",
|
|
247
|
-
|
|
247
|
+
et(e.previousParentId, I),
|
|
248
248
|
" -> ",
|
|
249
|
-
|
|
249
|
+
et(e.parentId, I)
|
|
250
250
|
] }, e.orgUnitId))
|
|
251
251
|
}) : null]
|
|
252
252
|
}), /* @__PURE__ */ N("div", {
|
|
253
253
|
className: W.orgTreeCanvas,
|
|
254
|
-
children: /* @__PURE__ */ P(
|
|
255
|
-
connectionMode:
|
|
254
|
+
children: /* @__PURE__ */ P(ye, {
|
|
255
|
+
connectionMode: me.Strict,
|
|
256
256
|
edges: [...R.edges],
|
|
257
257
|
fitViewOptions: {
|
|
258
258
|
minZoom: ee,
|
|
259
259
|
padding: .18
|
|
260
260
|
},
|
|
261
|
-
isValidConnection: (e) =>
|
|
261
|
+
isValidConnection: (e) => $e({
|
|
262
262
|
source: e.source,
|
|
263
263
|
target: e.target
|
|
264
264
|
}, b),
|
|
265
|
-
maxZoom:
|
|
265
|
+
maxZoom: Ae,
|
|
266
266
|
minZoom: ee,
|
|
267
|
-
nodeTypes:
|
|
267
|
+
nodeTypes: Be,
|
|
268
268
|
nodes: [...E],
|
|
269
269
|
nodesConnectable: s,
|
|
270
270
|
nodesDraggable: s,
|
|
@@ -285,9 +285,9 @@ var W = {
|
|
|
285
285
|
panOnDrag: !0,
|
|
286
286
|
proOptions: { hideAttribution: !0 },
|
|
287
287
|
children: [
|
|
288
|
-
/* @__PURE__ */ N(
|
|
289
|
-
/* @__PURE__ */ N(
|
|
290
|
-
/* @__PURE__ */ P(
|
|
288
|
+
/* @__PURE__ */ N(pe, {}),
|
|
289
|
+
/* @__PURE__ */ N(he, {}),
|
|
290
|
+
/* @__PURE__ */ P(ve, {
|
|
291
291
|
className: `${W.orgTreePanel} nopan nodrag`,
|
|
292
292
|
position: "top-right",
|
|
293
293
|
children: [/* @__PURE__ */ N(h, {
|
|
@@ -302,7 +302,7 @@ var W = {
|
|
|
302
302
|
children: "全部收合"
|
|
303
303
|
})]
|
|
304
304
|
}),
|
|
305
|
-
V ? /* @__PURE__ */ N(
|
|
305
|
+
V ? /* @__PURE__ */ N(_e, {
|
|
306
306
|
pannable: !0,
|
|
307
307
|
zoomable: !0
|
|
308
308
|
}) : null
|
|
@@ -311,7 +311,7 @@ var W = {
|
|
|
311
311
|
})]
|
|
312
312
|
});
|
|
313
313
|
});
|
|
314
|
-
function
|
|
314
|
+
function He({ data: e, selected: t }) {
|
|
315
315
|
return /* @__PURE__ */ P("div", {
|
|
316
316
|
className: [
|
|
317
317
|
W.orgTreeNode,
|
|
@@ -321,13 +321,13 @@ function Ve({ data: e, selected: t }) {
|
|
|
321
321
|
t ? W.orgTreeNodeSelected : ""
|
|
322
322
|
].filter(Boolean).join(" "),
|
|
323
323
|
children: [
|
|
324
|
-
e.isSyntheticRoot ? null : /* @__PURE__ */ N(
|
|
324
|
+
e.isSyntheticRoot ? null : /* @__PURE__ */ N(ge, {
|
|
325
325
|
id: "target",
|
|
326
326
|
isConnectable: e.isEditing,
|
|
327
327
|
position: H.Top,
|
|
328
328
|
type: "target"
|
|
329
329
|
}),
|
|
330
|
-
/* @__PURE__ */ N(
|
|
330
|
+
/* @__PURE__ */ N(ge, {
|
|
331
331
|
id: "source",
|
|
332
332
|
isConnectable: e.isEditing,
|
|
333
333
|
position: H.Bottom,
|
|
@@ -399,14 +399,14 @@ function Ve({ data: e, selected: t }) {
|
|
|
399
399
|
]
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Ue(e, t) {
|
|
403
403
|
let n = /* @__PURE__ */ new Map();
|
|
404
404
|
return e.forEach((e) => {
|
|
405
405
|
let r = t.get(e.id) ?? G;
|
|
406
406
|
n.set(r, [...n.get(r) ?? [], e.id]);
|
|
407
407
|
}), n;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function We({ childrenMap: e, collapsedIds: t }) {
|
|
410
410
|
let n = /* @__PURE__ */ new Set(), r = (i) => {
|
|
411
411
|
t.has(i) || (e.get(i) ?? []).forEach((e) => {
|
|
412
412
|
n.add(e), r(e);
|
|
@@ -414,29 +414,29 @@ function Ue({ childrenMap: e, collapsedIds: t }) {
|
|
|
414
414
|
};
|
|
415
415
|
return r(G), n;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
let u =
|
|
417
|
+
function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild: r, onEditOrgUnit: i, onToggleCollapse: a, orgUnits: o, orgUnitsById: s, parentDraft: c, selectedOrgUnitId: l }) {
|
|
418
|
+
let u = Ue(o, c), d = We({
|
|
419
419
|
childrenMap: u,
|
|
420
420
|
collapsedIds: e
|
|
421
|
-
}), f = o.filter((e) => d.has(e.id)), p = (e) => u.get(e)?.length ?? 0, m = (e, t) => Math.max(t, n.get(e) ?? 0), h = new
|
|
421
|
+
}), f = o.filter((e) => d.has(e.id)), p = (e) => u.get(e)?.length ?? 0, m = (e, t) => Math.max(t, n.get(e) ?? 0), h = new xe.graphlib.Graph();
|
|
422
422
|
h.setDefaultEdgeLabel(() => ({})), h.setGraph({
|
|
423
423
|
marginx: 36,
|
|
424
424
|
marginy: 36,
|
|
425
425
|
nodesep: 44,
|
|
426
426
|
rankdir: "TB",
|
|
427
|
-
ranksep:
|
|
427
|
+
ranksep: Re
|
|
428
428
|
}), h.setNode(G, {
|
|
429
|
-
height: m(G,
|
|
430
|
-
width:
|
|
429
|
+
height: m(G, Oe),
|
|
430
|
+
width: De
|
|
431
431
|
}), f.forEach((e) => {
|
|
432
432
|
h.setNode(e.id, {
|
|
433
|
-
height: m(e.id,
|
|
433
|
+
height: m(e.id, Ee),
|
|
434
434
|
width: K
|
|
435
435
|
});
|
|
436
436
|
}), f.forEach((e) => {
|
|
437
437
|
let t = c.get(e.id) ?? null;
|
|
438
438
|
h.setEdge(t ?? G, e.id);
|
|
439
|
-
}),
|
|
439
|
+
}), xe.layout(h);
|
|
440
440
|
let g = h.graph(), _ = {
|
|
441
441
|
height: g.height ?? 0,
|
|
442
442
|
width: g.width ?? 0
|
|
@@ -444,7 +444,7 @@ function We({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
444
444
|
x: _.width > 0 ? _.width / 2 : v?.x ?? 0,
|
|
445
445
|
y: v?.y ?? 0
|
|
446
446
|
}, b = {
|
|
447
|
-
...
|
|
447
|
+
...Ke({
|
|
448
448
|
data: {
|
|
449
449
|
changed: !1,
|
|
450
450
|
childCount: p(G),
|
|
@@ -463,18 +463,18 @@ function We({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
463
463
|
typeLabel: ""
|
|
464
464
|
},
|
|
465
465
|
graph: h,
|
|
466
|
-
height: m(G,
|
|
466
|
+
height: m(G, Oe),
|
|
467
467
|
id: G,
|
|
468
468
|
selected: l === null,
|
|
469
|
-
width:
|
|
469
|
+
width: De
|
|
470
470
|
}),
|
|
471
471
|
position: {
|
|
472
|
-
x: y.x -
|
|
473
|
-
y: y.y - m(G,
|
|
472
|
+
x: y.x - De / 2,
|
|
473
|
+
y: y.y - m(G, Oe) / 2
|
|
474
474
|
}
|
|
475
475
|
}, x = f.map((n) => {
|
|
476
|
-
let o = c.get(n.id) ?? null, u =
|
|
477
|
-
return
|
|
476
|
+
let o = c.get(n.id) ?? null, u = et(o, s);
|
|
477
|
+
return Ke({
|
|
478
478
|
data: {
|
|
479
479
|
changed: o !== n.parentId,
|
|
480
480
|
childCount: p(n.id),
|
|
@@ -490,10 +490,10 @@ function We({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
490
490
|
orgUnitId: n.id,
|
|
491
491
|
parentLabel: u,
|
|
492
492
|
path: n.path,
|
|
493
|
-
typeLabel:
|
|
493
|
+
typeLabel: tt(n.type)
|
|
494
494
|
},
|
|
495
495
|
graph: h,
|
|
496
|
-
height: m(n.id,
|
|
496
|
+
height: m(n.id, Ee),
|
|
497
497
|
id: n.id,
|
|
498
498
|
selected: l === n.id,
|
|
499
499
|
width: K
|
|
@@ -522,7 +522,7 @@ function We({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
|
|
|
522
522
|
rootCenter: y
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Ke({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
|
|
526
526
|
let o = t.node(r);
|
|
527
527
|
return {
|
|
528
528
|
data: e,
|
|
@@ -543,15 +543,15 @@ function Ge({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
|
|
|
543
543
|
width: a
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
let n =
|
|
546
|
+
function qe(e, t) {
|
|
547
|
+
let n = Ze(e);
|
|
548
548
|
return t.filter((t) => t.id !== e.id).map((e) => ({
|
|
549
|
-
distance:
|
|
549
|
+
distance: Qe(n, Ze(e)),
|
|
550
550
|
id: e.id
|
|
551
|
-
})).filter((e) => e.distance <=
|
|
551
|
+
})).filter((e) => e.distance <= ke).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
let n =
|
|
553
|
+
function Je(e, t) {
|
|
554
|
+
let n = Ye(e);
|
|
555
555
|
if (n) return Array.from(document.querySelectorAll(".react-flow__node[data-id]")).map((e) => {
|
|
556
556
|
let r = e.dataset.id;
|
|
557
557
|
if (!r || r === t) return null;
|
|
@@ -560,43 +560,43 @@ function qe(e, t) {
|
|
|
560
560
|
y: i.top + i.height / 2
|
|
561
561
|
};
|
|
562
562
|
return {
|
|
563
|
-
distance:
|
|
563
|
+
distance: Qe(n, a),
|
|
564
564
|
id: r
|
|
565
565
|
};
|
|
566
|
-
}).filter((e) => !!e).filter((e) => e.distance <=
|
|
566
|
+
}).filter((e) => !!e).filter((e) => e.distance <= ke).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
return
|
|
568
|
+
function Ye(e) {
|
|
569
|
+
return Xe(e) ? {
|
|
570
570
|
x: e.clientX,
|
|
571
571
|
y: e.clientY
|
|
572
572
|
} : null;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Xe(e) {
|
|
575
575
|
return typeof e == "object" && !!e && "clientX" in e && "clientY" in e && typeof e.clientX == "number" && typeof e.clientY == "number";
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function Ze(e) {
|
|
578
578
|
return {
|
|
579
579
|
x: e.position.x + (e.width ?? K) / 2,
|
|
580
|
-
y: e.position.y + (e.measured?.height ?? e.initialHeight ??
|
|
580
|
+
y: e.position.y + (e.measured?.height ?? e.initialHeight ?? Ee) / 2
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function Qe(e, t) {
|
|
584
584
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
return !e.source || !e.target || e.target === G ? !1 :
|
|
586
|
+
function $e(e, t) {
|
|
587
|
+
return !e.source || !e.target || e.target === G ? !1 : Te({
|
|
588
588
|
orgUnitId: e.target,
|
|
589
589
|
parentDraft: t,
|
|
590
590
|
parentId: e.source === G ? null : e.source
|
|
591
591
|
}) === null;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function et(e, t) {
|
|
594
594
|
if (!e) return "根節點";
|
|
595
595
|
let n = t.get(e);
|
|
596
596
|
return n ? `${n.name} · ${n.code}` : "未知組織";
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
return
|
|
598
|
+
function tt(e) {
|
|
599
|
+
return ze[e.toUpperCase()] ?? "未知類型";
|
|
600
600
|
}
|
|
601
601
|
var J = {
|
|
602
602
|
tableIntroActions: "bpm_tableIntroActions_WO4XU",
|
|
@@ -606,10 +606,10 @@ var J = {
|
|
|
606
606
|
orgFilterArea: "bpm_orgFilterArea_Xjbbp",
|
|
607
607
|
membershipFilterArea: "bpm_membershipFilterArea_zob-Y",
|
|
608
608
|
scopeLabel: "bpm_scopeLabel_TLHMC"
|
|
609
|
-
},
|
|
609
|
+
}, nt = {
|
|
610
610
|
hasDraftChanges: !1,
|
|
611
611
|
isEditing: !1
|
|
612
|
-
},
|
|
612
|
+
}, rt = 100, Y = [
|
|
613
613
|
{
|
|
614
614
|
id: "COMPANY",
|
|
615
615
|
name: "公司"
|
|
@@ -626,10 +626,10 @@ var J = {
|
|
|
626
626
|
id: "TEAM",
|
|
627
627
|
name: "小組"
|
|
628
628
|
}
|
|
629
|
-
],
|
|
629
|
+
], it = {
|
|
630
630
|
id: "ALL",
|
|
631
631
|
name: "全部類型"
|
|
632
|
-
},
|
|
632
|
+
}, at = [it, ...Y], X = [
|
|
633
633
|
{
|
|
634
634
|
id: "MEMBER",
|
|
635
635
|
name: "指定會員"
|
|
@@ -642,14 +642,14 @@ var J = {
|
|
|
642
642
|
id: "POSITION",
|
|
643
643
|
name: "指定職位"
|
|
644
644
|
}
|
|
645
|
-
],
|
|
645
|
+
], ot = {
|
|
646
646
|
id: "ALL",
|
|
647
647
|
name: "全部範圍"
|
|
648
|
-
},
|
|
648
|
+
}, st = [ot, ...X], ct = {
|
|
649
649
|
activeOnly: !1,
|
|
650
650
|
id: "ALL",
|
|
651
651
|
name: "全部狀態"
|
|
652
|
-
}, Z = [
|
|
652
|
+
}, Z = [ct, {
|
|
653
653
|
activeOnly: !0,
|
|
654
654
|
id: "ACTIVE",
|
|
655
655
|
name: "目前有效"
|
|
@@ -661,40 +661,40 @@ var J = {
|
|
|
661
661
|
id: "false",
|
|
662
662
|
name: "一般歸屬",
|
|
663
663
|
value: !1
|
|
664
|
-
}],
|
|
664
|
+
}], lt = [
|
|
665
665
|
10,
|
|
666
666
|
20,
|
|
667
667
|
50
|
|
668
|
-
],
|
|
669
|
-
function
|
|
670
|
-
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(
|
|
668
|
+
], ut = 1368, dt = 948, ft = 1292, pt = 1124;
|
|
669
|
+
function mt() {
|
|
670
|
+
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(ct), [v, y] = p(1), [b, x] = p(10), [E, k] = p(ot), [F, L] = p(0), [R, z] = p([]), [B, pe] = p(null), [me, he] = p(null), [ge, _e] = p(null), [ve, H] = p(1), [ye, be] = p(10), [xe, Se] = p(null), [Ce, we] = p(0), [Te, U] = p(null), [W, G] = p(1), [K, Ee] = p(10), [De, Oe] = p(""), [ke, Ae] = p(0), [je, Me] = p(it), [Ne, Pe] = p("TABLE"), [q, Fe] = p([]), [Ie, Le] = p([]), [Re, ze] = p([]), [Be, Ve] = p(null), [He, Ue] = p(1), [We, Ge] = p(10), [Ke, qe] = p(""), [Je, Ye] = p(0), [Xe, Ze] = p([]), [Qe, $e] = p([]), [et, tt] = p([]), [J, nt] = p(!1);
|
|
671
671
|
l(() => {
|
|
672
672
|
n && a(n);
|
|
673
673
|
}, [n]);
|
|
674
|
-
let Y = n ?? i,
|
|
674
|
+
let Y = n ?? i, at = c(async () => {
|
|
675
675
|
f(!0), s(null);
|
|
676
676
|
try {
|
|
677
|
-
let e = await
|
|
677
|
+
let e = await ce({
|
|
678
678
|
managerActiveOnly: g.activeOnly,
|
|
679
679
|
managerPage: v,
|
|
680
680
|
managerPageSize: b,
|
|
681
681
|
managerScopeType: E.id === "ALL" ? null : E.id,
|
|
682
682
|
membershipActiveOnly: B?.activeOnly ?? !1,
|
|
683
|
-
membershipOrgUnitId:
|
|
684
|
-
membershipPage:
|
|
685
|
-
membershipPageSize:
|
|
686
|
-
membershipPositionId:
|
|
683
|
+
membershipOrgUnitId: ge?.id ?? null,
|
|
684
|
+
membershipPage: ve,
|
|
685
|
+
membershipPageSize: ye,
|
|
686
|
+
membershipPositionId: xe?.id ?? null,
|
|
687
687
|
orgUnitPage: W,
|
|
688
688
|
orgUnitPageSize: K,
|
|
689
|
-
orgUnitSearchText:
|
|
690
|
-
orgUnitType:
|
|
691
|
-
positionPage:
|
|
692
|
-
positionPageSize:
|
|
693
|
-
positionSearchText:
|
|
694
|
-
}), t =
|
|
695
|
-
z(n),
|
|
689
|
+
orgUnitSearchText: De,
|
|
690
|
+
orgUnitType: je.id === "ALL" ? null : je.id,
|
|
691
|
+
positionPage: He,
|
|
692
|
+
positionPageSize: We,
|
|
693
|
+
positionSearchText: Ke
|
|
694
|
+
}), t = kt(e.memberships, e.managerResolutions), n = await j(t);
|
|
695
|
+
z(n), Fe(e.orgUnits), Ae(e.orgUnitCount), Le(e.filteredOrgUnits), Ze(e.positions), Ye(e.positionCount), ze(e.filteredPositions), we(e.membershipCount), tt(e.filteredMemberships), L(e.managerResolutionCount), $e(e.filteredManagerResolutions);
|
|
696
696
|
} catch (e) {
|
|
697
|
-
s(
|
|
697
|
+
s(Qt(e));
|
|
698
698
|
} finally {
|
|
699
699
|
f(!1);
|
|
700
700
|
}
|
|
@@ -704,55 +704,55 @@ function pt() {
|
|
|
704
704
|
b,
|
|
705
705
|
E,
|
|
706
706
|
B,
|
|
707
|
-
|
|
708
|
-
_e,
|
|
707
|
+
ge,
|
|
709
708
|
ve,
|
|
710
|
-
|
|
709
|
+
ye,
|
|
710
|
+
xe,
|
|
711
711
|
W,
|
|
712
712
|
K,
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
713
|
+
De,
|
|
714
|
+
je,
|
|
715
|
+
He,
|
|
716
|
+
We,
|
|
717
|
+
Ke
|
|
718
718
|
]);
|
|
719
719
|
l(() => {
|
|
720
|
-
|
|
721
|
-
}, [
|
|
722
|
-
let X = d(() => new Map(q.map((e) => [e.id, e])), [q]),
|
|
720
|
+
at();
|
|
721
|
+
}, [at]);
|
|
722
|
+
let X = d(() => new Map(q.map((e) => [e.id, e])), [q]), st = d(() => new Map(Xe.map((e) => [e.id, e])), [Xe]), Z = d(() => new Map(R.map((e) => [e.memberId, e])), [R]), Q = d(() => Ie.map((e) => ({
|
|
723
723
|
...e,
|
|
724
724
|
key: e.id,
|
|
725
|
-
parentName: e.parentId ?
|
|
726
|
-
typeLabel:
|
|
727
|
-
})), [
|
|
725
|
+
parentName: e.parentId ? Mt(X.get(e.parentId)) : "根節點",
|
|
726
|
+
typeLabel: Nt(e.type)
|
|
727
|
+
})), [Ie, X]), lt = d(() => Re.map((e) => ({
|
|
728
728
|
...e,
|
|
729
729
|
key: e.id
|
|
730
|
-
})), [
|
|
730
|
+
})), [Re]), ut = d(() => et.map((e) => ({
|
|
731
731
|
...e,
|
|
732
732
|
key: e.id,
|
|
733
|
-
memberName:
|
|
734
|
-
orgUnitName:
|
|
735
|
-
positionName: e.positionId ?
|
|
733
|
+
memberName: jt(Z.get(e.memberId)),
|
|
734
|
+
orgUnitName: Mt(X.get(e.orgUnitId)),
|
|
735
|
+
positionName: e.positionId ? Pt(st.get(e.positionId)) : "未指定"
|
|
736
736
|
})), [
|
|
737
737
|
Z,
|
|
738
|
-
|
|
738
|
+
et,
|
|
739
739
|
X,
|
|
740
|
-
|
|
741
|
-
]),
|
|
740
|
+
st
|
|
741
|
+
]), dt = d(() => Qe.map((e) => ({
|
|
742
742
|
...e,
|
|
743
743
|
key: e.id,
|
|
744
|
-
managerName:
|
|
745
|
-
scopeLabel:
|
|
744
|
+
managerName: jt(Z.get(e.managerMemberId)),
|
|
745
|
+
scopeLabel: At(e, {
|
|
746
746
|
membersById: Z,
|
|
747
747
|
orgUnitsById: X,
|
|
748
|
-
positionsById:
|
|
748
|
+
positionsById: st
|
|
749
749
|
})
|
|
750
750
|
})), [
|
|
751
|
-
|
|
751
|
+
Qe,
|
|
752
752
|
Z,
|
|
753
753
|
X,
|
|
754
|
-
|
|
755
|
-
]),
|
|
754
|
+
st
|
|
755
|
+
]), ft = d(() => ({
|
|
756
756
|
render: (e) => [{
|
|
757
757
|
name: "編輯",
|
|
758
758
|
onClick: () => U({
|
|
@@ -772,20 +772,30 @@ function pt() {
|
|
|
772
772
|
}],
|
|
773
773
|
variant: "base-secondary",
|
|
774
774
|
width: 128
|
|
775
|
-
}), []),
|
|
775
|
+
}), []), pt = d(() => ({
|
|
776
776
|
render: (e) => [{
|
|
777
777
|
name: "編輯",
|
|
778
|
-
onClick: () =>
|
|
778
|
+
onClick: () => Ve({
|
|
779
779
|
record: e,
|
|
780
780
|
type: "EDIT"
|
|
781
781
|
})
|
|
782
|
+
}, {
|
|
783
|
+
name: "刪除",
|
|
784
|
+
onClick: () => r({
|
|
785
|
+
confirmText: "刪除職位",
|
|
786
|
+
description: `刪除職位「${e.name}」。若仍有會員歸屬、主管解析規則、簽核範本或進行中單據的加簽對象引用它,系統會拒絕刪除並說明原因。`,
|
|
787
|
+
id: e.id,
|
|
788
|
+
title: "刪除職位",
|
|
789
|
+
type: "POSITION"
|
|
790
|
+
}),
|
|
791
|
+
variant: "destructive-secondary"
|
|
782
792
|
}],
|
|
783
793
|
variant: "base-secondary",
|
|
784
|
-
width:
|
|
785
|
-
}), []),
|
|
794
|
+
width: 128
|
|
795
|
+
}), []), mt = d(() => ({
|
|
786
796
|
render: (e) => [{
|
|
787
797
|
name: "編輯",
|
|
788
|
-
onClick: () =>
|
|
798
|
+
onClick: () => he({
|
|
789
799
|
record: e,
|
|
790
800
|
type: "EDIT"
|
|
791
801
|
})
|
|
@@ -802,7 +812,7 @@ function pt() {
|
|
|
802
812
|
}],
|
|
803
813
|
variant: "base-secondary",
|
|
804
814
|
width: 128
|
|
805
|
-
}), []),
|
|
815
|
+
}), []), yt = d(() => ({
|
|
806
816
|
render: (e) => [{
|
|
807
817
|
name: "編輯",
|
|
808
818
|
onClick: () => h({
|
|
@@ -823,60 +833,60 @@ function pt() {
|
|
|
823
833
|
variant: "base-secondary",
|
|
824
834
|
width: 128
|
|
825
835
|
}), []);
|
|
826
|
-
function yt(e) {
|
|
827
|
-
G(1), De(e);
|
|
828
|
-
}
|
|
829
836
|
function bt(e) {
|
|
830
|
-
G(1),
|
|
837
|
+
G(1), Oe(e);
|
|
831
838
|
}
|
|
832
839
|
function xt(e) {
|
|
833
|
-
|
|
840
|
+
G(1), Me(e);
|
|
834
841
|
}
|
|
835
842
|
function St(e) {
|
|
836
|
-
|
|
843
|
+
Ue(1), qe(e);
|
|
844
|
+
}
|
|
845
|
+
function Ct(e) {
|
|
846
|
+
H(1), pe(e);
|
|
837
847
|
}
|
|
838
848
|
function $(e) {
|
|
839
|
-
H(1),
|
|
849
|
+
H(1), _e(e);
|
|
840
850
|
}
|
|
841
|
-
function
|
|
842
|
-
H(1),
|
|
851
|
+
function Ot(e) {
|
|
852
|
+
H(1), Se(e);
|
|
843
853
|
}
|
|
844
|
-
function
|
|
854
|
+
function It(e) {
|
|
845
855
|
y(1), _(e);
|
|
846
856
|
}
|
|
847
|
-
function
|
|
857
|
+
function Lt(e) {
|
|
848
858
|
y(1), k(e);
|
|
849
859
|
}
|
|
850
|
-
function
|
|
860
|
+
function Rt() {
|
|
851
861
|
J || r(null);
|
|
852
862
|
}
|
|
853
|
-
async function
|
|
854
|
-
n && await
|
|
855
|
-
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);
|
|
863
|
+
async function zt() {
|
|
864
|
+
n && await Vt(async () => {
|
|
865
|
+
n.type === "ORG_UNIT" && await oe(n.id), n.type === "POSITION" && await se(n.id), n.type === "MEMBERSHIP" && await ae(n.id), n.type === "MANAGER_RESOLUTION" && await ie(n.id), r(null);
|
|
856
866
|
});
|
|
857
867
|
}
|
|
858
|
-
async function
|
|
859
|
-
|
|
868
|
+
async function Bt(e) {
|
|
869
|
+
nt(!0), s(null);
|
|
860
870
|
try {
|
|
861
871
|
await ee({ moves: e.map((e) => ({
|
|
862
872
|
baseUpdatedAt: X.get(e.orgUnitId)?.updatedAt ?? "",
|
|
863
873
|
id: e.orgUnitId,
|
|
864
874
|
parentId: e.parentId
|
|
865
|
-
})) }), await
|
|
875
|
+
})) }), await at();
|
|
866
876
|
} catch (e) {
|
|
867
|
-
throw s(
|
|
877
|
+
throw s(Qt(e)), e;
|
|
868
878
|
} finally {
|
|
869
|
-
|
|
879
|
+
nt(!1);
|
|
870
880
|
}
|
|
871
881
|
}
|
|
872
|
-
async function
|
|
873
|
-
|
|
882
|
+
async function Vt(e) {
|
|
883
|
+
nt(!0), s(null);
|
|
874
884
|
try {
|
|
875
|
-
await e(), await
|
|
885
|
+
await e(), await at();
|
|
876
886
|
} catch (e) {
|
|
877
|
-
s(
|
|
887
|
+
s(Qt(e));
|
|
878
888
|
} finally {
|
|
879
|
-
|
|
889
|
+
nt(!1);
|
|
880
890
|
}
|
|
881
891
|
}
|
|
882
892
|
return /* @__PURE__ */ P(M, { children: [
|
|
@@ -887,7 +897,7 @@ function pt() {
|
|
|
887
897
|
/* @__PURE__ */ N(T, { children: /* @__PURE__ */ P(w, {
|
|
888
898
|
tab: /* @__PURE__ */ P(D, {
|
|
889
899
|
activeKey: e,
|
|
890
|
-
onChange: (e) => t(
|
|
900
|
+
onChange: (e) => t(Ft(e)),
|
|
891
901
|
children: [
|
|
892
902
|
/* @__PURE__ */ N(O, { children: "組織樹" }, "ORG_UNITS"),
|
|
893
903
|
/* @__PURE__ */ N(O, { children: "職位" }, "POSITIONS"),
|
|
@@ -901,8 +911,8 @@ function pt() {
|
|
|
901
911
|
variant: "body",
|
|
902
912
|
children: o
|
|
903
913
|
}) : null,
|
|
904
|
-
e === "ORG_UNITS" ? /* @__PURE__ */ N(
|
|
905
|
-
actions:
|
|
914
|
+
e === "ORG_UNITS" ? /* @__PURE__ */ N(ht, {
|
|
915
|
+
actions: ft,
|
|
906
916
|
loading: u,
|
|
907
917
|
onCreate: () => U({
|
|
908
918
|
parentId: null,
|
|
@@ -919,94 +929,94 @@ function pt() {
|
|
|
919
929
|
type: "EDIT"
|
|
920
930
|
}),
|
|
921
931
|
onPageChange: G,
|
|
922
|
-
onSaveDraft:
|
|
932
|
+
onSaveDraft: Bt,
|
|
923
933
|
onPageSizeChange: (e) => {
|
|
924
|
-
G(1),
|
|
934
|
+
G(1), Ee(e);
|
|
925
935
|
},
|
|
926
|
-
onSearchTextChange:
|
|
927
|
-
onTypeFilterChange:
|
|
936
|
+
onSearchTextChange: bt,
|
|
937
|
+
onTypeFilterChange: xt,
|
|
928
938
|
orgUnits: q,
|
|
929
939
|
page: W,
|
|
930
940
|
pageSize: K,
|
|
931
941
|
rows: Q,
|
|
932
|
-
searchText:
|
|
942
|
+
searchText: De,
|
|
933
943
|
saving: J,
|
|
934
|
-
total:
|
|
935
|
-
typeFilter:
|
|
936
|
-
viewMode:
|
|
937
|
-
onViewModeChange:
|
|
944
|
+
total: ke,
|
|
945
|
+
typeFilter: je,
|
|
946
|
+
viewMode: Ne,
|
|
947
|
+
onViewModeChange: Pe
|
|
938
948
|
}) : null,
|
|
939
|
-
e === "POSITIONS" ? /* @__PURE__ */ N(
|
|
940
|
-
actions:
|
|
949
|
+
e === "POSITIONS" ? /* @__PURE__ */ N(gt, {
|
|
950
|
+
actions: pt,
|
|
941
951
|
loading: u,
|
|
942
|
-
onCreate: () =>
|
|
952
|
+
onCreate: () => Ve({
|
|
943
953
|
record: null,
|
|
944
954
|
type: "CREATE"
|
|
945
955
|
}),
|
|
946
|
-
onPageChange:
|
|
956
|
+
onPageChange: Ue,
|
|
947
957
|
onPageSizeChange: (e) => {
|
|
948
|
-
|
|
958
|
+
Ue(1), Ge(e);
|
|
949
959
|
},
|
|
950
|
-
onSearchTextChange:
|
|
951
|
-
page:
|
|
952
|
-
pageSize:
|
|
953
|
-
rows:
|
|
954
|
-
searchText:
|
|
955
|
-
total:
|
|
960
|
+
onSearchTextChange: St,
|
|
961
|
+
page: He,
|
|
962
|
+
pageSize: We,
|
|
963
|
+
rows: lt,
|
|
964
|
+
searchText: Ke,
|
|
965
|
+
total: Je
|
|
956
966
|
}) : null,
|
|
957
|
-
e === "MEMBERSHIPS" ? /* @__PURE__ */ N(
|
|
958
|
-
actions:
|
|
967
|
+
e === "MEMBERSHIPS" ? /* @__PURE__ */ N(_t, {
|
|
968
|
+
actions: mt,
|
|
959
969
|
loading: u,
|
|
960
|
-
onCreate: () =>
|
|
970
|
+
onCreate: () => he({
|
|
961
971
|
record: null,
|
|
962
972
|
type: "CREATE"
|
|
963
973
|
}),
|
|
964
|
-
onActiveFilterChange:
|
|
974
|
+
onActiveFilterChange: Ct,
|
|
965
975
|
onOrgUnitFilterChange: $,
|
|
966
976
|
onPageChange: H,
|
|
967
977
|
onPageSizeChange: (e) => {
|
|
968
|
-
H(1),
|
|
978
|
+
H(1), be(e);
|
|
969
979
|
},
|
|
970
|
-
onPositionFilterChange:
|
|
971
|
-
orgUnitFilter:
|
|
980
|
+
onPositionFilterChange: Ot,
|
|
981
|
+
orgUnitFilter: ge,
|
|
972
982
|
orgUnits: q,
|
|
973
|
-
page:
|
|
974
|
-
pageSize:
|
|
975
|
-
positionFilter:
|
|
976
|
-
positions:
|
|
977
|
-
rows:
|
|
983
|
+
page: ve,
|
|
984
|
+
pageSize: ye,
|
|
985
|
+
positionFilter: xe,
|
|
986
|
+
positions: Xe,
|
|
987
|
+
rows: ut,
|
|
978
988
|
statusFilter: B,
|
|
979
|
-
total:
|
|
989
|
+
total: Ce
|
|
980
990
|
}) : null,
|
|
981
|
-
e === "MANAGERS" ? /* @__PURE__ */ N(
|
|
982
|
-
actions:
|
|
991
|
+
e === "MANAGERS" ? /* @__PURE__ */ N(vt, {
|
|
992
|
+
actions: yt,
|
|
983
993
|
loading: u,
|
|
984
994
|
onCreate: () => h({
|
|
985
995
|
record: null,
|
|
986
996
|
type: "CREATE"
|
|
987
997
|
}),
|
|
988
|
-
onActiveFilterChange:
|
|
998
|
+
onActiveFilterChange: It,
|
|
989
999
|
onPageChange: y,
|
|
990
1000
|
onPageSizeChange: (e) => {
|
|
991
1001
|
y(1), x(e);
|
|
992
1002
|
},
|
|
993
|
-
onScopeTypeFilterChange:
|
|
1003
|
+
onScopeTypeFilterChange: Lt,
|
|
994
1004
|
page: v,
|
|
995
1005
|
pageSize: b,
|
|
996
|
-
rows:
|
|
1006
|
+
rows: dt,
|
|
997
1007
|
scopeTypeFilter: E,
|
|
998
1008
|
statusFilter: g,
|
|
999
1009
|
total: F
|
|
1000
1010
|
}) : null
|
|
1001
1011
|
]
|
|
1002
1012
|
}) }),
|
|
1003
|
-
/* @__PURE__ */ N(
|
|
1004
|
-
modal:
|
|
1013
|
+
/* @__PURE__ */ N(wt, {
|
|
1014
|
+
modal: Te,
|
|
1005
1015
|
onClose: () => U(null),
|
|
1006
|
-
onSubmit: (e) =>
|
|
1007
|
-
|
|
1016
|
+
onSubmit: (e) => Vt(async () => {
|
|
1017
|
+
Te?.type === "EDIT" && Te.record ? await de({
|
|
1008
1018
|
...e,
|
|
1009
|
-
id:
|
|
1019
|
+
id: Te.record.id,
|
|
1010
1020
|
metadataJson: null
|
|
1011
1021
|
}) : await ne({
|
|
1012
1022
|
code: e.code ?? "",
|
|
@@ -1019,97 +1029,101 @@ function pt() {
|
|
|
1019
1029
|
orgUnits: q,
|
|
1020
1030
|
saving: J
|
|
1021
1031
|
}),
|
|
1022
|
-
/* @__PURE__ */ N(
|
|
1023
|
-
modal:
|
|
1024
|
-
onClose: () =>
|
|
1025
|
-
onSubmit: (e) =>
|
|
1026
|
-
|
|
1032
|
+
/* @__PURE__ */ N(Tt, {
|
|
1033
|
+
modal: Be,
|
|
1034
|
+
onClose: () => Ve(null),
|
|
1035
|
+
onSubmit: (e) => Vt(async () => {
|
|
1036
|
+
Be?.type === "EDIT" && Be.record ? await fe({
|
|
1027
1037
|
...e,
|
|
1028
|
-
id:
|
|
1038
|
+
id: Be.record.id,
|
|
1029
1039
|
metadataJson: null
|
|
1030
1040
|
}) : await re({
|
|
1031
1041
|
code: e.code ?? "",
|
|
1032
1042
|
level: e.level ?? 0,
|
|
1033
1043
|
metadataJson: "{}",
|
|
1034
1044
|
name: e.name ?? ""
|
|
1035
|
-
}),
|
|
1045
|
+
}), Ve(null);
|
|
1036
1046
|
}),
|
|
1037
1047
|
saving: J
|
|
1038
1048
|
}),
|
|
1039
|
-
/* @__PURE__ */ N(
|
|
1049
|
+
/* @__PURE__ */ N(Et, {
|
|
1040
1050
|
membersById: Z,
|
|
1041
|
-
modal:
|
|
1042
|
-
onClose: () =>
|
|
1043
|
-
onSubmit: (e) =>
|
|
1044
|
-
|
|
1051
|
+
modal: me,
|
|
1052
|
+
onClose: () => he(null),
|
|
1053
|
+
onSubmit: (e) => Vt(async () => {
|
|
1054
|
+
me?.type === "EDIT" && me.record ? await ue({
|
|
1045
1055
|
...e,
|
|
1046
|
-
id:
|
|
1056
|
+
id: me.record.id
|
|
1047
1057
|
}) : await te({
|
|
1048
|
-
effectiveFrom: e.effectiveFrom ??
|
|
1058
|
+
effectiveFrom: e.effectiveFrom ?? Jt(),
|
|
1049
1059
|
effectiveTo: e.effectiveTo,
|
|
1050
1060
|
isPrimary: e.isPrimary ?? !1,
|
|
1051
1061
|
memberId: e.memberId ?? "",
|
|
1052
1062
|
orgUnitId: e.orgUnitId ?? "",
|
|
1053
1063
|
positionId: e.positionId
|
|
1054
|
-
}),
|
|
1064
|
+
}), he(null);
|
|
1055
1065
|
}),
|
|
1056
1066
|
orgUnits: q,
|
|
1057
|
-
positions:
|
|
1067
|
+
positions: Xe,
|
|
1058
1068
|
saving: J
|
|
1059
1069
|
}),
|
|
1060
|
-
/* @__PURE__ */ N(
|
|
1070
|
+
/* @__PURE__ */ N(Dt, {
|
|
1061
1071
|
membersById: Z,
|
|
1062
1072
|
modal: m,
|
|
1063
1073
|
onClose: () => h(null),
|
|
1064
|
-
onSubmit: (e) =>
|
|
1065
|
-
m?.type === "EDIT" && m.record ? await
|
|
1074
|
+
onSubmit: (e) => Vt(async () => {
|
|
1075
|
+
m?.type === "EDIT" && m.record ? await le({
|
|
1066
1076
|
...e,
|
|
1067
1077
|
id: m.record.id
|
|
1068
1078
|
}) : await V({
|
|
1069
|
-
effectiveFrom: e.effectiveFrom ??
|
|
1079
|
+
effectiveFrom: e.effectiveFrom ?? Jt(),
|
|
1070
1080
|
effectiveTo: e.effectiveTo,
|
|
1071
1081
|
managerMemberId: e.managerMemberId ?? "",
|
|
1072
|
-
priority: e.priority ??
|
|
1082
|
+
priority: e.priority ?? rt,
|
|
1073
1083
|
scopeId: e.scopeId ?? "",
|
|
1074
1084
|
scopeType: e.scopeType ?? "MEMBER"
|
|
1075
1085
|
}), h(null);
|
|
1076
1086
|
}),
|
|
1077
1087
|
orgUnits: q,
|
|
1078
|
-
positions:
|
|
1088
|
+
positions: Xe,
|
|
1079
1089
|
saving: J
|
|
1080
1090
|
}),
|
|
1081
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ P(S, {
|
|
1082
1092
|
cancelText: "取消",
|
|
1083
1093
|
confirmButtonProps: { variant: "destructive-primary" },
|
|
1084
1094
|
confirmText: Y?.confirmText ?? "",
|
|
1085
1095
|
loading: J,
|
|
1086
1096
|
modalStatusType: "error",
|
|
1087
1097
|
modalType: "standard",
|
|
1088
|
-
onCancel:
|
|
1089
|
-
onClose:
|
|
1090
|
-
onConfirm: () => void
|
|
1098
|
+
onCancel: Rt,
|
|
1099
|
+
onClose: Rt,
|
|
1100
|
+
onConfirm: () => void zt(),
|
|
1091
1101
|
open: !!n,
|
|
1092
1102
|
showModalFooter: !0,
|
|
1093
1103
|
showModalHeader: !0,
|
|
1094
1104
|
size: "regular",
|
|
1095
1105
|
supportingText: "此操作會立即套用,請確認後再繼續。",
|
|
1096
1106
|
title: Y?.title ?? "",
|
|
1097
|
-
children: /* @__PURE__ */ N(A, {
|
|
1107
|
+
children: [/* @__PURE__ */ N(A, {
|
|
1098
1108
|
color: "text-neutral",
|
|
1099
1109
|
variant: "body",
|
|
1100
1110
|
children: Y?.description ?? ""
|
|
1101
|
-
})
|
|
1111
|
+
}), o ? /* @__PURE__ */ N(A, {
|
|
1112
|
+
color: "text-error",
|
|
1113
|
+
variant: "body",
|
|
1114
|
+
children: o
|
|
1115
|
+
}) : null]
|
|
1102
1116
|
})
|
|
1103
1117
|
] });
|
|
1104
1118
|
}
|
|
1105
|
-
function
|
|
1106
|
-
let I = f(null), [R, z] = p(
|
|
1119
|
+
function ht({ 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 }) {
|
|
1120
|
+
let I = f(null), [R, z] = p(nt), B = j === "TABLE" ? "FLOW" : "TABLE", ee = j === "TABLE" ? "切換樹狀圖" : "切換表格", V = j === "FLOW", te = bt({
|
|
1107
1121
|
isTreeMode: V,
|
|
1108
1122
|
isTreeEditing: R.isEditing
|
|
1109
|
-
}), ne =
|
|
1123
|
+
}), ne = xt({
|
|
1110
1124
|
isTreeMode: V,
|
|
1111
1125
|
isTreeEditing: R.isEditing
|
|
1112
|
-
}), re =
|
|
1126
|
+
}), re = St({
|
|
1113
1127
|
hasDraftChanges: R.hasDraftChanges,
|
|
1114
1128
|
isTreeEditing: R.isEditing,
|
|
1115
1129
|
isTreeMode: V,
|
|
@@ -1148,8 +1162,8 @@ function mt({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1148
1162
|
}
|
|
1149
1163
|
], []);
|
|
1150
1164
|
return l(() => {
|
|
1151
|
-
j === "TABLE" && z(
|
|
1152
|
-
}, [j]), /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(
|
|
1165
|
+
j === "TABLE" && z(nt);
|
|
1166
|
+
}, [j]), /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(Ct, {
|
|
1153
1167
|
actionDisabled: re,
|
|
1154
1168
|
actionIcon: ne,
|
|
1155
1169
|
actionLabel: te,
|
|
@@ -1205,8 +1219,8 @@ function mt({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1205
1219
|
children: /* @__PURE__ */ N(E, {
|
|
1206
1220
|
clearable: !1,
|
|
1207
1221
|
fullWidth: !0,
|
|
1208
|
-
onChange: (e) => u(
|
|
1209
|
-
options: [...
|
|
1222
|
+
onChange: (e) => u(Lt(e)),
|
|
1223
|
+
options: [...at],
|
|
1210
1224
|
placeholder: "類型",
|
|
1211
1225
|
size: "sub",
|
|
1212
1226
|
value: A
|
|
@@ -1221,16 +1235,16 @@ function mt({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1221
1235
|
dataSource: [...w],
|
|
1222
1236
|
fullWidth: !0,
|
|
1223
1237
|
loading: t,
|
|
1224
|
-
pagination:
|
|
1238
|
+
pagination: yt({
|
|
1225
1239
|
onPageChange: a,
|
|
1226
1240
|
onPageSizeChange: s,
|
|
1227
1241
|
page: S,
|
|
1228
1242
|
pageSize: C,
|
|
1229
1243
|
total: O
|
|
1230
1244
|
}),
|
|
1231
|
-
style: { minWidth:
|
|
1245
|
+
style: { minWidth: ut }
|
|
1232
1246
|
})
|
|
1233
|
-
})] }) : /* @__PURE__ */ N(
|
|
1247
|
+
})] }) : /* @__PURE__ */ N(Ve, {
|
|
1234
1248
|
ref: I,
|
|
1235
1249
|
onCreateChild: r,
|
|
1236
1250
|
onCreateRoot: n,
|
|
@@ -1241,7 +1255,7 @@ function mt({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1241
1255
|
saving: D
|
|
1242
1256
|
})] });
|
|
1243
1257
|
}
|
|
1244
|
-
function
|
|
1258
|
+
function gt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeChange: i, onSearchTextChange: a, page: o, pageSize: s, rows: c, searchText: l, total: u }) {
|
|
1245
1259
|
let f = d(() => [
|
|
1246
1260
|
{
|
|
1247
1261
|
dataIndex: "code",
|
|
@@ -1269,7 +1283,7 @@ function ht({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1269
1283
|
}
|
|
1270
1284
|
], []);
|
|
1271
1285
|
return /* @__PURE__ */ P(M, { children: [
|
|
1272
|
-
/* @__PURE__ */ N(
|
|
1286
|
+
/* @__PURE__ */ N(Ct, {
|
|
1273
1287
|
actionLabel: "新增職位",
|
|
1274
1288
|
description: "職位提供會員歸屬與主管解析規則使用。",
|
|
1275
1289
|
onCreate: n,
|
|
@@ -1303,19 +1317,19 @@ function ht({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1303
1317
|
dataSource: [...c],
|
|
1304
1318
|
fullWidth: !0,
|
|
1305
1319
|
loading: t,
|
|
1306
|
-
pagination:
|
|
1320
|
+
pagination: yt({
|
|
1307
1321
|
onPageChange: r,
|
|
1308
1322
|
onPageSizeChange: i,
|
|
1309
1323
|
page: o,
|
|
1310
1324
|
pageSize: s,
|
|
1311
1325
|
total: u
|
|
1312
1326
|
}),
|
|
1313
|
-
style: { minWidth:
|
|
1327
|
+
style: { minWidth: dt }
|
|
1314
1328
|
})
|
|
1315
1329
|
})
|
|
1316
1330
|
] });
|
|
1317
1331
|
}
|
|
1318
|
-
function
|
|
1332
|
+
function _t({ actions: e, loading: n, onCreate: r, 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 }) {
|
|
1319
1333
|
let T = d(() => [
|
|
1320
1334
|
{
|
|
1321
1335
|
dataIndex: "memberName",
|
|
@@ -1355,7 +1369,7 @@ function gt({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1355
1369
|
}
|
|
1356
1370
|
], []), E = d(() => f.map(t), [f]), D = d(() => x.map(i), [x]);
|
|
1357
1371
|
return /* @__PURE__ */ P(M, { children: [
|
|
1358
|
-
/* @__PURE__ */ N(
|
|
1372
|
+
/* @__PURE__ */ N(Ct, {
|
|
1359
1373
|
actionLabel: "新增歸屬",
|
|
1360
1374
|
description: "會員歸屬是 BPM 內部組織權限、主管解析與條件判斷的來源。",
|
|
1361
1375
|
onCreate: r,
|
|
@@ -1382,7 +1396,7 @@ function gt({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1382
1396
|
},
|
|
1383
1397
|
mode: "single",
|
|
1384
1398
|
name: "membershipOrgUnitFilter",
|
|
1385
|
-
onChange: (e) => o(
|
|
1399
|
+
onChange: (e) => o(Ht(e)),
|
|
1386
1400
|
options: [...E],
|
|
1387
1401
|
placeholder: "全部組織",
|
|
1388
1402
|
size: "sub",
|
|
@@ -1407,7 +1421,7 @@ function gt({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1407
1421
|
},
|
|
1408
1422
|
mode: "single",
|
|
1409
1423
|
name: "membershipPositionFilter",
|
|
1410
|
-
onChange: (e) => l(
|
|
1424
|
+
onChange: (e) => l(Ut(e)),
|
|
1411
1425
|
options: [...D],
|
|
1412
1426
|
placeholder: "全部職位",
|
|
1413
1427
|
size: "sub",
|
|
@@ -1432,7 +1446,7 @@ function gt({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1432
1446
|
},
|
|
1433
1447
|
mode: "single",
|
|
1434
1448
|
name: "membershipStatusFilter",
|
|
1435
|
-
onChange: (e) => a(
|
|
1449
|
+
onChange: (e) => a(Vt(e)),
|
|
1436
1450
|
options: [...Z],
|
|
1437
1451
|
placeholder: "全部狀態",
|
|
1438
1452
|
size: "sub",
|
|
@@ -1450,19 +1464,19 @@ function gt({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
|
|
|
1450
1464
|
dataSource: [...S],
|
|
1451
1465
|
fullWidth: !0,
|
|
1452
1466
|
loading: n,
|
|
1453
|
-
pagination:
|
|
1467
|
+
pagination: yt({
|
|
1454
1468
|
onPageChange: s,
|
|
1455
1469
|
onPageSizeChange: c,
|
|
1456
1470
|
page: p,
|
|
1457
1471
|
pageSize: h,
|
|
1458
1472
|
total: w
|
|
1459
1473
|
}),
|
|
1460
|
-
style: { minWidth:
|
|
1474
|
+
style: { minWidth: ft }
|
|
1461
1475
|
})
|
|
1462
1476
|
})
|
|
1463
1477
|
] });
|
|
1464
1478
|
}
|
|
1465
|
-
function
|
|
1479
|
+
function vt({ 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 }) {
|
|
1466
1480
|
let m = d(() => [
|
|
1467
1481
|
{
|
|
1468
1482
|
dataIndex: "scopeLabel",
|
|
@@ -1496,7 +1510,7 @@ function _t({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1496
1510
|
}
|
|
1497
1511
|
], []);
|
|
1498
1512
|
return /* @__PURE__ */ P(M, { children: [
|
|
1499
|
-
/* @__PURE__ */ N(
|
|
1513
|
+
/* @__PURE__ */ N(Ct, {
|
|
1500
1514
|
actionLabel: "新增主管規則",
|
|
1501
1515
|
description: "簽核主管規則獨立於組織樹 parent,解析優先序為會員、組織、職位。",
|
|
1502
1516
|
onCreate: n,
|
|
@@ -1514,8 +1528,8 @@ function _t({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1514
1528
|
children: /* @__PURE__ */ N(E, {
|
|
1515
1529
|
clearable: !1,
|
|
1516
1530
|
fullWidth: !0,
|
|
1517
|
-
onChange: (e) => o(
|
|
1518
|
-
options: [...
|
|
1531
|
+
onChange: (e) => o(zt(e)),
|
|
1532
|
+
options: [...st],
|
|
1519
1533
|
placeholder: "套用範圍",
|
|
1520
1534
|
size: "sub",
|
|
1521
1535
|
value: u
|
|
@@ -1530,7 +1544,7 @@ function _t({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1530
1544
|
children: /* @__PURE__ */ N(E, {
|
|
1531
1545
|
clearable: !1,
|
|
1532
1546
|
fullWidth: !0,
|
|
1533
|
-
onChange: (e) => r(
|
|
1547
|
+
onChange: (e) => r(Bt(e)),
|
|
1534
1548
|
options: [...Z],
|
|
1535
1549
|
placeholder: "狀態",
|
|
1536
1550
|
size: "sub",
|
|
@@ -1547,41 +1561,41 @@ function _t({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1547
1561
|
dataSource: [...l],
|
|
1548
1562
|
fullWidth: !0,
|
|
1549
1563
|
loading: t,
|
|
1550
|
-
pagination:
|
|
1564
|
+
pagination: yt({
|
|
1551
1565
|
onPageChange: i,
|
|
1552
1566
|
onPageSizeChange: a,
|
|
1553
1567
|
page: s,
|
|
1554
1568
|
pageSize: c,
|
|
1555
1569
|
total: p
|
|
1556
1570
|
}),
|
|
1557
|
-
style: { minWidth:
|
|
1571
|
+
style: { minWidth: pt }
|
|
1558
1572
|
})
|
|
1559
1573
|
})
|
|
1560
1574
|
] });
|
|
1561
1575
|
}
|
|
1562
|
-
function
|
|
1576
|
+
function yt({ onPageChange: e, onPageSizeChange: t, page: n, pageSize: r, total: i }) {
|
|
1563
1577
|
return {
|
|
1564
1578
|
current: n,
|
|
1565
1579
|
onChange: e,
|
|
1566
1580
|
onChangePageSize: t,
|
|
1567
1581
|
pageSize: r,
|
|
1568
1582
|
pageSizeLabel: "每頁筆數",
|
|
1569
|
-
pageSizeOptions: [...
|
|
1583
|
+
pageSizeOptions: [...lt],
|
|
1570
1584
|
renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
|
|
1571
1585
|
showPageSizeOptions: !0,
|
|
1572
1586
|
total: i
|
|
1573
1587
|
};
|
|
1574
1588
|
}
|
|
1575
|
-
function
|
|
1589
|
+
function bt({ isTreeEditing: e, isTreeMode: t }) {
|
|
1576
1590
|
return t ? e ? "儲存" : "開始編輯" : "新增組織";
|
|
1577
1591
|
}
|
|
1578
|
-
function
|
|
1592
|
+
function xt({ isTreeEditing: e, isTreeMode: t }) {
|
|
1579
1593
|
return t ? e ? B : R : z;
|
|
1580
1594
|
}
|
|
1581
|
-
function
|
|
1595
|
+
function St({ hasDraftChanges: e, isTreeEditing: t, isTreeMode: n, loading: r, saving: i }) {
|
|
1582
1596
|
return n ? t ? !e || i : r : !1;
|
|
1583
1597
|
}
|
|
1584
|
-
function
|
|
1598
|
+
function Ct({ actionDisabled: e = !1, actionIcon: t = z, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
|
|
1585
1599
|
return /* @__PURE__ */ P("div", {
|
|
1586
1600
|
className: J.tableIntro,
|
|
1587
1601
|
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(A, {
|
|
@@ -1604,7 +1618,7 @@ function St({ actionDisabled: e = !1, actionIcon: t = z, actionLabel: n, actions
|
|
|
1604
1618
|
})]
|
|
1605
1619
|
});
|
|
1606
1620
|
}
|
|
1607
|
-
function
|
|
1621
|
+
function wt({ modal: n, onClose: i, onSubmit: a, orgUnits: o, saving: s }) {
|
|
1608
1622
|
let [c, u] = p(""), [d, f] = p(""), [m, h] = p(null), [g, _] = p(Y[2]);
|
|
1609
1623
|
return l(() => {
|
|
1610
1624
|
if (!n) return;
|
|
@@ -1652,7 +1666,7 @@ function Ct({ modal: n, onClose: i, onSubmit: a, orgUnits: o, saving: s }) {
|
|
|
1652
1666
|
children: /* @__PURE__ */ N(E, {
|
|
1653
1667
|
clearable: !1,
|
|
1654
1668
|
fullWidth: !0,
|
|
1655
|
-
onChange: (e) => _(
|
|
1669
|
+
onChange: (e) => _(It(e)),
|
|
1656
1670
|
options: [...Y],
|
|
1657
1671
|
placeholder: "選擇組織類型",
|
|
1658
1672
|
value: g
|
|
@@ -1673,7 +1687,7 @@ function Ct({ modal: n, onClose: i, onSubmit: a, orgUnits: o, saving: s }) {
|
|
|
1673
1687
|
})
|
|
1674
1688
|
});
|
|
1675
1689
|
}
|
|
1676
|
-
function
|
|
1690
|
+
function Tt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
1677
1691
|
let [i, a] = p(""), [o, s] = p("0"), [c, u] = p("");
|
|
1678
1692
|
return l(() => {
|
|
1679
1693
|
e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)), u(e.record?.name ?? ""));
|
|
@@ -1723,12 +1737,12 @@ function wt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
|
1723
1737
|
})
|
|
1724
1738
|
});
|
|
1725
1739
|
}
|
|
1726
|
-
function
|
|
1727
|
-
let [g, _] = p(
|
|
1740
|
+
function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, positions: m, saving: h }) {
|
|
1741
|
+
let [g, _] = p(Jt()), [v, y] = p(""), [b, x] = p(Q[1]), [C, w] = p(null), [T, D] = p(null), [O, k] = p(null);
|
|
1728
1742
|
return l(() => {
|
|
1729
1743
|
if (!c) return;
|
|
1730
1744
|
let e = c.record, r = e ? s.get(e.memberId) : null;
|
|
1731
|
-
_(e?.effectiveFrom ??
|
|
1745
|
+
_(e?.effectiveFrom ?? Jt()), y(e?.effectiveTo ?? ""), x(Q.find((t) => t.value === e?.isPrimary) ?? Q[1]), w(r ? n(r) : null), D(qt(f.find((t) => t.id === e?.orgUnitId), t)), k(qt(m.find((t) => t.id === e?.positionId), i));
|
|
1732
1746
|
}, [
|
|
1733
1747
|
s,
|
|
1734
1748
|
c,
|
|
@@ -1796,20 +1810,20 @@ function Tt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1796
1810
|
children: /* @__PURE__ */ N(E, {
|
|
1797
1811
|
clearable: !1,
|
|
1798
1812
|
fullWidth: !0,
|
|
1799
|
-
onChange: (e) => x(
|
|
1813
|
+
onChange: (e) => x(Wt(e)),
|
|
1800
1814
|
options: [...Q],
|
|
1801
1815
|
placeholder: "選擇歸屬類型",
|
|
1802
1816
|
value: b
|
|
1803
1817
|
})
|
|
1804
1818
|
}),
|
|
1805
|
-
/* @__PURE__ */ N(
|
|
1819
|
+
/* @__PURE__ */ N(Ot, {
|
|
1806
1820
|
label: "生效日",
|
|
1807
1821
|
name: "membershipEffectiveFrom",
|
|
1808
1822
|
onChange: _,
|
|
1809
1823
|
placeholder: "YYYY-MM-DD",
|
|
1810
1824
|
value: g
|
|
1811
1825
|
}),
|
|
1812
|
-
/* @__PURE__ */ N(
|
|
1826
|
+
/* @__PURE__ */ N(Ot, {
|
|
1813
1827
|
label: "結束日",
|
|
1814
1828
|
name: "membershipEffectiveTo",
|
|
1815
1829
|
onChange: y,
|
|
@@ -1820,12 +1834,12 @@ function Tt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1820
1834
|
})
|
|
1821
1835
|
});
|
|
1822
1836
|
}
|
|
1823
|
-
function
|
|
1824
|
-
let [g, _] = p(
|
|
1837
|
+
function Dt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, positions: m, saving: h }) {
|
|
1838
|
+
let [g, _] = p(Jt()), [v, y] = p(""), [b, x] = p(null), [C, w] = p(String(rt)), [T, D] = p(null), [O, k] = p(null), [j, M] = p(null), [F, I] = p(X[0]);
|
|
1825
1839
|
l(() => {
|
|
1826
1840
|
if (!c) return;
|
|
1827
1841
|
let e = c.record, r = X.find((t) => t.id === e?.scopeType) ?? X[0];
|
|
1828
|
-
_(e?.effectiveFrom ??
|
|
1842
|
+
_(e?.effectiveFrom ?? Jt()), y(e?.effectiveTo ?? ""), x(qt(e ? s.get(e.managerMemberId) : null, n)), w(String(e?.priority ?? rt)), D(r.id === "MEMBER" ? qt(e ? s.get(e.scopeId) : null, n) : null), k(r.id === "ORG_UNIT" ? qt(f.find((t) => t.id === e?.scopeId), t) : null), M(r.id === "POSITION" ? qt(m.find((t) => t.id === e?.scopeId), i) : null), I(r);
|
|
1829
1843
|
}, [
|
|
1830
1844
|
s,
|
|
1831
1845
|
c,
|
|
@@ -1863,7 +1877,7 @@ function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1863
1877
|
children: /* @__PURE__ */ N(E, {
|
|
1864
1878
|
clearable: !1,
|
|
1865
1879
|
fullWidth: !0,
|
|
1866
|
-
onChange: (e) => I(
|
|
1880
|
+
onChange: (e) => I(Rt(e)),
|
|
1867
1881
|
options: [...X],
|
|
1868
1882
|
placeholder: "選擇套用範圍",
|
|
1869
1883
|
value: F
|
|
@@ -1924,14 +1938,14 @@ function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1924
1938
|
placeholder: "例如 100",
|
|
1925
1939
|
value: C
|
|
1926
1940
|
}),
|
|
1927
|
-
/* @__PURE__ */ N(
|
|
1941
|
+
/* @__PURE__ */ N(Ot, {
|
|
1928
1942
|
label: "生效日",
|
|
1929
1943
|
name: "managerEffectiveFrom",
|
|
1930
1944
|
onChange: _,
|
|
1931
1945
|
placeholder: "YYYY-MM-DD",
|
|
1932
1946
|
value: g
|
|
1933
1947
|
}),
|
|
1934
|
-
/* @__PURE__ */ N(
|
|
1948
|
+
/* @__PURE__ */ N(Ot, {
|
|
1935
1949
|
label: "結束日",
|
|
1936
1950
|
name: "managerEffectiveTo",
|
|
1937
1951
|
onChange: y,
|
|
@@ -1956,7 +1970,7 @@ function $({ hintText: t, label: n, name: r, onChange: i, placeholder: a, value:
|
|
|
1956
1970
|
})
|
|
1957
1971
|
});
|
|
1958
1972
|
}
|
|
1959
|
-
function
|
|
1973
|
+
function Ot({ label: t, name: n, onChange: r, placeholder: i, value: a }) {
|
|
1960
1974
|
return /* @__PURE__ */ N(e, {
|
|
1961
1975
|
label: t,
|
|
1962
1976
|
name: n,
|
|
@@ -1964,110 +1978,110 @@ function Dt({ label: t, name: n, onChange: r, placeholder: i, value: a }) {
|
|
|
1964
1978
|
format: "YYYY-MM-DD",
|
|
1965
1979
|
fullWidth: !0,
|
|
1966
1980
|
inputProps: { name: n },
|
|
1967
|
-
onChange: (e) => r(
|
|
1981
|
+
onChange: (e) => r(Yt(e)),
|
|
1968
1982
|
placeholder: i,
|
|
1969
1983
|
value: a.trim() ? a : void 0
|
|
1970
1984
|
})
|
|
1971
1985
|
});
|
|
1972
1986
|
}
|
|
1973
|
-
function
|
|
1987
|
+
function kt(e, t) {
|
|
1974
1988
|
return [.../* @__PURE__ */ new Set([
|
|
1975
1989
|
...e.map((e) => e.memberId),
|
|
1976
1990
|
...t.map((e) => e.managerMemberId),
|
|
1977
1991
|
...t.filter((e) => e.scopeType === "MEMBER").map((e) => e.scopeId)
|
|
1978
1992
|
])];
|
|
1979
1993
|
}
|
|
1980
|
-
function
|
|
1981
|
-
return e.scopeType === "MEMBER" ? `會員:${
|
|
1994
|
+
function At(e, t) {
|
|
1995
|
+
return e.scopeType === "MEMBER" ? `會員:${jt(t.membersById.get(e.scopeId))}` : e.scopeType === "ORG_UNIT" ? `組織:${Mt(t.orgUnitsById.get(e.scopeId))}` : `職位:${Pt(t.positionsById.get(e.scopeId))}`;
|
|
1982
1996
|
}
|
|
1983
|
-
function
|
|
1997
|
+
function jt(e) {
|
|
1984
1998
|
return e ? `${e.name} · ${e.email}` : "未知會員";
|
|
1985
1999
|
}
|
|
1986
|
-
function
|
|
2000
|
+
function Mt(e) {
|
|
1987
2001
|
return e ? `${e.name} · ${e.code}` : "未知組織";
|
|
1988
2002
|
}
|
|
1989
|
-
function
|
|
2003
|
+
function Nt(e) {
|
|
1990
2004
|
return Y.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
|
|
1991
2005
|
}
|
|
1992
|
-
function
|
|
2006
|
+
function Pt(e) {
|
|
1993
2007
|
return e ? `${e.name} · ${e.code}` : "未指定";
|
|
1994
2008
|
}
|
|
1995
|
-
function
|
|
2009
|
+
function Ft(e) {
|
|
1996
2010
|
return e === "MANAGERS" || e === "MEMBERSHIPS" || e === "POSITIONS" ? e : "ORG_UNITS";
|
|
1997
2011
|
}
|
|
1998
|
-
function
|
|
1999
|
-
let t =
|
|
2012
|
+
function It(e) {
|
|
2013
|
+
let t = Kt(e) ? e : null;
|
|
2000
2014
|
if (typeof t?.id == "string") {
|
|
2001
2015
|
let e = t.id;
|
|
2002
2016
|
return Y.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? Y[2];
|
|
2003
2017
|
}
|
|
2004
2018
|
return Y[2];
|
|
2005
2019
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let t =
|
|
2020
|
+
function Lt(e) {
|
|
2021
|
+
let t = Kt(e) ? e : null;
|
|
2008
2022
|
if (typeof t?.id == "string") {
|
|
2009
2023
|
let e = t.id;
|
|
2010
|
-
return
|
|
2024
|
+
return at.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? it;
|
|
2011
2025
|
}
|
|
2012
|
-
return
|
|
2013
|
-
}
|
|
2014
|
-
function Lt(e) {
|
|
2015
|
-
return Wt(e, X, X[0]);
|
|
2026
|
+
return it;
|
|
2016
2027
|
}
|
|
2017
2028
|
function Rt(e) {
|
|
2018
|
-
return
|
|
2029
|
+
return Gt(e, X, X[0]);
|
|
2019
2030
|
}
|
|
2020
2031
|
function zt(e) {
|
|
2021
|
-
return
|
|
2032
|
+
return Gt(e, st, ot);
|
|
2022
2033
|
}
|
|
2023
2034
|
function Bt(e) {
|
|
2024
|
-
|
|
2025
|
-
return Z.find((e) => e.id === n) ?? null;
|
|
2035
|
+
return Gt(e, Z, ct);
|
|
2026
2036
|
}
|
|
2027
2037
|
function Vt(e) {
|
|
2028
|
-
let t =
|
|
2038
|
+
let t = Kt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
|
|
2039
|
+
return Z.find((e) => e.id === n) ?? null;
|
|
2040
|
+
}
|
|
2041
|
+
function Ht(e) {
|
|
2042
|
+
let t = Kt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
2029
2043
|
return n && r ? {
|
|
2030
2044
|
id: n,
|
|
2031
2045
|
name: r
|
|
2032
2046
|
} : null;
|
|
2033
2047
|
}
|
|
2034
|
-
function
|
|
2035
|
-
let t =
|
|
2048
|
+
function Ut(e) {
|
|
2049
|
+
let t = Kt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
2036
2050
|
return n && r ? {
|
|
2037
2051
|
id: n,
|
|
2038
2052
|
name: r
|
|
2039
2053
|
} : null;
|
|
2040
2054
|
}
|
|
2041
|
-
function
|
|
2042
|
-
return
|
|
2055
|
+
function Wt(e) {
|
|
2056
|
+
return Gt(e, Q, Q[1]);
|
|
2043
2057
|
}
|
|
2044
|
-
function
|
|
2045
|
-
let r =
|
|
2058
|
+
function Gt(e, t, n) {
|
|
2059
|
+
let r = Kt(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
|
|
2046
2060
|
return t.find((e) => e.id === i) ?? n;
|
|
2047
2061
|
}
|
|
2048
|
-
function
|
|
2062
|
+
function Kt(e) {
|
|
2049
2063
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2050
2064
|
}
|
|
2051
|
-
function
|
|
2065
|
+
function qt(e, t) {
|
|
2052
2066
|
return e ? t(e) : null;
|
|
2053
2067
|
}
|
|
2054
|
-
function
|
|
2055
|
-
return
|
|
2056
|
-
}
|
|
2057
|
-
function Jt(e) {
|
|
2058
|
-
let t = e ? new Date(e) : null;
|
|
2059
|
-
return t && !Number.isNaN(t.getTime()) ? Yt(t) : "";
|
|
2068
|
+
function Jt() {
|
|
2069
|
+
return Xt(/* @__PURE__ */ new Date());
|
|
2060
2070
|
}
|
|
2061
2071
|
function Yt(e) {
|
|
2062
|
-
|
|
2072
|
+
let t = e ? new Date(e) : null;
|
|
2073
|
+
return t && !Number.isNaN(t.getTime()) ? Xt(t) : "";
|
|
2063
2074
|
}
|
|
2064
2075
|
function Xt(e) {
|
|
2065
|
-
return
|
|
2076
|
+
return `${e.getFullYear()}-${Zt(e.getMonth() + 1)}-${Zt(e.getDate())}`;
|
|
2066
2077
|
}
|
|
2067
2078
|
function Zt(e) {
|
|
2079
|
+
return String(e).padStart(2, "0");
|
|
2080
|
+
}
|
|
2081
|
+
function Qt(e) {
|
|
2068
2082
|
return e instanceof Error ? e.message : "讀取組織資料失敗。";
|
|
2069
2083
|
}
|
|
2070
2084
|
//#endregion
|
|
2071
|
-
export {
|
|
2085
|
+
export { mt as t };
|
|
2072
2086
|
|
|
2073
|
-
//# sourceMappingURL=orgs-
|
|
2087
|
+
//# sourceMappingURL=orgs-Cr_7zsAD.js.map
|