1
81041
2019-06-20 ab3c4acf83f54f8449ca8664c4a2bb79bd30f297
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<template>
    <div data-name="monitor-batt-param" class="page">
        <!-- Top Navbar -->
        <div class="navbar">
            <div class="navbar-inner">
                <div class="left">
                    <a href="#" class="link back">
                        <i class="icon f7-icons">chevron_left</i>
                    </a>
                </div>
                <div class="title center">系统参数</div>
                <div class="right">
                    <a href="#" class="link refresh">
                        <i class="icon f7-icons">refresh</i>
                    </a>
                </div>
            </div>
        </div>
        <!-- Scrollable page content -->
        <div class="page-content">
            <div class="data-table data-table-collapsible data-table-init card" id="sysParam">
                <table>
                    <thead>
                        <tr>
                            <th class="label-cell">设备ID</th>
                            <th class="numeric-cell">机房名称</th>
                            <th class="numeric-cell">总续航时间</th>
                            <th class="numeric-cell">保一次下电续航时间</th>
                            <th class="numeric-cell">电流钳量程</th>
                            <th class="numeric-cell">一次下电电压</th>
                            <th class="numeric-cell">二次下电电压</th>
                            <th class="numeric-cell">DCDC模块数量</th>
                            <th class="numeric-cell">单体数据来源类型</th>
                            <th class="numeric-cell">续航组数</th>
                            <th class="numeric-cell">续航下限</th>
                            <th class="numeric-cell">续航启动下限</th>
                            <th class="numeric-cell">电池合路器主电池组编号</th>
                            <th class="numeric-cell">背光时长</th>
                            <th class="numeric-cell">停电充电电流</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="label-cell">${sysParam.fbsId}</td>
                            <td class="numeric-cell">${sysParam.stationName}</td>
                            <td class="numeric-cell">${sysParam.timeLong|unit("分钟")}</td>
                            <td class="numeric-cell">${sysParam.firTimeLong|unit("分钟")}</td>
                            <td class="numeric-cell">${sysParam.currRange|unit("A")}</td>
                            <td class="numeric-cell">${sysParam.firVol|unit("V")}</td>
                            <td class="numeric-cell">${sysParam.secVol|unit("V")}</td>
                            <td class="numeric-cell">${sysParam.dcdcNum}</td>
                            <td class="numeric-cell">${sysParam.dataSource}</td>
                            <td class="numeric-cell">${sysParam.endurNum}</td>
                            <td class="numeric-cell">${sysParam.endurLow|unit("V")}</td>
                            <td class="numeric-cell">${sysParam.endurStartLow|unit("V")}</td>
                            <td class="numeric-cell">${sysParam.groupNum}</td>
                            <td class="numeric-cell">${sysParam.backLight|unit("分钟")}</td>
                            <td class="numeric-cell">${sysParam.curr|unit("A")}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</template>
 
<script>
    return {
        data: function() {
            var params = this.$route.params;
            return {
                params: params,
                battParam: ''
            };
        },
        methods: {
            searchData: function(props) {
                // 查询后台
                $.ajax({
                    type: 'post',
                    async: true,
                    url: props.url,
                    data: props.data,
                    dataType: 'json',
                    beforeSend: function() {
                        if(typeof props.beforeSend == 'function') {
                            props.beforeSend();
                        }
                    },
                    success: function(res) {
                        if(typeof props.success == 'function') {
                            var rs = JSON.parse(res.result);
                            props.success(rs);
                        }
                    },
                    error: function() {
                        app.dialog.alert("请求异常,请检测网络连接!");
                    },
                    complete: function() {
                        if(typeof props.complete == 'function') {
                            props.complete();
                        }
                    }
                });
            },
            searchSysParam: function() {
                var params = this.params;
                var sysParam = this.sysParam.sysParam;
                var searchCondition = {
                    num: 128,
                    dev_id: params.fbsid
                };
                
                // 查询后台数据
                this.searchData({
                    url: "Fbs9100_sysparamAction_action_serchByCondition",
                    data: "json="+JSON.stringify(searchCondition),
                    beforeSend: function() {
                        app.preloader.show();
                    },
                    success: function(res){
                        if(res.code==1) {
                            var data = res.data[0];
                            sysParam.fbsId = data.dev_id;
                            sysParam.stationName = data.stationName;
                            sysParam.timeLong = data.GroupVolRange;
                            sysParam.firTimeLong = data.GroupVolSorce;
                            sysParam.currRange = data.CurrentRange;
                            sysParam.firVol = Math.ceil(data.CurrentTyte/10);
                            sysParam.secVol = Math.ceil(data.MonomerOrder/10);
                            sysParam.dcdcNum = data.LoaderCount;//DC数量
                            sysParam.dataSource = data.DtCardCount;
                            sysParam.endurNum = data.POF_BG_Boost_Cnt;
                            sysParam.endurLow = data.POF_BG_Boost_VolStop;
                            sysParam.endurStartLow = data.POF_BG_Boost_VolStart;
                            sysParam.groupNum = data.MajorBattGroupNum;
                            sysParam.backLight = data.BackLightTime;
                            sysParam.curr = data.PowerBreakChargeCurr;
                        }else {
                            app.dialog.alert("系统参数获取失败!")
                        }
                    },
                    complete: function() {
                        app.preloader.hide();
                    }
                });
            }
        },
        on: {
            pageInit: function(e, page) {
                var params = this.params;
                var cView = app.views.current;
                var _this = this;
                this.sysParam = new Vue({
                    el: '#sysParam',
                    delimiters: ['${', '}'],
                    data: {
                        sysParam: {
                            fbsId: params.fbsid,    // 设备id
                            stationName: '',    // 机房名称
                            timeLong: 0, //    续航时间
                            firTimeLong: 0, // 保一次下电续航时间
                            currRange: 0, // 电流钳量程
                            firVol: 0,    // 一次下电电压
                            secVol: 0, // 二次下电电压
                            dcdcNum: 0,    // DCDC模块数量
                            dataSource: 0,    // 单体数据来源类型
                            endurNum: 0,     // 续航组数
                            endurLow: 0,    // 续航下限
                            endurStartLow: 0,    // 续航启动下限
                            groupNum: 0,        // 电池合路器主电池编号
                            backLight: 0,        // 背光时长
                            curr: 0,        //  停电充电电流
                        }
                    },
                    filters: {
                        unit: function(value, unit) {
                            return value+unit;
                        }
                    }
                });
                
                // 查询数据
                this.searchSysParam();
                
                // 刷新页面
                $$(".refresh").click(function() {
                    _this.searchSysParam();
                });
            }    
        }
    }
</script>