diff --git a/src/api/ecology/acid.js b/src/api/ecology/acid.js
index 7072f3a..7e73daf 100644
--- a/src/api/ecology/acid.js
+++ b/src/api/ecology/acid.js
@@ -49,8 +49,7 @@ const updateAcidRain = function (data) {
// -------------------------统计---------------------
const pageAcidRainStatisticUrl = '/acidRain/acidRain/statistic';
-const statisticSourceUrl = '/acidRain/acidRain/statistic/source';
-const statisticYearUrl = '/acidRain/acidRain/statistic/year';
+
const getHistoryyears = function () {
return axios.get("/acidRain/acidRain/history-year")
}
@@ -58,6 +57,10 @@ const getColumnOptions = function(column){
return axios.get("/acidRain/acidRain/options",{params:{column}})
}
+const statisticCity = "/acidRain/acidRain/statistic/city"
+const statisticCounty = "/acidRain/acidRain/statistic/county"
+const statisticIon = "/acidRain/acidRain/statistic/ion"
+
export {
pageBillUrl,
saveAcidRainBill,
@@ -74,7 +77,7 @@ export {
pageAcidRainStatisticUrl,
getHistoryyears,
getColumnOptions,
- statisticSourceUrl,
- statisticYearUrl
-
+ statisticCity,
+ statisticIon,
+ statisticCounty
}
diff --git a/src/api/ecology/atmosphere/acid-rain-plcae.js b/src/api/ecology/atmosphere/acid-rain-plcae.js
index eeccf92..b56d902 100644
--- a/src/api/ecology/atmosphere/acid-rain-plcae.js
+++ b/src/api/ecology/atmosphere/acid-rain-plcae.js
@@ -1,32 +1,39 @@
import axios from 'axios';
-const baseUri = "/ambientAir/airPlaceBasicInfoDict";
+const baseUri = "/acidRain/acidRainPlaceBaseInfoDict";
const listAllUrl = baseUri + "";
// 添加
const savePlace = function (data) {
- return axios.post("/ambientAir/airPlaceBasicInfoDict",data)
+ return axios.post("/acidRain/acidRainPlaceBaseInfoDict",data)
}
// 删除
const removePlace = function (id) {
- return axios.delete(`/ambientAir/airPlaceBasicInfoDict/${id}`,)
+ return axios.delete(`/acidRain/acidRainPlaceBaseInfoDict/${id}`,)
}
// 批量删除
const removeBatchPlace = function (ids) {
- return axios.delete("/ambientAir/airPlaceBasicInfoDict/batch",{data:ids})
+ return axios.delete("/acidRain/acidRainPlaceBaseInfoDict/batch",{data:ids})
}
// 修改
const updatePlace = function (data) {
- return axios.put("/ambientAir/airPlaceBasicInfoDict",data)
+ return axios.put("/acidRain/acidRainPlaceBaseInfoDict",data)
}
-
+const copyBatchPlace = function (data){
+ return axios.post("/acidRain/acidRainPlaceBaseInfoDict/copyBatch",data)
+}
+const getColumnOptions = function(column){
+ return axios.get("/acidRain/acidRainPlaceBaseInfoDict/options",{params:{column}})
+}
export {
listAllUrl,
savePlace,
updatePlace,
removeBatchPlace,
- removePlace
+ removePlace,
+ copyBatchPlace,
+ getColumnOptions
}
diff --git a/src/views/atmosphere/acid-rain/dict/index.vue b/src/views/atmosphere/acid-rain/dict/index.vue
index 73d2acd..25bbc9e 100644
--- a/src/views/atmosphere/acid-rain/dict/index.vue
+++ b/src/views/atmosphere/acid-rain/dict/index.vue
@@ -5,9 +5,9 @@
-
-
-
+
+
+
@@ -20,14 +20,12 @@
*
*
*/
-import LeqLevel from "./leq-level"
import Place from "./place"
export default {
- name: 'ZoneNoiseDictIndex',
+ name: 'AcidRainDictIndex',
components: {
- LeqLevel,
Place
},
data() {
diff --git a/src/views/atmosphere/acid-rain/dict/leq-level.vue b/src/views/atmosphere/acid-rain/dict/leq-level.vue
deleted file mode 100644
index 0ea43ec..0000000
--- a/src/views/atmosphere/acid-rain/dict/leq-level.vue
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- 昼
- 夜
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 新增
-
- 删除
-
-
-
-
-
-
- 修改
-
- 删除
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/views/atmosphere/acid-rain/dict/place.vue b/src/views/atmosphere/acid-rain/dict/place.vue
index 5940883..4bbe631 100644
--- a/src/views/atmosphere/acid-rain/dict/place.vue
+++ b/src/views/atmosphere/acid-rain/dict/place.vue
@@ -1,9 +1,56 @@
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
(data = d.data)"
>
新增
+
+
+
+
+ {{ item.label }}
+
+
+
+
+ 批量复制
+
+
+
删除
+ 导出
@@ -66,7 +169,8 @@
type="primary"
shape="round"
size="small"
- >修改修改
+
删除删除
+
@@ -93,12 +198,16 @@ import {
savePlace,
updatePlace,
removePlace,
- removeBatchPlace
-} from "@/api/ecology/noise/zone-noise-place";
+ removeBatchPlace,
+ copyBatchPlace,
+ getColumnOptions
+} from "@/api/ecology/atmosphere/acid-rain-plcae";
+import {DownOutlined} from '@ant-design/icons-vue';
+import XLSX from "xlsx";
// import moment from "moment";
export default {
- name: "ZoneNoisePlace",
- components: {},
+ name: "AcidRainPlace",
+ components: {DownOutlined},
data() {
return {
data: [],
@@ -107,6 +216,11 @@ export default {
selection: [],
// 表格列配置
columns: [
+ {
+ title: "年份",
+ dataIndex: "year",
+ sorter: true,
+ },
{
title: "点位名称",
dataIndex: "place",
@@ -133,25 +247,29 @@ export default {
},
},
],
-
// 表格搜索条件
where: {},
+ yearOptions: [],
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
+ showNYear:false,
+ cYear: undefined,
+ nYear:undefined,
// 表单数据
form: {},
loading: false,
rules: {
- place:[{required: true,message: '请输入点位名称'}],
- placeCode:[{required: true,message: '请输入点位编码'}],
- placeLng: [{required: true,message: '请输入测点经度',},],
- placeLat: [{required: true,message: '请输入测点纬度',},],
+ year: [{required: true, message: '请输入年份'}],
+ placeName: [{required: true, message: '请选择测点名称'}],
+ placeLng: [{required: true, message: '请输入测点经度',},],
+ placeLat: [{required: true, message: '请输入测点纬度',},],
},
};
},
mounted() {
+ this.getOptions();
},
methods: {
/* 刷新表格 */
@@ -161,6 +279,19 @@ export default {
where: this.where,
});
},
+ getOptions(){
+ getColumnOptions("year").then(res => {
+ console.log(res)
+ if (res.data.code == 0) {
+ this.yearOptions = res.data.data.map(item => {
+ return {
+ label: item,
+ value: item
+ }
+ })
+ }
+ })
+ },
/* 重置搜索 */
reset() {
this.where = {};
@@ -179,13 +310,14 @@ export default {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
- if (form.airBasicInfoDictId) {
+ if (form.roadNoisePlaceId) {
updatePlace(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
+ this.getOptions();
} else {
this.$message.error(res.data.msg);
}
@@ -203,6 +335,7 @@ export default {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
+ this.getOptions();
} else {
this.$message.error(res.data.msg);
}
@@ -218,7 +351,7 @@ export default {
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
- removePlace(row.airBasicInfoDictId).then((res) => {
+ removePlace(row.roadNoisePlaceId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
@@ -234,7 +367,7 @@ export default {
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
- const ids = this.selectionList.map((item) => item.airBasicInfoDictId);
+ const ids = this.selectionList.map((item) => item.roadNoisePlaceId);
removeBatchPlace(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
@@ -247,6 +380,40 @@ export default {
}).finally(() => {
hide();
})
+ },
+ setCYear(e){
+ this.cYear = e.key;
+ this.showNYear = true;
+ },
+ copyBatch(){
+ const hide = this.$message.loading('请求中..', 0);
+ copyBatchPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
+ if (res.data.code === 0) {
+ this.$message.success(res.data.msg);
+ this.reload();
+ this.getOptions();
+ } else {
+ this.$message.error(res.data.msg);
+ }
+ this.showNYear = false;
+ }).catch(e => {
+ this.$message.error(e.message);
+ }).finally(() => {
+ hide();
+ })
+ },
+ exportData(){
+ const columns = this.columns.filter(item=>item.dataIndex);
+ 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());
}
},
diff --git a/src/views/atmosphere/acid-rain/statistic/average.vue b/src/views/atmosphere/acid-rain/statistic/average.vue
deleted file mode 100644
index a657b1e..0000000
--- a/src/views/atmosphere/acid-rain/statistic/average.vue
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
-
-
- 查询
-
- 导出Excel
-
-
-
-
-
-
- (data = d.data)"
- >
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/views/atmosphere/acid-rain/statistic/city.vue b/src/views/atmosphere/acid-rain/statistic/city.vue
new file mode 100644
index 0000000..5961ec1
--- /dev/null
+++ b/src/views/atmosphere/acid-rain/statistic/city.vue
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+ 导出Excel
+
+
+
+
+
+ (data = d.data)"
+ method="POST"
+ >
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/atmosphere/acid-rain/statistic/county.vue b/src/views/atmosphere/acid-rain/statistic/county.vue
new file mode 100644
index 0000000..d9eba25
--- /dev/null
+++ b/src/views/atmosphere/acid-rain/statistic/county.vue
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+ 导出Excel
+
+
+
+
+
+ (data = d.data)"
+ method="POST"
+ >
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/atmosphere/acid-rain/statistic/index.vue b/src/views/atmosphere/acid-rain/statistic/index.vue
index 7591a18..5a9894f 100644
--- a/src/views/atmosphere/acid-rain/statistic/index.vue
+++ b/src/views/atmosphere/acid-rain/statistic/index.vue
@@ -1,42 +1,51 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/atmosphere/acid-rain/statistic/source.vue b/src/views/atmosphere/acid-rain/statistic/source.vue
deleted file mode 100644
index 6a1ee38..0000000
--- a/src/views/atmosphere/acid-rain/statistic/source.vue
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
-
-
- 查询
-
- 导出Excel
-
-
-
-
-
-
- (data = d.data)"
- >
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/views/atmosphere/acid-rain/statistic/year.vue b/src/views/atmosphere/acid-rain/statistic/year.vue
deleted file mode 100644
index 7b677e3..0000000
--- a/src/views/atmosphere/acid-rain/statistic/year.vue
+++ /dev/null
@@ -1,224 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
-
-
- 查询
-
- 导出Excel
-
-
-
-
-
-
- (data = d.data)"
- >
-
-
-
-
-
-
-
-
-
\ No newline at end of file