浏览代码

货位管理内存出现泄露

flower_mr 1 月之前
父节点
当前提交
7acd8ce40c
共有 4 个文件被更改,包括 73 次插入35 次删除
  1. 二进制
      db.sqlite3
  2. 32 0
      logs/server.log
  3. 2 2
      templates/src/components/goodscard.vue
  4. 39 33
      templates/src/pages/stock/management.vue

二进制
db.sqlite3


+ 32 - 0
logs/server.log

@@ -2448,3 +2448,35 @@ RuntimeError: You called this URL via POST, but the URL doesn't end in a slash a
 [2025-04-14 17:38:22,962][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
 [2025-04-14 22:12:51,949][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
 [2025-04-14 22:24:10,438][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:18,337][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:22,521][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:27,179][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:31,323][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:34,253][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:35,982][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:38,623][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:41:48,926][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 22:54:15,477][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 23:40:36,785][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-14 23:43:15,894][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:07:54,838][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:08:05,362][django.request.log_response():241] [WARNING] Not Found: /dn/list/
+[2025-04-15 00:08:18,625][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:08:23,073][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:08:29,986][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:38:24,539][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:39:01,145][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:39:06,703][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:39:11,595][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:39:17,558][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:39:42,415][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:39:47,645][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 00:40:20,801][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 01:00:23,519][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 01:00:27,411][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 01:03:00,233][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 01:03:21,109][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 01:03:31,813][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 01:07:18,450][django.request.log_response():241] [WARNING] Not Found: /cyclecount/qtyrecorviewset/
+[2025-04-15 01:07:45,911][django.request.log_response():241] [WARNING] Not Found: /stock/list/
+[2025-04-15 01:07:48,094][django.request.log_response():241] [WARNING] Not Found: /cyclecount/manualcyclecount/

+ 2 - 2
templates/src/components/goodscard.vue

@@ -39,7 +39,7 @@
             <q-card style="min-width: 600px; ">
                 <q-bar class="bg-light-blue-10 text-white rounded-borders" style="height: 50px">
                     <div>
-                        {{ $t("stock.shelf.shelf_details") }}
+                        {{ $t("stock.shelf.shelf_details")  }} {{ rowIndex }}-{{ colIndex }}-{{layerIndex}}
                     </div>
                     <q-space></q-space>
                     <q-btn dense flat icon="close" v-close-popup>
@@ -410,7 +410,7 @@ export default {
 
         },
         handleclick() {
-            console.log('点击')
+      
             if (this.shelfLocal == "undefined") { this.clickedinput = true, this.storage_dialog = false, this.elevator_dialog = false, this.conveyor_dialog = false }
             if (this.shelfLocal == "storage") { this.getList(), this.clickedinput = false, this.storage_dialog = true, this.elevator_dialog = false, this.conveyor_dialog = false }
             if (this.shelfLocal == "elevator") { this.getList(), this.clickedinput = false, this.storage_dialog = false, this.elevator_dialog = true, this.conveyor_dialog = false }

+ 39 - 33
templates/src/pages/stock/management.vue

@@ -57,24 +57,30 @@
 
                 <!-- 网格系统 -->
                 <div class="grid-container">
-                    <!-- 内容层 -->
+                    <!-- 内容层 --> 
                     <div class="grid-content">
                         <div v-for="(row, rowIndex) in shelf.rows" :key="`row-${rowIndex}|${shelf.layer_now}`" class="grid-row">
                             <div v-for="(col, colIndex) in shelf.cols" :key="`col-${colIndex}|${shelf.layer_now}`" class="grid-item">
-                                <q-btn
-                                    v-if="shouldShowButton(
-                                        shelf.rows - rowIndex, 
-                                        colIndex + 1, 
-                                        shelf.layer_now
-                                        )"
-                                    :key="`${shelf.rows - rowIndex}-${col}-${shelf.layer_now}`"
-                                    :style="{
-                                        width: 'var(--cell-d)',
-                                        height: 'var(--cell-d)',
-                                        backgroundColor: getBinColor(shelf.rows - rowIndex, colIndex+1, shelf.layer_now)
-                                    }"
-                                    @click="handleBinClick(shelf.rows - rowIndex, colIndex+1, shelf.layer_now)"
-                                />
+                                <div 
+                                v-if="shouldShowButton(
+                                    shelf.rows - rowIndex, 
+                                    colIndex + 1, 
+                                    shelf.layer_now
+                                )"
+                                :key="`${shelf.rows - rowIndex}-${colIndex}-${shelf.layer_now}`"
+                                :style="{
+                                    border: '1px solid #ccc', 
+                                    borderRadius: '5px',
+                                    width: 'var(--cell-d)',
+                                    height: 'var(--cell-d)',
+                                    backgroundColor: getBinColor(shelf.rows - rowIndex, colIndex+1, shelf.layer_now),
+                                    cursor: 'pointer' // 明确指示点击行为
+                                }"
+                                @click="handleBinClick(shelf.rows - rowIndex, colIndex+1, shelf.layer_now)"
+                            >
+                                <!-- 确保没有子元素获得焦点 -->
+                            </div>
+
                                 <q-tooltip content-class="bg-amber text-black shadow-4" :offset="[20, 20]"
                                     content-style="font-size: 10px">
                                     {{ $t('stock.rowtip') }} {{ shelf.rows - rowIndex }}
@@ -96,7 +102,6 @@
 
 <script>
 import goodscard from 'components/goodscard.vue'
-
 import { LocalStorage } from 'quasar'
 import { getauth, postauth, putauth, deleteauth, getfile } from 'boot/axios_request'
 
@@ -119,7 +124,8 @@ export default {
             },
             filter: "",
             auth_edit: false,
-            goodsMap: {},      // 坐标映射表
+            goodsMap: {},  // 
+
             goodsMatrix: [] ,   // 二维数据矩阵
    
             // 颜色配置
@@ -138,21 +144,21 @@ export default {
             }
         }
     },
-    // 修正后的路由守卫
-    beforeRouteEnter(to, from, next) {
-        next(vm => {
-            // 使用 vm 访问组件实例
-            vm.goodsMatrix = []
-            vm.selectedBin = null
-            vm.goodsMap = {}
-        })
-    },
-    // beforeDestroy() {
-    //     //清空数据
-
-    //     this.goodsMatrix = []
-    //     this.selectedBin = null
-    // },
+        // 修正后的路由守卫
+        beforeRouteEnter(to, from, next) {
+            next(vm => {
+                // 使用 vm 访问组件实例
+                vm.goodsMatrix = []
+          
+                vm.goodsMap = {}
+            })
+        },
+        beforeDestroy() {
+            //清空数据
+            this.goodsMap = {}
+            this.goodsMatrix = []
+    
+        },
     methods: {
         shouldShowButton(row, col, layer) {
             const bin = this.goodsMap[`${row}-${col}-${layer}`]
@@ -298,7 +304,7 @@ export default {
         // 清理数据
         this.goodsMap = {}
         this.goodsMatrix = []
-        this.selectedBin = null
+
         
         // 清理事件监听
         window.removeEventListener('resize', this.handleResize)