|
|
@ -183,17 +183,17 @@ |
|
|
|
<el-card class="echart" :class="{ echartHide: !searchShow }" shadow="always"> |
|
|
|
<div class="sidebar"> |
|
|
|
<h3>换热站</h3> |
|
|
|
<el-menu :default-active="filterForm.deviceUuid" class="deviceMenu" @select="deviceSelect" @open="deviceOpen"> |
|
|
|
<el-menu :default-active="filterForm.assetCode" class="deviceMenu" @select="deviceSelect" @open="deviceOpen"> |
|
|
|
<el-menu-item |
|
|
|
:class="{ weather: item.sign === 'weather' }" |
|
|
|
:index="item.centerDeviceCode" |
|
|
|
:index="item.assetCode" |
|
|
|
v-for="item in deviceData" |
|
|
|
:key="item.centerDeviceCode" |
|
|
|
:key="item.assetCode" |
|
|
|
> |
|
|
|
<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 class="box-item" effect="dark" :content="item.assetName" placement="right-start"> |
|
|
|
{{ item.assetName }} |
|
|
|
</el-tooltip> |
|
|
|
</el-menu-item> |
|
|
|
</el-menu> |
|
|
@ -206,10 +206,10 @@ |
|
|
|
<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'"> |
|
|
|
<div class="average" v-if="filterForm.assetCode === 'weatherDataChart'"> |
|
|
|
最大温度 : {{ item.max }} {{ item.paramUnit }} |
|
|
|
</div> |
|
|
|
<div class="average" v-if="filterForm.deviceUuid === 'weatherDataChart'"> |
|
|
|
<div class="average" v-if="filterForm.assetCode === 'weatherDataChart'"> |
|
|
|
最小温度 : {{ item.min }} {{ item.paramUnit }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -294,7 +294,7 @@ const filterForm = reactive({ |
|
|
|
startTime: '', |
|
|
|
step: 1, |
|
|
|
stepType: '1', |
|
|
|
deviceUuid: '', |
|
|
|
assetCode: '', |
|
|
|
paramCode: '', |
|
|
|
partion: '', |
|
|
|
showZero: true, |
|
|
@ -322,8 +322,8 @@ const resetInit = { |
|
|
|
additionalInfo: null |
|
|
|
}; |
|
|
|
export interface deviceVo { |
|
|
|
centerDeviceCode: string; |
|
|
|
deviceName: string; |
|
|
|
assetCode: string; |
|
|
|
assetName: string; |
|
|
|
sign: string; |
|
|
|
} |
|
|
|
const colors = ['#5470c6', '#91cc75', '#fac858', '#1a94bc', '#f26b1f', '#5bae23']; |
|
|
@ -722,7 +722,7 @@ onUnmounted(() => { |
|
|
|
const deviceSelect = (key: string, keyPath: string[], item: object) => { |
|
|
|
//点击换热站列表 |
|
|
|
console.log(key, keyPath, item); |
|
|
|
filterForm.deviceUuid = key; |
|
|
|
filterForm.assetCode = key; |
|
|
|
if (key === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
@ -731,7 +731,7 @@ const deviceSelect = (key: string, keyPath: string[], item: object) => { |
|
|
|
}; |
|
|
|
const deviceOpen = (key: string, keyPath: string[]) => { |
|
|
|
console.log(key, keyPath); |
|
|
|
filterForm.deviceUuid = key; |
|
|
|
filterForm.assetCode = key; |
|
|
|
}; |
|
|
|
|
|
|
|
function lineClick() { |
|
|
@ -766,26 +766,26 @@ function keyClick(res: string) { |
|
|
|
type: 'warning' |
|
|
|
}); |
|
|
|
} else { |
|
|
|
const device = filterForm.deviceUuid; |
|
|
|
const device = filterForm.assetCode; |
|
|
|
const deviceDataValue = deviceData.value; |
|
|
|
// console.log('已选设备:', filterForm.deviceUuid); |
|
|
|
// console.log('已选设备:', filterForm.assetCode); |
|
|
|
if (deviceDataValue?.length != 0) { |
|
|
|
deviceDataValue?.map((item: deviceVo, index: number) => { |
|
|
|
// console.log('遍历设备:', item, index); |
|
|
|
if (res === 'ArrowUp') { |
|
|
|
//上一个 |
|
|
|
if (device === item.centerDeviceCode && index != 0) { |
|
|
|
filterForm.deviceUuid = deviceDataValue[index - 1].centerDeviceCode; |
|
|
|
// filterForm.deviceUuid = filterForm.deviceUuid; |
|
|
|
// console.log('当前设备:', filterForm.deviceUuid); |
|
|
|
if (device === item.assetCode && index != 0) { |
|
|
|
filterForm.assetCode = deviceDataValue[index - 1].assetCode; |
|
|
|
// filterForm.assetCode = filterForm.assetCode; |
|
|
|
// console.log('当前设备:', filterForm.assetCode); |
|
|
|
} |
|
|
|
} else if (res === 'ArrowDown') { |
|
|
|
//下一个 |
|
|
|
if (device === item.centerDeviceCode && index + 1 != deviceDataValue?.length) { |
|
|
|
// console.log('当前设备:', item.deviceName, index); |
|
|
|
filterForm.deviceUuid = deviceDataValue[index + 1].centerDeviceCode; |
|
|
|
// filterForm.deviceUuid = filterForm.deviceUuid; |
|
|
|
// console.log('当前设备:', filterForm.deviceUuid); |
|
|
|
if (device === item.assetCode && index + 1 != deviceDataValue?.length) { |
|
|
|
// console.log('当前设备:', item.assetName, index); |
|
|
|
filterForm.assetCode = deviceDataValue[index + 1].assetCode; |
|
|
|
// filterForm.assetCode = filterForm.assetCode; |
|
|
|
// console.log('当前设备:', filterForm.assetCode); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -797,7 +797,7 @@ function keyClick(res: string) { |
|
|
|
function showZeroChange() { |
|
|
|
//是否显示0值 |
|
|
|
filterForm.showZero = !filterForm.showZero; |
|
|
|
if (filterForm.deviceUuid === 'weatherDataChart') { |
|
|
|
if (filterForm.assetCode === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
|
verifyInfo(); |
|
|
@ -852,7 +852,7 @@ function getDeviceInfo() { |
|
|
|
|
|
|
|
function getweatherHoursList() { |
|
|
|
//获取天气数据图表折线图数据 |
|
|
|
if (filterForm.deviceUuid === '') { |
|
|
|
if (filterForm.assetCode === '') { |
|
|
|
ElMessage({ |
|
|
|
message: '请选择换热站', |
|
|
|
type: 'warning' |
|
|
@ -1021,7 +1021,7 @@ function init(data: any) { |
|
|
|
// //设备选择确认 |
|
|
|
// // searchForm.parameter = []; |
|
|
|
// // multipleLimit.value = res.length <= 1 ? 0 : 1; |
|
|
|
// filterForm.deviceUuid = res; |
|
|
|
// filterForm.assetCode = res; |
|
|
|
// } |
|
|
|
function dateChange(res: any) { |
|
|
|
//日期选择 |
|
|
@ -1032,12 +1032,12 @@ function dateChange(res: any) { |
|
|
|
} else { |
|
|
|
searchForm.startTime = res + ' ' + searchForm.time; |
|
|
|
filterForm.startTime = res + ' ' + searchForm.time; |
|
|
|
if (filterForm.deviceUuid === 'weatherDataChart') { |
|
|
|
if (filterForm.assetCode === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
|
verifyInfo(); |
|
|
|
} |
|
|
|
// console.log('date--', filterForm.deviceUuid); |
|
|
|
// console.log('date--', filterForm.assetCode); |
|
|
|
} |
|
|
|
} |
|
|
|
function timeChange(res: any) { |
|
|
@ -1049,12 +1049,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') { |
|
|
|
if (filterForm.assetCode === 'weatherDataChart') { |
|
|
|
getweatherHoursList(); |
|
|
|
} else { |
|
|
|
verifyInfo(); |
|
|
|
} |
|
|
|
// console.log('time--', filterForm.deviceUuid); |
|
|
|
// console.log('time--', filterForm.assetCode); |
|
|
|
} |
|
|
|
} |
|
|
|
function stepChange(num: any) { |
|
|
@ -1105,7 +1105,7 @@ const stepClickDebounce = debounce(() => { |
|
|
|
}, 800); |
|
|
|
|
|
|
|
function verifyInfo() { |
|
|
|
if (filterForm.deviceUuid === '') { |
|
|
|
if (filterForm.assetCode === '') { |
|
|
|
ElMessage({ |
|
|
|
message: '请选择换热站', |
|
|
|
type: 'warning' |
|
|
@ -1132,7 +1132,7 @@ function verifyInfo() { |
|
|
|
function searchClick(type: string) { |
|
|
|
//显示/隐藏筛选栏 |
|
|
|
searchShow.value = type === 'hide' ? false : true; |
|
|
|
if (filterForm.deviceUuid === '') { |
|
|
|
if (filterForm.assetCode === '') { |
|
|
|
} else if (filterForm.startTime === '') { |
|
|
|
} else if (filterForm.step === null) { |
|
|
|
} else if (filterForm.paramCode === '') { |
|
|
@ -1158,7 +1158,7 @@ function searchClick(type: string) { |
|
|
|
// if (!formEl) return; |
|
|
|
// formEl.resetFields(); |
|
|
|
// filterForm.startTime = ''; |
|
|
|
// filterForm.deviceUuid = ''; |
|
|
|
// filterForm.assetCode = ''; |
|
|
|
// filterForm.paramCode = ''; |
|
|
|
// filterForm.partion = ''; |
|
|
|
// init(resetInit); |
|
|
|