@bwg-ui/core 1.3.9 → 1.3.10
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/components/core/{BwgXlsxUploader.d.ts → BwgExcelUploaderBatch.d.ts} +4 -4
- package/dist/components/core/BwgExcelUploaderBatch.d.ts.map +1 -0
- package/dist/components/core/BwgExcelUploaderService.d.ts +31 -0
- package/dist/components/core/BwgExcelUploaderService.d.ts.map +1 -0
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.d.ts +4 -2
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +1362 -1190
- package/dist/index.cjs +87 -39
- package/dist/index.js +9239 -9677
- package/dist/provider/hooks/useSizeConfig.d.ts +2 -2
- package/dist/stores/codeStore.d.ts.map +1 -1
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.js +12 -12
- package/package.json +1 -1
- package/dist/components/core/BwgXlsxUploader.d.ts.map +0 -1
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { useMemo as q, memo as
|
|
4
|
-
import { useUserStore as
|
|
1
|
+
import { jsx as e, jsxs as O, Fragment as $e } from "react/jsx-runtime";
|
|
2
|
+
import { Button as ee, Form as x, Checkbox as he, ConfigProvider as de, DatePicker as ue, message as w, Card as xe, List as le, Input as K, Spin as ye, Upload as Q, Typography as fe, Flex as Ie, Progress as Ge, notification as We, Tooltip as He, Select as Ce, Space as $, InputNumber as je, Radio as Xe, Switch as Ke, Popover as ie } from "antd";
|
|
3
|
+
import { useMemo as q, memo as qe, useState as P, useEffect as X, forwardRef as Je, useRef as J, useCallback as te, cloneElement as Ze } from "react";
|
|
4
|
+
import { useUserStore as Qe, usePopupStore as et } from "../../stores/index.js";
|
|
5
5
|
import N from "dayjs";
|
|
6
|
-
import { PaperClipOutlined as
|
|
7
|
-
import { getApiDeps as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { d as
|
|
11
|
-
import { findIndex as
|
|
12
|
-
import { useDrop as
|
|
13
|
-
import { HTML5Backend as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
const { componentSize:
|
|
6
|
+
import { PaperClipOutlined as tt, DownloadOutlined as nt, DeleteOutlined as rt, InboxOutlined as Ve, UploadOutlined as re, CloudUploadOutlined as ot, CheckCircleOutlined as lt, CloseCircleOutlined as at, FileTextOutlined as st, CalendarOutlined as pe, ExclamationCircleOutlined as Ae, SearchOutlined as Fe, FilePdfTwoTone as it, FileWordTwoTone as ct, FileExcelTwoTone as dt, FilePptTwoTone as ut, FileTwoTone as ft, LinkOutlined as mt, FileOutlined as ht, PlayCircleOutlined as ve, RedoOutlined as ge, ExclamationCircleFilled as Oe } from "@ant-design/icons";
|
|
7
|
+
import { getApiDeps as ke, callServiceByAppCd as pt, getCrprCd as Ee, callService as oe, getUserInfo as Me } from "../../utils/index.js";
|
|
8
|
+
import gt from "jszip";
|
|
9
|
+
import ce from "imask";
|
|
10
|
+
import { d as Te, e as Ue, h as Be } from "../../chunks/provider-ff4RVDYo.js";
|
|
11
|
+
import { findIndex as me } from "lodash";
|
|
12
|
+
import { useDrop as yt, useDrag as Ct, DndProvider as Pe } from "react-dnd";
|
|
13
|
+
import { HTML5Backend as _e } from "react-dnd-html5-backend";
|
|
14
|
+
import Ft from "antd/es/upload/Dragger";
|
|
15
|
+
const Z = (t) => {
|
|
16
|
+
const { componentSize: n } = Qe(), u = q(() => t.size ? t.size : {
|
|
17
17
|
0: "small",
|
|
18
18
|
1: "middle",
|
|
19
19
|
2: "large"
|
|
20
|
-
}[
|
|
20
|
+
}[n], [n, t.size]), a = q(() => ({
|
|
21
21
|
0: 12,
|
|
22
22
|
// 작게
|
|
23
23
|
1: 14,
|
|
24
24
|
// 보통
|
|
25
25
|
2: 16
|
|
26
26
|
// 크게
|
|
27
|
-
})[
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
27
|
+
})[n], [n]);
|
|
28
|
+
return /* @__PURE__ */ e(
|
|
29
|
+
ee,
|
|
30
30
|
{
|
|
31
|
-
...
|
|
31
|
+
...t,
|
|
32
32
|
size: u,
|
|
33
33
|
className: "bwg-btn",
|
|
34
|
-
style: { fontSize: `${
|
|
35
|
-
children:
|
|
34
|
+
style: { fontSize: `${a}px`, ...t.style },
|
|
35
|
+
children: t.children
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
},
|
|
38
|
+
}, G = qe(
|
|
39
39
|
({
|
|
40
|
-
children:
|
|
41
|
-
label:
|
|
40
|
+
children: t,
|
|
41
|
+
label: n,
|
|
42
42
|
name: u,
|
|
43
|
-
rules:
|
|
44
|
-
initialValue:
|
|
43
|
+
rules: a,
|
|
44
|
+
initialValue: r,
|
|
45
45
|
style: o,
|
|
46
|
-
required:
|
|
47
|
-
...
|
|
46
|
+
required: i,
|
|
47
|
+
...c
|
|
48
48
|
}) => {
|
|
49
|
-
const
|
|
49
|
+
const h = {
|
|
50
50
|
fontWeight: "bold"
|
|
51
51
|
};
|
|
52
|
-
(
|
|
52
|
+
(a == null || a == null) && i && (a = [
|
|
53
53
|
{
|
|
54
54
|
required: !0,
|
|
55
|
-
message: `${
|
|
55
|
+
message: `${n}을(를) 입력해주세요.`
|
|
56
56
|
}
|
|
57
57
|
]);
|
|
58
|
-
const s = Array.isArray(
|
|
59
|
-
|
|
60
|
-
s && /* @__PURE__ */
|
|
61
|
-
] }) : /* @__PURE__ */
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
|
|
58
|
+
const s = Array.isArray(a) && a.some((y) => y.required === !0), d = () => typeof n == "string" ? /* @__PURE__ */ O("span", { style: h, children: [
|
|
59
|
+
n,
|
|
60
|
+
s && /* @__PURE__ */ e("span", { style: { color: "#ff4d4f", marginLeft: "4px" }, children: "*" })
|
|
61
|
+
] }) : /* @__PURE__ */ e("span", { style: h, children: n });
|
|
62
|
+
return /* @__PURE__ */ e(
|
|
63
|
+
x.Item,
|
|
64
64
|
{
|
|
65
65
|
className: "bwg-form-item",
|
|
66
|
-
label:
|
|
67
|
-
labelAlign:
|
|
66
|
+
label: n ? d() : void 0,
|
|
67
|
+
labelAlign: c.labelAlign || "left",
|
|
68
68
|
name: u,
|
|
69
|
-
rules:
|
|
69
|
+
rules: a,
|
|
70
70
|
colon: !1,
|
|
71
|
-
initialValue:
|
|
71
|
+
initialValue: r,
|
|
72
72
|
style: o,
|
|
73
|
-
...
|
|
74
|
-
children:
|
|
73
|
+
...c,
|
|
74
|
+
children: t
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
|
-
),
|
|
79
|
-
itemProps:
|
|
80
|
-
inputProps:
|
|
78
|
+
), Kt = ({
|
|
79
|
+
itemProps: t,
|
|
80
|
+
inputProps: n = {
|
|
81
81
|
format: "YN"
|
|
82
82
|
}
|
|
83
83
|
}) => {
|
|
84
|
-
const u =
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
84
|
+
const u = x.useFormInstance();
|
|
85
|
+
return /* @__PURE__ */ e(
|
|
86
|
+
G,
|
|
87
87
|
{
|
|
88
|
-
...
|
|
89
|
-
getValueProps: (
|
|
90
|
-
normalize: (
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
}, children:
|
|
88
|
+
...t,
|
|
89
|
+
getValueProps: (r) => ({ checked: n.format === "boolean" ? !!r : r === "Y" }),
|
|
90
|
+
normalize: (r) => typeof r == "boolean" ? n.format === "boolean" ? r : r ? "Y" : "N" : n.format === "boolean" ? !!r : r ? "Y" : "N",
|
|
91
|
+
children: /* @__PURE__ */ e(he, { ...n, onChange: (r) => {
|
|
92
|
+
n.format === "boolean" ? u.setFieldValue(t?.name, r.target.checked) : u.setFieldValue(t?.name, r.target.checked ? "Y" : "N"), n.onChange && n.onChange(r);
|
|
93
|
+
}, children: n?.title })
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
|
-
},
|
|
97
|
-
const u =
|
|
98
|
-
|
|
99
|
-
), [o,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
const s = (
|
|
106
|
-
const
|
|
107
|
-
return (
|
|
108
|
-
|
|
109
|
-
}),
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
}, y = (
|
|
113
|
-
|
|
96
|
+
}, qt = ({ itemProps: t, inputProps: n }) => {
|
|
97
|
+
const u = x.useFormInstance(), [a, r] = P(
|
|
98
|
+
t?.initialValue ?? []
|
|
99
|
+
), [o, i] = P([]), c = o.length > 0 && o.length == a?.length, h = a?.length > 0 && a.length < o.length;
|
|
100
|
+
X(() => {
|
|
101
|
+
i(s(n?.options));
|
|
102
|
+
}, [n?.options]), X(() => {
|
|
103
|
+
r(a);
|
|
104
|
+
}, [a]);
|
|
105
|
+
const s = (p) => {
|
|
106
|
+
const I = [];
|
|
107
|
+
return (p || []).map((C, T) => {
|
|
108
|
+
I.push(C.value);
|
|
109
|
+
}), I;
|
|
110
|
+
}, d = (p) => {
|
|
111
|
+
r(p.target.checked ? o : []), u.setFieldValue(t?.name, p.target.checked ? o : []);
|
|
112
|
+
}, y = (p) => {
|
|
113
|
+
r(p), u.setFieldValue(t?.name, p), n?.onChange && typeof n?.onChange == "function" && n?.onChange(p);
|
|
114
114
|
};
|
|
115
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ O(de, { theme: {
|
|
116
116
|
components: {
|
|
117
117
|
Checkbox: {
|
|
118
118
|
colorPrimary: "var(--check-primary)",
|
|
@@ -121,25 +121,25 @@ const oe = (e) => {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}, children: [
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
n?.allCheck && /* @__PURE__ */ e(
|
|
125
|
+
he,
|
|
126
126
|
{
|
|
127
|
-
indeterminate:
|
|
128
|
-
checked:
|
|
129
|
-
onChange:
|
|
127
|
+
indeterminate: h,
|
|
128
|
+
checked: c,
|
|
129
|
+
onChange: d,
|
|
130
130
|
children: "전체선택"
|
|
131
131
|
}
|
|
132
132
|
),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
|
|
133
|
+
/* @__PURE__ */ e(
|
|
134
|
+
he.Group,
|
|
135
135
|
{
|
|
136
|
-
options:
|
|
137
|
-
value:
|
|
136
|
+
options: n?.options,
|
|
137
|
+
value: a,
|
|
138
138
|
onChange: y
|
|
139
139
|
}
|
|
140
140
|
)
|
|
141
141
|
] }) });
|
|
142
|
-
},
|
|
142
|
+
}, we = {
|
|
143
143
|
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
144
144
|
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
145
145
|
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
|
|
@@ -148,105 +148,105 @@ const oe = (e) => {
|
|
|
148
148
|
displayFormat: "YYYY-MM-DD HH:mm",
|
|
149
149
|
outputFormat: "YYYYMMDDHHmm"
|
|
150
150
|
}
|
|
151
|
-
},
|
|
152
|
-
itemProps:
|
|
153
|
-
inputProps:
|
|
151
|
+
}, Jt = ({
|
|
152
|
+
itemProps: t,
|
|
153
|
+
inputProps: n,
|
|
154
154
|
type: u = "date",
|
|
155
|
-
returnType:
|
|
155
|
+
returnType: a = "string"
|
|
156
156
|
}) => {
|
|
157
|
-
const { displayFormat:
|
|
158
|
-
() =>
|
|
157
|
+
const { displayFormat: r, outputFormat: o } = q(
|
|
158
|
+
() => we[u],
|
|
159
159
|
[u]
|
|
160
|
-
),
|
|
161
|
-
() => Object.values(
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
if (
|
|
160
|
+
), i = q(
|
|
161
|
+
() => Object.values(we).map((c) => c.outputFormat).sort((c, h) => {
|
|
162
|
+
if (c.length === h.length) {
|
|
163
|
+
if (c === o) return -1;
|
|
164
|
+
if (h === o) return 1;
|
|
165
165
|
}
|
|
166
|
-
return
|
|
166
|
+
return h.length - c.length;
|
|
167
167
|
}),
|
|
168
168
|
[o]
|
|
169
169
|
// type(outputFormat)이 바뀔 때마다 재정렬
|
|
170
170
|
);
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
|
|
171
|
+
return /* @__PURE__ */ e(
|
|
172
|
+
G,
|
|
173
173
|
{
|
|
174
|
-
...
|
|
175
|
-
getValueProps: (
|
|
174
|
+
...t,
|
|
175
|
+
getValueProps: (c) => ({
|
|
176
176
|
// 폼에 저장된 값(문자열 또는 Dayjs)을 DatePicker가 요구하는 Dayjs로 변환
|
|
177
|
-
value:
|
|
177
|
+
value: c ? N.isDayjs(c) ? c : N(c, i) : null
|
|
178
178
|
}),
|
|
179
|
-
normalize: (
|
|
180
|
-
children: /* @__PURE__ */
|
|
181
|
-
|
|
179
|
+
normalize: (c) => c ? a === "dayjs" ? c : c.format(o) : null,
|
|
180
|
+
children: /* @__PURE__ */ e(
|
|
181
|
+
ue,
|
|
182
182
|
{
|
|
183
|
-
...
|
|
183
|
+
...n,
|
|
184
184
|
picker: u === "datetime" ? "date" : u,
|
|
185
|
-
showTime:
|
|
186
|
-
format:
|
|
185
|
+
showTime: n?.showTime ?? (u === "datetime" || u === "time"),
|
|
186
|
+
format: n?.format ?? r
|
|
187
187
|
}
|
|
188
188
|
)
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
|
-
},
|
|
192
|
-
fileGrpKey:
|
|
193
|
-
onFetchFilesTrxCd:
|
|
191
|
+
}, Zt = ({
|
|
192
|
+
fileGrpKey: t,
|
|
193
|
+
onFetchFilesTrxCd: n = "SCMFILE00101",
|
|
194
194
|
readOnly: u = !1,
|
|
195
|
-
appCd:
|
|
195
|
+
appCd: a = __APP_CD__
|
|
196
196
|
}) => {
|
|
197
|
-
const [
|
|
198
|
-
|
|
199
|
-
if (
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
if (!
|
|
203
|
-
console.error("해당 앱코드는 존재하지 않습니다.",
|
|
197
|
+
const [r, o] = P([]);
|
|
198
|
+
X(() => {
|
|
199
|
+
if (n)
|
|
200
|
+
if (a != __APP_CD__) {
|
|
201
|
+
const h = ke().findSystemByAppCd?.(a ?? __APP_CD__);
|
|
202
|
+
if (!h || !h.sysCd) {
|
|
203
|
+
console.error("해당 앱코드는 존재하지 않습니다.", a);
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
{ trxCd:
|
|
206
|
+
pt(
|
|
207
|
+
{ trxCd: n, appCd: a },
|
|
208
208
|
{
|
|
209
|
-
crprCd:
|
|
210
|
-
sysCd:
|
|
211
|
-
fileGrpKey:
|
|
209
|
+
crprCd: Ee(),
|
|
210
|
+
sysCd: h.sysCd,
|
|
211
|
+
fileGrpKey: t
|
|
212
212
|
}
|
|
213
213
|
).then((s) => {
|
|
214
214
|
if (s?.sub) {
|
|
215
|
-
const
|
|
215
|
+
const d = s.sub.map((y) => ({
|
|
216
216
|
uid: y.fileKey,
|
|
217
217
|
name: y.lgclFileNm,
|
|
218
218
|
filePath: y.filePath
|
|
219
219
|
}));
|
|
220
|
-
o(
|
|
220
|
+
o(d);
|
|
221
221
|
}
|
|
222
222
|
}).catch((s) => {
|
|
223
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", s),
|
|
223
|
+
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", s), w.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
224
224
|
});
|
|
225
225
|
} else
|
|
226
|
-
|
|
227
|
-
crprCd:
|
|
226
|
+
oe(n, {
|
|
227
|
+
crprCd: Me()?.crprCd,
|
|
228
228
|
sysCd: __SYS_CD__,
|
|
229
|
-
fileGrpKey:
|
|
230
|
-
}).then((
|
|
231
|
-
if (
|
|
232
|
-
const
|
|
229
|
+
fileGrpKey: t
|
|
230
|
+
}).then((c) => {
|
|
231
|
+
if (c?.sub) {
|
|
232
|
+
const h = c.sub.map((s) => ({
|
|
233
233
|
uid: s.fileKey,
|
|
234
234
|
name: s.lgclFileNm,
|
|
235
235
|
filePath: s.filePath
|
|
236
236
|
}));
|
|
237
|
-
o(
|
|
237
|
+
o(h);
|
|
238
238
|
}
|
|
239
|
-
}).catch((
|
|
240
|
-
console.error("파일 목록 조회 서비스 호출에 실패했습니다.",
|
|
239
|
+
}).catch((c) => {
|
|
240
|
+
console.error("파일 목록 조회 서비스 호출에 실패했습니다.", c), w.error("파일 목록을 불러오는 중 오류가 발생했습니다.");
|
|
241
241
|
});
|
|
242
242
|
else
|
|
243
243
|
o([]);
|
|
244
|
-
}, [
|
|
245
|
-
const
|
|
244
|
+
}, [t, n, a]);
|
|
245
|
+
const i = async (c) => {
|
|
246
246
|
try {
|
|
247
|
-
const s =
|
|
247
|
+
const s = ke().findSystemByAppCd?.(a ?? __APP_CD__);
|
|
248
248
|
if (!s || !s.sysCd) {
|
|
249
|
-
console.error("해당 앱코드는 존재하지 않습니다.",
|
|
249
|
+
console.error("해당 앱코드는 존재하지 않습니다.", a);
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
const y = await fetch("/api/download", {
|
|
@@ -257,49 +257,49 @@ const oe = (e) => {
|
|
|
257
257
|
// 여기에 필요한 다른 헤더(예: 인증 토큰)를 추가할 수 있습니다.
|
|
258
258
|
},
|
|
259
259
|
body: JSON.stringify({
|
|
260
|
-
filePath:
|
|
261
|
-
logicalName:
|
|
262
|
-
fileKey:
|
|
260
|
+
filePath: c.filePath,
|
|
261
|
+
logicalName: c.name,
|
|
262
|
+
fileKey: c.uid
|
|
263
263
|
})
|
|
264
264
|
});
|
|
265
265
|
if (!y.ok) {
|
|
266
|
-
const
|
|
267
|
-
throw new Error(
|
|
266
|
+
const g = (await y.json().catch(() => null))?.message || "파일 다운로드에 실패했습니다.";
|
|
267
|
+
throw new Error(g);
|
|
268
268
|
}
|
|
269
|
-
const
|
|
270
|
-
C.href =
|
|
271
|
-
} catch (
|
|
272
|
-
console.error(
|
|
273
|
-
|
|
269
|
+
const p = await y.blob(), I = window.URL.createObjectURL(p), C = document.createElement("a");
|
|
270
|
+
C.href = I, C.setAttribute("download", c.name), document.body.appendChild(C), C.click(), document.body.removeChild(C), window.URL.revokeObjectURL(I);
|
|
271
|
+
} catch (h) {
|
|
272
|
+
console.error(h), w.error(
|
|
273
|
+
h.message || "파일을 다운로드하는 중 오류가 발생했습니다."
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
|
-
return /* @__PURE__ */
|
|
278
|
-
|
|
277
|
+
return /* @__PURE__ */ e(xe, { title: "파일 목록", children: /* @__PURE__ */ e(
|
|
278
|
+
le,
|
|
279
279
|
{
|
|
280
|
-
dataSource:
|
|
281
|
-
renderItem: (
|
|
282
|
-
|
|
280
|
+
dataSource: r,
|
|
281
|
+
renderItem: (c) => /* @__PURE__ */ e(
|
|
282
|
+
le.Item,
|
|
283
283
|
{
|
|
284
284
|
actions: u ? [] : [
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
|
|
285
|
+
/* @__PURE__ */ e(
|
|
286
|
+
ee,
|
|
287
287
|
{
|
|
288
288
|
type: "text",
|
|
289
|
-
icon: /* @__PURE__ */
|
|
290
|
-
onClick: () =>
|
|
289
|
+
icon: /* @__PURE__ */ e(nt, {}),
|
|
290
|
+
onClick: () => i(c)
|
|
291
291
|
},
|
|
292
292
|
"download"
|
|
293
293
|
)
|
|
294
294
|
],
|
|
295
|
-
children: /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ e(le.Item.Meta, { avatar: /* @__PURE__ */ e(tt, {}), title: c.name })
|
|
296
296
|
}
|
|
297
297
|
)
|
|
298
298
|
}
|
|
299
299
|
) });
|
|
300
|
-
},
|
|
301
|
-
({ children:
|
|
302
|
-
|
|
300
|
+
}, Et = Je(
|
|
301
|
+
({ children: t, labelCol: n, style: u, className: a, ...r }, o) => /* @__PURE__ */ e(
|
|
302
|
+
de,
|
|
303
303
|
{
|
|
304
304
|
form: {
|
|
305
305
|
/**
|
|
@@ -308,23 +308,23 @@ const oe = (e) => {
|
|
|
308
308
|
*/
|
|
309
309
|
// validateMessages: { required: "'${label}을(를) 입력해주세요.'" },
|
|
310
310
|
},
|
|
311
|
-
children: /* @__PURE__ */
|
|
312
|
-
|
|
311
|
+
children: /* @__PURE__ */ e(
|
|
312
|
+
x,
|
|
313
313
|
{
|
|
314
314
|
ref: o,
|
|
315
|
-
...
|
|
315
|
+
...r,
|
|
316
316
|
requiredMark: !1,
|
|
317
|
-
labelCol:
|
|
317
|
+
labelCol: n || { flex: "100px" },
|
|
318
318
|
style: { padding: "10px", ...u },
|
|
319
|
-
className: `bwg-form ${
|
|
320
|
-
children:
|
|
319
|
+
className: `bwg-form ${a ?? ""}`,
|
|
320
|
+
children: t
|
|
321
321
|
}
|
|
322
322
|
)
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
);
|
|
326
|
-
|
|
327
|
-
const
|
|
326
|
+
Et.displayName = "BwgForm";
|
|
327
|
+
const Qt = ({ itemProps: t, inputProps: n }) => /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(K, { ...n }) }), { Text: se } = fe, { Dragger: Dt } = Q, It = [
|
|
328
328
|
".pdf",
|
|
329
329
|
".xlsx",
|
|
330
330
|
".xls",
|
|
@@ -342,60 +342,60 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
342
342
|
".gif",
|
|
343
343
|
// 압축
|
|
344
344
|
".zip"
|
|
345
|
-
],
|
|
346
|
-
if (
|
|
347
|
-
const u = 1024,
|
|
348
|
-
return parseFloat((
|
|
349
|
-
},
|
|
350
|
-
title:
|
|
351
|
-
fileGrpKey:
|
|
345
|
+
], kt = (t, n = 2) => {
|
|
346
|
+
if (t === 0) return "0 Bytes";
|
|
347
|
+
const u = 1024, a = n < 0 ? 0 : n, r = ["Bytes", "KB", "MB", "GB", "TB"], o = Math.floor(Math.log(t) / Math.log(u));
|
|
348
|
+
return parseFloat((t / Math.pow(u, o)).toFixed(a)) + " " + r[o];
|
|
349
|
+
}, en = ({
|
|
350
|
+
title: t = "첨부파일",
|
|
351
|
+
fileGrpKey: n,
|
|
352
352
|
onUploadComplete: u,
|
|
353
|
-
onSuccessTrxCd:
|
|
353
|
+
onSuccessTrxCd: a = "SCMFILE00102",
|
|
354
354
|
// BwgUploader와 동일한 기본 trxCd 설정
|
|
355
|
-
anotherServiceTrxCd:
|
|
356
|
-
allowedExtensions: o =
|
|
357
|
-
maxFileSize:
|
|
355
|
+
anotherServiceTrxCd: r = "SCMFILE00105",
|
|
356
|
+
allowedExtensions: o = It,
|
|
357
|
+
maxFileSize: i = 2048
|
|
358
358
|
// 기본값 2GB
|
|
359
359
|
}) => {
|
|
360
|
-
const [
|
|
360
|
+
const [c, h] = P([]), [s, d] = P(!1), [y, p] = P(!1), [I, C] = P(0), T = (f) => {
|
|
361
361
|
if (o && o.length > 0) {
|
|
362
|
-
const
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
-
})(
|
|
366
|
-
if (!o.includes(
|
|
367
|
-
return
|
|
368
|
-
`${
|
|
362
|
+
const Y = ((_) => {
|
|
363
|
+
const l = _.lastIndexOf(".");
|
|
364
|
+
return l === -1 ? "" : _.substring(l).toLowerCase();
|
|
365
|
+
})(f.name);
|
|
366
|
+
if (!o.includes(Y))
|
|
367
|
+
return w.error(
|
|
368
|
+
`${f.name} 파일은 허용되지 않는 확장자입니다. (${o.join(
|
|
369
369
|
", "
|
|
370
370
|
)}만 가능)`
|
|
371
371
|
), !1;
|
|
372
372
|
}
|
|
373
373
|
return !0;
|
|
374
|
-
},
|
|
375
|
-
const
|
|
376
|
-
(
|
|
374
|
+
}, g = async () => {
|
|
375
|
+
const f = c.filter((D) => D.status !== "done"), v = f.reduce(
|
|
376
|
+
(D, S) => D + (S.size || 0),
|
|
377
377
|
0
|
|
378
|
-
),
|
|
379
|
-
if (
|
|
380
|
-
|
|
378
|
+
), Y = 2 * 1024 * 1024 * 1024;
|
|
379
|
+
if (v > Y) {
|
|
380
|
+
We.error({
|
|
381
381
|
message: "업로드 용량 초과",
|
|
382
382
|
description: "한 번에 업로드할 수 있는 총 파일 용량은 2GB를 초과할 수 없습니다."
|
|
383
383
|
});
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
|
-
if (
|
|
387
|
-
|
|
386
|
+
if (f.length === 0) {
|
|
387
|
+
w.warning(
|
|
388
388
|
"업로드할 파일이 없거나 모든 파일이 이미 업로드되었습니다."
|
|
389
389
|
);
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
392
|
-
|
|
393
|
-
let
|
|
392
|
+
p(!0);
|
|
393
|
+
let _;
|
|
394
394
|
try {
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}),
|
|
395
|
+
const D = new gt();
|
|
396
|
+
f.forEach((S) => {
|
|
397
|
+
S.originFileObj && D.file(S.name, S.originFileObj);
|
|
398
|
+
}), _ = await D.generateAsync({
|
|
399
399
|
type: "blob",
|
|
400
400
|
compression: "DEFLATE",
|
|
401
401
|
compressionOptions: {
|
|
@@ -403,207 +403,207 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
403
403
|
// 높은 압축률 설정
|
|
404
404
|
}
|
|
405
405
|
});
|
|
406
|
-
} catch (
|
|
407
|
-
|
|
406
|
+
} catch (D) {
|
|
407
|
+
p(!1), w.error("파일을 압축하는 중 오류가 발생했습니다."), console.error("Zipping error:", D);
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
|
-
|
|
411
|
-
const
|
|
412
|
-
|
|
410
|
+
p(!1);
|
|
411
|
+
const l = new FormData();
|
|
412
|
+
l.append("file", _, "upload.zip"), d(!0), C(0);
|
|
413
413
|
try {
|
|
414
|
-
const
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
const
|
|
419
|
-
|
|
414
|
+
const D = await new Promise((z, U) => {
|
|
415
|
+
const B = new XMLHttpRequest();
|
|
416
|
+
B.open("POST", "/api/upload-large", !0), B.upload.onprogress = (W) => {
|
|
417
|
+
if (W.lengthComputable) {
|
|
418
|
+
const ae = Math.round(
|
|
419
|
+
W.loaded / W.total * 100
|
|
420
420
|
);
|
|
421
|
-
C(
|
|
421
|
+
C(ae);
|
|
422
422
|
}
|
|
423
|
-
},
|
|
424
|
-
if (
|
|
423
|
+
}, B.onload = () => {
|
|
424
|
+
if (B.status >= 200 && B.status < 300)
|
|
425
425
|
try {
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
new Error(
|
|
426
|
+
const W = JSON.parse(B.responseText);
|
|
427
|
+
W.success ? z(W) : U(
|
|
428
|
+
new Error(W.message || "파일 업로드에 실패했습니다.")
|
|
429
429
|
);
|
|
430
430
|
} catch {
|
|
431
|
-
|
|
431
|
+
U(new Error("잘못된 서버 응답입니다."));
|
|
432
432
|
}
|
|
433
433
|
else
|
|
434
434
|
try {
|
|
435
|
-
const
|
|
436
|
-
|
|
435
|
+
const W = JSON.parse(B.responseText);
|
|
436
|
+
U(new Error(W.message || `서버 오류: ${B.status}`));
|
|
437
437
|
} catch {
|
|
438
|
-
|
|
438
|
+
U(new Error(`서버 오류: ${B.status}`));
|
|
439
439
|
}
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
},
|
|
440
|
+
}, B.onerror = () => {
|
|
441
|
+
U(new Error("네트워크 오류가 발생했습니다."));
|
|
442
|
+
}, B.send(l);
|
|
443
443
|
});
|
|
444
|
-
|
|
445
|
-
|
|
444
|
+
w.success(
|
|
445
|
+
D.message || "압축 파일이 성공적으로 업로드되었습니다."
|
|
446
446
|
);
|
|
447
|
-
const
|
|
448
|
-
(
|
|
447
|
+
const S = c.map(
|
|
448
|
+
(z) => f.find((U) => U.uid === z.uid) ? { ...z, status: "done" } : z
|
|
449
449
|
);
|
|
450
|
-
if (
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
crprCd:
|
|
450
|
+
if (h(S), a && D.uploadedFiles && Array.isArray(D.uploadedFiles)) {
|
|
451
|
+
const z = Me();
|
|
452
|
+
D.uploadedFiles.forEach((U) => {
|
|
453
|
+
const B = {
|
|
454
|
+
crprCd: z?.crprCd,
|
|
455
455
|
sysCd: __SYS_CD__,
|
|
456
|
-
fileGrpKey:
|
|
456
|
+
fileGrpKey: n,
|
|
457
457
|
sub: [
|
|
458
458
|
{
|
|
459
|
-
crprCd:
|
|
459
|
+
crprCd: z?.crprCd,
|
|
460
460
|
sysCd: __SYS_CD__,
|
|
461
|
-
fileGrpKey:
|
|
462
|
-
physFileNm:
|
|
463
|
-
lgclFileNm:
|
|
464
|
-
filePath:
|
|
465
|
-
fileExtn:
|
|
466
|
-
fileSize:
|
|
461
|
+
fileGrpKey: n,
|
|
462
|
+
physFileNm: U.fileNameP,
|
|
463
|
+
lgclFileNm: U.fileNameL,
|
|
464
|
+
filePath: U.filePath,
|
|
465
|
+
fileExtn: U.fileExt,
|
|
466
|
+
fileSize: U.fileSize,
|
|
467
467
|
mltpYn: "Y"
|
|
468
468
|
}
|
|
469
469
|
]
|
|
470
470
|
};
|
|
471
|
-
|
|
472
|
-
const
|
|
473
|
-
crprCd:
|
|
471
|
+
oe(a, B).then((W) => {
|
|
472
|
+
const ae = c.map((ne) => ({
|
|
473
|
+
crprCd: z?.crprCd,
|
|
474
474
|
sysCd: __SYS_CD__,
|
|
475
|
-
fileGrpKey:
|
|
476
|
-
fileKey:
|
|
477
|
-
lgclFileNm:
|
|
478
|
-
fileSize:
|
|
479
|
-
fileExtn:
|
|
480
|
-
fileType:
|
|
475
|
+
fileGrpKey: W.sub[0].fileGrpKey,
|
|
476
|
+
fileKey: W.sub[0].fileKey,
|
|
477
|
+
lgclFileNm: ne.name,
|
|
478
|
+
fileSize: ne.size,
|
|
479
|
+
fileExtn: ne.name.split(".").pop(),
|
|
480
|
+
fileType: ne.type
|
|
481
481
|
}));
|
|
482
|
-
|
|
482
|
+
oe(r, {
|
|
483
483
|
// 파일 목록에 fileKey를 추가합니다.
|
|
484
|
-
sub:
|
|
484
|
+
sub: ae
|
|
485
485
|
});
|
|
486
|
-
}).catch((
|
|
487
|
-
console.error("후처리 서비스 호출 실패:",
|
|
488
|
-
`${
|
|
486
|
+
}).catch((W) => {
|
|
487
|
+
console.error("후처리 서비스 호출 실패:", W), w.error(
|
|
488
|
+
`${U.fileNameL} 파일의 후처리 작업에 실패했습니다.`
|
|
489
489
|
);
|
|
490
490
|
}), u && u({
|
|
491
|
-
fileNameP:
|
|
492
|
-
fileNameL:
|
|
491
|
+
fileNameP: U.fileNameP,
|
|
492
|
+
fileNameL: U.fileNameL
|
|
493
493
|
});
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
|
-
} catch (
|
|
497
|
-
|
|
498
|
-
const
|
|
499
|
-
(
|
|
500
|
-
...
|
|
496
|
+
} catch (D) {
|
|
497
|
+
w.error(D.message || "파일 업로드 중 오류가 발생했습니다.");
|
|
498
|
+
const S = c.map(
|
|
499
|
+
(z) => f.find((U) => U.uid === z.uid) ? {
|
|
500
|
+
...z,
|
|
501
501
|
status: "error",
|
|
502
|
-
response:
|
|
503
|
-
} :
|
|
502
|
+
response: D.message || "파일 업로드 중 오류가 발생했습니다."
|
|
503
|
+
} : z
|
|
504
504
|
);
|
|
505
|
-
|
|
505
|
+
h(S);
|
|
506
506
|
} finally {
|
|
507
|
-
|
|
507
|
+
d(!1);
|
|
508
508
|
}
|
|
509
|
-
},
|
|
509
|
+
}, F = {
|
|
510
510
|
multiple: !0,
|
|
511
|
-
fileList:
|
|
512
|
-
beforeUpload: (
|
|
513
|
-
`대용량 첨부 파일 최대 크기는 ${(
|
|
511
|
+
fileList: c,
|
|
512
|
+
beforeUpload: (f) => T(f) ? i && f.size >= i * 1024 * 1024 ? (w.error(
|
|
513
|
+
`대용량 첨부 파일 최대 크기는 ${(i / 1024).toFixed(
|
|
514
514
|
1
|
|
515
515
|
)}GB입니다.`
|
|
516
|
-
),
|
|
517
|
-
onChange: ({ fileList:
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}),
|
|
516
|
+
), Q.LIST_IGNORE) : !1 : Q.LIST_IGNORE,
|
|
517
|
+
onChange: ({ fileList: f }) => {
|
|
518
|
+
const v = new Map(c.map((Y) => [Y.uid, Y]));
|
|
519
|
+
f.forEach((Y) => {
|
|
520
|
+
v.set(Y.uid, Y);
|
|
521
|
+
}), h(Array.from(v.values()));
|
|
522
522
|
},
|
|
523
|
-
onRemove: (
|
|
524
|
-
const
|
|
525
|
-
|
|
523
|
+
onRemove: (f) => {
|
|
524
|
+
const v = c.filter((Y) => Y.uid !== f.uid);
|
|
525
|
+
h(v);
|
|
526
526
|
},
|
|
527
527
|
showUploadList: !1
|
|
528
528
|
// 수동으로 목록을 렌더링하므로 antd의 기본 목록은 숨깁니다.
|
|
529
529
|
};
|
|
530
|
-
return /* @__PURE__ */
|
|
531
|
-
|
|
530
|
+
return /* @__PURE__ */ e(
|
|
531
|
+
ye,
|
|
532
532
|
{
|
|
533
533
|
spinning: s || y,
|
|
534
|
-
tip: y ? "파일 압축 중..." : `파일 업로드 중... ${
|
|
535
|
-
children: /* @__PURE__ */
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
|
|
534
|
+
tip: y ? "파일 압축 중..." : `파일 업로드 중... ${I}%`,
|
|
535
|
+
children: /* @__PURE__ */ O("div", { className: "bwg-large-uploader-container", children: [
|
|
536
|
+
/* @__PURE__ */ e(
|
|
537
|
+
xe,
|
|
538
538
|
{
|
|
539
|
-
title: /* @__PURE__ */
|
|
540
|
-
extra: /* @__PURE__ */
|
|
539
|
+
title: /* @__PURE__ */ e(se, { strong: !0, children: t }),
|
|
540
|
+
extra: /* @__PURE__ */ e(Q, { ...F, children: /* @__PURE__ */ e(ee, { icon: /* @__PURE__ */ e(re, {}), children: "파일 선택" }) }),
|
|
541
541
|
style: { padding: 0 },
|
|
542
|
-
children: /* @__PURE__ */
|
|
543
|
-
|
|
542
|
+
children: /* @__PURE__ */ e(
|
|
543
|
+
Dt,
|
|
544
544
|
{
|
|
545
|
-
...
|
|
545
|
+
...F,
|
|
546
546
|
style: {
|
|
547
547
|
border: "none",
|
|
548
548
|
background: "transparent",
|
|
549
549
|
padding: 0
|
|
550
550
|
},
|
|
551
|
-
children: /* @__PURE__ */
|
|
552
|
-
|
|
551
|
+
children: /* @__PURE__ */ e("div", { className: "upload-list-container", children: c.length > 0 ? /* @__PURE__ */ e(
|
|
552
|
+
le,
|
|
553
553
|
{
|
|
554
554
|
style: { textAlign: "left" },
|
|
555
|
-
dataSource:
|
|
556
|
-
renderItem: (
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
return
|
|
560
|
-
|
|
555
|
+
dataSource: c,
|
|
556
|
+
renderItem: (f) => {
|
|
557
|
+
const v = f.status === "done", Y = f.status === "error";
|
|
558
|
+
let _;
|
|
559
|
+
return v ? _ = /* @__PURE__ */ e(
|
|
560
|
+
lt,
|
|
561
561
|
{
|
|
562
562
|
style: { color: "#52c41a", fontSize: 14 }
|
|
563
563
|
}
|
|
564
|
-
) :
|
|
565
|
-
|
|
564
|
+
) : Y ? _ = /* @__PURE__ */ e(
|
|
565
|
+
He,
|
|
566
566
|
{
|
|
567
|
-
title: typeof
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
|
|
567
|
+
title: typeof f.response == "string" ? f.response : "업로드 실패",
|
|
568
|
+
children: /* @__PURE__ */ e(
|
|
569
|
+
at,
|
|
570
570
|
{
|
|
571
571
|
style: { color: "#ff4d4f", fontSize: 14 }
|
|
572
572
|
}
|
|
573
573
|
)
|
|
574
574
|
}
|
|
575
|
-
) :
|
|
576
|
-
|
|
575
|
+
) : _ = /* @__PURE__ */ e(st, { style: { fontSize: 14 } }), /* @__PURE__ */ e(
|
|
576
|
+
le.Item,
|
|
577
577
|
{
|
|
578
578
|
actions: [
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
|
|
579
|
+
/* @__PURE__ */ e(se, { type: "secondary", children: kt(f.size || 0) }, "size"),
|
|
580
|
+
/* @__PURE__ */ e(
|
|
581
|
+
ee,
|
|
582
582
|
{
|
|
583
583
|
type: "text",
|
|
584
|
-
icon: /* @__PURE__ */
|
|
585
|
-
onClick: (
|
|
586
|
-
|
|
584
|
+
icon: /* @__PURE__ */ e(rt, {}),
|
|
585
|
+
onClick: (l) => {
|
|
586
|
+
l.stopPropagation(), F.onRemove?.(f);
|
|
587
587
|
},
|
|
588
588
|
disabled: s || y
|
|
589
589
|
},
|
|
590
590
|
"delete"
|
|
591
591
|
)
|
|
592
592
|
],
|
|
593
|
-
children: /* @__PURE__ */
|
|
594
|
-
|
|
593
|
+
children: /* @__PURE__ */ e(
|
|
594
|
+
le.Item.Meta,
|
|
595
595
|
{
|
|
596
|
-
avatar:
|
|
597
|
-
title: /* @__PURE__ */
|
|
596
|
+
avatar: _,
|
|
597
|
+
title: /* @__PURE__ */ e(se, { type: Y ? "danger" : void 0, children: f.name })
|
|
598
598
|
}
|
|
599
599
|
)
|
|
600
600
|
},
|
|
601
|
-
|
|
601
|
+
f.uid
|
|
602
602
|
);
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
) : /* @__PURE__ */
|
|
606
|
-
|
|
605
|
+
) : /* @__PURE__ */ O(
|
|
606
|
+
Ie,
|
|
607
607
|
{
|
|
608
608
|
gap: "middle",
|
|
609
609
|
align: "center",
|
|
@@ -611,8 +611,8 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
611
611
|
vertical: !0,
|
|
612
612
|
style: { padding: "20px 0", minHeight: "120px" },
|
|
613
613
|
children: [
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ e(Ve, { style: { fontSize: "32px", color: "#999" } }),
|
|
615
|
+
/* @__PURE__ */ e(se, { type: "secondary", children: "업로드할 파일을 선택하거나 이 영역으로 드래그하세요." })
|
|
616
616
|
]
|
|
617
617
|
}
|
|
618
618
|
) })
|
|
@@ -620,22 +620,22 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
620
620
|
)
|
|
621
621
|
}
|
|
622
622
|
),
|
|
623
|
-
|
|
624
|
-
|
|
623
|
+
c.length > 0 && /* @__PURE__ */ O(
|
|
624
|
+
Ie,
|
|
625
625
|
{
|
|
626
626
|
justify: "flex-end",
|
|
627
627
|
align: "center",
|
|
628
628
|
gap: "large",
|
|
629
629
|
style: { marginTop: 16 },
|
|
630
630
|
children: [
|
|
631
|
-
s && /* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
|
|
631
|
+
s && /* @__PURE__ */ e("div", { style: { width: "250px" }, children: /* @__PURE__ */ e(Ge, { percent: I, size: "small" }) }),
|
|
632
|
+
/* @__PURE__ */ e(
|
|
633
|
+
ee,
|
|
634
634
|
{
|
|
635
635
|
type: "primary",
|
|
636
|
-
onClick:
|
|
637
|
-
disabled: s || y ||
|
|
638
|
-
icon: /* @__PURE__ */
|
|
636
|
+
onClick: g,
|
|
637
|
+
disabled: s || y || c.filter((f) => f.status !== "done").length === 0,
|
|
638
|
+
icon: /* @__PURE__ */ e(ot, {}),
|
|
639
639
|
children: "일괄 업로드"
|
|
640
640
|
}
|
|
641
641
|
)
|
|
@@ -645,36 +645,36 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
645
645
|
] })
|
|
646
646
|
}
|
|
647
647
|
);
|
|
648
|
-
},
|
|
649
|
-
if (typeof
|
|
650
|
-
return
|
|
651
|
-
if (Array.isArray(
|
|
652
|
-
return
|
|
653
|
-
if (typeof
|
|
654
|
-
const { mask:
|
|
655
|
-
return
|
|
656
|
-
const o = u?.[
|
|
648
|
+
}, wt = (t) => {
|
|
649
|
+
if (typeof t == "string")
|
|
650
|
+
return t.replace(/0/g, "_");
|
|
651
|
+
if (Array.isArray(t))
|
|
652
|
+
return t[0].replace(/0/g, "_");
|
|
653
|
+
if (typeof t == "object" && "mask" in t && "blocks" in t) {
|
|
654
|
+
const { mask: n, blocks: u } = t;
|
|
655
|
+
return n.split(".").map((a) => {
|
|
656
|
+
const o = u?.[a]?.maxLength ?? 3;
|
|
657
657
|
return "_".repeat(o);
|
|
658
658
|
}).join(".");
|
|
659
659
|
}
|
|
660
660
|
return "";
|
|
661
|
-
},
|
|
662
|
-
itemProps:
|
|
663
|
-
inputProps:
|
|
661
|
+
}, tn = ({
|
|
662
|
+
itemProps: t,
|
|
663
|
+
inputProps: n,
|
|
664
664
|
mask: u
|
|
665
665
|
}) => {
|
|
666
|
-
const
|
|
667
|
-
return
|
|
668
|
-
if (!
|
|
669
|
-
const
|
|
670
|
-
return
|
|
671
|
-
|
|
666
|
+
const a = J(null), r = x.useFormInstance(), o = q(() => wt(u), [u]);
|
|
667
|
+
return X(() => {
|
|
668
|
+
if (!a.current?.input) return;
|
|
669
|
+
const i = typeof u == "string" || Array.isArray(u) ? { mask: u } : u, c = ce(a.current.input, i);
|
|
670
|
+
return c.on("accept", () => {
|
|
671
|
+
r && t?.name && r.setFieldValue(t.name, c.value);
|
|
672
672
|
}), () => {
|
|
673
|
-
|
|
673
|
+
c.destroy();
|
|
674
674
|
};
|
|
675
|
-
}, [u,
|
|
676
|
-
},
|
|
677
|
-
switch (
|
|
675
|
+
}, [u, r, t?.name]), /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(K, { ...n, ref: a, placeholder: o }) });
|
|
676
|
+
}, St = (t) => {
|
|
677
|
+
switch (t) {
|
|
678
678
|
case "year":
|
|
679
679
|
return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
|
|
680
680
|
case "month":
|
|
@@ -687,69 +687,69 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
687
687
|
outputFormat: "YYYYMMDD"
|
|
688
688
|
};
|
|
689
689
|
}
|
|
690
|
-
},
|
|
691
|
-
type:
|
|
692
|
-
itemProps:
|
|
690
|
+
}, nn = ({
|
|
691
|
+
type: t = "date",
|
|
692
|
+
itemProps: n = { name: "calendar" },
|
|
693
693
|
inputProps: u,
|
|
694
|
-
pickerProps:
|
|
694
|
+
pickerProps: a
|
|
695
695
|
}) => {
|
|
696
|
-
const { format:
|
|
697
|
-
|
|
698
|
-
if (!
|
|
699
|
-
const
|
|
696
|
+
const { format: r, mask: o, outputFormat: i } = St(t), c = J(null), h = J(null), s = J(null), d = x.useFormInstance(), [y, p] = P(!1), [I, C] = P(!1), T = n?.name, [g, F] = P(null), f = x.useWatch(T, d), v = Te();
|
|
697
|
+
X(() => {
|
|
698
|
+
if (!c.current?.input) return;
|
|
699
|
+
const l = ce(c.current.input, {
|
|
700
700
|
mask: o,
|
|
701
701
|
lazy: !1
|
|
702
702
|
});
|
|
703
|
-
return
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
|
|
703
|
+
return h.current = l, l.on("accept", () => {
|
|
704
|
+
const D = l.value;
|
|
705
|
+
D.length > 0 && p(!0);
|
|
706
|
+
const S = N(D, r, !0);
|
|
707
|
+
D.length === r.length && S.isValid() && (d.setFieldValue(T, S.format(i)), F(S), h.current?.updateValue());
|
|
708
708
|
}), () => {
|
|
709
|
-
|
|
709
|
+
l.destroy();
|
|
710
710
|
};
|
|
711
|
-
}, [
|
|
712
|
-
if (!
|
|
713
|
-
|
|
711
|
+
}, [r, o]), X(() => {
|
|
712
|
+
if (!f) {
|
|
713
|
+
F(null);
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
|
-
let
|
|
717
|
-
if (typeof
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
} else if (
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
} else
|
|
716
|
+
let l = null;
|
|
717
|
+
if (typeof f == "string" && f.length === i.length && /^\d+$/.test(f))
|
|
718
|
+
if (t === "date") {
|
|
719
|
+
const D = f.substring(0, 4), S = f.substring(4, 6), z = f.substring(6, 8);
|
|
720
|
+
l = N(`${D}-${S}-${z}`, r, !0);
|
|
721
|
+
} else if (t === "month") {
|
|
722
|
+
const D = f.substring(0, 4), S = f.substring(4, 6);
|
|
723
|
+
l = N(`${D}-${S}`, r, !0);
|
|
724
|
+
} else t === "year" && (l = N(f, r, !0));
|
|
725
725
|
else
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}, [
|
|
729
|
-
const
|
|
730
|
-
if (!
|
|
731
|
-
|
|
726
|
+
l = N(f, r, !0);
|
|
727
|
+
l && l.isValid() ? F(l) : F(null), C(!1);
|
|
728
|
+
}, [f, r, i, t]);
|
|
729
|
+
const Y = (l) => {
|
|
730
|
+
if (!l) {
|
|
731
|
+
d.setFieldValue(T, void 0), F(null), h.current?.updateValue();
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
|
-
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
},
|
|
734
|
+
F(l);
|
|
735
|
+
const D = l.format(i);
|
|
736
|
+
d.setFieldValue(T, D), h.current && (h.current.value = l.format(r), h.current.updateValue()), C(!1);
|
|
737
|
+
}, _ = (l) => {
|
|
738
738
|
setTimeout(() => {
|
|
739
|
-
const
|
|
740
|
-
!(
|
|
739
|
+
const D = document.activeElement, S = s.current, z = S?.querySelector(".ant-picker-dropdown");
|
|
740
|
+
!(S && (S.contains(D) || S === D || z?.contains(D))) && !(l !== void 0 ? l : y) && console.log("✅ Input과 DatePicker 모두 포커스가 없습니다");
|
|
741
741
|
}, 0);
|
|
742
742
|
};
|
|
743
|
-
return /* @__PURE__ */
|
|
744
|
-
|
|
743
|
+
return /* @__PURE__ */ e(
|
|
744
|
+
G,
|
|
745
745
|
{
|
|
746
|
-
...
|
|
746
|
+
...n,
|
|
747
747
|
name: void 0,
|
|
748
|
-
validateStatus:
|
|
749
|
-
children: /* @__PURE__ */
|
|
750
|
-
|
|
748
|
+
validateStatus: I ? "warning" : void 0,
|
|
749
|
+
children: /* @__PURE__ */ O(
|
|
750
|
+
de,
|
|
751
751
|
{
|
|
752
|
-
componentSize:
|
|
752
|
+
componentSize: v.componentSize,
|
|
753
753
|
theme: {
|
|
754
754
|
components: {
|
|
755
755
|
Input: {
|
|
@@ -758,63 +758,63 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
758
758
|
}
|
|
759
759
|
},
|
|
760
760
|
children: [
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
|
|
761
|
+
/* @__PURE__ */ e(
|
|
762
|
+
x.Item,
|
|
763
763
|
{
|
|
764
|
-
name:
|
|
765
|
-
getValueProps: (
|
|
766
|
-
value:
|
|
764
|
+
name: T,
|
|
765
|
+
getValueProps: (l) => ({
|
|
766
|
+
value: l ? N(l).format(r) : void 0
|
|
767
767
|
}),
|
|
768
|
-
normalize: (
|
|
768
|
+
normalize: (l) => l ? N(l).format(i) : void 0,
|
|
769
769
|
noStyle: !0,
|
|
770
|
-
rules:
|
|
771
|
-
children: /* @__PURE__ */
|
|
772
|
-
|
|
770
|
+
rules: n?.rules ?? [],
|
|
771
|
+
children: /* @__PURE__ */ e(
|
|
772
|
+
K,
|
|
773
773
|
{
|
|
774
774
|
...u,
|
|
775
|
-
ref:
|
|
775
|
+
ref: c,
|
|
776
776
|
onFocus: () => {
|
|
777
|
-
|
|
777
|
+
p(!y), h.current?.updateValue();
|
|
778
778
|
},
|
|
779
779
|
onBlur: () => {
|
|
780
|
-
|
|
780
|
+
_();
|
|
781
781
|
},
|
|
782
|
-
onKeyDown: (
|
|
783
|
-
if (
|
|
782
|
+
onKeyDown: (l) => {
|
|
783
|
+
if (l.key === "Backspace" && p(!0), l.key === "Tab" && p(!1), l.key === "Enter")
|
|
784
784
|
if (y) {
|
|
785
|
-
const
|
|
786
|
-
|
|
785
|
+
const D = h.current?.value || "", S = N(D, r, !0);
|
|
786
|
+
D.length === r.length && S.isValid() ? (p(!1), C(!1)) : C(!0);
|
|
787
787
|
} else
|
|
788
|
-
|
|
788
|
+
p(!0);
|
|
789
789
|
},
|
|
790
790
|
style: {
|
|
791
791
|
width: "65%"
|
|
792
792
|
},
|
|
793
793
|
allowClear: !0,
|
|
794
794
|
placeholder: o.replace(/0/g, "_"),
|
|
795
|
-
suffix: /* @__PURE__ */
|
|
795
|
+
suffix: /* @__PURE__ */ e(pe, { style: { color: "#d9d9d9" } }),
|
|
796
796
|
autoComplete: "off"
|
|
797
797
|
}
|
|
798
798
|
)
|
|
799
799
|
}
|
|
800
800
|
),
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
|
|
801
|
+
/* @__PURE__ */ e(
|
|
802
|
+
ue,
|
|
803
803
|
{
|
|
804
|
-
...
|
|
804
|
+
...a,
|
|
805
805
|
open: y,
|
|
806
|
-
picker:
|
|
806
|
+
picker: t,
|
|
807
807
|
format: {
|
|
808
|
-
format:
|
|
808
|
+
format: r,
|
|
809
809
|
type: "mask"
|
|
810
810
|
},
|
|
811
811
|
showNow: !0,
|
|
812
|
-
value:
|
|
813
|
-
onChange:
|
|
814
|
-
onOpenChange: (
|
|
815
|
-
|
|
812
|
+
value: g,
|
|
813
|
+
onChange: Y,
|
|
814
|
+
onOpenChange: (l) => {
|
|
815
|
+
p(l), l || _(!1);
|
|
816
816
|
},
|
|
817
|
-
renderExtraFooter: () =>
|
|
817
|
+
renderExtraFooter: () => I ? /* @__PURE__ */ O(
|
|
818
818
|
"div",
|
|
819
819
|
{
|
|
820
820
|
style: {
|
|
@@ -828,12 +828,12 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
828
828
|
backgroundColor: "#fffbe6"
|
|
829
829
|
},
|
|
830
830
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ e(Ae, {}),
|
|
832
|
+
/* @__PURE__ */ e("span", { children: "유효하지 않은 날짜입니다" })
|
|
833
833
|
]
|
|
834
834
|
}
|
|
835
835
|
) : null,
|
|
836
|
-
getPopupContainer: (
|
|
836
|
+
getPopupContainer: (l) => l.parentElement,
|
|
837
837
|
style: {
|
|
838
838
|
position: "absolute",
|
|
839
839
|
top: 0,
|
|
@@ -849,8 +849,8 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
849
849
|
)
|
|
850
850
|
}
|
|
851
851
|
);
|
|
852
|
-
}, { RangePicker:
|
|
853
|
-
switch (
|
|
852
|
+
}, { RangePicker: bt } = ue, Lt = (t) => {
|
|
853
|
+
switch (t) {
|
|
854
854
|
case "year":
|
|
855
855
|
return { format: "YYYY", mask: "0000", outputFormat: "YYYY" };
|
|
856
856
|
case "month":
|
|
@@ -863,231 +863,231 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
863
863
|
outputFormat: "YYYYMMDD"
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
},
|
|
867
|
-
type:
|
|
868
|
-
itemProps:
|
|
866
|
+
}, rn = ({
|
|
867
|
+
type: t = "date",
|
|
868
|
+
itemProps: n = { name: "dateRange" },
|
|
869
869
|
inputProps: u,
|
|
870
|
-
pickerProps:
|
|
870
|
+
pickerProps: a
|
|
871
871
|
}) => {
|
|
872
|
-
const { format:
|
|
872
|
+
const { format: r, mask: o, outputFormat: i } = Lt(t), c = J(null), h = J(null), s = J(null), d = J(null), y = J(null), p = x.useFormInstance(), [I, C] = P(!1), [T, g] = P(!1), [F, f] = P(null), [v, Y] = P(!1), _ = J(!1), l = n?.name, [D, S] = P([
|
|
873
873
|
null,
|
|
874
874
|
null
|
|
875
|
-
]),
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
),
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
),
|
|
882
|
-
|
|
883
|
-
if (!
|
|
884
|
-
const m =
|
|
875
|
+
]), z = x.useWatch(
|
|
876
|
+
l ? Array.isArray(l) ? [...l, 0] : [l, 0] : void 0,
|
|
877
|
+
p
|
|
878
|
+
), U = x.useWatch(
|
|
879
|
+
l ? Array.isArray(l) ? [...l, 1] : [l, 1] : void 0,
|
|
880
|
+
p
|
|
881
|
+
), B = x.useWatch(l, p), W = Te();
|
|
882
|
+
X(() => {
|
|
883
|
+
if (!c.current?.input) return;
|
|
884
|
+
const m = ce(c.current.input, {
|
|
885
885
|
mask: o,
|
|
886
886
|
lazy: !1
|
|
887
887
|
});
|
|
888
888
|
return s.current = m, m.on("accept", () => {
|
|
889
|
-
const
|
|
889
|
+
const E = m.value, L = m.unmaskedValue || "";
|
|
890
890
|
if (console.log("🔵 [시작일] accept 이벤트:", {
|
|
891
|
-
maskValue:
|
|
892
|
-
unmaskedValue:
|
|
893
|
-
length:
|
|
894
|
-
formatLength:
|
|
895
|
-
}),
|
|
896
|
-
const
|
|
897
|
-
if (
|
|
891
|
+
maskValue: E,
|
|
892
|
+
unmaskedValue: L,
|
|
893
|
+
length: E.length,
|
|
894
|
+
formatLength: r.length
|
|
895
|
+
}), E.length > 0 && (f("start"), C(!0), Y(!1)), L.length === i.length) {
|
|
896
|
+
const k = N(E, r, !0);
|
|
897
|
+
if (k.isValid()) {
|
|
898
898
|
console.log("🔵 [시작일] 입력 완료 및 검증 통과:", {
|
|
899
|
-
parsed:
|
|
899
|
+
parsed: k.format(r)
|
|
900
900
|
});
|
|
901
|
-
const H =
|
|
902
|
-
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
if (
|
|
909
|
-
const
|
|
910
|
-
!(
|
|
901
|
+
const H = k.format(i);
|
|
902
|
+
_.current = !0;
|
|
903
|
+
const b = Array.isArray(l) ? [...l, 0] : [l, 0];
|
|
904
|
+
p.setFieldValue(b, H), S([k, D[1]]), s.current && s.current.updateValue(), g(!1), setTimeout(() => {
|
|
905
|
+
d.current && (d.current.value = "", d.current.unmaskedValue = "", d.current.updateValue());
|
|
906
|
+
const V = Array.isArray(l) ? [...l, 1] : [l, 1];
|
|
907
|
+
p.getFieldValue(V) || p.setFieldValue(V, void 0), h.current?.focus(), setTimeout(() => {
|
|
908
|
+
if (d.current) {
|
|
909
|
+
const j = d.current.value || "";
|
|
910
|
+
!(d.current.unmaskedValue || "") && !j.replace(/[^0-9]/g, "") && (d.current.value = "", d.current.updateValue());
|
|
911
911
|
}
|
|
912
|
-
}, 10),
|
|
912
|
+
}, 10), f("end"), C(!0), _.current = !1;
|
|
913
913
|
}, 0);
|
|
914
914
|
} else
|
|
915
|
-
|
|
915
|
+
a?.allowEmpty ? g(!1) : (console.log("🔵 [시작일] 검증 실패:", { val: E, parsed: k }), g(!0));
|
|
916
916
|
}
|
|
917
917
|
}), () => {
|
|
918
918
|
m.destroy();
|
|
919
919
|
};
|
|
920
|
-
}, [
|
|
921
|
-
if (!
|
|
922
|
-
const m =
|
|
920
|
+
}, [r, o, l]), X(() => {
|
|
921
|
+
if (!h.current?.input) return;
|
|
922
|
+
const m = ce(h.current.input, {
|
|
923
923
|
mask: o,
|
|
924
924
|
lazy: !1
|
|
925
925
|
});
|
|
926
|
-
return
|
|
927
|
-
const
|
|
926
|
+
return d.current = m, m.on("accept", () => {
|
|
927
|
+
const E = m.value, L = m.unmaskedValue || "";
|
|
928
928
|
if (console.log("🟢 [종료일] accept 이벤트:", {
|
|
929
|
-
maskValue:
|
|
930
|
-
unmaskedValue:
|
|
931
|
-
length:
|
|
932
|
-
formatLength:
|
|
933
|
-
}),
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
|
|
929
|
+
maskValue: E,
|
|
930
|
+
unmaskedValue: L,
|
|
931
|
+
length: E.length,
|
|
932
|
+
formatLength: r.length
|
|
933
|
+
}), L === "" || L.length === 0) {
|
|
934
|
+
const k = Array.isArray(l) ? [...l, 1] : [l, 1];
|
|
935
|
+
p.setFieldValue(k, void 0), S([D[0], null]), d.current && (d.current.value = "", d.current.updateValue()), setTimeout(() => {
|
|
936
|
+
c.current?.focus(), f("start"), C(!0);
|
|
937
937
|
}, 0);
|
|
938
938
|
return;
|
|
939
939
|
}
|
|
940
|
-
if (
|
|
941
|
-
|
|
940
|
+
if (E.length > 0 && (f("end"), C(!0)), E.length < r.length) {
|
|
941
|
+
g(!1);
|
|
942
942
|
return;
|
|
943
943
|
}
|
|
944
|
-
if (
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
947
|
-
const H =
|
|
944
|
+
if (L.length === i.length) {
|
|
945
|
+
const k = N(E, r, !0);
|
|
946
|
+
if (k.isValid()) {
|
|
947
|
+
const H = k.format(i);
|
|
948
948
|
console.log("🟢 [종료일] 입력 완료:", {
|
|
949
|
-
parsed:
|
|
949
|
+
parsed: k.format(r),
|
|
950
950
|
formatted: H
|
|
951
|
-
}),
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
951
|
+
}), _.current = !0;
|
|
952
|
+
const b = Array.isArray(l) ? [...l, 1] : [l, 1];
|
|
953
|
+
p.setFieldValue(b, H), S([D[0], k]), d.current?.updateValue(), setTimeout(() => {
|
|
954
|
+
_.current = !1;
|
|
955
955
|
}, 0);
|
|
956
956
|
} else
|
|
957
|
-
|
|
957
|
+
a?.allowEmpty ? g(!1) : (console.log("🟢 [종료일] 검증 실패:", { val: E, parsed: k }), g(!0));
|
|
958
958
|
}
|
|
959
959
|
}), () => {
|
|
960
960
|
m.destroy();
|
|
961
961
|
};
|
|
962
|
-
}, [
|
|
962
|
+
}, [r, o, l]), X(() => {
|
|
963
963
|
console.log("🟡 [useEffect] form 값 변경 감지:", {
|
|
964
|
-
startFormValue:
|
|
965
|
-
endFormValue:
|
|
966
|
-
formValue:
|
|
964
|
+
startFormValue: z,
|
|
965
|
+
endFormValue: U,
|
|
966
|
+
formValue: B
|
|
967
967
|
});
|
|
968
|
-
const m =
|
|
969
|
-
if (m === void 0 &&
|
|
970
|
-
|
|
968
|
+
const m = z ?? (Array.isArray(B) ? B[0] : null), E = U ?? (Array.isArray(B) ? B[1] : null);
|
|
969
|
+
if (m === void 0 && E === void 0 && (!B || !Array.isArray(B))) {
|
|
970
|
+
S([null, null]);
|
|
971
971
|
return;
|
|
972
972
|
}
|
|
973
|
-
const
|
|
974
|
-
if (!
|
|
975
|
-
let
|
|
976
|
-
if (typeof
|
|
977
|
-
if (
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
} else if (
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
} else
|
|
973
|
+
const L = (b) => {
|
|
974
|
+
if (!b) return null;
|
|
975
|
+
let V = null;
|
|
976
|
+
if (typeof b == "string" && b.length === i.length && /^\d+$/.test(b))
|
|
977
|
+
if (t === "date") {
|
|
978
|
+
const R = b.substring(0, 4), j = b.substring(4, 6), De = b.substring(6, 8);
|
|
979
|
+
V = N(`${R}-${j}-${De}`, r, !0);
|
|
980
|
+
} else if (t === "month") {
|
|
981
|
+
const R = b.substring(0, 4), j = b.substring(4, 6);
|
|
982
|
+
V = N(`${R}-${j}`, r, !0);
|
|
983
|
+
} else t === "year" && (V = N(b, r, !0));
|
|
984
984
|
else
|
|
985
|
-
|
|
986
|
-
return
|
|
987
|
-
},
|
|
985
|
+
V = N(b, r, !0);
|
|
986
|
+
return V && V.isValid() ? V : null;
|
|
987
|
+
}, k = L(m), H = L(E);
|
|
988
988
|
if (console.log("🟡 [useEffect] 파싱 결과:", {
|
|
989
|
-
startParsed:
|
|
990
|
-
endParsed: H ? H.format(
|
|
991
|
-
isStartDateFromPicker:
|
|
992
|
-
}),
|
|
993
|
-
console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"),
|
|
989
|
+
startParsed: k ? k.format(r) : null,
|
|
990
|
+
endParsed: H ? H.format(r) : null,
|
|
991
|
+
isStartDateFromPicker: v
|
|
992
|
+
}), S([k, H]), _.current) {
|
|
993
|
+
console.log("🟡 [useEffect] 사용자 입력 중 - 마스크 값 업데이트 스킵"), g(!1);
|
|
994
994
|
return;
|
|
995
995
|
}
|
|
996
|
-
if (!
|
|
997
|
-
const
|
|
996
|
+
if (!v && s.current) {
|
|
997
|
+
const b = s.current.value || "", V = k ? k.format(r) : "", R = s.current.unmaskedValue || "", j = k ? k.format(i) : "";
|
|
998
998
|
console.log("🟡 [useEffect] 시작일 마스크 값 체크:", {
|
|
999
|
-
currentMaskValue:
|
|
1000
|
-
expectedMaskValue:
|
|
1001
|
-
unmaskedValue:
|
|
1002
|
-
expectedUnmasked:
|
|
1003
|
-
shouldUpdate:
|
|
1004
|
-
canUpdate:
|
|
1005
|
-
}), (
|
|
1006
|
-
before:
|
|
1007
|
-
after:
|
|
1008
|
-
}),
|
|
999
|
+
currentMaskValue: b,
|
|
1000
|
+
expectedMaskValue: V,
|
|
1001
|
+
unmaskedValue: R,
|
|
1002
|
+
expectedUnmasked: j,
|
|
1003
|
+
shouldUpdate: b === "" || b !== V,
|
|
1004
|
+
canUpdate: R === "" || R === j
|
|
1005
|
+
}), (b === "" || b !== V) && (R === "" || R === j ? (console.log("🟡 [useEffect] 시작일 마스크 값 업데이트:", {
|
|
1006
|
+
before: b,
|
|
1007
|
+
after: k ? k.format(r) : ""
|
|
1008
|
+
}), k ? (s.current.value = k.format(r), s.current.updateValue()) : (s.current.value = "", s.current.updateValue())) : console.log(
|
|
1009
1009
|
"🟡 [useEffect] 시작일 마스크 값 업데이트 스킵 (사용자 입력 중)"
|
|
1010
1010
|
));
|
|
1011
1011
|
}
|
|
1012
|
-
if (
|
|
1013
|
-
const
|
|
1012
|
+
if (d.current) {
|
|
1013
|
+
const b = d.current.value || "", V = H ? H.format(r) : "", R = d.current.unmaskedValue || "", j = H ? H.format(i) : "";
|
|
1014
1014
|
console.log("🟡 [useEffect] 종료일 마스크 값 체크:", {
|
|
1015
|
-
currentMaskValue:
|
|
1016
|
-
expectedMaskValue:
|
|
1017
|
-
unmaskedValue:
|
|
1018
|
-
expectedUnmasked:
|
|
1019
|
-
shouldUpdate:
|
|
1020
|
-
canUpdate:
|
|
1021
|
-
}), (
|
|
1022
|
-
before:
|
|
1023
|
-
after:
|
|
1024
|
-
}), H ? (
|
|
1015
|
+
currentMaskValue: b,
|
|
1016
|
+
expectedMaskValue: V,
|
|
1017
|
+
unmaskedValue: R,
|
|
1018
|
+
expectedUnmasked: j,
|
|
1019
|
+
shouldUpdate: b === "" || b !== V,
|
|
1020
|
+
canUpdate: R === "" || R === j
|
|
1021
|
+
}), (b === "" || b !== V) && (R === "" || R === j ? (console.log("🟡 [useEffect] 종료일 마스크 값 업데이트:", {
|
|
1022
|
+
before: b,
|
|
1023
|
+
after: V
|
|
1024
|
+
}), H ? (d.current.value = H.format(r), d.current.updateValue()) : (d.current.value = "", d.current.updateValue())) : console.log(
|
|
1025
1025
|
"🟡 [useEffect] 종료일 마스크 값 업데이트 스킵 (사용자 입력 중)"
|
|
1026
1026
|
));
|
|
1027
1027
|
}
|
|
1028
|
-
|
|
1029
|
-
}, [
|
|
1030
|
-
const
|
|
1028
|
+
g(!1);
|
|
1029
|
+
}, [z, U, B, r, i, t]);
|
|
1030
|
+
const ae = (m) => {
|
|
1031
1031
|
if (console.log("🔴 [RangePicker] 날짜 변경:", {
|
|
1032
1032
|
dates: m ? [
|
|
1033
|
-
m[0] ? m[0].format(
|
|
1034
|
-
m[1] ? m[1].format(
|
|
1033
|
+
m[0] ? m[0].format(r) : null,
|
|
1034
|
+
m[1] ? m[1].format(r) : null
|
|
1035
1035
|
] : null,
|
|
1036
1036
|
prevRange: [
|
|
1037
|
-
|
|
1038
|
-
|
|
1037
|
+
D[0] ? D[0].format(r) : null,
|
|
1038
|
+
D[1] ? D[1].format(r) : null
|
|
1039
1039
|
]
|
|
1040
1040
|
}), !m) {
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1041
|
+
S([null, null]);
|
|
1042
|
+
const V = Array.isArray(l) ? [...l, 0] : [l, 0], R = Array.isArray(l) ? [...l, 1] : [l, 1];
|
|
1043
|
+
p.setFieldValue(V, void 0), p.setFieldValue(R, void 0), s.current?.updateValue(), d.current?.updateValue();
|
|
1044
1044
|
return;
|
|
1045
1045
|
}
|
|
1046
|
-
const [
|
|
1047
|
-
|
|
1048
|
-
|
|
1046
|
+
const [E, L] = m, k = D[0], H = E && (!k || !E.isSame(
|
|
1047
|
+
k,
|
|
1048
|
+
t === "year" ? "year" : t === "month" ? "month" : "day"
|
|
1049
1049
|
));
|
|
1050
1050
|
if (console.log("🔴 [RangePicker] 시작일 변경 여부:", {
|
|
1051
1051
|
isStartDateChanged: H,
|
|
1052
|
-
startDate:
|
|
1053
|
-
prevStartDate:
|
|
1054
|
-
}),
|
|
1055
|
-
console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"),
|
|
1056
|
-
const
|
|
1052
|
+
startDate: E ? E.format(r) : null,
|
|
1053
|
+
prevStartDate: k ? k.format(r) : null
|
|
1054
|
+
}), S([E, L]), H) {
|
|
1055
|
+
console.log("🔴 [RangePicker] 시작일 선택됨 - input 비우기"), Y(!0), s.current && (s.current.value = "", s.current.updateValue());
|
|
1056
|
+
const V = E.format(i);
|
|
1057
1057
|
console.log("🔴 [RangePicker] form 값 업데이트:", {
|
|
1058
|
-
formatted:
|
|
1058
|
+
formatted: V
|
|
1059
1059
|
});
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
} else if (!
|
|
1063
|
-
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1060
|
+
const R = Array.isArray(l) ? [...l, 0] : [l, 0];
|
|
1061
|
+
p.setFieldValue(R, V);
|
|
1062
|
+
} else if (!E && s.current) {
|
|
1063
|
+
Y(!1), s.current.value = "", s.current.updateValue();
|
|
1064
|
+
const V = Array.isArray(l) ? [...l, 0] : [l, 0];
|
|
1065
|
+
p.setFieldValue(V, void 0);
|
|
1066
1066
|
} else
|
|
1067
|
-
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1067
|
+
Y(!1);
|
|
1068
|
+
const b = Array.isArray(l) ? [...l, 1] : [l, 1];
|
|
1069
|
+
if (L) {
|
|
1070
|
+
const V = L.format(i);
|
|
1071
|
+
p.setFieldValue(b, V), d.current && (d.current.value = L.format(r), d.current.updateValue());
|
|
1072
1072
|
} else
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
},
|
|
1073
|
+
p.setFieldValue(b, void 0), d.current && (d.current.value = "", d.current.updateValue());
|
|
1074
|
+
g(!1);
|
|
1075
|
+
}, ne = (m) => {
|
|
1076
1076
|
setTimeout(() => {
|
|
1077
|
-
const
|
|
1078
|
-
!(
|
|
1077
|
+
const E = document.activeElement, L = y.current, k = L?.querySelector(".ant-picker-dropdown");
|
|
1078
|
+
!(L && (L.contains(E) || L === E || k?.contains(E))) && !(m !== void 0 ? m : I) && (console.log("✅ Input과 RangePicker 모두 포커스가 없습니다"), C(!1));
|
|
1079
1079
|
}, 0);
|
|
1080
1080
|
};
|
|
1081
|
-
return /* @__PURE__ */
|
|
1082
|
-
|
|
1081
|
+
return /* @__PURE__ */ e(
|
|
1082
|
+
G,
|
|
1083
1083
|
{
|
|
1084
|
-
...
|
|
1084
|
+
...n,
|
|
1085
1085
|
name: void 0,
|
|
1086
|
-
validateStatus:
|
|
1087
|
-
children: /* @__PURE__ */
|
|
1088
|
-
|
|
1086
|
+
validateStatus: T ? "warning" : void 0,
|
|
1087
|
+
children: /* @__PURE__ */ O(
|
|
1088
|
+
de,
|
|
1089
1089
|
{
|
|
1090
|
-
componentSize:
|
|
1090
|
+
componentSize: W.componentSize,
|
|
1091
1091
|
theme: {
|
|
1092
1092
|
components: {
|
|
1093
1093
|
Input: {
|
|
@@ -1096,7 +1096,7 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1096
1096
|
}
|
|
1097
1097
|
},
|
|
1098
1098
|
children: [
|
|
1099
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ O(
|
|
1100
1100
|
"div",
|
|
1101
1101
|
{
|
|
1102
1102
|
ref: y,
|
|
@@ -1107,130 +1107,130 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1107
1107
|
width: "100%"
|
|
1108
1108
|
},
|
|
1109
1109
|
children: [
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
|
|
1110
|
+
/* @__PURE__ */ e(
|
|
1111
|
+
x.Item,
|
|
1112
1112
|
{
|
|
1113
|
-
name:
|
|
1113
|
+
name: l ? Array.isArray(l) ? [...l, 0] : [l, 0] : void 0,
|
|
1114
1114
|
getValueProps: (m) => {
|
|
1115
1115
|
if (!m) return { value: void 0 };
|
|
1116
|
-
if (typeof m == "string" && m.length ===
|
|
1117
|
-
if (
|
|
1118
|
-
const
|
|
1119
|
-
return { value: `${
|
|
1120
|
-
} else if (
|
|
1121
|
-
const
|
|
1122
|
-
return { value: `${
|
|
1123
|
-
} else if (
|
|
1116
|
+
if (typeof m == "string" && m.length === i.length && /^\d+$/.test(m)) {
|
|
1117
|
+
if (t === "date") {
|
|
1118
|
+
const E = m.substring(0, 4), L = m.substring(4, 6), k = m.substring(6, 8);
|
|
1119
|
+
return { value: `${E}-${L}-${k}` };
|
|
1120
|
+
} else if (t === "month") {
|
|
1121
|
+
const E = m.substring(0, 4), L = m.substring(4, 6);
|
|
1122
|
+
return { value: `${E}-${L}` };
|
|
1123
|
+
} else if (t === "year")
|
|
1124
1124
|
return { value: m };
|
|
1125
1125
|
}
|
|
1126
|
-
return { value: N(m).format(
|
|
1126
|
+
return { value: N(m).format(r) };
|
|
1127
1127
|
},
|
|
1128
|
-
normalize: (m) => m ? N(m).format(
|
|
1128
|
+
normalize: (m) => m ? N(m).format(i) : (a?.allowEmpty, void 0),
|
|
1129
1129
|
noStyle: !0,
|
|
1130
|
-
rules:
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1132
|
-
|
|
1130
|
+
rules: n?.rules ?? [],
|
|
1131
|
+
children: /* @__PURE__ */ e(
|
|
1132
|
+
K,
|
|
1133
1133
|
{
|
|
1134
1134
|
...u,
|
|
1135
1135
|
value: void 0,
|
|
1136
|
-
ref:
|
|
1136
|
+
ref: c,
|
|
1137
1137
|
onFocus: () => {
|
|
1138
|
-
if (
|
|
1139
|
-
const m = Array.isArray(
|
|
1140
|
-
|
|
1138
|
+
if (f("start"), C(!I), Y(!1), s.current) {
|
|
1139
|
+
const m = Array.isArray(l) ? [...l, 0] : [l, 0];
|
|
1140
|
+
p.getFieldValue(m) || (s.current.value = "", s.current.unmaskedValue = ""), s.current.updateValue();
|
|
1141
1141
|
}
|
|
1142
1142
|
},
|
|
1143
1143
|
onBlur: () => {
|
|
1144
|
-
|
|
1144
|
+
ne();
|
|
1145
1145
|
},
|
|
1146
1146
|
onKeyDown: (m) => {
|
|
1147
|
-
if (m.key === "Backspace" && (
|
|
1148
|
-
if (
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1147
|
+
if (m.key === "Backspace" && (f("start"), C(!0)), m.key === "Enter")
|
|
1148
|
+
if (I && F === "start") {
|
|
1149
|
+
const E = s.current?.value || "";
|
|
1150
|
+
E.length === r.length ? N(E, r, !0).isValid() ? (C(!1), g(!1)) : a?.allowEmpty ? g(!1) : g(!0) : g(!1);
|
|
1151
1151
|
} else
|
|
1152
|
-
|
|
1152
|
+
f("start"), C(!0);
|
|
1153
1153
|
},
|
|
1154
1154
|
style: {
|
|
1155
1155
|
flex: 1
|
|
1156
1156
|
},
|
|
1157
1157
|
allowClear: !0,
|
|
1158
1158
|
placeholder: o.replace(/0/g, "_"),
|
|
1159
|
-
suffix: /* @__PURE__ */
|
|
1159
|
+
suffix: /* @__PURE__ */ e(pe, { style: { color: "#d9d9d9" } }),
|
|
1160
1160
|
autoComplete: "off"
|
|
1161
1161
|
}
|
|
1162
1162
|
)
|
|
1163
1163
|
}
|
|
1164
1164
|
),
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
|
|
1165
|
+
/* @__PURE__ */ e("span", { style: { color: "#d9d9d9", userSelect: "none" }, children: "~" }),
|
|
1166
|
+
/* @__PURE__ */ e(
|
|
1167
|
+
x.Item,
|
|
1168
1168
|
{
|
|
1169
|
-
name:
|
|
1169
|
+
name: l ? Array.isArray(l) ? [...l, 1] : [l, 1] : void 0,
|
|
1170
1170
|
getValueProps: (m) => {
|
|
1171
1171
|
if (!m) return { value: void 0 };
|
|
1172
|
-
if (typeof m == "string" && m.length ===
|
|
1173
|
-
if (
|
|
1174
|
-
const
|
|
1175
|
-
return { value: `${
|
|
1176
|
-
} else if (
|
|
1177
|
-
const
|
|
1178
|
-
return { value: `${
|
|
1179
|
-
} else if (
|
|
1172
|
+
if (typeof m == "string" && m.length === i.length && /^\d+$/.test(m)) {
|
|
1173
|
+
if (t === "date") {
|
|
1174
|
+
const E = m.substring(0, 4), L = m.substring(4, 6), k = m.substring(6, 8);
|
|
1175
|
+
return { value: `${E}-${L}-${k}` };
|
|
1176
|
+
} else if (t === "month") {
|
|
1177
|
+
const E = m.substring(0, 4), L = m.substring(4, 6);
|
|
1178
|
+
return { value: `${E}-${L}` };
|
|
1179
|
+
} else if (t === "year")
|
|
1180
1180
|
return { value: m };
|
|
1181
1181
|
}
|
|
1182
|
-
return { value: N(m).format(
|
|
1182
|
+
return { value: N(m).format(r) };
|
|
1183
1183
|
},
|
|
1184
|
-
normalize: (m) => m ? N(m).format(
|
|
1184
|
+
normalize: (m) => m ? N(m).format(i) : (a?.allowEmpty, void 0),
|
|
1185
1185
|
noStyle: !0,
|
|
1186
|
-
rules:
|
|
1187
|
-
children: /* @__PURE__ */
|
|
1188
|
-
|
|
1186
|
+
rules: n?.rules ?? [],
|
|
1187
|
+
children: /* @__PURE__ */ e(
|
|
1188
|
+
K,
|
|
1189
1189
|
{
|
|
1190
1190
|
...u,
|
|
1191
|
-
ref:
|
|
1191
|
+
ref: h,
|
|
1192
1192
|
onFocus: () => {
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1195
|
-
const m =
|
|
1196
|
-
!(
|
|
1193
|
+
if (f("end"), C(!I), d.current) {
|
|
1194
|
+
d.current.updateValue();
|
|
1195
|
+
const m = d.current.value || "";
|
|
1196
|
+
!(d.current.unmaskedValue || "") && !m.replace(/[^0-9]/g, "") && (d.current.value = "", d.current.updateValue());
|
|
1197
1197
|
}
|
|
1198
1198
|
},
|
|
1199
1199
|
onBlur: () => {
|
|
1200
|
-
|
|
1200
|
+
ne();
|
|
1201
1201
|
},
|
|
1202
1202
|
onKeyDown: (m) => {
|
|
1203
1203
|
if (m.key === "Backspace") {
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1204
|
+
const E = d.current?.value || "", L = d.current?.unmaskedValue || "";
|
|
1205
|
+
if (E === "" || L === "" || E.replace(/[^0-9]/g, "").length <= 1) {
|
|
1206
1206
|
m.preventDefault();
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1209
|
-
|
|
1207
|
+
const k = Array.isArray(l) ? [...l, 1] : [l, 1];
|
|
1208
|
+
p.setFieldValue(k, void 0), S([D[0], null]), d.current && (d.current.value = "", d.current.updateValue()), setTimeout(() => {
|
|
1209
|
+
c.current?.focus(), f("start"), C(!0);
|
|
1210
1210
|
}, 0);
|
|
1211
1211
|
return;
|
|
1212
1212
|
}
|
|
1213
|
-
|
|
1213
|
+
f("end"), C(!0);
|
|
1214
1214
|
}
|
|
1215
1215
|
if (m.key === "Tab" && C(!1), m.key === "Enter")
|
|
1216
|
-
if (
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1216
|
+
if (I && F === "end") {
|
|
1217
|
+
const E = d.current?.value || "";
|
|
1218
|
+
E.length === r.length ? N(E, r, !0).isValid() ? (C(!1), g(!1)) : a?.allowEmpty ? g(!1) : g(!0) : g(!1);
|
|
1219
1219
|
} else
|
|
1220
|
-
|
|
1220
|
+
f("end"), C(!0);
|
|
1221
1221
|
},
|
|
1222
1222
|
style: {
|
|
1223
1223
|
flex: 1
|
|
1224
1224
|
},
|
|
1225
1225
|
allowClear: !0,
|
|
1226
1226
|
onClear: () => {
|
|
1227
|
-
const m = Array.isArray(
|
|
1228
|
-
|
|
1229
|
-
|
|
1227
|
+
const m = Array.isArray(l) ? [...l, 1] : [l, 1];
|
|
1228
|
+
p.setFieldValue(m, void 0), S([D[0], null]), d.current && (d.current.value = "", d.current.updateValue()), setTimeout(() => {
|
|
1229
|
+
c.current?.focus(), f("start"), C(!0);
|
|
1230
1230
|
}, 0);
|
|
1231
1231
|
},
|
|
1232
1232
|
placeholder: o.replace(/0/g, "_"),
|
|
1233
|
-
suffix: /* @__PURE__ */
|
|
1233
|
+
suffix: /* @__PURE__ */ e(pe, { style: { color: "#d9d9d9" } }),
|
|
1234
1234
|
autoComplete: "off"
|
|
1235
1235
|
}
|
|
1236
1236
|
)
|
|
@@ -1239,23 +1239,23 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1239
1239
|
]
|
|
1240
1240
|
}
|
|
1241
1241
|
),
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
|
|
1242
|
+
/* @__PURE__ */ e(
|
|
1243
|
+
bt,
|
|
1244
1244
|
{
|
|
1245
|
-
...
|
|
1246
|
-
open:
|
|
1247
|
-
picker:
|
|
1245
|
+
...a,
|
|
1246
|
+
open: I,
|
|
1247
|
+
picker: t,
|
|
1248
1248
|
format: {
|
|
1249
|
-
format:
|
|
1249
|
+
format: r,
|
|
1250
1250
|
type: "mask"
|
|
1251
1251
|
},
|
|
1252
1252
|
showNow: !0,
|
|
1253
|
-
value:
|
|
1254
|
-
onChange:
|
|
1253
|
+
value: D,
|
|
1254
|
+
onChange: ae,
|
|
1255
1255
|
onOpenChange: (m) => {
|
|
1256
|
-
C(m), m ||
|
|
1256
|
+
C(m), m || ne(!1);
|
|
1257
1257
|
},
|
|
1258
|
-
renderExtraFooter: () =>
|
|
1258
|
+
renderExtraFooter: () => T ? /* @__PURE__ */ O(
|
|
1259
1259
|
"div",
|
|
1260
1260
|
{
|
|
1261
1261
|
style: {
|
|
@@ -1269,8 +1269,8 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1269
1269
|
backgroundColor: "#fffbe6"
|
|
1270
1270
|
},
|
|
1271
1271
|
children: [
|
|
1272
|
-
/* @__PURE__ */
|
|
1273
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ e(Ae, {}),
|
|
1273
|
+
/* @__PURE__ */ e("span", { children: "유효하지 않은 날짜입니다" })
|
|
1274
1274
|
]
|
|
1275
1275
|
}
|
|
1276
1276
|
) : null,
|
|
@@ -1290,46 +1290,46 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1290
1290
|
)
|
|
1291
1291
|
}
|
|
1292
1292
|
);
|
|
1293
|
-
}, { Option:
|
|
1294
|
-
const [u,
|
|
1295
|
-
return
|
|
1296
|
-
|
|
1293
|
+
}, { Option: Se } = Ce, on = ({ itemProps: t, inputProps: n }) => {
|
|
1294
|
+
const [u, a] = P([]);
|
|
1295
|
+
return X(() => {
|
|
1296
|
+
n?.addField === "ALL" ? a([
|
|
1297
1297
|
{ label: "전체", value: "" },
|
|
1298
|
-
...
|
|
1299
|
-
]) :
|
|
1300
|
-
}, [
|
|
1301
|
-
|
|
1298
|
+
...n?.list || []
|
|
1299
|
+
]) : n?.addField === "NULL" ? a([{ label: "", value: "" }, ...n?.list || []]) : a(n?.list || []);
|
|
1300
|
+
}, [n?.list]), /* @__PURE__ */ e(
|
|
1301
|
+
G,
|
|
1302
1302
|
{
|
|
1303
|
-
...
|
|
1304
|
-
getValueProps: (
|
|
1305
|
-
value:
|
|
1303
|
+
...t,
|
|
1304
|
+
getValueProps: (r) => r ? {
|
|
1305
|
+
value: r && r.indexOf(",") > 0 ? r.split(",") : [r]
|
|
1306
1306
|
} : {
|
|
1307
1307
|
value: []
|
|
1308
1308
|
},
|
|
1309
|
-
normalize: (
|
|
1310
|
-
children: /* @__PURE__ */
|
|
1311
|
-
const { value: o, label:
|
|
1312
|
-
return
|
|
1309
|
+
normalize: (r) => r != null && r != null && r.length > 0 ? r.toString() : "",
|
|
1310
|
+
children: /* @__PURE__ */ e(Ce, { ...n, mode: "multiple", children: u.map((r) => {
|
|
1311
|
+
const { value: o, label: i } = r;
|
|
1312
|
+
return n?.printCode ? /* @__PURE__ */ e(Se, { value: o, label: i, children: /* @__PURE__ */ e($, { children: `[${o}] ${i}` }) }, o) : /* @__PURE__ */ e(Se, { value: o, label: i, children: /* @__PURE__ */ e($, { children: `${i}` }) }, o);
|
|
1313
1313
|
}) })
|
|
1314
1314
|
}
|
|
1315
1315
|
);
|
|
1316
|
-
},
|
|
1317
|
-
const u = (
|
|
1318
|
-
let o =
|
|
1319
|
-
return
|
|
1320
|
-
},
|
|
1321
|
-
let o =
|
|
1322
|
-
return
|
|
1316
|
+
}, ln = ({ itemProps: t, inputProps: n }) => {
|
|
1317
|
+
const u = (r) => {
|
|
1318
|
+
let o = r.toString().split(".");
|
|
1319
|
+
return n?.decimalPoint != null && o[1] != null && n?.decimalPoint > 0 ? o[1].length > n?.decimalPoint ? o[1] = "." + o[1].substring(0, n?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + o[1];
|
|
1320
|
+
}, a = (r) => {
|
|
1321
|
+
let o = r.toString().split(".");
|
|
1322
|
+
return n?.decimalPoint != null && o[1] != null && n?.decimalPoint > 0 ? o[1].length > n?.decimalPoint ? o[1] = "." + o[1].substring(0, n?.decimalPoint) : o[1] = "." + o[1] : o[1] = "", o[0].replace(/\$\s?|(,*)/g, "") + o[1];
|
|
1323
1323
|
};
|
|
1324
|
-
return /* @__PURE__ */
|
|
1325
|
-
|
|
1324
|
+
return /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(
|
|
1325
|
+
je,
|
|
1326
1326
|
{
|
|
1327
|
-
...
|
|
1328
|
-
formatter: (
|
|
1329
|
-
parser: (
|
|
1327
|
+
...n,
|
|
1328
|
+
formatter: (r) => u(r),
|
|
1329
|
+
parser: (r) => a(r)
|
|
1330
1330
|
}
|
|
1331
1331
|
) });
|
|
1332
|
-
},
|
|
1332
|
+
}, an = ({ itemProps: t, inputProps: n }) => /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(Xe.Group, { ...n }) }), { RangePicker: Yt } = ue, be = {
|
|
1333
1333
|
year: { displayFormat: "YYYY", outputFormat: "YYYY" },
|
|
1334
1334
|
month: { displayFormat: "YYYY-MM", outputFormat: "YYYYMM" },
|
|
1335
1335
|
date: { displayFormat: "YYYY-MM-DD", outputFormat: "YYYYMMDD" },
|
|
@@ -1338,141 +1338,141 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1338
1338
|
displayFormat: "YYYY-MM-DD HH:mm",
|
|
1339
1339
|
outputFormat: "YYYYMMDDHHmm"
|
|
1340
1340
|
}
|
|
1341
|
-
},
|
|
1342
|
-
itemProps:
|
|
1343
|
-
inputProps:
|
|
1341
|
+
}, sn = ({
|
|
1342
|
+
itemProps: t,
|
|
1343
|
+
inputProps: n,
|
|
1344
1344
|
type: u = "date",
|
|
1345
|
-
minDate:
|
|
1346
|
-
maxDate:
|
|
1345
|
+
minDate: a,
|
|
1346
|
+
maxDate: r,
|
|
1347
1347
|
returnType: o = "string"
|
|
1348
1348
|
}) => {
|
|
1349
|
-
const { displayFormat:
|
|
1350
|
-
() =>
|
|
1349
|
+
const { displayFormat: i, outputFormat: c } = q(
|
|
1350
|
+
() => be[u],
|
|
1351
1351
|
[u]
|
|
1352
|
-
),
|
|
1353
|
-
() => Object.values(
|
|
1354
|
-
if (s.length ===
|
|
1355
|
-
if (s ===
|
|
1356
|
-
if (
|
|
1352
|
+
), h = q(
|
|
1353
|
+
() => Object.values(be).map((s) => s.outputFormat).sort((s, d) => {
|
|
1354
|
+
if (s.length === d.length) {
|
|
1355
|
+
if (s === c) return -1;
|
|
1356
|
+
if (d === c) return 1;
|
|
1357
1357
|
}
|
|
1358
|
-
return
|
|
1358
|
+
return d.length - s.length;
|
|
1359
1359
|
}),
|
|
1360
|
-
[
|
|
1360
|
+
[c]
|
|
1361
1361
|
// type(outputFormat)이 바뀔 때마다 재정렬
|
|
1362
1362
|
);
|
|
1363
|
-
return /* @__PURE__ */
|
|
1364
|
-
|
|
1363
|
+
return /* @__PURE__ */ e(
|
|
1364
|
+
G,
|
|
1365
1365
|
{
|
|
1366
|
-
...
|
|
1366
|
+
...t,
|
|
1367
1367
|
getValueProps: (s) => ({
|
|
1368
1368
|
// 폼에 저장된 값(문자열 또는 Dayjs)을 RangePicker가 요구하는 Dayjs 배열로 변환
|
|
1369
1369
|
value: s && s.length > 0 ? [
|
|
1370
|
-
s[0] ? N.isDayjs(s[0]) ? s[0] : N(s[0],
|
|
1371
|
-
s[1] ? N.isDayjs(s[1]) ? s[1] : N(s[1],
|
|
1370
|
+
s[0] ? N.isDayjs(s[0]) ? s[0] : N(s[0], h) : null,
|
|
1371
|
+
s[1] ? N.isDayjs(s[1]) ? s[1] : N(s[1], h) : null
|
|
1372
1372
|
] : null
|
|
1373
1373
|
}),
|
|
1374
1374
|
normalize: (s) => s ? o === "dayjs" ? [s[0] ?? void 0, s[1] ?? void 0] : [
|
|
1375
|
-
s[0] ? s[0].format(
|
|
1376
|
-
s[1] ? s[1].format(
|
|
1375
|
+
s[0] ? s[0].format(c) : void 0,
|
|
1376
|
+
s[1] ? s[1].format(c) : void 0
|
|
1377
1377
|
] : [void 0, void 0],
|
|
1378
|
-
children: /* @__PURE__ */
|
|
1379
|
-
|
|
1378
|
+
children: /* @__PURE__ */ e(
|
|
1379
|
+
Yt,
|
|
1380
1380
|
{
|
|
1381
|
-
...
|
|
1381
|
+
...n,
|
|
1382
1382
|
order: !0,
|
|
1383
|
-
minDate:
|
|
1384
|
-
maxDate:
|
|
1383
|
+
minDate: a ? N(a, h) : void 0,
|
|
1384
|
+
maxDate: r ? N(r, h) : void 0,
|
|
1385
1385
|
picker: u === "datetime" ? "date" : u,
|
|
1386
|
-
showTime:
|
|
1387
|
-
format:
|
|
1386
|
+
showTime: n?.showTime ?? (u === "datetime" || u === "time"),
|
|
1387
|
+
format: i
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
1390
1390
|
}
|
|
1391
1391
|
);
|
|
1392
|
-
},
|
|
1393
|
-
const
|
|
1394
|
-
callback(
|
|
1395
|
-
Array.isArray(
|
|
1392
|
+
}, Le = K.Search, cn = (t) => {
|
|
1393
|
+
const n = x.useFormInstance(), { openPopup: u } = et(), a = t.itemProps?.name || [], r = t.popupConfig || {
|
|
1394
|
+
callback(i) {
|
|
1395
|
+
Array.isArray(a) && a.length > 1 ? (n.setFieldValue(a[0], i.code), n.setFieldValue(a[1], i.name)) : n.setFieldValue(a, i.code);
|
|
1396
1396
|
}
|
|
1397
1397
|
}, o = {
|
|
1398
|
-
...
|
|
1399
|
-
placeholder: typeof
|
|
1400
|
-
onChange: (
|
|
1401
|
-
Array.isArray(
|
|
1398
|
+
...t,
|
|
1399
|
+
placeholder: typeof t.placeholder == "string" ? t.placeholder : t.placeholder?.[0] || "",
|
|
1400
|
+
onChange: (i) => {
|
|
1401
|
+
Array.isArray(a) && a.length > 1 && n.setFieldValue(a[0], ""), t.onChange?.(i);
|
|
1402
1402
|
},
|
|
1403
|
-
onSearch: (
|
|
1404
|
-
|
|
1403
|
+
onSearch: (i) => {
|
|
1404
|
+
t.popuCd ? u(t.popuCd, t.popupParams, r) : t.onSearch?.(i);
|
|
1405
1405
|
}
|
|
1406
1406
|
};
|
|
1407
|
-
return Array.isArray(
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
|
|
1407
|
+
return Array.isArray(a) && a.length > 1 ? /* @__PURE__ */ e(G, { ...t.itemProps, name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
|
|
1408
|
+
/* @__PURE__ */ e(
|
|
1409
|
+
x.Item,
|
|
1410
1410
|
{
|
|
1411
|
-
name:
|
|
1412
|
-
rules:
|
|
1411
|
+
name: a[0],
|
|
1412
|
+
rules: t.itemProps?.rules,
|
|
1413
1413
|
style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
|
|
1414
1414
|
validateStatus: "",
|
|
1415
1415
|
help: "",
|
|
1416
|
-
children: /* @__PURE__ */
|
|
1417
|
-
|
|
1416
|
+
children: /* @__PURE__ */ e(
|
|
1417
|
+
K,
|
|
1418
1418
|
{
|
|
1419
1419
|
style: { color: "#999", backgroundColor: "#f5f5f5" },
|
|
1420
|
-
placeholder:
|
|
1420
|
+
placeholder: t.placeholder?.[0] || "",
|
|
1421
1421
|
readOnly: !0
|
|
1422
1422
|
}
|
|
1423
1423
|
)
|
|
1424
1424
|
}
|
|
1425
1425
|
),
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
|
|
1426
|
+
/* @__PURE__ */ e(x.Item, { name: a[1], style: { width: "60%", marginBottom: 0 }, children: /* @__PURE__ */ e(
|
|
1427
|
+
Le,
|
|
1428
1428
|
{
|
|
1429
|
-
readOnly:
|
|
1430
|
-
enterButton: /* @__PURE__ */
|
|
1431
|
-
|
|
1429
|
+
readOnly: t.readOnly,
|
|
1430
|
+
enterButton: /* @__PURE__ */ e(
|
|
1431
|
+
ee,
|
|
1432
1432
|
{
|
|
1433
|
-
icon: /* @__PURE__ */
|
|
1434
|
-
disabled:
|
|
1433
|
+
icon: /* @__PURE__ */ e(Fe, {}),
|
|
1434
|
+
disabled: t.readOnly
|
|
1435
1435
|
}
|
|
1436
1436
|
),
|
|
1437
1437
|
...o
|
|
1438
1438
|
}
|
|
1439
1439
|
) })
|
|
1440
|
-
] }) }) : /* @__PURE__ */
|
|
1441
|
-
},
|
|
1442
|
-
itemProps:
|
|
1443
|
-
selectProps:
|
|
1440
|
+
] }) }) : /* @__PURE__ */ e(G, { ...t.itemProps, children: /* @__PURE__ */ e(Le, { ...o }) });
|
|
1441
|
+
}, dn = ({
|
|
1442
|
+
itemProps: t,
|
|
1443
|
+
selectProps: n = {
|
|
1444
1444
|
options: [],
|
|
1445
1445
|
allowClear: !0
|
|
1446
1446
|
}
|
|
1447
1447
|
}) => {
|
|
1448
|
-
const u =
|
|
1449
|
-
|
|
1450
|
-
},
|
|
1451
|
-
...
|
|
1452
|
-
allowClear:
|
|
1453
|
-
options:
|
|
1448
|
+
const u = x.useFormInstance(), a = !!u, r = q(() => n?.addField === "ALL" ? [{ label: "전체", value: "" }, ...n?.options || []] : n?.addField === "NULL" ? [{ label: "", value: "" }, ...n?.options || []] : n?.options || [], [n.options, n.addField]), o = (h) => {
|
|
1449
|
+
n.onChange?.(h);
|
|
1450
|
+
}, i = {
|
|
1451
|
+
...n,
|
|
1452
|
+
allowClear: n.allowClear ?? !0,
|
|
1453
|
+
options: r,
|
|
1454
1454
|
onChange: o,
|
|
1455
|
-
variant:
|
|
1456
|
-
},
|
|
1457
|
-
return
|
|
1455
|
+
variant: n.variant
|
|
1456
|
+
}, c = /* @__PURE__ */ e(Ce, { ...i, disabled: n.disabled });
|
|
1457
|
+
return n.copyable && !a && console.warn(
|
|
1458
1458
|
"BwgSelect: copyable 기능은 Form 컨텍스트 내에서만 사용 가능합니다."
|
|
1459
|
-
),
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
|
|
1459
|
+
), n.copyable ? /* @__PURE__ */ e(G, { ...t, name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
|
|
1460
|
+
/* @__PURE__ */ e(
|
|
1461
|
+
x.Item,
|
|
1462
1462
|
{
|
|
1463
|
-
name:
|
|
1464
|
-
rules:
|
|
1463
|
+
name: t?.name,
|
|
1464
|
+
rules: t?.rules,
|
|
1465
1465
|
style: { width: "100%", marginBottom: 0 },
|
|
1466
1466
|
validateStatus: "",
|
|
1467
1467
|
help: "",
|
|
1468
|
-
children:
|
|
1468
|
+
children: c
|
|
1469
1469
|
}
|
|
1470
1470
|
),
|
|
1471
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ e(
|
|
1472
1472
|
fe.Paragraph,
|
|
1473
1473
|
{
|
|
1474
1474
|
copyable: {
|
|
1475
|
-
text:
|
|
1475
|
+
text: a && u?.getFieldValue(t?.name)?.toString() || "",
|
|
1476
1476
|
tooltips: ["코드복사", "코드복사됨"]
|
|
1477
1477
|
},
|
|
1478
1478
|
style: {
|
|
@@ -1489,99 +1489,99 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
|
-
] }) }) : /* @__PURE__ */
|
|
1493
|
-
},
|
|
1494
|
-
itemProps:
|
|
1495
|
-
inputProps:
|
|
1492
|
+
] }) }) : /* @__PURE__ */ e(G, { ...t, children: c });
|
|
1493
|
+
}, un = ({
|
|
1494
|
+
itemProps: t,
|
|
1495
|
+
inputProps: n = {
|
|
1496
1496
|
format: "YN"
|
|
1497
1497
|
}
|
|
1498
1498
|
}) => {
|
|
1499
|
-
const u =
|
|
1500
|
-
|
|
1499
|
+
const u = x.useFormInstance(), a = (r, o) => {
|
|
1500
|
+
n.format === "boolean" ? u.setFieldValue(t?.name, r) : u.setFieldValue(t?.name, r ? "Y" : "N"), n.onChange && n.onChange(r, o);
|
|
1501
1501
|
};
|
|
1502
|
-
return /* @__PURE__ */
|
|
1503
|
-
|
|
1502
|
+
return /* @__PURE__ */ e(
|
|
1503
|
+
G,
|
|
1504
1504
|
{
|
|
1505
|
-
...
|
|
1506
|
-
getValueProps: (
|
|
1507
|
-
normalize: (
|
|
1508
|
-
children: /* @__PURE__ */
|
|
1505
|
+
...t,
|
|
1506
|
+
getValueProps: (r) => ({ checked: n.format === "boolean" ? !!r : r === "Y" }),
|
|
1507
|
+
normalize: (r) => typeof r == "boolean" ? n.format === "boolean" ? r : r ? "Y" : "N" : n.format === "boolean" ? !!r : r ? "Y" : "N",
|
|
1508
|
+
children: /* @__PURE__ */ e(Ke, { ...n, onChange: (r, o) => a(r, o) })
|
|
1509
1509
|
}
|
|
1510
1510
|
);
|
|
1511
|
-
}, { TextArea:
|
|
1512
|
-
const
|
|
1511
|
+
}, { TextArea: Nt } = K, fn = ({ itemProps: t, inputProps: n }) => /* @__PURE__ */ e(G, { ...t, children: /* @__PURE__ */ e(Nt, { ...n }) }), xt = K.Search, mn = (t) => {
|
|
1512
|
+
const n = x.useFormInstance(), { openCorePopup: u } = Ue(), a = {
|
|
1513
1513
|
value: "deptNm",
|
|
1514
1514
|
fieldName: "deptNm",
|
|
1515
1515
|
placeholder: "부서명"
|
|
1516
|
-
},
|
|
1516
|
+
}, r = {
|
|
1517
1517
|
value: "empNm",
|
|
1518
1518
|
fieldName: "empNm",
|
|
1519
1519
|
placeholder: "사원명 입력"
|
|
1520
|
-
}, o =
|
|
1521
|
-
(
|
|
1522
|
-
|
|
1520
|
+
}, o = t.field1 || a, i = t.field2 || r, c = te(
|
|
1521
|
+
(d) => {
|
|
1522
|
+
n.setFieldValue(t.employeeFieldName || "employee", d), n.setFieldValue(t.empNoFieldName || "empNo", d.empNo ?? ""), n.setFieldValue(
|
|
1523
1523
|
o.fieldName,
|
|
1524
|
-
|
|
1525
|
-
),
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
),
|
|
1524
|
+
d[o.value || "deptNm"] ?? ""
|
|
1525
|
+
), n.setFieldValue(
|
|
1526
|
+
i.fieldName,
|
|
1527
|
+
d[i.value || "empNm"] ?? ""
|
|
1528
|
+
), t.onFinish?.();
|
|
1529
1529
|
},
|
|
1530
|
-
[
|
|
1531
|
-
),
|
|
1532
|
-
(
|
|
1530
|
+
[n, o, i, t.employeeFieldName]
|
|
1531
|
+
), h = te(
|
|
1532
|
+
(d) => {
|
|
1533
1533
|
u("CORE_ORGANIZATION_01", {
|
|
1534
1534
|
onSelect: (y) => {
|
|
1535
|
-
|
|
1535
|
+
c(y);
|
|
1536
1536
|
},
|
|
1537
1537
|
defaultParams: {
|
|
1538
|
-
keyword:
|
|
1538
|
+
keyword: d
|
|
1539
1539
|
}
|
|
1540
1540
|
});
|
|
1541
1541
|
},
|
|
1542
|
-
[
|
|
1543
|
-
), s =
|
|
1544
|
-
async (
|
|
1545
|
-
const y =
|
|
1542
|
+
[c, u]
|
|
1543
|
+
), s = te(
|
|
1544
|
+
async (d) => {
|
|
1545
|
+
const y = d?.trim();
|
|
1546
1546
|
if (y)
|
|
1547
1547
|
try {
|
|
1548
|
-
const
|
|
1548
|
+
const p = await oe(
|
|
1549
1549
|
"SCMUTIL00101",
|
|
1550
1550
|
{
|
|
1551
1551
|
keyword: y
|
|
1552
1552
|
},
|
|
1553
1553
|
{ showLoading: !1 }
|
|
1554
|
-
),
|
|
1555
|
-
if (
|
|
1556
|
-
|
|
1554
|
+
), I = p?.empList || [];
|
|
1555
|
+
if (p?.empCnt === 0) {
|
|
1556
|
+
w.warning(
|
|
1557
1557
|
"일치하는 사원을 찾을 수 없어 팝업을 열립니다. 사원을 선택해주세요."
|
|
1558
|
-
),
|
|
1558
|
+
), h();
|
|
1559
1559
|
return;
|
|
1560
1560
|
}
|
|
1561
|
-
if (
|
|
1562
|
-
|
|
1561
|
+
if (p?.empCnt > 1) {
|
|
1562
|
+
w.info(
|
|
1563
1563
|
"여러 건이 검색되어 팝업이 열립니다. 사원을 선택해주세요."
|
|
1564
|
-
),
|
|
1564
|
+
), h(y);
|
|
1565
1565
|
return;
|
|
1566
1566
|
}
|
|
1567
|
-
const C =
|
|
1568
|
-
|
|
1569
|
-
} catch (
|
|
1570
|
-
console.error("사원 검색 서비스 실패:",
|
|
1567
|
+
const C = I[0];
|
|
1568
|
+
c(C);
|
|
1569
|
+
} catch (p) {
|
|
1570
|
+
console.error("사원 검색 서비스 실패:", p), w.error("사원 검색 중 오류가 발생했습니다.");
|
|
1571
1571
|
}
|
|
1572
1572
|
},
|
|
1573
|
-
[
|
|
1573
|
+
[c, h]
|
|
1574
1574
|
);
|
|
1575
|
-
return /* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
|
|
1575
|
+
return /* @__PURE__ */ e(G, { label: t.label || "사원", name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
|
|
1576
|
+
/* @__PURE__ */ e(
|
|
1577
|
+
x.Item,
|
|
1578
1578
|
{
|
|
1579
1579
|
name: o.fieldName,
|
|
1580
1580
|
style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
|
|
1581
1581
|
validateStatus: "",
|
|
1582
1582
|
help: "",
|
|
1583
|
-
children: /* @__PURE__ */
|
|
1584
|
-
|
|
1583
|
+
children: /* @__PURE__ */ e(
|
|
1584
|
+
K,
|
|
1585
1585
|
{
|
|
1586
1586
|
style: { color: "#999", backgroundColor: "#f5f5f5" },
|
|
1587
1587
|
placeholder: o.placeholder,
|
|
@@ -1590,301 +1590,114 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1590
1590
|
)
|
|
1591
1591
|
}
|
|
1592
1592
|
),
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
|
|
1593
|
+
/* @__PURE__ */ e(
|
|
1594
|
+
x.Item,
|
|
1595
1595
|
{
|
|
1596
|
-
name:
|
|
1596
|
+
name: t.employeeFieldName || "employee",
|
|
1597
1597
|
hidden: !0
|
|
1598
1598
|
}
|
|
1599
1599
|
),
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
|
|
1600
|
+
/* @__PURE__ */ e(x.Item, { name: t.empNoFieldName || "empNo", hidden: !0 }),
|
|
1601
|
+
/* @__PURE__ */ e(
|
|
1602
|
+
x.Item,
|
|
1603
1603
|
{
|
|
1604
|
-
name:
|
|
1604
|
+
name: i.fieldName,
|
|
1605
1605
|
style: { width: "60%", marginBottom: 0 },
|
|
1606
|
-
children: /* @__PURE__ */
|
|
1607
|
-
|
|
1606
|
+
children: /* @__PURE__ */ e(
|
|
1607
|
+
xt,
|
|
1608
1608
|
{
|
|
1609
1609
|
allowClear: !0,
|
|
1610
|
-
readOnly:
|
|
1611
|
-
placeholder:
|
|
1612
|
-
enterButton: /* @__PURE__ */
|
|
1613
|
-
|
|
1610
|
+
readOnly: t.readOnly,
|
|
1611
|
+
placeholder: i.placeholder,
|
|
1612
|
+
enterButton: /* @__PURE__ */ e(
|
|
1613
|
+
ee,
|
|
1614
1614
|
{
|
|
1615
|
-
icon: /* @__PURE__ */
|
|
1616
|
-
disabled:
|
|
1615
|
+
icon: /* @__PURE__ */ e(Fe, {}),
|
|
1616
|
+
disabled: t.readOnly,
|
|
1617
1617
|
onClick: () => {
|
|
1618
|
-
|
|
1618
|
+
h();
|
|
1619
1619
|
}
|
|
1620
1620
|
}
|
|
1621
1621
|
),
|
|
1622
1622
|
onSearch: s,
|
|
1623
|
-
onChange: (
|
|
1624
|
-
|
|
1623
|
+
onChange: (d) => {
|
|
1624
|
+
n.setFieldValue(o.fieldName, ""), n.setFieldValue(t.employeeFieldName || "employee", null), n.setFieldValue(t.empNoFieldName || "empNo", "");
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
1627
|
)
|
|
1628
1628
|
}
|
|
1629
1629
|
)
|
|
1630
1630
|
] }) });
|
|
1631
|
-
},
|
|
1632
|
-
|
|
1633
|
-
UPLOADING: "uploading",
|
|
1634
|
-
UPLOADED: "uploaded",
|
|
1635
|
-
EXECUTING: "executing",
|
|
1636
|
-
COMPLETED: "completed",
|
|
1637
|
-
FAILED: "failed"
|
|
1638
|
-
}, Nt = {
|
|
1639
|
-
[v.IDLE]: "엑셀 파일을 선택해 업로드 해 주세요. (xlsx, xls, csv만 가능)",
|
|
1640
|
-
[v.UPLOADING]: "엑셀 업로드 중입니다. 잠시만 기다려 주세요.",
|
|
1641
|
-
[v.UPLOADED]: "엑셀 업로드가 완료되었습니다.",
|
|
1642
|
-
[v.EXECUTING]: "배치 작업 실행 중입니다. 잠시만 기다려 주세요.",
|
|
1643
|
-
[v.COMPLETED]: "배치 작업이 완료되었습니다.",
|
|
1644
|
-
[v.FAILED]: "배치 작업이 실패했습니다."
|
|
1645
|
-
}, un = ({
|
|
1646
|
-
label: e = "엑셀 업로드",
|
|
1647
|
-
jobId: r,
|
|
1648
|
-
extraParams: u,
|
|
1649
|
-
onFinish: l,
|
|
1650
|
-
disabled: n = !1
|
|
1651
|
-
}) => {
|
|
1652
|
-
const [o, d] = z(v.IDLE), [i, f] = z(null), [s, c] = z(null), y = Q(async () => {
|
|
1653
|
-
if (!(!i || !s)) {
|
|
1654
|
-
if (!r) {
|
|
1655
|
-
x.warning("실행 job id(jobId)가 설정되어 있지 않습니다.");
|
|
1656
|
-
return;
|
|
1657
|
-
}
|
|
1658
|
-
try {
|
|
1659
|
-
if (!s.filePath) {
|
|
1660
|
-
x.error("파일 URL 정보가 없습니다.");
|
|
1661
|
-
return;
|
|
1662
|
-
}
|
|
1663
|
-
d(v.EXECUTING);
|
|
1664
|
-
const p = {
|
|
1665
|
-
crprCd: Ne(),
|
|
1666
|
-
sysCd: window.__SYS_CD__ || "",
|
|
1667
|
-
fileKey: s.fileKey,
|
|
1668
|
-
filePath: s.filePath,
|
|
1669
|
-
jobId: r
|
|
1670
|
-
}, E = await te("SCMUTIL00301", {
|
|
1671
|
-
...p,
|
|
1672
|
-
...u
|
|
1673
|
-
});
|
|
1674
|
-
E?.success ? (g(), x.success(
|
|
1675
|
-
E?.message || "배치 실행 요청이 성공적으로 완료되었습니다."
|
|
1676
|
-
)) : (d(v.FAILED), x.error(E?.message || "배치 실행 요청에 실패했습니다."));
|
|
1677
|
-
} catch (p) {
|
|
1678
|
-
console.error("배치 실행 요청에 실패했습니다.", p), x.error("배치 실행 요청에 실패했습니다."), d(v.FAILED);
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
}, [i, s, r, u]), g = Q(async () => {
|
|
1682
|
-
setTimeout(async () => {
|
|
1683
|
-
try {
|
|
1684
|
-
const p = await te("SCMUTIL00302", {
|
|
1685
|
-
jobId: r
|
|
1686
|
-
});
|
|
1687
|
-
if (p?.status === "COMPLETED") {
|
|
1688
|
-
d(v.COMPLETED), x.success("배치 작업이 완료되었습니다."), l?.();
|
|
1689
|
-
return;
|
|
1690
|
-
} else if (p?.status === "FAILED") {
|
|
1691
|
-
d(v.FAILED), x.error("배치 작업이 실패했습니다.");
|
|
1692
|
-
return;
|
|
1693
|
-
} else {
|
|
1694
|
-
setTimeout(g, 1e3);
|
|
1695
|
-
return;
|
|
1696
|
-
}
|
|
1697
|
-
} catch (p) {
|
|
1698
|
-
console.error("배치 작업 상태 확인 오류:", p), d(v.FAILED), x.error("배치 작업 상태 확인 중 오류가 발생했습니다.");
|
|
1699
|
-
}
|
|
1700
|
-
}, 3e3);
|
|
1701
|
-
}, [r, l]), Y = q(
|
|
1702
|
-
() => ({
|
|
1703
|
-
name: "file",
|
|
1704
|
-
accept: ".xlsx, .xls, .csv",
|
|
1705
|
-
listType: "picture",
|
|
1706
|
-
multiple: !1,
|
|
1707
|
-
action: "/api/upload",
|
|
1708
|
-
showUploadList: {
|
|
1709
|
-
showRemoveIcon: !0
|
|
1710
|
-
},
|
|
1711
|
-
beforeUpload: (p) => {
|
|
1712
|
-
const E = `.${p.name.split(".").pop()?.toLowerCase()}`;
|
|
1713
|
-
if (![".xlsx", ".xls", ".csv"].includes(E))
|
|
1714
|
-
return x.error(
|
|
1715
|
-
`${p.name} 파일은 허용되지 않는 확장자입니다. (xlsx, xls, csv만 가능)`
|
|
1716
|
-
), ee.LIST_IGNORE;
|
|
1717
|
-
},
|
|
1718
|
-
onChange: (p) => {
|
|
1719
|
-
const { status: E } = p.file;
|
|
1720
|
-
if (E === "removed") {
|
|
1721
|
-
f(null), d(v.IDLE), c(null);
|
|
1722
|
-
return;
|
|
1723
|
-
}
|
|
1724
|
-
if (f(p.file), E === "uploading") {
|
|
1725
|
-
d(v.UPLOADING);
|
|
1726
|
-
return;
|
|
1727
|
-
}
|
|
1728
|
-
if (E === "done") {
|
|
1729
|
-
if (p.file.response?.success) {
|
|
1730
|
-
d(v.UPLOADED);
|
|
1731
|
-
const h = p.file.response.uploadedFiles[0] || {};
|
|
1732
|
-
c({
|
|
1733
|
-
fileKey: h.fileKey,
|
|
1734
|
-
filePath: h.filePath,
|
|
1735
|
-
fileNameL: h.fileNameL,
|
|
1736
|
-
fileNameP: h.fileNameP,
|
|
1737
|
-
fileSize: h.fileSize,
|
|
1738
|
-
fileExt: h.fileExt
|
|
1739
|
-
});
|
|
1740
|
-
} else
|
|
1741
|
-
d(v.IDLE), x.error(
|
|
1742
|
-
p.file.response?.message || `${p.file.name} 파일 업로드에 실패했습니다.`
|
|
1743
|
-
);
|
|
1744
|
-
return;
|
|
1745
|
-
}
|
|
1746
|
-
E === "error" && (d(v.IDLE), x.error(
|
|
1747
|
-
p.file.response?.message || `${p.file.name} 파일 업로드 중 오류가 발생했습니다.`
|
|
1748
|
-
));
|
|
1749
|
-
}
|
|
1750
|
-
}),
|
|
1751
|
-
[]
|
|
1752
|
-
), C = q(
|
|
1753
|
-
() => /* @__PURE__ */ T(j, { direction: "vertical", style: { width: 400 }, children: [
|
|
1754
|
-
/* @__PURE__ */ T(j, { children: [
|
|
1755
|
-
o === v.EXECUTING && /* @__PURE__ */ t(Ee, { size: "small" }),
|
|
1756
|
-
/* @__PURE__ */ t(Se, { type: o === v.FAILED ? "danger" : "secondary", children: Nt[o] })
|
|
1757
|
-
] }),
|
|
1758
|
-
o !== v.EXECUTING && o !== v.COMPLETED && o !== v.FAILED && /* @__PURE__ */ t(ee, { ...Y, children: !i && /* @__PURE__ */ t(oe, { icon: /* @__PURE__ */ t(ae, {}), children: "파일 선택" }) }),
|
|
1759
|
-
o === v.UPLOADED && /* @__PURE__ */ t(j, { direction: "vertical", children: /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
|
|
1760
|
-
oe,
|
|
1761
|
-
{
|
|
1762
|
-
type: "primary",
|
|
1763
|
-
icon: /* @__PURE__ */ t(rt, {}),
|
|
1764
|
-
onClick: y,
|
|
1765
|
-
disabled: !i,
|
|
1766
|
-
children: "실행하기"
|
|
1767
|
-
}
|
|
1768
|
-
) }) }),
|
|
1769
|
-
(o === v.COMPLETED || o === v.FAILED) && /* @__PURE__ */ t(j, { direction: "vertical", children: /* @__PURE__ */ T(j, { children: [
|
|
1770
|
-
/* @__PURE__ */ t(oe, { icon: /* @__PURE__ */ t(ot, {}), onClick: y, children: "다시 실행하기" }),
|
|
1771
|
-
/* @__PURE__ */ t(
|
|
1772
|
-
oe,
|
|
1773
|
-
{
|
|
1774
|
-
icon: /* @__PURE__ */ t(ae, {}),
|
|
1775
|
-
onClick: () => {
|
|
1776
|
-
d(v.IDLE), f(null), c(null);
|
|
1777
|
-
},
|
|
1778
|
-
children: "다른 파일 업로드"
|
|
1779
|
-
}
|
|
1780
|
-
)
|
|
1781
|
-
] }) })
|
|
1782
|
-
] }),
|
|
1783
|
-
[o, i, y, Y]
|
|
1784
|
-
), O = /* @__PURE__ */ t(oe, { icon: /* @__PURE__ */ t(ae, {}), disabled: n, children: e });
|
|
1785
|
-
return n ? /* @__PURE__ */ t(
|
|
1786
|
-
Fe,
|
|
1787
|
-
{
|
|
1788
|
-
title: /* @__PURE__ */ T("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1789
|
-
/* @__PURE__ */ t(at, { style: { color: "#faad14", fontSize: 16 } }),
|
|
1790
|
-
/* @__PURE__ */ t("span", { style: { fontWeight: 600 }, children: "'엑셀 업로드' 버튼에 대한 사용 권한이 없습니다." })
|
|
1791
|
-
] }),
|
|
1792
|
-
content: /* @__PURE__ */ t(
|
|
1793
|
-
"div",
|
|
1794
|
-
{
|
|
1795
|
-
style: {
|
|
1796
|
-
display: "flex",
|
|
1797
|
-
flexDirection: "column",
|
|
1798
|
-
gap: 4,
|
|
1799
|
-
paddingLeft: 24
|
|
1800
|
-
},
|
|
1801
|
-
children: /* @__PURE__ */ t("span", { style: { fontSize: 12 }, children: "관리자에게 문의하세요." })
|
|
1802
|
-
}
|
|
1803
|
-
),
|
|
1804
|
-
placement: "bottom",
|
|
1805
|
-
styles: { body: { backgroundColor: "#fffbe6" } },
|
|
1806
|
-
children: /* @__PURE__ */ t("span", { children: O })
|
|
1807
|
-
}
|
|
1808
|
-
) : /* @__PURE__ */ t(
|
|
1809
|
-
Fe,
|
|
1810
|
-
{
|
|
1811
|
-
content: C,
|
|
1812
|
-
title: /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", marginBottom: 0 }, children: /* @__PURE__ */ t(Se, { strong: !0, children: "엑셀 업로드" }) }),
|
|
1813
|
-
trigger: "click",
|
|
1814
|
-
placement: "bottom",
|
|
1815
|
-
children: O
|
|
1816
|
-
}
|
|
1817
|
-
);
|
|
1818
|
-
}, vt = X.Search, mn = (e) => {
|
|
1819
|
-
const r = D.useFormInstance(), { openCorePopup: u } = Le(), l = {
|
|
1631
|
+
}, Vt = K.Search, hn = (t) => {
|
|
1632
|
+
const n = x.useFormInstance(), { openCorePopup: u } = Ue(), a = {
|
|
1820
1633
|
value: "deptNm",
|
|
1821
1634
|
fieldName: "deptNm",
|
|
1822
1635
|
placeholder: "부서명"
|
|
1823
|
-
},
|
|
1824
|
-
(
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
),
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
),
|
|
1636
|
+
}, r = t.field || a, o = te(
|
|
1637
|
+
(h) => {
|
|
1638
|
+
n.setFieldValue(t.departmentFieldName || "department", h), n.setFieldValue(
|
|
1639
|
+
r.fieldName,
|
|
1640
|
+
h[r.value || "deptNm"] ?? ""
|
|
1641
|
+
), n.setFieldValue(
|
|
1642
|
+
t.deptCdFieldName || "deptCd",
|
|
1643
|
+
h.deptCd ?? ""
|
|
1644
|
+
), t.onFinish?.();
|
|
1832
1645
|
},
|
|
1833
|
-
[
|
|
1834
|
-
),
|
|
1835
|
-
(
|
|
1646
|
+
[n, r, t.departmentFieldName, t.deptCdFieldName]
|
|
1647
|
+
), i = te(
|
|
1648
|
+
(h) => {
|
|
1836
1649
|
u("CORE_DEPARTMENT_01", {
|
|
1837
1650
|
onSelect: (s) => {
|
|
1838
1651
|
o(s);
|
|
1839
1652
|
},
|
|
1840
1653
|
defaultParams: {
|
|
1841
|
-
keyword:
|
|
1654
|
+
keyword: h
|
|
1842
1655
|
}
|
|
1843
1656
|
});
|
|
1844
1657
|
},
|
|
1845
1658
|
[o, u]
|
|
1846
|
-
),
|
|
1847
|
-
async (
|
|
1848
|
-
const s =
|
|
1659
|
+
), c = te(
|
|
1660
|
+
async (h) => {
|
|
1661
|
+
const s = h?.trim();
|
|
1849
1662
|
if (s)
|
|
1850
1663
|
try {
|
|
1851
|
-
const
|
|
1664
|
+
const d = await oe(
|
|
1852
1665
|
"SCMUTIL00103",
|
|
1853
1666
|
{
|
|
1854
1667
|
keyword: s
|
|
1855
1668
|
},
|
|
1856
1669
|
{ showLoading: !1 }
|
|
1857
|
-
), y =
|
|
1858
|
-
if (y === 0 ||
|
|
1859
|
-
|
|
1670
|
+
), y = d?.deptCnt ?? 0, p = d?.deptList || [];
|
|
1671
|
+
if (y === 0 || p.length === 0) {
|
|
1672
|
+
w.warning(
|
|
1860
1673
|
"일치하는 부서를 찾을 수 없어 팝업을 열립니다. 부서를 선택해주세요."
|
|
1861
|
-
),
|
|
1674
|
+
), i(s);
|
|
1862
1675
|
return;
|
|
1863
1676
|
}
|
|
1864
|
-
if (y > 1 ||
|
|
1865
|
-
|
|
1677
|
+
if (y > 1 || p.length > 1) {
|
|
1678
|
+
w.info(
|
|
1866
1679
|
"여러 건이 검색되어 팝업이 열립니다. 부서를 선택해주세요."
|
|
1867
|
-
),
|
|
1680
|
+
), i(s);
|
|
1868
1681
|
return;
|
|
1869
1682
|
}
|
|
1870
|
-
const
|
|
1871
|
-
o(
|
|
1872
|
-
} catch (
|
|
1873
|
-
console.error("부서 검색 서비스 실패:",
|
|
1683
|
+
const I = p[0];
|
|
1684
|
+
o(I);
|
|
1685
|
+
} catch (d) {
|
|
1686
|
+
console.error("부서 검색 서비스 실패:", d), w.error("부서 검색 중 오류가 발생했습니다.");
|
|
1874
1687
|
}
|
|
1875
1688
|
},
|
|
1876
|
-
[o,
|
|
1689
|
+
[o, i]
|
|
1877
1690
|
);
|
|
1878
|
-
return /* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
1880
|
-
|
|
1691
|
+
return /* @__PURE__ */ e(G, { label: t.label || "부서", name: void 0, children: /* @__PURE__ */ O($.Compact, { block: !0, children: [
|
|
1692
|
+
/* @__PURE__ */ e(
|
|
1693
|
+
x.Item,
|
|
1881
1694
|
{
|
|
1882
|
-
name:
|
|
1695
|
+
name: t.deptCdFieldName || "deptCd",
|
|
1883
1696
|
style: { width: "40%", marginBottom: 0, marginInlineEnd: 0 },
|
|
1884
1697
|
validateStatus: "",
|
|
1885
1698
|
help: "",
|
|
1886
|
-
children: /* @__PURE__ */
|
|
1887
|
-
|
|
1699
|
+
children: /* @__PURE__ */ e(
|
|
1700
|
+
K,
|
|
1888
1701
|
{
|
|
1889
1702
|
style: { color: "#999", backgroundColor: "#f5f5f5" },
|
|
1890
1703
|
placeholder: "부서코드",
|
|
@@ -1893,38 +1706,38 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1893
1706
|
)
|
|
1894
1707
|
}
|
|
1895
1708
|
),
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
|
|
1709
|
+
/* @__PURE__ */ e(
|
|
1710
|
+
x.Item,
|
|
1898
1711
|
{
|
|
1899
|
-
name:
|
|
1712
|
+
name: t.departmentFieldName || "department",
|
|
1900
1713
|
hidden: !0
|
|
1901
1714
|
}
|
|
1902
1715
|
),
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
|
|
1716
|
+
/* @__PURE__ */ e(
|
|
1717
|
+
x.Item,
|
|
1905
1718
|
{
|
|
1906
|
-
name:
|
|
1719
|
+
name: r.fieldName,
|
|
1907
1720
|
style: { width: "60%", marginBottom: 0 },
|
|
1908
|
-
children: /* @__PURE__ */
|
|
1909
|
-
|
|
1721
|
+
children: /* @__PURE__ */ e(
|
|
1722
|
+
Vt,
|
|
1910
1723
|
{
|
|
1911
1724
|
allowClear: !0,
|
|
1912
|
-
readOnly:
|
|
1913
|
-
placeholder:
|
|
1914
|
-
enterButton: /* @__PURE__ */
|
|
1915
|
-
|
|
1725
|
+
readOnly: t.readOnly,
|
|
1726
|
+
placeholder: r.placeholder,
|
|
1727
|
+
enterButton: /* @__PURE__ */ e(
|
|
1728
|
+
ee,
|
|
1916
1729
|
{
|
|
1917
|
-
icon: /* @__PURE__ */
|
|
1918
|
-
disabled:
|
|
1730
|
+
icon: /* @__PURE__ */ e(Fe, {}),
|
|
1731
|
+
disabled: t.readOnly,
|
|
1919
1732
|
onClick: () => {
|
|
1920
|
-
|
|
1733
|
+
i();
|
|
1921
1734
|
}
|
|
1922
1735
|
}
|
|
1923
1736
|
),
|
|
1924
|
-
onSearch:
|
|
1925
|
-
onChange: (
|
|
1926
|
-
|
|
1927
|
-
|
|
1737
|
+
onSearch: c,
|
|
1738
|
+
onChange: (h) => {
|
|
1739
|
+
n.setFieldValue(t.deptCdFieldName || "deptCd", ""), n.setFieldValue(
|
|
1740
|
+
t.departmentFieldName || "department",
|
|
1928
1741
|
null
|
|
1929
1742
|
);
|
|
1930
1743
|
}
|
|
@@ -1933,54 +1746,54 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1933
1746
|
}
|
|
1934
1747
|
)
|
|
1935
1748
|
] }) });
|
|
1936
|
-
},
|
|
1937
|
-
originNode:
|
|
1938
|
-
file:
|
|
1749
|
+
}, At = ({
|
|
1750
|
+
originNode: t,
|
|
1751
|
+
file: n,
|
|
1939
1752
|
fileList: u,
|
|
1940
|
-
moveFile:
|
|
1941
|
-
onDrop:
|
|
1753
|
+
moveFile: a,
|
|
1754
|
+
onDrop: r
|
|
1942
1755
|
}) => {
|
|
1943
|
-
const o =
|
|
1756
|
+
const o = J(null), [{ handlerId: i }, c] = yt({
|
|
1944
1757
|
accept: "file",
|
|
1945
1758
|
collect: (y) => ({
|
|
1946
1759
|
handlerId: y.getHandlerId()
|
|
1947
1760
|
}),
|
|
1948
|
-
hover(y,
|
|
1761
|
+
hover(y, p) {
|
|
1949
1762
|
if (!o.current)
|
|
1950
1763
|
return;
|
|
1951
|
-
const
|
|
1952
|
-
if (
|
|
1764
|
+
const I = y.uid, C = n.uid;
|
|
1765
|
+
if (I === C)
|
|
1953
1766
|
return;
|
|
1954
|
-
const
|
|
1955
|
-
if (
|
|
1767
|
+
const T = me(u, { uid: C }), g = me(u, { uid: I });
|
|
1768
|
+
if (g === -1 || T === -1)
|
|
1956
1769
|
return;
|
|
1957
|
-
const
|
|
1958
|
-
if (!
|
|
1770
|
+
const F = o.current.getBoundingClientRect(), f = p.getClientOffset();
|
|
1771
|
+
if (!f)
|
|
1959
1772
|
return;
|
|
1960
|
-
const
|
|
1961
|
-
|
|
1773
|
+
const v = (F.bottom - F.top) / 2, Y = f.y - F.top;
|
|
1774
|
+
g < T && Y < v || g > T && Y > v || a(I, C);
|
|
1962
1775
|
},
|
|
1963
1776
|
drop() {
|
|
1964
|
-
|
|
1777
|
+
r();
|
|
1965
1778
|
}
|
|
1966
|
-
}), [{ isDragging:
|
|
1779
|
+
}), [{ isDragging: h }, s] = Ct({
|
|
1967
1780
|
type: "file",
|
|
1968
1781
|
item: () => ({
|
|
1969
|
-
uid:
|
|
1970
|
-
index:
|
|
1782
|
+
uid: n.uid,
|
|
1783
|
+
index: me(u, { uid: n.uid })
|
|
1971
1784
|
}),
|
|
1972
1785
|
collect: (y) => ({
|
|
1973
1786
|
isDragging: y.isDragging()
|
|
1974
1787
|
})
|
|
1975
|
-
}),
|
|
1976
|
-
return s(
|
|
1977
|
-
},
|
|
1978
|
-
const o = u[0]?.uid ===
|
|
1979
|
-
href:
|
|
1788
|
+
}), d = h ? 0 : 1;
|
|
1789
|
+
return s(c(o)), /* @__PURE__ */ e("div", { ref: o, style: { opacity: d }, "data-handler-id": i, children: t });
|
|
1790
|
+
}, ze = (t, n, u, a, r) => {
|
|
1791
|
+
const o = u[0]?.uid === n.uid, i = Ze(t, {
|
|
1792
|
+
href: n.url || void 0,
|
|
1980
1793
|
title: void 0
|
|
1981
1794
|
});
|
|
1982
|
-
return /* @__PURE__ */
|
|
1983
|
-
o && /* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ O($e, { children: [
|
|
1796
|
+
o && /* @__PURE__ */ O(
|
|
1984
1797
|
"div",
|
|
1985
1798
|
{
|
|
1986
1799
|
style: {
|
|
@@ -1995,138 +1808,497 @@ const qt = ({ itemProps: e, inputProps: r }) => /* @__PURE__ */ t(R, { ...e, chi
|
|
|
1995
1808
|
]
|
|
1996
1809
|
}
|
|
1997
1810
|
),
|
|
1998
|
-
/* @__PURE__ */
|
|
1999
|
-
|
|
1811
|
+
/* @__PURE__ */ e(
|
|
1812
|
+
At,
|
|
2000
1813
|
{
|
|
2001
|
-
originNode:
|
|
2002
|
-
file:
|
|
1814
|
+
originNode: i,
|
|
1815
|
+
file: n,
|
|
2003
1816
|
fileList: u,
|
|
2004
|
-
moveFile:
|
|
2005
|
-
onDrop:
|
|
1817
|
+
moveFile: a,
|
|
1818
|
+
onDrop: r
|
|
2006
1819
|
}
|
|
2007
1820
|
)
|
|
2008
1821
|
] });
|
|
2009
|
-
},
|
|
2010
|
-
const u = String(
|
|
2011
|
-
return u.startsWith("picture") ?
|
|
2012
|
-
},
|
|
2013
|
-
listType:
|
|
2014
|
-
buttonText:
|
|
1822
|
+
}, Re = (t, n) => {
|
|
1823
|
+
const u = String(n || "");
|
|
1824
|
+
return u.startsWith("picture") ? t.name.endsWith(".pdf") ? /* @__PURE__ */ e(it, {}) : t.name.endsWith(".docx") || t.name.endsWith(".doc") ? /* @__PURE__ */ e(ct, {}) : t.name.endsWith(".xlsx") || t.name.endsWith(".xls") ? /* @__PURE__ */ e(dt, {}) : t.name.endsWith(".pptx") || t.name.endsWith(".ppt") ? /* @__PURE__ */ e(ut, {}) : /* @__PURE__ */ e(ft, {}) : u.startsWith("text") ? /* @__PURE__ */ e(mt, {}) : /* @__PURE__ */ e(ht, {});
|
|
1825
|
+
}, pn = ({
|
|
1826
|
+
listType: t = "picture",
|
|
1827
|
+
buttonText: n = "파일 선택",
|
|
2015
1828
|
permissions: u,
|
|
2016
|
-
multiple:
|
|
2017
|
-
fileGrpKey:
|
|
1829
|
+
multiple: a = !1,
|
|
1830
|
+
fileGrpKey: r,
|
|
2018
1831
|
uploadProps: o,
|
|
2019
|
-
heights:
|
|
2020
|
-
...
|
|
1832
|
+
heights: i,
|
|
1833
|
+
...c
|
|
2021
1834
|
}) => {
|
|
2022
1835
|
const {
|
|
2023
|
-
defaultUploadProps:
|
|
1836
|
+
defaultUploadProps: h,
|
|
2024
1837
|
fileList: s,
|
|
2025
|
-
fetchFileList:
|
|
1838
|
+
fetchFileList: d,
|
|
2026
1839
|
reorderFiles: y,
|
|
2027
|
-
saveFileOrder:
|
|
2028
|
-
} =
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
}, [
|
|
2032
|
-
const
|
|
2033
|
-
...
|
|
2034
|
-
listType:
|
|
1840
|
+
saveFileOrder: p
|
|
1841
|
+
} = Be({ multiple: a, fileGrpKey: r, ...c });
|
|
1842
|
+
X(() => {
|
|
1843
|
+
r && d();
|
|
1844
|
+
}, [r]);
|
|
1845
|
+
const I = !!u?.fileAdd, C = {
|
|
1846
|
+
...h,
|
|
1847
|
+
listType: t,
|
|
2035
1848
|
styles: {
|
|
2036
|
-
root: { height:
|
|
2037
|
-
list: { height:
|
|
1849
|
+
root: { height: i?.root },
|
|
1850
|
+
list: { height: i?.list }
|
|
2038
1851
|
},
|
|
2039
|
-
iconRender:
|
|
2040
|
-
itemRender(
|
|
2041
|
-
return
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
1852
|
+
iconRender: Re,
|
|
1853
|
+
itemRender(T, g, F) {
|
|
1854
|
+
return ze(
|
|
1855
|
+
T,
|
|
1856
|
+
g,
|
|
1857
|
+
F,
|
|
2045
1858
|
y,
|
|
2046
|
-
|
|
1859
|
+
p
|
|
2047
1860
|
);
|
|
2048
1861
|
},
|
|
2049
1862
|
...o
|
|
2050
1863
|
};
|
|
2051
|
-
return /* @__PURE__ */
|
|
2052
|
-
|
|
1864
|
+
return /* @__PURE__ */ e(Pe, { backend: _e, children: /* @__PURE__ */ e(
|
|
1865
|
+
Q,
|
|
2053
1866
|
{
|
|
2054
1867
|
headers: { SYSCD: __SYS_CD__ },
|
|
2055
|
-
style: { height:
|
|
1868
|
+
style: { height: i?.root },
|
|
2056
1869
|
...C,
|
|
2057
|
-
children:
|
|
1870
|
+
children: I && a || (I && !a || s.length === 0) && /* @__PURE__ */ e(ee, { icon: /* @__PURE__ */ e(re, {}), children: n })
|
|
2058
1871
|
}
|
|
2059
1872
|
) });
|
|
2060
|
-
},
|
|
2061
|
-
listType:
|
|
2062
|
-
permissions:
|
|
1873
|
+
}, gn = ({
|
|
1874
|
+
listType: t = "picture",
|
|
1875
|
+
permissions: n,
|
|
2063
1876
|
multiple: u = !1,
|
|
2064
|
-
fileGrpKey:
|
|
2065
|
-
uploadProps:
|
|
1877
|
+
fileGrpKey: a,
|
|
1878
|
+
uploadProps: r,
|
|
2066
1879
|
heights: o,
|
|
2067
|
-
...
|
|
1880
|
+
...i
|
|
2068
1881
|
}) => {
|
|
2069
|
-
const { defaultUploadProps:
|
|
2070
|
-
...
|
|
2071
|
-
listType:
|
|
1882
|
+
const { defaultUploadProps: c, fetchFileList: h, reorderFiles: s, saveFileOrder: d } = Be({ multiple: u, fileGrpKey: a, ...i }), y = {
|
|
1883
|
+
...c,
|
|
1884
|
+
listType: t,
|
|
2072
1885
|
// styles: {
|
|
2073
1886
|
// root: { height: heights?.root },
|
|
2074
1887
|
// list: { height: heights?.list, overflowY: 'auto' },
|
|
2075
1888
|
// },
|
|
2076
|
-
iconRender:
|
|
2077
|
-
itemRender(
|
|
2078
|
-
return
|
|
2079
|
-
|
|
2080
|
-
|
|
1889
|
+
iconRender: Re,
|
|
1890
|
+
itemRender(p, I, C) {
|
|
1891
|
+
return ze(
|
|
1892
|
+
p,
|
|
1893
|
+
I,
|
|
2081
1894
|
C,
|
|
2082
1895
|
s,
|
|
2083
|
-
|
|
1896
|
+
d
|
|
2084
1897
|
);
|
|
2085
1898
|
},
|
|
2086
|
-
...
|
|
1899
|
+
...r
|
|
2087
1900
|
};
|
|
2088
|
-
return
|
|
2089
|
-
|
|
2090
|
-
}, [
|
|
2091
|
-
|
|
1901
|
+
return X(() => {
|
|
1902
|
+
a && h();
|
|
1903
|
+
}, [a]), /* @__PURE__ */ e(Pe, { backend: _e, children: /* @__PURE__ */ O(
|
|
1904
|
+
Ft,
|
|
2092
1905
|
{
|
|
2093
1906
|
style: { marginBottom: 10 },
|
|
2094
1907
|
height: o?.dragger || 100,
|
|
2095
1908
|
...y,
|
|
2096
1909
|
children: [
|
|
2097
|
-
/* @__PURE__ */
|
|
2098
|
-
/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ e("p", { className: "ant-upload-drag-icon", style: { marginBottom: 10 }, children: /* @__PURE__ */ e(Ve, { style: { fontSize: 25 } }) }),
|
|
1911
|
+
/* @__PURE__ */ e("p", { className: "ant-upload-hint", children: "첨부할 파일을 여기에 끌어다 놓거나, 영역을 클릭하여 파일을 직접 선택해주세요." })
|
|
2099
1912
|
]
|
|
2100
1913
|
}
|
|
2101
1914
|
) });
|
|
1915
|
+
}, { Text: Ye } = fe, A = {
|
|
1916
|
+
IDLE: "idle",
|
|
1917
|
+
UPLOADING: "uploading",
|
|
1918
|
+
UPLOADED: "uploaded",
|
|
1919
|
+
EXECUTING: "executing",
|
|
1920
|
+
COMPLETED: "completed",
|
|
1921
|
+
FAILED: "failed"
|
|
1922
|
+
}, vt = {
|
|
1923
|
+
[A.IDLE]: "엑셀 파일을 선택해 업로드 해 주세요. (xlsx, xls, csv만 가능)",
|
|
1924
|
+
[A.UPLOADING]: "엑셀 업로드 중입니다. 잠시만 기다려 주세요.",
|
|
1925
|
+
[A.UPLOADED]: "엑셀 업로드가 완료되었습니다.",
|
|
1926
|
+
[A.EXECUTING]: "배치 작업 실행 중입니다. 잠시만 기다려 주세요.",
|
|
1927
|
+
[A.COMPLETED]: "배치 작업이 완료되었습니다.",
|
|
1928
|
+
[A.FAILED]: "배치 작업이 실패했습니다."
|
|
1929
|
+
}, yn = ({
|
|
1930
|
+
label: t = "엑셀 업로드",
|
|
1931
|
+
jobId: n,
|
|
1932
|
+
extraParams: u,
|
|
1933
|
+
onFinish: a,
|
|
1934
|
+
disabled: r = !1
|
|
1935
|
+
}) => {
|
|
1936
|
+
const [o, i] = P(A.IDLE), [c, h] = P(null), [s, d] = P(null), y = te(async () => {
|
|
1937
|
+
if (!(!c || !s)) {
|
|
1938
|
+
if (!n) {
|
|
1939
|
+
w.warning("실행 job id(jobId)가 설정되어 있지 않습니다.");
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
try {
|
|
1943
|
+
if (!s.filePath) {
|
|
1944
|
+
w.error("파일 URL 정보가 없습니다.");
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
i(A.EXECUTING);
|
|
1948
|
+
const g = {
|
|
1949
|
+
crprCd: Ee(),
|
|
1950
|
+
sysCd: window.__SYS_CD__ || "",
|
|
1951
|
+
fileKey: s.fileKey,
|
|
1952
|
+
filePath: s.filePath,
|
|
1953
|
+
jobId: n
|
|
1954
|
+
}, F = await oe("SCMUTIL00301", {
|
|
1955
|
+
...g,
|
|
1956
|
+
...u
|
|
1957
|
+
});
|
|
1958
|
+
F?.success ? w.success(
|
|
1959
|
+
F?.message || "배치 실행 요청이 접수되었습니다. 상태 확인을 눌러주세요."
|
|
1960
|
+
) : (i(A.FAILED), w.error(F?.message || "배치 실행 요청에 실패했습니다."));
|
|
1961
|
+
} catch (g) {
|
|
1962
|
+
console.error("배치 실행 요청에 실패했습니다.", g), w.error("배치 실행 요청에 실패했습니다."), i(A.FAILED);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
}, [c, s, n, u]), p = te(async () => {
|
|
1966
|
+
if (!n) {
|
|
1967
|
+
w.warning("실행 job id(jobId)가 설정되어 있지 않습니다.");
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
try {
|
|
1971
|
+
const g = await oe("SCMUTIL00302", {
|
|
1972
|
+
jobId: n
|
|
1973
|
+
});
|
|
1974
|
+
if (g?.status === "COMPLETED") {
|
|
1975
|
+
i(A.COMPLETED), w.success("배치 작업이 완료되었습니다."), a?.();
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1978
|
+
if (g?.status === "FAILED") {
|
|
1979
|
+
i(A.FAILED), w.error("배치 작업이 실패했습니다.");
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1982
|
+
w.info("배치가 아직 진행 중입니다.");
|
|
1983
|
+
} catch (g) {
|
|
1984
|
+
console.error("배치 작업 상태 확인 오류:", g), w.error("배치 작업 상태 확인 중 오류가 발생했습니다.");
|
|
1985
|
+
}
|
|
1986
|
+
}, [n, a]), I = q(
|
|
1987
|
+
() => ({
|
|
1988
|
+
name: "file",
|
|
1989
|
+
accept: ".xlsx, .xls, .csv",
|
|
1990
|
+
listType: "picture",
|
|
1991
|
+
multiple: !1,
|
|
1992
|
+
action: "/api/upload",
|
|
1993
|
+
showUploadList: {
|
|
1994
|
+
showRemoveIcon: !0
|
|
1995
|
+
},
|
|
1996
|
+
beforeUpload: (g) => {
|
|
1997
|
+
const F = `.${g.name.split(".").pop()?.toLowerCase()}`;
|
|
1998
|
+
if (![".xlsx", ".xls", ".csv"].includes(F))
|
|
1999
|
+
return w.error(
|
|
2000
|
+
`${g.name} 파일은 허용되지 않는 확장자입니다. (xlsx, xls, csv만 가능)`
|
|
2001
|
+
), Q.LIST_IGNORE;
|
|
2002
|
+
},
|
|
2003
|
+
onChange: (g) => {
|
|
2004
|
+
const { status: F } = g.file;
|
|
2005
|
+
if (F === "removed") {
|
|
2006
|
+
h(null), i(A.IDLE), d(null);
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
if (h(g.file), F === "uploading") {
|
|
2010
|
+
i(A.UPLOADING);
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
if (F === "done") {
|
|
2014
|
+
if (g.file.response?.success) {
|
|
2015
|
+
i(A.UPLOADED);
|
|
2016
|
+
const f = g.file.response.uploadedFiles[0] || {};
|
|
2017
|
+
d({
|
|
2018
|
+
fileKey: f.fileKey,
|
|
2019
|
+
filePath: f.filePath,
|
|
2020
|
+
fileNameL: f.fileNameL,
|
|
2021
|
+
fileNameP: f.fileNameP,
|
|
2022
|
+
fileSize: f.fileSize,
|
|
2023
|
+
fileExt: f.fileExt
|
|
2024
|
+
});
|
|
2025
|
+
} else
|
|
2026
|
+
i(A.IDLE), w.error(
|
|
2027
|
+
g.file.response?.message || `${g.file.name} 파일 업로드에 실패했습니다.`
|
|
2028
|
+
);
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
F === "error" && (i(A.IDLE), w.error(
|
|
2032
|
+
g.file.response?.message || `${g.file.name} 파일 업로드 중 오류가 발생했습니다.`
|
|
2033
|
+
));
|
|
2034
|
+
}
|
|
2035
|
+
}),
|
|
2036
|
+
[]
|
|
2037
|
+
), C = q(
|
|
2038
|
+
() => /* @__PURE__ */ O($, { direction: "vertical", style: { width: 400 }, children: [
|
|
2039
|
+
/* @__PURE__ */ O($, { children: [
|
|
2040
|
+
o === A.EXECUTING && /* @__PURE__ */ e(ye, { size: "small" }),
|
|
2041
|
+
/* @__PURE__ */ e(Ye, { type: o === A.FAILED ? "danger" : "secondary", children: vt[o] })
|
|
2042
|
+
] }),
|
|
2043
|
+
o !== A.EXECUTING && o !== A.COMPLETED && o !== A.FAILED && /* @__PURE__ */ e(Q, { ...I, children: !c && /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), children: "파일 선택" }) }),
|
|
2044
|
+
o === A.UPLOADED && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
|
|
2045
|
+
Z,
|
|
2046
|
+
{
|
|
2047
|
+
type: "primary",
|
|
2048
|
+
icon: /* @__PURE__ */ e(ve, {}),
|
|
2049
|
+
onClick: y,
|
|
2050
|
+
disabled: !c,
|
|
2051
|
+
children: "실행하기"
|
|
2052
|
+
}
|
|
2053
|
+
) }) }),
|
|
2054
|
+
o === A.EXECUTING && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
|
|
2055
|
+
Z,
|
|
2056
|
+
{
|
|
2057
|
+
icon: /* @__PURE__ */ e(ge, {}),
|
|
2058
|
+
onClick: p,
|
|
2059
|
+
type: "primary",
|
|
2060
|
+
children: "상태 새로고침"
|
|
2061
|
+
}
|
|
2062
|
+
) }) }),
|
|
2063
|
+
(o === A.COMPLETED || o === A.FAILED) && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ O($, { children: [
|
|
2064
|
+
/* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(ge, {}), onClick: y, children: "다시 실행하기" }),
|
|
2065
|
+
/* @__PURE__ */ e(
|
|
2066
|
+
Z,
|
|
2067
|
+
{
|
|
2068
|
+
icon: /* @__PURE__ */ e(re, {}),
|
|
2069
|
+
onClick: () => {
|
|
2070
|
+
i(A.IDLE), h(null), d(null);
|
|
2071
|
+
},
|
|
2072
|
+
children: "다른 파일 업로드"
|
|
2073
|
+
}
|
|
2074
|
+
)
|
|
2075
|
+
] }) })
|
|
2076
|
+
] }),
|
|
2077
|
+
[o, c, y, I]
|
|
2078
|
+
), T = /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), disabled: r, children: t });
|
|
2079
|
+
return r ? /* @__PURE__ */ e(
|
|
2080
|
+
ie,
|
|
2081
|
+
{
|
|
2082
|
+
title: /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
2083
|
+
/* @__PURE__ */ e(Oe, { style: { color: "#faad14", fontSize: 16 } }),
|
|
2084
|
+
/* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "'엑셀 업로드' 버튼에 대한 사용 권한이 없습니다." })
|
|
2085
|
+
] }),
|
|
2086
|
+
content: /* @__PURE__ */ e(
|
|
2087
|
+
"div",
|
|
2088
|
+
{
|
|
2089
|
+
style: {
|
|
2090
|
+
display: "flex",
|
|
2091
|
+
flexDirection: "column",
|
|
2092
|
+
gap: 4,
|
|
2093
|
+
paddingLeft: 24
|
|
2094
|
+
},
|
|
2095
|
+
children: /* @__PURE__ */ e("span", { style: { fontSize: 12 }, children: "관리자에게 문의하세요." })
|
|
2096
|
+
}
|
|
2097
|
+
),
|
|
2098
|
+
placement: "bottom",
|
|
2099
|
+
styles: { body: { backgroundColor: "#fffbe6" } },
|
|
2100
|
+
children: /* @__PURE__ */ e("span", { children: T })
|
|
2101
|
+
}
|
|
2102
|
+
) : /* @__PURE__ */ e(
|
|
2103
|
+
ie,
|
|
2104
|
+
{
|
|
2105
|
+
content: C,
|
|
2106
|
+
title: /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", marginBottom: 0 }, children: /* @__PURE__ */ e(Ye, { strong: !0, children: "엑셀 업로드" }) }),
|
|
2107
|
+
trigger: "click",
|
|
2108
|
+
placement: "bottom",
|
|
2109
|
+
children: T
|
|
2110
|
+
}
|
|
2111
|
+
);
|
|
2112
|
+
}, { Text: Ne } = fe, M = {
|
|
2113
|
+
IDLE: "idle",
|
|
2114
|
+
UPLOADING: "uploading",
|
|
2115
|
+
UPLOADED: "uploaded",
|
|
2116
|
+
EXECUTING: "executing",
|
|
2117
|
+
COMPLETED: "completed",
|
|
2118
|
+
FAILED: "failed"
|
|
2119
|
+
}, Ot = {
|
|
2120
|
+
[M.IDLE]: "엑셀 파일을 선택해 업로드 해 주세요. (xlsx만 가능)",
|
|
2121
|
+
[M.UPLOADING]: "엑셀 업로드 중입니다. 잠시만 기다려 주세요.",
|
|
2122
|
+
[M.UPLOADED]: "엑셀 업로드가 완료되었습니다.",
|
|
2123
|
+
[M.EXECUTING]: "서비스 작업 실행 중입니다. 잠시만 기다려 주세요.",
|
|
2124
|
+
[M.COMPLETED]: "서비스 작업이 완료되었습니다.",
|
|
2125
|
+
[M.FAILED]: "서비스 작업이 실패했습니다."
|
|
2126
|
+
}, Cn = ({
|
|
2127
|
+
label: t = "엑셀 업로드",
|
|
2128
|
+
serviceName: n,
|
|
2129
|
+
extraParams: u,
|
|
2130
|
+
onFinish: a,
|
|
2131
|
+
disabled: r = !1
|
|
2132
|
+
}) => {
|
|
2133
|
+
const [o, i] = P(M.IDLE), [c, h] = P(null), [s, d] = P(null), y = te(async () => {
|
|
2134
|
+
if (!(!c || !s)) {
|
|
2135
|
+
if (!n) {
|
|
2136
|
+
w.warning(
|
|
2137
|
+
"실행 서비스 이름(serviceName)이 설정되어 있지 않습니다."
|
|
2138
|
+
);
|
|
2139
|
+
return;
|
|
2140
|
+
}
|
|
2141
|
+
try {
|
|
2142
|
+
if (!s.filePath) {
|
|
2143
|
+
w.error("파일 URL 정보가 없습니다.");
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2146
|
+
i(M.EXECUTING);
|
|
2147
|
+
const F = {
|
|
2148
|
+
crprCd: Ee(),
|
|
2149
|
+
filePath: s.filePath
|
|
2150
|
+
}, f = await oe(n, {
|
|
2151
|
+
...F,
|
|
2152
|
+
...u
|
|
2153
|
+
});
|
|
2154
|
+
f?.success || (i(M.FAILED), w.error(f?.message || "서비스 실행에 실패했습니다.")), i(M.COMPLETED), w.success(f?.message || "서비스 실행이 완료되었습니다."), a?.();
|
|
2155
|
+
} catch (F) {
|
|
2156
|
+
console.error("서비스 실행 요청에 실패했습니다.", F), w.error("서비스 실행 요청에 실패했습니다."), i(M.FAILED);
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
}, [c, s, n, u, a]), I = `/excel/test/${N().format("YYYY/MM/DD")}`, C = q(
|
|
2160
|
+
() => ({
|
|
2161
|
+
name: "file",
|
|
2162
|
+
accept: ".xlsx",
|
|
2163
|
+
listType: "picture",
|
|
2164
|
+
multiple: !1,
|
|
2165
|
+
action: `/api/upload${I}`,
|
|
2166
|
+
showUploadList: {
|
|
2167
|
+
showRemoveIcon: !0
|
|
2168
|
+
},
|
|
2169
|
+
beforeUpload: (F) => {
|
|
2170
|
+
const f = `.${F.name.split(".").pop()?.toLowerCase()}`;
|
|
2171
|
+
if (![".xlsx"].includes(f))
|
|
2172
|
+
return w.error(
|
|
2173
|
+
`${F.name} 파일은 허용되지 않는 확장자입니다. (xlsx만 가능)`
|
|
2174
|
+
), Q.LIST_IGNORE;
|
|
2175
|
+
const v = 10 * 1024 * 1024;
|
|
2176
|
+
if (F.size > v)
|
|
2177
|
+
return w.error("첨부 파일은 최대 10MB까지 업로드 가능합니다."), Q.LIST_IGNORE;
|
|
2178
|
+
},
|
|
2179
|
+
onChange: (F) => {
|
|
2180
|
+
const { status: f } = F.file;
|
|
2181
|
+
if (f === "removed") {
|
|
2182
|
+
h(null), i(M.IDLE), d(null);
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
if (h(F.file), f === "uploading") {
|
|
2186
|
+
i(M.UPLOADING);
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
if (f === "done") {
|
|
2190
|
+
i(M.UPLOADED);
|
|
2191
|
+
const v = F.file, Y = v.name || v.response.file_1?.filename, _ = v.response.file_1?.encrypted;
|
|
2192
|
+
d({
|
|
2193
|
+
fileKey: _,
|
|
2194
|
+
filePath: `${I}/${Y}`,
|
|
2195
|
+
fileNameL: Y,
|
|
2196
|
+
fileNameP: v.response.file_1?.encrypted,
|
|
2197
|
+
fileSize: v.response.file_1?.fileSize,
|
|
2198
|
+
fileExt: Y.includes(".") ? Y.split(".").pop() : ""
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
f === "error" && (i(M.IDLE), w.error(
|
|
2202
|
+
F.file.response?.message || `${F.file.name} 파일 업로드 중 오류가 발생했습니다.`
|
|
2203
|
+
));
|
|
2204
|
+
}
|
|
2205
|
+
}),
|
|
2206
|
+
[I]
|
|
2207
|
+
), T = q(
|
|
2208
|
+
() => /* @__PURE__ */ O($, { direction: "vertical", style: { width: 400 }, children: [
|
|
2209
|
+
/* @__PURE__ */ O($, { children: [
|
|
2210
|
+
o === M.EXECUTING && /* @__PURE__ */ e(ye, { size: "small" }),
|
|
2211
|
+
/* @__PURE__ */ e(Ne, { type: o === M.FAILED ? "danger" : "secondary", children: Ot[o] })
|
|
2212
|
+
] }),
|
|
2213
|
+
o !== M.EXECUTING && o !== M.COMPLETED && o !== M.FAILED && /* @__PURE__ */ e(Q, { ...C, children: !c && /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), children: "파일 선택" }) }),
|
|
2214
|
+
o === M.UPLOADED && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
|
|
2215
|
+
Z,
|
|
2216
|
+
{
|
|
2217
|
+
type: "primary",
|
|
2218
|
+
icon: /* @__PURE__ */ e(ve, {}),
|
|
2219
|
+
onClick: y,
|
|
2220
|
+
disabled: !c,
|
|
2221
|
+
children: "실행하기"
|
|
2222
|
+
}
|
|
2223
|
+
) }) }),
|
|
2224
|
+
(o === M.COMPLETED || o === M.FAILED) && /* @__PURE__ */ e($, { direction: "vertical", children: /* @__PURE__ */ O($, { children: [
|
|
2225
|
+
/* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(ge, {}), onClick: y, children: "다시 실행하기" }),
|
|
2226
|
+
/* @__PURE__ */ e(
|
|
2227
|
+
Z,
|
|
2228
|
+
{
|
|
2229
|
+
icon: /* @__PURE__ */ e(re, {}),
|
|
2230
|
+
onClick: () => {
|
|
2231
|
+
i(M.IDLE), h(null), d(null);
|
|
2232
|
+
},
|
|
2233
|
+
children: "다른 파일 업로드"
|
|
2234
|
+
}
|
|
2235
|
+
)
|
|
2236
|
+
] }) })
|
|
2237
|
+
] }),
|
|
2238
|
+
[o, c, y, C]
|
|
2239
|
+
), g = /* @__PURE__ */ e(Z, { icon: /* @__PURE__ */ e(re, {}), disabled: r, children: t });
|
|
2240
|
+
return r ? /* @__PURE__ */ e(
|
|
2241
|
+
ie,
|
|
2242
|
+
{
|
|
2243
|
+
title: /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
2244
|
+
/* @__PURE__ */ e(Oe, { style: { color: "#faad14", fontSize: 16 } }),
|
|
2245
|
+
/* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "'엑셀 업로드' 버튼에 대한 사용 권한이 없습니다." })
|
|
2246
|
+
] }),
|
|
2247
|
+
content: /* @__PURE__ */ e(
|
|
2248
|
+
"div",
|
|
2249
|
+
{
|
|
2250
|
+
style: {
|
|
2251
|
+
display: "flex",
|
|
2252
|
+
flexDirection: "column",
|
|
2253
|
+
gap: 4,
|
|
2254
|
+
paddingLeft: 24
|
|
2255
|
+
},
|
|
2256
|
+
children: /* @__PURE__ */ e("span", { style: { fontSize: 12 }, children: "관리자에게 문의하세요." })
|
|
2257
|
+
}
|
|
2258
|
+
),
|
|
2259
|
+
placement: "bottom",
|
|
2260
|
+
style: { backgroundColor: "#fffbe6" },
|
|
2261
|
+
children: /* @__PURE__ */ e("span", { children: g })
|
|
2262
|
+
}
|
|
2263
|
+
) : /* @__PURE__ */ e(
|
|
2264
|
+
ie,
|
|
2265
|
+
{
|
|
2266
|
+
content: T,
|
|
2267
|
+
title: /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", marginBottom: 0 }, children: /* @__PURE__ */ e(Ne, { strong: !0, children: "엑셀 업로드" }) }),
|
|
2268
|
+
trigger: "click",
|
|
2269
|
+
placement: "bottom",
|
|
2270
|
+
children: g
|
|
2271
|
+
}
|
|
2272
|
+
);
|
|
2102
2273
|
};
|
|
2103
2274
|
export {
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
Qt as
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
tn as
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
an as
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2275
|
+
Z as BwgButton,
|
|
2276
|
+
Kt as BwgCheck,
|
|
2277
|
+
qt as BwgCheckList,
|
|
2278
|
+
Jt as BwgDatePicker,
|
|
2279
|
+
hn as BwgDeptSearch,
|
|
2280
|
+
Zt as BwgDownload,
|
|
2281
|
+
gn as BwgDraggerUploader,
|
|
2282
|
+
mn as BwgEmpSearch,
|
|
2283
|
+
yn as BwgExcelUploaderBatch,
|
|
2284
|
+
Cn as BwgExcelUploaderService,
|
|
2285
|
+
Et as BwgForm,
|
|
2286
|
+
G as BwgFormItem,
|
|
2287
|
+
Qt as BwgInput,
|
|
2288
|
+
en as BwgLargeUploader,
|
|
2289
|
+
nn as BwgMaskedDate,
|
|
2290
|
+
tn as BwgMaskedInput,
|
|
2291
|
+
rn as BwgMaskedRange,
|
|
2292
|
+
on as BwgMultiSelect,
|
|
2293
|
+
ln as BwgNumber,
|
|
2294
|
+
an as BwgRadio,
|
|
2295
|
+
sn as BwgRangePicker,
|
|
2296
|
+
cn as BwgSearch,
|
|
2297
|
+
dn as BwgSelect,
|
|
2298
|
+
un as BwgSwitch,
|
|
2299
|
+
fn as BwgTextArea,
|
|
2300
|
+
pn as BwgUploader,
|
|
2301
|
+
At as DraggableUploadListItem,
|
|
2302
|
+
Re as defaultIconRender,
|
|
2303
|
+
ze as defaultItemRender
|
|
2132
2304
|
};
|