@bwg-ui/core 1.2.11 → 1.2.12
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/{MenuReport-CXsmjSvg.cjs → MenuReport-Bqeps5fC.cjs} +1 -1
- package/dist/chunks/{MenuReport-Dgq2wH6w.js → MenuReport-CozV1tpR.js} +28 -28
- package/dist/chunks/common-components-B-zgrX-L.cjs +1028 -0
- package/dist/chunks/common-components-XA2KG7Pl.js +30179 -0
- package/dist/chunks/{layout-components-yyItu5pi.js → layout-components-MrnKV5g7.js} +548 -478
- package/dist/chunks/layout-components-bb0cWC3I.cjs +35 -0
- package/dist/components/common/BwgGrid.d.ts +1 -1
- package/dist/components/common/BwgGrid.d.ts.map +1 -1
- package/dist/components/common/BwgView.d.ts +9 -3
- package/dist/components/common/BwgView.d.ts.map +1 -1
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.d.ts +1 -1
- package/dist/components/common/index.d.ts.map +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +122 -122
- package/dist/components/guide/BwgPracticeGuide.d.ts +6 -0
- package/dist/components/guide/BwgPracticeGuide.d.ts.map +1 -0
- package/dist/components/guide/BwgPracticeGuideS00.d.ts +6 -0
- package/dist/components/guide/BwgPracticeGuideS00.d.ts.map +1 -0
- package/dist/components/guide/BwgPracticeGuideS01.d.ts +6 -0
- package/dist/components/guide/BwgPracticeGuideS01.d.ts.map +1 -0
- package/dist/components/guide/CMHldyCfg.d.ts +3 -0
- package/dist/components/guide/CMHldyCfg.d.ts.map +1 -0
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.d.ts +2 -0
- package/dist/components/guide/index.d.ts.map +1 -1
- package/dist/components/guide/index.js +645 -5
- package/dist/components/layout/BwgCoreLogin.d.ts +38 -0
- package/dist/components/layout/BwgCoreLogin.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 +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +13 -11
- package/dist/components/pages/auth/CMAuthMstrM01.d.ts +1 -2
- package/dist/components/pages/auth/CMAuthMstrM01.d.ts.map +1 -1
- package/dist/components/pages/auth/CMRoleMstrM01.d.ts +2 -1
- package/dist/components/pages/auth/CMRoleMstrM01.d.ts.map +1 -1
- package/dist/components/pages/rsrc/CMFileMstrM01.d.ts +2 -1
- package/dist/components/pages/rsrc/CMFileMstrM01.d.ts.map +1 -1
- package/dist/components/pages/rsrc/CMMenuMstrM01.d.ts +2 -1
- package/dist/components/pages/rsrc/CMMenuMstrM01.d.ts.map +1 -1
- package/dist/components/pages/rsrc/CMPopuMstrM01.d.ts +2 -1
- package/dist/components/pages/rsrc/CMPopuMstrM01.d.ts.map +1 -1
- package/dist/components/pages/rsrc/CMPrgrMstrM01.d.ts +2 -1
- package/dist/components/pages/rsrc/CMPrgrMstrM01.d.ts.map +1 -1
- package/dist/components/pages/syst/CMSystCfgM01.d.ts +2 -1
- package/dist/components/pages/syst/CMSystCfgM01.d.ts.map +1 -1
- package/dist/components/pages/syst/CMSystCodeM01.d.ts +2 -1
- package/dist/components/pages/syst/CMSystCodeM01.d.ts.map +1 -1
- package/dist/components/pages/types.d.ts +5 -0
- package/dist/components/pages/types.d.ts.map +1 -0
- package/dist/components/pages/user/CMUserMstrM01.d.ts +2 -1
- package/dist/components/pages/user/CMUserMstrM01.d.ts.map +1 -1
- package/dist/components/popup/SearchHolidayP01.d.ts +4 -0
- package/dist/components/popup/SearchHolidayP01.d.ts.map +1 -0
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.d.ts +1 -0
- package/dist/components/popup/index.d.ts.map +1 -1
- package/dist/components/popup/index.js +4 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +256 -238
- package/dist/stores/favoriteStore.d.ts +10 -9
- package/dist/stores/favoriteStore.d.ts.map +1 -1
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.d.ts +4 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +1129 -631
- package/dist/stores/loginStore.d.ts +64 -0
- package/dist/stores/loginStore.d.ts.map +1 -0
- package/dist/stores/menuModelStore.d.ts +1 -1
- package/dist/stores/menuViewStore.d.ts +1 -0
- package/dist/stores/menuViewStore.d.ts.map +1 -1
- package/dist/stores/systemStore.d.ts +32 -0
- package/dist/stores/systemStore.d.ts.map +1 -0
- package/dist/stores/userStore.d.ts +5 -5
- package/dist/stores/userStore.d.ts.map +1 -1
- package/dist/utils/apiUtils.d.ts +27 -60
- package/dist/utils/apiUtils.d.ts.map +1 -1
- package/dist/utils/gwUtils.d.ts +3 -2
- package/dist/utils/gwUtils.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +3 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1169 -1196
- package/dist/utils/serviceConfig.d.ts +1 -0
- package/dist/utils/serviceConfig.d.ts.map +1 -1
- package/dist/utils/userUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/common-components-Bp95qOup.js +0 -16236
- package/dist/chunks/common-components-CoRIM-Z-.cjs +0 -183
- package/dist/chunks/layout-components-hCEUMfz3.cjs +0 -35
package/dist/stores/index.js
CHANGED
|
@@ -1,177 +1,179 @@
|
|
|
1
|
-
import { create as
|
|
2
|
-
import { callService as
|
|
3
|
-
import { message as
|
|
4
|
-
import { l as
|
|
5
|
-
|
|
1
|
+
import { create as N } from "zustand";
|
|
2
|
+
import { callService as b, getServiceCode as E, getUserId as v, getUserInfo as Q, getCookie as ee, encryptSha256 as te, setCookie as G } from "../utils/index.js";
|
|
3
|
+
import { message as L } from "antd";
|
|
4
|
+
import { l as oe } from "../chunks/layout-components-MrnKV5g7.js";
|
|
5
|
+
import { useState as Y, useCallback as X } from "react";
|
|
6
|
+
import { useNavigate as se } from "react-router-dom";
|
|
7
|
+
function ne(n, r) {
|
|
6
8
|
let e;
|
|
7
9
|
try {
|
|
8
|
-
e =
|
|
10
|
+
e = n();
|
|
9
11
|
} catch {
|
|
10
12
|
return;
|
|
11
13
|
}
|
|
12
14
|
return {
|
|
13
15
|
getItem: (o) => {
|
|
14
16
|
var t;
|
|
15
|
-
const a = (
|
|
16
|
-
return
|
|
17
|
+
const a = (c) => c === null ? null : JSON.parse(c, void 0), d = (t = e.getItem(o)) != null ? t : null;
|
|
18
|
+
return d instanceof Promise ? d.then(a) : a(d);
|
|
17
19
|
},
|
|
18
20
|
setItem: (o, t) => e.setItem(o, JSON.stringify(t, void 0)),
|
|
19
21
|
removeItem: (o) => e.removeItem(o)
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
|
-
const
|
|
24
|
+
const A = (n) => (r) => {
|
|
23
25
|
try {
|
|
24
|
-
const e = r
|
|
26
|
+
const e = n(r);
|
|
25
27
|
return e instanceof Promise ? e : {
|
|
26
|
-
then(
|
|
27
|
-
return
|
|
28
|
+
then(s) {
|
|
29
|
+
return A(s)(e);
|
|
28
30
|
},
|
|
29
|
-
catch(
|
|
31
|
+
catch(s) {
|
|
30
32
|
return this;
|
|
31
33
|
}
|
|
32
34
|
};
|
|
33
35
|
} catch (e) {
|
|
34
36
|
return {
|
|
35
|
-
then(
|
|
37
|
+
then(s) {
|
|
36
38
|
return this;
|
|
37
39
|
},
|
|
38
|
-
catch(
|
|
39
|
-
return
|
|
40
|
+
catch(s) {
|
|
41
|
+
return A(s)(e);
|
|
40
42
|
}
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
|
-
},
|
|
45
|
+
}, re = (n, r) => (e, s, o) => {
|
|
44
46
|
let t = {
|
|
45
|
-
storage:
|
|
46
|
-
partialize: (
|
|
47
|
+
storage: ne(() => localStorage),
|
|
48
|
+
partialize: (C) => C,
|
|
47
49
|
version: 0,
|
|
48
|
-
merge: (
|
|
49
|
-
...
|
|
50
|
-
...
|
|
50
|
+
merge: (C, g) => ({
|
|
51
|
+
...g,
|
|
52
|
+
...C
|
|
51
53
|
}),
|
|
52
|
-
...
|
|
54
|
+
...r
|
|
53
55
|
}, a = !1;
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
if (!
|
|
57
|
-
return
|
|
58
|
-
(...
|
|
56
|
+
const d = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
|
|
57
|
+
let i = t.storage;
|
|
58
|
+
if (!i)
|
|
59
|
+
return n(
|
|
60
|
+
(...C) => {
|
|
59
61
|
console.warn(
|
|
60
62
|
`[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`
|
|
61
|
-
), e(...
|
|
63
|
+
), e(...C);
|
|
62
64
|
},
|
|
63
|
-
|
|
65
|
+
s,
|
|
64
66
|
o
|
|
65
67
|
);
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
-
state:
|
|
68
|
+
const p = () => {
|
|
69
|
+
const C = t.partialize({ ...s() });
|
|
70
|
+
return i.setItem(t.name, {
|
|
71
|
+
state: C,
|
|
70
72
|
version: t.version
|
|
71
73
|
});
|
|
72
|
-
},
|
|
73
|
-
o.setState = (
|
|
74
|
-
const m =
|
|
75
|
-
(...
|
|
76
|
-
|
|
74
|
+
}, h = o.setState;
|
|
75
|
+
o.setState = (C, g) => (h(C, g), p());
|
|
76
|
+
const m = n(
|
|
77
|
+
(...C) => (e(...C), p()),
|
|
78
|
+
s,
|
|
77
79
|
o
|
|
78
80
|
);
|
|
79
81
|
o.getInitialState = () => m;
|
|
80
|
-
let
|
|
81
|
-
const
|
|
82
|
-
var
|
|
83
|
-
if (!
|
|
84
|
-
a = !1,
|
|
85
|
-
var
|
|
86
|
-
return
|
|
82
|
+
let u;
|
|
83
|
+
const f = () => {
|
|
84
|
+
var C, g;
|
|
85
|
+
if (!i) return;
|
|
86
|
+
a = !1, d.forEach((y) => {
|
|
87
|
+
var S;
|
|
88
|
+
return y((S = s()) != null ? S : m);
|
|
87
89
|
});
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
if (
|
|
91
|
-
if (typeof
|
|
90
|
+
const k = ((g = t.onRehydrateStorage) == null ? void 0 : g.call(t, (C = s()) != null ? C : m)) || void 0;
|
|
91
|
+
return A(i.getItem.bind(i))(t.name).then((y) => {
|
|
92
|
+
if (y)
|
|
93
|
+
if (typeof y.version == "number" && y.version !== t.version) {
|
|
92
94
|
if (t.migrate) {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
const S = t.migrate(
|
|
96
|
+
y.state,
|
|
97
|
+
y.version
|
|
96
98
|
);
|
|
97
|
-
return
|
|
99
|
+
return S instanceof Promise ? S.then((w) => [!0, w]) : [!0, S];
|
|
98
100
|
}
|
|
99
101
|
console.error(
|
|
100
102
|
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
101
103
|
);
|
|
102
104
|
} else
|
|
103
|
-
return [!1,
|
|
105
|
+
return [!1, y.state];
|
|
104
106
|
return [!1, void 0];
|
|
105
|
-
}).then((
|
|
106
|
-
var
|
|
107
|
-
const [
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
(
|
|
111
|
-
), e(
|
|
112
|
-
return
|
|
107
|
+
}).then((y) => {
|
|
108
|
+
var S;
|
|
109
|
+
const [w, V] = y;
|
|
110
|
+
if (u = t.merge(
|
|
111
|
+
V,
|
|
112
|
+
(S = s()) != null ? S : m
|
|
113
|
+
), e(u, !0), w)
|
|
114
|
+
return p();
|
|
113
115
|
}).then(() => {
|
|
114
|
-
|
|
115
|
-
}).catch((
|
|
116
|
-
|
|
116
|
+
k?.(u, void 0), u = s(), a = !0, c.forEach((y) => y(u));
|
|
117
|
+
}).catch((y) => {
|
|
118
|
+
k?.(void 0, y);
|
|
117
119
|
});
|
|
118
120
|
};
|
|
119
121
|
return o.persist = {
|
|
120
|
-
setOptions: (
|
|
122
|
+
setOptions: (C) => {
|
|
121
123
|
t = {
|
|
122
124
|
...t,
|
|
123
|
-
...
|
|
124
|
-
},
|
|
125
|
+
...C
|
|
126
|
+
}, C.storage && (i = C.storage);
|
|
125
127
|
},
|
|
126
128
|
clearStorage: () => {
|
|
127
|
-
|
|
129
|
+
i?.removeItem(t.name);
|
|
128
130
|
},
|
|
129
131
|
getOptions: () => t,
|
|
130
|
-
rehydrate: () =>
|
|
132
|
+
rehydrate: () => f(),
|
|
131
133
|
hasHydrated: () => a,
|
|
132
|
-
onHydrate: (
|
|
133
|
-
|
|
134
|
+
onHydrate: (C) => (d.add(C), () => {
|
|
135
|
+
d.delete(C);
|
|
134
136
|
}),
|
|
135
|
-
onFinishHydration: (
|
|
136
|
-
|
|
137
|
+
onFinishHydration: (C) => (c.add(C), () => {
|
|
138
|
+
c.delete(C);
|
|
137
139
|
})
|
|
138
|
-
}, t.skipHydration ||
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
(
|
|
140
|
+
}, t.skipHydration || f(), u || m;
|
|
141
|
+
}, M = re, T = N()(
|
|
142
|
+
M(
|
|
143
|
+
(n, r) => ({
|
|
142
144
|
user: null,
|
|
143
|
-
isLoggedIn: !1,
|
|
144
145
|
hrInfo: null,
|
|
146
|
+
isLoggedIn: () => !!r().user,
|
|
145
147
|
// 로그인
|
|
146
|
-
|
|
147
|
-
|
|
148
|
+
setLoginUser: (e, s) => {
|
|
149
|
+
n({ user: e, hrInfo: s ?? null }), console.log("사용자 로그인:", e, s);
|
|
148
150
|
},
|
|
149
151
|
// 로그아웃
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
clearLoginUser: () => {
|
|
153
|
+
n({ user: null, hrInfo: null }), console.log("사용자 로그아웃");
|
|
152
154
|
},
|
|
153
155
|
// 사용자 정보 업데이트
|
|
154
|
-
updateUser: (e,
|
|
155
|
-
const o =
|
|
156
|
-
o &&
|
|
156
|
+
updateUser: (e, s) => {
|
|
157
|
+
const o = r().user, t = r().hrInfo;
|
|
158
|
+
o && n({
|
|
157
159
|
user: { ...o, ...e }
|
|
158
|
-
}), t &&
|
|
159
|
-
hrInfo: { ...t, ...
|
|
160
|
+
}), t && n({
|
|
161
|
+
hrInfo: { ...t, ...s }
|
|
160
162
|
});
|
|
161
163
|
}
|
|
162
164
|
}),
|
|
163
165
|
{
|
|
164
166
|
name: "user-storage",
|
|
165
167
|
// 로컬 스토리지 키
|
|
166
|
-
partialize: (
|
|
167
|
-
user:
|
|
168
|
-
hrInfo:
|
|
169
|
-
isLoggedIn:
|
|
168
|
+
partialize: (n) => ({
|
|
169
|
+
user: n.user,
|
|
170
|
+
hrInfo: n.hrInfo,
|
|
171
|
+
isLoggedIn: n.isLoggedIn
|
|
170
172
|
})
|
|
171
173
|
// 저장할 상태만 선택
|
|
172
174
|
}
|
|
173
175
|
)
|
|
174
|
-
),
|
|
176
|
+
), D = {
|
|
175
177
|
CACHE_SIZE_LIMIT: 1e3
|
|
176
178
|
}, l = {
|
|
177
179
|
codeCache: /* @__PURE__ */ new Map(),
|
|
@@ -184,30 +186,30 @@ const H = (r) => (s) => {
|
|
|
184
186
|
this.codeCache.clear(), this.nameCache.clear(), this.optionCache.clear(), this.colorCache.clear(), this.loadedGroups.clear(), this.cacheHits.clear();
|
|
185
187
|
},
|
|
186
188
|
cleanupCache() {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
+
const n = Array.from(this.cacheHits.entries());
|
|
190
|
+
n.sort((e, s) => e[1] - s[1]), n.slice(0, Math.floor(n.length * 0.3)).forEach(([e]) => {
|
|
189
191
|
this.codeCache.delete(e), this.nameCache.delete(e), this.optionCache.delete(e), this.colorCache.delete(e), this.cacheHits.delete(e);
|
|
190
192
|
});
|
|
191
193
|
},
|
|
192
|
-
isGroupLoaded(
|
|
193
|
-
return this.loadedGroups.has(
|
|
194
|
+
isGroupLoaded(n) {
|
|
195
|
+
return this.loadedGroups.has(n);
|
|
194
196
|
},
|
|
195
|
-
markGroupLoaded(
|
|
196
|
-
this.loadedGroups.add(
|
|
197
|
+
markGroupLoaded(n) {
|
|
198
|
+
this.loadedGroups.add(n);
|
|
197
199
|
}
|
|
198
|
-
},
|
|
199
|
-
console.log("대규모 데이터 변환 시작:",
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const e =
|
|
203
|
-
|
|
200
|
+
}, ae = (n) => {
|
|
201
|
+
console.log("대규모 데이터 변환 시작:", n);
|
|
202
|
+
const r = {};
|
|
203
|
+
if (n && n.code && Array.isArray(n.code)) {
|
|
204
|
+
const e = n.code, s = n.opt || [], o = /* @__PURE__ */ new Map();
|
|
205
|
+
s.forEach((t) => {
|
|
204
206
|
t.cmmnCd && t.enblYn === "Y" && (o.has(t.cmmnCd) || o.set(t.cmmnCd, []), o.get(t.cmmnCd).push(t));
|
|
205
207
|
}), e.forEach((t) => {
|
|
206
208
|
if (t && t.cmmnCdGrp && t.cmmnCd && t.enblYn === "Y") {
|
|
207
209
|
const a = t.cmmnCdGrp;
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
|
|
210
|
+
r[a] || (r[a] = {});
|
|
211
|
+
const c = (o.get(t.cmmnCd) || []).reduce((i, p) => (p.optnCd && p.optnNm && (i[p.optnCd] = p.optnNm), i), {});
|
|
212
|
+
r[a][t.cmmnCd] = {
|
|
211
213
|
codeValue: t.cmmnCd,
|
|
212
214
|
codeNm: t.cmmnCdNm,
|
|
213
215
|
groupCode: t.cmmnCdGrp,
|
|
@@ -216,67 +218,67 @@ const H = (r) => (s) => {
|
|
|
216
218
|
systemCodeYn: t.syscdYn,
|
|
217
219
|
sortOrder: parseInt(t.sortOrd) || 1,
|
|
218
220
|
enabled: t.enblYn === "Y",
|
|
219
|
-
options: Object.keys(
|
|
221
|
+
options: Object.keys(c).length > 0 ? c : null,
|
|
220
222
|
originalData: t
|
|
221
223
|
};
|
|
222
224
|
}
|
|
223
225
|
});
|
|
224
226
|
}
|
|
225
|
-
return console.log("대규모 데이터 변환 완료:",
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
(
|
|
227
|
+
return console.log("대규모 데이터 변환 완료:", r), r;
|
|
228
|
+
}, I = N()(
|
|
229
|
+
M(
|
|
230
|
+
(n, r) => ({
|
|
229
231
|
codeData: null,
|
|
230
232
|
isLoading: !1,
|
|
231
233
|
error: null,
|
|
232
234
|
lastUpdated: null,
|
|
233
235
|
loadedGroups: /* @__PURE__ */ new Set(),
|
|
234
236
|
fetchData: async () => {
|
|
235
|
-
|
|
237
|
+
n({ isLoading: !0, error: null });
|
|
236
238
|
try {
|
|
237
239
|
console.log("대규모 공통코드 데이터 가져오기 시작: SCMSIGN00301");
|
|
238
|
-
const e = await
|
|
240
|
+
const e = await b(E("SRCH_CODE"), {
|
|
239
241
|
crprCd: "100"
|
|
240
242
|
});
|
|
241
243
|
console.log("대규모 공통코드 응답:", e), console.log("대규모 공통코드목록:", e.code), console.log("대규모 공통코드옵션션목록:", e.opt);
|
|
242
|
-
const
|
|
244
|
+
const s = ae(e);
|
|
243
245
|
l.clearCache();
|
|
244
|
-
const o = new Set(Object.keys(
|
|
246
|
+
const o = new Set(Object.keys(s));
|
|
245
247
|
o.forEach((t) => {
|
|
246
248
|
l.markGroupLoaded(t);
|
|
247
|
-
}),
|
|
248
|
-
codeData:
|
|
249
|
+
}), n({
|
|
250
|
+
codeData: s,
|
|
249
251
|
isLoading: !1,
|
|
250
252
|
error: null,
|
|
251
253
|
lastUpdated: /* @__PURE__ */ new Date(),
|
|
252
254
|
loadedGroups: o
|
|
253
255
|
}), console.log("대규모 공통코드 데이터 가져오기 완료");
|
|
254
256
|
} catch (e) {
|
|
255
|
-
console.error("대규모 공통코드 데이터 가져오기 실패:", e),
|
|
257
|
+
console.error("대규모 공통코드 데이터 가져오기 실패:", e), n({
|
|
256
258
|
isLoading: !1,
|
|
257
259
|
error: e instanceof Error ? e.message : "대규모 공통코드 데이터 가져오기 실패"
|
|
258
260
|
});
|
|
259
261
|
}
|
|
260
262
|
},
|
|
261
263
|
loadSpecificGroup: async (e) => {
|
|
262
|
-
const { codeData:
|
|
263
|
-
if (!
|
|
264
|
+
const { codeData: s, loadedGroups: o } = r();
|
|
265
|
+
if (!s || o.has(e)) return;
|
|
264
266
|
const t = new Set(o).add(e);
|
|
265
|
-
|
|
267
|
+
n({ loadedGroups: t }), l.markGroupLoaded(e);
|
|
266
268
|
},
|
|
267
269
|
setData: (e) => {
|
|
268
270
|
l.clearCache();
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
+
const s = new Set(Object.keys(e));
|
|
272
|
+
s.forEach((o) => {
|
|
271
273
|
l.markGroupLoaded(o);
|
|
272
|
-
}),
|
|
274
|
+
}), n({
|
|
273
275
|
codeData: e,
|
|
274
276
|
lastUpdated: /* @__PURE__ */ new Date(),
|
|
275
|
-
loadedGroups:
|
|
277
|
+
loadedGroups: s
|
|
276
278
|
});
|
|
277
279
|
},
|
|
278
280
|
clearData: () => {
|
|
279
|
-
l.clearCache(),
|
|
281
|
+
l.clearCache(), n({
|
|
280
282
|
codeData: null,
|
|
281
283
|
isLoading: !1,
|
|
282
284
|
error: null,
|
|
@@ -284,76 +286,76 @@ const H = (r) => (s) => {
|
|
|
284
286
|
loadedGroups: /* @__PURE__ */ new Set()
|
|
285
287
|
});
|
|
286
288
|
},
|
|
287
|
-
getLoadedGroups: () => Array.from(
|
|
289
|
+
getLoadedGroups: () => Array.from(r().loadedGroups)
|
|
288
290
|
}),
|
|
289
291
|
{
|
|
290
292
|
name: "large-data-storage",
|
|
291
|
-
partialize: (
|
|
292
|
-
codeData:
|
|
293
|
-
lastUpdated:
|
|
294
|
-
loadedGroups: Array.from(
|
|
293
|
+
partialize: (n) => ({
|
|
294
|
+
codeData: n.codeData,
|
|
295
|
+
lastUpdated: n.lastUpdated,
|
|
296
|
+
loadedGroups: Array.from(n.loadedGroups)
|
|
295
297
|
})
|
|
296
298
|
}
|
|
297
299
|
)
|
|
298
|
-
),
|
|
299
|
-
|
|
300
|
-
(
|
|
300
|
+
), H = N()(
|
|
301
|
+
M(
|
|
302
|
+
(n, r) => ({
|
|
301
303
|
// 공통 데이터 스토어에서 상태 가져오기
|
|
302
304
|
get codeData() {
|
|
303
|
-
return
|
|
305
|
+
return I.getState().codeData;
|
|
304
306
|
},
|
|
305
307
|
get isLoading() {
|
|
306
|
-
return
|
|
308
|
+
return I.getState().isLoading;
|
|
307
309
|
},
|
|
308
310
|
get error() {
|
|
309
|
-
return
|
|
311
|
+
return I.getState().error;
|
|
310
312
|
},
|
|
311
313
|
get lastUpdated() {
|
|
312
|
-
return
|
|
314
|
+
return I.getState().lastUpdated;
|
|
313
315
|
},
|
|
314
316
|
// 공통코드 가져오기 (중앙 스토어 사용)
|
|
315
317
|
fetchCommonCodes: async () => {
|
|
316
|
-
await
|
|
318
|
+
await I.getState().fetchData();
|
|
317
319
|
},
|
|
318
320
|
// 1. 통합된 코드 목록 조회 (그룹코드 필수, 옵션으로 필터링)
|
|
319
|
-
getCodeList: (e,
|
|
321
|
+
getCodeList: (e, s) => {
|
|
320
322
|
const {
|
|
321
323
|
enabledOnly: o = !0,
|
|
322
324
|
systemCodeOnly: t = !1,
|
|
323
325
|
sortByOrder: a = !1,
|
|
324
|
-
excludeParentCode:
|
|
325
|
-
} =
|
|
326
|
-
if (l.optionCache.has(
|
|
327
|
-
const
|
|
328
|
-
return l.cacheHits.set(
|
|
326
|
+
excludeParentCode: d = !1
|
|
327
|
+
} = s || {}, c = `simpleCodeList_${e}_${o}_${t}_${a}_${d}`;
|
|
328
|
+
if (l.optionCache.has(c)) {
|
|
329
|
+
const f = l.cacheHits.get(c) || 0;
|
|
330
|
+
return l.cacheHits.set(c, f + 1), l.optionCache.get(c);
|
|
329
331
|
}
|
|
330
|
-
const
|
|
331
|
-
if (!
|
|
332
|
-
if (!l.isGroupLoaded(e) && !
|
|
332
|
+
const i = I.getState().codeData;
|
|
333
|
+
if (!i) return [];
|
|
334
|
+
if (!l.isGroupLoaded(e) && !i[e])
|
|
333
335
|
return console.warn(`그룹 ${e}가 아직 로드되지 않았습니다.`), [];
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
if (!(o && !
|
|
337
|
-
if (
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
...
|
|
341
|
-
codeValue:
|
|
336
|
+
const p = [], h = i[e];
|
|
337
|
+
h && Object.values(h).forEach((f) => {
|
|
338
|
+
if (!(o && !f.enabled) && !(t && f.systemCodeYn !== "Y"))
|
|
339
|
+
if (d) {
|
|
340
|
+
const C = e.length, g = f.codeValue.substring(C);
|
|
341
|
+
g.length > 0 && p.push({
|
|
342
|
+
...f,
|
|
343
|
+
codeValue: g
|
|
342
344
|
// 자식코드만 사용
|
|
343
345
|
});
|
|
344
346
|
} else
|
|
345
|
-
|
|
347
|
+
p.push(f);
|
|
346
348
|
});
|
|
347
349
|
let m;
|
|
348
|
-
a ? m =
|
|
349
|
-
(
|
|
350
|
+
a ? m = p.sort((f, C) => f.sortOrder !== C.sortOrder ? f.sortOrder - C.sortOrder : f.codeValue.localeCompare(C.codeValue)) : m = p.sort(
|
|
351
|
+
(f, C) => f.codeValue.localeCompare(C.codeValue)
|
|
350
352
|
);
|
|
351
|
-
const
|
|
352
|
-
label:
|
|
353
|
-
value:
|
|
354
|
-
tagColor:
|
|
353
|
+
const u = m.map((f) => ({
|
|
354
|
+
label: f.codeNm,
|
|
355
|
+
value: f.codeValue,
|
|
356
|
+
tagColor: f.labelColor
|
|
355
357
|
}));
|
|
356
|
-
return l.optionCache.size >=
|
|
358
|
+
return l.optionCache.size >= D.CACHE_SIZE_LIMIT && l.cleanupCache(), l.optionCache.set(c, u), l.cacheHits.set(c, 1), u;
|
|
357
359
|
},
|
|
358
360
|
// 2. 코드를 던졌을 때 코드명을 리턴 (대규모 최적화)
|
|
359
361
|
getCodeName: (e) => {
|
|
@@ -361,9 +363,9 @@ const H = (r) => (s) => {
|
|
|
361
363
|
const o = l.cacheHits.get(`name_${e}`) || 0;
|
|
362
364
|
return l.cacheHits.set(`name_${e}`, o + 1), l.nameCache.get(e);
|
|
363
365
|
}
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
366
|
-
for (const o of Object.values(
|
|
366
|
+
const s = I.getState().codeData;
|
|
367
|
+
if (!s) return null;
|
|
368
|
+
for (const o of Object.values(s))
|
|
367
369
|
for (const t of Object.values(o))
|
|
368
370
|
if (t.codeValue === e)
|
|
369
371
|
return l.nameCache.set(e, t.codeNm), l.cacheHits.set(`name_${e}`, 1), t.codeNm;
|
|
@@ -375,9 +377,9 @@ const H = (r) => (s) => {
|
|
|
375
377
|
const o = l.cacheHits.get(`color_${e}`) || 0;
|
|
376
378
|
return l.cacheHits.set(`color_${e}`, o + 1), l.colorCache.get(e);
|
|
377
379
|
}
|
|
378
|
-
const
|
|
379
|
-
if (!
|
|
380
|
-
for (const o of Object.values(
|
|
380
|
+
const s = I.getState().codeData;
|
|
381
|
+
if (!s) return null;
|
|
382
|
+
for (const o of Object.values(s))
|
|
381
383
|
for (const t of Object.values(o))
|
|
382
384
|
if (t.codeValue === e)
|
|
383
385
|
return l.colorCache.set(
|
|
@@ -388,76 +390,76 @@ const H = (r) => (s) => {
|
|
|
388
390
|
},
|
|
389
391
|
// 4. 그리드 lookup용 데이터 반환 (labels, values 배열, lookupDisplay 포함)
|
|
390
392
|
getGridLookup: (e) => {
|
|
391
|
-
const
|
|
392
|
-
if (l.optionCache.has(
|
|
393
|
-
const
|
|
394
|
-
return l.cacheHits.set(
|
|
393
|
+
const s = `gridLookup_${e}`;
|
|
394
|
+
if (l.optionCache.has(s)) {
|
|
395
|
+
const i = l.cacheHits.get(s) || 0;
|
|
396
|
+
return l.cacheHits.set(s, i + 1), l.optionCache.get(s);
|
|
395
397
|
}
|
|
396
|
-
const o =
|
|
398
|
+
const o = I.getState().codeData;
|
|
397
399
|
if (!o) return { labels: [], values: [], lookupDisplay: !0 };
|
|
398
400
|
const t = o[e];
|
|
399
401
|
if (!t) return { labels: [], values: [], lookupDisplay: !0 };
|
|
400
|
-
const a = [],
|
|
401
|
-
Object.values(t).filter((
|
|
402
|
-
a.push(
|
|
402
|
+
const a = [], d = [];
|
|
403
|
+
Object.values(t).filter((i) => i.enabled).sort((i, p) => i.sortOrder - p.sortOrder).forEach((i) => {
|
|
404
|
+
a.push(i.codeNm), d.push(i.codeValue);
|
|
403
405
|
});
|
|
404
|
-
const
|
|
405
|
-
return l.optionCache.set(
|
|
406
|
+
const c = { labels: a, values: d, lookupDisplay: !0 };
|
|
407
|
+
return l.optionCache.set(s, c), l.cacheHits.set(s, 1), c;
|
|
406
408
|
},
|
|
407
409
|
// 3. 옵션값으로 코드를 조회하는 새로운 메서드
|
|
408
|
-
getCodeByOption: (e,
|
|
409
|
-
const t = `codeByOption_${e}_${
|
|
410
|
+
getCodeByOption: (e, s, o) => {
|
|
411
|
+
const t = `codeByOption_${e}_${s}_${o}`;
|
|
410
412
|
if (l.codeCache.has(t)) {
|
|
411
|
-
const
|
|
412
|
-
return l.cacheHits.set(t,
|
|
413
|
+
const p = l.cacheHits.get(t) || 0;
|
|
414
|
+
return l.cacheHits.set(t, p + 1), l.codeCache.get(t);
|
|
413
415
|
}
|
|
414
|
-
const a =
|
|
416
|
+
const a = I.getState().codeData;
|
|
415
417
|
if (!a) return [];
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
...
|
|
420
|
-
codeNm:
|
|
418
|
+
const d = [], c = a[e];
|
|
419
|
+
c && Object.values(c).forEach((p) => {
|
|
420
|
+
p.enabled && p.options && p.options[s] === o && d.push({
|
|
421
|
+
...p,
|
|
422
|
+
codeNm: p.options[s] || p.codeNm
|
|
421
423
|
// 옵션값을 코드명으로 사용
|
|
422
424
|
});
|
|
423
425
|
});
|
|
424
|
-
const
|
|
425
|
-
(
|
|
426
|
+
const i = d.sort(
|
|
427
|
+
(p, h) => p.codeValue.localeCompare(h.codeValue)
|
|
426
428
|
);
|
|
427
|
-
return l.codeCache.size >=
|
|
429
|
+
return l.codeCache.size >= D.CACHE_SIZE_LIMIT && l.cleanupCache(), l.codeCache.set(t, i), l.cacheHits.set(t, 1), i;
|
|
428
430
|
},
|
|
429
431
|
// 6. 옵션코드별로 코드 목록 조회 (SimpleCodeItem 형태로 반환)
|
|
430
|
-
getCodeListByOption: (e,
|
|
432
|
+
getCodeListByOption: (e, s, o) => {
|
|
431
433
|
const {
|
|
432
434
|
enabledOnly: t = !0,
|
|
433
435
|
systemCodeOnly: a = !1,
|
|
434
|
-
sortByOrder:
|
|
435
|
-
} = o || {},
|
|
436
|
-
if (l.codeCache.has(
|
|
437
|
-
const
|
|
438
|
-
return l.cacheHits.set(
|
|
439
|
-
|
|
436
|
+
sortByOrder: d = !1
|
|
437
|
+
} = o || {}, c = `codeListByOption_${e}_${s}_${t}_${a}_${d}`;
|
|
438
|
+
if (l.codeCache.has(c)) {
|
|
439
|
+
const u = l.cacheHits.get(c) || 0;
|
|
440
|
+
return l.cacheHits.set(c, u + 1), l.codeCache.get(
|
|
441
|
+
c
|
|
440
442
|
);
|
|
441
443
|
}
|
|
442
|
-
const
|
|
443
|
-
if (!
|
|
444
|
-
if (!l.isGroupLoaded(e) && !
|
|
444
|
+
const i = I.getState().codeData;
|
|
445
|
+
if (!i) return [];
|
|
446
|
+
if (!l.isGroupLoaded(e) && !i[e])
|
|
445
447
|
return console.warn(`그룹 ${e}가 아직 로드되지 않았습니다.`), [];
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
t && !
|
|
449
|
-
label:
|
|
448
|
+
const p = [], h = i[e];
|
|
449
|
+
h && Object.values(h).forEach((u) => {
|
|
450
|
+
t && !u.enabled || a && u.systemCodeYn !== "Y" || u.options && u.options[s] && p.push({
|
|
451
|
+
label: u.options[s],
|
|
450
452
|
// optnNm 값
|
|
451
|
-
value:
|
|
453
|
+
value: u.commonCode,
|
|
452
454
|
// 공통코드값
|
|
453
|
-
tagColor:
|
|
455
|
+
tagColor: u.labelColor
|
|
454
456
|
// 라벨 컬러
|
|
455
457
|
});
|
|
456
458
|
});
|
|
457
459
|
let m;
|
|
458
|
-
return
|
|
459
|
-
(
|
|
460
|
-
), l.codeCache.size >=
|
|
460
|
+
return d ? m = p.sort((u, f) => u.value.localeCompare(f.value)) : m = p.sort(
|
|
461
|
+
(u, f) => u.value.localeCompare(f.value)
|
|
462
|
+
), l.codeCache.size >= D.CACHE_SIZE_LIMIT && l.cleanupCache(), l.codeCache.set(c, m), l.cacheHits.set(c, 1), m;
|
|
461
463
|
},
|
|
462
464
|
// 7. 그룹코드 목록 조회
|
|
463
465
|
getAvailableGroupCodes: () => {
|
|
@@ -466,9 +468,9 @@ const H = (r) => (s) => {
|
|
|
466
468
|
const t = l.cacheHits.get(e) || 0;
|
|
467
469
|
return l.cacheHits.set(e, t + 1), JSON.parse(l.nameCache.get(e));
|
|
468
470
|
}
|
|
469
|
-
const
|
|
470
|
-
if (!
|
|
471
|
-
const o = Object.keys(
|
|
471
|
+
const s = I.getState().codeData;
|
|
472
|
+
if (!s) return [];
|
|
473
|
+
const o = Object.keys(s).sort();
|
|
472
474
|
return l.nameCache.set(
|
|
473
475
|
e,
|
|
474
476
|
JSON.stringify(o)
|
|
@@ -476,93 +478,93 @@ const H = (r) => (s) => {
|
|
|
476
478
|
},
|
|
477
479
|
// 공통코드 초기화
|
|
478
480
|
clearCodes: () => {
|
|
479
|
-
|
|
481
|
+
I.getState().clearData();
|
|
480
482
|
}
|
|
481
483
|
}),
|
|
482
484
|
{
|
|
483
485
|
name: "code-storage",
|
|
484
|
-
partialize: (
|
|
486
|
+
partialize: (n) => ({
|
|
485
487
|
// 상태는 중앙 스토어에서 관리하므로 여기서는 저장하지 않음
|
|
486
488
|
})
|
|
487
489
|
}
|
|
488
490
|
)
|
|
489
|
-
),
|
|
490
|
-
|
|
491
|
-
(
|
|
491
|
+
), ve = N()(
|
|
492
|
+
M(
|
|
493
|
+
(n, r) => ({
|
|
492
494
|
// 공통 데이터 스토어에서 상태 가져오기
|
|
493
495
|
get codeData() {
|
|
494
|
-
return
|
|
496
|
+
return I.getState().codeData;
|
|
495
497
|
},
|
|
496
498
|
get isLoading() {
|
|
497
|
-
return
|
|
499
|
+
return I.getState().isLoading;
|
|
498
500
|
},
|
|
499
501
|
get error() {
|
|
500
|
-
return
|
|
502
|
+
return I.getState().error;
|
|
501
503
|
},
|
|
502
504
|
get lastUpdated() {
|
|
503
|
-
return
|
|
505
|
+
return I.getState().lastUpdated;
|
|
504
506
|
},
|
|
505
507
|
// 공통코드 가져오기 (중앙 스토어 사용)
|
|
506
508
|
fetchCommonCodes: async () => {
|
|
507
|
-
await
|
|
509
|
+
await I.getState().fetchData();
|
|
508
510
|
},
|
|
509
511
|
// 그룹코드와 옵션코드를 던졌을 때 상세코드의 옵션값을 리턴 (대규모 최적화)
|
|
510
|
-
getOptionValue: (e,
|
|
511
|
-
const o = `option_${e}_${
|
|
512
|
+
getOptionValue: (e, s) => {
|
|
513
|
+
const o = `option_${e}_${s}`;
|
|
512
514
|
if (l.optionCache.has(o)) {
|
|
513
|
-
const
|
|
514
|
-
return l.cacheHits.set(o,
|
|
515
|
+
const d = l.cacheHits.get(o) || 0;
|
|
516
|
+
return l.cacheHits.set(o, d + 1), l.optionCache.get(o);
|
|
515
517
|
}
|
|
516
|
-
const t =
|
|
518
|
+
const t = I.getState().codeData;
|
|
517
519
|
if (!t) return null;
|
|
518
520
|
const a = t[e];
|
|
519
|
-
if (a && a[
|
|
520
|
-
const
|
|
521
|
-
return l.optionCache.set(o,
|
|
521
|
+
if (a && a[s]) {
|
|
522
|
+
const d = a[s].options;
|
|
523
|
+
return l.optionCache.set(o, d), l.cacheHits.set(o, 1), d;
|
|
522
524
|
}
|
|
523
525
|
return null;
|
|
524
526
|
},
|
|
525
527
|
// 특정 옵션 키의 값 가져오기 (대규모 최적화)
|
|
526
|
-
getOptionByKey: (e,
|
|
527
|
-
const t = `option_${e}_${
|
|
528
|
+
getOptionByKey: (e, s, o) => {
|
|
529
|
+
const t = `option_${e}_${s}_${o}`;
|
|
528
530
|
if (l.optionCache.has(t)) {
|
|
529
|
-
const
|
|
530
|
-
return l.cacheHits.set(t,
|
|
531
|
+
const c = l.cacheHits.get(t) || 0;
|
|
532
|
+
return l.cacheHits.set(t, c + 1), l.optionCache.get(t);
|
|
531
533
|
}
|
|
532
|
-
const a =
|
|
533
|
-
return l.optionCache.set(t,
|
|
534
|
+
const a = r().getOptionValue(e, s), d = a ? a[o] : null;
|
|
535
|
+
return l.optionCache.set(t, d), l.cacheHits.set(t, 1), d;
|
|
534
536
|
},
|
|
535
537
|
// 공통코드 초기화
|
|
536
538
|
clearCodes: () => {
|
|
537
|
-
|
|
539
|
+
I.getState().clearData();
|
|
538
540
|
}
|
|
539
541
|
}),
|
|
540
542
|
{
|
|
541
543
|
name: "option-storage",
|
|
542
|
-
partialize: (
|
|
544
|
+
partialize: (n) => ({
|
|
543
545
|
// 상태는 중앙 스토어에서 관리하므로 여기서는 저장하지 않음
|
|
544
546
|
})
|
|
545
547
|
}
|
|
546
548
|
)
|
|
547
|
-
),
|
|
548
|
-
|
|
549
|
-
(
|
|
549
|
+
), Pe = N()(
|
|
550
|
+
M(
|
|
551
|
+
(n, r) => ({
|
|
550
552
|
// 공통 데이터 스토어에서 상태 가져오기
|
|
551
553
|
get codeData() {
|
|
552
|
-
return
|
|
554
|
+
return I.getState().codeData;
|
|
553
555
|
},
|
|
554
556
|
get isLoading() {
|
|
555
|
-
return
|
|
557
|
+
return I.getState().isLoading;
|
|
556
558
|
},
|
|
557
559
|
get error() {
|
|
558
|
-
return
|
|
560
|
+
return I.getState().error;
|
|
559
561
|
},
|
|
560
562
|
get lastUpdated() {
|
|
561
|
-
return
|
|
563
|
+
return I.getState().lastUpdated;
|
|
562
564
|
},
|
|
563
565
|
// 공통코드 가져오기 (중앙 스토어 사용)
|
|
564
566
|
fetchCommonCodes: async () => {
|
|
565
|
-
await
|
|
567
|
+
await I.getState().fetchData();
|
|
566
568
|
},
|
|
567
569
|
// 코드를 던졌을 때 컬러코드를 리턴 (대규모 최적화)
|
|
568
570
|
getColorCode: (e) => {
|
|
@@ -570,9 +572,9 @@ const H = (r) => (s) => {
|
|
|
570
572
|
const o = l.cacheHits.get(`color_${e}`) || 0;
|
|
571
573
|
return l.cacheHits.set(`color_${e}`, o + 1), l.colorCache.get(e);
|
|
572
574
|
}
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
for (const o of Object.values(
|
|
575
|
+
const s = I.getState().codeData;
|
|
576
|
+
if (!s) return null;
|
|
577
|
+
for (const o of Object.values(s))
|
|
576
578
|
for (const t of Object.values(o))
|
|
577
579
|
if (t.codeValue === e)
|
|
578
580
|
return l.colorCache.set(
|
|
@@ -588,10 +590,10 @@ const H = (r) => (s) => {
|
|
|
588
590
|
const t = l.cacheHits.get(e) || 0;
|
|
589
591
|
return l.cacheHits.set(e, t + 1), l.optionCache.get(e);
|
|
590
592
|
}
|
|
591
|
-
const
|
|
592
|
-
if (!
|
|
593
|
+
const s = I.getState().codeData;
|
|
594
|
+
if (!s) return [];
|
|
593
595
|
const o = [];
|
|
594
|
-
return Object.values(
|
|
596
|
+
return Object.values(s).forEach((t) => {
|
|
595
597
|
Object.values(t).forEach((a) => {
|
|
596
598
|
a.labelColor && o.push({
|
|
597
599
|
code: a.codeValue,
|
|
@@ -602,17 +604,17 @@ const H = (r) => (s) => {
|
|
|
602
604
|
},
|
|
603
605
|
// 공통코드 초기화
|
|
604
606
|
clearCodes: () => {
|
|
605
|
-
|
|
607
|
+
I.getState().clearData();
|
|
606
608
|
}
|
|
607
609
|
}),
|
|
608
610
|
{
|
|
609
611
|
name: "color-storage",
|
|
610
|
-
partialize: (
|
|
612
|
+
partialize: (n) => ({
|
|
611
613
|
// 상태는 중앙 스토어에서 관리하므로 여기서는 저장하지 않음
|
|
612
614
|
})
|
|
613
615
|
}
|
|
614
616
|
)
|
|
615
|
-
),
|
|
617
|
+
), de = (n, r) => ({
|
|
616
618
|
nodes: {},
|
|
617
619
|
rootIds: [],
|
|
618
620
|
loadedFor: void 0,
|
|
@@ -620,63 +622,73 @@ const H = (r) => (s) => {
|
|
|
620
622
|
error: void 0,
|
|
621
623
|
treeNodes: [],
|
|
622
624
|
// ====== 셀렉터 ======
|
|
623
|
-
isMenuBookmarked: (e) => Object.values(
|
|
624
|
-
(
|
|
625
|
+
isMenuBookmarked: (e) => Object.values(r().nodes).some(
|
|
626
|
+
(s) => s.type === "M" && s.menuId === e
|
|
625
627
|
),
|
|
626
628
|
getPrntBkmkIdByMenuId: (e) => {
|
|
627
|
-
const
|
|
628
|
-
return
|
|
629
|
+
const s = O(r().nodes, e);
|
|
630
|
+
return s ? r().nodes[s]?.prntBkmkId ?? "-" : "-";
|
|
629
631
|
},
|
|
630
632
|
getNodeByMenuId: (e) => {
|
|
631
|
-
const
|
|
632
|
-
if (!
|
|
633
|
-
const o =
|
|
633
|
+
const s = O(r().nodes, e);
|
|
634
|
+
if (!s) return null;
|
|
635
|
+
const o = r().nodes[s];
|
|
634
636
|
return o?.type === "M" ? o : null;
|
|
635
637
|
},
|
|
636
638
|
getFolderTree: (e) => {
|
|
637
|
-
const { nodes:
|
|
638
|
-
const
|
|
639
|
-
if (!
|
|
640
|
-
const
|
|
641
|
-
return t(
|
|
642
|
-
key:
|
|
643
|
-
title: `📁 ${
|
|
644
|
-
children:
|
|
639
|
+
const { nodes: s, rootIds: o } = r(), t = (d) => e ? d.toLowerCase().includes(e.toLowerCase()) : !0, a = (d) => {
|
|
640
|
+
const c = s[d];
|
|
641
|
+
if (!c || c.type !== "F") return null;
|
|
642
|
+
const i = c, p = (i.children || []).map((m) => s[m]).filter((m) => !!m && m.type === "F").map((m) => a(m.bkmkId)).filter(Boolean);
|
|
643
|
+
return t(i.bkmkNm) || p.length > 0 ? {
|
|
644
|
+
key: i.bkmkId,
|
|
645
|
+
title: `📁 ${i.bkmkNm}`,
|
|
646
|
+
children: p.length ? p : void 0
|
|
645
647
|
} : null;
|
|
646
648
|
};
|
|
647
|
-
return o.map((
|
|
649
|
+
return o.map((d) => a(d)).filter(Boolean);
|
|
648
650
|
},
|
|
649
651
|
// ====== 로더 ======
|
|
650
|
-
loadFavorites: async (e,
|
|
651
|
-
console.log("loadFavorites ::::: ", e,
|
|
652
|
-
const o =
|
|
653
|
-
if (!(!
|
|
654
|
-
|
|
652
|
+
loadFavorites: async (e, s = !1) => {
|
|
653
|
+
console.log("loadFavorites ::::: ", e, s);
|
|
654
|
+
const o = r();
|
|
655
|
+
if (!(!s && o.loadedFor === e && Object.keys(o.nodes).length)) {
|
|
656
|
+
n({ loading: !0, error: void 0 });
|
|
655
657
|
try {
|
|
656
|
-
const t = await
|
|
657
|
-
|
|
658
|
-
|
|
658
|
+
const t = await b("SCMBKMK00101", { userId: e }), a = Array.isArray(t?.sub) ? t.sub : [], d = ce(a), c = P(
|
|
659
|
+
d.nodes,
|
|
660
|
+
d.rootIds
|
|
659
661
|
);
|
|
660
|
-
|
|
661
|
-
...
|
|
662
|
-
treeNodes:
|
|
662
|
+
n({
|
|
663
|
+
...d,
|
|
664
|
+
treeNodes: c,
|
|
663
665
|
loadedFor: e,
|
|
664
666
|
loading: !1
|
|
665
667
|
});
|
|
666
668
|
} catch (t) {
|
|
667
|
-
throw
|
|
669
|
+
throw n({ loading: !1, error: t?.message || "즐겨찾기 로드 실패" }), t;
|
|
668
670
|
}
|
|
669
671
|
}
|
|
670
672
|
},
|
|
671
673
|
loadFavoritesIfNeeded: async (e) => {
|
|
672
|
-
const
|
|
673
|
-
(
|
|
674
|
+
const s = r();
|
|
675
|
+
(s.loadedFor !== e || Object.keys(s.nodes).length === 0) && await r().loadFavorites(e);
|
|
676
|
+
},
|
|
677
|
+
clearFavorites: () => {
|
|
678
|
+
n({
|
|
679
|
+
nodes: {},
|
|
680
|
+
rootIds: [],
|
|
681
|
+
treeNodes: [],
|
|
682
|
+
loadedFor: void 0,
|
|
683
|
+
loading: !1,
|
|
684
|
+
error: void 0
|
|
685
|
+
}), console.log("📚 북마크 스토어 초기화 완료");
|
|
674
686
|
},
|
|
675
687
|
// ====== 공통: 생성 ======
|
|
676
688
|
addNode: async (e) => {
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
const a = e.sortOrdr ?? $(t, e.prntBkmkId),
|
|
689
|
+
const s = _(r()), o = pe();
|
|
690
|
+
n((t) => {
|
|
691
|
+
const a = e.sortOrdr ?? $(t, e.prntBkmkId), d = {
|
|
680
692
|
...t,
|
|
681
693
|
nodes: {
|
|
682
694
|
...t.nodes,
|
|
@@ -703,11 +715,11 @@ const H = (r) => (s) => {
|
|
|
703
715
|
rootIds: t.rootIds.slice(),
|
|
704
716
|
treeNodes: t.treeNodes
|
|
705
717
|
};
|
|
706
|
-
return
|
|
718
|
+
return le(d, o, e.prntBkmkId), d.treeNodes = P(d.nodes, d.rootIds), d;
|
|
707
719
|
});
|
|
708
720
|
try {
|
|
709
721
|
let t = o;
|
|
710
|
-
const a = $(
|
|
722
|
+
const a = $(r(), e.prntBkmkId), d = await b("SCMBKMK00102", {
|
|
711
723
|
iudFlag: "I",
|
|
712
724
|
type: e.type,
|
|
713
725
|
sysCd: e.sysCd,
|
|
@@ -718,55 +730,55 @@ const H = (r) => (s) => {
|
|
|
718
730
|
prntBkmkId: e.prntBkmkId,
|
|
719
731
|
menuId: e.menuId,
|
|
720
732
|
sortOrdr: a,
|
|
721
|
-
chngId:
|
|
733
|
+
chngId: v()
|
|
722
734
|
});
|
|
723
|
-
return t = String(
|
|
724
|
-
const
|
|
735
|
+
return t = String(d?.bkmkId ?? d?.itemId ?? o), n((c) => {
|
|
736
|
+
const i = ue(c, o, t);
|
|
725
737
|
return {
|
|
726
|
-
...
|
|
727
|
-
treeNodes:
|
|
738
|
+
...i,
|
|
739
|
+
treeNodes: P(i.nodes, i.rootIds)
|
|
728
740
|
};
|
|
729
741
|
}), t;
|
|
730
742
|
} catch (t) {
|
|
731
|
-
throw
|
|
743
|
+
throw n(s), t;
|
|
732
744
|
}
|
|
733
745
|
},
|
|
734
746
|
// ====== 공통: 이동 ======
|
|
735
|
-
moveNode: async ({ bkmkId: e, newPrntBkmkId:
|
|
736
|
-
const a =
|
|
737
|
-
if (!
|
|
738
|
-
if (
|
|
739
|
-
const
|
|
740
|
-
if (!
|
|
747
|
+
moveNode: async ({ bkmkId: e, newPrntBkmkId: s, sortOrdr: o, userId: t }) => {
|
|
748
|
+
const a = r(), d = structuredClone(a.nodes), c = [...a.rootIds], i = d[e];
|
|
749
|
+
if (!i) return;
|
|
750
|
+
if (s !== "-") {
|
|
751
|
+
const u = d[s];
|
|
752
|
+
if (!u || u.type !== "F")
|
|
741
753
|
throw new Error("부모는 폴더만 가능합니다.");
|
|
742
754
|
}
|
|
743
|
-
const
|
|
755
|
+
const p = i.prntBkmkId ?? "-", h = p === "-" ? c : d[p].children ||= [];
|
|
744
756
|
{
|
|
745
|
-
const
|
|
746
|
-
|
|
757
|
+
const u = h.indexOf(e);
|
|
758
|
+
u >= 0 && h.splice(u, 1);
|
|
747
759
|
}
|
|
748
|
-
const m =
|
|
760
|
+
const m = s === "-" ? c : d[s].children ||= [];
|
|
749
761
|
m.splice(
|
|
750
762
|
Math.max(0, Math.min(o, m.length)),
|
|
751
763
|
0,
|
|
752
764
|
e
|
|
753
|
-
),
|
|
765
|
+
), i.prntBkmkId = s, n({ nodes: d, rootIds: c }), x(d, c, s), x(d, c, p);
|
|
754
766
|
try {
|
|
755
|
-
await
|
|
767
|
+
await b("SCMBKMK00104", {
|
|
756
768
|
// 백엔드 명칭 호환
|
|
757
769
|
bkmkId: e,
|
|
758
|
-
prntBkmkId:
|
|
770
|
+
prntBkmkId: s,
|
|
759
771
|
sortOrdr: o,
|
|
760
772
|
chngId: t
|
|
761
773
|
});
|
|
762
|
-
} catch (
|
|
763
|
-
throw
|
|
774
|
+
} catch (u) {
|
|
775
|
+
throw n(a), u;
|
|
764
776
|
}
|
|
765
777
|
},
|
|
766
778
|
// ====== 공통: 삭제 ======
|
|
767
779
|
removeNode: async (e) => {
|
|
768
|
-
const
|
|
769
|
-
|
|
780
|
+
const s = _(r());
|
|
781
|
+
n((o) => {
|
|
770
782
|
if (!o.nodes[e]) return o;
|
|
771
783
|
const t = {
|
|
772
784
|
...o,
|
|
@@ -774,126 +786,127 @@ const H = (r) => (s) => {
|
|
|
774
786
|
rootIds: o.rootIds.slice(),
|
|
775
787
|
treeNodes: o.treeNodes
|
|
776
788
|
};
|
|
777
|
-
return
|
|
789
|
+
return J(t, e), t.treeNodes = P(t.nodes, t.rootIds), t;
|
|
778
790
|
});
|
|
779
791
|
try {
|
|
780
|
-
await
|
|
792
|
+
await b("SCMBKMK00103", { bkmkId: e });
|
|
781
793
|
} catch (o) {
|
|
782
|
-
throw
|
|
794
|
+
throw n(s), o;
|
|
783
795
|
}
|
|
784
796
|
},
|
|
785
797
|
// ====== 공통: 수정 ======
|
|
786
|
-
editNode: async ({ bkmkId: e, userId:
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
const
|
|
790
|
-
return
|
|
791
|
-
...
|
|
798
|
+
editNode: async ({ bkmkId: e, userId: s, bkmkNm: o, prntBkmkId: t, sortOrdr: a }) => {
|
|
799
|
+
const d = _(r());
|
|
800
|
+
n((c) => {
|
|
801
|
+
const i = { ...c, nodes: { ...c.nodes } }, p = i.nodes[e];
|
|
802
|
+
return p?.type === "F" && typeof o == "string" && (i.nodes[e] = {
|
|
803
|
+
...p,
|
|
792
804
|
bkmkNm: o
|
|
793
|
-
}),
|
|
805
|
+
}), i;
|
|
794
806
|
});
|
|
795
807
|
try {
|
|
796
|
-
await
|
|
808
|
+
await b("SCMBKMK00102", {
|
|
797
809
|
iudFlag: "U",
|
|
798
|
-
userId:
|
|
810
|
+
userId: s,
|
|
799
811
|
bkmkId: e,
|
|
800
812
|
bkmkNm: o,
|
|
801
813
|
prntBkmkId: t,
|
|
802
814
|
sortOrdr: a,
|
|
803
|
-
chngId:
|
|
815
|
+
chngId: v()
|
|
804
816
|
});
|
|
805
|
-
} catch (
|
|
806
|
-
throw
|
|
817
|
+
} catch (c) {
|
|
818
|
+
throw n(d), c;
|
|
807
819
|
}
|
|
808
820
|
},
|
|
809
821
|
// ====== 호환용 래퍼 ======
|
|
810
|
-
addFolder: async (e,
|
|
822
|
+
addFolder: async (e, s, o, t) => await r().addNode({
|
|
811
823
|
type: "F",
|
|
812
824
|
bkmkNm: e,
|
|
813
|
-
prntBkmkId:
|
|
825
|
+
prntBkmkId: s,
|
|
814
826
|
sysCd: o,
|
|
815
827
|
userId: t
|
|
816
828
|
}),
|
|
817
|
-
addMenuToFolder: async (e,
|
|
829
|
+
addMenuToFolder: async (e, s) => O(r().nodes, s.menuId) ? "이미 북마크에 저장된 메뉴입니다." : await r().addNode({
|
|
818
830
|
type: "M",
|
|
819
831
|
prntBkmkId: e,
|
|
820
832
|
sysCd: "KH",
|
|
821
|
-
userId:
|
|
822
|
-
menuId:
|
|
823
|
-
menuNm:
|
|
833
|
+
userId: v(),
|
|
834
|
+
menuId: s.menuId,
|
|
835
|
+
menuNm: s.menuNm
|
|
824
836
|
}),
|
|
825
|
-
toggleMenuFavorite: async (e,
|
|
826
|
-
|
|
827
|
-
|
|
837
|
+
toggleMenuFavorite: async (e, s) => {
|
|
838
|
+
if (!e) return;
|
|
839
|
+
const o = r(), t = Object.values(o.nodes).find(
|
|
840
|
+
(d) => d.type === "M" && d.menuId === s.menuId
|
|
828
841
|
);
|
|
829
842
|
if (t) {
|
|
830
|
-
await
|
|
843
|
+
await r().removeNode(t.bkmkId);
|
|
831
844
|
return;
|
|
832
845
|
}
|
|
833
|
-
let a =
|
|
834
|
-
a || (await
|
|
846
|
+
let a = U(o);
|
|
847
|
+
a || (await r().loadFavorites(e, !0), a = U(r())), a && await r().addNode({
|
|
835
848
|
type: "M",
|
|
836
849
|
prntBkmkId: a,
|
|
837
850
|
sysCd: "KH",
|
|
838
|
-
userId:
|
|
839
|
-
menuId:
|
|
840
|
-
menuNm:
|
|
851
|
+
userId: v(),
|
|
852
|
+
menuId: s.menuId,
|
|
853
|
+
menuNm: s.menuNm
|
|
841
854
|
});
|
|
842
855
|
},
|
|
843
856
|
removeMenuByMenuId: async (e) => {
|
|
844
|
-
const
|
|
845
|
-
o && await
|
|
857
|
+
const s = r(), o = O(s.nodes, e);
|
|
858
|
+
o && await r().removeNode(o);
|
|
846
859
|
},
|
|
847
860
|
removeMenu: async (e) => {
|
|
848
|
-
await
|
|
861
|
+
await r().removeNode(e);
|
|
849
862
|
},
|
|
850
863
|
removeFolder: async (e) => {
|
|
851
|
-
await
|
|
864
|
+
await r().removeNode(e);
|
|
852
865
|
},
|
|
853
|
-
editFolder: async (e,
|
|
854
|
-
await
|
|
866
|
+
editFolder: async (e, s, o, t, a) => {
|
|
867
|
+
await r().editNode({
|
|
855
868
|
bkmkId: e,
|
|
856
|
-
userId:
|
|
869
|
+
userId: s,
|
|
857
870
|
bkmkNm: o,
|
|
858
871
|
prntBkmkId: t,
|
|
859
872
|
sortOrdr: a
|
|
860
873
|
});
|
|
861
874
|
},
|
|
862
875
|
/** Ant Tree 데이터 변환 (검색 포함) */
|
|
863
|
-
convertToAntTreeData: (e,
|
|
864
|
-
const a = (
|
|
865
|
-
const
|
|
866
|
-
if (!
|
|
867
|
-
if (
|
|
868
|
-
const
|
|
869
|
-
return a(
|
|
870
|
-
key:
|
|
876
|
+
convertToAntTreeData: (e, s, o, t = !1) => {
|
|
877
|
+
const a = (c) => o ? c.toLowerCase().includes(o.toLowerCase()) : !0, d = (c) => {
|
|
878
|
+
const i = e[c];
|
|
879
|
+
if (!i || t && i.type !== "F") return null;
|
|
880
|
+
if (i.type === "F") {
|
|
881
|
+
const p = i, h = (p.children || []).map((u) => d(u)).filter(Boolean);
|
|
882
|
+
return a(p.bkmkNm) || h.length > 0 ? {
|
|
883
|
+
key: p.bkmkId,
|
|
871
884
|
type: "F",
|
|
872
|
-
title: `📁 ${
|
|
873
|
-
bkmkNm:
|
|
874
|
-
prntBkmkId:
|
|
875
|
-
sortOrdr:
|
|
876
|
-
fullPath:
|
|
877
|
-
children:
|
|
885
|
+
title: `📁 ${p.bkmkNm}`,
|
|
886
|
+
bkmkNm: p.bkmkNm,
|
|
887
|
+
prntBkmkId: p.prntBkmkId,
|
|
888
|
+
sortOrdr: p.sortOrdr,
|
|
889
|
+
fullPath: p.fullPath,
|
|
890
|
+
children: h.length ? h : void 0
|
|
878
891
|
} : null;
|
|
879
892
|
} else {
|
|
880
|
-
const
|
|
881
|
-
return a(
|
|
882
|
-
key:
|
|
893
|
+
const p = i, h = p.menuNm ? `${p.menuNm} (${p.menuId})` : p.menuId;
|
|
894
|
+
return a(h) ? {
|
|
895
|
+
key: p.bkmkId,
|
|
883
896
|
type: "M",
|
|
884
|
-
title: `📄 ${
|
|
885
|
-
prntBkmkId:
|
|
886
|
-
sortOrdr:
|
|
887
|
-
fullPath:
|
|
897
|
+
title: `📄 ${h}`,
|
|
898
|
+
prntBkmkId: p.prntBkmkId,
|
|
899
|
+
sortOrdr: p.sortOrdr,
|
|
900
|
+
fullPath: p.fullPath,
|
|
888
901
|
isLeaf: !0
|
|
889
902
|
} : null;
|
|
890
903
|
}
|
|
891
904
|
};
|
|
892
|
-
return
|
|
905
|
+
return s.map(d).filter(Boolean);
|
|
893
906
|
}
|
|
894
|
-
}),
|
|
895
|
-
function
|
|
896
|
-
const
|
|
907
|
+
}), q = N(de);
|
|
908
|
+
function ce(n) {
|
|
909
|
+
const r = {}, e = [], s = (o) => {
|
|
897
910
|
o.forEach((t) => {
|
|
898
911
|
const a = {
|
|
899
912
|
type: t.type,
|
|
@@ -905,174 +918,174 @@ function ee(r) {
|
|
|
905
918
|
fullPath: t.fullPath ?? t.FULL_PATH
|
|
906
919
|
};
|
|
907
920
|
if (t.type === "F") {
|
|
908
|
-
|
|
921
|
+
r[a.bkmkId] = {
|
|
909
922
|
...a,
|
|
910
923
|
bkmkNm: t.bkmkNm ?? t.BKMK_NM ?? t.name ?? a.bkmkId,
|
|
911
924
|
children: []
|
|
912
925
|
};
|
|
913
|
-
const
|
|
914
|
-
|
|
926
|
+
const d = Array.isArray(t.children) ? t.children : [];
|
|
927
|
+
s(d);
|
|
915
928
|
} else
|
|
916
|
-
|
|
929
|
+
r[a.bkmkId] = {
|
|
917
930
|
...a,
|
|
918
931
|
menuId: t.menuId ?? t.MENU_ID ?? "",
|
|
919
932
|
menuNm: t.menuNm ?? t.MENU_NM
|
|
920
933
|
};
|
|
921
934
|
});
|
|
922
935
|
};
|
|
923
|
-
return n
|
|
936
|
+
return s(n), Object.values(r).forEach((o) => {
|
|
924
937
|
if (o.prntBkmkId && o.prntBkmkId !== "-") {
|
|
925
|
-
const t =
|
|
938
|
+
const t = r[o.prntBkmkId];
|
|
926
939
|
t?.type === "F" && t.children.push(o.bkmkId);
|
|
927
940
|
} else o.type === "F" && e.push(o.bkmkId);
|
|
928
|
-
}), e.sort((o, t) => (
|
|
941
|
+
}), e.sort((o, t) => (r[o].sortOrdr ?? 0) - (r[t].sortOrdr ?? 0)), Object.values(r).forEach((o) => {
|
|
929
942
|
o.type === "F" && o.children.sort(
|
|
930
|
-
(a,
|
|
943
|
+
(a, d) => (r[a].sortOrdr ?? 0) - (r[d].sortOrdr ?? 0)
|
|
931
944
|
);
|
|
932
|
-
}), { nodes:
|
|
945
|
+
}), { nodes: r, rootIds: e };
|
|
933
946
|
}
|
|
934
|
-
function
|
|
947
|
+
function _(n) {
|
|
935
948
|
return {
|
|
936
|
-
...
|
|
937
|
-
nodes: JSON.parse(JSON.stringify(
|
|
938
|
-
rootIds:
|
|
949
|
+
...n,
|
|
950
|
+
nodes: JSON.parse(JSON.stringify(n.nodes)),
|
|
951
|
+
rootIds: n.rootIds.slice()
|
|
939
952
|
};
|
|
940
953
|
}
|
|
941
|
-
function
|
|
954
|
+
function pe() {
|
|
942
955
|
return `tmp_${Math.random().toString(36).slice(2, 10)}`;
|
|
943
956
|
}
|
|
944
|
-
function $(
|
|
945
|
-
if (!
|
|
946
|
-
const e =
|
|
957
|
+
function $(n, r) {
|
|
958
|
+
if (!r || r === "-") return n.rootIds.length;
|
|
959
|
+
const e = n.nodes[r];
|
|
947
960
|
return e ? e.children.length : 0;
|
|
948
961
|
}
|
|
949
|
-
function
|
|
950
|
-
const
|
|
951
|
-
if (
|
|
962
|
+
function le(n, r, e) {
|
|
963
|
+
const s = n.nodes[r];
|
|
964
|
+
if (s)
|
|
952
965
|
if (e && e !== "-") {
|
|
953
|
-
const o =
|
|
966
|
+
const o = n.nodes[e];
|
|
954
967
|
if (!o || o.type !== "F") return;
|
|
955
|
-
|
|
968
|
+
s.prntBkmkId = e, o.children = [...o.children, r];
|
|
956
969
|
} else
|
|
957
|
-
|
|
970
|
+
s.prntBkmkId = "-", n.rootIds = [...n.rootIds, r];
|
|
958
971
|
}
|
|
959
|
-
function
|
|
960
|
-
const e =
|
|
972
|
+
function ie(n, r) {
|
|
973
|
+
const e = n.nodes[r];
|
|
961
974
|
if (!e) return;
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
const o =
|
|
965
|
-
o?.type === "F" && (o.children = o.children.filter((t) => t !==
|
|
975
|
+
const s = e.prntBkmkId;
|
|
976
|
+
if (s && s !== "-") {
|
|
977
|
+
const o = n.nodes[s];
|
|
978
|
+
o?.type === "F" && (o.children = o.children.filter((t) => t !== r));
|
|
966
979
|
} else
|
|
967
|
-
|
|
980
|
+
n.rootIds = n.rootIds.filter((o) => o !== r);
|
|
968
981
|
}
|
|
969
|
-
function
|
|
970
|
-
const e =
|
|
982
|
+
function J(n, r) {
|
|
983
|
+
const e = n.nodes[r];
|
|
971
984
|
if (!e) return;
|
|
972
|
-
e.type === "F" && e.children.slice().forEach((a) =>
|
|
973
|
-
const { [
|
|
974
|
-
|
|
985
|
+
e.type === "F" && e.children.slice().forEach((a) => J(n, a)), ie(n, r);
|
|
986
|
+
const { [r]: s, ...o } = n.nodes;
|
|
987
|
+
n.nodes = o;
|
|
975
988
|
}
|
|
976
|
-
function
|
|
977
|
-
if (
|
|
978
|
-
const
|
|
979
|
-
if (!
|
|
980
|
-
const o = JSON.parse(JSON.stringify(
|
|
989
|
+
function ue(n, r, e) {
|
|
990
|
+
if (r === e) return n;
|
|
991
|
+
const s = n.nodes[r];
|
|
992
|
+
if (!s) return n;
|
|
993
|
+
const o = JSON.parse(JSON.stringify(s));
|
|
981
994
|
o.bkmkId = e;
|
|
982
|
-
const t = { ...
|
|
983
|
-
delete t[
|
|
984
|
-
let a =
|
|
995
|
+
const t = { ...n.nodes, [e]: o };
|
|
996
|
+
delete t[r];
|
|
997
|
+
let a = n.rootIds;
|
|
985
998
|
if (o.prntBkmkId && o.prntBkmkId !== "-") {
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
...
|
|
989
|
-
children:
|
|
999
|
+
const d = t[o.prntBkmkId];
|
|
1000
|
+
d?.type === "F" && (t[o.prntBkmkId] = {
|
|
1001
|
+
...d,
|
|
1002
|
+
children: d.children.map((c) => c === r ? e : c)
|
|
990
1003
|
});
|
|
991
1004
|
} else
|
|
992
|
-
a =
|
|
993
|
-
return { ...
|
|
1005
|
+
a = n.rootIds.map((d) => d === r ? e : d);
|
|
1006
|
+
return { ...n, nodes: t, rootIds: a };
|
|
994
1007
|
}
|
|
995
|
-
function
|
|
996
|
-
return
|
|
1008
|
+
function U(n) {
|
|
1009
|
+
return n.rootIds.find((r) => n.nodes[r]?.type === "F") ?? null;
|
|
997
1010
|
}
|
|
998
|
-
function
|
|
1011
|
+
function P(n, r) {
|
|
999
1012
|
const e = {};
|
|
1000
|
-
Object.values(
|
|
1001
|
-
const
|
|
1002
|
-
!
|
|
1013
|
+
Object.values(n).forEach((c) => {
|
|
1014
|
+
const i = c.bkmkId, p = c.prntBkmkId;
|
|
1015
|
+
!i || !p || p === "-" || p === i || (e[p] ??= []).push(i);
|
|
1003
1016
|
});
|
|
1004
|
-
const
|
|
1005
|
-
if (
|
|
1006
|
-
const
|
|
1007
|
-
if (!
|
|
1008
|
-
|
|
1017
|
+
const s = /* @__PURE__ */ new Set(), o = (c) => {
|
|
1018
|
+
if (s.has(c)) return null;
|
|
1019
|
+
const i = n[c];
|
|
1020
|
+
if (!i) return null;
|
|
1021
|
+
s.add(c);
|
|
1009
1022
|
try {
|
|
1010
|
-
if (
|
|
1011
|
-
const
|
|
1023
|
+
if (i.type === "F") {
|
|
1024
|
+
const h = i, m = e[c] ?? [];
|
|
1012
1025
|
return {
|
|
1013
1026
|
type: "F",
|
|
1014
|
-
bkmkId:
|
|
1015
|
-
bkmkNm:
|
|
1016
|
-
prntBkmkId:
|
|
1027
|
+
bkmkId: c,
|
|
1028
|
+
bkmkNm: h.bkmkNm,
|
|
1029
|
+
prntBkmkId: h.prntBkmkId,
|
|
1017
1030
|
children: m.map(o).filter(Boolean)
|
|
1018
1031
|
};
|
|
1019
1032
|
}
|
|
1020
|
-
const
|
|
1033
|
+
const p = i;
|
|
1021
1034
|
return {
|
|
1022
1035
|
type: "M",
|
|
1023
|
-
bkmkId:
|
|
1024
|
-
bkmkNm:
|
|
1025
|
-
menuId:
|
|
1026
|
-
menuNm:
|
|
1027
|
-
prntBkmkId:
|
|
1036
|
+
bkmkId: c,
|
|
1037
|
+
bkmkNm: p.menuNm,
|
|
1038
|
+
menuId: p.menuId,
|
|
1039
|
+
menuNm: p.menuNm,
|
|
1040
|
+
prntBkmkId: p.prntBkmkId
|
|
1028
1041
|
};
|
|
1029
1042
|
} finally {
|
|
1030
|
-
|
|
1043
|
+
s.delete(c);
|
|
1031
1044
|
}
|
|
1032
|
-
}, t = Object.values(
|
|
1045
|
+
}, t = Object.values(n).filter((c) => c.prntBkmkId === "-" && c.type === "M").map((c) => c.bkmkId), a = Object.values(n).filter((c) => c.prntBkmkId === "-" && c.type === "F").map((c) => c.bkmkId);
|
|
1033
1046
|
return Array.from(
|
|
1034
|
-
/* @__PURE__ */ new Set([...
|
|
1047
|
+
/* @__PURE__ */ new Set([...r, ...t, ...a])
|
|
1035
1048
|
).map(o).filter(Boolean);
|
|
1036
1049
|
}
|
|
1037
|
-
function
|
|
1038
|
-
for (const e of Object.values(
|
|
1039
|
-
if (e.type === "M" && e.menuId ===
|
|
1050
|
+
function O(n, r) {
|
|
1051
|
+
for (const e of Object.values(n))
|
|
1052
|
+
if (e.type === "M" && e.menuId === r) return e.bkmkId;
|
|
1040
1053
|
return null;
|
|
1041
1054
|
}
|
|
1042
|
-
function
|
|
1043
|
-
(!e || e === "-" ?
|
|
1044
|
-
const a =
|
|
1055
|
+
function x(n, r, e) {
|
|
1056
|
+
(!e || e === "-" ? r : n[e].children || []).forEach((o, t) => {
|
|
1057
|
+
const a = n[o];
|
|
1045
1058
|
a && (a.sortOrdr = t);
|
|
1046
1059
|
});
|
|
1047
1060
|
}
|
|
1048
|
-
const
|
|
1061
|
+
const B = {
|
|
1049
1062
|
DEFAULT_PRNT_GBCD: 1
|
|
1050
|
-
},
|
|
1051
|
-
let
|
|
1052
|
-
const
|
|
1053
|
-
if (
|
|
1054
|
-
const
|
|
1055
|
-
if (
|
|
1056
|
-
if (
|
|
1063
|
+
}, me = (n) => n && typeof n == "object" && typeof n.menuId == "string" && typeof n.menuNm == "string", j = (n) => Array.isArray(n) && n.every(me);
|
|
1064
|
+
let K = [], z = [];
|
|
1065
|
+
const Ce = (n) => {
|
|
1066
|
+
if (n && typeof n == "object") {
|
|
1067
|
+
const r = n;
|
|
1068
|
+
if (r.menus && j(r.menus)) return r.menus;
|
|
1069
|
+
if (j(n)) return n;
|
|
1057
1070
|
}
|
|
1058
1071
|
return console.warn("⚠️ 메뉴 응답이 비어있거나 예상과 다릅니다."), [];
|
|
1059
|
-
},
|
|
1060
|
-
if (
|
|
1061
|
-
(t, a) => t.menuId ===
|
|
1072
|
+
}, fe = (n, r) => !!r && n.crprCd === r.crprCd && n.userId === r.userId && (n.prntGbcd ?? B.DEFAULT_PRNT_GBCD) === (r.prntGbcd ?? B.DEFAULT_PRNT_GBCD), he = (n) => {
|
|
1073
|
+
if (K.length === n.length && K.every(
|
|
1074
|
+
(t, a) => t.menuId === n[a]?.menuId && t.menuPrntId === n[a]?.menuPrntId
|
|
1062
1075
|
))
|
|
1063
|
-
return
|
|
1064
|
-
if (!
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
const a =
|
|
1068
|
-
a && (t.menuPrntId && t.menuPrntId !== "" && t.menuPrntId !== "-" ?
|
|
1076
|
+
return z;
|
|
1077
|
+
if (!n.length) return [];
|
|
1078
|
+
const r = /* @__PURE__ */ new Map(), e = [];
|
|
1079
|
+
n.forEach((t) => t?.menuId && r.set(t.menuId, { ...t, children: [] })), n.forEach((t) => {
|
|
1080
|
+
const a = r.get(t.menuId);
|
|
1081
|
+
a && (t.menuPrntId && t.menuPrntId !== "" && t.menuPrntId !== "-" ? r.get(t.menuPrntId)?.children?.push(a) : e.push(a));
|
|
1069
1082
|
});
|
|
1070
|
-
const
|
|
1083
|
+
const s = (t) => t.sort((a, d) => (a?.menuNo ?? 0) - (d?.menuNo ?? 0)).map((a) => ({
|
|
1071
1084
|
...a,
|
|
1072
|
-
children: a.children && a.children.length ?
|
|
1073
|
-
})), o =
|
|
1074
|
-
return
|
|
1075
|
-
},
|
|
1085
|
+
children: a.children && a.children.length ? s(a.children) : void 0
|
|
1086
|
+
})), o = s(e);
|
|
1087
|
+
return K = [...n], z = o, o;
|
|
1088
|
+
}, R = N((n, r) => ({
|
|
1076
1089
|
// 📊 초기 상태값
|
|
1077
1090
|
menuList: [],
|
|
1078
1091
|
flatMenuList: [],
|
|
@@ -1081,35 +1094,35 @@ const ae = (r) => {
|
|
|
1081
1094
|
_lastFetchParams: null,
|
|
1082
1095
|
// 🔧 메뉴 모델 조회
|
|
1083
1096
|
// 서버에서 사용자별 메뉴 권한 데이터를 가져와서 트리/플랫 구조로 저장
|
|
1084
|
-
fetchMenu: async ({ crprCd: e, userId:
|
|
1097
|
+
fetchMenu: async ({ crprCd: e, userId: s, prntGbcd: o }) => {
|
|
1085
1098
|
const t = {
|
|
1086
1099
|
crprCd: e,
|
|
1087
|
-
userId:
|
|
1088
|
-
prntGbcd: o ??
|
|
1100
|
+
userId: s,
|
|
1101
|
+
prntGbcd: o ?? B.DEFAULT_PRNT_GBCD
|
|
1089
1102
|
};
|
|
1090
|
-
if (
|
|
1103
|
+
if (fe(t, r()._lastFetchParams)) {
|
|
1091
1104
|
console.log("✅ 중복 fetch 차단", t);
|
|
1092
1105
|
return;
|
|
1093
1106
|
}
|
|
1094
|
-
|
|
1107
|
+
n({ isLoading: !0, error: null, _lastFetchParams: t });
|
|
1095
1108
|
try {
|
|
1096
|
-
const a = await
|
|
1097
|
-
|
|
1098
|
-
flatMenuList:
|
|
1109
|
+
const a = await b(E("AUTH_MENU"), t), d = Ce(a), c = he(d);
|
|
1110
|
+
n({
|
|
1111
|
+
flatMenuList: d,
|
|
1099
1112
|
// 평면 리스트 저장
|
|
1100
|
-
menuList:
|
|
1113
|
+
menuList: c,
|
|
1101
1114
|
// 트리 구조 저장
|
|
1102
1115
|
isLoading: !1,
|
|
1103
1116
|
error: null
|
|
1104
1117
|
});
|
|
1105
1118
|
} catch (a) {
|
|
1106
|
-
|
|
1119
|
+
n({ isLoading: !1, error: a?.message ?? "메뉴 로드 실패" });
|
|
1107
1120
|
}
|
|
1108
1121
|
},
|
|
1109
1122
|
// 🔧 메뉴 모델 초기화
|
|
1110
1123
|
// 로그아웃 시나 사용자 변경 시 메뉴 모델 클리어
|
|
1111
1124
|
clearMenu: () => {
|
|
1112
|
-
|
|
1125
|
+
n({
|
|
1113
1126
|
menuList: [],
|
|
1114
1127
|
flatMenuList: [],
|
|
1115
1128
|
error: null,
|
|
@@ -1119,123 +1132,136 @@ const ae = (r) => {
|
|
|
1119
1132
|
// 🔧 메뉴 ID로 메뉴 아이템 찾기
|
|
1120
1133
|
// URL 파라미터나 프로그래밍 방식으로 특정 메뉴를 찾을 때 사용
|
|
1121
1134
|
findMenuById: (e) => {
|
|
1122
|
-
const { flatMenuList:
|
|
1123
|
-
return
|
|
1135
|
+
const { flatMenuList: s } = r();
|
|
1136
|
+
return s.find((o) => o.menuId === e) ?? null;
|
|
1124
1137
|
}
|
|
1125
|
-
})),
|
|
1138
|
+
})), F = {
|
|
1126
1139
|
MAX_TABS: 15
|
|
1127
|
-
},
|
|
1140
|
+
}, W = N((n, r) => ({
|
|
1128
1141
|
// 📊 초기 상태값
|
|
1129
1142
|
activeMenuId: null,
|
|
1130
1143
|
activeMenuItem: null,
|
|
1131
1144
|
activeDetailItem: null,
|
|
1132
1145
|
tabs: [],
|
|
1133
1146
|
sidebarCollapsed: !1,
|
|
1134
|
-
maxTabs:
|
|
1147
|
+
maxTabs: F.MAX_TABS,
|
|
1135
1148
|
tabProtectFlag: {},
|
|
1136
1149
|
tabParams: {},
|
|
1137
1150
|
componentLabelMap: {},
|
|
1151
|
+
clearMenuViewStore: () => {
|
|
1152
|
+
n({
|
|
1153
|
+
activeMenuId: null,
|
|
1154
|
+
activeMenuItem: null,
|
|
1155
|
+
activeDetailItem: null,
|
|
1156
|
+
tabs: [],
|
|
1157
|
+
sidebarCollapsed: !1,
|
|
1158
|
+
maxTabs: F.MAX_TABS,
|
|
1159
|
+
tabProtectFlag: {},
|
|
1160
|
+
tabParams: {},
|
|
1161
|
+
componentLabelMap: {}
|
|
1162
|
+
});
|
|
1163
|
+
},
|
|
1138
1164
|
// 🔧 탭 추가 (메뉴 아이템 객체로)
|
|
1139
1165
|
// 사이드바에서 메뉴 클릭 시 호출되는 메인 함수
|
|
1140
|
-
openTabFromMenu: (e,
|
|
1141
|
-
const { tabs: o } =
|
|
1166
|
+
openTabFromMenu: (e, s) => {
|
|
1167
|
+
const { tabs: o } = r(), t = o.find((d) => d.key === e.menuId), a = o.find((d) => d.key === e.menuId);
|
|
1142
1168
|
if (t)
|
|
1143
|
-
a != null ? (
|
|
1169
|
+
a != null ? (n({ activeMenuId: e.menuId, activeMenuItem: e }), r().setTabParams(e.menuId, s || {}), e?.prsnInfoYn === "Y" && r().setProtectFlagForKey(e.menuId)) : L.warning("유효하지 않은 메뉴정보입니다.");
|
|
1144
1170
|
else {
|
|
1145
|
-
if (o.length >
|
|
1146
|
-
console.warn("❌ 최대 탭 개수를 초과했습니다."),
|
|
1147
|
-
`최대 ${
|
|
1171
|
+
if (o.length > F.MAX_TABS) {
|
|
1172
|
+
console.warn("❌ 최대 탭 개수를 초과했습니다."), L.warning(
|
|
1173
|
+
`최대 ${F.MAX_TABS}개의 탭만 열 수 있습니다.
|
|
1148
1174
|
기존 탭을 닫고 다시 시도해주세요.`
|
|
1149
1175
|
);
|
|
1150
1176
|
return;
|
|
1151
1177
|
}
|
|
1152
|
-
const
|
|
1178
|
+
const d = {
|
|
1153
1179
|
key: e.menuId,
|
|
1154
1180
|
label: e.menuNm,
|
|
1155
1181
|
gubun: "M",
|
|
1156
1182
|
menuItem: e,
|
|
1157
1183
|
closable: !0
|
|
1158
1184
|
};
|
|
1159
|
-
|
|
1160
|
-
tabs: [...o,
|
|
1185
|
+
n({
|
|
1186
|
+
tabs: [...o, d],
|
|
1161
1187
|
// 탭 목록에 추가
|
|
1162
1188
|
activeMenuId: e.menuId,
|
|
1163
1189
|
// 새 탭을 활성화
|
|
1164
1190
|
activeMenuItem: e
|
|
1165
1191
|
// 현재 프로그램으로 설정
|
|
1166
|
-
}),
|
|
1192
|
+
}), r().setTabParams(e.menuId, s || {}), e?.prsnInfoYn === "Y" && r().setProtectFlagForKey(e.menuId);
|
|
1167
1193
|
}
|
|
1168
1194
|
},
|
|
1169
1195
|
// 🔧 탭 추가 (메뉴 ID로)
|
|
1170
1196
|
// URL 파라미터로 메뉴 열기 시 사용 (예: ?menuId=CM000301)
|
|
1171
|
-
openTabByMenuId: (e,
|
|
1172
|
-
const o =
|
|
1173
|
-
o ?
|
|
1197
|
+
openTabByMenuId: (e, s) => {
|
|
1198
|
+
const o = R.getState().findMenuById(e);
|
|
1199
|
+
o ? r().openTabFromMenu(o, s) : L.warning("메뉴 ID를 찾을 수 없습니다.");
|
|
1174
1200
|
},
|
|
1175
|
-
openDetailView: (e,
|
|
1176
|
-
const { tabs: t } =
|
|
1177
|
-
if (t.find((
|
|
1178
|
-
|
|
1201
|
+
openDetailView: (e, s, o) => {
|
|
1202
|
+
const { tabs: t } = r();
|
|
1203
|
+
if (t.find((d) => d.key === e.viewId))
|
|
1204
|
+
r().focusTab(e.viewId);
|
|
1179
1205
|
else {
|
|
1180
|
-
const
|
|
1206
|
+
const d = {
|
|
1181
1207
|
key: e.viewId,
|
|
1182
1208
|
label: e.viewLabel,
|
|
1183
1209
|
gubun: "C",
|
|
1184
1210
|
componentItem: {
|
|
1185
|
-
scrnPath:
|
|
1211
|
+
scrnPath: s,
|
|
1186
1212
|
prsnInfoYn: o,
|
|
1187
1213
|
prntInfo: e.prntInfo
|
|
1188
1214
|
},
|
|
1189
1215
|
closable: !0
|
|
1190
1216
|
};
|
|
1191
|
-
|
|
1192
|
-
tabs: [...t,
|
|
1217
|
+
n({
|
|
1218
|
+
tabs: [...t, d],
|
|
1193
1219
|
// 탭 목록에 추가
|
|
1194
1220
|
activeMenuId: e.viewId,
|
|
1195
1221
|
// 새 탭을 활성화
|
|
1196
1222
|
activeDetailItem: e
|
|
1197
|
-
}),
|
|
1223
|
+
}), r().setTabParams(e.viewId, e.viewParams || {});
|
|
1198
1224
|
}
|
|
1199
1225
|
},
|
|
1200
1226
|
// 🔧 탭 제거
|
|
1201
1227
|
// X 버튼 클릭 시 탭을 닫고 관련 상태도 정리
|
|
1202
1228
|
closeTab: (e) => {
|
|
1203
|
-
const { tabs:
|
|
1204
|
-
|
|
1205
|
-
const t =
|
|
1229
|
+
const { tabs: s, activeMenuId: o } = r();
|
|
1230
|
+
s.find((d) => d.key === e);
|
|
1231
|
+
const t = s.filter((d) => d.key !== e);
|
|
1206
1232
|
let a = o;
|
|
1207
1233
|
if (o === e) {
|
|
1208
|
-
const
|
|
1209
|
-
a = t.length ? t[Math.min(
|
|
1234
|
+
const d = s.findIndex((c) => c.key === e);
|
|
1235
|
+
a = t.length ? t[Math.min(d, t.length - 1)]?.key ?? null : null;
|
|
1210
1236
|
}
|
|
1211
|
-
|
|
1237
|
+
n({
|
|
1212
1238
|
tabs: t
|
|
1213
|
-
}), a &&
|
|
1239
|
+
}), a && r().focusTab(a);
|
|
1214
1240
|
},
|
|
1215
1241
|
// 🔧 활성 탭 변경
|
|
1216
1242
|
// 탭 헤더 클릭 시 해당 탭으로 전환
|
|
1217
1243
|
focusTab: (e) => {
|
|
1218
|
-
const { tabs:
|
|
1244
|
+
const { tabs: s } = r(), o = s.find((t) => t.key === e);
|
|
1219
1245
|
if (o) {
|
|
1220
1246
|
const t = o.gubun === "C" ? {
|
|
1221
1247
|
viewId: o.key,
|
|
1222
1248
|
viewLabel: o.label,
|
|
1223
1249
|
prntInfo: o.componentItem?.prntInfo
|
|
1224
1250
|
} : null;
|
|
1225
|
-
o.menuItem?.prsnInfoYn === "Y" ? (
|
|
1251
|
+
o.menuItem?.prsnInfoYn === "Y" ? (n({
|
|
1226
1252
|
activeMenuId: e,
|
|
1227
1253
|
activeMenuItem: o.menuItem,
|
|
1228
1254
|
activeDetailItem: t
|
|
1229
1255
|
}), console.log(
|
|
1230
1256
|
"✅ 탭 포커스 (개인정보) - activeMenuItem:",
|
|
1231
1257
|
o.menuItem
|
|
1232
|
-
),
|
|
1258
|
+
), r().setProtectFlagForKey(e)) : (n({
|
|
1233
1259
|
activeMenuId: e,
|
|
1234
1260
|
activeMenuItem: o.menuItem,
|
|
1235
1261
|
activeDetailItem: t
|
|
1236
|
-
}),
|
|
1262
|
+
}), r().clearProtectFlagForKey(e));
|
|
1237
1263
|
} else
|
|
1238
|
-
|
|
1264
|
+
n({
|
|
1239
1265
|
activeMenuId: e,
|
|
1240
1266
|
activeMenuItem: null,
|
|
1241
1267
|
activeDetailItem: null
|
|
@@ -1243,7 +1269,7 @@ const ae = (r) => {
|
|
|
1243
1269
|
},
|
|
1244
1270
|
// 🔧 모든 탭 제거
|
|
1245
1271
|
// 로그아웃이나 전체 초기화 시 사용
|
|
1246
|
-
closeAllTabs: () =>
|
|
1272
|
+
closeAllTabs: () => n({
|
|
1247
1273
|
tabs: [],
|
|
1248
1274
|
activeMenuId: null,
|
|
1249
1275
|
activeMenuItem: null,
|
|
@@ -1251,215 +1277,687 @@ const ae = (r) => {
|
|
|
1251
1277
|
}),
|
|
1252
1278
|
// 🔧 사이드바 토글
|
|
1253
1279
|
// 햄버거 메뉴 클릭 시 사이드바 접기/펼치기
|
|
1254
|
-
toggleSidebar: () =>
|
|
1280
|
+
toggleSidebar: () => n((e) => ({ sidebarCollapsed: !e.sidebarCollapsed })),
|
|
1255
1281
|
// useMenuViewStore.ts
|
|
1256
|
-
reorderTabs: (e) =>
|
|
1257
|
-
const o = new Map(
|
|
1282
|
+
reorderTabs: (e) => n((s) => {
|
|
1283
|
+
const o = new Map(s.tabs.map((t) => [t.key, t]));
|
|
1258
1284
|
return { tabs: e.map((t) => o.get(t)).filter(Boolean) };
|
|
1259
1285
|
}),
|
|
1260
1286
|
// 개인정보 포함여부에 따른 탭 잠금 Flag 설정
|
|
1261
|
-
setProtectFlagForKey: (e) =>
|
|
1262
|
-
tabProtectFlag: { ...
|
|
1287
|
+
setProtectFlagForKey: (e) => n((s) => ({
|
|
1288
|
+
tabProtectFlag: { ...s.tabProtectFlag, [e]: !0 }
|
|
1263
1289
|
})),
|
|
1264
1290
|
// 개인정보 포함여부에 따른 탭 잠금 해제
|
|
1265
|
-
clearProtectFlagForKey: (e) =>
|
|
1266
|
-
const o = { ...
|
|
1291
|
+
clearProtectFlagForKey: (e) => n((s) => {
|
|
1292
|
+
const o = { ...s.tabProtectFlag };
|
|
1267
1293
|
return delete o[e], { tabProtectFlag: o };
|
|
1268
1294
|
}),
|
|
1269
1295
|
// 탭 파라미터 설정
|
|
1270
|
-
setTabParams: (e,
|
|
1271
|
-
const t = o.tabParams[e] || {}, a = { ...
|
|
1272
|
-
return Object.keys(t).length === Object.keys(a).length && Object.keys(a).every((
|
|
1296
|
+
setTabParams: (e, s) => n((o) => {
|
|
1297
|
+
const t = o.tabParams[e] || {}, a = { ...s || {} };
|
|
1298
|
+
return Object.keys(t).length === Object.keys(a).length && Object.keys(a).every((c) => t[c] === a[c]) ? o : {
|
|
1273
1299
|
tabParams: { ...o.tabParams, [e]: a }
|
|
1274
1300
|
};
|
|
1275
1301
|
}),
|
|
1276
1302
|
// 컴포넌트 라벨 맵 설정
|
|
1277
|
-
setComponentLabelMap: (e,
|
|
1278
|
-
})),
|
|
1303
|
+
setComponentLabelMap: (e, s) => n({ componentLabelMap: e })
|
|
1304
|
+
})), Ie = N((n, r) => ({
|
|
1279
1305
|
popups: [],
|
|
1280
1306
|
activePopupId: null,
|
|
1281
1307
|
isLoading: !1,
|
|
1282
1308
|
error: null,
|
|
1283
1309
|
zIndexSeed: 1e3,
|
|
1284
1310
|
// 팝업 열기
|
|
1285
|
-
openPopup: async (e,
|
|
1286
|
-
|
|
1311
|
+
openPopup: async (e, s, o) => {
|
|
1312
|
+
n({ isLoading: !0, error: null });
|
|
1287
1313
|
try {
|
|
1288
1314
|
let t = null;
|
|
1289
|
-
const a = await
|
|
1290
|
-
crprCd:
|
|
1315
|
+
const a = await b(E("SRCH_POPU"), {
|
|
1316
|
+
crprCd: Q()?.crprCd,
|
|
1291
1317
|
popuCd: e
|
|
1292
1318
|
});
|
|
1293
1319
|
t = a?.mstr;
|
|
1294
|
-
const
|
|
1320
|
+
const d = a?.dtls || [];
|
|
1295
1321
|
if (!t || !t.popuUrl) {
|
|
1296
|
-
const
|
|
1297
|
-
throw console.error(
|
|
1322
|
+
const u = `팝업 정보를 찾을 수 없습니다: ${e}`;
|
|
1323
|
+
throw console.error(u), new Error(u);
|
|
1298
1324
|
}
|
|
1299
|
-
const
|
|
1325
|
+
const i = ((u) => `/src/pages/views/popup/${u}`)(t.popuUrl), p = r().zIndexSeed + 1, h = {
|
|
1300
1326
|
popupId: `popup_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
1301
1327
|
popupCode: e,
|
|
1302
1328
|
//config.title을 통해 팝업 제목 변경 가능
|
|
1303
1329
|
popupTitle: o?.title || t.popuNm || "팝업",
|
|
1304
|
-
popupUrl:
|
|
1305
|
-
popupParams:
|
|
1330
|
+
popupUrl: i,
|
|
1331
|
+
popupParams: s,
|
|
1306
1332
|
width: t.popuWdth || 800,
|
|
1307
1333
|
height: t.popuHght || 600,
|
|
1308
1334
|
resizable: !0,
|
|
1309
1335
|
draggable: !0,
|
|
1310
|
-
buttonList:
|
|
1336
|
+
buttonList: d,
|
|
1311
1337
|
// 버튼 목록 추가
|
|
1312
1338
|
config: o,
|
|
1313
|
-
zIndex:
|
|
1314
|
-
}, m =
|
|
1339
|
+
zIndex: p
|
|
1340
|
+
}, m = r().popups.find((u) => u.popupCode === e);
|
|
1315
1341
|
if (m) {
|
|
1316
|
-
|
|
1342
|
+
n({
|
|
1317
1343
|
activePopupId: m.popupId,
|
|
1318
|
-
popups:
|
|
1319
|
-
(
|
|
1344
|
+
popups: r().popups.map(
|
|
1345
|
+
(u) => u.popupId === m.popupId ? { ...u, config: o } : u
|
|
1320
1346
|
),
|
|
1321
1347
|
isLoading: !1
|
|
1322
1348
|
});
|
|
1323
1349
|
return;
|
|
1324
1350
|
}
|
|
1325
|
-
|
|
1326
|
-
popups: [...
|
|
1327
|
-
activePopupId:
|
|
1351
|
+
n((u) => ({
|
|
1352
|
+
popups: [...u.popups, h],
|
|
1353
|
+
activePopupId: h.popupId,
|
|
1328
1354
|
isLoading: !1,
|
|
1329
|
-
zIndexSeed:
|
|
1355
|
+
zIndexSeed: p
|
|
1330
1356
|
}));
|
|
1331
1357
|
} catch (t) {
|
|
1332
|
-
|
|
1358
|
+
n({
|
|
1333
1359
|
error: t instanceof Error ? t.message : "팝업 열기 실패",
|
|
1334
1360
|
isLoading: !1
|
|
1335
1361
|
});
|
|
1336
1362
|
}
|
|
1337
1363
|
},
|
|
1338
1364
|
// 로컬 팝업 열기 (DB 조회 없이 레지스트리 매핑으로 렌더)
|
|
1339
|
-
openCorePopup: (e,
|
|
1340
|
-
const o = `popup_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, t =
|
|
1341
|
-
...
|
|
1342
|
-
...
|
|
1365
|
+
openCorePopup: (e, s) => {
|
|
1366
|
+
const o = `popup_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, t = r().zIndexSeed + 1, d = oe[e]?.defaultConfig || {}, c = {
|
|
1367
|
+
...d,
|
|
1368
|
+
...s,
|
|
1343
1369
|
// buttons와 callback은 완전히 덮어쓰기 (병합하지 않음)
|
|
1344
|
-
buttons:
|
|
1345
|
-
callback:
|
|
1346
|
-
},
|
|
1370
|
+
buttons: s?.buttons !== void 0 ? s.buttons : d.buttons,
|
|
1371
|
+
callback: s?.callback !== void 0 ? s.callback : d.callback
|
|
1372
|
+
}, i = s?.defaultParams || {}, p = r().popups.find(
|
|
1347
1373
|
(m) => m.popupCode === e && m.isLocal
|
|
1348
1374
|
);
|
|
1349
|
-
if (
|
|
1350
|
-
const m =
|
|
1351
|
-
|
|
1352
|
-
popups:
|
|
1353
|
-
(
|
|
1354
|
-
...
|
|
1355
|
-
config:
|
|
1375
|
+
if (p) {
|
|
1376
|
+
const m = r().zIndexSeed + 1;
|
|
1377
|
+
n({ activePopupId: p.popupId, zIndexSeed: m }), n((u) => ({
|
|
1378
|
+
popups: u.popups.map(
|
|
1379
|
+
(f) => f.popupId === p.popupId ? {
|
|
1380
|
+
...f,
|
|
1381
|
+
config: c,
|
|
1356
1382
|
zIndex: m,
|
|
1357
1383
|
close: () => {
|
|
1358
|
-
|
|
1384
|
+
r().closePopup(p.popupId);
|
|
1359
1385
|
}
|
|
1360
|
-
} :
|
|
1386
|
+
} : f
|
|
1361
1387
|
)
|
|
1362
1388
|
}));
|
|
1363
1389
|
return;
|
|
1364
1390
|
}
|
|
1365
|
-
const
|
|
1391
|
+
const h = {
|
|
1366
1392
|
popupId: o,
|
|
1367
1393
|
popupCode: e,
|
|
1368
|
-
popupTitle:
|
|
1394
|
+
popupTitle: c.title || e,
|
|
1369
1395
|
popupUrl: "",
|
|
1370
1396
|
// 로컬 팝업은 URL 사용 안 함
|
|
1371
|
-
popupParams:
|
|
1372
|
-
width:
|
|
1373
|
-
height:
|
|
1374
|
-
resizable:
|
|
1375
|
-
draggable:
|
|
1397
|
+
popupParams: i,
|
|
1398
|
+
width: c.width || 1e3,
|
|
1399
|
+
height: c.height || 700,
|
|
1400
|
+
resizable: c.resizable !== void 0 ? c.resizable : !0,
|
|
1401
|
+
draggable: c.draggable !== void 0 ? c.draggable : !0,
|
|
1376
1402
|
buttonList: [],
|
|
1377
|
-
config:
|
|
1403
|
+
config: c,
|
|
1378
1404
|
isLocal: !0,
|
|
1379
1405
|
zIndex: t,
|
|
1380
1406
|
close: () => {
|
|
1381
|
-
|
|
1407
|
+
r().closePopup(o);
|
|
1382
1408
|
}
|
|
1383
1409
|
};
|
|
1384
|
-
|
|
1385
|
-
popups: [...m.popups,
|
|
1410
|
+
n((m) => ({
|
|
1411
|
+
popups: [...m.popups, h],
|
|
1386
1412
|
activePopupId: o,
|
|
1387
1413
|
zIndexSeed: t
|
|
1388
1414
|
}));
|
|
1389
1415
|
},
|
|
1390
1416
|
// 팝업 닫기
|
|
1391
1417
|
closePopup: (e) => {
|
|
1392
|
-
const { popups:
|
|
1418
|
+
const { popups: s, activePopupId: o } = r(), t = s.filter((d) => d.popupId !== e);
|
|
1393
1419
|
let a = o;
|
|
1394
|
-
o === e && (a = t.length > 0 ? t[t.length - 1].popupId : null),
|
|
1420
|
+
o === e && (a = t.length > 0 ? t[t.length - 1].popupId : null), n({
|
|
1395
1421
|
popups: t,
|
|
1396
1422
|
activePopupId: a
|
|
1397
1423
|
});
|
|
1398
1424
|
},
|
|
1399
1425
|
// 모든 팝업 닫기
|
|
1400
1426
|
closeAllPopups: () => {
|
|
1401
|
-
|
|
1427
|
+
n({
|
|
1402
1428
|
popups: [],
|
|
1403
1429
|
activePopupId: null
|
|
1404
1430
|
});
|
|
1405
1431
|
},
|
|
1406
1432
|
// 활성 팝업 설정
|
|
1407
1433
|
setActivePopup: (e) => {
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1434
|
+
const s = r().zIndexSeed + 1;
|
|
1435
|
+
n((o) => ({
|
|
1410
1436
|
activePopupId: e,
|
|
1411
|
-
zIndexSeed:
|
|
1437
|
+
zIndexSeed: s,
|
|
1412
1438
|
popups: o.popups.map(
|
|
1413
|
-
(t) => t.popupId === e ? { ...t, zIndex:
|
|
1439
|
+
(t) => t.popupId === e ? { ...t, zIndex: s } : t
|
|
1414
1440
|
)
|
|
1415
1441
|
}));
|
|
1416
1442
|
},
|
|
1417
1443
|
// 팝업 설정 업데이트
|
|
1418
|
-
updatePopupConfig: (e,
|
|
1419
|
-
|
|
1444
|
+
updatePopupConfig: (e, s) => {
|
|
1445
|
+
n((o) => ({
|
|
1420
1446
|
popups: o.popups.map(
|
|
1421
|
-
(t) => t.popupId === e ? { ...t, config: { ...t.config, ...
|
|
1447
|
+
(t) => t.popupId === e ? { ...t, config: { ...t.config, ...s } } : t
|
|
1422
1448
|
)
|
|
1423
1449
|
}));
|
|
1424
1450
|
}
|
|
1425
|
-
})),
|
|
1451
|
+
})), Z = N()(
|
|
1452
|
+
M(
|
|
1453
|
+
(n, r) => ({
|
|
1454
|
+
systemMap: [],
|
|
1455
|
+
fetchSystemMap: async () => {
|
|
1456
|
+
n({
|
|
1457
|
+
systemMap: [
|
|
1458
|
+
{
|
|
1459
|
+
sysCd: "KE",
|
|
1460
|
+
appItCd: "ERPS",
|
|
1461
|
+
appCd: "SAP",
|
|
1462
|
+
systemNm: "K-ERP",
|
|
1463
|
+
appNm: "SAP"
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
sysCd: "KE",
|
|
1467
|
+
appItCd: "KERP",
|
|
1468
|
+
appCd: "FI",
|
|
1469
|
+
systemNm: "K-ERP",
|
|
1470
|
+
appNm: "재무회계"
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
sysCd: "KE",
|
|
1474
|
+
appItCd: "KERP",
|
|
1475
|
+
appCd: "FM",
|
|
1476
|
+
systemNm: "K-ERP",
|
|
1477
|
+
appNm: "예산관리"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
sysCd: "KE",
|
|
1481
|
+
appItCd: "KERP",
|
|
1482
|
+
appCd: "MM",
|
|
1483
|
+
systemNm: "K-ERP",
|
|
1484
|
+
appNm: "구매계약"
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
sysCd: "KE",
|
|
1488
|
+
appItCd: "KERP",
|
|
1489
|
+
appCd: "SD",
|
|
1490
|
+
systemNm: "K-ERP",
|
|
1491
|
+
appNm: "영업관리"
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
sysCd: "CH",
|
|
1495
|
+
appItCd: "KERP",
|
|
1496
|
+
appCd: "PMN",
|
|
1497
|
+
systemNm: "K-ERP",
|
|
1498
|
+
appNm: "파트너관리"
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
sysCd: "FB",
|
|
1502
|
+
appItCd: "FBK",
|
|
1503
|
+
appCd: "FBK",
|
|
1504
|
+
systemNm: "펌뱅킹",
|
|
1505
|
+
appNm: "펌뱅킹"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
sysCd: "IA",
|
|
1509
|
+
appItCd: "IAC",
|
|
1510
|
+
appCd: "IAC",
|
|
1511
|
+
systemNm: "내부회계",
|
|
1512
|
+
appNm: "내부회계"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
sysCd: "ET",
|
|
1516
|
+
appItCd: "ETAX",
|
|
1517
|
+
appCd: "ETAX",
|
|
1518
|
+
systemNm: "전자세금계산서",
|
|
1519
|
+
appNm: "전자세금계산서"
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
sysCd: "HR",
|
|
1523
|
+
appItCd: "KHR",
|
|
1524
|
+
appCd: "HR",
|
|
1525
|
+
systemNm: "K-HR",
|
|
1526
|
+
appNm: "HR 솔루션"
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
sysCd: "YT",
|
|
1530
|
+
appItCd: "KHYT",
|
|
1531
|
+
appCd: "YT",
|
|
1532
|
+
systemNm: "K-HR 연말정산",
|
|
1533
|
+
appNm: "연말정산"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
sysCd: "CM",
|
|
1537
|
+
appItCd: "KCM",
|
|
1538
|
+
appCd: "CM",
|
|
1539
|
+
systemNm: "K-HR 프레임워크 공통",
|
|
1540
|
+
appNm: "프레임워크 공통"
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
sysCd: "PA",
|
|
1544
|
+
appItCd: "KHPE",
|
|
1545
|
+
appCd: "PE",
|
|
1546
|
+
systemNm: "K-HR 평정",
|
|
1547
|
+
appNm: "평정"
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
sysCd: "OT",
|
|
1551
|
+
appItCd: "POF",
|
|
1552
|
+
appCd: "POF",
|
|
1553
|
+
systemNm: "시간외(PC-OFF)",
|
|
1554
|
+
appNm: "시간외(PC-OFF)"
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
sysCd: "DC",
|
|
1558
|
+
appItCd: "CDT",
|
|
1559
|
+
appCd: "CDT",
|
|
1560
|
+
systemNm: "전자계약",
|
|
1561
|
+
appNm: "전자계약"
|
|
1562
|
+
},
|
|
1563
|
+
{
|
|
1564
|
+
sysCd: "KS",
|
|
1565
|
+
appItCd: "EAUD",
|
|
1566
|
+
appCd: "EAUD",
|
|
1567
|
+
systemNm: "K-업무지원",
|
|
1568
|
+
appNm: "e-감사"
|
|
1569
|
+
},
|
|
1570
|
+
{
|
|
1571
|
+
sysCd: "KS",
|
|
1572
|
+
appItCd: "INR",
|
|
1573
|
+
appCd: "INR",
|
|
1574
|
+
systemNm: "K-업무지원",
|
|
1575
|
+
appNm: "청렴신고"
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
sysCd: "KS",
|
|
1579
|
+
appItCd: "ITSM",
|
|
1580
|
+
appCd: "ITAM",
|
|
1581
|
+
systemNm: "K-업무지원",
|
|
1582
|
+
appNm: "ITAM"
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
sysCd: "KS",
|
|
1586
|
+
appItCd: "CMM",
|
|
1587
|
+
appCd: "CMM",
|
|
1588
|
+
systemNm: "K-업무지원",
|
|
1589
|
+
appNm: "차량/회의실"
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
sysCd: "KS",
|
|
1593
|
+
appItCd: "OAM",
|
|
1594
|
+
appCd: "OAM",
|
|
1595
|
+
systemNm: "K-업무지원",
|
|
1596
|
+
appNm: "OA전산물품관리"
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
sysCd: "KS",
|
|
1600
|
+
appItCd: "KSGA",
|
|
1601
|
+
appCd: "GAM",
|
|
1602
|
+
systemNm: "K-업무지원",
|
|
1603
|
+
appNm: "총무관리"
|
|
1604
|
+
},
|
|
1605
|
+
{
|
|
1606
|
+
sysCd: "KS",
|
|
1607
|
+
appItCd: "KSGA",
|
|
1608
|
+
appCd: "ACM",
|
|
1609
|
+
systemNm: "K-업무지원",
|
|
1610
|
+
appNm: "출입관리"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
sysCd: "KS",
|
|
1614
|
+
appItCd: "KSGA",
|
|
1615
|
+
appCd: "IVM",
|
|
1616
|
+
systemNm: "K-업무지원",
|
|
1617
|
+
appNm: "비품관리"
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
sysCd: "KS",
|
|
1621
|
+
appItCd: "KSGA",
|
|
1622
|
+
appCd: "SGS",
|
|
1623
|
+
systemNm: "K-업무지원",
|
|
1624
|
+
appNm: "인장서비스"
|
|
1625
|
+
},
|
|
1626
|
+
{
|
|
1627
|
+
sysCd: "KS",
|
|
1628
|
+
appItCd: "HIS",
|
|
1629
|
+
appCd: "HIS",
|
|
1630
|
+
systemNm: "K-업무지원",
|
|
1631
|
+
appNm: "사료관리"
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
sysCd: "KS",
|
|
1635
|
+
appItCd: "WFAX",
|
|
1636
|
+
appCd: "WFAX",
|
|
1637
|
+
systemNm: "K-업무지원",
|
|
1638
|
+
appNm: "웹펙스서비스"
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
sysCd: "KS",
|
|
1642
|
+
appItCd: "SMS",
|
|
1643
|
+
appCd: "SMS",
|
|
1644
|
+
systemNm: "K-업무지원",
|
|
1645
|
+
appNm: "메시지서비스"
|
|
1646
|
+
},
|
|
1647
|
+
{
|
|
1648
|
+
sysCd: "KS",
|
|
1649
|
+
appItCd: "BID",
|
|
1650
|
+
appCd: "BID",
|
|
1651
|
+
systemNm: "K-업무지원",
|
|
1652
|
+
appNm: "경영공시"
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
sysCd: "KS",
|
|
1656
|
+
appItCd: "PAM",
|
|
1657
|
+
appCd: "PAM",
|
|
1658
|
+
systemNm: "K-업무지원",
|
|
1659
|
+
appNm: "언론미디어"
|
|
1660
|
+
},
|
|
1661
|
+
{
|
|
1662
|
+
sysCd: "KS",
|
|
1663
|
+
appItCd: "DAC",
|
|
1664
|
+
appCd: "DAC",
|
|
1665
|
+
systemNm: "K-업무지원",
|
|
1666
|
+
appNm: "심의자문위원회"
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
sysCd: "KS",
|
|
1670
|
+
appItCd: "IPR",
|
|
1671
|
+
appCd: "IPR",
|
|
1672
|
+
systemNm: "K-업무지원",
|
|
1673
|
+
appNm: "지식재산권신청"
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
sysCd: "KS",
|
|
1677
|
+
appItCd: "ISB",
|
|
1678
|
+
appCd: "ISB",
|
|
1679
|
+
systemNm: "K-업무지원",
|
|
1680
|
+
appNm: "정보공유게시판"
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
sysCd: "DE",
|
|
1684
|
+
appItCd: "BCOM",
|
|
1685
|
+
appCd: "BCOM",
|
|
1686
|
+
systemNm: "온통",
|
|
1687
|
+
appNm: "온통"
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
sysCd: "TS",
|
|
1691
|
+
appItCd: "ITSM",
|
|
1692
|
+
appCd: "ITSM",
|
|
1693
|
+
systemNm: "ITSM",
|
|
1694
|
+
appNm: "ITSM"
|
|
1695
|
+
},
|
|
1696
|
+
{
|
|
1697
|
+
sysCd: "EP",
|
|
1698
|
+
appItCd: "EPOP",
|
|
1699
|
+
appCd: "EPOP",
|
|
1700
|
+
systemNm: "국민신문고",
|
|
1701
|
+
appNm: "국민신문고"
|
|
1702
|
+
},
|
|
1703
|
+
{
|
|
1704
|
+
sysCd: "VC",
|
|
1705
|
+
appItCd: "VOC",
|
|
1706
|
+
appCd: "VOC",
|
|
1707
|
+
systemNm: "VOC",
|
|
1708
|
+
appNm: "VOC"
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
sysCd: "CC",
|
|
1712
|
+
appItCd: "CAL",
|
|
1713
|
+
appCd: "CAL",
|
|
1714
|
+
systemNm: "콜센터",
|
|
1715
|
+
appNm: "콜센터"
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
sysCd: "LA",
|
|
1719
|
+
appItCd: "LEG",
|
|
1720
|
+
appCd: "LEG",
|
|
1721
|
+
systemNm: "법규포털",
|
|
1722
|
+
appNm: "법규포털"
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
sysCd: "IM",
|
|
1726
|
+
appItCd: "IDXM",
|
|
1727
|
+
appCd: "IDXM",
|
|
1728
|
+
systemNm: "지수방법론",
|
|
1729
|
+
appNm: "지수방법론"
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
sysCd: "PM",
|
|
1733
|
+
appItCd: "ORM",
|
|
1734
|
+
appCd: "ORM",
|
|
1735
|
+
systemNm: "운영리스크관리",
|
|
1736
|
+
appNm: "운영리스크관리"
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
sysCd: "RF",
|
|
1740
|
+
appItCd: "RFID",
|
|
1741
|
+
appCd: "RFID",
|
|
1742
|
+
systemNm: "RFID(비품관리)",
|
|
1743
|
+
appNm: "RFID(비품관리)"
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
sysCd: "SL",
|
|
1747
|
+
appItCd: "SGM",
|
|
1748
|
+
appCd: "SGM",
|
|
1749
|
+
systemNm: "인장관리",
|
|
1750
|
+
appNm: "인장관리"
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
sysCd: "DM",
|
|
1754
|
+
appItCd: "LBS",
|
|
1755
|
+
appCd: "LBS",
|
|
1756
|
+
systemNm: "도서관리",
|
|
1757
|
+
appNm: "도서관리"
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
sysCd: "HE",
|
|
1761
|
+
appItCd: "RMS",
|
|
1762
|
+
appCd: "RMS",
|
|
1763
|
+
systemNm: "원격지원",
|
|
1764
|
+
appNm: "원격지원"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
sysCd: "WF",
|
|
1768
|
+
appItCd: "WFX",
|
|
1769
|
+
appCd: "WFX",
|
|
1770
|
+
systemNm: "WebFax",
|
|
1771
|
+
appNm: "WebFax"
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
sysCd: "SM",
|
|
1775
|
+
appItCd: "SMT",
|
|
1776
|
+
appCd: "SMT",
|
|
1777
|
+
systemNm: "SMS",
|
|
1778
|
+
appNm: "SMS"
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
sysCd: "SO",
|
|
1782
|
+
appItCd: "SSO",
|
|
1783
|
+
appCd: "SSO",
|
|
1784
|
+
systemNm: "SSO",
|
|
1785
|
+
appNm: "SSO"
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
sysCd: "SF",
|
|
1789
|
+
appItCd: "SFO",
|
|
1790
|
+
appCd: "SFO",
|
|
1791
|
+
systemNm: "생체인증(One Pass)",
|
|
1792
|
+
appNm: "생체인증 FIDO"
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
sysCd: "SP",
|
|
1796
|
+
appItCd: "SPO",
|
|
1797
|
+
appCd: "SPO",
|
|
1798
|
+
systemNm: "생체인증(장정맥)",
|
|
1799
|
+
appNm: "생체인증 장정맥"
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
sysCd: "AG",
|
|
1803
|
+
appItCd: "APG",
|
|
1804
|
+
appCd: "APG",
|
|
1805
|
+
systemNm: "API GW",
|
|
1806
|
+
appNm: "API Gateway"
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
sysCd: "AM",
|
|
1810
|
+
appItCd: "APM",
|
|
1811
|
+
appCd: "APM",
|
|
1812
|
+
systemNm: "APM",
|
|
1813
|
+
appNm: "APM"
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
sysCd: "JS",
|
|
1817
|
+
appItCd: "BXS",
|
|
1818
|
+
appCd: "BXS",
|
|
1819
|
+
systemNm: "배치스케줄러",
|
|
1820
|
+
appNm: "배치스케줄러"
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
sysCd: "DT",
|
|
1824
|
+
appItCd: "PDT",
|
|
1825
|
+
appCd: "PDT",
|
|
1826
|
+
systemNm: "개인정보변환",
|
|
1827
|
+
appNm: "개인정보변환"
|
|
1828
|
+
}
|
|
1829
|
+
]
|
|
1830
|
+
});
|
|
1831
|
+
},
|
|
1832
|
+
setSystemMap: (e) => {
|
|
1833
|
+
n({
|
|
1834
|
+
systemMap: e
|
|
1835
|
+
});
|
|
1836
|
+
},
|
|
1837
|
+
clearSystemMap: () => {
|
|
1838
|
+
n({ systemMap: [] });
|
|
1839
|
+
},
|
|
1840
|
+
getBySysCd: (e) => r().systemMap.filter((s) => s.sysCd === e),
|
|
1841
|
+
getByAppItCd: (e) => r().systemMap.filter((s) => s.appItCd === e),
|
|
1842
|
+
findByAppCd: (e) => r().systemMap.find((s) => s.appCd === e),
|
|
1843
|
+
filterSystemMap: (e) => {
|
|
1844
|
+
const { sysCd: s, appItCd: o, appCd: t } = e;
|
|
1845
|
+
return r().systemMap.filter((a) => (s ? a.sysCd === s : !0) && (o ? a.appItCd === o : !0) && (t ? a.appCd === t : !0));
|
|
1846
|
+
}
|
|
1847
|
+
}),
|
|
1848
|
+
{
|
|
1849
|
+
name: "system-info-store"
|
|
1850
|
+
// localStorage key
|
|
1851
|
+
}
|
|
1852
|
+
)
|
|
1853
|
+
), Oe = N((n) => ({
|
|
1426
1854
|
requestCount: 0,
|
|
1427
1855
|
loading: !1,
|
|
1428
|
-
showLoading: () =>
|
|
1429
|
-
const e =
|
|
1856
|
+
showLoading: () => n((r) => {
|
|
1857
|
+
const e = r.requestCount + 1;
|
|
1430
1858
|
return { requestCount: e, loading: e > 0 };
|
|
1431
1859
|
}),
|
|
1432
|
-
hideLoading: () =>
|
|
1433
|
-
const e = Math.max(0,
|
|
1860
|
+
hideLoading: () => n((r) => {
|
|
1861
|
+
const e = Math.max(0, r.requestCount - 1);
|
|
1434
1862
|
return { requestCount: e, loading: e > 0 };
|
|
1435
1863
|
})
|
|
1436
|
-
})),
|
|
1864
|
+
})), Fe = N((n) => ({
|
|
1437
1865
|
requestCount: 0,
|
|
1438
1866
|
loading: !1,
|
|
1439
|
-
showLoading: () =>
|
|
1440
|
-
const e =
|
|
1867
|
+
showLoading: () => n((r) => {
|
|
1868
|
+
const e = r.requestCount + 1;
|
|
1441
1869
|
return { requestCount: e, loading: e > 0 };
|
|
1442
1870
|
}),
|
|
1443
|
-
hideLoading: () =>
|
|
1444
|
-
const e = Math.max(0,
|
|
1871
|
+
hideLoading: () => n((r) => {
|
|
1872
|
+
const e = Math.max(0, r.requestCount - 1);
|
|
1445
1873
|
return { requestCount: e, loading: e > 0 };
|
|
1446
1874
|
})
|
|
1447
|
-
}))
|
|
1875
|
+
}));
|
|
1876
|
+
function ye() {
|
|
1877
|
+
const [n, r] = Y(!1), e = X((s) => {
|
|
1878
|
+
const o = s?.getModifierState?.("CapsLock");
|
|
1879
|
+
typeof o == "boolean" && r(o);
|
|
1880
|
+
}, []);
|
|
1881
|
+
return { capsOn: n, onKeyDown: e };
|
|
1882
|
+
}
|
|
1883
|
+
function Le(n) {
|
|
1884
|
+
const {
|
|
1885
|
+
loginApi: r,
|
|
1886
|
+
fetchCommonCodes: e,
|
|
1887
|
+
onAfterLogin: s,
|
|
1888
|
+
onError: o,
|
|
1889
|
+
rememberCookie: t = { enabled: !0, days: 30 }
|
|
1890
|
+
} = n, [a, d] = Y(!1), { capsOn: c, onKeyDown: i } = ye(), p = "SCMSIGN00101", h = `${__SYS_CD__}_login_id`, m = {
|
|
1891
|
+
id: t?.enabled ? ee(h) : void 0,
|
|
1892
|
+
pswr: void 0
|
|
1893
|
+
}, u = X(
|
|
1894
|
+
async (f, C) => {
|
|
1895
|
+
d(!0);
|
|
1896
|
+
try {
|
|
1897
|
+
const g = {
|
|
1898
|
+
crprCd: "100",
|
|
1899
|
+
id: f.id,
|
|
1900
|
+
pswr: await te(f.pswr)
|
|
1901
|
+
}, y = await (r ?? ((S) => b(p, S)))(g);
|
|
1902
|
+
if (y?.userInfo?.userId) {
|
|
1903
|
+
if (T.getState().setLoginUser(y.userInfo, y?.hrInfo), t?.enabled) {
|
|
1904
|
+
const S = t.days ?? 30;
|
|
1905
|
+
f.remember ? G(h, f.id ?? "", S) : G(h, "", 0);
|
|
1906
|
+
}
|
|
1907
|
+
return e ? await e() : await H.getState().fetchCommonCodes(), s ? s(y, C) : (L.success(`${y.userInfo.userNm}님 환영합니다.`), C("/main")), { user: y.userInfo, response: y };
|
|
1908
|
+
} else
|
|
1909
|
+
throw o?.({ user: y.userInfo, response: y, navigate: C }), new Error("사용자 정보가 유효하지 않습니다.");
|
|
1910
|
+
} catch (g) {
|
|
1911
|
+
throw o?.(g), g;
|
|
1912
|
+
} finally {
|
|
1913
|
+
d(!1);
|
|
1914
|
+
}
|
|
1915
|
+
},
|
|
1916
|
+
[
|
|
1917
|
+
p,
|
|
1918
|
+
r,
|
|
1919
|
+
e,
|
|
1920
|
+
s,
|
|
1921
|
+
o,
|
|
1922
|
+
t?.enabled,
|
|
1923
|
+
t?.days
|
|
1924
|
+
]
|
|
1925
|
+
);
|
|
1926
|
+
return {
|
|
1927
|
+
loading: a,
|
|
1928
|
+
capsOn: c,
|
|
1929
|
+
onKeyDown: i,
|
|
1930
|
+
prefills: m,
|
|
1931
|
+
doLogin: u
|
|
1932
|
+
};
|
|
1933
|
+
}
|
|
1934
|
+
function we() {
|
|
1935
|
+
const n = se();
|
|
1936
|
+
return () => {
|
|
1937
|
+
T.getState().clearLoginUser(), Z.getState().clearSystemMap(), H.getState().clearCodes(), R.getState().clearMenu(), W.getState().clearMenuViewStore(), q.getState().clearFavorites(), n("/login");
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
const De = () => H.getState(), _e = () => Ie.getState(), Ke = () => T.getState(), Ae = () => q.getState(), Be = () => R.getState(), Ee = () => W.getState(), Te = () => Z.getState();
|
|
1448
1941
|
export {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1942
|
+
ye as useCapsLock,
|
|
1943
|
+
De as useCode,
|
|
1944
|
+
H as useCodeStore,
|
|
1945
|
+
Pe as useColorStore,
|
|
1946
|
+
Ae as useFavorite,
|
|
1947
|
+
q as useFavoriteStore,
|
|
1948
|
+
Oe as useLoadingStore,
|
|
1949
|
+
Le as useLogin,
|
|
1950
|
+
we as useLogout,
|
|
1951
|
+
Be as useMenuModel,
|
|
1952
|
+
R as useMenuModelStore,
|
|
1953
|
+
Ee as useMenuView,
|
|
1954
|
+
W as useMenuViewStore,
|
|
1955
|
+
ve as useOptionStore,
|
|
1956
|
+
Fe as usePopupLoadingStore,
|
|
1957
|
+
_e as usePopupState,
|
|
1958
|
+
Ie as usePopupStore,
|
|
1959
|
+
Te as useSystemCode,
|
|
1960
|
+
Z as useSystemStore,
|
|
1961
|
+
Ke as useUser,
|
|
1962
|
+
T as useUserStore
|
|
1465
1963
|
};
|