whyczyk
2022-03-01 f868ff46ef4fb25a01364f3c5d0fe220d32b7ad0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<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">
            <el-button type="primary" size="mini" @click="goRealTime">实时数据</el-button>
            <el-button type="primary" size="mini" @click="goHistory">历史数据</el-button>
        </div>
        <div class="content-item">地址:{{info.address}}</div>
    </div>
</template>
 
<script>
 
export default {
    data() {
        return {
            isCanDel: false,
            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() {
            window.parent.parent.postMessage({
                cmd: "syncPage",
                params: {
                    pageInfo: {
                        label: "历史数据",
                        name: "history",
                        src: "/dataTest/history" + this.search,
                        closable: true
                    }
                }
            }, "*");
        },
        // 跳转到实时数据
        goRealTime() {
            window.parent.parent.postMessage({
                cmd: "syncPage",
                params: {
                    pageInfo: {
                        label: "实时监控",
                        name: "movingRingSystem",
                        src: "/dataTest/movingRingSystem" + this.search + '&listReload=1',
                        closable: true
                    }
                }
            }, "*");
        },
        // 跳转告警界面
        goBattWarn() {
            window.parent.parent.postMessage({
                cmd: "syncPage",
                params: {
                    pageInfo: {
                        label: "电池告警实时查询",
                        name: "batteryrTimequery",
                        src: "/alarmMager/batteryrTimequery" + this.search + '&fromType=fromIndex',
                        closable: true
                    }
                }
            }, "*");
        },
        // 跳转到落后机房
        goBehind() {
            // this.$layer.msg('该功能暂未开启');
            window.parent.parent.postMessage({
                cmd: "syncPage",
                params: {
                    pageInfo: {
                        label: "落后单体查询",
                        name: "taskplan",
                        src: "/reportStatistics/taskplan?province=" + this.info.StationName.split('-')[0] + '&home=' + this.info.StationName + '&fromType=fromIndex',
                        closable: true
                    }
                }
            }, "*");
        },
        // 跳转到延时
        goTimeout() {
            this.$layer.msg('该功能暂未开启');
        },
        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 {
    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>