import{_ as S}from"./index-M_JNBppB.js";/* empty css                  *//* empty css                              *//* empty css                 */import{ax as q,r as c,c as g,j as I,B as d,z as r,D as o,M as L,a7 as R,H as B,u as e,G as x,y as E,L as D,O as v,F as U,K as z}from"./vue-BJk78QHK.js";import{c as $,s as j,f as A,q as G}from"./element-3_pOinej.js";import"./threejs-BafxXW5-.js";import"./utils-YI6ye1sf.js";import"./vxe-Dx3zSILm.js";const H={class:"edit-table"},K=["onClick"],O={key:1},J=["onClick"],Q={class:"valueTd"},W={key:1},X={__name:"EditPie",setup(Y){const _={mounted:s=>{s.querySelector("input").focus()}},k=q(),a=c(""),i=c(!1),f=c(""),p=c(""),T=c(["#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)"]),n=g(()=>k.state.curComponent.propValue.data),m=g(()=>k.state.curComponent.propValue.color);function F(){i.value=!0}function V(s,t){f.value=t,a.value=s,p.value=a.value}function b(){i.value=!1,a.value=""}function M(){if(!p.value&&p.value!==0){G.error("请先选择要删除的行");return}const s=p.value;n.value.splice(s,1),m.value.splice(s,1)}function N(){n.value.push({value:"",name:""}),m.value.push("")}return I(()=>{}),(s,t)=>{const y=$,P=j,C=A;return r(),d("div",H,[t[3]||(t[3]=o("h4",{style:{color:"#66b1ff","margin-bottom":"10px"}}," 数据 ",-1)),o("table",{onDblclick:F},[o("tbody",null,[t[0]||(t[0]=o("tr",{style:{color:"#66b1ff",height:"40px"}},[o("th",null,"name"),o("th",null,"value/color")],-1)),(r(!0),d(L,null,R(e(n),(h,l)=>(r(),d("tr",{key:l},[o("td",{class:B({selected:e(a)===l}),onClick:u=>V(l,"name")},[e(i)&&e(a)===l&&e(f)==="name"?x((r(),E(y,{key:0,modelValue:e(n)[l].name,"onUpdate:modelValue":u=>e(n)[l].name=u,onBlur:b},null,8,["modelValue","onUpdate:modelValue"])),[[_]]):(r(),d("span",O,D(h.name),1))],10,K),o("td",{class:B({selected:e(a)===l}),onClick:u=>V(l,"value")},[o("div",Q,[e(i)&&e(a)===l&&e(f)==="value"?x((r(),E(y,{key:0,modelValue:e(n)[l].value,"onUpdate:modelValue":u=>e(n)[l].value=u,onBlur:b},null,8,["modelValue","onUpdate:modelValue"])),[[_]]):(r(),d("span",W,D(h.value),1)),v(P,{modelValue:e(m)[l],"onUpdate:modelValue":u=>e(m)[l]=u,predefine:e(T),"show-alpha":""},null,8,["modelValue","onUpdate:modelValue","predefine"])])],10,J)]))),128))])],32),o("div",null,[v(C,{type:"primary",size:"small",onClick:N},{default:U(()=>t[1]||(t[1]=[z(" 添加 ")])),_:1}),v(C,{type:"danger",size:"small",onClick:M},{default:U(()=>t[2]||(t[2]=[z(" 删除 ")])),_:1})])])}}},ue=S(X,[["__scopeId","data-v-5d47fef9"]]);export{ue as default};
