????

Your IP : 3.128.31.200


Current Path : C:/inetpub/vhost/hotrochinhsach.nextform.vn/www/assets/
Upload File :
Current File : C:/inetpub/vhost/hotrochinhsach.nextform.vn/www/assets/index-9aa11e32.js

import{r as u,j as n,u as D}from"./index-3ac6b886.js";import{r as T,c as x}from"./function-c7c2f09a.js";import{F as y}from"./FontAwesome4-4d1c8e97.js";import{I as M}from"./Input-a404c875.js";import{D as N}from"./DataTable-4f7de56a.js";import{M as C}from"./Modal-834c96f4.js";import"./utils-1da25c48.js";import"./useTheme-cc71593c.js";import"./OdataUtils-69f581ff.js";import"./Fade-c1d8e31e.js";import"./Transition-41b94a89.js";const b=[{tabName:"Danh mục dùng chung"},{title:"Danh mục Quan hệ với chủ hộ",url:"DM_QuanHeVoiChuHo"},{title:"Danh mục Giới tính",url:"DM_GioiTinh"},{title:"Danh mục Dân tộc",url:"DM_DanToc"},{title:"Danh mục Tôn giáo",url:"DM_TonGiao"},{title:"Danh mục Đơn vị hành chính",url:"DM_DonViHanhChinh"},{title:"Danh mục Tỉnh/Thành phố",url:"TinhThanhs",columns:[{title:"Mã tỉnh thành",field:"MaTinhThanh",dataID:!0},{title:"Tên tỉnh thành",field:"TenTinhThanh",type:"string",searchable:!0},{title:"Phân loại",field:"Cap"}],dependent:{compare:"MaTinhThanh",title:"Danh mục Quận/huyện/thị xã/thành phố",url:"QuanHuyens",columns:[{title:"Mã Quận/Huyện",field:"MaQuanHuyen",dataID:!0},{title:"Tên Quận/Huyện",field:"TenQuanHuyen",type:"string",searchable:!0}],dependent:{compare:"MaQuanHuyen",title:"Danh mục Phường/Xã",url:"PhuongXas",columns:[{title:"Mã Phường/Xã",field:"MaPhuongXa",dataID:!0},{title:"Tên Phường/Xã",field:"TenPhuongXa",type:"string",searchable:!0},{title:"Phân loại",field:"Cap"},{title:"Phân loại",field:"DM_KhuVuc.Name",hidden:!0},{title:"Phân loại Khu vực",field:"ThanhThiNongThon_Id",type:"data-select",render:e=>{var h;return(h=e==null?void 0:e.DM_KhuVuc)==null?void 0:h.Name},dataSelect:{url:"DM_KhuVuc",column:{field:"Id",label:"Name"},placeholder:"Chọn Khu vực"}}]}}},{title:"Danh mục Trình học vấn",url:"DM_TrinhDoHocVan",columns:[{title:"Id",field:"Id",dataID:!0},{title:"Tên",field:"Name",searchable:!0},{title:"Code",field:"Code"}]},{title:"Danh mục Tình trạng hôn nhân",url:"DM_TinhTrangHonNhan"},{title:"Danh mục Phân loại hộ",url:"DM_PhanLoaiHo"},{title:"Danh mục Trình độ Chuyên môn kỹ thuật",url:"DM_TrinhDoCMKT"},{title:"Danh mục Tình trạng việc làm",url:"DM_ViecLam"},{tabName:"Phân hệ quản lý quỹ"},{title:"Danh mục Quỹ",url:"DM_DanhMucQuy"},{title:"Danh mục Nội dung chi",url:"DM_NoiDungChi",columns:[{title:"Id",field:"Id",dataID:!0},{title:"Tên",field:"Name",searchable:!0},{title:"Số tiền",field:"SoTien",type:"currency"},{title:"Đơn vị tính",field:"DonViTinh"}]}];const j=({tab:e,onChange:h,i:t,search:o})=>{var r;const s=new URLSearchParams(window.location.search),c=s.get("url"),m=+s.get("group"),[p,a]=u.useState(c?t===m:!1),l=(i,d)=>i?d.title.toUpperCase().includes(i.toUpperCase()):!0;return n.jsx(n.Fragment,{children:n.jsxs("div",{onClick:()=>a(i=>!i),className:"body-tab-item",style:{cursor:"pointer"},children:[n.jsx("div",{className:"heade-tab h6 mb-3",children:n.jsxs("div",{style:{fontSize:"15px"},className:"d-flex gap-3 my-2",children:[e==null?void 0:e.tabName,n.jsx(y,{style:{marginLeft:"auto"},fa:"angle-down"})]})}),(p||o)&&n.jsx("div",{className:"body-tab pb-3",children:(r=e==null?void 0:e.children)==null?void 0:r.map((i,d)=>n.jsx(n.Fragment,{children:l(o,i)&&n.jsx("div",{onClick:f=>{f.stopPropagation(),h(i,d)},className:`item-tab ${c===i.url?"active":""}`,children:i==null?void 0:i.title})}))})]})})},g=({data:e,compare:h})=>{const[t,o]=u.useState({id:null,dependent:null}),s=u.useRef(),c=u.useCallback(()=>s.current&&s.current.onQueryChange(),[s]);u.useEffect(()=>{c()},[e,c]);const m=()=>e!=null&&e.columns?e==null?void 0:e.columns:[{title:"Id",field:"Id",dataID:!0},{title:"Tên",field:"Name",type:"string",searchable:!0}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"tab-right text-capitalize",children:n.jsx(N,{tableRef:s,title:n.jsx("h5",{className:"mb-3",children:e.title}),url:e==null?void 0:e.url,where:(h||h===0)&&(e!=null&&e.compare)?`${e!=null&&e.compareChild?e==null?void 0:e.compareChild:e==null?void 0:e.compare} eq ${T(typeof h,h)}`:"",columns:m(),onRowClick:e!=null&&e.dependent?(p,a)=>{o(l=>{var r;return{...l,id:a[(r=e==null?void 0:e.dependent)==null?void 0:r.compare],dependent:e==null?void 0:e.dependent}})}:void 0,onEdit:{},onAdd:{disabled:!1,defaultValues:h||h===0?[{field:e!=null&&e.compareChild?e==null?void 0:e.compareChild:e==null?void 0:e.compare,value:h}]:!1},onDelete:{}})}),(t==null?void 0:t.dependent)&&n.jsx(C,{size:"xl",isOpen:t==null?void 0:t.dependent,toggle:()=>o(p=>({...p,id:null,dependent:null})),children:n.jsx("div",{className:"p-3",children:n.jsx(g,{data:t==null?void 0:t.dependent,compare:t==null?void 0:t.id})})})]})},w=()=>{const e=x(b),[h,t]=u.useState(e.filter(l=>{var r;return(r=l==null?void 0:l.children)==null?void 0:r.length})[0].children[0]),o=D(),s=new URLSearchParams(window.location.search),c=s.get("group")||0,m=s.get("page")||0,[p,a]=u.useState("");return u.useEffect(()=>{t(e.filter(l=>{var r;return(r=l==null?void 0:l.children)==null?void 0:r.length})[c].children[m])},[c,e,m]),n.jsx(n.Fragment,{children:n.jsxs("div",{className:"form-danh-muc-hncn",children:[n.jsxs("div",{className:"tab-left-hncn",children:[n.jsx(M,{className:"input-search-danh-muc",onChange:l=>a(l.target.value),placeholder:"Tìm kiếm danh mục..."}),n.jsx("p",{className:"my-4 text-secondary border-bottom"}),n.jsx("div",{className:"body-tab list-tab",children:e.filter(l=>{var r;return(r=l==null?void 0:l.children)==null?void 0:r.length}).map((l,r)=>n.jsx(n.Fragment,{children:n.jsx(j,{tab:l,i:r,search:p,onChange:(i,d)=>{o.push({search:`?group=${r}&page=${d}&url=${i==null?void 0:i.url}`})}})}))})]}),n.jsx(g,{data:h})]})})};export{w as default};