| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表单 --> |
| | | <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" |
| | | :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> |
| | | |
| | | <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="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> |
| | | <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="alarmDev1" icon="el-icon-search">查询</el-button> |
| | | <el-button type="primary" round size="mini" icon="el-icon-wallet" @click="exportFile1">导出</el-button> |
| | | </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="alarmDev" 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.currentPage" |
| | | :page-sizes="[10, 20,30, 50, 100]" :page-size="queryInfo.pagesize" layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total"></el-pagination> |
| | | </div> |
| | | <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> |
| | | |
| | |
| | | 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: "", |
| | |
| | | label: null |
| | | }], |
| | | /* 表单 */ |
| | | table: { |
| | | table1: { |
| | | headers: [{ |
| | | prop: "rooms1", |
| | | label: "编号", |
| | |
| | | |
| | | ], |
| | | 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() { |
| | |
| | | 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) { |
| | |
| | | }) |
| | | } |
| | | 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])); |
| | |
| | | } |
| | | } |
| | | }, |
| | | 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) { |
| | |
| | | }; |
| | | } |
| | | ); |
| | | 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 { |
| | | 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.table.datas = []; |
| | | this.total = 0; |
| | | this.table2.datas = []; |
| | | this.total2 = 0; |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | } |
| | |
| | | |
| | | }, |
| | | // 显示条数 |
| | | 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(); |
| | | } |
| | | }, |