import{d as I,r as y,a as O,b as S,e as u,o as i,c as _,L as h,M as B,n as a,g as d,w as p,h as x,f as D,l as L,V as $,t as q,_ as G}from"./index-17740f03-1778929502341v=1.0.0.js";import{g as H}from"./fileManage-21b3e25f-1778929502341v=1.0.0.js";const J={class:"plan-container"},K={class:"item flex"},Q={class:"flex mr10"},R={class:"flex mr10"},W={class:"item"},X={class:"flex flex-s"},Y={key:1,class:"flex",style:{width:"100%",overflow:"hidden"}},Z={class:"flex flex-s"},ee=I({__name:"MediaData",props:{value:Object},emits:["update:value","update:loading","cancel","submit"],setup(b,{expose:E,emit:V}){let g=b;const k=V,v=y([]),C=async()=>{const{data:l}=await H({page:1,size:999});v.value=l.list},n=O({get(){return U(g.value)},set(l){k("update:value",A(l))}}),U=l=>{let e=l;return e.forEach(s=>{s.fileList=[],s.file_url&&s.fileList.push({url:s.file_url,name:s.name,file_path:s.file_url,file_type_id:s.file_type_id})}),e},w=(l,e)=>{n.value[e].name=l[0].name,n.value[e].file_url=l[0].file_path,n.value[e].file_path=l[0].file_url},A=l=>{let e=l;return e=e.map(s=>{const{file_type_id:c,name:r,file_url:f}=s;return{file_type_id:c,name:r,file_url:f}}),e},M=()=>{n.value.push({title:"",url:""})},P=l=>{n.value.splice(l,1)},N=y(!1),T=l=>{l.preventDefault(),N.value=!0};return S(()=>{C()}),E({elsePlan:n}),(l,e)=>{const s=u("el-option"),c=u("el-select"),r=u("el-input"),f=u("el-button"),j=u("Delete"),F=u("el-icon"),z=u("Plus");return i(),_("div",J,[(i(!0),_(h,null,B(x(n),(o,m)=>(i(),_("div",{key:m,class:"else-plan mb20"},[a("div",K,[a("div",Q,[e[0]||(e[0]=a("span",null,"\u6587\u4EF6\u7C7B\u578B\uFF1A",-1)),d(c,{modelValue:o.file_type_id,"onUpdate:modelValue":t=>o.file_type_id=t,class:"flex1 w_more_2",placeholder:"\u8BF7\u5148\u9009\u62E9\u6587\u4EF6\u7C7B\u578B\u518D\u4E0A\u4F20\u6587\u4EF6"},{default:p(()=>[(i(!0),_(h,null,B(x(v),t=>(i(),D(s,{key:t.file_type_id,label:t.name,value:t.file_type_id},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),a("div",R,[e[1]||(e[1]=a("span",null,"\u6587\u4EF6\u540D\u79F0\uFF1A",-1)),d(r,{modelValue:o.name,"onUpdate:modelValue":t=>o.name=t,rows:1,class:"flex1",type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u65B9\u6848\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])])]),a("div",W,[a("div",X,[e[3]||(e[3]=a("span",null,"\u6587\u4EF6\u9644\u4EF6\uFF1A",-1)),o.url?(i(),_("div",Y,[a("span",{onClick:T,class:"url"},q(o.url),1)])):(i(),D($,{key:0,disabled:!o.file_type_id,fileList:o.fileList,"onUpdate:fileList":t=>o.fileList=t,onUploadFile:t=>w(t,m),limit:1,showFileList:!1},{default:p(()=>[d(f,null,{default:p(()=>e[2]||(e[2]=[L("\u70B9\u51FB\u4E0A\u4F20")])),_:1})]),_:2},1032,["disabled","fileList","onUpdate:fileList","onUploadFile"]))])]),a("div",Z,[d(F,{onClick:t=>P(m),class:"icon"},{default:p(()=>[d(j)]),_:2},1032,["onClick"])])]))),128)),a("div",{class:"add-button",onClick:M},[d(F,null,{default:p(()=>[d(z)]),_:1}),e[4]||(e[4]=L(" \u65B0\u589E "))])])}}});const se=G(ee,[["__scopeId","data-v-a10409ef"]]);export{se as default};
