|
@ -1,8 +1,10 @@ |
|
|
<!-- 巡查项目管理-水闸 --> |
|
|
<!-- 巡查项目管理-水闸 --> |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
getRunSzDeviceRecordList |
|
|
getRunSzDeviceRecordList, |
|
|
|
|
|
getRunSzDeviceRecord |
|
|
} from "@/api/sluice"; |
|
|
} from "@/api/sluice"; |
|
|
|
|
|
import { getAreasData } from "@/api/areas/index"; |
|
|
import { |
|
|
import { |
|
|
getDicts |
|
|
getDicts |
|
|
} from "@/api/management"; |
|
|
} from "@/api/management"; |
|
@ -11,6 +13,7 @@ export default { |
|
|
name: "record", |
|
|
name: "record", |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
xcDeviceType: [], |
|
|
xcWarnningType: [], |
|
|
xcWarnningType: [], |
|
|
xcWarnningLevelType: [], |
|
|
xcWarnningLevelType: [], |
|
|
searchForm: { |
|
|
searchForm: { |
|
@ -19,6 +22,12 @@ export default { |
|
|
warningLevel: -1, |
|
|
warningLevel: -1, |
|
|
warningTime: null, |
|
|
warningTime: null, |
|
|
}, |
|
|
}, |
|
|
|
|
|
areasOptions: [], // 检查类型 |
|
|
|
|
|
adcdOptions: [], // 检查类型 |
|
|
|
|
|
areasOptionProps: { |
|
|
|
|
|
emitPath: false, |
|
|
|
|
|
checkStrictly: true, //选择任意一级 |
|
|
|
|
|
}, |
|
|
mdl: null, |
|
|
mdl: null, |
|
|
tableData: [], // 检查列表 |
|
|
tableData: [], // 检查列表 |
|
|
pageData: { |
|
|
pageData: { |
|
@ -51,6 +60,17 @@ export default { |
|
|
this.$refs['searchForm'].resetFields() |
|
|
this.$refs['searchForm'].resetFields() |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
async handelAdd () { |
|
|
|
|
|
await getRunSzDeviceRecord({ |
|
|
|
|
|
deviceId: '763434', |
|
|
|
|
|
wagaCode: '441322000081', |
|
|
|
|
|
wagaName: '鸡心岭水闸', |
|
|
|
|
|
warningData: '235', |
|
|
|
|
|
warningLevel: '0', |
|
|
|
|
|
warningTime: '2024-03-18 02:56:38', |
|
|
|
|
|
warningType: '0' |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
// 获取列表数据 |
|
|
// 获取列表数据 |
|
|
getTableData() { |
|
|
getTableData() { |
|
|
getRunSzDeviceRecordList({ |
|
|
getRunSzDeviceRecordList({ |
|
@ -75,6 +95,31 @@ export default { |
|
|
console.log("🚀表格数据🚀", res); |
|
|
console.log("🚀表格数据🚀", res); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取地区树数据 |
|
|
|
|
|
getTreeData() { |
|
|
|
|
|
getAreasData().then((items) => { |
|
|
|
|
|
this.adcdOptions = items.data |
|
|
|
|
|
if (items?.data) { |
|
|
|
|
|
let res = []; |
|
|
|
|
|
let getChildren = (res, pid) => { |
|
|
|
|
|
for (const i of items.data) { |
|
|
|
|
|
if (i.parentid === pid) { |
|
|
|
|
|
const newItem = { |
|
|
|
|
|
label: i.name, |
|
|
|
|
|
value: i.id, |
|
|
|
|
|
}; |
|
|
|
|
|
if (i.layer != 3) newItem.children = []; |
|
|
|
|
|
res.push(newItem); |
|
|
|
|
|
getChildren(newItem.children, newItem.value); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
getChildren(res, items.data[0].parentid); |
|
|
|
|
|
this.areasOptions = res; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
that = this |
|
|
that = this |
|
@ -89,6 +134,19 @@ export default { |
|
|
filterwarnningLevel (price) { |
|
|
filterwarnningLevel (price) { |
|
|
const data = that.xcWarnningLevelType.filter((res) => res.dictValue == price) |
|
|
const data = that.xcWarnningLevelType.filter((res) => res.dictValue == price) |
|
|
return data[0] ? data[0].dictLabel : '/' |
|
|
return data[0] ? data[0].dictLabel : '/' |
|
|
|
|
|
}, |
|
|
|
|
|
// 过滤设备类型 |
|
|
|
|
|
filterdeviceType (price) { |
|
|
|
|
|
const data = that.xcDeviceType.filter((res) => res.dictValue == price) |
|
|
|
|
|
return data[0] ? data[0].dictLabel : '/' |
|
|
|
|
|
}, |
|
|
|
|
|
// 过滤区域 |
|
|
|
|
|
filterAdcd (price) { |
|
|
|
|
|
let name = '' |
|
|
|
|
|
if (that.adcdOptions.filter((res) => res.id == price)[0]) { |
|
|
|
|
|
name = that.adcdOptions.filter((res) => res.id == price)[0].name |
|
|
|
|
|
} |
|
|
|
|
|
return name |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async mounted() { |
|
|
async mounted() { |
|
@ -100,7 +158,12 @@ export default { |
|
|
getDicts("xc_warnning_level").then((res) => { |
|
|
getDicts("xc_warnning_level").then((res) => { |
|
|
this.xcWarnningLevelType = res.data; |
|
|
this.xcWarnningLevelType = res.data; |
|
|
}); |
|
|
}); |
|
|
// 获取列表数据 |
|
|
// 获取设备类型 |
|
|
|
|
|
getDicts("xc_device_type").then((res) => { |
|
|
|
|
|
this.xcDeviceType = res.data; |
|
|
|
|
|
}); |
|
|
|
|
|
// 获取列表数据a |
|
|
|
|
|
await this.getTreeData(); |
|
|
await this.getTableData(); |
|
|
await this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
@ -148,6 +211,7 @@ export default { |
|
|
</el-time-picker> |
|
|
</el-time-picker> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
|
|
|
<!-- <el-button class="search-btn" type="success" @click="handelAdd">添加</el-button>--> |
|
|
<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-button @click="resetSearch">重置</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -155,12 +219,26 @@ export default { |
|
|
<el-table height="625" :data="tableData" border style="width: 100%"> |
|
|
<el-table height="625" :data="tableData" border style="width: 100%"> |
|
|
<el-table-column type="index" align="center" label="序号"> |
|
|
<el-table-column type="index" align="center" label="序号"> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="deviceName" align="center" label="设备名称"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="wagaName" align="center" label="所属水闸"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="adcd" align="center" label="具体地点"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ scope.row.adcd | filterAdcd }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="deviceType" align="center" label="设备类型"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ scope.row.deviceType | filterdeviceType }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column prop="warningType" align="center" label="预警类型"> |
|
|
<el-table-column prop="warningType" align="center" label="预警类型"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
{{ scope.row.warningType | filterwarnningType }} |
|
|
{{ scope.row.warningType | filterwarnningType }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="warningLevel" align="center" label="预警等级"> |
|
|
<el-table-column prop="warningLevel" align="center" label="预警级别"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
{{ scope.row.warningLevel | filterwarnningLevel }} |
|
|
{{ scope.row.warningLevel | filterwarnningLevel }} |
|
|
</template> |
|
|
</template> |
|
|