|
@@ -13,14 +13,23 @@
|
|
|
<!--
|
|
|
要resetFields起作用,必须配置:model和prop
|
|
|
-->
|
|
|
- <el-form ref="queryForm" :model="queryModel" inline class="demo-form-inline">
|
|
|
- <el-form-item label="报警时间" prop="createTime">
|
|
|
+ <el-form
|
|
|
+ ref="queryForm"
|
|
|
+ :model="queryModel"
|
|
|
+ inline
|
|
|
+ class="demo-form-inline"
|
|
|
+ >
|
|
|
+ <el-form-item label="报警时间" prop="queryTimeRange">
|
|
|
<el-date-picker
|
|
|
- v-model="queryModel.createTime"
|
|
|
+ v-model="queryModel.queryTimeRange"
|
|
|
type="daterange"
|
|
|
range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ placeholder="选择时间范围"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ :clearable="false"
|
|
|
+ style="width: 300px"
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -30,27 +39,38 @@
|
|
|
icon="ios-search"
|
|
|
@click="changePage(1)"
|
|
|
:loading="loading"
|
|
|
- >查询</el-button>
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="info"
|
|
|
size="mini"
|
|
|
style="margin-left: 8px"
|
|
|
@click="handleReset('queryForm')"
|
|
|
- >重置</el-button>
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-divider></el-divider>
|
|
|
<el-row class="button-group"></el-row>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
- style="min-height:400px;"
|
|
|
+ style="min-height: 400px"
|
|
|
v-loading="loading"
|
|
|
stripe
|
|
|
@sort-change="sortChange"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column prop="createTime" sort-by="create_time" label="报警时间" width="180"></el-table-column>
|
|
|
- <el-table-column prop="message" sort-by="message_" label="报警信息"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="createTime"
|
|
|
+ sort-by="create_time"
|
|
|
+ label="报警时间"
|
|
|
+ width="180"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="message"
|
|
|
+ sort-by="message_"
|
|
|
+ label="报警信息"
|
|
|
+ ></el-table-column>
|
|
|
<!-- <el-table-column label="操作">
|
|
|
<template slot-scope="{row}">
|
|
|
<el-button size="mini" disabled type="primary" icon="el-icon-video-camera" @click="handleOpenVideo(row)">查看回放</el-button>
|
|
@@ -88,15 +108,8 @@ export default {
|
|
|
return {
|
|
|
queryModel: {
|
|
|
id: "",
|
|
|
- createBy: "",
|
|
|
- createTime: "",
|
|
|
- updateBy: "",
|
|
|
- updateTime: "",
|
|
|
- delFlag: "",
|
|
|
- deviceNo: "",
|
|
|
- channelName: "",
|
|
|
- alertType: "",
|
|
|
- type: "2"
|
|
|
+ queryTimeRange: ["", ""],
|
|
|
+ type: "2",
|
|
|
},
|
|
|
loading: false,
|
|
|
tableData: [],
|
|
@@ -110,7 +123,7 @@ export default {
|
|
|
multipleSelection: [],
|
|
|
showModal: false,
|
|
|
modalTitle: "",
|
|
|
- businessKey: ""
|
|
|
+ businessKey: "",
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -126,16 +139,17 @@ export default {
|
|
|
formData.append("pageSize", self.pageSize);
|
|
|
|
|
|
formData.append("id", self.queryModel.id);
|
|
|
- formData.append("createBy", self.queryModel.createBy);
|
|
|
formData.append("createTime", self.queryModel.createTime);
|
|
|
- formData.append("updateBy", self.queryModel.updateBy);
|
|
|
- formData.append("updateTime", self.queryModel.updateTime);
|
|
|
- formData.append("delFlag", self.queryModel.delFlag);
|
|
|
- formData.append("deviceNo", self.queryModel.deviceNo);
|
|
|
- formData.append("channelName", self.queryModel.channelName);
|
|
|
- formData.append("alertType", self.queryModel.alertType);
|
|
|
formData.append("type", self.queryModel.type);
|
|
|
|
|
|
+ if (self.queryModel.queryTimeRange[0] != null) {
|
|
|
+ formData.append("queryStartTime", self.queryModel.queryTimeRange[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (self.queryModel.queryTimeRange[1] != null) {
|
|
|
+ formData.append("queryEndTime", self.queryModel.queryTimeRange[1]);
|
|
|
+ }
|
|
|
+
|
|
|
if (this.field != null) {
|
|
|
formData.append("field", this.field);
|
|
|
}
|
|
@@ -146,7 +160,7 @@ export default {
|
|
|
|
|
|
alarmInfoApi
|
|
|
.pageList(formData)
|
|
|
- .then(function(response) {
|
|
|
+ .then(function (response) {
|
|
|
self.loading = false;
|
|
|
|
|
|
var jsonData = response.data.data;
|
|
@@ -155,7 +169,7 @@ export default {
|
|
|
self.totalPages = jsonData.totalPages;
|
|
|
self.totalElements = jsonData.recordsTotal;
|
|
|
})
|
|
|
- .catch(error => {
|
|
|
+ .catch((error) => {
|
|
|
self.loading = false;
|
|
|
// self.$message.error(error + "");
|
|
|
});
|
|
@@ -192,10 +206,10 @@ export default {
|
|
|
.$confirm("是否确认删除?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
.then(() => {
|
|
|
- alarmInfoApi.remove(record.id).then(function(response) {
|
|
|
+ alarmInfoApi.remove(record.id).then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
|
|
|
if (jsonData.result) {
|
|
@@ -205,7 +219,7 @@ export default {
|
|
|
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "删除成功!"
|
|
|
+ message: "删除成功!",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -214,16 +228,16 @@ export default {
|
|
|
handleBatchDelete() {
|
|
|
var self = this;
|
|
|
|
|
|
- var idList = this.multipleSelection.map(record => {
|
|
|
+ var idList = this.multipleSelection.map((record) => {
|
|
|
return record.id;
|
|
|
});
|
|
|
|
|
|
this.$confirm("是否确认删除选中项?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
}).then(() => {
|
|
|
- alarmInfoApi.batchRemove(idList).then(function(response) {
|
|
|
+ alarmInfoApi.batchRemove(idList).then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
|
|
|
if (jsonData.result) {
|
|
@@ -231,7 +245,7 @@ export default {
|
|
|
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "删除成功!"
|
|
|
+ message: "删除成功!",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -252,7 +266,7 @@ export default {
|
|
|
var self = this;
|
|
|
var formData = new FormData();
|
|
|
formData.append("type", 2);
|
|
|
- alarmInfoApi.queryNotify(formData).then(function(response) {
|
|
|
+ alarmInfoApi.queryNotify(formData).then(function (response) {
|
|
|
var jsonData = response;
|
|
|
if (jsonData.data.result) {
|
|
|
self.$notify({
|
|
@@ -260,21 +274,21 @@ export default {
|
|
|
message: jsonData.data.data,
|
|
|
position: "bottom-right",
|
|
|
type: "warning",
|
|
|
- duration: 0
|
|
|
+ duration: 0,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
- mounted: function() {
|
|
|
+ mounted: function () {
|
|
|
this.changePage(1);
|
|
|
- window.setInterval(() => {
|
|
|
- setTimeout(this.queryNotify(), 0);
|
|
|
- }, 10000);
|
|
|
+ // window.setInterval(() => {
|
|
|
+ // setTimeout(this.queryNotify(), 0);
|
|
|
+ // }, 10000);
|
|
|
},
|
|
|
components: {
|
|
|
- "alarmInfo-detail": AlarmInfoDetail
|
|
|
- }
|
|
|
+ "alarmInfo-detail": AlarmInfoDetail,
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|