|
|
@ -9,14 +9,22 @@ |
|
|
|
</ElTabPane> |
|
|
|
<ElTabPane label="设备参数" name="second"> |
|
|
|
<div class="content-second" style="height: 185px"> |
|
|
|
<RadioGroup v-model="roadType" :options="roadTypeList" @input="changeRadio" /> |
|
|
|
<RadioGroup |
|
|
|
v-model="roadType" |
|
|
|
:options="roadTypeList" |
|
|
|
@input="changeRadio" |
|
|
|
/> |
|
|
|
<span>当前车流量: {{ carNum }}辆</span> |
|
|
|
<LineChartForTraffic style="flex: 1" v-if="isShowCar && activeName === 'second'" :xData="xData" |
|
|
|
:yData="yData" /> |
|
|
|
<LineChartForTraffic |
|
|
|
style="flex: 1" |
|
|
|
v-if="isShowCar && activeName === 'second'" |
|
|
|
:xData="xData" |
|
|
|
:yData="yData" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</ElTabPane> |
|
|
|
<ElTabPane label="在线率统计" name="third"> |
|
|
|
<LineChart v-if="activeName === 'third'" :productId="dialogData.productId" /> |
|
|
|
<LineChart v-if="activeName === 'third'" :productId="dialogData.id" /> |
|
|
|
</ElTabPane> |
|
|
|
</ElTabs> |
|
|
|
</div> |
|
|
@ -40,7 +48,7 @@ import { dialogDelayVisible } from "./../mixin"; |
|
|
|
import request from "@/utils/request"; |
|
|
|
import { Message } from "element-ui"; |
|
|
|
import RadioGroup from "@screen/components/FormConfig/components/RadioGroup/index.vue"; |
|
|
|
import moment from 'moment/moment'; |
|
|
|
import moment from "moment/moment"; |
|
|
|
|
|
|
|
// 广播发布 |
|
|
|
export default { |
|
|
@ -72,8 +80,8 @@ export default { |
|
|
|
}, |
|
|
|
carNum: 0, |
|
|
|
objectValue: { |
|
|
|
'1': 0, |
|
|
|
'3': 0 |
|
|
|
1: 0, |
|
|
|
3: 0, |
|
|
|
}, |
|
|
|
xData: [], |
|
|
|
yData: [], |
|
|
@ -150,7 +158,7 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
changeRadio(value) { |
|
|
|
this.carNum = this.objectValue[value + '']; |
|
|
|
this.carNum = this.objectValue[value + ""]; |
|
|
|
this.isShowCar = false; |
|
|
|
if (value == 3) { |
|
|
|
this.yData = this.jnYData; |
|
|
@ -162,7 +170,7 @@ export default { |
|
|
|
// console.log('rdata', this.jnYData); |
|
|
|
setTimeout(() => { |
|
|
|
this.isShowCar = true; |
|
|
|
}, 1000) |
|
|
|
}, 1000); |
|
|
|
}, |
|
|
|
getPropertiesHistory(deviceId) { |
|
|
|
this.xData = []; |
|
|
@ -177,17 +185,17 @@ export default { |
|
|
|
}).then((result) => { |
|
|
|
if (result.code != 200) return Message.error(result?.msg); |
|
|
|
this.objectValue = result.data[result.data.length - 1]; |
|
|
|
this.carNum = result.data[result.data.length - 1]['1']; |
|
|
|
result.data.forEach(it => { |
|
|
|
this.carNum = result.data[result.data.length - 1]["1"]; |
|
|
|
result.data.forEach((it) => { |
|
|
|
this.xData.push(moment(it.timestamp).format("HH:mm")); |
|
|
|
this.hzYData.push(it['1']); |
|
|
|
this.jnYData.push(it['3']); |
|
|
|
this.hzYData.push(it["1"]); |
|
|
|
this.jnYData.push(it["3"]); |
|
|
|
this.yData = this.hzYData; |
|
|
|
}) |
|
|
|
}); |
|
|
|
this.isShowCar = true; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
@ -240,7 +248,7 @@ div.switcher { |
|
|
|
align-items: center; |
|
|
|
justify-content: end; |
|
|
|
|
|
|
|
>div { |
|
|
|
> div { |
|
|
|
font-size: 16px; |
|
|
|
padding: 6px 12px; |
|
|
|
} |
|
|
|