From ab5f90ea5168fbc43582a36e53973181b25061ac Mon Sep 17 00:00:00 2001 From: fofolee Date: Tue, 14 Jan 2025 16:21:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=BB=93=E6=9E=9C=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E5=B0=86=E6=A0=91=E7=8A=B6=E7=9A=84=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=A0=BC=E5=BC=8F=E4=B8=BAJSON=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=B1=95=E7=A4=BA=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=BD=AC?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E7=9A=84=E6=8C=89=E9=92=AE=EF=BC=8C=E5=B0=86?= =?UTF-8?q?=E7=AC=A6=E5=90=88=E6=9D=A1=E4=BB=B6=E7=9A=84=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E8=BD=AC=E4=B8=BA=E8=A1=A8=E6=A0=BC=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CommandRunResult.vue | 1 + src/components/ResultArea.vue | 19 ++- src/components/popup/ResultMenu.vue | 200 ++++++++++++++++++++++++---- 3 files changed, 195 insertions(+), 25 deletions(-) diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 581d5d9..0b2f476 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -39,6 +39,7 @@ :textbtn="!enableHtml" :imagebtn="!enableHtml && isDataUrl" @showImg="showBase64Img" + @updateResult="runResult = $event" :style="{ height: headerHeight + 'px', }" diff --git a/src/components/ResultArea.vue b/src/components/ResultArea.vue index 8a3d888..2441449 100644 --- a/src/components/ResultArea.vue +++ b/src/components/ResultArea.vue @@ -22,7 +22,12 @@ v-else-if="typeof item === 'undefined'" v-text="'undefined'" /> -
+        
       
     
   
@@ -78,6 +83,10 @@ export default {
           )
         : "";
     },
+    // 判断是否是转为表格的结果,表格结果不需要换行,第二行一般包含分隔符---
+    isTable() {
+      return this.runResult?.[0]?.split("\n")?.[1]?.includes("---");
+    },
   },
   mounted() {
     this.frameInit();
@@ -135,16 +144,22 @@ export default {
 .text {
   font-family: Consolas, Monaco, "Courier New";
 }
+
 .result {
-  white-space: pre-wrap;
   word-wrap: break-word;
   max-width: 100%;
   margin: 0;
 }
+
+.result.wrapLine {
+  white-space: pre-wrap;
+}
+
 .undefined {
   color: #999;
   font-style: italic;
 }
+
 iframe {
   width: 100%;
   display: block;
diff --git a/src/components/popup/ResultMenu.vue b/src/components/popup/ResultMenu.vue
index ecc10d6..d5e20b5 100644
--- a/src/components/popup/ResultMenu.vue
+++ b/src/components/popup/ResultMenu.vue
@@ -1,13 +1,32 @@