@bwg-ui/core 1.2.0 → 1.2.1
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/{common-components-CI7wc_j0.js → common-components-CKPZB7JH.js} +1360 -1355
- package/dist/chunks/{common-components-cQcq2ylW.cjs → common-components-Cw7pbhrp.cjs} +14 -14
- package/dist/chunks/{core-xi9w8O3O.js → core-C2wEZy2f.js} +1 -1
- package/dist/chunks/{core-Cg6a-3GL.cjs → core-DfOWJ6JQ.cjs} +1 -1
- package/dist/chunks/{enc-base64-CyKdjNg8.js → enc-base64-BNbm__mu.js} +2 -2
- package/dist/chunks/{enc-base64-BR77UbCA.cjs → enc-base64-DPfS87kE.cjs} +1 -1
- package/dist/chunks/{sha256-DA5XnjXl.cjs → sha256-BXXaP9RF.cjs} +1 -1
- package/dist/chunks/{sha256-DmQY-nMP.js → sha256-ZWZAX8tH.js} +2 -2
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgUploader.d.ts +31 -6
- package/dist/components/core/BwgUploader.d.ts.map +1 -1
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +520 -453
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.js +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +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.js +3 -3
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { memo as
|
|
4
|
-
import
|
|
5
|
-
import { PaperClipOutlined as
|
|
6
|
-
import { isEmpty as
|
|
7
|
-
import { callService_SYSCD as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { usePopupStore as
|
|
11
|
-
import { DndProvider as
|
|
12
|
-
import { HTML5Backend as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as r, jsxs as q } from "react/jsx-runtime";
|
|
2
|
+
import { Button as J, Form as E, Checkbox as ie, ConfigProvider as pe, DatePicker as le, message as b, Card as Fe, List as P, Input as te, Spin as be, Upload as G, Typography as ye, Flex as de, Progress as Se, notification as we, Tooltip as Ie, Select as se, Space as ae, InputNumber as _e, Radio as Ne, Switch as Me } from "antd";
|
|
3
|
+
import { memo as De, useState as T, useEffect as j, useMemo as ee, forwardRef as ke, useRef as X, cloneElement as ve } from "react";
|
|
4
|
+
import z from "dayjs";
|
|
5
|
+
import { PaperClipOutlined as xe, DownloadOutlined as Ee, DeleteOutlined as Be, InboxOutlined as Oe, UploadOutlined as Ye, CloudUploadOutlined as Ve, CheckCircleOutlined as Ue, CloseCircleOutlined as Ae, FileTextOutlined as ze, SearchOutlined as Te } from "@ant-design/icons";
|
|
6
|
+
import { isEmpty as Re, debounce as $e, findIndex as ne } from "lodash";
|
|
7
|
+
import { callService_SYSCD as je, getUserInfo as K, callService as W } from "../../utils/index.js";
|
|
8
|
+
import He from "jszip";
|
|
9
|
+
import Ce from "imask";
|
|
10
|
+
import { usePopupStore as Ke } from "../../stores/index.js";
|
|
11
|
+
import { DndProvider as Ge, useDrop as qe, useDrag as We } from "react-dnd";
|
|
12
|
+
import { HTML5Backend as Je } from "react-dnd-html5-backend";
|
|
13
|
+
const yt = (t) => /* @__PURE__ */ r(J, { ...t, className: "bwg-btn" }), D = De(
|
|
14
14
|
({
|
|
15
15
|
children: t,
|
|
16
16
|
label: e,
|
|
@@ -22,12 +22,12 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
22
22
|
}) => {
|
|
23
23
|
const a = {
|
|
24
24
|
fontWeight: "bold"
|
|
25
|
-
}, u = Array.isArray(i) && i.some((
|
|
25
|
+
}, u = Array.isArray(i) && i.some((C) => C.required === !0), s = () => typeof e == "string" ? /* @__PURE__ */ q("span", { style: a, children: [
|
|
26
26
|
e,
|
|
27
27
|
u && /* @__PURE__ */ r("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
|
|
28
28
|
] }) : /* @__PURE__ */ r("span", { style: a, children: e });
|
|
29
29
|
return /* @__PURE__ */ r(
|
|
30
|
-
|
|
30
|
+
E.Item,
|
|
31
31
|
{
|
|
32
32
|
className: "bwg-form-item",
|
|
33
33
|
label: e ? s() : void 0,
|
|
@@ -42,44 +42,44 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
-
),
|
|
45
|
+
), Yt = ({
|
|
46
46
|
itemProps: t,
|
|
47
47
|
inputProps: e = {
|
|
48
48
|
format: "YN"
|
|
49
49
|
}
|
|
50
50
|
}) => {
|
|
51
|
-
const l =
|
|
51
|
+
const l = E.useFormInstance();
|
|
52
52
|
return /* @__PURE__ */ r(
|
|
53
53
|
D,
|
|
54
54
|
{
|
|
55
55
|
...t,
|
|
56
56
|
getValueProps: (n) => ({ checked: e.format === "boolean" ? !!n : n === "Y" }),
|
|
57
57
|
normalize: (n) => typeof n == "boolean" ? e.format === "boolean" ? n : n ? "Y" : "N" : e.format === "boolean" ? !!n : n ? "Y" : "N",
|
|
58
|
-
children: /* @__PURE__ */ r(
|
|
58
|
+
children: /* @__PURE__ */ r(ie, { ...e, onChange: (n) => {
|
|
59
59
|
e.format === "boolean" ? l.setFieldValue(t?.name, n.target.checked) : l.setFieldValue(t?.name, n.target.checked ? "Y" : "N"), e.onChange && e.onChange(n);
|
|
60
60
|
}, children: e?.title })
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
},
|
|
64
|
-
const l =
|
|
63
|
+
}, Ct = ({ itemProps: t, inputProps: e }) => {
|
|
64
|
+
const l = E.useFormInstance(), [i, n] = T(
|
|
65
65
|
t?.initialValue ?? []
|
|
66
|
-
), [o, d] =
|
|
67
|
-
|
|
66
|
+
), [o, d] = T([]), a = o.length > 0 && o.length == i?.length, u = i?.length > 0 && i.length < o.length;
|
|
67
|
+
j(() => {
|
|
68
68
|
d(s(e?.options));
|
|
69
|
-
}, [e?.options]),
|
|
69
|
+
}, [e?.options]), j(() => {
|
|
70
70
|
n(i);
|
|
71
71
|
}, [i]);
|
|
72
|
-
const s = (
|
|
73
|
-
const
|
|
74
|
-
return (
|
|
75
|
-
|
|
76
|
-
}),
|
|
77
|
-
},
|
|
78
|
-
n(
|
|
79
|
-
}, F = (
|
|
80
|
-
n(
|
|
72
|
+
const s = (Y) => {
|
|
73
|
+
const L = [];
|
|
74
|
+
return (Y || []).map((k, B) => {
|
|
75
|
+
L.push(k.value);
|
|
76
|
+
}), L;
|
|
77
|
+
}, C = (Y) => {
|
|
78
|
+
n(Y.target.checked ? o : []), l.setFieldValue(t?.name, Y.target.checked ? o : []);
|
|
79
|
+
}, F = (Y) => {
|
|
80
|
+
n(Y), l.setFieldValue(t?.name, Y), e?.onChange && typeof e?.onChange == "function" && e?.onChange(Y);
|
|
81
81
|
};
|
|
82
|
-
return /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ q(pe, { theme: {
|
|
83
83
|
components: {
|
|
84
84
|
Checkbox: {
|
|
85
85
|
colorPrimary: "var(--check-primary)",
|
|
@@ -89,16 +89,16 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
89
89
|
}
|
|
90
90
|
}, children: [
|
|
91
91
|
e?.allCheck && /* @__PURE__ */ r(
|
|
92
|
-
|
|
92
|
+
ie,
|
|
93
93
|
{
|
|
94
94
|
indeterminate: u,
|
|
95
95
|
checked: a,
|
|
96
|
-
onChange:
|
|
96
|
+
onChange: C,
|
|
97
97
|
children: "전체선택"
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
100
|
/* @__PURE__ */ r(
|
|
101
|
-
|
|
101
|
+
ie.Group,
|
|
102
102
|
{
|
|
103
103
|
options: e?.options,
|
|
104
104
|
value: i,
|
|
@@ -106,7 +106,7 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
106
106
|
}
|
|
107
107
|
)
|
|
108
108
|
] }) });
|
|
109
|
-
},
|
|
109
|
+
}, ue = {
|
|
110
110
|
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
111
111
|
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
112
112
|
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
|
|
@@ -115,17 +115,17 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
115
115
|
displayFormat: "YYYY-MM-DD HH:mm",
|
|
116
116
|
outputFormat: "YYYYMMDDHHmm"
|
|
117
117
|
}
|
|
118
|
-
},
|
|
118
|
+
}, Lt = ({
|
|
119
119
|
itemProps: t,
|
|
120
120
|
inputProps: e,
|
|
121
121
|
type: l = "date",
|
|
122
122
|
returnType: i = "string"
|
|
123
123
|
}) => {
|
|
124
|
-
const { displayFormat: n, outputFormat: o } =
|
|
125
|
-
() =>
|
|
124
|
+
const { displayFormat: n, outputFormat: o } = ee(
|
|
125
|
+
() => ue[l],
|
|
126
126
|
[l]
|
|
127
|
-
), d =
|
|
128
|
-
() => Object.values(
|
|
127
|
+
), d = ee(
|
|
128
|
+
() => Object.values(ue).map((a) => a.outputFormat).sort((a, u) => {
|
|
129
129
|
if (a.length === u.length) {
|
|
130
130
|
if (a === o) return -1;
|
|
131
131
|
if (u === o) return 1;
|
|
@@ -141,11 +141,11 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
141
141
|
...t,
|
|
142
142
|
getValueProps: (a) => ({
|
|
143
143
|
// 폼에 저장된 값(문자열 또는 Dayjs)을 DatePicker가 요구하는 Dayjs로 변환
|
|
144
|
-
value: a ?
|
|
144
|
+
value: a ? z.isDayjs(a) ? a : z(a, d) : null
|
|
145
145
|
}),
|
|
146
146
|
normalize: (a) => a ? i === "dayjs" ? a : a.format(o) : null,
|
|
147
147
|
children: /* @__PURE__ */ r(
|
|
148
|
-
|
|
148
|
+
le,
|
|
149
149
|
{
|
|
150
150
|
...e,
|
|
151
151
|
picker: l === "datetime" ? "date" : l,
|
|
@@ -155,16 +155,16 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
155
155
|
)
|
|
156
156
|
}
|
|
157
157
|
);
|
|
158
|
-
},
|
|
158
|
+
}, bt = ({
|
|
159
159
|
fileGrpKey: t,
|
|
160
160
|
onFetchFilesTrxCd: e = "SCMFILE00101",
|
|
161
161
|
readOnly: l = !1,
|
|
162
162
|
sysCd: i = __SYS_CD__
|
|
163
163
|
}) => {
|
|
164
|
-
const [n, o] =
|
|
165
|
-
|
|
166
|
-
t && e ? i != __SYS_CD__ ?
|
|
167
|
-
crprCd:
|
|
164
|
+
const [n, o] = T([]);
|
|
165
|
+
j(() => {
|
|
166
|
+
t && e ? i != __SYS_CD__ ? je(i, e, {
|
|
167
|
+
crprCd: K()?.crprCd,
|
|
168
168
|
sysCd: i,
|
|
169
169
|
fileGrpKey: t
|
|
170
170
|
}).then((a) => {
|
|
@@ -177,9 +177,9 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
177
177
|
o(u);
|
|
178
178
|
}
|
|
179
179
|
}).catch((a) => {
|
|
180
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", a),
|
|
181
|
-
}) :
|
|
182
|
-
crprCd:
|
|
180
|
+
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", a), b.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
181
|
+
}) : W(e, {
|
|
182
|
+
crprCd: K()?.crprCd,
|
|
183
183
|
sysCd: i,
|
|
184
184
|
fileGrpKey: t
|
|
185
185
|
}).then((a) => {
|
|
@@ -192,7 +192,7 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
192
192
|
o(u);
|
|
193
193
|
}
|
|
194
194
|
}).catch((a) => {
|
|
195
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", a),
|
|
195
|
+
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", a), b.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
196
196
|
}) : o([]);
|
|
197
197
|
}, [t, e]);
|
|
198
198
|
const d = async (a) => {
|
|
@@ -213,50 +213,50 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
213
213
|
})
|
|
214
214
|
});
|
|
215
215
|
if (!s.ok) {
|
|
216
|
-
const
|
|
217
|
-
throw new Error(
|
|
216
|
+
const k = (await s.json().catch(() => null))?.message || "파일 다운로드에 실패했습니다.";
|
|
217
|
+
throw new Error(k);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
|
|
219
|
+
const C = await s.blob(), F = window.URL.createObjectURL(C), Y = document.createElement("a");
|
|
220
|
+
Y.href = F, Y.setAttribute("download", a.name), document.body.appendChild(Y), Y.click(), document.body.removeChild(Y), window.URL.revokeObjectURL(F);
|
|
221
221
|
} catch (u) {
|
|
222
|
-
console.error(u),
|
|
222
|
+
console.error(u), b.error(
|
|
223
223
|
u.message || "파일을 다운로드하는 중 오류가 발생했습니다."
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
return
|
|
228
|
-
|
|
227
|
+
return Re(n) ? null : /* @__PURE__ */ r(Fe, { title: "파일 목록", children: /* @__PURE__ */ r(
|
|
228
|
+
P,
|
|
229
229
|
{
|
|
230
230
|
dataSource: n,
|
|
231
231
|
renderItem: (a) => /* @__PURE__ */ r(
|
|
232
|
-
|
|
232
|
+
P.Item,
|
|
233
233
|
{
|
|
234
234
|
actions: l ? [] : [
|
|
235
235
|
/* @__PURE__ */ r(
|
|
236
|
-
|
|
236
|
+
J,
|
|
237
237
|
{
|
|
238
238
|
type: "text",
|
|
239
|
-
icon: /* @__PURE__ */ r(
|
|
239
|
+
icon: /* @__PURE__ */ r(Ee, {}),
|
|
240
240
|
onClick: () => d(a)
|
|
241
241
|
},
|
|
242
242
|
"download"
|
|
243
243
|
)
|
|
244
244
|
],
|
|
245
|
-
children: /* @__PURE__ */ r(
|
|
245
|
+
children: /* @__PURE__ */ r(P.Item.Meta, { avatar: /* @__PURE__ */ r(xe, {}), title: a.name })
|
|
246
246
|
}
|
|
247
247
|
)
|
|
248
248
|
}
|
|
249
249
|
) });
|
|
250
|
-
},
|
|
250
|
+
}, Xe = ke(
|
|
251
251
|
({ children: t, labelCol: e, style: l, className: i, ...n }, o) => /* @__PURE__ */ r(
|
|
252
|
-
|
|
252
|
+
pe,
|
|
253
253
|
{
|
|
254
254
|
form: {
|
|
255
255
|
//기존 rule.message의 default message인 $name을를 입력해주세요를 변경
|
|
256
256
|
validateMessages: { required: "'${label}을(를) 입력해주세요.'" }
|
|
257
257
|
},
|
|
258
258
|
children: /* @__PURE__ */ r(
|
|
259
|
-
|
|
259
|
+
E,
|
|
260
260
|
{
|
|
261
261
|
ref: o,
|
|
262
262
|
...n,
|
|
@@ -270,8 +270,8 @@ const it = (t) => /* @__PURE__ */ r(U, { ...t, className: "bwg-btn" }), D = ye(
|
|
|
270
270
|
}
|
|
271
271
|
)
|
|
272
272
|
);
|
|
273
|
-
|
|
274
|
-
const
|
|
273
|
+
Xe.displayName = "BwgForm";
|
|
274
|
+
const St = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(te, { ...e }) }), { Text: oe } = ye, { Dragger: Ze } = G, Qe = [
|
|
275
275
|
".pdf",
|
|
276
276
|
".xlsx",
|
|
277
277
|
".xls",
|
|
@@ -289,60 +289,60 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
289
289
|
".gif",
|
|
290
290
|
// 압축
|
|
291
291
|
".zip"
|
|
292
|
-
],
|
|
292
|
+
], Pe = (t, e = 2) => {
|
|
293
293
|
if (t === 0) return "0 Bytes";
|
|
294
294
|
const l = 1024, i = e < 0 ? 0 : e, n = ["Bytes", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(t) / Math.log(l));
|
|
295
295
|
return parseFloat((t / Math.pow(l, o)).toFixed(i)) + " " + n[o];
|
|
296
|
-
},
|
|
296
|
+
}, wt = ({
|
|
297
297
|
title: t = "첨부파일",
|
|
298
298
|
fileGrpKey: e,
|
|
299
299
|
onUploadComplete: l,
|
|
300
300
|
onSuccessTrxCd: i = "SCMFILE00102",
|
|
301
301
|
// BwgUploader와 동일한 기본 trxCd 설정
|
|
302
302
|
anotherServiceTrxCd: n = "SCMFILE00105",
|
|
303
|
-
allowedExtensions: o =
|
|
303
|
+
allowedExtensions: o = Qe,
|
|
304
304
|
maxFileSize: d = 2048
|
|
305
305
|
// 기본값 2GB
|
|
306
306
|
}) => {
|
|
307
|
-
const [a, u] =
|
|
307
|
+
const [a, u] = T([]), [s, C] = T(!1), [F, Y] = T(!1), [L, k] = T(0), B = (m) => {
|
|
308
308
|
if (o && o.length > 0) {
|
|
309
|
-
const
|
|
310
|
-
const
|
|
311
|
-
return
|
|
309
|
+
const I = ((O) => {
|
|
310
|
+
const H = O.lastIndexOf(".");
|
|
311
|
+
return H === -1 ? "" : O.substring(H).toLowerCase();
|
|
312
312
|
})(m.name);
|
|
313
|
-
if (!o.includes(
|
|
314
|
-
return
|
|
313
|
+
if (!o.includes(I))
|
|
314
|
+
return b.error(
|
|
315
315
|
`${m.name} 파일은 허용되지 않는 확장자입니다. (${o.join(
|
|
316
316
|
", "
|
|
317
317
|
)}만 가능)`
|
|
318
318
|
), !1;
|
|
319
319
|
}
|
|
320
320
|
return !0;
|
|
321
|
-
},
|
|
322
|
-
const m = a.filter((
|
|
323
|
-
(
|
|
321
|
+
}, v = async () => {
|
|
322
|
+
const m = a.filter((_) => _.status !== "done"), g = m.reduce(
|
|
323
|
+
(_, R) => _ + (R.size || 0),
|
|
324
324
|
0
|
|
325
|
-
),
|
|
326
|
-
if (
|
|
327
|
-
|
|
325
|
+
), I = 2 * 1024 * 1024 * 1024;
|
|
326
|
+
if (g > I) {
|
|
327
|
+
we.error({
|
|
328
328
|
message: "업로드 용량 초과",
|
|
329
329
|
description: "한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."
|
|
330
330
|
});
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
333
333
|
if (m.length === 0) {
|
|
334
|
-
|
|
334
|
+
b.warning(
|
|
335
335
|
"업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다."
|
|
336
336
|
);
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
|
-
|
|
340
|
-
let
|
|
339
|
+
Y(!0);
|
|
340
|
+
let O;
|
|
341
341
|
try {
|
|
342
|
-
const
|
|
343
|
-
m.forEach((
|
|
344
|
-
|
|
345
|
-
}),
|
|
342
|
+
const _ = new He();
|
|
343
|
+
m.forEach((R) => {
|
|
344
|
+
R.originFileObj && _.file(R.name, R.originFileObj);
|
|
345
|
+
}), O = await _.generateAsync({
|
|
346
346
|
type: "blob",
|
|
347
347
|
compression: "DEFLATE",
|
|
348
348
|
compressionOptions: {
|
|
@@ -350,187 +350,187 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
350
350
|
// 높은 압축률 설정
|
|
351
351
|
}
|
|
352
352
|
});
|
|
353
|
-
} catch (
|
|
354
|
-
|
|
353
|
+
} catch (_) {
|
|
354
|
+
Y(!1), b.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", _);
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
|
|
357
|
+
Y(!1);
|
|
358
|
+
const H = new FormData();
|
|
359
|
+
H.append("file", O, "upload.zip"), C(!0), k(0);
|
|
360
360
|
try {
|
|
361
|
-
const
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
if (
|
|
365
|
-
const
|
|
366
|
-
|
|
361
|
+
const _ = await new Promise((p, S) => {
|
|
362
|
+
const x = new XMLHttpRequest();
|
|
363
|
+
x.open("POST", "/api/upload-large", !0), x.upload.onprogress = (N) => {
|
|
364
|
+
if (N.lengthComputable) {
|
|
365
|
+
const re = Math.round(
|
|
366
|
+
N.loaded / N.total * 100
|
|
367
367
|
);
|
|
368
|
-
|
|
368
|
+
k(re);
|
|
369
369
|
}
|
|
370
|
-
},
|
|
371
|
-
if (
|
|
370
|
+
}, x.onload = () => {
|
|
371
|
+
if (x.status >= 200 && x.status < 300)
|
|
372
372
|
try {
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
new Error(
|
|
373
|
+
const N = JSON.parse(x.responseText);
|
|
374
|
+
N.success ? p(N) : S(
|
|
375
|
+
new Error(N.message || "파일 업로드에 실패했습니다.")
|
|
376
376
|
);
|
|
377
377
|
} catch {
|
|
378
|
-
|
|
378
|
+
S(new Error("잘못된 서버 응답입니다."));
|
|
379
379
|
}
|
|
380
380
|
else
|
|
381
381
|
try {
|
|
382
|
-
const
|
|
383
|
-
|
|
382
|
+
const N = JSON.parse(x.responseText);
|
|
383
|
+
S(new Error(N.message || `서버 오류: ${x.status}`));
|
|
384
384
|
} catch {
|
|
385
|
-
|
|
385
|
+
S(new Error(`서버 오류: ${x.status}`));
|
|
386
386
|
}
|
|
387
|
-
},
|
|
388
|
-
|
|
389
|
-
},
|
|
387
|
+
}, x.onerror = () => {
|
|
388
|
+
S(new Error("네트워크 오류가 발생했습니다."));
|
|
389
|
+
}, x.send(H);
|
|
390
390
|
});
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
b.success(
|
|
392
|
+
_.message || "압축 파일이 성공적으로 업로드되었습니다."
|
|
393
393
|
);
|
|
394
|
-
const
|
|
395
|
-
(
|
|
394
|
+
const R = a.map(
|
|
395
|
+
(p) => m.find((S) => S.uid === p.uid) ? { ...p, status: "done" } : p
|
|
396
396
|
);
|
|
397
|
-
if (u(
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
crprCd:
|
|
397
|
+
if (u(R), i && _.uploadedFiles && Array.isArray(_.uploadedFiles)) {
|
|
398
|
+
const p = K();
|
|
399
|
+
_.uploadedFiles.forEach((S) => {
|
|
400
|
+
const x = {
|
|
401
|
+
crprCd: p?.crprCd,
|
|
402
402
|
sysCd: __SYS_CD__,
|
|
403
403
|
fileGrpKey: e,
|
|
404
404
|
sub: [
|
|
405
405
|
{
|
|
406
|
-
crprCd:
|
|
406
|
+
crprCd: p?.crprCd,
|
|
407
407
|
sysCd: __SYS_CD__,
|
|
408
408
|
fileGrpKey: e,
|
|
409
|
-
physFileNm:
|
|
410
|
-
lgclFileNm:
|
|
411
|
-
filePath:
|
|
412
|
-
fileExtn:
|
|
413
|
-
fileSize:
|
|
409
|
+
physFileNm: S.fileNameP,
|
|
410
|
+
lgclFileNm: S.fileNameL,
|
|
411
|
+
filePath: S.filePath,
|
|
412
|
+
fileExtn: S.fileExt,
|
|
413
|
+
fileSize: S.fileSize,
|
|
414
414
|
mltpYn: "Y"
|
|
415
415
|
}
|
|
416
416
|
]
|
|
417
417
|
};
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
crprCd:
|
|
418
|
+
W(i, x).then((N) => {
|
|
419
|
+
const re = a.map((Z) => ({
|
|
420
|
+
crprCd: p?.crprCd,
|
|
421
421
|
sysCd: __SYS_CD__,
|
|
422
|
-
fileGrpKey:
|
|
423
|
-
fileKey:
|
|
424
|
-
lgclFileNm:
|
|
425
|
-
fileSize:
|
|
426
|
-
fileExtn:
|
|
427
|
-
fileType:
|
|
422
|
+
fileGrpKey: N.sub[0].fileGrpKey,
|
|
423
|
+
fileKey: N.sub[0].fileKey,
|
|
424
|
+
lgclFileNm: Z.name,
|
|
425
|
+
fileSize: Z.size,
|
|
426
|
+
fileExtn: Z.name.split(".").pop(),
|
|
427
|
+
fileType: Z.type
|
|
428
428
|
}));
|
|
429
|
-
|
|
429
|
+
W(n, {
|
|
430
430
|
// 파일 목록에 fileKey를 추가합니다.
|
|
431
|
-
sub:
|
|
431
|
+
sub: re
|
|
432
432
|
});
|
|
433
|
-
}).catch((
|
|
434
|
-
console.error("후처리 서비스 호출 실패:",
|
|
435
|
-
`${
|
|
433
|
+
}).catch((N) => {
|
|
434
|
+
console.error("후처리 서비스 호출 실패:", N), b.error(
|
|
435
|
+
`${S.fileNameL} 파일의 후처리 작업에 실패했습니다.`
|
|
436
436
|
);
|
|
437
437
|
}), l && l({
|
|
438
|
-
fileNameP:
|
|
439
|
-
fileNameL:
|
|
438
|
+
fileNameP: S.fileNameP,
|
|
439
|
+
fileNameL: S.fileNameL
|
|
440
440
|
});
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
-
} catch (
|
|
444
|
-
|
|
445
|
-
const
|
|
446
|
-
(
|
|
447
|
-
...
|
|
443
|
+
} catch (_) {
|
|
444
|
+
b.error(_.message || "파일 업로드 중 오류가 발생했습니다.");
|
|
445
|
+
const R = a.map(
|
|
446
|
+
(p) => m.find((S) => S.uid === p.uid) ? {
|
|
447
|
+
...p,
|
|
448
448
|
status: "error",
|
|
449
|
-
response:
|
|
450
|
-
} :
|
|
449
|
+
response: _.message || "파일 업로드 중 오류가 발생했습니다."
|
|
450
|
+
} : p
|
|
451
451
|
);
|
|
452
|
-
u(
|
|
452
|
+
u(R);
|
|
453
453
|
} finally {
|
|
454
|
-
|
|
454
|
+
C(!1);
|
|
455
455
|
}
|
|
456
|
-
},
|
|
456
|
+
}, f = {
|
|
457
457
|
multiple: !0,
|
|
458
458
|
fileList: a,
|
|
459
|
-
beforeUpload: (m) =>
|
|
459
|
+
beforeUpload: (m) => B(m) ? d && m.size >= d * 1024 * 1024 ? (b.error(
|
|
460
460
|
`대용량 첨부 파일 최대 크기는 ${(d / 1024).toFixed(
|
|
461
461
|
1
|
|
462
462
|
)}GB입니다.`
|
|
463
|
-
),
|
|
463
|
+
), G.LIST_IGNORE) : !1 : G.LIST_IGNORE,
|
|
464
464
|
onChange: ({ fileList: m }) => {
|
|
465
|
-
const
|
|
466
|
-
m.forEach((
|
|
467
|
-
|
|
468
|
-
}), u(Array.from(
|
|
465
|
+
const g = new Map(a.map((I) => [I.uid, I]));
|
|
466
|
+
m.forEach((I) => {
|
|
467
|
+
g.set(I.uid, I);
|
|
468
|
+
}), u(Array.from(g.values()));
|
|
469
469
|
},
|
|
470
470
|
onRemove: (m) => {
|
|
471
|
-
const
|
|
472
|
-
u(
|
|
471
|
+
const g = a.filter((I) => I.uid !== m.uid);
|
|
472
|
+
u(g);
|
|
473
473
|
},
|
|
474
474
|
showUploadList: !1
|
|
475
475
|
// 수동으로 목록을 렌더링하므로 antd의 기본 목록은 숨깁니다.
|
|
476
476
|
};
|
|
477
477
|
return /* @__PURE__ */ r(
|
|
478
|
-
|
|
478
|
+
be,
|
|
479
479
|
{
|
|
480
480
|
spinning: s || F,
|
|
481
|
-
tip: F ? "파일 압축 중..." : `파일 업로드 중... ${
|
|
482
|
-
children: /* @__PURE__ */
|
|
481
|
+
tip: F ? "파일 압축 중..." : `파일 업로드 중... ${L}%`,
|
|
482
|
+
children: /* @__PURE__ */ q("div", { className: "bwg-large-uploader-container", children: [
|
|
483
483
|
/* @__PURE__ */ r(
|
|
484
|
-
|
|
484
|
+
Fe,
|
|
485
485
|
{
|
|
486
|
-
title: /* @__PURE__ */ r(
|
|
487
|
-
extra: /* @__PURE__ */ r(
|
|
486
|
+
title: /* @__PURE__ */ r(oe, { strong: !0, children: t }),
|
|
487
|
+
extra: /* @__PURE__ */ r(G, { ...f, children: /* @__PURE__ */ r(J, { icon: /* @__PURE__ */ r(Ye, {}), children: "파일 선택" }) }),
|
|
488
488
|
bodyStyle: { padding: 0 },
|
|
489
489
|
children: /* @__PURE__ */ r(
|
|
490
|
-
|
|
490
|
+
Ze,
|
|
491
491
|
{
|
|
492
|
-
...
|
|
492
|
+
...f,
|
|
493
493
|
style: {
|
|
494
494
|
border: "none",
|
|
495
495
|
background: "transparent",
|
|
496
496
|
padding: 0
|
|
497
497
|
},
|
|
498
498
|
children: /* @__PURE__ */ r("div", { className: "upload-list-container", children: a.length > 0 ? /* @__PURE__ */ r(
|
|
499
|
-
|
|
499
|
+
P,
|
|
500
500
|
{
|
|
501
501
|
style: { textAlign: "left" },
|
|
502
502
|
dataSource: a,
|
|
503
503
|
renderItem: (m) => {
|
|
504
|
-
const
|
|
505
|
-
let
|
|
506
|
-
return
|
|
507
|
-
|
|
504
|
+
const g = m.status === "done", I = m.status === "error";
|
|
505
|
+
let O;
|
|
506
|
+
return g ? O = /* @__PURE__ */ r(
|
|
507
|
+
Ue,
|
|
508
508
|
{
|
|
509
509
|
style: { color: "#52c41a", fontSize: 14 }
|
|
510
510
|
}
|
|
511
|
-
) :
|
|
512
|
-
|
|
511
|
+
) : I ? O = /* @__PURE__ */ r(
|
|
512
|
+
Ie,
|
|
513
513
|
{
|
|
514
514
|
title: typeof m.response == "string" ? m.response : "업로드 실패",
|
|
515
515
|
children: /* @__PURE__ */ r(
|
|
516
|
-
|
|
516
|
+
Ae,
|
|
517
517
|
{
|
|
518
518
|
style: { color: "#ff4d4f", fontSize: 14 }
|
|
519
519
|
}
|
|
520
520
|
)
|
|
521
521
|
}
|
|
522
|
-
) :
|
|
523
|
-
|
|
522
|
+
) : O = /* @__PURE__ */ r(ze, { style: { fontSize: 14 } }), /* @__PURE__ */ r(
|
|
523
|
+
P.Item,
|
|
524
524
|
{
|
|
525
525
|
actions: [
|
|
526
|
-
/* @__PURE__ */ r(
|
|
526
|
+
/* @__PURE__ */ r(oe, { type: "secondary", children: Pe(m.size || 0) }, "size"),
|
|
527
527
|
/* @__PURE__ */ r(
|
|
528
|
-
|
|
528
|
+
J,
|
|
529
529
|
{
|
|
530
530
|
type: "text",
|
|
531
|
-
icon: /* @__PURE__ */ r(
|
|
532
|
-
onClick: (
|
|
533
|
-
|
|
531
|
+
icon: /* @__PURE__ */ r(Be, {}),
|
|
532
|
+
onClick: (H) => {
|
|
533
|
+
H.stopPropagation(), f.onRemove?.(m);
|
|
534
534
|
},
|
|
535
535
|
disabled: s || F
|
|
536
536
|
},
|
|
@@ -538,10 +538,10 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
538
538
|
)
|
|
539
539
|
],
|
|
540
540
|
children: /* @__PURE__ */ r(
|
|
541
|
-
|
|
541
|
+
P.Item.Meta,
|
|
542
542
|
{
|
|
543
|
-
avatar:
|
|
544
|
-
title: /* @__PURE__ */ r(
|
|
543
|
+
avatar: O,
|
|
544
|
+
title: /* @__PURE__ */ r(oe, { type: I ? "danger" : void 0, children: m.name })
|
|
545
545
|
}
|
|
546
546
|
)
|
|
547
547
|
},
|
|
@@ -549,8 +549,8 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
549
549
|
);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
) : /* @__PURE__ */
|
|
553
|
-
|
|
552
|
+
) : /* @__PURE__ */ q(
|
|
553
|
+
de,
|
|
554
554
|
{
|
|
555
555
|
gap: "middle",
|
|
556
556
|
align: "center",
|
|
@@ -558,8 +558,8 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
558
558
|
vertical: !0,
|
|
559
559
|
style: { padding: "20px 0", minHeight: "120px" },
|
|
560
560
|
children: [
|
|
561
|
-
/* @__PURE__ */ r(
|
|
562
|
-
/* @__PURE__ */ r(
|
|
561
|
+
/* @__PURE__ */ r(Oe, { style: { fontSize: "32px", color: "#999" } }),
|
|
562
|
+
/* @__PURE__ */ r(oe, { type: "secondary", children: "업로드할 파일을 선택하거나 이 영역으로 드래그하세요." })
|
|
563
563
|
]
|
|
564
564
|
}
|
|
565
565
|
) })
|
|
@@ -567,22 +567,22 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
567
567
|
)
|
|
568
568
|
}
|
|
569
569
|
),
|
|
570
|
-
a.length > 0 && /* @__PURE__ */
|
|
571
|
-
|
|
570
|
+
a.length > 0 && /* @__PURE__ */ q(
|
|
571
|
+
de,
|
|
572
572
|
{
|
|
573
573
|
justify: "flex-end",
|
|
574
574
|
align: "center",
|
|
575
575
|
gap: "large",
|
|
576
576
|
style: { marginTop: 16 },
|
|
577
577
|
children: [
|
|
578
|
-
s && /* @__PURE__ */ r("div", { style: { width: "250px" }, children: /* @__PURE__ */ r(
|
|
578
|
+
s && /* @__PURE__ */ r("div", { style: { width: "250px" }, children: /* @__PURE__ */ r(Se, { percent: L, size: "small" }) }),
|
|
579
579
|
/* @__PURE__ */ r(
|
|
580
|
-
|
|
580
|
+
J,
|
|
581
581
|
{
|
|
582
582
|
type: "primary",
|
|
583
|
-
onClick:
|
|
583
|
+
onClick: v,
|
|
584
584
|
disabled: s || F || a.filter((m) => m.status !== "done").length === 0,
|
|
585
|
-
icon: /* @__PURE__ */ r(
|
|
585
|
+
icon: /* @__PURE__ */ r(Ve, {}),
|
|
586
586
|
children: "일괄 업로드"
|
|
587
587
|
}
|
|
588
588
|
)
|
|
@@ -592,7 +592,7 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
592
592
|
] })
|
|
593
593
|
}
|
|
594
594
|
);
|
|
595
|
-
},
|
|
595
|
+
}, et = (t) => {
|
|
596
596
|
if (typeof t == "string")
|
|
597
597
|
return t.replace(/0/g, "_");
|
|
598
598
|
if (Array.isArray(t))
|
|
@@ -605,22 +605,22 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
605
605
|
}).join(".");
|
|
606
606
|
}
|
|
607
607
|
return "";
|
|
608
|
-
},
|
|
608
|
+
}, It = ({
|
|
609
609
|
itemProps: t,
|
|
610
610
|
inputProps: e,
|
|
611
611
|
mask: l
|
|
612
612
|
}) => {
|
|
613
|
-
const i =
|
|
614
|
-
return
|
|
613
|
+
const i = X(null), n = E.useFormInstance(), o = ee(() => et(l), [l]);
|
|
614
|
+
return j(() => {
|
|
615
615
|
if (!i.current?.input) return;
|
|
616
|
-
const d = typeof l == "string" || Array.isArray(l) ? { mask: l } : l, a =
|
|
616
|
+
const d = typeof l == "string" || Array.isArray(l) ? { mask: l } : l, a = Ce(i.current.input, d);
|
|
617
617
|
return a.on("accept", () => {
|
|
618
618
|
n && t?.name && n.setFieldValue(t.name, a.value);
|
|
619
619
|
}), () => {
|
|
620
620
|
a.destroy();
|
|
621
621
|
};
|
|
622
|
-
}, [l, n, t?.name]), /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(
|
|
623
|
-
},
|
|
622
|
+
}, [l, n, t?.name]), /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(te, { ...e, ref: i, placeholder: o }) });
|
|
623
|
+
}, tt = (t) => {
|
|
624
624
|
switch (t) {
|
|
625
625
|
case "year":
|
|
626
626
|
return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
|
|
@@ -634,35 +634,35 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
634
634
|
outputFormat: "YYYYMMDD"
|
|
635
635
|
};
|
|
636
636
|
}
|
|
637
|
-
},
|
|
637
|
+
}, _t = ({
|
|
638
638
|
type: t = "date",
|
|
639
639
|
itemProps: e = { name: "calendar" },
|
|
640
640
|
inputProps: l
|
|
641
641
|
}) => {
|
|
642
|
-
const { format: i, mask: n, outputFormat: o } =
|
|
643
|
-
|
|
642
|
+
const { format: i, mask: n, outputFormat: o } = tt(t), d = X(null), a = X(null), u = E.useFormInstance(), [s, C] = T(!1), [F, Y] = T(!1), L = e?.name, [k, B] = T(null);
|
|
643
|
+
j(() => {
|
|
644
644
|
if (!d.current?.input) return;
|
|
645
|
-
const
|
|
645
|
+
const f = Ce(d.current.input, {
|
|
646
646
|
mask: n,
|
|
647
647
|
lazy: !1
|
|
648
648
|
});
|
|
649
|
-
return a.current =
|
|
650
|
-
console.log("input :: ",
|
|
651
|
-
const m =
|
|
652
|
-
console.log("input :: ",
|
|
649
|
+
return a.current = f, f.on("accept", () => {
|
|
650
|
+
console.log("input :: ", f.value);
|
|
651
|
+
const m = f.value, g = z(m, i, !0);
|
|
652
|
+
console.log("input :: ", g), m.length === i.length && g.isValid() && (console.log("parsed :: ", g.format(o)), u.setFieldValue(L, g.format(o)), a.current?.updateValue(), C(!1));
|
|
653
653
|
}), () => {
|
|
654
|
-
|
|
654
|
+
f.destroy();
|
|
655
655
|
};
|
|
656
|
-
}, [i, n]),
|
|
657
|
-
|
|
658
|
-
}, [u.getFieldValue(
|
|
659
|
-
const
|
|
660
|
-
if (!
|
|
656
|
+
}, [i, n]), j(() => {
|
|
657
|
+
B(z(u.getFieldValue(L)));
|
|
658
|
+
}, [u.getFieldValue(L)]);
|
|
659
|
+
const v = (f) => {
|
|
660
|
+
if (!f) {
|
|
661
661
|
a.current?.updateValue();
|
|
662
662
|
return;
|
|
663
663
|
}
|
|
664
|
-
const m =
|
|
665
|
-
console.log("formatted :: ", m), a.current && (a.current.value = m, a.current.updateValue()),
|
|
664
|
+
const m = f.format(o);
|
|
665
|
+
console.log("formatted :: ", m), a.current && (a.current.value = m, a.current.updateValue()), Y(!1);
|
|
666
666
|
};
|
|
667
667
|
return /* @__PURE__ */ r(
|
|
668
668
|
D,
|
|
@@ -671,26 +671,26 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
671
671
|
name: void 0,
|
|
672
672
|
validateStatus: F ? "warning" : void 0,
|
|
673
673
|
help: F ? "유효하지 않은 날짜입니다" : void 0,
|
|
674
|
-
children: /* @__PURE__ */
|
|
674
|
+
children: /* @__PURE__ */ q("div", { style: { position: "relative" }, children: [
|
|
675
675
|
/* @__PURE__ */ r(
|
|
676
|
-
|
|
676
|
+
E.Item,
|
|
677
677
|
{
|
|
678
|
-
name:
|
|
679
|
-
getValueProps: (
|
|
680
|
-
value:
|
|
678
|
+
name: L,
|
|
679
|
+
getValueProps: (f) => ({
|
|
680
|
+
value: f ? z(f).format(i) : void 0
|
|
681
681
|
}),
|
|
682
|
-
normalize: (
|
|
682
|
+
normalize: (f) => f ? z(f).format(o) : void 0,
|
|
683
683
|
noStyle: !0,
|
|
684
684
|
children: /* @__PURE__ */ r(
|
|
685
|
-
|
|
685
|
+
te,
|
|
686
686
|
{
|
|
687
687
|
...l,
|
|
688
688
|
ref: d,
|
|
689
689
|
onFocus: () => {
|
|
690
|
-
|
|
690
|
+
C(!s), a.current?.updateValue();
|
|
691
691
|
},
|
|
692
|
-
onKeyDown: (
|
|
693
|
-
|
|
692
|
+
onKeyDown: (f) => {
|
|
693
|
+
f.key === "Backspace" && C(!0), f.key === "Tab" && C(!1);
|
|
694
694
|
},
|
|
695
695
|
allowClear: !0,
|
|
696
696
|
placeholder: n.replace(/0/g, "_"),
|
|
@@ -700,14 +700,14 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
700
700
|
}
|
|
701
701
|
),
|
|
702
702
|
/* @__PURE__ */ r(
|
|
703
|
-
|
|
703
|
+
le,
|
|
704
704
|
{
|
|
705
705
|
open: s,
|
|
706
706
|
picker: t,
|
|
707
707
|
format: i,
|
|
708
|
-
value:
|
|
709
|
-
onChange:
|
|
710
|
-
getPopupContainer: (
|
|
708
|
+
value: k,
|
|
709
|
+
onChange: v,
|
|
710
|
+
getPopupContainer: (f) => f.parentElement,
|
|
711
711
|
style: {
|
|
712
712
|
position: "absolute",
|
|
713
713
|
top: 0,
|
|
@@ -721,9 +721,9 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
721
721
|
] })
|
|
722
722
|
}
|
|
723
723
|
);
|
|
724
|
-
}, { Option:
|
|
725
|
-
const [l, i] =
|
|
726
|
-
return
|
|
724
|
+
}, { Option: me } = se, Nt = ({ itemProps: t, inputProps: e }) => {
|
|
725
|
+
const [l, i] = T([]);
|
|
726
|
+
return j(() => {
|
|
727
727
|
e?.addField === "ALL" ? i([
|
|
728
728
|
{ label: "전체", value: "" },
|
|
729
729
|
...e?.list || []
|
|
@@ -738,13 +738,13 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
738
738
|
value: []
|
|
739
739
|
},
|
|
740
740
|
normalize: (n) => n != null && n != null && n.length > 0 ? n.toString() : "",
|
|
741
|
-
children: /* @__PURE__ */ r(
|
|
741
|
+
children: /* @__PURE__ */ r(se, { ...e, mode: "multiple", children: l.map((n) => {
|
|
742
742
|
const { value: o, label: d } = n;
|
|
743
|
-
return e?.printCode ? /* @__PURE__ */ r(
|
|
743
|
+
return e?.printCode ? /* @__PURE__ */ r(me, { value: o, label: d, children: /* @__PURE__ */ r(ae, { children: `[${o}] ${d}` }) }, o) : /* @__PURE__ */ r(me, { value: o, label: d, children: /* @__PURE__ */ r(ae, { children: `${d}` }) }, o);
|
|
744
744
|
}) })
|
|
745
745
|
}
|
|
746
746
|
);
|
|
747
|
-
},
|
|
747
|
+
}, Mt = ({ itemProps: t, inputProps: e }) => {
|
|
748
748
|
const l = (n) => {
|
|
749
749
|
let o = n.toString().split(".");
|
|
750
750
|
return e?.decimalPoint != null && o[1] != null && e?.decimalPoint > 0 ? o[1].length > e?.decimalPoint ? o[1] = "." + o[1].substring(0, e?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + o[1];
|
|
@@ -753,14 +753,14 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
753
753
|
return e?.decimalPoint != null && o[1] != null && e?.decimalPoint > 0 ? o[1].length > e?.decimalPoint ? o[1] = "." + o[1].substring(0, e?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\$\s?|(,*)/g, "") + o[1];
|
|
754
754
|
};
|
|
755
755
|
return /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(
|
|
756
|
-
|
|
756
|
+
_e,
|
|
757
757
|
{
|
|
758
758
|
...e,
|
|
759
759
|
formatter: (n) => l(n),
|
|
760
760
|
parser: (n) => i(n)
|
|
761
761
|
}
|
|
762
762
|
) });
|
|
763
|
-
},
|
|
763
|
+
}, Dt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(Ne.Group, { ...e }) }), { RangePicker: rt } = le, fe = {
|
|
764
764
|
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
765
765
|
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
766
766
|
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
|
|
@@ -769,7 +769,7 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
769
769
|
displayFormat: "YYYY-MM-DD HH:mm",
|
|
770
770
|
outputFormat: "YYYYMMDDHHmm"
|
|
771
771
|
}
|
|
772
|
-
},
|
|
772
|
+
}, kt = ({
|
|
773
773
|
itemProps: t,
|
|
774
774
|
inputProps: e,
|
|
775
775
|
type: l = "date",
|
|
@@ -777,16 +777,16 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
777
777
|
maxDate: n,
|
|
778
778
|
returnType: o = "string"
|
|
779
779
|
}) => {
|
|
780
|
-
const { displayFormat: d, outputFormat: a } =
|
|
781
|
-
() =>
|
|
780
|
+
const { displayFormat: d, outputFormat: a } = ee(
|
|
781
|
+
() => fe[l],
|
|
782
782
|
[l]
|
|
783
|
-
), u =
|
|
784
|
-
() => Object.values(
|
|
785
|
-
if (s.length ===
|
|
783
|
+
), u = ee(
|
|
784
|
+
() => Object.values(fe).map((s) => s.outputFormat).sort((s, C) => {
|
|
785
|
+
if (s.length === C.length) {
|
|
786
786
|
if (s === a) return -1;
|
|
787
|
-
if (
|
|
787
|
+
if (C === a) return 1;
|
|
788
788
|
}
|
|
789
|
-
return
|
|
789
|
+
return C.length - s.length;
|
|
790
790
|
}),
|
|
791
791
|
[a]
|
|
792
792
|
// type(outputFormat)이 바뀔 때마다 재정렬
|
|
@@ -798,8 +798,8 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
798
798
|
getValueProps: (s) => ({
|
|
799
799
|
// 폼에 저장된 값(문자열 또는 Dayjs)을 RangePicker가 요구하는 Dayjs 배열로 변환
|
|
800
800
|
value: s && s.length > 0 ? [
|
|
801
|
-
s[0] ?
|
|
802
|
-
s[1] ?
|
|
801
|
+
s[0] ? z.isDayjs(s[0]) ? s[0] : z(s[0], u) : null,
|
|
802
|
+
s[1] ? z.isDayjs(s[1]) ? s[1] : z(s[1], u) : null
|
|
803
803
|
] : null
|
|
804
804
|
}),
|
|
805
805
|
normalize: (s) => s ? o === "dayjs" ? [s[0] ?? void 0, s[1] ?? void 0] : [
|
|
@@ -807,12 +807,12 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
807
807
|
s[1] ? s[1].format(a) : void 0
|
|
808
808
|
] : [void 0, void 0],
|
|
809
809
|
children: /* @__PURE__ */ r(
|
|
810
|
-
|
|
810
|
+
rt,
|
|
811
811
|
{
|
|
812
812
|
...e,
|
|
813
813
|
order: !0,
|
|
814
|
-
minDate: i ?
|
|
815
|
-
maxDate: n ?
|
|
814
|
+
minDate: i ? z(i, u) : void 0,
|
|
815
|
+
maxDate: n ? z(n, u) : void 0,
|
|
816
816
|
picker: l === "datetime" ? "date" : l,
|
|
817
817
|
showTime: e?.showTime ?? (l === "datetime" || l === "time"),
|
|
818
818
|
format: d
|
|
@@ -820,8 +820,8 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
820
820
|
)
|
|
821
821
|
}
|
|
822
822
|
);
|
|
823
|
-
},
|
|
824
|
-
const e =
|
|
823
|
+
}, he = te.Search, vt = (t) => {
|
|
824
|
+
const e = E.useFormInstance(), { openPopup: l } = Ke(), i = t.itemProps?.name || [], n = t.popupConfig || {
|
|
825
825
|
callback(d) {
|
|
826
826
|
console.log("callback data :: ", d), i.length > 1 ? (e.setFieldValue(i[0], d.code), e.setFieldValue(i[1], d.name)) : e.setFieldValue(i, d.code);
|
|
827
827
|
}
|
|
@@ -835,9 +835,9 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
835
835
|
t.popuCd ? l(t.popuCd, t.popupParams, n) : t.onSearch?.(d);
|
|
836
836
|
}
|
|
837
837
|
};
|
|
838
|
-
return i.length > 1 ? /* @__PURE__ */ r(D, { ...t.itemProps, name: void 0, children: /* @__PURE__ */
|
|
838
|
+
return i.length > 1 ? /* @__PURE__ */ r(D, { ...t.itemProps, name: void 0, children: /* @__PURE__ */ q(ae.Compact, { block: !0, children: [
|
|
839
839
|
/* @__PURE__ */ r(
|
|
840
|
-
|
|
840
|
+
E.Item,
|
|
841
841
|
{
|
|
842
842
|
name: i[0],
|
|
843
843
|
rules: t.itemProps?.rules,
|
|
@@ -845,7 +845,7 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
845
845
|
validateStatus: "",
|
|
846
846
|
help: "",
|
|
847
847
|
children: /* @__PURE__ */ r(
|
|
848
|
-
|
|
848
|
+
te,
|
|
849
849
|
{
|
|
850
850
|
style: { color: "#999", backgroundColor: "#f5f5f5" },
|
|
851
851
|
placeholder: t.placeholder?.[0] || "",
|
|
@@ -854,29 +854,29 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
854
854
|
)
|
|
855
855
|
}
|
|
856
856
|
),
|
|
857
|
-
/* @__PURE__ */ r(
|
|
858
|
-
|
|
857
|
+
/* @__PURE__ */ r(E.Item, { name: i[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ r(
|
|
858
|
+
he,
|
|
859
859
|
{
|
|
860
860
|
readOnly: t.readOnly,
|
|
861
861
|
enterButton: /* @__PURE__ */ r(
|
|
862
|
-
|
|
862
|
+
J,
|
|
863
863
|
{
|
|
864
|
-
icon: /* @__PURE__ */ r(
|
|
864
|
+
icon: /* @__PURE__ */ r(Te, {}),
|
|
865
865
|
disabled: t.readOnly
|
|
866
866
|
}
|
|
867
867
|
),
|
|
868
868
|
...o
|
|
869
869
|
}
|
|
870
870
|
) })
|
|
871
|
-
] }) }) : /* @__PURE__ */ r(D, { ...t.itemProps, children: /* @__PURE__ */ r(
|
|
872
|
-
},
|
|
871
|
+
] }) }) : /* @__PURE__ */ r(D, { ...t.itemProps, children: /* @__PURE__ */ r(he, { ...o }) });
|
|
872
|
+
}, xt = ({
|
|
873
873
|
itemProps: t,
|
|
874
874
|
selectProps: e = {
|
|
875
875
|
options: [],
|
|
876
876
|
allowClear: !0
|
|
877
877
|
}
|
|
878
878
|
}) => {
|
|
879
|
-
const l =
|
|
879
|
+
const l = E.useFormInstance(), i = !!l, n = ee(() => e?.addField === "ALL" ? [{ label: "전체", value: "" }, ...e?.options || []] : e?.addField === "NULL" ? [{ label: "", value: "" }, ...e?.options || []] : e?.options || [], [e.options, e.addField]), o = (u) => {
|
|
880
880
|
e.onChange?.(u);
|
|
881
881
|
}, d = {
|
|
882
882
|
...e,
|
|
@@ -884,12 +884,12 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
884
884
|
options: n,
|
|
885
885
|
onChange: o,
|
|
886
886
|
variant: e.variant
|
|
887
|
-
}, a = /* @__PURE__ */ r(
|
|
887
|
+
}, a = /* @__PURE__ */ r(se, { ...d, disabled: e.disabled });
|
|
888
888
|
return e.copyable && !i && console.warn(
|
|
889
889
|
"BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."
|
|
890
|
-
), e.copyable ? /* @__PURE__ */ r(D, { ...t, name: void 0, children: /* @__PURE__ */
|
|
890
|
+
), e.copyable ? /* @__PURE__ */ r(D, { ...t, name: void 0, children: /* @__PURE__ */ q(ae.Compact, { block: !0, children: [
|
|
891
891
|
/* @__PURE__ */ r(
|
|
892
|
-
|
|
892
|
+
E.Item,
|
|
893
893
|
{
|
|
894
894
|
name: t?.name,
|
|
895
895
|
rules: t?.rules,
|
|
@@ -900,7 +900,7 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
900
900
|
}
|
|
901
901
|
),
|
|
902
902
|
/* @__PURE__ */ r(
|
|
903
|
-
|
|
903
|
+
ye.Paragraph,
|
|
904
904
|
{
|
|
905
905
|
copyable: {
|
|
906
906
|
text: i && l?.getFieldValue(t?.name)?.toString() || "",
|
|
@@ -921,13 +921,13 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
921
921
|
}
|
|
922
922
|
)
|
|
923
923
|
] }) }) : /* @__PURE__ */ r(D, { ...t, children: a });
|
|
924
|
-
},
|
|
924
|
+
}, Et = ({
|
|
925
925
|
itemProps: t,
|
|
926
926
|
inputProps: e = {
|
|
927
927
|
format: "YN"
|
|
928
928
|
}
|
|
929
929
|
}) => {
|
|
930
|
-
const l =
|
|
930
|
+
const l = E.useFormInstance(), i = (n, o) => {
|
|
931
931
|
e.format === "boolean" ? l.setFieldValue(t?.name, n) : l.setFieldValue(t?.name, n ? "Y" : "N"), e.onChange && e.onChange(n, o);
|
|
932
932
|
};
|
|
933
933
|
return /* @__PURE__ */ r(
|
|
@@ -936,10 +936,10 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
936
936
|
...t,
|
|
937
937
|
getValueProps: (n) => ({ checked: e.format === "boolean" ? !!n : n === "Y" }),
|
|
938
938
|
normalize: (n) => typeof n == "boolean" ? e.format === "boolean" ? n : n ? "Y" : "N" : e.format === "boolean" ? !!n : n ? "Y" : "N",
|
|
939
|
-
children: /* @__PURE__ */ r(
|
|
939
|
+
children: /* @__PURE__ */ r(Me, { ...e, onChange: (n, o) => i(n, o) })
|
|
940
940
|
}
|
|
941
941
|
);
|
|
942
|
-
}, { TextArea:
|
|
942
|
+
}, { TextArea: nt } = te, Bt = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, children: /* @__PURE__ */ r(nt, { ...e }) }), ot = [
|
|
943
943
|
".pdf",
|
|
944
944
|
".xlsx",
|
|
945
945
|
".xls",
|
|
@@ -957,265 +957,332 @@ const ut = ({ itemProps: t, inputProps: e }) => /* @__PURE__ */ r(D, { ...t, chi
|
|
|
957
957
|
".gif",
|
|
958
958
|
// 압축
|
|
959
959
|
".zip"
|
|
960
|
-
],
|
|
960
|
+
], ge = {
|
|
961
961
|
FILE: "file"
|
|
962
|
-
},
|
|
962
|
+
}, at = ({
|
|
963
963
|
originNode: t,
|
|
964
964
|
file: e,
|
|
965
965
|
fileList: l,
|
|
966
966
|
moveFile: i,
|
|
967
967
|
onDrop: n
|
|
968
968
|
}) => {
|
|
969
|
-
const o =
|
|
970
|
-
accept:
|
|
969
|
+
const o = X(null), [{ handlerId: d }, a] = qe({
|
|
970
|
+
accept: ge.FILE,
|
|
971
971
|
collect: (F) => ({
|
|
972
972
|
handlerId: F.getHandlerId()
|
|
973
973
|
}),
|
|
974
|
-
hover(F,
|
|
974
|
+
hover(F, Y) {
|
|
975
975
|
if (!o.current)
|
|
976
976
|
return;
|
|
977
|
-
const
|
|
978
|
-
if (
|
|
977
|
+
const L = F.uid, k = e.uid;
|
|
978
|
+
if (L === k)
|
|
979
979
|
return;
|
|
980
|
-
const
|
|
981
|
-
if (
|
|
980
|
+
const B = ne(l, { uid: k }), v = ne(l, { uid: L });
|
|
981
|
+
if (v === -1 || B === -1)
|
|
982
982
|
return;
|
|
983
|
-
const
|
|
983
|
+
const f = o.current.getBoundingClientRect(), m = Y.getClientOffset();
|
|
984
984
|
if (!m)
|
|
985
985
|
return;
|
|
986
|
-
const
|
|
987
|
-
|
|
986
|
+
const g = (f.bottom - f.top) / 2, I = m.y - f.top;
|
|
987
|
+
v < B && I < g || v > B && I > g || i(L, k);
|
|
988
988
|
},
|
|
989
989
|
drop() {
|
|
990
990
|
n();
|
|
991
991
|
}
|
|
992
|
-
}), [{ isDragging: u }, s] =
|
|
993
|
-
type:
|
|
992
|
+
}), [{ isDragging: u }, s] = We({
|
|
993
|
+
type: ge.FILE,
|
|
994
994
|
item: () => ({
|
|
995
995
|
uid: e.uid,
|
|
996
|
-
index:
|
|
996
|
+
index: ne(l, { uid: e.uid })
|
|
997
997
|
}),
|
|
998
998
|
collect: (F) => ({
|
|
999
999
|
isDragging: F.isDragging()
|
|
1000
1000
|
})
|
|
1001
|
-
}),
|
|
1002
|
-
return s(a(o)), /* @__PURE__ */ r("div", { ref: o, style: { opacity:
|
|
1003
|
-
},
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1001
|
+
}), C = u ? 0 : 1;
|
|
1002
|
+
return s(a(o)), /* @__PURE__ */ r("div", { ref: o, style: { opacity: C }, "data-handler-id": d, children: t });
|
|
1003
|
+
}, Ot = ({
|
|
1004
|
+
itemProps: t,
|
|
1005
|
+
fileGrpKey: e,
|
|
1006
|
+
onUploadComplete: l,
|
|
1007
|
+
onFetchFilesTrxCd: i = "SCMFILE00101",
|
|
1008
|
+
onSuccessTrxCd: n = "SCMFILE00102",
|
|
1009
|
+
onDeleteFileTrxCd: o = "SCMFILE00103",
|
|
1010
|
+
onReorderFilesTrxCd: d = "SCMFILE00104",
|
|
1011
|
+
allowedExtensions: a = ot,
|
|
1012
|
+
maxFileSize: u = 200,
|
|
1013
|
+
showButton: s = !0,
|
|
1013
1014
|
// 기본값으로 true 설정
|
|
1014
|
-
multiple:
|
|
1015
|
+
multiple: C = !1,
|
|
1016
|
+
newFileGrpKeyonModify: F = !1,
|
|
1017
|
+
buttonText: Y = "파일 선택",
|
|
1018
|
+
localOnly: L = !1,
|
|
1019
|
+
onFilesChange: k
|
|
1015
1020
|
}) => {
|
|
1016
|
-
const [
|
|
1017
|
-
|
|
1018
|
-
if (
|
|
1021
|
+
const [B, v] = T([]), f = X(e), m = X([]), g = E.useFormInstance(), O = X(
|
|
1022
|
+
$e(() => {
|
|
1023
|
+
if (L || m.current.length === 0)
|
|
1019
1024
|
return;
|
|
1020
|
-
const c = [...
|
|
1021
|
-
if (
|
|
1022
|
-
const
|
|
1023
|
-
crprCd:
|
|
1025
|
+
const c = [...m.current];
|
|
1026
|
+
if (m.current = [], n) {
|
|
1027
|
+
const w = c.map((y) => ({
|
|
1028
|
+
crprCd: K()?.crprCd,
|
|
1024
1029
|
sysCd: __SYS_CD__,
|
|
1025
|
-
fileGrpKey:
|
|
1026
|
-
physFileNm:
|
|
1027
|
-
lgclFileNm:
|
|
1028
|
-
filePath:
|
|
1029
|
-
fileExtn:
|
|
1030
|
-
fileSize:
|
|
1030
|
+
fileGrpKey: f.current,
|
|
1031
|
+
physFileNm: y.fileNameP,
|
|
1032
|
+
lgclFileNm: y.fileNameL,
|
|
1033
|
+
filePath: y.filePath,
|
|
1034
|
+
fileExtn: y.fileExt,
|
|
1035
|
+
fileSize: y.fileSize,
|
|
1031
1036
|
mltpYn: "N"
|
|
1032
1037
|
}));
|
|
1033
|
-
|
|
1034
|
-
|
|
1038
|
+
console.log("newFileGrpKeyonModify", F), console.log(
|
|
1039
|
+
"newFileGrpKeyonModify",
|
|
1040
|
+
F ? 0 : f.current
|
|
1041
|
+
), W(n, {
|
|
1042
|
+
crprCd: K()?.crprCd,
|
|
1035
1043
|
sysCd: __SYS_CD__,
|
|
1036
|
-
fileGrpKey:
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1044
|
+
fileGrpKey: F ? 0 : f.current,
|
|
1045
|
+
oldFileGrpKey: f.current,
|
|
1046
|
+
newFileGrpKeyonModify: F,
|
|
1047
|
+
sub: w
|
|
1048
|
+
}).then((y) => {
|
|
1049
|
+
if (y?.sub && y.sub.length > 0) {
|
|
1050
|
+
const h = y.sub[0].fileGrpKey;
|
|
1051
|
+
f.current || (f.current = h);
|
|
1052
|
+
const V = /* @__PURE__ */ new Map();
|
|
1053
|
+
y.sub.forEach((M) => {
|
|
1054
|
+
const U = c.find(
|
|
1055
|
+
($) => $.fileNameL === M.lgclFileNm
|
|
1046
1056
|
);
|
|
1047
|
-
|
|
1048
|
-
})
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1057
|
+
U && V.set(U.tempId, M);
|
|
1058
|
+
});
|
|
1059
|
+
const Q = t?.name;
|
|
1060
|
+
((M) => {
|
|
1061
|
+
if (p) {
|
|
1062
|
+
const U = g?.getFieldValue(Q) || [], $ = M(U);
|
|
1063
|
+
g?.setFieldValue(Q, $);
|
|
1064
|
+
} else
|
|
1065
|
+
v((U) => M(U));
|
|
1066
|
+
})((M) => M.map((U) => {
|
|
1067
|
+
const $ = V.get(U.uid);
|
|
1068
|
+
if ($) {
|
|
1069
|
+
const ce = c.find(
|
|
1070
|
+
(Le) => Le.tempId === U.uid
|
|
1053
1071
|
);
|
|
1054
|
-
return
|
|
1055
|
-
|
|
1056
|
-
fileGrpKey:
|
|
1057
|
-
fileKey:
|
|
1072
|
+
return l && ce && l({
|
|
1073
|
+
...ce,
|
|
1074
|
+
fileGrpKey: h,
|
|
1075
|
+
fileKey: $.fileKey
|
|
1058
1076
|
}), {
|
|
1059
|
-
...
|
|
1060
|
-
name:
|
|
1061
|
-
fileGrpKey:
|
|
1062
|
-
fileKey:
|
|
1063
|
-
uid:
|
|
1077
|
+
...U,
|
|
1078
|
+
name: $.lgclFileNm,
|
|
1079
|
+
fileGrpKey: h,
|
|
1080
|
+
fileKey: $.fileKey,
|
|
1081
|
+
uid: $.fileKey,
|
|
1064
1082
|
status: "done",
|
|
1065
|
-
url: `/api/download?filePath=${
|
|
1083
|
+
url: `/api/download?filePath=${$.filePath}&logicalName=${$.lgclFileNm}`
|
|
1066
1084
|
};
|
|
1067
1085
|
}
|
|
1068
|
-
return
|
|
1086
|
+
return U;
|
|
1069
1087
|
}));
|
|
1070
1088
|
}
|
|
1071
|
-
}).catch((
|
|
1072
|
-
console.error("업로드 후처리 서비스 호출 실패:",
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1075
|
-
(
|
|
1076
|
-
|
|
1089
|
+
}).catch((y) => {
|
|
1090
|
+
console.error("업로드 후처리 서비스 호출 실패:", y), b.error("파일 후처리 중 오류가 발생했습니다.");
|
|
1091
|
+
const h = new Set(c.map((A) => A.tempId)), V = t?.name;
|
|
1092
|
+
((A) => {
|
|
1093
|
+
if (p) {
|
|
1094
|
+
const M = g?.getFieldValue(V) || [], U = A(M);
|
|
1095
|
+
g?.setFieldValue(V, U);
|
|
1096
|
+
} else
|
|
1097
|
+
v((M) => A(M));
|
|
1098
|
+
})(
|
|
1099
|
+
(A) => A.map(
|
|
1100
|
+
(M) => h.has(M.uid) ? { ...M, status: "error", error: "후처리 실패" } : M
|
|
1077
1101
|
)
|
|
1078
1102
|
);
|
|
1079
1103
|
});
|
|
1080
1104
|
}
|
|
1081
1105
|
}, 500)
|
|
1082
1106
|
).current;
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
}, [
|
|
1086
|
-
|
|
1087
|
-
}, [
|
|
1088
|
-
|
|
1089
|
-
crprCd:
|
|
1107
|
+
j(() => () => {
|
|
1108
|
+
O.cancel();
|
|
1109
|
+
}, [O]), j(() => {
|
|
1110
|
+
f.current = e;
|
|
1111
|
+
}, [e]), j(() => {
|
|
1112
|
+
L || e && i && W(i, {
|
|
1113
|
+
crprCd: K()?.crprCd,
|
|
1090
1114
|
sysCd: __SYS_CD__,
|
|
1091
|
-
fileGrpKey:
|
|
1115
|
+
fileGrpKey: e
|
|
1092
1116
|
}).then((c) => {
|
|
1093
1117
|
if (c?.sub) {
|
|
1094
|
-
const
|
|
1118
|
+
const w = c.sub.map((h) => ({
|
|
1095
1119
|
uid: h.fileKey,
|
|
1096
1120
|
name: h.lgclFileNm,
|
|
1097
1121
|
status: "done",
|
|
1098
1122
|
url: `/api/download?filePath=${h.filePath}&logicalName=${h.lgclFileNm}`
|
|
1099
|
-
}));
|
|
1100
|
-
|
|
1101
|
-
} else
|
|
1102
|
-
|
|
1123
|
+
})), y = t?.name;
|
|
1124
|
+
p ? g?.setFieldValue(y, w) : v(w);
|
|
1125
|
+
} else {
|
|
1126
|
+
const w = t?.name;
|
|
1127
|
+
p ? g?.setFieldValue(w, []) : v([]);
|
|
1128
|
+
}
|
|
1103
1129
|
}).catch((c) => {
|
|
1104
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", c),
|
|
1130
|
+
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", c), b.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
1105
1131
|
});
|
|
1106
|
-
}, [
|
|
1107
|
-
const
|
|
1108
|
-
const h =
|
|
1109
|
-
if (
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1112
|
-
},
|
|
1113
|
-
if (
|
|
1114
|
-
const c =
|
|
1115
|
-
|
|
1116
|
-
crprCd:
|
|
1132
|
+
}, [e, i]);
|
|
1133
|
+
const H = (c, w) => {
|
|
1134
|
+
const y = t?.name, h = p ? g?.getFieldValue(y) || [] : B, V = ne(h, { uid: c }), Q = ne(h, { uid: w });
|
|
1135
|
+
if (V < 0 || Q < 0) return;
|
|
1136
|
+
const A = [...h], [M] = A.splice(V, 1);
|
|
1137
|
+
A.splice(Q, 0, M), p ? g?.setFieldValue(y, A) : v(A);
|
|
1138
|
+
}, _ = () => {
|
|
1139
|
+
if (!L && e && d) {
|
|
1140
|
+
const c = t?.name, y = (p ? g?.getFieldValue(c) || [] : B).map((h) => h.uid);
|
|
1141
|
+
W(d, {
|
|
1142
|
+
crprCd: K()?.crprCd,
|
|
1117
1143
|
sysCd: __SYS_CD__,
|
|
1118
|
-
fileGrpKey:
|
|
1119
|
-
reorderedFileKeys:
|
|
1144
|
+
fileGrpKey: e,
|
|
1145
|
+
reorderedFileKeys: y
|
|
1120
1146
|
}).then(() => {
|
|
1121
|
-
|
|
1122
|
-
}).catch((
|
|
1123
|
-
console.error("파일 순서 저장 서비스 호출 실패:",
|
|
1147
|
+
b.success("파일 순서가 성공적으로 저장되었습니다.");
|
|
1148
|
+
}).catch((h) => {
|
|
1149
|
+
console.error("파일 순서 저장 서비스 호출 실패:", h), b.error("파일 순서 저장 중 오류가 발생했습니다.");
|
|
1124
1150
|
});
|
|
1125
1151
|
}
|
|
1126
|
-
},
|
|
1152
|
+
}, R = (c) => {
|
|
1153
|
+
const w = t?.name, y = p ? g?.getFieldValue(w) || [] : B;
|
|
1154
|
+
if (!C && y.length > 0)
|
|
1155
|
+
return b.error("하나의 파일만 업로드할 수 있습니다."), G.LIST_IGNORE;
|
|
1156
|
+
if (a && a.length > 0) {
|
|
1157
|
+
const h = `.${c.name.split(".").pop()?.toLowerCase()}`;
|
|
1158
|
+
if (!a.includes(h))
|
|
1159
|
+
return b.error(
|
|
1160
|
+
`${c.name} 파일은 허용되지 않는 확장자입니다. (${a.join(
|
|
1161
|
+
", "
|
|
1162
|
+
)})`
|
|
1163
|
+
), G.LIST_IGNORE;
|
|
1164
|
+
}
|
|
1165
|
+
return u && !(c.size / 1024 / 1024 < u) ? (b.error(`일반업로드의 최대용량은 ${u}MB입니다.`), G.LIST_IGNORE) : !L;
|
|
1166
|
+
}, p = !!t?.name, S = {
|
|
1127
1167
|
name: "file",
|
|
1128
|
-
multiple:
|
|
1129
|
-
action: "/api/upload",
|
|
1130
|
-
|
|
1131
|
-
beforeUpload: (c) => {
|
|
1132
|
-
if (!s && Y.length > 0)
|
|
1133
|
-
return L.error("하나의 파일만 업로드할 수 있습니다."), T.LIST_IGNORE;
|
|
1134
|
-
if (d && d.length > 0) {
|
|
1135
|
-
const p = `.${c.name.split(".").pop()?.toLowerCase()}`;
|
|
1136
|
-
if (!d.includes(p))
|
|
1137
|
-
return L.error(
|
|
1138
|
-
`${c.name} 파일은 허용되지 않는 확장자입니다. (${d.join(
|
|
1139
|
-
", "
|
|
1140
|
-
)})`
|
|
1141
|
-
), T.LIST_IGNORE;
|
|
1142
|
-
}
|
|
1143
|
-
return a && !(c.size / 1024 / 1024 < a) ? (L.error(`일반업로드의 최대용량은 ${a}MB입니다.`), T.LIST_IGNORE) : !0;
|
|
1144
|
-
},
|
|
1168
|
+
multiple: C,
|
|
1169
|
+
action: L ? void 0 : "/api/upload",
|
|
1170
|
+
beforeUpload: R,
|
|
1145
1171
|
showUploadList: {
|
|
1146
|
-
showRemoveIcon:
|
|
1172
|
+
showRemoveIcon: s
|
|
1147
1173
|
// showButton 값에 따라 삭제 버튼 표시/숨김
|
|
1148
1174
|
},
|
|
1149
1175
|
onChange(c) {
|
|
1150
|
-
const { status:
|
|
1151
|
-
if (
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1176
|
+
const { status: w, uid: y } = c.file;
|
|
1177
|
+
if (w === "removed") {
|
|
1178
|
+
if (!L && o)
|
|
1179
|
+
W(o, {
|
|
1180
|
+
crprCd: K()?.crprCd,
|
|
1181
|
+
sysCd: __SYS_CD__,
|
|
1182
|
+
fileGrpKey: F ? 0 : f.current,
|
|
1183
|
+
fileKey: y,
|
|
1184
|
+
oldFileGrpKey: f.current,
|
|
1185
|
+
newFileGrpKeyonModify: F
|
|
1186
|
+
}).then((h) => {
|
|
1187
|
+
if (b.success("파일이 성공적으로 삭제되었습니다."), p) {
|
|
1188
|
+
const V = t?.name;
|
|
1189
|
+
g?.setFieldValue(V, c.fileList);
|
|
1190
|
+
} else
|
|
1191
|
+
v(c.fileList);
|
|
1192
|
+
k?.(c.fileList), l?.({
|
|
1193
|
+
fileGrpKey: h.fileGrpKey
|
|
1194
|
+
});
|
|
1195
|
+
}).catch((h) => {
|
|
1196
|
+
console.error("파일 삭제 서비스 호출에 실패했습니다.", h), b.error("파일 삭제 중 오류가 발생했습니다.");
|
|
1197
|
+
});
|
|
1198
|
+
else {
|
|
1199
|
+
if (p) {
|
|
1200
|
+
const h = t?.name;
|
|
1201
|
+
g?.setFieldValue(h, c.fileList);
|
|
1202
|
+
} else
|
|
1203
|
+
v(c.fileList);
|
|
1204
|
+
k?.(c.fileList);
|
|
1205
|
+
}
|
|
1162
1206
|
return;
|
|
1163
1207
|
}
|
|
1164
|
-
if (
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1208
|
+
if (p) {
|
|
1209
|
+
const h = t?.name;
|
|
1210
|
+
g?.setFieldValue(h, c.fileList);
|
|
1211
|
+
} else
|
|
1212
|
+
v(c.fileList);
|
|
1213
|
+
if (k?.(c.fileList), w === "done")
|
|
1214
|
+
if (!L && c.file.response?.success) {
|
|
1215
|
+
const { uploadedFiles: h } = c.file.response;
|
|
1216
|
+
h && Array.isArray(h) && h.length > 0 && (h.forEach((V) => {
|
|
1217
|
+
V.tempId = c.file.uid, m.current.push(V);
|
|
1218
|
+
}), O()), b.success(
|
|
1170
1219
|
c.file.response.message || `${c.file.name} 파일이 성공적으로 업로드되었습니다.`
|
|
1171
1220
|
);
|
|
1172
1221
|
} else
|
|
1173
|
-
|
|
1222
|
+
b.error(
|
|
1174
1223
|
c.file.response?.message || `${c.file.name} 파일 업로드에 실패했습니다.`
|
|
1175
1224
|
);
|
|
1176
|
-
else
|
|
1225
|
+
else w === "error" && b.error(
|
|
1177
1226
|
c.file.response?.message || `${c.file.name} 파일 업로드 중 오류가 발생했습니다.`
|
|
1178
1227
|
);
|
|
1179
1228
|
},
|
|
1180
|
-
itemRender(c,
|
|
1181
|
-
const
|
|
1182
|
-
href:
|
|
1229
|
+
itemRender(c, w, y) {
|
|
1230
|
+
const h = ve(c, {
|
|
1231
|
+
href: w.url || void 0,
|
|
1183
1232
|
title: void 0
|
|
1184
1233
|
});
|
|
1185
1234
|
return /* @__PURE__ */ r(
|
|
1186
|
-
|
|
1235
|
+
at,
|
|
1187
1236
|
{
|
|
1188
|
-
originNode:
|
|
1189
|
-
file:
|
|
1190
|
-
fileList:
|
|
1191
|
-
moveFile:
|
|
1192
|
-
onDrop:
|
|
1237
|
+
originNode: h,
|
|
1238
|
+
file: w,
|
|
1239
|
+
fileList: y,
|
|
1240
|
+
moveFile: H,
|
|
1241
|
+
onDrop: _
|
|
1193
1242
|
},
|
|
1194
|
-
|
|
1243
|
+
w.uid
|
|
1195
1244
|
);
|
|
1196
1245
|
}
|
|
1197
1246
|
};
|
|
1198
|
-
|
|
1247
|
+
p || (S.fileList = B);
|
|
1248
|
+
const x = (c) => Array.isArray(c) ? c : c && c.fileList, N = t?.name, re = p ? E.useWatch?.(N, g) : void 0, Z = p ? re || [] : B;
|
|
1249
|
+
return /* @__PURE__ */ r(Ge, { backend: Je, children: /* @__PURE__ */ r(
|
|
1250
|
+
D,
|
|
1251
|
+
{
|
|
1252
|
+
valuePropName: "fileList",
|
|
1253
|
+
getValueFromEvent: x,
|
|
1254
|
+
...t,
|
|
1255
|
+
children: /* @__PURE__ */ r(
|
|
1256
|
+
G,
|
|
1257
|
+
{
|
|
1258
|
+
headers: { SYSCD: __SYS_CD__ },
|
|
1259
|
+
...S,
|
|
1260
|
+
listType: "picture",
|
|
1261
|
+
children: s && (C || Z.length === 0) && /* @__PURE__ */ r(J, { icon: /* @__PURE__ */ r(Ye, {}), children: Y })
|
|
1262
|
+
}
|
|
1263
|
+
)
|
|
1264
|
+
}
|
|
1265
|
+
) });
|
|
1199
1266
|
};
|
|
1200
1267
|
export {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1268
|
+
yt as BwgButton,
|
|
1269
|
+
Yt as BwgCheck,
|
|
1270
|
+
Ct as BwgCheckList,
|
|
1271
|
+
Lt as BwgDatePicker,
|
|
1272
|
+
bt as BwgDownload,
|
|
1273
|
+
Xe as BwgForm,
|
|
1207
1274
|
D as BwgFormItem,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1275
|
+
St as BwgInput,
|
|
1276
|
+
wt as BwgLargeUploader,
|
|
1277
|
+
It as BwgMaskedInput,
|
|
1278
|
+
_t as BwgMaskedPicker,
|
|
1279
|
+
Nt as BwgMultiSelect,
|
|
1280
|
+
Mt as BwgNumber,
|
|
1281
|
+
Dt as BwgRadio,
|
|
1282
|
+
kt as BwgRangePicker,
|
|
1283
|
+
vt as BwgSearch,
|
|
1284
|
+
xt as BwgSelect,
|
|
1285
|
+
Et as BwgSwitch,
|
|
1286
|
+
Bt as BwgTextArea,
|
|
1287
|
+
Ot as BwgUploader
|
|
1221
1288
|
};
|