Browse Source

修改动态监测历史记录

sy-water-data-board-ui
hejunjie 1 year ago
parent
commit
8d4a19ae36
  1. 8
      src/views/dike/runManage/monitoring/dike/manage/index.vue
  2. 66
      src/views/dike/runManage/monitoring/dike/record/index.vue
  3. 2
      src/views/sluice/runManage/monitoring/sluice/manage/index.vue
  4. 84
      src/views/sluice/runManage/monitoring/sluice/record/index.vue

8
src/views/dike/runManage/monitoring/dike/manage/index.vue

@ -29,6 +29,12 @@ export default {
dom: '', dom: '',
visible: false visible: false
}, },
areasOptions: [], //
adcdOptions: [], //
areasOptionProps: {
emitPath: false,
checkStrictly: true, //
},
mdl: null, mdl: null,
tableData: [], // tableData: [], //
pageData: { pageData: {
@ -162,7 +168,7 @@ export default {
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) { filterdeviceType (price) {
const data = that.xcDeviceType.filter((res) => res.dictValue == price) const data = that.xcDeviceType.filter((res) => res.dictValue == price)
return data[0] ? data[0].dictLabel : '/' return data[0] ? data[0].dictLabel : '/'

66
src/views/dike/runManage/monitoring/dike/record/index.vue

@ -3,6 +3,7 @@
import { import {
getRunDFDeviceRecordList getRunDFDeviceRecordList
} from "@/api/dike"; } from "@/api/dike";
import { getAreasData } from "@/api/areas/index";
import { import {
getDicts getDicts
} from "@/api/management"; } from "@/api/management";
@ -11,6 +12,7 @@ export default {
name: "record", name: "record",
data() { data() {
return { return {
xcDeviceType: [],
xcWarnningType: [], xcWarnningType: [],
xcWarnningLevelType: [], xcWarnningLevelType: [],
searchForm: { searchForm: {
@ -19,6 +21,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: {
@ -39,7 +47,6 @@ export default {
this.getTableData(); this.getTableData();
}, },
search() { search() {
console.log(this.searchForm)
this.pageData.pageNum = 1; this.pageData.pageNum = 1;
this.getTableData(); this.getTableData();
}, },
@ -51,6 +58,30 @@ export default {
this.$refs['searchForm'].resetFields() this.$refs['searchForm'].resetFields()
this.getTableData(); this.getTableData();
}, },
//
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;
}
});
},
// //
getTableData() { getTableData() {
getRunDFDeviceRecordList({ getRunDFDeviceRecordList({
@ -89,6 +120,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 +144,12 @@ export default {
getDicts("xc_df_warnning_level").then((res) => { getDicts("xc_df_warnning_level").then((res) => {
this.xcWarnningLevelType = res.data; this.xcWarnningLevelType = res.data;
}); });
//
getDicts("xc_df_device_type").then((res) => {
this.xcDeviceType = res.data;
});
// //
await this.getTreeData();
await this.getTableData(); await this.getTableData();
}, },
}; };
@ -155,6 +204,21 @@ 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="dikeName" align="center" label="所属堤防">
</el-table-column>
<el-table-column align="center" label="具体地点">
<template slot-scope="scope">
{{ scope.row.adcdStart | filterAdcd }}
{{ scope.row.adcdEnd | 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 }}

2
src/views/sluice/runManage/monitoring/sluice/manage/index.vue

@ -162,7 +162,7 @@ export default {
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) { filterdeviceType (price) {
const data = that.xcDeviceType.filter((res) => res.dictValue == price) const data = that.xcDeviceType.filter((res) => res.dictValue == price)
return data[0] ? data[0].dictLabel : '/' return data[0] ? data[0].dictLabel : '/'

84
src/views/sluice/runManage/monitoring/sluice/record/index.vue

@ -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>

Loading…
Cancel
Save