You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

361 lines
10 KiB
Vue

2 years ago
<template>
2 years ago
<div class="alarmHandBox">
<div class="searchMain">
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压等级">
2 years ago
<el-select v-model="formdata.dyId" @change="getSearchxl">
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称">
2 years ago
<el-select v-model="formdata.lineId" @change="getSearchgt">
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称">
2 years ago
<el-select v-model="formdata.towerId">
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="日期">
<el-date-picker
v-model="formdata.timeVal"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="timestamp"
></el-date-picker>
</el-form-item>
2 years ago
<el-form-item label="告警原因">
2 years ago
<el-select v-model="formdata.warnCause">
2 years ago
<el-option
v-for="item in gjOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
2 years ago
</div>
2 years ago
<div class="alarmContain" v-loading="loading">
<div class="alarmTable">
<el-table
ref="multipleTable"
:data="tableData"
stripe
border
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
height="calc(100% - 40px)"
@row-click="handleRowClick"
2 years ago
highlight-current-row
2 years ago
>
<el-table-column min-width="45" label="序号">
<template slot-scope="scope">
<span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column
prop="alarmTime"
label="告警时间"
min-width="135"
:show-overflow-tooltip="true"
:formatter="dateFormat"
>
</el-table-column>
2 years ago
<!-- <el-table-column
prop="dyLevel"
label="电压等级"
2 years ago
min-width="75"
:show-overflow-tooltip="true"
>
2 years ago
</el-table-column> -->
<el-table-column
prop="lineName"
label="线路名称"
min-width="105"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
2 years ago
prop="towerName"
label="杆塔名称"
min-width="115"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
2 years ago
prop="displayName"
label="设备名称"
min-width="95"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
2 years ago
label="通道名称"
min-width="75"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">{{
scope.row.alias !== null && scope.row.alias !== ""
? scope.row.alias
: scope.row.channnelName
}}</template>
</el-table-column>
<!-- <el-table-column
2 years ago
prop="termId"
label="设备编号"
min-width="75"
:show-overflow-tooltip="true"
>
2 years ago
</el-table-column> -->
<el-table-column
2 years ago
prop="enname"
label="告警原因"
min-width="155"
:show-overflow-tooltip="true"
>
</el-table-column>
2 years ago
<el-table-column label="是否已读" min-width="95" fixed="right">
<template slot-scope="scope">
2 years ago
<span v-if="scope.row.isread == 0"></span>
<span v-if="scope.row.isread == 1"></span>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
2 years ago
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
2 years ago
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
2 years ago
</div>
<div class="alarmPic">
<div class="imgshow"><img :src="photoPic" /></div>
<div class="editorBtn">
<el-button type="primary">主动拍照</el-button>
<el-button type="primary">历史图片</el-button>
</div>
2 years ago
</div>
2 years ago
</div>
2 years ago
</div>
2 years ago
</div>
2 years ago
</template>
<script>
2 years ago
import { getSearchInfo, getAlarmList } from "@/utils/api/index";
2 years ago
import moment from "moment";
2 years ago
export default {
2 years ago
data() {
return {
2 years ago
dyOptions: [{ id: 0, name: "全部" }], //电压数据
xlOptions: [{ id: 0, name: "全部" }], //线路数据
gtOptions: [{ id: 0, name: "全部" }], //杆塔数据
gjOptions: [{ id: 0, name: "全部" }], //告警数据
formdata: {
2 years ago
dyId: "",
lineId: "",
towerId: "",
2 years ago
warnCause: "",
timeVal: "",
},
2 years ago
photoPic: "",
tableData: [],
multipleSelection: [],
page: 1, // 当前页数
pageSize: 20, // 每页数量
total: 0, //总条数
2 years ago
loading: false,
2 years ago
};
},
2 years ago
mounted() {
2 years ago
this.$set(this.formdata, "timeVal", [
new Date(new Date().toLocaleDateString()).getTime(),
new Date().getTime(),
]);
2 years ago
this.getTableList();
this.getSearchdy();
this.getSearchgj();
},
2 years ago
methods: {
2 years ago
//获取电压信息
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = this.dyOptions.concat(res.data.list);
this.formdata.dyId = this.dyOptions[0].id;
this.getSearchxl();
})
.catch((err) => {});
},
//获取线路数据
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyId })
.then((res) => {
this.xlOptions = [{ id: 0, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
this.formdata.lineId = this.xlOptions[0].id;
this.getSearchgt();
})
.catch((err) => {});
},
//获取杆塔数据
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineId })
.then((res) => {
this.gtOptions = [{ id: 0, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
this.formdata.towerId = this.gtOptions[0].id;
})
.catch((err) => {});
},
//获取告警原因
getSearchgj() {
getSearchInfo({ type: 1, id: this.formdata.lineId })
.then((res) => {
this.gjOptions = [{ id: 0, name: "全部" }];
this.gjOptions = this.gjOptions.concat(res.data.list);
this.formdata.warnCause = this.gjOptions[0].id;
})
.catch((err) => {});
2 years ago
},
2 years ago
//获取数据
2 years ago
getTableList() {
2 years ago
this.loading = true;
2 years ago
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
2 years ago
this.$set(this.formdata, "starttime", this.formdata.timeVal[0]);
this.$set(this.formdata, "endtime", this.formdata.timeVal[1]);
2 years ago
getAlarmList(this.formdata)
.then((res) => {
2 years ago
this.loading = false;
2 years ago
this.tableData = res.data.list;
this.total = res.data.total;
2 years ago
this.photoPic = res.data.list[0].path;
2 years ago
})
.catch((err) => {
console.log(err);
});
},
//查询
onSubmit() {
2 years ago
this.getTableList();
2 years ago
},
2 years ago
handleSelectionChange(val) {
this.multipleSelection = val;
2 years ago
},
2 years ago
//点击分页
handleCurrentChange(val) {
this.page = val;
this.getTableList();
},
//每页条数
handleSizeChange(val) {
this.pageSize = val;
this.getTableList();
},
2 years ago
handleRowClick(row) {
//this.$refs.multipleTable.toggleRowSelection(row);
console.log(row);
2 years ago
this.photoPic = row.path;
2 years ago
},
dateFormat(row, column) {
var date = row[column.property];
if (date == undefined) {
return "";
}
return moment(date).format("YYYY-MM-DD HH:mm:ss");
},
2 years ago
},
2 years ago
};
</script>
<style lang="less">
.alarmHandBox {
2 years ago
width: calc(100% - 32px);
height: calc(100% - 32px);
padding: 16px 16px;
background: #ffffff;
.searchMain {
border: 1px solid #dddddd;
2 years ago
height: calc(100% - 34px);
max-height: calc(100% - 34px);
padding: 16px;
border-radius: 4px;
}
2 years ago
.alarmTop {
padding: 0px 8px 16px 8px;
2 years ago
}
.alarmContain {
display: flex;
height: calc(100% - 48px);
2 years ago
padding: 0px 8px;
.alarmTable {
width: 50%;
height: 100%;
2 years ago
.el-table__body tr {
cursor: pointer;
}
.el-table__body tr.current-row > td {
background-color: rgba(18, 128, 113, 0.2);
}
2 years ago
}
2 years ago
.pageNation {
margin-top: 8px;
2 years ago
justify-content: flex-start;
2 years ago
}
.alarmPic {
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.imgshow {
width: 100%;
height: 100%;
2 years ago
img {
width: 100%;
height: 100%;
2 years ago
}
2 years ago
}
.editorBtn {
margin-top: 8px;
// border: 1px solid @border-color-base;
padding-top: 5px;
// border-radius: 4px;
2 years ago
}
.editorBtn {
display: flex;
justify-content: flex-start;
}
2 years ago
}
2 years ago
}
2 years ago
}
2 years ago
</style>