????

Your IP : 216.73.216.152


Current Path : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/
Upload File :
Current File : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/5736.3da0d8c7.chunk.js

"use strict";(self.webpackChunk_qlxd_frontend=self.webpackChunk_qlxd_frontend||[]).push([[5736],{23683:(e,t,n)=>{function r(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}n.d(t,{A:()=>r})},55736:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k});var r=n(82210),a=n(64776),l=n(27894),s=n(35065),i=n(6954),o=n(62384),d=n(24021),u=n(61278),c=n(46099),h=n(2103),f=n(6058);const m=e=>{const t=[];return e.forEach(((n,r,a)=>{if(!n.ParentId){const r={...n};if(0!==a.filter((e=>e.ParentId===n.Id)).length){const t=p(e,n.Id);r.children=t}t.push(r)}})),t};function p(e,t){var n=[];return e.forEach(((r,a)=>{if(r.ParentId===t){var l=p(e,r.Id);l.length&&(r.children=l),n.push(r)}})),n}const j=r.forwardRef(((e,t)=>{let{manipulation:n,onSelect:a,viewDeleted:l,reloadTable:i}=e;const[o,p]=(0,r.useState)(!0),[j,v]=(0,r.useState)([]),[g,N]=(0,r.useState)([]),[C,S]=(0,r.useState)([]),[y,I]=(0,r.useState)([]);(0,r.useEffect)((()=>{t.current.queryData()}),[t]),(0,r.useImperativeHandle)(t,(()=>({queryData:()=>{p(!0),n.view().then((e=>{const t=m(e.value);v(t),N(t)})).catch((e=>(0,s.a3)("Kh\xf4ng th\u1ec3 load d\u1eef li\u1ec7u !"))).finally((()=>p(!1)))}})));return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsx)(d.A,{placeholder:"T\xecm ki\u1ebfm theo t\xean v\xe0 m\xe3...",onChange:e=>(e=>{let t=(0,u.zS)(e.target.value).toLowerCase().trim();if(t){const e=j.reduce(((e,n)=>{const r=n.children&&n.children.filter((e=>(0,u.zS)(e.Name).toLowerCase().trim().includes(t)||(0,u.zS)(e.Code).toLowerCase().trim().includes(t)));r&&r.length?e.push({...n,children:r}):((0,u.zS)(n.Name).toLowerCase().trim().includes(t)||(0,u.zS)(n.Code).toLowerCase().trim().includes(t))&&e.push({...n,name:n.Name});let a=[];return e.forEach((e=>a.push(e.Id))),S(a),e}),[]);N(e)}else N(j),S([])})(e)}),(0,f.jsx)(c.kt,{show:o,children:g&&0!==g.length&&(0,f.jsx)(h.G,{className:"tree-dm-loaivl",disableSelection:!1,multiSelect:!1,nameId:"Id",expandAll:!0,expanded:C,data:[{Id:"null",children:g}],selected:y,onNodeToggle:(e,t)=>{e.persist(),e.target.closest(".MuiTreeItem-iconContainer")&&S(t)},onNodeSelect:(e,t)=>{I((e=>e=e===t?null:t))},children:x("null",g,l,a,n,i)})})]})})),x=(e,t,n,r,a,i)=>t&&t.map(((t,o)=>(0,f.jsx)(h.y,{nodeId:t.Id,icon:"fas fa-tape",title:t.Code+" - "+t.Name,data:{Parent:e,NodeId:t.Id,Title:t.Name,Name:t.Name,Note:t.Note,Code:t.Code},onSelection:(e,t)=>{r(e,t)},renderAfter:n&&(0,f.jsx)(l.WB,{style:{height:24},onClick:()=>(0,s.A1)(`B\u1ea1n th\u1eadt s\u1ef1 mu\u1ed1n x\xf3a lo\u1ea1i v\u1eadt li\u1ec7u v\u1edbi t\xean '${t.Name}' ?`,"X\xf3a lo\u1ea1i v\u1eadt li\u1ec7u").then((e=>{e&&e.isConfirmed&&a.delete(t.Id).then((e=>{i(),(0,s.nw)("X\xf3a th\xe0nh c\xf4ng")})).catch((e=>(0,s.a3)("X\xf3a th\u1ea5t b\u1ea1i !")))})),children:"X\xf3a"}),isJustify:!0,children:t.children&&x(t.Id,t.children,n,r,a,i)},`${o}${t.Id}`))),v=j;var g=n(79209),N=n(4407);const C=r.forwardRef(((e,t)=>{let{manipulation:n,name:l,code:s,note:o,parent:d,setName:u,setCode:c,setNote:h,setParent:m,refeshMenu:p}=e;const j=(0,r.useRef)(null),x=(0,r.useCallback)((()=>j.current&&j.current.queryData()),[]);(0,r.useImperativeHandle)(t,(()=>({refeshMenu:()=>j.current&&j.current.queryData()})));const[C,S]=(0,r.useState)({}),[y,I]=(0,r.useState)("");return(0,r.useEffect)((()=>{I((e=>e=e===C.Name?"":C.Name))}),[C]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(i.gE,{row:!0,children:[(0,f.jsx)(N.J,{sm:2,children:"M\xe3 lo\u1ea1i v\u1eadt li\u1ec7u"}),(0,f.jsx)(a.fv,{sm:10,children:(0,f.jsx)(g.Sm,{value:s,onChange:e=>c(e.target.value||""),placeholder:"Nh\u1eadp m\xe3"})})]}),(0,f.jsxs)(i.gE,{row:!0,children:[(0,f.jsx)(N.J,{sm:2,children:"Lo\u1ea1i v\u1eadt li\u1ec7u"}),(0,f.jsx)(a.fv,{sm:10,children:(0,f.jsx)(g.Sm,{value:l,onChange:e=>u(e.target.value||""),placeholder:"Nh\u1eadp t\xean"})})]}),(0,f.jsxs)(i.gE,{row:!0,children:[(0,f.jsx)(N.J,{sm:2,children:"Ghi ch\xfa"}),(0,f.jsx)(a.fv,{sm:10,children:(0,f.jsx)(g.Sm,{value:o,onChange:e=>h(e.target.value||""),placeholder:"Nh\u1eadp ghi ch\xfa"})})]}),(0,f.jsxs)(i.gE,{row:!0,children:[(0,f.jsx)(N.J,{sm:2,children:"Con c\u1ee7a menu"}),(0,f.jsx)(a.fv,{sm:10,children:(0,f.jsx)("span",{children:y})})]}),(0,f.jsxs)(i.gE,{row:!0,className:"form-edit-LVL",children:[(0,f.jsx)(N.J,{sm:2,children:"Thu\u1ed9c lo\u1ea1i v\u1eadt li\u1ec7u"}),(0,f.jsx)(a.fv,{sm:10,children:(0,f.jsx)(v,{ref:j,reloadTable:x,refeshMenu:p,manipulation:n,selectedKeys:d?[d]:[""],onSelect:(e,t)=>{t&&S(t),t&&m(t.NodeId)}})})]})]})})),S=e=>{let{manipulation:t,isOpen:n,toggle:a,refeshMenu:d}=e;const[u,c]=(0,r.useState)(""),[h,m]=(0,r.useState)(""),[p,j]=(0,r.useState)(""),[x,v]=(0,r.useState)(null),g=(0,r.useCallback)((()=>{c(""),j(""),m(""),v(null)}),[]);return(0,f.jsxs)(o.aF,{isOpen:n,toggle:a,size:"lg",children:[(0,f.jsx)(o.rQ,{toggle:a,children:"Th\xeam lo\u1ea1i v\u1eadt li\u1ec7u"}),(0,f.jsx)(o.cw,{children:(0,f.jsx)(i.lV,{children:(0,f.jsx)(C,{manipulation:t,code:h,setCode:e=>m(e),name:u,setName:e=>c(e),note:p,setNote:e=>j(e),parent:x,setParent:e=>v(e)})})}),(0,f.jsxs)(o.jl,{children:[(0,f.jsx)(l.UN,{onClick:()=>{if(""===u)return void(0,s.a3)("Vui l\xf2ng nh\u1eadp \u0111\u1ea7y \u0111\u1ee7 th\xf4ng tin !");const e={Name:u,Note:p,Code:h};null!==x&&(e.ParentId=x),t.add(e).then((e=>{a(),e&&d(),g(),(0,s.nw)("Th\xeam lo\u1ea1i v\u1eadt li\u1ec7u th\xe0nh c\xf4ng !")})).catch((()=>(0,s.a3)("Th\xeam v\u1eadt li\u1ec7u th\u1ea5t b\u1ea1i !")))},children:"Th\xeam"})," ",(0,f.jsx)(l.pf,{onClick:a,children:"\u0110\xf3ng"})]})]})},y=r.forwardRef(((e,t)=>{let{manipulation:n,menuDetailSetValue:a,refeshMenu:l}=e;const s=(0,r.useRef)(null),i=(e,t)=>{a(e,t)},o=(0,r.useCallback)((()=>s.current&&s.current.queryData()),[]);return(0,r.useImperativeHandle)(t,(()=>({onSelect:i,refeshMenu:()=>o()}))),(0,f.jsx)(v,{reloadTable:l,ref:s,manipulation:n,viewDeleted:!0,onSelect:(e,t)=>i(e,t)})})),I=r.forwardRef(((e,t)=>{let{manipulation:n,refeshMenu:a}=e;const o=(0,r.useRef)(null),[d,u]=(0,r.useState)(""),[c,h]=(0,r.useState)(""),[m,p]=(0,r.useState)(""),[j,x]=(0,r.useState)(""),[v,g]=(0,r.useState)(null);(0,r.useImperativeHandle)(t,(()=>({refeshMenu:()=>o.current&&o.current.refeshMenu(),setValuesDetail:(e,t)=>{t&&(u((e=>e=e===t.NodeId?"":t.NodeId)),h((e=>e=e===t.Name?"":t.Name)),p((e=>e=e===t.Code?"":t.Code)),x((e=>e=e===t.Note?"":t.Note)),g((e=>e=e===t.Parent?null:t.Parent)))}})));return(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)(i.lV,{className:"m-0",children:[(0,f.jsx)(C,{refeshMenu:a,ref:o,manipulation:n,code:m,setCode:e=>p(e),name:c,setName:e=>h(e),note:j,setNote:e=>x(e),parent:v,setParent:e=>g(e)}),(0,f.jsx)(i.IN,{children:(0,f.jsx)(l.DR,{disabled:""===d,onClick:()=>{if(""===d||""===c)return void(0,s.a3)("Vui l\xf2ng nh\u1eadp \u0111\u1ea7y \u0111\u1ee7 th\xf4ng tin !");const e={Id:d,Name:c,Note:j};if("null"!==v){if(d===v)return void(0,s.AB)("Lo\u1ea1i v\u1eadt li\u1ec7u b\u1ea1n s\u1eeda kh\xf4ng th\u1ec3 l\xe0 con c\u1ee7a ch\xednh n\xf3 !");e.ParentId=v}n.edit(e).then((e=>{a(),(0,s.nw)("S\u1eeda lo\u1ea1i v\u1eadt li\u1ec7u th\xe0nh c\xf4ng !")})).catch((()=>(0,s.a3)("S\u1eeda kh\xf4ng th\xe0nh c\xf4ng !")))},children:"S\u1eeda"})})]})})}));var w=n(92548);function $(e){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),{name:s,manipulation:i}=e,[o,d]=(0,r.useState)(!1),u=()=>{t.current&&t.current.refeshMenu(),n.current&&n.current.refeshMenu()},c=(0,f.jsxs)("div",{className:"header-col-viewLVL",children:[s," ",(0,f.jsx)(l.UN,{onClick:()=>d(!o),children:"Th\xeam"})]});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(S,{isOpen:o,toggle:()=>d(!o),refeshMenu:u,manipulation:i}),(0,f.jsxs)(a.fI,{className:"row-DMLoaiVatLieu",children:[(0,f.jsx)(a.fv,{md:6,className:"col-viewLVL",children:(0,f.jsx)(w.A,{renderTitle:c,children:(0,f.jsx)(y,{refeshMenu:u,ref:t,menuDetailSetValue:(e,t)=>{n.current&&n.current.setValuesDetail(e,t)},manipulation:i})})}),(0,f.jsx)(a.fv,{md:6,className:"col-editLVL",children:(0,f.jsx)(w.A,{title:"Chi ti\u1ebft",children:(0,f.jsx)(I,{ref:n,refeshMenu:u,manipulation:i})})})]})]})}var A=n(14658),b=n(86897);function k(e){return(0,f.jsx)($,{name:"Danh s\xe1ch lo\u1ea1i v\u1eadt li\u1ec7u",manipulation:{view:()=>A.d1.getAllDMLoaiVatLieus(),add:e=>b.A.Create(A.d1,e),edit:e=>{let{Id:t,...n}=e;return b.A.Update(A.d1,t,n,{mode:"no-cors"})},delete:e=>b.A.Delete(A.d1,e)}})}},86897:(e,t,n)=>{n.d(t,{A:()=>u});var r,a=n(23683),l=n(91343),s=n(87760),i=(0,l.A)("createQuery"),o=(0,l.A)("parseExpand");class d{static SearchAll(e,t,n){const r=(0,a.A)(this,i)[i](t);return e.SearchAll(s.Cf,`?${r}`,n,!0)}static FindById(e,t,n,r){const l=(0,a.A)(this,i)[i](n);return e.FindById(s.Cf,t,`?${l}`,r)}static GetCount(e,t,n){const r=(0,a.A)(this,i)[i](t);return e.SearchAll(s.Cf+"/$count",`?${r}`,n,!0)}static Create(e,t){return e.Insert(s.Cf,t)}static Update(e,t,n,r){return e.Update(s.Cf,n,`(${t})`,r)}static Delete(e,t){return e.Delete(s.Cf,`(${t})`)}}r=d,Object.defineProperty(d,i,{writable:!0,value:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";const n=[];if("undefined"!==typeof e.select&&n.push(`$select=${Array.of(e.select).flat(2).join(",")}`),"undefined"!==typeof e.expand){const t=Array.isArray(e.expand)?e.expand.join(","):(0,a.A)(r,o)[o](e.expand);n.push(`$expand=${t}`)}if("undefined"!==typeof e.count&&n.push(`$count=${e.count}`),"undefined"!==typeof e.top&&n.push(`$top=${e.top}`),"undefined"!==typeof e.skip&&n.push(`$skip=${e.skip}`),"undefined"!==typeof e.format){const t="string"===typeof e.format?e.format:Array.of("application/json",...Object.entries(e.format).map((e=>{let[t,n]=e;return`odata.${t}=${n}`}))).join(";");n.push(`$format=${t}`)}if("undefined"!==typeof e.orderby){const t=Array.of(e.orderby).flat(2).map((e=>"string"===typeof e?e:Object.entries(e).map((e=>{let[t,n]=e;return`${t} ${n}`})))).flat().join(",");t&&n.push(`$orderby=${t}`)}return"undefined"!==typeof e.filter&&n.push(`$filter=${e.filter}`),n.join(t)}}),Object.defineProperty(d,o,{writable:!0,value:e=>"string"===typeof e?e:Object.keys(e).map((t=>{var n;const l=null!==(n=e[t])&&void 0!==n?n:{},s=(0,a.A)(r,i)[i](l,";");return s?`${t}(${s})`:t})).join(",")});const u=d},91343:(e,t,n)=>{n.d(t,{A:()=>a});var r=0;function a(e){return"__private_"+r+++"_"+e}}}]);
//# sourceMappingURL=5736.3da0d8c7.chunk.js.map