From 05302246665dbb14b26c5d46386bd82d89965396 Mon Sep 17 00:00:00 2001
From: XingChuan <m17600301067@163.com>
Date: 星期四, 27 五月 2021 14:47:41 +0800
Subject: [PATCH] 更换报表数据请求方式
---
public/assets/wasteGas.json | 53 +++++
src/components/table/components/SoilGroundwater.vue | 52 -----
src/components/table/components/tabHandover.vue | 60 +++++-
src/components/table/components/WasteWater.vue | 54 -----
src/api/mapApi.js | 15 +
src/components/table/components/WasteGas.vue | 52 -----
public/assets/soilGroundwater.json | 53 +++++
public/assets/wasteWater.json | 53 +++++
src/components/table/components/EnvironmentalRisk.vue | 43 ++++
public/assets/pollutionSource.json | 22 ++
src/components/table/components/PollutionSource.vue | 41 ++++
11 files changed, 336 insertions(+), 162 deletions(-)
diff --git a/public/assets/pollutionSource.json b/public/assets/pollutionSource.json
new file mode 100644
index 0000000..716e990
--- /dev/null
+++ b/public/assets/pollutionSource.json
@@ -0,0 +1,22 @@
+[
+ {
+ "UserName": "闆嗗洟鍏徃",
+ "ProductionFacilities": 45,
+ "GovernanceFacilities": 32
+ },
+ {
+ "UserName": "鍖椾含鐭虫补",
+ "ProductionFacilities": 22,
+ "GovernanceFacilities": 14
+ },
+ {
+ "UserName": "澶╂触鐭冲寲",
+ "ProductionFacilities": 3,
+ "GovernanceFacilities": 12
+ },
+ {
+ "UserName": "璐靛窞鐭虫补",
+ "ProductionFacilities": 10,
+ "GovernanceFacilities": 6
+ }
+]
\ No newline at end of file
diff --git a/public/assets/soilGroundwater.json b/public/assets/soilGroundwater.json
new file mode 100644
index 0000000..e74333e
--- /dev/null
+++ b/public/assets/soilGroundwater.json
@@ -0,0 +1,53 @@
+[
+ {
+ UserName: '闆嗗洟鍚嶇О',
+ WasteWaters: '',
+ AddOutPut: '',
+ MonthOutPut: '',
+ NH4NPut: '',
+ NH4NMonth: '',
+ normal: '',
+ overProof: '',
+ Abnormal: '',
+ StopProduction: '',
+ deficiency: ''
+ },
+ {
+ UserName: '澶╂触鐭冲寲',
+ WasteWaters: '116.6',
+ AddOutPut: '58.3',
+ MonthOutPut: '13.1',
+ NH4NPut: '58.3',
+ NH4NMonth: '13.1',
+ normal: '21',
+ overProof: '2',
+ Abnormal: '2',
+ StopProduction: '2',
+ deficiency: '2'
+ },
+ {
+ UserName: 'xxxx鐐煎寲3',
+ WasteWaters: '116.6',
+ MonthOutPut: '13.1',
+ NH4NPut: '58.3',
+ NH4NMonth: '13.1',
+ normal: '21',
+ overProof: '2',
+ Abnormal: '2',
+ StopProduction: '2',
+ deficiency: '2'
+ },
+ {
+ UserName: 'xxxx4',
+ WasteWaters: '116.6',
+ AddOutPut: '58.3',
+ MonthOutPut: '13.1',
+ NH4NPut: '58.3',
+ NH4NMonth: '13.1',
+ normal: '21',
+ overProof: '2',
+ Abnormal: '2',
+ StopProduction: '2',
+ deficiency: '2'
+ }
+]
\ No newline at end of file
diff --git a/public/assets/wasteGas.json b/public/assets/wasteGas.json
new file mode 100644
index 0000000..2ffbdf6
--- /dev/null
+++ b/public/assets/wasteGas.json
@@ -0,0 +1,53 @@
+[
+ {
+ "UserName": "闆嗗洟鍚嶇О",
+ "WasteWaters": "",
+ "AddOutPut": "",
+ "MonthOutPut": "",
+ "NH4NPut": "",
+ "NH4NMonth": "",
+ "normal": "",
+ "overProof": "",
+ "Abnormal": "",
+ "StopProduction": "",
+ "deficiency": ""
+ },
+ {
+ "UserName": "澶╂触鐭冲寲",
+ "WasteWaters": "116.6",
+ "AddOutPut": "58.3",
+ "MonthOutPut": "13.1",
+ "NH4NPut": "58.3",
+ "NH4NMonth": "13.1",
+ "normal": "21",
+ "overProof": "2",
+ "Abnormal": "2",
+ "StopProduction": "2",
+ "deficiency": "2"
+ },
+ {
+ "UserName": "xxxx鐐煎寲3",
+ "WasteWaters": "116.6",
+ "MonthOutPut": "13.1",
+ "NH4NPut": "58.3",
+ "NH4NMonth": "13.1",
+ "normal": "21",
+ "overProof": "2",
+ "Abnormal": "2",
+ "StopProduction": "2",
+ "deficiency": "2"
+ },
+ {
+ "UserName": "xxxx4",
+ "WasteWaters": "116.6",
+ "AddOutPut": "58.3",
+ "MonthOutPut": "13.1",
+ "NH4NPut": "58.3",
+ "NH4NMonth": "13.1",
+ "normal": "21",
+ "overProof": "2",
+ "Abnormal": "2",
+ "StopProduction": "2",
+ "deficiency": "2"
+ }
+]
\ No newline at end of file
diff --git a/public/assets/wasteWater.json b/public/assets/wasteWater.json
new file mode 100644
index 0000000..2ffbdf6
--- /dev/null
+++ b/public/assets/wasteWater.json
@@ -0,0 +1,53 @@
+[
+ {
+ "UserName": "闆嗗洟鍚嶇О",
+ "WasteWaters": "",
+ "AddOutPut": "",
+ "MonthOutPut": "",
+ "NH4NPut": "",
+ "NH4NMonth": "",
+ "normal": "",
+ "overProof": "",
+ "Abnormal": "",
+ "StopProduction": "",
+ "deficiency": ""
+ },
+ {
+ "UserName": "澶╂触鐭冲寲",
+ "WasteWaters": "116.6",
+ "AddOutPut": "58.3",
+ "MonthOutPut": "13.1",
+ "NH4NPut": "58.3",
+ "NH4NMonth": "13.1",
+ "normal": "21",
+ "overProof": "2",
+ "Abnormal": "2",
+ "StopProduction": "2",
+ "deficiency": "2"
+ },
+ {
+ "UserName": "xxxx鐐煎寲3",
+ "WasteWaters": "116.6",
+ "MonthOutPut": "13.1",
+ "NH4NPut": "58.3",
+ "NH4NMonth": "13.1",
+ "normal": "21",
+ "overProof": "2",
+ "Abnormal": "2",
+ "StopProduction": "2",
+ "deficiency": "2"
+ },
+ {
+ "UserName": "xxxx4",
+ "WasteWaters": "116.6",
+ "AddOutPut": "58.3",
+ "MonthOutPut": "13.1",
+ "NH4NPut": "58.3",
+ "NH4NMonth": "13.1",
+ "normal": "21",
+ "overProof": "2",
+ "Abnormal": "2",
+ "StopProduction": "2",
+ "deficiency": "2"
+ }
+]
\ No newline at end of file
diff --git a/src/api/mapApi.js b/src/api/mapApi.js
index 4cec69b..bb60fa9 100644
--- a/src/api/mapApi.js
+++ b/src/api/mapApi.js
@@ -91,5 +91,20 @@
},
getRiskEnterprise (data) {
return axios.get('/assets/riskEnterprise.json', data)
+ },
+ getPollutionSourceStatistics (data) {
+ return axios.get('/assets/pollutionSource.json', data)
+ },
+ getWasteWaterStatistics (data) {
+ return axios.get('/assets/wasteWater.json', data)
+ },
+ getWasteGasStatistics (data) {
+ return axios.get('/assets/wasteGas.json', data)
+ },
+ getSolidWasteStatistics (data) {
+ return axios.get('/assets/wasteGas.json', data)
+ },
+ getEnvironmentalRiskStatistics (data) {
+ return axios.get('/assets/pollutionSource.json', data)
}
}
diff --git a/src/components/table/components/EnvironmentalRisk.vue b/src/components/table/components/EnvironmentalRisk.vue
new file mode 100644
index 0000000..739b570
--- /dev/null
+++ b/src/components/table/components/EnvironmentalRisk.vue
@@ -0,0 +1,43 @@
+<template>
+ <div class="PollutionSource">
+ <el-table class="tableBox" :data="EnvironmentalRisktableDataList" :header-cell-style="tableHeaderColor" :cell-style="rowClass" border>
+ <el-table-column width="30px" label="">
+ <template>
+ <i class="el-icon-caret-right"></i>
+ <span style="margin-left: 10px"></span>
+ </template>
+ </el-table-column>
+ <el-table-column label="搴忓彿" width="60px" type="index"></el-table-column>
+ <el-table-column prop="UserName" label="浼佷笟鍚嶇О"></el-table-column>
+ <el-table-column prop="ProductionFacilities" label="涓�绾ч闄╂簮锛堜釜锛�"></el-table-column>
+ <el-table-column prop="GovernanceFacilities" label="浜岀骇椋庨櫓婧愶紙涓級"></el-table-column>
+ <el-table-column prop="GovernanceFacilities" label="涓夌骇椋庨櫓婧愶紙涓級"></el-table-column>
+ <el-table-column prop="GovernanceFacilities" label="搴旀�ョ墿璧勫瓨鏀剧偣"></el-table-column>
+ </el-table>
+ </div>
+</template>
+
+<script>
+export default {
+ name: 'AirQuality',
+ data () {
+ return {
+ tableData: null
+ }
+ },
+ props: ['EnvironmentalRisktableDataList'],
+ methods: {
+ tableHeaderColor ({ row, column, owIndex, columnIndex }) {
+ // return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px'
+ },
+ // 琛ㄥご鏍峰紡璁剧疆
+ rowClass () {
+ // return 'text-align: center;background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;width:64px'
+ }
+ }
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/components/table/components/PollutionSource.vue b/src/components/table/components/PollutionSource.vue
new file mode 100644
index 0000000..aa4adcd
--- /dev/null
+++ b/src/components/table/components/PollutionSource.vue
@@ -0,0 +1,41 @@
+<template>
+ <div class="PollutionSource">
+ <el-table class="tableBox" :data="PollutionSourcetableDataList" :header-cell-style="tableHeaderColor" :cell-style="rowClass" border>
+ <el-table-column width="30px" label="">
+ <template>
+ <i class="el-icon-caret-right"></i>
+ <span style="margin-left: 10px"></span>
+ </template>
+ </el-table-column>
+ <el-table-column label="搴忓彿" width="60px" type="index"></el-table-column>
+ <el-table-column prop="UserName" label="浼佷笟鍚嶇О"></el-table-column>
+ <el-table-column prop="ProductionFacilities" label="鐢熶骇璁炬柦"></el-table-column>
+ <el-table-column prop="GovernanceFacilities" label="娌荤悊璁炬柦"></el-table-column>
+ </el-table>
+ </div>
+</template>
+
+<script>
+export default {
+ name: 'AirQuality',
+ data () {
+ return {
+ tableData: null
+ }
+ },
+ props: ['PollutionSourcetableDataList'],
+ methods: {
+ tableHeaderColor ({ row, column, owIndex, columnIndex }) {
+ // return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px'
+ },
+ // 琛ㄥご鏍峰紡璁剧疆
+ rowClass () {
+ // return 'text-align: center;background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;width:64px'
+ }
+ }
+}
+</script>
+
+<style scoped>
+
+</style>
diff --git a/src/components/table/components/SoilGroundwater.vue b/src/components/table/components/SoilGroundwater.vue
index cad6f79..27709a7 100644
--- a/src/components/table/components/SoilGroundwater.vue
+++ b/src/components/table/components/SoilGroundwater.vue
@@ -1,6 +1,6 @@
<template>
<div class="waste-water">
- <el-table class="tableBox" :data="tableData" style="width: 100%" @cell-click="handle">
+ <el-table class="tableBox" :data="SolidWastetableDataList" style="width: 100%" @cell-click="handle">
<el-table-column width="30px" label="">
<template slot-scope="{row,$index}">
<el-popover placement="bottom" trigger="click" :disabled="!isShowIcon" popper-class="popovers">
@@ -96,55 +96,6 @@
return {
isActive: '',
isShowIcon: false,
- tableData: [{
- UserName: '闆嗗洟鍚嶇О',
- WasteWaters: '',
- AddOutPut: '',
- MonthOutPut: '',
- NH4NPut: '',
- NH4NMonth: '',
- normal: '',
- overProof: '',
- Abnormal: '',
- StopProduction: '',
- deficiency: ''
- }, {
- UserName: '澶╂触鐭冲寲',
- WasteWaters: '116.6',
- AddOutPut: '58.3',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
- }, {
- UserName: 'xxxx鐐煎寲3',
- WasteWaters: '116.6',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
- }, {
- UserName: 'xxxx4',
- WasteWaters: '116.6',
- AddOutPut: '58.3',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
-
- }],
tableHeader1: [
{ name: '浼佷笟鍚嶇О', width: '140', propS: 'value1' },
{ name: '鍦板潡鍚嶇О', width: '140', propS: 'value2' },
@@ -165,6 +116,7 @@
]
}
},
+ props: ['SolidWastetableDataList'],
methods: {
tableHeaderColor ({ row, column, owIndex, columnIndex }) {
// return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px'
diff --git a/src/components/table/components/WasteGas.vue b/src/components/table/components/WasteGas.vue
index 1bbe3b1..6ad7cd5 100644
--- a/src/components/table/components/WasteGas.vue
+++ b/src/components/table/components/WasteGas.vue
@@ -1,6 +1,6 @@
<template>
<div class="Waste-water">
- <el-table class="tableBox" :data="tableData" :header-cell-style="tableHeaderColor" :cell-style="rowClass" @cell-click="handle">
+ <el-table class="tableBox" :data="WasteGastableDataList" :header-cell-style="tableHeaderColor" :cell-style="rowClass" @cell-click="handle">
<el-table-column width="30px" label="">
<template slot-scope="{row,$index}">
<!-- <i class="el-icon-caret-right" v-if="$index ===1"></i>-->
@@ -74,55 +74,6 @@
return {
isActive: '',
isShowIcon: false,
- tableData: [{
- UserName: '闆嗗洟鍚嶇О',
- WasteWaters: '',
- AddOutPut: '',
- MonthOutPut: '',
- NH4NPut: '',
- NH4NMonth: '',
- normal: '',
- overProof: '',
- Abnormal: '',
- StopProduction: '',
- deficiency: ''
- }, {
- UserName: '澶╂触鐭冲寲',
- WasteWaters: '116.6',
- AddOutPut: '58.3',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
- }, {
- UserName: 'xxxx鐐煎寲3',
- WasteWaters: '116.6',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
- }, {
- UserName: 'xxxx4',
- WasteWaters: '116.6',
- AddOutPut: '58.3',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
-
- }],
tableHeader1: [
{ name: '鎺掓斁鐐�', width: '140', propS: 'value1' },
{ name: '鍗曚綅閮ㄩ棬', width: '80', propS: 'value2' },
@@ -137,6 +88,7 @@
]
}
},
+ props: ['WasteGastableDataList'],
methods: {
tableHeaderColor ({ columnIndex }) {
// return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px'
diff --git a/src/components/table/components/WasteWater.vue b/src/components/table/components/WasteWater.vue
index a4c51fd..2a970b8 100644
--- a/src/components/table/components/WasteWater.vue
+++ b/src/components/table/components/WasteWater.vue
@@ -1,6 +1,6 @@
<template>
<div class="waste-water">
- <el-table class="tableBox" :data="tableData" style="width: 100%" @cell-click="handle">
+ <el-table class="tableBox" :data="WasteWatertableDataList" style="width: 100%" @cell-click="handle">
<el-table-column width="30px" label="">
<template slot-scope="{row,$index}">
<!-- <i class="el-icon-caret-right" v-if="$index ===1"></i>-->
@@ -80,58 +80,10 @@
data () {
return {
isActive: '',
- isShowIcon: false,
- tableData: [{
- UserName: '闆嗗洟鍚嶇О',
- WasteWaters: '',
- AddOutPut: '',
- MonthOutPut: '',
- NH4NPut: '',
- NH4NMonth: '',
- normal: '',
- overProof: '',
- Abnormal: '',
- StopProduction: '',
- deficiency: ''
- }, {
- UserName: '澶╂触鐭冲寲',
- WasteWaters: '116.6',
- AddOutPut: '58.3',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
- }, {
- UserName: 'xxxx鐐煎寲3',
- WasteWaters: '116.6',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
- }, {
- UserName: 'xxxx4',
- WasteWaters: '116.6',
- AddOutPut: '58.3',
- MonthOutPut: '13.1',
- NH4NPut: '58.3',
- NH4NMonth: '13.1',
- normal: '21',
- overProof: '2',
- Abnormal: '2',
- StopProduction: '2',
- deficiency: '2'
-
- }]
+ isShowIcon: false
}
},
+ props: ['WasteWatertableDataList'],
methods: {
tableHeaderColor ({ row, column, owIndex, columnIndex }) {
// return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px'
diff --git a/src/components/table/components/tabHandover.vue b/src/components/table/components/tabHandover.vue
index 1665928..1599ed3 100644
--- a/src/components/table/components/tabHandover.vue
+++ b/src/components/table/components/tabHandover.vue
@@ -4,7 +4,12 @@
<el-tab-pane v-for="(item,index) in topicList" :key="index" :label="item.name" :name="item.name"></el-tab-pane>
</el-tabs>
<div>
- <component :is="gcComp"></component>
+ <component :is="gcComp" :PollutionSourcetableDataList="PollutionSourcetableDataList" v-if="PollutionSourcetableDataList"
+ :WasteWatertableDataList="WasteWatertableDataList"
+ :WasteGastableDataList="WasteGastableDataList"
+ :SolidWastetableDataList="SolidWastetableDataList"
+ :EnvironmentalRisktableDataList="EnvironmentalRisktableDataList"
+ ></component>
</div>
</div>
</template>
@@ -15,10 +20,11 @@
import SoilGroundwater from '@components/table/components/SoilGroundwater'
import WasteGas from '@components/table/components/WasteGas'
import SolidWaste from '@components/table/components/WasteSolid'
-import AirQuality from '@components/table/components/AirQuality'
+import PollutionSource from '@components/table/components/PollutionSource'
+import EnvironmentalRisk from '@components/table/components/EnvironmentalRisk'
+import mapApi from '@/api/mapApi'
import { TopicList } from '../../../conf/Topic'
-
export default {
name: 'tabHandover',
components: {
@@ -26,43 +32,75 @@
// WasteGas,
// SoilGroundwater,
SolidWaste,
- AirQuality
+ PollutionSource,
+ EnvironmentalRisk
},
data () {
return {
titleProp: '',
- activeName: 'gcComp',
- topicList: TopicList,
- gcComp: AirQuality
+ activeName: '姹℃煋婧�',
+ topicList: TopicList, // tab椤�
+ gcComp: PollutionSource, // 榛樿鏄剧ず姹℃煋婧愬唴瀹�
+ PollutionSourcetableDataList: null, // 姹℃煋婧愮粺璁℃暟鎹�
+ WasteWatertableDataList: null, // 搴熸按缁熻鏁版嵁
+ WasteGastableDataList: null, // 搴熸皵缁熻鏁版嵁
+ SolidWastetableDataList: null, // 鍥哄簾缁熻鏁版嵁
+ EnvironmentalRisktableDataList: null // 鐜椋庨櫓婧愮粺璁℃暟鎹�
}
+ },
+ mounted () {
+ this.getStatisticsData(this.activeName)
},
methods: {
refsDatatitle (item) {
this.titleProp = item
},
+ async getStatisticsData (obj) {
+ switch (obj) {
+ case '姹℃煋婧�':
+ this.PollutionSourcetableDataList = await mapApi.getPollutionSourceStatistics()
+ break
+ case '搴熸按':
+ this.WasteWatertableDataList = await mapApi.getWasteWaterStatistics()
+ break
+ case '搴熸皵':
+ this.WasteGastableDataList = await mapApi.getWasteGasStatistics()
+ break
+ case '鍥哄簾':
+ this.SolidWastetableDataList = await mapApi.getSolidWasteStatistics()
+ break
+ case '鐜椋庨櫓':
+ this.EnvironmentalRisktableDataList = await mapApi.getEnvironmentalRiskStatistics()
+ break
+ }
+ },
handleClick (tab, event) {
- console.log(tab.label)
switch (tab.label) {
case '姹℃煋婧�':
- this.gcComp = AirQuality
+ this.gcComp = PollutionSource
+ this.getStatisticsData('姹℃煋婧�')
break
case '搴熸按':
this.gcComp = WasteWater
+ this.getStatisticsData('搴熸按')
break
case '搴熸皵':
this.gcComp = WasteGas
+ this.getStatisticsData('搴熸皵')
break
case '鍥哄簾':
this.gcComp = SolidWaste
+ this.getStatisticsData('鍥哄簾')
break
case '鐜椋庨櫓':
- this.gcComp = AirQuality
+ this.gcComp = EnvironmentalRisk
+ this.getStatisticsData('鐜椋庨櫓')
break
case '鍦熷¥鍙婂湴涓嬫按':
this.gcComp = SoilGroundwater
break
case '绠$嚎':
- this.gcComp = AirQuality
+ // this.gcComp = AirQuality
break
}
}
--
Gitblit v1.8.0