| | |
| | | |
| | | <script setup lang="ts"> |
| | | import type * as echarts from 'echarts'; |
| | | import _ from 'lodash'; |
| | | import moment from 'moment'; |
| | | import type { PropType } from 'vue'; |
| | | import { computed, ref, shallowRef, watch } from 'vue'; |
| | |
| | | import RecordSetTable from '../recordSetTable/RecordSetTable.vue'; |
| | | import DisplayMode from './components/DisplayMode.vue'; |
| | | import YRange from './components/YRange.vue'; |
| | | import { IS_DAY_LIST } from './components/constants'; |
| | | import { DisplayModeType } from './components/types'; |
| | | import type { RecordSetParamsItem } from './types'; |
| | | import { RecordSetParamsType, recordSetMapCom, scoreMap } from './types'; |
| | |
| | | import { axisLabelFormatter } from '/@/utils/chart'; |
| | | import { deepClone } from '/@/utils/other'; |
| | | import { debounce } from '/@/utils/util'; |
| | | import { IS_DAY_LIST } from './components/constants'; |
| | | import { defaultsDeep, groupBy, random } from 'lodash-es'; |
| | | const chartRef = ref<HTMLDivElement>(null); |
| | | |
| | | const showMode = ref(DisplayModeType.Chart); |
| | |
| | | formatter: yAxisFormatter, |
| | | }, |
| | | }; |
| | | const combineOption = _.defaultsDeep( |
| | | const combineOption = defaultsDeep( |
| | | { |
| | | grid: { |
| | | bottom: 20, |
| | |
| | | nameIndex = 1; |
| | | } |
| | | nameCol = data.cols[nameIndex]; |
| | | groupedValues = _.groupBy(data.values, (item) => item[nameIndex]); |
| | | groupedValues = groupBy(data.values, (item) => item[nameIndex]); |
| | | } else if (data.chart === 'single_line') { |
| | | groupedValues = { |
| | | default: data.values, |
| | |
| | | nameIndex = 1; |
| | | } |
| | | nameCol = data.cols[nameIndex]; |
| | | groupedValues = _.groupBy(data.values, (item) => item[nameIndex]); |
| | | groupedValues = groupBy(data.values, (item) => item[nameIndex]); |
| | | } |
| | | }; |
| | | |
| | |
| | | // 只更新 value,不直接覆盖,防止丢失响应性 |
| | | // updateVisibleParams(res); |
| | | //#endregion |
| | | groupedValues = _.groupBy(values, (item) => item[nameIndex]); |
| | | groupedValues = groupBy(values, (item) => item[nameIndex]); |
| | | if (isMultiCompare.value) { |
| | | handleMultiCompare(); |
| | | } else { |
| | |
| | | const seriesData = Object.keys(cloneData).reduce((preVal, curVal, curIndex, arr) => { |
| | | const values = cloneData[curVal]; |
| | | const isMulti = arr.length > 1; |
| | | const groupByDateValues = _.groupBy(values, (item) => moment(item[timeIndex]).format('YYYY-MM-DD')); |
| | | const groupByDateValues = groupBy(values, (item) => moment(item[timeIndex]).format('YYYY-MM-DD')); |
| | | for (const key in groupByDateValues) { |
| | | if (Object.prototype.hasOwnProperty.call(groupByDateValues, key)) { |
| | | const val = groupByDateValues[key]; |
| | |
| | | watch( |
| | | () => currentSeries.value, |
| | | (val) => { |
| | | tableKey.value = _.random(0, 100000) + ''; |
| | | tableKey.value = random(0, 100000) + ''; |
| | | } |
| | | ); |
| | | |