| | |
| | | }; |
| | | const { chartContainerResize, chartInstance } = useDrawChatChart({ chartRef, drawChart }); |
| | | |
| | | const updateCurrent = (res) => { |
| | | const updateCurrent = (res, isNew = false) => { |
| | | const title = res?.title; |
| | | const values = res?.values ?? []; |
| | | //#region ====================== 刷新当前 filter ====================== |
| | |
| | | if (isMultiCompare.value) { |
| | | handleMultiCompare(); |
| | | } else { |
| | | (currentSeries.value = |
| | | groupedValues && |
| | | Object.keys(groupedValues).map((item, index) => { |
| | | const values = groupedValues[item]; |
| | | return { |
| | | name: item === 'default' ? '' : item, |
| | | data: values.map((item) => [item[timeIndex], item[valueIndex]]), |
| | | }; |
| | | })), |
| | | chartInstance.value?.setOption({ |
| | | title: { |
| | | text: title, |
| | | }, |
| | | series: currentSeries.value, |
| | | }); |
| | | if (isNew) { |
| | | setNewOption(); |
| | | } else { |
| | | (currentSeries.value = |
| | | groupedValues && |
| | | Object.keys(groupedValues).map((item, index) => { |
| | | const values = groupedValues[item]; |
| | | return { |
| | | name: item === 'default' ? '' : item, |
| | | data: values.map((item) => [item[timeIndex], item[valueIndex]]), |
| | | }; |
| | | })), |
| | | chartInstance.value?.setOption({ |
| | | title: { |
| | | text: title, |
| | | }, |
| | | series: currentSeries.value, |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | const updateIndexSummary = (summary) => { |
| | | updateCurrent(summary?.[props.summaryIndex]); |
| | | updateCurrent(summary?.[props.summaryIndex],true); |
| | | }; |
| | | |
| | | defineExpose({ |