chenlu
2024-03-07 de18cca83738bdf6b279046e34b910ccd5b73a84
north-glass-erp/northglass-erp/src/hook/mouseMove.ts
@@ -399,17 +399,17 @@
            // //这里需要是visibleData
            // let tableData = getTablexGrid().getTableData().visibleData//获取处理条件之后的全量表体数据
            // let rowStart = selectionStart.rowIndex//获取选中起始行索引
            // let rowEnd = selectionEnd.rowIndex//获取选中结束行索引
            // let selectRows = tableData.filter((col, index: number) => {//col参数不能改否则会获取不到数据
            //     //这里修改从右下往左上拖动的数据显示
            //     if (rowStart <= rowEnd) {
            //         return rowStart <= index && rowEnd >= index
            //     } else {
            //         return rowStart >= index && rowEnd <= index
            //     }
            // })
            let tableData = getTablexGrid().getTableData().visibleData//获取处理条件之后的全量表体数据
            let rowStart = selectionStart.rowIndex//获取选中起始行索引
            let rowEnd = selectionEnd.rowIndex//获取选中结束行索引
            let selectRows = tableData.filter((col, index: number) => {//col参数不能改否则会获取不到数据
                //这里修改从右下往左上拖动的数据显示
                if (rowStart <= rowEnd) {
                    return rowStart <= index && rowEnd >= index
                } else {
                    return rowStart >= index && rowEnd <= index
                }
            })
            // console.log("鼠标选中行:", JSON.stringify(selectRows))
            //这里需要是visibleColumn
@@ -423,13 +423,26 @@
                } else {
                    return colStart >= index && colEnd <= index
                }
            })
            return  {
                start:selectionStart.rowIndex,//开始行
                end : selectionEnd.rowIndex,//结束行
                cell:selectCols[0].field//选中列
            let result=null
            if(selectRows.length===0){
                return false
            }
            result =  {
                start:selectionStart.rowIndex,//开始行
                end: selectionEnd.rowIndex,//结束行
                cell:selectCols[0].field,//选中列,
                row:selectRows
            }
            selectionStart.rowIndex=-1
            selectionStart.cellIndex=-1
            selectionEnd.rowIndex=-1
            selectionEnd.cellIndex=-1
            return  result
            //console.log("鼠标选中列:", JSON.stringify(selectCols))