This commit is contained in:
chengdandan 2023-04-19 17:50:15 +08:00
commit 83c46fe83f
3 changed files with 241 additions and 199 deletions

View File

@ -13,3 +13,15 @@ export const GetLevelAlarm = (params) => {
params
})
};
//获取昨天、今天报警数量
export const getSecurityAlarmCount = (params) => {
return axios.get('api/GetSecurityAlarmCount', {
params
})
};
//获取报警统计接口
export const getAlarmStatistics = (params) => {
return axios.get('api/GetAlarmStatistics', {
params
})
};

View File

@ -242,7 +242,7 @@
</template>
<script>
import { GetLevelAlarm } from "../api/index";
import { GetLevelAlarm, getAlarmStatistics } from "../api/index";
export default {
data() {
return {
@ -377,7 +377,7 @@ export default {
setTimeout(() => {
this.cameraList = camera;
}, 1000);
this.warnSelect(0)
this.warnSelect(0);
},
methods: {
//
@ -444,6 +444,15 @@ export default {
},
//
warningOne() {
let data = [];
let dataX = []
getAlarmStatistics({
Type: "消防",
}).then((res) => {
res.data.data.forEach((item, index) => {
data.push(item.Count);
dataX.push(item.Name)
});
var myChart = this.$echarts.init(document.getElementById("warningOne"));
let option = {
legend: {
@ -475,7 +484,7 @@ export default {
top: "17%",
},
xAxis: {
data: ["温感", "烟感", "手动报警"],
data: dataX,
axisLine: {
show: true,
lineStyle: {
@ -557,14 +566,24 @@ export default {
position: "inside",
},
},
data: [90, 94, 98],
data: data,
},
],
};
myChart.setOption(option);
});
},
//
warningTwo() {
let data = [];
let dataX = []
getAlarmStatistics({
Type: "设备",
}).then((res) => {
res.data.data.forEach((item, index) => {
data.push(item.Count);
dataX.push(item.Name)
});
var myChart = this.$echarts.init(document.getElementById("warningTwo"));
let option = {
legend: {
@ -596,7 +615,7 @@ export default {
top: "17%",
},
xAxis: {
data: ["空调", "照明", "电梯", "太阳灯"],
data: dataX,
axisLine: {
show: true,
lineStyle: {
@ -678,11 +697,12 @@ export default {
position: "inside",
},
},
data: [90, 100, 98, 97],
data: data,
},
],
};
myChart.setOption(option);
});
},
maintenanceLeft() {
var myChart = this.$echarts.init(

View File

@ -147,7 +147,7 @@
</template>
<script>
import { GetLevelAlarm } from "../api/index";
import { GetLevelAlarm , getSecurityAlarmCount} from "../api/index";
export default {
name: "security",
data() {
@ -261,8 +261,17 @@ export default {
this.getFireWarnList()
//
this.getPoliceList()
//
this.getAlarmCount()
},
methods: {
//
getAlarmCount(){
getSecurityAlarmCount().then((res)=>{
this.securityList[4].count = res.data.data.TodayCount
this.securityList[5].count = res.data.data.YesterdayCount
})
},
videoChange(index) {
this.warnCameraList.forEach((item, i) => {
item.icon = require("../assets/images/anFang/video.png");
@ -321,6 +330,7 @@ export default {
});
});
},
},
watch: {},
components: {},