lzh1232 8 months ago
commit 9c18db32cc
  1. 6
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java
  2. 5
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/job/GatherJob.java
  3. 5
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/InternalMessageMapper.java
  4. 6
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/ScheduleRulesMapper.java
  5. 3
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java
  6. 14
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java
  7. 1
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/InternalMessageServiceImpl.java
  8. 15
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java
  9. 57
      ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleShutdownHook.java
  10. 6
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/InternalMessageMapper.xml
  11. 9
      ALOps_sys_backend/alops-system/src/main/resources/mapper/system/ScheduleRulesMapper.xml
  12. 15
      ALOps_sys_fe/alops-ui/src/api/message/index.js
  13. 8
      ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue
  14. 8
      ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/history.vue
  15. 18
      ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/interface.vue
  16. 6
      ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/routing.vue
  17. 93
      ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/veneer.vue
  18. 8
      ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/vlan.vue
  19. 2
      ALOps_sys_fe/alops-ui/src/views/index.vue
  20. 95
      ALOps_sys_fe/alops-ui/src/views/message/index.vue

@ -48,12 +48,8 @@ public class AlertMessageController extends BaseController
@ApiOperation("立即执行预警") @ApiOperation("立即执行预警")
@Log(title = "【立即执行预警】", businessType = BusinessType.DELETE) @Log(title = "【立即执行预警】", businessType = BusinessType.DELETE)
@PostMapping("/executeImmediate") @PostMapping("/executeImmediate")
public AjaxResult executeImmediate(@RequestBody Map<String, List<Long>> paramMap) { public AjaxResult executeImmediate() {
try { try {
List<Long> ruleIds = paramMap.get("ruleIds");
if (ruleIds == null || ruleIds.isEmpty()) {
return AjaxResult.error("请选择至少一条规则");
}
iAlertLaunchService.executeImmediateAlerts(); // 调用 Service 执行 iAlertLaunchService.executeImmediateAlerts(); // 调用 Service 执行
return AjaxResult.success("立即预警任务已触发,存入成功,请查看"); return AjaxResult.success("立即预警任务已触发,存入成功,请查看");

@ -40,8 +40,9 @@ public class GatherJob implements Job {
try { try {
if (rule == null) return; if (rule == null) return;
// 1.状态为4时取消调度任务 // 1.状态为5时取消调度任务
if (rule.getStatus() == 4) { if (rule.getStatus() == 5) {
rule.setStatus(4);
Scheduler scheduler = context.getScheduler(); Scheduler scheduler = context.getScheduler();
JobKey jobKey = context.getJobDetail().getKey(); JobKey jobKey = context.getJobDetail().getKey();
// scheduler.deleteJob(jobKey); // scheduler.deleteJob(jobKey);

@ -16,7 +16,10 @@ import java.util.List;
public interface InternalMessageMapper public interface InternalMessageMapper
{ {
/**
* 根据用户ID将所有消息状态更新为已读
*/
int updateMessagesToReadByUserId(@Param("userId") Long userId);
/** /**
* 查询指定用户的所有消息按时间倒序 * 查询指定用户的所有消息按时间倒序
*/ */

@ -16,6 +16,12 @@ public interface ScheduleRulesMapper
{ {
/**
* status 1 5 的记录更新为 3
* @return 更新的记录数
*/
int updateStatusFrom1And5To3();
public List<ScheduleRules> selectList(); public List<ScheduleRules> selectList();
public List<ScheduleRules> selectListOne(); public List<ScheduleRules> selectListOne();

@ -341,7 +341,8 @@ public class AlertLaunchServiceImpl implements IAlertLaunchService {
" WHERE t3.equ_id = g1.equ_id " + " WHERE t3.equ_id = g1.equ_id " +
" ) " + " ) " +
") " + ") " +
"AND (g1." + col + " <> g2." + col + " OR g1." + col + " IS NULL OR g2." + col + " IS NULL)"; "AND (g1." + col + " <> g2." + col + " OR g1." + col + " IS NULL OR g2." + col + " IS NULL)"+
"AND b.status = '1'";
System.out.println(sql); System.out.println(sql);
System.out.println(jdbcTemplate.queryForList(sql)); System.out.println(jdbcTemplate.queryForList(sql));

@ -159,8 +159,10 @@ public class AlertRuleServiceImpl implements IAlertRuleService
.append(" FROM equ_gather ") .append(" FROM equ_gather ")
.append(" GROUP BY equ_id ") .append(" GROUP BY equ_id ")
.append(") latest ON g.equ_id = latest.equ_id AND g.gather_time = latest.latest_time ") .append(") latest ON g.equ_id = latest.equ_id AND g.gather_time = latest.latest_time ")
.append("WHERE ") .append("WHERE b.status = '1' "); // 先把固定条件放在前面
.append(buildConditionsSql(conditions)); if (!buildConditionsSql(conditions).isEmpty()) {
sql.append(" AND ").append(buildConditionsSql(conditions));
}
} else { } else {
// 其他表,需要连 equ_gather → equ_base → equ_type // 其他表,需要连 equ_gather → equ_base → equ_type
sql.append("src.*, g.equ_id, t.name AS equ_type,b.name AS equ_name,b.equ_number ") sql.append("src.*, g.equ_id, t.name AS equ_type,b.name AS equ_name,b.equ_number ")
@ -168,8 +170,12 @@ public class AlertRuleServiceImpl implements IAlertRuleService
.append("JOIN equ_gather g ON src.equ_gather_id = g.id ") .append("JOIN equ_gather g ON src.equ_gather_id = g.id ")
.append("JOIN equ_base b ON g.equ_id = b.id ") .append("JOIN equ_base b ON g.equ_id = b.id ")
.append("JOIN equ_type t ON b.equ_type = t.id ") // ★ 新增关联 .append("JOIN equ_type t ON b.equ_type = t.id ") // ★ 新增关联
.append("WHERE ") .append("WHERE b.status = '1' "); // 先把固定条件放在前面
.append(buildConditionsSql(conditions));
if (!buildConditionsSql(conditions).isEmpty()) {
sql.append(" AND ").append(buildConditionsSql(conditions));
}
} }
return sql.toString(); return sql.toString();

@ -29,6 +29,7 @@ public class InternalMessageServiceImpl implements IInternalMessageService
if (userId == null) { if (userId == null) {
return Collections.emptyList(); return Collections.emptyList();
} }
internalMessageMapper.updateMessagesToReadByUserId(userId);
return internalMessageMapper.selectMessagesByUserId(userId); return internalMessageMapper.selectMessagesByUserId(userId);
} }
@Override @Override

@ -89,12 +89,13 @@ public class ScheduleRulesServiceImpl implements IScheduleRulesService {
switch (rule.getStatus()) { switch (rule.getStatus()) {
case 1: // 正在执行 case 1: // 正在执行
log.info("规则[{}]:正在执行上一个任务,等待上一个任务完成……", rule.getId()); log.info("规则[{}]:正在执行上一个任务,等待上一个任务完成……", rule.getId());
if (rule.getRuleType() == 2 || rule.getRuleType() == 1) { // if (rule.getRuleType() == 2 || rule.getRuleType() == 1) {
rule.setStatus(2); //// rule.setStatus(2);
} else if (rule.getRuleType() == 0) { // } else
log.info("改变状态为4"); // if (rule.getRuleType() == 0) {
rule.setStatus(4); log.info("改变状态为5");
} rule.setStatus(5);
// }
scheduleRulesMapper.updateScheduleRules(rule); scheduleRulesMapper.updateScheduleRules(rule);
return true; return true;
case 0: // 待执行 case 0: // 待执行
@ -105,6 +106,8 @@ public class ScheduleRulesServiceImpl implements IScheduleRulesService {
scheduleRulesMapper.updateScheduleRules(rule); scheduleRulesMapper.updateScheduleRules(rule);
iAlertSenderService.sendInternalMessage("采集整体任务取消成功","任务执行完此次,已取消后续任务","2"); iAlertSenderService.sendInternalMessage("采集整体任务取消成功","任务执行完此次,已取消后续任务","2");
return false; return false;
case 5:
return true;
default: default:
return true; return true;
} }

@ -0,0 +1,57 @@
package com.alops.system.service.impl;
import com.alops.system.mapper.ScheduleRulesMapper;
import com.alops.system.service.IAlertSenderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Component
public class ScheduleShutdownHook {
private static final Logger log = LoggerFactory.getLogger(ScheduleShutdownHook.class);
@Autowired
private ScheduleRulesMapper scheduleRulesMapper;
@Autowired
private IAlertSenderService iAlertSenderService;
private static ScheduleShutdownHook instance;
@PostConstruct
public void init() {
instance = this;
registerShutdownHook();
}
private void registerShutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
log.info("检测到应用关闭,开始更新任务状态...");
updateInterruptedStatus();
}));
}
private void updateInterruptedStatus() {
try {
// 将所有状态为1(执行中)、5(等待中)的任务更新为3(执行失败)
int affectedRows = scheduleRulesMapper.updateStatusFrom1And5To3();
log.info("成功更新 {} 个任务状态为中断", affectedRows);
// 发送站内信
if (affectedRows > 0) {
iAlertSenderService.sendInternalMessage(
"系统中断",
"采集任务被外部中断,已更新" + affectedRows + "个任务状态",
"2"
);
}
} catch (Exception e) {
log.error("中断处理失败: {}", e.getMessage(), e);
// 备用方案:直接输出到控制台
System.err.println("中断处理失败: " + e.getMessage());
}
}
}

@ -14,6 +14,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<!-- 根据用户ID将所有消息状态更新为已读 -->
<update id="updateMessagesToReadByUserId">
UPDATE internal_message
SET status = 'read' <!-- 假设1表示已读状态,请根据您的实际状态值调整 -->
WHERE user_id = #{userId}
</update>
<select id="selectMessagesByUserId" resultMap="InternalMessageResult"> <select id="selectMessagesByUserId" resultMap="InternalMessageResult">
SELECT * SELECT *

@ -42,10 +42,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id, rule_name, rule_type, frequency, gather_time, start_time, end_time, status,created_at ,created_by from schedule_rules select id, rule_name, rule_type, frequency, gather_time, start_time, end_time, status,created_at ,created_by from schedule_rules
</sql> </sql>
<update id="updateStatusFrom1And5To3">
UPDATE schedule_rules
SET status = 3
WHERE status IN (1, 5)
</update>
<select id="selectList" resultMap="ScheduleRulesResult"> <select id="selectList" resultMap="ScheduleRulesResult">
SELECT * SELECT *
FROM schedule_rules FROM schedule_rules
WHERE status IN (0, 1) WHERE status IN (0, 1,5)
</select> </select>

@ -0,0 +1,15 @@
import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";
// 查询预警消息列表
export function messageList(query) {
return request({
url: '/message/list',
method: 'get',
params: query
})
}

@ -227,6 +227,9 @@
<div class="bottom-item" v-if="tabIndex == 3"> <div class="bottom-item" v-if="tabIndex == 3">
<Routing :dsId="dsId"/> <Routing :dsId="dsId"/>
</div> </div>
<div class="bottom-item" v-if="tabIndex == 4">
<Veneer :dsId="dsId"/>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -245,10 +248,12 @@ import Interface from './interface.vue'
import Vlan from './vlan.vue' import Vlan from './vlan.vue'
import Routing from './routing.vue' import Routing from './routing.vue'
import LineChart from './LineChart.vue' import LineChart from './LineChart.vue'
import Veneer from './veneer.vue'
export default { export default {
name: "cardItem", name: "cardItem",
components: { History, Interface, Vlan, Routing, LineChart }, components: { History, Interface, Vlan, Routing, LineChart, Veneer},
data() { data() {
return { return {
DateValue: [dayjs().subtract(1, 'month').format('YYYY-MM-DD HH:mm:ss'),dayjs().format('YYYY-MM-DD HH:mm:ss')], DateValue: [dayjs().subtract(1, 'month').format('YYYY-MM-DD HH:mm:ss'),dayjs().format('YYYY-MM-DD HH:mm:ss')],
@ -258,6 +263,7 @@ export default {
{ name: '接口信息' }, { name: '接口信息' },
{ name: 'VLAN信息' }, { name: 'VLAN信息' },
{ name: '路由表信息' }, { name: '路由表信息' },
{ name: 'venner信息' },
], ],
tabIndex: 0, tabIndex: 0,
dsId:null, dsId:null,

@ -10,17 +10,17 @@
></el-table-column> ></el-table-column>
<el-table-column label="预警时间" align="center" key="occurTime" prop="occurTime"> <el-table-column label="预警时间" align="center" key="occurTime" prop="occurTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.occurTime || '--' }}</span> <span>{{ scope.row.occurTime !== undefined && scope.row.occurTime !== null ? scope.row.occurTime : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预警等级" align="center" key="level" prop="level" :show-overflow-tooltip="true"> <el-table-column label="预警等级" align="center" key="level" prop="level" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.level || '--' }}</span> <span>{{ scope.row.level !== undefined && scope.row.level !== null ? scope.row.level : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预警信息" align="center" key="message" prop="message" :show-overflow-tooltip="true"> <el-table-column label="预警信息" align="center" key="message" prop="message" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.message || '--' }}</span> <span>{{ scope.row.message !== undefined && scope.row.message !== null ? scope.row.message : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预警状态" align="center" key="status" prop="status" :show-overflow-tooltip="true"> <el-table-column label="预警状态" align="center" key="status" prop="status" :show-overflow-tooltip="true">
@ -39,7 +39,7 @@
<el-table-column label="处理人" align="center" key="handler" prop="handler" :show-overflow-tooltip="true" > <el-table-column label="处理人" align="center" key="handler" prop="handler" :show-overflow-tooltip="true" >
<template slot-scope="scope"> <template slot-scope="scope">
<span >{{ scope.row.handler || '--' }}</span> <span >{{ scope.row.handler !== undefined && scope.row.handler !== null ? scope.row.handler : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>

@ -10,12 +10,12 @@
></el-table-column> ></el-table-column>
<el-table-column label="采集时间" align="center" prop="gatherTime" width="160"> <el-table-column label="采集时间" align="center" prop="gatherTime" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.gatherTime) || '--' }}</span> <span>{{ parseTime(scope.row.gatherTime) !== undefined && parseTime(scope.row.gatherTime) !== null ? parseTime(scope.row.gatherTime) : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="接口ID" align="center" key="id" prop="id" :show-overflow-tooltip="true"> <el-table-column label="接口ID" align="center" key="id" prop="id" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.id || '--' }}</span> <span>{{ scope.row.id !== undefined && scope.row.id !== null ? scope.row.id : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="双工模式" align="center" key="commuicateMode" prop="commuicateMode" :show-overflow-tooltip="true"> <el-table-column label="双工模式" align="center" key="commuicateMode" prop="commuicateMode" :show-overflow-tooltip="true">
@ -25,37 +25,37 @@
</el-table-column> </el-table-column>
<el-table-column label="入方向流量" align="center" key="inFlow" prop="inFlow" :show-overflow-tooltip="true"> <el-table-column label="入方向流量" align="center" key="inFlow" prop="inFlow" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.inFlow || '--' }}</span> <span>{{ scope.row.inFlow !== undefined && scope.row.inFlow !== null ? scope.row.inFlow : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="出方向流量" align="center" key="outFlow" prop="outFlow" :show-overflow-tooltip="true"> <el-table-column label="出方向流量" align="center" key="outFlow" prop="outFlow" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.outFlow || '--' }}</span> <span>{{ scope.row.outFlow !== undefined && scope.row.outFlow !== null ? scope.row.outFlow : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="入方向宽带占用率%" align="center" key="inBandwidth" prop="inBandwidth" :show-overflow-tooltip="true"> <el-table-column label="入方向宽带占用率%" align="center" key="inBandwidth" prop="inBandwidth" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.inBandwidth || '--' }}</span> <span>{{ scope.row.inBandwidth !== undefined && scope.row.inBandwidth !== null ? scope.row.inBandwidth : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="出方向宽带占用率%" align="center" key="outBandwidth" prop="outBandwidth" :show-overflow-tooltip="true"> <el-table-column label="出方向宽带占用率%" align="center" key="outBandwidth" prop="outBandwidth" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.outBandwidth || '--' }}</span> <span>{{ scope.row.outBandwidth !== undefined && scope.row.outBandwidth !== null ? scope.row.outBandwidth : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="丢包率" align="center" key="lossRate" prop="lossRate" :show-overflow-tooltip="true"> <el-table-column label="丢包率" align="center" key="lossRate" prop="lossRate" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.lossRate || '--' }}</span> <span>{{ scope.row.lossRate !== undefined && scope.row.lossRate !== null ? scope.row.lossRate : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="错包率" align="center" key="errorRate" prop="errorRate" :show-overflow-tooltip="true"> <el-table-column label="错包率" align="center" key="errorRate" prop="errorRate" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.errorRate || '--' }}</span> <span>{{ scope.row.errorRate !== undefined && scope.row.errorRate !== null ? scope.row.errorRate : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="传输速率" align="center" key="rate" prop="rate" :show-overflow-tooltip="true"> <el-table-column label="传输速率" align="center" key="rate" prop="rate" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.rate || '--' }}</span> <span>{{ scope.row.rate !== undefined && scope.row.rate !== null ? scope.row.rate : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

@ -10,17 +10,17 @@
></el-table-column> ></el-table-column>
<el-table-column label="目的地址" align="center" key="desAddress" prop="desAddress" :show-overflow-tooltip="true"> <el-table-column label="目的地址" align="center" key="desAddress" prop="desAddress" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.desAddress || '--' }}</span> <span>{{ scope.row.desAddress !== undefined && scope.row.desAddress !== null ? scope.row.desAddress : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="子网掩码" align="center" key="subnetMask" prop="subnetMask" :show-overflow-tooltip="true"> <el-table-column label="子网掩码" align="center" key="subnetMask" prop="subnetMask" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.subnetMask || '--' }}</span> <span>{{ scope.row.subnetMask !== undefined && scope.row.subnetMask !== null ? scope.row.subnetMask : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="下一跳地址" align="center" key="nextHop" prop="nextHop" :show-overflow-tooltip="true"> <el-table-column label="下一跳地址" align="center" key="nextHop" prop="nextHop" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.nextHop || '--' }}</span> <span>{{ scope.row.nextHop !== undefined && scope.row.nextHop !== null ? scope.row.nextHop : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

@ -0,0 +1,93 @@
<template>
<div class="">
<el-row :gutter="20">
<el-col>
<el-table v-loading="loading" :data="userList">
<el-table-column
label="序号"
width="60"
type="index"
></el-table-column>
<el-table-column label="ID" align="center" key="id" prop="id" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.id !== undefined && scope.row.id !== null ? scope.row.id : '--' }}</span>
</template>
</el-table-column>
<el-table-column label="单板ID" align="center" key="veneerId" prop="veneerId" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.veneerId !== undefined && scope.row.veneerId !== null ? scope.row.veneerId : '--' }}</span>
</template>
</el-table-column>
<el-table-column label="设备ID" align="center" key="equId" prop="equId" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.equId !== undefined && scope.row.equId !== null ? scope.row.equId : '--' }}</span>
</template>
</el-table-column>
<el-table-column label="单板状态" align="center" key="veneerStatus" prop="veneerStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.veneerStatus !== undefined && scope.row.veneerStatus !== null ? scope.row.veneerStatus : '--' }}</span>
</template>
</el-table-column>
<el-table-column label="采集ID" align="center" key="equGatherId" prop="equGatherId" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.equGatherId !== undefined && scope.row.equGatherId !== null ? scope.row.equGatherId : '--' }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</div>
</template>
<script>
import { systemVeneer } from "@/api/inMonitoring/devicesState"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
import "splitpanes/dist/splitpanes.css"
export default {
props: {
dsId: {
type: String,
default: 'chart'
}
},
data() {
return {
//
loading: true,
//
total: 0,
//
userList: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined
},
}
},
created() {
},
watch: {
dsId: {
handler(val) {
this.getList(val)
},
deep: true,
immediate: true
}
},
methods: {
/** 查询类型列表 */
getList(id) {
this.loading = true
systemVeneer(id).then(response => {
this.userList = response.rows
this.loading = false
}
)
}
}
}
</script>

@ -10,17 +10,17 @@
></el-table-column> ></el-table-column>
<el-table-column label="ManID" align="center" key="mainId" prop="mainId" :show-overflow-tooltip="true"> <el-table-column label="ManID" align="center" key="mainId" prop="mainId" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.mainId || '--' }}</span> <span>{{ scope.row.mainId !== undefined && scope.row.mainId !== null ? scope.row.mainId : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="IP地址" align="center" key="ipAddress" prop="ipAddress" :show-overflow-tooltip="true"> <el-table-column label="IP地址" align="center" key="ipAddress" prop="ipAddress" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.ipAddress || '--' }}</span> <span>{{ scope.row.ipAddress !== undefined && scope.row.ipAddress !== null ? scope.row.ipAddress : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="子网掩码" align="center" key="subnetMask" prop="subnetMask" :show-overflow-tooltip="true"> <el-table-column label="子网掩码" align="center" key="subnetMask" prop="subnetMask" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.subnetMask || '--' }}</span> <span>{{ scope.row.subnetMask !== undefined && scope.row.subnetMask !== null ? scope.row.subnetMask : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -52,7 +52,7 @@ export default {
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 1000,
name: undefined name: undefined
}, },
} }

@ -375,7 +375,7 @@ export default {
// //
setInterval(() => { setInterval(() => {
this.refreshDeviceStatus(); this.refreshDeviceStatus();
}, 60000); }, 600000);
}, },
beforeDestroy() { beforeDestroy() {
// //

@ -0,0 +1,95 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">
<!--设备档案-->
<pane size="84">
<el-col>
<el-table v-loading="loading" :data="dataList">
<el-table-column type="selection" width="50" align="center" />
<el-table-column
label="序号"
width="60"
type="index"
></el-table-column>
<el-table-column label="消息ID" align="center" key="id" prop="id" width="80" />
<el-table-column label="用户ID" align="center" key="userId" prop="userId" width="80" />
<el-table-column label="消息内容" align="center" key="content" prop="content" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.content || '--' }}</span>
</template>
</el-table-column>
<el-table-column label="消息状态" align="center" key="status" prop="status" width="100">
<template slot-scope="scope">
<el-tag :type="scope.row.status === 'unread' ? 'primary' : 'success'">
{{ scope.row.status === 'unread' ? '未读' : '已读' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="标题" align="center" key="title" prop="title" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.title || '--' }}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
</el-col>
</pane>
</splitpanes>
</el-row>
</div>
</template>
<script>
import { messageList } from "@/api/message/index"
import { Splitpanes, Pane } from "splitpanes"
import "splitpanes/dist/splitpanes.css"
export default {
name: "Message",
components: { Splitpanes, Pane },
data() {
return {
//
loading: true,
//
total: 0,
//
dataList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
status: undefined
},
}
},
created() {
this.getList()
},
methods: {
/** 查询设备列表 */
getList() {
this.loading = true
messageList(this.queryParams).then(response => {
this.dataList = response.data || []
this.total = response.data?.length || 0
this.loading = false
}
)
},
}
}
</script>
Loading…
Cancel
Save