소스 검색

feat:tablePlus

ananzhusen 9 달 전
부모
커밋
54592aad45
2개의 변경된 파일17개의 추가작업 그리고 17개의 파일을 삭제
  1. 13 13
      src/views/components/Custom.vue
  2. 4 4
      src/views/components/PenDatas.vue

+ 13 - 13
src/views/components/Custom.vue

@@ -278,11 +278,11 @@ const getPenData = (data: any) => {
     if (!props.pen.styles) {
       props.pen.styles = [];
     }
-    if (props.pen.calculative.activeCell) {
-      cell.value.col = props.pen.calculative.activeCell.col;
-      cell.value.row = props.pen.calculative.activeCell.row;
+    if (props.pen.calculative.activeCol !== undefined) {
+      cell.value.col = props.pen.calculative.activeCol;
+      cell.value.row = undefined;
       let found = props.pen.styles.findIndex((item: any) => {
-        return item.row === cell.value.row && item.col === cell.value.col;
+        return item.row === undefined && item.col === cell.value.col;
       });
       if (found !== -1) {
         cell.value.background = props.pen.styles[found].background;
@@ -293,11 +293,12 @@ const getPenData = (data: any) => {
         cell.value.textColor = undefined;
         cell.value.fontSize = undefined;
       }
-    } else if (props.pen.calculative.activeCol !== undefined) {
-      cell.value.col = props.pen.calculative.activeCol;
-      cell.value.row = undefined;
+    } else if (props.pen.calculative.activeRow !== undefined) {
+      cell.value.col = undefined;
+      cell.value.row = props.pen.calculative.activeRow;
+
       let found = props.pen.styles.findIndex((item: any) => {
-        return item.row === undefined && item.col === cell.value.col;
+        return item.row === cell.value.row && item.col === undefined;
       });
       if (found !== -1) {
         cell.value.background = props.pen.styles[found].background;
@@ -308,12 +309,11 @@ const getPenData = (data: any) => {
         cell.value.textColor = undefined;
         cell.value.fontSize = undefined;
       }
-    } else if (props.pen.calculative.activeRow !== undefined) {
-      cell.value.col = undefined;
-      cell.value.row = props.pen.calculative.activeRow;
-
+    } else if (props.pen.calculative.activeCell) {
+      cell.value.col = props.pen.calculative.activeCell.col;
+      cell.value.row = props.pen.calculative.activeCell.row;
       let found = props.pen.styles.findIndex((item: any) => {
-        return item.row === cell.value.row && item.col === undefined;
+        return item.row === cell.value.row && item.col === cell.value.col;
       });
       if (found !== -1) {
         cell.value.background = props.pen.styles[found].background;

+ 4 - 4
src/views/components/PenDatas.vue

@@ -1955,12 +1955,12 @@ const cell = ref({
 
 const getPenData = (e)=>{
   if(props.pen.name === 'tablePlus'){
-    if(props.pen.calculative.activeCell){
-      cell.value.col = props.pen.calculative.activeCell.col;
-      cell.value.row = props.pen.calculative.activeCell.row;
-    }else if(props.pen.calculative.activeRow !== undefined){
+   if(props.pen.calculative.activeRow !== undefined){
       cell.value.row = props.pen.calculative.activeRow;
       cell.value.col = undefined;
+    }else if(props.pen.calculative.activeCell){
+      cell.value.col = props.pen.calculative.activeCell.col;
+      cell.value.row = props.pen.calculative.activeCell.row;
     }else{
       cell.value.col = undefined;
       cell.value.row = undefined;