饮用水框架页面

This commit is contained in:
庞东林
2021-12-14 10:20:11 +08:00
parent c95c693570
commit c36a162d33
11 changed files with 778 additions and 38 deletions

View File

@@ -19,6 +19,7 @@
row-key="drinkingWaterId"
:datasource="datasource"
:columns="columns"
:total="count"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"

View File

@@ -52,7 +52,6 @@
// 水质达标情况
import waterQualityUp from "./waterQualityUp.vue";
//综合营养指数
import waterNutritional from "./waterNutritional.vue"

View File

@@ -73,13 +73,13 @@ export default {
selection: [],
columns:[
{title:"城市名称",dataIndex:"city",},
{title:"水源地名称",dataIndex:"place",},
{title:"水源地名称",dataIndex:"sourceWaterName",},
{title:"期数",dataIndex:"sourceWaterName",},
{title:"水源地性质",dataIndex:"waterSourceProperty",},
{title:"断面水质",align: 'center',children: [
{title: "本月", dataIndex: ""},
{title: "上月", dataIndex: ""},
{title: "去年同期", dataIndex: ""},
{title: "本月", dataIndex: "waterQualityCategory"},
{title: "上月", dataIndex: "waterQualityCategoryMom"},
{title: "去年同期", dataIndex: "waterQualityCategoryYoy"},
]
},
{title:"主要污染指标",dataIndex:"",},
@@ -89,7 +89,7 @@ export default {
// 表格列配置
// 表格搜索条件
// 表格搜索条件
where: {
checked: 1,
},

View File

@@ -72,12 +72,12 @@ export default {
datasource:{},
selection: [],
columns:[
{title:"断面名称",dataIndex:"city",},
{title:"时间",dataIndex:"place",},
{title:"水质目标",dataIndex:"sourceWaterName",},
{title:"水质类别",dataIndex:"waterSourceProperty",},
{title: "达标情况", dataIndex: ""},
{title: "达标率", dataIndex: ""},
{title:"断面名称",dataIndex:"sectionName",},
{title:"时间",dataIndex:"time",},
{title:"水质目标",dataIndex:"waterTarget",},
{title:"水质类别",dataIndex:"waterQualityCategory",},
{title: "达标情况", dataIndex: "standard"},
{title: "达标率", dataIndex: "standardRate"},
// {title:"达标情况",align: 'center',children: [
// {title: "达标情况", dataIndex: ""},
// {title: "达标率", dataIndex: ""},
@@ -112,7 +112,12 @@ export default {
this.$message.error(res.data.msg);
this.datasource = []
}else{
this.datasource = res.data.data
let newData = []
const resData = res.data.data || {}
for(let i in resData){
newData.push(resData[i])
}
this.datasource = newData
}
}).catch(()=>{
this.loading = false;

View File

@@ -4,6 +4,15 @@
<a-tab-pane tab="监测数据报送表" key="base" >
<base-statistic :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base'"></base-statistic>
</a-tab-pane>
<a-tab-pane tab="水质类别" key="base2" >
<water-quality :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base2'"></water-quality>
</a-tab-pane>
<a-tab-pane tab="水质达标情况" key="base8" >
<water-quality-up :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base8'"></water-quality-up>
</a-tab-pane>
<!-- <a-tab-pane tab="报送情况说明表" key="base1">
<county-appraise :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base1'"></county-appraise>
</a-tab-pane>
@@ -13,16 +22,12 @@
<a-tab-pane tab="超标评价" key="base4">
<county-over-standard :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base4'"></county-over-standard>
</a-tab-pane> -->
<!--<a-tab-pane tab="水质类别" key="base2" >
<city-water-quality :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base2'"></city-water-quality>
</a-tab-pane>
<!--
<a-tab-pane tab="水质统计" key="base7" >
<water-quality-count :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base7'"></water-quality-count>
</a-tab-pane>
<a-tab-pane tab="水质达标情况" key="base8" >
<water-quality-up :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base8'"></water-quality-up>
</a-tab-pane>
<a-tab-pane tab="备用水源营养指数" key="base5">
<water-nutritional :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base5'"></water-nutritional>
</a-tab-pane> -->
@@ -45,12 +50,12 @@
// import countyWaterWithdrawal from "./waterCount.vue"
// // 超标评价
// import countyOverStandard from './overStandard.vue'
// // 水质类别
// import cityWaterQuality from "./waterQuality.vue"
// 水质类别
import waterQuality from "./waterQuality.vue"
// // 水质统计
// import waterQualityCount from "./waterQualityCount.vue";
// // 水质达标情况
// import waterQualityUp from "./waterQualityUp.vue";
// 水质达标情况
import waterQualityUp from "./waterQualityUp.vue";
// //综合营养指数
// import waterNutritional from "./waterNutritional.vue"
@@ -64,9 +69,9 @@
components: {
BaseStatistic,
// countyAppraise,
// cityWaterQuality,
waterQuality,
// waterQualityCount,
// waterQualityUp,
waterQualityUp,
// waterNutritional,
// countyWaterWithdrawal,
// countyOverStandard

View File

@@ -0,0 +1,183 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search
:searchForm="searchForm"
:filterKeys="filterKeys"
@search="searchData"
@exportFile="exportFile"
@filterColumns="changeFilter"
:visiable="visiable"
:loading="loading"
/>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="datasource"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
import XLSX from "xlsx";
import {
villageWaterQualityData
} from "@/api/ecology/new-drinking-water";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from "./../components/countySideSeatch.vue";
export default {
name: "waterQuality",
components: {
Search
},
props:{
// 表格搜索条件
searchForm:{
typeof:Object,
default: function () {
return {}
},
},
filterKeys:{
typeof:Object,
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
datasource:{},
selection: [],
columns:[
{title:"城市名称",dataIndex:"city",},
{title:"水源地名称",dataIndex:"sourceWaterName",},
{title:"期数",dataIndex:"sourceWaterName",},
{title:"水源地性质",dataIndex:"waterSourceProperty",},
{title:"断面水质",align: 'center',children: [
{title: "本月", dataIndex: "waterQualityCategory"},
{title: "上月", dataIndex: "waterQualityCategoryMom"},
{title: "去年同期", dataIndex: "waterQualityCategoryYoy"},
]
},
{title:"主要污染指标",dataIndex:"",},
],
// 表格列配置
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
loading:false
};
},
mounted() {
},
methods: {
// 获取列表数据
getPageData(){
this.loading = true;
villageWaterQualityData(this.where).then(res=>{
this.loading = false;
if(res.data.code){
this.$message.error(res.data.msg);
this.datasource = []
}else{
this.datasource = res.data.data
}
}).catch(()=>{
this.loading = false;
})
},
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
// 执行搜索
searchData(data){
this.where = data;
this.$emit("search", this.where);
this.reload();
},
/* 刷新表格 */
reload() {
this.getPageData()
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [...this.columns];
const arr = [];
let th1 = []
let th2 = []
const sColumns = []
columns.forEach(item=>{
th1.push(item.title)
if(Array.isArray(item.children) && item.children.length>0){
item.children.forEach(single=>{
th1.push('')
th2.push(single.title)
sColumns.push({dataIndex:single.dataIndex})
})
}else{
th2.push('')
sColumns.push({dataIndex:item.dataIndex})
}
})
arr.push(th1)
arr.push(th2)
this.datasource.forEach((d) => {
const td = sColumns.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());
},
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,165 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search
:searchForm="searchForm"
:filterKeys="filterKeys"
@search="searchData"
@exportFile="exportFile"
@filterColumns="changeFilter"
:visiable="visiable"
:loading="loading"
/>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="datasource"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
import XLSX from "xlsx";
import {
villageWaterQualityUpData
} from "@/api/ecology/new-drinking-water";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from "./../components/countySideSeatch.vue";
export default {
name: "waterQuality",
components: {
Search
},
props:{
// 表格搜索条件
searchForm:{
typeof:Object,
default: function () {
return {}
},
},
filterKeys:{
typeof:Object,
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
datasource:{},
selection: [],
columns:[
{title:"断面名称",dataIndex:"sectionName",},
{title:"时间",dataIndex:"time",},
{title:"水质目标",dataIndex:"waterTarget",},
{title:"水质类别",dataIndex:"waterQualityCategory",},
{title: "达标情况", dataIndex: "standard"},
{title: "达标率", dataIndex: "standardRate"},
],
// 表格列配置
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
loading:false
};
},
mounted() {
},
methods: {
// 获取列表数据
getPageData(){
this.loading = true;
villageWaterQualityUpData(this.where).then(res=>{
this.loading = false;
if(res.data.code){
this.$message.error(res.data.msg);
this.datasource = []
}else{
let newData = []
const resData = res.data.data || {}
for(let i in resData){
newData.push(resData[i])
}
this.datasource = newData
}
}).catch(()=>{
this.loading = false;
})
},
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
// 执行搜索
searchData(data){
this.where = data;
this.$emit("search", this.where);
this.reload();
},
/* 刷新表格 */
reload() {
this.getPageData()
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...this.columns,
];
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());
},
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -13,16 +13,21 @@
<a-tab-pane tab="超标评价" key="base4">
<county-over-standard :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base4'"></county-over-standard>
</a-tab-pane>
<!--<a-tab-pane tab="水质类别" key="base2" >
<city-water-quality :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base2'"></city-water-quality>
<a-tab-pane tab="水质类别" key="base2" >
<water-quality :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base2'"></water-quality>
</a-tab-pane>
<a-tab-pane tab="水质达标情况" key="base8" >
<water-quality-up :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base8'"></water-quality-up>
</a-tab-pane>
<!--
<a-tab-pane tab="水质统计" key="base7" >
<water-quality-count :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base7'"></water-quality-count>
</a-tab-pane>
<a-tab-pane tab="水质达标情况" key="base8" >
<water-quality-up :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base8'"></water-quality-up>
</a-tab-pane>
<a-tab-pane tab="备用水源营养指数" key="base5">
<water-nutritional :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='base5'"></water-nutritional>
</a-tab-pane> -->
@@ -45,12 +50,12 @@
import countyWaterWithdrawal from "./waterCount.vue"
// 超标评价
import countyOverStandard from './overStandard.vue'
// // 水质类别
// import cityWaterQuality from "./waterQuality.vue"
// 水质类别
import waterQuality from "./waterQuality.vue"
// // 水质统计
// import waterQualityCount from "./waterQualityCount.vue";
// // 水质达标情况
// import waterQualityUp from "./waterQualityUp.vue";
// 水质达标情况
import waterQualityUp from "./waterQualityUp.vue";
// //综合营养指数
// import waterNutritional from "./waterNutritional.vue"
@@ -64,9 +69,9 @@
components: {
BaseStatistic,
countyAppraise,
// cityWaterQuality,
waterQuality,
// waterQualityCount,
// waterQualityUp,
waterQualityUp,
// waterNutritional,
countyWaterWithdrawal,
countyOverStandard

View File

@@ -0,0 +1,183 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search
:searchForm="searchForm"
:filterKeys="filterKeys"
@search="searchData"
@exportFile="exportFile"
@filterColumns="changeFilter"
:visiable="visiable"
:loading="loading"
/>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="datasource"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
import XLSX from "xlsx";
import {
countyWaterQualityData
} from "@/api/ecology/new-drinking-water";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from "./../components/countySearch.vue";
export default {
name: "waterQuality",
components: {
Search
},
props:{
// 表格搜索条件
searchForm:{
typeof:Object,
default: function () {
return {}
},
},
filterKeys:{
typeof:Object,
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
datasource:{},
selection: [],
columns:[
{title:"城市名称",dataIndex:"city",},
{title:"水源地名称",dataIndex:"sourceWaterName",},
{title:"期数",dataIndex:"sourceWaterName",},
{title:"水源地性质",dataIndex:"waterSourceProperty",},
{title:"断面水质",align: 'center',children: [
{title: "本月", dataIndex: "waterQualityCategory"},
{title: "上月", dataIndex: "waterQualityCategoryMom"},
{title: "去年同期", dataIndex: "waterQualityCategoryYoy"},
]
},
{title:"主要污染指标",dataIndex:"",},
],
// 表格列配置
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
loading:false
};
},
mounted() {
},
methods: {
// 获取列表数据
getPageData(){
this.loading = true;
countyWaterQualityData(this.where).then(res=>{
this.loading = false;
if(res.data.code){
this.$message.error(res.data.msg);
this.datasource = []
}else{
this.datasource = res.data.data
}
}).catch(()=>{
this.loading = false;
})
},
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
// 执行搜索
searchData(data){
this.where = data;
this.$emit("search", this.where);
this.reload();
},
/* 刷新表格 */
reload() {
this.getPageData()
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [...this.columns];
const arr = [];
let th1 = []
let th2 = []
const sColumns = []
columns.forEach(item=>{
th1.push(item.title)
if(Array.isArray(item.children) && item.children.length>0){
item.children.forEach(single=>{
th1.push('')
th2.push(single.title)
sColumns.push({dataIndex:single.dataIndex})
})
}else{
th2.push('')
sColumns.push({dataIndex:item.dataIndex})
}
})
arr.push(th1)
arr.push(th2)
this.datasource.forEach((d) => {
const td = sColumns.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());
},
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,171 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search
:searchForm="searchForm"
:filterKeys="filterKeys"
@search="searchData"
@exportFile="exportFile"
@filterColumns="changeFilter"
:visiable="visiable"
:loading="loading"
/>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="datasource"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
import XLSX from "xlsx";
import {
countyWaterQualityUpData
} from "@/api/ecology/new-drinking-water";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from "./../components/countySearch.vue";
export default {
name: "waterQuality",
components: {
Search
},
props:{
// 表格搜索条件
searchForm:{
typeof:Object,
default: function () {
return {}
},
},
filterKeys:{
typeof:Object,
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
datasource:{},
selection: [],
columns:[
{title:"断面名称",dataIndex:"sectionName",},
{title:"时间",dataIndex:"time",},
{title:"水质目标",dataIndex:"waterTarget",},
{title:"水质类别",dataIndex:"waterQualityCategory",},
{title: "达标情况", dataIndex: "standard"},
{title: "达标率", dataIndex: "standardRate"},
// {title:"达标情况",align: 'center',children: [
// {title: "达标情况", dataIndex: ""},
// {title: "达标率", dataIndex: ""},
// {title: "去年同期", dataIndex: ""},
// ]
// },
],
// 表格列配置
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
loading:false
};
},
mounted() {
},
methods: {
// 获取列表数据
getPageData(){
this.loading = true;
countyWaterQualityUpData(this.where).then(res=>{
this.loading = false;
if(res.data.code){
this.$message.error(res.data.msg);
this.datasource = []
}else{
let newData = []
const resData = res.data.data || {}
for(let i in resData){
newData.push(resData[i])
}
this.datasource = newData
}
}).catch(()=>{
this.loading = false;
})
},
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
// 执行搜索
searchData(data){
this.where = data;
this.$emit("search", this.where);
this.reload();
},
/* 刷新表格 */
reload() {
this.getPageData()
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...this.columns,
];
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());
},
},
};
</script>
<style scoped lang="less">
</style>