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