From a660db06773007b1be690e0674829c00a57aeb7b Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 24 十二月 2025 16:21:23 +0800
Subject: [PATCH] 订单首页流程卡新增楼层编号显示

---
 north-glass-erp/northglass-erp/src/hook/mouseMove.ts |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/hook/mouseMove.ts b/north-glass-erp/northglass-erp/src/hook/mouseMove.ts
index 7bb96b1..e3a88e8 100644
--- a/north-glass-erp/northglass-erp/src/hook/mouseMove.ts
+++ b/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) // 鏄惁姝e湪杩涜閫夋嫨鎿嶄綔,榛樿涓篺alse
 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)//缁檞indow娣诲姞榧犳爣鎸変笅浜嬩欢,鍒ゆ柇鏄惁鍦ㄨ〃鏍煎,鏄攢姣�
@@ -145,6 +146,9 @@
         isSelecting.value = false//鏍囪涓哄仠姝㈤�夋嫨鎿嶄綔
     }
     const result = exportData()
+    if(!result){
+        return
+    }
     const activeElement = getTablexGrid().$el.querySelector(".vxe-table--main-wrapper .vxe-table--body-wrapper .vxe-table--cell-main-area p")
     const element = xGrid.value.$el.querySelector(".vxe-table--fixed-wrapper .vxe-table--fixed-left-wrapper .vxe-table--body-wrapper .vxe-table--cell-main-area p")
 
@@ -161,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)
@@ -269,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鎴杛ightFixedMainElement
                 element.style.left = `${left}px`
             } else {
@@ -560,5 +570,6 @@
 export {
     addListener,
     toolbarButtonClickEvent,
-    exportData
+    exportData,
+    destroyAreaBox
 }
\ No newline at end of file

--
Gitblit v1.8.0