import{_ as q}from"./index-M_JNBppB.js";/* empty css                 */import{ax as z,r as d,c as m,B as s,z as a,D as o,M as _,a7 as k,H as F,u as c,G as I,y as L,L as M}from"./vue-BJk78QHK.js";import{c as R,q as h}from"./element-3_pOinej.js";import"./threejs-BafxXW5-.js";import"./utils-YI6ye1sf.js";import"./vxe-Dx3zSILm.js";const U={class:"edit-table"},w=["onClick"],A={key:1},G={__name:"EditScrollTable",setup(H){const v=z(),r=d(""),p=d(!1),l=d(""),b=m(()=>v.state.curComponent.propValue.config.data),t=m({get:()=>b.value,set:e=>{v.state.curComponent.propValue.config.data=e}}),C={mounted:e=>{e.querySelector("input").focus()}};function y(){p.value=!0}function g(e,i){r.value=`${e},${i}`,l.value=r.value}function B(){p.value=!1,r.value=""}function E(){if(!l.value&&l.value!==0){h.error("请先选择要删除的行");return}const e=l.value.split(",")[0];t.value.splice(e,1)}function V(){var e;t.value.length>0?t.value.push(new Array(((e=t.value[0])==null?void 0:e.length)||1).fill(" ")):t.value.push([" "])}function $(){t.value.length?t.value.forEach(e=>e.push(" ")):t.value.push([" "])}function D(){if(!l.value&&l.value!==0){h.error("请先选择要删除的列");return}const e=l.value.split(",")[1];t.value.forEach(i=>{i.splice(e,1)})}return(e,i)=>{const S=R;return a(),s("div",U,[o("table",{onDblclick:y},[o("tbody",null,[(a(!0),s(_,null,k(c(t),(x,n)=>(a(),s("tr",{key:n},[(a(!0),s(_,null,k(x,(T,u)=>(a(),s("td",{key:u,class:F({selected:c(r)===`${n},${u}`}),onClick:f=>g(n,u)},[c(p)&&c(r)===`${n},${u}`?I((a(),L(S,{key:0,modelValue:c(t)[n][u],"onUpdate:modelValue":f=>c(t)[n][u]=f,onBlur:B},null,8,["modelValue","onUpdate:modelValue"])),[[C]]):(a(),s("span",A,M(T),1))],10,w))),128))]))),128))])],32),o("div",{style:{width:"100%"}},[o("button",{onClick:V}," 加一行 "),o("button",{onClick:$}," 加一列 "),o("button",{onClick:E}," 减一行 "),o("button",{onClick:D}," 减一列 ")])])}}},W=q(G,[["__scopeId","data-v-04a37cc7"]]);export{W as default};
