<template>
|
<div class="map-panel-content">
|
<div class="content-item content-item-nowrap">
|
蓄电池组告警数目:{{warnText}}
|
<a class="content-detail" href="javascript:;" @click="goBattWarn">详情>></a>
|
</div>
|
<div class="content-item content-item-nowrap">
|
蓄电池组落后数目:{{info.nums.sum}}
|
<a class="content-detail" href="javascript:;" @click="goBehind">详情>></a>
|
</div>
|
<div class="content-item content-item-nowrap box-height" v-show="weatherState">
|
<weather-component v-if="weatherState" :lng="info.longitude" :lat="info.latitude"></weather-component>
|
</div>
|
<!-- <div class="content-item content-item-nowrap">-->
|
<!-- 蓄电池组延时数目:{{info.nums.newsum}}-->
|
<!-- <a class="content-detail" href="javascript:;" @click="goTimeout">详情>></a>-->
|
<!-- </div>-->
|
<div class="content-item">
|
<el-button type="primary" size="mini" @click="goRealTime">实时数据</el-button>
|
<el-button type="primary" size="mini" @click="goHistory">历史数据</el-button>
|
<el-button v-if="isCanDel" type="danger" size="mini" @click="delHome">移除机房</el-button>
|
</div>
|
<div class="content-item">地址:{{info.Address}}</div>
|
</div>
|
</template>
|
|
<script>
|
import PagesThreeHome from '@/pages/dataTest/threeHome';
|
import platform from "@/assets/js/config";
|
import {
|
delMapHome
|
} from "@/assets/js/api";
|
import WeatherComponent from "@/components/weatherComponent";
|
|
export default {
|
components: {WeatherComponent},
|
data() {
|
return {
|
isCanDel: false,
|
weatherState: platform.weather.value,
|
username: sessionStorage.getItem('username'),
|
info: {
|
num: 369,
|
StationId: "42070471",
|
StationName: "贵州省-贵阳市-观山湖区-观山湖区护理学院-设备1",
|
StationName3: "观山湖区护理学院",
|
Address: "湖北省武汉市武昌区",
|
longitude: 114.37285909,
|
latitude: 30.56442241,
|
information: "",
|
FBSDeviceId: 910000111,
|
nums: {
|
code: 0,
|
sum: 0,
|
newsum: 0,
|
msg: "0,0"
|
}
|
}
|
}
|
},
|
methods: {
|
// 跳转到历史数据
|
goHistory() {
|
window.parent.postMessage({
|
cmd: "syncPage",
|
params: {
|
pageInfo: {
|
label: "历史数据",
|
name: "history",
|
src: "#/history" + this.search,
|
closable: true
|
}
|
}
|
}, "*");
|
},
|
// 跳转到实时数据
|
goRealTime() {
|
window.parent.postMessage({
|
cmd: "syncPage",
|
params: {
|
pageInfo: {
|
label: "实时监控",
|
name: "movingRingSysteRrealTime",
|
src: "#/moving-ring-system" + this.search,
|
closable: true
|
}
|
}
|
}, "*");
|
},
|
// 跳转告警界面
|
goBattWarn() {
|
window.parent.postMessage({
|
cmd: "syncPage",
|
params: {
|
pageInfo: {
|
label: "电池告警实时查询",
|
name: "batteryrTimequery",
|
src: "#/batteryrTimequery" + this.search + '&fromType=fromIndex',
|
closable: true
|
}
|
}
|
}, "*");
|
},
|
// 跳转到落后机房
|
goBehind() {
|
window.parent.postMessage({
|
cmd: "syncPage",
|
params: {
|
pageInfo: {
|
label: "落后单体查询",
|
name: "taskplan",
|
src: "#/reportStatistics/taskplan"+ this.search + '&fromType=fromIndex',
|
closable: true,
|
}
|
}
|
}, "*");
|
},
|
// 跳转到延时
|
goTimeout() {
|
this.$layer.msg('该功能暂未开启');
|
},
|
// 移除机房
|
delHome() {
|
let content = "确认从地图上移除" + this.info.StationName
|
this.$layer.confirm(content, {
|
icon: 3
|
}, index => {
|
this.$layer.close(index);
|
let loading = this.$layer.loading(1);
|
delMapHome(this.info).then(res => {
|
let rs = JSON.parse(res.data.result);
|
if (rs.code == 1) {
|
this.$layer.msg("删除成功");
|
// 关闭等待框
|
this.$layer.close(loading);
|
// 触发删除事件,告诉父组件
|
this.$emit('delHome');
|
} else {
|
// 关闭等待框
|
this.$layer.close(loading);
|
this.$layer.msg("删除失败")
|
}
|
}).catch(error => {
|
// 关闭等待框
|
this.$layer.close(loading);
|
});
|
});
|
},
|
setInfo(info) {
|
this.info = info;
|
},
|
setType(type) {
|
this.type = type;
|
}
|
},
|
computed: {
|
search() {
|
let list = this.info.StationName.split('-');
|
return '?province=' + list[0] + '&city=' + list[1] + '&county=' + list[2] + '&home=' + this.info.StationName3
|
},
|
warnText() {
|
let warns = this.info.nums.msg.split(",");
|
return "未确认:"+(warns[1]||0)+"; 已确认:"+(warns[0]||0);
|
}
|
},
|
}
|
</script>
|
|
<style scoped>
|
.map-panel-content {
|
width: 300Px;
|
}
|
|
.content-item {
|
padding: 4Px;
|
font-size: 12Px;
|
}
|
|
.content-item-nowrap {
|
white-space: nowrap;
|
}
|
|
.content-detail {
|
margin-left: 8Px;
|
}
|
.box-height {
|
height: 32px;
|
}
|
</style>
|