he wei
2022-04-27 04931ed145e5526d9bf13fca79c9a2ee744a6d0f
U 告警管理 列表页超出省略的数据添加汽泡提示
8个文件已修改
1920 ■■■■■ 已修改文件
src/views/alarmMager/batteryrHistoryquery.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/alarmMager/batteryrTimequery.vue 1868 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/alarmMager/deviceHistoryquery.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/alarmMager/deviceTimequery.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/alarmMager/powerAlarmTimeout.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/alarmMager/powerBoxAlarm.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/alarmMager/powerBoxHistoryAlarm.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataMager/components/AddBattGroup.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/alarmMager/batteryrHistoryquery.vue
@@ -190,6 +190,7 @@
          height="100%"
          class="tableCent"
          ref="goodsDetailTable"
          tooltip-effect="light"
        >
          <el-table-column :width="50" type="index" label="编号">
          </el-table-column>
@@ -200,6 +201,7 @@
            :label="header.label"
            :width="header.width"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="cztime"
@@ -270,7 +272,7 @@
import { export_json_to_excel } from "@/assets/js/excel/Export2Excel.js";
import { isHasPermit } from "@/assets/js/tools";
export default {
  name: 'batteryrHistoryquery',
  name: "batteryrHistoryquery",
  data() {
    let permits = this.$store.state.user.permits;
    let isCanDel = isHasPermit("batt_alm_delete_permit", permits);
src/views/alarmMager/batteryrTimequery.vue
@@ -1,212 +1,430 @@
<template>
    <flex-layout>
        <div slot="header">
            <div class="table-layout filter-box-table">
                <div class="table-row">
                    <div class="table-cell text-right">维护区:</div>
                    <div class="table-cell">
                        <el-select v-model="selectValue1" placeholder="请选择维护区" size="small" class="weihu" @change="changeSelect1">
                            <el-option v-for="item in vindicate" :key="item.label" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                    </div>
                    <div class="table-cell text-right">机房站点:</div>
                    <div class="table-cell">
                        <el-select v-model="selectValue2" @change="storageBatterys" placeholder="请选择机房站点" size="small" class="rooms">
                            <el-option v-for="(item, idx) in newRoms" :key="'newRoms_' + idx" :label="item.label" :value="item.value"></el-option>
                        </el-select>
                    </div>
                    <div class="table-cell text-right">蓄电池组:</div>
                    <div class="table-cell">
                        <el-select v-model="selectValue3" placeholder="请选择蓄电池组" size="small" class="dainchi" @change="sendMessage">
                            <el-option :label="selectPlace3" :value="0"></el-option>
                            <el-option v-for="(item, idx) in options" :key="'BattGroup_' + idx" :label="item.BattGroupName" :value="item.battGroupId"></el-option>
                        </el-select>
                    </div>
                </div>
            </div>
            <!-- 告警状态警示灯 -->
            <table class="condiOpt" border="1">
                <tr class="trTitle">
                    <td>
                        <center>告警状态警示灯</center>
                    </td>
                    <td>
                        <center>告警条件过滤</center>
                    </td>
                    <td>
                        <center>告警阀值过滤</center>
                    </td>
                    <td>
                        <center>告警等级过滤</center>
                    </td>
                </tr>
                <tr class="trBody">
                    <td class="tdOne">
                        <ul class="light">
                            <li>
                                <el-tooltip class="item" effect="dark" content="一级警告" placement="bottom-end">
                                    <img :src="eleOffImg" class="lampImg" />
                                </el-tooltip>
                            </li>
                            <li>
                                <el-tooltip class="item" effect="dark" content="二级警告" placement="bottom-end">
                                    <img :src="eleOnImg" class="lampImg" />
                                </el-tooltip>
                            </li>
                            <li>
                                <el-tooltip class="item" effect="dark" content="三级警告" placement="bottom-end">
                                    <img :src="eleOffImg" class="lampImg" />
                                </el-tooltip>
                            </li>
                            <li>
                                <el-tooltip class="item" effect="dark" content="四级警告" placement="bottom-end">
                                    <img :src="eleOffImg" class="lampImg" />
                                </el-tooltip>
                            </li>
                        </ul>
                    </td>
                    <td class="tdTwo">
                        <ul class="inputOne">
                            <li>
                                <el-checkbox v-model="checkbox.usr_id.bol">在线电压</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.fault_type_id.bol">组端电压</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.uname.bol">漏液电压</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.fault_level.bol">充电电流</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.record_uid.bol">放电电流</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.maint_type_id.bol">单体电压</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.maint_close.bol">单体内阻</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.maint_done.bol">单体温度</el-checkbox>
                            </li>
                        </ul>
                    </td>
                    <td class="tdTree">
                        <ul class="inputOne">
                            <li>
                                <el-checkbox v-model="checkbox.alm_id.bol">上限告警</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.alm_signal_id.bol">下限告警</el-checkbox>
                            </li>
                        </ul>
                    </td>
                    <td class="tdFrou">
                        <ul class="inputOne">
                            <li>
                                <el-checkbox v-model="checkbox.Level_one_warn.bol">一级告警</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.Level_two_warn.bol">二级告警</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.master_audit.bol">三级告警</el-checkbox>
                            </li>
                            <li>
                                <el-checkbox v-model="checkbox.appoint_uid.bol">四级告警</el-checkbox>
                            </li>
                        </ul>
                    </td>
                </tr>
            </table>
        </div>
        <el-tabs v-model="acTabs" type="border-card" class="flex-layout noborder" @tab-click="tabClick">
            <el-tab-pane label="未确认告警" name="unconfirmed">
                <flex-layout>
                    <!-- 表单 -->
                    <div class="flex-page-content">
                        <el-table id="batteryrTimequeryTable" stripe size="small" :data="table1.datas" height="100%" class="tableCent">
                            <el-table-column label="编号" type="index" width="50">
                            </el-table-column>
                            <el-table-column v-for="header in table1.headers" :key="header.prop" :prop="header.prop" :label="header.label" :width="header.width" :min-width="header.minWidth" align="center"></el-table-column>
                            <el-table-column label="确认告警" align="center" :width="80">
                                <template slot-scope="scope">
                                    <el-checkbox v-model="scope.row.almIsConfirmed" disabled></el-checkbox>
                                    <!-- <input type="checkbox" disabled :checked="scope.row.alarm1 && scope.row.alarm1.length > 0 ? true : false"> -->
                                </template>
                            </el-table-column>
                            <el-table-column prop="cztime" fixed="right" width="257px" align="center" label="操作">
                                <template slot-scope="scope">
                                    <el-button :disabled="!isCanConfirm" type="primary" size="mini" @click="okAlarm(scope.row)">确认告警</el-button>
                                    <el-button :disabled="!isCanQuit" type="success" size="mini" @click="deleteUser(scope.row)">取消告警</el-button>
                                    <el-button :disabled="!isCanDel" type="danger" size="mini" @click="delteTim(scope.row, 0)">删除</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <!-- 底部分页 -->
                    <div class="flex-page-footer" slot="footer">
                        <div class="el-pagination-btns">
                            <el-button type="primary" round size="mini" icon="el-icon-search" @click="sendMessage">查询</el-button>
                            <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile1">导出</el-button>
                        </div>
                        <el-pagination class="pagess" @size-change="handleSizeChange1" @current-change="handleCurrentChange1" :current-page="queryInfo1.pagenum" :page-sizes="[10, 20, 30, 50, 100]" :page-size="queryInfo1.pagesize" layout="total, sizes, prev, pager, next, jumper" :total="total1"></el-pagination>
                        <!--  <el-button type="primary" round size="mini" icon="el-icon-wallet">全部选中</el-button> -->
                    </div>
                </flex-layout>
            </el-tab-pane>
            <el-tab-pane label="已确认告警" name="confirmed">
                <flex-layout>
                    <!-- 表单 -->
                    <div class="flex-page-content">
                        <el-table id="batteryrTimequeryTable" stripe size="small" :data="table2.datas" height="100%" class="tableCent">
                            <el-table-column label="编号" type="index" width="50">
                            </el-table-column>
                            <el-table-column v-for="header in table2.headers" :key="header.prop" :prop="header.prop" :label="header.label" :width="header.width" :min-width="header.minWidth" align="center"></el-table-column>
                            <el-table-column label="确认告警" align="center" :width="80">
                                <template slot-scope="scope">
                                    <el-checkbox v-model="scope.row.almIsConfirmed" disabled></el-checkbox>
                                    <!-- <input type="checkbox" disabled :checked="scope.row.alarm1 && scope.row.alarm1.length > 0 ? true : false"> -->
                                </template>
                            </el-table-column>
                            <el-table-column prop="cztime" fixed="right" width="257px" align="center" label="操作">
                                <template slot-scope="scope">
                                    <el-button :disabled="!isCanConfirm" type="primary" size="mini" @click="okAlarm(scope.row)">确认告警</el-button>
                                    <el-button :disabled="!isCanQuit" type="success" size="mini" @click="deleteUser(scope.row)">取消告警</el-button>
                                    <el-button :disabled="!isCanDel" type="danger" size="mini" @click="delteTim(scope.row, 1)">删除</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <!-- 底部分页 -->
                    <div class="flex-page-footer" slot="footer">
                        <div class="el-pagination-btns">
                            <el-button type="primary" round size="mini" icon="el-icon-search" @click="sendMessage">查询</el-button>
                            <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile2">导出</el-button>
                        </div>
                        <el-pagination class="pagess" @size-change="handleSizeChange2" @current-change="handleCurrentChange2" :current-page="queryInfo2.pagenum" :page-sizes="[10, 20, 30, 50, 100]" :page-size="queryInfo2.pagesize" layout="total, sizes, prev, pager, next, jumper" :total="total2"></el-pagination>
                        <!--  <el-button type="primary" round size="mini" icon="el-icon-wallet">全部选中</el-button> -->
                    </div>
                </flex-layout>
            </el-tab-pane>
        </el-tabs>
    </flex-layout>
  <flex-layout>
    <div slot="header">
      <div class="table-layout filter-box-table">
        <div class="table-row">
          <div class="table-cell text-right">维护区:</div>
          <div class="table-cell">
            <el-select
              v-model="selectValue1"
              placeholder="请选择维护区"
              size="small"
              class="weihu"
              @change="changeSelect1"
            >
              <el-option
                v-for="item in vindicate"
                :key="item.label"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </div>
          <div class="table-cell text-right">机房站点:</div>
          <div class="table-cell">
            <el-select
              v-model="selectValue2"
              @change="storageBatterys"
              placeholder="请选择机房站点"
              size="small"
              class="rooms"
            >
              <el-option
                v-for="(item, idx) in newRoms"
                :key="'newRoms_' + idx"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </div>
          <div class="table-cell text-right">蓄电池组:</div>
          <div class="table-cell">
            <el-select
              v-model="selectValue3"
              placeholder="请选择蓄电池组"
              size="small"
              class="dainchi"
              @change="sendMessage"
            >
              <el-option :label="selectPlace3" :value="0"></el-option>
              <el-option
                v-for="(item, idx) in options"
                :key="'BattGroup_' + idx"
                :label="item.BattGroupName"
                :value="item.battGroupId"
              ></el-option>
            </el-select>
          </div>
        </div>
      </div>
      <!-- 告警状态警示灯 -->
      <table class="condiOpt" border="1">
        <tr class="trTitle">
          <td>
            <center>告警状态警示灯</center>
          </td>
          <td>
            <center>告警条件过滤</center>
          </td>
          <td>
            <center>告警阀值过滤</center>
          </td>
          <td>
            <center>告警等级过滤</center>
          </td>
        </tr>
        <tr class="trBody">
          <td class="tdOne">
            <ul class="light">
              <li>
                <el-tooltip
                  class="item"
                  effect="dark"
                  content="一级警告"
                  placement="bottom-end"
                >
                  <img :src="eleOffImg" class="lampImg" />
                </el-tooltip>
              </li>
              <li>
                <el-tooltip
                  class="item"
                  effect="dark"
                  content="二级警告"
                  placement="bottom-end"
                >
                  <img :src="eleOnImg" class="lampImg" />
                </el-tooltip>
              </li>
              <li>
                <el-tooltip
                  class="item"
                  effect="dark"
                  content="三级警告"
                  placement="bottom-end"
                >
                  <img :src="eleOffImg" class="lampImg" />
                </el-tooltip>
              </li>
              <li>
                <el-tooltip
                  class="item"
                  effect="dark"
                  content="四级警告"
                  placement="bottom-end"
                >
                  <img :src="eleOffImg" class="lampImg" />
                </el-tooltip>
              </li>
            </ul>
          </td>
          <td class="tdTwo">
            <ul class="inputOne">
              <li>
                <el-checkbox v-model="checkbox.usr_id.bol"
                  >在线电压</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.fault_type_id.bol"
                  >组端电压</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.uname.bol">漏液电压</el-checkbox>
              </li>
              <li>
                <el-checkbox v-model="checkbox.fault_level.bol"
                  >充电电流</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.record_uid.bol"
                  >放电电流</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.maint_type_id.bol"
                  >单体电压</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.maint_close.bol"
                  >单体内阻</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.maint_done.bol"
                  >单体温度</el-checkbox
                >
              </li>
            </ul>
          </td>
          <td class="tdTree">
            <ul class="inputOne">
              <li>
                <el-checkbox v-model="checkbox.alm_id.bol"
                  >上限告警</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.alm_signal_id.bol"
                  >下限告警</el-checkbox
                >
              </li>
            </ul>
          </td>
          <td class="tdFrou">
            <ul class="inputOne">
              <li>
                <el-checkbox v-model="checkbox.Level_one_warn.bol"
                  >一级告警</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.Level_two_warn.bol"
                  >二级告警</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.master_audit.bol"
                  >三级告警</el-checkbox
                >
              </li>
              <li>
                <el-checkbox v-model="checkbox.appoint_uid.bol"
                  >四级告警</el-checkbox
                >
              </li>
            </ul>
          </td>
        </tr>
      </table>
    </div>
    <el-tabs
      v-model="acTabs"
      type="border-card"
      class="flex-layout noborder"
      @tab-click="tabClick"
    >
      <el-tab-pane label="未确认告警" name="unconfirmed">
        <flex-layout>
          <!-- 表单 -->
          <div class="flex-page-content">
            <el-table
              id="batteryrTimequeryTable"
              stripe
              size="small"
              :data="table1.datas"
              height="100%"
              class="tableCent"
              tooltip-effect="light"
            >
              <el-table-column label="编号" type="index" width="50">
              </el-table-column>
              <el-table-column
                v-for="header in table1.headers"
                :key="header.prop"
                :prop="header.prop"
                :label="header.label"
                :width="header.width"
                :min-width="header.minWidth"
                show-overflow-tooltip
                align="center"
              ></el-table-column>
              <el-table-column label="确认告警" align="center" :width="80">
                <template slot-scope="scope">
                  <el-checkbox
                    v-model="scope.row.almIsConfirmed"
                    disabled
                  ></el-checkbox>
                  <!-- <input type="checkbox" disabled :checked="scope.row.alarm1 && scope.row.alarm1.length > 0 ? true : false"> -->
                </template>
              </el-table-column>
              <el-table-column
                prop="cztime"
                fixed="right"
                width="257px"
                align="center"
                label="操作"
              >
                <template slot-scope="scope">
                  <el-button
                    :disabled="!isCanConfirm"
                    type="primary"
                    size="mini"
                    @click="okAlarm(scope.row)"
                    >确认告警</el-button
                  >
                  <el-button
                    :disabled="!isCanQuit"
                    type="success"
                    size="mini"
                    @click="deleteUser(scope.row)"
                    >取消告警</el-button
                  >
                  <el-button
                    :disabled="!isCanDel"
                    type="danger"
                    size="mini"
                    @click="delteTim(scope.row, 0)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
          <!-- 底部分页 -->
          <div class="flex-page-footer" slot="footer">
            <div class="el-pagination-btns">
              <el-button
                type="primary"
                round
                size="mini"
                icon="el-icon-search"
                @click="sendMessage"
                >查询</el-button
              >
              <el-button
                type="primary"
                round
                size="mini"
                icon="el-icon-wallet"
                @click="exportFile1"
                >导出</el-button
              >
            </div>
            <el-pagination
              class="pagess"
              @size-change="handleSizeChange1"
              @current-change="handleCurrentChange1"
              :current-page="queryInfo1.pagenum"
              :page-sizes="[10, 20, 30, 50, 100]"
              :page-size="queryInfo1.pagesize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total1"
            ></el-pagination>
            <!--  <el-button type="primary" round size="mini" icon="el-icon-wallet">全部选中</el-button> -->
          </div>
        </flex-layout>
      </el-tab-pane>
      <el-tab-pane label="已确认告警" name="confirmed">
        <flex-layout>
          <!-- 表单 -->
          <div class="flex-page-content">
            <el-table
              id="batteryrTimequeryTable"
              stripe
              size="small"
              :data="table2.datas"
              tooltip-effect="light"
              height="100%"
              class="tableCent"
            >
              <el-table-column label="编号" type="index" width="50">
              </el-table-column>
              <el-table-column
                v-for="header in table2.headers"
                :key="header.prop"
                :prop="header.prop"
                :label="header.label"
                :width="header.width"
                :min-width="header.minWidth"
                show-overflow-tooltip
                align="center"
              ></el-table-column>
              <el-table-column label="确认告警" align="center" :width="80">
                <template slot-scope="scope">
                  <el-checkbox
                    v-model="scope.row.almIsConfirmed"
                    disabled
                  ></el-checkbox>
                  <!-- <input type="checkbox" disabled :checked="scope.row.alarm1 && scope.row.alarm1.length > 0 ? true : false"> -->
                </template>
              </el-table-column>
              <el-table-column
                prop="cztime"
                fixed="right"
                width="257px"
                align="center"
                label="操作"
              >
                <template slot-scope="scope">
                  <el-button
                    :disabled="!isCanConfirm"
                    type="primary"
                    size="mini"
                    @click="okAlarm(scope.row)"
                    >确认告警</el-button
                  >
                  <el-button
                    :disabled="!isCanQuit"
                    type="success"
                    size="mini"
                    @click="deleteUser(scope.row)"
                    >取消告警</el-button
                  >
                  <el-button
                    :disabled="!isCanDel"
                    type="danger"
                    size="mini"
                    @click="delteTim(scope.row, 1)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
          <!-- 底部分页 -->
          <div class="flex-page-footer" slot="footer">
            <div class="el-pagination-btns">
              <el-button
                type="primary"
                round
                size="mini"
                icon="el-icon-search"
                @click="sendMessage"
                >查询</el-button
              >
              <el-button
                type="primary"
                round
                size="mini"
                icon="el-icon-wallet"
                @click="exportFile2"
                >导出</el-button
              >
            </div>
            <el-pagination
              class="pagess"
              @size-change="handleSizeChange2"
              @current-change="handleCurrentChange2"
              :current-page="queryInfo2.pagenum"
              :page-sizes="[10, 20, 30, 50, 100]"
              :page-size="queryInfo2.pagesize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total2"
            ></el-pagination>
            <!--  <el-button type="primary" round size="mini" icon="el-icon-wallet">全部选中</el-button> -->
          </div>
        </flex-layout>
      </el-tab-pane>
    </el-tabs>
  </flex-layout>
</template>
<script>
import {
    newsAlarm /*告警信息 */,
    deletionRecord /* 删除 */,
    reporTemergency /* 确认告警 */,
    CancelTheAlarm /* 取消告警 */,
  newsAlarm /*告警信息 */,
  deletionRecord /* 删除 */,
  reporTemergency /* 确认告警 */,
  CancelTheAlarm /* 取消告警 */,
} from "./js/batteryrTimequery.js";
import {
    searchProvince,
    roomsStation /* 机房站点 */,
    batterySearch /* 蓄电池组 */,
  searchProvince,
  roomsStation /* 机房站点 */,
  batterySearch /* 蓄电池组 */,
} from "@/assets/js/api";
import { isHasPermit, Timeout } from "@/assets/js/tools";
// 引入导出表格
@@ -214,568 +432,574 @@
import createWs from "@/assets/js/websocket";
const WSMixin = createWs("battAlarmData");
export default {
    name: 'batteryrTimequery',
  name: "batteryrTimequery",
  mixins: [WSMixin],
    data() {
        let permits = this.$store.state.user.permits;
        let isCanConfirm = isHasPermit("batt_alm_confirm_permit", permits);
        let isCanQuit = isHasPermit("batt_alm_clear_permit", permits);
        let isCanDel = isHasPermit("batt_alm_delete_permit", permits);
        return {
            skinActive: "science-blue",
            eleOffImg: require("../../assets/images/eleOff.png"),
            eleOnImg: require("../../assets/images/eleOn.png"),
            isCanConfirm: isCanConfirm,
            isCanQuit: isCanQuit,
            isCanDel: isCanDel,
            // 当前tab
            acTabs: "unconfirmed",
            queryInfo1: {
                query: "" /* 查询 */,
                pagenum: 1 /* 当前页码 绑定queryInfo.pagenum */,
                pagesize: 10 /* 每页显示的数据 绑定queryInfo.pagesize */,
            },
            queryInfo2: {
                query: "" /* 查询 */,
                pagenum: 1 /* 当前页码 绑定queryInfo.pagenum */,
                pagesize: 10 /* 每页显示的数据 绑定queryInfo.pagesize */,
            },
            total1: 0 /* 总共有多少条 */,
            total2: 0 /* 总共有多少条 */,
            /* 维护区 */
            vindicate: [],
            /* 机房站点 */
            newRoms: [],
            /* 蓄电池租 */
            options: [],
            checkbox: {
                /* 在线电压 */
                usr_id: {
                    bol: true,
                    value1: 119001,
                    value2: 0,
                },
                /* 组端电压 */
                fault_type_id: {
                    bol: true,
                    value1: 119002,
                    value2: 0,
                },
                /* 漏液电压 */
                uname: {
                    bol: true,
                    value1: 119012,
                    value2: 0,
                },
                fault_level: {
                    bol: true,
                    value1: 119003,
                    value2: 0,
                } /* 充电电流 */,
                record_uid: {
                    bol: true,
                    value1: 119004,
                    value2: 0,
                } /* 放电电流 */,
                Level_one_warn: {
                    bol: true,
                    value1: 1,
                    value2: 0,
                } /*一级警告 */,
                Level_two_warn: {
                    bol: true,
                    value1: 2,
                    value2: 0,
                } /* 二级警告 */,
                alm_id: {
                    bol: true,
                    value1: 1,
                    value2: 100,
                } /* 上限告警 */,
                maint_type_id: {
                    bol: true,
                    value1: 119005,
                    value2: 0,
                } /* 单体电压 */,
                maint_close: {
                    bol: true,
                    value1: 119007,
                    value2: 0,
                } /* 单体内阻 */,
                maint_done: {
                    bol: true,
                    value1: 119006,
                    value2: 0,
                } /* 单体温度 */,
                master_audit: {
                    bol: true,
                    value1: 3,
                    value2: 0,
                } /*  三级告警 */,
                appoint_uid: {
                    bol: true,
                    value1: 4,
                    value2: 0,
                } /* 四级告警 */,
                alm_signal_id: {
                    bol: true,
                    value1: 0,
                    value2: 100,
                } /* 下限告警 */,
            },
            selectValue1: "",
            selectPlace1: "",
            selectValue2: "",
            selectPlace2: "",
            selectValue3: 0,
            selectPlace3: "",
            /* 表单 */
            table1: {
                headers: [
                    {
                        prop: "stationName",
                        label: "机房名称",
                        minWidth: 220,
                    },
                    {
                        prop: "battGroupName",
                        label: "电池组名称",
                        width: 120,
                    },
                    {
                        prop: "alarmName",
                        label: "告警名称",
                        width: 162,
                    },
                    {
                        prop: "monNum",
                        label: "单体编号",
                        width: 80,
                    },
                    {
                        prop: "almValue",
                        label: "告警值",
                        width: 80,
                    },
                    {
                        prop: "almLevel",
                        label: "告警等级",
                        width: 120,
                    },
                    {
                        prop: "almStartTime",
                        label: "告警开始时间",
                        width: 180,
                    },
                    {
                        prop: "almConfirmedTime",
                        label: "确认告警时间",
                        width: 180,
                    },
                ],
                datas: [],
            },
            table2: {
                headers: [
                    {
                        prop: "stationName",
                        label: "机房名称",
                        minWidth: 220,
                    },
                    {
                        prop: "battGroupName",
                        label: "电池组名称",
                        width: 120,
                    },
                    {
                        prop: "alarmName",
                        label: "告警名称",
                        width: 162,
                    },
                    {
                        prop: "monNum",
                        label: "单体编号",
                        width: 80,
                    },
                    {
                        prop: "almValue",
                        label: "告警值",
                        width: 80,
                    },
                    {
                        prop: "almLevel",
                        label: "告警等级",
                        width: 120,
                    },
                    {
                        prop: "almStartTime",
                        label: "告警开始时间",
                        width: 180,
                    },
                    {
                        prop: "almConfirmedTime",
                        label: "确认告警时间",
                        width: 180,
                    },
                ],
                datas: [],
            },
            timer: new Timeout("batteryrTimequery"),
            // 第一次查询
            isFirstQuery: false,
        };
    },
    mounted() {
        // 根据告警类型勾选筛选条件
        let alarmType = this.$route.query.alarmType;
        if (alarmType) {
            Object.keys(this.checkbox).forEach((key) => {
                let item = this.checkbox[key];
                if (item.value1 == alarmType) {
                    item.bol = true;
                } else {
                    if (Number(item.value1) > 1000) {
                        item.bol = false;
                    }
                }
            });
        }
  data() {
    let permits = this.$store.state.user.permits;
    let isCanConfirm = isHasPermit("batt_alm_confirm_permit", permits);
    let isCanQuit = isHasPermit("batt_alm_clear_permit", permits);
    let isCanDel = isHasPermit("batt_alm_delete_permit", permits);
    return {
      skinActive: "science-blue",
      eleOffImg: require("../../assets/images/eleOff.png"),
      eleOnImg: require("../../assets/images/eleOn.png"),
      isCanConfirm: isCanConfirm,
      isCanQuit: isCanQuit,
      isCanDel: isCanDel,
      // 当前tab
      acTabs: "unconfirmed",
      queryInfo1: {
        query: "" /* 查询 */,
        pagenum: 1 /* 当前页码 绑定queryInfo.pagenum */,
        pagesize: 10 /* 每页显示的数据 绑定queryInfo.pagesize */,
      },
      queryInfo2: {
        query: "" /* 查询 */,
        pagenum: 1 /* 当前页码 绑定queryInfo.pagenum */,
        pagesize: 10 /* 每页显示的数据 绑定queryInfo.pagesize */,
      },
      total1: 0 /* 总共有多少条 */,
      total2: 0 /* 总共有多少条 */,
      /* 维护区 */
      vindicate: [],
      /* 机房站点 */
      newRoms: [],
      /* 蓄电池租 */
      options: [],
      checkbox: {
        /* 在线电压 */
        usr_id: {
          bol: true,
          value1: 119001,
          value2: 0,
        },
        /* 组端电压 */
        fault_type_id: {
          bol: true,
          value1: 119002,
          value2: 0,
        },
        /* 漏液电压 */
        uname: {
          bol: true,
          value1: 119012,
          value2: 0,
        },
        fault_level: {
          bol: true,
          value1: 119003,
          value2: 0,
        } /* 充电电流 */,
        record_uid: {
          bol: true,
          value1: 119004,
          value2: 0,
        } /* 放电电流 */,
        Level_one_warn: {
          bol: true,
          value1: 1,
          value2: 0,
        } /*一级警告 */,
        Level_two_warn: {
          bol: true,
          value1: 2,
          value2: 0,
        } /* 二级警告 */,
        alm_id: {
          bol: true,
          value1: 1,
          value2: 100,
        } /* 上限告警 */,
        maint_type_id: {
          bol: true,
          value1: 119005,
          value2: 0,
        } /* 单体电压 */,
        maint_close: {
          bol: true,
          value1: 119007,
          value2: 0,
        } /* 单体内阻 */,
        maint_done: {
          bol: true,
          value1: 119006,
          value2: 0,
        } /* 单体温度 */,
        master_audit: {
          bol: true,
          value1: 3,
          value2: 0,
        } /*  三级告警 */,
        appoint_uid: {
          bol: true,
          value1: 4,
          value2: 0,
        } /* 四级告警 */,
        alm_signal_id: {
          bol: true,
          value1: 0,
          value2: 100,
        } /* 下限告警 */,
      },
      selectValue1: "",
      selectPlace1: "",
      selectValue2: "",
      selectPlace2: "",
      selectValue3: 0,
      selectPlace3: "",
      /* 表单 */
      table1: {
        headers: [
          {
            prop: "stationName",
            label: "机房名称",
            minWidth: 220,
          },
          {
            prop: "battGroupName",
            label: "电池组名称",
            width: 120,
          },
          {
            prop: "alarmName",
            label: "告警名称",
            width: 162,
          },
          {
            prop: "monNum",
            label: "单体编号",
            width: 80,
          },
          {
            prop: "almValue",
            label: "告警值",
            width: 80,
          },
          {
            prop: "almLevel",
            label: "告警等级",
            width: 120,
          },
          {
            prop: "almStartTime",
            label: "告警开始时间",
            width: 180,
          },
          {
            prop: "almConfirmedTime",
            label: "确认告警时间",
            width: 180,
          },
        ],
        datas: [],
      },
      table2: {
        headers: [
          {
            prop: "stationName",
            label: "机房名称",
            minWidth: 220,
          },
          {
            prop: "battGroupName",
            label: "电池组名称",
            width: 120,
          },
          {
            prop: "alarmName",
            label: "告警名称",
            width: 162,
          },
          {
            prop: "monNum",
            label: "单体编号",
            width: 80,
          },
          {
            prop: "almValue",
            label: "告警值",
            width: 80,
          },
          {
            prop: "almLevel",
            label: "告警等级",
            width: 120,
          },
          {
            prop: "almStartTime",
            label: "告警开始时间",
            width: 180,
          },
          {
            prop: "almConfirmedTime",
            label: "确认告警时间",
            width: 180,
          },
        ],
        datas: [],
      },
      timer: new Timeout("batteryrTimequery"),
      // 第一次查询
      isFirstQuery: false,
    };
  },
  mounted() {
    // 根据告警类型勾选筛选条件
    let alarmType = this.$route.query.alarmType;
    if (alarmType) {
      Object.keys(this.checkbox).forEach((key) => {
        let item = this.checkbox[key];
        if (item.value1 == alarmType) {
          item.bol = true;
        } else {
          if (Number(item.value1) > 1000) {
            item.bol = false;
          }
        }
      });
    }
        this.vindicateData(); /* 维护区 */
        this.computerSite(); /*机房站点 */
        this.storageBatterys(); /* 蓄电池组 */
        // this.sendMessage(); /* 告警信息 */
        // this.startTimer(); /* 定时请求 */
    },
    methods: {
        tabClick(tab) {
            this.acTabs = tab.name;
      if (tab.name == 'unconfirmed') {
    this.vindicateData(); /* 维护区 */
    this.computerSite(); /*机房站点 */
    this.storageBatterys(); /* 蓄电池组 */
    // this.sendMessage(); /* 告警信息 */
    // this.startTimer(); /* 定时请求 */
  },
  methods: {
    tabClick(tab) {
      this.acTabs = tab.name;
      if (tab.name == "unconfirmed") {
        this.handleCurrentChange1(1);
      } else {
        this.handleCurrentChange2(1);
      }
        },
        // 导出表格
        exportFile1() {
            let tHeader = [];
            let filterVal = [];
            this.table1.headers.map((item, index) => {
                tHeader.push(item.label);
                filterVal.push(item.prop);
            });
            tHeader.push("确认告警");
            filterVal.push("almIsConfirmed1");
            let list = this.table1.datas;
            let excelData = formatJson(filterVal, list);
            export_json_to_excel(tHeader, excelData, "电池告警实时数据-未确认");
        },
        // 导出表格
        exportFile2() {
            let tHeader = [];
            let filterVal = [];
            this.table2.headers.map((item, index) => {
                tHeader.push(item.label);
                filterVal.push(item.prop);
            });
            tHeader.push("确认告警");
            filterVal.push("almIsConfirmed1");
            let list = this.table2.datas;
            let excelData = formatJson(filterVal, list);
            export_json_to_excel(tHeader, excelData, "电池告警实时数据-已确认");
        },
        /* 维护区 */
        async vindicateData() {
            const resType = await searchProvince();
            let res = resType.data;
            // console.log(res, 'res====');
            if (res.code) {
                let typeList = res.data.map((item) => {
                    return {
                        label: item,
                        value: item,
                    };
                });
                let len = res.data.length;
                typeList.unshift({
                    label: `全部(共${len}种)`,
                    value: "",
                });
                this.vindicate = typeList;
                this.selectPlace1 = `全部(共${len}种)`;
            }
        },
        /* 机房站点 */
        async computerSite() {
            const roomsSeation = await roomsStation({
                stationName1: this.selectValue1,
            });
            let res = roomsSeation.data;
            if (res.code) {
                // console.log(res.data, "===data", this.selectValue1);
                let newRoms = res.data.map((item) => {
                    return {
                        label: item,
                        value: item,
                    };
                });
                let len = res.data.length;
                newRoms.unshift({
                    label: `全部(共${len}种)`,
                    value: "",
                });
                this.newRoms = newRoms;
                this.selectPlace2 = `全部(共${len}种)`;
            }
        },
        /* 蓄电池组 */
        async storageBatterys() {
            // 初始化值
            this.selectValue3 = 0;
            // 构造查询条件
            const batteryss = await batterySearch({
                stationName1: this.selectValue1,
                stationName: this.selectValue2,
            });
            let res = batteryss.data;
            if (res.code) {
                let options = res.data.map((item) => {
                    item.BattGroupName = `${item.battGroupName}-${item.monCount}节`;
                    return item;
                });
                this.options = options;
                this.selectPlace3 = `全部(共${options.length}种)`;
            }
            // 查询告警信息
            this.sendMessage();
        },
        /* 告警信息 */
        paramsAlram(data) {
            this.paramsAlram1(data.unconfirmedAlarms);
            this.paramsAlram2(data.confirmedAlarms);
        },
        formatParams() {
            let params = {};
            Object.keys(this.checkbox).forEach((item, index) => {
                if (this.checkbox[item].bol) {
                    params[item] = this.checkbox[item].value1;
                } else {
                    params[item] = this.checkbox[item].value2;
                }
            });
            let param = {
                almIdOne: params.usr_id,
                almIdTwo: params.fault_type_id,
                almIdThree: params.uname,
                almIdFour: params.fault_level,
                almIdFive: params.record_uid,
                almIdSix: params.maint_type_id,
                almIdSeven: params.maint_close,
                almIdEight: params.maint_done,
                almIsConfirmed: 0,
                almLevelFour: params.appoint_uid,
                almLevelOne: params.Level_one_warn,
                almLevelThree: params.master_audit,
                almLevelTwo: params.Level_two_warn,
                almSignalIdOne: params.alm_id,
                almSignalIdTwo: params.alm_signal_id,
                battGroupId: this.selectValue3 ? this.selectValue3 : 0,
                page: {
                    pageCurr: this.acTabs == "unconfirmed" ? this.queryInfo1.pagenum : this.queryInfo2.pagenum,
                    pageSize: this.acTabs == "unconfirmed" ? this.queryInfo1.pagesize : this.queryInfo2.pagesize,
                },
                stationname: this.selectValue2,
                stationname1: this.selectValue1,
        uId: sessionStorage.getItem('userId')
            };
            return param;
        },
        /* 告警信息未确认 */
        paramsAlram1(res) {
            let loading;
            if (this.isFirstQuery) {
                loading = this.$layer.loading(1);
            }
            this.isFirstQuery = false;
            loading && this.$layer.close(loading); // 关闭等待框
            if (res.code) {
                let data = res.data;
                this.total1 = data.total;
                let list = [];
                data.list.forEach((v) => {
                    let stationName = v.stationName;
                    let battGroupName = v.battGroupName;
                    let battGroupId = v.battGroupId;
                    v.adatas.forEach((item) => {
                        list.push({
                            stationName,
                            battGroupName,
                            battGroupId,
                            num: item.num,
                            alarmName: item.almSignalIdName,
                            monNum: item.monNum,
                            almValue: item.almValue,
                            almLevel: item.almLevelName,
                            almStartTime: item.almStartTime,
                            almConfirmedTime: "",
                            almIsConfirmed: false,
                            almIsConfirmed1: "否",
                        });
                    });
                });
                this.table1.datas = list;
            }
            // console.log("newsAlaa", newsAlaa);
        },
        /* 告警信息已确认 */
        paramsAlram2(res) {
            let loading;
            if (this.isFirstQuery) {
                loading = this.$layer.loading(1);
            }
            this.isFirstQuery = false;
            loading && this.$layer.close(loading); // 关闭等待框
            if (res.code) {
                let data = res.data;
                this.total2 = data.total;
                let list = [];
                data.list.forEach((v) => {
                    let stationName = v.stationName;
                    let battGroupName = v.battGroupName;
                    let battGroupId = v.battGroupId;
                    v.adatas.forEach((item) => {
                        list.push({
                            stationName,
                            battGroupName,
                            battGroupId,
                            num: item.num,
                            // TODO
                            alarmName: item.almSignalIdName,
                            monNum: item.monNum,
                            almValue: item.almValue,
                            almLevel: item.almLevelName,
                            almStartTime: item.almStartTime,
                            almConfirmedTime: item.almConfirmedTime,
                            almIsConfirmed: true,
                            almIsConfirmed1: "是",
                        });
                    });
                });
                this.table2.datas = list;
            }
        },
        /* 删除 */
        async delteTim(val, idx) {
            const confirmResult = await this.$confirm(
                "此操作将永久删除该文件, 是否继续?",
                "提示",
                {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                }
            ).catch((err) => err);
            if (confirmResult !== "confirm") {
                return;
            }
            const del = await deletionRecord({ num: val.num });
            let res = del.data;
            if (res.code) {
                this.$message.success("删除成功");
                if (idx) {
                    if (this.queryInfo2.pagenum != 1 && this.table2.datas.length == 1) {
                        this.queryInfo2.pagenum--;
                    }
                } else {
                    if (this.queryInfo1.pagenum != 1 && this.table1.datas.length == 1) {
                        this.queryInfo1.pagenum--;
                    }
                }
                /* 重新获取用户列表数据*/
                this.sendMessage();
            } else {
                this.$message.error("删除失败");
            }
        },
        /*确认告警 */
        async okAlarm(vlas) {
            const confirmResult = await this.$confirm(
                "确定这条告警记录, 是否继续?",
                "提示",
                {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                }
            ).catch((err) => err);
            if (confirmResult !== "confirm") {
                return;
            }
            // console.log(vlas, 'vlas======');
            const wk = await reporTemergency({ num: vlas.num });
            // console.log('wk=====',wk);
            let res = wk.data;
            if (res.code) {
                this.sendMessage();
                this.$message.success("确认成功");
            } else {
                this.$message.error("确认失败");
            }
        },
        /* 取消告警 */
        async deleteUser(vla) {
            const confirmResult = await this.$confirm(
                "确定取消这条告警记录吗, 是否继续?",
                "提示",
                {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning",
                }
            ).catch((err) => err);
            if (confirmResult !== "confirm") {
                return;
            }
            const wkk = await CancelTheAlarm({
                num: vla.num,
            });
            let res = wkk.data;
            if (res.code) {
                this.sendMessage();
                this.$message.success("操作成功");
            } else {
                this.$message.error("操作失败");
            }
        },
        //selectValue1改变事件
        changeSelect1() {
            this.selectValue2 = "";
            this.selectValue3 = 0;
            this.computerSite(); /*机房站点 */
            this.storageBatterys(); /* 蓄电池组 */
        },
        handleSizeChange1(newSize) {
            this.queryInfo1.pagesize = newSize;
            /*console.log(`每页 ${val} 条`); */
            this.sendMessage();
        },
        handleCurrentChange1(newPage) {
            this.queryInfo1.pagenum = newPage;
            /*console.log(`当前页: ${val}`); */
            this.sendMessage();
        },
        handleSizeChange2(newSize) {
            this.queryInfo2.pagesize = newSize;
            /*console.log(`每页 ${val} 条`); */
            this.sendMessage();
        },
        handleCurrentChange2(newPage) {
            this.queryInfo2.pagenum = newPage;
            /*console.log(`当前页: ${val}`); */
            this.sendMessage();
        },
    },
    // 导出表格
    exportFile1() {
      let tHeader = [];
      let filterVal = [];
      this.table1.headers.map((item, index) => {
        tHeader.push(item.label);
        filterVal.push(item.prop);
      });
      tHeader.push("确认告警");
      filterVal.push("almIsConfirmed1");
      let list = this.table1.datas;
      let excelData = formatJson(filterVal, list);
      export_json_to_excel(tHeader, excelData, "电池告警实时数据-未确认");
    },
    // 导出表格
    exportFile2() {
      let tHeader = [];
      let filterVal = [];
      this.table2.headers.map((item, index) => {
        tHeader.push(item.label);
        filterVal.push(item.prop);
      });
      tHeader.push("确认告警");
      filterVal.push("almIsConfirmed1");
      let list = this.table2.datas;
      let excelData = formatJson(filterVal, list);
      export_json_to_excel(tHeader, excelData, "电池告警实时数据-已确认");
    },
    /* 维护区 */
    async vindicateData() {
      const resType = await searchProvince();
      let res = resType.data;
      // console.log(res, 'res====');
      if (res.code) {
        let typeList = res.data.map((item) => {
          return {
            label: item,
            value: item,
          };
        });
        let len = res.data.length;
        typeList.unshift({
          label: `全部(共${len}种)`,
          value: "",
        });
        this.vindicate = typeList;
        this.selectPlace1 = `全部(共${len}种)`;
      }
    },
    /* 机房站点 */
    async computerSite() {
      const roomsSeation = await roomsStation({
        stationName1: this.selectValue1,
      });
      let res = roomsSeation.data;
      if (res.code) {
        // console.log(res.data, "===data", this.selectValue1);
        let newRoms = res.data.map((item) => {
          return {
            label: item,
            value: item,
          };
        });
        let len = res.data.length;
        newRoms.unshift({
          label: `全部(共${len}种)`,
          value: "",
        });
        this.newRoms = newRoms;
        this.selectPlace2 = `全部(共${len}种)`;
      }
    },
    /* 蓄电池组 */
    async storageBatterys() {
      // 初始化值
      this.selectValue3 = 0;
      // 构造查询条件
      const batteryss = await batterySearch({
        stationName1: this.selectValue1,
        stationName: this.selectValue2,
      });
      let res = batteryss.data;
      if (res.code) {
        let options = res.data.map((item) => {
          item.BattGroupName = `${item.battGroupName}-${item.monCount}节`;
          return item;
        });
        this.options = options;
        this.selectPlace3 = `全部(共${options.length}种)`;
      }
      // 查询告警信息
      this.sendMessage();
    },
    /* 告警信息 */
    paramsAlram(data) {
      this.paramsAlram1(data.unconfirmedAlarms);
      this.paramsAlram2(data.confirmedAlarms);
    },
    formatParams() {
      let params = {};
      Object.keys(this.checkbox).forEach((item, index) => {
        if (this.checkbox[item].bol) {
          params[item] = this.checkbox[item].value1;
        } else {
          params[item] = this.checkbox[item].value2;
        }
      });
      let param = {
        almIdOne: params.usr_id,
        almIdTwo: params.fault_type_id,
        almIdThree: params.uname,
        almIdFour: params.fault_level,
        almIdFive: params.record_uid,
        almIdSix: params.maint_type_id,
        almIdSeven: params.maint_close,
        almIdEight: params.maint_done,
        almIsConfirmed: 0,
        almLevelFour: params.appoint_uid,
        almLevelOne: params.Level_one_warn,
        almLevelThree: params.master_audit,
        almLevelTwo: params.Level_two_warn,
        almSignalIdOne: params.alm_id,
        almSignalIdTwo: params.alm_signal_id,
        battGroupId: this.selectValue3 ? this.selectValue3 : 0,
        page: {
          pageCurr:
            this.acTabs == "unconfirmed"
              ? this.queryInfo1.pagenum
              : this.queryInfo2.pagenum,
          pageSize:
            this.acTabs == "unconfirmed"
              ? this.queryInfo1.pagesize
              : this.queryInfo2.pagesize,
        },
        stationname: this.selectValue2,
        stationname1: this.selectValue1,
        uId: sessionStorage.getItem("userId"),
      };
      return param;
    },
    /* 告警信息未确认 */
    paramsAlram1(res) {
      let loading;
      if (this.isFirstQuery) {
        loading = this.$layer.loading(1);
      }
      this.isFirstQuery = false;
      loading && this.$layer.close(loading); // 关闭等待框
      if (res.code) {
        let data = res.data;
        this.total1 = data.total;
        let list = [];
        data.list.forEach((v) => {
          let stationName = v.stationName;
          let battGroupName = v.battGroupName;
          let battGroupId = v.battGroupId;
          v.adatas.forEach((item) => {
            list.push({
              stationName,
              battGroupName,
              battGroupId,
              num: item.num,
              alarmName: item.almSignalIdName,
              monNum: item.monNum,
              almValue: item.almValue,
              almLevel: item.almLevelName,
              almStartTime: item.almStartTime,
              almConfirmedTime: "",
              almIsConfirmed: false,
              almIsConfirmed1: "否",
            });
          });
        });
        this.table1.datas = list;
      }
      // console.log("newsAlaa", newsAlaa);
    },
    /* 告警信息已确认 */
    paramsAlram2(res) {
      let loading;
      if (this.isFirstQuery) {
        loading = this.$layer.loading(1);
      }
      this.isFirstQuery = false;
      loading && this.$layer.close(loading); // 关闭等待框
      if (res.code) {
        let data = res.data;
        this.total2 = data.total;
        let list = [];
        data.list.forEach((v) => {
          let stationName = v.stationName;
          let battGroupName = v.battGroupName;
          let battGroupId = v.battGroupId;
          v.adatas.forEach((item) => {
            list.push({
              stationName,
              battGroupName,
              battGroupId,
              num: item.num,
              // TODO
              alarmName: item.almSignalIdName,
              monNum: item.monNum,
              almValue: item.almValue,
              almLevel: item.almLevelName,
              almStartTime: item.almStartTime,
              almConfirmedTime: item.almConfirmedTime,
              almIsConfirmed: true,
              almIsConfirmed1: "是",
            });
          });
        });
        this.table2.datas = list;
      }
    },
    /* 删除 */
    async delteTim(val, idx) {
      const confirmResult = await this.$confirm(
        "此操作将永久删除该文件, 是否继续?",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      ).catch((err) => err);
      if (confirmResult !== "confirm") {
        return;
      }
      const del = await deletionRecord({ num: val.num });
      let res = del.data;
      if (res.code) {
        this.$message.success("删除成功");
        if (idx) {
          if (this.queryInfo2.pagenum != 1 && this.table2.datas.length == 1) {
            this.queryInfo2.pagenum--;
          }
        } else {
          if (this.queryInfo1.pagenum != 1 && this.table1.datas.length == 1) {
            this.queryInfo1.pagenum--;
          }
        }
        /* 重新获取用户列表数据*/
        this.sendMessage();
      } else {
        this.$message.error("删除失败");
      }
    },
    /*确认告警 */
    async okAlarm(vlas) {
      const confirmResult = await this.$confirm(
        "确定这条告警记录, 是否继续?",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      ).catch((err) => err);
      if (confirmResult !== "confirm") {
        return;
      }
      // console.log(vlas, 'vlas======');
      const wk = await reporTemergency({ num: vlas.num });
      // console.log('wk=====',wk);
      let res = wk.data;
      if (res.code) {
        this.sendMessage();
        this.$message.success("确认成功");
      } else {
        this.$message.error("确认失败");
      }
    },
    /* 取消告警 */
    async deleteUser(vla) {
      const confirmResult = await this.$confirm(
        "确定取消这条告警记录吗, 是否继续?",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      ).catch((err) => err);
      if (confirmResult !== "confirm") {
        return;
      }
      const wkk = await CancelTheAlarm({
        num: vla.num,
      });
      let res = wkk.data;
      if (res.code) {
        this.sendMessage();
        this.$message.success("操作成功");
      } else {
        this.$message.error("操作失败");
      }
    },
    //selectValue1改变事件
    changeSelect1() {
      this.selectValue2 = "";
      this.selectValue3 = 0;
      this.computerSite(); /*机房站点 */
      this.storageBatterys(); /* 蓄电池组 */
    },
    handleSizeChange1(newSize) {
      this.queryInfo1.pagesize = newSize;
      /*console.log(`每页 ${val} 条`); */
      this.sendMessage();
    },
    handleCurrentChange1(newPage) {
      this.queryInfo1.pagenum = newPage;
      /*console.log(`当前页: ${val}`); */
      this.sendMessage();
    },
    handleSizeChange2(newSize) {
      this.queryInfo2.pagesize = newSize;
      /*console.log(`每页 ${val} 条`); */
      this.sendMessage();
    },
    handleCurrentChange2(newPage) {
      this.queryInfo2.pagenum = newPage;
      /*console.log(`当前页: ${val}`); */
      this.sendMessage();
    },
    onWSOpen() {
      this.sendMessage();
    },
@@ -790,70 +1014,70 @@
      console.log(data, "=====data");
      this.paramsAlram(data);
    },
        // startTimer() {
        //     this.timer.start(() => {
        //         this.$axios
        //             .all([this.paramsAlram()])
        //             .then(() => {
        //                 this.timer.open();
        //             })
        //             .catch(() => {
        //                 this.timer.open();
        //             });
        //     }, 1000);
        // },
        changeSkin() {
            this.$nextTick(() => {
                if (this.skinActive == "science-black") {
                    this.eleOffImg = require("../../assets/images/eleOff-black.png");
                    this.eleOnImg = require("../../assets/images/eleOn-black.png");
                } else if (this.skinActive == "science-green") {
                    this.eleOffImg = require("../../assets/images/eleOff-black.png");
                    this.eleOnImg = require("../../assets/images/eleOn-black.png");
                } else if (this.skinActive == "science-blue") {
                    this.eleOffImg = require("../../assets/images/eleOff.png");
                    this.eleOnImg = require("../../assets/images/eleOn.png");
                }
            });
        },
    },
    created() {
        if (this.$route.query.fromType == "fromIndex") {
            this.selectValue1 = this.$route.query.province;
            this.selectValue2 =
                this.$route.query.province +
                "-" +
                this.$route.query.city +
                "-" +
                this.$route.query.county +
                "-" +
                this.$route.query.home;
            this.storageBatterys();
        }
        this.skinActive = localStorage.getItem("activeSkin");
        this.changeSkin();
    },
    watch: {
        $route() {
            if (this.$route.query.fromType == "fromIndex") {
                this.selectValue1 = this.$route.query.province;
                this.selectValue2 =
                    this.$route.query.province +
                    "-" +
                    this.$route.query.city +
                    "-" +
                    this.$route.query.county +
                    "-" +
                    this.$route.query.home;
                this.storageBatterys();
                this.sendMessage();
            }
        },
        "$store.state.theme.activeSkin"(val) {
            this.skinActive = localStorage.getItem("activeSkin");
            this.changeSkin();
        },
    },
    // startTimer() {
    //     this.timer.start(() => {
    //         this.$axios
    //             .all([this.paramsAlram()])
    //             .then(() => {
    //                 this.timer.open();
    //             })
    //             .catch(() => {
    //                 this.timer.open();
    //             });
    //     }, 1000);
    // },
    changeSkin() {
      this.$nextTick(() => {
        if (this.skinActive == "science-black") {
          this.eleOffImg = require("../../assets/images/eleOff-black.png");
          this.eleOnImg = require("../../assets/images/eleOn-black.png");
        } else if (this.skinActive == "science-green") {
          this.eleOffImg = require("../../assets/images/eleOff-black.png");
          this.eleOnImg = require("../../assets/images/eleOn-black.png");
        } else if (this.skinActive == "science-blue") {
          this.eleOffImg = require("../../assets/images/eleOff.png");
          this.eleOnImg = require("../../assets/images/eleOn.png");
        }
      });
    },
  },
  created() {
    if (this.$route.query.fromType == "fromIndex") {
      this.selectValue1 = this.$route.query.province;
      this.selectValue2 =
        this.$route.query.province +
        "-" +
        this.$route.query.city +
        "-" +
        this.$route.query.county +
        "-" +
        this.$route.query.home;
      this.storageBatterys();
    }
    this.skinActive = localStorage.getItem("activeSkin");
    this.changeSkin();
  },
  watch: {
    $route() {
      if (this.$route.query.fromType == "fromIndex") {
        this.selectValue1 = this.$route.query.province;
        this.selectValue2 =
          this.$route.query.province +
          "-" +
          this.$route.query.city +
          "-" +
          this.$route.query.county +
          "-" +
          this.$route.query.home;
        this.storageBatterys();
        this.sendMessage();
      }
    },
    "$store.state.theme.activeSkin"(val) {
      this.skinActive = localStorage.getItem("activeSkin");
      this.changeSkin();
    },
  },
};
</script>
src/views/alarmMager/deviceHistoryquery.vue
@@ -67,6 +67,7 @@
        :data="table.datas"
        height="100%"
        class="tableCent"
        tooltip-effect="light"
      >
        <el-table-column type="index" label="编号" width="50">
        </el-table-column>
@@ -77,6 +78,7 @@
          :label="header.label"
          :min-width="header.width"
          align="center"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <div>
src/views/alarmMager/deviceTimequery.vue
@@ -67,7 +67,13 @@
        <flex-layout>
          <!-- 表单 -->
          <div class="flex-page-content">
            <el-table stripe size="small" :data="table1.datas" height="100%">
            <el-table
              stripe
              size="small"
              tooltip-effect="light"
              :data="table1.datas"
              height="100%"
            >
              <el-table-column type="index" label="编号" width="50">
              </el-table-column>
              <el-table-column
@@ -78,6 +84,7 @@
                :width="header.width"
                :min-width="header.minWidth"
                align="center"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column label="确认告警" width="80px" align="center">
@@ -159,7 +166,13 @@
        <flex-layout>
          <!-- 表单 -->
          <div class="flex-page-content">
            <el-table stripe size="small" :data="table2.datas" height="100%">
            <el-table
              stripe
              size="small"
              :data="table2.datas"
              tooltip-effect="light"
              height="100%"
            >
              <el-table-column
                type="index"
                label="编号"
@@ -173,6 +186,7 @@
                :width="header.width"
                :min-width="header.minWidth"
                align="center"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column label="确认告警" width="80px" align="center">
@@ -271,7 +285,7 @@
import createWs from "@/assets/js/websocket";
const WSMixin = createWs("devAlarmData");
export default {
  name: 'deviceTimequery',
  name: "deviceTimequery",
  mixins: [WSMixin],
  data() {
    let permits = this.$store.state.user.permits;
@@ -416,7 +430,7 @@
  methods: {
    tabClick(tab) {
      this.acTabs = tab.name;
      if (tab.name == 'unconfirmed') {
      if (tab.name == "unconfirmed") {
        this.handleCurrentChange1(1);
      } else {
        this.handleCurrentChange2(1);
@@ -566,10 +580,16 @@
        almType: this.value,
        almIsConfirmed: 0,
        page: {
          pageSize: this.acTabs == "unconfirmed" ? this.queryInfo1.pagesize : this.queryInfo2.pagesize,
          pageCurr: this.acTabs == "unconfirmed" ? this.queryInfo1.currentPage : this.queryInfo2.currentPage,
          pageSize:
            this.acTabs == "unconfirmed"
              ? this.queryInfo1.pagesize
              : this.queryInfo2.pagesize,
          pageCurr:
            this.acTabs == "unconfirmed"
              ? this.queryInfo1.currentPage
              : this.queryInfo2.currentPage,
        },
        uId: sessionStorage.getItem('userId')
        uId: sessionStorage.getItem("userId"),
      };
      console.log("====", params, JSON.stringify(params));
      this.SOCKET.send(JSON.stringify(params));
@@ -685,7 +705,7 @@
      this.queryInfo2.currentPage = val2;
      this.sendMessage();
    },
  }
  },
};
</script>
src/views/alarmMager/powerAlarmTimeout.vue
@@ -47,6 +47,7 @@
            size="mini"
            header-row-class-name="header-primary"
            height="100%"
            tooltip-effect="light"
            :data="table2.datas"
          >
            <el-table-column
@@ -62,6 +63,7 @@
              min-width="320"
              :resizable="false"
              align="center"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              prop="alarmTypeid"
@@ -210,7 +212,7 @@
      this.sendMessage1();
    },
    sendMessage1() {
      let params = sessionStorage.getItem('userId') * 1;
      let params = sessionStorage.getItem("userId") * 1;
      console.log("====", params, JSON.stringify(params));
      this.SOCKET1.send(JSON.stringify(params));
    },
src/views/alarmMager/powerBoxAlarm.vue
@@ -140,6 +140,7 @@
        :data="table.datas"
        height="100%"
        class="tableCent"
        tooltip-effect="light"
      >
        <el-table-column label="编号" type="index" align="center" :width="50">
        </el-table-column>
@@ -151,6 +152,7 @@
          :width="header.width"
          :min-width="header.minWidth"
          align="center"
          show-overflow-tooltip
        ></el-table-column>
        <el-table-column label="确认告警" align="center" :width="80">
          <template slot-scope="scope">
src/views/alarmMager/powerBoxHistoryAlarm.vue
@@ -153,6 +153,7 @@
        height="100%"
        @selection-change="selectEvet"
        class="tableCent"
        tooltip-effect="light"
      >
        <el-table-column
          type="selection"
@@ -168,6 +169,7 @@
          :label="header.label"
          :width="header.width"
          :min-width="header.minWidth"
          show-overflow-tooltip
          align="center"
        >
        </el-table-column>
src/views/dataMager/components/AddBattGroup.vue
@@ -234,7 +234,7 @@
        <!--                </el-col>-->
        <el-col :span="layout.span">
          <el-form-item label="负载电流(A)" prop="loadCurr">
            <el-input v-model="params.Load_curr"></el-input>
            <el-input v-model="params.loadCurr"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="layout.span">