????

Your IP : 216.73.216.64


Current Path : C:/inetpub/vhost/gdnn.gdtsolutions.vn/build/assets/
Upload File :
Current File : C:/inetpub/vhost/gdnn.gdtsolutions.vn/build/assets/TextHuyenPhuongXa-91b9e817.js

var O=Object.defineProperty;var K=(i,t,e)=>t in i?O(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var h=(i,t,e)=>(K(i,typeof t!="symbol"?t+"":t,e),e);import{r as l,j as s,D as N,P as r,R as W,t as f,T as S,m as j,E as G,v as X,z as U,k as J}from"./index-fa055cb8.js";import{S as Z,a as ee,B as ne,b as L}from"./ButtonLoad-5b8d7df7.js";import{F as T}from"./FontAwesome4-64371a0f.js";import{B as _}from"./Button-b6c26fff.js";import{B as te}from"./ButtonClose-01990b88.js";import{w as se,F as ae,C as oe,G as ie,I as re}from"./reactstrap.modern-274e1102.js";import{D as le,Q as ce}from"./QuickSearch-2b8999c3.js";import{L as C,a as me,b as he}from"./ListItem-1dafb2d8.js";import{b as ue,e as x,C as de,D as pe,f as ge,g as fe,h as Ne}from"./DialogCustomize-3c3737d6.js";import{R as ve}from"./Required-11df292c.js";import{d as be}from"./InputNumber-092cea71.js";import"./InputTime-cf0160db.js";import{I as je}from"./Icon-d973dfc5.js";import{_ as A}from"./OdataUtils-36531977.js";import{c as y,a as R}from"./withStyles-fa9fb6d9.js";import{w as k}from"./capitalize-d666ae9b.js";import{S as P}from"./Skeleton-7cb68aa7.js";const xe=()=>{const i=new Date().getFullYear();let t=[];for(var e=i-5;e<=i+2;e++)t.push({value:e,label:`Năm ${e}`});return t},ke=i=>{let t=[],e=new Date().getFullYear(),n=e-2,a=e+5;i.minYear&&i.maxYear&&(n=i.minYear,a=i.maxYear);for(let o=n;o<=a;o++)t.push({value:o,label:o});return t};class I extends l.Component{render(){const{value:t,onChange:e,isDetail:n,disabled:a,options:o,generateOptions:c}=this.props,m=c?ke(c):xe(),d=t||"";return n?s.jsxDEV("div",{style:{textAlign:"center"},children:d?"Năm "+d:""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectYear.jsx",lineNumber:36,columnNumber:14},this):s.jsxDEV(Z,{disabled:a,value:d,onChange:e,options:o||m,valueRef:"value",labelRef:"label",placeholder:"Chọn năm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectYear.jsx",lineNumber:39,columnNumber:9},this)}}I.propTypes={};I.defaultProps={placeholder:"Chọn..."};const nn=I,Ve=ue(l.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");var De=function(t){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:t.palette.background.default,backgroundColor:t.palette.type==="light"?t.palette.grey[400]:t.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:t.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}};function Ae(i){var t=i.src,e=i.srcSet,n=l.useState(!1),a=n[0],o=n[1];return l.useEffect(function(){if(!(!t&&!e)){o(!1);var c=!0,m=new Image;return m.src=t,m.srcSet=e,m.onload=function(){c&&o("loaded")},m.onerror=function(){c&&o("error")},function(){c=!1}}},[t,e]),a}var M=l.forwardRef(function(t,e){var n=t.alt,a=t.children,o=t.classes,c=t.className,m=t.component,d=m===void 0?"div":m,w=t.imgProps,V=t.sizes,v=t.src,b=t.srcSet,D=t.variant,B=D===void 0?"circular":D,E=A(t,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),p=null,g=Ae({src:v,srcSet:b}),u=v||b,F=u&&g!=="error";return F?p=l.createElement("img",N({alt:n,src:v,srcSet:b,sizes:V,className:o.img},w)):a!=null?p=a:u&&n?p=n[0]:p=l.createElement(Ve,{className:o.fallback}),l.createElement(d,N({className:y(o.root,o.system,o[B],c,!F&&o.colorDefault),ref:e},E),p)});M.propTypes={alt:r.string,children:r.node,classes:R(r.object,function(i){var t=i.classes;if(t==null)return null;if(t.circle!=null&&t.circle.split(" ").length>1)throw new Error("Material-UI: The `circle` class is deprecated. Use `circular` instead.");return null}),className:r.string,component:r.elementType,imgProps:r.object,sizes:r.string,src:r.string,srcSet:r.string,variant:R(r.oneOf(["circle","circular","rounded","square"]),function(i){var t=i.variant;if(t==="circle")throw new Error('Material-UI: `variant="circle"` is deprecated. Use `variant="circular"` instead.');return null})};const ye=k(De,{name:"MuiAvatar"})(M);var we={root:{marginBottom:12}},H=l.forwardRef(function(t,e){return l.createElement(x,N({component:"p",variant:"body1",color:"textSecondary",ref:e},t))});H.propTypes={children:r.node,classes:r.object};const Be=k(we,{name:"MuiDialogContentText"})(H);var Ee={root:{minWidth:56,flexShrink:0},alignItemsFlexStart:{marginTop:8}},q=l.forwardRef(function(t,e){var n=t.classes,a=t.className,o=A(t,["classes","className"]),c=l.useContext(C);return l.createElement("div",N({className:y(n.root,a,c.alignItems==="flex-start"&&n.alignItemsFlexStart),ref:e},o))});q.propTypes={children:r.element.isRequired,classes:r.object,className:r.string};const Se=k(Ee,{name:"MuiListItemAvatar"})(q);var Te=function(t){return{root:{minWidth:56,color:t.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}},z=l.forwardRef(function(t,e){var n=t.classes,a=t.className,o=A(t,["classes","className"]),c=l.useContext(C);return l.createElement("div",N({className:y(n.root,a,c.alignItems==="flex-start"&&n.alignItemsFlexStart),ref:e},o))});z.propTypes={children:r.node,classes:r.object,className:r.string};const Ce=k(Te,{name:"MuiListItemIcon"})(z);var Ie={root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},Y=l.forwardRef(function(t,e){var n=t.children,a=t.classes,o=t.className,c=t.disableTypography,m=c===void 0?!1:c,d=t.inset,w=d===void 0?!1:d,V=t.primary,v=t.primaryTypographyProps,b=t.secondary,D=t.secondaryTypographyProps,B=A(t,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),E=l.useContext(C),p=E.dense,g=V??n;g!=null&&g.type!==x&&!m&&(g=l.createElement(x,N({variant:p?"body2":"body1",className:a.primary,component:"span",display:"block"},v),g));var u=b;return u!=null&&u.type!==x&&!m&&(u=l.createElement(x,N({variant:"body2",className:a.secondary,color:"textSecondary",display:"block"},D),u)),l.createElement("div",N({className:y(a.root,o,p&&a.dense,w&&a.inset,g&&u&&a.multiline),ref:e},B),g,u)});Y.propTypes={children:r.node,classes:r.object,className:r.string,disableTypography:r.bool,inset:r.bool,primary:r.node,primaryTypographyProps:r.object,secondary:r.node,secondaryTypographyProps:r.object};const $e=k(Ie,{name:"MuiListItemText"})(Y);class Fe extends l.Component{constructor(e){super(e);h(this,"renderbutton",()=>s.jsxDEV("div",{style:{float:"right"},children:[s.jsxDEV(ee,{onClick:this.props.close,children:"Hủy"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:21,columnNumber:9},this),s.jsxDEV(ne,{size:"sm",type:"submit",children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:22,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:20,columnNumber:7},this));h(this,"submitHandler",e=>{e.preventDefault();let n=new FormData(this.formRef.current);this.props.onSubmit(n)});this.state={file:"",Subject:""},this.formRef=W.createRef()}getInputValue(e,n){return this.props.data&&this.props.data[e]?this.props.data[e]:n||""}render(){return s.jsxDEV(de,{open:this.props.open,handleClose:this.props.close,title:"Đính kèm văn bản",maxWidth:"xs",children:s.jsxDEV(se,{innerRef:this.formRef,id:"upload-vanban-form",method:"POST",onSubmit:this.submitHandler,children:[s.jsxDEV(ae,{row:!0,children:[s.jsxDEV(ve,{xs:"4",children:"Tệp tin"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:43,columnNumber:13},this),s.jsxDEV(oe,{xs:"8",children:s.jsxDEV(be,{name:"file",onChange:e=>this.setState({file:e}),title:"Chọn tập tin pdf đính kèm trước khi tải lên",accept:"application/pdf",required:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:45,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:44,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:42,columnNumber:11},this),this.renderbutton()]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:41,columnNumber:9},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/DetailDrawer/DetailFormDoanhNghiep.jsx",lineNumber:40,columnNumber:7},this)}}class Q extends l.Component{constructor(e){super(e);h(this,"uploadVanBan",e=>{let n=this,a=Math.max(...this.state.data.map(o=>o.stt));e.append("target_id",n.props.target_id||null),e.append("target_module",n.props.target_module||null),e.append("ma_tai_khoan",S.MaTaiKhoan),e.append("created_date",new Date),e.append("stt",a),X("QuanLyVanBan/Attachment","POST",e).then(function(o){n.getItems(),n.setState({uploading:!1,showPopup:!1})}).catch(function(o){j(o)})});h(this,"addAttachment",async e=>{let n=Math.max(...this.state.data.map(a=>a.stt),1);for(let a=0;a<e.length;a++){let o={target_id:this.props.target_id||null,target_module:this.props.target_module||null,created_by:S.MaTaiKhoan,created_date:new Date,id_van_ban:e[a],stt:++n};try{await f("Attachments","POST",JSON.stringify(o))}catch(c){console.log(c)}}this.setState({searching:!1}),this.getItems()});h(this,"deleteAttachment",async(e,n)=>{try{await U("Bạn muốn xóa văn bản sau khỏi danh sách văn bản liên quan","Xác nhận")&&f(`Attachments(guid'${e}')`,"DELETE",null).then(()=>f(`VanBans(guid'${n}')`,"DELETE",null).then(()=>this.getItems()))}catch(a){j(a)}});h(this,"popupImage",e=>{var n=document.getElementById("myModal"),a=document.getElementById("img01"),o=document.getElementById("caption");n.style.display="block",a.src=e.src,o.innerHTML=e.alt;var c=document.getElementsByClassName("close")[0];c.onclick=function(){n.style.display="none",a.src="",o.innerHTML=""}});this.uploadVanBan=this.uploadVanBan.bind(this),this.addAttachment=this.addAttachment.bind(this),this.deleteAttachment=this.deleteAttachment.bind(this),this.state={searching:!1,uploading:!1,data:[],LoaiDonVi:null,showPopup:!1}}componentDidMount(){this.getDN(),this.getItems()}getDN(){f(`DonVis?$filter=MaDonVi eq '${S.MaDonVi}'`).then(e=>this.setState({LoaiDonVi:e.value[0]?e.value[0].LoaiDonVi:null})).catch(e=>console.log(e))}getItems(){const{isChange:e}=this.props;let n=this;f(`Attachments?$expand=VanBan&$filter=target_id eq '${this.props.target_id}' and IsAttachment eq true&$orderby=stt`,"GET",null).then(function(a){n.setState({data:a.value},()=>e(n.state.data.length))}).catch(function(a){j(a.Message||a)})}downloadPDF(e){let n=e.LinkFile.split("/")[3].split(".")[1];G(`QuanLyVanBan/Download?id=${e.ID}`,e.Subject+`.${n}`).then().catch(function(a){j(a)})}getCode(e){let n=[];return e.CodeNumber&&n.push(e.CodeNumber),e.CodeNotation&&n.push(e.CodeNotation),n.join("/")}renderClassName(e){let n="";switch(e.LinkFile.split("/")[3].split(".")[1]){case"pdf":n="fa fa-file-pdf-o colorRed";break;case"xlsx":n="fa fa-file-excel-o colorGreen";break;case"xls":n="fa fa-file-excel-o colorGreen";break;case"docx":n="fa fa-file-word-o colorBlue";break;case"doc":n="fa fa-file-word-o colorBlue";break}return n}render(){const{LoaiDonVi:e}=this.state;return s.jsxDEV("div",{children:[s.jsxDEV("hr",{},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:170,columnNumber:9},this),s.jsxDEV("div",{className:"clearfix",children:[s.jsxDEV("b",{children:"DANH SÁCH ĐÍNH KÈM"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:172,columnNumber:11},this),s.jsxDEV("div",{className:"pull-right",children:s.jsxDEV(_,{color:"success",onClick:()=>{this.setState({showPopup:!0})},children:[s.jsxDEV(T,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:180,columnNumber:15},this)," Tải lên"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:174,columnNumber:13},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:173,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:171,columnNumber:9},this),s.jsxDEV("p",{},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:184,columnNumber:9},this),s.jsxDEV(ie,{size:"sm",className:"table-bordered table-attachment",children:[s.jsxDEV("thead",{children:s.jsxDEV("tr",{children:[s.jsxDEV("th",{children:"#"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:188,columnNumber:15},this),s.jsxDEV("th",{children:"Tiêu đề"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:189,columnNumber:15},this),s.jsxDEV("th",{children:"Thao tác"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:190,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:187,columnNumber:13},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:186,columnNumber:11},this),s.jsxDEV("tbody",{children:this.state.data&&this.state.data.length?this.state.data.map((n,a)=>n.VanBan?s.jsxDEV("tr",{children:[s.jsxDEV("td",{className:"td-stt",children:a+1},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:198,columnNumber:21},this),s.jsxDEV("td",{children:[s.jsxDEV("div",{className:"pull-left",children:n.VanBan.LinkFile.split("/")[3].split(".")[1]==="png"||n.VanBan.LinkFile.split("/")[3].split(".")[1]==="jpg"?s.jsxDEV("img",{onClick:o=>this.popupImage(o.target),alt:"",src:J+n.VanBan.LinkFile,className:"myImg",width:"50",height:"30"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:203,columnNumber:27},this):s.jsxDEV(je,{style:{fontSize:"2rem",marginRight:5},className:this.renderClassName(n.VanBan)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:212,columnNumber:27},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:200,columnNumber:23},this),s.jsxDEV("div",{className:"pull-left",children:e&&e===2?s.jsxDEV("p",{children:n.VanBan.Subject},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:220,columnNumber:27},this):s.jsxDEV(s.Fragment,{children:[s.jsxDEV("div",{className:"small text-muted",children:["Số, ký hiệu: ",this.getCode(n.VanBan)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:223,columnNumber:29},this),s.jsxDEV("div",{children:n.VanBan.Subject},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:224,columnNumber:29},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:222,columnNumber:27},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:218,columnNumber:23},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:199,columnNumber:21},this),s.jsxDEV("td",{className:"td-actions",children:[s.jsxDEV(L,{color:"primary",icon:"download",onClick:o=>this.downloadPDF(n.VanBan),title:"Tải xuống"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:230,columnNumber:23},this),n.VanBan&&s.jsxDEV(L,{color:"danger",icon:"times",onClick:o=>this.deleteAttachment(n.id,n.VanBan.ID),title:"Xóa văn bản"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:237,columnNumber:25},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:229,columnNumber:21},this)]},n.id_van_ban,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:197,columnNumber:19},this):null):s.jsxDEV("tr",{children:s.jsxDEV("td",{colSpan:"3",className:"td-noAttachment",children:"Không có văn bản đính kèm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:250,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:249,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:193,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:185,columnNumber:9},this),this.state.searching?s.jsxDEV(Le,{target_id:this.props.target_id,target_module:this.props.target_module,setClose:()=>this.setState({searching:!1}),onSubmit:this.addAttachment},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:258,columnNumber:11},this):null,this.state.uploading?s.jsxDEV(le,{mode:"create",onOpen:()=>this.setState({uploading:!0}),onClose:()=>this.setState({uploading:!1}),onSubmit:this.uploadVanBan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:266,columnNumber:11},this):null,this.state.showPopup?s.jsxDEV(Fe,{open:this.state.showPopup,close:()=>this.setState({showPopup:!1}),onSubmit:this.uploadVanBan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:274,columnNumber:11},this):null,s.jsxDEV("div",{id:"myModal",className:"modal",children:[s.jsxDEV("span",{className:"close",children:"×"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:282,columnNumber:11},this),s.jsxDEV("img",{className:"modal-content",id:"img01",alt:""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:283,columnNumber:11},this),s.jsxDEV("div",{id:"caption"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:284,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:281,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/Attachment.jsx",lineNumber:169,columnNumber:7},this)}}Q.propTypes={target_module:r.string.isRequired,target_id:r.string.isRequired,onView:r.func};const tn=Q;class $ extends l.Component{constructor(e){super(e);h(this,"handleChange",e=>{this.setState({searchText:e.target.value})});h(this,"selectVanBan",e=>{let n=this.state.selected;n.indexOf(e.target.value)>-1?n.splice(n.indexOf(e.target.value),1):n.push(e.target.value)});h(this,"submitHandler",e=>{this.props.onSubmit(this.state.selected)});this.updateResult=this.updateResult.bind(this),this.state={searchText:"",result:[],selected:[]}}componentDidMount(){this.updateResult()}updateResult(){let e=this;f(`VanBans?$select=ID,Subject,CodeNumber,CodeNotation&$filter= DocType ne null and substringof('${e.state.searchText}', Subject) and Attachments/all(a:a/target_id ne '${e.props.target_id}')`).then(function(n){e.setState({result:n.value})}).catch(function(n){j(n)})}getSize(e){let n=e;if(n<1e3)return n+" bytes";if(n=n/1e3,n<1e3)return n.toFixed(2)+" KB";if(n=n/1e3,n<1e3)return n.toFixed(2)+" MB";if(n=n/1e3,n<1e3)return n.toFixed(2)+" GB"}getCode(e){let n=[];return e.CodeNumber&&n.push(e.CodeNumber),e.CodeNotation&&n.push(e.CodeNotation),"Số, ký hiệu: "+n.join("/")}showResult(){return this.state.result&&this.state.result.length?s.jsxDEV(me,{dense:!0,children:this.state.result.map((e,n)=>s.jsxDEV(he,{children:[s.jsxDEV(Ce,{children:s.jsxDEV(re,{id:"vb_"+e.ID,type:"checkbox",value:e.ID,onChange:this.selectVanBan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:73,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:72,columnNumber:13},this),s.jsxDEV(Se,{children:s.jsxDEV(ye,{children:s.jsxDEV(T,{fa:"file-pdf-o",style:{color:"red"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:77,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:76,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:75,columnNumber:13},this),s.jsxDEV($e,{primary:e.Subject,secondary:this.getCode(e)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:80,columnNumber:13},this)]},n,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:71,columnNumber:11},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:69,columnNumber:7},this):s.jsxDEV(Be,{children:"* Không tìm thấy văn bản nào"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:85,columnNumber:7},this)}render(){return s.jsxDEV(pe,{open:this.props.open,onClose:this.props.setClose,fullWidth:!0,scroll:"paper",maxWidth:"lg",style:{height:"100%"},children:[s.jsxDEV(ge,{children:["Tìm kiếm văn bản",s.jsxDEV(ce,{placeholder:"Nhập thông tin văn bản cần tìm",value:this.state.searchText,onChange:this.handleChange,onSearch:this.updateResult},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:108,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:106,columnNumber:9},this),s.jsxDEV(fe,{children:this.showResult()},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:115,columnNumber:9},this),s.jsxDEV(Ne,{children:[s.jsxDEV(te,{color:"danger",onClick:this.props.setClose,children:"Đóng lại"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:117,columnNumber:11},this),s.jsxDEV(_,{color:"primary",onClick:this.submitHandler,children:[s.jsxDEV(T,{fa:"paperclip"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:121,columnNumber:13},this)," Đính kèm"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:120,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:116,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/components/VanBan/Attachment/AttachSearch.jsx",lineNumber:98,columnNumber:7},this)}}$.propTypes={open:r.bool,setClose:r.func.isRequired,onSubmit:r.func.isRequired};$.defaultProps={open:!0};const Le=$,sn=({maPhuongXa:i,maThonXom:t})=>{const[e,n]=l.useState(void 0);return l.useEffect(()=>{i?f(`PhuongXas?$filter=MaPhuongXa eq '${i}' &$expand=QuanHuyen,QuanHuyen/TinhThanh`).then(({value:[a]})=>{n(`${a.TenPhuongXa}, ${a.QuanHuyen.TenQuanHuyen}, ${a.QuanHuyen.TinhThanh.TenTinhThanh}`),t&&f(`ThonXoms(${t})`).then(o=>{n(c=>`Thôn ${o==null?void 0:o.Ten}, `+c)})}):n(null)},[i,t]),e===void 0?s.jsxDEV("div",{children:[s.jsxDEV(P,{width:250},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/TextHuyenPhuongXa.jsx",lineNumber:26,columnNumber:7},globalThis),s.jsxDEV(P,{width:100},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/TextHuyenPhuongXa.jsx",lineNumber:27,columnNumber:7},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/TextHuyenPhuongXa.jsx",lineNumber:25,columnNumber:5},globalThis):e};export{tn as A,nn as S,sn as T};