<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.numBadBatt }}
|
<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.numPlan}}-->
|
<!-- <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 Vue from "vue";
|
import router from "@/router";
|
const thisVue = new Vue({ router });
|
import platform from "@/assets/js/config";
|
import { delMapHome } from "../js/api";
|
import WeatherComponent from "@/layout/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,
|
numBadBatt: 0,
|
numPlan: 0,
|
battAlarmStr: "0,0"
|
}
|
}
|
};
|
},
|
methods: {
|
// 跳转到历史数据
|
goHistory() {
|
thisVue.$router.push("/dataTest/history" + this.search);
|
},
|
// 跳转到实时数据
|
goRealTime() {
|
thisVue.$router.push(
|
"/dataTest/movingRingSystem" + this.search + "&listReload=1"
|
);
|
},
|
// 跳转告警界面
|
goBattWarn() {
|
thisVue.$router.push(
|
"/alarmMager/batteryrTimequery" + this.search + "&fromType=fromIndex"
|
);
|
},
|
// 跳转到落后机房
|
goBehind() {
|
thisVue.$router.push(
|
"/reportStatistics/taskplan" + this.search + "&fromType=fromIndex"
|
);
|
},
|
// 跳转到延时
|
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 = res.data;
|
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=" +
|
list[3]
|
);
|
},
|
warnText() {
|
let warns = this.info.nums.battAlarmStr.split(",");
|
return "未确认:" + (warns[1] || 0) + "; 已确认:" + (warns[0] || 0);
|
}
|
}
|
};
|
</script>
|
|
<style scoped>
|
.map-panel-content {
|
min-width: 400px;
|
}
|
|
.content-item {
|
padding: 4px;
|
font-size: 12px;
|
}
|
|
.content-item-nowrap {
|
white-space: nowrap;
|
}
|
|
.content-detail {
|
margin-left: 8px;
|
}
|
|
.box-height {
|
height: 32px;
|
}
|
</style>
|