专项湖库
This commit is contained in:
@@ -36,3 +36,36 @@ export const cityYearContrastUrl = '/lakeLibrary/wateAnalysis/city/yearContrast'
|
|||||||
export const cityYearContrastData = function (data) {
|
export const cityYearContrastData = function (data) {
|
||||||
return axios.post(cityYearContrastUrl,data)
|
return axios.post(cityYearContrastUrl,data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 专项湖库
|
||||||
|
// 专项湖库原始数据接口
|
||||||
|
export const specialOriginalUrl = '/lakeLibrary/wateAnalysis/special/originalData'
|
||||||
|
export const specialOriginalData = function (data) {
|
||||||
|
return axios.post(specialOriginalUrl,data)
|
||||||
|
}
|
||||||
|
|
||||||
|
//专项湖库综合营养指数接口
|
||||||
|
export const specialComprehensiveNutritionUrl = '/lakeLibrary/wateAnalysis/special/comprehensiveNutrition';
|
||||||
|
export const specialComprehensiveNutritionData = function (data) {
|
||||||
|
return axios.post(specialComprehensiveNutritionUrl,data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 专项湖库平均数据接口
|
||||||
|
export const specialAverageUrl = '/lakeLibrary/wateAnalysis/special/average';
|
||||||
|
export const specialAverageData = function (data) {
|
||||||
|
return axios.post(specialAverageUrl,data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 专项湖库平均营养指数接口
|
||||||
|
export const specialAverageNutritionUrl = '/lakeLibrary/wateAnalysis/special/averageNutrition';
|
||||||
|
export const specialAverageNutrition = function (data) {
|
||||||
|
return axios.post(specialAverageNutritionUrl,data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 专项湖库平均营养指数接口
|
||||||
|
export const specialYearContrastUrl = '/lakeLibrary/wateAnalysis/special/yearContrast';
|
||||||
|
export const specialYearContrastData = function (data) {
|
||||||
|
return axios.post(specialYearContrastUrl,data)
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import SpecialLake from "./special-lake.vue";
|
import SpecialLake from "./special";
|
||||||
import InnerLake from "./inner";
|
import InnerLake from "./inner";
|
||||||
import SpecialAvg from "./special-avg"
|
import SpecialAvg from "./special-avg"
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -153,10 +153,12 @@ export default {
|
|||||||
filterData[index]['waterType'+i] = single.waterType;
|
filterData[index]['waterType'+i] = single.waterType;
|
||||||
filterData[index]['year'+i] = single.year;
|
filterData[index]['year'+i] = single.year;
|
||||||
|
|
||||||
addCloumns[index] = {}
|
|
||||||
addCloumns[index].title = single.year
|
if(i==0 && index==0){
|
||||||
addCloumns[index].align = 'center'
|
addCloumns[index] = {}
|
||||||
if(i==0){
|
addCloumns[index].title = single.year
|
||||||
|
addCloumns[index].align = 'center'
|
||||||
|
|
||||||
addCloumns[index].children = [
|
addCloumns[index].children = [
|
||||||
{ title: "水质类别", dataIndex: `waterType${i}`, sorter: true,align:'center' },
|
{ title: "水质类别", dataIndex: `waterType${i}`, sorter: true,align:'center' },
|
||||||
{ title: "综合营养状态指数", dataIndex: `comprehensiveNutrition${i}`, sorter: true,align:'center' },
|
{ title: "综合营养状态指数", dataIndex: `comprehensiveNutrition${i}`, sorter: true,align:'center' },
|
||||||
@@ -175,7 +177,6 @@ export default {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.columns = [
|
this.columns = [
|
||||||
{ title: "类别", dataIndex: "type", sorter: true },
|
{ title: "类别", dataIndex: "type", sorter: true },
|
||||||
{ title: "点位名称", dataIndex: "pointName", sorter: true},
|
{ title: "点位名称", dataIndex: "pointName", sorter: true},
|
||||||
|
|||||||
159
src/views/water/lake/statistic/special/component/average.vue
Normal file
159
src/views/water/lake/statistic/special/component/average.vue
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
<!--平均数据-->
|
||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 搜索表单 -->
|
||||||
|
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
:loading="loading"
|
||||||
|
: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 {specialAverageData} from "@/api/ecology/new-lake";
|
||||||
|
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||||
|
import Search from './search.vue';
|
||||||
|
import {averageTableColumns} from "./raw-colums"
|
||||||
|
export default {
|
||||||
|
name: 'inner-raw',
|
||||||
|
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: averageTableColumns,
|
||||||
|
palceOptions: [],
|
||||||
|
areaOptions: [],
|
||||||
|
regionLevelOptions: [],
|
||||||
|
where:{},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
loading: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
filterKeys(newKeys) {
|
||||||
|
this.filterColumns(newKeys)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
// 获取列表数据
|
||||||
|
getPageData(){
|
||||||
|
this.loading = true;
|
||||||
|
specialAverageData(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;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 传上父级
|
||||||
|
changeFilter(data){
|
||||||
|
this.$emit('changeFilter',data)
|
||||||
|
},
|
||||||
|
//动态修改表头
|
||||||
|
filterColumns(keys){
|
||||||
|
|
||||||
|
if(!Array.isArray(keys)){return}
|
||||||
|
|
||||||
|
let newCloumns = [...averageTableColumns]
|
||||||
|
|
||||||
|
let filterIndex = [];
|
||||||
|
newCloumns.forEach((item,index)=>{
|
||||||
|
if(keys.indexOf(item.dataIndex)>-1){
|
||||||
|
filterIndex.push(index)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const newList = newCloumns.filter((item, index) => {
|
||||||
|
return filterIndex.indexOf(index) == -1
|
||||||
|
})
|
||||||
|
this.columns = newList
|
||||||
|
|
||||||
|
},
|
||||||
|
// 执行搜索
|
||||||
|
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>
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
<!--平均营养指标-->
|
||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 搜索表单 -->
|
||||||
|
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
:datasource="datasource"
|
||||||
|
:columns="columns"
|
||||||
|
row-id="pointName"
|
||||||
|
:where="where"
|
||||||
|
:loading="loading"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
@done="(d) => (data = d.data)"
|
||||||
|
>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import XLSX from "xlsx";
|
||||||
|
// import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
|
||||||
|
import {specialAverageNutrition} from "@/api/ecology/new-lake";
|
||||||
|
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||||
|
import Search from './search.vue';
|
||||||
|
export default {
|
||||||
|
name: 'inner-raw',
|
||||||
|
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: "monitorTime", sorter: true,},
|
||||||
|
{title: "类别", dataIndex: "type", sorter: true,},
|
||||||
|
{title: "点位名称", dataIndex: "pointName", sorter: true,},
|
||||||
|
{title: "水质类别", dataIndex: "waterType", sorter: true,},
|
||||||
|
{title: "级别", dataIndex: "level", sorter: true,},
|
||||||
|
{title: "综合营养状态指数", dataIndex: "comprehensiveNutrition", sorter: true,},
|
||||||
|
{title: "超标项目(超标倍数)", dataIndex: "overflow", sorter: true,},
|
||||||
|
],
|
||||||
|
palceOptions: [],
|
||||||
|
areaOptions: [],
|
||||||
|
regionLevelOptions: [],
|
||||||
|
where:{},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
loading: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 传上父级
|
||||||
|
changeFilter(data){
|
||||||
|
this.$emit('changeFilter',data)
|
||||||
|
},
|
||||||
|
// 执行搜索
|
||||||
|
searchData(data){
|
||||||
|
this.where = data;
|
||||||
|
this.$emit("search", this.where);
|
||||||
|
this.reload();
|
||||||
|
},
|
||||||
|
// 获取列表数据
|
||||||
|
getPageData(){
|
||||||
|
this.loading = true;
|
||||||
|
specialAverageNutrition(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;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/* 刷新表格 */
|
||||||
|
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>
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
<!--综合营养指标-->
|
||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 搜索表单 -->
|
||||||
|
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
:datasource="datasource"
|
||||||
|
:columns="columns"
|
||||||
|
:where="where"
|
||||||
|
:loading="loading"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
@done="(d) => (data = d.data)"
|
||||||
|
>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import XLSX from "xlsx";
|
||||||
|
// import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
|
||||||
|
import {specialComprehensiveNutritionData} from "@/api/ecology/new-lake";
|
||||||
|
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||||
|
import Search from './search.vue';
|
||||||
|
export default {
|
||||||
|
name: 'lakeLibraryInnerCity',
|
||||||
|
components: {
|
||||||
|
Search
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
// 表格搜索条件
|
||||||
|
searchForm:{
|
||||||
|
typeof:Object,
|
||||||
|
default: function () {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filterKeys:{
|
||||||
|
typeof:Object,
|
||||||
|
default: function () {
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
},
|
||||||
|
visiable:{
|
||||||
|
typeof:Boolean
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
locale,
|
||||||
|
bill: {},
|
||||||
|
// 表格数据接口
|
||||||
|
// url: pageLakeUrl,
|
||||||
|
datasource:[],
|
||||||
|
selection: [],
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||||
|
{title: "类别", dataIndex: "type", sorter: true,},
|
||||||
|
{title: "点位名称", dataIndex: "pointName", sorter: true,},
|
||||||
|
{title: "水质类别", dataIndex: "waterType", sorter: true,},
|
||||||
|
{title: "级别", dataIndex: "level", sorter: true,},
|
||||||
|
{title: "综合营养状态指数", dataIndex: "comprehensiveNutrition", sorter: true,},
|
||||||
|
{title: "超标项目(超标倍数)", dataIndex: "overflow", sorter: true,},
|
||||||
|
],
|
||||||
|
palceOptions: [],
|
||||||
|
areaOptions: [],
|
||||||
|
regionLevelOptions: [],
|
||||||
|
where:{},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
loading:false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.loadOptionData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 传上父级
|
||||||
|
changeFilter(data){
|
||||||
|
this.$emit('changeFilter',data)
|
||||||
|
},
|
||||||
|
// 执行搜索
|
||||||
|
searchData(data){
|
||||||
|
this.where = data;
|
||||||
|
this.$emit("search", this.where);
|
||||||
|
this.reload();
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取列表数据
|
||||||
|
getPageData(){
|
||||||
|
console.log('请求')
|
||||||
|
this.loading = true;
|
||||||
|
specialComprehensiveNutritionData(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;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 刷新表格 */
|
||||||
|
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>
|
||||||
223
src/views/water/lake/statistic/special/component/comparison.vue
Normal file
223
src/views/water/lake/statistic/special/component/comparison.vue
Normal file
@@ -0,0 +1,223 @@
|
|||||||
|
<!--年度对比-->
|
||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 搜索表单 -->
|
||||||
|
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
:datasource="datasource"
|
||||||
|
:columns="columns"
|
||||||
|
:where="where"
|
||||||
|
:loading="loading"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
@done="(d) => (data = d.data)"
|
||||||
|
>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import XLSX from "xlsx";
|
||||||
|
// import { pageLakeUrl, getColumnOptions } from "@/api/ecology/lake";
|
||||||
|
import {specialYearContrastData} from "@/api/ecology/new-lake";
|
||||||
|
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||||
|
import Search from "./search.vue";
|
||||||
|
export default {
|
||||||
|
name: "lakeLibraryInnerCity",
|
||||||
|
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: "type", sorter: true },
|
||||||
|
// { title: "点位名称", dataIndex: "pointName", sorter: true },
|
||||||
|
// {
|
||||||
|
// title: "2020年",
|
||||||
|
// children: [
|
||||||
|
// { title: "水质类别", dataIndex: "remark", sorter: true },
|
||||||
|
// { title: "综合营养状态指数", dataIndex: "remark", sorter: true },
|
||||||
|
// { title: "级别", dataIndex: "remark", sorter: true },
|
||||||
|
// {
|
||||||
|
// title: "超标项目(超标倍数)",
|
||||||
|
// dataIndex: "remark",
|
||||||
|
// sorter: true,
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
|
|
||||||
|
// {
|
||||||
|
// title: "2021年",
|
||||||
|
// children: [
|
||||||
|
// { title: "水质类别", dataIndex: "remark", sorter: true },
|
||||||
|
// { title: "综合营养状态指数", dataIndex: "remark", sorter: true },
|
||||||
|
// { title: "级别", dataIndex: "remark", sorter: true },
|
||||||
|
// {
|
||||||
|
// title: "超标项目(超标倍数)",
|
||||||
|
// dataIndex: "remark",
|
||||||
|
// sorter: true,
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
palceOptions: [],
|
||||||
|
areaOptions: [],
|
||||||
|
regionLevelOptions: [],
|
||||||
|
where: {},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
loading:false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.loadOptionData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 传上父级
|
||||||
|
changeFilter(data){
|
||||||
|
this.$emit('changeFilter',data)
|
||||||
|
},
|
||||||
|
// 执行搜索
|
||||||
|
searchData(data) {
|
||||||
|
this.where = data;
|
||||||
|
this.$emit("search", this.where);
|
||||||
|
this.reload();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 获取列表数据
|
||||||
|
getPageData(){
|
||||||
|
this.loading = true;
|
||||||
|
specialYearContrastData(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
|
||||||
|
this.filterData(res.data.data)
|
||||||
|
}
|
||||||
|
}).catch(()=>{
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 格式化数据
|
||||||
|
filterData(data){
|
||||||
|
let filterData = []
|
||||||
|
let addCloumns = []
|
||||||
|
|
||||||
|
if(Array.isArray(data)){
|
||||||
|
|
||||||
|
data.forEach((item,index)=>{
|
||||||
|
filterData[index] = {}
|
||||||
|
filterData[index].type = item.type;
|
||||||
|
filterData[index].pointName = item.pointName;
|
||||||
|
|
||||||
|
// 筛选出年份
|
||||||
|
if(Array.isArray(item.data)){
|
||||||
|
item.data.forEach((single,i)=>{
|
||||||
|
filterData[index]['comprehensiveNutrition'+i] = single.comprehensiveNutrition;
|
||||||
|
filterData[index]['level'+i] = single.level;
|
||||||
|
filterData[index]['overflow'+i] = single.overflow;
|
||||||
|
filterData[index]['waterType'+i] = single.waterType;
|
||||||
|
filterData[index]['year'+i] = single.year;
|
||||||
|
|
||||||
|
|
||||||
|
if(i==0 && index==0){
|
||||||
|
addCloumns[index] = {}
|
||||||
|
addCloumns[index].title = single.year
|
||||||
|
addCloumns[index].align = 'center'
|
||||||
|
|
||||||
|
addCloumns[index].children = [
|
||||||
|
{ title: "水质类别", dataIndex: `waterType${i}`, sorter: true,align:'center' },
|
||||||
|
{ title: "综合营养状态指数", dataIndex: `comprehensiveNutrition${i}`, sorter: true,align:'center' },
|
||||||
|
{ title: "级别", dataIndex: `level${i}`, sorter: true,align:'center' },
|
||||||
|
{
|
||||||
|
title: "超标项目(超标倍数)",
|
||||||
|
align:'center',
|
||||||
|
dataIndex: `overflow${i}`,
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.columns = [
|
||||||
|
{ title: "类别", dataIndex: "type", sorter: true },
|
||||||
|
{ title: "点位名称", dataIndex: "pointName", sorter: true},
|
||||||
|
...addCloumns
|
||||||
|
]
|
||||||
|
this.datasource = filterData;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 刷新表格 */
|
||||||
|
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">
|
||||||
|
td{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
138
src/views/water/lake/statistic/special/component/raw-colums.js
Normal file
138
src/views/water/lake/statistic/special/component/raw-colums.js
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
const innerFilterColumns = [
|
||||||
|
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||||
|
{title: "透明度(cm)", dataIndex: "transparency", sorter: true,},
|
||||||
|
{title: "溶解氧饱和度(﹪)", dataIndex: "dissolvedOxygenSaturation", sorter: true,},
|
||||||
|
{title: "溶解氧", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||||
|
{title: "高锰酸盐指数", dataIndex: "permanganateIndex", sorter: true,},
|
||||||
|
{title: "五日生化需氧量", dataIndex: "fiveDayBod", sorter: true,},
|
||||||
|
{title: "总氮 ", dataIndex: "totalNitrogen", sorter: true,},
|
||||||
|
{title: "氨氮", dataIndex: "ammonia", sorter: true,},
|
||||||
|
{title: "挥发酚", dataIndex: "volatilePhenol", sorter: true,},
|
||||||
|
{title: "砷(mg/L)", dataIndex: "as", sorter: true,},
|
||||||
|
{title: "汞 (mg/L)", dataIndex: "hg", sorter: true,},
|
||||||
|
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||||
|
{title: "铅 (mg/L)", dataIndex: "pb", sorter: true,},
|
||||||
|
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||||
|
{title: "总磷", dataIndex: "totalPhosphorus", sorter: true,},
|
||||||
|
{title: "石油类", dataIndex: "petro", sorter: true,},
|
||||||
|
{title: "粪大肠菌群(MPN/L)", dataIndex: "fecalColiforms", sorter: true,},
|
||||||
|
{title: "化学需氧量", dataIndex: "cod", sorter: true,},
|
||||||
|
{title: "叶绿素a (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||||
|
{title: "阴离子表面活性剂(mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||||
|
{title: "硫化物(mg/L) ", dataIndex: "s", sorter: true,},
|
||||||
|
{title: "氧化还原电位(mV)", dataIndex: "oxidationReductionPotential", sorter: true,}
|
||||||
|
]
|
||||||
|
|
||||||
|
const innerTableColumns = [
|
||||||
|
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||||
|
{title: "断面名称", dataIndex: "pointName", sorter: true,},
|
||||||
|
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
|
||||||
|
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||||
|
{title: "透明度(cm)", dataIndex: "transparency", sorter: true,},
|
||||||
|
{title: "溶解氧饱和度(﹪)", dataIndex: "dissolvedOxygenSaturation", sorter: true,},
|
||||||
|
{title: "溶解氧", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||||
|
{title: "高锰酸盐指数", dataIndex: "permanganateIndex", sorter: true,},
|
||||||
|
{title: "五日生化需氧量", dataIndex: "fiveDayBod", sorter: true,},
|
||||||
|
{title: "总氮 ", dataIndex: "totalNitrogen", sorter: true,},
|
||||||
|
{title: "氨氮", dataIndex: "ammonia", sorter: true,},
|
||||||
|
{title: "挥发酚", dataIndex: "volatilePhenol", sorter: true,},
|
||||||
|
{title: "砷(mg/L)", dataIndex: "as", sorter: true,},
|
||||||
|
{title: "汞 (mg/L)", dataIndex: "hg", sorter: true,},
|
||||||
|
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||||
|
{title: "铅 (mg/L)", dataIndex: "pb", sorter: true,},
|
||||||
|
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||||
|
{title: "总磷", dataIndex: "totalPhosphorus", sorter: true,},
|
||||||
|
{title: "石油类", dataIndex: "petro", sorter: true,},
|
||||||
|
{title: "粪大肠菌群(MPN/L)", dataIndex: "fecalColiforms", sorter: true,},
|
||||||
|
{title: "化学需氧量", dataIndex: "cod", sorter: true,},
|
||||||
|
{title: "叶绿素a (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||||
|
{title: "阴离子表面活性剂(mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||||
|
{title: "硫化物(mg/L) ", dataIndex: "s", sorter: true,},
|
||||||
|
{title: "氧化还原电位(mV)", dataIndex: "oxidationReductionPotential", sorter: true,}
|
||||||
|
// {title: "备注", dataIndex: "remark", sorter: true,},
|
||||||
|
];
|
||||||
|
|
||||||
|
const averageTableColumns = [
|
||||||
|
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||||
|
{title: "断面名称", dataIndex: "pointName", sorter: true,},
|
||||||
|
{title: "水温(℃)", dataIndex: "waterTemperature", sorter: true,},
|
||||||
|
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||||
|
{title: "透明度(cm)", dataIndex: "transparency", sorter: true,},
|
||||||
|
{title: "溶解氧饱和度(﹪)", dataIndex: "dissolvedOxygenSaturation", sorter: true,},
|
||||||
|
{title: "溶解氧", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||||
|
{title: "高锰酸盐指数", dataIndex: "permanganateIndex", sorter: true,},
|
||||||
|
{title: "五日生化需氧量", dataIndex: "fiveDayBod", sorter: true,},
|
||||||
|
{title: "总氮 ", dataIndex: "totalNitrogen", sorter: true,},
|
||||||
|
{title: "氨氮", dataIndex: "ammonia", sorter: true,},
|
||||||
|
{title: "挥发酚", dataIndex: "volatilePhenol", sorter: true,},
|
||||||
|
{title: "砷(mg/L)", dataIndex: "as", sorter: true,},
|
||||||
|
{title: "汞 (mg/L)", dataIndex: "hg", sorter: true,},
|
||||||
|
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||||
|
{title: "铅 (mg/L)", dataIndex: "pb", sorter: true,},
|
||||||
|
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||||
|
{title: "总磷", dataIndex: "totalPhosphorus", sorter: true,},
|
||||||
|
{title: "石油类", dataIndex: "petro", sorter: true,},
|
||||||
|
{title: "粪大肠菌群(MPN/L)", dataIndex: "fecalColiforms", sorter: true,},
|
||||||
|
{title: "化学需氧量", dataIndex: "cod", sorter: true,},
|
||||||
|
{title: "叶绿素a (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||||
|
{title: "阴离子表面活性剂(mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||||
|
{title: "硫化物(mg/L) ", dataIndex: "s", sorter: true,},
|
||||||
|
{title: "氧化还原电位(mV)", dataIndex: "oxidationReductionPotential", sorter: true,}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
const specialFilterColumns = [
|
||||||
|
{title: "浊度(NTU)", dataIndex: "turbidity", sorter: true,},
|
||||||
|
{title: "水温(℃)", dataIndex: "wTemp", sorter: true,},
|
||||||
|
{title: "水位(m)", dataIndex: "wd", sorter: true,},
|
||||||
|
{title: "pH值", dataIndex: "ph", sorter: true,},
|
||||||
|
{title: "电导率(ms/m)", dataIndex: "wCond", sorter: true,},
|
||||||
|
{title: "透明度(cm)", dataIndex: "transp", sorter: true,},
|
||||||
|
{title: "溶解氧 (mg/L)", dataIndex: "dissolvedOxygen", sorter: true,},
|
||||||
|
{title: "高锰酸盐指数 (mg/L)", dataIndex: "codmn", sorter: true,},
|
||||||
|
{title: "氨氮 (mg/L)", dataIndex: "nh4N", sorter: true,},
|
||||||
|
{title: "石油类 (mg/L)", dataIndex: "oils", sorter: true,},
|
||||||
|
{title: "总氮 (mg/L)", dataIndex: "nTotal", sorter: true,},
|
||||||
|
{title: "总磷 (mg/L)", dataIndex: "pTotal", sorter: true,},
|
||||||
|
{title: "叶绿素 (mg/L)", dataIndex: "chlA", sorter: true,},
|
||||||
|
{title: "挥发酚 (mg/L)", dataIndex: "vPhen", sorter: true,},
|
||||||
|
{title: "汞 (mg/L)", dataIndex: "wHg", sorter: true,},
|
||||||
|
{title: "铅 (mg/L)", dataIndex: "wPb", sorter: true,},
|
||||||
|
{title: "化学需氧量 (mg/L)", dataIndex: "codcr", sorter: true,},
|
||||||
|
{title: "铜 (mg/L)", dataIndex: "wCu", sorter: true,},
|
||||||
|
{title: "锌 (mg/L)", dataIndex: "wZn", sorter: true,},
|
||||||
|
{title: "氟化物 (mg/L)", dataIndex: "f", sorter: true,},
|
||||||
|
{title: "硒 (mg/L)", dataIndex: "se", sorter: true,},
|
||||||
|
{title: "砷 (mg/L)", dataIndex: "as", sorter: true,},
|
||||||
|
{title: "镉 (mg/L)", dataIndex: "cd", sorter: true,},
|
||||||
|
{title: "六价铬 (mg/L)", dataIndex: "cr6", sorter: true,},
|
||||||
|
{title: "氰化物 (mg/L)", dataIndex: "cnTotal", sorter: true,},
|
||||||
|
{title: "阴离子表面活性剂 (mg/L)", dataIndex: "anSaa", sorter: true,},
|
||||||
|
{title: "硫化物 (mg/L)", dataIndex: "s", sorter: true,},
|
||||||
|
{title: "粪大肠菌群 (mg/L)", dataIndex: "coloOrg", sorter: true,},
|
||||||
|
{title: "硫酸盐 (mg/L)", dataIndex: "so4", sorter: true,},
|
||||||
|
{title: "氯化物 (mg/L)", dataIndex: "cl", sorter: true,},
|
||||||
|
{title: "硝酸盐 (mg/L)", dataIndex: "no3N", sorter: true,},
|
||||||
|
{title: "铁 (mg/L)", dataIndex: "wFe", sorter: true,},
|
||||||
|
{title: "锰 (mg/L)", dataIndex: "wMn", sorter: true,}
|
||||||
|
]
|
||||||
|
|
||||||
|
const specialTableColumns = [
|
||||||
|
{title: "监测时间", dataIndex: "monitorTime", sorter: true,},
|
||||||
|
{title: "测站名称", dataIndex: "stationName", sorter: true,},
|
||||||
|
{title: "测站代码", dataIndex: "stationCode", sorter: true,},
|
||||||
|
{title: "湖库名称", dataIndex: "lakeLibraryName", sorter: true,},
|
||||||
|
{title: "湖库代码", dataIndex: "lakeLibraryCode", sorter: true,},
|
||||||
|
{title: "断面名称", dataIndex: "sectionName", sorter: true,},
|
||||||
|
{title: "断面代码", dataIndex: "sectionCode", sorter: true,},
|
||||||
|
{title: "控制属性", dataIndex: "controlAttributes", sorter: true,},
|
||||||
|
{title: "所属流域", dataIndex: "watershed", sorter: true,},
|
||||||
|
{title: "水期代码", dataIndex: "waterPeriodCode", sorter: true,},
|
||||||
|
|
||||||
|
...specialFilterColumns,
|
||||||
|
|
||||||
|
{title: "水质类别", dataIndex: "waterQualityCategory", sorter: true,},
|
||||||
|
{title: "系统编码", dataIndex: "systemCode", sorter: true,},
|
||||||
|
{title: "备注", dataIndex: "remark", sorter: true,},
|
||||||
|
];
|
||||||
|
export {innerTableColumns, specialTableColumns, innerFilterColumns, specialFilterColumns, averageTableColumns}
|
||||||
172
src/views/water/lake/statistic/special/component/raw.vue
Normal file
172
src/views/water/lake/statistic/special/component/raw.vue
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
<!--原始数据-->
|
||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 搜索表单 -->
|
||||||
|
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
row-key="lakeLibrarySpecialId"
|
||||||
|
:datasource="datasource"
|
||||||
|
:columns="columns"
|
||||||
|
:loading="loading"
|
||||||
|
:where="where"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
@done="(d) => (data = d.data)"
|
||||||
|
>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import XLSX from "xlsx";
|
||||||
|
import {getLakeDropdown, specialOriginalData} from "@/api/ecology/new-lake";
|
||||||
|
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||||
|
import Search from './search.vue';
|
||||||
|
import {innerTableColumns} from "./raw-colums"
|
||||||
|
export default {
|
||||||
|
name: 'inner-raw',
|
||||||
|
components: {
|
||||||
|
Search
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
// 表格搜索条件
|
||||||
|
searchForm:{
|
||||||
|
typeof:Object,
|
||||||
|
default: function () {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filterKeys:{
|
||||||
|
typeof:Object,
|
||||||
|
default: function () {
|
||||||
|
return []
|
||||||
|
},
|
||||||
|
},
|
||||||
|
visiable:{
|
||||||
|
typeof:Boolean
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
locale,
|
||||||
|
bill: {},
|
||||||
|
// 表格数据接口
|
||||||
|
// url: cityOriginalUrl,
|
||||||
|
datasource:[],
|
||||||
|
selection: [],
|
||||||
|
// 表格列配置
|
||||||
|
columns: innerTableColumns,
|
||||||
|
palceOptions: [],
|
||||||
|
areaOptions: [],
|
||||||
|
regionLevelOptions: [],
|
||||||
|
where:{},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
loading:false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
filterKeys(newKeys) {
|
||||||
|
this.filterColumns(newKeys)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
// 获取列表数据
|
||||||
|
getPageData(){
|
||||||
|
this.loading = true
|
||||||
|
specialOriginalData(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;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 传上父级
|
||||||
|
changeFilter(data){
|
||||||
|
this.$emit('changeFilter',data)
|
||||||
|
},
|
||||||
|
//动态修改表头
|
||||||
|
filterColumns(keys){
|
||||||
|
|
||||||
|
if(!Array.isArray(keys)){return}
|
||||||
|
|
||||||
|
let newCloumns = [...innerTableColumns]
|
||||||
|
|
||||||
|
let filterIndex = [];
|
||||||
|
newCloumns.forEach((item,index)=>{
|
||||||
|
if(keys.indexOf(item.dataIndex)>-1){
|
||||||
|
filterIndex.push(index)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const newList = newCloumns.filter((item, index) => {
|
||||||
|
return filterIndex.indexOf(index) == -1
|
||||||
|
})
|
||||||
|
this.columns = newList
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 执行搜索
|
||||||
|
searchData(data){
|
||||||
|
this.where = data;
|
||||||
|
this.$emit("search", this.where);
|
||||||
|
this.reload();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**获取下来框数据 */
|
||||||
|
loadOptionData() {
|
||||||
|
getLakeDropdown().then((res) => {
|
||||||
|
this.palceOptions = res.data.data.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.sectionName,
|
||||||
|
value: item.sectionName,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
/* 刷新表格 */
|
||||||
|
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>
|
||||||
317
src/views/water/lake/statistic/special/component/search.vue
Normal file
317
src/views/water/lake/statistic/special/component/search.vue
Normal file
@@ -0,0 +1,317 @@
|
|||||||
|
<template>
|
||||||
|
<a-form
|
||||||
|
:model="where"
|
||||||
|
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||||
|
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||||
|
>
|
||||||
|
<a-row>
|
||||||
|
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||||
|
<a-form-item label="断面名称:">
|
||||||
|
<a-select mode="multiple" v-model:value="where.sectionName" allowClear showSearch>
|
||||||
|
<a-select-option v-for="item in sectionOptions" :key="item.value"
|
||||||
|
>{{ item.label }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||||
|
<a-form-item label="起始时间:" name="startTime" >
|
||||||
|
<a-month-picker
|
||||||
|
v-model:value="where.startTime"
|
||||||
|
valueFormat="YYYY-MM"
|
||||||
|
:locale="locale"
|
||||||
|
placeholder="请输入起始时间"
|
||||||
|
allow-clear
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||||
|
<a-form-item label="结束时间:" name="endTime">
|
||||||
|
<a-month-picker
|
||||||
|
v-model:value="where.endTime"
|
||||||
|
valueFormat="YYYY-MM"
|
||||||
|
:locale="locale"
|
||||||
|
placeholder="请输入结束时间"
|
||||||
|
allow-clear
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||||
|
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
|
||||||
|
<a-space>
|
||||||
|
<a-button type="primary" @click="searchData">查询</a-button>
|
||||||
|
<a-button @click="reset">重置</a-button>
|
||||||
|
<a-button @click="exportFile">导出Excel</a-button>
|
||||||
|
</a-space>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||||
|
<a-form-item label="区域:">
|
||||||
|
<a-select
|
||||||
|
v-model:value="where.checked"
|
||||||
|
allowClear
|
||||||
|
placeholder="未选择"
|
||||||
|
>
|
||||||
|
<a-select-option v-for="item in palceOptions" :key="item.value"
|
||||||
|
>{{ item.label }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||||
|
<a-form-item label="水质类别:">
|
||||||
|
<a-select
|
||||||
|
v-model:value="where.checked"
|
||||||
|
allowClear
|
||||||
|
placeholder="未选择"
|
||||||
|
>
|
||||||
|
<a-select-option :value="1">已审核</a-select-option>
|
||||||
|
<a-select-option :value="0">未审核</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||||
|
<a-form-item label="监测指标:">
|
||||||
|
<div class="input-item" @click="showModal">
|
||||||
|
<a-checkbox
|
||||||
|
:checked="checkAll"
|
||||||
|
:indeterminate="indeterminate"
|
||||||
|
>
|
||||||
|
全选
|
||||||
|
</a-checkbox>
|
||||||
|
</div>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
|
||||||
|
<a-modal v-model:visible="visible" width="700px" title="监测指标" @ok="handleOk" @cancel="handleCancel">
|
||||||
|
<div :style="{ borderBottom: '1px solid #E9E9E9', marginBottom: '5px', paddingBottom: '5px' }">
|
||||||
|
<a-checkbox
|
||||||
|
v-model:checked="checkAll"
|
||||||
|
:indeterminate="indeterminate"
|
||||||
|
@change="onCheckAllChange"
|
||||||
|
>
|
||||||
|
全选
|
||||||
|
</a-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a-checkbox-group
|
||||||
|
style="width: 100%"
|
||||||
|
@change="handleChange"
|
||||||
|
v-model:value="filter"
|
||||||
|
>
|
||||||
|
<a-row>
|
||||||
|
<a-col
|
||||||
|
:span="8"
|
||||||
|
v-for="item in filterColumns"
|
||||||
|
:key="item.dataIndex"
|
||||||
|
>
|
||||||
|
<a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-checkbox-group>
|
||||||
|
|
||||||
|
</a-modal>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||||
|
import { innerFilterColumns } from "./raw-colums";
|
||||||
|
import {getLakeDropdown} from "@/api/ecology/new-lake";
|
||||||
|
export default {
|
||||||
|
name: "inner-search",
|
||||||
|
props: {
|
||||||
|
// 表格搜索条件
|
||||||
|
searchForm: {
|
||||||
|
typeof: Object,
|
||||||
|
default: function () {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filterKeys:{
|
||||||
|
typeof: Object,
|
||||||
|
default: function () {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
visiable:{
|
||||||
|
typeof:Boolean
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
indeterminate:false,
|
||||||
|
checkAll: true,
|
||||||
|
where: {},
|
||||||
|
filter:[],
|
||||||
|
columnsKey:[],
|
||||||
|
locale,
|
||||||
|
visible: false,
|
||||||
|
filterColumns: innerFilterColumns,
|
||||||
|
newCloumns:[],
|
||||||
|
oldCloumns:[],
|
||||||
|
filterItem:[],
|
||||||
|
palceOptions:[],
|
||||||
|
sectionOptions:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created(){
|
||||||
|
this.loadOptionData();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
searchForm(newV) {
|
||||||
|
this.where = newV;
|
||||||
|
},
|
||||||
|
filterKeys(newKeys){
|
||||||
|
this.initFilter(newKeys)
|
||||||
|
},
|
||||||
|
// 监控修改全选框图标状态
|
||||||
|
filter(newV){
|
||||||
|
if(newV.length !== this.filterColumns.length){
|
||||||
|
this.checkAll = false
|
||||||
|
this.indeterminate = false
|
||||||
|
if(newV.length){
|
||||||
|
this.indeterminate = true
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.checkAll = true
|
||||||
|
this.indeterminate = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听组件显示
|
||||||
|
visiable(val){
|
||||||
|
this.emitData(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.where = this.searchForm;
|
||||||
|
this.filter = innerFilterColumns.map((item) => item.dataIndex);
|
||||||
|
this.columnsKey = [...this.filter]
|
||||||
|
this.newCloumns = [...innerFilterColumns];
|
||||||
|
this.oldCloumns = [...innerFilterColumns];
|
||||||
|
// this.$emit("buildColumns", innerFilterColumns);
|
||||||
|
this.initFilter(this.filterKeys);
|
||||||
|
this.emitData(true)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
emitData(val){
|
||||||
|
if(val && this.where.startTime && this.where.endTime){
|
||||||
|
this.$emit("search", this.where);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 初始化选择
|
||||||
|
initFilter(newKeys){
|
||||||
|
let filterIndex =this.filterColumns.map(item=>(item.dataIndex))
|
||||||
|
const newList = filterIndex.filter((item) => {
|
||||||
|
return newKeys.indexOf(item) == -1
|
||||||
|
})
|
||||||
|
this.filter = newList;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**获取下来框数据 */
|
||||||
|
loadOptionData() {
|
||||||
|
getLakeDropdown().then((res) => {
|
||||||
|
this.palceOptions = res.data.data.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.regionName,
|
||||||
|
value: item.regionName,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
this.sectionOptions= res.data.data.map((item) => {
|
||||||
|
return {
|
||||||
|
label: item.sectionName,
|
||||||
|
value: item.sectionName,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 指标全选
|
||||||
|
onCheckAllChange (e) {
|
||||||
|
this.filter = e.target.checked ? innerFilterColumns.map((item) => item.dataIndex) : []
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
handleChange(e) {
|
||||||
|
let newCloumns = [];
|
||||||
|
innerFilterColumns.forEach((item) => {
|
||||||
|
const index = e.indexOf(item.dataIndex);
|
||||||
|
if (index > -1) {
|
||||||
|
newCloumns.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.newCloumns = newCloumns;
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.where = {
|
||||||
|
checked: 1,
|
||||||
|
};
|
||||||
|
this.searchData();
|
||||||
|
},
|
||||||
|
searchData() {
|
||||||
|
this.$emit("search", this.where);
|
||||||
|
},
|
||||||
|
exportFile() {
|
||||||
|
this.$emit("exportFile");
|
||||||
|
},
|
||||||
|
showModal() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
handleCancel(){
|
||||||
|
this.visible = false;
|
||||||
|
// 如果是取消,则还原上次勾选项
|
||||||
|
this.filter = this.oldCloumns.map(item=>item.dataIndex)
|
||||||
|
},
|
||||||
|
handleOk() {
|
||||||
|
this.visible = false;
|
||||||
|
this.oldCloumns = [...this.newCloumns];
|
||||||
|
|
||||||
|
let filterKey = []
|
||||||
|
|
||||||
|
this.columnsKey.forEach(key=>{
|
||||||
|
if(this.filter.indexOf(key) == -1){
|
||||||
|
filterKey.push(key)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.$emit("filterColumns", filterKey);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.ant-calendar-picker {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.input-item {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-variant: tabular-nums;
|
||||||
|
list-style: none;
|
||||||
|
font-feature-settings: "tnum";
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
padding: 4px 11px;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.5715;
|
||||||
|
background-color: #fff;
|
||||||
|
background-image: none;
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
border-radius: 2px;
|
||||||
|
transition: all 0.3s;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
65
src/views/water/lake/statistic/special/index.vue
Normal file
65
src/views/water/lake/statistic/special/index.vue
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
|
<a-tab-pane key="raw" tab="原始数据">
|
||||||
|
<raw :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='raw'"></raw>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="com-nutritional" tab="综合营养指标">
|
||||||
|
<com-nutritional :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter" :visiable="activeKey=='com-nutritional'"></com-nutritional>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="average" tab="平均数据">
|
||||||
|
<average :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter"></average>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="avg-nutritional" tab="平均营养指数">
|
||||||
|
<avg-nutritional :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter"></avg-nutritional>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="comparison" tab="年度对比">
|
||||||
|
<comparison :searchForm="searchForm" :filterKeys="filterKeys" @search="changeSearch" @changeFilter="changeFilter"></comparison>
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Raw from "./component/raw.vue";
|
||||||
|
import ComNutritional from "./component/com-nutritional.vue";
|
||||||
|
import Average from "./component/average.vue";
|
||||||
|
import AvgNutritional from "./component/avg-nutritional.vue";
|
||||||
|
import Comparison from "./component/comparison.vue";
|
||||||
|
export default {
|
||||||
|
name: 'StatisticLake',
|
||||||
|
components: {
|
||||||
|
Raw,
|
||||||
|
ComNutritional,
|
||||||
|
Average,
|
||||||
|
AvgNutritional,
|
||||||
|
Comparison,
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeKey: 'raw',
|
||||||
|
searchForm:{},
|
||||||
|
filterKeys:[]
|
||||||
|
};
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeSearch(data){
|
||||||
|
this.searchForm = data
|
||||||
|
},
|
||||||
|
changeFilter(data){
|
||||||
|
this.filterKeys = data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.ele-body{
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user