????
Current Path : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/ |
Current File : C:/inetpub/vhost/lantha.gdtsolutions.vn/wwwtest/wwwroot/static/js/1274.aed6cb89.chunk.js |
"use strict";(self.webpackChunkgdt=self.webpackChunkgdt||[]).push([[1274],{428:(e,t,n)=>{n.d(t,{A5:()=>h,G5:()=>o,Is:()=>f,UI:()=>a,V$:()=>u,Yv:()=>d,Z5:()=>c,e9:()=>p,gn:()=>i,jB:()=>r,xz:()=>g});n(67116);const o=e=>e.filter((e=>e.dataID))[0],a=e=>o(e).field,i=e=>e&&e.includes("."),l=e=>e.split(".").join("/"),s=(e,t)=>e?t.field:t,d=(e,t,n)=>{const a=o(t);return`${e}(${"guid"===a.type?"guid":""}'${n[a.field]}')`},r=function(e,t,n){return arguments.length>3&&void 0!==arguments[3]&&arguments[3]?`substringof('${n}', ${e})`:`${e} eq ${((e,t)=>"string"===e?`'${t}'`:"datetime"===e?`datetime'${t}'`:"guid"===e?`guid'${t}'`:`${t}`)(t,n)}`},h=(e,t)=>{if(e.filters&&e.filters.length>0){const t=e.filters.filter((e=>e.column.field&&e.column.type)).map((e=>{const t=`${i(e.column.field)?e.column.dataRef?e.column.dataRef[0]:l(e.column.field):e.column.field}`;return r(t,e.column.type,e.value)}));return t&&t.join(" and ")}if(e.search&&e.search.length>=1){const n=t.filter((e=>e.searchable&&e.field&&e.type)).map((t=>{const n=`${i(t.field)?l(t.field):t.field}`;return r(n,t.type,e.search,!0)}));return n&&n.join(" or ")}return""},c=(e,t)=>`$top=${t}&$skip=${e*t}&$inlinecount=allpages`,u=(e,t)=>`&$orderby=${i(e)?l(e):e} ${t}`,p=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.filter((e=>i(s(t,e))));return 0===n.length?"":`&$expand=${function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[];return e.forEach(((e,o)=>{let a=s(t,e).split(".").reverse().splice(1).reverse().join("/");0===o?n.push(a):n.some((e=>e===a))||n.push(a)})),n.join(",")}(n,t)}`},f=function(e){const t=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t?"withColumns"===t?`${e.reduce(((e,t,o,a)=>{let d=s(n,t),r=`${e}`;return i(d)?r+=`${void 0===t.dataRef?"":t.dataRef[0]+","}${l(d)}`:r+=`${d}`,`${r}${o===a.length-1?"":","}`}),"")}`:"":`${e.filter((e=>i(e.field))).reduce(((e,t)=>`${e},${l(s(n,t))}`),"*")}`}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"withColumns",!(arguments.length>2&&void 0!==arguments[2])||arguments[2]);return t?`&$select=${t}`:""},g=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"withColumns";return`${p(e,n)}${f(e,o,n)}${t?"&$filter="+t:""}`}},10077:(e,t,n)=>{n.d(t,{A:()=>b});var o=n(9950),a=n(15255);const i={body:{emptyDataSourceMessage:"Kh\xf4ng c\xf3 d\u1eef li\u1ec7u \u0111\u1ec3 hi\u1ec3n th\u1ecb",addTooltip:"Th\xeam",editTooltip:"S\u1eeda",deleteTooltip:"X\xf3a",editRow:{deleteText:"B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn x\xf3a d\xf2ng n\xe0y kh\xf4ng?",cancelTooltip:"H\u1ee7y",saveTooltip:"L\u01b0u"}},toolbar:{exportTitle:"Xu\u1ea5t file",searchTooltip:"T\xecm ki\u1ebfm",showColumnsTitle:"Hi\u1ec7n c\u1ed9t",addRemoveColumns:"Th\xeam v\xe0 hi\u1ec3n th\u1ecb c\xe1c c\u1ed9t",searchPlaceholder:"T\xecm ki\u1ebfm"},pagination:{labelRowsPerPage:"S\u1ed1 d\xf2ng cho 1 trang",labelRowsSelect:"d\xf2ng",labelDisplayedRows:" {from}-{to} c\u1ee7a {count}",firstTooltip:"Trang \u0111\u1ea7u ti\xean",previousTooltip:"Trang tr\u01b0\u1edbc",nextTooltip:"Trang sau",lastTooltip:"Trang cu\u1ed1i c\xf9ng"},header:{actions:"Thao t\xe1c"}};var l=n(44414);const s=o.lazy((()=>Promise.all([n.e(9818),n.e(8185),n.e(3130),n.e(783),n.e(7930),n.e(7608),n.e(7476),n.e(484),n.e(7925),n.e(5060),n.e(2026),n.e(8190),n.e(537),n.e(1105)]).then(n.bind(n,38671)))),d=o.lazy((()=>Promise.all([n.e(9818),n.e(3130),n.e(783),n.e(7930),n.e(5060),n.e(5897)]).then(n.bind(n,46350)))),r=o.lazy((()=>Promise.all([n.e(9818),n.e(3435)]).then(n.bind(n,33435)))),h={color:"#000",padding:"2px",fontSize:"12px",fontWeight:"bold",textAlign:"center",backgroundColor:"powderblue",borderLeft:"0.5px solid rgb(224, 224, 224)",zIndex:99},c={even:"#FFF",odd:"rgb(247, 248, 255)"},u={fontSize:"12px",borderLeft:"0.5px solid rgba(224, 224, 224, 1)"};class p extends o.Component{render(){const{addMoreRows:e,pageSize:t,search:n,CustumToolbar:o,CustumCell:a,SearchAdvanced:c,onRowClick:p,dataCount:f,rowStyle:g,rowsPerPage:m,page:b,...C}=this.props;return(0,l.jsx)(s,{...C,addMoreRows:e,localization:i,options:{exportButton:!1,search:n,actionsColumnIndex:-1,pageSize:t,headerStyle:h,rowStyle:g},onRowClick:void 0===p?void 0:(e,t)=>p(e,t),components:(()=>{let e={Toolbar:e=>(0,l.jsx)(d,{...e,SearchAdvanced:c}),Cell:e=>(0,l.jsx)(r,{...e,style:u})};return o&&(e.Toolbar=o),a&&(e.Cell=a),e})()})}}p.defaultProps={rowStyle:(e,t,n)=>({backgroundColor:t%2===0?c.even:c.odd}),pageSize:10,search:!0};var f=n(428),g=n(4370),m=n(67116);class b extends o.Component{render(){const{tableRef:e,url:t,title:n,columns:o,pageSize:i,detailPanel:s,where:d,search:r,selectType:h,rowStyle:c,onAdd:u,onEdit:b,onDelete:C,onActions:v,onRowClick:T,SearchAdvanced:D,CustumToolbar:y,CustumCell:$,urlExt:R,unRefresDatatable:x,notCreateUUID:w,messageCustomDetele:S}=this.props,A=e=>o.filter((e=>f.gn(e.field)&&e.dataRef)).map((e=>({column:e,field_split:e.field.split(".")}))).forEach((t=>{delete e[t.field_split[0]]})),k=e=>{let t=o.filter((e=>e.dataCheck));for(var n=0;n<t.length;n++)if(f.gn(t[n].field)&&t[n].dataRef){if(null===e[t[n].dataRef[0]]||void 0===e[t[n].dataRef[0]]||""===e[t[n].field])return(0,m.AB)("Vui l\xf2ng nh\u1eadp d\u1eef li\u1ec7u c\u1ed9t "+t[n].title),!1}else if(void 0===e[t[n].field]||null===e[t[n].field]||""===e[t[n].field])return(0,m.AB)("Vui l\xf2ng nh\u1eadp d\u1eef li\u1ec7u c\u1ed9t "+t[n].title),!1;return!0};return(0,l.jsx)(p,{search:r,pageSize:i,title:n,columns:o,tableRef:e,SearchAdvanced:D,CustumToolbar:y,CustumCell:$,data:e=>R?(0,g.g3)((e=>`${R}${d?"?"+d:"&"}skip=${e.page*e.pageSize}&take=${e.pageSize}`)(e),"GET",null,!1).then((t=>({data:void 0===t.value?[]:t.value,page:e.page,totalCount:Number(t.count)}))):(0,g.g3)((e=>{let n=`${t}?${f.Z5(e.page,e.pageSize)}`;n+=`${f.e9(o)}${f.Is(o,h)}`,e.orderBy&&void 0!==e.orderBy&&e.orderDirection&&""!==e.orderDirection&&(n+=f.V$(e.orderBy.field,e.orderDirection));let a=f.A5(e,o);return n+=a?d?`&$filter=(${a}) and ${d}`:`&$filter=${a}`:d?"&$filter="+d:"",n})(e)).then((t=>({data:void 0===t.value?[]:t.value,page:e.page,totalCount:Number(t["odata.count"])}))),rowStyle:c,detailPanel:s,editable:(()=>{let e={};return u&&void 0===u.onClick&&!1===u.disabled&&(void 0===u.onRowAdd?e.onRowAdd=e=>new Promise(((n,i)=>{let l=f.G5(o);l.type&&"numeric"!==l.type&&(w?delete e[f.UI(o)]:l.dataIdCustom||(e[f.UI(o)]=(0,a.A)())),A(e),u.defaultValues&&u.defaultValues.forEach((t=>e[t.field]=t.value)),k(e)?(0,g.g3)(`${t}`,"POST",JSON.stringify(e)).then((e=>n(e))).catch((e=>{e.json().then((e=>(0,m.AB)(e.value))),i(e)})).finally((()=>{this.props.updateCountRadioList&&this.props.updateCountRadioList(),this.props.addCallback&&this.props.addCallback()})):i()})).then((e=>this.props.addCallbackWithResponse&&this.props.addCallbackWithResponse(e))).catch((e=>console.log(e))):e.onRowAdd=e=>u.onRowAdd(e)),b&&void 0===b.onClick&&(b.hidden&&("function"===typeof b.hidden?e.onUpdateHidden=e=>b.hidden(e):e.onUpdateHidden=b.hidden),b.disabled&&(e.isEditable=e=>b.disabled(e)),void 0===b.onRowUpdate?e.onRowUpdate=(e,n)=>new Promise(((a,i)=>{A(e),k(e)?(0,g.g3)(f.Yv(t,o,n),"PATCH",JSON.stringify(e)).then((()=>a())).catch((e=>{e.json().then((e=>(0,m.AB)(e.value))),i(e)})).finally((()=>{this.props.updateCountRadioList&&this.props.updateCountRadioList(),this.props.updateCallback&&this.props.updateCallback()})):i()})):e.onRowUpdate=(e,t)=>b.onRowUpdate(e,t)),C&&void 0===C.onClick&&(C.hidden&&("function"===typeof C.hidden?e.onDeleteHidden=e=>C.hidden(e):e.onDeleteHidden=C.hidden),C.disabled&&(e.isDeletable=e=>C.disabled(e)),void 0===C.onRowDelete?e.onRowDelete=e=>new Promise(((n,a)=>(0,g.g3)(f.Yv(t,o,e),"DELETE").then((()=>{C.messageSuccess?n(null,C.messageSuccess):n("X\xf3a d\u1eef li\u1ec7u th\xe0nh c\xf4ng !")})).catch((e=>{S?(0,m.a3)(S,"Th\xf4ng b\xe1o"):(0,m.a3)("X\xf3a d\u1eef li\u1ec7u kh\xf4ng th\xe0nh c\xf4ng !"),C.messageError?a(e,C.messageError):a("X\xf3a d\u1eef li\u1ec7u th\u1ea5t b\u1ea1i !")})).finally((()=>{this.props.updateCountRadioList&&this.props.updateCountRadioList(),this.props.deleteCallback&&this.props.deleteCallback()})))):e.onRowDelete=e=>C.onRowDelete(e)),e})(),actions:(()=>{let e=[];return v&&v.map((t=>e.push(t))),u&&u.onClick&&(u.icon="add_box",u.tooltip="Th\xeam",u.isAdd=!0,u.isFreeAction=!0,e.push(u)),b&&b.onClick&&(b.icon="edit",b.tooltip="S\u1eeda",b.isEdit=!0,e.push(b)),C&&C.onClick&&(C.icon="delete",C.tooltip="X\xf3a",C.isDelete=!0,e.push(C)),e})(),onRowClick:void 0===T?void 0:(e,t)=>T(e,t)})}}b.defaultProps={title:"",columns:[],pageSize:10,search:!0,tableRef:o.createRef()}},15255:(e,t,n)=>{var o;n.d(t,{A:()=>c});var a=new Uint8Array(16);function i(){if(!o&&!(o="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(a)}const l=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const s=function(e){return"string"===typeof e&&l.test(e)};for(var d=[],r=0;r<256;++r)d.push((r+256).toString(16).substr(1));const h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(d[e[t+0]]+d[e[t+1]]+d[e[t+2]]+d[e[t+3]]+"-"+d[e[t+4]]+d[e[t+5]]+"-"+d[e[t+6]]+d[e[t+7]]+"-"+d[e[t+8]]+d[e[t+9]]+"-"+d[e[t+10]]+d[e[t+11]]+d[e[t+12]]+d[e[t+13]]+d[e[t+14]]+d[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};const c=function(e,t,n){var o=(e=e||{}).random||(e.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var a=0;a<16;++a)t[n+a]=o[a];return t}return h(o)}},32385:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(9950),a=n(23931),i=n(44414);class l extends o.Component{render(){let{children:e,className:t,FilterSearchAdvanced:n,FilterNoHeader:o,NoTabs:l}=this.props,s=[];return t&&s.push(t),s.push("filter-datatable"),n&&s.push("filter-search-advanced"),o&&s.push("filter-no-header"),l&&s.push("filter-no-tabs"),(0,i.jsx)(a.A,{className:s.join(" "),md:"9",children:e})}}l.defaultProps={className:"",FilterSearchAdvanced:"",FilterNoHeader:"",NoTabs:""}},41274:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var o=n(9950),a=n(10077),i=n(30616),l=n(28412),s=n(62181),d=n(23931),r=n(32385),h=n(67116),c=n(4370),u=n(58195),p=n(14113),f=n(99308),g=n(85907),m=n(18849),b=n(16272),C=n(73613),v=n(44414),T={Id:{field_name:"Id"},TenDiemKinhDoanh:{field_name:"TenDiemKinhDoanh",title:"T\xean",type:"textbox",required:!0}};class D extends o.Component{constructor(e){super(e),this.loadData=()=>{this.props.ID&&(0,c.Pq)(`DiemKinhDoanhs(${this.props.ID})`,"GET",null).then((e=>this.setState({data:{TenDiemKinhDoanh:e.Ten}})))},this.setStateData=(e,t)=>{var{data:n}=this.state;n[e]=t,this.setState({data:n})},this.handleChange=(e,t)=>{this.setStateData(e,t)},this.state={data:{Id:null,TenDiemKinhDoanh:""}},this.save=this.save.bind(this)}componentDidMount(){this.loadData()}save(){if(this.handleValidate()){const{data:e}=this.state;let t=this.props.ID?"DiemKinhDoanh/CapNhat":"DiemKinhDoanh/TaoMoi",n=this.props.ID?"C\u1eadp nh\u1eadt th\xe0nh c\xf4ng!":"T\u1ea1o \u0111i\u1ec3m kinh doanh th\xe0nh c\xf4ng",o={DiemKinhDoanhId:this.props.ID||"",TenDiemKinhDoanh:e.TenDiemKinhDoanh};(0,c.Pq)(t,"POST",JSON.stringify(o),!1).then((e=>{this.props.onReloadTable(),this.props.onClose(),(0,h.nw)(n,"Th\xf4ng b\xe1o")})).catch((e=>(0,h.a3)("\u0110\xe3 x\u1ea3y ra l\u1ed7i","Th\xf4ng b\xe1o")))}}handleValidate(){const e=Object.values(T).filter((e=>e.required));let{data:t}=this.state;for(let n=0;n<e.length;n++){const o=e[n];let a=t[o.field_name];return null!==a&&""!==a&&void 0!==a&&0!==a.length||((0,h.AB)('Vui l\xf2ng nh\u1eadp "'+o.title+'"'),!1)}}render(){const{data:e}=this.state,{openModal:t,onClose:n,ID:o}=this.props;let a=o?"Ch\u1ec9nh s\u1eeda":"Th\xeam m\u1edbi";return(0,v.jsxs)(u.A,{isOpen:t,className:"modal-them-dkd",children:[(0,v.jsx)(p.A,{children:a}),(0,v.jsx)(f.A,{children:(0,v.jsx)(b.A,{data:T.TenDiemKinhDoanh,value:e.TenDiemKinhDoanh,onChange:this.handleChange})}),(0,v.jsxs)(g.A,{children:[(0,v.jsxs)(m.A,{color:"success",style:{marginRight:"10px"},onClick:this.save,children:[(0,v.jsx)(C.A,{fa:"save"})," L\u01b0u"]}),(0,v.jsxs)(m.A,{color:"dark",onClick:()=>{n()},children:[(0,v.jsx)(C.A,{fa:"ban"})," B\u1ecf qua"]})]})]})}}var y=[{field:"Id",type:"numeric",dataID:!0,hidden:!0,editable:"never"},{title:"T\xean",field:"Ten",type:"string",dataCheck:!0,searchable:!0}];const $=o.createRef(),R=()=>$.current&&$.current.onQueryChange();class x extends o.Component{constructor(e){super(e),this.createKho=e=>{(0,c.Pq)("DiemKinhDoanh/TaoMoi","POST",JSON.stringify(e),!1).then((e=>{this.props.reloadTable(),(0,h.nw)("T\u1ea1o kho th\xe0nh c\xf4ng","Th\xf4ng b\xe1o")})).catch((e=>(0,h.a3)("\u0110\xe3 x\u1ea3y ra l\u1ed7i","Th\xf4ng b\xe1o")))},this.setSearch=e=>{13===e.charCode&&this.setState({search:e.target.value},(()=>R()))},this.state={search:null,Ten:"",openModal:!1}}deleteRow(e){(0,c.Pq)(`DiemKinhDoanh/HuyDiemKinhDoanh?Id=${e}`,"DELETE",null,!1).then((t=>(0,h.nw)("X\xf3a \u0111i\u1ec3m kinh doanh "+e+" th\xe0nh c\xf4ng!","Th\xf4ng b\xe1o").then((()=>R())))).catch((e=>(0,h.a3)("\u0110\xe3 x\u1ea3y ra l\u1ed7i!","Th\xf4ng b\xe1o")))}render(){const{search:e,openModal:t,Id:n}=this.state;let o=[];return e&&o.push(`substringof('${e}', Ten)`),(0,v.jsxs)(i.A,{children:[(0,v.jsx)(l.A,{NoTabs:!0,children:(0,v.jsx)(d.A,{md:"12",className:"p-0 mb-2",children:(0,v.jsx)(s.A,{title:"T\xecm ki\u1ebfm",defaultValue:e,onKeyPress:e=>this.setSearch(e),placeholder:"T\xecm ki\u1ebfm theo t\xean..."})})}),(0,v.jsxs)(r.A,{NoTabs:!0,children:[(0,v.jsx)(a.A,{tableRef:$,title:"Danh s\xe1ch chi nh\xe1nh",url:"DiemKinhDoanhs",columns:y,where:o.join(" and "),selectType:"withColumns",onAdd:{onClick:()=>{this.setState({openModal:!0,Id:null})}},onEdit:{onClick:(e,t)=>this.setState({openModal:!0,Id:t.Id})},onDelete:{onClick:(e,t)=>(0,h.A1)("B\u1ea1n c\xf3 ch\u1eafc ch\u1eafn mu\u1ed1n x\xf3a kh\xf4ng?","C\u1ea3nh b\xe1o").then((()=>this.deleteRow(t.Id)))}}),t&&(0,v.jsx)(D,{ID:n,onClose:()=>this.setState({openModal:!1}),openModal:t,onReloadTable:R})]})]})}}class w extends o.Component{render(){return(0,v.jsx)(x,{})}}},85907:(e,t,n)=>{n.d(t,{A:()=>f});var o=n(58168),a=n(98587),i=n(9950),l=n(11942),s=n.n(l),d=n(48738),r=n.n(d),h=n(44208),c=["className","cssModule","tag"],u={tag:h.Wx,className:s().string,cssModule:s().object},p=function(e){var t=e.className,n=e.cssModule,l=e.tag,s=(0,a.A)(e,c),d=(0,h.qO)(r()(t,"modal-footer"),n);return i.createElement(l,(0,o.A)({},s,{className:d}))};p.propTypes=u,p.defaultProps={tag:"div"};const f=p}}]);