import{_ as x}from"./index-M_JNBppB.js";/* empty css                  *//* empty css                              *//* empty css                 */import{ax as w,r as c,c as U,B as u,z as a,D as e,M as z,a7 as M,y as k,V as y,L as b,O as p,F as V,K as B}from"./vue-BJk78QHK.js";import{c as F,s as N,f as $,q as A}from"./element-3_pOinej.js";import"./threejs-BafxXW5-.js";import"./utils-YI6ye1sf.js";import"./vxe-Dx3zSILm.js";const I={class:"edit-table"},L={class:"table-container"},O=["onDblclick"],R={key:1},S=["onDblclick"],T={key:1},j={class:"actions"},q=Object.assign({name:"EditBar3"},{__name:"EditBar3",setup(K){const C=w(),r=c(!1),n=c({index:-1,key:""}),E=c(["#E8A61F","#E67C26","#0CD8A7","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585"]),d=U(()=>C.state.curComponent.propValue.data);function m(i,l){r.value=!0,n.value={index:i,key:l}}function f(){r.value=!1,n.value={index:-1,key:""}}function g(){d.value.push({name:"新类别",value:10,color:"#cccccc"})}function h(i){if(d.value.length<=1){A.warning("至少保留一行数据");return}d.value.splice(i,1)}return(i,l)=>{const v=F,D=N,_=$;return a(),u("div",I,[l[5]||(l[5]=e("h4",{style:{color:"#66b1ff","margin-bottom":"10px"}}," 数据编辑 ",-1)),e("div",L,[e("table",null,[l[3]||(l[3]=e("thead",null,[e("tr",{style:{color:"#66b1ff",height:"40px"}},[e("th",null,"类别(name)"),e("th",null,"值(value)"),e("th",null,"颜色(color)"),e("th",null,"操作")])],-1)),e("tbody",null,[(a(!0),u(z,null,M(d.value,(o,s)=>(a(),u("tr",{key:s},[e("td",{onDblclick:t=>m(s,"name")},[r.value&&n.value.index===s&&n.value.key==="name"?(a(),k(v,{key:0,modelValue:o.name,"onUpdate:modelValue":t=>o.name=t,onBlur:f,onClick:l[0]||(l[0]=y(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(a(),u("span",R,b(o.name),1))],40,O),e("td",{onDblclick:t=>m(s,"value")},[r.value&&n.value.index===s&&n.value.key==="value"?(a(),k(v,{key:0,modelValue:o.value,"onUpdate:modelValue":t=>o.value=t,modelModifiers:{number:!0},type:"number",onBlur:f,onClick:l[1]||(l[1]=y(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(a(),u("span",T,b(o.value),1))],40,S),e("td",null,[p(D,{modelValue:o.color,"onUpdate:modelValue":t=>o.color=t,predefine:E.value,size:"small","show-alpha":""},null,8,["modelValue","onUpdate:modelValue","predefine"])]),e("td",null,[p(_,{type:"danger",link:"",onClick:t=>h(s)},{default:V(()=>l[2]||(l[2]=[B(" 删除 ")])),_:2},1032,["onClick"])])]))),128))])])]),e("div",j,[p(_,{type:"primary",size:"small",onClick:g},{default:V(()=>l[4]||(l[4]=[B(" 添加数据项 ")])),_:1})])])}}}),ee=x(q,[["__scopeId","data-v-d51c2a64"]]);export{ee as default};
