PageSourceSearch

https://npt-nolinsk.ru/kubcms-front/v5/master/s/c-SingleUploaderWithActions-D2-pHZJp.js

js npt-nolinsk.ru collected 2026-09-25 10:40:29 UTC 3,456 bytes, 1 lines download raw bytes

1import{aR as C,cx as E,cr as I,cF as _,cA as S,cG as B,a_ as c,cy as w,dP as V,ej as R,c9 as N,ca as P,aV as a,aW as d,br as $,cb as D,b2 as m,b3 as f,bR as F,b6 as k,b1 as i,bg as u,bh as p}from"./c-index-C7aDQtMU.js";import"./c-el-form-item-lGG0C5Mp.js";const H=C({components:{ElUpload:S,ElDialog:_,FontAwesomeIcon:I,ElButton:E},props:{modelValue:{type:String},action:{type:String},accept:{type:String},fileName:{type:String},listType:{type:String,default:"picture-card"}},emits:{"update:modelValue":e=>!0,remove:()=>!0,"upload:success":e=>!0},setup(e,{emit:s}){const{modelValue:y,action:T}=B(e),g=c(!1),h=c(!1),o=c(!1),r=c({}),n=c(!1);return{headers:r,uploading:n,disabled:o,dialogVisible:g,dialogImageEditorVisible:h,emit:s,handleEdit:()=>{h.value=!0},beforeUpload:()=>{n.value=!0;const l=V.get("xsrf-token")||V.get("XSRF-TOKEN")||"";r.value={"X-XSRF-TOKEN":l}},handleProgress:l=>{},handleOnErrorImageHandle:()=>{w.error("Возникла ошибка при загрузке"),n.value=!1},handleHeadImageSuccess:l=>{w.success("Успешно загружено"),n.value=!1,s("update:modelValue",l.url),s("upload:success",l)},handlePictureCardPreview:()=>{g.value=!0},handleDownload:()=>{const l=window.open(y.value,"_blank");l&&l.focus()},handleRemove:async()=>{await R.confirm("Вы действительно хотите удалить?","Внимание",{confirmButtonText:"Да",cancelButtonText:"Отмена",type:"warning"}),s("update:modelValue",""),s("remove")}}}}),U={key:1,class:"el-upload-list el-upload-list--picture-card"},A={class:"el-upload-list__item is-ready w-full"},O=["src"],X={class:"el-upload-list__item-actions"},j={key:2,class:"text-center"},K={class:"flex justify-between"},M=["src"];function W(e,s,y,T,g,h){const o=P("FontAwesomeIcon"),r=E,n=S,v=_,b=D;return a(),d("div",null,[e.modelValue?e.listType==="picture-card"?(a(),d("ul",U,[i("li",A,[i("img",{class:"w-full",src:e.modelValue,alt:""},null,8,O),i("span",X,[e.disabled?p("",!0):(a(),d("span",{key:0,class:"el-upload-list__item-delete",onClick:s[0]||(s[0]=t=>e.handleEdit())},[u(o,{icon:"edit"})])),e.disabled?p("",!0):(a(),d("span",{key:1,class:"el-upload-list__item-delete",onClick:s[1]||(s[1]=t=>e.handleDownload())},[u(o,{icon:"download"})])),e.disabled?p("",!0):(a(),d("span",{key:2,class:"el-upload-list__item-delete",onClick:s[2]||(s[2]=t=>e.handleRemove())},[u(o,{icon:"trash"})]))])])])):e.listType==="text"?(a(),d("div",j,[i("div",K,[i("div",null,k(e.fileName||e.modelValue),1),e.disabled?p("",!0):(a(),m(r,{key:0,size:"small",type:"danger",onClick:s[3]||(s[3]=t=>e.handleRemove())},{default:f(()=>[u(o,{icon:"trash"})]),_:1}))])])):p("",!0):$((a(),m(n,{key:0,accept:e.accept,action:e.action,"with-credentials":!0,headers:e.headers,"before-upload":e.beforeUpload,"list-type":e.listType,"on-progress":e.handleProgress,"on-error":e.handleOnErrorImageHandle,"on-success":e.handleHeadImageSuccess,"show-file-list":!1},{default:f(()=>[e.listType==="picture-card"?(a(),m(o,{key:0,icon:"plus"})):(a(),m(r,{key:1,type:"primary"},{default:f(()=>[F("Загрузить файл "+k(e.accept),1)]),_:1}))]),_:1},8,["accept","action","headers","before-upload","list-type","on-progress","on-error","on-success"])),[[b,e.uploading]]),u(v,{modelValue:e.dialogVisible,"onUpdate:modelValue":s[4]||(s[4]=t=>e.dialogVisible=t)},{default:f(()=>[i("img",{class:"w-full",src:e.modelValue,alt:""},null,8,M)]),_:1},8,["modelValue"])])}const Z=N(H,[["render",W]]);export{Z as S};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.