import{_ as P}from"./index-M_JNBppB.js";/* empty css                  *//* empty css                              *//* empty css                 */import{ax as S,r as i,c as y,B as c,z as n,D as a,M as T,a7 as N,H as g,y as h,V as B,L as E,O as m,F as x,K as z}from"./vue-BJk78QHK.js";import{c as $,s as F,f as L,q as O}from"./element-3_pOinej.js";import"./threejs-BafxXW5-.js";import"./utils-YI6ye1sf.js";import"./vxe-Dx3zSILm.js";const R={class:"edit-table"},j=["onClick"],q={key:1},A=["onClick"],H={class:"valueTd"},K={key:1},G=Object.assign({name:"EditPie1"},{__name:"EditPie1",setup(J){const _=S(),o=i(""),p=i(!1),f=i(""),d=i(""),w=i(["#00ffff","#00cfff","#006ced","#ffe000","#ffa800","#ff5b00","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585"]),s=y(()=>_.state.curComponent.propValue.data.data),u=y(()=>_.state.curComponent.propValue.data.color);function M(){p.value=!0}function k(r,e){f.value=e,o.value=r,d.value=o.value}function V(){p.value=!1,o.value=""}function U(){if(!d.value&&d.value!==0){O.error("请先选择要删除的行");return}const r=s.value.findIndex(e=>e===d.value);r!==-1&&(s.value.splice(r,1),u.value.length>s.value.length&&u.value.splice(r,1),d.value="")}function D(){s.value.push({value:10,name:"新系列"}),u.value.length<s.value.length&&u.value.push(`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`)}return(r,e)=>{const C=$,I=F,b=L;return n(),c("div",R,[e[5]||(e[5]=a("h4",{style:{color:"#66b1ff","margin-bottom":"10px"}}," 数据 ",-1)),a("table",{onDblclick:M},[a("tbody",null,[e[2]||(e[2]=a("tr",{style:{color:"#66b1ff",height:"40px"}},[a("th",null,"系列(name)"),a("th",null,"值(value)/颜色")],-1)),(n(!0),c(T,null,N(s.value,(l,v)=>(n(),c("tr",{key:v},[a("td",{class:g({selected:o.value===l}),onClick:t=>k(l,"name")},[p.value&&o.value===l&&f.value==="name"?(n(),h(C,{key:0,modelValue:l.name,"onUpdate:modelValue":t=>l.name=t,onBlur:V,onClick:e[0]||(e[0]=B(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(n(),c("span",q,E(l.name),1))],10,j),a("td",{class:g({selected:o.value===l}),onClick:t=>k(l,"value")},[a("div",H,[p.value&&o.value===l&&f.value==="value"?(n(),h(C,{key:0,modelValue:l.value,"onUpdate:modelValue":t=>l.value=t,modelModifiers:{number:!0},type:"number",onBlur:V,onClick:e[1]||(e[1]=B(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(n(),c("span",K,E(l.value),1)),m(I,{modelValue:u.value[v],"onUpdate:modelValue":t=>u.value[v]=t,predefine:w.value,size:"small","show-alpha":""},null,8,["modelValue","onUpdate:modelValue","predefine"])])],10,A)]))),128))])],32),a("div",null,[m(b,{type:"primary",size:"small",onClick:D},{default:x(()=>e[3]||(e[3]=[z(" 添加 ")])),_:1}),m(b,{type:"danger",size:"small",onClick:U},{default:x(()=>e[4]||(e[4]=[z(" 删除 ")])),_:1})])])}}}),te=P(G,[["__scopeId","data-v-44be9cde"]]);export{te as default};
