whychdw
2020-08-26 a0781bbfea57c3c4be2ffed564ddc222cb63745a
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
<template>
    <flex-layout direction="row" class="page-history">
        <home-list slot="header"
        @toggleChange="toggleChange"
        @leaf-click="leafClick"></home-list>
        <content-box style="margin-left: 4px; margin-right: 4px;" :title="battFullName">
            <flex-layout>
                <div class="content-header" slot="header">
                    <div class="table-layout">
                        <div class="table-row">
                            <div class="table-cell text-right w80">电池状态:</div>
                            <div class="table-cell">
                                <el-input placeholder="" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">端电压:</div>
                            <div class="table-cell">
                                <el-input placeholder="" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">电池电流:</div>
                            <div class="table-cell">
                                <el-input placeholder="" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">测试时长:</div>
                            <div class="table-cell">
                                <el-input placeholder="" size="small" :disabled="true"></el-input>
                            </div>
                        </div>
                        <div class="table-row">
                            <div class="table-cell text-right w80">测试日期:</div>
                            <div class="table-cell">
                                <el-cascader :options="list" 
                                size="small" placeholder="请选择测试日期"
                                style="width: 100%; min-width:16rem">
                                    <template slot-scope="{ node, data }">
                                        <span>{{ data.label }}</span>
                                        <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
                                    </template>
                                </el-cascader>
                            </div>
                            <div class="table-cell text-right w80">测试容量:</div>
                            <div class="table-cell">
                                <el-input placeholder="" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">剩余容量:</div>
                            <div class="table-cell">
                                <el-input placeholder="" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">续航时间:</div>
                            <div class="table-cell">
                                <el-input placeholder="" size="small" :disabled="true"></el-input>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="page-content">
                    <div class="history-list">
                        
                    </div>
                    <div class="flex-box-list">
                        <div class="flex-box">
                            <line-chart ref="groupVol" id="groupVol" unit="V"></line-chart>
                        </div>
                        <div class="flex-box">
                            <bar-chart ref="monBar" id="monBar"></bar-chart>
                        </div>
                    </div>
                    <div class="flex-box-list">
                        <div class="flex-box">
                            <line-chart ref="groupCurr" id="groupCurr" unit="A"></line-chart>
                        </div>
                        <div class="flex-box">
                            <line-chart ref="monInfo" id="monInfo"></line-chart>
                        </div>
                    </div>
                </div>
            </flex-layout>
        </content-box>
    </flex-layout>
</template>
 
<script>
import ContentBox from '../../components/ContentBox'
import HomeList from './HomeList'
import BarChart from '../../components/chart/BarChart'
import LineChart from '../../components/chart/LineChart'
 
export default {
    components: {
        ContentBox,
        HomeList,
        BarChart,
        LineChart,
    },
    data() {
        return {
            battFullName: '电池组全称',
            data: [],
            batt: {},
            list: [
                {
                    value: 'herongDischarge',
                    label: '核容放电',
                    children: []
                },
                {
                    value: 'herongCharge',
                    label: '核容充电',
                    children: []
                },
                {
                    value: 'jianceDischarge',
                    label: '监测放电',
                    children: []
                },
                {
                    value: 'jianceCharge',
                    label: '监测充电',
                    children: []
                },
            ]
        }
    },
    methods: {
        toggleChange() {
            this.resize();
        },
        resize() {
            this.$G.chartManage.resize('groupVol');
            this.$G.chartManage.resize('monBar');
            this.$G.chartManage.resize('groupCurr');
            this.$G.chartManage.resize('monInfo');
        },
        leafClick(data) {
            this.batt = data;
            // 查询历史数据
        }
    },
    mounted() {
        // 屏幕缩放时触发
        window.addEventListener('resize', ()=>{
            this.resize();
        });
    }
}
</script>
 
<style scoped>
.page-history {
    color: #FFFFFF;
}
.table-cell.text-right {
    font-size: 14px;
}
.table-row .table-cell {
    padding-top: 12px;
}
.page-content {
    position: relative;
    padding-top: 8px;
    padding-bottom: 2px;
    box-sizing: border-box;
    height: 100%;
}
.history-list {
    position: absolute;
    top: 8px;
    left: 24px;
    z-index: 99;
}
.flex-box-list {
    display: flex;
    flex-direction: row;
    height: 50%;
    box-sizing: border-box;
}
.page-content .flex-box {
    flex:1;
    overflow: hidden;
}
</style>