Файловый менеджер - Редактировать - /var/www/vhosts/aviointeriors.dev1.mndrn.cloud/user/assets/view-folder-CYGEF8JT.js
Назад
import{D as C,G as u,I as p,E as h,O as k,J as i,Q as l,z as o,K as s,F as v,L as F,M as r,$ as c,P as m,N as f}from"./index-D1h448_Z.js";import{u as _,V as $,a as w,b as x}from"./VTooltip-BVRIkNqG.js";import{_ as B,p as P,j as g,V as y,i as U}from"./index-BoPYeLSL.js";import{V as N}from"./VContainer-Cme4lOJz.js";import{V as I,b as S}from"./VCard-BX7_GSZd.js";import{a as T}from"./VTextField-CB8_CfWO.js";import"./VSelect-B5jKwMMM.js";import"./form-CnC7Ky5f.js";import"./forwardRefs-C-GTDzx5.js";import"./VMenu-Dgle3co-.js";import"./easing-DY7PVvcf.js";import"./VCheckboxBtn-DLlhaLU6.js";const A={setup(){const e=_(),t=C();return t.fetchUser(),{fs:e,authStore:t}},data:()=>({tableHeaders:[{title:"Name",value:"name",key:"name"},{title:"Year",value:"subFolder",key:"subFolder"},{title:"P/N",value:"serialNumber",key:"serialNumber"},{title:"Actions",value:"actions",sortable:!1}],sortBy:[{key:"name",order:"asc"}],search:"",items:[],parent:"",parentId:null,company:null,currentCabin:null,loading:!1,alert:{type:"error",show:!1,text:""}}),props:["id"],created(){this.getFolderContents()},methods:{getIndex(){this.currentCabin=[],u.get("/documents").then(e=>{e.status!==200||(this.items=p.map(e.data.items,function(t){return p.extend({},t,{dialog:!1})}),this.parent=e.data.parent,this.company=null,this.fs.updatePath("/")),this.loading=!1}).catch(e=>{e.response.status==401&&(h(),this.$router.push("/login")),this.loading=!1})},getFolderContents(){this.currentCabin=[],u.get("/documents/folder/"+this.$route.params.id).then(e=>{e.status!==200||(this.items=p.map(e.data.items,function(t){return p.extend({},t,{dialog:!1})}),this.parent=e.data.parent,this.parentId=e.data.parentId,this.parent&&this.parent!="/"&&(this.company=this.authStore.currentUser.company,this.parent.split("/").length>=2?this.currentCabin=this.company.cabinClasses.filter(t=>t.name==this.parent.split("/")[1])[0]:this.currentCabin=[]),this.fs.updatePath(this.parent)),this.loading=!1}).catch(e=>{e.response.status==401?(h(),this.$router.push("/login")):e.response.status==403&&this.$router.replace("/documents"),this.loading=!1})},deleteFile(e,t){t.dialog=!1,u.post("/documents/delete",{path:e}).then(n=>{n.status!==200||this.getFolderContents(this.fs.currentPath),this.loading=!1}).catch(n=>{n.response.status==401&&(h(),this.$router.push("/login")),this.loading=!1})},deleteFolder(e,t){t.dialog=!1,u.delete(`/documents/folder/${e}`).then(n=>{n.status!==200||this.getFolderContents(this.fs.currentPath),this.loading=!1}).catch(n=>{n.response.status==401&&(h(),this.$router.push("/login")),this.loading=!1})},downloadPath(e){this.loading=!0,u.post("/documents/download",{path:e},{responseType:"blob"}).then(t=>{if(t.status!==200)this.loading=!1;else{const n=window.URL.createObjectURL(new Blob([t.data])),d=document.createElement("a");d.href=n,d.setAttribute("download",e),document.body.appendChild(d),d.click()}this.loading=!1}).catch(t=>{this.loading=!1})},uploadCleanup(e){console.log(e),this.getFolderContents(this.fs.currentPath)},getItemUrl(e){}}},D={class:"d-flex ga-2"},E=f("div",{class:"text-end"},"Actions",-1),L={class:"d-flex justify-end"};function j(e,t,n,d,H,V){const b=F("router-link");return r(),k(v,null,[this.loading?(r(),i(U,{key:0,indeterminate:"",color:"primary","bg-color":"blue"})):l("",!0),o(P,null,{default:s(()=>[o(N,null,{default:s(()=>[o(I,{flat:""},{default:s(()=>[o(S,{class:"d-flex align-center pe-2"},{default:s(()=>[o(g,{icon:"mdi-folder",color:"primary"}),c(" "),this.authStore.currentUser?(r(),i(b,{key:0,to:"/documents"},{default:s(()=>[c(m(this.authStore.currentUser.company.name),1)]),_:1})):l("",!0),f("span",null,[o(g,{icon:"mdi-chevron-right"}),c(m(this.parent.split("/").slice(-1)[0]),1)]),o($),o(T,{modelValue:e.search,"onUpdate:modelValue":t[0]||(t[0]=a=>e.search=a),"prepend-inner-icon":"mdi-magnify",density:"comfortable",label:"Search","single-line":"",color:"primary","hide-details":"",variant:"outlined"},null,8,["modelValue"])]),_:1}),this.items?(r(),i(x,{key:0,headers:e.tableHeaders,search:e.search,"onUpdate:search":t[1]||(t[1]=a=>e.search=a),"sort-by":e.sortBy,"onUpdate:sortBy":t[2]||(t[2]=a=>e.sortBy=a),items:this.items},{"item.name":s(({item:a})=>[f("div",D,[o(b,{to:`/documents/folder/${a.folderId}`},{default:s(()=>[a.type=="folder"?(r(),i(y,{key:0,variant:"plain",color:"primary","prepend-icon":"mdi-folder",class:"text-none"},{default:s(()=>[c(m(a.name),1)]),_:2},1024)):l("",!0)]),_:2},1032,["to"]),a.type=="file"?(r(),i(y,{key:0,variant:"plain",color:"blue","prepend-icon":"mdi-file-outline",class:"text-none"},{default:s(()=>[c(m(a.name),1)]),_:2},1024)):l("",!0)])]),"header.actions":s(()=>[E]),"item.actions":s(({item:a})=>[f("div",L,[a.type=="file"?(r(),i(y,{key:0,variant:"plain",onClick:O=>V.downloadPath(a.path)},{default:s(()=>[o(g,{icon:"mdi-download",color:"primary"}),o(w,{type:"plain",activator:"parent",location:"bottom",text:"Download"})]),_:2},1032,["onClick"])):l("",!0)])]),_:1},8,["headers","search","sort-by","items"])):l("",!0)]),_:1})]),_:1})]),_:1})],64)}const ee=B(A,[["render",j]]);export{ee as default};
| ver. 1.4 |
Github
|
.
| PHP 8.2.5 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка