diff --git a/src/api/ecology/noise/road-noise-place.js b/src/api/ecology/noise/road-noise-place.js
index 43aac39..35e073b 100644
--- a/src/api/ecology/noise/road-noise-place.js
+++ b/src/api/ecology/noise/road-noise-place.js
@@ -20,7 +20,9 @@ const removeBatchPlace = function (ids) {
const updatePlace = function (data) {
return axios.put("/sound/road/place",data)
}
-
+const copyBatchPlace = function (data){
+ return axios.post("/sound/road/place/copyBatch",data)
+}
const getColumnOptions = function(column){
return axios.get("/sound/road/place/options",{params:{column}})
}
@@ -30,6 +32,7 @@ export {
updatePlace,
removeBatchPlace,
removePlace,
- getColumnOptions
+ getColumnOptions,
+ copyBatchPlace
}
diff --git a/src/api/ecology/noise/zone-noise-place.js b/src/api/ecology/noise/zone-noise-place.js
index c874131..2b87162 100644
--- a/src/api/ecology/noise/zone-noise-place.js
+++ b/src/api/ecology/noise/zone-noise-place.js
@@ -24,6 +24,9 @@ const updatePlace = function (data) {
const getColumnOptions = function(column){
return axios.get("/sound/zone/place/options",{params:{column}})
}
+const copyBatchPlace = function (data){
+ return axios.post("/sound/zone/copyBatch",data)
+}
export {
@@ -32,6 +35,7 @@ export {
updatePlace,
removeBatchPlace,
removePlace,
+ copyBatchPlace,
getColumnOptions
}
diff --git a/src/views/sound/road/dict/place.vue b/src/views/sound/road/dict/place.vue
index 93375e1..9ee67fc 100644
--- a/src/views/sound/road/dict/place.vue
+++ b/src/views/sound/road/dict/place.vue
@@ -10,8 +10,8 @@
>
-
-
+
+
查询
- 批量复制
+
重置
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -109,6 +131,19 @@
新增
+
+
+
+
+ {{ item.label }}
+
+
+
+
+ 批量复制
+
+
+
修改修改
+
删除删除
+
@@ -161,12 +198,14 @@ import {
updatePlace,
removePlace,
removeBatchPlace,
+ copyBatchPlace,
getColumnOptions
} from "@/api/ecology/noise/road-noise-place";
+import {DownOutlined} from '@ant-design/icons-vue';
// import moment from "moment";
export default {
name: "RoadNoisePlace",
- components: {},
+ components: {DownOutlined},
data() {
return {
data: [],
@@ -175,6 +214,11 @@ export default {
selection: [],
// 表格列配置
columns: [
+ {
+ title: "年份",
+ dataIndex: "year",
+ sorter: true,
+ },
{
title: "测点名称",
dataIndex: "placeName",
@@ -261,28 +305,28 @@ export default {
},
},
],
-
// 表格搜索条件
where: {},
- yearOption:[],
+ yearOptions: [],
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
+ showNYear:false,
+ cYear: undefined,
+ nYear:undefined,
// 表单数据
form: {},
loading: false,
rules: {
- placeName:[{required: true,message: '请选择测点名称'}],
- placeLng: [{required: true,message: '请输入测点经度',},],
- placeLat: [{required: true,message: '请输入测点纬度',},],
+ placeName: [{required: true, message: '请选择测点名称'}],
+ placeLng: [{required: true, message: '请输入测点经度',},],
+ placeLat: [{required: true, message: '请输入测点纬度',},],
},
};
},
mounted() {
- getColumnOptions("year").then(res=>{
- console.log(res)
- })
+ this.getOptions();
},
methods: {
/* 刷新表格 */
@@ -292,6 +336,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 = {};
@@ -317,6 +374,7 @@ export default {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
+ this.getOptions();
} else {
this.$message.error(res.data.msg);
}
@@ -334,6 +392,7 @@ export default {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
+ this.getOptions();
} else {
this.$message.error(res.data.msg);
}
@@ -378,6 +437,27 @@ 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();
+ })
}
},