声
This commit is contained in:
@@ -23,13 +23,16 @@ const updateFunctionType = function (data) {
|
||||
const getColumnOptions = function(column){
|
||||
return axios.get("/sound/function/functionType/options",{params:{column}})
|
||||
}
|
||||
|
||||
const copyBatchFunctionType = function (data){
|
||||
return axios.post("/sound/function/functionType/copyBatch",data)
|
||||
}
|
||||
export {
|
||||
listAllUrl,
|
||||
saveFunctionType,
|
||||
updateFunctionType,
|
||||
removeBatchFunctionType,
|
||||
removeFunctionType,
|
||||
getColumnOptions
|
||||
getColumnOptions,
|
||||
copyBatchFunctionType
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ const getColumnOptions = function(column){
|
||||
return axios.get("/sound/function/place/options",{params:{column}})
|
||||
}
|
||||
|
||||
const copyBatchPlace = function (data){
|
||||
return axios.post("/sound/function/place/copyBatch",data)
|
||||
}
|
||||
|
||||
export {
|
||||
listAllUrl,
|
||||
@@ -32,6 +35,6 @@ export {
|
||||
updatePlace,
|
||||
removeBatchPlace,
|
||||
removePlace,
|
||||
getColumnOptions
|
||||
|
||||
getColumnOptions,
|
||||
copyBatchPlace
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ const updateLeqLevel = function (data) {
|
||||
const getColumnOptions = function(column){
|
||||
return axios.get("/sound/road/noiseLeqLevel/options",{params:{column}})
|
||||
}
|
||||
const copyBatchLeqLevel = function (data){
|
||||
return axios.post("/sound/road/noiseLeqLevel/copyBatch",data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
export {
|
||||
@@ -32,6 +36,7 @@ export {
|
||||
updateLeqLevel,
|
||||
removeBatchLeqLevel,
|
||||
removeLeqLevel,
|
||||
getColumnOptions
|
||||
getColumnOptions,
|
||||
copyBatchLeqLevel
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ const getColumnOptions = function(column){
|
||||
return axios.get("/sound/zone/noiseLeqLevel/options",{params:{column}})
|
||||
}
|
||||
|
||||
const copyBatchLeqLevel = function (data){
|
||||
return axios.post("/sound/zone/noiseLeqLevel/copyBatch",data)
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
listAllUrl,
|
||||
@@ -31,6 +35,7 @@ export {
|
||||
updateLeqLevel,
|
||||
removeBatchLeqLevel,
|
||||
removeLeqLevel,
|
||||
getColumnOptions
|
||||
getColumnOptions,
|
||||
copyBatchLeqLevel
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ const getColumnOptions = function(column){
|
||||
return axios.get("/sound/zone/place/options",{params:{column}})
|
||||
}
|
||||
const copyBatchPlace = function (data){
|
||||
return axios.post("/sound/zone/copyBatch",data)
|
||||
return axios.post("/sound/zone/place/copyBatch",data)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
const reportDate = aoa[2][0].replace(/[^\d]+/g, "-");
|
||||
|
||||
const acidList = aoa.filter((item) => {
|
||||
return item.length >= 23 && item[0] && !item[0].includes("编号");
|
||||
return item.length >= 16 && item[0] && !item[0].includes("编号");
|
||||
});
|
||||
// 解析成对象数组
|
||||
const billName = aoa[0][0] + aoa[1][0];
|
||||
|
||||
@@ -9,13 +9,31 @@
|
||||
: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-range-picker v-model:value="time"/>
|
||||
</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.regionLevel" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in regionLevelOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>{{ 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.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in placeOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@@ -146,7 +164,14 @@ export default {
|
||||
sorter: true,
|
||||
}
|
||||
],
|
||||
regionLevelOptions: [],
|
||||
regionLevelOptions: [
|
||||
{label: "市区", value: "city"},
|
||||
{label: "城区", value: "area"},
|
||||
{label: "县区", value: "county"},
|
||||
{label: "站点", value: "place"},
|
||||
],
|
||||
placeOptions:[],
|
||||
time:[],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
@@ -161,8 +186,8 @@ export default {
|
||||
methods: {
|
||||
/**获取下来框数据 */
|
||||
loadOptionData() {
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
getColumnOptions("place").then((res) => {
|
||||
this.placeOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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 v-model:value="where.year" allow-clear show-search>
|
||||
<a-select-option
|
||||
v-for="(item) in yearOptions"
|
||||
: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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.id !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="功能区类别" name="functionType">
|
||||
<a-input
|
||||
v-model:value="form.functionType"
|
||||
@@ -62,6 +111,19 @@
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -77,6 +139,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -113,12 +176,16 @@ import {
|
||||
saveFunctionType,
|
||||
updateFunctionType,
|
||||
removeFunctionType,
|
||||
removeBatchFunctionType
|
||||
removeBatchFunctionType,
|
||||
getColumnOptions,
|
||||
copyBatchFunctionType
|
||||
} from "@/api/ecology/noise/function-noise-function-type";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "FunctionNoiseFunctionType",
|
||||
components: {},
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -171,14 +238,19 @@ export default {
|
||||
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
yearOptions: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
// 表单数据
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
year:[{required: true,message: '请输入年份'}],
|
||||
functionType:[{required: true,message: '请输入功能区类别'}],
|
||||
functionCode:[{required: true,message: '请输入功能区代码'}],
|
||||
maxLd: [{required: true,message: '请输入昼间限值',},],
|
||||
@@ -189,6 +261,7 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
minLeqChange(e){
|
||||
@@ -201,6 +274,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 = {};
|
||||
@@ -226,6 +312,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -243,6 +330,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -287,6 +375,40 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
copyBatch(){
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
copyBatchFunctionType({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());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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 v-model:value="where.year" allow-clear show-search>
|
||||
<a-select-option
|
||||
v-for="(item) in yearOptions"
|
||||
: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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.roadNoisePlaceId !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点名称" name="placeName">
|
||||
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear />
|
||||
</a-form-item>
|
||||
@@ -79,6 +128,19 @@
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -94,6 +156,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -130,8 +193,11 @@ import {
|
||||
savePlace,
|
||||
updatePlace,
|
||||
removePlace,
|
||||
removeBatchPlace
|
||||
removeBatchPlace,
|
||||
getColumnOptions,
|
||||
copyBatchPlace
|
||||
} from "@/api/ecology/noise/function-noise-place";
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "FunctionNoisePlace",
|
||||
@@ -144,6 +210,11 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "placeName",
|
||||
@@ -233,17 +304,22 @@ export default {
|
||||
selectionList: [],
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
yearOptions: [],
|
||||
// 表单数据
|
||||
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() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
/* 刷新表格 */
|
||||
@@ -278,6 +354,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -295,6 +372,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -339,7 +417,54 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
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());
|
||||
},
|
||||
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();
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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 v-model:value="where.year" allow-clear show-search>
|
||||
<a-select-option
|
||||
v-for="(item) in yearOptions"
|
||||
: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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.id !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="最小值" name="minLeq">
|
||||
<a-input-number @change="minLeqChange" :step=".1" :precision="1" v-model:value="form.minLeq" />
|
||||
</a-form-item>
|
||||
@@ -57,10 +106,25 @@
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
:need-page="false"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -76,6 +140,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -112,13 +177,19 @@ import {
|
||||
saveLeqLevel,
|
||||
updateLeqLevel,
|
||||
removeLeqLevel,
|
||||
removeBatchLeqLevel
|
||||
removeBatchLeqLevel,
|
||||
getColumnOptions,
|
||||
copyBatchLeqLevel
|
||||
} from "@/api/ecology/noise/road-noise-leq-level";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
|
||||
export default {
|
||||
name: "RoadNoiseLeqLevel",
|
||||
components: {},
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -127,6 +198,11 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
@@ -173,8 +249,13 @@ export default {
|
||||
where: {},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
yearOptions:[],
|
||||
// 表单数据
|
||||
form: {},
|
||||
loading: false,
|
||||
@@ -189,6 +270,7 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
minLeqChange(e){
|
||||
@@ -231,6 +313,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions()
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -248,6 +331,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions()
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -292,7 +376,55 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
copyBatch(){
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
copyBatchLeqLevel({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());
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
<a-form
|
||||
:model="where"
|
||||
layout="vertical"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-row>
|
||||
@@ -20,16 +18,16 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :lg="24" :md="24" :sm="24" :xs="24">
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
@@ -66,7 +64,7 @@
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input v-model:value="form.year" placeholder="请输入年份" allow-clear/>
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="测点名称" name="placeName">
|
||||
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear/>
|
||||
@@ -127,6 +125,8 @@
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
:need-page="false"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
@@ -159,6 +159,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -202,6 +203,7 @@ import {
|
||||
getColumnOptions
|
||||
} from "@/api/ecology/noise/road-noise-place";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "RoadNoisePlace",
|
||||
@@ -319,6 +321,7 @@ export default {
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
year: [{required: true, message: '请输入年份'}],
|
||||
placeName: [{required: true, message: '请选择测点名称'}],
|
||||
placeLng: [{required: true, message: '请输入测点经度',},],
|
||||
placeLat: [{required: true, message: '请输入测点纬度',},],
|
||||
@@ -458,6 +461,19 @@ export default {
|
||||
}).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());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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 v-model:value="where.year" allow-clear show-search>
|
||||
<a-select-option
|
||||
v-for="(item) in yearOptions"
|
||||
: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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.id !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
|
||||
</a-form-item>
|
||||
<a-form-item label="最小值" name="minLeq">
|
||||
<a-input-number @change="minLeqChange" :step=".1" :precision="1" v-model:value="form.minLeq" />
|
||||
</a-form-item>
|
||||
@@ -61,6 +110,19 @@
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -76,6 +138,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -112,13 +175,17 @@ import {
|
||||
saveLeqLevel,
|
||||
updateLeqLevel,
|
||||
removeLeqLevel,
|
||||
removeBatchLeqLevel
|
||||
removeBatchLeqLevel,
|
||||
copyBatchLeqLevel,
|
||||
getColumnOptions
|
||||
} from "@/api/ecology/noise/zone-noise-leq-level";
|
||||
import { message } from 'ant-design-vue';
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "ZoneNoiseLeqLevel",
|
||||
components: {},
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -127,6 +194,11 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "时段",
|
||||
dataIndex: "timeSlot",
|
||||
@@ -175,6 +247,10 @@ export default {
|
||||
selectionList: [],
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
showNYear:false,
|
||||
cYear: undefined,
|
||||
nYear:undefined,
|
||||
yearOptions:[],
|
||||
// 表单数据
|
||||
form: {},
|
||||
loading: false,
|
||||
@@ -189,6 +265,7 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
minLeqChange(e){
|
||||
@@ -231,6 +308,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions()
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -248,6 +326,7 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions()
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -292,6 +371,53 @@ export default {
|
||||
}).finally(() => {
|
||||
hide();
|
||||
})
|
||||
},
|
||||
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
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
setCYear(e){
|
||||
this.cYear = e.key;
|
||||
this.showNYear = true;
|
||||
},
|
||||
copyBatch(){
|
||||
const hide = this.$message.loading('请求中..', 0);
|
||||
copyBatchLeqLevel({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());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -1,6 +1,52 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<a-form
|
||||
:model="where"
|
||||
: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 v-model:value="where.year" allow-clear show-search>
|
||||
<a-select-option
|
||||
v-for="(item) in yearOptions"
|
||||
: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-space>
|
||||
<a-button type="primary" @click="reload">查询</a-button>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-modal
|
||||
v-model:visible="showNYear"
|
||||
:title="'批量复制'"
|
||||
:confirm-loading="loading"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@ok="copyBatch"
|
||||
>
|
||||
<a-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="新年份" name="nYear">
|
||||
<a-input-number id="inputNumber" v-model:value="nYear" :min="1970" :max="2050"/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
v-model:visible="showEdit"
|
||||
:title="form.zoneNoisePlaceId !== undefined ? '修改' : '添加'"
|
||||
@@ -16,6 +62,9 @@
|
||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||
>
|
||||
<a-form-item label="年份" name="year">
|
||||
<a-input-number v-model:value="form.year" :min="1970" :max="2050"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="测点名称" name="placeName">
|
||||
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear/>
|
||||
</a-form-item>
|
||||
@@ -74,6 +123,19 @@
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu @click="setCYear">
|
||||
<a-menu-item v-for="item in yearOptions" :key="item.value">
|
||||
{{ item.label }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>
|
||||
批量复制
|
||||
<DownOutlined/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm
|
||||
:disabled="selectionList.length == 0"
|
||||
:title="`确认删除${selectionList.length}条数据吗?`"
|
||||
@@ -89,6 +151,7 @@
|
||||
>删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="exportData" type="primary">导出</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
@@ -98,7 +161,8 @@
|
||||
type="primary"
|
||||
shape="round"
|
||||
size="small"
|
||||
>修改</a-button
|
||||
>修改
|
||||
</a-button
|
||||
>
|
||||
<a-popconfirm
|
||||
:title="`确认删除这条数据吗?`"
|
||||
@@ -107,7 +171,8 @@
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a-button type="primary" danger shape="round" size="small"
|
||||
>删除</a-button
|
||||
>删除
|
||||
</a-button
|
||||
>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
@@ -125,12 +190,16 @@ import {
|
||||
savePlace,
|
||||
updatePlace,
|
||||
removePlace,
|
||||
removeBatchPlace
|
||||
removeBatchPlace,
|
||||
copyBatchPlace,
|
||||
getColumnOptions
|
||||
} from "@/api/ecology/noise/zone-noise-place";
|
||||
import {DownOutlined} from '@ant-design/icons-vue';
|
||||
import XLSX from "xlsx";
|
||||
// import moment from "moment";
|
||||
export default {
|
||||
name: "ZoneNoisePlace",
|
||||
components: {},
|
||||
components: {DownOutlined},
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
@@ -139,6 +208,11 @@ export default {
|
||||
selection: [],
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
title: "年份",
|
||||
dataIndex: "year",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "测点名称",
|
||||
dataIndex: "placeName",
|
||||
@@ -213,14 +287,19 @@ export default {
|
||||
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
yearOptions: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
showNYear: false,
|
||||
cYear: undefined,
|
||||
nYear: undefined,
|
||||
// 表单数据
|
||||
form: {},
|
||||
loading: false,
|
||||
rules: {
|
||||
year: [{required: true, message: '请输入年份'}],
|
||||
placeName: [{required: true, message: '请输入测点名称'}],
|
||||
placeCode: [{required: true, message: '请输入点位编码'}],
|
||||
placeLng: [{required: true, message: '请输入测点经度',},],
|
||||
@@ -229,6 +308,7 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
/* 刷新表格 */
|
||||
@@ -238,6 +318,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 = {};
|
||||
@@ -263,6 +356,8 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -280,6 +375,8 @@ export default {
|
||||
this.showEdit = false;
|
||||
this.$message.success(res.data.msg);
|
||||
this.reload();
|
||||
this.getOptions();
|
||||
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
@@ -324,9 +421,44 @@ 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());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -14,7 +14,20 @@
|
||||
<a-select-option
|
||||
v-for="item in yearOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>{{ 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.regionLevel" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="item in regionLevelOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}
|
||||
</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@@ -107,7 +120,11 @@ export default {
|
||||
},
|
||||
],
|
||||
// 表格搜索条件
|
||||
where: {},
|
||||
where: {regionLevel :"市级"},
|
||||
regionLevelOptions:[
|
||||
{label: "市级",value: "市级"},
|
||||
{label: "县级",value: "县级"}
|
||||
],
|
||||
yearOptions: [],
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
@@ -128,6 +145,7 @@ export default {
|
||||
});
|
||||
|
||||
this.where.year = this.yearOptions[0].value;
|
||||
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user