湖里大屏(环境管理):实时数据 今日报警模块 接口对接

This commit is contained in:
骆乐 2022-08-10 15:33:25 +08:00
parent 2c32007920
commit 5d9e24ae9b
3 changed files with 57 additions and 5 deletions

View File

@ -8,6 +8,7 @@
<script>
import echarts from 'echarts4';
// import { getRealTimeDustNoiseDataApi } from "@/assets/js/api/environmentManage";
export default {
props: {
@ -72,8 +73,43 @@ export default {
},
mounted(){
this.createCenterChart();
// this.getRealTimeDustNoiseData();
},
methods:{
//
// getRealTimeDustNoiseData() {
// let data = {
// deviceId: this.currentDevDetail.deviceId,
// projectSn: this.projectSn,
// };
// console.log(data);
// getRealTimeDustNoiseDataApi(data).then((res) => {
// console.log(res);
// if (res.code == 200) {
// console.log(res.result)
// if (res.result) {
// this.plantCap = res.result;
// } else {
// this.plantCap = {
// crc: "--",
// humidity: "--",
// noise: "--",
// plateHumidity: "--",
// plateTemperature: "--",
// pm10: "--",
// pm25: "--",
// pressure: "--",
// temperature: "--",
// tsp: "--",
// voltage: "--",
// winddirectionName: "--",
// windspeed: "--",
// };
// }
// // this.createCenterChart();
// }
// });
// },
//--
createCenterChart() {
let centerChart = echarts.init(this.$refs.centerChart);

View File

@ -8,6 +8,7 @@
<script>
import echarts from "echarts4";
import {selectEnvironmentAlarmCountTotalApi} from "@/assets/js/api/dataBoard"
export default {
props: {
@ -18,13 +19,26 @@ export default {
},
data() {
return {
alarmData:{
totalAlarm:'',
noiseNum:'',
pm25Num:'',
}
};
},
mounted(){
this.initMyChart();
this.countTotal();
},
methods:{
countTotal(){
selectEnvironmentAlarmCountTotalApi({
sn: this.$store.state.projectSn,
}).then((res) => {
this.alarmData=res.result
// console.log('',res.result);
this.initMyChart();
});
},
initMyChart() {
const myChart = echarts.init(this.$refs.myChart);
const option = {
@ -32,7 +46,7 @@ export default {
textAlign: 'center',
x: '29%',
y: '38%',
text:'27',
text:this.alarmData.totalAlarm,
textStyle: {
fontSize: 20,
fontWeight: 'normal',
@ -91,8 +105,8 @@ export default {
show: false,
},
data: [
{ value: 13, name: "扬尘噪声报警 : 13" },
{ value: 14, name: "PM2.5超标报警 : 14" },
{ value: this.alarmData.noiseNum, name: `扬尘噪声报警 : ${this.alarmData.noiseNum}`},
{ value: this.alarmData.pm25Num, name: `PM2.5超标报警 : ${this.alarmData.pm25Num}`},
],
},
],

View File

@ -372,6 +372,7 @@ export default {
let json = this.addEditForm;
json.inspectUser = json.inspectUser.join(",");
json.createUser = this.$store.state.userInfo.userId;
console.log('--------新增参数',json)
addinspectTaskRecordApi(json).then((result) => {
this.$message.success("添加成功!");
this.checkDaterange = [];
@ -387,6 +388,7 @@ export default {
});
},
loadList() {
console.log('------查询条件',this.searchForm)
getinspectTaskRecordListApi(this.searchForm).then((result) => {
this.rocordList = result.result.records;
this.pageTotal = result.result.total;