@bwg-ui/core 1.3.6 → 1.3.8

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