he wei
5 天以前 3c3576d5792bfabcef84979757ee344712e71cd3
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<script setup name="manage">
import { ref, reactive, computed, watch, nextTick, onMounted } from "vue";
import info from '@/components/info.vue';
import bar from '@/components/echarts/bar5.vue';
 
const props = defineProps({
  data: {
    type: Object,
    default: {},
  },
});
 
 
const pOption = [
  {
    label: "站点ID",
    props: "stationId",
  },
  {
    label: "站点名称",
    props: "stationName",
  },
  {
    label: "电源设备IP",
    props: "powerIp",
  },
  {
    label: "电源设备名称",
    props: "powerName",
  },
  {
    label: "生产厂家",
    props: "company",
  },
  {
    label: "电源型号",
    props: "powerModel",
  },
  {
    label: "投入使用日期",
    props: "powerInuseTimeStr",
  },
  {
    label: "电源ID",
    props: "powerId",
  },
];
 
const bOption = [
  {
    label: "站点ID",
    props: "stationId",
  },
  {
    label: "站点名称",
    props: "stationName",
  },
  {
    label: "标称容量",
    props: "moncapstd",
  },
  {
    label: "单体电压",
    props: "monvolstd",
  },
  {
    label: "标称单体内阻",
    props: "monresstd",
  },
  // {
  //   label: "电池生产日期",
  //   props: "",
  // },
  {
    label: "投入使用日期",
    props: "inuseTimeStr",
  },
  {
    label: "电池品牌",
    props: "product",
  },
  {
    label: "电池型号",
    props: "battModel",
  },
  {
    label: "设备IP",
    props: "devIp",
  },
  {
    label: "设备ID",
    props: "devId",
  },
  {
    label: "电池组ID",
    props: "battgroupId",
  },
];
 
const rtInfo = computed(() => {
  let binf = props.data.binf || {};
  let pinf = props.data.pinf || {};
  let sinf = props.data.sinf || {};
  return {
    ...sinf,
    ...pinf,
    ...binf,
    inuseTimeStr: binf.inuseTime ? binf.inuseTime.substring(0, 10) : "",
    powerInuseTimeStr: pinf.powerInuseTime ? pinf.powerInuseTime.substring(0, 10) : "",
  }
});
 
 
 
 
onMounted(() => {
 
});
</script>
 
<template>
  <div class="tab-content">
    <div class="p-left">
      <card title="电源信息">
        <template #tools>
          <div class="btn">电源信息管理</div>
        </template>
        <div class="main">
          <div class="info">
            <div class="row" v-for="(p, idx) in pOption" :key="'p_' + idx">
              <div class="label">{{ p.label }}</div>
              <div class="value">{{ rtInfo[p.props] }}</div>
            </div>
          </div>
        </div>
      </card>
    </div>
    <div class="p-right">
      <card title="电池信息">
        <template #tools>
          <div class="btn">电池信息管理</div>
        </template>
        <div class="main">
          <div class="info">
            <div class="row" v-for="(b, idx) in bOption" :key="'b_' + idx">
              <div class="label">{{ b.label }}</div>
              <div class="value">{{ rtInfo[b.props] }}</div>
            </div>
          </div>
        </div>
      </card>
    </div>
  </div>
</template>
 
<style scoped lang="less">
.tab-content {
  display: flex;
  flex-direction: row;
  height: 100%;
  padding: 10px;
 
  .btn {
    background: linear-gradient(69deg, #6EABE4, #6EABE4 25%, #0A3E77 75%, #0A3E77);
    border: 1px solid #4D81BA;
    display: inline-block;
    font-size: 14px;
    padding: 4px 10px;
    color: #fff;
    cursor: pointer;
  }
 
  .main {
    padding: 40px 18px 10px 18px;
  }
  .info {
    border: 1px solid #146C9C;
    padding: 4px;
    .row {
      display: flex;
      height: 36px;
      flex-direction: row;
      background: rgba(0, 0, 0, 0.1);
      font-size: 14px;
      .label {
        background: rgba(7,111,232, 0.5);
        width: 180px;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 2em;
      }
      .value {
        flex: 1;
        display: flex;
        align-items: center;
      }
      &:nth-child(2n) {
        background: rgba(200, 200, 255, 0.1);
      }
      &:hover {
        background: rgba(200, 200, 255, 0.2);
      }
    }
  }
 
  .p-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-right: 10px;
 
  }
  .p-right {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
 
}
</style>