import{x as O,r as v,c as $,k as H,al as t,y as n,z as d,P as y,a4 as F,A as s,Q as u,I as p,u as h,H as B,M as x,O as Q}from"./vendor-6ae0c374-1783405707921v=1.0.0.js";import{D as S}from"./DocumentOne-3125b02c-1783405707921v=1.0.0.js";import{h as Z,_ as j}from"./index-71d7b18c-1783405707921v=1.0.0.js";import{E as q}from"./eleVendor-d42abce8-1783405707921v=1.0.0.js";const G=c=>Z.post("/facility/fileType/page",c,{headers:{noLoading:!0}}),J={class:"plan-container"},K={class:"item flex"},R={class:"flex mr10"},W={class:"flex mr10"},X={class:"item"},Y={class:"flex flex-s"},ee={key:1,class:"flex",style:{width:"100%",overflow:"hidden"}},le={class:"flex flex-s"},ae=O({__name:"MediaData",props:{value:Array},emits:["update:value","update:loading","cancel","submit"],setup(c,{expose:C,emit:D}){let k=c;const E=D,_=v([]),U=async()=>{const e=await G({page:1,size:999});if(e.code==0){let l=[];e.data.listData.map(r=>{l.push({label:r.name,value:r.fileTypeId})}),_.value=l}},i=$({get(){return b(k.value)},set(e){E("update:value",T(e))}}),g=e=>{if(!e.fileTypeId){q.warning("\u8BF7\u5148\u9009\u62E9\u6587\u4EF6\u7C7B\u578B");return}},b=e=>e,T=e=>e,V=()=>{i.value.push({name:"",fileUrl:"",fileTypeId:""})},w=e=>{i.value.splice(e,1)},A=v(!1),I=e=>{e.preventDefault(),A.value=!0};return H(()=>{U()}),C({elsePlan:i}),(e,l)=>{const r=t("el-option"),M=t("el-select"),L=t("el-input"),P=t("el-button"),z=t("Delete"),f=t("el-icon"),N=t("Plus");return n(),d("div",J,[(n(!0),d(y,null,F(h(i),(o,m)=>(n(),d("div",{key:m,class:"else-plan mb20"},[s("div",K,[s("div",R,[l[0]||(l[0]=s("span",null,"\u6587\u4EF6\u7C7B\u578B\uFF1A",-1)),u(M,{modelValue:o.fileTypeId,"onUpdate:modelValue":a=>o.fileTypeId=a,class:"flex1 w_more_2",placeholder:"\u8BF7\u5148\u9009\u62E9\u6587\u4EF6\u7C7B\u578B\u518D\u4E0A\u4F20\u6587\u4EF6"},{default:p(()=>[(n(!0),d(y,null,F(h(_),a=>(n(),B(r,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),s("div",W,[l[1]||(l[1]=s("span",null,"\u6587\u4EF6\u540D\u79F0\uFF1A",-1)),u(L,{modelValue:o.name,"onUpdate:modelValue":a=>o.name=a,rows:1,class:"flex1",type:"input",placeholder:"\u8BF7\u8F93\u5165\u65B9\u6848\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])])]),s("div",X,[s("div",Y,[l[3]||(l[3]=s("span",null,"\u6587\u4EF6\u9644\u4EF6\uFF1A",-1)),o.fileUrl?(n(),d("div",ee,[s("span",{onClick:I,class:"url"},Q(o.fileUrl),1)])):(n(),B(S,{key:0,disabled:!o.fileTypeId,name:o.name,"onUpdate:name":a=>o.name=a,url:o.fileUrl,"onUpdate:url":a=>o.fileUrl=a,limit:1,showFileList:!1,uploadType:"file",process:!1},{default:p(()=>[u(P,{onClick:a=>g(o)},{default:p(()=>[...l[2]||(l[2]=[x("\u70B9\u51FB\u4E0A\u4F20",-1)])]),_:2,__:[2]},1032,["onClick"])]),_:2},1032,["disabled","name","onUpdate:name","url","onUpdate:url"]))])]),s("div",le,[u(f,{onClick:a=>w(m),class:"icon"},{default:p(()=>[u(z)]),_:2},1032,["onClick"])])]))),128)),s("div",{class:"add-button",onClick:V},[u(f,null,{default:p(()=>[u(N)]),_:1}),l[4]||(l[4]=x(" \u65B0\u589E ",-1))])])}}});const ue=j(ae,[["__scopeId","data-v-53f6aede"],["__file","D:/desktop/huaZhong/huazhong-common/apps/vue-admin/src/views/components/MediaData.vue"]]);export{ue as default};
