lishifeng
2020-09-15 ce10677f47a14879424e7f562f78442cc03cfda1
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<template>
  <flex-layout direction="row" style="color:#ffffff">
    <content-Box>
      <div slot="title">电池告警历史查询 显示与隐藏查询条件</div>
      <div class="headrs">
        <table class="table-head" width="100%" border="1" cellspacing="0">
          <thead>
            <tr>
              <th>维护区</th>
              <th>机房站点</th>
              <th>蓄电池组</th>
              <th>告警开始日期</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td width="300px">
                <el-select v-model="value" placeholder="全部(共17种)" class="weihu">
                  <el-option
                    v-for="item in newsHost"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </td>
              <td width="500px">
                <el-select v-model="value" placeholder="全部(共70种)" class="rooms">
                  <el-option
                    v-for="item in newSite"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </td>
              <td width="300px">
                <el-select v-model="value" placeholder="全部(共93种)" class="dainchi">
                  <el-option
                    v-for="item in batterList"
                    :key="item.BattGroupId"
                    :label="item.BattGroupName"
                    :value="item.BattGroupId"
                  ></el-option>
                </el-select>
              </td>
              <td width="300px">
                <el-date-picker
                  class="blocks"
                  v-model="valueTime"
                  type="daterange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                ></el-date-picker>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
 
      <!-- 选择 -->
      <table class="condiOpt" border="1">
        <tr class="trTitle">
          <td>
            <center>
              <input type="checkbox">在线电压
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">组端电压
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">
              充电电流
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">
              放电电流
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">
              一级告警
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">
              二级告警
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">
              上限告警
            </center>
          </td>
        </tr>
        <tr class="body">
          <td colspan="2">
            <center>
              <input type="checkbox">单体电压
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">单体内阻
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">单体温度
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">三级告警
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">四级告警
            </center>
          </td>
          <td>
            <center>
              <input type="checkbox">下限告警
            </center>
          </td>
        </tr>
      </table>
 
      <!-- 表单 -->
      <el-table border size="small" :data="table.datas" height="73%" class="tableCent">
        <el-table-column
          v-for="header in table.headers"
          :key="header.prop"
          :prop="header.prop"
          :label="header.label"
          :width="header.width"
          align="center"
        ></el-table-column>
        <el-table-column label="确认告警">
          <input type="checkbox">
        </el-table-column>
      </el-table>
 
      <!-- 底部分页 -->
      <div class="paginations">
        <ul>
          <li>查询</li>
          <li>导出</li>
          <li>表格选项</li>
        </ul>
        <el-pagination
          class="pagess"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[2, 5, 10, 20]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="20"
        ></el-pagination>
      </div>
    </content-Box>
  </flex-layout>
</template>
 
