@bwg-ui/core 1.3.2 → 1.3.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/dist/chunks/{CMSearchIntfGwP01-Bx5cpkhH.js → CMSearchIntfGwP01-Co6lrDf9.js} +9 -9
- package/dist/chunks/CMSearchIntfGwP01-Do_ZDjmX.cjs +1 -0
- package/dist/chunks/{MenuReport-DxJIaW8D.js → MenuReport-BTtoDFz-.js} +146 -141
- package/dist/chunks/MenuReport-Bn5NyNel.cjs +1 -0
- package/dist/chunks/{common-components-dzN5Nuq0.js → common-components-0IMhPxxg.js} +11521 -10978
- package/dist/chunks/common-components-Csd3OioX.cjs +1109 -0
- package/dist/chunks/core-components-CX6NGtTh.cjs +1 -0
- package/dist/chunks/core-components-Ckwf4Rd7.js +1969 -0
- package/dist/chunks/layout-components-BMLp8YAy.cjs +38 -0
- package/dist/chunks/{layout-components-B25FFvXj.js → layout-components-DphZY34c.js} +942 -741
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgEmpSearch.d.ts +28 -0
- package/dist/components/core/BwgEmpSearch.d.ts.map +1 -0
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +22 -1846
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.js +13 -13
- package/dist/components/layout/AppWrapper.d.ts +2 -1
- package/dist/components/layout/AppWrapper.d.ts.map +1 -1
- package/dist/components/layout/BwgCoreLogin.d.ts +1 -2
- package/dist/components/layout/BwgCoreLogin.d.ts.map +1 -1
- package/dist/components/layout/BwgSessionNotice.d.ts +15 -0
- package/dist/components/layout/BwgSessionNotice.d.ts.map +1 -0
- package/dist/components/layout/BwgSsoLogin.d.ts +19 -0
- package/dist/components/layout/BwgSsoLogin.d.ts.map +1 -0
- package/dist/components/layout/custom/ConfigurableHeader.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +16 -14
- package/dist/components/pages/board/CMAdminBoardM01.d.ts.map +1 -1
- package/dist/components/pages/board/CMMyBoardM01.d.ts.map +1 -1
- package/dist/components/popup/MenuReport.d.ts.map +1 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts +1 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts.map +1 -1
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +160 -157
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.d.ts +2 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +368 -335
- package/dist/stores/loginStore.d.ts +55 -10
- package/dist/stores/loginStore.d.ts.map +1 -1
- package/dist/stores/userStore.d.ts +1 -2
- package/dist/stores/userStore.d.ts.map +1 -1
- package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
- package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
- package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
- package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +455 -454
- package/package.json +1 -1
- package/dist/chunks/CMSearchIntfGwP01-Uhl4uqiV.cjs +0 -1
- package/dist/chunks/MenuReport-CPwq8w-z.cjs +0 -1
- package/dist/chunks/common-components-Dd_AsKs7.cjs +0 -1109
- package/dist/chunks/layout-components-Cz7Zets7.cjs +0 -35
package/dist/stores/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { create as
|
|
2
|
-
import { callService as
|
|
3
|
-
import { message as
|
|
4
|
-
import { l as ne } from "../chunks/layout-components-
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
1
|
+
import { create as b } from "zustand";
|
|
2
|
+
import { callService as S, getServiceCode as _, getUserId as v, getUserInfo as te, getCookie as oe, encryptSha256 as X, setCookie as x } from "../utils/index.js";
|
|
3
|
+
import { message as B, Modal as se } from "antd";
|
|
4
|
+
import { l as ne } from "../chunks/layout-components-DphZY34c.js";
|
|
5
|
+
import { useState as H, useCallback as U } from "react";
|
|
6
|
+
import re from "axios";
|
|
7
7
|
function ae(n, r) {
|
|
8
8
|
let e;
|
|
9
9
|
try {
|
|
@@ -21,12 +21,12 @@ function ae(n, r) {
|
|
|
21
21
|
removeItem: (o) => e.removeItem(o)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const G = (n) => (r) => {
|
|
25
25
|
try {
|
|
26
26
|
const e = n(r);
|
|
27
27
|
return e instanceof Promise ? e : {
|
|
28
28
|
then(s) {
|
|
29
|
-
return
|
|
29
|
+
return G(s)(e);
|
|
30
30
|
},
|
|
31
31
|
catch(s) {
|
|
32
32
|
return this;
|
|
@@ -38,18 +38,18 @@ const B = (n) => (r) => {
|
|
|
38
38
|
return this;
|
|
39
39
|
},
|
|
40
40
|
catch(s) {
|
|
41
|
-
return
|
|
41
|
+
return G(s)(e);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
}, de = (n, r) => (e, s, o) => {
|
|
46
46
|
let t = {
|
|
47
47
|
storage: ae(() => localStorage),
|
|
48
|
-
partialize: (
|
|
48
|
+
partialize: (h) => h,
|
|
49
49
|
version: 0,
|
|
50
|
-
merge: (
|
|
51
|
-
...
|
|
52
|
-
...
|
|
50
|
+
merge: (h, N) => ({
|
|
51
|
+
...N,
|
|
52
|
+
...h
|
|
53
53
|
}),
|
|
54
54
|
...r
|
|
55
55
|
}, a = !1;
|
|
@@ -57,89 +57,89 @@ const B = (n) => (r) => {
|
|
|
57
57
|
let i = t.storage;
|
|
58
58
|
if (!i)
|
|
59
59
|
return n(
|
|
60
|
-
(...
|
|
60
|
+
(...h) => {
|
|
61
61
|
console.warn(
|
|
62
62
|
`[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`
|
|
63
|
-
), e(...
|
|
63
|
+
), e(...h);
|
|
64
64
|
},
|
|
65
65
|
s,
|
|
66
66
|
o
|
|
67
67
|
);
|
|
68
|
-
const
|
|
69
|
-
const
|
|
68
|
+
const p = () => {
|
|
69
|
+
const h = t.partialize({ ...s() });
|
|
70
70
|
return i.setItem(t.name, {
|
|
71
|
-
state:
|
|
71
|
+
state: h,
|
|
72
72
|
version: t.version
|
|
73
73
|
});
|
|
74
|
-
},
|
|
75
|
-
o.setState = (
|
|
74
|
+
}, f = o.setState;
|
|
75
|
+
o.setState = (h, N) => (f(h, N), p());
|
|
76
76
|
const m = n(
|
|
77
|
-
(...
|
|
77
|
+
(...h) => (e(...h), p()),
|
|
78
78
|
s,
|
|
79
79
|
o
|
|
80
80
|
);
|
|
81
81
|
o.getInitialState = () => m;
|
|
82
82
|
let u;
|
|
83
|
-
const
|
|
84
|
-
var
|
|
83
|
+
const C = () => {
|
|
84
|
+
var h, N;
|
|
85
85
|
if (!i) return;
|
|
86
|
-
a = !1, d.forEach((
|
|
87
|
-
var
|
|
88
|
-
return
|
|
86
|
+
a = !1, d.forEach((y) => {
|
|
87
|
+
var M;
|
|
88
|
+
return y((M = s()) != null ? M : m);
|
|
89
89
|
});
|
|
90
|
-
const
|
|
91
|
-
return
|
|
92
|
-
if (
|
|
93
|
-
if (typeof
|
|
90
|
+
const g = ((N = t.onRehydrateStorage) == null ? void 0 : N.call(t, (h = s()) != null ? h : m)) || void 0;
|
|
91
|
+
return G(i.getItem.bind(i))(t.name).then((y) => {
|
|
92
|
+
if (y)
|
|
93
|
+
if (typeof y.version == "number" && y.version !== t.version) {
|
|
94
94
|
if (t.migrate) {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
const M = t.migrate(
|
|
96
|
+
y.state,
|
|
97
|
+
y.version
|
|
98
98
|
);
|
|
99
|
-
return
|
|
99
|
+
return M instanceof Promise ? M.then((T) => [!0, T]) : [!0, M];
|
|
100
100
|
}
|
|
101
101
|
console.error(
|
|
102
102
|
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
103
103
|
);
|
|
104
104
|
} else
|
|
105
|
-
return [!1,
|
|
105
|
+
return [!1, y.state];
|
|
106
106
|
return [!1, void 0];
|
|
107
|
-
}).then((
|
|
108
|
-
var
|
|
109
|
-
const [T,
|
|
107
|
+
}).then((y) => {
|
|
108
|
+
var M;
|
|
109
|
+
const [T, ee] = y;
|
|
110
110
|
if (u = t.merge(
|
|
111
|
-
|
|
112
|
-
(
|
|
111
|
+
ee,
|
|
112
|
+
(M = s()) != null ? M : m
|
|
113
113
|
), e(u, !0), T)
|
|
114
|
-
return
|
|
114
|
+
return p();
|
|
115
115
|
}).then(() => {
|
|
116
|
-
|
|
117
|
-
}).catch((
|
|
118
|
-
|
|
116
|
+
g?.(u, void 0), u = s(), a = !0, c.forEach((y) => y(u));
|
|
117
|
+
}).catch((y) => {
|
|
118
|
+
g?.(void 0, y);
|
|
119
119
|
});
|
|
120
120
|
};
|
|
121
121
|
return o.persist = {
|
|
122
|
-
setOptions: (
|
|
122
|
+
setOptions: (h) => {
|
|
123
123
|
t = {
|
|
124
124
|
...t,
|
|
125
|
-
...
|
|
126
|
-
},
|
|
125
|
+
...h
|
|
126
|
+
}, h.storage && (i = h.storage);
|
|
127
127
|
},
|
|
128
128
|
clearStorage: () => {
|
|
129
129
|
i?.removeItem(t.name);
|
|
130
130
|
},
|
|
131
131
|
getOptions: () => t,
|
|
132
|
-
rehydrate: () =>
|
|
132
|
+
rehydrate: () => C(),
|
|
133
133
|
hasHydrated: () => a,
|
|
134
|
-
onHydrate: (
|
|
135
|
-
d.delete(
|
|
134
|
+
onHydrate: (h) => (d.add(h), () => {
|
|
135
|
+
d.delete(h);
|
|
136
136
|
}),
|
|
137
|
-
onFinishHydration: (
|
|
138
|
-
c.delete(
|
|
137
|
+
onFinishHydration: (h) => (c.add(h), () => {
|
|
138
|
+
c.delete(h);
|
|
139
139
|
})
|
|
140
|
-
}, t.skipHydration ||
|
|
141
|
-
},
|
|
142
|
-
|
|
140
|
+
}, t.skipHydration || C(), u || m;
|
|
141
|
+
}, k = de, w = b()(
|
|
142
|
+
k(
|
|
143
143
|
(n, r) => ({
|
|
144
144
|
user: null,
|
|
145
145
|
hrInfo: null,
|
|
@@ -260,17 +260,16 @@ const B = (n) => (r) => {
|
|
|
260
260
|
enableProtectWrapper: n.enableProtectWrapper,
|
|
261
261
|
gridLayouts: n.gridLayouts,
|
|
262
262
|
// 그리드 레이아웃 정보 저장
|
|
263
|
-
theme: n.theme
|
|
263
|
+
theme: n.theme
|
|
264
264
|
// 테마 정보 저장
|
|
265
|
-
isLoggedIn: n.isLoggedIn
|
|
266
265
|
// buttonAuthCache는 세션 동안만 유지 (localStorage에 저장 안 함)
|
|
267
266
|
})
|
|
268
267
|
// 저장할 상태만 선택
|
|
269
268
|
}
|
|
270
269
|
)
|
|
271
|
-
),
|
|
270
|
+
), A = {
|
|
272
271
|
CACHE_SIZE_LIMIT: 1e3
|
|
273
|
-
},
|
|
272
|
+
}, l = {
|
|
274
273
|
codeCache: /* @__PURE__ */ new Map(),
|
|
275
274
|
nameCache: /* @__PURE__ */ new Map(),
|
|
276
275
|
optionCache: /* @__PURE__ */ new Map(),
|
|
@@ -292,7 +291,7 @@ const B = (n) => (r) => {
|
|
|
292
291
|
markGroupLoaded(n) {
|
|
293
292
|
this.loadedGroups.add(n);
|
|
294
293
|
}
|
|
295
|
-
},
|
|
294
|
+
}, L = (n) => {
|
|
296
295
|
console.log("대규모 데이터 변환 시작:", n);
|
|
297
296
|
const r = {};
|
|
298
297
|
if (n && n.code && Array.isArray(n.code)) {
|
|
@@ -303,7 +302,7 @@ const B = (n) => (r) => {
|
|
|
303
302
|
if (t && t.cmmnCdGrp && t.cmmnCd && t.enblYn === "Y") {
|
|
304
303
|
const a = t.cmmnCdGrp;
|
|
305
304
|
r[a] || (r[a] = {});
|
|
306
|
-
const c = (o.get(t.cmmnCd) || []).reduce((i,
|
|
305
|
+
const c = (o.get(t.cmmnCd) || []).reduce((i, p) => (p.optnCd && p.optnNm && (i[p.optnCd] = p.optnNm), i), {});
|
|
307
306
|
r[a][t.cmmnCd] = {
|
|
308
307
|
codeValue: t.cmmnCd,
|
|
309
308
|
codeNm: t.cmmnCdNm,
|
|
@@ -320,8 +319,8 @@ const B = (n) => (r) => {
|
|
|
320
319
|
});
|
|
321
320
|
}
|
|
322
321
|
return console.log("대규모 데이터 변환 완료:", r), r;
|
|
323
|
-
},
|
|
324
|
-
|
|
322
|
+
}, I = b()(
|
|
323
|
+
k(
|
|
325
324
|
(n, r) => ({
|
|
326
325
|
codeData: null,
|
|
327
326
|
isLoading: !1,
|
|
@@ -333,19 +332,19 @@ const B = (n) => (r) => {
|
|
|
333
332
|
n({ isLoading: !0, error: null });
|
|
334
333
|
try {
|
|
335
334
|
console.log("시스템 공통코드 데이터 가져오기 시작: SCMSIGN00301");
|
|
336
|
-
const e = await
|
|
335
|
+
const e = await S(_("SRCH_CODE"), {
|
|
337
336
|
crprCd: "100"
|
|
338
337
|
});
|
|
339
338
|
console.log("시스템 공통코드 응답:", e), console.log("시스템 공통코드목록:", e.code), console.log("시스템 공통코드옵션목록:", e.opt);
|
|
340
|
-
const s =
|
|
339
|
+
const s = L(e), t = {
|
|
341
340
|
...r().codeData || {},
|
|
342
341
|
...s
|
|
343
342
|
// 시스템 공통코드가 우선 (같은 그룹코드가 있으면 덮어씀)
|
|
344
343
|
};
|
|
345
|
-
|
|
344
|
+
l.clearCache();
|
|
346
345
|
const a = new Set(Object.keys(t));
|
|
347
346
|
a.forEach((d) => {
|
|
348
|
-
|
|
347
|
+
l.markGroupLoaded(d);
|
|
349
348
|
}), n({
|
|
350
349
|
codeData: t,
|
|
351
350
|
isLoading: !1,
|
|
@@ -365,19 +364,19 @@ const B = (n) => (r) => {
|
|
|
365
364
|
n({ isLoading: !0, error: null });
|
|
366
365
|
try {
|
|
367
366
|
console.log("업무 공통코드 데이터 가져오기 시작: SCMSIGN00302");
|
|
368
|
-
const e = await
|
|
367
|
+
const e = await S("SCMSIGN00302", {
|
|
369
368
|
sysCd: __SYS_CD__
|
|
370
369
|
});
|
|
371
370
|
console.log("업무 공통코드 응답:", e), console.log("업무 공통코드목록:", e.code), console.log("업무 공통코드옵션목록:", e.opt);
|
|
372
|
-
const s =
|
|
371
|
+
const s = L(e), t = {
|
|
373
372
|
...r().codeData || {},
|
|
374
373
|
...s
|
|
375
374
|
// 업무 공통코드 추가 (같은 그룹코드가 있으면 덮어씀)
|
|
376
375
|
};
|
|
377
|
-
|
|
376
|
+
l.clearCache();
|
|
378
377
|
const a = new Set(Object.keys(t));
|
|
379
378
|
a.forEach((d) => {
|
|
380
|
-
|
|
379
|
+
l.markGroupLoaded(d);
|
|
381
380
|
}), n({
|
|
382
381
|
codeData: t,
|
|
383
382
|
isLoading: !1,
|
|
@@ -398,23 +397,23 @@ const B = (n) => (r) => {
|
|
|
398
397
|
try {
|
|
399
398
|
console.log("전체 공통코드 데이터 가져오기 시작 (시스템 + 업무)");
|
|
400
399
|
const [e, s] = await Promise.all([
|
|
401
|
-
|
|
400
|
+
S(_("SRCH_CODE"), {
|
|
402
401
|
crprCd: "100"
|
|
403
402
|
}),
|
|
404
|
-
|
|
403
|
+
S("SCMSIGN00302", {
|
|
405
404
|
sysCd: __SYS_CD__
|
|
406
405
|
})
|
|
407
406
|
]);
|
|
408
407
|
console.log("시스템 공통코드 응답:", e), console.log("업무 공통코드 응답:", s);
|
|
409
|
-
const o =
|
|
408
|
+
const o = L(e), t = L(s), a = {
|
|
410
409
|
...o,
|
|
411
410
|
...t
|
|
412
411
|
// 업무 공통코드가 같은 그룹코드를 덮어쓸 수 있음
|
|
413
412
|
};
|
|
414
|
-
|
|
413
|
+
l.clearCache();
|
|
415
414
|
const d = new Set(Object.keys(a));
|
|
416
415
|
d.forEach((c) => {
|
|
417
|
-
|
|
416
|
+
l.markGroupLoaded(c);
|
|
418
417
|
}), n({
|
|
419
418
|
codeData: a,
|
|
420
419
|
isLoading: !1,
|
|
@@ -433,13 +432,13 @@ const B = (n) => (r) => {
|
|
|
433
432
|
const { codeData: s, loadedGroups: o } = r();
|
|
434
433
|
if (!s || o.has(e)) return;
|
|
435
434
|
const t = new Set(o).add(e);
|
|
436
|
-
n({ loadedGroups: t }),
|
|
435
|
+
n({ loadedGroups: t }), l.markGroupLoaded(e);
|
|
437
436
|
},
|
|
438
437
|
setData: (e) => {
|
|
439
|
-
|
|
438
|
+
l.clearCache();
|
|
440
439
|
const s = new Set(Object.keys(e));
|
|
441
440
|
s.forEach((o) => {
|
|
442
|
-
|
|
441
|
+
l.markGroupLoaded(o);
|
|
443
442
|
}), n({
|
|
444
443
|
codeData: e,
|
|
445
444
|
lastUpdated: /* @__PURE__ */ new Date(),
|
|
@@ -447,7 +446,7 @@ const B = (n) => (r) => {
|
|
|
447
446
|
});
|
|
448
447
|
},
|
|
449
448
|
clearData: () => {
|
|
450
|
-
|
|
449
|
+
l.clearCache(), n({
|
|
451
450
|
codeData: null,
|
|
452
451
|
isLoading: !1,
|
|
453
452
|
error: null,
|
|
@@ -466,25 +465,25 @@ const B = (n) => (r) => {
|
|
|
466
465
|
})
|
|
467
466
|
}
|
|
468
467
|
)
|
|
469
|
-
),
|
|
470
|
-
|
|
468
|
+
), F = b()(
|
|
469
|
+
k(
|
|
471
470
|
(n, r) => ({
|
|
472
471
|
// 공통 데이터 스토어에서 상태 가져오기
|
|
473
472
|
get codeData() {
|
|
474
|
-
return
|
|
473
|
+
return I.getState().codeData;
|
|
475
474
|
},
|
|
476
475
|
get isLoading() {
|
|
477
|
-
return
|
|
476
|
+
return I.getState().isLoading;
|
|
478
477
|
},
|
|
479
478
|
get error() {
|
|
480
|
-
return
|
|
479
|
+
return I.getState().error;
|
|
481
480
|
},
|
|
482
481
|
get lastUpdated() {
|
|
483
|
-
return
|
|
482
|
+
return I.getState().lastUpdated;
|
|
484
483
|
},
|
|
485
484
|
// 공통코드 가져오기 (중앙 스토어 사용)
|
|
486
485
|
fetchCommonCodes: async () => {
|
|
487
|
-
await
|
|
486
|
+
await I.getState().fetchData();
|
|
488
487
|
},
|
|
489
488
|
// 1. 통합된 코드 목록 조회 (그룹코드 필수, 옵션으로 필터링)
|
|
490
489
|
getCodeList: (e, s) => {
|
|
@@ -494,108 +493,108 @@ const B = (n) => (r) => {
|
|
|
494
493
|
sortByOrder: a = !1,
|
|
495
494
|
excludeParentCode: d = !1
|
|
496
495
|
} = s || {}, c = `simpleCodeList_${e}_${o}_${t}_${a}_${d}`;
|
|
497
|
-
if (
|
|
498
|
-
const
|
|
499
|
-
return
|
|
496
|
+
if (l.optionCache.has(c)) {
|
|
497
|
+
const C = l.cacheHits.get(c) || 0;
|
|
498
|
+
return l.cacheHits.set(c, C + 1), l.optionCache.get(c);
|
|
500
499
|
}
|
|
501
|
-
const i =
|
|
500
|
+
const i = I.getState().codeData;
|
|
502
501
|
if (!i) return [];
|
|
503
|
-
if (!
|
|
502
|
+
if (!l.isGroupLoaded(e) && !i[e])
|
|
504
503
|
return console.warn(`그룹 ${e}가 아직 로드되지 않았습니다.`), [];
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
if (!(o && !
|
|
504
|
+
const p = [], f = i[e];
|
|
505
|
+
f && Object.values(f).forEach((C) => {
|
|
506
|
+
if (!(o && !C.enabled) && !(t && C.systemCodeYn !== "Y"))
|
|
508
507
|
if (d) {
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
...
|
|
512
|
-
codeValue:
|
|
508
|
+
const h = e.length, N = C.codeValue.substring(h);
|
|
509
|
+
N.length > 0 && p.push({
|
|
510
|
+
...C,
|
|
511
|
+
codeValue: N
|
|
513
512
|
// 자식코드만 사용
|
|
514
513
|
});
|
|
515
514
|
} else
|
|
516
|
-
|
|
515
|
+
p.push(C);
|
|
517
516
|
});
|
|
518
517
|
let m;
|
|
519
|
-
a ? m =
|
|
520
|
-
(
|
|
518
|
+
a ? m = p.sort((C, h) => C.sortOrder !== h.sortOrder ? C.sortOrder - h.sortOrder : C.codeValue.localeCompare(h.codeValue)) : m = p.sort(
|
|
519
|
+
(C, h) => C.codeValue.localeCompare(h.codeValue)
|
|
521
520
|
);
|
|
522
|
-
const u = m.map((
|
|
523
|
-
label:
|
|
524
|
-
value:
|
|
525
|
-
tagColor:
|
|
521
|
+
const u = m.map((C) => ({
|
|
522
|
+
label: C.codeNm,
|
|
523
|
+
value: C.codeValue,
|
|
524
|
+
tagColor: C.labelColor
|
|
526
525
|
}));
|
|
527
|
-
return
|
|
526
|
+
return l.optionCache.size >= A.CACHE_SIZE_LIMIT && l.cleanupCache(), l.optionCache.set(c, u), l.cacheHits.set(c, 1), u;
|
|
528
527
|
},
|
|
529
528
|
// 2. 코드를 던졌을 때 코드명을 리턴 (대규모 최적화)
|
|
530
529
|
getCodeName: (e) => {
|
|
531
|
-
if (
|
|
532
|
-
const o =
|
|
533
|
-
return
|
|
530
|
+
if (l.nameCache.has(e)) {
|
|
531
|
+
const o = l.cacheHits.get(`name_${e}`) || 0;
|
|
532
|
+
return l.cacheHits.set(`name_${e}`, o + 1), l.nameCache.get(e);
|
|
534
533
|
}
|
|
535
|
-
const s =
|
|
534
|
+
const s = I.getState().codeData;
|
|
536
535
|
if (!s) return null;
|
|
537
536
|
for (const o of Object.values(s))
|
|
538
537
|
for (const t of Object.values(o))
|
|
539
538
|
if (t.codeValue === e)
|
|
540
|
-
return
|
|
539
|
+
return l.nameCache.set(e, t.codeNm), l.cacheHits.set(`name_${e}`, 1), t.codeNm;
|
|
541
540
|
return null;
|
|
542
541
|
},
|
|
543
542
|
// 3. 코드를 던졌을 때 라벨 컬러를 리턴 (대규모 최적화)
|
|
544
543
|
getCodeColor: (e) => {
|
|
545
|
-
if (
|
|
546
|
-
const o =
|
|
547
|
-
return
|
|
544
|
+
if (l.colorCache.has(e)) {
|
|
545
|
+
const o = l.cacheHits.get(`color_${e}`) || 0;
|
|
546
|
+
return l.cacheHits.set(`color_${e}`, o + 1), l.colorCache.get(e);
|
|
548
547
|
}
|
|
549
|
-
const s =
|
|
548
|
+
const s = I.getState().codeData;
|
|
550
549
|
if (!s) return null;
|
|
551
550
|
for (const o of Object.values(s))
|
|
552
551
|
for (const t of Object.values(o))
|
|
553
552
|
if (t.codeValue === e)
|
|
554
|
-
return
|
|
553
|
+
return l.colorCache.set(
|
|
555
554
|
e,
|
|
556
555
|
t.labelColor || ""
|
|
557
|
-
),
|
|
556
|
+
), l.cacheHits.set(`color_${e}`, 1), t.labelColor;
|
|
558
557
|
return null;
|
|
559
558
|
},
|
|
560
559
|
// 4. 그리드 lookup용 데이터 반환 (labels, values 배열, lookupDisplay 포함)
|
|
561
560
|
getGridLookup: (e) => {
|
|
562
561
|
const s = `gridLookup_${e}`;
|
|
563
|
-
if (
|
|
564
|
-
const i =
|
|
565
|
-
return
|
|
562
|
+
if (l.optionCache.has(s)) {
|
|
563
|
+
const i = l.cacheHits.get(s) || 0;
|
|
564
|
+
return l.cacheHits.set(s, i + 1), l.optionCache.get(s);
|
|
566
565
|
}
|
|
567
|
-
const o =
|
|
566
|
+
const o = I.getState().codeData;
|
|
568
567
|
if (!o) return { labels: [], values: [], lookupDisplay: !0 };
|
|
569
568
|
const t = o[e];
|
|
570
569
|
if (!t) return { labels: [], values: [], lookupDisplay: !0 };
|
|
571
570
|
const a = [], d = [];
|
|
572
|
-
Object.values(t).filter((i) => i.enabled).sort((i,
|
|
571
|
+
Object.values(t).filter((i) => i.enabled).sort((i, p) => i.sortOrder - p.sortOrder).forEach((i) => {
|
|
573
572
|
a.push(i.codeNm), d.push(i.codeValue);
|
|
574
573
|
});
|
|
575
574
|
const c = { labels: a, values: d, lookupDisplay: !0 };
|
|
576
|
-
return
|
|
575
|
+
return l.optionCache.set(s, c), l.cacheHits.set(s, 1), c;
|
|
577
576
|
},
|
|
578
577
|
// 3. 옵션값으로 코드를 조회하는 새로운 메서드
|
|
579
578
|
getCodeByOption: (e, s, o) => {
|
|
580
579
|
const t = `codeByOption_${e}_${s}_${o}`;
|
|
581
|
-
if (
|
|
582
|
-
const
|
|
583
|
-
return
|
|
580
|
+
if (l.codeCache.has(t)) {
|
|
581
|
+
const p = l.cacheHits.get(t) || 0;
|
|
582
|
+
return l.cacheHits.set(t, p + 1), l.codeCache.get(t);
|
|
584
583
|
}
|
|
585
|
-
const a =
|
|
584
|
+
const a = I.getState().codeData;
|
|
586
585
|
if (!a) return [];
|
|
587
586
|
const d = [], c = a[e];
|
|
588
|
-
c && Object.values(c).forEach((
|
|
589
|
-
|
|
590
|
-
...
|
|
591
|
-
codeNm:
|
|
587
|
+
c && Object.values(c).forEach((p) => {
|
|
588
|
+
p.enabled && p.options && p.options[s] === o && d.push({
|
|
589
|
+
...p,
|
|
590
|
+
codeNm: p.options[s] || p.codeNm
|
|
592
591
|
// 옵션값을 코드명으로 사용
|
|
593
592
|
});
|
|
594
593
|
});
|
|
595
594
|
const i = d.sort(
|
|
596
|
-
(
|
|
595
|
+
(p, f) => p.codeValue.localeCompare(f.codeValue)
|
|
597
596
|
);
|
|
598
|
-
return
|
|
597
|
+
return l.codeCache.size >= A.CACHE_SIZE_LIMIT && l.cleanupCache(), l.codeCache.set(t, i), l.cacheHits.set(t, 1), i;
|
|
599
598
|
},
|
|
600
599
|
// 6. 옵션코드별로 코드 목록 조회 (SimpleCodeItem 형태로 반환)
|
|
601
600
|
getCodeListByOption: (e, s, o) => {
|
|
@@ -604,19 +603,19 @@ const B = (n) => (r) => {
|
|
|
604
603
|
systemCodeOnly: a = !1,
|
|
605
604
|
sortByOrder: d = !1
|
|
606
605
|
} = o || {}, c = `codeListByOption_${e}_${s}_${t}_${a}_${d}`;
|
|
607
|
-
if (
|
|
608
|
-
const u =
|
|
609
|
-
return
|
|
606
|
+
if (l.codeCache.has(c)) {
|
|
607
|
+
const u = l.cacheHits.get(c) || 0;
|
|
608
|
+
return l.cacheHits.set(c, u + 1), l.codeCache.get(
|
|
610
609
|
c
|
|
611
610
|
);
|
|
612
611
|
}
|
|
613
|
-
const i =
|
|
612
|
+
const i = I.getState().codeData;
|
|
614
613
|
if (!i) return [];
|
|
615
|
-
if (!
|
|
614
|
+
if (!l.isGroupLoaded(e) && !i[e])
|
|
616
615
|
return console.warn(`그룹 ${e}가 아직 로드되지 않았습니다.`), [];
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
t && !u.enabled || a && u.systemCodeYn !== "Y" || u.options && u.options[s] &&
|
|
616
|
+
const p = [], f = i[e];
|
|
617
|
+
f && Object.values(f).forEach((u) => {
|
|
618
|
+
t && !u.enabled || a && u.systemCodeYn !== "Y" || u.options && u.options[s] && p.push({
|
|
620
619
|
label: u.options[s],
|
|
621
620
|
// optnNm 값
|
|
622
621
|
value: u.commonCode,
|
|
@@ -626,28 +625,28 @@ const B = (n) => (r) => {
|
|
|
626
625
|
});
|
|
627
626
|
});
|
|
628
627
|
let m;
|
|
629
|
-
return d ? m =
|
|
630
|
-
(u,
|
|
631
|
-
),
|
|
628
|
+
return d ? m = p.sort((u, C) => u.value.localeCompare(C.value)) : m = p.sort(
|
|
629
|
+
(u, C) => u.value.localeCompare(C.value)
|
|
630
|
+
), l.codeCache.size >= A.CACHE_SIZE_LIMIT && l.cleanupCache(), l.codeCache.set(c, m), l.cacheHits.set(c, 1), m;
|
|
632
631
|
},
|
|
633
632
|
// 7. 그룹코드 목록 조회
|
|
634
633
|
getAvailableGroupCodes: () => {
|
|
635
634
|
const e = "available_group_codes";
|
|
636
|
-
if (
|
|
637
|
-
const t =
|
|
638
|
-
return
|
|
635
|
+
if (l.nameCache.has(e)) {
|
|
636
|
+
const t = l.cacheHits.get(e) || 0;
|
|
637
|
+
return l.cacheHits.set(e, t + 1), JSON.parse(l.nameCache.get(e));
|
|
639
638
|
}
|
|
640
|
-
const s =
|
|
639
|
+
const s = I.getState().codeData;
|
|
641
640
|
if (!s) return [];
|
|
642
641
|
const o = Object.keys(s).sort();
|
|
643
|
-
return
|
|
642
|
+
return l.nameCache.set(
|
|
644
643
|
e,
|
|
645
644
|
JSON.stringify(o)
|
|
646
|
-
),
|
|
645
|
+
), l.cacheHits.set(e, 1), o;
|
|
647
646
|
},
|
|
648
647
|
// 공통코드 초기화
|
|
649
648
|
clearCodes: () => {
|
|
650
|
-
|
|
649
|
+
I.getState().clearData();
|
|
651
650
|
}
|
|
652
651
|
}),
|
|
653
652
|
{
|
|
@@ -657,55 +656,55 @@ const B = (n) => (r) => {
|
|
|
657
656
|
})
|
|
658
657
|
}
|
|
659
658
|
)
|
|
660
|
-
),
|
|
661
|
-
|
|
659
|
+
), Le = b()(
|
|
660
|
+
k(
|
|
662
661
|
(n, r) => ({
|
|
663
662
|
// 공통 데이터 스토어에서 상태 가져오기
|
|
664
663
|
get codeData() {
|
|
665
|
-
return
|
|
664
|
+
return I.getState().codeData;
|
|
666
665
|
},
|
|
667
666
|
get isLoading() {
|
|
668
|
-
return
|
|
667
|
+
return I.getState().isLoading;
|
|
669
668
|
},
|
|
670
669
|
get error() {
|
|
671
|
-
return
|
|
670
|
+
return I.getState().error;
|
|
672
671
|
},
|
|
673
672
|
get lastUpdated() {
|
|
674
|
-
return
|
|
673
|
+
return I.getState().lastUpdated;
|
|
675
674
|
},
|
|
676
675
|
// 공통코드 가져오기 (중앙 스토어 사용)
|
|
677
676
|
fetchCommonCodes: async () => {
|
|
678
|
-
await
|
|
677
|
+
await I.getState().fetchData();
|
|
679
678
|
},
|
|
680
679
|
// 그룹코드와 옵션코드를 던졌을 때 상세코드의 옵션값을 리턴 (대규모 최적화)
|
|
681
680
|
getOptionValue: (e, s) => {
|
|
682
681
|
const o = `option_${e}_${s}`;
|
|
683
|
-
if (
|
|
684
|
-
const d =
|
|
685
|
-
return
|
|
682
|
+
if (l.optionCache.has(o)) {
|
|
683
|
+
const d = l.cacheHits.get(o) || 0;
|
|
684
|
+
return l.cacheHits.set(o, d + 1), l.optionCache.get(o);
|
|
686
685
|
}
|
|
687
|
-
const t =
|
|
686
|
+
const t = I.getState().codeData;
|
|
688
687
|
if (!t) return null;
|
|
689
688
|
const a = t[e];
|
|
690
689
|
if (a && a[s]) {
|
|
691
690
|
const d = a[s].options;
|
|
692
|
-
return
|
|
691
|
+
return l.optionCache.set(o, d), l.cacheHits.set(o, 1), d;
|
|
693
692
|
}
|
|
694
693
|
return null;
|
|
695
694
|
},
|
|
696
695
|
// 특정 옵션 키의 값 가져오기 (대규모 최적화)
|
|
697
696
|
getOptionByKey: (e, s, o) => {
|
|
698
697
|
const t = `option_${e}_${s}_${o}`;
|
|
699
|
-
if (
|
|
700
|
-
const c =
|
|
701
|
-
return
|
|
698
|
+
if (l.optionCache.has(t)) {
|
|
699
|
+
const c = l.cacheHits.get(t) || 0;
|
|
700
|
+
return l.cacheHits.set(t, c + 1), l.optionCache.get(t);
|
|
702
701
|
}
|
|
703
702
|
const a = r().getOptionValue(e, s), d = a ? a[o] : null;
|
|
704
|
-
return
|
|
703
|
+
return l.optionCache.set(t, d), l.cacheHits.set(t, 1), d;
|
|
705
704
|
},
|
|
706
705
|
// 공통코드 초기화
|
|
707
706
|
clearCodes: () => {
|
|
708
|
-
|
|
707
|
+
I.getState().clearData();
|
|
709
708
|
}
|
|
710
709
|
}),
|
|
711
710
|
{
|
|
@@ -715,51 +714,51 @@ const B = (n) => (r) => {
|
|
|
715
714
|
})
|
|
716
715
|
}
|
|
717
716
|
)
|
|
718
|
-
),
|
|
719
|
-
|
|
717
|
+
), Pe = b()(
|
|
718
|
+
k(
|
|
720
719
|
(n, r) => ({
|
|
721
720
|
// 공통 데이터 스토어에서 상태 가져오기
|
|
722
721
|
get codeData() {
|
|
723
|
-
return
|
|
722
|
+
return I.getState().codeData;
|
|
724
723
|
},
|
|
725
724
|
get isLoading() {
|
|
726
|
-
return
|
|
725
|
+
return I.getState().isLoading;
|
|
727
726
|
},
|
|
728
727
|
get error() {
|
|
729
|
-
return
|
|
728
|
+
return I.getState().error;
|
|
730
729
|
},
|
|
731
730
|
get lastUpdated() {
|
|
732
|
-
return
|
|
731
|
+
return I.getState().lastUpdated;
|
|
733
732
|
},
|
|
734
733
|
// 공통코드 가져오기 (중앙 스토어 사용)
|
|
735
734
|
fetchCommonCodes: async () => {
|
|
736
|
-
await
|
|
735
|
+
await I.getState().fetchData();
|
|
737
736
|
},
|
|
738
737
|
// 코드를 던졌을 때 컬러코드를 리턴 (대규모 최적화)
|
|
739
738
|
getColorCode: (e) => {
|
|
740
|
-
if (
|
|
741
|
-
const o =
|
|
742
|
-
return
|
|
739
|
+
if (l.colorCache.has(e)) {
|
|
740
|
+
const o = l.cacheHits.get(`color_${e}`) || 0;
|
|
741
|
+
return l.cacheHits.set(`color_${e}`, o + 1), l.colorCache.get(e);
|
|
743
742
|
}
|
|
744
|
-
const s =
|
|
743
|
+
const s = I.getState().codeData;
|
|
745
744
|
if (!s) return null;
|
|
746
745
|
for (const o of Object.values(s))
|
|
747
746
|
for (const t of Object.values(o))
|
|
748
747
|
if (t.codeValue === e)
|
|
749
|
-
return
|
|
748
|
+
return l.colorCache.set(
|
|
750
749
|
e,
|
|
751
750
|
t.labelColor || ""
|
|
752
|
-
),
|
|
751
|
+
), l.cacheHits.set(`color_${e}`, 1), t.labelColor;
|
|
753
752
|
return null;
|
|
754
753
|
},
|
|
755
754
|
// 코드/컬러 매핑 배열 가져오기 (대규모 최적화)
|
|
756
755
|
getColorMapping: () => {
|
|
757
756
|
const e = "color_mapping";
|
|
758
|
-
if (
|
|
759
|
-
const t =
|
|
760
|
-
return
|
|
757
|
+
if (l.optionCache.has(e)) {
|
|
758
|
+
const t = l.cacheHits.get(e) || 0;
|
|
759
|
+
return l.cacheHits.set(e, t + 1), l.optionCache.get(e);
|
|
761
760
|
}
|
|
762
|
-
const s =
|
|
761
|
+
const s = I.getState().codeData;
|
|
763
762
|
if (!s) return [];
|
|
764
763
|
const o = [];
|
|
765
764
|
return Object.values(s).forEach((t) => {
|
|
@@ -769,11 +768,11 @@ const B = (n) => (r) => {
|
|
|
769
768
|
color: a.labelColor
|
|
770
769
|
});
|
|
771
770
|
});
|
|
772
|
-
}),
|
|
771
|
+
}), l.optionCache.set(e, o), l.cacheHits.set(e, 1), o;
|
|
773
772
|
},
|
|
774
773
|
// 공통코드 초기화
|
|
775
774
|
clearCodes: () => {
|
|
776
|
-
|
|
775
|
+
I.getState().clearData();
|
|
777
776
|
}
|
|
778
777
|
}),
|
|
779
778
|
{
|
|
@@ -795,11 +794,11 @@ const B = (n) => (r) => {
|
|
|
795
794
|
(s) => s.type === "M" && s.menuId === e
|
|
796
795
|
),
|
|
797
796
|
getPrntBkmkIdByMenuId: (e) => {
|
|
798
|
-
const s =
|
|
797
|
+
const s = O(r().nodes, e);
|
|
799
798
|
return s ? r().nodes[s]?.prntBkmkId ?? "-" : "-";
|
|
800
799
|
},
|
|
801
800
|
getNodeByMenuId: (e) => {
|
|
802
|
-
const s =
|
|
801
|
+
const s = O(r().nodes, e);
|
|
803
802
|
if (!s) return null;
|
|
804
803
|
const o = r().nodes[s];
|
|
805
804
|
return o?.type === "M" ? o : null;
|
|
@@ -808,11 +807,11 @@ const B = (n) => (r) => {
|
|
|
808
807
|
const { nodes: s, rootIds: o } = r(), t = (d) => e ? d.toLowerCase().includes(e.toLowerCase()) : !0, a = (d) => {
|
|
809
808
|
const c = s[d];
|
|
810
809
|
if (!c || c.type !== "F") return null;
|
|
811
|
-
const i = c,
|
|
812
|
-
return t(i.bkmkNm) ||
|
|
810
|
+
const i = c, p = (i.children || []).map((m) => s[m]).filter((m) => !!m && m.type === "F").map((m) => a(m.bkmkId)).filter(Boolean);
|
|
811
|
+
return t(i.bkmkNm) || p.length > 0 ? {
|
|
813
812
|
key: i.bkmkId,
|
|
814
813
|
title: `📁 ${i.bkmkNm}`,
|
|
815
|
-
children:
|
|
814
|
+
children: p.length ? p : void 0
|
|
816
815
|
} : null;
|
|
817
816
|
};
|
|
818
817
|
return o.map((d) => a(d)).filter(Boolean);
|
|
@@ -824,7 +823,7 @@ const B = (n) => (r) => {
|
|
|
824
823
|
if (!(!s && o.loadedFor === e && Object.keys(o.nodes).length)) {
|
|
825
824
|
n({ loading: !0, error: void 0 });
|
|
826
825
|
try {
|
|
827
|
-
const t = await
|
|
826
|
+
const t = await S("SCMBKMK00101", { userId: e }), a = Array.isArray(t?.sub) ? t.sub : [], d = pe(a), c = P(
|
|
828
827
|
d.nodes,
|
|
829
828
|
d.rootIds
|
|
830
829
|
);
|
|
@@ -855,9 +854,9 @@ const B = (n) => (r) => {
|
|
|
855
854
|
},
|
|
856
855
|
// ====== 공통: 생성 ======
|
|
857
856
|
addNode: async (e) => {
|
|
858
|
-
const s =
|
|
857
|
+
const s = E(r()), o = le();
|
|
859
858
|
n((t) => {
|
|
860
|
-
const a = e.sortOrdr ??
|
|
859
|
+
const a = e.sortOrdr ?? z(t, e.prntBkmkId), d = {
|
|
861
860
|
...t,
|
|
862
861
|
nodes: {
|
|
863
862
|
...t.nodes,
|
|
@@ -884,11 +883,11 @@ const B = (n) => (r) => {
|
|
|
884
883
|
rootIds: t.rootIds.slice(),
|
|
885
884
|
treeNodes: t.treeNodes
|
|
886
885
|
};
|
|
887
|
-
return ie(d, o, e.prntBkmkId), d.treeNodes =
|
|
886
|
+
return ie(d, o, e.prntBkmkId), d.treeNodes = P(d.nodes, d.rootIds), d;
|
|
888
887
|
});
|
|
889
888
|
try {
|
|
890
889
|
let t = o;
|
|
891
|
-
const a =
|
|
890
|
+
const a = z(r(), e.prntBkmkId), d = await S("SCMBKMK00102", {
|
|
892
891
|
iudFlag: "I",
|
|
893
892
|
type: e.type,
|
|
894
893
|
sysCd: e.sysCd,
|
|
@@ -905,7 +904,7 @@ const B = (n) => (r) => {
|
|
|
905
904
|
const i = me(c, o, t);
|
|
906
905
|
return {
|
|
907
906
|
...i,
|
|
908
|
-
treeNodes:
|
|
907
|
+
treeNodes: P(i.nodes, i.rootIds)
|
|
909
908
|
};
|
|
910
909
|
}), t;
|
|
911
910
|
} catch (t) {
|
|
@@ -921,19 +920,19 @@ const B = (n) => (r) => {
|
|
|
921
920
|
if (!u || u.type !== "F")
|
|
922
921
|
throw new Error("부모는 폴더만 가능합니다.");
|
|
923
922
|
}
|
|
924
|
-
const
|
|
923
|
+
const p = i.prntBkmkId ?? "-", f = p === "-" ? c : d[p].children ||= [];
|
|
925
924
|
{
|
|
926
|
-
const u =
|
|
927
|
-
u >= 0 &&
|
|
925
|
+
const u = f.indexOf(e);
|
|
926
|
+
u >= 0 && f.splice(u, 1);
|
|
928
927
|
}
|
|
929
928
|
const m = s === "-" ? c : d[s].children ||= [];
|
|
930
929
|
m.splice(
|
|
931
930
|
Math.max(0, Math.min(o, m.length)),
|
|
932
931
|
0,
|
|
933
932
|
e
|
|
934
|
-
), i.prntBkmkId = s, n({ nodes: d, rootIds: c }),
|
|
933
|
+
), i.prntBkmkId = s, n({ nodes: d, rootIds: c }), Y(d, c, s), Y(d, c, p);
|
|
935
934
|
try {
|
|
936
|
-
await
|
|
935
|
+
await S("SCMBKMK00104", {
|
|
937
936
|
// 백엔드 명칭 호환
|
|
938
937
|
bkmkId: e,
|
|
939
938
|
prntBkmkId: s,
|
|
@@ -946,7 +945,7 @@ const B = (n) => (r) => {
|
|
|
946
945
|
},
|
|
947
946
|
// ====== 공통: 삭제 ======
|
|
948
947
|
removeNode: async (e) => {
|
|
949
|
-
const s =
|
|
948
|
+
const s = E(r());
|
|
950
949
|
n((o) => {
|
|
951
950
|
if (!o.nodes[e]) return o;
|
|
952
951
|
const t = {
|
|
@@ -955,26 +954,26 @@ const B = (n) => (r) => {
|
|
|
955
954
|
rootIds: o.rootIds.slice(),
|
|
956
955
|
treeNodes: o.treeNodes
|
|
957
956
|
};
|
|
958
|
-
return
|
|
957
|
+
return Z(t, e), t.treeNodes = P(t.nodes, t.rootIds), t;
|
|
959
958
|
});
|
|
960
959
|
try {
|
|
961
|
-
await
|
|
960
|
+
await S("SCMBKMK00103", { bkmkId: e });
|
|
962
961
|
} catch (o) {
|
|
963
962
|
throw n(s), o;
|
|
964
963
|
}
|
|
965
964
|
},
|
|
966
965
|
// ====== 공통: 수정 ======
|
|
967
966
|
editNode: async ({ bkmkId: e, userId: s, bkmkNm: o, prntBkmkId: t, sortOrdr: a }) => {
|
|
968
|
-
const d =
|
|
967
|
+
const d = E(r());
|
|
969
968
|
n((c) => {
|
|
970
|
-
const i = { ...c, nodes: { ...c.nodes } },
|
|
971
|
-
return
|
|
972
|
-
...
|
|
969
|
+
const i = { ...c, nodes: { ...c.nodes } }, p = i.nodes[e];
|
|
970
|
+
return p?.type === "F" && typeof o == "string" && (i.nodes[e] = {
|
|
971
|
+
...p,
|
|
973
972
|
bkmkNm: o
|
|
974
973
|
}), i;
|
|
975
974
|
});
|
|
976
975
|
try {
|
|
977
|
-
await
|
|
976
|
+
await S("SCMBKMK00102", {
|
|
978
977
|
iudFlag: "U",
|
|
979
978
|
userId: s,
|
|
980
979
|
bkmkId: e,
|
|
@@ -995,7 +994,7 @@ const B = (n) => (r) => {
|
|
|
995
994
|
sysCd: o,
|
|
996
995
|
userId: t
|
|
997
996
|
}),
|
|
998
|
-
addMenuToFolder: async (e, s) =>
|
|
997
|
+
addMenuToFolder: async (e, s) => O(r().nodes, s.menuId) ? "이미 북마크에 저장된 메뉴입니다." : await r().addNode({
|
|
999
998
|
type: "M",
|
|
1000
999
|
prntBkmkId: e,
|
|
1001
1000
|
sysCd: "KH",
|
|
@@ -1012,8 +1011,8 @@ const B = (n) => (r) => {
|
|
|
1012
1011
|
await r().removeNode(t.bkmkId);
|
|
1013
1012
|
return;
|
|
1014
1013
|
}
|
|
1015
|
-
let a =
|
|
1016
|
-
a || (await r().loadFavorites(e, !0), a =
|
|
1014
|
+
let a = j(o);
|
|
1015
|
+
a || (await r().loadFavorites(e, !0), a = j(r())), a && await r().addNode({
|
|
1017
1016
|
type: "M",
|
|
1018
1017
|
prntBkmkId: a,
|
|
1019
1018
|
sysCd: "KH",
|
|
@@ -1023,7 +1022,7 @@ const B = (n) => (r) => {
|
|
|
1023
1022
|
});
|
|
1024
1023
|
},
|
|
1025
1024
|
removeMenuByMenuId: async (e) => {
|
|
1026
|
-
const s = r(), o =
|
|
1025
|
+
const s = r(), o = O(s.nodes, e);
|
|
1027
1026
|
o && await r().removeNode(o);
|
|
1028
1027
|
},
|
|
1029
1028
|
removeMenu: async (e) => {
|
|
@@ -1047,33 +1046,33 @@ const B = (n) => (r) => {
|
|
|
1047
1046
|
const i = e[c];
|
|
1048
1047
|
if (!i || t && i.type !== "F") return null;
|
|
1049
1048
|
if (i.type === "F") {
|
|
1050
|
-
const
|
|
1051
|
-
return a(
|
|
1052
|
-
key:
|
|
1049
|
+
const p = i, f = (p.children || []).map((u) => d(u)).filter(Boolean);
|
|
1050
|
+
return a(p.bkmkNm) || f.length > 0 ? {
|
|
1051
|
+
key: p.bkmkId,
|
|
1053
1052
|
type: "F",
|
|
1054
|
-
title: `📁 ${
|
|
1055
|
-
bkmkNm:
|
|
1056
|
-
prntBkmkId:
|
|
1057
|
-
sortOrdr:
|
|
1058
|
-
fullPath:
|
|
1059
|
-
children:
|
|
1053
|
+
title: `📁 ${p.bkmkNm}`,
|
|
1054
|
+
bkmkNm: p.bkmkNm,
|
|
1055
|
+
prntBkmkId: p.prntBkmkId,
|
|
1056
|
+
sortOrdr: p.sortOrdr,
|
|
1057
|
+
fullPath: p.fullPath,
|
|
1058
|
+
children: f.length ? f : void 0
|
|
1060
1059
|
} : null;
|
|
1061
1060
|
} else {
|
|
1062
|
-
const
|
|
1063
|
-
return a(
|
|
1064
|
-
key:
|
|
1061
|
+
const p = i, f = p.menuNm ? `${p.menuNm} (${p.menuId})` : p.menuId;
|
|
1062
|
+
return a(f) ? {
|
|
1063
|
+
key: p.bkmkId,
|
|
1065
1064
|
type: "M",
|
|
1066
|
-
title: `📄 ${
|
|
1067
|
-
prntBkmkId:
|
|
1068
|
-
sortOrdr:
|
|
1069
|
-
fullPath:
|
|
1065
|
+
title: `📄 ${f}`,
|
|
1066
|
+
prntBkmkId: p.prntBkmkId,
|
|
1067
|
+
sortOrdr: p.sortOrdr,
|
|
1068
|
+
fullPath: p.fullPath,
|
|
1070
1069
|
isLeaf: !0
|
|
1071
1070
|
} : null;
|
|
1072
1071
|
}
|
|
1073
1072
|
};
|
|
1074
1073
|
return s.map(d).filter(Boolean);
|
|
1075
1074
|
}
|
|
1076
|
-
}),
|
|
1075
|
+
}), J = b(ce);
|
|
1077
1076
|
function pe(n) {
|
|
1078
1077
|
const r = {}, e = [], s = (o) => {
|
|
1079
1078
|
o.forEach((t) => {
|
|
@@ -1113,7 +1112,7 @@ function pe(n) {
|
|
|
1113
1112
|
);
|
|
1114
1113
|
}), { nodes: r, rootIds: e };
|
|
1115
1114
|
}
|
|
1116
|
-
function
|
|
1115
|
+
function E(n) {
|
|
1117
1116
|
return {
|
|
1118
1117
|
...n,
|
|
1119
1118
|
nodes: JSON.parse(JSON.stringify(n.nodes)),
|
|
@@ -1123,7 +1122,7 @@ function _(n) {
|
|
|
1123
1122
|
function le() {
|
|
1124
1123
|
return `tmp_${Math.random().toString(36).slice(2, 10)}`;
|
|
1125
1124
|
}
|
|
1126
|
-
function
|
|
1125
|
+
function z(n, r) {
|
|
1127
1126
|
if (!r || r === "-") return n.rootIds.length;
|
|
1128
1127
|
const e = n.nodes[r];
|
|
1129
1128
|
return e ? e.children.length : 0;
|
|
@@ -1148,10 +1147,10 @@ function ue(n, r) {
|
|
|
1148
1147
|
} else
|
|
1149
1148
|
n.rootIds = n.rootIds.filter((o) => o !== r);
|
|
1150
1149
|
}
|
|
1151
|
-
function
|
|
1150
|
+
function Z(n, r) {
|
|
1152
1151
|
const e = n.nodes[r];
|
|
1153
1152
|
if (!e) return;
|
|
1154
|
-
e.type === "F" && e.children.slice().forEach((a) =>
|
|
1153
|
+
e.type === "F" && e.children.slice().forEach((a) => Z(n, a)), ue(n, r);
|
|
1155
1154
|
const { [r]: s, ...o } = n.nodes;
|
|
1156
1155
|
n.nodes = o;
|
|
1157
1156
|
}
|
|
@@ -1174,14 +1173,14 @@ function me(n, r, e) {
|
|
|
1174
1173
|
a = n.rootIds.map((d) => d === r ? e : d);
|
|
1175
1174
|
return { ...n, nodes: t, rootIds: a };
|
|
1176
1175
|
}
|
|
1177
|
-
function
|
|
1176
|
+
function j(n) {
|
|
1178
1177
|
return n.rootIds.find((r) => n.nodes[r]?.type === "F") ?? null;
|
|
1179
1178
|
}
|
|
1180
|
-
function
|
|
1179
|
+
function P(n, r) {
|
|
1181
1180
|
const e = {};
|
|
1182
1181
|
Object.values(n).forEach((c) => {
|
|
1183
|
-
const i = c.bkmkId,
|
|
1184
|
-
!i || !
|
|
1182
|
+
const i = c.bkmkId, p = c.prntBkmkId;
|
|
1183
|
+
!i || !p || p === "-" || p === i || (e[p] ??= []).push(i);
|
|
1185
1184
|
});
|
|
1186
1185
|
const s = /* @__PURE__ */ new Set(), o = (c) => {
|
|
1187
1186
|
if (s.has(c)) return null;
|
|
@@ -1190,23 +1189,23 @@ function L(n, r) {
|
|
|
1190
1189
|
s.add(c);
|
|
1191
1190
|
try {
|
|
1192
1191
|
if (i.type === "F") {
|
|
1193
|
-
const
|
|
1192
|
+
const f = i, m = e[c] ?? [];
|
|
1194
1193
|
return {
|
|
1195
1194
|
type: "F",
|
|
1196
1195
|
bkmkId: c,
|
|
1197
|
-
bkmkNm:
|
|
1198
|
-
prntBkmkId:
|
|
1196
|
+
bkmkNm: f.bkmkNm,
|
|
1197
|
+
prntBkmkId: f.prntBkmkId,
|
|
1199
1198
|
children: m.map(o).filter(Boolean)
|
|
1200
1199
|
};
|
|
1201
1200
|
}
|
|
1202
|
-
const
|
|
1201
|
+
const p = i;
|
|
1203
1202
|
return {
|
|
1204
1203
|
type: "M",
|
|
1205
1204
|
bkmkId: c,
|
|
1206
|
-
bkmkNm:
|
|
1207
|
-
menuId:
|
|
1208
|
-
menuNm:
|
|
1209
|
-
prntBkmkId:
|
|
1205
|
+
bkmkNm: p.menuNm,
|
|
1206
|
+
menuId: p.menuId,
|
|
1207
|
+
menuNm: p.menuNm,
|
|
1208
|
+
prntBkmkId: p.prntBkmkId
|
|
1210
1209
|
};
|
|
1211
1210
|
} finally {
|
|
1212
1211
|
s.delete(c);
|
|
@@ -1216,33 +1215,33 @@ function L(n, r) {
|
|
|
1216
1215
|
/* @__PURE__ */ new Set([...r, ...t, ...a])
|
|
1217
1216
|
).map(o).filter(Boolean);
|
|
1218
1217
|
}
|
|
1219
|
-
function
|
|
1218
|
+
function O(n, r) {
|
|
1220
1219
|
for (const e of Object.values(n))
|
|
1221
1220
|
if (e.type === "M" && e.menuId === r) return e.bkmkId;
|
|
1222
1221
|
return null;
|
|
1223
1222
|
}
|
|
1224
|
-
function
|
|
1223
|
+
function Y(n, r, e) {
|
|
1225
1224
|
(!e || e === "-" ? r : n[e].children || []).forEach((o, t) => {
|
|
1226
1225
|
const a = n[o];
|
|
1227
1226
|
a && (a.sortOrdr = t);
|
|
1228
1227
|
});
|
|
1229
1228
|
}
|
|
1230
|
-
const
|
|
1229
|
+
const R = {
|
|
1231
1230
|
DEFAULT_PRNT_GBCD: 1
|
|
1232
|
-
}, Ce = (n) => n && typeof n == "object" && typeof n.menuId == "string" && typeof n.menuNm == "string",
|
|
1233
|
-
let
|
|
1231
|
+
}, Ce = (n) => n && typeof n == "object" && typeof n.menuId == "string" && typeof n.menuNm == "string", W = (n) => Array.isArray(n) && n.every(Ce);
|
|
1232
|
+
let K = [], q = [];
|
|
1234
1233
|
const fe = (n) => {
|
|
1235
1234
|
if (n && typeof n == "object") {
|
|
1236
1235
|
const r = n;
|
|
1237
|
-
if (r.menus &&
|
|
1238
|
-
if (
|
|
1236
|
+
if (r.menus && W(r.menus)) return r.menus;
|
|
1237
|
+
if (W(n)) return n;
|
|
1239
1238
|
}
|
|
1240
1239
|
return console.warn("⚠️ 메뉴 응답이 비어있거나 예상과 다릅니다."), [];
|
|
1241
|
-
}, he = (n, r) => !!r && n.crprCd === r.crprCd && n.userId === r.userId && (n.prntGbcd ??
|
|
1242
|
-
if (
|
|
1240
|
+
}, he = (n, r) => !!r && n.crprCd === r.crprCd && n.userId === r.userId && (n.prntGbcd ?? R.DEFAULT_PRNT_GBCD) === (r.prntGbcd ?? R.DEFAULT_PRNT_GBCD), Ie = (n) => {
|
|
1241
|
+
if (K.length === n.length && K.every(
|
|
1243
1242
|
(t, a) => t.menuId === n[a]?.menuId && t.menuPrntId === n[a]?.menuPrntId
|
|
1244
1243
|
))
|
|
1245
|
-
return
|
|
1244
|
+
return q;
|
|
1246
1245
|
if (!n.length) return [];
|
|
1247
1246
|
const r = /* @__PURE__ */ new Map(), e = [];
|
|
1248
1247
|
n.forEach((t) => t?.menuId && r.set(t.menuId, { ...t, children: [] })), n.forEach((t) => {
|
|
@@ -1253,8 +1252,8 @@ const fe = (n) => {
|
|
|
1253
1252
|
...a,
|
|
1254
1253
|
children: a.children && a.children.length ? s(a.children) : void 0
|
|
1255
1254
|
})), o = s(e);
|
|
1256
|
-
return
|
|
1257
|
-
},
|
|
1255
|
+
return K = [...n], q = o, o;
|
|
1256
|
+
}, $ = b((n, r) => ({
|
|
1258
1257
|
// 📊 초기 상태값
|
|
1259
1258
|
menuList: [],
|
|
1260
1259
|
flatMenuList: [],
|
|
@@ -1267,7 +1266,7 @@ const fe = (n) => {
|
|
|
1267
1266
|
const t = {
|
|
1268
1267
|
crprCd: e,
|
|
1269
1268
|
userId: s,
|
|
1270
|
-
prntGbcd: o ??
|
|
1269
|
+
prntGbcd: o ?? R.DEFAULT_PRNT_GBCD
|
|
1271
1270
|
};
|
|
1272
1271
|
if (he(t, r()._lastFetchParams)) {
|
|
1273
1272
|
console.log("✅ 중복 fetch 차단", t);
|
|
@@ -1275,7 +1274,7 @@ const fe = (n) => {
|
|
|
1275
1274
|
}
|
|
1276
1275
|
n({ isLoading: !0, error: null, _lastFetchParams: t });
|
|
1277
1276
|
try {
|
|
1278
|
-
const a = await
|
|
1277
|
+
const a = await S(_("AUTH_MENU"), t), d = fe(a), c = Ie(d);
|
|
1279
1278
|
n({
|
|
1280
1279
|
flatMenuList: d,
|
|
1281
1280
|
// 평면 리스트 저장
|
|
@@ -1304,16 +1303,16 @@ const fe = (n) => {
|
|
|
1304
1303
|
const { flatMenuList: s } = r();
|
|
1305
1304
|
return s.find((o) => o.menuId === e) ?? null;
|
|
1306
1305
|
}
|
|
1307
|
-
})),
|
|
1306
|
+
})), D = {
|
|
1308
1307
|
MAX_TABS: 15
|
|
1309
|
-
},
|
|
1308
|
+
}, V = b((n, r) => ({
|
|
1310
1309
|
// 📊 초기 상태값
|
|
1311
1310
|
activeMenuId: null,
|
|
1312
1311
|
activeMenuItem: null,
|
|
1313
1312
|
activeDetailItem: null,
|
|
1314
1313
|
tabs: [],
|
|
1315
1314
|
sidebarCollapsed: !1,
|
|
1316
|
-
maxTabs:
|
|
1315
|
+
maxTabs: D.MAX_TABS,
|
|
1317
1316
|
tabProtectFlag: {},
|
|
1318
1317
|
tabParams: {},
|
|
1319
1318
|
componentLabelMap: {},
|
|
@@ -1326,7 +1325,7 @@ const fe = (n) => {
|
|
|
1326
1325
|
activeDetailItem: null,
|
|
1327
1326
|
tabs: [],
|
|
1328
1327
|
sidebarCollapsed: !1,
|
|
1329
|
-
maxTabs:
|
|
1328
|
+
maxTabs: D.MAX_TABS,
|
|
1330
1329
|
tabProtectFlag: {},
|
|
1331
1330
|
tabParams: {},
|
|
1332
1331
|
componentLabelMap: {},
|
|
@@ -1358,9 +1357,9 @@ const fe = (n) => {
|
|
|
1358
1357
|
});
|
|
1359
1358
|
return;
|
|
1360
1359
|
}
|
|
1361
|
-
if (t.length >=
|
|
1362
|
-
console.warn("❌ 최대 탭 개수를 초과했습니다."),
|
|
1363
|
-
`최대 ${
|
|
1360
|
+
if (t.length >= D.MAX_TABS) {
|
|
1361
|
+
console.warn("❌ 최대 탭 개수를 초과했습니다."), B.warning(
|
|
1362
|
+
`최대 ${D.MAX_TABS}개의 탭만 열 수 있습니다.
|
|
1364
1363
|
기존 탭을 닫고 다시 시도해주세요.`
|
|
1365
1364
|
);
|
|
1366
1365
|
return;
|
|
@@ -1384,8 +1383,8 @@ const fe = (n) => {
|
|
|
1384
1383
|
// 🔧 탭 추가 (메뉴 ID로)
|
|
1385
1384
|
// URL 파라미터로 메뉴 열기 시 사용 (예: ?menuId=CM000301)
|
|
1386
1385
|
openTabByMenuId: (e, s, o) => {
|
|
1387
|
-
const t =
|
|
1388
|
-
t ? r().openTabFromMenu(t, s, o) :
|
|
1386
|
+
const t = $.getState().findMenuById(e);
|
|
1387
|
+
t ? r().openTabFromMenu(t, s, o) : B.warning("메뉴 ID를 찾을 수 없습니다.");
|
|
1389
1388
|
},
|
|
1390
1389
|
openDetailView: (e, s, o) => {
|
|
1391
1390
|
const { tabs: t } = r();
|
|
@@ -1520,7 +1519,7 @@ const fe = (n) => {
|
|
|
1520
1519
|
const t = r().pinnedTabs;
|
|
1521
1520
|
s.slice(o + 1).filter((d) => !t.has(d.key)).forEach((d) => r().closeTab(d.key));
|
|
1522
1521
|
}
|
|
1523
|
-
})),
|
|
1522
|
+
})), ye = b((n, r) => ({
|
|
1524
1523
|
popups: [],
|
|
1525
1524
|
activePopupId: null,
|
|
1526
1525
|
isLoading: !1,
|
|
@@ -1531,8 +1530,8 @@ const fe = (n) => {
|
|
|
1531
1530
|
n({ isLoading: !0, error: null });
|
|
1532
1531
|
try {
|
|
1533
1532
|
let t = null;
|
|
1534
|
-
const a = await
|
|
1535
|
-
crprCd:
|
|
1533
|
+
const a = await S(_("SRCH_POPU"), {
|
|
1534
|
+
crprCd: te()?.crprCd,
|
|
1536
1535
|
popuCd: e
|
|
1537
1536
|
});
|
|
1538
1537
|
t = a?.mstr;
|
|
@@ -1541,7 +1540,7 @@ const fe = (n) => {
|
|
|
1541
1540
|
const u = `팝업 정보를 찾을 수 없습니다: ${e}`;
|
|
1542
1541
|
throw console.error(u), new Error(u);
|
|
1543
1542
|
}
|
|
1544
|
-
const i = ((u) => `/src/pages/views/popup/${u}`)(t.popuUrl),
|
|
1543
|
+
const i = ((u) => `/src/pages/views/popup/${u}`)(t.popuUrl), p = r().zIndexSeed + 1, f = {
|
|
1545
1544
|
popupId: `popup_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
1546
1545
|
popupCode: e,
|
|
1547
1546
|
//config.title을 통해 팝업 제목 변경 가능
|
|
@@ -1555,7 +1554,7 @@ const fe = (n) => {
|
|
|
1555
1554
|
buttonList: d,
|
|
1556
1555
|
// 버튼 목록 추가
|
|
1557
1556
|
config: o,
|
|
1558
|
-
zIndex:
|
|
1557
|
+
zIndex: p
|
|
1559
1558
|
}, m = r().popups.find((u) => u.popupCode === e);
|
|
1560
1559
|
if (m) {
|
|
1561
1560
|
n({
|
|
@@ -1568,10 +1567,10 @@ const fe = (n) => {
|
|
|
1568
1567
|
return;
|
|
1569
1568
|
}
|
|
1570
1569
|
n((u) => ({
|
|
1571
|
-
popups: [...u.popups,
|
|
1572
|
-
activePopupId:
|
|
1570
|
+
popups: [...u.popups, f],
|
|
1571
|
+
activePopupId: f.popupId,
|
|
1573
1572
|
isLoading: !1,
|
|
1574
|
-
zIndexSeed:
|
|
1573
|
+
zIndexSeed: p
|
|
1575
1574
|
}));
|
|
1576
1575
|
} catch (t) {
|
|
1577
1576
|
n({
|
|
@@ -1588,26 +1587,26 @@ const fe = (n) => {
|
|
|
1588
1587
|
// buttons와 callback은 완전히 덮어쓰기 (병합하지 않음)
|
|
1589
1588
|
buttons: s?.buttons !== void 0 ? s.buttons : d.buttons,
|
|
1590
1589
|
callback: s?.callback !== void 0 ? s.callback : d.callback
|
|
1591
|
-
}, i = s?.defaultParams || {},
|
|
1590
|
+
}, i = s?.defaultParams || {}, p = r().popups.find(
|
|
1592
1591
|
(m) => m.popupCode === e && m.isLocal
|
|
1593
1592
|
);
|
|
1594
|
-
if (
|
|
1593
|
+
if (p) {
|
|
1595
1594
|
const m = r().zIndexSeed + 1;
|
|
1596
|
-
n({ activePopupId:
|
|
1595
|
+
n({ activePopupId: p.popupId, zIndexSeed: m }), n((u) => ({
|
|
1597
1596
|
popups: u.popups.map(
|
|
1598
|
-
(
|
|
1599
|
-
...
|
|
1597
|
+
(C) => C.popupId === p.popupId ? {
|
|
1598
|
+
...C,
|
|
1600
1599
|
config: c,
|
|
1601
1600
|
zIndex: m,
|
|
1602
1601
|
close: () => {
|
|
1603
|
-
r().closePopup(
|
|
1602
|
+
r().closePopup(p.popupId);
|
|
1604
1603
|
}
|
|
1605
|
-
} :
|
|
1604
|
+
} : C
|
|
1606
1605
|
)
|
|
1607
1606
|
}));
|
|
1608
1607
|
return;
|
|
1609
1608
|
}
|
|
1610
|
-
const
|
|
1609
|
+
const f = {
|
|
1611
1610
|
popupId: o,
|
|
1612
1611
|
popupCode: e,
|
|
1613
1612
|
popupTitle: c.title || e,
|
|
@@ -1627,7 +1626,7 @@ const fe = (n) => {
|
|
|
1627
1626
|
}
|
|
1628
1627
|
};
|
|
1629
1628
|
n((m) => ({
|
|
1630
|
-
popups: [...m.popups,
|
|
1629
|
+
popups: [...m.popups, f],
|
|
1631
1630
|
activePopupId: o,
|
|
1632
1631
|
zIndexSeed: t
|
|
1633
1632
|
}));
|
|
@@ -1667,8 +1666,8 @@ const fe = (n) => {
|
|
|
1667
1666
|
)
|
|
1668
1667
|
}));
|
|
1669
1668
|
}
|
|
1670
|
-
})),
|
|
1671
|
-
|
|
1669
|
+
})), Q = b()(
|
|
1670
|
+
k(
|
|
1672
1671
|
(n, r) => ({
|
|
1673
1672
|
systemMap: [],
|
|
1674
1673
|
fetchSystemMap: async () => {
|
|
@@ -2076,7 +2075,7 @@ const fe = (n) => {
|
|
|
2076
2075
|
// localStorage key
|
|
2077
2076
|
}
|
|
2078
2077
|
)
|
|
2079
|
-
),
|
|
2078
|
+
), Oe = b((n) => ({
|
|
2080
2079
|
requestCount: 0,
|
|
2081
2080
|
loading: !1,
|
|
2082
2081
|
showLoading: () => n((r) => {
|
|
@@ -2087,7 +2086,7 @@ const fe = (n) => {
|
|
|
2087
2086
|
const e = Math.max(0, r.requestCount - 1);
|
|
2088
2087
|
return { requestCount: e, loading: e > 0 };
|
|
2089
2088
|
})
|
|
2090
|
-
})),
|
|
2089
|
+
})), De = b((n) => ({
|
|
2091
2090
|
requestCount: 0,
|
|
2092
2091
|
loading: !1,
|
|
2093
2092
|
showLoading: () => n((r) => {
|
|
@@ -2100,47 +2099,47 @@ const fe = (n) => {
|
|
|
2100
2099
|
})
|
|
2101
2100
|
}));
|
|
2102
2101
|
function ge() {
|
|
2103
|
-
const [n, r] =
|
|
2102
|
+
const [n, r] = H(!1), e = U((s) => {
|
|
2104
2103
|
const o = s?.getModifierState?.("CapsLock");
|
|
2105
2104
|
typeof o == "boolean" && r(o);
|
|
2106
2105
|
}, []);
|
|
2107
2106
|
return { capsOn: n, onKeyDown: e };
|
|
2108
2107
|
}
|
|
2109
|
-
function
|
|
2108
|
+
function _e(n) {
|
|
2110
2109
|
const {
|
|
2111
2110
|
loginApi: r,
|
|
2112
2111
|
fetchCommonCodes: e,
|
|
2113
2112
|
onAfterLogin: s,
|
|
2114
2113
|
onError: o,
|
|
2115
2114
|
rememberCookie: t = { enabled: !0, days: 30 }
|
|
2116
|
-
} = n, [a, d] =
|
|
2117
|
-
id: t?.enabled ?
|
|
2115
|
+
} = n, [a, d] = H(!1), { capsOn: c, onKeyDown: i } = ge(), p = "SCMSIGN00101", f = `${__SYS_CD__}_login_id`, m = {
|
|
2116
|
+
id: t?.enabled ? oe(f) : void 0,
|
|
2118
2117
|
pswr: void 0
|
|
2119
|
-
}, u =
|
|
2120
|
-
async (
|
|
2118
|
+
}, u = U(
|
|
2119
|
+
async (C) => {
|
|
2121
2120
|
d(!0);
|
|
2122
2121
|
try {
|
|
2123
|
-
const
|
|
2122
|
+
const h = {
|
|
2124
2123
|
crprCd: "100",
|
|
2125
|
-
id:
|
|
2126
|
-
pswr: await
|
|
2127
|
-
},
|
|
2128
|
-
if (
|
|
2129
|
-
if (
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2124
|
+
id: C.id,
|
|
2125
|
+
pswr: await X(C.pswr)
|
|
2126
|
+
}, g = await (r ?? ((y) => S(p, y)))(h);
|
|
2127
|
+
if (g?.userInfo?.userId) {
|
|
2128
|
+
if (w.getState().setLoginUser(g.userInfo, g?.hrInfo), localStorage.setItem("LOGIN_USER_ID", g.userInfo.userId), t?.enabled) {
|
|
2129
|
+
const y = t.days ?? 30;
|
|
2130
|
+
C.remember ? x(f, C.id ?? "", y) : x(f, "", 0);
|
|
2132
2131
|
}
|
|
2133
|
-
return e ? await e() : await
|
|
2132
|
+
return e ? await e() : await F.getState().fetchCommonCodes(), s(g), { user: g.userInfo, response: g };
|
|
2134
2133
|
} else
|
|
2135
|
-
throw o
|
|
2136
|
-
} catch (
|
|
2137
|
-
|
|
2134
|
+
throw o({ user: g.userInfo, response: g }), new Error("사용자 정보가 유효하지 않습니다.");
|
|
2135
|
+
} catch (h) {
|
|
2136
|
+
o(h);
|
|
2138
2137
|
} finally {
|
|
2139
2138
|
d(!1);
|
|
2140
2139
|
}
|
|
2141
2140
|
},
|
|
2142
2141
|
[
|
|
2143
|
-
|
|
2142
|
+
p,
|
|
2144
2143
|
r,
|
|
2145
2144
|
e,
|
|
2146
2145
|
s,
|
|
@@ -2152,38 +2151,72 @@ function Fe(n) {
|
|
|
2152
2151
|
return {
|
|
2153
2152
|
loading: a,
|
|
2154
2153
|
capsOn: c,
|
|
2155
|
-
onKeyDown: i,
|
|
2156
2154
|
prefills: m,
|
|
2155
|
+
onKeyDown: i,
|
|
2157
2156
|
doLogin: u
|
|
2158
2157
|
};
|
|
2159
2158
|
}
|
|
2160
|
-
function
|
|
2161
|
-
const n =
|
|
2159
|
+
function we(n) {
|
|
2160
|
+
const { loginApi: r, fetchCommonCodes: e, onAfterLogin: s, onError: o } = n, [t, a] = H("LOADING"), d = {
|
|
2161
|
+
NO_TOKEN: "인증 정보가 없습니다.",
|
|
2162
|
+
INVALID_USER: "사용자 정보가 유효하지 않습니다.",
|
|
2163
|
+
UNKNOWN: "SSO 로그인 중 오류가 발생했습니다."
|
|
2164
|
+
}, c = (p) => p === "NO_TOKEN" || p === "INVALID_USER" ? p : "UNKNOWN", i = U(
|
|
2165
|
+
async (p) => {
|
|
2166
|
+
a("LOADING");
|
|
2167
|
+
try {
|
|
2168
|
+
const f = await re.post("/api/auth", {});
|
|
2169
|
+
f.data.result && f.data.userId && B.success(f.data.message);
|
|
2170
|
+
const m = {
|
|
2171
|
+
crprCd: "100",
|
|
2172
|
+
id: f.data.userId,
|
|
2173
|
+
pswr: await X("krx2025!@")
|
|
2174
|
+
}, C = await (r ?? ((h) => S("SCMSIGN00101", h)))(m);
|
|
2175
|
+
if (C?.userInfo?.userId)
|
|
2176
|
+
return w.getState().setLoginUser(C.userInfo, C?.hrInfo), localStorage.setItem("LOGIN_USER_ID", C.userInfo.userId), e ? await e() : await F.getState().fetchCommonCodes(), s(C), a("SUCCESS"), { user: C.userInfo, response: C };
|
|
2177
|
+
throw new Error("INVALID_USER");
|
|
2178
|
+
} catch (f) {
|
|
2179
|
+
const m = c(f?.message);
|
|
2180
|
+
o?.({
|
|
2181
|
+
code: m,
|
|
2182
|
+
msg: d[m]
|
|
2183
|
+
}), a("FAIL");
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
[r, e, s, o]
|
|
2187
|
+
);
|
|
2188
|
+
return {
|
|
2189
|
+
loginStatus: t,
|
|
2190
|
+
doSsoLogin: i
|
|
2191
|
+
};
|
|
2192
|
+
}
|
|
2193
|
+
function Fe(n) {
|
|
2162
2194
|
return () => {
|
|
2163
|
-
|
|
2195
|
+
w.getState().clearLoginUser(), Q.getState().clearSystemMap(), F.getState().clearCodes(), $.getState().clearMenu(), V.getState().clearMenuViewStore(), J.getState().clearFavorites(), localStorage.removeItem("LOGIN_USER_ID"), n?.();
|
|
2164
2196
|
};
|
|
2165
2197
|
}
|
|
2166
|
-
const
|
|
2198
|
+
const Te = () => F.getState(), Ae = () => ye.getState(), Ee = () => w.getState(), Ke = () => J.getState(), Be = () => $.getState(), Ge = () => V.getState(), Re = () => Q.getState();
|
|
2167
2199
|
export {
|
|
2168
2200
|
ge as useCapsLock,
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2201
|
+
Te as useCode,
|
|
2202
|
+
F as useCodeStore,
|
|
2203
|
+
Pe as useColorStore,
|
|
2172
2204
|
Ke as useFavorite,
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2205
|
+
J as useFavoriteStore,
|
|
2206
|
+
Oe as useLoadingStore,
|
|
2207
|
+
_e as useLogin,
|
|
2208
|
+
Fe as useLogout,
|
|
2177
2209
|
Be as useMenuModel,
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2210
|
+
$ as useMenuModelStore,
|
|
2211
|
+
Ge as useMenuView,
|
|
2212
|
+
V as useMenuViewStore,
|
|
2213
|
+
Le as useOptionStore,
|
|
2214
|
+
De as usePopupLoadingStore,
|
|
2215
|
+
Ae as usePopupState,
|
|
2216
|
+
ye as usePopupStore,
|
|
2217
|
+
we as useSsoLogin,
|
|
2218
|
+
Re as useSystemCode,
|
|
2219
|
+
Q as useSystemStore,
|
|
2220
|
+
Ee as useUser,
|
|
2221
|
+
w as useUserStore
|
|
2189
2222
|
};
|