Файловый менеджер - Редактировать - /var/www/vhosts/aviointeriors.dev1.mndrn.cloud/admin/Old_12-06/assets/avio-upload-_ypBsb4n.js
Назад
import{a4 as de,J as ce,I as pe,P as n,M as y,N as d,i as a,R as f,Q as I,X as x,U as w,S as b,p as fe,a5 as me,g as he,a6 as ve,u as ye,c as h,a7 as J,r as R,w as ge,h as Ce,a8 as Fe,j as U,F as v,E as be,a9 as Ve,W as Q}from"./index-NVKqXbaB.js";import{_ as q,V as ke,k as _e,i as G}from"./index-v3pl9dcj.js";import{V as Pe}from"./VRow-OugPEoOO.js";import{V as N}from"./VCol-uIfsAF_D.js";import{V as P}from"./VBtn-SVfbwc9p.js";import{V as $e}from"./VAutocomplete-Oab0ZaIJ.js";import{V as Se,m as Ie,b as xe,u as Re,a as X,f as Ue,c as Ne,d as we}from"./VTextField-t2cTLDjN.js";import{f as ze}from"./forwardRefs-g5bhJaRn.js";import{a as Ae}from"./VSelect-2ZmrsEtC.js";const H=de("filesystem",{state:()=>({currentPath:"/",prevPath:"/"}),getters:{path:e=>e.currentPath,prev:e=>e.prevPath},actions:{updatePath(e){this.currentPath!=e&&(this.prevPath=this.currentPath),this.currentPath=e}}}),Be="/admin/file_icon.png",je={setup(){return{fs:H()}},data:()=>({hasProduct:!1,uploadPercentage:0,serialNumber:""}),props:["uploadedFile","products"],mounted:()=>{},methods:{upload(){let e=new FormData;e.append("document",this.$props.uploadedFile),e.append("path",this.fs.currentPath),e.append("serialNumber",this.serialNumber),e.append("totalFiles",this.$parent.files.length),this.$parent.uploadCounter>=this.$parent.files.length-1&&e.append("isLastFile",!0);let l={headers:{"Content-Type":"multipart/form-data"},onUploadProgress:(function(u){this.uploadPercentage=parseInt(Math.round(u.loaded/u.total*100))}).bind(this)};ce.post("documents/upload",e,l).then(u=>{u.status!==200||(this.uploadPercentage=0),this.loading=!1}).catch(u=>{u.status==401&&(pe(),this.$router.push("/login")),this.loading=!1}).finally(()=>{this.$parent.uploadCounter<this.$parent.files.length-1?this.$parent.uploadCounter++:(this.$parent.fileComponents=[],this.$parent.uploading=!1,this.$parent.uploadCounter=0,this.$parent.clearFiles(),this.$parent.onUploadSuccess())})},getFileUrl(e){return URL.createObjectURL(e)}}},Le=["src"],De={key:1,class:"img-upload-thumbnail",src:Be},Me={class:"text-body-2"},Te={class:"text-body-2"},Ee={class:"text-body-2"},Oe={key:1,class:"d-flex justify-center align-center"};function We(e,l,u,V,i,c){return this.$props.uploadedFile?(n(),y(G,{key:0,variant:"elevated",class:"elevation-4 px-4 pt-4 mb-4"},{default:d(()=>[a(Pe,null,{default:d(()=>[a(N,{class:"v-col-1"},{default:d(()=>[this.$props.uploadedFile.type.startsWith("image")?(n(),f("img",{key:0,class:"img-upload-thumbnail",src:c.getFileUrl(this.$props.uploadedFile)},null,8,Le)):(n(),f("img",De)),a(ke,{icon:"mdi-text-file"})]),_:1}),a(N,{class:"justify-end v-col-3"},{default:d(()=>[I("p",Me,"Name: "+x(this.$props.uploadedFile.name),1),I("p",Te,"Size: "+x((this.$props.uploadedFile.size/(1024*1024)).toFixed(3))+"mb",1),I("p",Ee,"Type: "+x(this.$props.uploadedFile.type),1),this.hasProduct?b("",!0):(n(),y(P,{key:0,"prepend-icon":"mdi-link",class:"my-4",color:"primary",onClick:l[0]||(l[0]=s=>this.hasProduct=!this.hasProduct)},{default:d(()=>[w("Link product")]),_:1})),this.hasProduct?(n(),f("div",Oe,[this.$props.products?(n(),y($e,{key:0,class:"mt-4",items:this.$props.products,modelValue:e.serialNumber,"onUpdate:modelValue":l[1]||(l[1]=s=>e.serialNumber=s),"item-title":"serialNumber",density:"compact",variant:"outlined",label:"Serial number"},null,8,["items","modelValue"])):(n(),y(Se,{key:1,class:"mt-4",modelValue:this.serialNumber,"onUpdate:modelValue":l[2]||(l[2]=s=>this.serialNumber=s),density:"compact",variant:"outlined",label:"Serial number"},null,8,["modelValue"])),a(P,{variant:"plain",ripple:!1,flat:"",icon:"mdi-close",color:"secondary",onClick:l[3]||(l[3]=s=>this.hasProduct=!this.hasProduct)})])):b("",!0)]),_:1}),this.uploadPercentage>0?(n(),y(N,{key:0,class:"d-flex justify-end align-bottom"},{default:d(()=>[a(_e,{class:"mt-auto mb-7",height:"8",rounded:"",color:"primary","model-value":this.uploadPercentage},null,8,["model-value"])]),_:1})):b("",!0)]),_:1})]),_:1})):b("",!0)}const Je=q(je,[["render",We]]),Qe=fe({chips:Boolean,counter:Boolean,counterSizeString:{type:String,default:"$vuetify.fileInput.counterSize"},counterString:{type:String,default:"$vuetify.fileInput.counter"},multiple:Boolean,showSize:{type:[Boolean,Number,String],default:!1,validator:e=>typeof e=="boolean"||[1e3,1024].includes(Number(e))},...Ie({prependIcon:"$file"}),modelValue:{type:Array,default:()=>[],validator:e=>me(e).every(l=>l!=null&&typeof l=="object")},...xe({clearable:!0})},"VFileInput"),Xe=he()({name:"VFileInput",inheritAttrs:!1,props:Qe(),emits:{"click:control":e=>!0,"mousedown:control":e=>!0,"update:focused":e=>!0,"update:modelValue":e=>!0},setup(e,l){let{attrs:u,emit:V,slots:i}=l;const{t:c}=ve(),s=ye(e,"modelValue"),{isFocused:r,focus:k,blur:z}=Re(e),A=h(()=>typeof e.showSize!="boolean"?e.showSize:void 0),B=h(()=>(s.value??[]).reduce((t,o)=>{let{size:g=0}=o;return t+g},0)),j=h(()=>J(B.value,A.value)),$=h(()=>(s.value??[]).map(t=>{const{name:o="",size:g=0}=t;return e.showSize?`${o} (${J(g,A.value)})`:o})),K=h(()=>{var o;const t=((o=s.value)==null?void 0:o.length)??0;return e.showSize?c(e.counterSizeString,t,j.value):c(e.counterString,t)}),L=R(),D=R(),m=R(),Y=h(()=>r.value||e.active),M=h(()=>["plain","underlined"].includes(e.variant));function S(){var t;m.value!==document.activeElement&&((t=m.value)==null||t.focus()),r.value||k()}function Z(t){T(t)}function ee(t){V("mousedown:control",t)}function T(t){var o;(o=m.value)==null||o.click(),V("click:control",t)}function te(t){t.stopPropagation(),S(),be(()=>{s.value=[],Ve(e["onClick:clear"],t)})}return ge(s,t=>{(!Array.isArray(t)||!t.length)&&m.value&&(m.value.value="")}),Ce(()=>{const t=!!(i.counter||e.counter),o=!!(t||i.details),[g,le]=Fe(u),{modelValue:Ke,...ae}=X.filterProps(e),se=Ue(e);return a(X,U({ref:L,modelValue:s.value,"onUpdate:modelValue":C=>s.value=C,class:["v-file-input",{"v-file-input--chips":!!e.chips,"v-input--plain-underlined":M.value},e.class],style:e.style,"onClick:prepend":Z},g,ae,{centerAffix:!M.value,focused:r.value}),{...i,default:C=>{let{id:_,isDisabled:F,isDirty:E,isReadonly:O,isValid:ne}=C;return a(Ne,U({ref:D,"prepend-icon":e.prependIcon,onMousedown:ee,onClick:T,"onClick:clear":te,"onClick:prependInner":e["onClick:prependInner"],"onClick:appendInner":e["onClick:appendInner"]},se,{id:_.value,active:Y.value||E.value,dirty:E.value,disabled:F.value,focused:r.value,error:ne.value===!1}),{...i,default:oe=>{var W;let{props:{class:ie,...re}}=oe;return a(v,null,[a("input",U({ref:m,type:"file",readonly:O.value,disabled:F.value,multiple:e.multiple,name:e.name,onClick:p=>{p.stopPropagation(),O.value&&p.preventDefault(),S()},onChange:p=>{if(!p.target)return;const ue=p.target;s.value=[...ue.files??[]]},onFocus:S,onBlur:z},re,le),null),a("div",{class:ie},[!!((W=s.value)!=null&&W.length)&&(i.selection?i.selection({fileNames:$.value,totalBytes:B.value,totalBytesReadable:j.value}):e.chips?$.value.map(p=>a(Ae,{key:p,size:"small",color:e.color},{default:()=>[p]})):$.value.join(", "))])])}})},details:o?C=>{var _,F;return a(v,null,[(_=i.details)==null?void 0:_.call(i,C),t&&a(v,null,[a("span",null,null),a(we,{active:!!((F=s.value)!=null&&F.length),value:K.value},i.counter)])])}:void 0})}),ze({},L,D,m)}}),qe={setup(){return{fs:H()}},data:()=>({files:[],uploadCounter:0,fileComponents:[],uploading:!1,loading:!1,alert:{type:"error",show:!1,text:""}}),props:["company","cabin"],emits:["uploadFinished"],watch:{uploadCounter:function(e){this.uploading==!0&&this.fileComponents[e].upload()}},mounted:()=>{},methods:{handleFileUpload(e){this.files=Array.from(e.target.files)},uploadFiles(){this.uploading=!0,this.fileComponents[0].upload()},clearFiles(){this.files=[]},getFileUrl(e){return URL.createObjectURL(e)},setItemRef(e){e&&this.fileComponents.push(e)},onUploadSuccess(){this.$emit("uploadFinished")}}},Ge={key:0,class:"d-flex justify-end my-8"};function He(e,l,u,V,i,c){const s=Je;return n(),f(v,null,[a(G,{flat:""},{default:d(()=>[a(Xe,{transition:"none",modelValue:this.files,"onUpdate:modelValue":l[0]||(l[0]=r=>this.files=r),onChange:l[1]||(l[1]=r=>c.handleFileUpload(r)),multiple:"",variant:"plain",label:"Drag your files or click to upload","prepend-icon":"",color:"",class:"upload-field mb-8 text-center"},{selection:d(({fileNames:r})=>[(n(!0),f(v,null,Q(r,(k,z)=>(n(),f(v,{key:k},[],64))),128))]),_:1},8,["modelValue"])]),_:1}),(n(!0),f(v,null,Q(this.files,(r,k)=>(n(),y(s,{uploadedFile:r,products:this.$props.cabin?Array.from(this.$props.cabin.products):[],ref_for:!0,ref:c.setItemRef},null,8,["uploadedFile","products"]))),256)),this.files.length>0?(n(),f("div",Ge,[a(P,{color:"secondary",onClick:c.clearFiles},{default:d(()=>[w("Cancel")]),_:1},8,["onClick"]),a(P,{color:"primary",class:"ml-4",onClick:c.uploadFiles},{default:d(()=>[w("Upload")]),_:1},8,["onClick"])])):b("",!0)],64)}const it=q(qe,[["render",He]]);export{it as _,H as u};
| ver. 1.4 |
Github
|
.
| PHP 8.2.5 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка