From b698a2085fd090e90abedb1e91266ec496574b29 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 16 四月 2026 23:31:35 +0800
Subject: [PATCH] 1
---
Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx | 70 ++++++++++++++++++++++++++++++++++
1 files changed, 69 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..43c918c 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,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,70 @@
},
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="30%"
+ 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