@bwg-ui/core 1.2.28 → 1.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/CMSearchIntfGwP01-C4Kg1iWo.cjs +1 -0
- package/dist/chunks/CMSearchIntfGwP01-CIf-fHXy.js +280 -0
- package/dist/chunks/{MenuReport-ByFOuqxd.cjs → MenuReport-DQS5SAmi.cjs} +1 -1
- package/dist/chunks/{MenuReport-CUfoyp52.js → MenuReport-GeXRkcDD.js} +1 -1
- package/dist/chunks/common-components-CyqUT5Vj.cjs +1109 -0
- package/dist/chunks/{common-components-D--Jte3C.js → common-components-DNos8aEG.js} +10264 -10147
- package/dist/chunks/{layout-components-CBp23tSs.js → layout-components-C4ehuALr.js} +537 -453
- package/dist/chunks/layout-components-USIA9TVn.cjs +35 -0
- package/dist/components/common/ButtonAccessController.d.ts.map +1 -1
- package/dist/components/common/BwgGrid.d.ts.map +1 -1
- package/dist/components/common/BwgTitleBox.d.ts.map +1 -1
- package/dist/components/common/BwgView.d.ts.map +1 -1
- package/dist/components/common/SearchBox.d.ts.map +1 -1
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgButton.d.ts +2 -2
- package/dist/components/core/BwgButton.d.ts.map +1 -1
- package/dist/components/core/BwgForm.d.ts.map +1 -1
- package/dist/components/core/BwgFormItem.d.ts +1 -1
- package/dist/components/core/BwgFormItem.d.ts.map +1 -1
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +364 -330
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.js +1 -1
- package/dist/components/layout/custom/ConfigurableHeader.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/layout/types.d.ts +7 -0
- package/dist/components/layout/types.d.ts.map +1 -1
- package/dist/components/pages/rsrc/CMFileMstrM01.d.ts.map +1 -1
- package/dist/components/popup/CMSearchIntfGwP01.d.ts +8 -0
- package/dist/components/popup/CMSearchIntfGwP01.d.ts.map +1 -0
- package/dist/components/popup/SearchOrganizationP01.d.ts +2 -1
- package/dist/components/popup/SearchOrganizationP01.d.ts.map +1 -1
- package/dist/components/popup/config/localPopupRegistry.d.ts.map +1 -1
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +248 -246
- package/dist/public/realgrid/css/realgrid-style-custom.css +3 -3
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.js +27 -6
- package/dist/stores/userStore.d.ts +15 -0
- package/dist/stores/userStore.d.ts.map +1 -1
- package/dist/styles/layout.css +1 -1
- package/dist/utils/{fileUtils.d.ts → FileUtils.d.ts} +1 -1
- package/dist/utils/FileUtils.d.ts.map +1 -0
- package/dist/utils/colorFormat.d.ts +169 -0
- package/dist/utils/colorFormat.d.ts.map +1 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +179 -9
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1152 -954
- package/package.json +1 -1
- package/dist/chunks/common-components-C4nSe5up.cjs +0 -1109
- package/dist/chunks/layout-components-CJqoB9Jz.cjs +0 -35
- package/dist/utils/fileUtils.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),U=require("@ant-design/icons"),q=require("antd"),s=require("react"),f=require("dayjs"),L=require("../utils/index.cjs"),o=require("./common-components-CyqUT5Vj.cjs"),h=require("../components/core/index.cjs"),W=[{label:"전체",value:""},{label:"기안",value:"DRAFT"},{label:"결재중",value:"IN_PROGRESS"},{label:"승인",value:"APPROVED"},{label:"반려",value:"REJECTED"}],Y=({popup:l,onClose:F})=>{const C=s.useRef(null),y=s.useRef(null),D=s.useRef(null),[S,j]=s.useState([]),[N,B]=s.useState(!1),[u,x]=s.useState(null),[b,v]=s.useState(1),[p,G]=s.useState(10),[E,A]=s.useState(0),k=s.useMemo(()=>{const n=f(),c=[];for(let a=1;a<=120;a++){const i=["DRAFT","IN_PROGRESS","APPROVED","REJECTED"];c.push({gwDcmtKey:`GW-${String(1e4+a)}`,gwDcmtNm:`업무 기안서 #${a}`,userId:`user${a%7+1}`,dprtNo:["HR","GEN","DEV1","DEV2","FIN"][a%5],aprvStts:i[a%i.length],aprvKey:L.generateUID(),createdAt:n.add(-(a%45),"day").hour(9+a%8).toISOString()})}return c},[]),g=s.useCallback(async(n,c)=>{B(!0),x(null);try{const a=D.current?.getFormData?.()??{},i=n??b,P=c??p,m={...a,page:i,pageSize:P},O=l?.popupParams?.serviceCode;if(O){const r=await L.callService(O,m),d=(r?.list||r?.data||[]).map(t=>({gwDcmtKey:t.gwDcmtKey??t.docNo??t.doc_id??t.id??"",gwDcmtNm:t.gwDcmtNm??t.title??t.subject??"",userId:t.userId??t.drafter??t.writerName??"",dprtNo:t.dprtNo??t.deptName??t.department??"",aprvStts:t.aprvStts??t.status??"DRAFT",createdAt:t.createdAt??t.writeYmd??t.created_at??"",aprvKey:t.aprvKey??void 0}));j(d),A(Number(r?.totalCount??r?.total??d.length));return}const K=k.filter(r=>{const d=m.keyword?.trim()?.toLowerCase(),t=!d||r.gwDcmtKey.toLowerCase().includes(d)||r.gwDcmtNm.toLowerCase().includes(d)||r.userId.toLowerCase().includes(d)||r.dprtNo.toLowerCase().includes(d),$=!m.status||r.aprvStts===m.status,w=m.createdAt,H=!w||(f(r.createdAt).isAfter(w[0].startOf("day"))||f(r.createdAt).isSame(w[0],"day"))&&(f(r.createdAt).isBefore(w[1].endOf("day"))||f(r.createdAt).isSame(w[1],"day"));return t&&$&&H});A(K.length);const T=(i-1)*P,_=K.slice(T,T+P);j(_)}catch{q.message.error("목록 조회 중 오류가 발생했습니다.")}finally{B(!1)}},[b,p,l?.popupParams,k]);s.useEffect(()=>{g()},[]);const I=s.useCallback(()=>{v(1),g(1,p)},[g,p]),M=s.useCallback((n,c)=>{v(n),G(c),g(n,c)},[g]),R=s.useCallback(()=>{if(!u){q.message.warning("항목을 선택해주세요.");return}const n=l?.config;n?.onSelect?n.onSelect(u):l?.popupParams?.onSelect?l.popupParams.onSelect(u):l?.config?.callback&&l.config.callback(u),n?.onClose?.(),l?.close?.()},[u,l]),z=s.useMemo(()=>[{fieldName:"gwDcmtKey",name:"gwDcmtKey",header:{text:"문서번호"},width:140},{fieldName:"gwDcmtNm",name:"gwDcmtNm",header:{text:"제목"},width:260},{fieldName:"userId",name:"userId",header:{text:"기안자"},width:120},{fieldName:"aprvKey",name:"aprvKey",header:{text:"기안연계키값"},width:120},{fieldName:"dprtNo",name:"dprtNo",header:{text:"기안부서"},width:140},{fieldName:"aprvStts",name:"aprvStts",header:{text:"상태"},width:110},{fieldName:"createdAt",name:"createdAt",header:{text:"기안일"},width:160}],[]),J=s.useMemo(()=>({header:{height:40},display:{rowHeight:36},container:{indicator:!0,check:!1,footer:!1},edit:{editable:!1}}),[]),V=s.useMemo(()=>({onCellClicked:(n,c)=>{try{const a=c?.itemIndex??c?.dataRow??-1;if(a<0)return;const i=n.getDataSource()?.getJsonRow(a);i&&x(i)}catch{}},onCellDblClicked:(n,c)=>{try{const a=c?.itemIndex??c?.dataRow??-1;if(a<0)return;const i=n.getDataSource()?.getJsonRow(a);i&&(x(i),setTimeout(()=>R(),0))}catch{}}}),[R]);return s.useEffect(()=>{C.current&&C.current.addAllData(S||[])},[S]),s.useEffect(()=>{y.current&&y.current.setTotalData(E||0)},[E]),e.jsx(o.BwgPopup,{popup:l,buttons:[{id:"confirm",label:"확인",type:"primary",onClick:R}],onClose:()=>{l?.config?.onClose?.(),F?.(),l?.close?.()},children:e.jsx(o.ContentLayOut,{children:e.jsxs(o.ContentBox,{border:!1,style:{paddingBottom:16},children:[e.jsx(o.SearchBox,{ref:D,reqRows:e.jsx(e.Fragment,{children:e.jsx(o.BwgRow,{children:e.jsxs(o.BwgCol,{span:24,children:[e.jsx(o.BwgTitleBox,{title:"기안 검색"}),e.jsxs(o.BwgRow,{gutter:[12,8],style:{marginTop:8},children:[e.jsx(o.BwgCol,{span:8,children:e.jsx(h.BwgInput,{inputProps:{placeholder:"제목/기안자/부서/문서번호",prefix:e.jsx(U.SearchOutlined,{}),allowClear:!0,onPressEnter:I},itemProps:{name:"keyword"}})}),e.jsx(o.BwgCol,{span:6,children:e.jsx(h.BwgSelect,{selectProps:{options:W},itemProps:{label:"상태",name:"status"}})}),e.jsxs(o.BwgCol,{span:8,children:[e.jsx(h.BwgRangePicker,{type:"datetime",itemProps:{label:"기안일",name:"createdAt"},inputProps:{style:{width:"100%"},allowEmpty:[!1,!1]}}),e.jsx(h.BwgRangePicker,{type:"datetime",itemProps:{label:"기안완료일",name:"completedAt"},inputProps:{style:{width:"100%"},allowEmpty:[!1,!1]}})]}),e.jsx(o.BwgCol,{span:2,children:e.jsx(h.BwgButton,{type:"primary",onClick:I,loading:N,style:{width:"100%"},children:"검색"})})]})]})})})}),e.jsx(o.BwgGrid,{ref:C,type:"nrml",gridColumns:z,gridOptions:J,gridEvents:V}),e.jsx(o.BwgPagination,{ref:y,mode:"server",onServerPageChange:M,pageSizeOptions:[10,20,50,100]}),S.length===0&&!N&&e.jsx(o.BwgRow,{style:{display:"none"},children:e.jsx(o.BwgCol,{span:24,children:e.jsx("span",{})})})]})})})};exports.default=Y;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { jsx as t, jsxs as h, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { SearchOutlined as ee } from "@ant-design/icons";
|
|
3
|
+
import { message as V } from "antd";
|
|
4
|
+
import { useRef as b, useState as i, useMemo as y, useCallback as C, useEffect as x } from "react";
|
|
5
|
+
import w from "dayjs";
|
|
6
|
+
import { generateUID as te, callService as ae } from "../utils/index.js";
|
|
7
|
+
import { n as oe, C as re, d as se, S as ne, i as A, j as d, e as ce, h as le, o as ie } from "./common-components-DNos8aEG.js";
|
|
8
|
+
import { BwgInput as de, BwgSelect as me, BwgRangePicker as _, BwgButton as fe } from "../components/core/index.js";
|
|
9
|
+
const ge = [
|
|
10
|
+
{ label: "전체", value: "" },
|
|
11
|
+
{ label: "기안", value: "DRAFT" },
|
|
12
|
+
{ label: "결재중", value: "IN_PROGRESS" },
|
|
13
|
+
{ label: "승인", value: "APPROVED" },
|
|
14
|
+
{ label: "반려", value: "REJECTED" }
|
|
15
|
+
], Pe = ({ popup: n, onClose: $ }) => {
|
|
16
|
+
const S = b(null), D = b(null), E = b(null), [P, B] = i([]), [I, k] = i(!1), [m, N] = i(null), [K, O] = i(1), [p, H] = i(10), [T, L] = i(0), F = y(() => {
|
|
17
|
+
const o = w(), s = [];
|
|
18
|
+
for (let a = 1; a <= 120; a++) {
|
|
19
|
+
const c = [
|
|
20
|
+
"DRAFT",
|
|
21
|
+
"IN_PROGRESS",
|
|
22
|
+
"APPROVED",
|
|
23
|
+
"REJECTED"
|
|
24
|
+
];
|
|
25
|
+
s.push({
|
|
26
|
+
gwDcmtKey: `GW-${String(1e4 + a)}`,
|
|
27
|
+
gwDcmtNm: `업무 기안서 #${a}`,
|
|
28
|
+
userId: `user${a % 7 + 1}`,
|
|
29
|
+
dprtNo: ["HR", "GEN", "DEV1", "DEV2", "FIN"][a % 5],
|
|
30
|
+
aprvStts: c[a % c.length],
|
|
31
|
+
aprvKey: te(),
|
|
32
|
+
createdAt: o.add(-(a % 45), "day").hour(9 + a % 8).toISOString()
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return s;
|
|
36
|
+
}, []), f = C(
|
|
37
|
+
async (o, s) => {
|
|
38
|
+
k(!0), N(null);
|
|
39
|
+
try {
|
|
40
|
+
const a = E.current?.getFormData?.() ?? {}, c = o ?? K, v = s ?? p, g = { ...a, page: c, pageSize: v }, j = n?.popupParams?.serviceCode;
|
|
41
|
+
if (j) {
|
|
42
|
+
const r = await ae(j, g), l = (r?.list || r?.data || []).map(
|
|
43
|
+
(e) => ({
|
|
44
|
+
gwDcmtKey: e.gwDcmtKey ?? e.docNo ?? e.doc_id ?? e.id ?? "",
|
|
45
|
+
gwDcmtNm: e.gwDcmtNm ?? e.title ?? e.subject ?? "",
|
|
46
|
+
userId: e.userId ?? e.drafter ?? e.writerName ?? "",
|
|
47
|
+
dprtNo: e.dprtNo ?? e.deptName ?? e.department ?? "",
|
|
48
|
+
aprvStts: e.aprvStts ?? e.status ?? "DRAFT",
|
|
49
|
+
createdAt: e.createdAt ?? e.writeYmd ?? e.created_at ?? "",
|
|
50
|
+
aprvKey: e.aprvKey ?? void 0
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
B(l), L(Number(r?.totalCount ?? r?.total ?? l.length));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const z = F.filter((r) => {
|
|
57
|
+
const l = g.keyword?.trim()?.toLowerCase(), e = !l || r.gwDcmtKey.toLowerCase().includes(l) || r.gwDcmtNm.toLowerCase().includes(l) || r.userId.toLowerCase().includes(l) || r.dprtNo.toLowerCase().includes(l), Q = !g.status || r.aprvStts === g.status, u = g.createdAt, X = !u || (w(r.createdAt).isAfter(u[0].startOf("day")) || w(r.createdAt).isSame(u[0], "day")) && (w(r.createdAt).isBefore(u[1].endOf("day")) || w(r.createdAt).isSame(u[1], "day"));
|
|
58
|
+
return e && Q && X;
|
|
59
|
+
});
|
|
60
|
+
L(z.length);
|
|
61
|
+
const J = (c - 1) * v, Y = z.slice(J, J + v);
|
|
62
|
+
B(Y);
|
|
63
|
+
} catch {
|
|
64
|
+
V.error("목록 조회 중 오류가 발생했습니다.");
|
|
65
|
+
} finally {
|
|
66
|
+
k(!1);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
[K, p, n?.popupParams, F]
|
|
70
|
+
);
|
|
71
|
+
x(() => {
|
|
72
|
+
f();
|
|
73
|
+
}, []);
|
|
74
|
+
const G = C(() => {
|
|
75
|
+
O(1), f(1, p);
|
|
76
|
+
}, [f, p]), M = C(
|
|
77
|
+
(o, s) => {
|
|
78
|
+
O(o), H(s), f(o, s);
|
|
79
|
+
},
|
|
80
|
+
[f]
|
|
81
|
+
), R = C(() => {
|
|
82
|
+
if (!m) {
|
|
83
|
+
V.warning("항목을 선택해주세요.");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const o = n?.config;
|
|
87
|
+
o?.onSelect ? o.onSelect(m) : n?.popupParams?.onSelect ? n.popupParams.onSelect(m) : n?.config?.callback && n.config.callback(m), o?.onClose?.(), n?.close?.();
|
|
88
|
+
}, [m, n]), q = y(
|
|
89
|
+
() => [
|
|
90
|
+
{
|
|
91
|
+
fieldName: "gwDcmtKey",
|
|
92
|
+
name: "gwDcmtKey",
|
|
93
|
+
header: { text: "문서번호" },
|
|
94
|
+
width: 140
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
fieldName: "gwDcmtNm",
|
|
98
|
+
name: "gwDcmtNm",
|
|
99
|
+
header: { text: "제목" },
|
|
100
|
+
width: 260
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
fieldName: "userId",
|
|
104
|
+
name: "userId",
|
|
105
|
+
header: { text: "기안자" },
|
|
106
|
+
width: 120
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
fieldName: "aprvKey",
|
|
110
|
+
name: "aprvKey",
|
|
111
|
+
header: { text: "기안연계키값" },
|
|
112
|
+
width: 120
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
fieldName: "dprtNo",
|
|
116
|
+
name: "dprtNo",
|
|
117
|
+
header: { text: "기안부서" },
|
|
118
|
+
width: 140
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
fieldName: "aprvStts",
|
|
122
|
+
name: "aprvStts",
|
|
123
|
+
header: { text: "상태" },
|
|
124
|
+
width: 110
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
fieldName: "createdAt",
|
|
128
|
+
name: "createdAt",
|
|
129
|
+
header: { text: "기안일" },
|
|
130
|
+
width: 160
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
[]
|
|
134
|
+
), U = y(
|
|
135
|
+
() => ({
|
|
136
|
+
header: { height: 40 },
|
|
137
|
+
display: { rowHeight: 36 },
|
|
138
|
+
container: { indicator: !0, check: !1, footer: !1 },
|
|
139
|
+
edit: { editable: !1 }
|
|
140
|
+
}),
|
|
141
|
+
[]
|
|
142
|
+
), W = y(
|
|
143
|
+
() => ({
|
|
144
|
+
onCellClicked: (o, s) => {
|
|
145
|
+
try {
|
|
146
|
+
const a = s?.itemIndex ?? s?.dataRow ?? -1;
|
|
147
|
+
if (a < 0) return;
|
|
148
|
+
const c = o.getDataSource()?.getJsonRow(a);
|
|
149
|
+
c && N(c);
|
|
150
|
+
} catch {
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
onCellDblClicked: (o, s) => {
|
|
154
|
+
try {
|
|
155
|
+
const a = s?.itemIndex ?? s?.dataRow ?? -1;
|
|
156
|
+
if (a < 0) return;
|
|
157
|
+
const c = o.getDataSource()?.getJsonRow(a);
|
|
158
|
+
c && (N(c), setTimeout(() => R(), 0));
|
|
159
|
+
} catch {
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
[R]
|
|
164
|
+
);
|
|
165
|
+
return x(() => {
|
|
166
|
+
S.current && S.current.addAllData(P || []);
|
|
167
|
+
}, [P]), x(() => {
|
|
168
|
+
D.current && D.current.setTotalData(T || 0);
|
|
169
|
+
}, [T]), /* @__PURE__ */ t(
|
|
170
|
+
oe,
|
|
171
|
+
{
|
|
172
|
+
popup: n,
|
|
173
|
+
buttons: [
|
|
174
|
+
{ id: "confirm", label: "확인", type: "primary", onClick: R }
|
|
175
|
+
],
|
|
176
|
+
onClose: () => {
|
|
177
|
+
n?.config?.onClose?.(), $?.(), n?.close?.();
|
|
178
|
+
},
|
|
179
|
+
children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ h(se, { border: !1, style: { paddingBottom: 16 }, children: [
|
|
180
|
+
/* @__PURE__ */ t(
|
|
181
|
+
ne,
|
|
182
|
+
{
|
|
183
|
+
ref: E,
|
|
184
|
+
reqRows: /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(A, { children: /* @__PURE__ */ h(d, { span: 24, children: [
|
|
185
|
+
/* @__PURE__ */ t(ce, { title: "기안 검색" }),
|
|
186
|
+
/* @__PURE__ */ h(A, { gutter: [12, 8], style: { marginTop: 8 }, children: [
|
|
187
|
+
/* @__PURE__ */ t(d, { span: 8, children: /* @__PURE__ */ t(
|
|
188
|
+
de,
|
|
189
|
+
{
|
|
190
|
+
inputProps: {
|
|
191
|
+
placeholder: "제목/기안자/부서/문서번호",
|
|
192
|
+
prefix: /* @__PURE__ */ t(ee, {}),
|
|
193
|
+
allowClear: !0,
|
|
194
|
+
onPressEnter: G
|
|
195
|
+
},
|
|
196
|
+
itemProps: {
|
|
197
|
+
name: "keyword"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
) }),
|
|
201
|
+
/* @__PURE__ */ t(d, { span: 6, children: /* @__PURE__ */ t(
|
|
202
|
+
me,
|
|
203
|
+
{
|
|
204
|
+
selectProps: {
|
|
205
|
+
options: ge
|
|
206
|
+
},
|
|
207
|
+
itemProps: {
|
|
208
|
+
label: "상태",
|
|
209
|
+
name: "status"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
) }),
|
|
213
|
+
/* @__PURE__ */ h(d, { span: 8, children: [
|
|
214
|
+
/* @__PURE__ */ t(
|
|
215
|
+
_,
|
|
216
|
+
{
|
|
217
|
+
type: "datetime",
|
|
218
|
+
itemProps: { label: "기안일", name: "createdAt" },
|
|
219
|
+
inputProps: {
|
|
220
|
+
style: { width: "100%" },
|
|
221
|
+
allowEmpty: [!1, !1]
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ t(
|
|
226
|
+
_,
|
|
227
|
+
{
|
|
228
|
+
type: "datetime",
|
|
229
|
+
itemProps: {
|
|
230
|
+
label: "기안완료일",
|
|
231
|
+
name: "completedAt"
|
|
232
|
+
},
|
|
233
|
+
inputProps: {
|
|
234
|
+
style: { width: "100%" },
|
|
235
|
+
allowEmpty: [!1, !1]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
] }),
|
|
240
|
+
/* @__PURE__ */ t(d, { span: 2, children: /* @__PURE__ */ t(
|
|
241
|
+
fe,
|
|
242
|
+
{
|
|
243
|
+
type: "primary",
|
|
244
|
+
onClick: G,
|
|
245
|
+
loading: I,
|
|
246
|
+
style: { width: "100%" },
|
|
247
|
+
children: "검색"
|
|
248
|
+
}
|
|
249
|
+
) })
|
|
250
|
+
] })
|
|
251
|
+
] }) }) })
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
/* @__PURE__ */ t(
|
|
255
|
+
le,
|
|
256
|
+
{
|
|
257
|
+
ref: S,
|
|
258
|
+
type: "nrml",
|
|
259
|
+
gridColumns: q,
|
|
260
|
+
gridOptions: U,
|
|
261
|
+
gridEvents: W
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
/* @__PURE__ */ t(
|
|
265
|
+
ie,
|
|
266
|
+
{
|
|
267
|
+
ref: D,
|
|
268
|
+
mode: "server",
|
|
269
|
+
onServerPageChange: M,
|
|
270
|
+
pageSizeOptions: [10, 20, 50, 100]
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
P.length === 0 && !I && /* @__PURE__ */ t(A, { style: { display: "none" }, children: /* @__PURE__ */ t(d, { span: 24, children: /* @__PURE__ */ t("span", {}) }) })
|
|
274
|
+
] }) })
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
export {
|
|
279
|
+
Pe as default
|
|
280
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@ant-design/icons"),t=require("antd"),pe=require("dayjs"),n=require("react"),G=require("../stores/index.cjs"),h=require("./common-components-C4nSe5up.cjs"),l=require("../components/core/index.cjs"),f=require("../utils/index.cjs"),he=require("../provider/index.cjs"),{TextArea:ge}=t.Input,R=[{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],fe={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},Q=[{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],je={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},W={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},ye=({popup:y,onClose:O})=>{const{searchBoxRef:I}=he.useSearchBox(),b=n.useRef(null),E=n.useRef(null),{user:w}=G.useUserStore(),{activeMenuItem:c}=G.useMenuViewStore(),[i]=t.Form.useForm(),[z,L]=n.useState(!1),[V,A]=n.useState(!1),[M,H]=n.useState(!1),[g,J]=n.useState(!1),[a,S]=n.useState(!1),[d,j]=n.useState("list");n.useState(null);const D=n.useRef(null),[F,U]=n.useState([]),[B,Y]=n.useState(""),[P,Ce]=n.useState(!1),[$,N]=n.useState(15),T=n.useRef(null),K=n.useMemo(()=>h.createBwgGridRenderer((s,r,o,m,x)=>{const p=s.getValue(r.index?.itemIndex,"type");x.render(e.jsx(t.Tag,{color:fe[p],children:R.find(v=>v.value===p)?.label}))}),[]),X=n.useMemo(()=>h.createBwgGridRenderer((s,r,o,m,x)=>{const p=s.getValue(r.index?.itemIndex,"status");x.render(e.jsx(t.Tag,{color:je[p],children:Q.find(v=>v.value===p)?.label}))}),[]),Z=n.useMemo(()=>h.createBwgGridRenderer((s,r,o,m,x)=>{s.getValue(r.index?.itemIndex,"urgentYn")==="Y"?x.render(e.jsx(C.AlertTwoTone,{twoToneColor:"red"})):x.render(e.jsx(e.Fragment,{}))}),[]),_=[{fieldName:"boardMstrId",header:{text:"글 번호"},width:80},{name:"type",fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType"},{fieldName:"title",header:{text:"제목"},width:200},{fieldName:"content",header:{text:"내용"},width:200,visible:!1},{name:"status",fieldName:"status",header:{text:"상태"},width:80,renderer:"statusTag"},{fieldName:"rgstUserId",visible:!1},{fieldName:"rgstUserNm",header:{text:"등록자"},width:100},{fieldName:"rgstDt",header:{text:"등록일자"},width:120,renderer:f.realFormat.maskYmd},{fieldName:"dueDt",header:{text:"마감요청일자"},width:120,renderer:f.realFormat.maskYmd},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:100},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,renderer:f.realFormat.maskYmd},{fieldName:"scrnId",header:{text:"화면ID"},width:100,visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,visible:!1}],ee={onCellDblClicked:(s,r)=>{const o=r.itemIndex??-1;if(o<0)return;const m=s.getValues(o);console.log("🔍 그리드 셀 더블클릭 이벤트:",m);const x={...m,menuId:c?.menuId,menuNm:c?.menuNm,scrnId:c?.scrnId};i.setFieldsValue(x),H(x.rgstUserId===w?.userId),J(x.status==="COMPLETED"||x.status==="REJECTED"),j("detail")}},k=()=>{i.resetFields(),j("list"),u.SCMBoardMstr0001(1,20)},q=async s=>{L(!0);try{i.validateFields().then(r=>{console.log("문의/신고 제출:",r),d==="new"?u.SCMBoardMstr0003(r):d==="detail"&&u.SCMBoardMstr0004(r)})}catch(r){console.error("문의/신고 제출 실패:",r)}finally{L(!1)}},te=()=>{u.SCMBoardMstr0005()},se=()=>{I?.current?.resetForm(),i.resetFields(),d==="new"?j("list"):(j("list"),y?.close?.()||O?.())},re=()=>{I?.current?.resetForm(),i.resetFields(),j("list"),y?.close?.()||O?.()},ne=()=>{(d==="detail"||d==="new")&&j("list")},le=()=>{i.resetFields(),j("new")},ie=()=>{console.log("댓글 수동 새로고침"),N(15)},oe=()=>{if(!B.trim()){t.message.warning("댓글 상세내용 작성");return}u.SCMBoardDtls0002(i.getFieldValue("boardMstrId"),B.trim()),Y(""),setTimeout(()=>{D.current&&(D.current.scrollTop=D.current.scrollHeight)},100)},ae=s=>{const r=F.find(o=>o.id===s);if(r&&r.regUserId!==w?.userId){t.message.error("본인이 작성한 댓글만 삭제할 수 있습니다.");return}u.SCMBoardDtls0003(i.getFieldValue("boardMstrId"),s)};n.useEffect(()=>{y&&setTimeout(()=>{u.SCMBoardMstr0001(1,20)},100)},[y]);const de=()=>e.jsxs(h.ContentBox,{border:!1,children:[e.jsx(h.SearchBox,{border:!0,ref:I,reqRows:e.jsxs(e.Fragment,{children:[e.jsx(t.Row,{gutter:[16,8],style:{marginBottom:"8px"},children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgFormItem,{label:"화면 정보",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{disabled:!0})}),e.jsx(t.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{disabled:!0})})]})})})}),e.jsxs(t.Row,{gutter:[16,8],style:{marginBottom:"8px"},children:[e.jsx(t.Col,{span:6,children:e.jsx(l.BwgSelect,{itemProps:{label:"등록구분",name:"type"},selectProps:{options:R}})}),e.jsx(t.Col,{span:12,children:e.jsx(l.BwgRangePicker,{itemProps:{label:"등록일자",name:"rgstDt"},inputProps:{allowEmpty:!0}})}),e.jsx(t.Col,{span:6,children:e.jsx(l.BwgSwitch,{itemProps:{name:"myArticle",label:"내 글만"},inputProps:{format:"YN",onChange:()=>console.log("hello!!")}})})]}),e.jsx(t.Row,{children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgInput,{itemProps:{label:"제목 및 내용",name:"keyword"}})})})]})}),e.jsx(h.BwgGrid,{ref:T,gridColumns:_,gridEvents:ee,gridOptions:{},renderers:[{name:"tagType",renderer:K},{name:"statusTag",renderer:X},{name:"alert",renderer:Z}]}),e.jsx(h.BwgPagination,{ref:b,mode:"server",onServerPageChange:(s,r)=>{console.log("🔄 서버 모드 페이징 변경:",{page:s,size:r}),u.SCMBoardMstr0001(s,r)},pageSizeOptions:[10,20,50,100]})]}),ce=()=>e.jsxs(t.Splitter,{children:[e.jsx(t.Splitter.Panel,{defaultSize:"70%",min:"60%",max:"80%",style:{paddingRight:"15px",overflowX:"hidden",overflowY:"hidden"},children:e.jsx(h.ContentBox,{children:e.jsxs(t.Form,{form:i,onFinish:q,labelCol:{flex:"100px"},disabled:!M||g,children:[e.jsxs(t.Row,{gutter:[16,8],children:[e.jsxs(t.Col,{span:8,children:[e.jsx(t.Form.Item,{name:"boardMstrId",hidden:!0,children:e.jsx(t.Input,{})}),e.jsx(l.BwgSelect,{itemProps:{name:"type",label:"구분"},selectProps:{options:R}})]}),e.jsxs(t.Col,{span:16,children:[e.jsx(l.BwgFormItem,{label:"화면 정보",name:void 0,children:e.jsxs(t.Space.Compact,{children:[e.jsx(t.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})}),e.jsx(t.Form.Item,{name:"scrnId",style:{width:"100%"},hidden:!0,children:e.jsx(t.Input,{readOnly:!0})})]})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgFormItem,{label:"작성자",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"rgstUserId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgDatePicker,{itemProps:{label:"작성일자",name:"rgstDt"},inputProps:{disabled:!0}})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgSelect,{itemProps:{name:"status",label:"상태"},selectProps:{options:Q,disabled:!0}})})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgDatePicker,{itemProps:{label:"마감요청일",name:"dueDate"}})}),e.jsx(t.Col,{span:8,children:e.jsxs(t.Flex,{vertical:!0,gap:2,children:[e.jsx("span",{style:{fontSize:"12px",color:"#000000E0"},children:"진척률"}),e.jsx(t.Progress,{percent:W[i.getFieldValue("status")],status:W[i.getFieldValue("status")]>0?"active":"normal",size:"small",format:s=>`${s}%`})]})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"}})})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgFormItem,{label:"처리담당자",name:void 0,help:"",children:e.jsxs(t.Space.Compact,{children:[e.jsx(t.Form.Item,{name:"processor",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"processorNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgDatePicker,{itemProps:{label:"처리일자",name:"processDt"}})})]}),e.jsx(t.Row,{gutter:[16,8],children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgFormItem,{label:"제목",name:"title",style:{width:"100%"},children:e.jsx(t.Input,{})})})}),e.jsx(h.BwgEditor,{border:!1,itemProps:{name:"content",label:"내용",rules:[{required:!0,message:"내용을 입력하세요."}]},editorProps:{isEditing:M&&!g,title:{title:"에디터"}}})]})})}),e.jsx(t.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:e.jsxs(h.ContentBox,{style:{flex:"0 0 400px",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{borderBottom:"1px solid #e8e8e8",paddingBottom:"12px",marginBottom:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontSize:"14px",fontWeight:"600",color:"#262626"},children:"댓글"}),e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx(t.Button,{type:"text",icon:e.jsx(C.ReloadOutlined,{spin:P||a}),onClick:ie,disabled:P||a,size:"small",style:{fontSize:"12px",color:g?"#d9d9d9":a?"#8c8c8c":"#595959",height:"24px",padding:"0 8px"}}),!g&&e.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",fontSize:"10px",fontWeight:"700",color:P?"#8c8c8c":"#1890ff",minWidth:"14px",height:"14px",lineHeight:"14px",textAlign:"center",borderRadius:"50%",pointerEvents:"none"},children:$})]})]}),e.jsx("div",{ref:D,style:{flex:1,overflowY:"auto",marginBottom:"16px",minHeight:0,position:"relative"},children:a?e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:[e.jsx("div",{style:{marginBottom:"12px"},children:e.jsx(C.ReloadOutlined,{spin:!0,style:{fontSize:"24px"}})}),e.jsx("div",{style:{fontSize:"13px"},children:"댓글을 불러오는 중..."})]}):F.length===0?e.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:e.jsx("div",{style:{fontSize:"13px"},children:"등록된 댓글이 없습니다."})}):e.jsx(t.List,{dataSource:F,renderItem:s=>e.jsxs(t.List.Item,{style:{position:"relative",paddingRight:"20px",padding:"12px 20px 12px 12px",borderBottom:"1px solid #f0f0f0"},children:[e.jsx(t.List.Item.Meta,{avatar:e.jsx(t.Avatar,{size:32,style:{backgroundColor:"#1890ff",fontSize:"13px"},children:s.author[0]}),title:e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[e.jsx("span",{style:{fontWeight:"500",fontSize:"13px",color:"#262626"},children:s.author}),e.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:s.regDt})]}),description:e.jsx("span",{style:{fontSize:"13px",color:"#595959",lineHeight:"1.5"},children:s.content})}),s.regUserId===w?.userId&&e.jsx(t.Button,{type:"text",danger:!0,icon:e.jsx(C.DeleteOutlined,{style:{fontSize:"12px"}}),size:"small",onClick:()=>ae(s.id),disabled:a,style:{position:"absolute",right:"8px",top:"62%",transform:"translateY(-50%)",opacity:a?.3:.5,height:"24px",width:"24px",padding:0},onMouseEnter:r=>{a||(r.currentTarget.style.opacity="1")},onMouseLeave:r=>{r.currentTarget.style.opacity=a?"0.3":"0.5"}})]},s.id)})}),e.jsx("div",{style:{padding:"12px",borderTop:"1px solid #e8e8e8",backgroundColor:g?"#f5f5f5":"#fafafa",flexShrink:0,marginTop:"auto"},children:g?e.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"#8c8c8c",fontSize:"13px",backgroundColor:"#ffffff",borderRadius:"6px",border:"1px solid #e8e8e8"},children:[e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(C.AlertTwoTone,{twoToneColor:"#faad14"})}),e.jsx("div",{children:"이미 완료처리된 게시글입니다."}),e.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"댓글을 작성할 수 없습니다."})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(ge,{rows:2,placeholder:a?"댓글 처리 중...":"댓글을 입력하세요...",value:B,onChange:s=>Y(s.target.value),maxLength:300,disabled:a,style:{borderRadius:"6px",border:"1px solid #d9d9d9",resize:"none",fontSize:"13px",backgroundColor:a?"#f5f5f5":"#ffffff",color:a?"#8c8c8c":"#000000"},onFocus:s=>{a||(s.target.style.borderColor="#1890ff",s.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.05)")},onBlur:s=>{s.target.style.borderColor="#d9d9d9",s.target.style.boxShadow="none"}})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:a?"처리 중...":`${B.length} / 300자`}),e.jsx(t.Button,{type:"primary",onClick:oe,size:"small",loading:a,style:{borderRadius:"4px",fontSize:"12px",height:"28px",padding:"0 16px",fontWeight:"500"},disabled:!B.trim()||a,children:a?"등록 중...":"등록"})]})]})})]})})]}),ue=()=>e.jsx(h.ContentBox,{children:e.jsxs(l.BwgForm,{form:i,onFinish:q,initialValues:{type:"INQR"},labelCol:{flex:"100px"},style:{height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgSelect,{itemProps:{name:"type",label:"구분",rules:[{required:!0,message:"구분을 선택해주세요."}]},selectProps:{options:R}})}),e.jsxs(t.Col,{span:16,children:[e.jsx(l.BwgFormItem,{label:"화면 정보",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})}),e.jsx(t.Form.Item,{name:"scrnId",style:{width:"100%"},hidden:!0,children:e.jsx(t.Input,{readOnly:!0})})]})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgFormItem,{label:"작성자",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"rgstUserId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})})}),e.jsx(t.Col,{span:6,children:e.jsx(l.BwgFormItem,{label:"작성일자",name:"rgstDt",style:{width:"100%"},children:e.jsx(t.DatePicker,{disabled:!0})})}),e.jsx(t.Col,{span:6,children:e.jsx(l.BwgFormItem,{label:"마감요청일",name:"dueDate",style:{width:"100%"},children:e.jsx(t.DatePicker,{})})}),e.jsx(t.Col,{span:4,children:e.jsx(l.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"}})})]}),e.jsx(t.Row,{gutter:[16,8],children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgFormItem,{label:"제목",name:"title",style:{width:"100%"},rules:[{required:!0,message:"제목을 입력해주세요."}],children:e.jsx(t.Input,{})})})}),e.jsx(h.BwgEditor,{border:!1,itemProps:{name:"content"},editorProps:{isEditing:V,title:{title:e.jsxs(e.Fragment,{children:[e.jsx(C.EditOutlined,{style:{marginRight:"5px"}})," 상세내용 작성"]}),children:e.jsx(t.Button,{icon:e.jsx(C.EyeFilled,{}),onClick:()=>A(!V),children:"미리보기"})}}})]})});n.useEffect(()=>{d==="new"&&(A(!0),i.setFieldsValue({type:"INQR",menuId:c?.menuId,menuNm:c?.menuNm,scrnId:c?.scrnId,rgstUserId:w?.userId,rgstUserNm:w?.userNm,rgstDt:pe(),content:""}))},[d,i,c,w]),n.useEffect(()=>{if(d==="detail"&&!g){const s=setInterval(()=>{N(r=>r<=1?(console.log("🔄 댓글 자동 갱신 실행 (카운트다운 완료)"),u.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),15):r-1)},1e3);return u.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),()=>{console.log("🧹 댓글 인터벌 정리"),clearInterval(s)}}else d==="detail"&&g&&(console.log("📋 완료된 게시글 - 댓글 조회만"),u.SCMBoardDtls0001(i.getFieldValue("boardMstrId")))},[d,g,i]),n.useEffect(()=>()=>{console.log("🧹 컴포넌트 언마운트 - 모든 인터벌 정리"),E.current&&(clearInterval(E.current),E.current=null)},[]),n.useEffect(()=>{d==="list"&&c&&(I?.current?.setFormData({menuId:c?.menuId,menuNm:c?.menuNm}),u.SCMBoardMstr0001(1,20))},[d,c]),n.useEffect(()=>{y&&c&&I?.current?.setFormData({menuId:c?.menuId,menuNm:c?.menuNm})},[y,c]);const u={SCMBoardMstr0001:async(s,r)=>{const o=s||b.current?.currentPage||1,m=r||b.current?.pageSize||20,x={...I?.current?.getFormData(),pageNum:o,pageCount:m};console.log("🔍 서버 모드 페이징 요청:",x);try{const p=await f.callService("SCMBoardMstr0001",x,{isPopup:!0});if(p&&p.pageList){const v=p.pageCnt||0;b.current?.setTotalData(v),T.current?.addAllData(p.pageList)}else b.current?.setTotalData(0),T.current?.addAllData([]),console.log("📭 서버 모드 페이징 데이터 없음")}catch(p){console.error("❌ SCMBoardMstr0001 호출 실패:",p),t.message.error("데이터 조회 중 오류가 발생했습니다.")}},SCMBoardMstr0003:s=>{f.callService("SCMBoardMstr0003",{...s,status:"READY"},{isPopup:!0}).then(r=>{console.log("문의/신고 제출 응답:",r),t.message.success("정상 접수되었습니다."),k()}).catch(r=>{console.error("문의/신고 제출 실패:",r),t.message.error("접수 중 오류가 발생했습니다.")})},SCMBoardMstr0004:s=>{f.callService("SCMBoardMstr0004",{boardMstrId:i.getFieldValue("boardMstrId"),...s},{isPopup:!0}).then(r=>{console.log("문의/신고 제출 응답:",r),t.message.success("수정이 완료되었습니다."),k()}).catch(r=>{console.error("문의/신고 변경 실패:",r)})},SCMBoardMstr0005:()=>{f.callService("SCMBoardMstr0005",{boardMstrId:i.getFieldValue("boardMstrId")},{isPopup:!0}).then(s=>{console.log("문의/신고 삭제 응답:",s),t.message.success("삭제가 완료되었습니다."),k()})},SCMBoardDtls0001:s=>{S(!0),f.callService("SCMBoardDtls0001",{boardMstrId:s},{isPopup:!0,showLoading:!1}).then(r=>{if(r&&r.subList){const o=r.subList.map(m=>({id:m.seq,author:m.userNm||m.regUserId,regUserId:m.regUserId,content:m.content,regDt:m.regDt}));U(o)}else U([])}).catch(r=>{console.error("게시글 댓글 목록 조회 실패:",r),t.message.error("댓글 목록 조회 중 오류가 발생했습니다.")}).finally(()=>{S(!1),N(15)})},SCMBoardDtls0002:(s,r)=>{S(!0),f.callService("SCMBoardDtls0002",{boardMstrId:s,content:r},{isPopup:!0,showLoading:!1}).then(o=>{o&&o.result===1?(t.message.success("댓글이 등록되었습니다."),u.SCMBoardDtls0001(s)):t.message.error("댓글 등록에 실패했습니다.")}).catch(o=>{t.message.error("댓글 등록 중 오류가 발생했습니다.")}).finally(()=>{S(!1)})},SCMBoardDtls0003:(s,r)=>{S(!0),f.callService("SCMBoardDtls0003",{boardMstrId:s,seq:r},{isPopup:!0,showLoading:!1}).then(o=>{o&&o.result===1?(t.message.success("댓글이 삭제되었습니다."),u.SCMBoardDtls0001(s)):t.message.error("댓글 삭제에 실패했습니다.")}).catch(o=>{t.message.error("댓글 삭제 중 오류가 발생했습니다.")}).finally(()=>{S(!1)})}},me=()=>{switch(d){case"list":return[{id:"REFRESH",label:"조회",type:"default",onClick:()=>u.SCMBoardMstr0001(),disabled:z},{id:"NEW",label:"신규 등록",type:"primary",onClick:le}];case"detail":return[{id:"BACK",label:"뒤로",type:"default",onClick:ne},{id:"EDIT",label:"수정",type:"primary",disabled:!M||g,onClick:()=>i.submit()},{id:"DELETE",label:"삭제",type:"default",disabled:!M||g,onClick:te}];case"new":return[{id:"SUBMIT",label:"제출",type:"primary",onClick:()=>i.submit(),disabled:z},{id:"CANCEL",label:"취소",type:"default",onClick:se}];default:return[]}},xe={};return e.jsxs(h.BwgPopup,{popup:y,buttons:me(),popupEvent:xe,onClose:re,children:[d==="list"&&de(),d==="detail"&&ce(),d==="new"&&ue()]})};exports.default=ye;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@ant-design/icons"),t=require("antd"),pe=require("dayjs"),n=require("react"),G=require("../stores/index.cjs"),h=require("./common-components-CyqUT5Vj.cjs"),l=require("../components/core/index.cjs"),f=require("../utils/index.cjs"),he=require("../provider/index.cjs"),{TextArea:ge}=t.Input,R=[{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],fe={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},Q=[{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],je={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},W={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},ye=({popup:y,onClose:O})=>{const{searchBoxRef:I}=he.useSearchBox(),b=n.useRef(null),E=n.useRef(null),{user:w}=G.useUserStore(),{activeMenuItem:c}=G.useMenuViewStore(),[i]=t.Form.useForm(),[z,L]=n.useState(!1),[V,A]=n.useState(!1),[M,H]=n.useState(!1),[g,J]=n.useState(!1),[a,S]=n.useState(!1),[d,j]=n.useState("list");n.useState(null);const D=n.useRef(null),[F,U]=n.useState([]),[B,Y]=n.useState(""),[P,Ce]=n.useState(!1),[$,N]=n.useState(15),T=n.useRef(null),K=n.useMemo(()=>h.createBwgGridRenderer((s,r,o,m,x)=>{const p=s.getValue(r.index?.itemIndex,"type");x.render(e.jsx(t.Tag,{color:fe[p],children:R.find(v=>v.value===p)?.label}))}),[]),X=n.useMemo(()=>h.createBwgGridRenderer((s,r,o,m,x)=>{const p=s.getValue(r.index?.itemIndex,"status");x.render(e.jsx(t.Tag,{color:je[p],children:Q.find(v=>v.value===p)?.label}))}),[]),Z=n.useMemo(()=>h.createBwgGridRenderer((s,r,o,m,x)=>{s.getValue(r.index?.itemIndex,"urgentYn")==="Y"?x.render(e.jsx(C.AlertTwoTone,{twoToneColor:"red"})):x.render(e.jsx(e.Fragment,{}))}),[]),_=[{fieldName:"boardMstrId",header:{text:"글 번호"},width:80},{name:"type",fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType"},{fieldName:"title",header:{text:"제목"},width:200},{fieldName:"content",header:{text:"내용"},width:200,visible:!1},{name:"status",fieldName:"status",header:{text:"상태"},width:80,renderer:"statusTag"},{fieldName:"rgstUserId",visible:!1},{fieldName:"rgstUserNm",header:{text:"등록자"},width:100},{fieldName:"rgstDt",header:{text:"등록일자"},width:120,renderer:f.realFormat.maskYmd},{fieldName:"dueDt",header:{text:"마감요청일자"},width:120,renderer:f.realFormat.maskYmd},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:100},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,renderer:f.realFormat.maskYmd},{fieldName:"scrnId",header:{text:"화면ID"},width:100,visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,visible:!1}],ee={onCellDblClicked:(s,r)=>{const o=r.itemIndex??-1;if(o<0)return;const m=s.getValues(o);console.log("🔍 그리드 셀 더블클릭 이벤트:",m);const x={...m,menuId:c?.menuId,menuNm:c?.menuNm,scrnId:c?.scrnId};i.setFieldsValue(x),H(x.rgstUserId===w?.userId),J(x.status==="COMPLETED"||x.status==="REJECTED"),j("detail")}},k=()=>{i.resetFields(),j("list"),u.SCMBoardMstr0001(1,20)},q=async s=>{L(!0);try{i.validateFields().then(r=>{console.log("문의/신고 제출:",r),d==="new"?u.SCMBoardMstr0003(r):d==="detail"&&u.SCMBoardMstr0004(r)})}catch(r){console.error("문의/신고 제출 실패:",r)}finally{L(!1)}},te=()=>{u.SCMBoardMstr0005()},se=()=>{I?.current?.resetForm(),i.resetFields(),d==="new"?j("list"):(j("list"),y?.close?.()||O?.())},re=()=>{I?.current?.resetForm(),i.resetFields(),j("list"),y?.close?.()||O?.()},ne=()=>{(d==="detail"||d==="new")&&j("list")},le=()=>{i.resetFields(),j("new")},ie=()=>{console.log("댓글 수동 새로고침"),N(15)},oe=()=>{if(!B.trim()){t.message.warning("댓글 상세내용 작성");return}u.SCMBoardDtls0002(i.getFieldValue("boardMstrId"),B.trim()),Y(""),setTimeout(()=>{D.current&&(D.current.scrollTop=D.current.scrollHeight)},100)},ae=s=>{const r=F.find(o=>o.id===s);if(r&&r.regUserId!==w?.userId){t.message.error("본인이 작성한 댓글만 삭제할 수 있습니다.");return}u.SCMBoardDtls0003(i.getFieldValue("boardMstrId"),s)};n.useEffect(()=>{y&&setTimeout(()=>{u.SCMBoardMstr0001(1,20)},100)},[y]);const de=()=>e.jsxs(h.ContentBox,{border:!1,children:[e.jsx(h.SearchBox,{border:!0,ref:I,reqRows:e.jsxs(e.Fragment,{children:[e.jsx(t.Row,{gutter:[16,8],style:{marginBottom:"8px"},children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgFormItem,{label:"화면 정보",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{disabled:!0})}),e.jsx(t.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{disabled:!0})})]})})})}),e.jsxs(t.Row,{gutter:[16,8],style:{marginBottom:"8px"},children:[e.jsx(t.Col,{span:6,children:e.jsx(l.BwgSelect,{itemProps:{label:"등록구분",name:"type"},selectProps:{options:R}})}),e.jsx(t.Col,{span:12,children:e.jsx(l.BwgRangePicker,{itemProps:{label:"등록일자",name:"rgstDt"},inputProps:{allowEmpty:!0}})}),e.jsx(t.Col,{span:6,children:e.jsx(l.BwgSwitch,{itemProps:{name:"myArticle",label:"내 글만"},inputProps:{format:"YN",onChange:()=>console.log("hello!!")}})})]}),e.jsx(t.Row,{children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgInput,{itemProps:{label:"제목 및 내용",name:"keyword"}})})})]})}),e.jsx(h.BwgGrid,{ref:T,gridColumns:_,gridEvents:ee,gridOptions:{},renderers:[{name:"tagType",renderer:K},{name:"statusTag",renderer:X},{name:"alert",renderer:Z}]}),e.jsx(h.BwgPagination,{ref:b,mode:"server",onServerPageChange:(s,r)=>{console.log("🔄 서버 모드 페이징 변경:",{page:s,size:r}),u.SCMBoardMstr0001(s,r)},pageSizeOptions:[10,20,50,100]})]}),ce=()=>e.jsxs(t.Splitter,{children:[e.jsx(t.Splitter.Panel,{defaultSize:"70%",min:"60%",max:"80%",style:{paddingRight:"15px",overflowX:"hidden",overflowY:"hidden"},children:e.jsx(h.ContentBox,{children:e.jsxs(t.Form,{form:i,onFinish:q,labelCol:{flex:"100px"},disabled:!M||g,children:[e.jsxs(t.Row,{gutter:[16,8],children:[e.jsxs(t.Col,{span:8,children:[e.jsx(t.Form.Item,{name:"boardMstrId",hidden:!0,children:e.jsx(t.Input,{})}),e.jsx(l.BwgSelect,{itemProps:{name:"type",label:"구분"},selectProps:{options:R}})]}),e.jsxs(t.Col,{span:16,children:[e.jsx(l.BwgFormItem,{label:"화면 정보",name:void 0,children:e.jsxs(t.Space.Compact,{children:[e.jsx(t.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})}),e.jsx(t.Form.Item,{name:"scrnId",style:{width:"100%"},hidden:!0,children:e.jsx(t.Input,{readOnly:!0})})]})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgFormItem,{label:"작성자",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"rgstUserId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgDatePicker,{itemProps:{label:"작성일자",name:"rgstDt"},inputProps:{disabled:!0}})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgSelect,{itemProps:{name:"status",label:"상태"},selectProps:{options:Q,disabled:!0}})})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgDatePicker,{itemProps:{label:"마감요청일",name:"dueDate"}})}),e.jsx(t.Col,{span:8,children:e.jsxs(t.Flex,{vertical:!0,gap:2,children:[e.jsx("span",{style:{fontSize:"12px",color:"#000000E0"},children:"진척률"}),e.jsx(t.Progress,{percent:W[i.getFieldValue("status")],status:W[i.getFieldValue("status")]>0?"active":"normal",size:"small",format:s=>`${s}%`})]})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"}})})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgFormItem,{label:"처리담당자",name:void 0,help:"",children:e.jsxs(t.Space.Compact,{children:[e.jsx(t.Form.Item,{name:"processor",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"processorNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})})}),e.jsx(t.Col,{span:8,children:e.jsx(l.BwgDatePicker,{itemProps:{label:"처리일자",name:"processDt"}})})]}),e.jsx(t.Row,{gutter:[16,8],children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgFormItem,{label:"제목",name:"title",style:{width:"100%"},children:e.jsx(t.Input,{})})})}),e.jsx(h.BwgEditor,{border:!1,itemProps:{name:"content",label:"내용",rules:[{required:!0,message:"내용을 입력하세요."}]},editorProps:{isEditing:M&&!g,title:{title:"에디터"}}})]})})}),e.jsx(t.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:e.jsxs(h.ContentBox,{style:{flex:"0 0 400px",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{borderBottom:"1px solid #e8e8e8",paddingBottom:"12px",marginBottom:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontSize:"14px",fontWeight:"600",color:"#262626"},children:"댓글"}),e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsx(t.Button,{type:"text",icon:e.jsx(C.ReloadOutlined,{spin:P||a}),onClick:ie,disabled:P||a,size:"small",style:{fontSize:"12px",color:g?"#d9d9d9":a?"#8c8c8c":"#595959",height:"24px",padding:"0 8px"}}),!g&&e.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",fontSize:"10px",fontWeight:"700",color:P?"#8c8c8c":"#1890ff",minWidth:"14px",height:"14px",lineHeight:"14px",textAlign:"center",borderRadius:"50%",pointerEvents:"none"},children:$})]})]}),e.jsx("div",{ref:D,style:{flex:1,overflowY:"auto",marginBottom:"16px",minHeight:0,position:"relative"},children:a?e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:[e.jsx("div",{style:{marginBottom:"12px"},children:e.jsx(C.ReloadOutlined,{spin:!0,style:{fontSize:"24px"}})}),e.jsx("div",{style:{fontSize:"13px"},children:"댓글을 불러오는 중..."})]}):F.length===0?e.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:e.jsx("div",{style:{fontSize:"13px"},children:"등록된 댓글이 없습니다."})}):e.jsx(t.List,{dataSource:F,renderItem:s=>e.jsxs(t.List.Item,{style:{position:"relative",paddingRight:"20px",padding:"12px 20px 12px 12px",borderBottom:"1px solid #f0f0f0"},children:[e.jsx(t.List.Item.Meta,{avatar:e.jsx(t.Avatar,{size:32,style:{backgroundColor:"#1890ff",fontSize:"13px"},children:s.author[0]}),title:e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[e.jsx("span",{style:{fontWeight:"500",fontSize:"13px",color:"#262626"},children:s.author}),e.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:s.regDt})]}),description:e.jsx("span",{style:{fontSize:"13px",color:"#595959",lineHeight:"1.5"},children:s.content})}),s.regUserId===w?.userId&&e.jsx(t.Button,{type:"text",danger:!0,icon:e.jsx(C.DeleteOutlined,{style:{fontSize:"12px"}}),size:"small",onClick:()=>ae(s.id),disabled:a,style:{position:"absolute",right:"8px",top:"62%",transform:"translateY(-50%)",opacity:a?.3:.5,height:"24px",width:"24px",padding:0},onMouseEnter:r=>{a||(r.currentTarget.style.opacity="1")},onMouseLeave:r=>{r.currentTarget.style.opacity=a?"0.3":"0.5"}})]},s.id)})}),e.jsx("div",{style:{padding:"12px",borderTop:"1px solid #e8e8e8",backgroundColor:g?"#f5f5f5":"#fafafa",flexShrink:0,marginTop:"auto"},children:g?e.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"#8c8c8c",fontSize:"13px",backgroundColor:"#ffffff",borderRadius:"6px",border:"1px solid #e8e8e8"},children:[e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(C.AlertTwoTone,{twoToneColor:"#faad14"})}),e.jsx("div",{children:"이미 완료처리된 게시글입니다."}),e.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"댓글을 작성할 수 없습니다."})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(ge,{rows:2,placeholder:a?"댓글 처리 중...":"댓글을 입력하세요...",value:B,onChange:s=>Y(s.target.value),maxLength:300,disabled:a,style:{borderRadius:"6px",border:"1px solid #d9d9d9",resize:"none",fontSize:"13px",backgroundColor:a?"#f5f5f5":"#ffffff",color:a?"#8c8c8c":"#000000"},onFocus:s=>{a||(s.target.style.borderColor="#1890ff",s.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.05)")},onBlur:s=>{s.target.style.borderColor="#d9d9d9",s.target.style.boxShadow="none"}})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:a?"처리 중...":`${B.length} / 300자`}),e.jsx(t.Button,{type:"primary",onClick:oe,size:"small",loading:a,style:{borderRadius:"4px",fontSize:"12px",height:"28px",padding:"0 16px",fontWeight:"500"},disabled:!B.trim()||a,children:a?"등록 중...":"등록"})]})]})})]})})]}),ue=()=>e.jsx(h.ContentBox,{children:e.jsxs(l.BwgForm,{form:i,onFinish:q,initialValues:{type:"INQR"},labelCol:{flex:"100px"},style:{height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgSelect,{itemProps:{name:"type",label:"구분",rules:[{required:!0,message:"구분을 선택해주세요."}]},selectProps:{options:R}})}),e.jsxs(t.Col,{span:16,children:[e.jsx(l.BwgFormItem,{label:"화면 정보",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})}),e.jsx(t.Form.Item,{name:"scrnId",style:{width:"100%"},hidden:!0,children:e.jsx(t.Input,{readOnly:!0})})]})]}),e.jsxs(t.Row,{gutter:[16,8],children:[e.jsx(t.Col,{span:8,children:e.jsx(l.BwgFormItem,{label:"작성자",name:void 0,children:e.jsxs(t.Space.Compact,{style:{width:"100%"},children:[e.jsx(t.Form.Item,{name:"rgstUserId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserNm",style:{width:"60%",marginBottom:0},children:e.jsx(t.Input,{readOnly:!0})})]})})}),e.jsx(t.Col,{span:6,children:e.jsx(l.BwgFormItem,{label:"작성일자",name:"rgstDt",style:{width:"100%"},children:e.jsx(t.DatePicker,{disabled:!0})})}),e.jsx(t.Col,{span:6,children:e.jsx(l.BwgFormItem,{label:"마감요청일",name:"dueDate",style:{width:"100%"},children:e.jsx(t.DatePicker,{})})}),e.jsx(t.Col,{span:4,children:e.jsx(l.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"}})})]}),e.jsx(t.Row,{gutter:[16,8],children:e.jsx(t.Col,{span:24,children:e.jsx(l.BwgFormItem,{label:"제목",name:"title",style:{width:"100%"},rules:[{required:!0,message:"제목을 입력해주세요."}],children:e.jsx(t.Input,{})})})}),e.jsx(h.BwgEditor,{border:!1,itemProps:{name:"content"},editorProps:{isEditing:V,title:{title:e.jsxs(e.Fragment,{children:[e.jsx(C.EditOutlined,{style:{marginRight:"5px"}})," 상세내용 작성"]}),children:e.jsx(t.Button,{icon:e.jsx(C.EyeFilled,{}),onClick:()=>A(!V),children:"미리보기"})}}})]})});n.useEffect(()=>{d==="new"&&(A(!0),i.setFieldsValue({type:"INQR",menuId:c?.menuId,menuNm:c?.menuNm,scrnId:c?.scrnId,rgstUserId:w?.userId,rgstUserNm:w?.userNm,rgstDt:pe(),content:""}))},[d,i,c,w]),n.useEffect(()=>{if(d==="detail"&&!g){const s=setInterval(()=>{N(r=>r<=1?(console.log("🔄 댓글 자동 갱신 실행 (카운트다운 완료)"),u.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),15):r-1)},1e3);return u.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),()=>{console.log("🧹 댓글 인터벌 정리"),clearInterval(s)}}else d==="detail"&&g&&(console.log("📋 완료된 게시글 - 댓글 조회만"),u.SCMBoardDtls0001(i.getFieldValue("boardMstrId")))},[d,g,i]),n.useEffect(()=>()=>{console.log("🧹 컴포넌트 언마운트 - 모든 인터벌 정리"),E.current&&(clearInterval(E.current),E.current=null)},[]),n.useEffect(()=>{d==="list"&&c&&(I?.current?.setFormData({menuId:c?.menuId,menuNm:c?.menuNm}),u.SCMBoardMstr0001(1,20))},[d,c]),n.useEffect(()=>{y&&c&&I?.current?.setFormData({menuId:c?.menuId,menuNm:c?.menuNm})},[y,c]);const u={SCMBoardMstr0001:async(s,r)=>{const o=s||b.current?.currentPage||1,m=r||b.current?.pageSize||20,x={...I?.current?.getFormData(),pageNum:o,pageCount:m};console.log("🔍 서버 모드 페이징 요청:",x);try{const p=await f.callService("SCMBoardMstr0001",x,{isPopup:!0});if(p&&p.pageList){const v=p.pageCnt||0;b.current?.setTotalData(v),T.current?.addAllData(p.pageList)}else b.current?.setTotalData(0),T.current?.addAllData([]),console.log("📭 서버 모드 페이징 데이터 없음")}catch(p){console.error("❌ SCMBoardMstr0001 호출 실패:",p),t.message.error("데이터 조회 중 오류가 발생했습니다.")}},SCMBoardMstr0003:s=>{f.callService("SCMBoardMstr0003",{...s,status:"READY"},{isPopup:!0}).then(r=>{console.log("문의/신고 제출 응답:",r),t.message.success("정상 접수되었습니다."),k()}).catch(r=>{console.error("문의/신고 제출 실패:",r),t.message.error("접수 중 오류가 발생했습니다.")})},SCMBoardMstr0004:s=>{f.callService("SCMBoardMstr0004",{boardMstrId:i.getFieldValue("boardMstrId"),...s},{isPopup:!0}).then(r=>{console.log("문의/신고 제출 응답:",r),t.message.success("수정이 완료되었습니다."),k()}).catch(r=>{console.error("문의/신고 변경 실패:",r)})},SCMBoardMstr0005:()=>{f.callService("SCMBoardMstr0005",{boardMstrId:i.getFieldValue("boardMstrId")},{isPopup:!0}).then(s=>{console.log("문의/신고 삭제 응답:",s),t.message.success("삭제가 완료되었습니다."),k()})},SCMBoardDtls0001:s=>{S(!0),f.callService("SCMBoardDtls0001",{boardMstrId:s},{isPopup:!0,showLoading:!1}).then(r=>{if(r&&r.subList){const o=r.subList.map(m=>({id:m.seq,author:m.userNm||m.regUserId,regUserId:m.regUserId,content:m.content,regDt:m.regDt}));U(o)}else U([])}).catch(r=>{console.error("게시글 댓글 목록 조회 실패:",r),t.message.error("댓글 목록 조회 중 오류가 발생했습니다.")}).finally(()=>{S(!1),N(15)})},SCMBoardDtls0002:(s,r)=>{S(!0),f.callService("SCMBoardDtls0002",{boardMstrId:s,content:r},{isPopup:!0,showLoading:!1}).then(o=>{o&&o.result===1?(t.message.success("댓글이 등록되었습니다."),u.SCMBoardDtls0001(s)):t.message.error("댓글 등록에 실패했습니다.")}).catch(o=>{t.message.error("댓글 등록 중 오류가 발생했습니다.")}).finally(()=>{S(!1)})},SCMBoardDtls0003:(s,r)=>{S(!0),f.callService("SCMBoardDtls0003",{boardMstrId:s,seq:r},{isPopup:!0,showLoading:!1}).then(o=>{o&&o.result===1?(t.message.success("댓글이 삭제되었습니다."),u.SCMBoardDtls0001(s)):t.message.error("댓글 삭제에 실패했습니다.")}).catch(o=>{t.message.error("댓글 삭제 중 오류가 발생했습니다.")}).finally(()=>{S(!1)})}},me=()=>{switch(d){case"list":return[{id:"REFRESH",label:"조회",type:"default",onClick:()=>u.SCMBoardMstr0001(),disabled:z},{id:"NEW",label:"신규 등록",type:"primary",onClick:le}];case"detail":return[{id:"BACK",label:"뒤로",type:"default",onClick:ne},{id:"EDIT",label:"수정",type:"primary",disabled:!M||g,onClick:()=>i.submit()},{id:"DELETE",label:"삭제",type:"default",disabled:!M||g,onClick:te}];case"new":return[{id:"SUBMIT",label:"제출",type:"primary",onClick:()=>i.submit(),disabled:z},{id:"CANCEL",label:"취소",type:"default",onClick:se}];default:return[]}},xe={};return e.jsxs(h.BwgPopup,{popup:y,buttons:me(),popupEvent:xe,onClose:re,children:[d==="list"&&de(),d==="detail"&&ce(),d==="new"&&ue()]})};exports.default=ye;
|
|
@@ -4,7 +4,7 @@ import { Form as d, Tag as oe, message as g, Row as x, Col as l, Space as D, Inp
|
|
|
4
4
|
import Ye from "dayjs";
|
|
5
5
|
import { useRef as O, useState as b, useMemo as J, useEffect as E } from "react";
|
|
6
6
|
import { useUserStore as Ge, useMenuViewStore as je } from "../stores/index.js";
|
|
7
|
-
import { m as $, n as qe, d as L, S as Qe, h as We, o as He, p as ce } from "./common-components-
|
|
7
|
+
import { m as $, n as qe, d as L, S as Qe, h as We, o as He, p as ce } from "./common-components-DNos8aEG.js";
|
|
8
8
|
import { BwgFormItem as I, BwgSelect as V, BwgRangePicker as Je, BwgSwitch as $e, BwgInput as Ke, BwgDatePicker as K, BwgCheck as me, BwgForm as Xe } from "../components/core/index.js";
|
|
9
9
|
import { callService as S, realFormat as X } from "../utils/index.js";
|
|
10
10
|
import { useSearchBox as Ze } from "../provider/index.js";
|