import{C as e,O as t,S as n,St as r,T as i,Y as a,Z as o,bt as s,cn as c,ct as l,dt as u,ft as d,g as f,in as p,j as m,k as h,kt as g,w as _,wt as v,x as y}from"./vue.runtime.esm-bundler-DpGzKKN4.js";import{a as b,i as x}from"./vue-router-BU7Z_qXI.js";import"./GxPagination-DOexUzbO.js";import{Ot as S}from"./vnode-DU8g6Rf7.js";import{n as C,t as ee}from"./table-C_Bpc8FZ.js";import{t as te}from"./button-CHjzS7b0.js";import{t as w}from"./directive-9SA1IQHd.js";import{t as T}from"./_plugin-vue_export-helper-CnS4QQza.js";import{O as E}from"./GxDialog-BUqY5Fq3.js";import{dn as D,in as O,nn as ne}from"./stores-BWYw2E2w.js";import"./css-CW_FwBqc2.js";import{o as re}from"./validate-CTyV86Nm.js";import"./css-DunA3L7q.js";import"./css-ropEN6qH.js";import"./css-BrGVMe3H.js";import{t as k}from"./EditControllerThemeVariableDialog-D2kE8PO4.js";var A={class:`design-controller-theme-variable flex-grow flex flex-col bg-white p-6`},j={class:`adap-text-gray flex flex-col`},M={class:`text-[22px] mb-8`},N={class:`grid md:grid-cols-4 grid-cols-2 gap-8`},P={class:`variable-group-item p-4`},F={class:`flex flex-row justify-between mb-4`},I={class:`text-base`},L={class:`adap-bg-gray-fourth rounded-xl py-1 px-2 text-xs`},R={class:`flex flex-col justify-center items-center`},z={class:`flex flex-row justify-center`},B={class:`flex justify-center mt-2`},V=`设计变量配置`,H=T(m({__name:`DesignControllerThemeVariable`,setup(m){b();let T=x(),H=r(!0),U=y(()=>T.params?.zxlPrdId),W=y(()=>T.query?.themeId),G=v(null),K=y(()=>{let e=G.value?.themeName;return e?`${e}主题--${V}`:V}),q=async()=>{let e=W.value;if(!e){G.value=null;return}try{G.value=await ne(e)||null}catch{}},J=v([]),Y=async()=>{let e=W.value;if(!e){J.value=[];return}H.value=!0;try{J.value=await O(e,U.value)||[]}catch{}H.value=!1},X=s({color:null,font:null,fontSize:null,round:null}),Z=[[2,`color`,`颜色`],[3,`font`,`字体`],[1,`fontSize`,`字号`],[4,`round`,`圆角`]];l(J,e=>{Z.forEach(([t,n,r],i)=>{let a=e.filter(e=>e.variableType===t);X[n]!==void 0&&(X[n]={variableType:t,groupName:r,members:a,membersLength:a.length})})}),l(W,e=>{q(),Y()},{immediate:!0});let Q=s({openType:`add`,visible:!1,row:null,themeObId:``,variableType:1}),$=(e,t,n)=>{Q.visible=!0,Q.openType=e,Q.row=n||null,Q.variableType=t,Q.themeObId=W.value||``},ie=async e=>{if(await re({message:`确认要删除变量：${e.variableName}？`,title:`提示`,confirmButtonText:`确定`,showCancelButton:!0,cancelButtonText:`取消`,confirmButtonClass:`message-box-confim`,cancelButtonClass:`message-box-cancel el-button--primary`}).then(()=>!0).catch(()=>!1))try{await D(e.themeVariableObId),Y()}catch{}};return(r,s)=>{let l=C,m=te,v=ee,y=S,b=w;return a(),i(`div`,A,[d((a(),i(`div`,j,[n(`p`,M,c(K.value),1),n(`div`,N,[(a(),i(f,null,o(Z,([r,o,d])=>n(`div`,P,[n(`div`,F,[n(`span`,I,c(d),1),n(`span`,L,c(`${X[o]?.membersLength||0} 个`),1)]),h(v,{data:X[o]?.members||[],stripe:!1,showHeader:!1},{default:u(()=>[r===3?_(``,!0):(a(),e(l,{key:0,prop:``,label:``,width:r===4?46:40},{default:u(({row:e})=>[n(`div`,R,[r===2?(a(),i(`span`,{key:0,class:`variable-value-example-color`,style:p(`background-color: ${e.variableValue};`)},null,4)):r===1?(a(),i(`span`,{key:1,style:p(`font-size: ${e.variableValue};`)},`A`,4)):r===4?(a(),i(`span`,{key:2,class:`variable-value-example-round`,style:p(`border-radius: ${e.variableValue};`)},null,4)):_(``,!0)])]),_:2},1032,[`width`])),h(l,{prop:`variableName`,label:``,"min-width":`80`,showOverflowTooltip:!0}),h(l,{prop:`variableValue`,label:``,"min-width":r===3?120:80,showOverflowTooltip:!0},{default:u(({row:e})=>[n(`span`,{class:`adap-text-blue`,style:p(r===3?`font-family: ${e.variableValue};`:``)},c(e.variableValue||``),5)]),_:2},1032,[`min-width`]),h(l,{prop:``,label:``,width:`120`,fixed:`right`},{default:u(({row:e})=>[n(`div`,z,[h(m,{class:`!p-0`,text:``,size:`small`,onClick:t=>$(`edit`,r,e)},{default:u(()=>[...s[1]||=[t(`修改`,-1)]]),_:1},8,[`onClick`]),h(m,{class:`!p-0 !text-[#EF4444]`,text:``,type:`danger`,size:`small`,onClick:t=>ie(e)},{default:u(()=>[...s[2]||=[t(`删除`,-1)]]),_:1},8,[`onClick`])])]),_:2},1024)]),_:2},1032,[`data`]),n(`div`,B,[h(m,{text:``,onClick:e=>$(`add`,r)},{default:u(()=>[h(y,null,{default:u(()=>[h(g(E))]),_:1})]),_:1},8,[`onClick`])])])),64))])])),[[b,H.value]]),h(k,{zxlPrdId:U.value,visible:Q.visible,"onUpdate:visible":s[0]||=e=>Q.visible=e,type:Q.openType,row:Q.row,"theme-ob-id":Q.themeObId,"variable-type":Q.variableType,onUpdateList:Y},null,8,[`zxlPrdId`,`visible`,`type`,`row`,`theme-ob-id`,`variable-type`])])}}}),[[`__scopeId`,`data-v-549ace0b`]]);export{H as default};