whychw
2021-07-12 547b70367a4569bc5d0ca1cc23e5cfcde2384480
U 实时告警分为 未确认 已确认
2个文件已修改
635 ■■■■■ 已修改文件
src/pages/alarmMager/batteryrTimequery.vue 307 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/deviceTimequery.vue 328 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/alarmMager/batteryrTimequery.vue
@@ -125,10 +125,13 @@
                </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="table.datas" height="100%" class="tableCent">
                <el-table-column v-for="header in table.headers" :key="header.prop" :prop="header.prop" :label="header.label"
                        <el-table id="batteryrTimequeryTable" stripe size="small" :data="table1.datas" height="100%" class="tableCent">
                            <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="180">
                    <template slot-scope="scope">
@@ -150,18 +153,60 @@
                </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="paramsAlram">查询</el-button>
                <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile">导出</el-button>
                            <el-button type="primary" round size="mini" icon="el-icon-search" @click="paramsAlram1">查询</el-button>
                            <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile1">导出</el-button>
            </div>
            <el-pagination class="pagess" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="queryInfo.pagenum" :page-sizes="[10, 20, 30, 50, 100]" :page-size="queryInfo.pagesize"
                layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
                        <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 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="180">
                                <template slot-scope="scope">
                                    {{ scope.row.isalarm1?scope.row.alm_confirmed_time:"" }}
                                </template>
                            </el-table-column>
                            <el-table-column label="确认告警" align="center" :width="80">
                                <template slot-scope="scope">
                                    <el-checkbox v-model="scope.row.isalarm1" 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)">删除</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="paramsAlram2">查询</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>
