@bwg-ui/core 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/chunks/{CMSearchIntfGwP01-CuGDAfFM.cjs → CMSearchIntfGwP01-0t3umcc_.cjs} +1 -1
  2. package/dist/chunks/{CMSearchIntfGwP01-DBpDpgQr.js → CMSearchIntfGwP01-DCHZJn2H.js} +1 -1
  3. package/dist/chunks/{MenuReport-yw8tZDUk.cjs → MenuReport-C70mGz2g.cjs} +1 -1
  4. package/dist/chunks/{MenuReport-CCbCy7yt.js → MenuReport-IBdoU2S3.js} +2 -2
  5. package/dist/chunks/common-components-DNgQR-Ge.cjs +1109 -0
  6. package/dist/chunks/{common-components-DtzVj5lz.js → common-components-DeYL3J6X.js} +13058 -13574
  7. package/dist/chunks/layout-components-Bf9IsLUS.cjs +38 -0
  8. package/dist/chunks/{layout-components-ljht1sHh.js → layout-components-DnuV2Psp.js} +831 -759
  9. package/dist/chunks/provider-Bi5OYngn.cjs +1 -0
  10. package/dist/chunks/{provider-Kxea5IoZ.js → provider-Bx4VpaFf.js} +90 -74
  11. package/dist/components/common/BwgGrid.d.ts +31 -8
  12. package/dist/components/common/BwgGrid.d.ts.map +1 -1
  13. package/dist/components/common/BwgView.d.ts.map +1 -1
  14. package/dist/components/common/index.cjs +1 -1
  15. package/dist/components/common/index.js +1 -1
  16. package/dist/components/core/BwgEmpSearch.d.ts +2 -2
  17. package/dist/components/core/BwgEmpSearch.d.ts.map +1 -1
  18. package/dist/components/core/BwgMaskedDate.d.ts.map +1 -1
  19. package/dist/components/core/BwgMaskedRange.d.ts.map +1 -1
  20. package/dist/components/core/index.cjs +1 -1
  21. package/dist/components/core/index.js +211 -208
  22. package/dist/components/guide/index.cjs +1 -1
  23. package/dist/components/guide/index.js +2 -2
  24. package/dist/components/layout/AppWrapper.d.ts +5 -1
  25. package/dist/components/layout/AppWrapper.d.ts.map +1 -1
  26. package/dist/components/layout/BwgCoreLogin.d.ts.map +1 -1
  27. package/dist/components/layout/BwgPortal01.d.ts.map +1 -1
  28. package/dist/components/layout/extension/ContentWrapper.d.ts.map +1 -1
  29. package/dist/components/layout/index.cjs +1 -1
  30. package/dist/components/layout/index.js +1 -1
  31. package/dist/components/pages/board/CMMyBoardM01.d.ts.map +1 -1
  32. package/dist/components/pages/rsrc/CMPopuMstrM01.d.ts.map +1 -1
  33. package/dist/components/popup/SearchOrganizationP01.d.ts.map +1 -1
  34. package/dist/components/popup/SearchOrganizationP02.d.ts.map +1 -1
  35. package/dist/components/popup/index.cjs +1 -1
  36. package/dist/components/popup/index.js +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +273 -271
  39. package/dist/provider/contexts/PageContentContext.d.ts +23 -0
  40. package/dist/provider/contexts/PageContentContext.d.ts.map +1 -0
  41. package/dist/provider/contexts/index.d.ts +1 -0
  42. package/dist/provider/contexts/index.d.ts.map +1 -1
  43. package/dist/provider/index.cjs +1 -1
  44. package/dist/provider/index.js +21 -19
  45. package/dist/public/realgrid/css/realgrid-style-custom.css +6 -10
  46. package/dist/stores/index.cjs +1 -1
  47. package/dist/stores/index.js +1 -1
  48. package/dist/styles/assets/images/backgrounds/kiam_login_bg.png +0 -0
  49. package/dist/styles/assets/images/header/icon/ico-bell.svg +3 -3
  50. package/dist/styles/assets/images/header/icon/ico-logout.svg +10 -10
  51. package/dist/styles/assets/images/header/icon/ico-setting.svg +4 -4
  52. package/dist/styles/assets/images/header/icon/ico-sidebar-arrow.svg +3 -3
  53. package/dist/styles/components_02.css +35 -0
  54. package/dist/styles/global.css +9 -1
  55. package/dist/styles/index.css +3 -0
  56. package/dist/styles/layout.css +14 -4
  57. package/dist/styles/layout_02.css +99 -0
  58. package/dist/styles/login.css +7 -44
  59. package/dist/styles/login_02.css +35 -0
  60. package/dist/utils/apiUtils.d.ts.map +1 -1
  61. package/dist/utils/index.cjs +1 -1
  62. package/dist/utils/index.d.ts +16 -22
  63. package/dist/utils/index.d.ts.map +1 -1
  64. package/dist/utils/index.js +1253 -1222
  65. package/dist/utils/messageUtils.d.ts +36 -48
  66. package/dist/utils/messageUtils.d.ts.map +1 -1
  67. package/dist/utils/modalUtils.d.ts +68 -0
  68. package/dist/utils/modalUtils.d.ts.map +1 -0
  69. package/dist/utils/notificationUtils.d.ts +50 -41
  70. package/dist/utils/notificationUtils.d.ts.map +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunks/common-components-CbkWoYfX.cjs +0 -1111
  73. package/dist/chunks/layout-components-BzLAGXiu.cjs +0 -38
  74. package/dist/chunks/provider-r4mkv5Zs.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),U=require("@ant-design/icons"),L=require("antd"),o=require("react"),p=require("dayjs"),l=require("./common-components-CbkWoYfX.cjs"),h=require("../components/core/index.cjs"),F=require("../utils/index.cjs"),W=[{label:"전체",value:""},{label:"기안",value:"DRAFT"},{label:"결재중",value:"IN_PROGRESS"},{label:"승인",value:"APPROVED"},{label:"반려",value:"REJECTED"}],Y=({popup:i,onClose:G})=>{const D=o.useRef(null),P=o.useRef(null),B=o.useRef(null),[j,v]=o.useState([]),[k,A]=o.useState(!1),[m,N]=o.useState(null),[I,E]=o.useState(1),[C,M]=o.useState(10),[K,O]=o.useState(0),T=o.useMemo(()=>{const a=p(),c=[];for(let s=1;s<=120;s++){const n=["DRAFT","IN_PROGRESS","APPROVED","REJECTED"];c.push({gwDcmtKey:`GW-${String(1e4+s)}`,gwDcmtNm:`업무 기안서 #${s}`,userId:`user${s%7+1}`,dprtNo:["HR","GEN","DEV1","DEV2","FIN"][s%5],aprvStts:n[s%n.length],aprvKey:F.generateUID(),createdAt:a.add(-(s%45),"day").hour(9+s%8).toISOString()})}return c},[]),w=o.useCallback(async(a,c)=>{A(!0),N(null);try{const s=B.current?.getFormData?.()??{},n=a??I,f=c??C,u={...s,page:n,pageSize:f},y=i?.popupParams?.serviceCode;if(y){const r=await F.callService(y,u),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}));v(d),O(Number(r?.totalCount??r?.total??d.length));return}const S=T.filter(r=>{const d=u.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),R=!u.status||r.aprvStts===u.status,g=u.createdAt,H=!g||(p(r.createdAt).isAfter(g[0].startOf("day"))||p(r.createdAt).isSame(g[0],"day"))&&(p(r.createdAt).isBefore(g[1].endOf("day"))||p(r.createdAt).isSame(g[1],"day"));return t&&R&&H});O(S.length);const x=(n-1)*f,$=S.slice(x,x+f);v($)}catch{L.message.error("목록 조회 중 오류가 발생했습니다.")}finally{A(!1)}},[I,C,i?.popupParams,T]);o.useEffect(()=>{w()},[]);const q=o.useCallback(()=>{E(1),w(1,C)},[w,C]),z=o.useCallback((a,c)=>{E(a),M(c),w(a,c)},[w]),b=o.useCallback(()=>{if(!m){L.message.warning("항목을 선택해주세요.");return}const a=i?.config;a?.onSelect?a.onSelect(m):i?.popupParams?.onSelect?i.popupParams.onSelect(m):i?.config?.callback&&i.config.callback(m),a?.onClose?.(),i?.close?.()},[m,i]),J=o.useMemo(()=>[{fieldName:"gwDcmtKey",name:"gwDcmtKey",header:{text:"문서번호"},width:140},{fieldName:"gwDcmtNm",name:"gwDcmtNm",header:{text:"제목"},width:260,button:"action"},{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}],[]),_=o.useMemo(()=>({header:{height:40},display:{rowHeight:36},container:{indicator:!0,check:!1,footer:!1},edit:{editable:!1}}),[]),V=o.useMemo(()=>({onCellClicked:(a,c)=>{try{const s=c?.itemIndex??c?.dataRow??-1;if(s<0)return;const n=a.getDataSource()?.getJsonRow(s);n&&N(n)}catch{}},onCellDblClicked:(a,c)=>{try{const s=c?.itemIndex??c?.dataRow??-1;if(s<0)return;const n=a.getDataSource()?.getJsonRow(s);n&&(N(n),setTimeout(()=>b(),0))}catch{}},onCellButtonClicked(a,c,s){if(c.dataRow===void 0)return;let n=a.getDataSource().getJsonRow(c.dataRow);const f="https://kgwd.krx.co.kr/ezConn/ezApprGate.do",u="width=1000,height=600";console.log(n);const y=n?.dprtNo,S=n?.emplNo,x=n?.aprvKey,r=`${n?.formId}:${y}:${S}:${x}:SAMP`;console.log("@@ params",r);const d=new TextEncoder().encode(r),t=Array.from(d,g=>String.fromCharCode(g)).join(""),R=`${f}?connkey=${btoa(t)}`;console.log("@@ url",R),window.open(R,"_blank",u)}}),[b]);return o.useEffect(()=>{D.current&&D.current.addAllData(j||[])},[j]),o.useEffect(()=>{P.current&&P.current.setTotalData(K||0)},[K]),e.jsx(l.BwgPopup,{popup:i,buttons:[{id:"confirm",label:"확인",type:"primary",onClick:b}],onClose:()=>{i?.config?.onClose?.(),G?.(),i?.close?.()},children:e.jsx(l.ContentLayOut,{children:e.jsxs(l.ContentBox,{border:!1,style:{paddingBottom:16},children:[e.jsx(l.SearchBox,{ref:B,reqRows:e.jsx(e.Fragment,{children:e.jsx(l.BwgRow,{children:e.jsxs(l.BwgCol,{span:24,children:[e.jsx(l.BwgTitleBox,{title:"기안 검색"}),e.jsxs(l.BwgRow,{gutter:[12,8],style:{marginTop:8},children:[e.jsx(l.BwgCol,{span:8,children:e.jsx(h.BwgInput,{inputProps:{placeholder:"제목/기안자/부서/문서번호",prefix:e.jsx(U.SearchOutlined,{}),allowClear:!0,onPressEnter:q},itemProps:{name:"keyword"}})}),e.jsx(l.BwgCol,{span:6,children:e.jsx(h.BwgSelect,{selectProps:{options:W},itemProps:{label:"상태",name:"status"}})}),e.jsxs(l.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(l.BwgCol,{span:2,children:e.jsx(h.BwgButton,{type:"primary",onClick:q,loading:k,style:{width:"100%"},children:"검색"})})]})]})})})}),e.jsx(l.BwgGrid,{ref:D,type:"nrml",gridColumns:J,gridOptions:_,gridEvents:V}),e.jsx(l.BwgPagination,{ref:P,mode:"server",onServerPageChange:z,pageSizeOptions:[10,20,50,100]}),j.length===0&&!k&&e.jsx(l.BwgRow,{style:{display:"none"},children:e.jsx(l.BwgCol,{span:24,children:e.jsx("span",{})})})]})})})};exports.default=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),U=require("@ant-design/icons"),L=require("antd"),o=require("react"),p=require("dayjs"),l=require("./common-components-DNgQR-Ge.cjs"),h=require("../components/core/index.cjs"),F=require("../utils/index.cjs"),W=[{label:"전체",value:""},{label:"기안",value:"DRAFT"},{label:"결재중",value:"IN_PROGRESS"},{label:"승인",value:"APPROVED"},{label:"반려",value:"REJECTED"}],Y=({popup:i,onClose:G})=>{const D=o.useRef(null),P=o.useRef(null),B=o.useRef(null),[j,v]=o.useState([]),[k,A]=o.useState(!1),[m,N]=o.useState(null),[I,E]=o.useState(1),[C,M]=o.useState(10),[K,O]=o.useState(0),T=o.useMemo(()=>{const a=p(),c=[];for(let s=1;s<=120;s++){const n=["DRAFT","IN_PROGRESS","APPROVED","REJECTED"];c.push({gwDcmtKey:`GW-${String(1e4+s)}`,gwDcmtNm:`업무 기안서 #${s}`,userId:`user${s%7+1}`,dprtNo:["HR","GEN","DEV1","DEV2","FIN"][s%5],aprvStts:n[s%n.length],aprvKey:F.generateUID(),createdAt:a.add(-(s%45),"day").hour(9+s%8).toISOString()})}return c},[]),w=o.useCallback(async(a,c)=>{A(!0),N(null);try{const s=B.current?.getFormData?.()??{},n=a??I,f=c??C,u={...s,page:n,pageSize:f},y=i?.popupParams?.serviceCode;if(y){const r=await F.callService(y,u),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}));v(d),O(Number(r?.totalCount??r?.total??d.length));return}const S=T.filter(r=>{const d=u.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),R=!u.status||r.aprvStts===u.status,g=u.createdAt,H=!g||(p(r.createdAt).isAfter(g[0].startOf("day"))||p(r.createdAt).isSame(g[0],"day"))&&(p(r.createdAt).isBefore(g[1].endOf("day"))||p(r.createdAt).isSame(g[1],"day"));return t&&R&&H});O(S.length);const x=(n-1)*f,$=S.slice(x,x+f);v($)}catch{L.message.error("목록 조회 중 오류가 발생했습니다.")}finally{A(!1)}},[I,C,i?.popupParams,T]);o.useEffect(()=>{w()},[]);const q=o.useCallback(()=>{E(1),w(1,C)},[w,C]),z=o.useCallback((a,c)=>{E(a),M(c),w(a,c)},[w]),b=o.useCallback(()=>{if(!m){L.message.warning("항목을 선택해주세요.");return}const a=i?.config;a?.onSelect?a.onSelect(m):i?.popupParams?.onSelect?i.popupParams.onSelect(m):i?.config?.callback&&i.config.callback(m),a?.onClose?.(),i?.close?.()},[m,i]),J=o.useMemo(()=>[{fieldName:"gwDcmtKey",name:"gwDcmtKey",header:{text:"문서번호"},width:140},{fieldName:"gwDcmtNm",name:"gwDcmtNm",header:{text:"제목"},width:260,button:"action"},{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}],[]),_=o.useMemo(()=>({header:{height:40},display:{rowHeight:36},container:{indicator:!0,check:!1,footer:!1},edit:{editable:!1}}),[]),V=o.useMemo(()=>({onCellClicked:(a,c)=>{try{const s=c?.itemIndex??c?.dataRow??-1;if(s<0)return;const n=a.getDataSource()?.getJsonRow(s);n&&N(n)}catch{}},onCellDblClicked:(a,c)=>{try{const s=c?.itemIndex??c?.dataRow??-1;if(s<0)return;const n=a.getDataSource()?.getJsonRow(s);n&&(N(n),setTimeout(()=>b(),0))}catch{}},onCellButtonClicked(a,c,s){if(c.dataRow===void 0)return;let n=a.getDataSource().getJsonRow(c.dataRow);const f="https://kgwd.krx.co.kr/ezConn/ezApprGate.do",u="width=1000,height=600";console.log(n);const y=n?.dprtNo,S=n?.emplNo,x=n?.aprvKey,r=`${n?.formId}:${y}:${S}:${x}:SAMP`;console.log("@@ params",r);const d=new TextEncoder().encode(r),t=Array.from(d,g=>String.fromCharCode(g)).join(""),R=`${f}?connkey=${btoa(t)}`;console.log("@@ url",R),window.open(R,"_blank",u)}}),[b]);return o.useEffect(()=>{D.current&&D.current.addAllData(j||[])},[j]),o.useEffect(()=>{P.current&&P.current.setTotalData(K||0)},[K]),e.jsx(l.BwgPopup,{popup:i,buttons:[{id:"confirm",label:"확인",type:"primary",onClick:b}],onClose:()=>{i?.config?.onClose?.(),G?.(),i?.close?.()},children:e.jsx(l.ContentLayOut,{children:e.jsxs(l.ContentBox,{border:!1,style:{paddingBottom:16},children:[e.jsx(l.SearchBox,{ref:B,reqRows:e.jsx(e.Fragment,{children:e.jsx(l.BwgRow,{children:e.jsxs(l.BwgCol,{span:24,children:[e.jsx(l.BwgTitleBox,{title:"기안 검색"}),e.jsxs(l.BwgRow,{gutter:[12,8],style:{marginTop:8},children:[e.jsx(l.BwgCol,{span:8,children:e.jsx(h.BwgInput,{inputProps:{placeholder:"제목/기안자/부서/문서번호",prefix:e.jsx(U.SearchOutlined,{}),allowClear:!0,onPressEnter:q},itemProps:{name:"keyword"}})}),e.jsx(l.BwgCol,{span:6,children:e.jsx(h.BwgSelect,{selectProps:{options:W},itemProps:{label:"상태",name:"status"}})}),e.jsxs(l.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(l.BwgCol,{span:2,children:e.jsx(h.BwgButton,{type:"primary",onClick:q,loading:k,style:{width:"100%"},children:"검색"})})]})]})})})}),e.jsx(l.BwgGrid,{ref:D,type:"nrml",gridColumns:J,gridOptions:_,gridEvents:V}),e.jsx(l.BwgPagination,{ref:P,mode:"server",onServerPageChange:z,pageSizeOptions:[10,20,50,100]}),j.length===0&&!k&&e.jsx(l.BwgRow,{style:{display:"none"},children:e.jsx(l.BwgCol,{span:24,children:e.jsx("span",{})})})]})})})};exports.default=Y;
