@bwg-ui/core 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{CMSearchIntfGwP01-Bx5cpkhH.js → CMSearchIntfGwP01-Co6lrDf9.js} +9 -9
- package/dist/chunks/CMSearchIntfGwP01-Do_ZDjmX.cjs +1 -0
- package/dist/chunks/{MenuReport-DxJIaW8D.js → MenuReport-BTtoDFz-.js} +146 -141
- package/dist/chunks/MenuReport-Bn5NyNel.cjs +1 -0
- package/dist/chunks/{common-components-dzN5Nuq0.js → common-components-0IMhPxxg.js} +11521 -10978
- package/dist/chunks/common-components-Csd3OioX.cjs +1109 -0
- package/dist/chunks/core-components-CX6NGtTh.cjs +1 -0
- package/dist/chunks/core-components-Ckwf4Rd7.js +1969 -0
- package/dist/chunks/layout-components-BMLp8YAy.cjs +38 -0
- package/dist/chunks/{layout-components-B25FFvXj.js → layout-components-DphZY34c.js} +942 -741
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgEmpSearch.d.ts +28 -0
- package/dist/components/core/BwgEmpSearch.d.ts.map +1 -0
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +22 -1846
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.js +13 -13
- package/dist/components/layout/AppWrapper.d.ts +2 -1
- package/dist/components/layout/AppWrapper.d.ts.map +1 -1
- package/dist/components/layout/BwgCoreLogin.d.ts +1 -2
- package/dist/components/layout/BwgCoreLogin.d.ts.map +1 -1
- package/dist/components/layout/BwgSessionNotice.d.ts +15 -0
- package/dist/components/layout/BwgSessionNotice.d.ts.map +1 -0
- package/dist/components/layout/BwgSsoLogin.d.ts +19 -0
- package/dist/components/layout/BwgSsoLogin.d.ts.map +1 -0
- package/dist/components/layout/custom/ConfigurableHeader.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +16 -14
- package/dist/components/pages/board/CMAdminBoardM01.d.ts.map +1 -1
- package/dist/components/pages/board/CMMyBoardM01.d.ts.map +1 -1
- package/dist/components/popup/MenuReport.d.ts.map +1 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts +1 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts.map +1 -1
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +160 -157
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.d.ts +2 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +368 -335
- package/dist/stores/loginStore.d.ts +55 -10
- package/dist/stores/loginStore.d.ts.map +1 -1
- package/dist/stores/userStore.d.ts +1 -2
- package/dist/stores/userStore.d.ts.map +1 -1
- package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
- package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
- package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
- package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +455 -454
- package/package.json +1 -1
- package/dist/chunks/CMSearchIntfGwP01-Uhl4uqiV.cjs +0 -1
- package/dist/chunks/MenuReport-CPwq8w-z.cjs +0 -1
- package/dist/chunks/common-components-Dd_AsKs7.cjs +0 -1109
- package/dist/chunks/layout-components-Cz7Zets7.cjs +0 -35
|
@@ -1,1848 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button as te, Form as $, Checkbox as ce, ConfigProvider as le, DatePicker as ie, message as O, Card as Ye, List as re, Input as J, Spin as Le, Upload as q, Typography as be, Flex as me, Progress as Ie, notification as ve, Tooltip as Me, Select as de, Space as oe, InputNumber as De, Radio as _e, Switch as Ne } from "antd";
|
|
3
|
-
import { useMemo as X, memo as xe, useState as j, useEffect as P, forwardRef as Ae, useRef as K, cloneElement as Ee } from "react";
|
|
4
|
-
import { useUserStore as Be, usePopupStore as ze } from "../../stores/index.js";
|
|
5
|
-
import N from "dayjs";
|
|
6
|
-
import { PaperClipOutlined as Oe, DownloadOutlined as $e, DeleteOutlined as Re, InboxOutlined as Ue, UploadOutlined as ke, CloudUploadOutlined as Te, CheckCircleOutlined as je, CloseCircleOutlined as He, FileTextOutlined as Ke, CalendarOutlined as ue, ExclamationCircleOutlined as Ve, SearchOutlined as Pe } from "@ant-design/icons";
|
|
7
|
-
import { getApiDeps as ge, callServiceByAppCd as Ge, getCrprCd as We, callService as ee, getUserInfo as Q } from "../../utils/index.js";
|
|
8
|
-
import qe from "jszip";
|
|
9
|
-
import se from "imask";
|
|
10
|
-
import { c as Se } from "../../chunks/provider-VCa8UGvF.js";
|
|
11
|
-
import { debounce as Je, findIndex as ne } from "lodash";
|
|
12
|
-
import { DndProvider as Xe, useDrop as Ze, useDrag as Qe } from "react-dnd";
|
|
13
|
-
import { HTML5Backend as et } from "react-dnd-html5-backend";
|
|
14
|
-
const Lt = (t) => {
|
|
15
|
-
const { componentSize: r } = Be(), d = X(() => t.size ? t.size : {
|
|
16
|
-
0: "small",
|
|
17
|
-
1: "middle",
|
|
18
|
-
2: "large"
|
|
19
|
-
}[r], [r, t.size]), l = X(() => ({
|
|
20
|
-
0: 12,
|
|
21
|
-
// 작게
|
|
22
|
-
1: 14,
|
|
23
|
-
// 보통
|
|
24
|
-
2: 16
|
|
25
|
-
// 크게
|
|
26
|
-
})[r], [r]);
|
|
27
|
-
return /* @__PURE__ */ a(
|
|
28
|
-
te,
|
|
29
|
-
{
|
|
30
|
-
...t,
|
|
31
|
-
size: d,
|
|
32
|
-
className: "bwg-btn",
|
|
33
|
-
style: { fontSize: `${l}px`, ...t.style },
|
|
34
|
-
children: t.children
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
}, T = xe(
|
|
38
|
-
({
|
|
39
|
-
children: t,
|
|
40
|
-
label: r,
|
|
41
|
-
name: d,
|
|
42
|
-
rules: l,
|
|
43
|
-
initialValue: e,
|
|
44
|
-
style: s,
|
|
45
|
-
required: p,
|
|
46
|
-
...c
|
|
47
|
-
}) => {
|
|
48
|
-
const y = {
|
|
49
|
-
fontWeight: "bold"
|
|
50
|
-
};
|
|
51
|
-
(l == null || l == null) && p && (l = [
|
|
52
|
-
{
|
|
53
|
-
required: !0,
|
|
54
|
-
message: `${r}을(를) 입력해주세요.`
|
|
55
|
-
}
|
|
56
|
-
]);
|
|
57
|
-
const i = Array.isArray(l) && l.some((b) => b.required === !0), f = () => typeof r == "string" ? /* @__PURE__ */ G("span", { style: y, children: [
|
|
58
|
-
r,
|
|
59
|
-
i && /* @__PURE__ */ a("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
|
|
60
|
-
] }) : /* @__PURE__ */ a("span", { style: y, children: r });
|
|
61
|
-
return /* @__PURE__ */ a(
|
|
62
|
-
$.Item,
|
|
63
|
-
{
|
|
64
|
-
className: "bwg-form-item",
|
|
65
|
-
label: r ? f() : void 0,
|
|
66
|
-
labelAlign: c.labelAlign || "left",
|
|
67
|
-
name: d,
|
|
68
|
-
rules: l,
|
|
69
|
-
colon: !1,
|
|
70
|
-
initialValue: e,
|
|
71
|
-
style: s,
|
|
72
|
-
...c,
|
|
73
|
-
children: t
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
), It = ({
|
|
78
|
-
itemProps: t,
|
|
79
|
-
inputProps: r = {
|
|
80
|
-
format: "YN"
|
|
81
|
-
}
|
|
82
|
-
}) => {
|
|
83
|
-
const d = $.useFormInstance();
|
|
84
|
-
return /* @__PURE__ */ a(
|
|
85
|
-
T,
|
|
86
|
-
{
|
|
87
|
-
...t,
|
|
88
|
-
getValueProps: (e) => ({ checked: r.format === "boolean" ? !!e : e === "Y" }),
|
|
89
|
-
normalize: (e) => typeof e == "boolean" ? r.format === "boolean" ? e : e ? "Y" : "N" : r.format === "boolean" ? !!e : e ? "Y" : "N",
|
|
90
|
-
children: /* @__PURE__ */ a(ce, { ...r, onChange: (e) => {
|
|
91
|
-
r.format === "boolean" ? d.setFieldValue(t?.name, e.target.checked) : d.setFieldValue(t?.name, e.target.checked ? "Y" : "N"), r.onChange && r.onChange(e);
|
|
92
|
-
}, children: r?.title })
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
}, vt = ({ itemProps: t, inputProps: r }) => {
|
|
96
|
-
const d = $.useFormInstance(), [l, e] = j(
|
|
97
|
-
t?.initialValue ?? []
|
|
98
|
-
), [s, p] = j([]), c = s.length > 0 && s.length == l?.length, y = l?.length > 0 && l.length < s.length;
|
|
99
|
-
P(() => {
|
|
100
|
-
p(i(r?.options));
|
|
101
|
-
}, [r?.options]), P(() => {
|
|
102
|
-
e(l);
|
|
103
|
-
}, [l]);
|
|
104
|
-
const i = (k) => {
|
|
105
|
-
const D = [];
|
|
106
|
-
return (k || []).map((Y, R) => {
|
|
107
|
-
D.push(Y.value);
|
|
108
|
-
}), D;
|
|
109
|
-
}, f = (k) => {
|
|
110
|
-
e(k.target.checked ? s : []), d.setFieldValue(t?.name, k.target.checked ? s : []);
|
|
111
|
-
}, b = (k) => {
|
|
112
|
-
e(k), d.setFieldValue(t?.name, k), r?.onChange && typeof r?.onChange == "function" && r?.onChange(k);
|
|
113
|
-
};
|
|
114
|
-
return /* @__PURE__ */ a(T, { ...t, children: /* @__PURE__ */ G(le, { theme: {
|
|
115
|
-
components: {
|
|
116
|
-
Checkbox: {
|
|
117
|
-
colorPrimary: "var(--check-primary)",
|
|
118
|
-
colorPrimaryBorder: "var(--check-primary)",
|
|
119
|
-
colorPrimaryHover: "var(--check-primary-active)"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}, children: [
|
|
123
|
-
r?.allCheck && /* @__PURE__ */ a(
|
|
124
|
-
ce,
|
|
125
|
-
{
|
|
126
|
-
indeterminate: y,
|
|
127
|
-
checked: c,
|
|
128
|
-
onChange: f,
|
|
129
|
-
children: "전체선택"
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
/* @__PURE__ */ a(
|
|
133
|
-
ce.Group,
|
|
134
|
-
{
|
|
135
|
-
options: r?.options,
|
|
136
|
-
value: l,
|
|
137
|
-
onChange: b
|
|
138
|
-
}
|
|
139
|
-
)
|
|
140
|
-
] }) });
|
|
141
|
-
}, he = {
|
|
142
|
-
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
143
|
-
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
144
|
-
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
|
|
145
|
-
time: { displayFormat: "HH:mm", outputFormat: "HHmm" },
|
|
146
|
-
datetime: {
|
|
147
|
-
displayFormat: "YYYY-MM-DD HH:mm",
|
|
148
|
-
outputFormat: "YYYYMMDDHHmm"
|
|
149
|
-
}
|
|
150
|
-
}, Mt = ({
|
|
151
|
-
itemProps: t,
|
|
152
|
-
inputProps: r,
|
|
153
|
-
type: d = "date",
|
|
154
|
-
returnType: l = "string"
|
|
155
|
-
}) => {
|
|
156
|
-
const { displayFormat: e, outputFormat: s } = X(
|
|
157
|
-
() => he[d],
|
|
158
|
-
[d]
|
|
159
|
-
), p = X(
|
|
160
|
-
() => Object.values(he).map((c) => c.outputFormat).sort((c, y) => {
|
|
161
|
-
if (c.length === y.length) {
|
|
162
|
-
if (c === s) return -1;
|
|
163
|
-
if (y === s) return 1;
|
|
164
|
-
}
|
|
165
|
-
return y.length - c.length;
|
|
166
|
-
}),
|
|
167
|
-
[s]
|
|
168
|
-
// type(outputFormat)이 바뀔 때마다 재정렬
|
|
169
|
-
);
|
|
170
|
-
return /* @__PURE__ */ a(
|
|
171
|
-
T,
|
|
172
|
-
{
|
|
173
|
-
...t,
|
|
174
|
-
getValueProps: (c) => ({
|
|
175
|
-
// 폼에 저장된 값(문자열 또는 Dayjs)을 DatePicker가 요구하는 Dayjs로 변환
|
|
176
|
-
value: c ? N.isDayjs(c) ? c : N(c, p) : null
|
|
177
|
-
}),
|
|
178
|
-
normalize: (c) => c ? l === "dayjs" ? c : c.format(s) : null,
|
|
179
|
-
children: /* @__PURE__ */ a(
|
|
180
|
-
ie,
|
|
181
|
-
{
|
|
182
|
-
...r,
|
|
183
|
-
picker: d === "datetime" ? "date" : d,
|
|
184
|
-
showTime: r?.showTime ?? (d === "datetime" || d === "time"),
|
|
185
|
-
format: r?.format ? {
|
|
186
|
-
format: r?.format?.format,
|
|
187
|
-
type: "mask"
|
|
188
|
-
} : e
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
}, Dt = ({
|
|
194
|
-
fileGrpKey: t,
|
|
195
|
-
onFetchFilesTrxCd: r = "SCMFILE00101",
|
|
196
|
-
readOnly: d = !1,
|
|
197
|
-
appCd: l = __APP_CD__
|
|
198
|
-
}) => {
|
|
199
|
-
const [e, s] = j([]);
|
|
200
|
-
P(() => {
|
|
201
|
-
if (r)
|
|
202
|
-
if (l != __APP_CD__) {
|
|
203
|
-
const y = ge().findSystemByAppCd?.(l ?? __APP_CD__);
|
|
204
|
-
if (!y || !y.sysCd) {
|
|
205
|
-
console.error("해당 앱코드는 존재하지 않습니다.", l);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
Ge(
|
|
209
|
-
{ trxCd: r, appCd: l },
|
|
210
|
-
{
|
|
211
|
-
crprCd: We(),
|
|
212
|
-
sysCd: y.sysCd,
|
|
213
|
-
fileGrpKey: t
|
|
214
|
-
}
|
|
215
|
-
).then((i) => {
|
|
216
|
-
if (i?.sub) {
|
|
217
|
-
const f = i.sub.map((b) => ({
|
|
218
|
-
uid: b.fileKey,
|
|
219
|
-
name: b.lgclFileNm,
|
|
220
|
-
filePath: b.filePath
|
|
221
|
-
}));
|
|
222
|
-
s(f);
|
|
223
|
-
}
|
|
224
|
-
}).catch((i) => {
|
|
225
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", i), O.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
226
|
-
});
|
|
227
|
-
} else
|
|
228
|
-
ee(r, {
|
|
229
|
-
crprCd: Q()?.crprCd,
|
|
230
|
-
sysCd: __SYS_CD__,
|
|
231
|
-
fileGrpKey: t
|
|
232
|
-
}).then((c) => {
|
|
233
|
-
if (c?.sub) {
|
|
234
|
-
const y = c.sub.map((i) => ({
|
|
235
|
-
uid: i.fileKey,
|
|
236
|
-
name: i.lgclFileNm,
|
|
237
|
-
filePath: i.filePath
|
|
238
|
-
}));
|
|
239
|
-
s(y);
|
|
240
|
-
}
|
|
241
|
-
}).catch((c) => {
|
|
242
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", c), O.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
243
|
-
});
|
|
244
|
-
else
|
|
245
|
-
s([]);
|
|
246
|
-
}, [t, r, l]);
|
|
247
|
-
const p = async (c) => {
|
|
248
|
-
try {
|
|
249
|
-
const i = ge().findSystemByAppCd?.(l ?? __APP_CD__);
|
|
250
|
-
if (!i || !i.sysCd) {
|
|
251
|
-
console.error("해당 앱코드는 존재하지 않습니다.", l);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const b = await fetch("/api/download", {
|
|
255
|
-
method: "POST",
|
|
256
|
-
headers: {
|
|
257
|
-
SYSCD: i.sysCd,
|
|
258
|
-
"Content-Type": "application/json"
|
|
259
|
-
// 여기에 필요한 다른 헤더(예: 인증 토큰)를 추가할 수 있습니다.
|
|
260
|
-
},
|
|
261
|
-
body: JSON.stringify({
|
|
262
|
-
filePath: c.filePath,
|
|
263
|
-
logicalName: c.name,
|
|
264
|
-
fileKey: c.uid
|
|
265
|
-
})
|
|
266
|
-
});
|
|
267
|
-
if (!b.ok) {
|
|
268
|
-
const V = (await b.json().catch(() => null))?.message || "파일 다운로드에 실패했습니다.";
|
|
269
|
-
throw new Error(V);
|
|
270
|
-
}
|
|
271
|
-
const k = await b.blob(), D = window.URL.createObjectURL(k), Y = document.createElement("a");
|
|
272
|
-
Y.href = D, Y.setAttribute("download", c.name), document.body.appendChild(Y), Y.click(), document.body.removeChild(Y), window.URL.revokeObjectURL(D);
|
|
273
|
-
} catch (y) {
|
|
274
|
-
console.error(y), O.error(
|
|
275
|
-
y.message || "파일을 다운로드하는 중 오류가 발생했습니다."
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
return /* @__PURE__ */ a(Ye, { title: "파일 목록", children: /* @__PURE__ */ a(
|
|
280
|
-
re,
|
|
281
|
-
{
|
|
282
|
-
dataSource: e,
|
|
283
|
-
renderItem: (c) => /* @__PURE__ */ a(
|
|
284
|
-
re.Item,
|
|
285
|
-
{
|
|
286
|
-
actions: d ? [] : [
|
|
287
|
-
/* @__PURE__ */ a(
|
|
288
|
-
te,
|
|
289
|
-
{
|
|
290
|
-
type: "text",
|
|
291
|
-
icon: /* @__PURE__ */ a($e, {}),
|
|
292
|
-
onClick: () => p(c)
|
|
293
|
-
},
|
|
294
|
-
"download"
|
|
295
|
-
)
|
|
296
|
-
],
|
|
297
|
-
children: /* @__PURE__ */ a(re.Item.Meta, { avatar: /* @__PURE__ */ a(Oe, {}), title: c.name })
|
|
298
|
-
}
|
|
299
|
-
)
|
|
300
|
-
}
|
|
301
|
-
) });
|
|
302
|
-
}, tt = Ae(
|
|
303
|
-
({ children: t, labelCol: r, style: d, className: l, ...e }, s) => /* @__PURE__ */ a(
|
|
304
|
-
le,
|
|
305
|
-
{
|
|
306
|
-
form: {
|
|
307
|
-
/**
|
|
308
|
-
* 기존 rule.message의 default message인 $name을를 입력해주세요를 변경
|
|
309
|
-
* label이 단순 string이 아닌 <><>형식으로 변경되서 주석처리.
|
|
310
|
-
*/
|
|
311
|
-
// validateMessages: { required: "'${label}을(를) 입력해주세요.'" },
|
|
312
|
-
},
|
|
313
|
-
children: /* @__PURE__ */ a(
|
|
314
|
-
$,
|
|
315
|
-
{
|
|
316
|
-
ref: s,
|
|
317
|
-
...e,
|
|
318
|
-
requiredMark: !1,
|
|
319
|
-
labelCol: r || { flex: "100px" },
|
|
320
|
-
style: { padding: "10px", ...d },
|
|
321
|
-
className: `bwg-form ${l ?? ""}`,
|
|
322
|
-
children: t
|
|
323
|
-
}
|
|
324
|
-
)
|
|
325
|
-
}
|
|
326
|
-
)
|
|
327
|
-
);
|
|
328
|
-
tt.displayName = "BwgForm";
|
|
329
|
-
const _t = ({ itemProps: t, inputProps: r }) => /* @__PURE__ */ a(T, { ...t, children: /* @__PURE__ */ a(J, { ...r }) }), { Text: ae } = be, { Dragger: rt } = q, nt = [
|
|
330
|
-
".pdf",
|
|
331
|
-
".xlsx",
|
|
332
|
-
".xls",
|
|
333
|
-
".docx",
|
|
334
|
-
".doc",
|
|
335
|
-
".pptx",
|
|
336
|
-
".ppt",
|
|
337
|
-
".hwp",
|
|
338
|
-
".txt",
|
|
339
|
-
".csv",
|
|
340
|
-
// 이미지
|
|
341
|
-
".jpg",
|
|
342
|
-
".jpeg",
|
|
343
|
-
".png",
|
|
344
|
-
".gif",
|
|
345
|
-
// 압축
|
|
346
|
-
".zip"
|
|
347
|
-
], at = (t, r = 2) => {
|
|
348
|
-
if (t === 0) return "0 Bytes";
|
|
349
|
-
const d = 1024, l = r < 0 ? 0 : r, e = ["Bytes", "KB", "MB", "GB", "TB"], s = Math.floor(Math.log(t) / Math.log(d));
|
|
350
|
-
return parseFloat((t / Math.pow(d, s)).toFixed(l)) + " " + e[s];
|
|
351
|
-
}, Nt = ({
|
|
352
|
-
title: t = "첨부파일",
|
|
353
|
-
fileGrpKey: r,
|
|
354
|
-
onUploadComplete: d,
|
|
355
|
-
onSuccessTrxCd: l = "SCMFILE00102",
|
|
356
|
-
// BwgUploader와 동일한 기본 trxCd 설정
|
|
357
|
-
anotherServiceTrxCd: e = "SCMFILE00105",
|
|
358
|
-
allowedExtensions: s = nt,
|
|
359
|
-
maxFileSize: p = 2048
|
|
360
|
-
// 기본값 2GB
|
|
361
|
-
}) => {
|
|
362
|
-
const [c, y] = j([]), [i, f] = j(!1), [b, k] = j(!1), [D, Y] = j(0), R = (g) => {
|
|
363
|
-
if (s && s.length > 0) {
|
|
364
|
-
const A = ((z) => {
|
|
365
|
-
const o = z.lastIndexOf(".");
|
|
366
|
-
return o === -1 ? "" : z.substring(o).toLowerCase();
|
|
367
|
-
})(g.name);
|
|
368
|
-
if (!s.includes(A))
|
|
369
|
-
return O.error(
|
|
370
|
-
`${g.name} 파일은 허용되지 않는 확장자입니다. (${s.join(
|
|
371
|
-
", "
|
|
372
|
-
)}만 가능)`
|
|
373
|
-
), !1;
|
|
374
|
-
}
|
|
375
|
-
return !0;
|
|
376
|
-
}, V = async () => {
|
|
377
|
-
const g = c.filter((F) => F.status !== "done"), v = g.reduce(
|
|
378
|
-
(F, w) => F + (w.size || 0),
|
|
379
|
-
0
|
|
380
|
-
), A = 2 * 1024 * 1024 * 1024;
|
|
381
|
-
if (v > A) {
|
|
382
|
-
ve.error({
|
|
383
|
-
message: "업로드 용량 초과",
|
|
384
|
-
description: "한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."
|
|
385
|
-
});
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
if (g.length === 0) {
|
|
389
|
-
O.warning(
|
|
390
|
-
"업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다."
|
|
391
|
-
);
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
k(!0);
|
|
395
|
-
let z;
|
|
396
|
-
try {
|
|
397
|
-
const F = new qe();
|
|
398
|
-
g.forEach((w) => {
|
|
399
|
-
w.originFileObj && F.file(w.name, w.originFileObj);
|
|
400
|
-
}), z = await F.generateAsync({
|
|
401
|
-
type: "blob",
|
|
402
|
-
compression: "DEFLATE",
|
|
403
|
-
compressionOptions: {
|
|
404
|
-
level: 9
|
|
405
|
-
// 높은 압축률 설정
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
} catch (F) {
|
|
409
|
-
k(!1), O.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", F);
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
k(!1);
|
|
413
|
-
const o = new FormData();
|
|
414
|
-
o.append("file", z, "upload.zip"), f(!0), Y(0);
|
|
415
|
-
try {
|
|
416
|
-
const F = await new Promise((S, E) => {
|
|
417
|
-
const B = new XMLHttpRequest();
|
|
418
|
-
B.open("POST", "/api/upload-large", !0), B.upload.onprogress = (U) => {
|
|
419
|
-
if (U.lengthComputable) {
|
|
420
|
-
const Z = Math.round(
|
|
421
|
-
U.loaded / U.total * 100
|
|
422
|
-
);
|
|
423
|
-
Y(Z);
|
|
424
|
-
}
|
|
425
|
-
}, B.onload = () => {
|
|
426
|
-
if (B.status >= 200 && B.status < 300)
|
|
427
|
-
try {
|
|
428
|
-
const U = JSON.parse(B.responseText);
|
|
429
|
-
U.success ? S(U) : E(
|
|
430
|
-
new Error(U.message || "파일 업로드에 실패했습니다.")
|
|
431
|
-
);
|
|
432
|
-
} catch {
|
|
433
|
-
E(new Error("잘못된 서버 응답입니다."));
|
|
434
|
-
}
|
|
435
|
-
else
|
|
436
|
-
try {
|
|
437
|
-
const U = JSON.parse(B.responseText);
|
|
438
|
-
E(new Error(U.message || `서버 오류: ${B.status}`));
|
|
439
|
-
} catch {
|
|
440
|
-
E(new Error(`서버 오류: ${B.status}`));
|
|
441
|
-
}
|
|
442
|
-
}, B.onerror = () => {
|
|
443
|
-
E(new Error("네트워크 오류가 발생했습니다."));
|
|
444
|
-
}, B.send(o);
|
|
445
|
-
});
|
|
446
|
-
O.success(
|
|
447
|
-
F.message || "압축 파일이 성공적으로 업로드되었습니다."
|
|
448
|
-
);
|
|
449
|
-
const w = c.map(
|
|
450
|
-
(S) => g.find((E) => E.uid === S.uid) ? { ...S, status: "done" } : S
|
|
451
|
-
);
|
|
452
|
-
if (y(w), l && F.uploadedFiles && Array.isArray(F.uploadedFiles)) {
|
|
453
|
-
const S = Q();
|
|
454
|
-
F.uploadedFiles.forEach((E) => {
|
|
455
|
-
const B = {
|
|
456
|
-
crprCd: S?.crprCd,
|
|
457
|
-
sysCd: __SYS_CD__,
|
|
458
|
-
fileGrpKey: r,
|
|
459
|
-
sub: [
|
|
460
|
-
{
|
|
461
|
-
crprCd: S?.crprCd,
|
|
462
|
-
sysCd: __SYS_CD__,
|
|
463
|
-
fileGrpKey: r,
|
|
464
|
-
physFileNm: E.fileNameP,
|
|
465
|
-
lgclFileNm: E.fileNameL,
|
|
466
|
-
filePath: E.filePath,
|
|
467
|
-
fileExtn: E.fileExt,
|
|
468
|
-
fileSize: E.fileSize,
|
|
469
|
-
mltpYn: "Y"
|
|
470
|
-
}
|
|
471
|
-
]
|
|
472
|
-
};
|
|
473
|
-
ee(l, B).then((U) => {
|
|
474
|
-
const Z = c.map((W) => ({
|
|
475
|
-
crprCd: S?.crprCd,
|
|
476
|
-
sysCd: __SYS_CD__,
|
|
477
|
-
fileGrpKey: U.sub[0].fileGrpKey,
|
|
478
|
-
fileKey: U.sub[0].fileKey,
|
|
479
|
-
lgclFileNm: W.name,
|
|
480
|
-
fileSize: W.size,
|
|
481
|
-
fileExtn: W.name.split(".").pop(),
|
|
482
|
-
fileType: W.type
|
|
483
|
-
}));
|
|
484
|
-
ee(e, {
|
|
485
|
-
// 파일 목록에 fileKey를 추가합니다.
|
|
486
|
-
sub: Z
|
|
487
|
-
});
|
|
488
|
-
}).catch((U) => {
|
|
489
|
-
console.error("후처리 서비스 호출 실패:", U), O.error(
|
|
490
|
-
`${E.fileNameL} 파일의 후처리 작업에 실패했습니다.`
|
|
491
|
-
);
|
|
492
|
-
}), d && d({
|
|
493
|
-
fileNameP: E.fileNameP,
|
|
494
|
-
fileNameL: E.fileNameL
|
|
495
|
-
});
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
} catch (F) {
|
|
499
|
-
O.error(F.message || "파일 업로드 중 오류가 발생했습니다.");
|
|
500
|
-
const w = c.map(
|
|
501
|
-
(S) => g.find((E) => E.uid === S.uid) ? {
|
|
502
|
-
...S,
|
|
503
|
-
status: "error",
|
|
504
|
-
response: F.message || "파일 업로드 중 오류가 발생했습니다."
|
|
505
|
-
} : S
|
|
506
|
-
);
|
|
507
|
-
y(w);
|
|
508
|
-
} finally {
|
|
509
|
-
f(!1);
|
|
510
|
-
}
|
|
511
|
-
}, _ = {
|
|
512
|
-
multiple: !0,
|
|
513
|
-
fileList: c,
|
|
514
|
-
beforeUpload: (g) => R(g) ? p && g.size >= p * 1024 * 1024 ? (O.error(
|
|
515
|
-
`대용량 첨부 파일 최대 크기는 ${(p / 1024).toFixed(
|
|
516
|
-
1
|
|
517
|
-
)}GB입니다.`
|
|
518
|
-
), q.LIST_IGNORE) : !1 : q.LIST_IGNORE,
|
|
519
|
-
onChange: ({ fileList: g }) => {
|
|
520
|
-
const v = new Map(c.map((A) => [A.uid, A]));
|
|
521
|
-
g.forEach((A) => {
|
|
522
|
-
v.set(A.uid, A);
|
|
523
|
-
}), y(Array.from(v.values()));
|
|
524
|
-
},
|
|
525
|
-
onRemove: (g) => {
|
|
526
|
-
const v = c.filter((A) => A.uid !== g.uid);
|
|
527
|
-
y(v);
|
|
528
|
-
},
|
|
529
|
-
showUploadList: !1
|
|
530
|
-
// 수동으로 목록을 렌더링하므로 antd의 기본 목록은 숨깁니다.
|
|
531
|
-
};
|
|
532
|
-
return /* @__PURE__ */ a(
|
|
533
|
-
Le,
|
|
534
|
-
{
|
|
535
|
-
spinning: i || b,
|
|
536
|
-
tip: b ? "파일 압축 중..." : `파일 업로드 중... ${D}%`,
|
|
537
|
-
children: /* @__PURE__ */ G("div", { className: "bwg-large-uploader-container", children: [
|
|
538
|
-
/* @__PURE__ */ a(
|
|
539
|
-
Ye,
|
|
540
|
-
{
|
|
541
|
-
title: /* @__PURE__ */ a(ae, { strong: !0, children: t }),
|
|
542
|
-
extra: /* @__PURE__ */ a(q, { ..._, children: /* @__PURE__ */ a(te, { icon: /* @__PURE__ */ a(ke, {}), children: "파일 선택" }) }),
|
|
543
|
-
style: { padding: 0 },
|
|
544
|
-
children: /* @__PURE__ */ a(
|
|
545
|
-
rt,
|
|
546
|
-
{
|
|
547
|
-
..._,
|
|
548
|
-
style: {
|
|
549
|
-
border: "none",
|
|
550
|
-
background: "transparent",
|
|
551
|
-
padding: 0
|
|
552
|
-
},
|
|
553
|
-
children: /* @__PURE__ */ a("div", { className: "upload-list-container", children: c.length > 0 ? /* @__PURE__ */ a(
|
|
554
|
-
re,
|
|
555
|
-
{
|
|
556
|
-
style: { textAlign: "left" },
|
|
557
|
-
dataSource: c,
|
|
558
|
-
renderItem: (g) => {
|
|
559
|
-
const v = g.status === "done", A = g.status === "error";
|
|
560
|
-
let z;
|
|
561
|
-
return v ? z = /* @__PURE__ */ a(
|
|
562
|
-
je,
|
|
563
|
-
{
|
|
564
|
-
style: { color: "#52c41a", fontSize: 14 }
|
|
565
|
-
}
|
|
566
|
-
) : A ? z = /* @__PURE__ */ a(
|
|
567
|
-
Me,
|
|
568
|
-
{
|
|
569
|
-
title: typeof g.response == "string" ? g.response : "업로드 실패",
|
|
570
|
-
children: /* @__PURE__ */ a(
|
|
571
|
-
He,
|
|
572
|
-
{
|
|
573
|
-
style: { color: "#ff4d4f", fontSize: 14 }
|
|
574
|
-
}
|
|
575
|
-
)
|
|
576
|
-
}
|
|
577
|
-
) : z = /* @__PURE__ */ a(Ke, { style: { fontSize: 14 } }), /* @__PURE__ */ a(
|
|
578
|
-
re.Item,
|
|
579
|
-
{
|
|
580
|
-
actions: [
|
|
581
|
-
/* @__PURE__ */ a(ae, { type: "secondary", children: at(g.size || 0) }, "size"),
|
|
582
|
-
/* @__PURE__ */ a(
|
|
583
|
-
te,
|
|
584
|
-
{
|
|
585
|
-
type: "text",
|
|
586
|
-
icon: /* @__PURE__ */ a(Re, {}),
|
|
587
|
-
onClick: (o) => {
|
|
588
|
-
o.stopPropagation(), _.onRemove?.(g);
|
|
589
|
-
},
|
|
590
|
-
disabled: i || b
|
|
591
|
-
},
|
|
592
|
-
"delete"
|
|
593
|
-
)
|
|
594
|
-
],
|
|
595
|
-
children: /* @__PURE__ */ a(
|
|
596
|
-
re.Item.Meta,
|
|
597
|
-
{
|
|
598
|
-
avatar: z,
|
|
599
|
-
title: /* @__PURE__ */ a(ae, { type: A ? "danger" : void 0, children: g.name })
|
|
600
|
-
}
|
|
601
|
-
)
|
|
602
|
-
},
|
|
603
|
-
g.uid
|
|
604
|
-
);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
) : /* @__PURE__ */ G(
|
|
608
|
-
me,
|
|
609
|
-
{
|
|
610
|
-
gap: "middle",
|
|
611
|
-
align: "center",
|
|
612
|
-
justify: "center",
|
|
613
|
-
vertical: !0,
|
|
614
|
-
style: { padding: "20px 0", minHeight: "120px" },
|
|
615
|
-
children: [
|
|
616
|
-
/* @__PURE__ */ a(Ue, { style: { fontSize: "32px", color: "#999" } }),
|
|
617
|
-
/* @__PURE__ */ a(ae, { type: "secondary", children: "업로드할 파일을 선택하거나 이 영역으로 드래그하세요." })
|
|
618
|
-
]
|
|
619
|
-
}
|
|
620
|
-
) })
|
|
621
|
-
}
|
|
622
|
-
)
|
|
623
|
-
}
|
|
624
|
-
),
|
|
625
|
-
c.length > 0 && /* @__PURE__ */ G(
|
|
626
|
-
me,
|
|
627
|
-
{
|
|
628
|
-
justify: "flex-end",
|
|
629
|
-
align: "center",
|
|
630
|
-
gap: "large",
|
|
631
|
-
style: { marginTop: 16 },
|
|
632
|
-
children: [
|
|
633
|
-
i && /* @__PURE__ */ a("div", { style: { width: "250px" }, children: /* @__PURE__ */ a(Ie, { percent: D, size: "small" }) }),
|
|
634
|
-
/* @__PURE__ */ a(
|
|
635
|
-
te,
|
|
636
|
-
{
|
|
637
|
-
type: "primary",
|
|
638
|
-
onClick: V,
|
|
639
|
-
disabled: i || b || c.filter((g) => g.status !== "done").length === 0,
|
|
640
|
-
icon: /* @__PURE__ */ a(Te, {}),
|
|
641
|
-
children: "일괄 업로드"
|
|
642
|
-
}
|
|
643
|
-
)
|
|
644
|
-
]
|
|
645
|
-
}
|
|
646
|
-
)
|
|
647
|
-
] })
|
|
648
|
-
}
|
|
649
|
-
);
|
|
650
|
-
}, ot = (t) => {
|
|
651
|
-
if (typeof t == "string")
|
|
652
|
-
return t.replace(/0/g, "_");
|
|
653
|
-
if (Array.isArray(t))
|
|
654
|
-
return t[0].replace(/0/g, "_");
|
|
655
|
-
if (typeof t == "object" && "mask" in t && "blocks" in t) {
|
|
656
|
-
const { mask: r, blocks: d } = t;
|
|
657
|
-
return r.split(".").map((l) => {
|
|
658
|
-
const s = d?.[l]?.maxLength ?? 3;
|
|
659
|
-
return "_".repeat(s);
|
|
660
|
-
}).join(".");
|
|
661
|
-
}
|
|
662
|
-
return "";
|
|
663
|
-
}, xt = ({
|
|
664
|
-
itemProps: t,
|
|
665
|
-
inputProps: r,
|
|
666
|
-
mask: d
|
|
667
|
-
}) => {
|
|
668
|
-
const l = K(null), e = $.useFormInstance(), s = X(() => ot(d), [d]);
|
|
669
|
-
return P(() => {
|
|
670
|
-
if (!l.current?.input) return;
|
|
671
|
-
const p = typeof d == "string" || Array.isArray(d) ? { mask: d } : d, c = se(l.current.input, p);
|
|
672
|
-
return c.on("accept", () => {
|
|
673
|
-
e && t?.name && e.setFieldValue(t.name, c.value);
|
|
674
|
-
}), () => {
|
|
675
|
-
c.destroy();
|
|
676
|
-
};
|
|
677
|
-
}, [d, e, t?.name]), /* @__PURE__ */ a(T, { ...t, children: /* @__PURE__ */ a(J, { ...r, ref: l, placeholder: s }) });
|
|
678
|
-
}, st = (t) => {
|
|
679
|
-
switch (t) {
|
|
680
|
-
case "year":
|
|
681
|
-
return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
|
|
682
|
-
case "month":
|
|
683
|
-
return { format: "YYYY-MM", mask: "0000-00", outputFormat: "YYYYMM" };
|
|
684
|
-
case "date":
|
|
685
|
-
default:
|
|
686
|
-
return {
|
|
687
|
-
format: "YYYY-MM-DD",
|
|
688
|
-
mask: "0000-00-00",
|
|
689
|
-
outputFormat: "YYYYMMDD"
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
}, At = ({
|
|
693
|
-
type: t = "date",
|
|
694
|
-
itemProps: r = { name: "calendar" },
|
|
695
|
-
inputProps: d,
|
|
696
|
-
pickerProps: l
|
|
697
|
-
}) => {
|
|
698
|
-
const { format: e, mask: s, outputFormat: p } = st(t), c = K(null), y = K(null), i = K(null), f = $.useFormInstance(), [b, k] = j(!1), [D, Y] = j(!1), R = r?.name, [V, _] = j(null), g = $.useWatch(R, f), v = Se();
|
|
699
|
-
P(() => {
|
|
700
|
-
if (!c.current?.input) return;
|
|
701
|
-
const o = se(c.current.input, {
|
|
702
|
-
mask: s,
|
|
703
|
-
lazy: !1
|
|
704
|
-
});
|
|
705
|
-
return y.current = o, o.on("accept", () => {
|
|
706
|
-
const F = o.value;
|
|
707
|
-
F.length > 0 && k(!0);
|
|
708
|
-
const w = N(F, e, !0);
|
|
709
|
-
F.length === e.length && w.isValid() && (f.setFieldValue(R, o.value), _(w), y.current?.updateValue());
|
|
710
|
-
}), () => {
|
|
711
|
-
o.destroy();
|
|
712
|
-
};
|
|
713
|
-
}, [e, s]), P(() => {
|
|
714
|
-
if (!g) {
|
|
715
|
-
_(null);
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
let o = null;
|
|
719
|
-
if (typeof g == "string" && g.length === p.length && /^\d+$/.test(g))
|
|
720
|
-
if (t === "date") {
|
|
721
|
-
const F = g.substring(0, 4), w = g.substring(4, 6), S = g.substring(6, 8);
|
|
722
|
-
o = N(`${F}-${w}-${S}`, e, !0);
|
|
723
|
-
} else if (t === "month") {
|
|
724
|
-
const F = g.substring(0, 4), w = g.substring(4, 6);
|
|
725
|
-
o = N(`${F}-${w}`, e, !0);
|
|
726
|
-
} else t === "year" && (o = N(g, e, !0));
|
|
727
|
-
else
|
|
728
|
-
o = N(g, e, !0);
|
|
729
|
-
o && o.isValid() ? _(o) : _(null), Y(!1);
|
|
730
|
-
}, [g, e, p, t]);
|
|
731
|
-
const A = (o) => {
|
|
732
|
-
if (!o) {
|
|
733
|
-
_(null), y.current?.updateValue();
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
_(o);
|
|
737
|
-
const F = o.format(p);
|
|
738
|
-
y.current && (y.current.value = F, y.current.updateValue()), Y(!1);
|
|
739
|
-
}, z = (o) => {
|
|
740
|
-
setTimeout(() => {
|
|
741
|
-
const F = document.activeElement, w = i.current, S = w?.querySelector(".ant-picker-dropdown");
|
|
742
|
-
!(w && (w.contains(F) || w === F || S?.contains(F))) && !(o !== void 0 ? o : b) && console.log("✅ Input과 DatePicker 모두 포커스가 없습니다");
|
|
743
|
-
}, 0);
|
|
744
|
-
};
|
|
745
|
-
return /* @__PURE__ */ a(
|
|
746
|
-
T,
|
|
747
|
-
{
|
|
748
|
-
...r,
|
|
749
|
-
name: void 0,
|
|
750
|
-
validateStatus: D ? "warning" : void 0,
|
|
751
|
-
children: /* @__PURE__ */ G(
|
|
752
|
-
le,
|
|
753
|
-
{
|
|
754
|
-
componentSize: v.componentSize,
|
|
755
|
-
theme: {
|
|
756
|
-
components: {
|
|
757
|
-
Input: {
|
|
758
|
-
addonBg: "#fff"
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
},
|
|
762
|
-
children: [
|
|
763
|
-
/* @__PURE__ */ a(
|
|
764
|
-
$.Item,
|
|
765
|
-
{
|
|
766
|
-
name: R,
|
|
767
|
-
getValueProps: (o) => ({
|
|
768
|
-
value: o ? N(o).format(e) : void 0
|
|
769
|
-
}),
|
|
770
|
-
normalize: (o) => o ? N(o).format(p) : void 0,
|
|
771
|
-
noStyle: !0,
|
|
772
|
-
children: /* @__PURE__ */ a(
|
|
773
|
-
J,
|
|
774
|
-
{
|
|
775
|
-
...d,
|
|
776
|
-
ref: c,
|
|
777
|
-
onFocus: () => {
|
|
778
|
-
k(!b), y.current?.updateValue();
|
|
779
|
-
},
|
|
780
|
-
onBlur: () => {
|
|
781
|
-
z();
|
|
782
|
-
},
|
|
783
|
-
onKeyDown: (o) => {
|
|
784
|
-
if (o.key === "Backspace" && k(!0), o.key === "Tab" && k(!1), o.key === "Enter")
|
|
785
|
-
if (b) {
|
|
786
|
-
const F = y.current?.value || "", w = N(F, e, !0);
|
|
787
|
-
F.length === e.length && w.isValid() ? (k(!1), Y(!1)) : Y(!0);
|
|
788
|
-
} else
|
|
789
|
-
k(!0);
|
|
790
|
-
},
|
|
791
|
-
style: {
|
|
792
|
-
width: "65%"
|
|
793
|
-
},
|
|
794
|
-
allowClear: !0,
|
|
795
|
-
placeholder: s.replace(/0/g, "_"),
|
|
796
|
-
suffix: /* @__PURE__ */ a(ue, { style: { color: "#d9d9d9" } }),
|
|
797
|
-
autoComplete: "off"
|
|
798
|
-
}
|
|
799
|
-
)
|
|
800
|
-
}
|
|
801
|
-
),
|
|
802
|
-
/* @__PURE__ */ a(
|
|
803
|
-
ie,
|
|
804
|
-
{
|
|
805
|
-
...l,
|
|
806
|
-
open: b,
|
|
807
|
-
picker: t,
|
|
808
|
-
format: {
|
|
809
|
-
format: e,
|
|
810
|
-
type: "mask"
|
|
811
|
-
},
|
|
812
|
-
showNow: !0,
|
|
813
|
-
value: V,
|
|
814
|
-
onChange: A,
|
|
815
|
-
onOpenChange: (o) => {
|
|
816
|
-
k(o), o || z(!1);
|
|
817
|
-
},
|
|
818
|
-
renderExtraFooter: () => D ? /* @__PURE__ */ G(
|
|
819
|
-
"div",
|
|
820
|
-
{
|
|
821
|
-
style: {
|
|
822
|
-
color: "#faad14",
|
|
823
|
-
paddingLeft: "8px",
|
|
824
|
-
fontSize: "12px",
|
|
825
|
-
display: "flex",
|
|
826
|
-
alignItems: "center",
|
|
827
|
-
gap: "6px",
|
|
828
|
-
borderTop: "1px solid #f0f0f0",
|
|
829
|
-
backgroundColor: "#fffbe6"
|
|
830
|
-
},
|
|
831
|
-
children: [
|
|
832
|
-
/* @__PURE__ */ a(Ve, {}),
|
|
833
|
-
/* @__PURE__ */ a("span", { children: "유효하지 않은 날짜입니다" })
|
|
834
|
-
]
|
|
835
|
-
}
|
|
836
|
-
) : null,
|
|
837
|
-
getPopupContainer: (o) => o.parentElement,
|
|
838
|
-
style: {
|
|
839
|
-
position: "absolute",
|
|
840
|
-
top: 0,
|
|
841
|
-
left: 0,
|
|
842
|
-
pointerEvents: "none",
|
|
843
|
-
opacity: 0,
|
|
844
|
-
width: "100%"
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
)
|
|
848
|
-
]
|
|
849
|
-
}
|
|
850
|
-
)
|
|
851
|
-
}
|
|
852
|
-
);
|
|
853
|
-
}, { RangePicker: lt } = ie, it = (t) => {
|
|
854
|
-
switch (t) {
|
|
855
|
-
case "year":
|
|
856
|
-
return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
|
|
857
|
-
case "month":
|
|
858
|
-
return { format: "YYYY-MM", mask: "0000-00", outputFormat: "YYYYMM" };
|
|
859
|
-
case "date":
|
|
860
|
-
default:
|
|
861
|
-
return {
|
|
862
|
-
format: "YYYY-MM-DD",
|
|
863
|
-
mask: "0000-00-00",
|
|
864
|
-
outputFormat: "YYYYMMDD"
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
}, Et = ({
|
|
868
|
-
type: t = "date",
|
|
869
|
-
itemProps: r = { name: "dateRange" },
|
|
870
|
-
inputProps: d,
|
|
871
|
-
pickerProps: l
|
|
872
|
-
}) => {
|
|
873
|
-
const { format: e, mask: s, outputFormat: p } = it(t), c = K(null), y = K(null), i = K(null), f = K(null), b = K(null), k = $.useFormInstance(), [D, Y] = j(!1), [R, V] = j(!1), [_, g] = j(null), [v, A] = j(!1), z = K(!1), o = r?.name, [F, w] = j([
|
|
874
|
-
null,
|
|
875
|
-
null
|
|
876
|
-
]), S = $.useWatch(
|
|
877
|
-
o ? Array.isArray(o) ? [...o, 0] : [o, 0] : void 0,
|
|
878
|
-
k
|
|
879
|
-
), E = $.useWatch(
|
|
880
|
-
o ? Array.isArray(o) ? [...o, 1] : [o, 1] : void 0,
|
|
881
|
-
k
|
|
882
|
-
), B = $.useWatch(o, k), U = Se();
|
|
883
|
-
P(() => {
|
|
884
|
-
if (!c.current?.input) return;
|
|
885
|
-
const n = se(c.current.input, {
|
|
886
|
-
mask: s,
|
|
887
|
-
lazy: !1
|
|
888
|
-
});
|
|
889
|
-
return i.current = n, n.on("accept", () => {
|
|
890
|
-
const m = n.value, h = n.unmaskedValue || "";
|
|
891
|
-
if (console.log("🔵 [시작일] accept 이벤트:", {
|
|
892
|
-
maskValue: m,
|
|
893
|
-
unmaskedValue: h,
|
|
894
|
-
length: m.length,
|
|
895
|
-
formatLength: e.length
|
|
896
|
-
}), m.length > 0 && (g("start"), Y(!0), A(!1)), h.length === p.length) {
|
|
897
|
-
const u = N(m, e, !0);
|
|
898
|
-
if (u.isValid()) {
|
|
899
|
-
console.log("🔵 [시작일] 입력 완료 및 검증 통과:", {
|
|
900
|
-
parsed: u.format(e)
|
|
901
|
-
});
|
|
902
|
-
const M = u.format(p);
|
|
903
|
-
z.current = !0;
|
|
904
|
-
const C = Array.isArray(o) ? [...o, 0] : [o, 0];
|
|
905
|
-
k.setFieldValue(C, M), w([u, F[1]]), i.current && i.current.updateValue(), V(!1), setTimeout(() => {
|
|
906
|
-
f.current && (f.current.value = "", f.current.unmaskedValue = "", f.current.updateValue());
|
|
907
|
-
const L = Array.isArray(o) ? [...o, 1] : [o, 1];
|
|
908
|
-
k.getFieldValue(L) || k.setFieldValue(L, void 0), y.current?.focus(), setTimeout(() => {
|
|
909
|
-
if (f.current) {
|
|
910
|
-
const x = f.current.value || "";
|
|
911
|
-
!(f.current.unmaskedValue || "") && !x.replace(/[^0-9]/g, "") && (f.current.value = "", f.current.updateValue());
|
|
912
|
-
}
|
|
913
|
-
}, 10), g("end"), Y(!0), z.current = !1;
|
|
914
|
-
}, 0);
|
|
915
|
-
} else
|
|
916
|
-
l?.allowEmpty ? V(!1) : (console.log("🔵 [시작일] 검증 실패:", { val: m, parsed: u }), V(!0));
|
|
917
|
-
}
|
|
918
|
-
}), () => {
|
|
919
|
-
n.destroy();
|
|
920
|
-
};
|
|
921
|
-
}, [e, s, o]), P(() => {
|
|
922
|
-
if (!y.current?.input) return;
|
|
923
|
-
const n = se(y.current.input, {
|
|
924
|
-
mask: s,
|
|
925
|
-
lazy: !1
|
|
926
|
-
});
|
|
927
|
-
return f.current = n, n.on("accept", () => {
|
|
928
|
-
const m = n.value, h = n.unmaskedValue || "";
|
|
929
|
-
if (console.log("🟢 [종료일] accept 이벤트:", {
|
|
930
|
-
maskValue: m,
|
|
931
|
-
unmaskedValue: h,
|
|
932
|
-
length: m.length,
|
|
933
|
-
formatLength: e.length
|
|
934
|
-
}), h === "" || h.length === 0) {
|
|
935
|
-
const u = Array.isArray(o) ? [...o, 1] : [o, 1];
|
|
936
|
-
k.setFieldValue(u, void 0), w([F[0], null]), f.current && (f.current.value = "", f.current.updateValue()), setTimeout(() => {
|
|
937
|
-
c.current?.focus(), g("start"), Y(!0);
|
|
938
|
-
}, 0);
|
|
939
|
-
return;
|
|
940
|
-
}
|
|
941
|
-
if (m.length > 0 && (g("end"), Y(!0)), m.length < e.length) {
|
|
942
|
-
V(!1);
|
|
943
|
-
return;
|
|
944
|
-
}
|
|
945
|
-
if (h.length === p.length) {
|
|
946
|
-
const u = N(m, e, !0);
|
|
947
|
-
if (u.isValid()) {
|
|
948
|
-
const M = u.format(p);
|
|
949
|
-
console.log("🟢 [종료일] 입력 완료:", {
|
|
950
|
-
parsed: u.format(e),
|
|
951
|
-
formatted: M
|
|
952
|
-
}), z.current = !0;
|
|
953
|
-
const C = Array.isArray(o) ? [...o, 1] : [o, 1];
|
|
954
|
-
k.setFieldValue(C, M), w([F[0], u]), f.current?.updateValue(), setTimeout(() => {
|
|
955
|
-
z.current = !1;
|
|
956
|
-
}, 0);
|
|
957
|
-
} else
|
|
958
|
-
l?.allowEmpty ? V(!1) : (console.log("🟢 [종료일] 검증 실패:", { val: m, parsed: u }), V(!0));
|
|
959
|
-
}
|
|
960
|
-
}), () => {
|
|
961
|
-
n.destroy();
|
|
962
|
-
};
|
|
963
|
-
}, [e, s, o]), P(() => {
|
|
964
|
-
console.log("🟡 [useEffect] form 값 변경 감지:", {
|
|
965
|
-
startFormValue: S,
|
|
966
|
-
endFormValue: E,
|
|
967
|
-
formValue: B
|
|
968
|
-
});
|
|
969
|
-
const n = S ?? (Array.isArray(B) ? B[0] : null), m = E ?? (Array.isArray(B) ? B[1] : null);
|
|
970
|
-
if (n === void 0 && m === void 0 && (!B || !Array.isArray(B))) {
|
|
971
|
-
w([null, null]);
|
|
972
|
-
return;
|
|
973
|
-
}
|
|
974
|
-
const h = (C) => {
|
|
975
|
-
if (!C) return null;
|
|
976
|
-
let L = null;
|
|
977
|
-
if (typeof C == "string" && C.length === p.length && /^\d+$/.test(C))
|
|
978
|
-
if (t === "date") {
|
|
979
|
-
const I = C.substring(0, 4), x = C.substring(4, 6), H = C.substring(6, 8);
|
|
980
|
-
L = N(`${I}-${x}-${H}`, e, !0);
|
|
981
|
-
} else if (t === "month") {
|
|
982
|
-
const I = C.substring(0, 4), x = C.substring(4, 6);
|
|
983
|
-
L = N(`${I}-${x}`, e, !0);
|
|
984
|
-
} else t === "year" && (L = N(C, e, !0));
|
|
985
|
-
else
|
|
986
|
-
L = N(C, e, !0);
|
|
987
|
-
return L && L.isValid() ? L : null;
|
|
988
|
-
}, u = h(n), M = h(m);
|
|
989
|
-
if (console.log("🟡 [useEffect] 파싱 결과:", {
|
|
990
|
-
startParsed: u ? u.format(e) : null,
|
|
991
|
-
endParsed: M ? M.format(e) : null,
|
|
992
|
-
isStartDateFromPicker: v
|
|
993
|
-
}), w([u, M]), z.current) {
|
|
994
|
-
console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"), V(!1);
|
|
995
|
-
return;
|
|
996
|
-
}
|
|
997
|
-
if (!v && i.current) {
|
|
998
|
-
const C = i.current.value || "", L = u ? u.format(e) : "", I = i.current.unmaskedValue || "", x = u ? u.format(p) : "";
|
|
999
|
-
console.log("🟡 [useEffect] 시작일 마스크 값 체크:", {
|
|
1000
|
-
currentMaskValue: C,
|
|
1001
|
-
expectedMaskValue: L,
|
|
1002
|
-
unmaskedValue: I,
|
|
1003
|
-
expectedUnmasked: x,
|
|
1004
|
-
shouldUpdate: C === "" || C !== L,
|
|
1005
|
-
canUpdate: I === "" || I === x
|
|
1006
|
-
}), (C === "" || C !== L) && (I === "" || I === x ? (console.log("🟡 [useEffect] 시작일 마스크 값 업데이트:", {
|
|
1007
|
-
before: C,
|
|
1008
|
-
after: u ? u.format(e) : ""
|
|
1009
|
-
}), u ? (i.current.value = u.format(e), i.current.updateValue()) : (i.current.value = "", i.current.updateValue())) : console.log(
|
|
1010
|
-
"🟡 [useEffect] 시작일 마스크 값 업데이트 스킵 (사용자 입력 중)"
|
|
1011
|
-
));
|
|
1012
|
-
}
|
|
1013
|
-
if (f.current) {
|
|
1014
|
-
const C = f.current.value || "", L = M ? M.format(e) : "", I = f.current.unmaskedValue || "", x = M ? M.format(p) : "";
|
|
1015
|
-
console.log("🟡 [useEffect] 종료일 마스크 값 체크:", {
|
|
1016
|
-
currentMaskValue: C,
|
|
1017
|
-
expectedMaskValue: L,
|
|
1018
|
-
unmaskedValue: I,
|
|
1019
|
-
expectedUnmasked: x,
|
|
1020
|
-
shouldUpdate: C === "" || C !== L,
|
|
1021
|
-
canUpdate: I === "" || I === x
|
|
1022
|
-
}), (C === "" || C !== L) && (I === "" || I === x ? (console.log("🟡 [useEffect] 종료일 마스크 값 업데이트:", {
|
|
1023
|
-
before: C,
|
|
1024
|
-
after: L
|
|
1025
|
-
}), M ? (f.current.value = M.format(e), f.current.updateValue()) : (f.current.value = "", f.current.updateValue())) : console.log(
|
|
1026
|
-
"🟡 [useEffect] 종료일 마스크 값 업데이트 스킵 (사용자 입력 중)"
|
|
1027
|
-
));
|
|
1028
|
-
}
|
|
1029
|
-
V(!1);
|
|
1030
|
-
}, [S, E, B, e, p, t]);
|
|
1031
|
-
const Z = (n) => {
|
|
1032
|
-
if (console.log("🔴 [RangePicker] 날짜 변경:", {
|
|
1033
|
-
dates: n ? [
|
|
1034
|
-
n[0] ? n[0].format(e) : null,
|
|
1035
|
-
n[1] ? n[1].format(e) : null
|
|
1036
|
-
] : null,
|
|
1037
|
-
prevRange: [
|
|
1038
|
-
F[0] ? F[0].format(e) : null,
|
|
1039
|
-
F[1] ? F[1].format(e) : null
|
|
1040
|
-
]
|
|
1041
|
-
}), !n) {
|
|
1042
|
-
w([null, null]), i.current?.updateValue(), f.current?.updateValue();
|
|
1043
|
-
return;
|
|
1044
|
-
}
|
|
1045
|
-
const [m, h] = n, u = F[0], M = m && (!u || !m.isSame(
|
|
1046
|
-
u,
|
|
1047
|
-
t === "year" ? "year" : t === "month" ? "month" : "day"
|
|
1048
|
-
));
|
|
1049
|
-
if (console.log("🔴 [RangePicker] 시작일 변경 여부:", {
|
|
1050
|
-
isStartDateChanged: M,
|
|
1051
|
-
startDate: m ? m.format(e) : null,
|
|
1052
|
-
prevStartDate: u ? u.format(e) : null
|
|
1053
|
-
}), w([m, h]), M) {
|
|
1054
|
-
console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"), A(!0), i.current && (i.current.value = "", i.current.updateValue());
|
|
1055
|
-
const C = m.format(p);
|
|
1056
|
-
console.log("🔴 [RangePicker] form 값 업데이트:", {
|
|
1057
|
-
formatted: C
|
|
1058
|
-
});
|
|
1059
|
-
const L = Array.isArray(o) ? [...o, 0] : [o, 0];
|
|
1060
|
-
k.setFieldValue(L, C);
|
|
1061
|
-
} else !m && i.current ? (A(!1), i.current.value = "", i.current.updateValue()) : A(!1);
|
|
1062
|
-
if (h && f.current) {
|
|
1063
|
-
const C = h.format(p);
|
|
1064
|
-
f.current.value = C, f.current.updateValue();
|
|
1065
|
-
} else !h && f.current && (f.current.value = "", f.current.updateValue());
|
|
1066
|
-
V(!1);
|
|
1067
|
-
}, W = (n) => {
|
|
1068
|
-
setTimeout(() => {
|
|
1069
|
-
const m = document.activeElement, h = b.current, u = h?.querySelector(".ant-picker-dropdown");
|
|
1070
|
-
!(h && (h.contains(m) || h === m || u?.contains(m))) && !(n !== void 0 ? n : D) && (console.log("✅ Input과 RangePicker 모두 포커스가 없습니다"), Y(!1));
|
|
1071
|
-
}, 0);
|
|
1072
|
-
};
|
|
1073
|
-
return /* @__PURE__ */ a(
|
|
1074
|
-
T,
|
|
1075
|
-
{
|
|
1076
|
-
...r,
|
|
1077
|
-
name: void 0,
|
|
1078
|
-
validateStatus: R ? "warning" : void 0,
|
|
1079
|
-
children: /* @__PURE__ */ G(
|
|
1080
|
-
le,
|
|
1081
|
-
{
|
|
1082
|
-
componentSize: U.componentSize,
|
|
1083
|
-
theme: {
|
|
1084
|
-
components: {
|
|
1085
|
-
Input: {
|
|
1086
|
-
addonBg: "#fff"
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
},
|
|
1090
|
-
children: [
|
|
1091
|
-
/* @__PURE__ */ G(
|
|
1092
|
-
"div",
|
|
1093
|
-
{
|
|
1094
|
-
ref: b,
|
|
1095
|
-
style: {
|
|
1096
|
-
display: "flex",
|
|
1097
|
-
alignItems: "center",
|
|
1098
|
-
gap: "8px",
|
|
1099
|
-
width: "100%"
|
|
1100
|
-
},
|
|
1101
|
-
children: [
|
|
1102
|
-
/* @__PURE__ */ a(
|
|
1103
|
-
$.Item,
|
|
1104
|
-
{
|
|
1105
|
-
name: o ? Array.isArray(o) ? [...o, 0] : [o, 0] : void 0,
|
|
1106
|
-
getValueProps: (n) => {
|
|
1107
|
-
if (!n) return { value: void 0 };
|
|
1108
|
-
if (typeof n == "string" && n.length === p.length && /^\d+$/.test(n)) {
|
|
1109
|
-
if (t === "date") {
|
|
1110
|
-
const m = n.substring(0, 4), h = n.substring(4, 6), u = n.substring(6, 8);
|
|
1111
|
-
return { value: `${m}-${h}-${u}` };
|
|
1112
|
-
} else if (t === "month") {
|
|
1113
|
-
const m = n.substring(0, 4), h = n.substring(4, 6);
|
|
1114
|
-
return { value: `${m}-${h}` };
|
|
1115
|
-
} else if (t === "year")
|
|
1116
|
-
return { value: n };
|
|
1117
|
-
}
|
|
1118
|
-
return { value: N(n).format(e) };
|
|
1119
|
-
},
|
|
1120
|
-
normalize: (n) => n ? N(n).format(p) : (l?.allowEmpty, void 0),
|
|
1121
|
-
noStyle: !0,
|
|
1122
|
-
children: /* @__PURE__ */ a(
|
|
1123
|
-
J,
|
|
1124
|
-
{
|
|
1125
|
-
...d,
|
|
1126
|
-
value: void 0,
|
|
1127
|
-
ref: c,
|
|
1128
|
-
onFocus: () => {
|
|
1129
|
-
if (g("start"), Y(!D), A(!1), i.current) {
|
|
1130
|
-
const n = Array.isArray(o) ? [...o, 0] : [o, 0];
|
|
1131
|
-
k.getFieldValue(n) || (i.current.value = "", i.current.unmaskedValue = ""), i.current.updateValue();
|
|
1132
|
-
}
|
|
1133
|
-
},
|
|
1134
|
-
onBlur: () => {
|
|
1135
|
-
W();
|
|
1136
|
-
},
|
|
1137
|
-
onKeyDown: (n) => {
|
|
1138
|
-
if (n.key === "Backspace" && (g("start"), Y(!0)), n.key === "Enter")
|
|
1139
|
-
if (D && _ === "start") {
|
|
1140
|
-
const m = i.current?.value || "";
|
|
1141
|
-
m.length === e.length ? N(m, e, !0).isValid() ? (Y(!1), V(!1)) : l?.allowEmpty ? V(!1) : V(!0) : V(!1);
|
|
1142
|
-
} else
|
|
1143
|
-
g("start"), Y(!0);
|
|
1144
|
-
},
|
|
1145
|
-
style: {
|
|
1146
|
-
flex: 1
|
|
1147
|
-
},
|
|
1148
|
-
allowClear: !0,
|
|
1149
|
-
placeholder: s.replace(/0/g, "_"),
|
|
1150
|
-
suffix: /* @__PURE__ */ a(ue, { style: { color: "#d9d9d9" } }),
|
|
1151
|
-
autoComplete: "off"
|
|
1152
|
-
}
|
|
1153
|
-
)
|
|
1154
|
-
}
|
|
1155
|
-
),
|
|
1156
|
-
/* @__PURE__ */ a("span", { style: { color: "#d9d9d9", userSelect: "none" }, children: "~" }),
|
|
1157
|
-
/* @__PURE__ */ a(
|
|
1158
|
-
$.Item,
|
|
1159
|
-
{
|
|
1160
|
-
name: o ? Array.isArray(o) ? [...o, 1] : [o, 1] : void 0,
|
|
1161
|
-
getValueProps: (n) => {
|
|
1162
|
-
if (!n) return { value: void 0 };
|
|
1163
|
-
if (typeof n == "string" && n.length === p.length && /^\d+$/.test(n)) {
|
|
1164
|
-
if (t === "date") {
|
|
1165
|
-
const m = n.substring(0, 4), h = n.substring(4, 6), u = n.substring(6, 8);
|
|
1166
|
-
return { value: `${m}-${h}-${u}` };
|
|
1167
|
-
} else if (t === "month") {
|
|
1168
|
-
const m = n.substring(0, 4), h = n.substring(4, 6);
|
|
1169
|
-
return { value: `${m}-${h}` };
|
|
1170
|
-
} else if (t === "year")
|
|
1171
|
-
return { value: n };
|
|
1172
|
-
}
|
|
1173
|
-
return { value: N(n).format(e) };
|
|
1174
|
-
},
|
|
1175
|
-
normalize: (n) => n ? N(n).format(p) : (l?.allowEmpty, void 0),
|
|
1176
|
-
noStyle: !0,
|
|
1177
|
-
children: /* @__PURE__ */ a(
|
|
1178
|
-
J,
|
|
1179
|
-
{
|
|
1180
|
-
...d,
|
|
1181
|
-
ref: y,
|
|
1182
|
-
onFocus: () => {
|
|
1183
|
-
if (g("end"), Y(!D), f.current) {
|
|
1184
|
-
f.current.updateValue();
|
|
1185
|
-
const n = f.current.value || "";
|
|
1186
|
-
!(f.current.unmaskedValue || "") && !n.replace(/[^0-9]/g, "") && (f.current.value = "", f.current.updateValue());
|
|
1187
|
-
}
|
|
1188
|
-
},
|
|
1189
|
-
onBlur: () => {
|
|
1190
|
-
W();
|
|
1191
|
-
},
|
|
1192
|
-
onKeyDown: (n) => {
|
|
1193
|
-
if (n.key === "Backspace") {
|
|
1194
|
-
const m = f.current?.value || "", h = f.current?.unmaskedValue || "";
|
|
1195
|
-
if (m === "" || h === "" || m.replace(/[^0-9]/g, "").length <= 1) {
|
|
1196
|
-
n.preventDefault();
|
|
1197
|
-
const u = Array.isArray(o) ? [...o, 1] : [o, 1];
|
|
1198
|
-
k.setFieldValue(u, void 0), w([F[0], null]), f.current && (f.current.value = "", f.current.updateValue()), setTimeout(() => {
|
|
1199
|
-
c.current?.focus(), g("start"), Y(!0);
|
|
1200
|
-
}, 0);
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
g("end"), Y(!0);
|
|
1204
|
-
}
|
|
1205
|
-
if (n.key === "Tab" && Y(!1), n.key === "Enter")
|
|
1206
|
-
if (D && _ === "end") {
|
|
1207
|
-
const m = f.current?.value || "";
|
|
1208
|
-
m.length === e.length ? N(m, e, !0).isValid() ? (Y(!1), V(!1)) : l?.allowEmpty ? V(!1) : V(!0) : V(!1);
|
|
1209
|
-
} else
|
|
1210
|
-
g("end"), Y(!0);
|
|
1211
|
-
},
|
|
1212
|
-
style: {
|
|
1213
|
-
flex: 1
|
|
1214
|
-
},
|
|
1215
|
-
allowClear: !0,
|
|
1216
|
-
onClear: () => {
|
|
1217
|
-
const n = Array.isArray(o) ? [...o, 1] : [o, 1];
|
|
1218
|
-
k.setFieldValue(n, void 0), w([F[0], null]), f.current && (f.current.value = "", f.current.updateValue()), setTimeout(() => {
|
|
1219
|
-
c.current?.focus(), g("start"), Y(!0);
|
|
1220
|
-
}, 0);
|
|
1221
|
-
},
|
|
1222
|
-
placeholder: s.replace(/0/g, "_"),
|
|
1223
|
-
suffix: /* @__PURE__ */ a(ue, { style: { color: "#d9d9d9" } }),
|
|
1224
|
-
autoComplete: "off"
|
|
1225
|
-
}
|
|
1226
|
-
)
|
|
1227
|
-
}
|
|
1228
|
-
)
|
|
1229
|
-
]
|
|
1230
|
-
}
|
|
1231
|
-
),
|
|
1232
|
-
/* @__PURE__ */ a(
|
|
1233
|
-
lt,
|
|
1234
|
-
{
|
|
1235
|
-
...l,
|
|
1236
|
-
open: D,
|
|
1237
|
-
picker: t,
|
|
1238
|
-
format: {
|
|
1239
|
-
format: e,
|
|
1240
|
-
type: "mask"
|
|
1241
|
-
},
|
|
1242
|
-
showNow: !0,
|
|
1243
|
-
value: F,
|
|
1244
|
-
onChange: Z,
|
|
1245
|
-
onOpenChange: (n) => {
|
|
1246
|
-
Y(n), n || W(!1);
|
|
1247
|
-
},
|
|
1248
|
-
renderExtraFooter: () => R ? /* @__PURE__ */ G(
|
|
1249
|
-
"div",
|
|
1250
|
-
{
|
|
1251
|
-
style: {
|
|
1252
|
-
color: "#faad14",
|
|
1253
|
-
paddingLeft: "8px",
|
|
1254
|
-
fontSize: "12px",
|
|
1255
|
-
display: "flex",
|
|
1256
|
-
alignItems: "center",
|
|
1257
|
-
gap: "6px",
|
|
1258
|
-
borderTop: "1px solid #f0f0f0",
|
|
1259
|
-
backgroundColor: "#fffbe6"
|
|
1260
|
-
},
|
|
1261
|
-
children: [
|
|
1262
|
-
/* @__PURE__ */ a(Ve, {}),
|
|
1263
|
-
/* @__PURE__ */ a("span", { children: "유효하지 않은 날짜입니다" })
|
|
1264
|
-
]
|
|
1265
|
-
}
|
|
1266
|
-
) : null,
|
|
1267
|
-
getPopupContainer: (n) => n.parentElement,
|
|
1268
|
-
style: {
|
|
1269
|
-
position: "absolute",
|
|
1270
|
-
top: 0,
|
|
1271
|
-
left: 0,
|
|
1272
|
-
pointerEvents: "none",
|
|
1273
|
-
opacity: 0,
|
|
1274
|
-
width: "100%"
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
)
|
|
1278
|
-
]
|
|
1279
|
-
}
|
|
1280
|
-
)
|
|
1281
|
-
}
|
|
1282
|
-
);
|
|
1283
|
-
}, { Option: pe } = de, Bt = ({ itemProps: t, inputProps: r }) => {
|
|
1284
|
-
const [d, l] = j([]);
|
|
1285
|
-
return P(() => {
|
|
1286
|
-
r?.addField === "ALL" ? l([
|
|
1287
|
-
{ label: "전체", value: "" },
|
|
1288
|
-
...r?.list || []
|
|
1289
|
-
]) : r?.addField === "NULL" ? l([{ label: "", value: "" }, ...r?.list || []]) : l(r?.list || []);
|
|
1290
|
-
}, [r?.list]), /* @__PURE__ */ a(
|
|
1291
|
-
T,
|
|
1292
|
-
{
|
|
1293
|
-
...t,
|
|
1294
|
-
getValueProps: (e) => e ? {
|
|
1295
|
-
value: e && e.indexOf(",") > 0 ? e.split(",") : [e]
|
|
1296
|
-
} : {
|
|
1297
|
-
value: []
|
|
1298
|
-
},
|
|
1299
|
-
normalize: (e) => e != null && e != null && e.length > 0 ? e.toString() : "",
|
|
1300
|
-
children: /* @__PURE__ */ a(de, { ...r, mode: "multiple", children: d.map((e) => {
|
|
1301
|
-
const { value: s, label: p } = e;
|
|
1302
|
-
return r?.printCode ? /* @__PURE__ */ a(pe, { value: s, label: p, children: /* @__PURE__ */ a(oe, { children: `[${s}] ${p}` }) }, s) : /* @__PURE__ */ a(pe, { value: s, label: p, children: /* @__PURE__ */ a(oe, { children: `${p}` }) }, s);
|
|
1303
|
-
}) })
|
|
1304
|
-
}
|
|
1305
|
-
);
|
|
1306
|
-
}, zt = ({ itemProps: t, inputProps: r }) => {
|
|
1307
|
-
const d = (e) => {
|
|
1308
|
-
let s = e.toString().split(".");
|
|
1309
|
-
return r?.decimalPoint != null && s[1] != null && r?.decimalPoint > 0 ? s[1].length > r?.decimalPoint ? s[1] = "." + s[1].substring(0, r?.decimalPoint) : s[1] = "." + s[1] : s[1] = "", s[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + s[1];
|
|
1310
|
-
}, l = (e) => {
|
|
1311
|
-
let s = e.toString().split(".");
|
|
1312
|
-
return r?.decimalPoint != null && s[1] != null && r?.decimalPoint > 0 ? s[1].length > r?.decimalPoint ? s[1] = "." + s[1].substring(0, r?.decimalPoint) : s[1] = "." + s[1] : s[1] = "", s[0].replace(/\$\s?|(,*)/g, "") + s[1];
|
|
1313
|
-
};
|
|
1314
|
-
return /* @__PURE__ */ a(T, { ...t, children: /* @__PURE__ */ a(
|
|
1315
|
-
De,
|
|
1316
|
-
{
|
|
1317
|
-
...r,
|
|
1318
|
-
formatter: (e) => d(e),
|
|
1319
|
-
parser: (e) => l(e)
|
|
1320
|
-
}
|
|
1321
|
-
) });
|
|
1322
|
-
}, Ot = ({ itemProps: t, inputProps: r }) => /* @__PURE__ */ a(T, { ...t, children: /* @__PURE__ */ a(_e.Group, { ...r }) }), { RangePicker: ct } = ie, ye = {
|
|
1323
|
-
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
1324
|
-
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
1325
|
-
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
|
|
1326
|
-
time: { displayFormat: "HH:mm", outputFormat: "HHmm" },
|
|
1327
|
-
datetime: {
|
|
1328
|
-
displayFormat: "YYYY-MM-DD HH:mm",
|
|
1329
|
-
outputFormat: "YYYYMMDDHHmm"
|
|
1330
|
-
}
|
|
1331
|
-
}, $t = ({
|
|
1332
|
-
itemProps: t,
|
|
1333
|
-
inputProps: r,
|
|
1334
|
-
type: d = "date",
|
|
1335
|
-
minDate: l,
|
|
1336
|
-
maxDate: e,
|
|
1337
|
-
returnType: s = "string"
|
|
1338
|
-
}) => {
|
|
1339
|
-
const { displayFormat: p, outputFormat: c } = X(
|
|
1340
|
-
() => ye[d],
|
|
1341
|
-
[d]
|
|
1342
|
-
), y = X(
|
|
1343
|
-
() => Object.values(ye).map((i) => i.outputFormat).sort((i, f) => {
|
|
1344
|
-
if (i.length === f.length) {
|
|
1345
|
-
if (i === c) return -1;
|
|
1346
|
-
if (f === c) return 1;
|
|
1347
|
-
}
|
|
1348
|
-
return f.length - i.length;
|
|
1349
|
-
}),
|
|
1350
|
-
[c]
|
|
1351
|
-
// type(outputFormat)이 바뀔 때마다 재정렬
|
|
1352
|
-
);
|
|
1353
|
-
return /* @__PURE__ */ a(
|
|
1354
|
-
T,
|
|
1355
|
-
{
|
|
1356
|
-
...t,
|
|
1357
|
-
getValueProps: (i) => ({
|
|
1358
|
-
// 폼에 저장된 값(문자열 또는 Dayjs)을 RangePicker가 요구하는 Dayjs 배열로 변환
|
|
1359
|
-
value: i && i.length > 0 ? [
|
|
1360
|
-
i[0] ? N.isDayjs(i[0]) ? i[0] : N(i[0], y) : null,
|
|
1361
|
-
i[1] ? N.isDayjs(i[1]) ? i[1] : N(i[1], y) : null
|
|
1362
|
-
] : null
|
|
1363
|
-
}),
|
|
1364
|
-
normalize: (i) => i ? s === "dayjs" ? [i[0] ?? void 0, i[1] ?? void 0] : [
|
|
1365
|
-
i[0] ? i[0].format(c) : void 0,
|
|
1366
|
-
i[1] ? i[1].format(c) : void 0
|
|
1367
|
-
] : [void 0, void 0],
|
|
1368
|
-
children: /* @__PURE__ */ a(
|
|
1369
|
-
ct,
|
|
1370
|
-
{
|
|
1371
|
-
...r,
|
|
1372
|
-
order: !0,
|
|
1373
|
-
minDate: l ? N(l, y) : void 0,
|
|
1374
|
-
maxDate: e ? N(e, y) : void 0,
|
|
1375
|
-
picker: d === "datetime" ? "date" : d,
|
|
1376
|
-
showTime: r?.showTime ?? (d === "datetime" || d === "time"),
|
|
1377
|
-
format: p
|
|
1378
|
-
}
|
|
1379
|
-
)
|
|
1380
|
-
}
|
|
1381
|
-
);
|
|
1382
|
-
}, Fe = J.Search, Rt = (t) => {
|
|
1383
|
-
const r = $.useFormInstance(), { openPopup: d } = ze(), l = t.itemProps?.name || [], e = t.popupConfig || {
|
|
1384
|
-
callback(p) {
|
|
1385
|
-
Array.isArray(l) && l.length > 1 ? (r.setFieldValue(l[0], p.code), r.setFieldValue(l[1], p.name)) : r.setFieldValue(l, p.code);
|
|
1386
|
-
}
|
|
1387
|
-
}, s = {
|
|
1388
|
-
...t,
|
|
1389
|
-
placeholder: typeof t.placeholder == "string" ? t.placeholder : t.placeholder?.[0] || "",
|
|
1390
|
-
onChange: (p) => {
|
|
1391
|
-
Array.isArray(l) && l.length > 1 && r.setFieldValue(l[0], ""), t.onChange?.(p);
|
|
1392
|
-
},
|
|
1393
|
-
onSearch: (p) => {
|
|
1394
|
-
t.popuCd ? d(t.popuCd, t.popupParams, e) : t.onSearch?.(p);
|
|
1395
|
-
}
|
|
1396
|
-
};
|
|
1397
|
-
return Array.isArray(l) && l.length > 1 ? /* @__PURE__ */ a(T, { ...t.itemProps, name: void 0, children: /* @__PURE__ */ G(oe.Compact, { block: !0, children: [
|
|
1398
|
-
/* @__PURE__ */ a(
|
|
1399
|
-
$.Item,
|
|
1400
|
-
{
|
|
1401
|
-
name: l[0],
|
|
1402
|
-
rules: t.itemProps?.rules,
|
|
1403
|
-
style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
|
|
1404
|
-
validateStatus: "",
|
|
1405
|
-
help: "",
|
|
1406
|
-
children: /* @__PURE__ */ a(
|
|
1407
|
-
J,
|
|
1408
|
-
{
|
|
1409
|
-
style: { color: "#999", backgroundColor: "#f5f5f5" },
|
|
1410
|
-
placeholder: t.placeholder?.[0] || "",
|
|
1411
|
-
readOnly: !0
|
|
1412
|
-
}
|
|
1413
|
-
)
|
|
1414
|
-
}
|
|
1415
|
-
),
|
|
1416
|
-
/* @__PURE__ */ a($.Item, { name: l[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ a(
|
|
1417
|
-
Fe,
|
|
1418
|
-
{
|
|
1419
|
-
readOnly: t.readOnly,
|
|
1420
|
-
enterButton: /* @__PURE__ */ a(
|
|
1421
|
-
te,
|
|
1422
|
-
{
|
|
1423
|
-
icon: /* @__PURE__ */ a(Pe, {}),
|
|
1424
|
-
disabled: t.readOnly
|
|
1425
|
-
}
|
|
1426
|
-
),
|
|
1427
|
-
...s
|
|
1428
|
-
}
|
|
1429
|
-
) })
|
|
1430
|
-
] }) }) : /* @__PURE__ */ a(T, { ...t.itemProps, children: /* @__PURE__ */ a(Fe, { ...s }) });
|
|
1431
|
-
}, Ut = ({
|
|
1432
|
-
itemProps: t,
|
|
1433
|
-
selectProps: r = {
|
|
1434
|
-
options: [],
|
|
1435
|
-
allowClear: !0
|
|
1436
|
-
}
|
|
1437
|
-
}) => {
|
|
1438
|
-
const d = $.useFormInstance(), l = !!d, e = X(() => r?.addField === "ALL" ? [{ label: "전체", value: "" }, ...r?.options || []] : r?.addField === "NULL" ? [{ label: "", value: "" }, ...r?.options || []] : r?.options || [], [r.options, r.addField]), s = (y) => {
|
|
1439
|
-
r.onChange?.(y);
|
|
1440
|
-
}, p = {
|
|
1441
|
-
...r,
|
|
1442
|
-
allowClear: r.allowClear ?? !0,
|
|
1443
|
-
options: e,
|
|
1444
|
-
onChange: s,
|
|
1445
|
-
variant: r.variant
|
|
1446
|
-
}, c = /* @__PURE__ */ a(de, { ...p, disabled: r.disabled });
|
|
1447
|
-
return r.copyable && !l && console.warn(
|
|
1448
|
-
"BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."
|
|
1449
|
-
), r.copyable ? /* @__PURE__ */ a(T, { ...t, name: void 0, children: /* @__PURE__ */ G(oe.Compact, { block: !0, children: [
|
|
1450
|
-
/* @__PURE__ */ a(
|
|
1451
|
-
$.Item,
|
|
1452
|
-
{
|
|
1453
|
-
name: t?.name,
|
|
1454
|
-
rules: t?.rules,
|
|
1455
|
-
style: { width: "100%", marginBottom: 0 },
|
|
1456
|
-
validateStatus: "",
|
|
1457
|
-
help: "",
|
|
1458
|
-
children: c
|
|
1459
|
-
}
|
|
1460
|
-
),
|
|
1461
|
-
/* @__PURE__ */ a(
|
|
1462
|
-
be.Paragraph,
|
|
1463
|
-
{
|
|
1464
|
-
copyable: {
|
|
1465
|
-
text: l && d?.getFieldValue(t?.name)?.toString() || "",
|
|
1466
|
-
tooltips: ["코드복사", "코드복사됨"]
|
|
1467
|
-
},
|
|
1468
|
-
style: {
|
|
1469
|
-
margin: 0,
|
|
1470
|
-
backgroundColor: "#f5f5f5",
|
|
1471
|
-
borderRadius: "4px",
|
|
1472
|
-
border: "1px solid #d9d9d9",
|
|
1473
|
-
fontSize: "12px",
|
|
1474
|
-
color: "#666",
|
|
1475
|
-
display: "flex",
|
|
1476
|
-
alignItems: "center",
|
|
1477
|
-
height: "30px",
|
|
1478
|
-
padding: "0 8px"
|
|
1479
|
-
}
|
|
1480
|
-
}
|
|
1481
|
-
)
|
|
1482
|
-
] }) }) : /* @__PURE__ */ a(T, { ...t, children: c });
|
|
1483
|
-
}, Tt = ({
|
|
1484
|
-
itemProps: t,
|
|
1485
|
-
inputProps: r = {
|
|
1486
|
-
format: "YN"
|
|
1487
|
-
}
|
|
1488
|
-
}) => {
|
|
1489
|
-
const d = $.useFormInstance(), l = (e, s) => {
|
|
1490
|
-
r.format === "boolean" ? d.setFieldValue(t?.name, e) : d.setFieldValue(t?.name, e ? "Y" : "N"), r.onChange && r.onChange(e, s);
|
|
1491
|
-
};
|
|
1492
|
-
return /* @__PURE__ */ a(
|
|
1493
|
-
T,
|
|
1494
|
-
{
|
|
1495
|
-
...t,
|
|
1496
|
-
getValueProps: (e) => ({ checked: r.format === "boolean" ? !!e : e === "Y" }),
|
|
1497
|
-
normalize: (e) => typeof e == "boolean" ? r.format === "boolean" ? e : e ? "Y" : "N" : r.format === "boolean" ? !!e : e ? "Y" : "N",
|
|
1498
|
-
children: /* @__PURE__ */ a(Ne, { ...r, onChange: (e, s) => l(e, s) })
|
|
1499
|
-
}
|
|
1500
|
-
);
|
|
1501
|
-
}, { TextArea: ut } = J, jt = ({ itemProps: t, inputProps: r }) => /* @__PURE__ */ a(T, { ...t, children: /* @__PURE__ */ a(ut, { ...r }) }), dt = [
|
|
1502
|
-
".pdf",
|
|
1503
|
-
".xlsx",
|
|
1504
|
-
".xls",
|
|
1505
|
-
".docx",
|
|
1506
|
-
".doc",
|
|
1507
|
-
".pptx",
|
|
1508
|
-
".ppt",
|
|
1509
|
-
".hwp",
|
|
1510
|
-
".txt",
|
|
1511
|
-
".csv",
|
|
1512
|
-
// 이미지
|
|
1513
|
-
".jpg",
|
|
1514
|
-
".jpeg",
|
|
1515
|
-
".png",
|
|
1516
|
-
".gif",
|
|
1517
|
-
// 압축
|
|
1518
|
-
".zip"
|
|
1519
|
-
], Ce = {
|
|
1520
|
-
FILE: "file"
|
|
1521
|
-
}, ft = ({
|
|
1522
|
-
originNode: t,
|
|
1523
|
-
file: r,
|
|
1524
|
-
fileList: d,
|
|
1525
|
-
moveFile: l,
|
|
1526
|
-
onDrop: e
|
|
1527
|
-
}) => {
|
|
1528
|
-
const s = K(null), [{ handlerId: p }, c] = Ze({
|
|
1529
|
-
accept: Ce.FILE,
|
|
1530
|
-
collect: (b) => ({
|
|
1531
|
-
handlerId: b.getHandlerId()
|
|
1532
|
-
}),
|
|
1533
|
-
hover(b, k) {
|
|
1534
|
-
if (!s.current)
|
|
1535
|
-
return;
|
|
1536
|
-
const D = b.uid, Y = r.uid;
|
|
1537
|
-
if (D === Y)
|
|
1538
|
-
return;
|
|
1539
|
-
const R = ne(d, { uid: Y }), V = ne(d, { uid: D });
|
|
1540
|
-
if (V === -1 || R === -1)
|
|
1541
|
-
return;
|
|
1542
|
-
const _ = s.current.getBoundingClientRect(), g = k.getClientOffset();
|
|
1543
|
-
if (!g)
|
|
1544
|
-
return;
|
|
1545
|
-
const v = (_.bottom - _.top) / 2, A = g.y - _.top;
|
|
1546
|
-
V < R && A < v || V > R && A > v || l(D, Y);
|
|
1547
|
-
},
|
|
1548
|
-
drop() {
|
|
1549
|
-
e();
|
|
1550
|
-
}
|
|
1551
|
-
}), [{ isDragging: y }, i] = Qe({
|
|
1552
|
-
type: Ce.FILE,
|
|
1553
|
-
item: () => ({
|
|
1554
|
-
uid: r.uid,
|
|
1555
|
-
index: ne(d, { uid: r.uid })
|
|
1556
|
-
}),
|
|
1557
|
-
collect: (b) => ({
|
|
1558
|
-
isDragging: b.isDragging()
|
|
1559
|
-
})
|
|
1560
|
-
}), f = y ? 0 : 1;
|
|
1561
|
-
return i(c(s)), /* @__PURE__ */ a("div", { ref: s, style: { opacity: f }, "data-handler-id": p, children: t });
|
|
1562
|
-
}, Ht = ({
|
|
1563
|
-
itemProps: t,
|
|
1564
|
-
fileGrpKey: r,
|
|
1565
|
-
onUploadComplete: d,
|
|
1566
|
-
onFetchFilesTrxCd: l = "SCMFILE00101",
|
|
1567
|
-
onSuccessTrxCd: e = "SCMFILE00102",
|
|
1568
|
-
onDeleteFileTrxCd: s = "SCMFILE00103",
|
|
1569
|
-
onReorderFilesTrxCd: p = "SCMFILE00104",
|
|
1570
|
-
allowedExtensions: c = dt,
|
|
1571
|
-
maxFileSize: y = 200,
|
|
1572
|
-
showButton: i = !0,
|
|
1573
|
-
// 기본값으로 true 설정
|
|
1574
|
-
multiple: f = !1,
|
|
1575
|
-
newFileGrpKeyonModify: b = !1,
|
|
1576
|
-
buttonText: k = "파일 선택",
|
|
1577
|
-
localOnly: D = !1,
|
|
1578
|
-
onFilesChange: Y
|
|
1579
|
-
}) => {
|
|
1580
|
-
const [R, V] = j([]), _ = K(r), g = K([]), v = $.useFormInstance(), z = K(
|
|
1581
|
-
Je(() => {
|
|
1582
|
-
if (D || g.current.length === 0)
|
|
1583
|
-
return;
|
|
1584
|
-
const n = [...g.current];
|
|
1585
|
-
if (g.current = [], e) {
|
|
1586
|
-
const m = n.map((h) => ({
|
|
1587
|
-
crprCd: Q()?.crprCd,
|
|
1588
|
-
sysCd: __SYS_CD__,
|
|
1589
|
-
fileGrpKey: _.current,
|
|
1590
|
-
physFileNm: h.fileNameP,
|
|
1591
|
-
lgclFileNm: h.fileNameL,
|
|
1592
|
-
filePath: h.filePath,
|
|
1593
|
-
fileExtn: h.fileExt,
|
|
1594
|
-
fileSize: h.fileSize,
|
|
1595
|
-
mltpYn: "N"
|
|
1596
|
-
}));
|
|
1597
|
-
console.log("newFileGrpKeyonModify", b), console.log(
|
|
1598
|
-
"newFileGrpKeyonModify",
|
|
1599
|
-
b ? 0 : _.current
|
|
1600
|
-
), ee(e, {
|
|
1601
|
-
crprCd: Q()?.crprCd,
|
|
1602
|
-
sysCd: __SYS_CD__,
|
|
1603
|
-
fileGrpKey: b ? 0 : _.current,
|
|
1604
|
-
oldFileGrpKey: _.current,
|
|
1605
|
-
newFileGrpKeyonModify: b,
|
|
1606
|
-
sub: m
|
|
1607
|
-
}).then((h) => {
|
|
1608
|
-
if (h?.sub && h.sub.length > 0) {
|
|
1609
|
-
const u = h.sub[0].fileGrpKey;
|
|
1610
|
-
(!_.current || b) && (_.current = u);
|
|
1611
|
-
const M = /* @__PURE__ */ new Map();
|
|
1612
|
-
h.sub.forEach((I) => {
|
|
1613
|
-
const x = n.find(
|
|
1614
|
-
(H) => H.fileNameL === I.lgclFileNm
|
|
1615
|
-
);
|
|
1616
|
-
x && M.set(x.tempId, I);
|
|
1617
|
-
});
|
|
1618
|
-
const C = t?.name;
|
|
1619
|
-
((I) => {
|
|
1620
|
-
if (S) {
|
|
1621
|
-
const x = v?.getFieldValue(C) || [], H = I(x);
|
|
1622
|
-
v?.setFieldValue(C, H);
|
|
1623
|
-
} else
|
|
1624
|
-
V((x) => I(x));
|
|
1625
|
-
})((I) => I.map((x) => {
|
|
1626
|
-
const H = M.get(x.uid);
|
|
1627
|
-
if (H) {
|
|
1628
|
-
const fe = n.find(
|
|
1629
|
-
(we) => we.tempId === x.uid
|
|
1630
|
-
);
|
|
1631
|
-
return d && fe && d({
|
|
1632
|
-
...fe,
|
|
1633
|
-
fileGrpKey: u,
|
|
1634
|
-
fileKey: H.fileKey
|
|
1635
|
-
}), {
|
|
1636
|
-
...x,
|
|
1637
|
-
name: H.lgclFileNm,
|
|
1638
|
-
fileGrpKey: u,
|
|
1639
|
-
fileKey: H.fileKey,
|
|
1640
|
-
uid: H.fileKey,
|
|
1641
|
-
status: "done",
|
|
1642
|
-
url: `/api/download?filePath=${H.filePath}&logicalName=${H.lgclFileNm}`
|
|
1643
|
-
};
|
|
1644
|
-
}
|
|
1645
|
-
return x;
|
|
1646
|
-
}));
|
|
1647
|
-
}
|
|
1648
|
-
}).catch((h) => {
|
|
1649
|
-
console.error("업로드 후처리 서비스 호출 실패:", h), O.error("파일 후처리 중 오류가 발생했습니다.");
|
|
1650
|
-
const u = new Set(n.map((L) => L.tempId)), M = t?.name;
|
|
1651
|
-
((L) => {
|
|
1652
|
-
if (S) {
|
|
1653
|
-
const I = v?.getFieldValue(M) || [], x = L(I);
|
|
1654
|
-
v?.setFieldValue(M, x);
|
|
1655
|
-
} else
|
|
1656
|
-
V((I) => L(I));
|
|
1657
|
-
})(
|
|
1658
|
-
(L) => L.map(
|
|
1659
|
-
(I) => u.has(I.uid) ? { ...I, status: "error", error: "후처리 실패" } : I
|
|
1660
|
-
)
|
|
1661
|
-
);
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
}, 500)
|
|
1665
|
-
).current;
|
|
1666
|
-
P(() => () => {
|
|
1667
|
-
z.cancel();
|
|
1668
|
-
}, [z]), P(() => {
|
|
1669
|
-
_.current = r;
|
|
1670
|
-
}, [r]), P(() => {
|
|
1671
|
-
D || r && l && ee(l, {
|
|
1672
|
-
crprCd: Q()?.crprCd,
|
|
1673
|
-
sysCd: __SYS_CD__,
|
|
1674
|
-
fileGrpKey: r
|
|
1675
|
-
}).then((n) => {
|
|
1676
|
-
if (n?.sub) {
|
|
1677
|
-
const m = n.sub.map((u) => ({
|
|
1678
|
-
uid: u.fileKey,
|
|
1679
|
-
name: u.lgclFileNm,
|
|
1680
|
-
status: "done",
|
|
1681
|
-
url: `/api/download?filePath=${u.filePath}&logicalName=${u.lgclFileNm}`
|
|
1682
|
-
})), h = t?.name;
|
|
1683
|
-
S ? v?.setFieldValue(h, m) : V(m);
|
|
1684
|
-
} else {
|
|
1685
|
-
const m = t?.name;
|
|
1686
|
-
S ? v?.setFieldValue(m, []) : V([]);
|
|
1687
|
-
}
|
|
1688
|
-
}).catch((n) => {
|
|
1689
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", n), O.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
1690
|
-
});
|
|
1691
|
-
}, [r, l]);
|
|
1692
|
-
const o = (n, m) => {
|
|
1693
|
-
const h = t?.name, u = S ? v?.getFieldValue(h) || [] : R, M = ne(u, { uid: n }), C = ne(u, { uid: m });
|
|
1694
|
-
if (M < 0 || C < 0) return;
|
|
1695
|
-
const L = [...u], [I] = L.splice(M, 1);
|
|
1696
|
-
L.splice(C, 0, I), S ? v?.setFieldValue(h, L) : V(L);
|
|
1697
|
-
}, F = () => {
|
|
1698
|
-
if (!D && r && p) {
|
|
1699
|
-
const n = t?.name, h = (S ? v?.getFieldValue(n) || [] : R).map((u) => u.uid);
|
|
1700
|
-
ee(p, {
|
|
1701
|
-
crprCd: Q()?.crprCd,
|
|
1702
|
-
sysCd: __SYS_CD__,
|
|
1703
|
-
fileGrpKey: r,
|
|
1704
|
-
reorderedFileKeys: h
|
|
1705
|
-
}).then(() => {
|
|
1706
|
-
O.success("파일 순서가 성공적으로 저장되었습니다.");
|
|
1707
|
-
}).catch((u) => {
|
|
1708
|
-
console.error("파일 순서 저장 서비스 호출 실패:", u), O.error("파일 순서 저장 중 오류가 발생했습니다.");
|
|
1709
|
-
});
|
|
1710
|
-
}
|
|
1711
|
-
}, w = (n) => {
|
|
1712
|
-
const m = t?.name, h = S ? v?.getFieldValue(m) || [] : R;
|
|
1713
|
-
if (!f && h.length > 0)
|
|
1714
|
-
return O.error("하나의 파일만 업로드할 수 있습니다."), q.LIST_IGNORE;
|
|
1715
|
-
if (c && c.length > 0) {
|
|
1716
|
-
const u = `.${n.name.split(".").pop()?.toLowerCase()}`;
|
|
1717
|
-
if (!c.includes(u))
|
|
1718
|
-
return O.error(
|
|
1719
|
-
`${n.name} 파일은 허용되지 않는 확장자입니다. (${c.join(
|
|
1720
|
-
", "
|
|
1721
|
-
)})`
|
|
1722
|
-
), q.LIST_IGNORE;
|
|
1723
|
-
}
|
|
1724
|
-
return y && !(n.size / 1024 / 1024 < y) ? (O.error(`일반업로드의 최대용량은 ${y}MB입니다.`), q.LIST_IGNORE) : !D;
|
|
1725
|
-
}, S = !!t?.name, E = {
|
|
1726
|
-
name: "file",
|
|
1727
|
-
multiple: f,
|
|
1728
|
-
action: D ? void 0 : "/api/upload",
|
|
1729
|
-
beforeUpload: w,
|
|
1730
|
-
showUploadList: {
|
|
1731
|
-
showRemoveIcon: i
|
|
1732
|
-
// showButton 값에 따라 삭제 버튼 표시/숨김
|
|
1733
|
-
},
|
|
1734
|
-
onChange(n) {
|
|
1735
|
-
const { status: m, uid: h } = n.file;
|
|
1736
|
-
if (m === "removed") {
|
|
1737
|
-
if (!D && s)
|
|
1738
|
-
ee(s, {
|
|
1739
|
-
crprCd: Q()?.crprCd,
|
|
1740
|
-
sysCd: __SYS_CD__,
|
|
1741
|
-
fileGrpKey: b ? 0 : _.current,
|
|
1742
|
-
fileKey: h,
|
|
1743
|
-
oldFileGrpKey: _.current,
|
|
1744
|
-
newFileGrpKeyonModify: b
|
|
1745
|
-
}).then((u) => {
|
|
1746
|
-
if (O.success("파일이 성공적으로 삭제되었습니다."), b && (_.current = u.fileGrpKey), S) {
|
|
1747
|
-
const M = t?.name;
|
|
1748
|
-
v?.setFieldValue(M, n.fileList);
|
|
1749
|
-
} else
|
|
1750
|
-
V(n.fileList);
|
|
1751
|
-
Y?.(n.fileList), d?.({
|
|
1752
|
-
fileGrpKey: u.fileGrpKey
|
|
1753
|
-
});
|
|
1754
|
-
}).catch((u) => {
|
|
1755
|
-
console.error("파일 삭제 서비스 호출에 실패했습니다.", u), O.error("파일 삭제 중 오류가 발생했습니다.");
|
|
1756
|
-
});
|
|
1757
|
-
else {
|
|
1758
|
-
if (S) {
|
|
1759
|
-
const u = t?.name;
|
|
1760
|
-
v?.setFieldValue(u, n.fileList);
|
|
1761
|
-
} else
|
|
1762
|
-
V(n.fileList);
|
|
1763
|
-
Y?.(n.fileList);
|
|
1764
|
-
}
|
|
1765
|
-
return;
|
|
1766
|
-
}
|
|
1767
|
-
if (S) {
|
|
1768
|
-
const u = t?.name;
|
|
1769
|
-
v?.setFieldValue(u, n.fileList);
|
|
1770
|
-
} else
|
|
1771
|
-
V(n.fileList);
|
|
1772
|
-
if (Y?.(n.fileList), m === "done")
|
|
1773
|
-
if (!D && n.file.response?.success) {
|
|
1774
|
-
const { uploadedFiles: u } = n.file.response;
|
|
1775
|
-
u && Array.isArray(u) && u.length > 0 && (u.forEach((M) => {
|
|
1776
|
-
M.tempId = n.file.uid, g.current.push(M);
|
|
1777
|
-
}), z()), O.success(
|
|
1778
|
-
n.file.response.message || `${n.file.name} 파일이 성공적으로 업로드되었습니다.`
|
|
1779
|
-
);
|
|
1780
|
-
} else
|
|
1781
|
-
O.error(
|
|
1782
|
-
n.file.response?.message || `${n.file.name} 파일 업로드에 실패했습니다.`
|
|
1783
|
-
);
|
|
1784
|
-
else m === "error" && O.error(
|
|
1785
|
-
n.file.response?.message || `${n.file.name} 파일 업로드 중 오류가 발생했습니다.`
|
|
1786
|
-
);
|
|
1787
|
-
},
|
|
1788
|
-
itemRender(n, m, h) {
|
|
1789
|
-
const u = Ee(n, {
|
|
1790
|
-
href: m.url || void 0,
|
|
1791
|
-
title: void 0
|
|
1792
|
-
});
|
|
1793
|
-
return /* @__PURE__ */ a(
|
|
1794
|
-
ft,
|
|
1795
|
-
{
|
|
1796
|
-
originNode: u,
|
|
1797
|
-
file: m,
|
|
1798
|
-
fileList: h,
|
|
1799
|
-
moveFile: o,
|
|
1800
|
-
onDrop: F
|
|
1801
|
-
},
|
|
1802
|
-
m.uid
|
|
1803
|
-
);
|
|
1804
|
-
}
|
|
1805
|
-
};
|
|
1806
|
-
S || (E.fileList = R);
|
|
1807
|
-
const B = (n) => Array.isArray(n) ? n : n && n.fileList, U = t?.name, Z = S ? $.useWatch?.(U, v) : void 0, W = S ? Z || [] : R;
|
|
1808
|
-
return /* @__PURE__ */ a(Xe, { backend: et, children: /* @__PURE__ */ a(
|
|
1809
|
-
T,
|
|
1810
|
-
{
|
|
1811
|
-
valuePropName: "fileList",
|
|
1812
|
-
getValueFromEvent: B,
|
|
1813
|
-
...t,
|
|
1814
|
-
children: /* @__PURE__ */ a(
|
|
1815
|
-
q,
|
|
1816
|
-
{
|
|
1817
|
-
headers: { SYSCD: __SYS_CD__ },
|
|
1818
|
-
...E,
|
|
1819
|
-
listType: "picture",
|
|
1820
|
-
children: i && (f || W.length === 0) && /* @__PURE__ */ a(te, { icon: /* @__PURE__ */ a(ke, {}), children: k })
|
|
1821
|
-
}
|
|
1822
|
-
)
|
|
1823
|
-
}
|
|
1824
|
-
) });
|
|
1825
|
-
};
|
|
1
|
+
import { B as g, k as s, l as w, i as B, r as t, a as r, d as o, b as c, o as d, p as k, q as i, t as l, h as n, g as m, m as p, j as u, e as h, c as M, u as S, f as D, n as I } from "../../chunks/core-components-Ckwf4Rd7.js";
|
|
1826
2
|
export {
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
3
|
+
g as BwgButton,
|
|
4
|
+
s as BwgCheck,
|
|
5
|
+
w as BwgCheckList,
|
|
6
|
+
B as BwgDatePicker,
|
|
7
|
+
t as BwgDownload,
|
|
8
|
+
r as BwgForm,
|
|
9
|
+
o as BwgFormItem,
|
|
10
|
+
c as BwgInput,
|
|
11
|
+
d as BwgLargeUploader,
|
|
12
|
+
k as BwgMaskedDate,
|
|
13
|
+
i as BwgMaskedInput,
|
|
14
|
+
l as BwgMaskedRange,
|
|
15
|
+
n as BwgMultiSelect,
|
|
16
|
+
m as BwgNumber,
|
|
17
|
+
p as BwgRadio,
|
|
18
|
+
u as BwgRangePicker,
|
|
19
|
+
h as BwgSearch,
|
|
20
|
+
M as BwgSelect,
|
|
21
|
+
S as BwgSwitch,
|
|
22
|
+
D as BwgTextArea,
|
|
23
|
+
I as BwgUploader
|
|
1848
24
|
};
|