|
|
@ -137,8 +137,14 @@ |
|
|
|
<div class="sidebar"> |
|
|
|
<h3>换热站</h3> |
|
|
|
<el-menu :default-active="filterForm.deviceUuid" class="deviceMenu" @select="deviceSelect" @open="deviceOpen"> |
|
|
|
<el-menu-item :index="item.centerDeviceCode" v-for="item in deviceData" :key="item.centerDeviceCode"> |
|
|
|
<i class="iconfont icon-station" /> |
|
|
|
<el-menu-item |
|
|
|
:class="{ weather: item.sign === 'weather' }" |
|
|
|
:index="item.centerDeviceCode" |
|
|
|
v-for="item in deviceData" |
|
|
|
:key="item.centerDeviceCode" |
|
|
|
> |
|
|
|
<i class="iconfont icon-weather" v-if="item.sign === 'weather'" /> |
|
|
|
<i class="iconfont icon-station" v-else /> |
|
|
|
<el-tooltip class="box-item" effect="dark" :content="item.deviceName" placement="right-start"> |
|
|
|
{{ item.deviceName }} |
|
|
|
</el-tooltip> |
|
|
@ -153,6 +159,12 @@ |
|
|
|
<div class="item" v-for="(item, index) in mainInfoList" :key="index"> |
|
|
|
<div class="name"><i :style="`background-color:${colors[index]}`" />{{ item.name }}</div> |
|
|
|
<div class="average">平均值 : {{ item.average }} {{ item.paramUnit }}</div> |
|
|
|
<div class="average" v-if="filterForm.deviceUuid === 'weatherDataChart'"> |
|
|
|
最大温度 : {{ item.max }} {{ item.paramUnit }} |
|
|
|
</div> |
|
|
|
<div class="average" v-if="filterForm.deviceUuid === 'weatherDataChart'"> |
|
|
|
最小温度 : {{ item.min }} {{ item.paramUnit }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -170,7 +182,15 @@ const stackedRef: Ref<HTMLElement | any> = ref(null); |
|
|
|
import type { FormInstance, FormRules } from 'element-plus'; |
|
|
|
import { ReturnDownBack } from '@vicons/ionicons5'; |
|
|
|
|
|
|
|
import { getAllDevices, getDevices, getClass, getParams, getPortions, getDeviceInfos } from '@/api/device/index'; |
|
|
|
import { |
|
|
|
getAllDevices, |
|
|
|
getDevices, |
|
|
|
getClass, |
|
|
|
getParams, |
|
|
|
getPortions, |
|
|
|
getDeviceInfos, |
|
|
|
weatherHoursList |
|
|
|
} from '@/api/device/index'; |
|
|
|
import { partitionVo, classVo, parameterVo, seriesVo, mainInfoVo } from '@/api/device/types'; |
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
@ -252,6 +272,7 @@ const resetInit = { |
|
|
|
export interface deviceVo { |
|
|
|
centerDeviceCode: string; |
|
|
|
deviceName: string; |
|
|
|
sign: string; |
|
|
|
} |
|
|
|
const colors = ['#5470c6', '#91cc75', '#fac858', '#1a94bc', '#f26b1f', '#5bae23']; |
|
|
|
const deviceData = ref<deviceVo[]>(); |
|
|
@ -639,7 +660,11 @@ const deviceSelect = (key: string, keyPath: string[], item: object) => { |
|
|
|
//点击换热站列表 |
|
|
|
console.log(key, keyPath, item); |
|
|
|
filterForm.deviceUuid = key; |
|
|
|
if (key === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
|
verifyInfo(); |
|
|
|
} |
|
|
|
}; |
|
|
|
const deviceOpen = (key: string, keyPath: string[]) => { |
|
|
|
console.log(key, keyPath); |
|
|
@ -709,7 +734,11 @@ function keyClick(res: string) { |
|
|
|
function showZeroChange() { |
|
|
|
//是否显示0值 |
|
|
|
filterForm.showZero = !filterForm.showZero; |
|
|
|
getDeviceInfo(); |
|
|
|
if (filterForm.deviceUuid === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
|
verifyInfo(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function getDevice() { |
|
|
@ -758,6 +787,38 @@ function getDeviceInfo() { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function getweatherHoursList() { |
|
|
|
//获取天气数据图表折线图数据 |
|
|
|
if (filterForm.deviceUuid === '') { |
|
|
|
ElMessage({ |
|
|
|
message: '请选择换热站', |
|
|
|
type: 'warning' |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (filterForm.startTime === '') { |
|
|
|
ElMessage({ |
|
|
|
message: '请选择起始时间', |
|
|
|
type: 'warning' |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
const params = filterForm; |
|
|
|
params.startTime = searchForm.startTime; |
|
|
|
params.step = searchForm.step; |
|
|
|
params.stepType = searchForm.stepType; |
|
|
|
params.queryType = 1; |
|
|
|
weatherHoursList(params).then((res: any) => { |
|
|
|
if (res.code === 200) { |
|
|
|
mainInfoList.value = res.data.mainInfos; |
|
|
|
if (res.data.additionalInfo != null) { |
|
|
|
currentEndTime.value = res.data.additionalInfo.endTime; |
|
|
|
} |
|
|
|
init(res.data); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
const debounceClick = debounce(() => { |
|
|
|
getDeviceInfoss(); |
|
|
|
}, 360000); |
|
|
@ -893,8 +954,12 @@ function dateChange(res: any) { |
|
|
|
} else { |
|
|
|
searchForm.startTime = res + ' ' + searchForm.time; |
|
|
|
filterForm.startTime = res + ' ' + searchForm.time; |
|
|
|
if (filterForm.deviceUuid === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
|
verifyInfo(); |
|
|
|
// console.log('date--', filterForm.startTime); |
|
|
|
} |
|
|
|
// console.log('date--', filterForm.deviceUuid); |
|
|
|
} |
|
|
|
} |
|
|
|
function timeChange(res: any) { |
|
|
@ -906,8 +971,12 @@ function timeChange(res: any) { |
|
|
|
// console.log('time--', res, searchForm.time); |
|
|
|
searchForm.startTime = searchForm.date + ' ' + res; |
|
|
|
filterForm.startTime = searchForm.date + ' ' + res; |
|
|
|
if (filterForm.deviceUuid === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
|
verifyInfo(); |
|
|
|
// console.log('time--', filterForm.startTime); |
|
|
|
} |
|
|
|
// console.log('time--', filterForm.deviceUuid); |
|
|
|
} |
|
|
|
} |
|
|
|
function stepChange(num: any) { |
|
|
|