From 78137be892b6810b54ba70f27c28a69a7179e603 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期一, 15 七月 2024 15:59:35 +0800
Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/WI/Web.V1.0

---
 src/components/chat/chatComponents/summaryCom/SummaryCom.vue |   58 +++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/src/components/chat/chatComponents/summaryCom/SummaryCom.vue b/src/components/chat/chatComponents/summaryCom/SummaryCom.vue
index d4fecfb..19a3658 100644
--- a/src/components/chat/chatComponents/summaryCom/SummaryCom.vue
+++ b/src/components/chat/chatComponents/summaryCom/SummaryCom.vue
@@ -1,27 +1,33 @@
 <template>
 	<div style="width: calc(100ch - 28px)">
-		<template v-if="summaryList && summaryList.length > 0">
-			<div class="w-full" v-for="(item, idx) in summaryList" :key="idx">
-				<h3>{{ item.title }}</h3>
-				<el-table ref="tableRefList" class="w-full" :data="[{}]">
-					<el-table-column v-for="(col, index) in item.values" :label="col.title" :key="index">
-						<template #default="scope">
-							{{ col?.value }}
-						</template>
-					</el-table-column>
-				</el-table>
+		<template v-if="data && data.length > 0">
+			<template v-if="summaryList && summaryList.length > 0">
+				<div class="w-full" v-for="(item, idx) in summaryList" :key="idx">
+					<h3>{{ item.title }}</h3>
+					<el-table ref="tableRefList" class="w-full" :data="[{}]">
+						<el-table-column v-for="(col, index) in item.values" :label="col.title" :key="index">
+							<template #default="scope">
+								{{ col?.value }}
+							</template>
+						</el-table-column>
+					</el-table>
+				</div>
+			</template>
+
+			<div
+				class="flex-column w-full"
+				:class="{ 'mt-10': summaryList && summaryList.length > 0 }"
+				v-if="recordSetList && recordSetList.length > 0"
+			>
+				<div class="min-h-[48rem] flex-auto w-full">
+					<div ref="chartRefList" v-for="(item, index) in recordSetList" :key="index"></div>
+				</div>
+			</div>
+			<div v-if="urlList && urlList.length > 0" class="w-full">
+				<HTMLCom data="/test"  v-for="(item, index) in urlList" :key="index"></HTMLCom>
 			</div>
 		</template>
-
-		<div
-			class="flex-column w-full"
-			:class="{ 'mt-10': summaryList && summaryList.length > 0 }"
-			v-if="recordSetList && recordSetList.length > 0"
-		>
-			<div class="min-h-[48rem] flex-auto w-full">
-				<div ref="chartRefList" v-for="(item, index) in recordSetList" :key="index"></div>
-			</div>
-		</div>
+		<div v-else class="text-red-500">{{ error }}</div>
 	</div>
 </template>
 
@@ -33,8 +39,9 @@
 import { ChartTypeEnum, chartTypeMapEchart, chartTypeMapName } from '../types';
 import { axisLabelFormatter } from '/@/utils/chart';
 import { timeDataOptionToContent } from '../common';
-
-const props = defineProps(['data']);
+import { AnswerType } from '../../model/types';
+import HTMLCom from '../htmlCom/HTMLCom.vue';
+const props = defineProps(['data', 'error']);
 
 const selectChartType = ref<ChartTypeEnum>(ChartTypeEnum.Line);
 
@@ -73,8 +80,10 @@
 	return refList;
 });
 
-const recordSetList = computed(() => props.data.filter((item) => item.type === 'recordset'));
-const summaryList = computed(() => props.data.filter((item) => item.type === 'summary'));
+const recordSetList = computed(() => props.data.filter((item) => item.type === AnswerType.RecordSet));
+const summaryList = computed(() => props.data.filter((item) => item.type === AnswerType.Summary));
+const urlList = computed(() => props.data.filter((item) => item.type === AnswerType.Url));
+
 const drawAllChart = () => {
 	chartInstanceList.map((item, index) => {
 		drawChart(item, recordSetList.value[index]);
@@ -233,7 +242,6 @@
 
 		if (!parent) {
 			return;
-		} else {
 		}
 
 		const parentBound = parent.getBoundingClientRect();

--
Gitblit v1.9.3