????

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/8319.e46bed00.chunk.js

"use strict";(self.webpackChunk_qlxd_frontend=self.webpackChunk_qlxd_frontend||[]).push([[8319],{88319:(t,e,n)=>{n.r(e),n.d(e,{default:()=>w});var o=n(6688),i=n.n(o),l=n(95391),s=n(7722);class c extends s.k{constructor(t){super("/SDoc",t),this.getAll=(t,e)=>this.SearchAllOdata(t,e),this.add=t=>this.InsertODATA(t),this.upload=(t,e)=>this.UploadODataSdoc("/upload",!0,!1,e,t),this.edit=(t,e)=>this.UpdateODATA(`(${t})`,e),this.delete=t=>this.DeleteADMINODATA(`(${t})`,{noLoading:"loadCC",noAlert:"lertCC"})}}const r=c;var a=n(87760),u=n(55285),h=n(21307),d=n.n(h);const f=new class extends r{constructor(){super("/Documents"),this.downloadDoc=t=>{let{Uuid:e,Subject:n}=t;return this.GetAuthenADMINODATA(`/Download?uuid=${e}`,{responseType:"blob",noAlert:!0,noLoading:!0}).then((t=>d()(t,n)))},this.getDocUrlByUuid=t=>a.Eh+a.Cf+this.prefix+this.path+`/Download?uuid=${t}`}addDocument(t){return this.add(t)}uploadFileDocument(t,e){return this.upload(t,e)}getByUuid(t){return this.getAll(`(${t})`,{noAlert:!0,noLoading:!0})}getBase64(t){const e=this.getDocUrlByUuid(t);return fetch(e,(0,u.Ys)("GET",null,!0)).then((t=>t.blob())).then(URL.createObjectURL)}},p=t=>t?Promise.all([f.delete(t)]).catch(Promise.resolve):Promise.resolve(),w=async function(t,e,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{};const{DocumentUuid:s,Uuid:c}=e;return c?"function"!==typeof t.delete?i().fire({icon:"warning",title:"\u0110\xe3 x\u1ea3y ra l\u1ed7i. Vui l\xf2ng th\u1eed l\u1ea1i!",showCancelButton:!1,showConfirmButton:!1}):void l.A.didOpen({confirmSwal:{title:`B\u1ea1n c\xf3 ch\u1eafc mu\u1ed1n x\xf3a ${n}?`,text:"Thao t\xe1c n\xe0y kh\xf4ng th\u1ec3 ho\xe0n t\xe1c!"},pendingSwal:{title:`\u0110ang x\xf3a ${n}`},callAPIFn:()=>Promise.all([t.delete(c),p(s)]),onSuccess:{callback:o,getSwal:()=>`\u0110\xe3 x\xf3a ${n}`}}):i().fire({icon:"warning",title:`Kh\xf4ng t\xecm th\u1ea5y Id c\u1ee7a ${n}. Vui l\xf2ng th\u1eed l\u1ea1i!`,showCancelButton:!1,showConfirmButton:!1})}},95391:(t,e,n)=>{n.d(e,{A:()=>c});var o=n(35065),i=n(12020),l=n.n(i);const s=(0,o.S6)().mixin({cancelButtonColor:"#d33"});const c=new class{constructor(){this.defaultErrorSwal={title:"\u0110\xe3 x\u1ea3y ra l\u1ed7i!",text:"Vui l\xf2ng th\u1eed l\u1ea1i",confirmButtonText:"Th\u1eed l\u1ea1i",cancelButtonText:"\u0110\xf3ng",icon:"error"},this.defaultSuccessSwal={icon:"success",showConfirmButton:!0,showCancelButton:!1,confirmButtonText:"X\xe1c nh\u1eadn",allowOutsideClick:!0,title:"Th\xe0nh c\xf4ng",text:""},this.handleSuccess=(t,e)=>n=>{"function"===typeof e&&e(n);const o=void 0!==t?l()(this.defaultSuccessSwal,"string"===typeof t?{title:t}:"object"===typeof t(n)?t(n):{title:t(n)}):this.defaultSuccessSwal;return s.isVisible()?s.update(o):s.fire(o)},this.handleError=t=>e=>{const{onError:{getSwal:n,callback:o}={}}=t;"function"===typeof o&&o(e);return s.fire({preConfirm:()=>this.didOpen(t,!0),...(()=>"string"===typeof n?l()(this.defaultErrorSwal,{title:n}):"function"===typeof n?l()(this.defaultErrorSwal,n(e)):this.defaultErrorSwal)()})},this.didOpen=(t,e)=>{const{confirmSwal:n,pendingSwal:o,callAPIFn:i,onSuccess:{getSwal:c,callback:r}={}}=t;if("function"!==typeof i)throw new Error("WTF Man");const a={icon:"info",title:"\u0110ang x\u1eed l\xfd",showConfirmButton:!1,showCancelButton:!1,allowOutsideClick:!s.isLoading,didOpen:()=>{s.showLoading(),i().then(this.handleSuccess(c,r)).catch(this.handleError(t)).finally(s.hideLoading)}},u=()=>s.fire(void 0===o?a:"object"===typeof o?l()(a,o):"string"===typeof o?l()(a,{title:o}):a),h={icon:"question",confirmButtonText:"X\xe1c nh\u1eadn",cancelButtonText:"H\u1ee7y",text:"Thao t\xe1c n\xe0y kh\xf4ng th\u1ec3 ho\xe0n t\xe1c!",preConfirm:t=>{if(t)return u()}};return n?e?u():s.fire(l()(h,"object"===typeof n?n:"string"===typeof n?{title:n}:{})):u()}}}}}]);
//# sourceMappingURL=8319.e46bed00.chunk.js.map