import{i as U,j as w}from"./decoration.c1b95658.js";import{P as j}from"./index.35b8c9ab.js";import{M as f}from"./index.dfdc0704.js";import{d as N,r as v,b as z,c as d,e as p,k as c,i as o,m as B,t as b,A as V,h as t,u as M,g as C}from"./index.0308b213.js";const S=C("div",{class:"muted"},"\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A\u5BBD88*\u9AD888\u50CF\u7D20\u7684jpg\uFF0Cjpeg\uFF0Cpng\uFF0Cgif\u56FE\u7247",-1),O=C("div",{class:"muted"},"\u5EFA\u8BAE\u5C3A\u5BF8\uFF1A\u5BBD88*\u9AD888\u50CF\u7D20\u7684jpg\uFF0Cjpeg\uFF0Cpng\uFF0Cgif\u56FE\u7247",-1),G=N({props:{type:{default:"add"},id:{default:""},btnText:{default:""}},emits:["refresh"],setup(n,{emit:g}){const r=n,i=v(),l=v({name:"",selected_icon:"",un_selected_icon:"",selected_color:"",un_selected_color:""}),y=z({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u5355\u4F4D",trigger:"blur"}]}),A=a=>{!a||a.resetFields()},D=()=>{r.id&&E(r.id)},E=async a=>{l.value=await U({id:a})},x=async()=>{await w({...l.value,id:r.id}),g("refresh")},k=a=>{!a||a.validate(e=>{if(!e)return!1;x()})};return(a,e)=>{const _=d("el-button"),m=d("el-input"),s=d("el-form-item"),F=d("el-color-picker"),T=d("el-form");return p(),c(j,{class:"m-r-10 inline",clickModalClose:!1,title:"\u7F16\u8F91\u5BFC\u822A",center:!0,onClose:e[7]||(e[7]=u=>A(i.value)),onOpen:D,onConfirm:e[8]||(e[8]=u=>k(i.value)),width:"50vw"},{trigger:o(()=>[n.type==="primary"?(p(),c(_,{key:0,type:"primary",size:"small"},{default:o(()=>[B(b(n.btnText),1)]),_:1})):V("",!0),n.type==="text"?(p(),c(_,{key:1,type:"text",size:"small"},{default:o(()=>[B(b(n.btnText),1)]),_:1})):V("",!0)]),default:o(()=>[t(T,{model:l.value,ref_key:"tabBarFormRef",ref:i,class:"tabbar-form",rules:M(y),size:"mini","label-width":"150px"},{default:o(()=>[t(s,{label:"\u5BFC\u822A\u540D\u79F0",prop:"name"},{default:o(()=>[t(m,{class:"ls-input",modelValue:l.value.name,"onUpdate:modelValue":e[0]||(e[0]=u=>l.value.name=u),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u9ED8\u8BA4\u56FE\u8868",prop:"un_selected_icon"},{default:o(()=>[t(f,{modelValue:l.value.un_selected_icon,"onUpdate:modelValue":e[1]||(e[1]=u=>l.value.un_selected_icon=u),limit:1},null,8,["modelValue"]),S]),_:1}),t(s,{label:"\u9009\u4E2D\u56FE\u8868",prop:"un_selected_icon"},{default:o(()=>[t(f,{modelValue:l.value.selected_icon,"onUpdate:modelValue":e[2]||(e[2]=u=>l.value.selected_icon=u),limit:1},null,8,["modelValue"]),O]),_:1}),t(s,{label:"\u9ED8\u8BA4\u5B57\u4F53",prop:"un_selected_icon"},{default:o(()=>[t(m,{class:"ls-input",modelValue:l.value.un_selected_color,"onUpdate:modelValue":e[4]||(e[4]=u=>l.value.un_selected_color=u),placeholder:"\u8BF7\u8F93\u5165"},{append:o(()=>[t(F,{modelValue:l.value.un_selected_color,"onUpdate:modelValue":e[3]||(e[3]=u=>l.value.un_selected_color=u)},null,8,["modelValue"])]),_:1},8,["modelValue"])]),_:1}),t(s,{label:"\u9009\u4E2D\u5B57\u4F53",prop:"un_selected_icon"},{default:o(()=>[t(m,{class:"ls-input",modelValue:l.value.selected_color,"onUpdate:modelValue":e[6]||(e[6]=u=>l.value.selected_color=u),placeholder:"\u8BF7\u8F93\u5165"},{append:o(()=>[t(F,{modelValue:l.value.selected_color,"onUpdate:modelValue":e[5]||(e[5]=u=>l.value.selected_color=u)},null,8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1})}}});export{G as _};
