whychdw
2020-10-30 2568ec0ad2cd23aecb4813f4d12e3f073345107b
添加权限
15个文件已修改
947 ■■■■ 已修改文件
src/assets/css/theme/science-blue.css 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PageMenu.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/battGroupMager/AddBattGroup.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/battGroupMager/EditBattGroup.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/indexPanel/AddPanel.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/batteryrHistoryquery.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/batteryrTimequery.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/deviceHistoryquery.vue 838 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/deviceTimequery.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/devicepaSetting.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataMager/battGroupMager.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataMager/threadMager.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/history.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/realTime.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/userMager/addEdit.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/theme/science-blue.css
@@ -281,6 +281,18 @@
.el-science-blue .el-input__inner::-webkit-input-placeholder {
    color: #FFE329;
}
/* bg white */
.el-science-blue .el-select:hover .el-input__inner,
.el-science-blue .bg-white .el-select .el-input.is-focus .el-input__inner {
    border-color: #409EFF;
}
.el-science-blue .bg-white .el-select .el-input .el-select__caret {
    color: #c0c4cc;
}
.el-science-blue .bg-white .el-input__inner::-webkit-input-placeholder {
    color: #c0c4cc;
}
/* table */
.el-science-blue .el-table {
src/components/PageMenu.vue
@@ -167,24 +167,28 @@
                            label: "电池告警实时查询",
                            name: "batteryrTimequery",
                            src: "#/batteryrTimequery",
                            permitName: 'batt_alm_query_permit',
                            closable: true
                        },
                        {
                            label: "电池告警历史查询",
                            name: "batteryrHistoryquery",
                            src: "#/batteryrHistoryquery",
                            permitName: "batt_alm_query_permit",
                            closable: true
                        },
                        {
                            label: "设备告警实时查询",
                            name: "deviceTimequery",
                            src: "#/deviceTimequery",
                            permitName: "dev_alm_query_permit",
                            closable: true
                        },
                        {
                            label: "设备告警历史查询",
                            name: "deviceHistoryquery",
                            src: "#/deviceHistoryquery",
                            permitName: "dev_alm_query_permit",
                            closable: true
                        },
                        // {
@@ -197,6 +201,7 @@
                            label: "电池告警参数设置",
                            name: "devicepaSetting",
                            src: "#/devicepaSetting",
                            permitName: "batt_alm_param_query_permit",
                            closable: true
                        }
                    ]
src/components/battGroupMager/AddBattGroup.vue
@@ -6,7 +6,7 @@
        label-position="top" 
        :model="params"
        :rules="rules" 
        class="params-dialog">
        class="params-dialog bg-white">
            <div class="table-layout">
                <div class="table-row">
                    <div class="table-cell pr16">
src/components/battGroupMager/EditBattGroup.vue
@@ -6,7 +6,7 @@
        label-position="top" 
        :model="params"
        :rules="rules" 
        class="params-dialog">
        class="params-dialog bg-white">
            <div class="table-layout">
                <div class="table-row">
                    <div class="table-cell pr16">
src/components/indexPanel/AddPanel.vue
@@ -6,7 +6,7 @@
        label-position="top"
        :model="params"
        :rules="rules"
        class="params-dialog">
        class="params-dialog bg-white">
            <el-form-item label="机房名称" prop="StationName">
                <el-select
                v-model="homeName"
@@ -153,4 +153,7 @@
.table-layout {
    margin-top: 16px;
}
.bg-white .table-cell {
    color: #000000;
}
</style>
src/pages/alarmMager/batteryrHistoryquery.vue
@@ -105,7 +105,7 @@
                     :width="header.width" align="center"></el-table-column>
                    <el-table-column prop="cztime" fixed="right" width="90px" align="center" label="操作">
                        <template slot-scope="scope">
                            <el-button type="danger" size="mini" @click="deleteUser(scope.row)">删除</el-button>
                            <el-button :disabled="!isCanDel" type="danger" size="mini" @click="deleteUser(scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
