wujingjing
2025-01-09 6a475521b957b2c3a68ee950704f8f1948bd6cf9
src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
@@ -100,6 +100,10 @@
      type: String,
      required: false,
   },
   tableHeight:{
      type:Number,
      default:document.body.clientHeight * 0.7,
   },
   showFilter: {
      type: Boolean,
      default: true,
@@ -108,13 +112,16 @@
      type: Boolean,
      default: false,
   },
}) as {
   data: any;
   summaryIndex: number;
   showFilter: Boolean;
};
   reportIndex:{
      type: Number,
      default: 0,
   },
   historyId: {
      type: String,
   },
});
const tableLimitHeight = props.chartHeight == undefined ? undefined : document.body.clientHeight * 0.7;
const tableLimitHeight = props.chartHeight == undefined ? undefined : props.tableHeight;
const chartLoading = ref(false);
@@ -129,6 +136,7 @@
const getVisibleParams = (data) => {
   // const visibleList = props.data?.params?.filter((item) => !item?.hide) ?? [];
   // index 作为 id
   const dataFilter =  data?.filter ?? [];
   const visibleList = (data?.filter ?? []).map((item, index) => {
      // 不修改原始地址
      item.id = index + '';
@@ -183,7 +191,6 @@
      }
   });
};
const visibleParams = ref(getVisibleParams(props.data));
const checkIsDayTime = () => {
@@ -277,12 +284,12 @@
           }
         : axisLabelFormatter;
   const tooltipValueFormatter =
      originChartType === ChartTypeEnum.Score
         ? (value) => {
               return scoreMap[value];
           }
         : undefined;
   const tooltipValueFormatter = (value) => {
      const realValue = originChartType === ChartTypeEnum.Score ? scoreMap[value] : value;
      return realValue + (props.data.unit ? ` ${props.data.unit}` : '');
   };
   const scoreYAxisOption: echarts.YAXisComponentOption = {
      min: 0,
@@ -353,7 +360,8 @@
            name: timeCol?.title,
         },
         yAxis: {
            name: valueCol?.title,
            name: props.data.unit ? `${props.data.unit}` : valueCol?.title,
            /** @description 不强制保留 */
            scale: true,
            ...(originChartType === ChartTypeEnum.Score ? scoreYAxisOption : {}),
@@ -499,7 +507,7 @@
};
const handleQueryChange = async (val: any, item: RecordSetParamsItem) => {
   if (!val) return;
   const historyId = (props as any).originData.historyId;
   const historyId = props.historyId;
   let res = null;
   // 改变原始值
@@ -517,6 +525,7 @@
         // 查询前后 agent_key 不会变
         agent_key: props.data.agent_key,
         filter_json: JSON.stringify(filterList),
         result_group_index: props.reportIndex,
      };
      res = await curveQuery(params);
      chartLoading.value = true;
@@ -690,8 +699,14 @@
      .toSorted((b, a) => {
         return b[0].localeCompare(a[0]);
      });
   const getColName = (name) => {
      if (props.data.unit) {
         return `${name}(${props.data.unit})`;
      }
      return name;
   }
   const cols = currentSeries.value.map((item, index) => ({
      title: item.name ?? `值${index + 1}`,
      title: getColName(item.name ?? `值${index + 1}`),
      type: 'text',
   }));