城市内湖前3表

This commit is contained in:
庞东林
2021-12-08 10:43:34 +08:00
parent 3670be1575
commit 23d63cb7f4
9 changed files with 252 additions and 192 deletions

View File

@@ -0,0 +1,38 @@
import axios from 'axios';
// 湖库断面,区域
export const getLakeDropdown = function () {
return axios.get(`/lakeLibrary/lakeCityDict/list`)
}
// 湖库水质分析城市内湖原始数据接口
export const cityOriginalUrl = '/lakeLibrary/wateAnalysis/city/originalData'
export const cityOriginalData = function (data) {
return axios.post(cityOriginalUrl,data)
}
//城市内湖综合营养指数接口
export const cityComprehensiveNutritionUrl = '/lakeLibrary/wateAnalysis/city/comprehensiveNutrition';
export const cityComprehensiveNutritionData = function (data) {
return axios.post(cityComprehensiveNutritionUrl,data)
}
// 城市内湖平均数据接口
export const cityAverageUrl = '/lakeLibrary/wateAnalysis/city/average';
export const cityAverageData = function (data) {
return axios.post(cityAverageUrl,data)
}
// 城市内湖平均营养指数接口
export const cityAverageNutritionUrl = '/lakeLibrary/wateAnalysis/city/averageNutrition';
export const cityAverageNutrition = function (data) {
return axios.post(cityAverageNutritionUrl,data)
}
// 城市内湖平均营养指数接口
export const cityYearContrastUrl = '/lakeLibrary/wateAnalysis/city/yearContrast';
export const cityYearContrastData = function (data) {
return axios.post(cityYearContrastUrl,data)
}

View File

