import{d as U,r as _,l as y,C as q,a as n,o as f,i as C,e as s,f as c,b as a,u as t,c as O,F as R,g as j,j as p,_ as G}from"./index-8184dd63-1780045603901v=1.0.0.js";import{b as I}from"./tagManage-1b66d64b-1780045603901v=1.0.0.js";const J={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:"blur"},{max:10,message:"\u6700\u591A10\u4E2A\u5B57\u7B26",trigger:"blur"}],tag_group_id:[{required:!0,message:"\u8BF7\u9009\u6807\u7B7E\u5206\u7C7B",trigger:"change"}],status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001 ",trigger:"change"}]},M={class:"form\u2014container"},z={class:"el-dialog__footer"},$={class:"dialog-footer"},H=U({__name:"TagForm",props:{tagType:String,value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(V,{emit:E}){_(!1);const B=_();let m=V;const i=E,l=y({get(){return L(m.value)},set(u){i("update:value",u)}}),x=y({get(){return m.loading},set(u){i("update:loading",u)}}),T=async u=>{u.validate(async(e,d)=>{if(e){let r=N();i("submit",r)}})},k=()=>{i("cancel")},F=_([]),D=async()=>{let u={page:1,size:1e3,type:m.tagType},e=await I(u);e.data.list.length===1&&(l.value.tag_group_id=e.data.list[0].tag_group_id),F.value=e.data.list};q(()=>{D()});const L=u=>{let e=u,d=[];return e.logo&&(d=e.logo.split(",").map((r,g)=>({name:String(g),url:r}))),e.imagesList=d,e},N=()=>JSON.parse(JSON.stringify(l.value));return(u,e)=>{const d=n("el-input"),r=n("el-form-item"),g=n("el-option"),S=n("el-select"),b=n("el-radio"),w=n("el-radio-group"),v=n("el-button"),A=n("el-form");return f(),C(A,{model:t(l),rules:t(J),ref_key:"ruleFormRef",ref:B,"label-position":"right","label-width":"140px","scroll-to-error":!0,class:"default-form"},{default:s(()=>[c("div",M,[a(r,{label:"\u540D\u79F0",prop:"name"},{default:s(()=>[a(d,{modelValue:t(l).name,"onUpdate:modelValue":e[0]||(e[0]=o=>t(l).name=o),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(r,{label:"\u6240\u5C5E\u5206\u7C7B",prop:"tag_group_id"},{default:s(()=>[a(S,{modelValue:t(l).tag_group_id,"onUpdate:modelValue":e[1]||(e[1]=o=>t(l).tag_group_id=o),placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u5206\u7C7B"},{default:s(()=>[(f(!0),O(R,null,j(t(F),o=>(f(),C(g,{key:o.tag_group_id,label:o.name,value:o.tag_group_id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(r,{label:"\u7B80\u4ECB",prop:"des"},{default:s(()=>[a(d,{modelValue:t(l).des,"onUpdate:modelValue":e[2]||(e[2]=o=>t(l).des=o),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u7B80\u4ECB"},null,8,["modelValue"])]),_:1}),a(r,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[a(w,{modelValue:t(l).status,"onUpdate:modelValue":e[3]||(e[3]=o=>t(l).status=o)},{default:s(()=>[a(b,{label:1},{default:s(()=>[...e[5]||(e[5]=[p("\u542F\u7528",-1)])]),_:1}),a(b,{label:2},{default:s(()=>[...e[6]||(e[6]=[p("\u505C\u7528",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),c("div",z,[c("span",$,[a(v,{onClick:k},{default:s(()=>[...e[7]||(e[7]=[p("\u53D6\u6D88",-1)])]),_:1}),a(v,{type:"primary",loading:t(x),onClick:e[4]||(e[4]=o=>T(t(B)))},{default:s(()=>[...e[8]||(e[8]=[p(" \u786E\u8BA4 ",-1)])]),_:1},8,["loading"])])])]),_:1},8,["model","rules"])}}});const Q=G(H,[["__scopeId","data-v-ac0f8ed9"],["__file","D:/desktop/yunNan/vue-area-submit/src/views/dataManage/components/TagForm.vue"]]);export{Q as default};
