import{_ as T}from"./index-M_JNBppB.js";/* empty css                  *//* empty css                              *//* empty css                 */import{ax as N,r as d,c as g,B as c,z as s,D as a,M as F,a7 as L,H as y,y as B,V as h,L as E,O as _,F as x,K as z}from"./vue-BJk78QHK.js";import{c as O,s as R,f as S,q as $}from"./element-3_pOinej.js";import"./threejs-BafxXW5-.js";import"./utils-YI6ye1sf.js";import"./vxe-Dx3zSILm.js";const j={class:"edit-table"},q=["onClick"],A={key:1},H=["onClick"],K={class:"valueTd"},P={key:1},G=Object.assign({name:"EditBar1"},{__name:"EditBar1",setup(J){const p=N(),o=d(""),i=d(!1),m=d(""),u=d(""),w=d(["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","rgb(51, 100, 98)","rgb(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","rgba(255, 0, 0, 1)"]),r=g(()=>p.state.curComponent.propValue.data.data),v=g({get:()=>p.state.curComponent.propValue.data.color,set:t=>{p.state.curComponent.propValue.data.data=t}});function U(){i.value=!0}function k(t,e){m.value=e,o.value=t,u.value=o.value}function V(){i.value=!1,o.value=""}function D(){if(!u.value&&u.value!==0){$.error("请先选择要删除的行");return}const t=r.value.findIndex(e=>e===u.value);t!==-1&&(r.value.splice(t,1),v.value.length>r.value.length,u.value="")}function I(){r.value.push({value:0,name:"新类别"})}return(t,e)=>{const b=O,M=R,C=S;return s(),c("div",j,[e[5]||(e[5]=a("h4",{style:{color:"#66b1ff","margin-bottom":"10px"}}," 数据 ",-1)),a("table",{onDblclick:U},[a("tbody",null,[e[2]||(e[2]=a("tr",{style:{color:"#66b1ff",height:"40px"}},[a("th",null,"类别(name)"),a("th",null,"值(value)/颜色")],-1)),(s(!0),c(F,null,L(r.value,(l,f)=>(s(),c("tr",{key:f},[a("td",{class:y({selected:o.value===l}),onClick:n=>k(l,"name")},[i.value&&o.value===l&&m.value==="name"?(s(),B(b,{key:0,modelValue:l.name,"onUpdate:modelValue":n=>l.name=n,onBlur:V,onClick:e[0]||(e[0]=h(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(s(),c("span",A,E(l.name),1))],10,q),a("td",{class:y({selected:o.value===l}),onClick:n=>k(l,"value")},[a("div",K,[i.value&&o.value===l&&m.value==="value"?(s(),B(b,{key:0,modelValue:l.value,"onUpdate:modelValue":n=>l.value=n,modelModifiers:{number:!0},type:"number",onBlur:V,onClick:e[1]||(e[1]=h(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(s(),c("span",P,E(l.value),1)),_(M,{modelValue:v.value[f],"onUpdate:modelValue":n=>v.value[f]=n,predefine:w.value,size:"small","show-alpha":""},null,8,["modelValue","onUpdate:modelValue","predefine"])])],10,H)]))),128))])],32),a("div",null,[_(C,{type:"primary",size:"small",onClick:I},{default:x(()=>e[3]||(e[3]=[z(" 添加 ")])),_:1}),_(C,{type:"danger",size:"small",onClick:D},{default:x(()=>e[4]||(e[4]=[z(" 删除 ")])),_:1})])])}}}),te=T(G,[["__scopeId","data-v-023d2578"]]);export{te as default};
