江河模块修改

This commit is contained in:
shixiaoman
2021-12-02 22:03:06 +08:00
parent 0cf94c370e
commit bff3daa644
11 changed files with 667 additions and 131 deletions

View File

@@ -30,53 +30,50 @@
</a-col>
</a-row>
</a-form> -->
<a-form
:model="where"
layout="inline"
>
<a-form-item label="起始日期:">
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeStart"></a-date-picker>
</a-form-item>
<a-form-item label="结束日期:">
<a-date-picker valueFormat="YYYY-MM-DD 23:59:59" v-model:value="where.timeEnd"></a-date-picker>
</a-form-item>
<a-form-item label="断面名称">
<a-select allow-clear mode="multiple" placeholder="请选择断面名称" v-model:value="where.name">
<a-select-option v-for="item in sectionInfo" :key="item.sectionName" :value="item.sectionName">
{{ item.sectionName }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="河段名称">
<a-select v-model:value="where.riverLakeLibrary" allowClear showSearch>
<a-select-option v-for="item in waterSystemList" :key="item">{{ item }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="水系名称">
<a-select v-model:value="where.waterSystem" allowClear showSearch>
<a-select-option v-for="item in waterBodyList" :key="item">{{ item }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="指标名称">
<a-select allow-clear mode="multiple" placeholder="请选择指标名称" v-model:value="where.targetName">
<a-select-option v-for="item in targetInfoList" :key="item" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
<a-form :model="where" layout="inline">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form>
<a-form-item label="起始日期:">
<a-date-picker valueFormat="YYYY-MM-DD 00:00:00" v-model:value="where.timeStart"></a-date-picker>
</a-form-item>
<a-form-item label="结束日期:">
<a-date-picker valueFormat="YYYY-MM-DD 23:59:59" v-model:value="where.timeEnd"></a-date-picker>
</a-form-item>
<a-form-item label="断面名称">
<a-select allow-clear mode="multiple" placeholder="请选择断面名称" v-model:value="where.name">
<a-select-option v-for="item in sectionInfo" :key="item.sectionName" :value="item.sectionName">
{{ item.sectionName }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="河段名称">
<a-select v-model:value="where.waterBody" allowClear showSearch>
<a-select-option v-for="item in waterSystemList" :key="item">{{ item }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="水系名称">
<a-select v-model:value="where.waterSystem" allowClear showSearch>
<a-select-option v-for="item in waterBodyList" :key="item">{{ item }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="指标名称">
<a-select allow-clear mode="multiple" placeholder="请选择指标名称" v-model:value="where.targetName">
<a-select-option v-for="item in targetInfoList" :key="item" :value="item">
{{ item }}
</a-select-option>
</a-select>
</a-form-item>
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form>
<!-- 表格 -->
<ele-pro-table ref="table" row-key="surfaceWaterSectionId" :datasource="url" :columns="columns" :where="where"
<ele-pro-table ref="table" row-key="surfaceWaterSectionId" :datasource="datasource" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-card>
@@ -87,7 +84,8 @@
<script>
import {
getRiverBill,
pageRiverUrl
pageRiverUrl,
listAllRiver
} from "@/api/ecology/river";
import {
listTargetInfo,
@@ -97,7 +95,7 @@
} from "@/api/ecology/water/river-plcae";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import {
tableColumns
tableColumnsBase
} from ".././collect/colums";
import XLSX from "xlsx";
export default {
@@ -114,23 +112,49 @@
// 表格数据接口
url: pageRiverUrl,
selection: [],
tableColumns,
tableColumnsBase,
// columnsList: [],
// 表格列配置
columns: [
...tableColumns,
...tableColumnsBase,
// this.columnsList,
{
title: "NO₃-(mg/L)",
dataIndex: "no3",
sorter: true,
},
{
title: "NO₂-(mg/L)",
dataIndex: "no2",
sorter: true,
},
{
title: "流量(m³/s)",
dataIndex: "flow",
sorter: true,
},
{
title: "水位",
dataIndex: "waterLevel",
sorter: true,
},
{
title: "备注",
dataIndex: "remark",
sorter: true,
},
],
// 表格搜索条件
surfaceWaterSectionBillId: billId,
where: {
surfaceWaterSectionBillId: billId,
},
where: {},
sectionInfo: {},
loading: false,
rules: {},
waterBodyList: [],
waterSystemList: [],
targetInfo:{},
targetInfoList:[],
targetInfo: {},
targetInfoList: [],
datasource:{},
};
},
mounted() {
@@ -146,41 +170,203 @@
},
created() {
listInfo().then((res) => {
if (res.data.code == 0) {
console.log(res.data.data)
this.visibleWater = true;
this.sectionInfo = res.data.data
} else {
this.$message.error(res.data.msg);
}
}),
listTargetInfo().then((res) => {
if (res.data.code == 0) {
console.log(res.data.data)
this.targetInfo = res.data.data
res.data.data.forEach((m) => {
this.targetInfoList.push(m.indicatorName);
})
this.targetInfoList = [...new Set(this.targetInfoList)];
} else {
this.$message.error(res.data.msg);
}
})
if (res.data.code == 0) {
console.log(res.data.data)
this.visibleWater = true;
this.sectionInfo = res.data.data
} else {
this.$message.error(res.data.msg);
}
}),
listTargetInfo().then((res) => {
if (res.data.code == 0) {
console.log(res.data.data)
this.targetInfo = res.data.data
res.data.data.forEach((m) => {
this.targetInfoList.push(m.indicatorName);
})
this.targetInfoList = [...new Set(this.targetInfoList)];
} else {
this.$message.error(res.data.msg);
}
})
},
methods: {
/**获取下来框数据 */
loadOptionData() {},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
if (this.where.targetName) {
var arr = this.where.targetName
arr.forEach((a) => {
if (a == 'ph') {
this.columns.push({
title: "pH值",
dataIndex: "ph",
sorter: true,
}, )
}
if (a == '汞') {
this.columns.push({
title: "T-Hg(mg/L)",
dataIndex: "tHg",
sorter: true,
}, )
}
if (a == '溶解氧') {
this.columns.push({
title: "溶解氧(mg/L)",
dataIndex: "dissolvedOxygen",
sorter: true,
}, )
}
if (a == '高锰酸盐指数') {
this.columns.push({
title: "COD Mn(mg/L)",
dataIndex: "codMn",
sorter: true,
}, )
}
if (a == '化学需氧量') {
this.columns.push({
title: "COD Cr(mg/L)",
dataIndex: "codCr",
sorter: true,
}, )
}
if (a == '氨氮') {
this.columns.push({
title: "NH₃-N(mg/L)",
dataIndex: "nh3N",
sorter: true,
}, )
}
if (a == '总磷') {
this.columns.push({
title: "T-P(mg/L)",
dataIndex: "tP",
sorter: true,
}, )
}
if (a == '铜') {
this.columns.push({
title: "Cu(mg/L)",
dataIndex: "cu",
sorter: true,
}, )
}
if (a == '锌') {
this.columns.push({
title: "Zn(mg/L)",
dataIndex: "zn",
sorter: true,
}, )
}
if (a == '铅') {
this.columns.push({
title: "Pb(mg/L)",
dataIndex: "pb",
sorter: true,
}, )
}
if (a == '镉') {
this.columns.push({
title: "Cd(mg/L)",
dataIndex: "cd",
sorter: true,
}, )
}
if (a == '五日生化需氧量') {
this.columns.push({
title: "BOD5(mg/L)",
dataIndex: "bod5",
sorter: true,
}, )
}
if (a == '砷') {
this.columns.push({
title: "T-As(mg/L)",
dataIndex: "tAs",
sorter: true,
}, )
}
if (a == '硒') {
this.columns.push({
title: "T-Se(mg/L)",
dataIndex: "tSe",
sorter: true,
}, )
}
if (a == '铬') {
this.columns.push({
title: "Cr6+(mg/L)",
dataIndex: "cr6",
sorter: true,
}, )
}
if (a == '阴离子表面活性剂') {
this.columns.push({
title: "Chla(mg/L)",
dataIndex: "chla",
sorter: true,
}, )
}
if (a == '硫化物') {
this.columns.push({
title: "S2-(mg/L)",
dataIndex: "s2",
sorter: true,
}, )
}
if (a == '石油类') {
this.columns.push({
title: "石油类(mg/L)",
dataIndex: "petro",
sorter: true,
}, )
}
if (a == '氰化物') {
this.columns.push({
title: "CN-(mg/L)",
dataIndex: "cn",
sorter: true,
})
}
if (a == '氟化物') {
this.columns.push({
title: "F-(mg/L)",
dataIndex: "f",
sorter: true,
}, )
}
if (a == '挥发酚') {
this.columns.push({
title: "挥发酚(mg/L)",
dataIndex: "volatilePhenol",
sorter: true,
}, )
}
console.log("bbbb" + this.columns);
});
}
// this.$refs.table.reload({
// where: this.where,
// });
listAllRiver(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {
this.$message.success(res.data.msg);
this.datasource = res.data.data
} else {
this.$message.error(res.data.msg);
}
});
},
/* 重置搜索 */
reset() {
this.where = {
surfaceWaterSectionId: this.surfaceWaterSectionId,
};
this.where = {};
this.reload();
},
/* 导出 */