From 5e851678cc02257bbbd179446de36082430ca5bc Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 13 四月 2026 15:12:04 +0800
Subject: [PATCH] feat(MES): 添加Mes_Log扩展逻辑

---
 Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx |   76 +++++++++++++++++++++++++++++++++++++
 1 files changed, 75 insertions(+), 1 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx
index 5b05c40..96340be 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx
+++ b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx
@@ -1,4 +1,6 @@
-import { h, resolveComponent } from 'vue';
+import { h, createApp } from 'vue';
+import { ElDrawer } from 'element-plus';
+
 let extension = {
   components: {
     //鍔ㄦ�佹墿鍏呯粍浠舵垨缁勪欢璺緞
@@ -20,6 +22,78 @@
     },
     onInited() {
       this.height = this.height - 170;
+    },
+
+    // 琛岀偣鍑讳簨浠� - 鏄剧ず鍙傛暟璇︽儏鎶藉眽
+    rowClick({ row, column }) {
+      // 濡傛灉鐐瑰嚮鐨勬槸璇锋眰鍙傛暟鎴栧搷搴斿弬鏁板垪锛屾樉绀鸿鎯呮娊灞�
+      if (column.property === 'requestParam' && row.requestParam) {
+        this.showJsonDetail(row, 'request');
+      } else if (column.property === 'responseParam' && row.responseParam) {
+        this.showJsonDetail(row, 'response');
+      }
+    },
+
+    // 鏄剧ず JSON 璇︽儏鎶藉眽
+    showJsonDetail(row, type = 'request') {
+      const content = type === 'request' ? row.requestParam : row.responseParam;
+      const title = type === 'request' ? '馃搵 璇锋眰鍙傛暟' : '馃摜 鍝嶅簲鍙傛暟';
+
+      // 鏍煎紡鍖� JSON
+      let formattedJson = '';
+      try {
+        const obj = typeof content === 'string' ? JSON.parse(content) : content;
+        formattedJson = JSON.stringify(obj, null, 2);
+      } catch (e) {
+        formattedJson = String(content);
+      }
+
+      // 鍒涘缓涓存椂瀹瑰櫒娓叉煋鎶藉眽
+      const container = document.createElement('div');
+      document.body.appendChild(container);
+
+      const app = createApp({
+        render() {
+          return h('div', [
+            h(ElDrawer, {
+              modelValue: true,
+              'onUpdate:modelValue': (val) => {
+                if (!val) {
+                  app.unmount();
+                  document.body.removeChild(container);
+                }
+              },
+              title: title,
+              size: '30%',
+              destroyOnClose: true,
+              closeOnClickModal: true
+            }, {
+              default: () => h('div', {
+                style: {
+                  height: '30%',
+                  backgroundColor: '#f5f5f5',
+                  padding: '16px',
+                  borderRadius: '4px'
+                }
+              }, [
+                h('pre', {
+                  style: {
+                    margin: '0',
+                    fontSize: '14px',
+                    lineHeight: '1.5',
+                    fontFamily: 'Consolas, Monaco, "Courier New", monospace',
+                    whiteSpace: 'pre-wrap',
+                    wordBreak: 'break-all'
+                  }
+                }, formattedJson)
+              ])
+            })
+          ]);
+        }
+      });
+
+      app.use(window.ElementPlus);
+      app.mount(container);
     }
   }
 };

--
Gitblit v1.9.3