Browse Source

去掉只有首行列能拖限制

shanbinzhang 2 months ago
parent
commit
629f619131
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/hooks/sheet/useResizeTable.js

+ 5 - 5
src/hooks/sheet/useResizeTable.js

@@ -23,15 +23,15 @@ export function useResizeTable(refName) {
 
     if(isMobile()) return
 
-    if(rIndex!==0 && cIndex!==0) return
+    // if(rIndex!==0 && cIndex!==0) return
 
     let target = e.target
     if (!dragging.value) {
         let rect = target.getBoundingClientRect();
 
-        if (rect.width > 12 && rect.right - e.pageX < moveToDistance && rIndex===0) {
+        if (rect.width > 12 && rect.right - e.pageX < moveToDistance /* && rIndex===0 */) {
             e.target.style.cursor = 'col-resize'
-        }else if (rect.height > 12 && rect.bottom - e.pageY < moveToDistance && cIndex===0) {
+        }else if (rect.height > 12 && rect.bottom - e.pageY < moveToDistance /* && cIndex===0 */) {
             e.target.style.cursor = 'row-resize'
         } else if (!dragging.value) {
             e.target.style.cursor = ''
@@ -51,7 +51,7 @@ export function useResizeTable(refName) {
 
     let rect = e.target.getBoundingClientRect();
 
-    if (rect.width > 12 && rect.right - e.pageX < moveToDistance && rIndex===0) {
+    if (rect.width > 12 && rect.right - e.pageX < moveToDistance /* && rIndex===0 */) {
       // 开始拖拽
       // 当前拖拽的列所在的表格
       // 当前所在列(单元格)
@@ -115,7 +115,7 @@ export function useResizeTable(refName) {
     }
 
 
-    if (rect.height > 12 && rect.bottom - e.pageY < moveToDistance && cIndex===0) {
+    if (rect.height > 12 && rect.bottom - e.pageY < moveToDistance /* && cIndex===0 */) {
       let thEL = e.target
       dragging.value = true