Merge pull request 'master' (#1) from master into yinyongshui

Reviewed-on: http://git.gxwebsoft.com/shengtaiting/shengtai-admin/pulls/1
This commit is contained in:
南宁网宿科技
2021-12-08 11:20:59 +08:00
11 changed files with 396 additions and 187 deletions

View File

@@ -1,14 +1,14 @@
import axios from 'axios';
// -------------------江河--水功能数据统计列表-----------------------
const autonomyWaterFunctionTotalUrl = '/waterFunctionArea/riverStatic/autoPage';
// const autonomyWaterFunctionTotalUrl = '/waterFunctionArea/riverStatic/autoPage';
const nationalWaterFunctionTotalUrl = '/waterFunctionArea/riverStatic/nationalPage';
//国家级水功能统计
const nationalWaterFunctionTotal = function (data) {
return axios.get("/waterFunctionArea/riverStatic/nationalPage",data)
const listNationalWaterFunctionTotal = function (data) {
return axios.post("/waterFunctionArea/riverStatic/nationalPage",data)
}
// /自治区水功能统计
const autonomyWaterFunctionTotal = function (data) {
return axios.get("/waterFunctionArea/riverStatic/autoPage",data)
const listAutonomyWaterFunctionTotal = function (data) {
return axios.post("/waterFunctionArea/riverStatic/autoPage",data)
}
@@ -64,10 +64,10 @@ const listTargetInfo = function () {
return axios.get("/waterFunctionArea/riverWaterEvaluationStandard",{})
}
export {
autonomyWaterFunctionTotalUrl,
// autonomyWaterFunctionTotalUrl,
nationalWaterFunctionTotalUrl,
nationalWaterFunctionTotal,
autonomyWaterFunctionTotal,
listNationalWaterFunctionTotal,
listAutonomyWaterFunctionTotal,
listWaterSiteYoy,
listWaterSiteMonthTotal,
listMonthWaterQualitySandard,

View File

@@ -170,10 +170,10 @@
/* 刷新表格 */
reload() {
this.loading = true;
this.momData = [];
listMonthWaterQualitySandard(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {
this.momData = [];
this.$message.success(res.data.msg);
res.data.data.forEach((m) => {
this.momData.push(m);

View File

@@ -6,21 +6,13 @@
<a-form :model="where" layout="inline">
<a-form-item label="开始时间:">
<a-month-picker
v-model:value="where.startTime"
:disabled-date="disabledDate"
valueFormat="YYYY-MM"
placeholder="开始时间"
/>
</a-form-item>
<a-form-item label="结束时间:">
<a-month-picker
v-model:value="where.endTime"
:disabled-date="disabledDate"
valueFormat="YYYY-MM"
placeholder="结束时间"
/>
</a-form-item>
<a-month-picker v-model:value="where.startTime" :disabled-date="disabledDate" valueFormat="YYYY-MM"
placeholder="开始时间" />
</a-form-item>
<a-form-item label="结束时间:">
<a-month-picker v-model:value="where.endTime" :disabled-date="disabledDate" valueFormat="YYYY-MM"
placeholder="结束时间" />
</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">
@@ -56,8 +48,8 @@
</a-space>
</a-form>
<!-- 表格 -->
<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 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>
</div>
@@ -78,8 +70,11 @@
} from "@/api/ecology/water/river-plcae";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import {
tableColumnsBase
tableColumnsBase,
} from ".././collect/colums";
// import {
// columnsBase,
// } from "./colums";
import XLSX from "xlsx";
export default {
name: "RiverCollectWater",
@@ -93,14 +88,122 @@
locale,
bill: {},
// 表格数据接口
listColumns:[],
url: pageRiverUrl,
selection: [],
tableColumnsBase,
// columnsList: [],
flg:true,
flg2:true,
columnsCopy:[],
// 表格列配置
columnsBase: [{
title: "pH值",
dataIndex: "ph",
sorter: true,
},
{
title: "T-Hg(mg/L)",
dataIndex: "tHg",
sorter: true,
},
{
title: "溶解氧(mg/L)",
dataIndex: "dissolvedOxygen",
sorter: true,
},
{
title: "COD Mn(mg/L)",
dataIndex: "codMn",
sorter: true,
},
{
title: "COD Cr(mg/L)",
dataIndex: "codCr",
sorter: true,
},
{
title: "NH₃-N(mg/L)",
dataIndex: "nh3N",
sorter: true,
},
{
title: "T-P(mg/L)",
dataIndex: "tP",
sorter: true,
},
{
title: "Cu(mg/L)",
dataIndex: "cu",
sorter: true,
},
{
title: "Zn(mg/L)",
dataIndex: "zn",
sorter: true,
},
{
title: "Pb(mg/L)",
dataIndex: "pb",
sorter: true,
},
{
title: "Cd(mg/L)",
dataIndex: "cd",
sorter: true,
},
{
title: "BOD5(mg/L)",
dataIndex: "bod5",
sorter: true,
},
{
title: "T-As(mg/L)",
dataIndex: "tAs",
sorter: true,
},
{
title: "T-Se(mg/L)",
dataIndex: "tSe",
sorter: true,
},
{
title: "Cr6+(mg/L)",
dataIndex: "cr6",
sorter: true,
},
{
title: "Chla(mg/L)",
dataIndex: "chla",
sorter: true,
},
{
title: "S2-(mg/L)",
dataIndex: "s2",
sorter: true,
},
{
title: "石油类(mg/L)",
dataIndex: "petro",
sorter: true,
},
{
title: "CN-(mg/L)",
dataIndex: "cn",
sorter: true,
},
{
title: "F-(mg/L)",
dataIndex: "f",
sorter: true,
},
{
title: "挥发酚(mg/L)",
dataIndex: "volatilePhenol",
sorter: true,
},
],
columns: [
...tableColumnsBase,
// this.columnsList,
{
title: "NO₃-(mg/L)",
dataIndex: "no3",
@@ -137,7 +240,7 @@
waterSystemList: [],
targetInfo: {},
targetInfoList: [],
datasource:{},
datasource: {},
};
},
mounted() {
@@ -158,11 +261,11 @@
this.visibleWater = true;
this.sectionInfo = res.data.data
res.data.data.forEach((m) => {
this.waterSystemList.push(m.waterBody);
this.waterBodyList.push(m.importWaterBody);
})
this.waterSystemList = [...new Set(this.waterSystemList)];
this.waterBodyList = [...new Set(this.waterBodyList)];
this.waterSystemList.push(m.waterBody);
this.waterBodyList.push(m.importWaterBody);
})
this.waterSystemList = [...new Set(this.waterSystemList)];
this.waterBodyList = [...new Set(this.waterBodyList)];
} else {
this.$message.error(res.data.msg);
}
@@ -185,164 +288,188 @@
loadOptionData() {},
/* 刷新表格 */
reload() {
console.log(this.where.targetName);
if (this.where.targetName) {
if(this.flg){
this.columnsCopy = this.columnsBase;
}
this.flg = false;
this.columnsBase = [];
console.log(this.columnsBase);
var arr = this.where.targetName
arr.forEach((a) => {
if (a == 'ph') {
this.columns.push({
this.columnsBase.push({
title: "pH值",
dataIndex: "ph",
sorter: true,
}, )
}
if (a == '汞') {
this.columns.push({
this.columnsBase.push({
title: "T-Hg(mg/L)",
dataIndex: "tHg",
sorter: true,
}, )
}
if (a == '溶解氧') {
this.columns.push({
this.columnsBase.push({
title: "溶解氧(mg/L)",
dataIndex: "dissolvedOxygen",
sorter: true,
}, )
}
if (a == '高锰酸盐指数') {
this.columns.push({
this.columnsBase.push({
title: "COD Mn(mg/L)",
dataIndex: "codMn",
sorter: true,
}, )
}
if (a == '化学需氧量') {
this.columns.push({
this.columnsBase.push({
title: "COD Cr(mg/L)",
dataIndex: "codCr",
sorter: true,
}, )
}
if (a == '氨氮') {
this.columns.push({
this.columnsBase.push({
title: "NH₃-N(mg/L)",
dataIndex: "nh3N",
sorter: true,
}, )
}
if (a == '总磷') {
this.columns.push({
this.columnsBase.push({
title: "T-P(mg/L)",
dataIndex: "tP",
sorter: true,
}, )
}
if (a == '铜') {
this.columns.push({
this.columnsBase.push({
title: "Cu(mg/L)",
dataIndex: "cu",
sorter: true,
}, )
}
if (a == '锌') {
this.columns.push({
this.columnsBase.push({
title: "Zn(mg/L)",
dataIndex: "zn",
sorter: true,
}, )
}
if (a == '铅') {
this.columns.push({
this.columnsBase.push({
title: "Pb(mg/L)",
dataIndex: "pb",
sorter: true,
}, )
}
if (a == '镉') {
this.columns.push({
this.columnsBase.push({
title: "Cd(mg/L)",
dataIndex: "cd",
sorter: true,
}, )
}
if (a == '五日生化需氧量') {
this.columns.push({
this.columnsBase.push({
title: "BOD5(mg/L)",
dataIndex: "bod5",
sorter: true,
}, )
}
if (a == '砷') {
this.columns.push({
this.columnsBase.push({
title: "T-As(mg/L)",
dataIndex: "tAs",
sorter: true,
}, )
}
if (a == '硒') {
this.columns.push({
this.columnsBase.push({
title: "T-Se(mg/L)",
dataIndex: "tSe",
sorter: true,
}, )
}
if (a == '铬') {
this.columns.push({
this.columnsBase.push({
title: "Cr6+(mg/L)",
dataIndex: "cr6",
sorter: true,
}, )
}
if (a == '阴离子表面活性剂') {
this.columns.push({
this.columnsBase.push({
title: "Chla(mg/L)",
dataIndex: "chla",
sorter: true,
}, )
}
if (a == '硫化物') {
this.columns.push({
this.columnsBase.push({
title: "S2-(mg/L)",
dataIndex: "s2",
sorter: true,
}, )
}
if (a == '石油类') {
this.columns.push({
this.columnsBase.push({
title: "石油类(mg/L)",
dataIndex: "petro",
sorter: true,
}, )
}
if (a == '氰化物') {
this.columns.push({
this.columnsBase.push({
title: "CN-(mg/L)",
dataIndex: "cn",
sorter: true,
})
}
if (a == '氟化物') {
this.columns.push({
this.columnsBase.push({
title: "F-(mg/L)",
dataIndex: "f",
sorter: true,
}, )
}
if (a == '挥发酚') {
this.columns.push({
this.columnsBase.push({
title: "挥发酚(mg/L)",
dataIndex: "volatilePhenol",
sorter: true,
}, )
}
console.log("bbbb" + this.columns);
console.log("bbbb" + this.columnsBase);
});
}else{
if(this.flg2){
this.listColumns= this.columns;
}
this.flg2 =false;
}
// this.$refs.table.reload({
// where: this.where,
// });
this.columns = [];
if(this.listColumns.length>0){
this.listColumns.forEach((i=>{
this.columns.push(i);
}))
}
if(this.columnsBase.length>0){
this.columnsBase.forEach((e=>{
this.columns.push(e);
}))
}else{
this.columnsCopy.forEach((e=>{
this.columns.push(e);
}))
}
listAllRiver(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {

View File

@@ -1,50 +1,109 @@
const exportColumns = [
{title: "断面编码",dataIndex: "sectionCode",sorter: true,},
{title: "断面名称",dataIndex: "sectionName",sorter: true,},
{title: "考核省份",dataIndex: "evaluationProvince",sorter: true,},
{title: "断面类型",dataIndex: "sectionType",sorter: true,},
{title: "断面属性",dataIndex: "sectionAttributes",sorter: true,},
{title: "流域",dataIndex: "watershed",sorter: true,},
{title: "水系",dataIndex: "waterSystem",sorter: true,},
// {title: "监测时间",dataIndex: "monitorTime",sorter: true,},
{title: "所在水体",dataIndex: "waterBody",sorter: true,},
{title: "汇入水体 ",dataIndex: "intoWaterBody",sorter: true,},
{title: "河流级别",dataIndex: "riverLevel",sorter: true,},
{title: "监测年份",dataIndex: "monitoringYear",sorter: true,},
{title: "监测月份",dataIndex: "monitoringMonth",sorter: true,},
{title: "水质类别",dataIndex: "waterQualityCategory",sorter: true,},
{title: "电导率(ms/m)",dataIndex: "conductivity",sorter: true,},
{title: "水温(℃)",dataIndex: "waterTemperature",sorter: true,},
{title: "pH值",dataIndex: "ph",sorter: true,},
{title: "溶解氧(mg/L)",dataIndex: "dissolvedOxygen",sorter: true,},
{title: "透明度(cm)",dataIndex: "transparency",sorter: true,},
{title: "盐度(‰)",dataIndex: "salinity",sorter: true,},
{title: "COD Mn(mg/L)",dataIndex: "codMn",sorter: true,},
{title: "COD Cr(mg/L)",dataIndex: "codCr",sorter: true,},
{title: "NH₃-N(mg/L)",dataIndex: "nh3N",sorter: true,},
{title: "T-P(mg/L)",dataIndex: "tP",sorter: true,},
{title: "T-N(mg/L)",dataIndex: "tN",sorter: true,},
{title: "Cu(mg/L)",dataIndex: "cu",sorter: true,},
{title: "Zn(mg/L)",dataIndex: "zn",sorter: true,},
{title: "Pb(mg/L)",dataIndex: "pb",sorter: true,},
{title: "Cd(mg/L)",dataIndex: "cd",sorter: true,},
{title: "BOD5(mg/L)",dataIndex: "bod5",sorter: true,},
{title: "T-As(mg/L)",dataIndex: "tAs",sorter: true,},
{title: "T-Se(mg/L)",dataIndex: "tSe",sorter: true,},
{title: "T-Hg(mg/L)",dataIndex: "tHg",sorter: true,},
{title: "Cr6+(mg/L)",dataIndex: "cr6",sorter: true,},
{title: "F-(mg/L)",dataIndex: "f",sorter: true,},
{title: "CN-(mg/L)",dataIndex: "cn",sorter: true,},
{title: "挥发酚(mg/L)",dataIndex: "volatilePhenol",sorter: true,},
{title: "石油类(mg/L)",dataIndex: "petro",sorter: true,},
{title: "LAS(mg/L)",dataIndex: "las",sorter: true,},
{title: "S2-(mg/L)",dataIndex: "s2",sorter: true,},
{title: "Chla(mg/L)",dataIndex: "chla",sorter: true,},
{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,},
const columnsBase = [
{
title: "pH值",
dataIndex: "ph",
sorter: true,
},
{
title: "T-Hg(mg/L)",
dataIndex: "tHg",
sorter: true,
},
{
title: "溶解氧(mg/L)",
dataIndex: "dissolvedOxygen",
sorter: true,
},
{
title: "COD Mn(mg/L)",
dataIndex: "codMn",
sorter: true,
},
{
title: "COD Cr(mg/L)",
dataIndex: "codCr",
sorter: true,
},
{
title: "NH₃-N(mg/L)",
dataIndex: "nh3N",
sorter: true,
},
{
title: "T-P(mg/L)",
dataIndex: "tP",
sorter: true,
},
{
title: "Cu(mg/L)",
dataIndex: "cu",
sorter: true,
},
{
title: "Zn(mg/L)",
dataIndex: "zn",
sorter: true,
},
{
title: "Pb(mg/L)",
dataIndex: "pb",
sorter: true,
},
{
title: "Cd(mg/L)",
dataIndex: "cd",
sorter: true,
},
{
title: "BOD5(mg/L)",
dataIndex: "bod5",
sorter: true,
},
{
title: "T-As(mg/L)",
dataIndex: "tAs",
sorter: true,
},
{
title: "T-Se(mg/L)",
dataIndex: "tSe",
sorter: true,
},
{
title: "Cr6+(mg/L)",
dataIndex: "cr6",
sorter: true,
},
{
title: "Chla(mg/L)",
dataIndex: "chla",
sorter: true,
},
{
title: "S2-(mg/L)",
dataIndex: "s2",
sorter: true,
},
{
title: "石油类(mg/L)",
dataIndex: "petro",
sorter: true,
},
{
title: "CN-(mg/L)",
dataIndex: "cn",
sorter: true,
},
{
title: "F-(mg/L)",
dataIndex: "f",
sorter: true,
},
{
title: "挥发酚(mg/L)",
dataIndex: "volatilePhenol",
sorter: true,
},
];
export {exportColumns}
export {columnsBase}

View File

@@ -185,6 +185,7 @@
this.loading = true;
listAutoStandard(this.where).then((res) => {
console.log(res.data.data);
this.datasource = [];
if (res.data.code == 0) {
this.$message.success(res.data.msg);
for (var key in res.data.data) {
@@ -246,10 +247,14 @@
if (month == '12') {
target.december = e.waterQualityCategory;
}
target.standardRate = e.standardRate;
target.standard = e.standard;
console.log(arr.length);
if(arr.length == '12'){
target.standardRate = e.standardRate;
target.standard = e.standard;
}
})
this.datasource.push(target);
}
} else {

View File

@@ -54,6 +54,7 @@
</template>
<script>
import moment from "moment";
import {
listAutoYoy,
} from "@/api/ecology/river-statis";
@@ -82,8 +83,9 @@
},
{
title: "时间",
dataIndex: "monitorTime",
dataIndex: "samplingTime",
sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM").format("YYYY-MM")
},
{
title: "水质目标",

View File

@@ -21,8 +21,8 @@
</a-form-item>
<a-form-item label="监测类型">
<a-select v-model:value="where.monitorType" placeholder="请选择监测类型" allowClear showSearch>
<a-select-option :value="'1'">全因子</a-select-option>
<a-select-option :value="'2'">纳污红线</a-select-option>
<a-select-option :value="'1'">全因子</a-select-option>
<a-select-option :value="'2'">纳污红线</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="起始日期:">
@@ -45,7 +45,7 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<ele-pro-table ref="table" :datasource="url" :columns="columns" :where="where"
<ele-pro-table ref="table" :datasource="datasource" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
@@ -56,7 +56,7 @@
<script>
import {
autonomyWaterFunctionTotalUrl,
listAutonomyWaterFunctionTotal,
} from "@/api/ecology/river-statis";
import {
listInfo
@@ -73,9 +73,8 @@
return {
data: [],
locale,
// datasource: {},
datasource: [],
// 表格数据接口
url: autonomyWaterFunctionTotalUrl,
selection: [],
tableColumns,
// 表格列配置
@@ -117,21 +116,23 @@
/* 刷新表格 */
reload() {
this.loading = true;
console.log(this.where);
this.$refs.table.reload({
where: this.where,
});
// autonomyWaterFunctionTotal(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);
// }
// this.loading = false;
// });
this.loading = false;
listAutonomyWaterFunctionTotal(this.where).then((res) => {
this.datasource = [];
console.log(res.data.data);
if (res.data.code == 0) {
this.$message.success(res.data.msg);
if(res.data.data != undefined){
res.data.data.forEach((e=>{
this.datasource.push(e);
}))
}
} else {
this.$message.error(res.data.msg);
}
this.loading = false;
});
this.loading = false;
},
/* 重置搜索 */
reset() {

View File

@@ -1,8 +1,9 @@
import moment from "moment";
const tableColumns = [
{title: "水体类型", dataIndex: "waterBodyType", sorter: true,},
{title: "水资源一级区名称", dataIndex: "waterResourcesFirstLevelZoneName", sorter: true,},
{title: "水质目标", dataIndex: "waterQualityGoal", sorter: true,},
{title: "采样时间", dataIndex: "monitorTime", sorter: true,},
{title: "采样时间", dataIndex: "monitorTime", sorter: true, customRender: ({text})=> moment(text,"YYYY/MM/DD").format("YYYY-MM-DD")},
{title: "数据来源", dataIndex: "dataSources", sorter: true,},
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
{title: "水温", dataIndex: "wtemp", sorter: true,},
@@ -59,7 +60,7 @@ const tableColumns = [
{title: "水体类型", dataIndex: "waterBodyType", sorter: true,},
{title: "水资源一级区名称", dataIndex: "waterResourcesFirstLevelZoneName", sorter: true,},
{title: "水质目标", dataIndex: "waterQualityGoal", sorter: true,},
{title: "采样时间", dataIndex: "samplingTime", sorter: true,},
{title: "采样时间", dataIndex: "samplingTime", sorter: true, customRender: ({text})=> moment(text,"YYYY/MM/DD").format("YYYY-MM-DD")},
{title: "数据来源", dataIndex: "dataSources", sorter: true,},
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
{title: "水温", dataIndex: "wtemp", sorter: true,},

View File

@@ -183,6 +183,7 @@
/* 刷新表格 */
reload() {
this.loading = true;
this.datasource = [];
listNationalStandard(this.where).then((res) => {
console.log(res.data.data);
if (res.data.code == 0) {

View File

@@ -54,6 +54,7 @@
</template>
<script>
import moment from "moment";
import {
listNationalYoy,
} from "@/api/ecology/river-statis";
@@ -69,7 +70,7 @@
return {
data: [],
locale,
datasource: {},
datasource: [],
// 表格数据接口
// url: autonomyWaterFunctionTotalUrl,
selection: [],
@@ -84,6 +85,7 @@
title: "时间",
dataIndex: "samplingTime",
sorter: true,
customRender: ({text})=> moment(text,"YYYY/MM").format("YYYY-MM")
},
{
title: "水质目标",
@@ -136,8 +138,13 @@
this.loading = true;
listNationalYoy(this.where).then((res) => {
console.log(res.data.data);
this.datasource = [];
if (res.data.code == 0) {
this.datasource = res.data.data;
if (res.data.data) {
res.data.data.forEach(e => {
this.datasource.push(e);
})
}
} else {
this.$message.error(res.data.msg);
}

View File

@@ -21,8 +21,8 @@
</a-form-item>
<a-form-item label="监测类型">
<a-select v-model:value="where.monitorType" placeholder="请选择监测类型" allowClear showSearch>
<a-select-option :value="'1'">全因子</a-select-option>
<a-select-option :value="'2'">纳污红线</a-select-option>
<a-select-option :value="'1'">全因子</a-select-option>
<a-select-option :value="'2'">纳污红线</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="起始日期:">
@@ -45,7 +45,7 @@
</a-form>
<!-- 表格 -->
<a-spin :spinning="loading">
<ele-pro-table ref="table" :datasource="url" :columns="columns" :where="where"
<ele-pro-table ref="table" :datasource="datasource" :columns="columns" :where="where"
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
</ele-pro-table>
</a-spin>
@@ -56,8 +56,7 @@
<script>
import {
nationalWaterFunctionTotalUrl,
// nationalWaterFunctionTotal
listNationalWaterFunctionTotal
} from "@/api/ecology/river-statis";
import {
listInfo
@@ -73,11 +72,11 @@
data() {
return {
data: [],
// datasource: {},
datasource: {},
locale,
bill: {},
// 表格数据接口
url: nationalWaterFunctionTotalUrl,
// url: nationalWaterFunctionTotalUrl,
selection: [],
nationalTableColumns,
// 表格列配置
@@ -98,54 +97,61 @@
where: this.where,
});
this.loading = false;
},
},
created() {
listInfo().then((res) => {
if (res.data.code == 0) {
console.log(res.data.data)
this.visibleWater = true;
this.sectionInfo = res.data.data
res.data.data.forEach((m) => {
created() {
listInfo().then((res) => {
if (res.data.code == 0) {
console.log(res.data.data)
this.visibleWater = true;
this.sectionInfo = res.data.data
res.data.data.forEach((m) => {
this.waterSystemList.push(m.waterBody);
})
this.waterSystemList = [...new Set(this.waterSystemList)];
} else {
this.$message.error(res.data.msg);
}
})
},
methods: {
/* 刷新表格 */
reload() {
this.loading = true;
this.$refs.table.reload({
where: this.where,
});
this.loading = false;
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 导出 */
exportFile() {
const columns = this.columns.filter(item => item.dataIndex);
const arr = [];
const th = columns.map((item) => item.title);
arr.push(th);
this.data.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]);
arr.push(td);
});
} else {
this.$message.error(res.data.msg);
}
})
},
methods: {
/* 刷新表格 */
reload() {
this.loading = true;
listNationalWaterFunctionTotal(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);
}
this.loading = false;
});
this.loading = false;
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 导出 */
exportFile() {
const columns = this.columns.filter(item => item.dataIndex);
const arr = [];
const th = columns.map((item) => item.title);
arr.push(th);
this.data.forEach((d) => {
const td = columns.map((item) => d[item.dataIndex]);
arr.push(td);
});
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
}
let sheet = XLSX.utils.aoa_to_sheet(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
}
},
};
},
};
</script>