|
@@ -1,23 +1,85 @@
|
|
|
<template>
|
|
|
- <el-table :data="tableData" border style="width: 100%">
|
|
|
- <el-table-column label="No." type="index" :width="70" align="left"></el-table-column>
|
|
|
- <el-table-column prop="date" label="告警名称"> </el-table-column>
|
|
|
- <el-table-column prop="date" label="告警时间" width="180"> </el-table-column>
|
|
|
- <el-table-column prop="date" label="告警地址" > </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <zz-table
|
|
|
+ :settings="{ showIndex: true, stripe: true }"
|
|
|
+ :cols="cols"
|
|
|
+ :data="mixins_list"
|
|
|
+ :pageset="mixins_pageset"
|
|
|
+ @page-change="pageChange"
|
|
|
+ ></zz-table>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import list from '@/utils/list.js';
|
|
|
+
|
|
|
export default {
|
|
|
+ mixins: [list],
|
|
|
props: ['params'],
|
|
|
data() {
|
|
|
return {
|
|
|
- tableData:[]
|
|
|
+ tableData: [],
|
|
|
+ cols: [
|
|
|
+ {
|
|
|
+ label: '告警名称',
|
|
|
+ prop: 'name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '告警时间',
|
|
|
+ prop: 'warningDate',
|
|
|
+ width: '150'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '告警地址',
|
|
|
+ prop: 'address',
|
|
|
+ width: '150'
|
|
|
+ }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- getData() {
|
|
|
+ getHydropower() {
|
|
|
this.$http
|
|
|
- .get('/sc-energy/device/detail', { deviceId: this.params.row.deviceId })
|
|
|
+ .post('/sc-community/alarmHydropower/getWarningDetails', { pageNum: 1, pageSize: 15, deviceId: this.params.row.deviceId })
|
|
|
+ .then(({ status, data: { list = [], total = 0 }, msg }) => {
|
|
|
+ if (0 === status) {
|
|
|
+ this.mixins_list = list;
|
|
|
+ this.mixins_pageset.total = total * 1;
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ getCard() {
|
|
|
+ // this.$http
|
|
|
+ // .get('/sc-community/dahuaDevice/getAlarmList', { deviceId: this.params.row.deviceId })
|
|
|
+ // .then(({ status, data, msg }) => {
|
|
|
+ // if (status == 0) {
|
|
|
+ // this.formData = data;
|
|
|
+ // console.log(data);
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(msg);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {});
|
|
|
+ },
|
|
|
+ getAccessControl() {
|
|
|
+ this.$http
|
|
|
+ .get('/sc-gate-web/alarm/page', { deviceNo: this.params.deviceNo })
|
|
|
+ .then(({ status, data: { list = [], total = 0 }, msg }) => {
|
|
|
+ this.cols[0].prop = 'alarmContent';
|
|
|
+ this.cols[1].prop = 'createDate';
|
|
|
+
|
|
|
+ if (0 === status) {
|
|
|
+ this.mixins_list = list;
|
|
|
+ this.mixins_pageset.total = total * 1;
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ getCamera() {
|
|
|
+ this.$http
|
|
|
+ .get('/sc-community/dahuaDevice/getAlarmList', { deviceId: this.params.row.deviceId })
|
|
|
.then(({ status, data, msg }) => {
|
|
|
if (status == 0) {
|
|
|
this.formData = data;
|
|
@@ -28,26 +90,27 @@ export default {
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
- typeStatus(val) {
|
|
|
- switch (val) {
|
|
|
- case 1:
|
|
|
- return '正常';
|
|
|
- case 2:
|
|
|
- return '告警';
|
|
|
- case 3:
|
|
|
- return '离线';
|
|
|
- case 4:
|
|
|
- return '未启用';
|
|
|
- case 5:
|
|
|
- return '报废';
|
|
|
- default:
|
|
|
- return '--';
|
|
|
+ submit() {
|
|
|
+ window.open('http://114.135.61.186:21020/sc-operation/workOrders/index?showPop');
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ const { deviceType } = this.params.row;
|
|
|
+ if (deviceType == 1) {
|
|
|
+ this.getCamera();
|
|
|
+ } else if (deviceType == 2) {
|
|
|
+ //门禁
|
|
|
+ this.getAccessControl();
|
|
|
+ } else if (deviceType == 3) {
|
|
|
+ //停车
|
|
|
+ this.getCard();
|
|
|
+ } else if (deviceType == 4 || deviceType == 5) {
|
|
|
+ //水电告警
|
|
|
+ this.getHydropower();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getData();
|
|
|
- // console.log(this.params.row);
|
|
|
+ this.getList();
|
|
|
}
|
|
|
};
|
|
|
</script>
|