空气字典 统计
This commit is contained in:
@@ -57,7 +57,8 @@ const updateAir = function (data) {
|
|||||||
const getColumnOptions = function(column){
|
const getColumnOptions = function(column){
|
||||||
return axios.get("/ambientAir/ambientAir/options",{params:{column}})
|
return axios.get("/ambientAir/ambientAir/options",{params:{column}})
|
||||||
}
|
}
|
||||||
|
//均值 百分位
|
||||||
|
const statisticAvg = "/ambientAir/ambientAir/statistic/avg";
|
||||||
export {
|
export {
|
||||||
pageBillUrl,
|
pageBillUrl,
|
||||||
saveAirBill,
|
saveAirBill,
|
||||||
@@ -73,6 +74,6 @@ export {
|
|||||||
updateAir,
|
updateAir,
|
||||||
removeBatchAir,
|
removeBatchAir,
|
||||||
getColumnOptions,
|
getColumnOptions,
|
||||||
|
statisticAvg
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
32
src/api/ecology/atmosphere/acid-rain-plcae.js
Normal file
32
src/api/ecology/atmosphere/acid-rain-plcae.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
const baseUri = "/ambientAir/airPlaceBasicInfoDict";
|
||||||
|
const listAllUrl = baseUri + "";
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const savePlace = function (data) {
|
||||||
|
return axios.post("/ambientAir/airPlaceBasicInfoDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const removePlace = function (id) {
|
||||||
|
return axios.delete(`/ambientAir/airPlaceBasicInfoDict/${id}`,)
|
||||||
|
}
|
||||||
|
// 批量删除
|
||||||
|
const removeBatchPlace = function (ids) {
|
||||||
|
return axios.delete("/ambientAir/airPlaceBasicInfoDict/batch",{data:ids})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
const updatePlace = function (data) {
|
||||||
|
return axios.put("/ambientAir/airPlaceBasicInfoDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export {
|
||||||
|
listAllUrl,
|
||||||
|
savePlace,
|
||||||
|
updatePlace,
|
||||||
|
removeBatchPlace,
|
||||||
|
removePlace
|
||||||
|
|
||||||
|
}
|
||||||
32
src/api/ecology/atmosphere/air-api-relate.js
Normal file
32
src/api/ecology/atmosphere/air-api-relate.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
const baseUri = "/ambientAir/airAqiRelateInfoDict";
|
||||||
|
const listAllUrl = baseUri + "";
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const saveAqiRelate = function (data) {
|
||||||
|
return axios.post("/ambientAir/airAqiRelateInfoDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const removeAqiRelate = function (id) {
|
||||||
|
return axios.delete(`/ambientAir/airAqiRelateInfoDict/${id}`,)
|
||||||
|
}
|
||||||
|
// 批量删除
|
||||||
|
const removeBatchAqiRelate = function (ids) {
|
||||||
|
return axios.delete("/ambientAir/airAqiRelateInfoDict/batch",{data:ids})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
const updateAqiRelate = function (data) {
|
||||||
|
return axios.put("/ambientAir/airAqiRelateInfoDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export {
|
||||||
|
listAllUrl,
|
||||||
|
saveAqiRelate,
|
||||||
|
updateAqiRelate,
|
||||||
|
removeBatchAqiRelate,
|
||||||
|
removeAqiRelate
|
||||||
|
|
||||||
|
}
|
||||||
32
src/api/ecology/atmosphere/air-evaluation-standard.js
Normal file
32
src/api/ecology/atmosphere/air-evaluation-standard.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
const baseUri = "/ambientAir/airEvaluationStandard";
|
||||||
|
const listAllUrl = baseUri + "";
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const saveStandard = function (data) {
|
||||||
|
return axios.post("/ambientAir/airEvaluationStandard",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const removeStandard = function (id) {
|
||||||
|
return axios.delete(`/ambientAir/airEvaluationStandard/${id}`,)
|
||||||
|
}
|
||||||
|
// 批量删除
|
||||||
|
const removeBatchStandard = function (ids) {
|
||||||
|
return axios.delete("/ambientAir/airEvaluationStandard/batch",{data:ids})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
const updateStandard = function (data) {
|
||||||
|
return axios.put("/ambientAir/airEvaluationStandard",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export {
|
||||||
|
listAllUrl,
|
||||||
|
saveStandard,
|
||||||
|
updateStandard,
|
||||||
|
removeBatchStandard,
|
||||||
|
removeStandard
|
||||||
|
|
||||||
|
}
|
||||||
32
src/api/ecology/atmosphere/air-indicator-iaqi.js
Normal file
32
src/api/ecology/atmosphere/air-indicator-iaqi.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
const baseUri = "/ambientAir/airIndicatorIaqiDict";
|
||||||
|
const listAllUrl = baseUri + "";
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const saveIndicatorIaqi = function (data) {
|
||||||
|
return axios.post("/ambientAir/airIndicatorIaqiDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const removeIndicatorIaqi = function (id) {
|
||||||
|
return axios.delete(`/ambientAir/airIndicatorIaqiDict/${id}`,)
|
||||||
|
}
|
||||||
|
// 批量删除
|
||||||
|
const removeBatchIndicatorIaqi = function (ids) {
|
||||||
|
return axios.delete("/ambientAir/airIndicatorIaqiDict/batch",{data:ids})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
const updateIndicatorIaqi = function (data) {
|
||||||
|
return axios.put("/ambientAir/airIndicatorIaqiDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export {
|
||||||
|
listAllUrl,
|
||||||
|
saveIndicatorIaqi,
|
||||||
|
updateIndicatorIaqi,
|
||||||
|
removeBatchIndicatorIaqi,
|
||||||
|
removeIndicatorIaqi
|
||||||
|
|
||||||
|
}
|
||||||
32
src/api/ecology/atmosphere/air-plcae.js
Normal file
32
src/api/ecology/atmosphere/air-plcae.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
const baseUri = "/ambientAir/airPlaceBasicInfoDict";
|
||||||
|
const listAllUrl = baseUri + "";
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const savePlace = function (data) {
|
||||||
|
return axios.post("/ambientAir/airPlaceBasicInfoDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const removePlace = function (id) {
|
||||||
|
return axios.delete(`/ambientAir/airPlaceBasicInfoDict/${id}`,)
|
||||||
|
}
|
||||||
|
// 批量删除
|
||||||
|
const removeBatchPlace = function (ids) {
|
||||||
|
return axios.delete("/ambientAir/airPlaceBasicInfoDict/batch",{data:ids})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
const updatePlace = function (data) {
|
||||||
|
return axios.put("/ambientAir/airPlaceBasicInfoDict",data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export {
|
||||||
|
listAllUrl,
|
||||||
|
savePlace,
|
||||||
|
updatePlace,
|
||||||
|
removeBatchPlace,
|
||||||
|
removePlace
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<a-modal
|
<a-modal
|
||||||
v-model:visible="showEdit"
|
v-model:visible="showEdit"
|
||||||
:title="form.zoneNoisePlaceId !== undefined ? '修改' : '添加'"
|
:title="form.airBasicInfoDictId !== undefined ? '修改' : '添加'"
|
||||||
:confirm-loading="loading"
|
:confirm-loading="loading"
|
||||||
:width="800"
|
:width="800"
|
||||||
:body-style="{ paddingBottom: '8px' }"
|
:body-style="{ paddingBottom: '8px' }"
|
||||||
@@ -16,56 +16,24 @@
|
|||||||
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
:label-col="{ md: { span: 6 }, sm: { span: 24 } }"
|
||||||
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
:wrapper-col="{ md: { span: 18 }, sm: { span: 24 } }"
|
||||||
>
|
>
|
||||||
<a-form-item label="测点名称" name="placeName">
|
<a-form-item label="点位名称" name="place">
|
||||||
<a-input v-model:value="form.placeName" placeholder="请输入测点名称" allow-clear />
|
<a-input v-model:value="form.place" placeholder="请输入点位名称" allow-clear />
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="点位编码" name="placeCode">
|
|
||||||
<a-input v-model:value="form.placeCode" placeholder="请输入点位编码" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="测点经度" name="placeLng">
|
|
||||||
<a-input v-model:value="form.placeLng" placeholder="请输入测点经度" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="测点纬度" name="placeLat">
|
|
||||||
<a-input v-model:value="form.placeLat" placeholder="请输入测点纬度" allow-clear />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label="测点参照物" name="refObj">
|
<a-form-item label="经度" name="longitude">
|
||||||
<a-input v-model:value="form.refObj" placeholder="请输入测点参照物" allow-clear />
|
<a-input v-model:value="form.longitude" placeholder="请输入经度" allow-clear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- <a-form-item label="网格覆盖人口(万人)" name="people">-->
|
<a-form-item label="纬度" name="latitude">
|
||||||
<!-- <a-input v-model:value="form.people" placeholder="请输入网格覆盖人口(万人)" allow-clear />-->
|
<a-input v-model:value="form.latitude" placeholder="请输入纬度" allow-clear />
|
||||||
<!-- </a-form-item>-->
|
|
||||||
<a-form-item label="监测站名" name="station">
|
|
||||||
<a-input v-model:value="form.station" placeholder="请输入监测站名" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="监测仪器型号" name="monitorInstrumentModel">
|
|
||||||
<a-input v-model:value="form.monitorInstrumentModel" placeholder="请输入测监测仪器型号" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="监测仪器编号" name="monitorInstrumentCode">
|
|
||||||
<a-input v-model:value="form.monitorInstrumentCode" placeholder="请输入监测仪器编号" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="监测前校准值" name="beforeMonitorValue">
|
|
||||||
<a-input v-model:value="form.beforeMonitorValue" placeholder="请输入监测前校准值" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="监测后校准值" name="afterMonitorValue">
|
|
||||||
<a-input v-model:value="form.afterMonitorValue" placeholder="请输入监测后校准值" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="声校准器测量声压值" name="soundPressureValue">
|
|
||||||
<a-input v-model:value="form.soundPressureValue" placeholder="请输入声校准器测量声压值" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="声校准仪器型号" name="soundInstrumentModel">
|
|
||||||
<a-input v-model:value="form.soundInstrumentModel" placeholder="请输入声校准仪器型号" allow-clear />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="声校准仪器编号" name="soundInstrumentCode">
|
|
||||||
<a-input v-model:value="form.soundInstrumentCode" placeholder="请输入声校准仪器编号" allow-clear />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
v-model:selection="selectionList"
|
v-model:selection="selectionList"
|
||||||
ref="table"
|
ref="table"
|
||||||
row-key="zoneNoisePlaceId"
|
row-key="airBasicInfoDictId"
|
||||||
:datasource="url"
|
:datasource="url"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:where="where"
|
:where="where"
|
||||||
@@ -140,63 +108,18 @@ export default {
|
|||||||
// 表格列配置
|
// 表格列配置
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: "测点名称",
|
title: "点位名称",
|
||||||
dataIndex: "placeName",
|
dataIndex: "place",
|
||||||
sorter: true,
|
|
||||||
}, {
|
|
||||||
title: "点位编码",
|
|
||||||
dataIndex: "placeCode",
|
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "测点经度",
|
title: "经度",
|
||||||
dataIndex: "placeLng",
|
dataIndex: "longitude",
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "测点纬度",
|
title: "纬度",
|
||||||
dataIndex: "placeLat",
|
dataIndex: "latitude",
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "测点参照物",
|
|
||||||
dataIndex: "refObj",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: "监测站名",
|
|
||||||
dataIndex: "station",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "监测仪器型号",
|
|
||||||
dataIndex: "monitorInstrumentModel",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "监测仪器编号",
|
|
||||||
dataIndex: "monitorInstrumentCode",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "监测前校准值",
|
|
||||||
dataIndex: "beforeMonitorValue",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "声校准器测量声压值",
|
|
||||||
dataIndex: "soundPressureValue",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "声校准仪器型号",
|
|
||||||
dataIndex: "soundInstrumentModel",
|
|
||||||
sorter: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "声校准仪器编号",
|
|
||||||
dataIndex: "soundInstrumentCode",
|
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -221,7 +144,7 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
rules: {
|
rules: {
|
||||||
placeName:[{required: true,message: '请输入测点名称'}],
|
place:[{required: true,message: '请输入点位名称'}],
|
||||||
placeCode:[{required: true,message: '请输入点位编码'}],
|
placeCode:[{required: true,message: '请输入点位编码'}],
|
||||||
placeLng: [{required: true,message: '请输入测点经度',},],
|
placeLng: [{required: true,message: '请输入测点经度',},],
|
||||||
placeLat: [{required: true,message: '请输入测点纬度',},],
|
placeLat: [{required: true,message: '请输入测点纬度',},],
|
||||||
@@ -256,7 +179,7 @@ export default {
|
|||||||
await this.$refs.form.validate();
|
await this.$refs.form.validate();
|
||||||
const hide = this.$message.loading('请求中..', 0);
|
const hide = this.$message.loading('请求中..', 0);
|
||||||
const form = this.form;
|
const form = this.form;
|
||||||
if (form.zoneNoisePlaceId) {
|
if (form.airBasicInfoDictId) {
|
||||||
updatePlace(form)
|
updatePlace(form)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
@@ -295,7 +218,7 @@ export default {
|
|||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
remove(row) {
|
remove(row) {
|
||||||
const hide = this.$message.loading('请求中..', 0);
|
const hide = this.$message.loading('请求中..', 0);
|
||||||
removePlace(row.zoneNoisePlaceId).then((res) => {
|
removePlace(row.airBasicInfoDictId).then((res) => {
|
||||||
hide();
|
hide();
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
@@ -311,7 +234,7 @@ export default {
|
|||||||
/* 批量删除 */
|
/* 批量删除 */
|
||||||
removeBatch() {
|
removeBatch() {
|
||||||
const hide = this.$message.loading('请求中..', 0);
|
const hide = this.$message.loading('请求中..', 0);
|
||||||
const ids = this.selectionList.map((item) => item.zoneNoisePlaceId);
|
const ids = this.selectionList.map((item) => item.airBasicInfoDictId);
|
||||||
removeBatchPlace(ids).then((res) => {
|
removeBatchPlace(ids).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success(res.data.msg);
|
this.$message.success(res.data.msg);
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
// 解析成对象数组
|
// 解析成对象数组
|
||||||
const billName1 = sheetNames[0];
|
const billName1 = file.name + sheetNames[0];
|
||||||
const billData1 = utils.toStationObjData(airList1);
|
const billData1 = utils.toStationObjData(airList1);
|
||||||
const billName2 = sheetNames[1];
|
const billName2 = file.name + sheetNames[1];
|
||||||
const billData2 = utils.toCityObjData(airList2);
|
const billData2 = utils.toCityObjData(airList2);
|
||||||
const billName3 = sheetNames[2];
|
const billName3 = file.name + sheetNames[2];
|
||||||
const billData3 = utils.toAreaObjData(airList3);
|
const billData3 = utils.toAreaObjData(airList3);
|
||||||
if (
|
if (
|
||||||
(!billData1 || billData1.length == 0) &&
|
(!billData1 || billData1.length == 0) &&
|
||||||
@@ -101,7 +101,7 @@ export default {
|
|||||||
tasks.push(
|
tasks.push(
|
||||||
saveAirBill({
|
saveAirBill({
|
||||||
billName: billName1,
|
billName: billName1,
|
||||||
regionLevel: "站点",
|
regionLevel: "place",
|
||||||
ambientAirList: billData1,
|
ambientAirList: billData1,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -110,7 +110,7 @@ export default {
|
|||||||
tasks.push(
|
tasks.push(
|
||||||
saveAirBill({
|
saveAirBill({
|
||||||
billName: billName2,
|
billName: billName2,
|
||||||
regionLevel: "市级",
|
regionLevel: "city",
|
||||||
ambientAirList: billData2,
|
ambientAirList: billData2,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -119,7 +119,7 @@ export default {
|
|||||||
tasks.push(
|
tasks.push(
|
||||||
saveAirBill({
|
saveAirBill({
|
||||||
billName: billName3,
|
billName: billName3,
|
||||||
regionLevel: "县级",
|
regionLevel: "county",
|
||||||
ambientAirList: billData3,
|
ambientAirList: billData3,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,8 +25,11 @@ export default {
|
|||||||
},
|
},
|
||||||
toAreaObjData(excelData) {
|
toAreaObjData(excelData) {
|
||||||
const result = excelData.map(item => {
|
const result = excelData.map(item => {
|
||||||
|
const place = item[0];
|
||||||
|
const county = place.substr(0,place.indexOf("县") + 1);
|
||||||
const row = {
|
const row = {
|
||||||
place: item[0],
|
place,
|
||||||
|
county,
|
||||||
monitorTime: moment(item[1]).format("YYYY/MM/DD HH:mm:ss"),
|
monitorTime: moment(item[1]).format("YYYY/MM/DD HH:mm:ss"),
|
||||||
airQualityStatus: item[2],
|
airQualityStatus: item[2],
|
||||||
aqiLevel: item[3],
|
aqiLevel: item[3],
|
||||||
@@ -46,9 +49,12 @@ export default {
|
|||||||
},
|
},
|
||||||
toStationObjData(excelData) {
|
toStationObjData(excelData) {
|
||||||
const result = excelData.map(item => {
|
const result = excelData.map(item => {
|
||||||
|
const place = item[1];
|
||||||
|
// const county = place.substr(0,place.indexOf("县"))
|
||||||
const row = {
|
const row = {
|
||||||
city: item[0],
|
city: item[0],
|
||||||
place: item[1],
|
// county,
|
||||||
|
place,
|
||||||
monitorTime: moment(item[2]).format("YYYY/MM/DD HH:mm:ss"),
|
monitorTime: moment(item[2]).format("YYYY/MM/DD HH:mm:ss"),
|
||||||
so2: Number(item[3]) || null,
|
so2: Number(item[3]) || null,
|
||||||
no2: Number(item[5]) || null,
|
no2: Number(item[5]) || null,
|
||||||
|
|||||||
292
src/views/atmosphere/air/dict/api-relate.vue
Normal file
292
src/views/atmosphere/air/dict/api-relate.vue
Normal file
@@ -0,0 +1,292 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-modal
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:title="form.id !== undefined ? '修改' : '添加'"
|
||||||
|
:confirm-loading="loading"
|
||||||
|
:width="500"
|
||||||
|
: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="iaqiCategory">
|
||||||
|
<a-input v-model:value="form.iaqiCategory" placeholder="请输入指标名称" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="空气质量指数级别" name="iaqiLevel">
|
||||||
|
<a-input v-model:value="form.iaqiLevel" placeholder="请输入指标名称" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="对健康影响情况" name="impactHealth">
|
||||||
|
<a-input v-model:value="form.impactHealth" placeholder="请输入对健康影响情况" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="建议采取的措施" name="suggestedMeasures">
|
||||||
|
<a-input v-model:value="form.suggestedMeasures" placeholder="建议采取的措施" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label="空气质量指数最小值" name="iaqiMin">
|
||||||
|
<a-input-number :step="1" :precision="0" v-model:value="form.iaqiMin" />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="空气质量指数最大值" name="iaqiMax">
|
||||||
|
<a-input-number :step="1" :precision="0" v-model:value="form.iaqiMax" />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
</a-form>
|
||||||
|
</a-modal>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
row-key="id"
|
||||||
|
:datasource="url"
|
||||||
|
:columns="columns"
|
||||||
|
:where="where"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<a-space>
|
||||||
|
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||||
|
<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 {
|
||||||
|
listAllUrl,
|
||||||
|
saveAqiRelate,
|
||||||
|
updateAqiRelate,
|
||||||
|
removeAqiRelate,
|
||||||
|
removeBatchAqiRelate
|
||||||
|
} from "@/api/ecology/atmosphere/air-api-relate";
|
||||||
|
// import moment from "moment";
|
||||||
|
export default {
|
||||||
|
name: "AirAqiRelate",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
// 表格数据接口
|
||||||
|
url: listAllUrl,
|
||||||
|
selection: [],
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
// {
|
||||||
|
// title: "年份",
|
||||||
|
// dataIndex: "year",
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: "空气质量指数类别",
|
||||||
|
dataIndex: "iaqiCategory",
|
||||||
|
}, {
|
||||||
|
title: "空气质量指数级别",
|
||||||
|
dataIndex: "iaqiLevel",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "空气质量指数最小值",
|
||||||
|
dataIndex: "iaqiMin",
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "空气质量指数最大值",
|
||||||
|
dataIndex: "iaqiMax",
|
||||||
|
// customRender: ({text})=>{
|
||||||
|
// return text!=undefined? text.toFixed(1):undefined
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "对健康影响情况",
|
||||||
|
dataIndex: "impactHealth",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "建议采取的措施",
|
||||||
|
dataIndex: "suggestedMeasures",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
width: 150,
|
||||||
|
align: "center",
|
||||||
|
fixed: "right",
|
||||||
|
slots: {
|
||||||
|
customRender: "action",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// 表格搜索条件
|
||||||
|
where: {},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
showEdit: false,
|
||||||
|
// 表单数据
|
||||||
|
form: {},
|
||||||
|
loading: false,
|
||||||
|
rules: {
|
||||||
|
timeSlot:[{required: true,message: '请选择时段'}],
|
||||||
|
// minLeq: [{required: true,message: '请输入最小值',},],
|
||||||
|
// maxLeq: [{required: true,message: '请输入最大值',},],
|
||||||
|
level: [{required: true,message: '请输入等级',},],
|
||||||
|
// evaluate: [{required: true,message: '请输入评价',},],
|
||||||
|
sortNumber: [{required: true,message: '请输入排序',},],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
minLeqChange(e){
|
||||||
|
console.log(e)
|
||||||
|
},
|
||||||
|
/* 刷新表格 */
|
||||||
|
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 {minLeq,maxLeq } = this.form;
|
||||||
|
// if(minLeq == undefined && maxLeq == undefined ){
|
||||||
|
// message.error("最小值和最大值请至少填写一项!")
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
const hide = this.$message.loading('请求中..', 0);
|
||||||
|
const form = this.form;
|
||||||
|
if (form.id) {
|
||||||
|
updateAqiRelate(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 {
|
||||||
|
saveAqiRelate(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);
|
||||||
|
removeAqiRelate(row.id).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.id);
|
||||||
|
removeBatchAqiRelate(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();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
</style>
|
||||||
299
src/views/atmosphere/air/dict/evaluation-standard.vue
Normal file
299
src/views/atmosphere/air/dict/evaluation-standard.vue
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-modal
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:title="form.id !== undefined ? '修改' : '添加'"
|
||||||
|
:confirm-loading="loading"
|
||||||
|
:width="500"
|
||||||
|
: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="indicatorName">
|
||||||
|
<a-input v-model:value="form.indicatorName" placeholder="请输入指标名称" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="平均时间" name="averageTime">
|
||||||
|
<a-input v-model:value="form.averageTime" placeholder="请输入平均时间" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label="浓度限值一级" name="concentrationLimitFirstLevel">
|
||||||
|
<a-input-number :step="1" :precision="0" v-model:value="form.concentrationLimitFirstLevel" />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="浓度限值二级" name="concentrationLimitSecondLevel">
|
||||||
|
<a-input-number :step="1" :precision="0" v-model:value="form.concentrationLimitSecondLevel" />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="单位" name="unit">
|
||||||
|
<a-input v-model:value="form.unit" placeholder="请输入单位" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label="评价" name="evaluate">
|
||||||
|
<a-input
|
||||||
|
v-model:value="form.evaluate"
|
||||||
|
placeholder="请输入评价"
|
||||||
|
allow-clear
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<!-- <a-form-item label="排序" name="sortNumber">-->
|
||||||
|
<!-- <a-input-number :step="1" :precision="0" v-model:value="form.sortNumber" />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
</a-form>
|
||||||
|
</a-modal>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
row-key="id"
|
||||||
|
:datasource="url"
|
||||||
|
:columns="columns"
|
||||||
|
:where="where"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<a-space>
|
||||||
|
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||||
|
<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 {
|
||||||
|
listAllUrl,
|
||||||
|
saveStandard,
|
||||||
|
updateStandard,
|
||||||
|
removeStandard,
|
||||||
|
removeBatchStandard
|
||||||
|
} from "@/api/ecology/atmosphere/air-evaluation-standard";
|
||||||
|
// import moment from "moment";
|
||||||
|
export default {
|
||||||
|
name: "ZoneNoiseStandard",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
// 表格数据接口
|
||||||
|
url: listAllUrl,
|
||||||
|
selection: [],
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: "年份",
|
||||||
|
dataIndex: "year",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "指标名称",
|
||||||
|
dataIndex: "indicatorName",
|
||||||
|
}, {
|
||||||
|
title: "平均时间",
|
||||||
|
dataIndex: "averageTime",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "浓度限值一级",
|
||||||
|
dataIndex: "concentrationLimitFirstLevel",
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "浓度限值二级",
|
||||||
|
dataIndex: "concentrationLimitSecondLevel",
|
||||||
|
// customRender: ({text})=>{
|
||||||
|
// return text!=undefined? text.toFixed(1):undefined
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "单位",
|
||||||
|
dataIndex: "unit",
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: "排序",
|
||||||
|
// dataIndex: "sortNumber",
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
width: 150,
|
||||||
|
align: "center",
|
||||||
|
fixed: "right",
|
||||||
|
slots: {
|
||||||
|
customRender: "action",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// 表格搜索条件
|
||||||
|
where: {},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
showEdit: false,
|
||||||
|
// 表单数据
|
||||||
|
form: {},
|
||||||
|
loading: false,
|
||||||
|
rules: {
|
||||||
|
timeSlot:[{required: true,message: '请选择时段'}],
|
||||||
|
// minLeq: [{required: true,message: '请输入最小值',},],
|
||||||
|
// maxLeq: [{required: true,message: '请输入最大值',},],
|
||||||
|
level: [{required: true,message: '请输入等级',},],
|
||||||
|
// evaluate: [{required: true,message: '请输入评价',},],
|
||||||
|
sortNumber: [{required: true,message: '请输入排序',},],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
minLeqChange(e){
|
||||||
|
console.log(e)
|
||||||
|
},
|
||||||
|
/* 刷新表格 */
|
||||||
|
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 {minLeq,maxLeq } = this.form;
|
||||||
|
// if(minLeq == undefined && maxLeq == undefined ){
|
||||||
|
// message.error("最小值和最大值请至少填写一项!")
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
const hide = this.$message.loading('请求中..', 0);
|
||||||
|
const form = this.form;
|
||||||
|
if (form.id) {
|
||||||
|
updateStandard(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 {
|
||||||
|
saveStandard(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);
|
||||||
|
removeStandard(row.id).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.id);
|
||||||
|
removeBatchStandard(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();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
</style>
|
||||||
55
src/views/atmosphere/air/dict/index.vue
Normal file
55
src/views/atmosphere/air/dict/index.vue
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
|
<a-tab-pane key="place" tab="点位信息">
|
||||||
|
<place></place>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="evaluation" tab="评估标准">
|
||||||
|
<evaluation-standard></evaluation-standard>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="aqi" tab="空气质量指数">
|
||||||
|
<aqi-relate></aqi-relate>
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="iaqi" tab="空气各项目指标AIQI">
|
||||||
|
<indiacator-iaqi></indiacator-iaqi>
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
import EvaluationStandard from "./evaluation-standard"
|
||||||
|
import AqiRelate from "./api-relate"
|
||||||
|
import Place from "./place"
|
||||||
|
import IndiacatorIaqi from "./indicator-iaqi"
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AirDictIndex',
|
||||||
|
components: {
|
||||||
|
EvaluationStandard,
|
||||||
|
Place,
|
||||||
|
AqiRelate,
|
||||||
|
IndiacatorIaqi
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeKey: 'place'
|
||||||
|
};
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
262
src/views/atmosphere/air/dict/indicator-iaqi.vue
Normal file
262
src/views/atmosphere/air/dict/indicator-iaqi.vue
Normal file
@@ -0,0 +1,262 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-modal
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:title="form.id !== undefined ? '修改' : '添加'"
|
||||||
|
:confirm-loading="loading"
|
||||||
|
:width="500"
|
||||||
|
: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 v-for="item in columns" :key="item.dataIndex" :label="item.title" :name="item.dataIndex">
|
||||||
|
<a-input v-model:value="form[item.dataIndex]" :placeholder="`请输入${item.title}`" allow-clear/>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</a-form>
|
||||||
|
</a-modal>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
row-key="id"
|
||||||
|
:datasource="url"
|
||||||
|
:columns="columns"
|
||||||
|
:where="where"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<a-space>
|
||||||
|
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||||
|
<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 {
|
||||||
|
listAllUrl,
|
||||||
|
saveIndicatorIaqi,
|
||||||
|
updateIndicatorIaqi,
|
||||||
|
removeIndicatorIaqi,
|
||||||
|
removeBatchIndicatorIaqi
|
||||||
|
} from "@/api/ecology/atmosphere/air-indicator-iaqi";
|
||||||
|
// import moment from "moment";
|
||||||
|
export default {
|
||||||
|
name: "AirIndicatorIaqi",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
// 表格数据接口
|
||||||
|
url: listAllUrl,
|
||||||
|
selection: [],
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
// {
|
||||||
|
// title: "年份",
|
||||||
|
// dataIndex: "year",
|
||||||
|
// },
|
||||||
|
{title: "空气质量分指数",dataIndex: "iaqi",}, {title: "so2 24小时平均", dataIndex: "so2TwentyFourHour",},
|
||||||
|
{title: "so2 1小时平均",dataIndex: "so2OneHour",},
|
||||||
|
{title: "no2 24小时平均",dataIndex: "no2TwentyFourHour",},
|
||||||
|
{title: "no2 1小时平均",dataIndex: "no2OneHour",},
|
||||||
|
{title: "pm10 24小时平均",dataIndex: "pm10TwentyFourHour",},
|
||||||
|
{title: "pm25 24小时平均",dataIndex: "pm25TwentyFourHour",},
|
||||||
|
{title: "co 24小时平均",dataIndex: "coTwentyFourHour",},
|
||||||
|
{title: "co 1小时平均",dataIndex: "coOneHour",},
|
||||||
|
{title: "o3 8小时平均", dataIndex: "o3EightHour",},
|
||||||
|
{title: "o3 1小时平均", dataIndex: "o3OneHour",},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
width: 150,
|
||||||
|
align: "center",
|
||||||
|
fixed: "right",
|
||||||
|
slots: {
|
||||||
|
customRender: "action",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// 表格搜索条件
|
||||||
|
where: {},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
showEdit: false,
|
||||||
|
// 表单数据
|
||||||
|
form: {},
|
||||||
|
loading: false,
|
||||||
|
rules: {
|
||||||
|
timeSlot: [{required: true, message: '请选择时段'}],
|
||||||
|
// minLeq: [{required: true,message: '请输入最小值',},],
|
||||||
|
// maxLeq: [{required: true,message: '请输入最大值',},],
|
||||||
|
level: [{required: true, message: '请输入等级',},],
|
||||||
|
// evaluate: [{required: true,message: '请输入评价',},],
|
||||||
|
sortNumber: [{required: true, message: '请输入排序',},],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
minLeqChange(e) {
|
||||||
|
console.log(e)
|
||||||
|
},
|
||||||
|
/* 刷新表格 */
|
||||||
|
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 {minLeq,maxLeq } = this.form;
|
||||||
|
// if(minLeq == undefined && maxLeq == undefined ){
|
||||||
|
// message.error("最小值和最大值请至少填写一项!")
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
const hide = this.$message.loading('请求中..', 0);
|
||||||
|
const form = this.form;
|
||||||
|
if (form.id) {
|
||||||
|
updateIndicatorIaqi(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 {
|
||||||
|
saveIndicatorIaqi(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);
|
||||||
|
removeIndicatorIaqi(row.id).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.id);
|
||||||
|
removeBatchIndicatorIaqi(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();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
</style>
|
||||||
234
src/views/atmosphere/air/dict/place-bill.vue
Normal file
234
src/views/atmosphere/air/dict/place-bill.vue
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-modal
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:title="form.airBasicInfoDictId !== 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="place">
|
||||||
|
<a-input v-model:value="form.place" placeholder="请输入点位名称" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
</a-form>
|
||||||
|
</a-modal>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
row-key="airBasicInfoDictId"
|
||||||
|
:datasource="url"
|
||||||
|
:columns="columns"
|
||||||
|
:where="where"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<a-space>
|
||||||
|
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||||
|
<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 {
|
||||||
|
listAllUrl,
|
||||||
|
savePlace,
|
||||||
|
updatePlace,
|
||||||
|
removePlace,
|
||||||
|
removeBatchPlace
|
||||||
|
} from "@/api/ecology/atmosphere/air-plcae";
|
||||||
|
// import moment from "moment";
|
||||||
|
export default {
|
||||||
|
name: "AirPlace",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
// 表格数据接口
|
||||||
|
url: listAllUrl,
|
||||||
|
selection: [],
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: "年份",
|
||||||
|
dataIndex: "year",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
width: 150,
|
||||||
|
align: "center",
|
||||||
|
fixed: "right",
|
||||||
|
slots: {
|
||||||
|
customRender: "action",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// 表格搜索条件
|
||||||
|
where: {},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
showEdit: false,
|
||||||
|
// 表单数据
|
||||||
|
form: {},
|
||||||
|
loading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
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.airBasicInfoDictId) {
|
||||||
|
updatePlace(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 {
|
||||||
|
savePlace(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);
|
||||||
|
removePlace(row.airBasicInfoDictId).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.airBasicInfoDictId);
|
||||||
|
removeBatchPlace(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();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
</style>
|
||||||
257
src/views/atmosphere/air/dict/place.vue
Normal file
257
src/views/atmosphere/air/dict/place.vue
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<a-modal
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:title="form.airBasicInfoDictId !== 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="place">
|
||||||
|
<a-input v-model:value="form.place" 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>
|
||||||
|
</a-modal>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
row-key="airBasicInfoDictId"
|
||||||
|
:datasource="url"
|
||||||
|
:columns="columns"
|
||||||
|
:where="where"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<a-space>
|
||||||
|
<a-button @click="openEdit" type="primary">新增</a-button>
|
||||||
|
<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 {
|
||||||
|
listAllUrl,
|
||||||
|
savePlace,
|
||||||
|
updatePlace,
|
||||||
|
removePlace,
|
||||||
|
removeBatchPlace
|
||||||
|
} from "@/api/ecology/atmosphere/air-plcae";
|
||||||
|
// import moment from "moment";
|
||||||
|
export default {
|
||||||
|
name: "AirPlace",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
// 表格数据接口
|
||||||
|
url: listAllUrl,
|
||||||
|
selection: [],
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: "点位名称",
|
||||||
|
dataIndex: "place",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "经度",
|
||||||
|
dataIndex: "longitude",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "纬度",
|
||||||
|
dataIndex: "latitude",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
width: 150,
|
||||||
|
align: "center",
|
||||||
|
fixed: "right",
|
||||||
|
slots: {
|
||||||
|
customRender: "action",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
// 表格搜索条件
|
||||||
|
where: {},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
showEdit: false,
|
||||||
|
// 表单数据
|
||||||
|
form: {},
|
||||||
|
loading: false,
|
||||||
|
rules: {
|
||||||
|
place:[{required: true,message: '请输入点位名称'}],
|
||||||
|
placeCode:[{required: true,message: '请输入点位编码'}],
|
||||||
|
placeLng: [{required: true,message: '请输入测点经度',},],
|
||||||
|
placeLat: [{required: true,message: '请输入测点纬度',},],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
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.airBasicInfoDictId) {
|
||||||
|
updatePlace(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 {
|
||||||
|
savePlace(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);
|
||||||
|
removePlace(row.airBasicInfoDictId).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.airBasicInfoDictId);
|
||||||
|
removeBatchPlace(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();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
</style>
|
||||||
228
src/views/atmosphere/air/statistic/avg.vue
Normal file
228
src/views/atmosphere/air/statistic/avg.vue
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<!-- 搜索表单 -->
|
||||||
|
<a-form
|
||||||
|
:model="where"
|
||||||
|
layout="vertical"
|
||||||
|
: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.model" >
|
||||||
|
<a-select-option
|
||||||
|
v-for="(item) in modelOptions"
|
||||||
|
:key="item.value"
|
||||||
|
>{{ item.label }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :lg="24" :md="24" :sm="24" :xs="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-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
v-model:selection="selectionList"
|
||||||
|
ref="table"
|
||||||
|
row-key="ambientAirId"
|
||||||
|
: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 {statisticAvg, getColumnOptions, listAllAir} from "@/api/ecology/air";
|
||||||
|
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||||
|
import moment from "moment";
|
||||||
|
// import utils from "./utils";
|
||||||
|
export default {
|
||||||
|
name: "StatisticAirAvg",
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
locale,
|
||||||
|
bill: {},
|
||||||
|
// 表格数据接口
|
||||||
|
url: statisticAvg,
|
||||||
|
selection: [],
|
||||||
|
modelOptions: [
|
||||||
|
{label: "市", value: "city"},
|
||||||
|
{label: "县", value: "county"},
|
||||||
|
{label: "站点", value: "place"},
|
||||||
|
|
||||||
|
],
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
{title:"SO2",dataIndex:"avgSo2"},
|
||||||
|
{title:"NO2",dataIndex:"avgNo2"},
|
||||||
|
{title:"PM10",dataIndex:"avgPm10"},
|
||||||
|
{title:"PM25",dataIndex:"avgPm25"},
|
||||||
|
{title:"CO",dataIndex:"avgCo"},
|
||||||
|
{title:"O3",dataIndex:"avgO3"},
|
||||||
|
{title:"AQI",dataIndex:"avgAqi"},
|
||||||
|
{title:"首要污染物",dataIndex:"primaryPollutant"},
|
||||||
|
{title:"空气质量指数级别",dataIndex:"aqiLevel"},
|
||||||
|
{title:"空气质量状况",dataIndex:"airQualityStatus"},
|
||||||
|
{title:"一氧化碳百分位数评价",dataIndex:"evaluationCo"},
|
||||||
|
{title:"臭氧百分位数评价",dataIndex:"evaluationO3"},
|
||||||
|
],
|
||||||
|
regionLevelOptions: [],
|
||||||
|
// 表格搜索条件
|
||||||
|
where: {
|
||||||
|
model: "city",
|
||||||
|
},
|
||||||
|
// 表格选中数据
|
||||||
|
selectionList: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadOptionData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**获取下来框数据 */
|
||||||
|
loadOptionData() {
|
||||||
|
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 = {
|
||||||
|
model: "city",
|
||||||
|
};
|
||||||
|
this.reload();
|
||||||
|
},
|
||||||
|
exportFile() {
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: "监测日期",
|
||||||
|
dataIndex: "monitorTime",
|
||||||
|
sorter: true,
|
||||||
|
customRender: ({text}) => moment(text).format("YYYY-MM-DD HH:mm")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "城市",
|
||||||
|
dataIndex: "city",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "测点名称",
|
||||||
|
dataIndex: "place",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "SO2/(μg/m3)",
|
||||||
|
dataIndex: "so2",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "NO2/(μg/m3)",
|
||||||
|
dataIndex: "no2",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "PM10/(μg/m3)",
|
||||||
|
dataIndex: "pm10",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "CO/(mg/m3)",
|
||||||
|
dataIndex: "co",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "臭氧(O3)最大8小时滑动平均浓度/(μg/m3)",
|
||||||
|
dataIndex: "o3",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "PM2.5",
|
||||||
|
dataIndex: "pm25",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "空气质量指数AQI",
|
||||||
|
dataIndex: "aqi",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "首要污染物",
|
||||||
|
dataIndex: "primaryPollutant",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "空气质量指数级别",
|
||||||
|
dataIndex: "aqiLevel",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "空气质量状况",
|
||||||
|
dataIndex: "airQualityStatus",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "备注",
|
||||||
|
dataIndex: "remark",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "创建人",
|
||||||
|
dataIndex: "username",
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const arr = [];
|
||||||
|
const th = columns.map((item) => item.title);
|
||||||
|
arr.push(th);
|
||||||
|
listAllAir(this.where).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
res.data.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>
|
||||||
@@ -5,7 +5,9 @@
|
|||||||
<a-tab-pane key="base" tab="数据总览">
|
<a-tab-pane key="base" tab="数据总览">
|
||||||
<base-statistic></base-statistic>
|
<base-statistic></base-statistic>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="avg" tab="均值、百分位">
|
||||||
|
<avg-statistic></avg-statistic>
|
||||||
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
@@ -18,15 +20,16 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import BaseStatistic from "./base.vue";
|
import BaseStatistic from "./base.vue";
|
||||||
|
import AvgStatistic from "./avg";
|
||||||
export default {
|
export default {
|
||||||
name: 'StatisticAirIndex',
|
name: 'StatisticAirIndex',
|
||||||
components: {
|
components: {
|
||||||
BaseStatistic,
|
BaseStatistic,AvgStatistic
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeKey: 'base'
|
activeKey: 'avg'
|
||||||
};
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,8 +29,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import BaseStatistic from "./base.vue";
|
import BaseStatistic from "./base.vue";
|
||||||
// import QuarterStatistic from "./quarter.vue";
|
|
||||||
// import Compare from "./compare.vue";
|
|
||||||
import AverageStatistic from "./average.vue";
|
import AverageStatistic from "./average.vue";
|
||||||
import SourceStatistic from "./source.vue";
|
import SourceStatistic from "./source.vue";
|
||||||
import YearStatistic from "./year.vue";
|
import YearStatistic from "./year.vue";
|
||||||
|
|||||||
Reference in New Issue
Block a user