import{_ as W}from"./index-M_JNBppB.js";/* empty css                  *//* empty css                   *//* empty css                  *//* empty css               *//* empty css                  *//* empty css                     *//* empty css                 */import{ax as X,r as v,c as g,ao as Y,B as m,z as u,D as n,M as S,a7 as $,H as R,u as l,G as q,y as k,L as V,O as f,F as i,K as I}from"./vue-BJk78QHK.js";import{c as Z,d as ee,e as le,f as te,I as oe,q as ae}from"./element-3_pOinej.js";import"./threejs-BafxXW5-.js";import"./utils-YI6ye1sf.js";import"./vxe-Dx3zSILm.js";const ne={class:"edit-table"},se=["onClick"],ue={key:1},re=["onClick"],ie={class:"valueTd"},de={key:1},pe={style:{display:"flex","flex-direction":"column","background-color":"#232630",padding:"20px"}},ce=["onMouseenter","onMouseout"],ve=["onMouseenter","onMouseout"],me={__name:"Edit",setup(fe){const y=X(),p=v(""),_=v(!1),D=v(""),C=v(""),r=v(0),h=v(""),E=v(""),d=g(()=>y.state.curComponent.propValue),c=g(()=>y.state.curComponent.propValue.tabData),a=g(()=>y.state.componentData),U=g(()=>y.state.curComponent);function K(t){r.value=t}function P(){const t=a.value.map(e=>e.id);d.value.tabData[r.value].showComponents=d.value.tabData[r.value].showComponents.filter(e=>t.includes(e))}function j(){const t=a.value.map(e=>e.id);d.value.tabData[r.value].hideComponents=d.value.tabData[r.value].hideComponents.filter(e=>t.includes(e))}function x(t){var e;h.value=a.value[t].style.opacity,E.value=a.value[t].style.backgroundColor,((e=a[t])==null?void 0:e.component)==="Group"?(a.value[t].groupStyle.opacity=".5",a.value[t].groupStyle.backgroundColor="#ff2e02fc"):(a.value[t].style.opacity=".5",a.value[t].style.backgroundColor="#ff2e02fc")}function z(t){var e;((e=a[t])==null?void 0:e.component)==="Group"?(a.value[t].groupStyle.opacity=h.value,a.value[t].groupStyle.backgroundColor=E.value):(a.value[t].style.opacity=h.value,a.value[t].style.backgroundColor=E.value)}function w(){_.value=!0}function O(t,e){D.value=e,p.value=t,C.value=p.value}function T(){_.value=!1,p.value=""}function A(){if(!C.value&&C.value!==0){ae.error("请先选择要删除的行");return}const t=C.value;c.value.splice(t,1)}function J(){c.value.push({value:"",label:""})}return(t,e)=>{const G=Z,N=le,F=ee,B=te,Q=oe,H=Y("focus");return u(),m("div",ne,[e[8]||(e[8]=n("h4",{style:{color:"#66b1ff","margin-bottom":"10px"}}," 数据 ",-1)),n("table",{onDblclick:w},[n("tbody",null,[e[5]||(e[5]=n("tr",{style:{color:"#66b1ff",height:"40px"}},[n("th",null,"名字"),n("th",null,"值")],-1)),(u(!0),m(S,null,$(l(c),(L,s)=>(u(),m("tr",{key:s},[n("td",{class:R({selected:l(p)===s}),onClick:o=>O(s,"label")},[l(_)&&l(p)===s&&l(D)==="label"?q((u(),k(G,{key:0,modelValue:l(c)[s].label,"onUpdate:modelValue":o=>l(c)[s].label=o,onBlur:T},null,8,["modelValue","onUpdate:modelValue"])),[[H]]):(u(),m("span",ue,V(L.label),1))],10,se),n("td",{class:R({selected:l(p)===s}),onClick:o=>O(s,"value")},[n("div",ie,[l(_)&&l(p)===s&&l(D)==="value"?q((u(),k(G,{key:0,modelValue:l(c)[s].value,"onUpdate:modelValue":o=>l(c)[s].value=o,onBlur:T},null,8,["modelValue","onUpdate:modelValue"])),[[H]]):(u(),m("span",de,V(L.value),1)),f(Q,{placement:"left",width:"300",trigger:"click"},{reference:i(()=>[f(B,{type:"primary",link:"",size:"small",onClick:o=>K(s)},{default:i(()=>e[4]||(e[4]=[I(" 配置 ")])),_:2},1032,["onClick"])]),default:i(()=>[n("div",pe,[e[2]||(e[2]=n("p",{style:{color:"#1e90ff"}}," 选中显示组件： ",-1)),f(F,{modelValue:l(d).tabData[l(r)].showComponents,"onUpdate:modelValue":e[0]||(e[0]=o=>l(d).tabData[l(r)].showComponents=o),style:{"margin-top":"10px"},placeholder:"请选择组件",class:"testtest",multiple:"","collapse-tags":"",teleported:!1,onChange:P},{default:i(()=>[(u(!0),m(S,null,$(l(a),(o,b)=>(u(),k(N,{key:o.id,value:o.id,label:o.label,disabled:l(U).id==o.id},{default:i(()=>[n("div",{onMouseenter:M=>x(b),onMouseout:M=>z(b)},V(o.label),41,ce)]),_:2},1032,["value","label","disabled"]))),128))]),_:1},8,["modelValue"]),e[3]||(e[3]=n("p",{style:{color:"#1e90ff","margin-top":"20px"}}," 选中隐藏组件： ",-1)),f(F,{modelValue:l(d).tabData[l(r)].hideComponents,"onUpdate:modelValue":e[1]||(e[1]=o=>l(d).tabData[l(r)].hideComponents=o),style:{"margin-top":"10px"},placeholder:"请选择组件",class:"testtest",multiple:"","collapse-tags":"",teleported:!1,onChange:j},{default:i(()=>[(u(!0),m(S,null,$(l(a),(o,b)=>(u(),k(N,{key:o.id,value:o.id,label:o.label,disabled:l(U).id==o.id},{default:i(()=>[n("div",{onMouseenter:M=>x(b),onMouseout:M=>z(b)},V(o.label),41,ve)]),_:2},1032,["value","label","disabled"]))),128))]),_:1},8,["modelValue"])])]),_:2},1024)])],10,re)]))),128))])],32),n("div",null,[f(B,{type:"primary",size:"small",onClick:J},{default:i(()=>e[6]||(e[6]=[I(" 添加 ")])),_:1}),f(B,{type:"danger",size:"small",onClick:A},{default:i(()=>e[7]||(e[7]=[I(" 删除 ")])),_:1})])])}}},$e=W(me,[["__scopeId","data-v-2e128ac6"]]);export{$e as default};
