guoyujie
2025-12-01 801bb13cadd66f9eb60fc917066751bd6672741b
north-glass-erp/northglass-erp/src/hook/mouseMove.ts
@@ -1,6 +1,7 @@
//鼠标滑动选中
import {nextTick, ref,reactive} from "vue";
import {ElMessage} from "element-plus";
import {add} from "../utils/decimal"
let isSelecting = ref(false) // 是否正在进行选择操作,默认为false
let selectionStart = reactive({ rowIndex: -1, cellIndex: -1 }) // 选择操作起始单元格位置
@@ -14,7 +15,7 @@
let cellarea = ref(`
    <div class="vxe-table--cell-area" style="font-size: 10px;text-align: left" >
      <span class="vxe-table--cell-main-area" >
        <p style="bottom: 0;color: blue;background-color: #5cadfe"></p>
        <p style="bottom: 0;color: blue;background-color: #5cadfe; margin-top: auto;font-size: 14px"></p>
        </span>
      <span class="vxe-table--cell-active-area"  ></span>
    </div>
@@ -38,7 +39,7 @@
    //cellarea.value = newElement
    //添加多选列
    nextTick(() => {
        window.addEventListener("keypress", ()=>{
        window.addEventListener("keydown", ()=>{
            destroyAreaBox()
        })
        window.addEventListener("mousedown", tableOutDestroyAreaBox)//给window添加鼠标按下事件,判断是否在表格外,是销毁
@@ -164,15 +165,16 @@
    result.forEach((item,index) => {
        if(index>0){
            sum+=item.reduce((a, b) => a*1 + b*1, 0);
            const val = isNaN(item[0])?0:item[0]
            sum = Number(add(sum, (val || 0)))
        }
    })
    sum=isNaN(sum)?0:sum
    setTimeout(()=>{
        activeElement.innerHTML ="SUM:"+parseFloat(sum.toFixed(2))
        activeElement.innerHTML ="SUM:"+sum
        if(element){
            element.innerHTML ="SUM:"+parseFloat(sum.toFixed(2))
            element.innerHTML ="SUM:"+sum
        }
    },200)
@@ -272,6 +274,11 @@
            element.style.height = `${height}px`
            element.style.top = `${top}px`
            element.style.display = "block"
            if(index%2==1){
                element.style.display = "flex"
                element.style.flexDirection = 'column'
            }
            if (index <= elements.length - 1 - 2) {//如果不是rightFixedActiveElement或rightFixedMainElement
                element.style.left = `${left}px`
            } else {
@@ -563,5 +570,6 @@
export {
    addListener,
    toolbarButtonClickEvent,
    exportData
    exportData,
    destroyAreaBox
}