yangyin
2024-07-15 78137be892b6810b54ba70f27c28a69a7179e603
src/components/chat/chatComponents/summaryCom/SummaryCom.vue
@@ -1,5 +1,6 @@
<template>
   <div style="width: calc(100ch - 28px)">
      <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>
@@ -22,6 +23,11 @@
            <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 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();