From fd5a166fa4f576497291062f4cbe67d8cf993d52 Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Sun, 29 Sep 2024 17:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=B5=8B=E6=95=B0=E6=8D=AE=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E5=8A=9F=E8=83=BD=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/query/DataQueryController.java | 40 + .../module/data/mqtt/MyMqttCallback.java | 9 +- .../module/data/service/DataQueryService.java | 139 +- .../data/service/IDataQueryService.java | 24 + .../mysql/gatewayinfo/GatewayInfoMapper.java | 5 + .../GatewayCardParamsServiceImpl.java | 14 + .../gatewayinfo/GatewayInfoService.java | 5 + .../gatewayinfo/GatewayInfoServiceImpl.java | 22 +- .../mapper/gatewayinfo/GatewayInfoMapper.xml | 4 + imt-ui/src/api/data/query.js | 45 + imt-ui/src/utils/dict.js | 1 + .../views/system/data/monitordata/index.vue | 1 - .../data/monitordatadashboard/index.vue | 1543 +++++++++++++++++ .../system/equip/equipdashboard/index.vue | 226 +++ 14 files changed, 2063 insertions(+), 15 deletions(-) create mode 100644 imt-ui/src/views/system/data/monitordatadashboard/index.vue create mode 100644 imt-ui/src/views/system/equip/equipdashboard/index.vue diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java index d52e332..81e82aa 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/controller/admin/query/DataQueryController.java @@ -77,6 +77,46 @@ public class DataQueryController { return success(resMap); } + @GetMapping("/getCurrentData") + @Operation(summary = "获取/查询网关电流数据列表") + @PreAuthorize("@ss.hasPermission('data:query:list')") + public CommonResult> getCurrentData(String equipId, String startTime, String endTime){ + Map resMap = dataQueryService.getCurrentData(equipId, startTime, endTime); + return success(resMap); + } + + @GetMapping("/getPressData") + @Operation(summary = "获取/查询网关液压数据列表") + @PreAuthorize("@ss.hasPermission('data:query:list')") + public CommonResult> getPressData(String equipId, String startTime, String endTime){ + Map resMap = dataQueryService.getPressData(equipId, startTime, endTime); + return success(resMap); + } + + @GetMapping("/getTempData") + @Operation(summary = "获取/查询网关温度数据列表") + @PreAuthorize("@ss.hasPermission('data:query:list')") + public CommonResult> getTempData(String equipId, String startTime, String endTime){ + Map resMap = dataQueryService.getTempData(equipId, startTime, endTime); + return success(resMap); + } + + @GetMapping("/getVibrData") + @Operation(summary = "获取/查询网关振动数据列表") + @PreAuthorize("@ss.hasPermission('data:query:list')") + public CommonResult> getVibrData(String equipId, String startTime, String endTime){ + Map resMap = dataQueryService.getVibrData(equipId, startTime, endTime); + return success(resMap); + } + + @GetMapping("/getWorkData") + @Operation(summary = "获取/查询网关工作数据列表") + @PreAuthorize("@ss.hasPermission('data:query:list')") + public CommonResult> getWorkData(String equipId, String startTime, String endTime){ + Map resMap = dataQueryService.getWorkData(equipId, startTime, endTime); + return success(resMap); + } + @GetMapping("/export-current-excel") @Operation(summary = "导出机床电流传感器参数 Excel") @PreAuthorize("@ss.hasPermission('data:query:export')") diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java index bac8540..1388e34 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/mqtt/MyMqttCallback.java @@ -90,8 +90,12 @@ public class MyMqttCallback implements MqttCallback { String deviceType = (String) map.get("deviceType"); String gatewayCode = deviceName.substring(0,17); Map mapping = getGatewayMapping(gatewayCode); + if(mapping == null){ + logger.info("未找到对应网关!"); + return; + } String msgType = (String) mapping.get(deviceType + "MsgType"); - if(map.get("msgType") != null && msgType.equals(map.get("msgType"))){ + if(map.get("msgType") != null && msgType != null && msgType.equals(map.get("msgType"))){ process((String)mapping.get(deviceType),(String)mapping.get("equipId"),(Map)mapping.get(deviceType + "Params"),(Map)map.get("msg")); }else{ logger.info("数据未存储!"); @@ -136,6 +140,9 @@ public class MyMqttCallback implements MqttCallback { private Map getGatewayMapping(String gatewayCode) { GatewayInfoService gatewayInfoService = SpringUtils.getBean(GatewayInfoService.class); GatewayInfoDO gatewayInfo = gatewayInfoService.getGatewayInfoByGatewayCode(gatewayCode); + if(gatewayInfo == null){ + return null; + } //通过配置获取 Map cardMapping = gatewayInfoService.getGatewayCardAndParamByCatch(gatewayInfo.getGatewayId()); cardMapping.put("equipId", gatewayInfo.getEquipId()); diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java index 865049b..9c8a646 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/DataQueryService.java @@ -14,6 +14,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @Author zhangjunwen @@ -57,17 +58,17 @@ public class DataQueryService implements IDataQueryService{ LocalDateTime etime = DateUtils.tranUTCtoLocalDateTime(endTime); long intervalHours = ChronoUnit.HOURS.between(stime, etime); - List> list = new ArrayList<>(); - if(intervalHours <= 6){//6小时内全查 - list = selectDataByColumnNameandDate(null,tableName, columnName, startTime, endTime); - }else if(intervalHours <= 7*24 ){//7天内,每30s一个 - list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "30s"); - }else if(intervalHours <= 30*24 ){//30天内,每2min一个 - list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "2m"); - }else if (intervalHours <= 90*24){//90天以上,每4h一个 - list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "6m"); - } - +// List> list = new ArrayList<>(); +// if(intervalHours <= 6){//6小时内全查 +// list = selectDataByColumnNameandDate(null,tableName, columnName, startTime, endTime); +// }else if(intervalHours <= 7*24 ){//7天内,每30s一个 +// list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "30s"); +// }else if(intervalHours <= 30*24 ){//30天内,每2min一个 +// list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "2m"); +// }else if (intervalHours <= 90*24){//90天以上,每6min一个 +// list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "6m"); +// } + List> list = selectDataByColumnNameandDateSegmentation(equipId, tableName, columnName, startTime, endTime, intervalHours); Map resMap = new HashMap<>(); if (list.size() == 0){ return null; @@ -89,6 +90,119 @@ public class DataQueryService implements IDataQueryService{ return resMap; } + /** + * 根据设备id获取排屑电流数据 + */ + public Map getCurrentData(String equipId, String startTime, String endTime){ + String tableName = "gateway_current_data"; + String columnName = "chip_removal_1,chip_removal_2"; + return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + } + + + /** + * 根据设备id获取液压数据 + */ + public Map getPressData(String equipId, String startTime, String endTime){ + String tableName = "gateway_hy_data"; + String columnName = "hy_1,hy_2,hy_3"; + return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + } + + /** + * 根据设备id获取温度数据 + */ + public Map getTempData(String equipId, String startTime, String endTime){ + String tableName = "gateway_temp_data"; + String columnName = "cr1_temp,cr2_temp,x0_temp,xp_temp,xn_temp,y0_temp,yp_temp,yn_temp,z0_temp,zp_temp,zn_temp"; + return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + } + + /** + * 根据设备id获取振动数据 + */ + public Map getVibrData(String equipId, String startTime, String endTime){ + String tableName = "gateway_aclr_data"; + String columnName = "x_aclr_rms,x_speed_rms,x_dis_rms,y_aclr_rms,y_speed_rms,y_dis_rms,z_aclr_rms,z_speed_rms,z_dis_rms," + + "x_aclr_peak,x_speed_peak,x_dis_peak,y_aclr_peak,y_speed_peak,y_dis_peak,z_aclr_peak,z_speed_peak,z_dis_peak"; + return getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + } + + /** + * 根据设备id获取工作数据 + */ + public Map getWorkData(String equipId, String startTime, String endTime){ + String tableName = "gateway_fanuc_data"; + String columnName = "power_time,process_num,total_process,work_time"; + Map resultMap = getAllData2ChartData(equipId,tableName,columnName, startTime, endTime); + List workTimeList = (List) resultMap.get("work_time"); + List powerTimeList = (List) resultMap.get("power_time"); + resultMap.put("work_time", workTimeList.stream().map(w -> w / 60.0).collect(Collectors.toList())); + resultMap.put("power_time", powerTimeList.stream().map(p -> p / 60.0).collect(Collectors.toList())); + return resultMap; + } + + public Map getAllData2ChartData(String equipId,String tableName,String columns, String startTime, String endTime){ + LocalDateTime stime = DateUtils.tranUTCtoLocalDateTime(startTime); + LocalDateTime etime = DateUtils.tranUTCtoLocalDateTime(endTime); + long intervalHours = ChronoUnit.HOURS.between(stime, etime); + List> list = selectDataByColumnNameandDateSegmentation(equipId, tableName, columns, startTime, endTime, intervalHours); + Map resMap = new HashMap<>(); + if (list.size() == 0){ + return null; + } + + List columnList = new ArrayList<>(); + List timelist = new ArrayList<>(); + String[] columnName = columns.split(","); + if(intervalHours > 6){ + for(int i=0;i < columnName.length;i++){ + columnName[i] = "mean_" + columnName[i]; + } + + } + for (String cn : columnName) { + if(cn.trim().length() == 0){ + continue; + } + String realCn = cn; + if(cn.startsWith("mean")){ + realCn = cn.replaceFirst("mean_", ""); + } + resMap.put(realCn, list.stream().map(map->{ + Double data = (Double)map.get(cn); + if("gateway_temp_data".equals(tableName)){//温度处理 + return data/10.0; + } + if("work_time".equals(columnName) || "power_time".equals(columnName)){//时间转小时 + return data/60.0; + } + return data; + }).collect(Collectors.toList())); + resMap.put("time", list.stream().map(map -> DateUtils.utcToCst(map.get("time").toString())).collect(Collectors.toList())); + } + + return resMap; + } + + /** + *按照策略分段查询数据列表 + */ + private List> selectDataByColumnNameandDateSegmentation(String equipId, String tableName, String columnName, String startTime, String endTime,long intervalHours) + { + List> list = new ArrayList<>(); + if(intervalHours <= 6){//6小时内全查 + list = selectDataByColumnNameandDate(null,tableName, columnName, startTime, endTime); + }else if(intervalHours <= 7*24 ){//7天内,每30s一个 + list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "30s"); + }else if(intervalHours <= 30*24 ){//30天内,每2min一个 + list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "2m"); + }else if (intervalHours <= 90*24){//90天以上,每6min一个 + list = selectLongTimeDataByColumnNameandDate(null,tableName, columnName, startTime, endTime, "6m"); + } + return list; + } + private List> queryDataByTime(String tableName, String equipId, String beginTime, String endTime, Integer pageNum, Integer pageSize) { StringBuilder sql = new StringBuilder("select * from ") .append("\"").append(tableName).append("\""); @@ -184,6 +298,9 @@ public class DataQueryService implements IDataQueryService{ * 查询长时间数据,每分钟取一条展示(最长3个月) */ private List> selectLongTimeDataByColumnNameandDate(String equipId,String tableName, String columnName, String beginTime, String endTime, String interval){ + if(columnName.split(",").length > 1){ + columnName = "*"; + } StringBuilder sql = new StringBuilder("select time, mean(").append(columnName).append(") from ") .append("\"").append(tableName).append("\""); if(equipId != null){ diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/IDataQueryService.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/IDataQueryService.java index 45bb76c..5a1bdc5 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/IDataQueryService.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/service/IDataQueryService.java @@ -22,4 +22,28 @@ public interface IDataQueryService { */ public Map queryDataListByColumnNameandDate(String equipId, String tableName, String columnName, String startTime, String endTime) throws ParseException; + /** + * 根据设备id获取排屑电流数据 + */ + public Map getCurrentData(String equipId, String startTime, String endTime); + + /** + * 根据设备id获取液压数据 + */ + public Map getPressData(String equipId, String startTime, String endTime); + + /** + * 根据设备id获取温度数据 + */ + public Map getTempData(String equipId, String startTime, String endTime); + + /** + * 根据设备id获取振动数据 + */ + public Map getVibrData(String equipId, String startTime, String endTime); + + /** + * 根据设备id获取工作数据 + */ + public Map getWorkData(String equipId, String startTime, String endTime); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java index 469fb11..e3b5126 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/gatewayinfo/GatewayInfoMapper.java @@ -43,4 +43,9 @@ public interface GatewayInfoMapper extends BaseMapperX { * 根据网关编号查询网关信息 */ public GatewayInfoDO selectGatewayByGatewayCode(@Param("gatewayCode") String gatewayCode); + + /** + * 获取网关信息列表 + */ + public List selectAllGatewayList(); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java index 5f95623..6355f34 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayCardParamsServiceImpl.java @@ -1,11 +1,14 @@ package com.inspur.module.system.service.gatewayinfo; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.concurrent.TimeUnit; + import com.inspur.module.system.controller.admin.gatewayinfo.vo.*; import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayCardParamsDO; import com.inspur.framework.common.pojo.PageResult; @@ -29,6 +32,9 @@ public class GatewayCardParamsServiceImpl implements GatewayCardParamsService { @Resource private GatewayCardParamsMapper gatewayCardParamsMapper; + @Resource + private StringRedisTemplate stringRedisTemplate; + @Override public String createGatewayCardParams(GatewayCardParamsSaveReqVO createReqVO) { // 插入 @@ -46,6 +52,10 @@ public class GatewayCardParamsServiceImpl implements GatewayCardParamsService { if(paramsList.isEmpty()){ return true; } + String gatewayId = paramsList.get(0).getGatewayId(); + if(Boolean.TRUE.equals(stringRedisTemplate.hasKey("cardmapping_" + gatewayId))){ + stringRedisTemplate.delete("cardmapping_" + gatewayId); + } List gatewayCardParamsList = BeanUtils.toBean(paramsList, GatewayCardParamsDO.class); return gatewayCardParamsMapper.insertBatch(gatewayCardParamsList); } @@ -66,6 +76,10 @@ public class GatewayCardParamsServiceImpl implements GatewayCardParamsService { if (paramsList.isEmpty()){ return true; } + String gatewayId = paramsList.get(0).getGatewayId(); + if(Boolean.TRUE.equals(stringRedisTemplate.hasKey("cardmapping_" + gatewayId))){ + stringRedisTemplate.delete("cardmapping_" + gatewayId); + } List gatewayCardParamsList = BeanUtils.toBean(paramsList, GatewayCardParamsDO.class); return gatewayCardParamsMapper.updateBatch(gatewayCardParamsList); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java index ef36f60..565deb8 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoService.java @@ -53,6 +53,11 @@ public interface GatewayInfoService { */ PageResult getGatewayInfoPage(GatewayInfoPageReqVO pageReqVO); + /** + * 获取机床网关列表 + */ + List getGatewayInfoList(); + /** * 根据机床网关编号获取机床网关信息 */ diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java index 5d8184b..1d2040c 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/gatewayinfo/GatewayInfoServiceImpl.java @@ -10,6 +10,7 @@ import com.inspur.module.system.dal.dataobject.gatewayinfo.GatewayCardParamsDO; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; +import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -49,6 +50,15 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { @Resource private StringRedisTemplate stringRedisTemplate; + @PostConstruct + public void init() { + List gatewayInfoList = getGatewayInfoList(); + + for (GatewayInfoDO gatewayInfo : gatewayInfoList) { + getGatewayCardAndParamByCatch(gatewayInfo.getGatewayId()); + } + } + @Override @TenantIgnore public String createGatewayInfo(GatewayInfoSaveReqVO createReqVO) { @@ -100,6 +110,14 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { return new PageResult<>(page.getRecords(), page.getTotal()); } + /** + * 获取机床网关列表 + */ + @Override + public List getGatewayInfoList(){ + return gatewayInfoMapper.selectAllGatewayList(); + } + /** * 根据机床网关编号获取机床网关信息 */ @@ -117,12 +135,12 @@ public class GatewayInfoServiceImpl implements GatewayInfoService { public Map getGatewayCardAndParamByCatch(String gatewayId){ //先从缓存中获取 if(Boolean.TRUE.equals(stringRedisTemplate.hasKey("cardmapping_" + gatewayId))){ - return JsonUtils.parseObject(stringRedisTemplate.opsForValue().get("gateway_" + gatewayId), Map.class); + return JsonUtils.parseObject(stringRedisTemplate.opsForValue().get("cardmapping_" + gatewayId), Map.class); } //获取网卡信息 List cardList = gatewayCardInfoService.getGatewayCardInfoListByGatewayId(gatewayId); //获取参数信息 - List paramsList = gatewayCardParamsService.getGatewayCardParamsByCardId(gatewayId); + List paramsList = gatewayCardParamsService.getGatewayCardParamsByGatewayId(gatewayId); if(cardList.size() == 0 || paramsList.size() == 0){ return null; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml index 0a5b327..6c7c94e 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/gatewayinfo/GatewayInfoMapper.xml @@ -50,4 +50,8 @@ and igi.status = 0 and igi.deleted = '0' + + \ No newline at end of file diff --git a/imt-ui/src/api/data/query.js b/imt-ui/src/api/data/query.js index b1baa8a..17e3df2 100644 --- a/imt-ui/src/api/data/query.js +++ b/imt-ui/src/api/data/query.js @@ -67,3 +67,48 @@ export function exportProcessDataExcel(params) { responseType: "blob", }); } + +// 根据设备id和时间获取电流数据 +export function getCurrentData(params) { + return request({ + url: "/data/query/getCurrentData", + method: "get", + params: params, + }); +} + +// 根据设备id和时间获取液压数据 +export function getPressData(params) { + return request({ + url: "/data/query/getPressData", + method: "get", + params: params, + }); +} + +// 根据设备id和时间获取温度数据 +export function getTempData(params) { + return request({ + url: "/data/query/getTempData", + method: "get", + params: params, + }); +} + +// 根据设备id和时间获取振动数据 +export function getVibrData(params) { + return request({ + url: "/data/query/getVibrData", + method: "get", + params: params, + }); +} + +// 根据设备id和时间获取振动数据 +export function getWorkData(params) { + return request({ + url: "/data/query/getWorkData", + method: "get", + params: params, + }); +} diff --git a/imt-ui/src/utils/dict.js b/imt-ui/src/utils/dict.js index 9c10eef..0f8f965 100644 --- a/imt-ui/src/utils/dict.js +++ b/imt-ui/src/utils/dict.js @@ -33,6 +33,7 @@ export const DICT_TYPE = { ALARM_TYPE: "equip_alarm_type", CARD_TYPE: "card_type", MSG_TYPE: "msg_type", + EQUIP_RUN_STATUS: "equip_run_status", // ========== SYSTEM 模块 ========== SYSTEM_USER_SEX: "system_user_sex", SYSTEM_MENU_TYPE: "system_menu_type", diff --git a/imt-ui/src/views/system/data/monitordata/index.vue b/imt-ui/src/views/system/data/monitordata/index.vue index 75afb2e..bba3121 100644 --- a/imt-ui/src/views/system/data/monitordata/index.vue +++ b/imt-ui/src/views/system/data/monitordata/index.vue @@ -624,7 +624,6 @@ export default { if (this.datetime == null) { this.datetime = this.getDefaultTimeRange(); } - // this.stopRefresh(); let startTime = new Date(this.datetime[0]); this.queryParams.startTime = startTime.toISOString(); let endTime = new Date(this.datetime[1]); diff --git a/imt-ui/src/views/system/data/monitordatadashboard/index.vue b/imt-ui/src/views/system/data/monitordatadashboard/index.vue new file mode 100644 index 0000000..861655e --- /dev/null +++ b/imt-ui/src/views/system/data/monitordatadashboard/index.vue @@ -0,0 +1,1543 @@ + + + + \ No newline at end of file diff --git a/imt-ui/src/views/system/equip/equipdashboard/index.vue b/imt-ui/src/views/system/equip/equipdashboard/index.vue new file mode 100644 index 0000000..75019a4 --- /dev/null +++ b/imt-ui/src/views/system/equip/equipdashboard/index.vue @@ -0,0 +1,226 @@ + + +