|
@@ -22,11 +22,11 @@
|
|
|
<el-table-column label="简称" align="center" prop="abbreviation"/>
|
|
|
<el-table-column label="场站经度" align="center" prop="longitude"/>
|
|
|
<el-table-column label="场站纬度" align="center" prop="latitude"/>
|
|
|
- <el-table-column label="场站类型" align="center" prop="stationType" :formatter="formatStatus" />
|
|
|
- <el-table-column label="关联设备" align="center" prop="equipment">
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- <span>{{ formatEquipment(scope.row.equipment) }}</span>-->
|
|
|
-<!-- </template>-->
|
|
|
+ <el-table-column label="场站类型" align="center" prop="stationType" :formatter="formatStatus"/>
|
|
|
+ <el-table-column label="关联设备" align="center" prop="equipment" :formatter="formatEquipment">
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <span>{{ formatEquipment(scope.row.equipment) }}</span>-->
|
|
|
+ <!-- </template>-->
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
@@ -95,7 +95,8 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="场站类型" prop="stationType">
|
|
|
- <el-select v-model="form.stationType" placeholder="请选择" style="width: 100%" clearable @change="typeChange">
|
|
|
+ <el-select v-model="form.stationType" placeholder="请选择" style="width: 100%" clearable
|
|
|
+ @change="typeChange">
|
|
|
<el-option
|
|
|
v-for="item in terrain"
|
|
|
:key="item.value"
|
|
@@ -122,10 +123,10 @@
|
|
|
<el-select v-model="form.equipment" placeholder="请选择" style="width: 100%" multiple clearable>
|
|
|
<el-option
|
|
|
v-for="item in gEquipment"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- :disabled="item.disabled">
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -148,6 +149,7 @@ import {
|
|
|
delElectricStation
|
|
|
} from "@/api/biz/dataQuery/electricStation";
|
|
|
import {listAllDisabled} from "@/api/biz/dataQuery/windTowerStatusInfo";
|
|
|
+import {infoList} from "@/api/biz/dataQuery/weatherStationInfo";
|
|
|
import axios from "axios";
|
|
|
|
|
|
export default {
|
|
@@ -238,8 +240,16 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getAllWindTowerInfo()
|
|
|
+ this.getWeatherStationInfo()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getWeatherStationInfo() {
|
|
|
+ infoList().then(res => {
|
|
|
+ this.gEquipment = res.data
|
|
|
+ }).catch(err => {
|
|
|
+ console.log('获取环境监测仪信息异常:' + err)
|
|
|
+ })
|
|
|
+ },
|
|
|
/*获取所有的测风塔*/
|
|
|
getAllWindTowerInfo() {
|
|
|
listAllDisabled().then(res => {
|
|
@@ -275,7 +285,7 @@ export default {
|
|
|
this.loading = false;
|
|
|
})
|
|
|
},
|
|
|
- typeChange(){
|
|
|
+ typeChange() {
|
|
|
this.eType = this.form.stationType
|
|
|
},
|
|
|
// 取消按钮
|
|
@@ -328,7 +338,8 @@ export default {
|
|
|
var a = null
|
|
|
const id = row.id || this.ids
|
|
|
this.modId = id
|
|
|
- if (row. equipment!== null) {
|
|
|
+ console.log(row.equipment)
|
|
|
+ if (row.equipment !== null) {
|
|
|
a = row.equipment.split(",")
|
|
|
a = a.length === 1 && a[0] === "" ? null : row.equipment.split(",")
|
|
|
}
|
|
@@ -388,9 +399,16 @@ export default {
|
|
|
handleCurrentChange(val) {
|
|
|
this.page.currentPage = val
|
|
|
},
|
|
|
- formatStatus(row){
|
|
|
- let option = this.terrain.find(w=>w.value === row.stationType)
|
|
|
- return option !==undefined?option.label:row.stationType
|
|
|
+ formatStatus(row) {
|
|
|
+ let option = this.terrain.find(w => w.value === row.stationType)
|
|
|
+ return option !== undefined ? option.label : row.stationType
|
|
|
+ },
|
|
|
+ formatEquipment(row) {
|
|
|
+ if (row.stationType !== '风') {
|
|
|
+ let option = this.gEquipment.find(w => w.id === row.equipment)
|
|
|
+ return option !== undefined ? option.name : row.equipment
|
|
|
+ }
|
|
|
+ return row.equipment
|
|
|
},
|
|
|
// formatType(row){
|
|
|
// let option = this.status.find(w=>w.value === row.stationStatus)
|