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