import{_ as S}from"./index-M_JNBppB.js";/* empty css                  *//* empty css                 */import{ax as U,r as d,c as b,B as i,z as u,D as a,M as N,a7 as P,H as y,y as V,V as h,L as x,O as B,F as E,K as z}from"./vue-BJk78QHK.js";import{c as T,f as $,q as A}from"./element-3_pOinej.js";import"./threejs-BafxXW5-.js";import"./utils-YI6ye1sf.js";import"./vxe-Dx3zSILm.js";const F={class:"edit-table"},L=["onClick"],O={key:1},R=["onClick"],j={key:1},q=Object.assign({name:"EditPie2"},{__name:"EditPie3",setup(H){const v=U(),o=d(""),c=d(!1),m=d(""),s=d("");d(["#18b78e","#01b3ee","#164bcd","#3434b0","#ffe000","#ffa800","#ff5b00","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff"]);const t=b(()=>v.state.curComponent.propValue.data.data),p=b(()=>v.state.curComponent.propValue.data.color),f=b(()=>v.state.curComponent.propValue.data.bgColor);function M(){c.value=!0}function g(n,e){m.value=e,o.value=n,s.value=o.value}function k(){c.value=!1,o.value=""}function w(){if(!s.value&&s.value!==0){A.error("请先选择要删除的行");return}const n=t.value.findIndex(e=>e===s.value);n!==-1&&(t.value.splice(n,1),p.value.length>t.value.length&&p.value.splice(n,1),f.value.length>t.value.length&&f.value.splice(n,1),s.value="")}function D(){t.value.push({value:10,name:"新系列"}),p.value.length<t.value.length&&p.value.push(`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`),f.value.length<t.value.length&&f.value.push("rgba(24,183,142,0.1)")}return(n,e)=>{const _=T,C=$;return u(),i("div",F,[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)),(u(!0),i(N,null,P(t.value,(l,I)=>(u(),i("tr",{key:I},[a("td",{class:y({selected:o.value===l}),onClick:r=>g(l,"name")},[c.value&&o.value===l&&m.value==="name"?(u(),V(_,{key:0,modelValue:l.name,"onUpdate:modelValue":r=>l.name=r,onBlur:k,onClick:e[0]||(e[0]=h(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(u(),i("span",O,x(l.name),1))],10,L),a("td",{class:y({selected:o.value===l}),onClick:r=>g(l,"value")},[c.value&&o.value===l&&m.value==="value"?(u(),V(_,{key:0,modelValue:l.value,"onUpdate:modelValue":r=>l.value=r,modelModifiers:{number:!0},type:"number",onBlur:k,onClick:e[1]||(e[1]=h(()=>{},["stop"])),size:"small"},null,8,["modelValue","onUpdate:modelValue"])):(u(),i("span",j,x(l.value),1))],10,R)]))),128))])],32),a("div",null,[B(C,{type:"primary",size:"small",onClick:D},{default:E(()=>e[3]||(e[3]=[z("添加")])),_:1}),B(C,{type:"danger",size:"small",onClick:w},{default:E(()=>e[4]||(e[4]=[z("删除")])),_:1})])])}}}),ee=S(q,[["__scopeId","data-v-ff414fa3"]]);export{ee as default};