<script>
import ContentBox from "../../components/ContentBox";
import {
  historyTrye /* 维护区 */,
  historyStation /*机房站点 */,
  historyBattery /* 蓄电池组 */,
  historySeroom /* 历史告警记录 */
} from "@/assets/js/alarmAdmian/batteryrHistoryquery.js";
export default {
  components: {
    ContentBox
  },
  data() {
    return {
      /* 日期 */
      valueTime: "",
      /* 维护区 */
      newsHost: [
        {
          value: null,
          label: null
        }
      ],
      /* 机房站点 */
      newSite: [
        {
          value: null,
          label: null
        }
      ],
      /*蓄电池组 */
      batterList: [
        {
          value: null,
          label: null
        }
      ],
 
      value: "",
      /* 表单 */
      table: {
        headers: [
          {
            prop: "room1",
            label: "编号",
            width: ""
          },
          {
            prop: "battery1",
            label: "机房名称",
            width: ""
          },
          {
            prop: "tes1",
            label: "电池组名称",
            width: ""
          },
          {
            prop: "tester1",
            label: "告警名称",
            width: ""
          },
          {
            prop: "current1",
            label: "单体编号",
            width: ""
          },
          {
            prop: "capacity1",
            label: "告警值",
            width: ""
          },
          {
            prop: "monomer1",
            label: "告警等级",
            width: ""
          },
          /*    {
            prop: "number1",
            label: "确认告警",
            width: ""
          }, */
          {
            prop: "alarm1",
            label: "告警确认时间",
            width: ""
          },
          {
            prop: "start1",
            label: "告警开始时间",
            width: ""
          },
          {
            prop: "end1",
            label: "告警结束时间",
            width: ""
          }
        ],
        datas: [
          {
            room1: 0,
            battery1: 0,
            tes1: 0,
            tester1: 0,
            current1: 0,
            capacity1: 0,
            monomer1: 0,
            number1: 0,
            vol1: 0,
            alarm1: 0,
            start1: 0,
            end1: 0
          }
        ]
      }
    };
  },
  mounted() {
    this.hisPivot(); /* 维护区 */
    this.sessionSite(); /* 机房站点 */
    this.batterJque(); /* 蓄电池组 */
    this.historyArlm(); /* 历史告警记录 */
  },
  methods: {
    /* 维护区 */
    async hisPivot() {
      const hisTrpes = await historyTrye();
      /*   console.log('hisTrpes',hisTrpes); */
      if (hisTrpes.data.result) {
        const pivotList = JSON.parse(hisTrpes.data.result).data.map(item => {
          return { label: item };
        });
        /*     console.log(' pivotList', pivotList); */
        const aaaa = pivotList.map((item, index) => {
          /* 生成index */
          item.value = index + 1;
          return item;
        });
        this.newsHost = aaaa;
      }
    },
    /*机房站点 */
    async sessionSite() {
      const siteList = await historyStation({ UNote: "" });
      /* console.log("siteList", siteList); */
      if (siteList.data.result) {
        const newSitelist = JSON.parse(siteList.data.result).data.map(item => {
          return { label: item };
        });
        /*  console.log('newSitelist', newSitelist) */
        const eeee = newSitelist.map((item, index) => {
          /* 生成index */
          item.value = index + 1;
          return item;
        });
        this.newSite = eeee;
        /* console.log('this.newSite',this.newSite); */
      }
    },
    /* 蓄电池组 */
    async batterJque() {
      const jquerys = await historyBattery({ UNote: "", UName: "" });
      /*    console.log(jquerys); */
      if (jquerys.data.result) {
        this.batterList = JSON.parse(jquerys.data.result).data.map(item => {
          item.BattGroupName = `${item.BattGroupName}-${item.MonCount}节`;
          return item;
        });
        /*     console.log('this.batterList',this.batterList); */
      }
    },
    /* 历史告警记录 */
    async historyArlm() {
      const historyList = await historySeroom({
        page: { pageCurr: 1, pageSize: 10, pageAll: 0 },
        binf: { StationName1: "", StationName: "", BattGroupId: "0" },
        mainf: {
          appoint_uid: "4",
          master_audit: "3",
          num: "1",
          BattGroupId: "2",
          usr_id: "119001",
          fault_type_id: 119002,
          fault_level: "119003",
          record_uid: "119004",
          maint_type_id: "119005",
          maint_done: "119006",
          maint_close: "119007",
          master_id: "0"
        },
        adata_H: {
          MonNum: "0",
          alm_id: 1,
          alm_start_time: "2000-1-1 00:00:00",
          alm_start_time1: "2020-09-11 23:59:59",
          alm_signal_id: 0,
          Record_Id: "0"
        }
      });
      console.log("historyList", historyList);
      const newHist = JSON.parse(historyList.data.result).data
       console.log('newHist',newHist);
/* console.log(newHist[0].binf.BattGroupName);
             this.table.datas[0].battery1 = newHist[4].binf.StationName9
         */
    const  newLists  =  newHist.map((item,index)=>{
            item.index = index + 1
            return {
              room1:item.index,
              battery1: item.binf.StationName,
              tes1 :item.binf.BattGroupName,
              tester1:item.binf.StationName8,
              current1:item.adata_H.MonNum,
              capacity1:item.adata_H.alm_value,
            monomer1:item.binf.StationName9,
          start1:item.adata_H.alm_start_time,
          end1:item.adata_H.alm_end_time,
          alarm1:item.adata_H.alm_confirmed_time,
            }
          })
        console.log('newLists',newLists);
 
    this.table.datas = newLists
 
 
    },
    handleSizeChange(val) {
      /*  console.log(`每页 ${val} 条`); */
    },
    handleCurrentChange(val) {
      /* console.log(`当前页: ${val}`); */
    }
  }
};
</script>
 
<style lang="less" scoped>
.headrs {
  font-weight: 900;
  height: 80px;
  width: 100%;
  position: relative;
  .table-head {
    color: #ffff;
    position: absolute;
    top: 3%;
    border: 1px solid #ffffff;
    thead tr {
      height: 35px;
    }
 
    tbody tr {
      height: 70%;
    }
  }
 
  .weihu {
    width: 100%;
  }
 
  .dainchi {
    width: 100%;
  }
 
  .rooms {
    width: 100%;
  }
  .blocks {
    width: 100%;
  }
}
 
/* 表单 */
.tableCent {
  margin-top: 3px;
}
 
/* 底部 */
.paginations {
  /*  border: 1px solid red; */
  width: 100%;
  position: relative;
 
  ul {
    position: absolute;
    top: 5px;
    left: 26%;
  }
  ul li {
    display: inline-block;
    margin: 2px;
  }
 
  .pagess {
    margin: 2px auto;
    width: 30%;
    /*  border: 1px solid blue; */
  }
}
 
/* 条件选择 */
.condiOpt {
  border: 1px solid #ffffff;
  width: 100%;
  margin-top: 3px;
 
  .trTitle {
    height: 35px;
  }
  .body {
    height: 35px;
  }
}
</style>