饮用水框架页面
This commit is contained in:
@@ -30,7 +30,7 @@ export const overStandardCount = function (data) {
|
||||
|
||||
|
||||
//市级—水质类别
|
||||
export const waterQualityUrl = '/drinkingWater/drinkingWater/AnalysePage';
|
||||
export const waterQualityUrl = '/drinkingWater/drinkingWater/getWaterQualityCategory';
|
||||
export const waterQualityData = function (data) {
|
||||
return axios.post(waterQualityUrl,data)
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export const waterQualityCountData = function (data) {
|
||||
}
|
||||
|
||||
//市级—水质达标情况
|
||||
export const waterQualityUpUrl = '/drinkingWater/drinkingWater/AnalysePage';
|
||||
export const waterQualityUpUrl = '/drinkingWater/drinkingWater/getWaterQualityStandard';
|
||||
export const waterQualityUpData = function (data) {
|
||||
return axios.post(waterQualityUpUrl,data)
|
||||
}
|
||||
@@ -74,6 +74,17 @@ export const countyOverStandardCount = function (data) {
|
||||
return axios.post(countyOverStandardtUrl,data)
|
||||
}
|
||||
|
||||
//县级—水质类别
|
||||
export const countyWaterQualityUrl = '/drinkingWater/drinkingWater/getWaterQualityCategory';
|
||||
export const countyWaterQualityData = function (data) {
|
||||
return axios.post(countyWaterQualityUrl,data)
|
||||
}
|
||||
|
||||
//县级—水质达标情况
|
||||
export const countyWaterQualityUpUrl = '/drinkingWater/drinkingWater/getWaterQualityStandard';
|
||||
export const countyWaterQualityUpData = function (data) {
|
||||
return axios.post(countyWaterQualityUpUrl,data)
|
||||
}
|
||||
|
||||
|
||||
// 农村
|
||||
@@ -81,3 +92,15 @@ export const villageAnalysePageUrl = '/drinkingWaterVillage/drinkingWaterVillage
|
||||
export const villageAnalysePageData = function (data) {
|
||||
return axios.post(villageAnalysePageUrl,data)
|
||||
}
|
||||
|
||||
//农村—水质类别
|
||||
export const villageWaterQualityUrl = '/drinkingWaterVillage/drinkingWaterVillage/getWaterQualityCategoryVillage';
|
||||
export const villageWaterQualityData = function (data) {
|
||||
return axios.post(villageWaterQualityUrl,data)
|
||||
}
|
||||
|
||||
//农村—水质达标情况
|
||||
export const villageWaterQualityUpUrl = '/drinkingWaterVillage/drinkingWaterVillage/getWaterQualityStandard';
|
||||
export const villageWaterQualityUpData = function (data) {
|
||||
return axios.post(villageWaterQualityUpUrl,data)
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
row-key="drinkingWaterId"
|
||||
:datasource="datasource"
|
||||
:columns="columns"
|
||||
:total="count"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
// 水质达标情况
|
||||
import waterQualityUp from "./waterQualityUp.vue";
|
||||
//综合营养指数
|
||||
|
||||
import waterNutritional from "./waterNutritional.vue"
|
||||
|
||||
|
||||
|
||||
@@ -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:"",},
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
183
src/views/water/drinking-water/statistic/county/waterQuality.vue
Normal file
183
src/views/water/drinking-water/statistic/county/waterQuality.vue
Normal 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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user