From 34f1e65179910f3c02f0ac6813dbfefb4244d4d7 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 15 四月 2026 19:23:24 +0800
Subject: [PATCH] feat(同步服务): 添加实例同步功能并优化更新逻辑

---
 Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx b/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx
index 5b05c40..06e24fa 100644
--- a/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx
+++ b/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx
@@ -1,4 +1,8 @@
-import { h, resolveComponent } from 'vue';
+import { createApp } from 'vue';
+import { ElDrawer } from 'element-plus';
+import { JsonViewer } from 'vue3-json-viewer';
+import 'vue3-json-viewer/dist/vue3-json-viewer.css';
+
 let extension = {
   components: {
     //鍔ㄦ�佹墿鍏呯粍浠舵垨缁勪欢璺緞
@@ -20,6 +24,69 @@
     },
     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' ? '馃搵 璇锋眰鍙傛暟' : '馃摜 鍝嶅簲鍙傛暟';
+
+      // 瑙f瀽 JSON 瀵硅薄锛岃В鏋愬け璐ュ垯淇濈暀鍘熷瀛楃涓�
+      let jsonData;
+      try {
+        jsonData = typeof content === 'string' ? JSON.parse(content) : content;
+      } catch (e) {
+        jsonData = String(content);
+      }
+
+      // 鍒涘缓涓存椂瀹瑰櫒娓叉煋鎶藉眽
+      const container = document.createElement('div');
+      document.body.appendChild(container);
+
+      const app = createApp({
+        render() {
+          const onClose = (val) => {
+            if (!val) {
+              app.unmount();
+              document.body.removeChild(container);
+            }
+          };
+          return (
+            <div>
+              <ElDrawer
+                modelValue={true}
+                onUpdate:modelValue={onClose}
+                title={title}
+                size="40%"
+                destroyOnClose={true}
+                closeOnClickModal={true}
+              >
+                <JsonViewer
+                  value={jsonData}
+                  expanded={true}
+                  expandDepth={5}
+                  copyable={true}
+                  sort={false}
+                  theme="light"
+                />
+              </ElDrawer>
+            </div>
+          );
+        }
+      });
+
+      app.use(window.ElementPlus);
+      app.component('JsonViewer', JsonViewer);
+      app.mount(container);
     }
   }
 };

--
Gitblit v1.9.3