@bwg-ui/core 1.3.3 → 1.3.5
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-CuGDAfFM.cjs +1 -0
- package/dist/chunks/{CMSearchIntfGwP01-Co6lrDf9.js → CMSearchIntfGwP01-DBpDpgQr.js} +21 -21
- package/dist/chunks/{MenuReport-BTtoDFz-.js → MenuReport-CCbCy7yt.js} +250 -228
- package/dist/chunks/MenuReport-yw8tZDUk.cjs +1 -0
- package/dist/chunks/common-components-CbkWoYfX.cjs +1111 -0
- package/dist/chunks/{common-components-0IMhPxxg.js → common-components-DtzVj5lz.js} +10904 -10757
- package/dist/chunks/layout-components-BzLAGXiu.cjs +38 -0
- package/dist/chunks/{layout-components-DphZY34c.js → layout-components-ljht1sHh.js} +954 -856
- package/dist/chunks/{provider-VCa8UGvF.js → provider-Kxea5IoZ.js} +57 -54
- package/dist/chunks/provider-r4mkv5Zs.cjs +1 -0
- package/dist/components/common/BwgGrid.d.ts.map +1 -1
- package/dist/components/common/BwgView.d.ts.map +1 -1
- package/dist/components/common/SearchBox.d.ts +2 -0
- 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/BwgDatePicker.d.ts.map +1 -1
- package/dist/components/core/BwgEmpSearch.d.ts +1 -1
- package/dist/components/core/BwgEmpSearch.d.ts.map +1 -1
- package/dist/components/core/BwgMaskedDate.d.ts.map +1 -1
- package/dist/components/core/BwgMaskedRange.d.ts.map +1 -1
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +1973 -22
- package/dist/components/guide/index.cjs +1 -1
- package/dist/components/guide/index.js +14 -14
- package/dist/components/layout/BwgPortal01.d.ts.map +1 -1
- package/dist/components/layout/custom/ConfigurableHeader.d.ts.map +1 -1
- package/dist/components/layout/custom/ConfigurableMenuTab.d.ts.map +1 -1
- package/dist/components/layout/custom/ConfigurableSidebar.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/pages/board/CMAdminBoardM01.d.ts.map +1 -1
- package/dist/components/pages/board/CMMyBoardM01.d.ts.map +1 -1
- package/dist/components/pages/rsrc/CMPopuMstrM01.d.ts.map +1 -1
- package/dist/components/pages/syst/SystemCodeManage.d.ts.map +1 -1
- package/dist/components/popup/MenuReport.d.ts.map +1 -1
- package/dist/components/popup/index.cjs +1 -1
- package/dist/components/popup/index.d.ts.map +1 -1
- package/dist/components/popup/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +242 -240
- package/dist/provider/contexts/SearchBoxContext.d.ts +20 -0
- package/dist/provider/contexts/SearchBoxContext.d.ts.map +1 -1
- package/dist/provider/index.cjs +1 -1
- package/dist/provider/index.js +5 -5
- package/dist/stores/favoriteStore.d.ts.map +1 -1
- package/dist/stores/index.cjs +2 -2
- package/dist/stores/index.js +208 -207
- package/dist/stores/loginStore.d.ts +4 -8
- package/dist/stores/loginStore.d.ts.map +1 -1
- package/dist/stores/popupStore.d.ts.map +1 -1
- package/dist/styles/components.css +107 -37
- package/dist/styles/layout.css +59 -5
- package/dist/styles/variables.css +6 -0
- package/dist/utils/commonUtils.d.ts +5 -1
- package/dist/utils/commonUtils.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +986 -954
- package/package.json +1 -1
- package/dist/chunks/CMSearchIntfGwP01-Do_ZDjmX.cjs +0 -1
- package/dist/chunks/MenuReport-Bn5NyNel.cjs +0 -1
- package/dist/chunks/common-components-Csd3OioX.cjs +0 -1109
- package/dist/chunks/core-components-CX6NGtTh.cjs +0 -1
- package/dist/chunks/core-components-Ckwf4Rd7.js +0 -1969
- package/dist/chunks/layout-components-BMLp8YAy.cjs +0 -38
- package/dist/chunks/provider-DrboIg2C.cjs +0 -1
- package/dist/components/popup/SearchAddress.d.ts +0 -3
- package/dist/components/popup/SearchAddress.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"),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;
|
|
@@ -3,9 +3,9 @@ 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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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";
|
|
7
|
+
import { BwgInput as le, BwgSelect as de, BwgRangePicker as M, BwgButton as ie } from "../components/core/index.js";
|
|
8
|
+
import { generateUID as me, callService as ge } from "../utils/index.js";
|
|
9
9
|
const fe = [
|
|
10
10
|
{ label: "전체", value: "" },
|
|
11
11
|
{ label: "기안", value: "DRAFT" },
|
|
@@ -13,7 +13,7 @@ const fe = [
|
|
|
13
13
|
{ label: "승인", value: "APPROVED" },
|
|
14
14
|
{ label: "반려", value: "REJECTED" }
|
|
15
15
|
], Pe = ({ popup: c, onClose: H }) => {
|
|
16
|
-
const v = x(null), b = x(null), K = x(null), [A, O] = m([]), [T, $] = m(!1), [f, I] = m(null), [L,
|
|
16
|
+
const v = x(null), b = x(null), K = x(null), [A, O] = m([]), [T, $] = m(!1), [f, I] = m(null), [L, F] = m(1), [h, U] = m(10), [G, j] = m(0), z = N(() => {
|
|
17
17
|
const o = p(), s = [];
|
|
18
18
|
for (let a = 1; a <= 120; a++) {
|
|
19
19
|
const r = [
|
|
@@ -28,7 +28,7 @@ const fe = [
|
|
|
28
28
|
userId: `user${a % 7 + 1}`,
|
|
29
29
|
dprtNo: ["HR", "GEN", "DEV1", "DEV2", "FIN"][a % 5],
|
|
30
30
|
aprvStts: r[a % r.length],
|
|
31
|
-
aprvKey:
|
|
31
|
+
aprvKey: me(),
|
|
32
32
|
createdAt: o.add(-(a % 45), "day").hour(9 + a % 8).toISOString()
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -39,7 +39,7 @@ const fe = [
|
|
|
39
39
|
try {
|
|
40
40
|
const a = K.current?.getFormData?.() ?? {}, r = o ?? L, w = s ?? h, d = { ...a, page: r, pageSize: w }, y = c?.popupParams?.serviceCode;
|
|
41
41
|
if (y) {
|
|
42
|
-
const n = await
|
|
42
|
+
const n = await ge(y, d), l = (n?.list || n?.data || []).map(
|
|
43
43
|
(e) => ({
|
|
44
44
|
gwDcmtKey: e.gwDcmtKey ?? e.docNo ?? e.doc_id ?? e.id ?? "",
|
|
45
45
|
gwDcmtNm: e.gwDcmtNm ?? e.title ?? e.subject ?? "",
|
|
@@ -50,14 +50,14 @@ const fe = [
|
|
|
50
50
|
aprvKey: e.aprvKey ?? void 0
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
|
-
O(l),
|
|
53
|
+
O(l), j(Number(n?.totalCount ?? n?.total ?? l.length));
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
const C = z.filter((n) => {
|
|
57
57
|
const l = d.keyword?.trim()?.toLowerCase(), e = !l || n.gwDcmtKey.toLowerCase().includes(l) || n.gwDcmtNm.toLowerCase().includes(l) || n.userId.toLowerCase().includes(l) || n.dprtNo.toLowerCase().includes(l), D = !d.status || n.aprvStts === d.status, i = d.createdAt, X = !i || (p(n.createdAt).isAfter(i[0].startOf("day")) || p(n.createdAt).isSame(i[0], "day")) && (p(n.createdAt).isBefore(i[1].endOf("day")) || p(n.createdAt).isSame(i[1], "day"));
|
|
58
58
|
return e && D && X;
|
|
59
59
|
});
|
|
60
|
-
|
|
60
|
+
j(C.length);
|
|
61
61
|
const S = (r - 1) * w, _ = C.slice(S, S + w);
|
|
62
62
|
O(_);
|
|
63
63
|
} catch {
|
|
@@ -72,10 +72,10 @@ const fe = [
|
|
|
72
72
|
u();
|
|
73
73
|
}, []);
|
|
74
74
|
const J = R(() => {
|
|
75
|
-
|
|
75
|
+
F(1), u(1, h);
|
|
76
76
|
}, [u, h]), q = R(
|
|
77
77
|
(o, s) => {
|
|
78
|
-
|
|
78
|
+
F(o), U(s), u(o, s);
|
|
79
79
|
},
|
|
80
80
|
[u]
|
|
81
81
|
), k = R(() => {
|
|
@@ -179,9 +179,9 @@ const fe = [
|
|
|
179
179
|
return B(() => {
|
|
180
180
|
v.current && v.current.addAllData(A || []);
|
|
181
181
|
}, [A]), B(() => {
|
|
182
|
-
b.current && b.current.setTotalData(
|
|
183
|
-
}, [
|
|
184
|
-
|
|
182
|
+
b.current && b.current.setTotalData(G || 0);
|
|
183
|
+
}, [G]), /* @__PURE__ */ t(
|
|
184
|
+
te,
|
|
185
185
|
{
|
|
186
186
|
popup: c,
|
|
187
187
|
buttons: [
|
|
@@ -190,16 +190,16 @@ const fe = [
|
|
|
190
190
|
onClose: () => {
|
|
191
191
|
c?.config?.onClose?.(), H?.(), c?.close?.();
|
|
192
192
|
},
|
|
193
|
-
children: /* @__PURE__ */ t(
|
|
193
|
+
children: /* @__PURE__ */ t(ae, { children: /* @__PURE__ */ P(oe, { border: !1, style: { paddingBottom: 16 }, children: [
|
|
194
194
|
/* @__PURE__ */ t(
|
|
195
|
-
|
|
195
|
+
re,
|
|
196
196
|
{
|
|
197
197
|
ref: K,
|
|
198
198
|
reqRows: /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ P(g, { span: 24, children: [
|
|
199
|
-
/* @__PURE__ */ t(
|
|
199
|
+
/* @__PURE__ */ t(ne, { title: "기안 검색" }),
|
|
200
200
|
/* @__PURE__ */ P(E, { gutter: [12, 8], style: { marginTop: 8 }, children: [
|
|
201
201
|
/* @__PURE__ */ t(g, { span: 8, children: /* @__PURE__ */ t(
|
|
202
|
-
|
|
202
|
+
le,
|
|
203
203
|
{
|
|
204
204
|
inputProps: {
|
|
205
205
|
placeholder: "제목/기안자/부서/문서번호",
|
|
@@ -213,7 +213,7 @@ const fe = [
|
|
|
213
213
|
}
|
|
214
214
|
) }),
|
|
215
215
|
/* @__PURE__ */ t(g, { span: 6, children: /* @__PURE__ */ t(
|
|
216
|
-
|
|
216
|
+
de,
|
|
217
217
|
{
|
|
218
218
|
selectProps: {
|
|
219
219
|
options: fe
|
|
@@ -252,7 +252,7 @@ const fe = [
|
|
|
252
252
|
)
|
|
253
253
|
] }),
|
|
254
254
|
/* @__PURE__ */ t(g, { span: 2, children: /* @__PURE__ */ t(
|
|
255
|
-
|
|
255
|
+
ie,
|
|
256
256
|
{
|
|
257
257
|
type: "primary",
|
|
258
258
|
onClick: J,
|
|
@@ -266,7 +266,7 @@ const fe = [
|
|
|
266
266
|
}
|
|
267
267
|
),
|
|
268
268
|
/* @__PURE__ */ t(
|
|
269
|
-
|
|
269
|
+
se,
|
|
270
270
|
{
|
|
271
271
|
ref: v,
|
|
272
272
|
type: "nrml",
|
|
@@ -276,7 +276,7 @@ const fe = [
|
|
|
276
276
|
}
|
|
277
277
|
),
|
|
278
278
|
/* @__PURE__ */ t(
|
|
279
|
-
|
|
279
|
+
ce,
|
|
280
280
|
{
|
|
281
281
|
ref: b,
|
|
282
282
|
mode: "server",
|