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

View File

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