@@ -137,14 +137,18 @@
    import {
        export_json_to_excel
    } from '../../assets/js/excel/Export2Excel.js'
    import {isHasPermit} from "@/assets/js/tools";
    export default {
        data() {
            let permits = this.$store.state.user.permits;
            let isCanDel = isHasPermit('batt_alm_delete_permit', permits);
            let thistime = new Date();
            let yy = thistime.getFullYear();
            let MM = thistime.getMonth() + 1;
            let dd = thistime.getDate();
            let day1 = yy + "-" + MM + "-" + dd;
            return {
                isCanDel: isCanDel,
                usr_ids: "119001",
                queryInfo: {
                    pageCurr: 1,
src/pages/alarmMager/batteryrTimequery.vue
@@ -128,9 +128,9 @@
                </el-table-column>
                <el-table-column prop="cztime" fixed="right" width="257px" align="center" label="操作">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" @click="okAlarm(scope.row)">确认告警</el-button>
                        <el-button type="success" size="mini" @click="deleteUser(scope.row)">取消告警</el-button>
                        <el-button type="danger" size="mini" @click="delteTim(scope.row)">删除</el-button>
                        <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)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -160,16 +160,24 @@
        reporTemergency /* 确认告警 */ ,
        CancelTheAlarm /* 取消告警 */
    } from "@/assets/js/alarmAdmian/batteryrTimequery.js";
    import {
        Timeout,
    } from "../../assets/js/tools";
    import {
        isHasPermit,
        Timeout,
    } from "../../assets/js/tools";
    // 引入导出表格
    import {
        export_json_to_excel
    } from '../../assets/js/excel/Export2Excel.js'
    export default {
        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 {
                isCanConfirm: isCanConfirm,
                isCanQuit: isCanQuit,
                isCanDel: isCanDel,
                queryInfo: {
                    query: "" /* 查询 */ ,
                    pagenum: 1 /* 当前页码 绑定queryInfo.pagenum */ ,
src/pages/alarmMager/deviceHistoryquery.vue
@@ -1,433 +1,439 @@
<template>
  <flex-layout>
    <div class="table-layout filter-box-table" slot="header">
      <div class="table-row">
        <div class="table-cell text-right">维护区:</div>
        <div class="table-cell">
          <el-select
            v-model="selectValue1"
            @change="changeSelect1"
            :placeholder="this.selectPlace1"
            class="weihu"
            size="small"
          >
            <el-option
              v-for="item in devss"
              :key="item.value"
              :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"  class="rooms" @change="alramData" size="small">
              <el-option
                  v-for="item in opt"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
        </div>
        <div class="table-cell text-right">操作记录时间段:</div>
        <div class="table-cell">
            <el-date-picker v-model="valueTime1" size="small" class="time_box" :picker-options="pickerOptions0" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"> </el-date-picker>
            至 <el-date-picker v-model="valueTime2" size="small" class="time_box" :picker-options="pickerOptions1" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"> </el-date-picker>
        </div>
      </div>
    </div>
    <!-- 表单 -->
    <div class="flex-page-content">
      <el-table stripe size="small" :data="table.datas" height="100%" 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"
        >
        <template slot-scope="scope">
            <div>
              <div v-if="header.prop == 'alm_type'">
                  <span v-if="scope.row.alm_type == 119020">通信故障</span>
                  <span v-if="scope.row.alm_type == 618501">继电器K1告警</span>
                  <span v-if="scope.row.alm_type == 618502">通讯告警</span>
                  <span v-if="scope.row.alm_type == 618503">设备过温告警</span>
                  <span v-if="scope.row.alm_type == 618504">二极管D1告警</span>
                  <span v-if="scope.row.alm_type == 618505">干接点告警</span>
                  <span v-if="scope.row.alm_type == 618506">异常核容或养护终止告警</span>
                  <span v-if="scope.row.alm_type == 119023">续航不足告警</span>
                  <span v-if="scope.row.alm_type == 119024">基站停电告警</span>
                  <span v-if="scope.row.alm_type == 119025">基站发电告警</span>
                  <span v-if="scope.row.alm_type == 119026">基站掉站告警</span>
                  <span v-if="scope.row.alm_type == 119027">基站开门告警</span>
                  <span v-if="scope.row.alm_type == 119028">设备高温告警</span>
                  <span v-if="scope.row.alm_type == 119032">设备SD卡故障</span>
                  <span v-if="scope.row.alm_type == 119033">采集线告警</span>
              </div>
              <div v-else-if="header.prop == 'alm_level'">
                <span v-if="scope.row.alm_level == 1">一级告警</span>
                <span v-if="scope.row.alm_level == 2">二级告警</span>
                <span v-if="scope.row.alm_level == 3">三级告警</span>
                <span v-if="scope.row.alm_level == 4">四级告警</span>
              </div>
              <div v-else-if="header.prop =='alm_is_confirmed'">
                <input type="checkbox" :checked='scope.row.alm_is_confirmed ===1?true:false' disabled>
              </div>
              <div v-else>
                  {{ scope.row[header.prop] }}
              </div>
    <flex-layout>
        <div class="table-layout filter-box-table" slot="header">
            <div class="table-row">
                <div class="table-cell text-right">维护区:</div>
                <div class="table-cell">
                    <el-select
                        v-model="selectValue1"
                        @change="changeSelect1"
                        :placeholder="this.selectPlace1"
                        class="weihu"
                        size="small"
                    >
                        <el-option
                            v-for="item in devss"
                            :key="item.value"
                            :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" class="rooms" @change="alramData" size="small">
                        <el-option
                            v-for="item in opt"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        ></el-option>
                    </el-select>
                </div>
                <div class="table-cell text-right">操作记录时间段:</div>
                <div class="table-cell">
                    <el-date-picker v-model="valueTime1" size="small" class="time_box" :picker-options="pickerOptions0"
                                    type="date" placeholder="选择日期" value-format="yyyy-MM-dd"></el-date-picker>
                    至
                    <el-date-picker v-model="valueTime2" size="small" class="time_box" :picker-options="pickerOptions1"
                                    type="date" placeholder="选择日期" value-format="yyyy-MM-dd"></el-date-picker>
                </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="cztime" fixed="right" width="80px" align="center" label="操作">
          <template slot-scope="scope">
            <el-button type="danger" size="mini" @click="deleteUser(scope.row)">删除</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" @click="alramData" round size="mini" icon="el-icon-search">查询</el-button>
        <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile">导出</el-button>
      </div>
      <el-pagination
        class="pagess"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="queryInfo.pageCurr"
        :page-sizes="[10, 20,30, 50,100]"
        :page-size="queryInfo.pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
      <!-- <el-button type="primary" round size="mini" icon="el-icon-wallet">全部选中</el-button> -->
    </div>
  </flex-layout>
        </div>
        <!-- 表单 -->
        <div class="flex-page-content">
            <el-table stripe size="small" :data="table.datas" height="100%" 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"
                >
                    <template slot-scope="scope">
                        <div>
                            <div v-if="header.prop == 'alm_type'">
                                <span v-if="scope.row.alm_type == 119020">通信故障</span>
                                <span v-if="scope.row.alm_type == 618501">继电器K1告警</span>
                                <span v-if="scope.row.alm_type == 618502">通讯告警</span>
                                <span v-if="scope.row.alm_type == 618503">设备过温告警</span>
                                <span v-if="scope.row.alm_type == 618504">二极管D1告警</span>
                                <span v-if="scope.row.alm_type == 618505">干接点告警</span>
                                <span v-if="scope.row.alm_type == 618506">异常核容或养护终止告警</span>
                                <span v-if="scope.row.alm_type == 119023">续航不足告警</span>
                                <span v-if="scope.row.alm_type == 119024">基站停电告警</span>
                                <span v-if="scope.row.alm_type == 119025">基站发电告警</span>
                                <span v-if="scope.row.alm_type == 119026">基站掉站告警</span>
                                <span v-if="scope.row.alm_type == 119027">基站开门告警</span>
                                <span v-if="scope.row.alm_type == 119028">设备高温告警</span>
                                <span v-if="scope.row.alm_type == 119032">设备SD卡故障</span>
                                <span v-if="scope.row.alm_type == 119033">采集线告警</span>
                            </div>
                            <div v-else-if="header.prop == 'alm_level'">
                                <span v-if="scope.row.alm_level == 1">一级告警</span>
                                <span v-if="scope.row.alm_level == 2">二级告警</span>
                                <span v-if="scope.row.alm_level == 3">三级告警</span>
                                <span v-if="scope.row.alm_level == 4">四级告警</span>
                            </div>
                            <div v-else-if="header.prop =='alm_is_confirmed'">
                                <input type="checkbox" :checked='scope.row.alm_is_confirmed ===1?true:false' disabled>
                            </div>
                            <div v-else>
                                {{ scope.row[header.prop] }}
                            </div>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="cztime" fixed="right" width="80px" align="center" label="操作">
                    <template slot-scope="scope">
                        <el-button :disabled="!isCanDel" type="danger" size="mini" @click="deleteUser(scope.row)">删除</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" @click="alramData" round size="mini" icon="el-icon-search">查询</el-button>
                <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile">导出</el-button>
            </div>
            <el-pagination
                class="pagess"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="queryInfo.pageCurr"
                :page-sizes="[10, 20,30, 50,100]"
                :page-size="queryInfo.pagesize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
            ></el-pagination>
            <!-- <el-button type="primary" round size="mini" icon="el-icon-wallet">全部选中</el-button> -->
        </div>
    </flex-layout>
</template>
<script>
import {
  deviceArea /* 维护区 */,
  deviserchSeions /* 机房站点 */,
  deviceRecord /* 告警记录 */,
  deviceArarmdel /* 删除*/
    deviceArea /* 维护区 */,
    deviserchSeions /* 机房站点 */,
    deviceRecord /* 告警记录 */,
    deviceArarmdel /* 删除*/
} from "@/assets/js/alarmAdmian/deviceHistoryquery.js";
// 引入导出表格
import {
    export_json_to_excel
    export_json_to_excel
} from '../../assets/js/excel/Export2Excel.js'
export default {
  data() {
    let newTime =  new Date().format('yyyy-MM-dd');
    let oldTime = new Date(new Date(newTime).getTime() - 7*24*3600*1000).format('yyyy-MM-dd');
    return {
      queryInfo: {
        pageCurr: 1,
        pagesize: 10
      },
      total: 0,
      /* 日期 */
      valueTime1: oldTime,
      valueTime2: newTime,
      pickerOptions0: {
          disabledDate: (time) => {
              let vm = this;
              if (vm.valueTime2) {
                  return new Date(time.getTime()) > new Date(vm.valueTime2);
              } else {
                  // return time.getTime() > Date.now();
              }
          }
      },
      pickerOptions1: {
          disabledDate: (time) => {
              return new Date(time.getTime()+24*60*60*1000) < new Date(this.valueTime1);
          }
      },
      /* 维护区 */
      devss: [
        {
          value: null,
          label: null
        }
      ],
      /* 机房站点 */
      opt: [
        {
          value: null,
          label: null
        }
      ],
      selectValue1: "",
      selectPlace1: "",
      selectValue2: "",
      selectPlace2: "",
      /* 表单 */
      table: {
        headers: [
          {
            prop: "room1",
            label: "编号",
            width: "50px"
          },
          {
            prop: "battery1",
            label: "设备ID",
            width: ""
          },
          {
            prop: "tes1",
            label: "设备名",
            width: ""
          },
          {
            prop: "tester1",
            label: "设备IP",
            width: ""
          },
          {
            prop: "sessdion1",
            label: "机房名称",
            width: "270px"
          },
          {
            prop: "alm_type",
            label: "告警事件",
            width: ""
          },
          {
            prop: "alm_level",
            label: "告警等级",
            width: ""
          },
          {
            prop: "alm_is_confirmed",
            label: "告警确认",
            width: ""
          },
          {
            prop: "monomer1",
            label: "告警确认时间",
            width: ""
          },
          {
            prop: "start1",
            label: "告警开始时间",
            width: ""
          },
          {
            prop: "end1",
            label: "告警结束时间",
            width: ""
          }
        ],
        datas: []
      }
    };
  },
  mounted() {
    this.deviceList(); /* 维护区 */
    this.sesston(); /* 机房站点 */
    this.alramData(); /* 告警记录 */
  },
  methods: {
    // 导出表格
    exportFile() {
        let tHeader = [];
        let filterVal = ['rooms1','batterys1','tesa1','dev1','tester1','alm_name','alm_level_name','monomers1','starts1'];
        this.table.headers.map((item, index) => {
            tHeader.push(item.label)
        })
        let list = this.table.datas;
        if (list.length > 0) {
            list.map((item, index) => {
                if (item.alm_type == 119020) {
                    item.alm_name = '通信故障'
                }else if(item.alm_type == 618501){
                    item.alm_name = '继电器K1告警'
                }else if(item.alm_type == 618502){
                    item.alm_name = '通讯告警'
                }else if(item.alm_type == 618503){
                    item.alm_name = '设备过温告警'
                }else if(item.alm_type == 618504){
                    item.alm_name = '二极管D1告警'
                }else if(item.alm_type == 618505){
                    item.alm_name = '干接点告警'
                }else if(item.alm_type == 618506){
                    item.alm_name = '异常核容或养护终止告警'
                }else if(item.alm_type == 119023){
                    item.alm_name = '续航不足告警'
                }else if(item.alm_type == 119024){
                    item.alm_name = '基站停电告警'
                }else if(item.alm_type == 119025){
                    item.alm_name = '基站发电告警'
                }else if(item.alm_type == 119026){
                    item.alm_name = '基站掉站告警'
                }else if(item.alm_type == 119027){
                    item.alm_name = '基站开门告警'
                }else if(item.alm_type == 119028){
                    item.alm_name = '设备高温告警'
                }else if(item.alm_type == 119032){
                    item.alm_name = '设备SD卡故障'
                }else if(item.alm_type == 119033){
                    item.alm_name = '采集线告警'
                }
                if (item.alm_level == 1) {
                    item.alm_level_name = '一级告警'
                }else if(item.alm_level == 2){
                    item.alm_level_name = '二级告警'
                }else if(item.alm_level == 3){
                    item.alm_level_name = '三级告警'
                }else if(item.alm_level == 4){
                    item.alm_level_name = '四级告警'
                }
            })
        }
        let excelData = this.formatJson(filterVal, list);
        export_json_to_excel(tHeader, excelData, "设备告警历史数据");
    },
    formatJson(filterVal, jsonData) {
        return jsonData.map(v => filterVal.map(j => v[j]));
    },
    /* 维护区 */
    async deviceList() {
      const newdevice = await deviceArea();
      if (
        newdevice.data.result &&
        JSON.parse(newdevice.data.result).code == 1
      ) {
        let devss = JSON.parse(newdevice.data.result).data.map(item => {
          return { label: item, value: item };
        });
        devss.unshift({
          label: `全部共${devss.length}种`,
          value: ""
        });
        this.devss = devss;
        this.selectPlace1 = `全部(共${devss.length}种)`;
      }
    },
    /* 机房站点 */
    async sesston(status) {
      const newss = await deviserchSeions({ UNote: this.selectValue1 });
      let opt = JSON.parse(newss.data.result).data.map(item => {
        return { label: item, value: item };
      });
      opt.unshift({
        label: `全部共${opt.length}种`,
        value: ""
      });
      this.opt = opt;
      this.selectPlace2 = `全部(共${opt.length}种)`;
      if(status == 1){
        this.alramData();
      }
    },
    /*查询设备历史告警记录 */
   alramData:function() {
       let loading = this.$layer.loading(1);
       deviceRecord({
        binf: {
          StationName: this.selectValue2,
          StationName1: this.selectValue1,
          BattProductDate: this.valueTime1 + ' 00:00:00',
          BattProductDate1: this.valueTime2 + ' 23:59:59'
        },
        page: {
          pageCurr: this.queryInfo.pageCurr,
          pageSize: this.queryInfo.pagesize
        }
      }).then((res)=>{
        this.$layer.close(loading);
        let alramaa = res;
            if(alramaa.data.result && JSON.parse(alramaa.data.result).code == 1){
              const newAlrams = JSON.parse(alramaa.data.result).data;
              this.total = newAlrams[newAlrams.length - 1].usr_id;
              const oldSalrams = newAlrams.map((item, index) => {
                item.index = index + 1;
                return {
                  room1: item.index,
                  battery1: item.dev_id,
                  tes1: item.dev_name,
                  tester1: item.dev_ip,
                  sessdion1: item.stationName,
                  monomer1: item.alm_confirmed_time,
                  start1: item.alm_start_time,
                  end1: item.alm_end_time,
                  num: item.num,
                  alm_is_confirmed:item.alm_is_confirmed,
                  alm_level:item.alm_level,
                  alm_type:item.alm_type,
                  alm_value:item.alm_value
                };
              });
              this.table.datas = oldSalrams;
          }else{
            this.table.datas = [];
            this.total = 0;
          }
      }).catch((err)=>{
          this.$layer.close(loading);
          this.table.datas = [];
          this.total = 0;
      });
import {isHasPermit} from "@/assets/js/tools";
export default {
    data() {
        let permits = this.$store.state.user.permits;
        let isCanDel = isHasPermit('dev_alm_delete_permit', permits);
        let newTime = new Date().format('yyyy-MM-dd');
        let oldTime = new Date(new Date(newTime).getTime() - 7 * 24 * 3600 * 1000).format('yyyy-MM-dd');
        return {
            isCanDel: isCanDel,
            queryInfo: {
                pageCurr: 1,
                pagesize: 10
            },
            total: 0,
            /* 日期 */
            valueTime1: oldTime,
            valueTime2: newTime,
            pickerOptions0: {
                disabledDate: (time) => {
                    let vm = this;
                    if (vm.valueTime2) {
                        return new Date(time.getTime()) > new Date(vm.valueTime2);
                    } else {
                        // return time.getTime() > Date.now();
                    }
                }
            },
            pickerOptions1: {
                disabledDate: (time) => {
                    return new Date(time.getTime() + 24 * 60 * 60 * 1000) < new Date(this.valueTime1);
                }
            },
            /* 维护区 */
            devss: [
                {
                    value: null,
                    label: null
                }
            ],
            /* 机房站点 */
            opt: [
                {
                    value: null,
                    label: null
                }
            ],
            selectValue1: "",
            selectPlace1: "",
            selectValue2: "",
            selectPlace2: "",
            /* 表单 */
            table: {
                headers: [
                    {
                        prop: "room1",
                        label: "编号",
                        width: "50px"
                    },
                    {
                        prop: "battery1",
                        label: "设备ID",
                        width: ""
                    },
                    {
                        prop: "tes1",
                        label: "设备名",
                        width: ""
                    },
                    {
                        prop: "tester1",
                        label: "设备IP",
                        width: ""
                    },
                    {
                        prop: "sessdion1",
                        label: "机房名称",
                        width: "270px"
                    },
                    {
                        prop: "alm_type",
                        label: "告警事件",
                        width: ""
                    },
                    {
                        prop: "alm_level",
                        label: "告警等级",
                        width: ""
                    },
                    {
                        prop: "alm_is_confirmed",
                        label: "告警确认",
                        width: ""
                    },
                    {
                        prop: "monomer1",
                        label: "告警确认时间",
                        width: ""
                    },
                    {
                        prop: "start1",
                        label: "告警开始时间",
                        width: ""
                    },
                    {
                        prop: "end1",
                        label: "告警结束时间",
                        width: ""
                    }
                ],
                datas: []
            }
        };
    },
    /*  删除 */
    async deleteUser(value) {
      const confirmResult = await this.$confirm(
        "确定删除这条告警记录吗, 是否继续?",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
    mounted() {
        this.deviceList(); /* 维护区 */
        this.sesston(); /* 机房站点 */
        this.alramData(); /* 告警记录 */
    },
    methods: {
        // 导出表格
        exportFile() {
            let tHeader = [];
            let filterVal = ['rooms1', 'batterys1', 'tesa1', 'dev1', 'tester1', 'alm_name', 'alm_level_name', 'monomers1', 'starts1'];
            this.table.headers.map((item, index) => {
                tHeader.push(item.label)
            })
            let list = this.table.datas;
            if (list.length > 0) {
                list.map((item, index) => {
                    if (item.alm_type == 119020) {
                        item.alm_name = '通信故障'
                    } else if (item.alm_type == 618501) {
                        item.alm_name = '继电器K1告警'
                    } else if (item.alm_type == 618502) {
                        item.alm_name = '通讯告警'
                    } else if (item.alm_type == 618503) {
                        item.alm_name = '设备过温告警'
                    } else if (item.alm_type == 618504) {
                        item.alm_name = '二极管D1告警'
                    } else if (item.alm_type == 618505) {
                        item.alm_name = '干接点告警'
                    } else if (item.alm_type == 618506) {
                        item.alm_name = '异常核容或养护终止告警'
                    } else if (item.alm_type == 119023) {
                        item.alm_name = '续航不足告警'
                    } else if (item.alm_type == 119024) {
                        item.alm_name = '基站停电告警'
                    } else if (item.alm_type == 119025) {
                        item.alm_name = '基站发电告警'
                    } else if (item.alm_type == 119026) {
                        item.alm_name = '基站掉站告警'
                    } else if (item.alm_type == 119027) {
                        item.alm_name = '基站开门告警'
                    } else if (item.alm_type == 119028) {
                        item.alm_name = '设备高温告警'
                    } else if (item.alm_type == 119032) {
                        item.alm_name = '设备SD卡故障'
                    } else if (item.alm_type == 119033) {
                        item.alm_name = '采集线告警'
                    }
                    if (item.alm_level == 1) {
                        item.alm_level_name = '一级告警'
                    } else if (item.alm_level == 2) {
                        item.alm_level_name = '二级告警'
                    } else if (item.alm_level == 3) {
                        item.alm_level_name = '三级告警'
                    } else if (item.alm_level == 4) {
                        item.alm_level_name = '四级告警'
                    }
                })
            }
            let excelData = this.formatJson(filterVal, list);
            export_json_to_excel(tHeader, excelData, "设备告警历史数据");
        },
        formatJson(filterVal, jsonData) {
            return jsonData.map(v => filterVal.map(j => v[j]));
        },
        /* 维护区 */
        async deviceList() {
            const newdevice = await deviceArea();
            if (
                newdevice.data.result &&
                JSON.parse(newdevice.data.result).code == 1
            ) {
                let devss = JSON.parse(newdevice.data.result).data.map(item => {
                    return {label: item, value: item};
                });
                devss.unshift({
                    label: `全部共${devss.length}种`,
                    value: ""
                });
                this.devss = devss;
                this.selectPlace1 = `全部(共${devss.length}种)`;
            }
        },
        /* 机房站点 */
        async sesston(status) {
            const newss = await deviserchSeions({UNote: this.selectValue1});
            let opt = JSON.parse(newss.data.result).data.map(item => {
                return {label: item, value: item};
            });
            opt.unshift({
                label: `全部共${opt.length}种`,
                value: ""
            });
            this.opt = opt;
            this.selectPlace2 = `全部(共${opt.length}种)`;
            if (status == 1) {
                this.alramData();
            }
        },
        /*查询设备历史告警记录 */
        alramData: function () {
            let loading = this.$layer.loading(1);
            deviceRecord({
                binf: {
                    StationName: this.selectValue2,
                    StationName1: this.selectValue1,
                    BattProductDate: this.valueTime1 + ' 00:00:00',
                    BattProductDate1: this.valueTime2 + ' 23:59:59'
                },
                page: {
                    pageCurr: this.queryInfo.pageCurr,
                    pageSize: this.queryInfo.pagesize
                }
            }).then((res) => {
                this.$layer.close(loading);
                let alramaa = res;
                if (alramaa.data.result && JSON.parse(alramaa.data.result).code == 1) {
                    const newAlrams = JSON.parse(alramaa.data.result).data;
                    this.total = newAlrams[newAlrams.length - 1].usr_id;
                    const oldSalrams = newAlrams.map((item, index) => {
                        item.index = index + 1;
                        return {
                            room1: item.index,
                            battery1: item.dev_id,
                            tes1: item.dev_name,
                            tester1: item.dev_ip,
                            sessdion1: item.stationName,
                            monomer1: item.alm_confirmed_time,
                            start1: item.alm_start_time,
                            end1: item.alm_end_time,
                            num: item.num,
                            alm_is_confirmed: item.alm_is_confirmed,
                            alm_level: item.alm_level,
                            alm_type: item.alm_type,
                            alm_value: item.alm_value
                        };
                    });
                    this.table.datas = oldSalrams;
                } else {
                    this.table.datas = [];
                    this.total = 0;
                }
            }).catch((err) => {
                this.$layer.close(loading);
                this.table.datas = [];
                this.total = 0;
            });
        },
        /*  删除 */
        async deleteUser(value) {
            const confirmResult = await this.$confirm(
                "确定删除这条告警记录吗, 是否继续?",
                "提示",
                {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning"
                }
            ).catch(err => err);
            if (confirmResult !== "confirm") {
                return this.$message.info("已取消删除");
            }
            const wa = await deviceArarmdel([
                {
                    num: value.num,
                    stationName: value.sessdion1,
                    note: " "
                }
            ]);
            if (JSON.parse(wa.data.result).code !== 1) {
                return this.$message.error("删除失败");
            }
            this.$message.success("删除成功");
            this.alramData();
        },
        //维护区改变事件
        changeSelect1() {
            this.selectValue2 = '';
            this.sesston(1);
        },
        /* 显示条数改变时 */
        handleSizeChange(val) {
            this.queryInfo.pagesize = val;
            this.alramData();
        },
        /* 翻页 */
        handleCurrentChange(val2) {
            this.queryInfo.pageCurr = val2;
            this.alramData();
        }
      ).catch(err => err);
      if (confirmResult !== "confirm") {
        return this.$message.info("已取消删除");
      }
      const wa = await deviceArarmdel([
        {
          num: value.num,
          stationName: value.sessdion1,
          note: " "
        }
      ]);
      if (JSON.parse(wa.data.result).code !== 1) {
        return this.$message.error("删除失败");
      }
      this.$message.success("删除成功");
      this.alramData();
    },
    //维护区改变事件
    changeSelect1() {
      this.selectValue2 = '';
      this.sesston(1);
    },
    /* 显示条数改变时 */
    handleSizeChange(val) {
      this.queryInfo.pagesize = val;
      this.alramData();
    },
    /* 翻页 */
    handleCurrentChange(val2) {
      this.queryInfo.pageCurr = val2;
      this.alramData();
    }
  }
};
</script>
src/pages/alarmMager/deviceTimequery.vue
@@ -66,9 +66,9 @@
                </el-table-column>
                <el-table-column prop="cztime" fixed="right" width="257px" align="center" label="操作">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" @click="okAlarm(scope.row)">确认告警</el-button>
                        <el-button type="danger" size="mini" @click="cancesWa( scope.row)">取消告警</el-button>
                        <el-button type="danger" size="mini" @click="deviceDelete(scope.row)">删除</el-button>
                        <el-button :disabled="!isCanConfirm" type="primary" size="mini" @click="okAlarm(scope.row)">确认告警</el-button>
                        <el-button :disabled="!isCanQuit" type="danger" size="mini" @click="cancesWa( scope.row)">取消告警</el-button>
                        <el-button :disabled="!isCanDel" type="danger" size="mini" @click="deviceDelete(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -99,9 +99,17 @@
    import {
        export_json_to_excel
    } from '../../assets/js/excel/Export2Excel.js'
    import {isHasPermit} from "@/assets/js/tools";
    export default {
        data() {
            let permits = this.$store.state.user.permits;
            let isCanConfirm = isHasPermit('dev_alm_confirm_permit', permits);
            let isCanQuit = isHasPermit('dev_alm_clear_permit', permits);
            let isCanDel = isHasPermit('dev_alm_delete_permit', permits);
            return {
                isCanConfirm: isCanConfirm,
                isCanQuit: isCanQuit,
                isCanDel: isCanDel,
                queryInfo: {
                    currentPage: 1,
                    pagesize: 10
src/pages/alarmMager/devicepaSetting.vue
@@ -43,7 +43,7 @@
                </el-table-column>
                <el-table-column prop="cztime" fixed="right" width="100px" align="center" label="操作">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" @click="handleClick(scope.row)">修改</el-button>
                        <el-button :disabled="!isCanEdit" type="primary" size="mini" @click="handleClick(scope.row)">修改</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -133,6 +133,7 @@
        devSearnumbe /* 查询告警下限数值 */ ,
        devSetting /* 修改 */
    } from "@/assets/js/alarmAdmian/devicepaSetting.js";
    import {isHasPermit} from "@/assets/js/tools";
    let warnparamstate = [{
            key: "Batt_Alarm_Type_OnlineVol",
            alm_id: 119001,
@@ -191,7 +192,10 @@
    ];
    export default {
        data() {
            let permits = this.$store.state.user.permits;
            let isCanEdit = isHasPermit('batt_alm_param_edit_permit', permits);
            return {
                isCanEdit: isCanEdit,
                selectValue1: "",
                selectPlace1: "",
                aacc: [],
src/pages/dataMager/battGroupMager.vue
@@ -280,8 +280,8 @@
                width="180"
                align="center">
                    <template slot-scope="scope">
                        <el-button @click="handleClick(scope.row)" type="primary" size="mini">编辑</el-button>
                        <el-button type="danger" size="mini" @click="confirmDelHome(scope.row)">删除</el-button>
                        <el-button :disabled="!isCanEdit" @click="handleClick(scope.row)" type="primary" size="mini">编辑</el-button>
                        <el-button :disabled="!isCanEdit" type="danger" size="mini" @click="confirmDelHome(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -300,7 +300,7 @@
            @current-change="currentChange"
            @size-change="sizeChange"></el-pagination>
            <div class="el-pagination-btns">
                <el-button type="primary" @click="addDialog=true" round size="mini" icon="el-icon-plus">新建电池组</el-button>
                <el-button :disabled="!isCanEdit" type="primary" @click="addDialog=true" round size="mini" icon="el-icon-plus">新建电池组</el-button>
            </div>
        </div>
        <!-- 添加电池组 -->
@@ -346,13 +346,17 @@
import {
    export_json_to_excel
} from '../../assets/js/excel/Export2Excel.js'
import {isHasPermit} from "@/assets/js/tools";
export default {
    components: {
        AddGroupMager,
        EditGroupMager
    },
    data() {
        let permits = this.$store.state.user.permits;
        let isCanEdit = isHasPermit('batttest_data_edit_permit', permits);
        return {
            isCanEdit: isCanEdit,
            batt: {},
            loading: '',
            filters: {
src/pages/dataMager/threadMager.vue
@@ -17,10 +17,10 @@
                width="180"
                align="center">
                    <template slot-scope="scope">
                        <el-button icon="el-icon-s-tools" @click="handleClick(scope.row)" type="primary" size="mini">设置</el-button>
                        <el-button :disabled="!isCanEdit" icon="el-icon-s-tools" @click="handleClick(scope.row)" type="primary" size="mini">设置</el-button>
                        <el-button 
                        icon="el-icon-refresh-right" type="danger" size="mini"
                        :disabled="scope.row.noRestart"
                        :disabled="scope.row.noRestart || !isCanEdit"
                        @click="confirmHandler(scope.row)">重启</el-button>
                    </template>
                </el-table-column>
@@ -113,12 +113,15 @@
<script>
import {
    Timeout,
    formatSeconds,
    formatSeconds, isHasPermit,
} from '../../assets/js/tools'
export default {
    data() {
        let permits = this.$store.state.user.permits;
        let isCanEdit = isHasPermit('batttest_data_edit_permit', permits);
        return {
            isCanEdit: isCanEdit,
            tblData: {
                header:[
                    {
src/pages/dataTest/history.vue
@@ -431,16 +431,16 @@
                    },
                    legend: {
                        show: true,
                        data: ["组端电压", "在线电压"],
                        data: ["在线电压", "组端电压"],
                        right: 0,
                        orient: "vertical"
                    },
                    series: [{
                            name: "组端电压",
                            name: "在线电压",
                            data: []
                        },
                        {
                            name: "在线电压",
                            name: "组端电压",
                            data: []
                        }
                    ]
@@ -512,8 +512,8 @@
            // 设置端电压折线图
            setGroupVolLineChart() {
                // 根据allData.groupVol数据设置groupVolLineChart的值
                groupVolLineChart.series[0].data = allData.groupVol;
                groupVolLineChart.series[1].data = allData.onlineVol;
                groupVolLineChart.series[0].data = allData.onlineVol;
                groupVolLineChart.series[1].data = allData.groupVol;
                // 更新图表
                this.$refs.groupVol.setOption(groupVolLineChart);
            },
src/pages/dataTest/realTime.vue
@@ -92,9 +92,9 @@
                        </el-popover>
                    </div>
                    <el-tabs v-model="acTabs" type="border-card" class="flex-layout noborder" @tab-click="tabClick">
<!--                        <el-tab-pane label="电源信息" name="powerInfo">-->
<!--                            电源信息-->
<!--                        </el-tab-pane>-->
                        <el-tab-pane label="电源信息" name="powerInfo">
                            电源信息
                        </el-tab-pane>
                        <el-tab-pane label="电路拓扑图" name="eleLine">
                            <science-box :top="8" :left="8" no-header v-show="stateListState">
                                <div class="hdw-state-list table-layout">
src/pages/userMager/addEdit.vue
@@ -1,6 +1,6 @@
<template>
<div>
    <el-form class="params-dialog formDataBox" :model="formData" :rules="rules" ref="formDataBox" label-width="80px">
    <el-form class="params-dialog formDataBox bg-white" :model="formData" :rules="rules" ref="formDataBox" label-width="80px">
    <div class="staff">
        <p> <span class="iconfont el-icon-duoyonghu"></span> 员工基本信息</p>
        <div class="table-row">