@@ -196,12 +241,20 @@
                isCanConfirm: isCanConfirm,
                isCanQuit: isCanQuit,
                isCanDel: isCanDel,
                queryInfo: {
                // 当前tab
                acTabs: "unconfirmed",
                queryInfo1: {
                    query: "" /* 查询 */ ,
                    pagenum: 1 /* 当前页码 绑定queryInfo.pagenum */ ,
                    pagesize: 10 /* 每页显示的数据 绑定queryInfo.pagesize */
                },
                total: 0 /* 总共有多少条 */ ,
                queryInfo2: {
                    query: "" /* 查询 */ ,
                    pagenum: 1 /* 当前页码 绑定queryInfo.pagenum */ ,
                    pagesize: 10 /* 每页显示的数据 绑定queryInfo.pagesize */
                },
                total1: 0 /* 总共有多少条 */ ,
                total2: 0 /* 总共有多少条 */ ,
                /* 维护区 */
                vindicate: [{
                    value: "选项1",
@@ -295,7 +348,61 @@
                selectValue3: 0,
                selectPlace3: "",
                /* 表单 */
                table: {
                table1: {
                    headers: [{
                            prop: "room1",
                            label: "编号",
                            width: 50
                        },
                        {
                            prop: "battery1",
                            label: "机房名称",
                            minWidth: 220
                        },
                        {
                            prop: "tes1",
                            label: "电池组名称",
                            width: 120
                        },
                        {
                            prop: "tester1",
                            label: "告警名称",
                            width: 162
                        },
                        {
                            prop: "current1",
                            label: "单体编号",
                            width: 80
                        },
                        {
                            prop: "capacity1",
                            label: "告警值",
                            width: 80
                        },
                        {
                            prop: "monomer1",
                            label: "告警等级",
                            width: 120
                        },
                        {
                            prop: "start1",
                            label: "告警开始时间",
                            width: 180
                        },
                    ],
                    datas: [{
                        room1: 0,
                        battery1: 0,
                        tes1: 0,
                        tester1: 0,
                        current1: 0,
                        capacity1: 0,
                        monomer1: 0,
                        alarm1: 0,
                        start1: 0
                    }]
                },
                table2: {
                    headers: [{
                            prop: "room1",
                            label: "编号",
@@ -350,6 +457,8 @@
                    }]
                },
                timer: new Timeout('batteryrTimequery'),
                // 第一次查询
                isFirstQuery: false
            };
        },
        mounted() {
@@ -360,11 +469,14 @@
            this.startTimer(); /* 定时请求 */
        },
        methods: {
            tabClick(tab) {
                this.acTabs = tab.name;
            },
            // 导出表格
            exportFile() {
            exportFile1() {
                let tHeader = [];
                let filterVal = [];
                this.table.headers.map((item, index) => {
                this.table1.headers.map((item, index) => {
                    tHeader.push(item.label)
                    filterVal.push(item.prop)
                })
@@ -372,7 +484,7 @@
                filterVal.push('alm_confirmed_time')
                tHeader.push('确认告警')
                filterVal.push('isalarm1')
                let list = this.table.datas;
                let list = this.table1.datas;
                if (list.length > 0) {
                    list.map((item, index) => {
                        if (item.isalarm1) {
@@ -383,7 +495,32 @@
                    })
                }
                let excelData = this.formatJson(filterVal, list);
                export_json_to_excel(tHeader, excelData, "电池告警实时数据");
                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('alm_confirmed_time')
                tHeader.push('确认告警')
                filterVal.push('isalarm1')
                let list = this.table2.datas;
                if (list.length > 0) {
                    list.map((item, index) => {
                        if (item.isalarm1) {
                            item.isalarm1 = '是'
                        } else {
                            item.isalarm1 = '否'
                        }
                    })
                }
                let excelData = this.formatJson(filterVal, list);
                export_json_to_excel(tHeader, excelData, "电池告警实时数据-已确认");
            },
            formatJson(filterVal, jsonData) {
                return jsonData.map(v => filterVal.map(j => v[j]));
@@ -450,8 +587,16 @@
                this.paramsAlram();
            },
            /* 告警信息 */
            async paramsAlram() {
                let loading = this.$layer.loading(1);
            paramsAlram () {
                this.paramsAlram1();
                this.paramsAlram2();
            },
            /* 告警信息未确认 */
            async paramsAlram1() {
                let loading;
                if (this.isFirstQuery) {
                    loading = this.$layer.loading(1);
                }
                let params = {};
                Object.keys(this.checkbox).forEach((item, index) => {
                    if (this.checkbox[item].bol) {
@@ -470,8 +615,8 @@
                const alarmDatas = await newsAlarm({
                    bmd: {
                        page: {
                            pageSize: this.queryInfo.pagesize,
                            pageCurr: this.queryInfo.pagenum
                            pageSize: this.queryInfo1.pagesize,
                            pageCurr: this.queryInfo1.pagenum
                        },
                        binf: {
                            StationName1: this.selectValue1,
@@ -497,16 +642,110 @@
                            MonNum: "0",
                            Record_Id: "0",
                            alm_id: params.alm_id,
                            alm_signal_id: params.alm_signal_id
                            alm_signal_id: params.alm_signal_id,
                            alm_is_confirmed: 0
                        }
                    }
                });
                //console.log("alarmDatas", alarmDatas);
                const newsAlaa = JSON.parse(alarmDatas.data.result).data;
                this.isFirstQuery = false;
                // console.log("newsAlaa", newsAlaa);
                loading && this.$layer.close(loading); // 关闭等待框
                this.total1 = newsAlaa[newsAlaa.length - 1].page.pageAll;
                this.table1.datas = newsAlaa.filter((item, index) => {
                    if (item.adata) {
                        item.room1 = index + 1;
                        item.battery1 =
                            item.binf && item.binf.StationName ? item.binf.StationName : "";
                        item.tes1 =
                            item.binf && item.binf.BattGroupName ? item.binf.BattGroupName : "";
                        item.tester1 =
                            item.binf && item.binf.StationName8 ? item.binf.StationName8 : "";
                        item.current1 =
                            item.adata && item.adata.MonNum ? item.adata.MonNum : 0;
                        item.capacity1 =
                            item.adata && item.adata.alm_value ? item.adata.alm_value : 0;
                        item.monomer1 =
                            item.binf && item.binf.StationName9 ? item.binf.StationName9 : "";
                        item.start1 =
                            item.adata && item.adata.alm_start_time ?
                            item.adata.alm_start_time :
                            "";
                        item.end1 =
                            item.adata && item.adata.alm_end_time ?
                            item.adata.alm_end_time :
                            "";
                        item.alm_confirmed_time = item.adata.alm_confirmed_time;
                        item.isalarm1 = item.adata.alm_is_confirmed == 1 ? true : false;
                        return item;
                    }
                });
            },
            /* 告警信息已确认 */
            async paramsAlram2 () {
                let loading;
                if (this.isFirstQuery) {
                    loading = this.$layer.loading(1);
                }
                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;
                    }
                });
                // 一级和二级告警
                params.num = this.checkbox.Level_one_warn.bol ? 1 : 0;
                params.BattGroupId = this.checkbox.Level_two_warn.bol ? 2 : 0;
                // 上限和下限告警
                params.alm_id = this.checkbox.alm_id.bol ? 1 : 100;
                params.alm_signal_id = this.checkbox.alm_signal_id.bol ? 0 : 100;
                /*  console.log("params", params); */
                const alarmDatas = await newsAlarm({
                    bmd: {
                        page: {
                            pageSize: this.queryInfo2.pagesize,
                            pageCurr: this.queryInfo2.pagenum
                        },
                        binf: {
                            StationName1: this.selectValue1,
                            stationName: this.selectValue2,
                            BattGroupId: this.selectValue3 ? this.selectValue3 : 0
                        },
                        mainf: {
                            usr_id: params.usr_id,
                            fault_type_id: params.fault_type_id,
                            uname: params.uname,
                            fault_level: params.fault_level,
                            record_uid: params.record_uid,
                            maint_type_id: params.maint_type_id,
                            maint_close: params.maint_close,
                            master_id: "0",
                            maint_done: params.maint_done,
                            num: params.num,
                            BattGroupId: params.BattGroupId,
                            master_audit: params.master_audit,
                            appoint_uid: params.appoint_uid
                        },
                        adata: {
                            MonNum: "0",
                            Record_Id: "0",
                            alm_id: params.alm_id,
                            alm_signal_id: params.alm_signal_id,
                            alm_is_confirmed: 1
                        }
                    }
                });
                //console.log("alarmDatas", alarmDatas);
                const newsAlaa = JSON.parse(alarmDatas.data.result).data;
                //console.log("newsAlaa", newsAlaa);
                this.$layer.close(loading); // 关闭等待框
                this.total = newsAlaa[newsAlaa.length - 1].page.pageAll;
                this.table.datas = newsAlaa.filter((item, index) => {
                this.isFirstQuery = false;
                loading && this.$layer.close(loading); // 关闭等待框
                this.total2 = newsAlaa[newsAlaa.length - 1].page.pageAll;
                this.table2.datas = newsAlaa.filter((item, index) => {
                    if (item.adata) {
                        item.room1 = index + 1;
                        item.battery1 =
@@ -629,15 +868,25 @@
                this.computerSite(); /*机房站点 */
                this.storageBatterys(); /* 蓄电池组 */
            },
            handleSizeChange(newSize) {
                this.queryInfo.pagesize = newSize;
            handleSizeChange1(newSize) {
                this.queryInfo1.pagesize = newSize;
                /*console.log(`每页 ${val} 条`); */
                this.paramsAlram();
                this.paramsAlram1();
            },
            handleCurrentChange(newPage) {
                this.queryInfo.pagenum = newPage;
            handleCurrentChange1(newPage) {
                this.queryInfo1.pagenum = newPage;
                /*console.log(`当前页: ${val}`); */
                this.paramsAlram();
                this.paramsAlram1();
            },
            handleSizeChange2(newSize) {
                this.queryInfo2.pagesize = newSize;
                /*console.log(`每页 ${val} 条`); */
                this.paramsAlram2();
            },
            handleCurrentChange2(newPage) {
                this.queryInfo2.pagenum = newPage;
                /*console.log(`当前页: ${val}`); */
                this.paramsAlram2();
            },
            startTimer() {
                this.timer.start(() => {
src/pages/alarmMager/deviceTimequery.vue
@@ -22,10 +22,13 @@
                </div>
            </div>
        </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 stripe size="small" :data="table.datas" height="100%">
                <el-table-column v-for="header in table.headers" :key="header.prop" :prop="header.prop" :label="header.label"
                        <el-table stripe size="small" :data="table1.datas" height="100%">
                            <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">
                    <template slot-scope="scope">
                        <div>
@@ -55,7 +58,6 @@
                            <div v-else>
                                {{ scope.row[header.prop] }}
                            </div>
                        </div>
                    </template>
                </el-table-column>
@@ -82,13 +84,86 @@
        <!-- 底部分页 -->
        <div class="flex-page-footer" slot="footer">
            <div class="el-pagination-btns">
                <el-button type="primary" round size="mini" @click="alarmDev" icon="el-icon-search">查询</el-button>
                <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile">导出</el-button>
                            <el-button type="primary" round size="mini" @click="alarmDev1" icon="el-icon-search">查询</el-button>
                            <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile1">导出</el-button>
            </div>
            <el-pagination class="pagess" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.currentPage"
             :page-sizes="[10, 20,30, 50, 100]" :page-size="queryInfo.pagesize" layout="total, sizes, prev, pager, next, jumper"
             :total="total"></el-pagination>
                        <el-pagination class="pagess" @size-change="handleSizeChange1" @current-change="handleCurrentChange1" :current-page="queryInfo1.currentPage"
                         :page-sizes="[10, 20,30, 50, 100]" :page-size="queryInfo1.pagesize" layout="total, sizes, prev, pager, next, jumper"
                         :total="total1"></el-pagination>
        </div>
                </flex-layout>
            </el-tab-pane>
            <el-tab-pane label="已确认告警" name="confirmed">
                <flex-layout>
                    <!-- 表单 -->
                    <div class="flex-page-content">
                        <el-table stripe size="small" :data="table2.datas" height="100%">
                            <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">
                                <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>
                                            {{ scope.row[header.prop] }}
                                        </div>
                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column label="确认告警时间" width="180px" align="center">
                                <template slot-scope="scope">
                                    {{ scope.row.isalarm1?scope.row.monomers1:"" }}
                                </template>
                            </el-table-column>
                            <el-table-column label="确认告警" width="80px" align="center">
                                <template slot-scope="scope">
                                    <el-checkbox v-model="scope.row.isalarm1" disabled></el-checkbox>
                                    <!-- <input type="checkbox" :checked='scope.row.alm_is_confirmed ===1?true:false' disabled> -->
                                </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="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>
                    </div>
                    <!-- 底部分页 -->
                    <div class="flex-page-footer" slot="footer">
                        <div class="el-pagination-btns">
                            <el-button type="primary" round size="mini" @click="alarmDev2" icon="el-icon-search">查询</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.currentPage"
                         :page-sizes="[10, 20,30, 50, 100]" :page-size="queryInfo2.pagesize" layout="total, sizes, prev, pager, next, jumper"
                         :total="total2"></el-pagination>
                    </div>
                </flex-layout>
            </el-tab-pane>
        </el-tabs>
    </flex-layout>
</template>
@@ -119,11 +194,17 @@
                isCanQuit: isCanQuit,
                isCanDel: isCanDel,
        timer: new Timeout(),
                queryInfo: {
                queryInfo1: {
                    currentPage: 1,
                    pagesize: 10
                },
                total: 0,
                queryInfo2: {
                    currentPage: 1,
                    pagesize: 10
                },
                acTabs: 'unconfirmed',
                total1: 0,
                total2: 0,
                /* 日期 */
                valueTime: ["2000-01-01 00:00:00", "2020-09-20 00:00:00"],
                selectValue1: "",
@@ -197,7 +278,7 @@
                    label: null
                }],
                /* 表单 */
                table: {
                table1: {
                    headers: [{
                            prop: "rooms1",
                            label: "编号",
@@ -241,7 +322,53 @@
                    ],
                    datas: []
                }
                },
                table2: {
                    headers: [{
                            prop: "rooms1",
                            label: "编号",
                            width: 50
                        },
                        {
                            prop: "batterys1",
                            label: "设备ID",
                            width: 120
                        },
                        {
                            prop: "tesa1",
                            label: "设备名",
                            width: 160
                        },
                        {
                            prop: "dev1",
                            label: "设备IP",
                            width: 120
                        },
                        {
                            prop: "tester1",
                            label: "机房名称",
                            minWidth: 220
                        },
                        {
                            prop: "alm_type",
                            label: "告警事件",
                            width: 180
                        },
                        {
                            prop: "alm_level",
                            label: "告警等级",
                            width: 120
                        },
                        {
                            prop: "starts1",
                            label: "告警开始时间",
                            width: 180
                        },
                    ],
                    datas: []
                },
                isFirstQuery: false
            };
        },
        mounted() {
@@ -250,18 +377,21 @@
            this.startSearch(); /* 实时告警 */
        },
        methods: {
            tabClick(tab) {
                this.acTabs = tab.name;
            },
            // 导出表格
            exportFile() {
            exportFile1() {
                let tHeader = [];
                let filterVal = ['rooms1', 'batterys1', 'tesa1', 'dev1', 'tester1', 'alm_name', 'alm_level_name', 'monomers1',
                    'starts1', 'isalarm1'
                ];
                this.table.headers.map((item, index) => {
                this.table1.headers.map((item, index) => {
                    tHeader.push(item.label)
                })
                tHeader.push('确认告警时间')
                tHeader.push('确认告警')
                let list = this.table.datas;
                let list = this.table1.datas;
                if (list.length > 0) {
                    list.map((item, index) => {
                        if (item.alm_type == 119020) {
@@ -314,7 +444,73 @@
                    })
                }
                let excelData = this.formatJson(filterVal, list);
                export_json_to_excel(tHeader, excelData, "设备告警实时数据");
                export_json_to_excel(tHeader, excelData, "设备告警实时数据-未确认");
            },
            // 导出表格
            exportFile2() {
                let tHeader = [];
                let filterVal = ['rooms1', 'batterys1', 'tesa1', 'dev1', 'tester1', 'alm_name', 'alm_level_name', 'monomers1',
                    'starts1', 'isalarm1'
                ];
                this.table2.headers.map((item, index) => {
                    tHeader.push(item.label)
                })
                tHeader.push('确认告警时间')
                tHeader.push('确认告警')
                let list = this.table2.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 = '四级告警'
                        }
                        if (item.alm_is_confirmed === 1) {
                            item.isalarm1 = '是'
                        } else {
                            item.isalarm1 = '否'
                        }
                    })
                }
                let excelData = this.formatJson(filterVal, list);
                export_json_to_excel(tHeader, excelData, "设备告警实时数据-已确认");
            },
            formatJson(filterVal, jsonData) {
                return jsonData.map(v => filterVal.map(j => v[j]));
@@ -366,16 +562,24 @@
                    }
                }
            },
            alarmDev () {
                this.alarmDev1();
                this.alarmDev2();
            },
            /* 告警信息 */
            async alarmDev() {
                let loading = this.$layer.loading(1);
            async alarmDev1() {
                let loading;
                if (this.isFirstQuery) {
                    loading = this.$layer.loading(1);
                }
                const newAlarm = await deviceAlarm({
                    stationName1: this.selectValue1,
                    stationName: this.selectValue2,
                    alm_type: this.value,
                    alm_is_confirmed: 0,
                    page: {
                        pageSize: this.queryInfo.pagesize,
                        pageCurr: this.queryInfo.currentPage
                        pageSize: this.queryInfo1.pagesize,
                        pageCurr: this.queryInfo1.currentPage
                    }
                });
                if (newAlarm.data.result && JSON.parse(newAlarm.data.result).code == 1) {
@@ -407,13 +611,71 @@
                            };
                        }
                    );
                    this.table.datas = alarmNes;
                    this.total = ssAlram[ssAlram.length - 1].usr_id;
                    this.table1.datas = alarmNes;
                    this.total1 = ssAlram[ssAlram.length - 1].usr_id;
                    this.isFirstQuery = false;
                    // 关闭等待框
                    loading && this.$layer.close(loading);
                } else {
                    this.table1.datas = [];
                    this.total1 = 0;
                    // 关闭等待框
                    this.$layer.close(loading);
                }
            },
            /* 告警信息 */
            async alarmDev2() {
                let loading;
                if (this.isFirstQuery) {
                    loading = this.$layer.loading(1);
                }
                const newAlarm = await deviceAlarm({
                    stationName1: this.selectValue1,
                    stationName: this.selectValue2,
                    alm_type: this.value,
                    alm_is_confirmed: 1,
                    page: {
                        pageSize: this.queryInfo2.pagesize,
                        pageCurr: this.queryInfo2.currentPage
                    }
                });
                if (newAlarm.data.result && JSON.parse(newAlarm.data.result).code == 1) {
                    const ssAlram = JSON.parse(newAlarm.data.result).data;
                    const alarmNes = ssAlram.map(
                        (item, index) => {
                            item.index = index + 1;
                            let isalarm1;
                            if (item.alm_is_confirmed === 1) {
                                isalarm1 = true
                } else {
                    this.table.datas = [];
                    this.total = 0;
                                isalarm1 = false
                            }
                            return {
                                rooms1: item.index,
                                batterys1: item.dev_id,
                                tesa1: item.dev_name,
                                dev1: item.dev_ip,
                                tester1: item.stationName,
                                starts1: item.alm_start_time,
                                ends1: item.alm_end_time,
                                monomers1: item.alm_confirmed_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,
                                isalarm1: isalarm1
                            };
                        }
                    );
                    this.table2.datas = alarmNes;
                    this.total2 = ssAlram[ssAlram.length - 1].usr_id;
                    this.isFirstQuery = false;
                    // 关闭等待框
                    loading && this.$layer.close(loading);
                } else {
                    this.table2.datas = [];
                    this.total2 = 0;
                    // 关闭等待框
                    this.$layer.close(loading);
                }
@@ -520,13 +782,23 @@
            },
            // 显示条数
            handleSizeChange(val) {
                this.queryInfo.pagesize = val;
            handleSizeChange1(val) {
                this.queryInfo1.pagesize = val;
                this.alarmDev();
            },
            // 翻页
            handleCurrentChange(val2) {
                this.queryInfo.currentPage = val2;
            handleCurrentChange1(val2) {
                this.queryInfo1.currentPage = val2;
                this.alarmDev();
            },
            // 显示条数
            handleSizeChange2(val) {
                this.queryInfo2.pagesize = val;
                this.alarmDev();
            },
            // 翻页
            handleCurrentChange2(val2) {
                this.queryInfo2.currentPage = val2;
                this.alarmDev();
            }
        },