From de398f47dd12b3890c9ee545422da78e82b60fa9 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 08 十二月 2025 09:22:06 +0800
Subject: [PATCH] 修改PDA出入库中出现undefined问题,修改job中因为上游调用频率过快导致job死掉,修改前端报警信息使用不同颜色

---
 新建文件夹/WMS/src/extension/Alarm/MessageInfo.js |   90 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/extension/Alarm/MessageInfo.js" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/extension/Alarm/MessageInfo.js"
index bc81bf3..274dbf8 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/extension/Alarm/MessageInfo.js"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WMS/src/extension/Alarm/MessageInfo.js"
@@ -22,7 +22,97 @@
           x.type = 'primary';
         }
       });
+        // 鍦� onInit 涓洿鎺ヤ慨鏀瑰垪閰嶇疆
+      this.fixColumnFormatter();
+    },
+       // 鐩存帴淇敼鍒楅厤缃�
+    fixColumnFormatter() {
+      // 寤惰繜鎵ц锛岀‘淇濆垪宸插姞杞�
+      this.$nextTick(() => {
+        setTimeout(() => {
+          const col = this.columns?.find(c => c.field === 'messageGroupBy');
+          if (col) {
+            // 瀹屽叏鏇挎崲 formatter
+            col.formatter = (row) => {
+              const value = row.messageGroupBy;
+              const text = this.getTextByValue(value);
+              
+              if (value === 1) {
+                // 搴撳瓨杩囨湡棰勮 - 鏍规嵁澶╂暟鍒嗕笁绉嶉鑹�
+                const info = row.messageInfo || '';
+                const days = this.extractDays(info);
+                
+                // 璁剧疆鏍峰紡
+                let style = '';
+                if (days !== null) {
+                  if (days < 0) {
+                    // 宸茶繃鏈� - 绾㈣壊
+                    style = 'background-color:#fff0f0;color:#f56c6c;border:1px solid #f56c6c33;';
+                  } else if (days <= 30) {
+                    // 1涓湀鍐呰繃鏈� - 绾㈣壊
+                    style = 'background-color:#fff0f0;color:#f56c6c;border:1px solid #f56c6c33;';
+                  } else if (days <= 120) {
+                    // 澶т簬30澶╀笖灏忎簬绛変簬120澶� - 姗欒壊
+                    style = 'background-color:#fdf6ec;color:#e6a23c;border:1px solid #e6a23c33;';
+                  } else {
+                    // 澶т簬120澶� - 缁胯壊
+                    style = 'background-color:#f0f9eb;color:#67c23a;border:1px solid #67c23a33;';
+                  }
+                } else {
+                  // 榛樿鏍峰紡
+                  style = 'background-color:#f5f5f5;color:#909399;border:1px solid #dcdfe6;';
+                }
+                
+                return `<span style="${style} padding:3px 10px;border-radius:12px;font-weight:600;font-size:12px;display:inline-block;line-height:1;">${text}</span>`;
+              }
+              
+              // 鍏朵粬鍒嗙粍 - 淇濇寔鍘熸湁鐨勬牱寮�
+              return this.getOtherGroupStyle(value, text);
+            };
+            
+            console.log('鍒楁牸寮忓寲鍑芥暟宸茶缃�');
+          }
+        }, 200);
+      });
+    },
 
+    // 鍏朵粬鍒嗙粍鐨勬牱寮�
+    getOtherGroupStyle(value, text) {
+      const styleMap = {
+        0: 'background-color:#e8f4ff;color:#0088ff;border:1px solid #0088ff33;', // 璁惧鎶ヨ - 浜摑鑹�
+        2: 'background-color:#fff2e8;color:#ff8800;border:1px solid #ff880033;', // 浣庡簱瀛橀璀� - 浜鑹�
+        3: 'background-color:#ffe8e8;color:#ff4444;border:1px solid #ff444433;', // 鐗╂枡寰呯淮鎶ゆ姤璀� - 浜孩鑹�
+        4: 'background-color:#f0e8ff;color:#8844ff;border:1px solid #8844ff33;', // 鍏ュ簱鍗曟姤璀� - 绱壊
+        5: 'background-color:#e8fffb;color:#00aa88;border:1px solid #00aa8833;', // 鍑哄簱鍗曟姤璀� - 闈掕壊
+        6: 'background-color:#fff8e8;color:#ffaa00;border:1px solid #ffaa0033;', // 涓嶦RP鍚屾鎶ヨ - 閲戣壊
+      };
+      
+      const style = styleMap[value] || 'background-color:#f5f5f5;color:#909399;border:1px solid #dcdfe6;';
+      
+      return `<span style="${style} padding:3px 10px;border-radius:12px;font-weight:600;font-size:12px;display:inline-block;line-height:1;">${text}</span>`;
+    },
+
+    getTextByValue(value) {
+      const map = {
+        0: '璁惧鎶ヨ',
+        1: '搴撳瓨杩囨湡棰勮',
+        2: '浣庡簱瀛橀璀�',
+        3: '鐗╂枡寰呯淮鎶ゆ姤璀�',
+        4: '鍏ュ簱鍗曟姤璀�',
+        5: '鍑哄簱鍗曟姤璀�',
+        6: '涓嶦RP鍚屾鎶ヨ'
+      };
+      return map[value] || `鍒嗙粍${value}`;
+    },
+
+    extractDays(info) {
+      if (!info) return null;
+      const match1 = info.match(/杩樻湁(\d+)澶╄繃鏈�/);
+      const match2 = info.match(/宸茶繃鏈�(\d+)澶�/);
+      
+      if (match1) return parseInt(match1[1]);
+      if (match2) return -parseInt(match2[1]);
+      return null;
     },
 
     onInited() {

--
Gitblit v1.9.3