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