|
@@ -3,42 +3,47 @@
|
|
|
<el-container>
|
|
|
|
|
|
<el-main>
|
|
|
- <el-form :inline="true" :model="searchFormData">
|
|
|
+ <div style="margin-bottom: 20px">
|
|
|
+ <el-button size="medium" icon="el-icon-back" type="text">返回</el-button>
|
|
|
+ <span style="margin-left: 20px;margin-bottom: 15px; font-size: 18px">报警记录列表</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <el-row>
|
|
|
+ <el-button size="medium" icon="el-icon-search" style="margin-bottom: 15px" @click="search(searchFormData)">
|
|
|
+ 查询
|
|
|
+ </el-button>
|
|
|
+ <el-button size="medium" icon="el-icon-plus" @click="showAdd">新增</el-button>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-form :inline="true" :model="searchFormData" style="background-color: white;">
|
|
|
<el-form-item label="报警名称">
|
|
|
- <el-input placeholder="报警名称" size="small" v-model="searchFormData.alarmName"></el-input>
|
|
|
+ <el-input placeholder="报警名称" size="mini" v-model="searchFormData.alarmName"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="报警类型">
|
|
|
- <el-input placeholder="设备类型" size="small" v-model="searchFormData.alarmType"></el-input>
|
|
|
+ <el-input placeholder="设备类型" size="mini" v-model="searchFormData.alarmType"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备SN">
|
|
|
- <el-input placeholder="设备SN" size="small" v-model="searchFormData.sn"></el-input>
|
|
|
+ <el-input placeholder="设备SN" size="mini" v-model="searchFormData.sn"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="运营商编号">
|
|
|
- <el-input placeholder="运营商编号" size="small" v-model="searchFormData.operatorNumber"></el-input>
|
|
|
+ <el-input placeholder="运营商编号" size="mini" v-model="searchFormData.operatorNumber"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="项目编号">
|
|
|
- <el-input placeholder="项目编号" size="small" v-model="searchFormData.projectNumber"></el-input>
|
|
|
+ <el-input placeholder="项目编号" size="mini" v-model="searchFormData.projectNumber"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="网关编号">
|
|
|
- <el-input placeholder="网关编号" size="small" v-model="searchFormData.gatewayNumber"></el-input>
|
|
|
+ <el-input placeholder="网关编号" size="mini" v-model="searchFormData.gatewayNumber"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="变量id">
|
|
|
- <el-input placeholder="变量id" size="small" v-model="searchFormData.variableId"></el-input>
|
|
|
+ <el-input placeholder="变量id" size="mini" v-model="searchFormData.variableId"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开始时间">
|
|
|
- <el-input placeholder="开始时间" size="small" v-model="searchFormData.startTime"></el-input>
|
|
|
+ <el-input placeholder="开始时间" size="mini" v-model="searchFormData.startTime"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="结束时间">
|
|
|
- <el-input placeholder="结束时间" size="small" v-model="searchFormData.endTime"></el-input>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" size="small" @click="search(searchFormData)">搜索</el-button>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" size="small" @click="showAdd">新增</el-button>
|
|
|
+ <el-input placeholder="结束时间" size="mini" v-model="searchFormData.endTime"></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
@@ -89,7 +94,7 @@
|
|
|
|
|
|
|
|
|
<el-table :data="tableData">
|
|
|
-
|
|
|
+ <el-table-column type="selection"></el-table-column>
|
|
|
<el-table-column prop="alarmName" label="报警名称"></el-table-column>
|
|
|
<el-table-column prop="alarmType" label="报警类型"></el-table-column>
|
|
|
<el-table-column prop="content" label="告警内容"></el-table-column>
|
|
@@ -99,10 +104,10 @@
|
|
|
<el-table-column label="状态">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- class="delBut non"
|
|
|
- @click="statusHandle(scope.row)"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ class="delBut non"
|
|
|
+ @click="statusHandle(scope.row)"
|
|
|
>
|
|
|
{{ scope.row.status == '未处理' ? '已处理' : '未处理' }}
|
|
|
</el-button>
|
|
@@ -112,22 +117,22 @@
|
|
|
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="primary" size="small" @click="showEdit(scope.row)">编辑</el-button>
|
|
|
- <el-button type="danger" size="small" @click="del(scope.row)">删除</el-button>
|
|
|
-
|
|
|
- <el-button type="primary" size="small" @click="manage(scope.row)">查看</el-button>
|
|
|
+ <el-button type="text" size="medium" @click="showEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button type="text" size="medium" @click="manage(scope.row)">查看</el-button>
|
|
|
+ <el-button type="text" size="medium" @click="del(scope.row)" style="color: #c01920">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<el-pagination
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :page-size="pager.pageSize"
|
|
|
- :current-page="pager.pageIndex"
|
|
|
- :total="pager.itemCount"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
+ style="margin-top: 15px;text-align: center"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="pager.pageSize"
|
|
|
+ :current-page="pager.pageIndex"
|
|
|
+ :total="pager.itemCount"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
</el-main>
|
|
@@ -163,13 +168,13 @@ export default {
|
|
|
},
|
|
|
|
|
|
tableData:
|
|
|
- [{
|
|
|
- alarmName: '',
|
|
|
- alarmType: '',
|
|
|
- content: '',
|
|
|
- startTime: '',
|
|
|
- endTime: '',
|
|
|
- }],
|
|
|
+ [{
|
|
|
+ alarmName: '',
|
|
|
+ alarmType: '',
|
|
|
+ content: '',
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
+ }],
|
|
|
formData: {
|
|
|
alarmName: '',
|
|
|
alarmType: '',
|
|
@@ -184,19 +189,19 @@ export default {
|
|
|
gatewayNumber: ''
|
|
|
},
|
|
|
searchFormData:
|
|
|
- {
|
|
|
- alarmName: '',
|
|
|
- alarmType: '',
|
|
|
- content: '',
|
|
|
- startTime: '',
|
|
|
- endTime: '',
|
|
|
-
|
|
|
- sn: '',
|
|
|
- variableId: '',
|
|
|
- operatorNumber: '',
|
|
|
- projectNumber: '',
|
|
|
- gatewayNumber: ''
|
|
|
- }
|
|
|
+ {
|
|
|
+ alarmName: '',
|
|
|
+ alarmType: '',
|
|
|
+ content: '',
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
+
|
|
|
+ sn: '',
|
|
|
+ variableId: '',
|
|
|
+ operatorNumber: '',
|
|
|
+ projectNumber: '',
|
|
|
+ gatewayNumber: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -212,7 +217,7 @@ export default {
|
|
|
|
|
|
loadData(index) {
|
|
|
const vm = this;
|
|
|
- vm.$http.get(vm.api.list, {
|
|
|
+ vm.$http.get(vm.api.list, {
|
|
|
params: {
|
|
|
pageSize: 5,
|
|
|
pageIndex: index ? index : 1,
|
|
@@ -229,14 +234,14 @@ export default {
|
|
|
variableId: this.searchFormData.variableId,
|
|
|
}
|
|
|
})
|
|
|
- .then((response) => {
|
|
|
- // vm.paper = response.data.data.paper;
|
|
|
- console.log(response.data.data);
|
|
|
+ .then((response) => {
|
|
|
+ // vm.paper = response.data.data.paper;
|
|
|
+ console.log(response.data.data);
|
|
|
|
|
|
- vm.pager = response.data.data.pager
|
|
|
+ vm.pager = response.data.data.pager
|
|
|
|
|
|
- vm.tableData = response.data.data.deviceAlarmRecords;
|
|
|
- })
|
|
|
+ vm.tableData = response.data.data.deviceAlarmRecords;
|
|
|
+ })
|
|
|
},
|
|
|
search() {
|
|
|
//console.log(this.searchFormData)
|
|
@@ -246,14 +251,14 @@ export default {
|
|
|
this.dialogFormVisible = true;
|
|
|
|
|
|
this.formData.alarmName = '',
|
|
|
- this.formData.alarmType = '',
|
|
|
- this.formData.content = '',
|
|
|
- this.formData.startTime = '',
|
|
|
- this.formData.endTime = '',
|
|
|
-
|
|
|
- this.formData.operatorNumber = '',
|
|
|
- this.formData.projectNumber = '',
|
|
|
- this.formData.gatewayNumber = ''
|
|
|
+ this.formData.alarmType = '',
|
|
|
+ this.formData.content = '',
|
|
|
+ this.formData.startTime = '',
|
|
|
+ this.formData.endTime = '',
|
|
|
+
|
|
|
+ this.formData.operatorNumber = '',
|
|
|
+ this.formData.projectNumber = '',
|
|
|
+ this.formData.gatewayNumber = ''
|
|
|
this.formData.sn = ''
|
|
|
this.formData.variableId = ''
|
|
|
},
|
|
@@ -292,25 +297,25 @@ export default {
|
|
|
gatewayCode: this.formData.gatewayCode,
|
|
|
}
|
|
|
})
|
|
|
- .then((response) => {
|
|
|
- console.log(response)
|
|
|
+ .then((response) => {
|
|
|
+ console.log(response)
|
|
|
|
|
|
- if (response.data.status == 200) {
|
|
|
+ if (response.data.status == 200) {
|
|
|
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- showClose: true,
|
|
|
- message: response.data.desc
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ showClose: true,
|
|
|
+ message: response.data.desc
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- this.dialogFormVisible = false;
|
|
|
+ this.dialogFormVisible = false;
|
|
|
|
|
|
- this.loadData();
|
|
|
+ this.loadData();
|
|
|
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
if (this.addOrEdit == 1) {
|
|
@@ -333,20 +338,20 @@ export default {
|
|
|
gatewayCode: this.formData.gatewayCode,
|
|
|
}
|
|
|
})
|
|
|
- .then((response) => {
|
|
|
- if (response.data.status == 200) {
|
|
|
+ .then((response) => {
|
|
|
+ if (response.data.status == 200) {
|
|
|
|
|
|
- this.dialogFormVisible = false;
|
|
|
+ this.dialogFormVisible = false;
|
|
|
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- showClose: true,
|
|
|
- message: response.data.desc
|
|
|
- })
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ showClose: true,
|
|
|
+ message: response.data.desc
|
|
|
+ })
|
|
|
|
|
|
- this.loadData();
|
|
|
- }
|
|
|
- })
|
|
|
+ this.loadData();
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -355,32 +360,32 @@ export default {
|
|
|
this.$confirm('确认删除', '提示', {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- vm.$http.get(vm.api.delete, {
|
|
|
+ vm.$http.get(vm.api.delete, {
|
|
|
params: {
|
|
|
code: row.code,
|
|
|
}
|
|
|
})
|
|
|
- .then((response) => {
|
|
|
- console.log(response)
|
|
|
- if (response.data.status == 200) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- showClose: true,
|
|
|
- message: response.data.desc
|
|
|
- })
|
|
|
+ .then((response) => {
|
|
|
+ console.log(response)
|
|
|
+ if (response.data.status == 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ showClose: true,
|
|
|
+ message: response.data.desc
|
|
|
+ })
|
|
|
|
|
|
|
|
|
- }
|
|
|
- this.loadData();
|
|
|
- })
|
|
|
+ }
|
|
|
+ this.loadData();
|
|
|
+ })
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- showClose: true,
|
|
|
- message: '取消删除'
|
|
|
- })
|
|
|
- });
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ showClose: true,
|
|
|
+ message: '取消删除'
|
|
|
+ })
|
|
|
+ });
|
|
|
},
|
|
|
cancel() {
|
|
|
this.$message({
|
|
@@ -398,7 +403,7 @@ export default {
|
|
|
this.$confirm('是否进行此操作', '提示', {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- vm.$http.get(vm.api.update, {
|
|
|
+ vm.$http.get(vm.api.update, {
|
|
|
params: {
|
|
|
alarmName: row.alarmName,
|
|
|
alarmType: row.alarmType,
|
|
@@ -421,27 +426,27 @@ export default {
|
|
|
status: row.status == '未处理' ? '已处理' : '未处理',
|
|
|
}
|
|
|
})
|
|
|
- .then((response) => {
|
|
|
- console.log(row)
|
|
|
- // console.log(response)
|
|
|
- if (response.data.status == 200) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- showClose: true,
|
|
|
- message: response.data.desc
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
- this.loadData();
|
|
|
- })
|
|
|
+ .then((response) => {
|
|
|
+ console.log(row)
|
|
|
+ // console.log(response)
|
|
|
+ if (response.data.status == 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ showClose: true,
|
|
|
+ message: response.data.desc
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ this.loadData();
|
|
|
+ })
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- showClose: true,
|
|
|
- message: '操作取消'
|
|
|
- })
|
|
|
- });
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ showClose: true,
|
|
|
+ message: '操作取消'
|
|
|
+ })
|
|
|
+ });
|
|
|
|
|
|
},
|
|
|
|
|
@@ -455,5 +460,8 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
+.el-form-item {
|
|
|
+ margin-left: 15px;
|
|
|
+ margin-top: 10px
|
|
|
+}
|
|
|
</style>
|