@@ -3,13 +3,13 @@
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter"/>
<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="url"
:loading="loading"
:datasource="datasource"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@@ -23,7 +23,8 @@
<script>
import XLSX from "xlsx";
import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
// import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
import {cityAverageData} 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"
@@ -45,6 +46,9 @@ export default {
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
@@ -53,7 +57,7 @@ export default {
locale,
bill: {},
// 表格数据接口
url: pageLakeUrl,
datasource:[],
selection: [],
// 表格列配置
columns: averageTableColumns,
@@ -63,10 +67,10 @@ export default {
where:{},
// 表格选中数据
selectionList: [],
loading: false
};
},
mounted() {
// this.loadOptionData();
},
watch: {
filterKeys(newKeys) {
@@ -74,7 +78,24 @@ export default {
},
},
methods: {
// 传上父级
// 获取列表数据
getPageData(){
this.loading = true;
cityAverageData(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)
},
@@ -105,39 +126,12 @@ export default {
this.reload();
},
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("place").then((res) => {
this.palceOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("area").then((res) => {
this.areaOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("region_level").then((res) => {
this.regionLevelOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
this.getPageData()
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {

View File

@@ -3,15 +3,15 @@
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter"/>
<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="url"
:datasource="datasource"
:columns="columns"
:where="where"
:loading="loading"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
@@ -23,7 +23,8 @@
<script>
import XLSX from "xlsx";
import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
// import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
import {cityAverageNutrition} from "@/api/ecology/new-lake";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from './search.vue';
export default {
@@ -44,6 +45,9 @@ export default {
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
@@ -52,7 +56,7 @@ export default {
locale,
bill: {},
// 表格数据接口
url: pageLakeUrl,
datasource:[],
selection: [],
// 表格列配置
columns: [
@@ -70,10 +74,11 @@ export default {
where:{},
// 表格选中数据
selectionList: [],
loading: false
};
},
mounted() {
// this.loadOptionData();
},
methods: {
// 传上父级
@@ -83,43 +88,30 @@ export default {
// 执行搜索
searchData(data){
this.where = data;
this.$emit("search", this.where);
this.$emit("search", this.where);
this.reload();
},
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("place").then((res) => {
this.palceOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("area").then((res) => {
this.areaOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("region_level").then((res) => {
this.regionLevelOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
// 获取列表数据
getPageData(){
this.loading = true;
cityAverageNutrition(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.$refs.table.reload({
where: this.where,
});
this.getPageData();
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {

View File

@@ -3,15 +3,15 @@
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter"/>
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="lakeLibraryInnerCityId"
:datasource="url"
:datasource="datasource"
:columns="columns"
:where="where"
:loading="loading"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
@@ -23,7 +23,8 @@
<script>
import XLSX from "xlsx";
import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
// import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
import {cityComprehensiveNutritionData} from "@/api/ecology/new-lake";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from './search.vue';
export default {
@@ -44,6 +45,9 @@ export default {
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
@@ -52,7 +56,8 @@ export default {
locale,
bill: {},
// 表格数据接口
url: pageLakeUrl,
// url: pageLakeUrl,
datasource:[],
selection: [],
// 表格列配置
columns: [
@@ -70,6 +75,7 @@ export default {
where:{},
// 表格选中数据
selectionList: [],
loading:false
};
},
mounted() {
@@ -83,43 +89,33 @@ export default {
// 执行搜索
searchData(data){
this.where = data;
this.$emit("search", this.where);
this.$emit("search", this.where);
this.reload();
},
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("place").then((res) => {
this.palceOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("area").then((res) => {
this.areaOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("region_level").then((res) => {
this.regionLevelOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
// 获取列表数据
getPageData(){
console.log('请求')
this.loading = true;
cityComprehensiveNutritionData(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.$refs.table.reload({
where: this.where,
});
this.getPageData();
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {

View File

@@ -8,10 +8,10 @@
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="lakeLibraryInnerCityId"
:datasource="url"
:datasource="datasource"
:columns="columns"
:where="where"
:loading="loading"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
@@ -23,7 +23,8 @@
<script>
import XLSX from "xlsx";
import { pageLakeUrl, getColumnOptions } from "@/api/ecology/lake";
// import { pageLakeUrl, getColumnOptions } from "@/api/ecology/lake";
import {cityYearContrastData} from "@/api/ecology/new-lake";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import Search from "./search.vue";
export default {
@@ -44,7 +45,10 @@ export default {
default: function () {
return []
},
}
},
visiable:{
typeof:Boolean
}
},
data() {
return {
@@ -52,7 +56,7 @@ export default {
locale,
bill: {},
// 表格数据接口
url: pageLakeUrl,
datasource: [],
selection: [],
// 表格列配置
columns: [
@@ -92,6 +96,7 @@ export default {
where: {},
// 表格选中数据
selectionList: [],
loading:false
};
},
mounted() {
@@ -109,38 +114,29 @@ export default {
this.reload();
},
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("place").then((res) => {
this.palceOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("area").then((res) => {
this.areaOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("region_level").then((res) => {
this.regionLevelOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
// 获取列表数据
getPageData(){
this.loading = true;
cityYearContrastData(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.$refs.table.reload({
where: this.where,
});
this.getPageData()
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {

View File

@@ -3,14 +3,14 @@
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter"/>
<search :searchForm="searchForm" :filterKeys="filterKeys" @search="searchData" @exportFile="exportFile" @filterColumns="changeFilter" :visiable="visiable"/>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="lakeLibraryInnerCityId"
:datasource="url"
:datasource="datasource"
:columns="columns"
:loading="loading"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
@@ -23,7 +23,7 @@
<script>
import XLSX from "xlsx";
import {pageLakeUrl, getColumnOptions} from "@/api/ecology/lake";
import {getLakeDropdown, cityOriginalData} 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"
@@ -45,6 +45,9 @@ export default {
default: function () {
return []
},
},
visiable:{
typeof:Boolean
}
},
data() {
@@ -53,7 +56,8 @@ export default {
locale,
bill: {},
// 表格数据接口
url: pageLakeUrl,
// url: cityOriginalUrl,
datasource:[],
selection: [],
// 表格列配置
columns: innerTableColumns,
@@ -63,17 +67,32 @@ export default {
where:{},
// 表格选中数据
selectionList: [],
loading:false
};
},
mounted() {
// this.loadOptionData();
},
watch: {
filterKeys(newKeys) {
this.filterColumns(newKeys)
this.filterColumns(newKeys)
},
},
methods: {
// 获取列表数据
getPageData(){
this.loading = true
cityOriginalData(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)
@@ -108,37 +127,22 @@ export default {
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("place").then((res) => {
getLakeDropdown().then((res) => {
this.palceOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("area").then((res) => {
this.areaOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
getColumnOptions("region_level").then((res) => {
this.regionLevelOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
label: item.sectionName,
value: item.sectionName,
};
});
});
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
this.getPageData();
// this.$refs.table.reload({
// where: this.where,
// });
},
/* 重置搜索 */
reset() {

View File

@@ -8,7 +8,7 @@
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="断面名称:">
<a-select v-model:value="where.sectionName" allowClear showSearch>
<a-select-option v-for="item in palceOptions" :key="item.value"
<a-select-option v-for="item in sectionOptions" :key="item.value"
>{{ item.label }}
</a-select-option>
</a-select>
@@ -55,11 +55,9 @@
allowClear
placeholder="未选择"
>
<a-select-option value="良庆区">良庆区</a-select-option>
<a-select-option value="江南区">江南区</a-select-option>
<a-select-option value="江南区">横县</a-select-option>
<a-select-option value="江南区">青秀区</a-select-option>
<a-select-option value="江南区">良庆区</a-select-option>
<a-select-option v-for="item in palceOptions" :key="item.value"
>{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
@@ -123,6 +121,7 @@
<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: {
@@ -138,7 +137,10 @@ export default {
default: function () {
return [];
},
}
},
visiable:{
typeof:Boolean
}
},
data() {
return {
@@ -152,9 +154,14 @@ export default {
filterColumns: innerFilterColumns,
newCloumns:[],
oldCloumns:[],
filterItem:[]
filterItem:[],
palceOptions:[],
sectionOptions:[]
};
},
created(){
this.loadOptionData();
},
watch: {
searchForm(newV) {
this.where = newV;
@@ -174,7 +181,11 @@ export default {
this.checkAll = true
this.indeterminate = false
}
}
},
// 监听组件显示
visiable(val){
this.emitData(val)
}
},
mounted() {
this.where = this.searchForm;
@@ -184,18 +195,45 @@ export default {
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))
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) : []
@@ -212,7 +250,9 @@ export default {
this.newCloumns = newCloumns;
},
reset() {
this.where = {};
this.where = {
checked: 1,
};
this.searchData();
},
searchData() {

View File

@@ -3,10 +3,10 @@
<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"></raw>
<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"></com-nutritional>
<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>