gerson
2024-07-25 134f812bf70a2451272d8f3cf5c4437528fc88b1
hide
已修改2个文件
27 ■■■■ 文件已修改
src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/chatComponents/summaryCom/components/recordSet/types.ts 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
@@ -1,9 +1,9 @@
<template>
    <div class="w-full">
        <div class="flex space-x-2 mb-4" v-if="data?.params && data?.params.length > 0">
        <div class="flex space-x-2 mb-4" v-if="visibleParams && visibleParams.length > 0">
            <component
                v-model="paramsValueList[index].value"
                v-for="(item, index) in data?.params"
                v-for="(item, index) in visibleParams as any"
                :key="item.id"
                :id="item.id"
                :is="recordSetMapCom[item.type]"
@@ -23,7 +23,7 @@
import type * as echarts from 'echarts';
import _ from 'lodash';
import type { PropType } from 'vue';
import { ref, watch } from 'vue';
import { computed, ref, watch } from 'vue';
import { SCATTER_SYMBOL_SIZE, chatComProps, getChatChartOption } from '../../../common';
import { useDrawChatChart } from '../../../hooks/useDrawChatChart';
import type { RecordSet, RecordSetParamsItem } from './types';
@@ -54,8 +54,9 @@
    data: RecordSet;
};
const chartLoading = ref(false);
const paramsValueList = ref(deepClone(props.data?.params));
const visibleParams = computed(()=>(props.data?.params?.filter((item) => !item?.hide) ?? []))
const paramsValueList = ref(deepClone(visibleParams.value));
let groupedValues = null;
let timeIndex = undefined;
let valueIndex = undefined;
@@ -169,7 +170,7 @@
const { chartContainerResize, chartInstance } = useDrawChatChart({ chartRef, drawChart });
// 更换列表
const changeMap = new Map<string,string>(null);
const changeMap = new Map<string, string>(null);
const handleQueryChange = async (val: string, item: RecordSetParamsItem) => {
    if (!val) return;
@@ -178,10 +179,9 @@
    let res = null;
    try {
        changeMap.set(item.id,val);
        changeMap.set(item.id, val);
        const paramsObj = {};
        for (const [key,value] of changeMap) {
        for (const [key, value] of changeMap) {
            paramsObj[key] = value;
        }
        const params = {
src/components/chat/chatComponents/summaryCom/components/recordSet/types.ts
@@ -5,24 +5,25 @@
    List = 'list',
}
export type TimestampParam = {
export type BaseParam = {
    id: string;
    title: string;
    hide?: boolean;
};
export type TimestampParam = {
    type: RecordSetParamsType.Timestamp;
    value: string;
};
} & BaseParam;
export type ListParamListItem = {
    title: string;
    value: string;
};
export type ListParam = {
    id: string;
    title: string;
    type: RecordSetParamsType.List;
    value: string;
    list: ListParamListItem[];
};
} & BaseParam;
export type RecordSetParamsItem = TimestampParam | ListParam;
export type RecordSet = {