@@ -3,7 +3,7 @@ import { SearchOutlined as ee } from "@ant-design/icons";
3
3
  import { message as V } from "antd";
4
4
  import { useRef as x, useState as m, useMemo as N, useCallback as R, useEffect as B } from "react";
5
5
  import p from "dayjs";
6
- import { m as te, C as ae, d as oe, S as re, i as E, j as g, e as ne, h as se, n as ce } from "./common-components-DtzVj5lz.js";
6
+ import { m as te, C as ae, d as oe, S as re, i as E, j as g, e as ne, h as se, n as ce } from "./common-components-DeYL3J6X.js";
7
7
  import { BwgInput as le, BwgSelect as de, BwgRangePicker as M, BwgButton as ie } from "../components/core/index.js";
8
8
  import { generateUID as me, callService as ge } from "../utils/index.js";
9
9
  const fe = [
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),I=require("@ant-design/icons"),t=require("antd"),he=require("dayjs"),n=require("react"),G=require("../stores/index.cjs"),f=require("./common-components-CbkWoYfX.cjs"),h=require("../utils/index.cjs"),l=require("../components/core/index.cjs"),ge=require("./provider-r4mkv5Zs.cjs"),{TextArea:fe}=t.Input,F=[{label:"전체",value:""},{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],je={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},Q=[{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],ye={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},W={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},Ie=({popup:S,onClose:O})=>{const{searchBoxRef:y}=ge.useSearchBox(),b=n.useRef(null),N=n.useRef(null),{user:C,hrInfo:H}=G.useUserStore(),{activeMenuItem:o}=G.useMenuViewStore(),[i]=t.Form.useForm(),[z,U]=n.useState(!1),[L,V]=n.useState(!1),[D,J]=n.useState(!1),[g,$]=n.useState(!1),[d,w]=n.useState(!1),[c,j]=n.useState("list");n.useState(null);const M=n.useRef(null),[R,A]=n.useState([]),[B,Y]=n.useState(""),[E,Ce]=n.useState(!1),[K,P]=n.useState(15),T=n.useRef(null),X=n.useMemo(()=>h.createBwgGridRenderer((s,r,a,u,p)=>{const x=s.getValue(r.index?.itemIndex,"type");p.render(e.jsx(t.Tag,{color:je[x],children:F.find(v=>v.value===x)?.label}))}),[]),Z=n.useMemo(()=>h.createBwgGridRenderer((s,r,a,u,p)=>{const x=s.getValue(r.index?.itemIndex,"status");p.render(e.jsx(t.Tag,{color:ye[x],children:Q.find(v=>v.value===x)?.label}))}),[]),_=n.useMemo(()=>h.createBwgGridRenderer((s,r,a,u,p)=>{s.getValue(r.index?.itemIndex,"urgentYn")==="Y"?p.render(e.jsx(I.AlertTwoTone,{twoToneColor:"red"})):p.render(e.jsx(e.Fragment,{}))}),[]),ee=[{fieldName:"boardMstrId",header:{text:"글 번호"},width:80},{name:"type",fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType"},{fieldName:"title",header:{text:"제목"},width:200,styleName:"left"},{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,styleName:"left"},{fieldName:"rgstUserDeptNm",visible:!1},{fieldName:"rgstDt",header:{text:"등록일자"},width:120,textFormat:h.realFormat.formatYmd,styleName:"right"},{fieldName:"dueDt",header:{text:"마감요청일자"},width:120,textFormat:h.realFormat.formatYmd,styleName:"right"},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:100,styleName:"left"},{fieldName:"prcsUserDeptNm",visible:!1},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,textFormat:h.realFormat.formatYmd,styleName:"right"},{fieldName:"scrnId",header:{text:"화면ID"},width:100,visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,visible:!1}],te={onCellDblClicked:(s,r)=>{const a=r.itemIndex??-1;if(a<0)return;const u=s.getValues(a);console.log("🔍 그리드 셀 더블클릭 이벤트:",u);const p={...u,menuId:o?.menuId,menuNm:o?.menuNm,scrnId:o?.scrnId};i.setFieldsValue(p),J(p.rgstUserId===C?.userId),$(p.status==="COMPLETED"||p.status==="REJECTED"),j("detail")}},k=()=>{i.resetFields(),j("list"),y?.current?.setFormData({menuId:o?.menuId,menuNm:o?.menuNm}),m.SCMBoardMstr0001(1,20)},q=async s=>{U(!0);try{i.validateFields().then(r=>{console.log("문의/신고 제출:",r),c==="new"?m.SCMBoardMstr0003(r):c==="detail"&&m.SCMBoardMstr0004(r)})}catch(r){console.error("문의/신고 제출 실패:",r)}finally{U(!1)}},se=()=>{m.SCMBoardMstr0005()},re=()=>{y?.current?.resetForm(),i.resetFields(),c==="new"?j("list"):(j("list"),O?.())},ne=()=>{y?.current?.resetForm(),i.resetFields(),j("list"),O?.()},le=()=>{(c==="detail"||c==="new")&&j("list")},ie=()=>{i.resetFields(),j("new")},ae=()=>{console.log("댓글 수동 새로고침"),P(15)},oe=()=>{if(!B.trim()){t.message.warning("댓글 상세내용 작성");return}m.SCMBoardDtls0002(i.getFieldValue("boardMstrId"),B.trim()),Y(""),setTimeout(()=>{M.current&&(M.current.scrollTop=M.current.scrollHeight)},100)},de=s=>{const r=R.find(a=>a.id===s);if(r&&r.regUserId!==C?.userId){t.message.error("본인이 작성한 댓글만 삭제할 수 있습니다.");return}m.SCMBoardDtls0003(i.getFieldValue("boardMstrId"),s)};n.useEffect(()=>{S&&setTimeout(()=>{m.SCMBoardMstr0001(1,20)},100)},[S]);const ce=()=>e.jsxs(f.ContentBox,{border:!1,children:[e.jsx(f.SearchBox,{border:!0,ref:y,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:F}})}),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(f.BwgGrid,{ref:T,gridColumns:ee,gridEvents:te,gridOptions:{},renderers:[{name:"tagType",renderer:X},{name:"statusTag",renderer:Z},{name:"alert",renderer:_}]}),e.jsx(f.BwgPagination,{ref:b,mode:"server",onServerPageChange:(s,r)=>{console.log("🔄 서버 모드 페이징 변경:",{page:s,size:r}),m.SCMBoardMstr0001(s,r)},pageSizeOptions:[10,20,50,100]})]}),me=()=>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(f.ContentBox,{children:e.jsxs(t.Form,{form:i,onFinish:q,labelCol:{flex:"100px"},disabled:!D||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:F}})]}),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:"rgstUserDeptNm",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserId",hidden:!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"},inputProps:{disabled:!0}})}),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:"긴급여부"},inputProps:{disabled:!0}})})]}),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:"prcsUserDeptNm",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"prcsUserId",hidden:!0}),e.jsx(t.Form.Item,{name:"prcsUserNm",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:"prcsDt"}})})]}),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(f.BwgEditor,{border:!1,itemProps:{name:"content",label:"내용",rules:[{required:!0,message:"내용을 입력하세요."}]},editorProps:{isEditing:D&&!g,title:{title:"에디터"}}})]})})}),e.jsx(t.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:e.jsxs(f.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(I.ReloadOutlined,{spin:E||d}),onClick:ae,disabled:E||d,size:"small",style:{fontSize:"12px",color:g?"#d9d9d9":d?"#8c8c8c":"#595959",height:"24px",padding:"0 8px"}}),!g&&e.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",fontSize:"10px",fontWeight:"700",color:E?"#8c8c8c":"#1890ff",minWidth:"14px",height:"14px",lineHeight:"14px",textAlign:"center",borderRadius:"50%",pointerEvents:"none"},children:K})]})]}),e.jsx("div",{ref:M,style:{flex:1,overflowY:"auto",marginBottom:"16px",minHeight:0,position:"relative"},children:d?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(I.ReloadOutlined,{spin:!0,style:{fontSize:"24px"}})}),e.jsx("div",{style:{fontSize:"13px"},children:"댓글을 불러오는 중..."})]}):R.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:R,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===C?.userId&&e.jsx(t.Button,{type:"text",danger:!0,icon:e.jsx(I.DeleteOutlined,{style:{fontSize:"12px"}}),size:"small",onClick:()=>de(s.id),disabled:d,style:{position:"absolute",right:"8px",top:"62%",transform:"translateY(-50%)",opacity:d?.3:.5,height:"24px",width:"24px",padding:0},onMouseEnter:r=>{d||(r.currentTarget.style.opacity="1")},onMouseLeave:r=>{r.currentTarget.style.opacity=d?"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(I.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(fe,{rows:2,placeholder:d?"댓글 처리 중...":"댓글을 입력하세요...",value:B,onChange:s=>Y(s.target.value),maxLength:300,disabled:d,style:{borderRadius:"6px",border:"1px solid #d9d9d9",resize:"none",fontSize:"13px",backgroundColor:d?"#f5f5f5":"#ffffff",color:d?"#8c8c8c":"#000000"},onFocus:s=>{d||(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:d?"처리 중...":`${B.length} / 300자`}),e.jsx(t.Button,{type:"primary",onClick:oe,size:"small",loading:d,style:{borderRadius:"4px",fontSize:"12px",height:"28px",padding:"0 16px",fontWeight:"500"},disabled:!B.trim()||d,children:d?"등록 중...":"등록"})]})]})})]})})]}),ue=()=>e.jsx(f.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:[...F].filter(s=>s.value!=="")}})}),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:"rgstUserDeptNm",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserId",hidden:!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,{disabled:!0})})}),e.jsx(t.Col,{span:4,children:e.jsx(l.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"},inputProps:{disabled:!0}})})]}),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(f.BwgEditor,{border:!1,itemProps:{name:"content"},editorProps:{isEditing:L,title:{title:e.jsxs(e.Fragment,{children:[e.jsx(I.EditOutlined,{style:{marginRight:"5px"}})," 상세내용 작성"]}),children:e.jsx(t.Button,{icon:e.jsx(I.EyeFilled,{}),onClick:()=>V(!L),children:"미리보기"})}}})]})});n.useEffect(()=>{c==="new"&&(V(!0),i.setFieldsValue({type:"INQR",menuId:o?.menuId,menuNm:o?.menuNm,scrnId:o?.scrnId,rgstUserId:C?.userId,rgstUserNm:C?.userNm,rgstUserDeptNm:H?.deptNm,rgstDt:he(),content:""}))},[c,i,o,C]),n.useEffect(()=>{if(c==="detail"&&!g){const s=setInterval(()=>{P(r=>r<=1?(console.log("🔄 댓글 자동 갱신 실행 (카운트다운 완료)"),m.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),15):r-1)},1e3);return m.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),()=>{console.log("🧹 댓글 인터벌 정리"),clearInterval(s)}}else c==="detail"&&g&&(console.log("📋 완료된 게시글 - 댓글 조회만"),m.SCMBoardDtls0001(i.getFieldValue("boardMstrId")))},[c,g,i]),n.useEffect(()=>()=>{console.log("🧹 컴포넌트 언마운트 - 모든 인터벌 정리"),N.current&&(clearInterval(N.current),N.current=null)},[]),n.useEffect(()=>{c==="list"&&o&&(y?.current?.setFormData({menuId:o?.menuId,menuNm:o?.menuNm}),m.SCMBoardMstr0001(1,20))},[c,o]),n.useEffect(()=>{S&&o&&y?.current?.setFormData({menuId:o?.menuId,menuNm:o?.menuNm})},[S,o]);const m={SCMBoardMstr0001:async(s,r)=>{const a=s||b.current?.currentPage||1,u=r||b.current?.pageSize||20,p={...y?.current?.getFormData(),pageNum:a,pageCount:u};console.log("🔍 서버 모드 페이징 요청:",p);try{const x=await h.callService("SCMBoardMstr0001",p,{isPopup:!0});if(x&&x.pageList){const v=x.pageCnt||0;b.current?.setTotalData(v),T.current?.addAllData(x.pageList)}else b.current?.setTotalData(0),T.current?.addAllData([]),console.log("📭 서버 모드 페이징 데이터 없음")}catch(x){console.error("❌ SCMBoardMstr0001 호출 실패:",x),t.message.error("데이터 조회 중 오류가 발생했습니다.")}},SCMBoardMstr0003:s=>{h.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=>{h.callService("SCMBoardMstr0004",{boardMstrId:i.getFieldValue("boardMstrId"),...s},{isPopup:!0}).then(r=>{console.log("문의/신고 제출 응답:",r),t.message.success("수정이 완료되었습니다."),k()}).catch(r=>{console.error("문의/신고 변경 실패:",r)})},SCMBoardMstr0005:()=>{h.callService("SCMBoardMstr0005",{boardMstrId:i.getFieldValue("boardMstrId")},{isPopup:!0}).then(s=>{console.log("문의/신고 삭제 응답:",s),t.message.success("삭제가 완료되었습니다."),k()})},SCMBoardDtls0001:s=>{w(!0),h.callService("SCMBoardDtls0001",{boardMstrId:s},{isPopup:!0,showLoading:!1}).then(r=>{if(r&&r.subList){const a=r.subList.map(u=>({id:u.seq,author:u.userNm||u.regUserId,regUserId:u.regUserId,content:u.content,regDt:u.regDt}));A(a)}else A([])}).catch(r=>{console.error("게시글 댓글 목록 조회 실패:",r),t.message.error("댓글 목록 조회 중 오류가 발생했습니다.")}).finally(()=>{w(!1),P(15)})},SCMBoardDtls0002:(s,r)=>{w(!0),h.callService("SCMBoardDtls0002",{boardMstrId:s,content:r},{isPopup:!0,showLoading:!1}).then(a=>{a&&a.result===1?(t.message.success("댓글이 등록되었습니다."),m.SCMBoardDtls0001(s)):t.message.error("댓글 등록에 실패했습니다.")}).catch(a=>{t.message.error("댓글 등록 중 오류가 발생했습니다.")}).finally(()=>{w(!1)})},SCMBoardDtls0003:(s,r)=>{w(!0),h.callService("SCMBoardDtls0003",{boardMstrId:s,seq:r},{isPopup:!0,showLoading:!1}).then(a=>{a&&a.result===1?(t.message.success("댓글이 삭제되었습니다."),m.SCMBoardDtls0001(s)):t.message.error("댓글 삭제에 실패했습니다.")}).catch(a=>{t.message.error("댓글 삭제 중 오류가 발생했습니다.")}).finally(()=>{w(!1)})}},pe=()=>{switch(c){case"list":return[{id:"REFRESH",label:"조회",type:"default",onClick:()=>m.SCMBoardMstr0001(),disabled:z},{id:"NEW",label:"신규 등록",type:"primary",onClick:ie}];case"detail":return[{id:"BACK",label:"뒤로",type:"default",onClick:le},{id:"EDIT",label:"수정",type:"primary",disabled:!D||g,onClick:()=>i.submit()},{id:"DELETE",label:"삭제",type:"default",disabled:!D||g,onClick:se}];case"new":return[{id:"SUBMIT",label:"제출",type:"primary",onClick:()=>i.submit(),disabled:z},{id:"CANCEL",label:"취소",type:"default",onClick:re}];default:return[]}},xe={};return e.jsxs(f.BwgPopup,{popup:S,buttons:pe(),popupEvent:xe,onClose:ne,children:[c==="list"&&ce(),c==="detail"&&me(),c==="new"&&ue()]})};exports.default=Ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),I=require("@ant-design/icons"),t=require("antd"),he=require("dayjs"),n=require("react"),G=require("../stores/index.cjs"),f=require("./common-components-DNgQR-Ge.cjs"),h=require("../utils/index.cjs"),l=require("../components/core/index.cjs"),ge=require("./provider-Bi5OYngn.cjs"),{TextArea:fe}=t.Input,F=[{label:"전체",value:""},{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],je={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},Q=[{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],ye={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},W={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},Ie=({popup:S,onClose:O})=>{const{searchBoxRef:y}=ge.useSearchBox(),b=n.useRef(null),N=n.useRef(null),{user:C,hrInfo:H}=G.useUserStore(),{activeMenuItem:o}=G.useMenuViewStore(),[i]=t.Form.useForm(),[z,U]=n.useState(!1),[L,V]=n.useState(!1),[D,J]=n.useState(!1),[g,$]=n.useState(!1),[d,w]=n.useState(!1),[c,j]=n.useState("list");n.useState(null);const M=n.useRef(null),[R,A]=n.useState([]),[B,Y]=n.useState(""),[E,Ce]=n.useState(!1),[K,P]=n.useState(15),T=n.useRef(null),X=n.useMemo(()=>h.createBwgGridRenderer((s,r,a,u,p)=>{const x=s.getValue(r.index?.itemIndex,"type");p.render(e.jsx(t.Tag,{color:je[x],children:F.find(v=>v.value===x)?.label}))}),[]),Z=n.useMemo(()=>h.createBwgGridRenderer((s,r,a,u,p)=>{const x=s.getValue(r.index?.itemIndex,"status");p.render(e.jsx(t.Tag,{color:ye[x],children:Q.find(v=>v.value===x)?.label}))}),[]),_=n.useMemo(()=>h.createBwgGridRenderer((s,r,a,u,p)=>{s.getValue(r.index?.itemIndex,"urgentYn")==="Y"?p.render(e.jsx(I.AlertTwoTone,{twoToneColor:"red"})):p.render(e.jsx(e.Fragment,{}))}),[]),ee=[{fieldName:"boardMstrId",header:{text:"글 번호"},width:80},{name:"type",fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType"},{fieldName:"title",header:{text:"제목"},width:200,styleName:"left"},{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,styleName:"left"},{fieldName:"rgstUserDeptNm",visible:!1},{fieldName:"rgstDt",header:{text:"등록일자"},width:120,textFormat:h.realFormat.formatYmd,styleName:"right"},{fieldName:"dueDt",header:{text:"마감요청일자"},width:120,textFormat:h.realFormat.formatYmd,styleName:"right"},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:100,styleName:"left"},{fieldName:"prcsUserDeptNm",visible:!1},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,textFormat:h.realFormat.formatYmd,styleName:"right"},{fieldName:"scrnId",header:{text:"화면ID"},width:100,visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,visible:!1}],te={onCellDblClicked:(s,r)=>{const a=r.itemIndex??-1;if(a<0)return;const u=s.getValues(a);console.log("🔍 그리드 셀 더블클릭 이벤트:",u);const p={...u,menuId:o?.menuId,menuNm:o?.menuNm,scrnId:o?.scrnId};i.setFieldsValue(p),J(p.rgstUserId===C?.userId),$(p.status==="COMPLETED"||p.status==="REJECTED"),j("detail")}},k=()=>{i.resetFields(),j("list"),y?.current?.setFormData({menuId:o?.menuId,menuNm:o?.menuNm}),m.SCMBoardMstr0001(1,20)},q=async s=>{U(!0);try{i.validateFields().then(r=>{console.log("문의/신고 제출:",r),c==="new"?m.SCMBoardMstr0003(r):c==="detail"&&m.SCMBoardMstr0004(r)})}catch(r){console.error("문의/신고 제출 실패:",r)}finally{U(!1)}},se=()=>{m.SCMBoardMstr0005()},re=()=>{y?.current?.resetForm(),i.resetFields(),c==="new"?j("list"):(j("list"),O?.())},ne=()=>{y?.current?.resetForm(),i.resetFields(),j("list"),O?.()},le=()=>{(c==="detail"||c==="new")&&j("list")},ie=()=>{i.resetFields(),j("new")},ae=()=>{console.log("댓글 수동 새로고침"),P(15)},oe=()=>{if(!B.trim()){t.message.warning("댓글 상세내용 작성");return}m.SCMBoardDtls0002(i.getFieldValue("boardMstrId"),B.trim()),Y(""),setTimeout(()=>{M.current&&(M.current.scrollTop=M.current.scrollHeight)},100)},de=s=>{const r=R.find(a=>a.id===s);if(r&&r.regUserId!==C?.userId){t.message.error("본인이 작성한 댓글만 삭제할 수 있습니다.");return}m.SCMBoardDtls0003(i.getFieldValue("boardMstrId"),s)};n.useEffect(()=>{S&&setTimeout(()=>{m.SCMBoardMstr0001(1,20)},100)},[S]);const ce=()=>e.jsxs(f.ContentBox,{border:!1,children:[e.jsx(f.SearchBox,{border:!0,ref:y,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:F}})}),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(f.BwgGrid,{ref:T,gridColumns:ee,gridEvents:te,gridOptions:{},renderers:[{name:"tagType",renderer:X},{name:"statusTag",renderer:Z},{name:"alert",renderer:_}]}),e.jsx(f.BwgPagination,{ref:b,mode:"server",onServerPageChange:(s,r)=>{console.log("🔄 서버 모드 페이징 변경:",{page:s,size:r}),m.SCMBoardMstr0001(s,r)},pageSizeOptions:[10,20,50,100]})]}),me=()=>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(f.ContentBox,{children:e.jsxs(t.Form,{form:i,onFinish:q,labelCol:{flex:"100px"},disabled:!D||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:F}})]}),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:"rgstUserDeptNm",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserId",hidden:!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"},inputProps:{disabled:!0}})}),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:"긴급여부"},inputProps:{disabled:!0}})})]}),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:"prcsUserDeptNm",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"prcsUserId",hidden:!0}),e.jsx(t.Form.Item,{name:"prcsUserNm",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:"prcsDt"}})})]}),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(f.BwgEditor,{border:!1,itemProps:{name:"content",label:"내용",rules:[{required:!0,message:"내용을 입력하세요."}]},editorProps:{isEditing:D&&!g,title:{title:"에디터"}}})]})})}),e.jsx(t.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:e.jsxs(f.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(I.ReloadOutlined,{spin:E||d}),onClick:ae,disabled:E||d,size:"small",style:{fontSize:"12px",color:g?"#d9d9d9":d?"#8c8c8c":"#595959",height:"24px",padding:"0 8px"}}),!g&&e.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",fontSize:"10px",fontWeight:"700",color:E?"#8c8c8c":"#1890ff",minWidth:"14px",height:"14px",lineHeight:"14px",textAlign:"center",borderRadius:"50%",pointerEvents:"none"},children:K})]})]}),e.jsx("div",{ref:M,style:{flex:1,overflowY:"auto",marginBottom:"16px",minHeight:0,position:"relative"},children:d?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(I.ReloadOutlined,{spin:!0,style:{fontSize:"24px"}})}),e.jsx("div",{style:{fontSize:"13px"},children:"댓글을 불러오는 중..."})]}):R.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:R,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===C?.userId&&e.jsx(t.Button,{type:"text",danger:!0,icon:e.jsx(I.DeleteOutlined,{style:{fontSize:"12px"}}),size:"small",onClick:()=>de(s.id),disabled:d,style:{position:"absolute",right:"8px",top:"62%",transform:"translateY(-50%)",opacity:d?.3:.5,height:"24px",width:"24px",padding:0},onMouseEnter:r=>{d||(r.currentTarget.style.opacity="1")},onMouseLeave:r=>{r.currentTarget.style.opacity=d?"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(I.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(fe,{rows:2,placeholder:d?"댓글 처리 중...":"댓글을 입력하세요...",value:B,onChange:s=>Y(s.target.value),maxLength:300,disabled:d,style:{borderRadius:"6px",border:"1px solid #d9d9d9",resize:"none",fontSize:"13px",backgroundColor:d?"#f5f5f5":"#ffffff",color:d?"#8c8c8c":"#000000"},onFocus:s=>{d||(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:d?"처리 중...":`${B.length} / 300자`}),e.jsx(t.Button,{type:"primary",onClick:oe,size:"small",loading:d,style:{borderRadius:"4px",fontSize:"12px",height:"28px",padding:"0 16px",fontWeight:"500"},disabled:!B.trim()||d,children:d?"등록 중...":"등록"})]})]})})]})})]}),ue=()=>e.jsx(f.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:[...F].filter(s=>s.value!=="")}})}),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:"rgstUserDeptNm",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:e.jsx(t.Input,{readOnly:!0})}),e.jsx(t.Form.Item,{name:"rgstUserId",hidden:!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,{disabled:!0})})}),e.jsx(t.Col,{span:4,children:e.jsx(l.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"},inputProps:{disabled:!0}})})]}),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(f.BwgEditor,{border:!1,itemProps:{name:"content"},editorProps:{isEditing:L,title:{title:e.jsxs(e.Fragment,{children:[e.jsx(I.EditOutlined,{style:{marginRight:"5px"}})," 상세내용 작성"]}),children:e.jsx(t.Button,{icon:e.jsx(I.EyeFilled,{}),onClick:()=>V(!L),children:"미리보기"})}}})]})});n.useEffect(()=>{c==="new"&&(V(!0),i.setFieldsValue({type:"INQR",menuId:o?.menuId,menuNm:o?.menuNm,scrnId:o?.scrnId,rgstUserId:C?.userId,rgstUserNm:C?.userNm,rgstUserDeptNm:H?.deptNm,rgstDt:he(),content:""}))},[c,i,o,C]),n.useEffect(()=>{if(c==="detail"&&!g){const s=setInterval(()=>{P(r=>r<=1?(console.log("🔄 댓글 자동 갱신 실행 (카운트다운 완료)"),m.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),15):r-1)},1e3);return m.SCMBoardDtls0001(i.getFieldValue("boardMstrId")),()=>{console.log("🧹 댓글 인터벌 정리"),clearInterval(s)}}else c==="detail"&&g&&(console.log("📋 완료된 게시글 - 댓글 조회만"),m.SCMBoardDtls0001(i.getFieldValue("boardMstrId")))},[c,g,i]),n.useEffect(()=>()=>{console.log("🧹 컴포넌트 언마운트 - 모든 인터벌 정리"),N.current&&(clearInterval(N.current),N.current=null)},[]),n.useEffect(()=>{c==="list"&&o&&(y?.current?.setFormData({menuId:o?.menuId,menuNm:o?.menuNm}),m.SCMBoardMstr0001(1,20))},[c,o]),n.useEffect(()=>{S&&o&&y?.current?.setFormData({menuId:o?.menuId,menuNm:o?.menuNm})},[S,o]);const m={SCMBoardMstr0001:async(s,r)=>{const a=s||b.current?.currentPage||1,u=r||b.current?.pageSize||20,p={...y?.current?.getFormData(),pageNum:a,pageCount:u};console.log("🔍 서버 모드 페이징 요청:",p);try{const x=await h.callService("SCMBoardMstr0001",p,{isPopup:!0});if(x&&x.pageList){const v=x.pageCnt||0;b.current?.setTotalData(v),T.current?.addAllData(x.pageList)}else b.current?.setTotalData(0),T.current?.addAllData([]),console.log("📭 서버 모드 페이징 데이터 없음")}catch(x){console.error("❌ SCMBoardMstr0001 호출 실패:",x),t.message.error("데이터 조회 중 오류가 발생했습니다.")}},SCMBoardMstr0003:s=>{h.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=>{h.callService("SCMBoardMstr0004",{boardMstrId:i.getFieldValue("boardMstrId"),...s},{isPopup:!0}).then(r=>{console.log("문의/신고 제출 응답:",r),t.message.success("수정이 완료되었습니다."),k()}).catch(r=>{console.error("문의/신고 변경 실패:",r)})},SCMBoardMstr0005:()=>{h.callService("SCMBoardMstr0005",{boardMstrId:i.getFieldValue("boardMstrId")},{isPopup:!0}).then(s=>{console.log("문의/신고 삭제 응답:",s),t.message.success("삭제가 완료되었습니다."),k()})},SCMBoardDtls0001:s=>{w(!0),h.callService("SCMBoardDtls0001",{boardMstrId:s},{isPopup:!0,showLoading:!1}).then(r=>{if(r&&r.subList){const a=r.subList.map(u=>({id:u.seq,author:u.userNm||u.regUserId,regUserId:u.regUserId,content:u.content,regDt:u.regDt}));A(a)}else A([])}).catch(r=>{console.error("게시글 댓글 목록 조회 실패:",r),t.message.error("댓글 목록 조회 중 오류가 발생했습니다.")}).finally(()=>{w(!1),P(15)})},SCMBoardDtls0002:(s,r)=>{w(!0),h.callService("SCMBoardDtls0002",{boardMstrId:s,content:r},{isPopup:!0,showLoading:!1}).then(a=>{a&&a.result===1?(t.message.success("댓글이 등록되었습니다."),m.SCMBoardDtls0001(s)):t.message.error("댓글 등록에 실패했습니다.")}).catch(a=>{t.message.error("댓글 등록 중 오류가 발생했습니다.")}).finally(()=>{w(!1)})},SCMBoardDtls0003:(s,r)=>{w(!0),h.callService("SCMBoardDtls0003",{boardMstrId:s,seq:r},{isPopup:!0,showLoading:!1}).then(a=>{a&&a.result===1?(t.message.success("댓글이 삭제되었습니다."),m.SCMBoardDtls0001(s)):t.message.error("댓글 삭제에 실패했습니다.")}).catch(a=>{t.message.error("댓글 삭제 중 오류가 발생했습니다.")}).finally(()=>{w(!1)})}},pe=()=>{switch(c){case"list":return[{id:"REFRESH",label:"조회",type:"default",onClick:()=>m.SCMBoardMstr0001(),disabled:z},{id:"NEW",label:"신규 등록",type:"primary",onClick:ie}];case"detail":return[{id:"BACK",label:"뒤로",type:"default",onClick:le},{id:"EDIT",label:"수정",type:"primary",disabled:!D||g,onClick:()=>i.submit()},{id:"DELETE",label:"삭제",type:"default",disabled:!D||g,onClick:se}];case"new":return[{id:"SUBMIT",label:"제출",type:"primary",onClick:()=>i.submit(),disabled:z},{id:"CANCEL",label:"취소",type:"default",onClick:re}];default:return[]}},xe={};return e.jsxs(f.BwgPopup,{popup:S,buttons:pe(),popupEvent:xe,onClose:ne,children:[c==="list"&&ce(),c==="detail"&&me(),c==="new"&&ue()]})};exports.default=Ie;
@@ -4,10 +4,10 @@ import { Form as s, Tag as de, message as g, Row as x, Col as n, Space as D, Inp
4
4
  import Ge from "dayjs";
5
5
  import { useRef as U, useState as b, useMemo as J, useEffect as M } from "react";
6
6
  import { useUserStore as je, useMenuViewStore as qe } from "../stores/index.js";
7
- import { m as Qe, d as k, S as We, h as He, n as Je, o as ce } from "./common-components-DtzVj5lz.js";
7
+ import { m as Qe, d as k, S as We, h as He, n as Je, o as ce } from "./common-components-DeYL3J6X.js";
8
8
  import { createBwgGridRenderer as $, callService as S, realFormat as K } from "../utils/index.js";
9
9
  import { BwgFormItem as I, BwgSelect as L, BwgRangePicker as $e, BwgSwitch as Ke, BwgInput as Xe, BwgDatePicker as X, BwgCheck as me, BwgForm as Ze } from "../components/core/index.js";
10
- import { c as _e } from "./provider-Kxea5IoZ.js";
10
+ import { c as _e } from "./provider-Bx4VpaFf.js";
11
11
  const { TextArea: et } = d, V = [
12
12
  { label: "전체", value: "" },
13
13
  { label: "요청", value: "RQST" },