소스 검색

JSON预览

CzRger 3 주 전
부모
커밋
a6a1062456
1개의 변경된 파일77개의 추가작업 그리고 31개의 파일을 삭제
  1. 77 31
      src/views/chat/answer/index.vue

+ 77 - 31
src/views/chat/answer/index.vue

@@ -114,12 +114,12 @@
                         wf.status ? (wf.__expend = !wf.__expend) : undefined
                       "
                     >
-                      <!--                      <template v-if="wf.__expend">-->
-                      <!--                        <SvgIcon name="czr_arrow" size="8" rotate="90" />-->
-                      <!--                      </template>-->
-                      <!--                      <template v-else>-->
-                      <!--                        <SvgIcon name="czr_arrow" size="8" />-->
-                      <!--                      </template>-->
+                      <template v-if="wf.__expend">
+                        <SvgIcon name="czr_arrow" size="8" rotate="90" />
+                      </template>
+                      <template v-else>
+                        <SvgIcon name="czr_arrow" size="8" />
+                      </template>
                       <img
                         :src="nodeSources[wf.nodeType].icon"
                         class="ml-1 size-4"
@@ -156,31 +156,77 @@
                         </template>
                       </div>
                     </div>
-                    <!--                    <div v-if="wf.__expend" class="mt-1 flex flex-col gap-1">-->
-                    <!--                      <div-->
-                    <!--                        v-if="wf.error"-->
-                    <!--                        class="rounded-sm border-1 border-[var(&#45;&#45;czr-error-color)] p-1 text-[var(&#45;&#45;czr-error-color)] shadow"-->
-                    <!--                      >-->
-                    <!--                        <div>错误信息</div>-->
-                    <!--                        <div class="mt-1 break-words">-->
-                    <!--                          {{ wf.error }}-->
-                    <!--                        </div>-->
-                    <!--                      </div>-->
-                    <!--                      <div-->
-                    <!--                        v-if="wf.inputData"-->
-                    <!--                        class="rounded-sm border-1 border-[#000000]/5 p-1 shadow"-->
-                    <!--                      >-->
-                    <!--                        <div>输入</div>-->
-                    <!--                        <div class="mt-1">{{ wf.inputData }}</div>-->
-                    <!--                      </div>-->
-                    <!--                      <div-->
-                    <!--                        v-if="wf.outputData"-->
-                    <!--                        class="rounded-sm border-1 border-[#000000]/5 p-1 shadow"-->
-                    <!--                      >-->
-                    <!--                        <div>输出</div>-->
-                    <!--                        <div class="mt-1">{{ wf.outputData }}</div>-->
-                    <!--                      </div>-->
-                    <!--                    </div>-->
+                    <div v-if="wf.__expend" class="mt-1 flex flex-col gap-1">
+                      <div
+                        v-if="wf.error"
+                        class="rounded-sm border-1 border-[var(--czr-error-color)]/10 shadow"
+                      >
+                        <div
+                          class="flex items-center justify-between rounded-t-sm bg-[#000000]/10 p-1 text-xs"
+                        >
+                          错误信息
+                          <el-tooltip content="复制" placement="top">
+                            <SvgIcon
+                              class="__hover"
+                              name="copy"
+                              size="14"
+                              @click="onCopy(JSON.stringify(wf.inputData))"
+                            />
+                          </el-tooltip>
+                        </div>
+                        <div
+                          class="bg-[var(--czr-error-color)]/10 p-1 pt-1 break-words"
+                        >
+                          {{ wf.error }}
+                        </div>
+                      </div>
+                      <div
+                        v-if="wf.inputData"
+                        class="rounded-sm border-1 border-[#000000]/5 shadow"
+                      >
+                        <div
+                          class="flex items-center justify-between rounded-t-sm bg-[#000000]/10 p-1 text-xs"
+                        >
+                          输入
+                          <el-tooltip content="复制" placement="top">
+                            <SvgIcon
+                              class="__hover"
+                              name="copy"
+                              size="14"
+                              @click="onCopy(JSON.stringify(wf.inputData))"
+                            />
+                          </el-tooltip>
+                        </div>
+                        <pre
+                          class="mt-1 p-1 break-words"
+                          style="margin-bottom: 0"
+                          >{{ wf.inputData }}</pre
+                        >
+                      </div>
+                      <div
+                        v-if="wf.outputData"
+                        class="rounded-sm border-1 border-[#000000]/5 shadow"
+                      >
+                        <div
+                          class="flex items-center justify-between rounded-t-sm bg-[#000000]/10 p-1 text-xs"
+                        >
+                          输出
+                          <el-tooltip content="复制" placement="top">
+                            <SvgIcon
+                              class="__hover"
+                              name="copy"
+                              size="14"
+                              @click="onCopy(JSON.stringify(wf.outputData))"
+                            />
+                          </el-tooltip>
+                        </div>
+                        <pre
+                          class="mt-1 p-1 break-words"
+                          style="margin-bottom: 0"
+                          >{{ wf.outputData }}</pre
+                        >
+                      </div>
+                    </div>
                   </div>
                 </template>
               </div>