饮用水字典,统计模块代码提交

This commit is contained in:
710356044
2021-11-28 21:57:03 +08:00
parent 258e6022d5
commit c96991618b
19 changed files with 2070 additions and 1110 deletions

View File

@@ -89,6 +89,67 @@ const copyBatchCountyBottomPlace = function (data){
return axios.post("/drinkingWater/drinkingWaterCountyBottomDict/copyBatch",data)
}
// ----------------------农村地表水字典-----------------------
const pageVillageTopDictUrl = '/drinkingWater/drinkingWaterVillageTopDict';
const listVillageTopAllUrl = pageVillageTopDictUrl + "";
// 添加
const saveDrinkingWaterVillageTopDict = function (data) {
return axios.post("/drinkingWater/drinkingWaterVillageTopDict/",data)
}
// 删除
const removeDrinkingWaterVillageTopDict = function (id) {
return axios.delete(`/drinkingWater/drinkingWaterVillageTopDict/${id}`,)
}
// 批量删除
const removeBatchDrinkingWaterVillageTopDict = function (ids) {
return axios.delete("/drinkingWater/drinkingWaterVillageTopDict/batch",{data:ids})
}
// 修改
const updateDrinkingWaterVillageTopDict = function (data) {
return axios.put("/drinkingWater/drinkingWaterVillageTopDict",data)
}
const getVillageTopColumnOptions = function(column){
return axios.get("/drinkingWater/drinkingWaterVillageTopDict/options",{params:{column}})
}
const copyBatchVillageTopPlace = function (data){
return axios.post("/drinkingWater/drinkingWaterVillageTopDict/copyBatch",data)
}
// ----------------------农村地下水字典-----------------------
const pageVillageBottomDictUrl = '/drinkingWater/drinkingWaterVillageBottomDict';
const listVillageBottomAllUrl = pageVillageBottomDictUrl + "";
// 添加
const saveDrinkingWaterVillageBottomDict = function (data) {
return axios.post("/drinkingWater/drinkingWaterVillageBottomDict/",data)
}
// 删除
const removeDrinkingWaterVillageBottomDict = function (id) {
return axios.delete(`/drinkingWater/drinkingWaterVillageBottomDict/${id}`,)
}
// 批量删除
const removeBatchDrinkingWaterVillageBottomDict = function (ids) {
return axios.delete("/drinkingWater/drinkingWaterVillageBottomDict/batch",{data:ids})
}
// 修改
const updateDrinkingWaterVillageBottomDict = function (data) {
return axios.put("/drinkingWater/drinkingWaterVillageBottomDict",data)
}
const getVillageBottomColumnOptions = function(column){
return axios.get("/drinkingWater/drinkingWaterVillageBottomDict/options",{params:{column}})
}
const copyBatchVillageBottomPlace = function (data){
return axios.post("/drinkingWater/drinkingWaterVillageBottomDict/copyBatch",data)
}
export {
//市级
pageDictUrl,
@@ -108,7 +169,7 @@ export {
updateDrinkingWaterCountyDict,
getCountyColumnOptions,
copyBatchCountyPlace,
//
//县级地下水
pageCountyBottomDictUrl,
listCountyBottomAllUrl,
saveDrinkingWaterCountyBottomDict,
@@ -116,7 +177,23 @@ export {
removeBatchDrinkingWaterCountyBottomDict,
updateDrinkingWaterCountyBottomDict,
getCountyBottomColumnOptions,
copyBatchCountyBottomPlace
//农村
copyBatchCountyBottomPlace,
//农村地表水
pageVillageTopDictUrl,
listVillageTopAllUrl,
saveDrinkingWaterVillageTopDict,
removeDrinkingWaterVillageTopDict,
removeBatchDrinkingWaterVillageTopDict,
updateDrinkingWaterVillageTopDict,
getVillageTopColumnOptions,
copyBatchVillageTopPlace,
//农村地下水
pageVillageBottomDictUrl,
listVillageBottomAllUrl,
saveDrinkingWaterVillageBottomDict,
removeDrinkingWaterVillageBottomDict,
removeBatchDrinkingWaterVillageBottomDict,
updateDrinkingWaterVillageBottomDict,
getVillageBottomColumnOptions,
copyBatchVillageBottomPlace,
}

View File

@@ -210,81 +210,21 @@ export default {
selection: [],
//
columns: [
{title: "年份",
dataIndex: "year",
sorter: true,
},
{
title: "省",
dataIndex: "province",
sorter: true,
},
{
title: "省份代码",
dataIndex: "provinceCode",
sorter: true,
},
{
title: "市",
dataIndex: "city",
sorter: true,
},
{
title: "城市代码",
dataIndex: "cityCode",
sorter: true,
},
{
title: "重点城市区分",
dataIndex: "keyCity",
sorter: true,
},
{
title: "城市方位",
dataIndex: "cityOrientation",
sorter: true,
},
{
title: "断面名称",
dataIndex: "sectionName",
sorter: true,
},
{
title: "断面代码",
dataIndex: "sectionCode",
sorter: true,
},
{
title: "水源名称",
dataIndex: "sourceWaterName",
sorter: true,
},
{
title: "所属水系",
dataIndex: "subordinateWater",
sorter: true,
},
{
title: "水源地性质",
dataIndex: "waterSourceProperty",
sorter: true,
},
{
title: "经度(°)",
dataIndex: "longitude",
sorter: true,
},
{
title: "纬度(°)",
dataIndex: "latitude",
sorter: true,
},
{
title: "饮用水类型",
dataIndex: "drinkingWaterType",
sorter: true,
customRender: ({text})=> text == 1?"在用":"备用"
},
{title: "年份",dataIndex: "year",sorter: true,},
{title: "省",dataIndex: "province",sorter: true,},
{title: "省份代码",dataIndex: "provinceCode",sorter: true,},
{title: "市",dataIndex: "city",sorter: true},
{title: "城市代码",dataIndex: "cityCode",sorter: true},
{title: "重点城市区分",dataIndex: "keyCity",sorter: true},
{title: "城市方位",dataIndex: "cityOrientation",sorter: true,},
{title: "断面名称",dataIndex: "sectionName",sorter: true},
{title: "断面代码",dataIndex: "sectionCode",sorter: true,},
{title: "水源名称",dataIndex: "sourceWaterName",sorter: true,},
{title: "所属水系",dataIndex: "subordinateWater",sorter: true,},
{title: "水源地性质",dataIndex: "waterSourceProperty",sorter: true},
{title: "经度(°)",dataIndex: "longitude",sorter: true,},
{title: "纬度(°)",dataIndex: "latitude",sorter: true,},
{title: "饮用水类型",dataIndex: "drinkingWaterType",sorter: true,customRender: ({text})=> text == 1?"在用":"备用"},
{
title: "操作",
key: "action",

View File

@@ -67,15 +67,48 @@
<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="county">
<a-input v-model:value="form.county" placeholder="请输入名称" allow-clear />
<a-form-item label="" name="province">
<a-input v-model:value="form.province" placeholder="请输入名称" allow-clear />
</a-form-item>
<a-form-item label="水源地名称" name="waterSourceName">
<a-input v-model:value="form.waterSourceName" placeholder="请输入水源地名称" allow-clear />
<a-form-item label="省份代码" name="provinceCode">
<a-input v-model:value="form.provinceCode" placeholder="请输入省份代码" allow-clear />
</a-form-item>
<a-form-item label="水源类型1地表水、2地下水" name="waterSourceType">
<a-input v-model:value="form.waterSourceType" placeholder="请输入水源类型1或者2" allow-clear />
<a-form-item label="市" name="city">
<a-input v-model:value="form.city" placeholder="请输入市名称" allow-clear />
</a-form-item>
<a-form-item label="城市代码" name="cityCode">
<a-input v-model:value="form.cityCode" placeholder="请输入城市代码" allow-clear />
</a-form-item>
<a-form-item label="县" name="countyName">
<a-input v-model:value="form.countyName" placeholder="请输入县名称" allow-clear />
</a-form-item>
<a-form-item label="县域代码" name="countyCode">
<a-input v-model:value="form.countyCode" placeholder="请输入县域代码" allow-clear />
</a-form-item>
<a-form-item label="断面名称" name="sectionName">
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear />
</a-form-item>
<a-form-item label="水源名称" name="sourceWaterName">
<a-input v-model:value="form.sourceWaterName" placeholder="请输入水源名称" allow-clear />
</a-form-item>
<a-form-item label="水源地代码" name="sourceWaterCode">
<a-input v-model:value="form.sourceWaterCode" placeholder="请输入水源地代码" allow-clear />
</a-form-item>
<a-form-item label="所属水系" name="subordinateWater">
<a-input v-model:value="form.subordinateWater" placeholder="请输入所属水系" allow-clear />
</a-form-item>
<a-form-item label="水源地性质" name="waterSourceProperty">
<a-input v-model:value="form.waterSourceProperty" placeholder="请输入水源地性质" allow-clear />
</a-form-item>
<a-form-item label="经度(°)" name="longitude">
<a-input v-model:value="form.longitude" placeholder="请输入经度(°)" allow-clear />
</a-form-item>
<a-form-item label="纬度(°)" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度(°)" allow-clear />
</a-form-item>
<!-- <a-form-item label="饮用水类型1在用、2备用" name="drinkingWaterType">
<a-input v-model:value="form.drinkingWaterType" placeholder="请输入饮用水类型1或者2" allow-clear />
</a-form-item> -->
</a-form>
</a-modal>
<!-- 表格 -->
@@ -177,24 +210,21 @@ export default {
selection: [],
// 表格列配置
columns: [
{title: "年份",
dataIndex: "year",
sorter: true,
},
{ title: "县",
dataIndex: "county",
sorter: true,
},
{ title: "水源名称",
dataIndex: "waterSourceName",
sorter: true,
},
{
title: "水源类型",
dataIndex: "waterSourceType",
sorter: true,
customRender: ({text})=> text == 1?"地表水":"地下水"
},
{title: "年份",dataIndex: "year",sorter: true},
{title: "省",dataIndex: "province",sorter: true,},
{title: "省份代码",dataIndex: "provinceCode",sorter: true,},
{title: "市",dataIndex: "city",sorter: true},
{title: "城市代码",dataIndex: "cityCode",sorter: true},
{title: "县",dataIndex: "countyName",sorter: true},
{title:"县域代码",dataIndex:"countyCode",sorter:true},
{title: "断面名称",dataIndex: "sectionName",sorter: true},
{title: "水源名称",dataIndex: "sourceWaterName",sorter: true,},
{title: "水源地代码",dataIndex: "sourceWaterCode",sorter: true,},
{title: "所属水系",dataIndex: "subordinateWater",sorter: true,},
{title: "水源地性质",dataIndex: "waterSourceProperty",sorter: true},
{title: "经度(°)",dataIndex: "longitude",sorter: true,},
{title: "纬度(°)",dataIndex: "latitude",sorter: true,},
// {title: "饮用水类型",dataIndex: "drinkingWaterType",sorter: true,customRender: ({text})=> text == 1?"在用":"备用"},
{
title: "操作",
key: "action",
@@ -209,7 +239,7 @@ export default {
// 表格搜索条件
where: {
sort: "sectionCode",
// sort: "sectionCode",
},
// 表格选中数据

View File

@@ -64,14 +64,44 @@
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
>
<a-form-item label="年份" name="year">
<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="county">
<a-input v-model:value="form.county" placeholder="请输入名称" allow-clear />
<a-form-item label="" name="province">
<a-input v-model:value="form.province" placeholder="请输入名称" allow-clear />
</a-form-item>
<a-form-item label="水源地名称" name="waterSourceName">
<a-input v-model:value="form.waterSourceName" placeholder="请输入水源地名称" allow-clear />
<a-form-item label="省份代码" name="provinceCode">
<a-input v-model:value="form.provinceCode" placeholder="请输入省份代码" allow-clear />
</a-form-item>
<a-form-item label="市" name="city">
<a-input v-model:value="form.city" placeholder="请输入市名称" allow-clear />
</a-form-item>
<a-form-item label="城市代码" name="cityCode">
<a-input v-model:value="form.cityCode" placeholder="请输入城市代码" allow-clear />
</a-form-item>
<a-form-item label="县" name="countyName">
<a-input v-model:value="form.countyName" placeholder="请输入县名称" allow-clear />
</a-form-item>
<a-form-item label="县域代码" name="countyCode">
<a-input v-model:value="form.countyCode" placeholder="请输入县域代码" allow-clear />
</a-form-item>
<a-form-item label="断面名称" name="sectionName">
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear />
</a-form-item>
<a-form-item label="水源名称" name="sourceWaterName">
<a-input v-model:value="form.sourceWaterName" placeholder="请输入水源名称" allow-clear />
</a-form-item>
<a-form-item label="所属水系" name="subordinateWater">
<a-input v-model:value="form.subordinateWater" placeholder="请输入所属水系" allow-clear />
</a-form-item>
<a-form-item label="水源地性质" name="waterSourceProperty">
<a-input v-model:value="form.waterSourceProperty" placeholder="请输入水源地性质" allow-clear />
</a-form-item>
<a-form-item label="经度(°)" name="longitude">
<a-input v-model:value="form.longitude" placeholder="请输入经度(°)" allow-clear />
</a-form-item>
<a-form-item label="纬度(°)" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度(°)" allow-clear />
</a-form-item>
<a-form-item label="饮用水类型1在用、2备用" name="drinkingWaterType">
<a-input v-model:value="form.drinkingWaterType" placeholder="请输入饮用水类型1或者2" allow-clear />
@@ -177,24 +207,20 @@ export default {
selection: [],
// 表格列配置
columns: [
{title: "年份",
dataIndex: "year",
sorter: true,
},
{ title: "县",
dataIndex: "county",
sorter: true,
},
{ title: "水源名称",
dataIndex: "waterSourceName",
sorter: true,
},
{
title: "饮用水类型",
dataIndex: "drinkingWaterType",
sorter: true,
customRender: ({text})=> text == 1?"在用":"备用"
},
{title: "年份",dataIndex: "year",sorter: true},
{title: "省",dataIndex: "province",sorter: true,},
{title: "省份代码",dataIndex: "provinceCode",sorter: true,},
{title: "市",dataIndex: "city",sorter: true},
{title: "城市代码",dataIndex: "cityCode",sorter: true},
{title: "县",dataIndex: "countyName",sorter: true},
{title:"县域代码",dataIndex:"countyCode",sorter:true},
{title: "断面名称",dataIndex: "sectionName",sorter: true},
{title: "水源名称",dataIndex: "sourceWaterName",sorter: true,},
{title: "所属水系",dataIndex: "subordinateWater",sorter: true,},
{title: "水源地性质",dataIndex: "waterSourceProperty",sorter: true},
{title: "经度(°)",dataIndex: "longitude",sorter: true,},
{title: "纬度(°)",dataIndex: "latitude",sorter: true,},
{title: "饮用水类型",dataIndex: "drinkingWaterType",sorter: true,customRender: ({text})=> text == 1?"在用":"备用"},
{
title: "操作",
key: "action",

View File

@@ -3,7 +3,7 @@
<a-card :bordered="false">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="place" tab="市级字典">
<place></place>
<cityWaterDict></cityWaterDict>
</a-tab-pane>
<a-tab-pane key="countyTopWater" tab="县级地表水字典">
<countyTopWaterDict></countyTopWaterDict>
@@ -11,8 +11,11 @@
<a-tab-pane key="countyBottomWater" tab="县级地下水字典">
<countyBottomWaterDict></countyBottomWaterDict>
</a-tab-pane>
<a-tab-pane key="village" tab="农村字典">
<villageDict></villageDict>
<a-tab-pane key="villageTopWater" tab="农村地表水字典">
<villageTopDict></villageTopDict>
</a-tab-pane>
<a-tab-pane key="villageBottomWater" tab="农村地下水字典">
<villageBottomDict></villageBottomDict>
</a-tab-pane>
<!-- <a-tab-pane key="standard" tab="标准限值">
<leq-level></leq-level>
@@ -30,18 +33,21 @@
*
*/
// import LeqLevel from "./surface-water"
import Place from "./place"
import cityWaterDict from "./cityWaterDict.vue"
import countyTopWaterDict from "./countyTopWaterDict.vue"
import countyBottomWaterDict from "./countyBottomWaterDict.vue"
import villageDict from "./villageDict.vue"
import villageTopDict from "./villageTopDict.vue"
import villageBottomDict from "./villageBottomDict.vue"
export default {
name: 'DrinkingWaterDictIndex',
components: {
// LeqLevel,
Place,
cityWaterDict,
countyTopWaterDict,
countyBottomWaterDict,
villageDict
villageTopDict,
villageBottomDict
},
data() {
return {

View File

@@ -0,0 +1,408 @@
<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-button @click="exportData" type="primary">按年份导出</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.drinkingWaterDictId !== undefined ? '修改' : '添加'"
:confirm-loading="loading"
:width="800"
:body-style="{ paddingBottom: '8px' }"
@ok="save"
>
<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="year">
<a-input-number v-model:value="form.year" :min="1970" :max="2050" />
</a-form-item>
<a-form-item label="断面代码" name="sectionCode">
<a-input v-model:value="form.sectionCode" placeholder="请输入断面名称" allow-clear />
</a-form-item>
<a-form-item label="省" name="province">
<a-input v-model:value="form.province" placeholder="请输入省名称" allow-clear />
</a-form-item>
<a-form-item label="市" name="city">
<a-input v-model:value="form.city" placeholder="请输入市名称" allow-clear />
</a-form-item>
<a-form-item label="县" name="county">
<a-input v-model:value="form.county" placeholder="请输入县名称" allow-clear />
</a-form-item>
<a-form-item label="乡镇" name="township">
<a-input v-model:value="form.township" placeholder="请输入乡镇名称" allow-clear />
</a-form-item>
<a-form-item label="村名" name="village">
<a-input v-model:value="form.village" placeholder="请输入村名称" allow-clear />
</a-form-item>
<a-form-item label="断面名称" name="sectionName">
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear />
</a-form-item>
<!-- <a-form-item label="湖库(是/否)" name="lakeLibraryFlag">
<a-input v-model:value="form.lakeLibraryFlag" placeholder="请输入湖库(是/否)" allow-clear />
</a-form-item> -->
<a-form-item label="经度(°)" name="longitude">
<a-input v-model:value="form.longitude" placeholder="请输入经度(°)" allow-clear />
</a-form-item>
<a-form-item label="纬度(°)" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度(°)" allow-clear />
</a-form-item>
<a-form-item label="服务人口数量(人)" name="numberServingPopulation">
<a-input v-model:value="form.numberServingPopulation" placeholder="请输入服务人口数量(人)" allow-clear />
</a-form-item>
<a-form-item label="日供水规模(吨)" name="dailyWaterSupplyScale">
<a-input v-model:value="form.dailyWaterSupplyScale" placeholder="请输入日供水规模(吨)" allow-clear />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterDictId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@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}条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="removeBatch"
>
<a-button
:disabled="selectionList.length == 0"
type="primary"
ghost
danger
>删除
</a-button>
</a-popconfirm>
</a-space>
</template>
<template #action="{ record }">
<a-space>
<a-button
@click="openEdit(record)"
type="primary"
shape="round"
size="small"
>修改</a-button
>
<a-popconfirm
:title="`确认删除这条数据吗?`"
ok-text="Yes"
cancel-text="No"
@confirm="remove(record)"
>
<a-button type="primary" danger shape="round" size="small"
>删除</a-button
>
</a-popconfirm>
</a-space>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import {
pageVillageBottomDictUrl,
saveDrinkingWaterVillageBottomDict,
removeDrinkingWaterVillageBottomDict,
removeBatchDrinkingWaterVillageBottomDict,
updateDrinkingWaterVillageBottomDict,
getVillageBottomColumnOptions,
copyBatchVillageBottomPlace,
} from "@/api/ecology/drinking-water-dict";
// import moment from "moment";
import {DownOutlined} from '@ant-design/icons-vue';
import XLSX from "xlsx";
export default {
name: "DrinkWaterDict",
components: {DownOutlined},
data() {
return {
data: [],
// 表格数据接口
url: pageVillageBottomDictUrl,
selection: [],
// 表格列配置
columns: [
{title: "年份",dataIndex: "year",sorter: true},
{title: "断面代码",dataIndex: "sectionCode",sorter: true},
{title: "省",dataIndex: "province",sorter: true,},
{title: "市",dataIndex: "city",sorter: true},
{title: "县",dataIndex: "county",sorter: true},
{title: "乡镇",dataIndex: "township",sorter: true,},
{title: "村",dataIndex: "village",sorter: true,},
{title: "断面名称",dataIndex: "sectionName",sorter: true},
// {title: "点位名称",dataIndex: "place",sorter: true},
// {title: "湖库(是/否)",dataIndex: "lakeLibraryFlag",sorter: true,},
{title: "经度(°)",dataIndex: "longitude",sorter: true,},
{title: "纬度(°)",dataIndex: "latitude",sorter: true,},
{title: "服务人口数量(人)",dataIndex: "numberServingPopulation",sorter: true,},
{title: "日供水规模(吨)",dataIndex: "dailyWaterSupplyScale",sorter: true,},
{
title: "操作",
key: "action",
width: 150,
align: "center",
fixed: "right",
slots: {
customRender: "action",
},
},
],
// 表格搜索条件
where: {
// sort: "sectionCode",
},
// 表格选中数据
selectionList: [],
// 是否显示编辑弹窗
showEdit: false,
// 表单数据
form: {},
loading: false,
rules: {
// year: [{required: true, message: '请输入年份'}],
// sourceWaterName:[{required: true,message: '请选择水源名称'}],
// longitude: [{required: true,message: '请输入经度',},],
// latitude: [{required: true,message: '请输入纬度',},],
},
yearOptions: [],
showNYear:false,
cYear: undefined,
nYear:undefined,
};
},
mounted() {
this.getOptions();
},
methods: {
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {};
this.reload();
},
/* 打开编辑弹窗 */
openEdit(row) {
// cloneRecord.mi
this.form = Object.assign({}, row);
this.showEdit = true;
this.$nextTick(() => {
this.$refs.form.clearValidate(); // 清除表单验证信息
});
},
async save() {
await this.$refs.form.validate();
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.drinkingWaterDictId) {
updateDrinkingWaterVillageBottomDict(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
} else {
saveDrinkingWaterVillageBottomDict(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
})
.finally(() => {
hide();
});
}
},
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removeDrinkingWaterVillageBottomDict(row.drinkingWaterDictId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
hide();
this.$message.error(e.message);
})
},
/* 批量删除 */
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.drinkingWaterDictId);
removeBatchDrinkingWaterVillageBottomDict(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
} else {
this.$message.error(res.data.msg);
}
}).catch(e => {
this.$message.error(e.message);
}).finally(() => {
hide();
})
},
getOptions(){
getVillageBottomColumnOptions("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);
copyBatchVillageBottomPlace({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);
});
console.log(arr);
let sheet = XLSX.utils.aoa_to_sheet(arr);
console.log(arr);
this.$util.exportSheet(XLSX, sheet, new Date().getTime().toString());
}
},
};
</script>
<style scoped lang="less">
</style>

View File

@@ -64,15 +64,46 @@
: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="sectionCode">
<a-input v-model:value="form.sectionCode" placeholder="请输入断面名称" allow-clear />
</a-form-item>
<a-form-item label="省" name="province">
<a-input v-model:value="form.province" placeholder="请输入省名称" allow-clear />
</a-form-item>
<a-form-item label="市" name="city">
<a-input v-model:value="form.city" placeholder="请输入市名称" allow-clear />
</a-form-item>
<a-form-item label="县" name="county">
<a-input v-model:value="form.county" placeholder="请输入县名称" allow-clear />
</a-form-item>
<a-form-item label="水源地名称" name="waterSourceName">
<a-input v-model:value="form.waterSourceName" placeholder="请输入水源地名称" allow-clear />
<a-form-item label="乡镇" name="township">
<a-input v-model:value="form.township" placeholder="请输入乡镇名称" allow-clear />
</a-form-item>
<a-form-item label="饮用水类型1在用、2备用" name="drinkingWaterType">
<a-input v-model:value="form.drinkingWaterType" placeholder="请输入饮用水类型1或者2" allow-clear />
<a-form-item label="村名" name="village">
<a-input v-model:value="form.village" placeholder="请输入村名称" allow-clear />
</a-form-item>
<a-form-item label="断面名称" name="sectionName">
<a-input v-model:value="form.sectionName" placeholder="请输入断面名称" allow-clear />
</a-form-item>
<a-form-item label="湖库(是/否)" name="lakeLibraryFlag">
<a-input v-model:value="form.lakeLibraryFlag" placeholder="请输入湖库(是/否)" allow-clear />
</a-form-item>
<a-form-item label="经度(°)" name="longitude">
<a-input v-model:value="form.longitude" placeholder="请输入经度(°)" allow-clear />
</a-form-item>
<a-form-item label="纬度(°)" name="latitude">
<a-input v-model:value="form.latitude" placeholder="请输入纬度(°)" allow-clear />
</a-form-item>
<a-form-item label="服务人口数量(人)" name="numberServingPopulation">
<a-input v-model:value="form.numberServingPopulation" placeholder="请输入服务人口数量(人)" allow-clear />
</a-form-item>
<a-form-item label="日供水规模(吨)" name="dailyWaterSupplyScale">
<a-input v-model:value="form.dailyWaterSupplyScale" placeholder="请输入日供水规模(吨)" allow-clear />
</a-form-item>
</a-form>
</a-modal>
<!-- 表格 -->
@@ -150,15 +181,13 @@
<script>
// import _ from "lodash";
import {
pageDictUrl,
saveDrinkingWaterDict,
removeDrinkingWaterDict,
removeBatchDrinkingWaterDict,
updateDrinkingWaterDict,
// verifyDrinkingWaterDict,
// getDrinkingWaterDict
getColumnOptions,
copyBatchPlace
pageVillageTopDictUrl,
saveDrinkingWaterVillageTopDict,
removeDrinkingWaterVillageTopDict,
removeBatchDrinkingWaterVillageTopDict,
updateDrinkingWaterVillageTopDict,
getVillageTopColumnOptions,
copyBatchVillageTopPlace,
} from "@/api/ecology/drinking-water-dict";
// import moment from "moment";
import {DownOutlined} from '@ant-design/icons-vue';
@@ -170,29 +199,25 @@ export default {
return {
data: [],
//
url: pageDictUrl,
url: pageVillageTopDictUrl,
selection: [],
//
columns: [
{title: "县",
dataIndex: "county",
sorter: true,
},
{title: "水源地名称",
dataIndex: "waterSourceName",
sorter: true,
},
{title: "饮用水类型1在用、2备用",
dataIndex: "drinkingWaterType",
sorter: true,
},
{
title: "饮用水类型",
dataIndex: "drinkingWaterType",
sorter: true,
customRender: ({text})=> text == 1?"在用":"备用"
},
{title: "年份",dataIndex: "year",sorter: true},
{title: "断面代码",dataIndex: "sectionCode",sorter: true},
{title: "省",dataIndex: "province",sorter: true,},
{title: "市",dataIndex: "city",sorter: true},
{title: "县",dataIndex: "county",sorter: true},
{title: "乡镇",dataIndex: "township",sorter: true,},
{title: "村",dataIndex: "village",sorter: true,},
{title: "断面名称",dataIndex: "sectionName",sorter: true},
// {title: "",dataIndex: "place",sorter: true},
{title: "湖库(是/否)",dataIndex: "lakeLibraryFlag",sorter: true,},
{title: "经度(°)",dataIndex: "longitude",sorter: true,},
{title: "纬度(°)",dataIndex: "latitude",sorter: true,},
{title: "服务人口数量(人)",dataIndex: "numberServingPopulation",sorter: true,},
{title: "日供水规模(吨)",dataIndex: "dailyWaterSupplyScale",sorter: true,},
{
title: "操作",
key: "action",
@@ -207,7 +232,7 @@ export default {
//
where: {
sort: "sectionCode",
// sort: "sectionCode",
},
//
selectionList: [],
@@ -258,7 +283,7 @@ export default {
const hide = this.$message.loading('请求中..', 0);
const form = this.form;
if (form.drinkingWaterDictId) {
updateDrinkingWaterDict(form)
updateDrinkingWaterVillageTopDict(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
@@ -275,7 +300,7 @@ export default {
hide();
});
} else {
saveDrinkingWaterDict(form)
saveDrinkingWaterVillageTopDict(form)
.then((res) => {
if (res.data.code == 0) {
this.showEdit = false;
@@ -296,7 +321,7 @@ export default {
/* 删除单个 */
remove(row) {
const hide = this.$message.loading('请求中..', 0);
removeDrinkingWaterDict(row.drinkingWaterDictId).then((res) => {
removeDrinkingWaterVillageTopDict(row.drinkingWaterDictId).then((res) => {
hide();
if (res.data.code === 0) {
this.$message.success(res.data.msg);
@@ -313,7 +338,7 @@ export default {
removeBatch() {
const hide = this.$message.loading('请求中..', 0);
const ids = this.selectionList.map((item) => item.drinkingWaterDictId);
removeBatchDrinkingWaterDict(ids).then((res) => {
removeBatchDrinkingWaterVillageTopDict(ids).then((res) => {
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();
@@ -328,7 +353,7 @@ export default {
},
getOptions(){
getColumnOptions("year").then(res => {
getVillageTopColumnOptions("year").then(res => {
console.log(res)
if (res.data.code == 0) {
this.yearOptions = res.data.data.map(item => {
@@ -346,7 +371,7 @@ export default {
},
copyBatch(){
const hide = this.$message.loading('请求中..', 0);
copyBatchPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
copyBatchVillageTopPlace({cyear:Number(this.cYear),nyear:this.nYear}).then(res=>{
if (res.data.code === 0) {
this.$message.success(res.data.msg);
this.reload();

View File

@@ -1,258 +0,0 @@
<template>
<div class="">
<ele-pro-table
ref="table"
row-key="id"
:datasource="url"
:columns="columns"
:where="where"
:needPage="false"
@done="(d) => (data = d.data)"
:scroll="{ x: 'max-content' }"
>
<template #toolbar>
<!-- 搜索表单 -->
<a-form :model="where" layout="inline" :labelCol="{ offset: 1 }">
<a-row>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="昼夜:">
<a-select
:options="timeSlotOptions"
v-model:value="where.timeSlot"
placeholder="昼夜"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="8" :md="12" :sm="24" :xs="24">
<a-form-item label="时间范围:">
<!-- <a-month-picker v-model:value="timeScope" placeholder="起始" /> -->
<a-range-picker v-model:value="timeScope" format="YYYY-MM-DD" />
</a-form-item>
</a-col>
<a-col :lg="4" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- <a-space>
</a-space> -->
</template>
<template #Leq="{ text, record }">
<a-tag
v-if="
(where.timeSlot == '昼' && text <= 68) ||
(where.timeSlot == '夜' && text <= 58)
"
color="green"
>{{ text }}</a-tag
>
<a-tag
v-else-if="
(record.timeSlot == '昼' && text > 68 && text <= 70) ||
(record.timeSlot == '夜' && text > 58 && text <= 60)
"
color="blue"
>{{ text }}</a-tag
>
<a-tag
v-else-if="
(record.timeSlot == '昼' && text > 70 && text <= 72) ||
(record.timeSlot == '夜' && text > 60 && text <= 62)
"
color="red"
>{{ text }}</a-tag
>
<a-tag
v-else-if="
(record.timeSlot == '昼' && text > 62 && text <= 74) ||
(record.timeSlot == '夜' && text > 62 && text <= 64)
"
color="red"
>{{ text }}</a-tag
>
<a-tag
v-else-if="
(record.timeSlot == '昼' && text > 74) ||
(record.timeSlot == '夜' && text > 64)
"
color="red"
>{{ text }}</a-tag
>
<template v-else color="#FFF">{{ text }}</template>
</template>
</ele-pro-table>
</div>
</template>
<script>
import _ from "lodash";
import XLSX from "xlsx";
import { pageRoadNoiseStatisticUrl } from "@/api/ecology/noise/road-sound";
const columns = [
{
title: "城区",
dataIndex: "area",
},
{
title: "市",
dataIndex: "city",
},
{
title: "路长",
dataIndex: "roadLength",
},
{
title: "路宽",
dataIndex: "roadWidth",
},
{
title: "LeqdB(A)",
dataIndex: "avgLeq",
slots: { customRender: "Leq" },
sorter: true,
},
{
title: "SDdB(A)",
dataIndex: "avgSD",
},
{
title: "L10dB(A)",
dataIndex: "avgL10",
},
{
title: "L50dB(A)",
dataIndex: "avgL50",
},
{
title: "L90dB(A)",
dataIndex: "avgL90",
},
];
export default {
name: "StatisticSoundRoadAverage",
components: {},
data() {
return {
url: pageRoadNoiseStatisticUrl,
data: [],
where: {
model: "area",
timeSlot: "昼"
},
timeScope: [],
columns,
modelOptions: [
{
value: "place",
label: "测点",
},
{
value: "road",
label: "路段",
},
{
value: "area",
label: "城区",
},
{
value: "city",
label: "市",
},
],
timeSlotOptions: [
{
value: "昼",
label: "昼",
},
{
value: "夜",
label: "夜",
},
],
};
},
methods: {
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: {
model: this.where.model,
timeStart:
this.timeScope.length == 2
? this.timeScope[0].format("Y-M-D")
: null,
timeEnd:
this.timeScope.length == 2
? this.timeScope[1].format("Y-M-D")
: null,
timeSlot: this.where.timeSlot,
},
});
let cloneColumns = _.cloneDeep(columns);
if (this.where.model == "area") {
this.columns = cloneColumns.filter((item) => {
return item.dataIndex != "place" && item.dataIndex != "road";
});
} else if (this.where.model == "road") {
this.columns = cloneColumns.filter((item) => {
return item.dataIndex != "place";
});
} else if (this.where.model == "city") {
this.columns = cloneColumns.filter((item) => {
return (
item.dataIndex != "place" &&
item.dataIndex != "road" &&
item.dataIndex != "area"
);
});
}
},
/* 重置搜索 */
reset() {
this.where = {
model: "area",
timeSlot: "",
};
this.this.timeScope = [];
this.reload();
},
exportFile() {
let array = [
["测点", "路段", "城区", "路长", "路宽", "平均Leq", "平均SD"],
];
this.data.forEach((d) => {
array.push([
d.place,
d.road,
d.area,
d.roadLength,
d.roadWidth,
d.avgLeq,
d.avgSD,
]);
});
let sheet = XLSX.utils.aoa_to_sheet(array);
// sheet['!merges'] = [
// {s: {r: 0, c: 1}, e: {r: 0, c: 5}}, // 合并第0行第1列到第0行第5列
// {s: {r: 0, c: 0}, e: {r: 1, c: 0}}, // 合并第0行第0列到第1行第0列
// {s: {r: 0, c: 6}, e: {r: 1, c: 6}} // 合并第0行第6列到第1行第6列
// ];
this.$util.exportSheet(XLSX, sheet, "道路交通噪声统计表");
},
},
};
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,226 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
: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.regionLevel" allowClear showSearch>
<a-select-option
v-for="(item) in regionLevelOptions"
: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-form-item label="测点名称:">
<a-select v-model:value="where.place" allowClear showSearch>
<a-select-option
v-for="(item) in palceOptions"
: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-form-item label="路段:">
<a-select v-model:value="where.road" allowClear showSearch>
<a-select-option
v-for="(item) in roadOptions"
: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-form-item label="城区">
<a-select v-model:value="where.area" allowClear showSearch>
<a-select-option
v-for="(item) in areaOptions"
: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-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
<template #county="{text}">
{{text="市区"}}
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
// import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import {
pageDrinkingWaterStatisticUrl,
// getColumnOptions
} from "@/api/ecology/drinking-water";
// import pageDictUrl from "@/api/ecology/drinking-water-dict"
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import { tableColumns } from "./colums";
import moment from "moment";
// import utils from "./utils";
// const columns =tableColumns;
export default {
name: "DrinkingWaterBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageDrinkingWaterStatisticUrl,
selection: [],
columns:[
{key: "index",title:"序号",dataIndex: "index",width: 48,align: "center",customRender: ({ index }) => index + 1,},
{title:"城市",dataIndex:"city",},
{title:"县城",dataIndex:"county",slots:{customRender:'county'}},
{title:"水源地名称",dataIndex:"place",},
{title:"类型",dataIndex:"waterSourceProperty",},
{title:"监测时间",dataIndex:"reportTime",customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY/MM/DD")},
{title:"应当监测项目个数"},
{title:"未测个数",dataIndex:"",},
{title:"独立分析项目个数",dataIndex:"",},
{title:"外送分析项目个数",dataIndex:"",},
// {title:"取水量万m3",dataIndex:"waterWithdrawal",},
// {title:"超标水源地取水量",dataIndex:"",},
{title:"超标项目",dataIndex:"",},
{title:"情况说明或原因",dataIndex:""},
{title:"备注",dataIndex:"remark"},
// {title:"水源地性质",dataIndex:"waterSourceProperty",},
],
// 表格列配置
// palceOptions: [],
// areaOptions: [],
// roadOptions: [],
// regionLevelOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
// this.loadOptionData();
},
methods: {
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
/**获取下来框数据 */
// 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("road").then((res) => {
// this.roadOptions = 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,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...tableColumns,
];
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>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,217 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
: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.regionLevel" allowClear showSearch>
<a-select-option
v-for="(item) in regionLevelOptions"
: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-form-item label="测点名称:">
<a-select v-model:value="where.place" allowClear showSearch>
<a-select-option
v-for="(item) in palceOptions"
: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-form-item label="路段:">
<a-select v-model:value="where.road" allowClear showSearch>
<a-select-option
v-for="(item) in roadOptions"
: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-form-item label="城区">
<a-select v-model:value="where.area" allowClear showSearch>
<a-select-option
v-for="(item) in areaOptions"
: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-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
// import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import {
pageDrinkingWaterStatisticUrl,
// getColumnOptions
} from "@/api/ecology/drinking-water";
// import pageDictUrl from "@/api/ecology/drinking-water-dict"
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import { tableColumns } from "./colums";
// import moment from "moment";
// import utils from "./utils";
// const columns =tableColumns;
export default {
name: "DrinkingWaterBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageDrinkingWaterStatisticUrl,
selection: [],
columns:[
{title:"城市名称",dataIndex:"city",},
{title:"水源地名称",dataIndex:"place",},
{title:"水源地性质",dataIndex:"waterSourceProperty",},
{title:"断面水质",align: 'center',children: [
{title: "本月", dataIndex: ""},
{title: "上月", dataIndex: ""},
{title: "去年同期", dataIndex: ""},
]
},
{title:"主要污染指标",dataIndex:"",},
],
// 表格列配置
// palceOptions: [],
// areaOptions: [],
// roadOptions: [],
// regionLevelOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
// this.loadOptionData();
},
methods: {
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
/**获取下来框数据 */
// 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("road").then((res) => {
// this.roadOptions = 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,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...tableColumns,
];
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>
<style scoped lang="less">
</style>

View File

@@ -159,8 +159,8 @@ const tableColumns2 = [
{ title: "城市名称", dataIndex: "city", sorter: true, },
{ title: "城市代码", dataIndex: "cityCode", sorter: true, },
// { title: "重点城市区分", dataIndex: "keyCity", sorter: true, },
{title:"县域名称",dataIndex:"county",sorter:true},
{title:"县域代码",dataIndex:"county",sorter:true},
{title:"县域名称",dataIndex:"countyName",sorter:true},
{title:"县域代码",dataIndex:"countyCode",sorter:true},
// { title: "南北方城市", dataIndex: "cityOrientation", sorter: true, },
{ title: "断面名称", dataIndex: "place", sorter: true, },
// { title: "断面代码", dataIndex: "sectionCode", sorter: true, },
@@ -308,33 +308,23 @@ export { tableColumns2 }
//农村数据总览表格
const tableColumns3=[
// {title:"断面代码",dataIndex:"sectionCode",sorter:true},
{title:"断面代码",dataIndex:"sectionCode",sorter:true},
{title: "省",dataIndex: "province",sorter: true,},
{title: "省份代码", dataIndex: "provinceCode", sorter: true, },
{title: "市",dataIndex: "city",sorter: true,},
{ title: "城市代码", dataIndex: "cityCode", sorter: true, },
{ title: "重点城市区分", dataIndex: "keyCity", sorter: true, },
{ title: "南北方城市", dataIndex: "cityOrientation", sorter: true, },
// {title: "城区",dataIndex: "城区",sorter: true,},
// {title: "县(区)",dataIndex: "county",sorter: true,},
// {title: "乡镇",dataIndex: "township",sorter: true,},
// {title: "村",dataIndex: "village",sorter: true,},
{title: "乡镇",dataIndex: "township",sorter: true,},
{title: "",dataIndex: "village",sorter: true,},
{title: "点位名称",dataIndex: "place",sorter: true,},
{ title: "断面代码", dataIndex: "sectionCode", sorter: true, },
{ title: "所属水系", dataIndex: "subordinateWater", sorter: true, },
{ title: "水源地性质", dataIndex: "waterSourceProperty", sorter: true, },
{ title: "本月取水量", dataIndex: "waterWithdrawal", sorter: true, },
{title: "监测时间",dataIndex: "monitorTime",sorter: true,customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY/MM/DD")},
{ title: "水期代码", dataIndex: "waterPhaseCode",sorter: true,
slots:{customRender:'waterCode' }
},
// {title: "湖库(是/否)",dataIndex: "lakeLibraryFlag",sorter: true,},
// {title: "必测村庄(是/否) ",dataIndex: "mustTestVillagesFlag",sorter: true,},
{title: "湖库(是/否)",dataIndex: "lakeLibraryFlag",sorter: true,},
{title: "经度(°)",dataIndex: "longitude",sorter: true,},
{title: "纬度(°)",dataIndex: "latitude",sorter: true,},
{title: "服务人口数量(人)",dataIndex: "numberServingPopulation",sorter: true,},
{title: "日供水规模(吨)",dataIndex: "dailyWaterSupplyScale",sorter: true,},
// {title: "监测时间",dataIndex: "monitorTime",sorter: true,customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY/MM/DD")},
// { title: "水期代码", dataIndex: "waterPhaseCode",sorter: true,
// slots:{customRender:'waterCode' }
// },
// {title: "必测村庄(是/否) ",dataIndex: "mustTestVillagesFlag",sorter: true,},
{title: "水温(℃)",dataIndex: "waterTemperature",sorter: true,},
{title: "pH(mg/L)",dataIndex: "ph",sorter: true,},
{title: "溶解氧(mg/L)",dataIndex: "dissolvedOxygen",sorter: true,},

View File

@@ -1,508 +0,0 @@
<template>
<div class="">
<a-form :model="where" :rules="whereRules" :labelCol="{ offset: 1 }">
<a-row>
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="统计模块:">
<a-select
:options="groupModelOptions"
v-model:value="where.groupModel"
placeholder="统计模块"
>
</a-select>
</a-form-item>
</a-col> -->
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="时间细度:">
<a-select
:options="groupTimeLengthOptions"
v-model:value="where.groupTimeLength"
placeholder=""
>
</a-select>
</a-form-item>
</a-col> -->
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item name="timeRange" label="时间范围:">
<a-range-picker
@panelChange="timeRangePanelChange"
v-model:value="timeRange"
format="YYYY"
:mode="['year', 'year']"
/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="昼夜:">
<a-select
:options="timeSlotOptions"
v-model:value="where.timeSlot"
placeholder="昼夜"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :sm="24" :xs="24">
<a-form-item label="类型:">
<a-select
v-model:value="where.valueType"
:options="valueTypeOptions"
mode="multiple"
placeholder="至少选择一项"
>
</a-select>
</a-form-item>
</a-col>
<!-- <a-col :lg="6" :md="12" :sm="24" :xs="24">
<a-form-item label="时间范围:">
<a-range-picker @change="reportTimeScopeChange" :mode="['year','year']" separator="~" v-model:value="where.reportTimeScope" ><a-range-picker>
<template #renderExtraFooter>
extra footer
</template>
</a-range-picker>
</a-form-item>
</a-col> -->
<a-col :lg="12" :md="12" :sm="24" :xs="24">
<a-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<ele-pro-table
v-if="hisYears.length > 0"
ref="table"
row-key="id"
:datasource="url"
:columns="columns"
:where="where"
:needPage="false"
:initLoad="false"
:scroll="{ x: 'max-content' }"
:method="'POST'"
@done="(d) => (data = d.data)"
>
<template #toolbar>
<!-- 搜索表单 -->
<!-- <a-space>
</a-space> -->
</template>
</ele-pro-table>
</div>
</template>
<script>
// import _ from "lodash";
import { ref } from "vue";
import XLSX from "xlsx";
import {
pageRoadNoiseCompare,
getHistoryyears,
} from "@/api/ecology/noise/road-sound";
export default {
name: "StatisticSoundRoadCompare",
components: {},
data() {
const groupModelOptions = [
{ label: "测点", value: "place" },
{ label: "城区", value: "area" },
{ label: "市", value: "city" },
];
const groupTimeLengthOptions = [
{
label: "年",
value: "monitor_year",
},
{
label: "季度",
value: "quarter",
},
];
// const valueTypeOptions = ['Leq','SD','L10','L50','L90','Lmin','Lmax'];
const valueTypeOptions = [
{
label: "Leq",
value: "index_Leq",
},
{
label: "SD",
value: "index_SD",
},
{
label: "L10",
value: "index_L10",
},
{
label: "L50",
value: "index_L50",
},
{
label: "L90",
value: "index_L90",
},
{
label: "Lmin",
value: "index_Lmin",
},
{
label: "Lmax",
value: "index_Lmax",
},
];
const whereRules = {};
return {
url: pageRoadNoiseCompare,
data: [],
where: {
groupModel: "area",
groupTimeLength: "monitor_year",
reportTimeScope: [],
valueType: ["index_Leq"],
timeRange: [],
regionLevel: "市级"
},
timeRange: [],
whereRules,
hisYears: [],
timeScope: [],
columns: [{ title: "年", dataIndex: "year" }],
groupModelOptions,
groupTimeLengthOptions,
valueTypeOptions: ref(valueTypeOptions),
timeSlotOptions: [
{
value: "昼",
label: "昼",
},
{
value: "夜",
label: "夜",
},
],
};
},
mounted() {
getHistoryyears().then((res) => {
this.hisYears = res.data.data;
this.$nextTick(() => {
this.reload();
});
});
},
methods: {
/* 刷新表格 */
reload() {
if (this.where.valueType.length == 0) {
this.$message.error("请至少选择一个类型");
return;
}
// 结束时间必须大于开始时间
if (this.where.timeRange && this.where.timeRange.length == 2) {
if (this.where.timeRange[0] > this.where.timeRange[1]) {
this.$message.error("结束时间必须大于起始时间");
return;
}
this.where.startYear = this.where.timeRange[0];
this.where.endYear = this.where.timeRange[1];
}
this.stableDone();
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {
groupModel: "area",
groupTimeLength: "monitor_year",
reportTimeScope: [],
valueType: ["index_Leq"],
timeRange: [],
regionLevel: "市级"
};
this.this.timeScope = [];
this.reload();
},
reportTimeScopeChange(d, dstr) {
console.log(d, dstr);
},
timeRangePanelChange(val) {
val[0] && (this.where.timeRange[0] = val[0].year());
val[1] && (this.where.timeRange[1] = val[1].year());
this.timeRange = val;
},
// 数据加载完成
stableDone() {
const columns = [];
if (this.where.groupModel == "area") {
columns.push({
title: "城区",
dataIndex: "area",
sorter: true,
});
} else if (this.where.groupModel == "place") {
columns.push({
title: "测点",
dataIndex: "area",
sorter: true,
});
} else if (this.where.groupModel == "city") {
columns.push({
title: "城市",
dataIndex: "area",
sorter: true,
});
}
this.hisYears.forEach((item) => {
if (
(!this.where.timeRange[0] || this.where.timeRange[0] <= item) &&
(!this.where.timeRange[1] || this.where.timeRange[1] >= item)
) {
if (this.where.groupTimeLength == "quarter") {
columns.push({
title: item + "年第一季度Leq",
dataIndex: item + "1" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度Leq",
dataIndex: item + "2" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度Leq",
dataIndex: item + "3" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度Leq",
dataIndex: item + "4" + "Leq",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度SD",
dataIndex: item + "1" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度SD",
dataIndex: item + "2" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度SD",
dataIndex: item + "3" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度SD",
dataIndex: item + "4" + "Sd",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度L10",
dataIndex: item + "1" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度L10",
dataIndex: item + "2" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度L10",
dataIndex: item + "3" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度L10",
dataIndex: item + "4" + "L10",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度L50",
dataIndex: item + "1" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度L50",
dataIndex: item + "2" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度L50",
dataIndex: item + "3" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度L50",
dataIndex: item + "4" + "L50",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度L90",
dataIndex: item + "1" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度L90",
dataIndex: item + "2" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度L90",
dataIndex: item + "3" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度L90",
dataIndex: item + "4" + "L90",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度Lmin",
dataIndex: item + "1" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度Lmin",
dataIndex: item + "2" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度Lmin",
dataIndex: item + "3" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度Lmin",
dataIndex: item + "4" + "Lmin",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第一季度Lmax",
dataIndex: item + "1" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第二季度Lmax",
dataIndex: item + "2" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第三季度Lmax",
dataIndex: item + "3" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
columns.push({
title: item + "年第四季度Lmax",
dataIndex: item + "4" + "Lmax",
customRender: ({ text }) =>text? Number(text).toFixed(1):"",
});
} else {
if (this.where.valueType.includes("index_Leq")) {
columns.push({
title: item + "年Leq",
dataIndex: item + "Leq",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_SD")) {
columns.push({
title: item + "年SD",
dataIndex: item + "Sd",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L10")) {
columns.push({
title: item + "年L10",
dataIndex: item + "L10",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L50")) {
columns.push({
title: item + "年L50",
dataIndex: item + "L50",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_L90")) {
columns.push({
title: item + "年L90",
dataIndex: item + "L90",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_Lmin")) {
columns.push({
title: item + "年Lmin",
dataIndex: item + "Lmin",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
if (this.where.valueType.includes("index_Lmax")) {
columns.push({
title: item + "年Lmax",
dataIndex: item + "Lmax",
customRender: ({ text }) => {
const val = text ? Number(text).toFixed(1) : "";
return val;
},
});
}
}
}
});
//
this.columns = columns;
},
exportFile() {
const arr = [];
const th = this.columns.map((item) => item.title);
arr.push(th);
this.data.forEach((d) => {
const td = this.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>
<style scoped>
</style>

View File

@@ -0,0 +1,238 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
: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.regionLevel" allowClear showSearch>
<a-select-option
v-for="(item) in regionLevelOptions"
: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-form-item label="测点名称:">
<a-select v-model:value="where.place" allowClear showSearch>
<a-select-option
v-for="(item) in palceOptions"
: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-form-item label="路段:">
<a-select v-model:value="where.road" allowClear showSearch>
<a-select-option
v-for="(item) in roadOptions"
: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-form-item label="城区">
<a-select v-model:value="where.area" allowClear showSearch>
<a-select-option
v-for="(item) in areaOptions"
: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-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
<template #waterCode="{text,record}">
<span >
{{
record.reportTime==null? text="":
record.reportTime.substr(5,2)=="01" || record.reportTime.substr(5,2) == "02" ||record.reportTime.substr(5,2) == "03" ||record.reportTime.substr(5,2)=="12"
? text="K":
record.reportTime.substr(5,2)=="04" || record.reportTime.substr(5,2) == "05" ||record.reportTime.substr(5,2)=="10"||record.reportTime.substr(5,2)=="11"
? text="P":
record.reportTime.substr(5,2)=="06" || record.reportTime.substr(5,2) == "07" ||record.reportTime.substr(5,2)=="08"||record.reportTime.substr(5,2)=="09"
? text="F":text="无采样时间"
}}
</span>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
// import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import {
pageDrinkingWaterCountyStatisticUrl,
// getColumnOptions
} from "@/api/ecology/drinking-water";
// import pageDictUrl from "@/api/ecology/drinking-water-dict"
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import { tableColumns2 } from "./colums";
import moment from "moment";
// import utils from "./utils";
// const columns =tableColumns;
export default {
name: "DrinkingWaterBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageDrinkingWaterCountyStatisticUrl,
selection: [],
columns:[
{key: "index",title:"序号",dataIndex: "index",width: 48,align: "center",customRender: ({ index }) => index + 1,},
{title:"城市",dataIndex:"city",},
{title:"县城",dataIndex:"county",slots:{customRender:'county'}},
{title:"水源地名称",dataIndex:"place",},
{title:"类型",dataIndex:"waterSourceProperty",},
{title:"监测时间",dataIndex:"reportTime",customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY/MM/DD")},
{title:"应当监测项目个数"},
{title:"未测个数",dataIndex:"",},
{title:"独立分析项目个数",dataIndex:"",},
{title:"外送分析项目个数",dataIndex:"",},
// {title:"取水量万m3",dataIndex:"waterWithdrawal",},
// {title:"超标水源地取水量",dataIndex:"",},
{title:"超标项目",dataIndex:"",},
{title:"情况说明或原因",dataIndex:""},
{title:"备注",dataIndex:"remark"},
// {title:"水源地性质",dataIndex:"waterSourceProperty",},
],
// 表格列配置
// palceOptions: [],
// areaOptions: [],
// roadOptions: [],
regionLevelOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
// this.loadOptionData();
},
methods: {
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
/**获取下来框数据 */
// 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("road").then((res) => {
// this.roadOptions = 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,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...tableColumns2,
];
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>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,231 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
: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.regionLevel" allowClear showSearch>
<a-select-option
v-for="(item) in regionLevelOptions"
: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-form-item label="测点名称:">
<a-select v-model:value="where.place" allowClear showSearch>
<a-select-option
v-for="(item) in palceOptions"
: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-form-item label="路段:">
<a-select v-model:value="where.road" allowClear showSearch>
<a-select-option
v-for="(item) in roadOptions"
: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-form-item label="城区">
<a-select v-model:value="where.area" allowClear showSearch>
<a-select-option
v-for="(item) in areaOptions"
: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-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
<template #waterCode="{text,record}">
<span >
{{
record.reportTime==null? text="":
record.reportTime.substr(5,2)=="01" || record.reportTime.substr(5,2) == "02" ||record.reportTime.substr(5,2) == "03" ||record.reportTime.substr(5,2)=="12"
? text="K":
record.reportTime.substr(5,2)=="04" || record.reportTime.substr(5,2) == "05" ||record.reportTime.substr(5,2)=="10"||record.reportTime.substr(5,2)=="11"
? text="P":
record.reportTime.substr(5,2)=="06" || record.reportTime.substr(5,2) == "07" ||record.reportTime.substr(5,2)=="08"||record.reportTime.substr(5,2)=="09"
? text="F":text="无采样时间"
}}
</span>
</template>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
// import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import {
pageDrinkingWaterCountyStatisticUrl,
// getColumnOptions
} from "@/api/ecology/drinking-water";
// import pageDictUrl from "@/api/ecology/drinking-water-dict"
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import { tableColumns2 } from "./colums";
// import moment from "moment";
// import utils from "./utils";
// const columns =tableColumns;
export default {
name: "DrinkingWaterBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageDrinkingWaterCountyStatisticUrl,
selection: [],
columns:[
{title:"城市名称",dataIndex:"city",},
{title:"水源地名称",dataIndex:"place",},
{title:"水源地性质",dataIndex:"waterSourceProperty",},
{title:"断面水质",children: [
{title: "本月", dataIndex: ""},
{title: "上月", dataIndex: ""},
{title: "去年同期", dataIndex: ""},
]
},
{title:"主要污染指标",dataIndex:"",},
],
// 表格列配置
// palceOptions: [],
// areaOptions: [],
// roadOptions: [],
regionLevelOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
// this.loadOptionData();
},
methods: {
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
/**获取下来框数据 */
// 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("road").then((res) => {
// this.roadOptions = 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,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...tableColumns2,
];
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>
<style scoped lang="less">
</style>

View File

@@ -4,29 +4,32 @@
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="city" tab="市级">
<a-tabs v-model:active="activeCity">
<a-tab-pane tab="数据总览" key="city" >
<a-tab-pane tab="监测数据报送表" key="city" >
<base-statistic></base-statistic>
</a-tab-pane>
<a-tab-pane tab="超标评价" key="base1">
<a-tab-pane tab="报送情况说明表" key="base1">
<!-- <function-bill ref="functionWater"></function-bill> -->
<city-appraise></city-appraise>
</a-tab-pane>
<a-tab-pane tab="水质类别" key="base2">
<function-bill ref="functionWater"></function-bill>
<!-- <a-tab-pane tab="水质类别" key="base2">
<city-water-quality></city-water-quality>
</a-tab-pane> -->
<a-tab-pane tab="取水量统计" key="base3">
<!-- <city-water-quality></city-water-quality> -->
</a-tab-pane>
</a-tabs>
</a-tab-pane>
<a-tab-pane key="county" tab="县级">
<a-tabs v-model:active="activeCounty">
<a-tab-pane tab="数据总览" key="County">
<a-tab-pane tab="监测数据报送表" key="County">
<county-data></county-data>
</a-tab-pane>
<a-tab-pane tab="超标评价" key="base1">
<function-bill ref="functionWater"></function-bill>
</a-tab-pane>
<a-tab-pane tab="水质类别" key="base2">
<function-bill ref="functionWater"></function-bill>
<a-tab-pane tab="报送情况说明表" key="base1">
<county-appraise></county-appraise>
</a-tab-pane>
<!-- <a-tab-pane tab="水质类别" key="base2">
<county-water-quality></county-water-quality>
</a-tab-pane> -->
</a-tabs>
</a-tab-pane>
<!-- <a-tab-pane key="quarter" tab="季度报告">
@@ -38,10 +41,10 @@
<village></village>
</a-tab-pane>
<a-tab-pane tab="超标评价" key="base1">
<function-bill ref="functionWater"></function-bill>
<village-appraise></village-appraise>
</a-tab-pane>
<a-tab-pane tab="水质类别" key="base2">
<function-bill ref="functionWater"></function-bill>
<village-water-quality></village-water-quality>
</a-tab-pane>
</a-tabs>
</a-tab-pane>
@@ -56,9 +59,15 @@
*
*
*/
import BaseStatistic from "./base.vue";
import BaseStatistic from "./cityDate.vue";
import countyData from "./countyData.vue"
import village from "./villageData.vue"
import cityAppraise from "./cityAppraise.vue"
import countyAppraise from "./countyAppraise.vue"
import villageAppraise from "./villageAppraise.vue"
// import cityWaterQuality from "./cityWaterQuality.vue"
// import countyWaterQuality from "./countyWaterQuality.vue"
import villageWaterQuality from "./villageWaterQuality.vue"
// import QuarterStatistic from "./quarter.vue";
// import Compare from "./compare.vue"
// import AverageStatistic from "./average.vue"
@@ -68,7 +77,13 @@
components: {
BaseStatistic,
countyData,
village
village,
cityAppraise,
countyAppraise,
villageAppraise,
// cityWaterQuality,
// countyWaterQuality,
villageWaterQuality
// QuarterStatistic,
// Compare,
// AverageStatistic

View File

@@ -0,0 +1,214 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
: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.regionLevel" allowClear showSearch>
<a-select-option
v-for="(item) in regionLevelOptions"
: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-form-item label="测点名称:">
<a-select v-model:value="where.place" allowClear showSearch>
<a-select-option
v-for="(item) in palceOptions"
: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-form-item label="路段:">
<a-select v-model:value="where.road" allowClear showSearch>
<a-select-option
v-for="(item) in roadOptions"
: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-form-item label="城区">
<a-select v-model:value="where.area" allowClear showSearch>
<a-select-option
v-for="(item) in areaOptions"
: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-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询3</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
// import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import {
pageDrinkingWaterVillageStatisticUrl,
// getColumnOptions
} from "@/api/ecology/drinking-water-village";
// import pageDictUrl from "@/api/ecology/drinking-water-dict"
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import { tableColumns3 } from "./colums";
// import moment from "moment";
// import utils from "./utils";
// const columns =tableColumns;
export default {
name: "DrinkingWaterBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageDrinkingWaterVillageStatisticUrl,
selection: [],
columns:[
{title:"城市名称",dataIndex:"city",},
{title:"水源地名称",dataIndex:"place",},
{title:"取水量万m3",dataIndex:"waterWithdrawal",},
{title:"超标水源地取水量",dataIndex:"",},
{title:"超标项目",dataIndex:"",},
{title:"水源地性质",dataIndex:"waterSourceProperty",},
],
// 表格列配置
// palceOptions: [],
// areaOptions: [],
// roadOptions: [],
regionLevelOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
// this.loadOptionData();
},
methods: {
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
/**获取下来框数据 */
// 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("road").then((res) => {
// this.roadOptions = 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,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...tableColumns3,
];
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>
<style scoped lang="less">
</style>

View File

@@ -0,0 +1,217 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
: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.regionLevel" allowClear showSearch>
<a-select-option
v-for="(item) in regionLevelOptions"
: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-form-item label="测点名称:">
<a-select v-model:value="where.place" allowClear showSearch>
<a-select-option
v-for="(item) in palceOptions"
: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-form-item label="路段:">
<a-select v-model:value="where.road" allowClear showSearch>
<a-select-option
v-for="(item) in roadOptions"
: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-form-item label="城区">
<a-select v-model:value="where.area" allowClear showSearch>
<a-select-option
v-for="(item) in areaOptions"
: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-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询3</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="drinkingWaterId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
@done="(d) => (data = d.data)"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
// import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import {
pageDrinkingWaterVillageStatisticUrl,
// getColumnOptions
} from "@/api/ecology/drinking-water-village";
// import pageDictUrl from "@/api/ecology/drinking-water-dict"
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import { tableColumns3 } from "./colums";
// import moment from "moment";
// import utils from "./utils";
// const columns =tableColumns;
export default {
name: "DrinkingWaterBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageDrinkingWaterVillageStatisticUrl,
selection: [],
columns:[
{title:"城市名称",dataIndex:"city",},
{title:"水源地名称",dataIndex:"place",},
{title:"水源地性质",dataIndex:"waterSourceProperty",},
{title:"断面水质",children: [
{title: "本月", dataIndex: ""},
{title: "上月", dataIndex: ""},
{title: "去年同期", dataIndex: ""},
]
},
{title:"主要污染指标",dataIndex:"",},
],
// 表格列配置
// palceOptions: [],
// areaOptions: [],
// roadOptions: [],
regionLevelOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
// this.loadOptionData();
},
methods: {
JumpFieldClick(record, column) {
console.log(column.dataIndex)
},
/**获取下来框数据 */
// 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("road").then((res) => {
// this.roadOptions = 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,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
...tableColumns3,
];
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>
<style scoped lang="less">
</style>

View File

@@ -1,134 +0,0 @@
<template>
<div class="ele-body">
<a-card :bordered="false">
<!-- 搜索表单 -->
<a-form
:model="where"
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
: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.area" allowClear showSearch>
<a-select-option
v-for="(item) in areaOptions"
: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-form-item class="ele-text-right" :wrapper-col="{ span: 24 }">
<a-space>
<a-button type="primary" @click="reload">查询</a-button>
<a-button @click="reset">重置</a-button>
<a-button @click="exportFile">导出Excel</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 表格 -->
<ele-pro-table
v-model:selection="selectionList"
ref="table"
row-key="roadNoiseId"
:datasource="url"
:columns="columns"
:where="where"
:scroll="{ x: 'max-content' }"
>
</ele-pro-table>
</a-card>
</div>
<!-- 编辑弹窗 -->
</template>
<script>
// import _ from "lodash";
import XLSX from "xlsx";
import { pageRoadNoiseUrl, getColumnOptions } from "@/api/ecology/noise/road-sound";
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
// import moment from "moment";
// import utils from "./utils";
export default {
name: "StatisticSoundRoadBase",
components: {},
data() {
return {
data: [],
locale,
bill: {},
// 表格数据接口
url: pageRoadNoiseUrl,
selection: [],
// 表格列配置
columns: [
{title: "年份",dataIndex: "year",},
{title: "路段总长度(米)",dataIndex: "roadLengthTotal",},
{title: "监测点数",dataIndex: "placeTotal",},
{title: "平均路长(米)",dataIndex: "roadLengthAvg",},
{title: "平均路宽(米)",dataIndex: "roadWidthAvg",},
{title: "超70分贝路段长度占总路长比例",dataIndex: "badProportion",},
],
areaOptions: [],
// 表格搜索条件
where: {
checked: 1,
},
// 表格选中数据
selectionList: [],
};
},
mounted() {
this.loadOptionData();
},
methods: {
/**获取下来框数据 */
loadOptionData() {
getColumnOptions("area").then((res) => {
this.areaOptions = res.data.data.map((item) => {
return {
label: item,
value: item,
};
});
});
},
/* 刷新表格 */
reload() {
this.$refs.table.reload({
where: this.where,
});
},
/* 重置搜索 */
reset() {
this.where = {
checked: 1,
};
this.reload();
},
exportFile() {
const columns = [
];
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>
<style scoped lang="less">
</style>