| | |
| | | @mouseleave="valueMouseLeave" |
| | | @click="emit('itemClick', item, row)" |
| | | > |
| | | {{ item[type]?.['OVALUE'] }} |
| | | {{ row.unit ? `${item[type]?.['OVALUE']} ${row.unit}` : item[type]?.['OVALUE'] }} |
| | | </span> |
| | | </div> |
| | | <div |
| | |
| | | </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> |
| | |
| | | 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, |
| | |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | reportIndex:{ |
| | | reportIndex: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | |
| | | 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 + ''; |
| | |
| | | } |
| | | : axisLabelFormatter; |
| | | |
| | | |
| | | |
| | | const tooltipValueFormatter = (value) => { |
| | | const realValue = originChartType === ChartTypeEnum.Score ? scoreMap[value] : value; |
| | | return realValue + (props.data.unit ? ` ${props.data.unit}` : ''); |
| | |
| | | return `${name}(${props.data.unit})`; |
| | | } |
| | | return name; |
| | | } |
| | | }; |
| | | const cols = currentSeries.value.map((item, index) => ({ |
| | | title: getColName(item.name ?? `值${index + 1}`), |
| | | type: 'text', |
| | |
| | | updateCurrent(summary?.[props.summaryIndex], true); |
| | | }; |
| | | |
| | | const clearChart = () => { |
| | | chartInstance.value.setOption( |
| | | { |
| | | title: { |
| | | text: '', |
| | | }, |
| | | series: [], |
| | | }, |
| | | true |
| | | ); |
| | | }; |
| | | |
| | | defineExpose({ |
| | | drawChart, |
| | | isMultiCompare, |
| | | handleMultiCompare, |
| | | handleData, |
| | | updateAll, |
| | | |
| | | clearChart, |
| | | updateIndexSummary, |
| | | }); |
| | | </script> |
| | |
| | | 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); |
| | |
| | | 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}`; |
| | |
| | | ], |
| | | }, |
| | | }; |
| | | }else{ |
| | | } else { |
| | | res = { |
| | | json_ok: res.json_ok, |
| | | values: { |
| | |
| | | ], |
| | | }, |
| | | }; |
| | | 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) { |
| | |
| | | () => isShow.value, |
| | | (val) => { |
| | | if (!val) { |
| | | recordSetRef.value?.clearChart(); |
| | | return; |
| | | } |
| | | queryRange.value = getRecentDateRange(1).map((item) => formatDate(item)); |