From 0cf75ce5557929ced4c3f69e057f9daa777e9a37 Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Tue, 7 Oct 2025 10:16:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?10.7=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99lis?= =?UTF-8?q?t=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AlertRuleController.java | 5 +- .../com/alops/system/domain/AlertRule.java | 1 + .../alops/system/domain/vo/AlertRuleVo.java | 75 +++++++++++++++++++ .../system/domain/vo/queryEquBaseVO.java | 6 +- .../alops/system/mapper/AlertRuleMapper.java | 7 +- .../system/service/IAlertRuleService.java | 5 +- .../service/impl/AlertRuleServiceImpl.java | 13 ++-- .../mapper/system/AlertRuleMapper.xml | 55 +++++++++++--- 8 files changed, 139 insertions(+), 28 deletions(-) create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertRuleVo.java diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java index 8a7dfce0..d2aaeff3 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java @@ -12,6 +12,7 @@ import com.alops.common.enums.BusinessType; import com.alops.common.utils.poi.ExcelUtil; import com.alops.system.domain.AlertRule; import com.alops.system.domain.dto.AlertRuleAddDto; +import com.alops.system.domain.vo.AlertRuleVo; import com.alops.system.service.IAlertLaunchService; import com.alops.system.service.IAlertRuleService; import com.alops.system.service.IDictAlarmParamService; @@ -55,7 +56,7 @@ public class AlertRuleController extends BaseController { try { - AlertRule alertRule = alertRuleService.saveRule(dto); + AlertRuleVo alertRule = alertRuleService.saveRule(dto); return AjaxResult.success("预警规则新增成功", alertRule); } catch (Exception e) { e.printStackTrace(); @@ -89,7 +90,7 @@ public class AlertRuleController extends BaseController { @ApiOperation("查询预警规则") public TableDataInfo list(AlertRule alertRule) { startPage(); - List list = alertRuleService.selectAlertRuleList(alertRule); + List list = alertRuleService.selectAlertRuleList(alertRule); return getDataTable(list); } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java index ff6a59fe..1a593e09 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java @@ -62,6 +62,7 @@ public class AlertRule extends BaseEntity + public void setId(Long id) { this.id = id; diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertRuleVo.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertRuleVo.java new file mode 100644 index 00000000..b790d1f8 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/AlertRuleVo.java @@ -0,0 +1,75 @@ +package com.alops.system.domain.vo; + +import com.alops.common.annotation.Excel; +import com.alops.common.core.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.util.Date; + +@Data +public class AlertRuleVo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 预警规则名称 */ + @Excel(name = "预警规则名称") + private String ruleName; + + /** 预警级别 */ + @Excel(name = "预警级别") + private Long severity; + + /** 预警方式(email/message) */ + @Excel(name = "预警方式(email/message)") + private String alertWay; + + /** 预警到站方 */ + @Excel(name = "预警到站方") + private String alertStation; + + /** 预警规则内容描述 */ + @Excel(name = "预警规则内容描述") + private String description; + + /** 启用状态(0为启用) */ + @Excel(name = "启用状态", readConverterExp = "0=为启用") + private Integer enable; + + /** 表格名称 */ + @Excel(name = "表格名称") + private String tableName; + + /** 预警sql语句查询 */ + @Excel(name = "预警sql语句查询") + @JsonIgnore + private String alertSql; + + /** 预警模版(参数用数据库命名法) */ + @Excel(name = "预警模版", readConverterExp = "参=数用数据库命名法") + private String alertTemplate; + + /** 预警类型 */ + @Excel(name = "预警类型") + private String type; + + /** 参数名称 */ + @Excel(name = "参数名称") + private String paramName; + + /** 比较符号 */ + @Excel(name = "比较符号") + private String operator; + + /** 比较值 */ + @Excel(name = "比较值") + private String compareValue; + + + + +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java index 4c30a6ef..c806e4e0 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java @@ -59,7 +59,7 @@ public class queryEquBaseVO { /** 安装日期 */ @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd") + @Excel(name = "安装日期", width = 30) private Date installDate; /** 预计年限(年) */ @@ -78,8 +78,8 @@ public class queryEquBaseVO { @Excel(name = "健康度") private BigDecimal health; /** 添加日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "添加日期", width = 30) private Date createDate; /** 启用状态 */ @Excel(name = "启用状态") diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java index b0dc7705..6c51a8e4 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java @@ -2,6 +2,7 @@ package com.alops.system.mapper; import com.alops.system.domain.AlertRule; import com.alops.system.domain.dto.AlertRuleAddDto; +import com.alops.system.domain.vo.AlertRuleVo; import org.apache.ibatis.annotations.Mapper; import org.springframework.data.repository.query.Param; @@ -26,15 +27,15 @@ public interface AlertRuleMapper * @param id 【请填写功能名称】主键 * @return 【请填写功能名称】 */ - public AlertRule selectAlertRuleById(Long id); - + public AlertRuleVo selectAlertRuleById(Long id); + public AlertRule selectAlertRuleByToId(Long id); /** * 查询【请填写功能名称】列表 * * @param alertRule 【请填写功能名称】 * @return 【请填写功能名称】集合 */ - public List selectAlertRuleList(AlertRule alertRule); + public List selectAlertRuleList(AlertRule alertRule); /** * 新增【请填写功能名称】 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java index ee90857d..0ec2269b 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java @@ -2,6 +2,7 @@ package com.alops.system.service; import com.alops.system.domain.AlertRule; import com.alops.system.domain.dto.AlertRuleAddDto; +import com.alops.system.domain.vo.AlertRuleVo; import java.util.List; import java.util.Map; @@ -15,7 +16,7 @@ import java.util.Map; public interface IAlertRuleService { - public AlertRule saveRule(AlertRuleAddDto dto); + public AlertRuleVo saveRule(AlertRuleAddDto dto); public AlertRule updateRule(AlertRuleAddDto dto); @@ -40,7 +41,7 @@ public interface IAlertRuleService * @param alertRule 【请填写功能名称】 * @return 【请填写功能名称】集合 */ - public List selectAlertRuleList(AlertRule alertRule); + public List selectAlertRuleList(AlertRule alertRule); /** * 新增【请填写功能名称】 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java index 0cd383f0..bad959f0 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java @@ -8,6 +8,7 @@ import com.alops.common.utils.SecurityUtils; import com.alops.system.domain.AlertRule; import com.alops.system.domain.AlertRuleCondition; import com.alops.system.domain.dto.AlertRuleAddDto; +import com.alops.system.domain.vo.AlertRuleVo; import com.alops.system.mapper.AlertRuleConditionMapper; import com.alops.system.mapper.AlertRuleMapper; import com.alops.system.service.IAlertRuleService; @@ -37,7 +38,7 @@ public class AlertRuleServiceImpl implements IAlertRuleService */ @Override - public AlertRule saveRule(AlertRuleAddDto dto) { + public AlertRuleVo saveRule(AlertRuleAddDto dto) { Long userId = SecurityUtils.getLoginUser().getUserId(); AlertRule rule = dto.getAlertRule(); @@ -67,7 +68,7 @@ public class AlertRuleServiceImpl implements IAlertRuleService alertRuleConditionMapper.insertAlertRuleCondition(c); } } - AlertRule fullRule = alertRuleMapper.selectAlertRuleById(rule.getId()); + AlertRuleVo fullRule = alertRuleMapper.selectAlertRuleById(rule.getId()); return fullRule; } @@ -104,14 +105,14 @@ public class AlertRuleServiceImpl implements IAlertRuleService alertRuleConditionMapper.insertAlertRuleCondition(c); } } - AlertRule fullRule = alertRuleMapper.selectAlertRuleById(rule.getId()); + AlertRule fullRule = alertRuleMapper.selectAlertRuleByToId(rule.getId()); return fullRule; } @Override public AlertRuleAddDto selectDetailAlertRuleById(Long id) { // 1. 查询主表 - AlertRule rule = alertRuleMapper.selectAlertRuleById(id); + AlertRule rule = alertRuleMapper.selectAlertRuleByToId(id); if (rule == null) { return null; } @@ -316,7 +317,7 @@ public class AlertRuleServiceImpl implements IAlertRuleService @Override public AlertRule selectAlertRuleById(Long id) { - return alertRuleMapper.selectAlertRuleById(id); + return alertRuleMapper.selectAlertRuleByToId(id); } /** @@ -326,7 +327,7 @@ public class AlertRuleServiceImpl implements IAlertRuleService * @return 【请填写功能名称】 */ @Override - public List selectAlertRuleList(AlertRule alertRule) + public List selectAlertRuleList(AlertRule alertRule) { return alertRuleMapper.selectAlertRuleList(alertRule); } diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml index 9c3b690a..495e3d76 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml @@ -31,18 +31,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT ar.id, - ar.rule_name, + ar.rule_name AS ruleName, ar.severity, - ar.alert_way, - ar.alert_station, + ar.alert_way AS alertWay, + ar.alert_station AS alertStation, ar.description, ar.enable, - ar.create_time, - ar.update_time, - su1.user_name AS create_by, - su2.user_name AS update_by, - ar.table_name, - ar.alert_sql, + ar.create_time as createTime, + ar.update_time as updateTime, + su1.user_name AS createBy, + su2.user_name AS updateBy, + ar.table_name as tableName, + ar.alert_sql AS alertSql, + ar.alert_template AS alertTemplate, + ar.type, + ac.param_name AS paramName, + ac.operator, + ac.compare_value AS compareValue + FROM alert_rule ar + LEFT JOIN sys_user su1 ON ar.create_by = su1.user_id + LEFT JOIN sys_user su2 ON ar.update_by = su2.user_id + LEFT JOIN alert_rule_condition ac ON ar.id = ac.alert_rule_id + + + + SELECT + ar.id, + ar.rule_name , + ar.severity, + ar.alert_way , + ar.alert_station , + ar.description, + ar.enable, + ar.create_time , + ar.update_time , + su1.user_name as create_by, + su2.user_name as update_by, + ar.table_name , + ar.alert_sql , ar.alert_template, ar.type FROM alert_rule ar @@ -50,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN sys_user su2 ON ar.update_by = su2.user_id - and ar.rule_name like concat('%', #{ruleName}, '%') @@ -65,9 +91,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - where id = #{id} + where ar.id = #{id} + + + From a548944f679dcd550977e4f9d341930a0e80ded1 Mon Sep 17 00:00:00 2001 From: Wangxin Date: Tue, 7 Oct 2025 17:00:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90web=E3=80=91=20=E9=A6=96=E9=A1=B5U?= =?UTF-8?q?I=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/inMonitoring/devicesState.js | 2 +- ALOps_sys_fe/alops-ui/src/api/index/index.js | 92 ++ ALOps_sys_fe/alops-ui/src/router/index.js | 2 +- .../alops-ui/src/views/device/files/index.vue | 10 +- .../inMonitoring/devicesState/cardItem.vue | 514 +++++++++-- .../inMonitoring/devicesState/detail.vue | 839 ++++++++++++++---- .../inMonitoring/devicesState/history.vue | 69 ++ .../views/inMonitoring/devicesState/index.vue | 30 +- .../inMonitoring/inMonitor/message/index.vue | 3 - .../inMonitoring/inMonitor/rules/index.vue | 4 +- ALOps_sys_fe/alops-ui/src/views/index.vue | 91 +- 11 files changed, 1398 insertions(+), 258 deletions(-) create mode 100644 ALOps_sys_fe/alops-ui/src/api/index/index.js create mode 100644 ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/history.vue diff --git a/ALOps_sys_fe/alops-ui/src/api/inMonitoring/devicesState.js b/ALOps_sys_fe/alops-ui/src/api/inMonitoring/devicesState.js index eb99e9e3..5ead40a8 100644 --- a/ALOps_sys_fe/alops-ui/src/api/inMonitoring/devicesState.js +++ b/ALOps_sys_fe/alops-ui/src/api/inMonitoring/devicesState.js @@ -5,7 +5,7 @@ const api = '/device/files/' // 查询多台设备列表 export function list(query) { return request({ - url: api + 'listMonitor', + url: api + 'list', method: 'get', params: query }) diff --git a/ALOps_sys_fe/alops-ui/src/api/index/index.js b/ALOps_sys_fe/alops-ui/src/api/index/index.js new file mode 100644 index 00000000..858aa7a0 --- /dev/null +++ b/ALOps_sys_fe/alops-ui/src/api/index/index.js @@ -0,0 +1,92 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; +const api = '/device/files/' + +// 查询详细 +export function getDict() { + return request({ + url: '/sys_dict', + method: 'get' + }) +} + +// 预警信息统 +export function statistic(query) { + return request({ + url: 'inMonitoring/statistic', + method: 'get', + params: query + }) +} + +// 统计预警信息次数 +export function alertMessageTimes(query) { + return request({ + url: 'inMonitoring/alertMessage/times', + method: 'get', + params: query + }) +} + +// 按设备类型分类统计设备信息 +export function byEquType() { + return request({ + url: 'device/files/byEquType', + method: 'get' + }) +} + +// 设备运行状态 +export function listMonitor(query) { + return request({ + url: 'device/files/monitorById', + method: 'get', + params: query + }) +} + + + + + + + + + +// 查询详细 +export function getInfo(id) { + return request({ + url: api + '/queryById/' + parseStrEmpty(id), + method: 'get' + }) +} + +// 新增 +export function add(data) { + return request({ + url: api + 'add', + method: 'post', + data: data + }) +} + +// 修改 +export function update(data) { + return request({ + url: api + 'modify', + method: 'put', + data: data + }) +} + +// 删除 +export function del(id) { + return request({ + url: api + id, + method: 'delete' + }) +} + + + + diff --git a/ALOps_sys_fe/alops-ui/src/router/index.js b/ALOps_sys_fe/alops-ui/src/router/index.js index 02ed4a52..904eb925 100644 --- a/ALOps_sys_fe/alops-ui/src/router/index.js +++ b/ALOps_sys_fe/alops-ui/src/router/index.js @@ -99,7 +99,7 @@ export const dynamicRoutes = [ permissions: ['inMonitoring:devicesState:edit'], children: [ { - path: 'detail/:userId(\\d+)', + path: 'detail/:userId', component: () => import('@/views/inMonitoring/devicesState/detail'), name: 'DevicesStateDetail', meta: { title: '设备详情', activeMenu: '/inMonitoring/devicesState-detail' } diff --git a/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue b/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue index 4185cba1..7b1d03db 100644 --- a/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue @@ -33,9 +33,9 @@ 删除 - + @@ -119,7 +119,9 @@ - + + + @@ -205,7 +207,7 @@ import "splitpanes/dist/splitpanes.css" export default { name: "User", - dicts: ['device_disable', 'sys_user_sex'], + dicts: ['device_disable', 'sys_user_sex', 'warning_level'], components: { Treeselect, Splitpanes, Pane }, data() { return { diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue index 445debfc..378dbb81 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/cardItem.vue @@ -1,75 +1,485 @@ \ No newline at end of file + + \ No newline at end of file diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue index c6aeb13f..59c8768a 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/detail.vue @@ -1,198 +1,679 @@ - \ No newline at end of file + .tab-top{ + display: flex; + gap: 20px; + } + .top-item{ + color: #2d3748; + font-weight: 400; + font-size:18px ; + cursor: pointer; + } + .top-item.ac{ + font-weight: 600; + border-bottom: 2px solid #2d3748; + } + \ No newline at end of file diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/history.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/history.vue new file mode 100644 index 00000000..f9828db3 --- /dev/null +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/history.vue @@ -0,0 +1,69 @@ + + + \ No newline at end of file diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/index.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/index.vue index 8a4bf9e2..d71f7257 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/devicesState/index.vue @@ -36,12 +36,10 @@ -
+
- - - - + +
@@ -148,7 +146,7 @@ \ No newline at end of file + + \ No newline at end of file diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue index 3f7ad5e9..0fdf7a3a 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/message/index.vue @@ -19,9 +19,6 @@ - - - 搜索 重置 diff --git a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue index 5800c083..fcd5b1c1 100644 --- a/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/inMonitoring/inMonitor/rules/index.vue @@ -7,7 +7,7 @@ - + @@ -112,7 +112,7 @@ - + diff --git a/ALOps_sys_fe/alops-ui/src/views/index.vue b/ALOps_sys_fe/alops-ui/src/views/index.vue index d35b56a4..3c06caf7 100644 --- a/ALOps_sys_fe/alops-ui/src/views/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/index.vue @@ -7,7 +7,7 @@
-

预警信息统计1

+

预警信息统计

@@ -132,6 +132,12 @@ import RaddarChart from './dashboard/RaddarChart' import PieChart from './dashboard/PieChart' import BarChart from './dashboard/BarChart' import digital from './dashboard/digital' +import { statistic, byEquType, listMonitor, alertMessageTimes } from "@/api/index/index" +import { getToken } from "@/utils/auth" +import Treeselect from "@riophae/vue-treeselect" +import "@riophae/vue-treeselect/dist/vue-treeselect.css" +import { Splitpanes, Pane } from "splitpanes" +import "splitpanes/dist/splitpanes.css" export default { name: 'Index', @@ -174,7 +180,47 @@ export default { level: 0, status: 'normal', icon: 'fas fa-check-circle' - } + }, + { + id: 1, + deviceName: 'PLC远程监控系统', + time: '2021-10-16 14:54:11', + location: '污水处理监控系统', + message: '2#电机运行状态等于1', + level: 1, + status: 'warning', + icon: 'fas fa-exclamation-circle' + }, + { + id: 2, + deviceName: 'PLC远程监控系统', + time: '2021-10-16 14:54:04', + location: '污水处理监控系统', + message: '2#电机运行状态报警恢复', + level: 0, + status: 'normal', + icon: 'fas fa-check-circle' + }, + { + id: 1, + deviceName: 'PLC远程监控系统', + time: '2021-10-16 14:54:11', + location: '污水处理监控系统', + message: '2#电机运行状态等于1', + level: 1, + status: 'warning', + icon: 'fas fa-exclamation-circle' + }, + { + id: 2, + deviceName: 'PLC远程监控系统', + time: '2021-10-16 14:54:04', + location: '污水处理监控系统', + message: '2#电机运行状态报警恢复', + level: 0, + status: 'normal', + icon: 'fas fa-check-circle' + }, ], tableHeaders: ['设备名称', '设备位置', 'CPU使用率', '内存使用率', '温度', '健康度', '设备运行时长', '采集时间'], deviceStatus: [ @@ -240,8 +286,45 @@ export default { if (health >= 80) return 'health-good'; if (health >= 60) return 'health-warning'; return 'health-critical'; - } - } + }, + getstatistic() { + this.loading = true + statistic().then(response => { + console.log("%c 🎹: getList -> response ", "font-size:16px;background-color:#624a64;color:white;", response) + this.loading = false + } + ) + }, + getbyEquType() { + this.loading = true + byEquType().then(response => { + this.loading = false + } + ) + }, + getlistMonitor() { + this.loading = true + listMonitor({id:11}).then(response => { + this.loading = false + } + ) + }, + getalertMessageTimes() { + this.loading = true + alertMessageTimes().then(response => { + this.loading = false + } + ) + }, + }, + created() { + this.getstatistic() + this.getbyEquType() + this.getlistMonitor() + this.getalertMessageTimes() + + + }, }