diff --git a/ui/dasadmin/src/views/backend/WindBlower/index.vue b/ui/dasadmin/src/views/backend/WindBlower/index.vue index ee97ef71..4a218adc 100644 --- a/ui/dasadmin/src/views/backend/WindBlower/index.vue +++ b/ui/dasadmin/src/views/backend/WindBlower/index.vue @@ -153,7 +153,7 @@
-

98

+

{{ realTimeDataForSingle.iwinddirection }}

风向

@@ -248,10 +248,8 @@ - - - - + +
@@ -315,7 +313,7 @@ import { useRoute } from 'vue-router' import Overview from './overview.vue' import { TableInstance } from 'element-plus' import { dayjs } from 'element-plus' -import { getRealTimeState } from '/@/views/backend/equipment/airBlower/utils' +import { getRealTimeState, getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils' const route = useRoute() const d = new Date() @@ -349,6 +347,7 @@ const realTimeDataForSingle = ref({ igenspeed: '', ipitchangle: '', iwindspeed: '', + iwinddirection: '', }) const state: { @@ -568,7 +567,7 @@ const TrendDataForMonth = [ ] const trendChartRef = ref() -const inittrendChart = (type: 'day' | 'month' = 'day') => { +const inittrendChart = (type: 'day' | 'month') => { const currentPeriod: any = type === 'day' ? TrendDataForDay.map((item) => item.currentPeriod) : TrendDataForMonth.map((item) => item.currentPeriod) const samePeriod: any = type === 'day' ? TrendDataForDay.map((item) => item.samePeriod) : TrendDataForMonth.map((item) => item.samePeriod) @@ -677,7 +676,7 @@ const inittrendChart = (type: 'day' | 'month' = 'day') => { trendChart.setOption(option) state.charts.trendChart = trendChart } -const chartsData = [ +const temperatureChartsData: { name: string; value: string | number }[] = [ { name: '环境温度(°C)', value: 56, @@ -699,7 +698,7 @@ const initTemperatureChart = () => { const temperatureChart2 = state.charts.temperatureChart2 ?? echarts.init(temperatureChartRef2.value as unknown as HTMLElement) const temperatureChart3 = state.charts.temperatureChart3 ?? echarts.init(temperatureChartRef3.value as unknown as HTMLElement) const options = [] - for (let i = 0; i < chartsData.length; i++) { + for (let i = 0; i < temperatureChartsData.length; i++) { const option = { grid: { top: 30, @@ -718,13 +717,13 @@ const initTemperatureChart = () => { }, series: [ { - name: chartsData[i].name, - data: [chartsData[i].value], + name: temperatureChartsData[i].name, + data: [temperatureChartsData[i].value], type: 'bar', label: { show: true, align: 'center', - formatter: ['{a|{c}}', '{b|{a}}'].join('\n'), + formatter: `{a|{c}}\n{b|{a}}`, rich: { a: { color: '#333333', @@ -735,7 +734,8 @@ const initTemperatureChart = () => { fontSize: 14, }, }, - position: ['350%', '50%'], + position: 'insideBottom', + offset: [62, 0], }, itemStyle: { color: '#048bd2', @@ -1043,6 +1043,10 @@ const createRealTimeData = async () => { const realData: any = await getRealTimeData() realTimeData.value.iturbineoperationmode = getRealTimeState(realData) + temperatureChartsData[0].value = getCutDecimalsValue(realData.itempoutdoor_1sec) + temperatureChartsData[1].value = getCutDecimalsValue(realData.itempnacelle_1sec) + temperatureChartsData[2].value = getCutDecimalsValue(realData.itempoutdoor_1sec) + const overviewDatakeys: any = Object.keys(overviewData) const sigleDataKeys: any = Object.keys(realTimeDataForSingle.value) @@ -1058,7 +1062,7 @@ const createRealTimeData = async () => { ] modelList.forEach((item: any) => { const realVal = realData[item.attributeCode.toLowerCase()] - const val = realVal === 0 ? 0 : realVal ? (realVal % 1 === 0 ? realVal : Math.floor(realVal * 1000) / 1000) : '-' + const val = getCutDecimalsValue(realVal) if (sigleDataKeys.includes(item.attributeCode.toLowerCase())) { realTimeDataForSingle.value[item.attributeCode.toLowerCase()] = val === '-' ? val : val } @@ -1211,6 +1215,7 @@ const autoUpdate = () => { if (!autoUpdateTimer) { autoUpdateTimer = setInterval(() => { createRealTimeData() + initTemperatureChart() }, 2000) } } @@ -1254,12 +1259,12 @@ const getChartData = () => { } onMounted(() => { - inittrendChart() + inittrendChart(trendChartType.value) getChartData().then(() => { initpowerChart() + initTemperatureChart() }) createScroll() - initTemperatureChart() initFrequencyChart() useEventListener(window, 'resize', echartsResize) autoUpdate() diff --git a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue index d188dc94..08dd0829 100644 --- a/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue +++ b/ui/dasadmin/src/views/backend/equipment/airBlower/index.vue @@ -53,7 +53,7 @@ :data="tableData" :header-row-style="tableHaderStyle" @selectionChange="selectTable" - height="100%" + max-height="100%" >