import{I as A}from"./Imgs-5872fe00.js";import{t as I}from"./addTag-25a19202.js";import{g as T}from"./tagManage-2aab0a1e.js";import{d as z,p as g,f as b,o as O,i,a as f,z as y,m as u,j as d,k as a,e as o,c as R,F as G,q as J,v as p,_ as M}from"./index-deffec86.js";const q={class:"form\u2014container"},$={class:"el-dialog__footer"},H={class:"dialog-footer"},K=z({__name:"tagForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(V,{emit:L}){g(!1);const c=g();let F=V;const m=L,s=b({get(){return D(F.value)},set(t){m("update:value",t)}}),E=b({get(){return F.loading},set(t){m("update:loading",t)}}),x=async t=>{t.validate(async(e,r)=>{if(e){let n=N();m("submit",n)}})},k=()=>{m("cancel")},v=g([]),j=async()=>{let e=await T({page:1,size:1e3,status:1,types:"event_activity_plan_project_kind,event_activity_special"});v.value=e.data.list};O(()=>{j()});const D=t=>{let e=t,r=[];return e.logo&&(r=e.logo.split(",").map((n,_)=>({name:String(_),url:n}))),e.imagesList=r,e},N=()=>{let t=JSON.parse(JSON.stringify(s.value)),e=t.imagesList.map(r=>r.url);return t.logo=e.join(","),t.logo&&delete t.imagesList,t};return(t,e)=>{const r=i("el-input"),n=i("el-form-item"),_=i("el-option"),S=i("el-select"),B=i("el-radio"),U=i("el-radio-group"),C=i("el-button"),w=i("el-form");return f(),y(w,{model:o(s),rules:o(I),ref_key:"ruleFormRef",ref:c,"label-position":"right","scroll-to-error":!0,"label-width":"140px"},{default:u(()=>[d("div",q,[a(n,{label:"\u7C7B\u578B\u540D\u79F0",prop:"name"},{default:u(()=>[a(r,{modelValue:o(s).name,"onUpdate:modelValue":e[0]||(e[0]=l=>o(s).name=l),placeholder:"\u8BF7\u8F93\u5165\u7C7B\u578B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u6240\u5C5E\u5206\u7C7B",prop:"tag_group_id"},{default:u(()=>[a(S,{modelValue:o(s).tag_group_id,"onUpdate:modelValue":e[1]||(e[1]=l=>o(s).tag_group_id=l),placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u5206\u7C7B"},{default:u(()=>[(f(!0),R(G,null,J(o(v),l=>(f(),y(_,{key:l.tag_group_id,label:l.name,value:l.tag_group_id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(n,{label:"\u56FE\u6807",prop:"imagesList"},{default:u(()=>[a(A,{fileList:o(s).imagesList,"onUpdate:fileList":e[2]||(e[2]=l=>o(s).imagesList=l),width:"100px",height:"100px",fileSize:2,limit:1},{tip:u(()=>e[6]||(e[6]=[p(" \u8BF7\u4E0A\u4F20\u5927\u5C0F\u4E0D\u8D85\u8FC7 "),d("span",{class:"tip"},"2M",-1),p(" \u683C\u5F0F\u4E3A"),d("span",{class:"tip"},"jpeg/jpg/png",-1),p("\u7684\u56FE\u7247 ")])),_:1},8,["fileList"])]),_:1}),a(n,{label:"\u7B80\u4ECB",prop:"des"},{default:u(()=>[a(r,{modelValue:o(s).des,"onUpdate:modelValue":e[3]||(e[3]=l=>o(s).des=l),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u7B80\u4ECB"},null,8,["modelValue"])]),_:1}),a(n,{label:"\u72B6\u6001",prop:"status"},{default:u(()=>[a(U,{modelValue:o(s).status,"onUpdate:modelValue":e[4]||(e[4]=l=>o(s).status=l)},{default:u(()=>[a(B,{label:1},{default:u(()=>e[7]||(e[7]=[p("\u542F\u7528")])),_:1}),a(B,{label:2},{default:u(()=>e[8]||(e[8]=[p("\u505C\u7528")])),_:1})]),_:1},8,["modelValue"])]),_:1})]),d("div",$,[d("span",H,[a(C,{onClick:k},{default:u(()=>e[9]||(e[9]=[p("\u53D6\u6D88")])),_:1}),a(C,{type:"primary",loading:o(E),onClick:e[5]||(e[5]=l=>x(o(c)))},{default:u(()=>e[10]||(e[10]=[p(" \u786E\u8BA4 ")])),_:1},8,["loading"])])])]),_:1},8,["model","rules"])}}});const Y=M(K,[["__scopeId","data-v-00ab52a8"]]);export{Y as default};
