import{_ as a,r as e,b as t,ad as s,c as o,d as l,e as d,f as r,h as i,w as c,g as n,j as f,k as p,F as m,l as b,a7 as u,am as v,n as g,E as y,p as _,q as j,t as x,v as h}from"./index.286e9b79.js";import{v as w}from"./loading.c49775a6.js";import{a as k}from"./form.ad10dcd5.js";import{E as C}from"./row.90d810f1.js";import{E}from"./col.5ff06cbd.js";import{_ as z}from"./tips.1f55fd6b.js";import{g as F,p as O}from"./http.f588794f.js";import"./_initCloneObject.fb8fbaea.js";import"./alert.e75c383f.js";const q={class:"wrap"},A={class:"web-main"},B=(a=>(x("data-v-73e46ad6"),a=a(),h(),a))((()=>i("div",{class:"web-title clear"},[i("div",null,"主题颜色"),i("div")],-1))),I={class:"web-content"},R=["onClick"],D={class:"text"},G={class:"icon-box"},H={class:"form-save"},J=a({__name:"color",setup(a){let x=e(),h=e(!1),J=e(!1),K=e([]),L=e(1),M=t({data:{id:0,type:!1,options:{backgroundColor:"#314bd2",backgroundBgColor:"#318bfc",borderColor:"#aeb6e0",fontColor:"#314bd2"}}});s((()=>{F("diy.index/color").then((a=>{a.code&&(K.value=a.data.theme,M.data=a.data.setting,L.value=a.data.setting.type)}))}));const N=async()=>{x.value&&(M.data.type=L.value,await x.value.validate(((a,e)=>{J.value=!1,a?(J.value=!0,O("diy.index/color",M.data).then((a=>{J.value=!1,a.code?y.success("编辑成功"):y.error(a.msg)})).catch((a=>{y.error(a)}))):y.error("请完善内容")})))};return(a,e)=>{const t=z,s=o("Apple"),y=_,F=o("Check"),O=E,L=C,P=k,Q=j,S=w;return l(),d("div",q,[r(t,{title:"注意",type:"info",description:"在切换主题颜色时，将会替换已设置的tabbar"}),i("div",A,[B,i("div",I,[c((l(),f(P,{model:n(M),ref_key:"ruleFormRef",ref:x,"label-width":"120px",style:{width:"100%"}},{default:p((()=>[r(L,{gutter:24,align:"middle"},{default:p((()=>[(l(!0),d(m,null,b(n(K),((a,e)=>(l(),f(O,{span:6,key:e,style:{"margin-bottom":"15px"}},{default:p((()=>[i("div",{class:u(["theme-box",{active:a.id==n(M).data.id}]),onClick:e=>((a,e)=>{M.data=Object.assign(M.data,a)})(a)},[r(y,{size:"30",color:a.color},{default:p((()=>[r(s)])),_:2},1032,["color"]),i("span",D,v(a.text),1),i("div",G,[r(y,{style:{position:"relative",top:"4px",left:"6px","font-weight":"bold"},size:"20",color:"#ffffff"},{default:p((()=>[r(F)])),_:1})])],10,R)])),_:2},1024)))),128))])),_:1})])),_:1},8,["model"])),[[S,n(h)]])]),i("div",H,[r(Q,{type:"primary",loading:n(J),onClick:N},{default:p((()=>[g("保存")])),_:1},8,["loading"])])])])}}},[["__scopeId","data-v-73e46ad6"]]);export{J as default};
