|
|
@ -1,18 +1,18 @@ |
|
|
|
<!-- 巡查项目管理-水闸 --> |
|
|
|
<script> |
|
|
|
import Edit from './components/edit.vue' |
|
|
|
import Edit from "./components/edit.vue"; |
|
|
|
import { |
|
|
|
getDicts, |
|
|
|
postSZDeviceList, |
|
|
|
postSZDevice, |
|
|
|
putSZDevice, |
|
|
|
delSZDevice |
|
|
|
delSZDevice, |
|
|
|
} from "@/api/management"; |
|
|
|
let that |
|
|
|
let that; |
|
|
|
export default { |
|
|
|
name: "manage", |
|
|
|
components: { |
|
|
|
Edit |
|
|
|
Edit, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -22,13 +22,13 @@ export default { |
|
|
|
xcDeviceStatus: [], |
|
|
|
searchForm: { |
|
|
|
type: -1, |
|
|
|
warningLevel: '', |
|
|
|
name: '' |
|
|
|
warningLevel: "", |
|
|
|
name: "", |
|
|
|
}, |
|
|
|
dialog: { |
|
|
|
title: '新增操作记录', |
|
|
|
dom: '', |
|
|
|
visible: false |
|
|
|
title: "新增操作记录", |
|
|
|
dom: "", |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
mdl: null, |
|
|
|
tableData: [], // 检查列表 |
|
|
@ -56,35 +56,35 @@ export default { |
|
|
|
// 重置搜索 |
|
|
|
resetSearch() { |
|
|
|
this.pageData.pageNum = 1; |
|
|
|
if (!this.$refs['searchForm']) return |
|
|
|
this.$refs['searchForm'].resetFields() |
|
|
|
if (!this.$refs["searchForm"]) return; |
|
|
|
this.$refs["searchForm"].resetFields(); |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
// 新增巡查内容 |
|
|
|
handleAdd() { |
|
|
|
this.dialog.dom = 'Edit' |
|
|
|
this.dialog.visible = true |
|
|
|
this.dialog.dom = "Edit"; |
|
|
|
this.dialog.visible = true; |
|
|
|
}, |
|
|
|
handleCheck(row) { |
|
|
|
this.dialog.dom = 'Edit' |
|
|
|
this.mdl = {...row} |
|
|
|
this.dialog.visible = true |
|
|
|
this.dialog.dom = "Edit"; |
|
|
|
this.mdl = { ...row }; |
|
|
|
this.dialog.visible = true; |
|
|
|
}, |
|
|
|
handleEdit(row) { |
|
|
|
this.dialog.dom = 'Edit' |
|
|
|
this.dialog.dom = "Edit"; |
|
|
|
this.mdl = { |
|
|
|
eventType: 'edit', |
|
|
|
...row |
|
|
|
} |
|
|
|
this.dialog.visible = true |
|
|
|
eventType: "edit", |
|
|
|
...row, |
|
|
|
}; |
|
|
|
this.dialog.visible = true; |
|
|
|
}, |
|
|
|
async handleDelete(row) { |
|
|
|
await delSZDevice(row.id) |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.getTableData() |
|
|
|
await delSZDevice(row.id); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
// 保存巡查项目 |
|
|
|
submitForm () { |
|
|
|
submitForm() { |
|
|
|
this.$refs.component.submitForm(async (from) => { |
|
|
|
if (this.mdl) { |
|
|
|
await putSZDevice({ |
|
|
@ -94,14 +94,14 @@ export default { |
|
|
|
{ |
|
|
|
maxThreshold: from.maxThreshold, |
|
|
|
minThreshold: from.minThreshold, |
|
|
|
reportInterval: from.reportInterval |
|
|
|
} |
|
|
|
reportInterval: from.reportInterval, |
|
|
|
}, |
|
|
|
], |
|
|
|
wagaCode: this.$route.query.wagaCode |
|
|
|
}) |
|
|
|
this.$message.success('修改成功') |
|
|
|
this.closeDialog() |
|
|
|
this.getTableData() |
|
|
|
wagaCode: this.$route.query.wagaCode, |
|
|
|
}); |
|
|
|
this.$message.success("修改成功"); |
|
|
|
this.closeDialog(); |
|
|
|
this.getTableData(); |
|
|
|
} else { |
|
|
|
await postSZDevice({ |
|
|
|
...from, |
|
|
@ -109,31 +109,33 @@ export default { |
|
|
|
{ |
|
|
|
maxThreshold: from.maxThreshold, |
|
|
|
minThreshold: from.minThreshold, |
|
|
|
reportInterval: from.reportInterval |
|
|
|
} |
|
|
|
reportInterval: from.reportInterval, |
|
|
|
}, |
|
|
|
], |
|
|
|
wagaCode: this.$route.query.wagaCode |
|
|
|
}) |
|
|
|
this.$message.success('新增成功') |
|
|
|
this.closeDialog() |
|
|
|
this.getTableData() |
|
|
|
wagaCode: this.$route.query.wagaCode, |
|
|
|
}); |
|
|
|
this.$message.success("新增成功"); |
|
|
|
this.closeDialog(); |
|
|
|
this.getTableData(); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
// 关闭dialog |
|
|
|
closeDialog() { |
|
|
|
this.dialog.visible = false |
|
|
|
this.mdl = null |
|
|
|
this.dialog.visible = false; |
|
|
|
this.mdl = null; |
|
|
|
}, |
|
|
|
// 获取列表数据 |
|
|
|
getTableData() { |
|
|
|
postSZDeviceList({ |
|
|
|
data: { |
|
|
|
type: this.searchForm.type === -1 ? '' : this.searchForm.type, |
|
|
|
type: this.searchForm.type === -1 ? "" : this.searchForm.type, |
|
|
|
name: this.searchForm.name, |
|
|
|
warningLevel: this.searchForm.warningLevel === -1 ? '' : this.searchForm.warningLevel, |
|
|
|
wagaCode: this.$route.query.wagaCode |
|
|
|
warningLevel: |
|
|
|
this.searchForm.warningLevel === -1 |
|
|
|
? "" |
|
|
|
: this.searchForm.warningLevel, |
|
|
|
wagaCode: this.$route.query.wagaCode, |
|
|
|
}, |
|
|
|
cv: { |
|
|
|
name: "name", |
|
|
@ -150,23 +152,25 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
that = this |
|
|
|
that = this; |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
// 过滤预警类型 |
|
|
|
filterwarnningType (price) { |
|
|
|
const data = that.xcWarnningType.filter((res) => res.dictValue == price) |
|
|
|
return data[0] ? data[0].dictLabel : '/' |
|
|
|
filterwarnningType(price) { |
|
|
|
const data = that.xcWarnningType.filter((res) => res.dictValue == price); |
|
|
|
return data[0] ? data[0].dictLabel : "/"; |
|
|
|
}, |
|
|
|
// 过滤预警级别 |
|
|
|
filterwarnningLevel (price) { |
|
|
|
const data = that.xcWarnningLevelType.filter((res) => res.dictValue == price) |
|
|
|
return data[0] ? data[0].dictLabel : '/' |
|
|
|
filterwarnningLevel(price) { |
|
|
|
const data = that.xcWarnningLevelType.filter( |
|
|
|
(res) => res.dictValue == price |
|
|
|
); |
|
|
|
return data[0] ? data[0].dictLabel : "/"; |
|
|
|
}, |
|
|
|
// 过滤设备类型 |
|
|
|
filterdeviceType (price) { |
|
|
|
const data = that.xcDeviceType.filter((res) => res.dictValue == price) |
|
|
|
return data[0] ? data[0].dictLabel : '/' |
|
|
|
filterdeviceType(price) { |
|
|
|
const data = that.xcDeviceType.filter((res) => res.dictValue == price); |
|
|
|
return data[0] ? data[0].dictLabel : "/"; |
|
|
|
}, |
|
|
|
// 过滤设备状态 |
|
|
|
filterStatus(price) { |
|
|
@ -201,7 +205,12 @@ export default { |
|
|
|
<div class="slider-right"> |
|
|
|
<div class="top-title">水闸动态监测管理</div> |
|
|
|
<div class="table-box"> |
|
|
|
<el-form inline :model="searchForm" ref="searchForm" class="demo-ruleForm"> |
|
|
|
<el-form |
|
|
|
inline |
|
|
|
:model="searchForm" |
|
|
|
ref="searchForm" |
|
|
|
class="demo-ruleForm" |
|
|
|
> |
|
|
|
<el-form-item label="设备类型:" prop="type"> |
|
|
|
<el-select v-model="searchForm.type" placeholder="请选择"> |
|
|
|
<el-option |
|
|
@ -225,10 +234,16 @@ export default { |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="设备名称:" prop="name"> |
|
|
|
<el-input v-model="searchForm.name" class="search-input" placeholder="请输入设备名称"></el-input> |
|
|
|
<el-input |
|
|
|
v-model="searchForm.name" |
|
|
|
class="search-input" |
|
|
|
placeholder="请输入设备名称" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button class="search-btn" type="success" @click="search()">查询</el-button> |
|
|
|
<el-button class="search-btn" type="success" @click="search()" |
|
|
|
>查询</el-button |
|
|
|
> |
|
|
|
<el-button @click="resetSearch()">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
@ -238,9 +253,8 @@ export default { |
|
|
|
type="success" |
|
|
|
v-hasPermi="['sz:run:dtjc:add']" |
|
|
|
@click="handleAdd()" |
|
|
|
>新增 |
|
|
|
</el-button |
|
|
|
> |
|
|
|
>新增 |
|
|
|
</el-button> |
|
|
|
<el-table height="625" :data="tableData" border style="width: 100%"> |
|
|
|
<el-table-column type="index" align="center" label="序号"> |
|
|
|
</el-table-column> |
|
|
@ -274,7 +288,12 @@ export default { |
|
|
|
label="预警时间" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="address" align="center" label="操作" min-width="200"> |
|
|
|
<el-table-column |
|
|
|
prop="address" |
|
|
|
align="center" |
|
|
|
label="操作" |
|
|
|
min-width="200" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
style="margin-right: 16px" |
|
|
@ -307,9 +326,8 @@ export default { |
|
|
|
size="small" |
|
|
|
slot="reference" |
|
|
|
v-hasPermi="['sz:run:dtjc:delete']" |
|
|
|
>删除 |
|
|
|
</el-button |
|
|
|
> |
|
|
|
>删除 |
|
|
|
</el-button> |
|
|
|
</el-popconfirm> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -331,15 +349,19 @@ export default { |
|
|
|
:title="dialog.title" |
|
|
|
@close="closeDialog" |
|
|
|
:visible.sync="dialog.visible" |
|
|
|
width="50%" |
|
|
|
width="820px" |
|
|
|
> |
|
|
|
<component v-if="dialog.visible" :is="dialog.dom" ref="component" :model="mdl"></component> |
|
|
|
<component |
|
|
|
v-if="dialog.visible" |
|
|
|
:is="dialog.dom" |
|
|
|
ref="component" |
|
|
|
:model="mdl" |
|
|
|
></component> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button size="mini" @click="closeDialog">取 消</el-button> |
|
|
|
<el-button size="mini" type="primary" @click="submitForm" |
|
|
|
>保存 |
|
|
|
</el-button |
|
|
|
> |
|
|
|
>保存 |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
@ -355,9 +377,13 @@ export default { |
|
|
|
font-weight: 600; |
|
|
|
} |
|
|
|
|
|
|
|
.demo-ruleForm { |
|
|
|
display: inline-block; |
|
|
|
} |
|
|
|
|
|
|
|
.table-box { |
|
|
|
width: 100%; |
|
|
|
height: calc(100% - 50px - 24px); |
|
|
|
height: calc(100% - 24px); |
|
|
|
margin-top: 24px; |
|
|
|
padding: 16px; |
|
|
|
background-color: white; |
|
|
|