wujingjing
2025-01-10 96279191d9fe0e80123c557f1c7dafb2e74ed195
单位支持
已修改3个文件
44 ■■■■■ 文件已修改
src/components/chat/chatComponents/summaryCom/components/deviceLastValue/MonitorContent.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSetDialog.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/chatComponents/summaryCom/components/deviceLastValue/MonitorContent.vue
@@ -30,7 +30,7 @@
                @mouseleave="valueMouseLeave"
                @click="emit('itemClick', item, row)"
            >
                {{ item[type]?.['OVALUE'] }}
                {{ row.unit ? `${item[type]?.['OVALUE']} ${row.unit}` : item[type]?.['OVALUE'] }}
            </span>
        </div>
        <div
@@ -54,7 +54,7 @@
                </div>
                <div v-if="hoverState.data?.[type] || hoverState.data?.[type] === 0" class="flex">
                    <div class="w-8">监测</div>
                    <div class="before:content-[':'] before:pr-1.5">{{ hoverState.data?.[type]?.['OVALUE'] }}</div>
                    <div class="before:content-[':'] before:pr-1.5">{{ row.unit ? `${hoverState.data?.[type]?.['OVALUE']} ${row.unit}` : hoverState.data?.[type]?.['OVALUE'] }}</div>
                </div>
                <div class="flex" v-if="hoverState.data?.OTIME">
                    <div class="w-8">时间</div>
src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
@@ -100,9 +100,9 @@
        type: String,
        required: false,
    },
    tableHeight:{
        type:Number,
        default:document.body.clientHeight * 0.7,
    tableHeight: {
        type: Number,
        default: document.body.clientHeight * 0.7,
    },
    showFilter: {
        type: Boolean,
@@ -112,7 +112,7 @@
        type: Boolean,
        default: false,
    },
    reportIndex:{
    reportIndex: {
        type: Number,
        default: 0,
    },
@@ -136,7 +136,7 @@
const getVisibleParams = (data) => {
    // const visibleList = props.data?.params?.filter((item) => !item?.hide) ?? [];
    // index 作为 id
    const dataFilter =  data?.filter ?? [];
    const dataFilter = data?.filter ?? [];
    const visibleList = (data?.filter ?? []).map((item, index) => {
        // 不修改原始地址
        item.id = index + '';
@@ -284,8 +284,6 @@
              }
            : axisLabelFormatter;
    const tooltipValueFormatter = (value) => {
        const realValue = originChartType === ChartTypeEnum.Score ? scoreMap[value] : value;
        return realValue + (props.data.unit ? ` ${props.data.unit}` : '');
@@ -704,7 +702,7 @@
            return `${name}(${props.data.unit})`;
        }
        return name;
    }
    };
    const cols = currentSeries.value.map((item, index) => ({
        title: getColName(item.name ?? `值${index + 1}`),
        type: 'text',
@@ -767,13 +765,25 @@
    updateCurrent(summary?.[props.summaryIndex], true);
};
const clearChart = () => {
    chartInstance.value.setOption(
        {
            title: {
                text: '',
            },
            series: [],
        },
        true
    );
};
defineExpose({
    drawChart,
    isMultiCompare,
    handleMultiCompare,
    handleData,
    updateAll,
    clearChart,
    updateIndexSummary,
});
</script>
src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSetDialog.vue
@@ -30,7 +30,7 @@
import { getRecentDateRange } from '/@/utils/util';
import service from '/@/utils/request';
const props = defineProps([ 'isDialog', 'height', 'metrics', 'tableHeight','metricsInfo','lastValueItem']);
const props = defineProps(['isDialog', 'height', 'metrics', 'tableHeight', 'metricsInfo', 'lastValueItem']);
// SDVAL_FULL_FLOW true 25 DEV_FLOW_W
const computedIsDialog = computed(() => props.isDialog ?? true);
@@ -67,10 +67,9 @@
const stepTime = ref('5 minutes');
const chartValues = ref(null);
const setChartData = async () => {
    let url = '';
    if (computedIsDialog.value) {
        const  otype = props.metricsInfo.id;
        const otype = props.metricsInfo.id;
        const oname = props.lastValueItem[otype]?.ONAME;
        const queryId = props.metricsInfo.query_detail_id;
        url = `chat/query_detail_values?query_id=${queryId}&otype=${otype}&oname=${oname}`;
@@ -104,7 +103,7 @@
                ],
            },
        };
    }else{
    } else {
        res = {
            json_ok: res.json_ok,
            values: {
@@ -122,9 +121,13 @@
                ],
            },
        };
        if (props.metricsInfo.unit) {
            res.values.unit = props.metricsInfo.unit;
        }
    }
    chartValues.value = res.values;
    chartValues.value.chart = 'single_line';
    nextTick(() => {
        setTimeout(() => {
            if (recordSetRef.value.isMultiCompare) {
@@ -141,6 +144,7 @@
    () => isShow.value,
    (val) => {
        if (!val) {
            recordSetRef.value?.clearChart();
            return;
        }
        queryRange.value = getRecentDateRange(1).map((item) => formatDate(item));