@rytass/bpm-core-react 0.5.0 → 0.7.1
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 +45 -0
- package/README.md +21 -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/detail-Cci9tnoC.cjs +2 -0
- package/dist/chunks/detail-Cci9tnoC.cjs.map +1 -0
- package/dist/chunks/detail-kyolfdBu.js +1957 -0
- package/dist/chunks/detail-kyolfdBu.js.map +1 -0
- package/dist/chunks/orgs-BbniWPB_.cjs +2 -0
- package/dist/chunks/orgs-BbniWPB_.cjs.map +1 -0
- package/dist/chunks/{orgs-Cc18umVt.js → orgs-BywlqXaG.js} +341 -331
- package/dist/chunks/orgs-BywlqXaG.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/instances/detail/index.cjs +1 -1
- package/dist/pages/instances/detail/index.js +1 -1
- package/dist/pages/templates/compose/index.cjs +1 -1
- package/dist/pages/templates/compose/index.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/instances/detail/index.cjs +1 -1
- package/dist/views/instances/detail/index.js +1 -1
- package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +8 -1
- package/dist/views/instances/detail/sections/container-helpers.d.ts +3 -2
- 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/detail-Bml-vXHX.js +0 -1622
- package/dist/chunks/detail-Bml-vXHX.js.map +0 -1
- package/dist/chunks/detail-CWeCrmtC.cjs +0 -2
- package/dist/chunks/detail-CWeCrmtC.cjs.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
|
@@ -12,11 +12,11 @@ import { commitOrgUnitTreeDraft as ne, createManagerResolution as re, createMemb
|
|
|
12
12
|
import { Background as he, ConnectionMode as ge, Controls as _e, Handle as ve, MiniMap as ye, Position as be, ReactFlow as xe, applyNodeChanges as Se } from "@xyflow/react";
|
|
13
13
|
import * as Ce from "dagre";
|
|
14
14
|
import '../orgs.css';//#region src/lib/org-tree-draft.ts
|
|
15
|
-
function
|
|
15
|
+
function we(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 Te({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
19
|
+
let r = n === e ? e : n, i = De({
|
|
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 Ee({ 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 De({ orgUnitId: e, parentDraft: t, parentId: n }) {
|
|
52
|
+
return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" : Oe({
|
|
53
53
|
orgUnitId: e,
|
|
54
54
|
parentDraft: t,
|
|
55
55
|
parentId: n
|
|
56
56
|
}) ? "不可搬移到自己的下層組織。" : null : "找不到新的上層組織。" : null : "找不到要搬移的組織節點。";
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Oe({ 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 z = {
|
|
67
67
|
orgTreeEditor: "bpm_orgTreeEditor_TMOtD",
|
|
68
68
|
orgTreeSummary: "bpm_orgTreeSummary_vpcV8",
|
|
69
69
|
orgTreeChangeList: "bpm_orgTreeChangeList_EzmOv",
|
|
@@ -76,16 +76,16 @@ var B = {
|
|
|
76
76
|
orgTreeNodeHeader: "bpm_orgTreeNodeHeader_LEXl-",
|
|
77
77
|
orgTreeNodeBadge: "bpm_orgTreeNodeBadge_zLc7t",
|
|
78
78
|
orgTreeNodeActions: "bpm_orgTreeNodeActions_cMldI"
|
|
79
|
-
},
|
|
79
|
+
}, B = "__org-tree-root__", V = 232, ke = 118, Ae = 232, je = 86, Me = 320, Ne = 1.4, Pe = .25, Fe = .005, Ie = 250, Le = 80, Re = {
|
|
80
80
|
COMPANY: "公司",
|
|
81
81
|
DEPARTMENT: "部門",
|
|
82
82
|
DIVISION: "事業群",
|
|
83
83
|
TEAM: "小組"
|
|
84
|
-
},
|
|
85
|
-
let [s, f] = p(!1), [m, h] = p(null), [g, _] = p(null), [v, y] = p(() =>
|
|
84
|
+
}, H = { orgUnit: Be }, ze = s(function({ onCreateChild: e, onCreateRoot: t, onEditOrgUnit: n, onSaveDraft: r, onStateChange: i, orgUnits: a }, o) {
|
|
85
|
+
let [s, f] = p(!1), [m, h] = p(null), [g, _] = p(null), [v, y] = p(() => we(a)), [b, x] = p([]), S = d(() => new Map(a.map((e) => [e.id, e])), [a]), C = d(() => Ee({
|
|
86
86
|
orgUnits: a,
|
|
87
87
|
parentDraft: v
|
|
88
|
-
}), [a, v]), w = d(() =>
|
|
88
|
+
}), [a, v]), w = d(() => Ve({
|
|
89
89
|
isEditing: s,
|
|
90
90
|
onCreateChild: (n) => {
|
|
91
91
|
n ? e(n) : t();
|
|
@@ -107,11 +107,14 @@ var B = {
|
|
|
107
107
|
S,
|
|
108
108
|
v,
|
|
109
109
|
g
|
|
110
|
-
]), T = C.length > 0
|
|
110
|
+
]), T = C.length > 0, E = d(() => {
|
|
111
|
+
let e = Math.max(w.bounds.width, w.bounds.height);
|
|
112
|
+
return e <= 0 ? Pe : Math.min(Pe, Math.max(Fe, Ie / e));
|
|
113
|
+
}, [w.bounds.height, w.bounds.width]), D = a.length <= Le;
|
|
111
114
|
u(o, () => ({
|
|
112
|
-
cancelEditing:
|
|
113
|
-
saveDraft:
|
|
114
|
-
startEditing:
|
|
115
|
+
cancelEditing: I,
|
|
116
|
+
saveDraft: ee,
|
|
117
|
+
startEditing: F
|
|
115
118
|
})), l(() => {
|
|
116
119
|
i({
|
|
117
120
|
hasDraftChanges: T,
|
|
@@ -122,45 +125,45 @@ var B = {
|
|
|
122
125
|
s,
|
|
123
126
|
i
|
|
124
127
|
]), l(() => {
|
|
125
|
-
y(
|
|
128
|
+
y(we(a)), _(null), h(null), f(!1);
|
|
126
129
|
}, [a]), l(() => {
|
|
127
130
|
x(w.nodes);
|
|
128
131
|
}, [w.nodes]);
|
|
129
|
-
let
|
|
132
|
+
let O = c((e, t) => {
|
|
130
133
|
y((n) => {
|
|
131
|
-
let r =
|
|
134
|
+
let r = Te({
|
|
132
135
|
orgUnitId: e,
|
|
133
136
|
parentDraft: n,
|
|
134
137
|
parentId: t
|
|
135
138
|
});
|
|
136
139
|
return h(r.message), r.parentDraft;
|
|
137
140
|
});
|
|
138
|
-
}, []),
|
|
141
|
+
}, []), k = c((e) => {
|
|
139
142
|
if (!s || !e.target || !e.source) return;
|
|
140
|
-
let t = e.source ===
|
|
141
|
-
if (e.target ===
|
|
143
|
+
let t = e.source === B ? null : e.source;
|
|
144
|
+
if (e.target === B) {
|
|
142
145
|
h("根節點不能搬移到其他節點下。");
|
|
143
146
|
return;
|
|
144
147
|
}
|
|
145
|
-
|
|
146
|
-
}, [
|
|
148
|
+
O(e.target, t);
|
|
149
|
+
}, [O, s]), j = c((e) => {
|
|
147
150
|
s && x((t) => Se(e, [...t]));
|
|
148
|
-
}, [s]),
|
|
149
|
-
if (!s || t.id ===
|
|
150
|
-
let r =
|
|
151
|
+
}, [s]), M = c((e, t, n) => {
|
|
152
|
+
if (!s || t.id === B) return;
|
|
153
|
+
let r = We(e, t.id) ?? Ue(t, n);
|
|
151
154
|
if (r === void 0) {
|
|
152
155
|
h("拖曳到目標父節點附近,或從父節點拉線到子節點。");
|
|
153
156
|
return;
|
|
154
157
|
}
|
|
155
|
-
|
|
156
|
-
}, [
|
|
157
|
-
function
|
|
158
|
-
f(!0), y(
|
|
158
|
+
O(t.id, r === B ? null : r);
|
|
159
|
+
}, [O, s]);
|
|
160
|
+
function F() {
|
|
161
|
+
f(!0), y(we(a)), h("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
|
|
159
162
|
}
|
|
160
|
-
function
|
|
161
|
-
f(!1), y(
|
|
163
|
+
function I() {
|
|
164
|
+
f(!1), y(we(a)), h("已取消草稿變更。");
|
|
162
165
|
}
|
|
163
|
-
async function
|
|
166
|
+
async function ee() {
|
|
164
167
|
if (!r) {
|
|
165
168
|
h("批次儲存 API 尚未接上,草稿仍保留在前端。");
|
|
166
169
|
return;
|
|
@@ -168,15 +171,15 @@ var B = {
|
|
|
168
171
|
await r(C), f(!1), h("組織樹草稿已儲存。");
|
|
169
172
|
}
|
|
170
173
|
return /* @__PURE__ */ P("div", {
|
|
171
|
-
className:
|
|
174
|
+
className: z.orgTreeEditor,
|
|
172
175
|
children: [/* @__PURE__ */ P("div", {
|
|
173
|
-
className:
|
|
176
|
+
className: z.orgTreeSummary,
|
|
174
177
|
children: [/* @__PURE__ */ N(A, {
|
|
175
178
|
color: "text-neutral",
|
|
176
179
|
variant: "caption",
|
|
177
180
|
children: m ?? (T ? `目前有 ${C.length} 筆父子關係草稿變更。` : "目前沒有草稿變更。")
|
|
178
181
|
}), T ? /* @__PURE__ */ N("ul", {
|
|
179
|
-
className:
|
|
182
|
+
className: z.orgTreeChangeList,
|
|
180
183
|
children: C.map((e) => /* @__PURE__ */ P("li", { children: [
|
|
181
184
|
U(e.orgUnitId, S),
|
|
182
185
|
":",
|
|
@@ -186,57 +189,60 @@ var B = {
|
|
|
186
189
|
] }, e.orgUnitId))
|
|
187
190
|
}) : null]
|
|
188
191
|
}), /* @__PURE__ */ N("div", {
|
|
189
|
-
className:
|
|
192
|
+
className: z.orgTreeCanvas,
|
|
190
193
|
children: /* @__PURE__ */ P(xe, {
|
|
191
194
|
connectionMode: ge.Strict,
|
|
192
195
|
edges: [...w.edges],
|
|
193
196
|
fitView: !0,
|
|
194
|
-
fitViewOptions: {
|
|
195
|
-
|
|
197
|
+
fitViewOptions: {
|
|
198
|
+
minZoom: E,
|
|
199
|
+
padding: .18
|
|
200
|
+
},
|
|
201
|
+
isValidConnection: (e) => Ye({
|
|
196
202
|
source: e.source,
|
|
197
203
|
target: e.target
|
|
198
204
|
}, v),
|
|
199
|
-
maxZoom:
|
|
200
|
-
minZoom:
|
|
201
|
-
nodeTypes:
|
|
205
|
+
maxZoom: Ne,
|
|
206
|
+
minZoom: E,
|
|
207
|
+
nodeTypes: H,
|
|
202
208
|
nodes: [...b],
|
|
203
209
|
nodesConnectable: s,
|
|
204
210
|
nodesDraggable: s,
|
|
205
|
-
onConnect:
|
|
211
|
+
onConnect: k,
|
|
206
212
|
onNodeClick: (e, t) => {
|
|
207
|
-
_(t.id ===
|
|
213
|
+
_(t.id === B ? null : t.id);
|
|
208
214
|
},
|
|
209
215
|
onNodeDoubleClick: (e, t) => {
|
|
210
|
-
if (t.id !==
|
|
216
|
+
if (t.id !== B) {
|
|
211
217
|
let e = S.get(t.id);
|
|
212
218
|
e && n(e);
|
|
213
219
|
}
|
|
214
220
|
},
|
|
215
|
-
onNodeDragStop:
|
|
216
|
-
onNodesChange:
|
|
221
|
+
onNodeDragStop: M,
|
|
222
|
+
onNodesChange: j,
|
|
217
223
|
onPaneClick: () => _(null),
|
|
218
224
|
panOnDrag: !0,
|
|
219
225
|
proOptions: { hideAttribution: !0 },
|
|
220
226
|
children: [
|
|
221
227
|
/* @__PURE__ */ N(he, {}),
|
|
222
228
|
/* @__PURE__ */ N(_e, {}),
|
|
223
|
-
/* @__PURE__ */ N(ye, {
|
|
229
|
+
D ? /* @__PURE__ */ N(ye, {
|
|
224
230
|
pannable: !0,
|
|
225
231
|
zoomable: !0
|
|
226
|
-
})
|
|
232
|
+
}) : null
|
|
227
233
|
]
|
|
228
234
|
})
|
|
229
235
|
})]
|
|
230
236
|
});
|
|
231
237
|
});
|
|
232
|
-
function
|
|
238
|
+
function Be({ data: e, selected: t }) {
|
|
233
239
|
return /* @__PURE__ */ P("div", {
|
|
234
240
|
className: [
|
|
235
|
-
|
|
236
|
-
e.isSyntheticRoot ?
|
|
237
|
-
e.changed ?
|
|
238
|
-
e.deleted ?
|
|
239
|
-
t ?
|
|
241
|
+
z.orgTreeNode,
|
|
242
|
+
e.isSyntheticRoot ? z.orgTreeNodeRoot : "",
|
|
243
|
+
e.changed ? z.orgTreeNodeChanged : "",
|
|
244
|
+
e.deleted ? z.orgTreeNodeDeleted : "",
|
|
245
|
+
t ? z.orgTreeNodeSelected : ""
|
|
240
246
|
].filter(Boolean).join(" "),
|
|
241
247
|
children: [
|
|
242
248
|
e.isSyntheticRoot ? null : /* @__PURE__ */ N(ve, {
|
|
@@ -252,7 +258,7 @@ function Ie({ data: e, selected: t }) {
|
|
|
252
258
|
type: "source"
|
|
253
259
|
}),
|
|
254
260
|
/* @__PURE__ */ P("div", {
|
|
255
|
-
className:
|
|
261
|
+
className: z.orgTreeNodeHeader,
|
|
256
262
|
children: [/* @__PURE__ */ N(A, {
|
|
257
263
|
component: "span",
|
|
258
264
|
ellipsis: !0,
|
|
@@ -260,7 +266,7 @@ function Ie({ data: e, selected: t }) {
|
|
|
260
266
|
variant: "label-primary",
|
|
261
267
|
children: e.name
|
|
262
268
|
}), e.changed ? /* @__PURE__ */ N("span", {
|
|
263
|
-
className:
|
|
269
|
+
className: z.orgTreeNodeBadge,
|
|
264
270
|
children: "草稿"
|
|
265
271
|
}) : null]
|
|
266
272
|
}),
|
|
@@ -281,7 +287,7 @@ function Ie({ data: e, selected: t }) {
|
|
|
281
287
|
children: ["上層:", e.parentLabel]
|
|
282
288
|
}),
|
|
283
289
|
/* @__PURE__ */ N("div", {
|
|
284
|
-
className:
|
|
290
|
+
className: z.orgTreeNodeActions,
|
|
285
291
|
children: e.isSyntheticRoot ? /* @__PURE__ */ N(h, {
|
|
286
292
|
icon: R,
|
|
287
293
|
iconType: "leading",
|
|
@@ -310,29 +316,32 @@ function Ie({ data: e, selected: t }) {
|
|
|
310
316
|
]
|
|
311
317
|
});
|
|
312
318
|
}
|
|
313
|
-
function
|
|
319
|
+
function Ve({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, orgUnitsById: i, parentDraft: a, selectedOrgUnitId: o }) {
|
|
314
320
|
let s = new Ce.graphlib.Graph();
|
|
315
321
|
s.setDefaultEdgeLabel(() => ({})), s.setGraph({
|
|
316
322
|
marginx: 36,
|
|
317
323
|
marginy: 36,
|
|
318
324
|
nodesep: 44,
|
|
319
325
|
rankdir: "TB"
|
|
320
|
-
}), s.setNode(
|
|
326
|
+
}), s.setNode(B, {
|
|
321
327
|
height: je,
|
|
322
328
|
width: Ae
|
|
323
329
|
}), r.forEach((e) => {
|
|
324
330
|
s.setNode(e.id, {
|
|
325
331
|
height: ke,
|
|
326
|
-
width:
|
|
332
|
+
width: V
|
|
327
333
|
});
|
|
328
334
|
}), r.forEach((e) => {
|
|
329
335
|
let t = a.get(e.id) ?? null;
|
|
330
|
-
s.setEdge(t ??
|
|
336
|
+
s.setEdge(t ?? B, e.id);
|
|
331
337
|
}), Ce.layout(s);
|
|
332
|
-
let c =
|
|
338
|
+
let c = s.graph(), l = {
|
|
339
|
+
height: c.height ?? 0,
|
|
340
|
+
width: c.width ?? 0
|
|
341
|
+
}, u = He({
|
|
333
342
|
data: {
|
|
334
343
|
changed: !1,
|
|
335
|
-
code:
|
|
344
|
+
code: B,
|
|
336
345
|
deleted: !1,
|
|
337
346
|
isEditing: e,
|
|
338
347
|
isSyntheticRoot: !0,
|
|
@@ -346,12 +355,12 @@ function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
|
|
|
346
355
|
},
|
|
347
356
|
graph: s,
|
|
348
357
|
height: je,
|
|
349
|
-
id:
|
|
358
|
+
id: B,
|
|
350
359
|
selected: o === null,
|
|
351
360
|
width: Ae
|
|
352
|
-
}),
|
|
361
|
+
}), d = r.map((r) => {
|
|
353
362
|
let c = a.get(r.id) ?? null, l = U(c, i);
|
|
354
|
-
return
|
|
363
|
+
return He({
|
|
355
364
|
data: {
|
|
356
365
|
changed: c !== r.parentId,
|
|
357
366
|
code: r.code,
|
|
@@ -364,23 +373,24 @@ function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
|
|
|
364
373
|
orgUnitId: r.id,
|
|
365
374
|
parentLabel: l,
|
|
366
375
|
path: r.path,
|
|
367
|
-
typeLabel:
|
|
376
|
+
typeLabel: Xe(r.type)
|
|
368
377
|
},
|
|
369
378
|
graph: s,
|
|
370
379
|
height: ke,
|
|
371
380
|
id: r.id,
|
|
372
381
|
selected: o === r.id,
|
|
373
|
-
width:
|
|
382
|
+
width: V
|
|
374
383
|
});
|
|
375
384
|
});
|
|
376
385
|
return {
|
|
386
|
+
bounds: l,
|
|
377
387
|
edges: r.map((t) => {
|
|
378
388
|
let n = a.get(t.id) ?? null, r = n !== t.parentId;
|
|
379
389
|
return {
|
|
380
390
|
animated: e && r,
|
|
381
391
|
data: {},
|
|
382
392
|
id: `org-tree-edge-${n ?? "root"}-${t.id}`,
|
|
383
|
-
source: n ??
|
|
393
|
+
source: n ?? B,
|
|
384
394
|
sourceHandle: "source",
|
|
385
395
|
style: r ? {
|
|
386
396
|
stroke: "var(--mzn-color-primary, #0057ff)",
|
|
@@ -391,10 +401,10 @@ function Le({ isEditing: e, onCreateChild: t, onEditOrgUnit: n, orgUnits: r, org
|
|
|
391
401
|
type: "smoothstep"
|
|
392
402
|
};
|
|
393
403
|
}),
|
|
394
|
-
nodes: [
|
|
404
|
+
nodes: [u, ...d]
|
|
395
405
|
};
|
|
396
406
|
}
|
|
397
|
-
function
|
|
407
|
+
function He({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
|
|
398
408
|
let o = t.node(r);
|
|
399
409
|
return {
|
|
400
410
|
data: e,
|
|
@@ -416,21 +426,21 @@ function Re({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
|
|
|
416
426
|
width: a
|
|
417
427
|
};
|
|
418
428
|
}
|
|
419
|
-
function
|
|
420
|
-
let n =
|
|
429
|
+
function Ue(e, t) {
|
|
430
|
+
let n = qe(e);
|
|
421
431
|
return t.filter((t) => t.id !== e.id).map((e) => ({
|
|
422
|
-
distance:
|
|
432
|
+
distance: Je(n, qe(e)),
|
|
423
433
|
id: e.id
|
|
424
434
|
})).filter((e) => e.distance <= Me).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
425
435
|
}
|
|
426
|
-
function
|
|
427
|
-
let n =
|
|
436
|
+
function We(e, t) {
|
|
437
|
+
let n = Ge(e);
|
|
428
438
|
if (n) return Array.from(document.querySelectorAll(".react-flow__node[data-id]")).map((e) => {
|
|
429
439
|
let r = e.dataset.id;
|
|
430
440
|
if (!r || r === t) return null;
|
|
431
441
|
let i = e.getBoundingClientRect();
|
|
432
442
|
return {
|
|
433
|
-
distance:
|
|
443
|
+
distance: Je(n, {
|
|
434
444
|
x: i.left + i.width / 2,
|
|
435
445
|
y: i.top + i.height / 2
|
|
436
446
|
}),
|
|
@@ -438,29 +448,29 @@ function ze(e, t) {
|
|
|
438
448
|
};
|
|
439
449
|
}).filter((e) => !!e).filter((e) => e.distance <= Me).sort((e, t) => e.distance - t.distance)[0]?.id;
|
|
440
450
|
}
|
|
441
|
-
function
|
|
442
|
-
return
|
|
451
|
+
function Ge(e) {
|
|
452
|
+
return Ke(e) ? {
|
|
443
453
|
x: e.clientX,
|
|
444
454
|
y: e.clientY
|
|
445
455
|
} : null;
|
|
446
456
|
}
|
|
447
|
-
function
|
|
457
|
+
function Ke(e) {
|
|
448
458
|
return typeof e == "object" && !!e && "clientX" in e && "clientY" in e && typeof e.clientX == "number" && typeof e.clientY == "number";
|
|
449
459
|
}
|
|
450
|
-
function
|
|
460
|
+
function qe(e) {
|
|
451
461
|
return {
|
|
452
|
-
x: e.position.x + (e.width ??
|
|
462
|
+
x: e.position.x + (e.width ?? V) / 2,
|
|
453
463
|
y: e.position.y + (e.height ?? ke) / 2
|
|
454
464
|
};
|
|
455
465
|
}
|
|
456
|
-
function
|
|
466
|
+
function Je(e, t) {
|
|
457
467
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
458
468
|
}
|
|
459
|
-
function
|
|
460
|
-
return !e.source || !e.target || e.target ===
|
|
469
|
+
function Ye(e, t) {
|
|
470
|
+
return !e.source || !e.target || e.target === B ? !1 : De({
|
|
461
471
|
orgUnitId: e.target,
|
|
462
472
|
parentDraft: t,
|
|
463
|
-
parentId: e.source ===
|
|
473
|
+
parentId: e.source === B ? null : e.source
|
|
464
474
|
}) === null;
|
|
465
475
|
}
|
|
466
476
|
function U(e, t) {
|
|
@@ -468,8 +478,8 @@ function U(e, t) {
|
|
|
468
478
|
let n = t.get(e);
|
|
469
479
|
return n ? `${n.name} · ${n.code}` : "未知組織";
|
|
470
480
|
}
|
|
471
|
-
function
|
|
472
|
-
return
|
|
481
|
+
function Xe(e) {
|
|
482
|
+
return Re[e.toUpperCase()] ?? "未知類型";
|
|
473
483
|
}
|
|
474
484
|
var W = {
|
|
475
485
|
tableIntroActions: "bpm_tableIntroActions_WO4XU",
|
|
@@ -479,7 +489,7 @@ var W = {
|
|
|
479
489
|
orgFilterArea: "bpm_orgFilterArea_Xjbbp",
|
|
480
490
|
membershipFilterArea: "bpm_membershipFilterArea_zob-Y",
|
|
481
491
|
scopeLabel: "bpm_scopeLabel_TLHMC"
|
|
482
|
-
},
|
|
492
|
+
}, Ze = {
|
|
483
493
|
hasDraftChanges: !1,
|
|
484
494
|
isEditing: !1
|
|
485
495
|
}, G = [
|
|
@@ -499,10 +509,10 @@ var W = {
|
|
|
499
509
|
id: "TEAM",
|
|
500
510
|
name: "小組"
|
|
501
511
|
}
|
|
502
|
-
],
|
|
512
|
+
], Qe = {
|
|
503
513
|
id: "ALL",
|
|
504
514
|
name: "全部類型"
|
|
505
|
-
},
|
|
515
|
+
}, $e = [Qe, ...G], K = [
|
|
506
516
|
{
|
|
507
517
|
id: "MEMBER",
|
|
508
518
|
name: "指定會員"
|
|
@@ -515,14 +525,14 @@ var W = {
|
|
|
515
525
|
id: "POSITION",
|
|
516
526
|
name: "指定職位"
|
|
517
527
|
}
|
|
518
|
-
],
|
|
528
|
+
], et = {
|
|
519
529
|
id: "ALL",
|
|
520
530
|
name: "全部範圍"
|
|
521
|
-
},
|
|
531
|
+
}, tt = [et, ...K], nt = {
|
|
522
532
|
activeOnly: !1,
|
|
523
533
|
id: "ALL",
|
|
524
534
|
name: "全部狀態"
|
|
525
|
-
},
|
|
535
|
+
}, rt = [nt, {
|
|
526
536
|
activeOnly: !0,
|
|
527
537
|
id: "ACTIVE",
|
|
528
538
|
name: "目前有效"
|
|
@@ -534,17 +544,17 @@ var W = {
|
|
|
534
544
|
id: "false",
|
|
535
545
|
name: "一般歸屬",
|
|
536
546
|
value: !1
|
|
537
|
-
}],
|
|
547
|
+
}], J = [
|
|
538
548
|
10,
|
|
539
549
|
20,
|
|
540
550
|
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(
|
|
551
|
+
], it = 1368, at = 908, ot = 1292, Y = 1124;
|
|
552
|
+
function st() {
|
|
553
|
+
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(nt), [v, y] = p(1), [b, x] = p(10), [E, k] = p(et), [I, ee] = p(0), [L, R] = p([]), [te, he] = p(null), [ge, _e] = p(null), [ve, ye] = p(null), [be, xe] = p(1), [Se, Ce] = p(10), [we, Te] = p(null), [Ee, De] = p(0), [Oe, z] = p(null), [B, V] = p(1), [ke, Ae] = p(10), [je, Me] = p(""), [Ne, Pe] = p(0), [Fe, Ie] = p(Qe), [Le, Re] = p("TABLE"), [H, ze] = p([]), [Be, Ve] = p([]), [He, Ue] = p([]), [We, Ge] = p(null), [Ke, qe] = p(1), [Je, Ye] = p(10), [U, Xe] = p(""), [W, Ze] = p(0), [G, $e] = p([]), [K, tt] = p([]), [rt, q] = p([]), [J, it] = p(!1);
|
|
544
554
|
l(() => {
|
|
545
555
|
n && a(n);
|
|
546
556
|
}, [n]);
|
|
547
|
-
let
|
|
557
|
+
let at = n ?? i, ot = c(async () => {
|
|
548
558
|
f(!0), s(null);
|
|
549
559
|
try {
|
|
550
560
|
let e = await ue({
|
|
@@ -556,18 +566,18 @@ function J() {
|
|
|
556
566
|
membershipOrgUnitId: ve?.id ?? null,
|
|
557
567
|
membershipPage: be,
|
|
558
568
|
membershipPageSize: Se,
|
|
559
|
-
membershipPositionId:
|
|
560
|
-
orgUnitPage:
|
|
569
|
+
membershipPositionId: we?.id ?? null,
|
|
570
|
+
orgUnitPage: B,
|
|
561
571
|
orgUnitPageSize: ke,
|
|
562
572
|
orgUnitSearchText: je,
|
|
563
573
|
orgUnitType: Fe.id === "ALL" ? null : Fe.id,
|
|
564
|
-
positionPage:
|
|
565
|
-
positionPageSize:
|
|
566
|
-
positionSearchText:
|
|
574
|
+
positionPage: Ke,
|
|
575
|
+
positionPageSize: Je,
|
|
576
|
+
positionSearchText: U
|
|
567
577
|
});
|
|
568
|
-
R(await j(
|
|
578
|
+
R(await j(xt(e.memberships, e.managerResolutions))), ze(e.orgUnits), Pe(e.orgUnitCount), Ve(e.filteredOrgUnits), $e(e.positions), Ze(e.positionCount), Ue(e.filteredPositions), De(e.membershipCount), q(e.filteredMemberships), ee(e.managerResolutionCount), tt(e.filteredManagerResolutions);
|
|
569
579
|
} catch (e) {
|
|
570
|
-
s(
|
|
580
|
+
s(Ht(e));
|
|
571
581
|
} finally {
|
|
572
582
|
f(!1);
|
|
573
583
|
}
|
|
@@ -580,55 +590,55 @@ function J() {
|
|
|
580
590
|
ve,
|
|
581
591
|
be,
|
|
582
592
|
Se,
|
|
583
|
-
|
|
584
|
-
|
|
593
|
+
we,
|
|
594
|
+
B,
|
|
585
595
|
ke,
|
|
586
596
|
je,
|
|
587
597
|
Fe,
|
|
588
|
-
Ge,
|
|
589
598
|
Ke,
|
|
590
|
-
Je
|
|
599
|
+
Je,
|
|
600
|
+
U
|
|
591
601
|
]);
|
|
592
602
|
l(() => {
|
|
593
|
-
|
|
594
|
-
}, [
|
|
595
|
-
let
|
|
603
|
+
ot();
|
|
604
|
+
}, [ot]);
|
|
605
|
+
let Y = d(() => new Map(H.map((e) => [e.id, e])), [H]), st = d(() => new Map(G.map((e) => [e.id, e])), [G]), X = d(() => new Map(L.map((e) => [e.memberId, e])), [L]), ft = d(() => Be.map((e) => ({
|
|
596
606
|
...e,
|
|
597
607
|
key: e.id,
|
|
598
|
-
parentName: e.parentId ?
|
|
599
|
-
typeLabel:
|
|
600
|
-
})), [Be,
|
|
608
|
+
parentName: e.parentId ? wt(Y.get(e.parentId)) : "根節點",
|
|
609
|
+
typeLabel: Tt(e.type)
|
|
610
|
+
})), [Be, Y]), pt = d(() => He.map((e) => ({
|
|
601
611
|
...e,
|
|
602
612
|
key: e.id
|
|
603
|
-
})), [He]),
|
|
613
|
+
})), [He]), mt = d(() => rt.map((e) => ({
|
|
604
614
|
...e,
|
|
605
615
|
key: e.id,
|
|
606
|
-
memberName:
|
|
607
|
-
orgUnitName:
|
|
608
|
-
positionName: e.positionId ?
|
|
616
|
+
memberName: Ct(X.get(e.memberId)),
|
|
617
|
+
orgUnitName: wt(Y.get(e.orgUnitId)),
|
|
618
|
+
positionName: e.positionId ? Et(st.get(e.positionId)) : "未指定"
|
|
609
619
|
})), [
|
|
610
|
-
Q,
|
|
611
|
-
nt,
|
|
612
620
|
X,
|
|
613
|
-
|
|
614
|
-
|
|
621
|
+
rt,
|
|
622
|
+
Y,
|
|
623
|
+
st
|
|
624
|
+
]), ht = d(() => K.map((e) => ({
|
|
615
625
|
...e,
|
|
616
626
|
key: e.id,
|
|
617
|
-
managerName:
|
|
618
|
-
scopeLabel:
|
|
619
|
-
membersById:
|
|
620
|
-
orgUnitsById:
|
|
621
|
-
positionsById:
|
|
627
|
+
managerName: Ct(X.get(e.managerMemberId)),
|
|
628
|
+
scopeLabel: St(e, {
|
|
629
|
+
membersById: X,
|
|
630
|
+
orgUnitsById: Y,
|
|
631
|
+
positionsById: st
|
|
622
632
|
})
|
|
623
633
|
})), [
|
|
624
|
-
|
|
625
|
-
Q,
|
|
634
|
+
K,
|
|
626
635
|
X,
|
|
627
|
-
|
|
628
|
-
|
|
636
|
+
Y,
|
|
637
|
+
st
|
|
638
|
+
]), Z = d(() => ({
|
|
629
639
|
render: (e) => [{
|
|
630
640
|
name: "編輯",
|
|
631
|
-
onClick: () =>
|
|
641
|
+
onClick: () => z({
|
|
632
642
|
record: e,
|
|
633
643
|
type: "EDIT"
|
|
634
644
|
})
|
|
@@ -645,17 +655,17 @@ function J() {
|
|
|
645
655
|
}],
|
|
646
656
|
variant: "base-secondary",
|
|
647
657
|
width: 128
|
|
648
|
-
}), []),
|
|
658
|
+
}), []), bt = d(() => ({
|
|
649
659
|
render: (e) => [{
|
|
650
660
|
name: "編輯",
|
|
651
|
-
onClick: () =>
|
|
661
|
+
onClick: () => Ge({
|
|
652
662
|
record: e,
|
|
653
663
|
type: "EDIT"
|
|
654
664
|
})
|
|
655
665
|
}],
|
|
656
666
|
variant: "base-secondary",
|
|
657
667
|
width: 88
|
|
658
|
-
}), []),
|
|
668
|
+
}), []), Ot = d(() => ({
|
|
659
669
|
render: (e) => [{
|
|
660
670
|
name: "編輯",
|
|
661
671
|
onClick: () => _e({
|
|
@@ -675,7 +685,7 @@ function J() {
|
|
|
675
685
|
}],
|
|
676
686
|
variant: "base-secondary",
|
|
677
687
|
width: 128
|
|
678
|
-
}), []),
|
|
688
|
+
}), []), kt = d(() => ({
|
|
679
689
|
render: (e) => [{
|
|
680
690
|
name: "編輯",
|
|
681
691
|
onClick: () => h({
|
|
@@ -696,60 +706,60 @@ function J() {
|
|
|
696
706
|
variant: "base-secondary",
|
|
697
707
|
width: 128
|
|
698
708
|
}), []);
|
|
699
|
-
function kt(e) {
|
|
700
|
-
Oe(1), Me(e);
|
|
701
|
-
}
|
|
702
709
|
function At(e) {
|
|
703
|
-
|
|
710
|
+
V(1), Me(e);
|
|
704
711
|
}
|
|
705
712
|
function jt(e) {
|
|
706
|
-
|
|
713
|
+
V(1), Ie(e);
|
|
707
714
|
}
|
|
708
715
|
function Mt(e) {
|
|
709
|
-
|
|
716
|
+
qe(1), Xe(e);
|
|
710
717
|
}
|
|
711
|
-
function
|
|
712
|
-
xe(1),
|
|
718
|
+
function Nt(e) {
|
|
719
|
+
xe(1), he(e);
|
|
713
720
|
}
|
|
714
721
|
function Pt(e) {
|
|
715
|
-
xe(1),
|
|
722
|
+
xe(1), ye(e);
|
|
716
723
|
}
|
|
717
724
|
function Ft(e) {
|
|
718
|
-
|
|
725
|
+
xe(1), Te(e);
|
|
719
726
|
}
|
|
720
727
|
function It(e) {
|
|
728
|
+
y(1), _(e);
|
|
729
|
+
}
|
|
730
|
+
function Lt(e) {
|
|
721
731
|
y(1), k(e);
|
|
722
732
|
}
|
|
723
|
-
function
|
|
733
|
+
function Q() {
|
|
724
734
|
J || r(null);
|
|
725
735
|
}
|
|
726
|
-
async function
|
|
727
|
-
n && await
|
|
736
|
+
async function Rt() {
|
|
737
|
+
n && await $(async () => {
|
|
728
738
|
n.type === "ORG_UNIT" && await le(n.id), n.type === "MEMBERSHIP" && await ce(n.id), n.type === "MANAGER_RESOLUTION" && await se(n.id), r(null);
|
|
729
739
|
});
|
|
730
740
|
}
|
|
731
741
|
async function Bt(e) {
|
|
732
|
-
|
|
742
|
+
it(!0), s(null);
|
|
733
743
|
try {
|
|
734
744
|
await ne({ moves: e.map((e) => ({
|
|
735
|
-
baseUpdatedAt:
|
|
745
|
+
baseUpdatedAt: Y.get(e.orgUnitId)?.updatedAt ?? "",
|
|
736
746
|
id: e.orgUnitId,
|
|
737
747
|
parentId: e.parentId
|
|
738
|
-
})) }), await
|
|
748
|
+
})) }), await ot();
|
|
739
749
|
} catch (e) {
|
|
740
|
-
throw s(
|
|
750
|
+
throw s(Ht(e)), e;
|
|
741
751
|
} finally {
|
|
742
|
-
|
|
752
|
+
it(!1);
|
|
743
753
|
}
|
|
744
754
|
}
|
|
745
|
-
async function
|
|
746
|
-
|
|
755
|
+
async function $(e) {
|
|
756
|
+
it(!0), s(null);
|
|
747
757
|
try {
|
|
748
|
-
await e(), await
|
|
758
|
+
await e(), await ot();
|
|
749
759
|
} catch (e) {
|
|
750
|
-
s(
|
|
760
|
+
s(Ht(e));
|
|
751
761
|
} finally {
|
|
752
|
-
|
|
762
|
+
it(!1);
|
|
753
763
|
}
|
|
754
764
|
}
|
|
755
765
|
return /* @__PURE__ */ P(M, { children: [
|
|
@@ -760,7 +770,7 @@ function J() {
|
|
|
760
770
|
/* @__PURE__ */ N(T, { children: /* @__PURE__ */ P(w, {
|
|
761
771
|
tab: /* @__PURE__ */ P(D, {
|
|
762
772
|
activeKey: e,
|
|
763
|
-
onChange: (e) => t(
|
|
773
|
+
onChange: (e) => t(Dt(e)),
|
|
764
774
|
children: [
|
|
765
775
|
/* @__PURE__ */ N(O, { children: "組織樹" }, "ORG_UNITS"),
|
|
766
776
|
/* @__PURE__ */ N(O, { children: "職位" }, "POSITIONS"),
|
|
@@ -774,34 +784,34 @@ function J() {
|
|
|
774
784
|
variant: "body",
|
|
775
785
|
children: o
|
|
776
786
|
}) : null,
|
|
777
|
-
e === "ORG_UNITS" ? /* @__PURE__ */ N(
|
|
778
|
-
actions:
|
|
787
|
+
e === "ORG_UNITS" ? /* @__PURE__ */ N(ct, {
|
|
788
|
+
actions: Z,
|
|
779
789
|
loading: u,
|
|
780
|
-
onCreate: () =>
|
|
790
|
+
onCreate: () => z({
|
|
781
791
|
parentId: null,
|
|
782
792
|
record: null,
|
|
783
793
|
type: "CREATE"
|
|
784
794
|
}),
|
|
785
|
-
onCreateChild: (e) =>
|
|
795
|
+
onCreateChild: (e) => z({
|
|
786
796
|
parentId: e,
|
|
787
797
|
record: null,
|
|
788
798
|
type: "CREATE"
|
|
789
799
|
}),
|
|
790
|
-
onEditOrgUnit: (e) =>
|
|
800
|
+
onEditOrgUnit: (e) => z({
|
|
791
801
|
record: e,
|
|
792
802
|
type: "EDIT"
|
|
793
803
|
}),
|
|
794
|
-
onPageChange:
|
|
804
|
+
onPageChange: V,
|
|
795
805
|
onSaveDraft: Bt,
|
|
796
806
|
onPageSizeChange: (e) => {
|
|
797
|
-
|
|
807
|
+
V(1), Ae(e);
|
|
798
808
|
},
|
|
799
|
-
onSearchTextChange:
|
|
800
|
-
onTypeFilterChange:
|
|
809
|
+
onSearchTextChange: At,
|
|
810
|
+
onTypeFilterChange: jt,
|
|
801
811
|
orgUnits: H,
|
|
802
|
-
page:
|
|
812
|
+
page: B,
|
|
803
813
|
pageSize: ke,
|
|
804
|
-
rows:
|
|
814
|
+
rows: ft,
|
|
805
815
|
searchText: je,
|
|
806
816
|
saving: J,
|
|
807
817
|
total: Ne,
|
|
@@ -809,77 +819,77 @@ function J() {
|
|
|
809
819
|
viewMode: Le,
|
|
810
820
|
onViewModeChange: Re
|
|
811
821
|
}) : null,
|
|
812
|
-
e === "POSITIONS" ? /* @__PURE__ */ N(
|
|
813
|
-
actions:
|
|
822
|
+
e === "POSITIONS" ? /* @__PURE__ */ N(lt, {
|
|
823
|
+
actions: bt,
|
|
814
824
|
loading: u,
|
|
815
|
-
onCreate: () =>
|
|
825
|
+
onCreate: () => Ge({
|
|
816
826
|
record: null,
|
|
817
827
|
type: "CREATE"
|
|
818
828
|
}),
|
|
819
|
-
onPageChange:
|
|
829
|
+
onPageChange: qe,
|
|
820
830
|
onPageSizeChange: (e) => {
|
|
821
|
-
|
|
831
|
+
qe(1), Ye(e);
|
|
822
832
|
},
|
|
823
|
-
onSearchTextChange:
|
|
824
|
-
page:
|
|
825
|
-
pageSize:
|
|
826
|
-
rows:
|
|
827
|
-
searchText:
|
|
828
|
-
total:
|
|
833
|
+
onSearchTextChange: Mt,
|
|
834
|
+
page: Ke,
|
|
835
|
+
pageSize: Je,
|
|
836
|
+
rows: pt,
|
|
837
|
+
searchText: U,
|
|
838
|
+
total: W
|
|
829
839
|
}) : null,
|
|
830
|
-
e === "MEMBERSHIPS" ? /* @__PURE__ */ N(
|
|
831
|
-
actions:
|
|
840
|
+
e === "MEMBERSHIPS" ? /* @__PURE__ */ N(ut, {
|
|
841
|
+
actions: Ot,
|
|
832
842
|
loading: u,
|
|
833
843
|
onCreate: () => _e({
|
|
834
844
|
record: null,
|
|
835
845
|
type: "CREATE"
|
|
836
846
|
}),
|
|
837
|
-
onActiveFilterChange:
|
|
838
|
-
onOrgUnitFilterChange:
|
|
847
|
+
onActiveFilterChange: Nt,
|
|
848
|
+
onOrgUnitFilterChange: Pt,
|
|
839
849
|
onPageChange: xe,
|
|
840
850
|
onPageSizeChange: (e) => {
|
|
841
851
|
xe(1), Ce(e);
|
|
842
852
|
},
|
|
843
|
-
onPositionFilterChange:
|
|
853
|
+
onPositionFilterChange: Ft,
|
|
844
854
|
orgUnitFilter: ve,
|
|
845
855
|
orgUnits: H,
|
|
846
856
|
page: be,
|
|
847
857
|
pageSize: Se,
|
|
848
|
-
positionFilter:
|
|
849
|
-
positions:
|
|
850
|
-
rows:
|
|
858
|
+
positionFilter: we,
|
|
859
|
+
positions: G,
|
|
860
|
+
rows: mt,
|
|
851
861
|
statusFilter: te,
|
|
852
|
-
total:
|
|
862
|
+
total: Ee
|
|
853
863
|
}) : null,
|
|
854
|
-
e === "MANAGERS" ? /* @__PURE__ */ N(
|
|
855
|
-
actions:
|
|
864
|
+
e === "MANAGERS" ? /* @__PURE__ */ N(dt, {
|
|
865
|
+
actions: kt,
|
|
856
866
|
loading: u,
|
|
857
867
|
onCreate: () => h({
|
|
858
868
|
record: null,
|
|
859
869
|
type: "CREATE"
|
|
860
870
|
}),
|
|
861
|
-
onActiveFilterChange:
|
|
871
|
+
onActiveFilterChange: It,
|
|
862
872
|
onPageChange: y,
|
|
863
873
|
onPageSizeChange: (e) => {
|
|
864
874
|
y(1), x(e);
|
|
865
875
|
},
|
|
866
|
-
onScopeTypeFilterChange:
|
|
876
|
+
onScopeTypeFilterChange: Lt,
|
|
867
877
|
page: v,
|
|
868
878
|
pageSize: b,
|
|
869
|
-
rows:
|
|
879
|
+
rows: ht,
|
|
870
880
|
scopeTypeFilter: E,
|
|
871
881
|
statusFilter: g,
|
|
872
882
|
total: I
|
|
873
883
|
}) : null
|
|
874
884
|
]
|
|
875
885
|
}) }),
|
|
876
|
-
/* @__PURE__ */ N(
|
|
877
|
-
modal:
|
|
878
|
-
onClose: () =>
|
|
879
|
-
onSubmit: (e) =>
|
|
880
|
-
|
|
886
|
+
/* @__PURE__ */ N(gt, {
|
|
887
|
+
modal: Oe,
|
|
888
|
+
onClose: () => z(null),
|
|
889
|
+
onSubmit: (e) => $(async () => {
|
|
890
|
+
Oe?.type === "EDIT" && Oe.record ? await pe({
|
|
881
891
|
...e,
|
|
882
|
-
id:
|
|
892
|
+
id: Oe.record.id,
|
|
883
893
|
metadataJson: null
|
|
884
894
|
}) : await ae({
|
|
885
895
|
code: e.code ?? "",
|
|
@@ -887,15 +897,15 @@ function J() {
|
|
|
887
897
|
name: e.name ?? "",
|
|
888
898
|
parentId: e.parentId,
|
|
889
899
|
type: e.type ?? "DEPARTMENT"
|
|
890
|
-
}),
|
|
900
|
+
}), z(null);
|
|
891
901
|
}),
|
|
892
902
|
orgUnits: H,
|
|
893
903
|
saving: J
|
|
894
904
|
}),
|
|
895
|
-
/* @__PURE__ */ N(
|
|
905
|
+
/* @__PURE__ */ N(_t, {
|
|
896
906
|
modal: We,
|
|
897
|
-
onClose: () =>
|
|
898
|
-
onSubmit: (e) =>
|
|
907
|
+
onClose: () => Ge(null),
|
|
908
|
+
onSubmit: (e) => $(async () => {
|
|
899
909
|
We?.type === "EDIT" && We.record ? await me({
|
|
900
910
|
...e,
|
|
901
911
|
id: We.record.id,
|
|
@@ -905,20 +915,20 @@ function J() {
|
|
|
905
915
|
level: e.level ?? 0,
|
|
906
916
|
metadataJson: "{}",
|
|
907
917
|
name: e.name ?? ""
|
|
908
|
-
}),
|
|
918
|
+
}), Ge(null);
|
|
909
919
|
}),
|
|
910
920
|
saving: J
|
|
911
921
|
}),
|
|
912
|
-
/* @__PURE__ */ N(
|
|
913
|
-
membersById:
|
|
922
|
+
/* @__PURE__ */ N(vt, {
|
|
923
|
+
membersById: X,
|
|
914
924
|
modal: ge,
|
|
915
925
|
onClose: () => _e(null),
|
|
916
|
-
onSubmit: (e) =>
|
|
926
|
+
onSubmit: (e) => $(async () => {
|
|
917
927
|
ge?.type === "EDIT" && ge.record ? await fe({
|
|
918
928
|
...e,
|
|
919
929
|
id: ge.record.id
|
|
920
930
|
}) : await ie({
|
|
921
|
-
effectiveFrom: e.effectiveFrom ??
|
|
931
|
+
effectiveFrom: e.effectiveFrom ?? zt(),
|
|
922
932
|
effectiveTo: e.effectiveTo,
|
|
923
933
|
isPrimary: e.isPrimary ?? !1,
|
|
924
934
|
memberId: e.memberId ?? "",
|
|
@@ -927,19 +937,19 @@ function J() {
|
|
|
927
937
|
}), _e(null);
|
|
928
938
|
}),
|
|
929
939
|
orgUnits: H,
|
|
930
|
-
positions:
|
|
940
|
+
positions: G,
|
|
931
941
|
saving: J
|
|
932
942
|
}),
|
|
933
|
-
/* @__PURE__ */ N(
|
|
934
|
-
membersById:
|
|
943
|
+
/* @__PURE__ */ N(yt, {
|
|
944
|
+
membersById: X,
|
|
935
945
|
modal: m,
|
|
936
946
|
onClose: () => h(null),
|
|
937
|
-
onSubmit: (e) =>
|
|
947
|
+
onSubmit: (e) => $(async () => {
|
|
938
948
|
m?.type === "EDIT" && m.record ? await de({
|
|
939
949
|
...e,
|
|
940
950
|
id: m.record.id
|
|
941
951
|
}) : await re({
|
|
942
|
-
effectiveFrom: e.effectiveFrom ??
|
|
952
|
+
effectiveFrom: e.effectiveFrom ?? zt(),
|
|
943
953
|
effectiveTo: e.effectiveTo,
|
|
944
954
|
managerMemberId: e.managerMemberId ?? "",
|
|
945
955
|
priority: e.priority ?? 0,
|
|
@@ -948,41 +958,41 @@ function J() {
|
|
|
948
958
|
}), h(null);
|
|
949
959
|
}),
|
|
950
960
|
orgUnits: H,
|
|
951
|
-
positions:
|
|
961
|
+
positions: G,
|
|
952
962
|
saving: J
|
|
953
963
|
}),
|
|
954
964
|
/* @__PURE__ */ N(S, {
|
|
955
965
|
cancelText: "取消",
|
|
956
966
|
confirmButtonProps: { variant: "destructive-primary" },
|
|
957
|
-
confirmText:
|
|
967
|
+
confirmText: at?.confirmText ?? "",
|
|
958
968
|
loading: J,
|
|
959
969
|
modalStatusType: "error",
|
|
960
970
|
modalType: "standard",
|
|
961
|
-
onCancel:
|
|
962
|
-
onClose:
|
|
963
|
-
onConfirm: () => void
|
|
971
|
+
onCancel: Q,
|
|
972
|
+
onClose: Q,
|
|
973
|
+
onConfirm: () => void Rt(),
|
|
964
974
|
open: !!n,
|
|
965
975
|
showModalFooter: !0,
|
|
966
976
|
showModalHeader: !0,
|
|
967
977
|
size: "regular",
|
|
968
978
|
supportingText: "此操作會立即套用,請確認後再繼續。",
|
|
969
|
-
title:
|
|
979
|
+
title: at?.title ?? "",
|
|
970
980
|
children: /* @__PURE__ */ N(A, {
|
|
971
981
|
color: "text-neutral",
|
|
972
982
|
variant: "body",
|
|
973
|
-
children:
|
|
983
|
+
children: at?.description ?? ""
|
|
974
984
|
})
|
|
975
985
|
})
|
|
976
986
|
] });
|
|
977
987
|
}
|
|
978
|
-
function
|
|
979
|
-
let F = f(null), [L, R] = p(
|
|
988
|
+
function ct({ 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 }) {
|
|
989
|
+
let F = f(null), [L, R] = p(Ze), te = j === "TABLE" ? "FLOW" : "TABLE", ne = j === "TABLE" ? "切換樹狀圖" : "切換表格", re = j === "FLOW", ie = ft({
|
|
980
990
|
isTreeMode: re,
|
|
981
991
|
isTreeEditing: L.isEditing
|
|
982
|
-
}), ae =
|
|
992
|
+
}), ae = pt({
|
|
983
993
|
isTreeMode: re,
|
|
984
994
|
isTreeEditing: L.isEditing
|
|
985
|
-
}), oe =
|
|
995
|
+
}), oe = mt({
|
|
986
996
|
hasDraftChanges: L.hasDraftChanges,
|
|
987
997
|
isTreeEditing: L.isEditing,
|
|
988
998
|
isTreeMode: re,
|
|
@@ -1021,8 +1031,8 @@ function it({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1021
1031
|
}
|
|
1022
1032
|
], []);
|
|
1023
1033
|
return l(() => {
|
|
1024
|
-
j === "TABLE" && R(
|
|
1025
|
-
}, [j]), /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(
|
|
1034
|
+
j === "TABLE" && R(Ze);
|
|
1035
|
+
}, [j]), /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(ht, {
|
|
1026
1036
|
actionDisabled: oe,
|
|
1027
1037
|
actionIcon: ae,
|
|
1028
1038
|
actionLabel: ie,
|
|
@@ -1078,8 +1088,8 @@ function it({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1078
1088
|
children: /* @__PURE__ */ N(E, {
|
|
1079
1089
|
clearable: !1,
|
|
1080
1090
|
fullWidth: !0,
|
|
1081
|
-
onChange: (e) => u(
|
|
1082
|
-
options: [
|
|
1091
|
+
onChange: (e) => u(kt(e)),
|
|
1092
|
+
options: [...$e],
|
|
1083
1093
|
placeholder: "類型",
|
|
1084
1094
|
size: "sub",
|
|
1085
1095
|
value: A
|
|
@@ -1094,16 +1104,16 @@ function it({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1094
1104
|
dataSource: [...w],
|
|
1095
1105
|
fullWidth: !0,
|
|
1096
1106
|
loading: t,
|
|
1097
|
-
pagination:
|
|
1107
|
+
pagination: X({
|
|
1098
1108
|
onPageChange: a,
|
|
1099
1109
|
onPageSizeChange: s,
|
|
1100
1110
|
page: S,
|
|
1101
1111
|
pageSize: C,
|
|
1102
1112
|
total: O
|
|
1103
1113
|
}),
|
|
1104
|
-
style: { minWidth:
|
|
1114
|
+
style: { minWidth: it }
|
|
1105
1115
|
})
|
|
1106
|
-
})] }) : /* @__PURE__ */ N(
|
|
1116
|
+
})] }) : /* @__PURE__ */ N(ze, {
|
|
1107
1117
|
ref: F,
|
|
1108
1118
|
onCreateChild: r,
|
|
1109
1119
|
onCreateRoot: n,
|
|
@@ -1114,7 +1124,7 @@ function it({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
|
|
|
1114
1124
|
saving: D
|
|
1115
1125
|
})] });
|
|
1116
1126
|
}
|
|
1117
|
-
function
|
|
1127
|
+
function lt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeChange: i, onSearchTextChange: a, page: o, pageSize: s, rows: c, searchText: l, total: u }) {
|
|
1118
1128
|
let f = d(() => [
|
|
1119
1129
|
{
|
|
1120
1130
|
dataIndex: "code",
|
|
@@ -1142,7 +1152,7 @@ function at({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1142
1152
|
}
|
|
1143
1153
|
], []);
|
|
1144
1154
|
return /* @__PURE__ */ P(M, { children: [
|
|
1145
|
-
/* @__PURE__ */ N(
|
|
1155
|
+
/* @__PURE__ */ N(ht, {
|
|
1146
1156
|
actionLabel: "新增職位",
|
|
1147
1157
|
description: "職位提供會員歸屬與主管解析規則使用。",
|
|
1148
1158
|
onCreate: n,
|
|
@@ -1176,19 +1186,19 @@ function at({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
|
|
|
1176
1186
|
dataSource: [...c],
|
|
1177
1187
|
fullWidth: !0,
|
|
1178
1188
|
loading: t,
|
|
1179
|
-
pagination:
|
|
1189
|
+
pagination: X({
|
|
1180
1190
|
onPageChange: r,
|
|
1181
1191
|
onPageSizeChange: i,
|
|
1182
1192
|
page: o,
|
|
1183
1193
|
pageSize: s,
|
|
1184
1194
|
total: u
|
|
1185
1195
|
}),
|
|
1186
|
-
style: { minWidth:
|
|
1196
|
+
style: { minWidth: at }
|
|
1187
1197
|
})
|
|
1188
1198
|
})
|
|
1189
1199
|
] });
|
|
1190
1200
|
}
|
|
1191
|
-
function
|
|
1201
|
+
function ut({ 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
1202
|
let T = d(() => [
|
|
1193
1203
|
{
|
|
1194
1204
|
dataIndex: "memberName",
|
|
@@ -1228,7 +1238,7 @@ function ot({ actions: t, loading: n, onCreate: i, onActiveFilterChange: a, onOr
|
|
|
1228
1238
|
}
|
|
1229
1239
|
], []), E = d(() => f.map(e), [f]), D = d(() => x.map(r), [x]);
|
|
1230
1240
|
return /* @__PURE__ */ P(M, { children: [
|
|
1231
|
-
/* @__PURE__ */ N(
|
|
1241
|
+
/* @__PURE__ */ N(ht, {
|
|
1232
1242
|
actionLabel: "新增歸屬",
|
|
1233
1243
|
description: "會員歸屬是 BPM 內部組織權限、主管解析與條件判斷的來源。",
|
|
1234
1244
|
onCreate: i,
|
|
@@ -1255,7 +1265,7 @@ function ot({ actions: t, loading: n, onCreate: i, onActiveFilterChange: a, onOr
|
|
|
1255
1265
|
},
|
|
1256
1266
|
mode: "single",
|
|
1257
1267
|
name: "membershipOrgUnitFilter",
|
|
1258
|
-
onChange: (e) => o(
|
|
1268
|
+
onChange: (e) => o(Pt(e)),
|
|
1259
1269
|
options: [...E],
|
|
1260
1270
|
placeholder: "全部組織",
|
|
1261
1271
|
size: "sub",
|
|
@@ -1280,7 +1290,7 @@ function ot({ actions: t, loading: n, onCreate: i, onActiveFilterChange: a, onOr
|
|
|
1280
1290
|
},
|
|
1281
1291
|
mode: "single",
|
|
1282
1292
|
name: "membershipPositionFilter",
|
|
1283
|
-
onChange: (e) => l(
|
|
1293
|
+
onChange: (e) => l(Ft(e)),
|
|
1284
1294
|
options: [...D],
|
|
1285
1295
|
placeholder: "全部職位",
|
|
1286
1296
|
size: "sub",
|
|
@@ -1305,8 +1315,8 @@ function ot({ actions: t, loading: n, onCreate: i, onActiveFilterChange: a, onOr
|
|
|
1305
1315
|
},
|
|
1306
1316
|
mode: "single",
|
|
1307
1317
|
name: "membershipStatusFilter",
|
|
1308
|
-
onChange: (e) => a(
|
|
1309
|
-
options: [...
|
|
1318
|
+
onChange: (e) => a(Nt(e)),
|
|
1319
|
+
options: [...rt],
|
|
1310
1320
|
placeholder: "全部狀態",
|
|
1311
1321
|
size: "sub",
|
|
1312
1322
|
value: C
|
|
@@ -1323,19 +1333,19 @@ function ot({ actions: t, loading: n, onCreate: i, onActiveFilterChange: a, onOr
|
|
|
1323
1333
|
dataSource: [...S],
|
|
1324
1334
|
fullWidth: !0,
|
|
1325
1335
|
loading: n,
|
|
1326
|
-
pagination:
|
|
1336
|
+
pagination: X({
|
|
1327
1337
|
onPageChange: s,
|
|
1328
1338
|
onPageSizeChange: c,
|
|
1329
1339
|
page: p,
|
|
1330
1340
|
pageSize: h,
|
|
1331
1341
|
total: w
|
|
1332
1342
|
}),
|
|
1333
|
-
style: { minWidth:
|
|
1343
|
+
style: { minWidth: ot }
|
|
1334
1344
|
})
|
|
1335
1345
|
})
|
|
1336
1346
|
] });
|
|
1337
1347
|
}
|
|
1338
|
-
function
|
|
1348
|
+
function dt({ 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
1349
|
let m = d(() => [
|
|
1340
1350
|
{
|
|
1341
1351
|
dataIndex: "scopeLabel",
|
|
@@ -1369,7 +1379,7 @@ function st({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1369
1379
|
}
|
|
1370
1380
|
], []);
|
|
1371
1381
|
return /* @__PURE__ */ P(M, { children: [
|
|
1372
|
-
/* @__PURE__ */ N(
|
|
1382
|
+
/* @__PURE__ */ N(ht, {
|
|
1373
1383
|
actionLabel: "新增主管規則",
|
|
1374
1384
|
description: "簽核主管規則獨立於組織樹 parent,解析優先序為會員、組織、職位。",
|
|
1375
1385
|
onCreate: n,
|
|
@@ -1387,8 +1397,8 @@ function st({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1387
1397
|
children: /* @__PURE__ */ N(E, {
|
|
1388
1398
|
clearable: !1,
|
|
1389
1399
|
fullWidth: !0,
|
|
1390
|
-
onChange: (e) => o(
|
|
1391
|
-
options: [...
|
|
1400
|
+
onChange: (e) => o(jt(e)),
|
|
1401
|
+
options: [...tt],
|
|
1392
1402
|
placeholder: "套用範圍",
|
|
1393
1403
|
size: "sub",
|
|
1394
1404
|
value: u
|
|
@@ -1403,8 +1413,8 @@ function st({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1403
1413
|
children: /* @__PURE__ */ N(E, {
|
|
1404
1414
|
clearable: !1,
|
|
1405
1415
|
fullWidth: !0,
|
|
1406
|
-
onChange: (e) => r(
|
|
1407
|
-
options: [...
|
|
1416
|
+
onChange: (e) => r(Mt(e)),
|
|
1417
|
+
options: [...rt],
|
|
1408
1418
|
placeholder: "狀態",
|
|
1409
1419
|
size: "sub",
|
|
1410
1420
|
value: f
|
|
@@ -1420,41 +1430,41 @@ function st({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
|
|
|
1420
1430
|
dataSource: [...l],
|
|
1421
1431
|
fullWidth: !0,
|
|
1422
1432
|
loading: t,
|
|
1423
|
-
pagination:
|
|
1433
|
+
pagination: X({
|
|
1424
1434
|
onPageChange: i,
|
|
1425
1435
|
onPageSizeChange: a,
|
|
1426
1436
|
page: s,
|
|
1427
1437
|
pageSize: c,
|
|
1428
1438
|
total: p
|
|
1429
1439
|
}),
|
|
1430
|
-
style: { minWidth:
|
|
1440
|
+
style: { minWidth: Y }
|
|
1431
1441
|
})
|
|
1432
1442
|
})
|
|
1433
1443
|
] });
|
|
1434
1444
|
}
|
|
1435
|
-
function
|
|
1445
|
+
function X({ onPageChange: e, onPageSizeChange: t, page: n, pageSize: r, total: i }) {
|
|
1436
1446
|
return {
|
|
1437
1447
|
current: n,
|
|
1438
1448
|
onChange: e,
|
|
1439
1449
|
onChangePageSize: t,
|
|
1440
1450
|
pageSize: r,
|
|
1441
1451
|
pageSizeLabel: "每頁筆數",
|
|
1442
|
-
pageSizeOptions: [
|
|
1452
|
+
pageSizeOptions: [...J],
|
|
1443
1453
|
renderResultSummary: (e, t, n) => `顯示 ${e}-${t} 筆,共 ${n} 筆`,
|
|
1444
1454
|
showPageSizeOptions: !0,
|
|
1445
1455
|
total: i
|
|
1446
1456
|
};
|
|
1447
1457
|
}
|
|
1448
|
-
function
|
|
1458
|
+
function ft({ isTreeEditing: e, isTreeMode: t }) {
|
|
1449
1459
|
return t ? e ? "儲存" : "開始編輯" : "新增組織";
|
|
1450
1460
|
}
|
|
1451
|
-
function
|
|
1461
|
+
function pt({ isTreeEditing: e, isTreeMode: t }) {
|
|
1452
1462
|
return t ? e ? te : L : R;
|
|
1453
1463
|
}
|
|
1454
|
-
function
|
|
1464
|
+
function mt({ hasDraftChanges: e, isTreeEditing: t, isTreeMode: n, loading: r, saving: i }) {
|
|
1455
1465
|
return n ? t ? !e || i : r : !1;
|
|
1456
1466
|
}
|
|
1457
|
-
function
|
|
1467
|
+
function ht({ actionDisabled: e = !1, actionIcon: t = R, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
|
|
1458
1468
|
return /* @__PURE__ */ P("div", {
|
|
1459
1469
|
className: W.tableIntro,
|
|
1460
1470
|
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(A, {
|
|
@@ -1477,7 +1487,7 @@ function Z({ actionDisabled: e = !1, actionIcon: t = R, actionLabel: n, actions:
|
|
|
1477
1487
|
})]
|
|
1478
1488
|
});
|
|
1479
1489
|
}
|
|
1480
|
-
function
|
|
1490
|
+
function gt({ modal: t, onClose: r, onSubmit: i, orgUnits: a, saving: s }) {
|
|
1481
1491
|
let [c, u] = p(""), [d, f] = p(""), [m, h] = p(null), [g, _] = p(G[2]);
|
|
1482
1492
|
return l(() => {
|
|
1483
1493
|
if (!t) return;
|
|
@@ -1505,14 +1515,14 @@ function ut({ modal: t, onClose: r, onSubmit: i, orgUnits: a, saving: s }) {
|
|
|
1505
1515
|
children: /* @__PURE__ */ P("div", {
|
|
1506
1516
|
className: W.modalFields,
|
|
1507
1517
|
children: [
|
|
1508
|
-
/* @__PURE__ */ N(
|
|
1518
|
+
/* @__PURE__ */ N(Z, {
|
|
1509
1519
|
label: "代碼",
|
|
1510
1520
|
name: "orgCode",
|
|
1511
1521
|
onChange: u,
|
|
1512
1522
|
placeholder: "例如 FIN-TW",
|
|
1513
1523
|
value: c
|
|
1514
1524
|
}),
|
|
1515
|
-
/* @__PURE__ */ N(
|
|
1525
|
+
/* @__PURE__ */ N(Z, {
|
|
1516
1526
|
label: "名稱",
|
|
1517
1527
|
name: "orgName",
|
|
1518
1528
|
onChange: f,
|
|
@@ -1525,7 +1535,7 @@ function ut({ modal: t, onClose: r, onSubmit: i, orgUnits: a, saving: s }) {
|
|
|
1525
1535
|
children: /* @__PURE__ */ N(E, {
|
|
1526
1536
|
clearable: !1,
|
|
1527
1537
|
fullWidth: !0,
|
|
1528
|
-
onChange: (e) => _(
|
|
1538
|
+
onChange: (e) => _(Ot(e)),
|
|
1529
1539
|
options: [...G],
|
|
1530
1540
|
placeholder: "選擇組織類型",
|
|
1531
1541
|
value: g
|
|
@@ -1546,7 +1556,7 @@ function ut({ modal: t, onClose: r, onSubmit: i, orgUnits: a, saving: s }) {
|
|
|
1546
1556
|
})
|
|
1547
1557
|
});
|
|
1548
1558
|
}
|
|
1549
|
-
function
|
|
1559
|
+
function _t({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
1550
1560
|
let [i, a] = p(""), [o, s] = p("0"), [c, u] = p("");
|
|
1551
1561
|
return l(() => {
|
|
1552
1562
|
e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)), u(e.record?.name ?? ""));
|
|
@@ -1571,21 +1581,21 @@ function dt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
|
1571
1581
|
children: /* @__PURE__ */ P("div", {
|
|
1572
1582
|
className: W.modalFields,
|
|
1573
1583
|
children: [
|
|
1574
|
-
/* @__PURE__ */ N(
|
|
1584
|
+
/* @__PURE__ */ N(Z, {
|
|
1575
1585
|
label: "代碼",
|
|
1576
1586
|
name: "positionCode",
|
|
1577
1587
|
onChange: a,
|
|
1578
1588
|
placeholder: "例如 FIN-MGR",
|
|
1579
1589
|
value: i
|
|
1580
1590
|
}),
|
|
1581
|
-
/* @__PURE__ */ N(
|
|
1591
|
+
/* @__PURE__ */ N(Z, {
|
|
1582
1592
|
label: "名稱",
|
|
1583
1593
|
name: "positionName",
|
|
1584
1594
|
onChange: u,
|
|
1585
1595
|
placeholder: "例如 財務主管",
|
|
1586
1596
|
value: c
|
|
1587
1597
|
}),
|
|
1588
|
-
/* @__PURE__ */ N(
|
|
1598
|
+
/* @__PURE__ */ N(Z, {
|
|
1589
1599
|
label: "職等",
|
|
1590
1600
|
name: "positionLevel",
|
|
1591
1601
|
onChange: s,
|
|
@@ -1596,12 +1606,12 @@ function dt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
|
|
|
1596
1606
|
})
|
|
1597
1607
|
});
|
|
1598
1608
|
}
|
|
1599
|
-
function
|
|
1600
|
-
let [g, _] = p(
|
|
1609
|
+
function vt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, positions: m, saving: h }) {
|
|
1610
|
+
let [g, _] = p(zt()), [v, y] = p(""), [b, x] = p(q[1]), [C, w] = p(null), [T, D] = p(null), [O, k] = p(null);
|
|
1601
1611
|
return l(() => {
|
|
1602
1612
|
if (!c) return;
|
|
1603
1613
|
let n = c.record, i = n ? s.get(n.memberId) : null;
|
|
1604
|
-
_(n?.effectiveFrom ??
|
|
1614
|
+
_(n?.effectiveFrom ?? zt()), y(n?.effectiveTo ?? ""), x(q.find((e) => e.value === n?.isPrimary) ?? q[1]), w(i ? t(i) : null), D(Rt(f.find((e) => e.id === n?.orgUnitId), e)), k(Rt(m.find((e) => e.id === n?.positionId), r));
|
|
1605
1615
|
}, [
|
|
1606
1616
|
s,
|
|
1607
1617
|
c,
|
|
@@ -1669,20 +1679,20 @@ function ft({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1669
1679
|
children: /* @__PURE__ */ N(E, {
|
|
1670
1680
|
clearable: !1,
|
|
1671
1681
|
fullWidth: !0,
|
|
1672
|
-
onChange: (e) => x(
|
|
1682
|
+
onChange: (e) => x(It(e)),
|
|
1673
1683
|
options: [...q],
|
|
1674
1684
|
placeholder: "選擇歸屬類型",
|
|
1675
1685
|
value: b
|
|
1676
1686
|
})
|
|
1677
1687
|
}),
|
|
1678
|
-
/* @__PURE__ */ N(
|
|
1688
|
+
/* @__PURE__ */ N(bt, {
|
|
1679
1689
|
label: "生效日",
|
|
1680
1690
|
name: "membershipEffectiveFrom",
|
|
1681
1691
|
onChange: _,
|
|
1682
1692
|
placeholder: "YYYY-MM-DD",
|
|
1683
1693
|
value: g
|
|
1684
1694
|
}),
|
|
1685
|
-
/* @__PURE__ */ N(
|
|
1695
|
+
/* @__PURE__ */ N(bt, {
|
|
1686
1696
|
label: "結束日",
|
|
1687
1697
|
name: "membershipEffectiveTo",
|
|
1688
1698
|
onChange: y,
|
|
@@ -1693,12 +1703,12 @@ function ft({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1693
1703
|
})
|
|
1694
1704
|
});
|
|
1695
1705
|
}
|
|
1696
|
-
function
|
|
1697
|
-
let [g, _] = p(
|
|
1706
|
+
function yt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, positions: m, saving: h }) {
|
|
1707
|
+
let [g, _] = p(zt()), [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(K[0]);
|
|
1698
1708
|
l(() => {
|
|
1699
1709
|
if (!c) return;
|
|
1700
1710
|
let n = c.record, i = K.find((e) => e.id === n?.scopeType) ?? K[0];
|
|
1701
|
-
_(n?.effectiveFrom ??
|
|
1711
|
+
_(n?.effectiveFrom ?? zt()), y(n?.effectiveTo ?? ""), x(Rt(n ? s.get(n.managerMemberId) : null, t)), w(String(n?.priority ?? 0)), D(i.id === "MEMBER" ? Rt(n ? s.get(n.scopeId) : null, t) : null), k(i.id === "ORG_UNIT" ? Rt(f.find((e) => e.id === n?.scopeId), e) : null), M(i.id === "POSITION" ? Rt(m.find((e) => e.id === n?.scopeId), r) : null), I(i);
|
|
1702
1712
|
}, [
|
|
1703
1713
|
s,
|
|
1704
1714
|
c,
|
|
@@ -1736,7 +1746,7 @@ function pt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1736
1746
|
children: /* @__PURE__ */ N(E, {
|
|
1737
1747
|
clearable: !1,
|
|
1738
1748
|
fullWidth: !0,
|
|
1739
|
-
onChange: (e) => I(
|
|
1749
|
+
onChange: (e) => I(At(e)),
|
|
1740
1750
|
options: [...K],
|
|
1741
1751
|
placeholder: "選擇套用範圍",
|
|
1742
1752
|
value: F
|
|
@@ -1789,21 +1799,21 @@ function pt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1789
1799
|
variant: "caption",
|
|
1790
1800
|
children: "簽核主管不可設定為套用會員本人。"
|
|
1791
1801
|
}) : null,
|
|
1792
|
-
/* @__PURE__ */ N(
|
|
1802
|
+
/* @__PURE__ */ N(Z, {
|
|
1793
1803
|
label: "優先序",
|
|
1794
1804
|
name: "managerPriority",
|
|
1795
1805
|
onChange: w,
|
|
1796
1806
|
placeholder: "例如 10",
|
|
1797
1807
|
value: C
|
|
1798
1808
|
}),
|
|
1799
|
-
/* @__PURE__ */ N(
|
|
1809
|
+
/* @__PURE__ */ N(bt, {
|
|
1800
1810
|
label: "生效日",
|
|
1801
1811
|
name: "managerEffectiveFrom",
|
|
1802
1812
|
onChange: _,
|
|
1803
1813
|
placeholder: "YYYY-MM-DD",
|
|
1804
1814
|
value: g
|
|
1805
1815
|
}),
|
|
1806
|
-
/* @__PURE__ */ N(
|
|
1816
|
+
/* @__PURE__ */ N(bt, {
|
|
1807
1817
|
label: "結束日",
|
|
1808
1818
|
name: "managerEffectiveTo",
|
|
1809
1819
|
onChange: y,
|
|
@@ -1814,7 +1824,7 @@ function pt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
|
|
|
1814
1824
|
})
|
|
1815
1825
|
});
|
|
1816
1826
|
}
|
|
1817
|
-
function
|
|
1827
|
+
function Z({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
|
|
1818
1828
|
return /* @__PURE__ */ N(o, {
|
|
1819
1829
|
label: e,
|
|
1820
1830
|
name: t,
|
|
@@ -1827,7 +1837,7 @@ function Q({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
|
|
|
1827
1837
|
})
|
|
1828
1838
|
});
|
|
1829
1839
|
}
|
|
1830
|
-
function
|
|
1840
|
+
function bt({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
|
|
1831
1841
|
return /* @__PURE__ */ N(o, {
|
|
1832
1842
|
label: e,
|
|
1833
1843
|
name: t,
|
|
@@ -1835,110 +1845,110 @@ function mt({ label: e, name: t, onChange: n, placeholder: r, value: i }) {
|
|
|
1835
1845
|
format: "YYYY-MM-DD",
|
|
1836
1846
|
fullWidth: !0,
|
|
1837
1847
|
inputProps: { name: t },
|
|
1838
|
-
onChange: (e) => n(
|
|
1848
|
+
onChange: (e) => n(Bt(e)),
|
|
1839
1849
|
placeholder: r,
|
|
1840
1850
|
value: i.trim() ? i : void 0
|
|
1841
1851
|
})
|
|
1842
1852
|
});
|
|
1843
1853
|
}
|
|
1844
|
-
function
|
|
1854
|
+
function xt(e, t) {
|
|
1845
1855
|
return [...new Set([
|
|
1846
1856
|
...e.map((e) => e.memberId),
|
|
1847
1857
|
...t.map((e) => e.managerMemberId),
|
|
1848
1858
|
...t.filter((e) => e.scopeType === "MEMBER").map((e) => e.scopeId)
|
|
1849
1859
|
])];
|
|
1850
1860
|
}
|
|
1851
|
-
function
|
|
1852
|
-
return e.scopeType === "MEMBER" ? `會員:${
|
|
1861
|
+
function St(e, t) {
|
|
1862
|
+
return e.scopeType === "MEMBER" ? `會員:${Ct(t.membersById.get(e.scopeId))}` : e.scopeType === "ORG_UNIT" ? `組織:${wt(t.orgUnitsById.get(e.scopeId))}` : `職位:${Et(t.positionsById.get(e.scopeId))}`;
|
|
1853
1863
|
}
|
|
1854
|
-
function
|
|
1864
|
+
function Ct(e) {
|
|
1855
1865
|
return e ? `${e.name} · ${e.email}` : "未知會員";
|
|
1856
1866
|
}
|
|
1857
|
-
function
|
|
1867
|
+
function wt(e) {
|
|
1858
1868
|
return e ? `${e.name} · ${e.code}` : "未知組織";
|
|
1859
1869
|
}
|
|
1860
|
-
function
|
|
1870
|
+
function Tt(e) {
|
|
1861
1871
|
return G.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
|
|
1862
1872
|
}
|
|
1863
|
-
function
|
|
1873
|
+
function Et(e) {
|
|
1864
1874
|
return e ? `${e.name} · ${e.code}` : "未指定";
|
|
1865
1875
|
}
|
|
1866
|
-
function
|
|
1876
|
+
function Dt(e) {
|
|
1867
1877
|
return e === "MANAGERS" || e === "MEMBERSHIPS" || e === "POSITIONS" ? e : "ORG_UNITS";
|
|
1868
1878
|
}
|
|
1869
|
-
function
|
|
1870
|
-
let t =
|
|
1879
|
+
function Ot(e) {
|
|
1880
|
+
let t = Q(e) ? e : null;
|
|
1871
1881
|
if (typeof t?.id == "string") {
|
|
1872
1882
|
let e = t.id;
|
|
1873
1883
|
return G.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? G[2];
|
|
1874
1884
|
}
|
|
1875
1885
|
return G[2];
|
|
1876
1886
|
}
|
|
1877
|
-
function
|
|
1878
|
-
let t =
|
|
1887
|
+
function kt(e) {
|
|
1888
|
+
let t = Q(e) ? e : null;
|
|
1879
1889
|
if (typeof t?.id == "string") {
|
|
1880
1890
|
let e = t.id;
|
|
1881
|
-
return
|
|
1891
|
+
return $e.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? Qe;
|
|
1882
1892
|
}
|
|
1883
|
-
return
|
|
1893
|
+
return Qe;
|
|
1884
1894
|
}
|
|
1885
|
-
function
|
|
1886
|
-
return
|
|
1895
|
+
function At(e) {
|
|
1896
|
+
return Lt(e, K, K[0]);
|
|
1887
1897
|
}
|
|
1888
|
-
function
|
|
1889
|
-
return
|
|
1898
|
+
function jt(e) {
|
|
1899
|
+
return Lt(e, tt, et);
|
|
1890
1900
|
}
|
|
1891
|
-
function
|
|
1892
|
-
return
|
|
1901
|
+
function Mt(e) {
|
|
1902
|
+
return Lt(e, rt, nt);
|
|
1893
1903
|
}
|
|
1894
|
-
function
|
|
1895
|
-
let t =
|
|
1896
|
-
return
|
|
1904
|
+
function Nt(e) {
|
|
1905
|
+
let t = Q(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
|
|
1906
|
+
return rt.find((e) => e.id === n) ?? null;
|
|
1897
1907
|
}
|
|
1898
|
-
function
|
|
1899
|
-
let t =
|
|
1908
|
+
function Pt(e) {
|
|
1909
|
+
let t = Q(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
1900
1910
|
return n && r ? {
|
|
1901
1911
|
id: n,
|
|
1902
1912
|
name: r
|
|
1903
1913
|
} : null;
|
|
1904
1914
|
}
|
|
1905
|
-
function
|
|
1906
|
-
let t =
|
|
1915
|
+
function Ft(e) {
|
|
1916
|
+
let t = Q(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
|
|
1907
1917
|
return n && r ? {
|
|
1908
1918
|
id: n,
|
|
1909
1919
|
name: r
|
|
1910
1920
|
} : null;
|
|
1911
1921
|
}
|
|
1912
|
-
function
|
|
1913
|
-
return
|
|
1922
|
+
function It(e) {
|
|
1923
|
+
return Lt(e, q, q[1]);
|
|
1914
1924
|
}
|
|
1915
|
-
function
|
|
1916
|
-
let r =
|
|
1925
|
+
function Lt(e, t, n) {
|
|
1926
|
+
let r = Q(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
|
|
1917
1927
|
return t.find((e) => e.id === i) ?? n;
|
|
1918
1928
|
}
|
|
1919
|
-
function
|
|
1929
|
+
function Q(e) {
|
|
1920
1930
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1921
1931
|
}
|
|
1922
|
-
function
|
|
1932
|
+
function Rt(e, t) {
|
|
1923
1933
|
return e ? t(e) : null;
|
|
1924
1934
|
}
|
|
1925
|
-
function
|
|
1926
|
-
return
|
|
1935
|
+
function zt() {
|
|
1936
|
+
return $(/* @__PURE__ */ new Date());
|
|
1927
1937
|
}
|
|
1928
|
-
function
|
|
1938
|
+
function Bt(e) {
|
|
1929
1939
|
let t = e ? new Date(e) : null;
|
|
1930
|
-
return t && !Number.isNaN(t.getTime()) ?
|
|
1940
|
+
return t && !Number.isNaN(t.getTime()) ? $(t) : "";
|
|
1931
1941
|
}
|
|
1932
|
-
function
|
|
1933
|
-
return `${e.getFullYear()}-${
|
|
1942
|
+
function $(e) {
|
|
1943
|
+
return `${e.getFullYear()}-${Vt(e.getMonth() + 1)}-${Vt(e.getDate())}`;
|
|
1934
1944
|
}
|
|
1935
|
-
function
|
|
1945
|
+
function Vt(e) {
|
|
1936
1946
|
return String(e).padStart(2, "0");
|
|
1937
1947
|
}
|
|
1938
|
-
function
|
|
1948
|
+
function Ht(e) {
|
|
1939
1949
|
return e instanceof Error ? e.message : "讀取組織資料失敗。";
|
|
1940
1950
|
}
|
|
1941
1951
|
//#endregion
|
|
1942
|
-
export {
|
|
1952
|
+
export { st as t };
|
|
1943
1953
|
|
|
1944
|
-
//# sourceMappingURL=orgs-
|
|
1954
|
+
//# sourceMappingURL=orgs-BywlqXaG.js.map
|