Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2c70a228fe
@ -73,5 +73,7 @@ public class SysIotModelFieldDto implements Serializable {
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
private Integer level;
|
||||
|
||||
|
||||
}
|
||||
|
@ -65,5 +65,6 @@ public class SysIotModelFieldExcel {
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
private Integer level;
|
||||
|
||||
}
|
||||
|
@ -66,4 +66,6 @@ public class SysIotModelFieldVo {
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
private Integer level;
|
||||
|
||||
}
|
||||
|
@ -99,4 +99,10 @@ public class SysIotModelField extends BaseEntity {
|
||||
*/
|
||||
@TableField("unit")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 离散量级别。0 提示;1告警;2 故障
|
||||
*/
|
||||
@TableField("level")
|
||||
private Integer level;
|
||||
}
|
||||
|
@ -304,6 +304,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
map.put("dataType", "*数据类型");
|
||||
map.put("visible", "是否可见(0:不可见,1:可见)");
|
||||
map.put("highSpeed", "*属性频度(0低频属性,1高频属性)");
|
||||
map.put("level","离散量级别:0提示;1告警;2故障");
|
||||
sheetDTO.setSheetName("物模型属性");
|
||||
sheetDTO.setFieldAndAlias(map);
|
||||
sheetDTO.setCollection(sysIotModelFieldVoList);
|
||||
@ -517,6 +518,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
|
||||
field.setDataType(row.get(9).toString());
|
||||
field.setVisible(ObjectUtil.isEmpty(row.get(10)) ? null : Integer.valueOf(row.get(10).toString()));
|
||||
field.setHighSpeed(Integer.valueOf(row.get(11).toString()));
|
||||
field.setLevel(ObjectUtil.isEmpty(row.get(12)) ? null : Integer.valueOf(row.get(12).toString()));
|
||||
field.setIotModelId(Long.valueOf(iotModelId));
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,26 @@
|
||||
package com.das.modules.fdr.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.das.common.result.R;
|
||||
import com.das.modules.curve.domain.dto.TheoreticalPowerCurveDto;
|
||||
import com.das.modules.curve.domain.entity.CurveItemEntity;
|
||||
import com.das.modules.curve.domain.excel.CurveItemExcel;
|
||||
import com.das.modules.equipment.entity.SysEquipment;
|
||||
import com.das.modules.fdr.domain.FileNode;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import com.das.modules.fdr.domain.dto.FileDownloadDto;
|
||||
import com.das.modules.fdr.domain.excel.SysFaultRecordingExcel;
|
||||
import com.das.modules.fdr.listener.SysFaultRecordingListener;
|
||||
import com.das.modules.fdr.service.FaultRecorderService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@ -27,6 +37,9 @@ public class FaultRecorderController {
|
||||
@Autowired
|
||||
private FaultRecorderService faultRecorderService;
|
||||
|
||||
@Autowired
|
||||
private SysFaultRecordingListener sysFaultRecordingListener;
|
||||
|
||||
@RequestMapping(value = "/files", method = RequestMethod.POST)
|
||||
public R<List<FileNode>> findList(@RequestBody JSONObject jsonObject) {
|
||||
String code = jsonObject.getString("deviceCode");
|
||||
@ -53,4 +66,35 @@ public class FaultRecorderController {
|
||||
|
||||
faultRecorderService.download(fileDownloadDto.getUrl(),httpServletResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述导出
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void exportTheoreticalPowerCurve(@RequestBody SysFaultRecordingDesc sysFaultRecordingDesc, HttpServletRequest request, HttpServletResponse response) {
|
||||
faultRecorderService.exportFaultRecordingDesc(sysFaultRecordingDesc,request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障录波描述导入
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public R<Void> importSysIotModel(String id, @RequestParam("file") MultipartFile file) throws IOException {
|
||||
sysFaultRecordingListener.setParent(Long.valueOf(id));
|
||||
ExcelReaderBuilder read = EasyExcel.read(file.getInputStream(), SysFaultRecordingExcel.class,sysFaultRecordingListener);
|
||||
read.sheet().doRead();
|
||||
return R.success("导入成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据制造商厂家型号查询故障信息描述
|
||||
* @return 信息中英文描述
|
||||
*/
|
||||
@PostMapping("/queryFdrDesc")
|
||||
public R<List<SysFaultRecordingDesc>> queryAllCurve(@RequestBody JSONObject jsonObject) {
|
||||
String madeinfactory = jsonObject.getString("madeinfactory");
|
||||
String model = jsonObject.getString("model");
|
||||
List<SysFaultRecordingDesc> sysFaultRecordingDescList = faultRecorderService.queryFaultRecordingDes(madeinfactory,model);
|
||||
return R.success(sysFaultRecordingDescList);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
package com.das.modules.fdr.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("sys_fault_recording_var_desc")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysFaultRecordingDesc {
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
@TableField("parent")
|
||||
private Long parent;
|
||||
|
||||
@TableField("variable")
|
||||
private String variable;
|
||||
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@TableField("revision")
|
||||
private Integer revision;
|
||||
|
||||
@TableField("created_by")
|
||||
private String createdBy;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("created_time")
|
||||
private Date createdTime;
|
||||
|
||||
@TableField("updated_by")
|
||||
private String updatedBy;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("updated_time")
|
||||
private Date updatedTime;
|
||||
|
||||
@TableField("unit")
|
||||
private String unit;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.das.modules.fdr.domain.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class SysFaultRecordingExcel implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "英文名称",index = 0)
|
||||
private String variable;
|
||||
/**
|
||||
* 物模型ID
|
||||
*/
|
||||
@ExcelProperty(value = "中文描述",index = 1)
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位",index = 2)
|
||||
private String unit;
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.das.modules.fdr.listener;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.utils.BeanCopyUtils;
|
||||
import com.das.common.utils.CommonFunction;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import com.das.modules.fdr.domain.excel.SysFaultRecordingExcel;
|
||||
import com.das.modules.fdr.service.impl.FaultRecorderServiceImpl;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* 物模型属性监听器
|
||||
*
|
||||
* @author huguanghan
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Data
|
||||
public class SysFaultRecordingListener extends AnalysisEventListener<SysFaultRecordingExcel> {
|
||||
@Autowired
|
||||
private FaultRecorderServiceImpl faultRecorderService;
|
||||
|
||||
public SysFaultRecordingListener(FaultRecorderServiceImpl faultRecorderService) {
|
||||
this.faultRecorderService = faultRecorderService;
|
||||
}
|
||||
|
||||
//parentId
|
||||
private Long parent;
|
||||
|
||||
/**计数标记*/
|
||||
private Integer flag=0;
|
||||
|
||||
/**存放插入*/
|
||||
ArrayList<SysFaultRecordingDesc> sysFaultRecordingDescArrayList = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
public void invoke(SysFaultRecordingExcel sysFaultRecordingExcel, AnalysisContext analysisContext) {
|
||||
// 如果一行Excel数据均为空值,则不装载该行数据
|
||||
if (CommonFunction.objCheckIsNull(sysFaultRecordingExcel)) {
|
||||
return;
|
||||
}
|
||||
log.info("解析到一条数据:{}", JSON.toJSONString(sysFaultRecordingExcel));
|
||||
SysFaultRecordingDesc sysFaultRecordingDesc = new SysFaultRecordingDesc();
|
||||
BeanCopyUtils.copy(sysFaultRecordingExcel, sysFaultRecordingDesc);
|
||||
sysFaultRecordingDesc.setParent(parent);
|
||||
//加入集合
|
||||
sysFaultRecordingDescArrayList.add(sysFaultRecordingDesc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
//确保最后遗留的数据也存储到数据库
|
||||
if (!sysFaultRecordingDescArrayList.isEmpty()){
|
||||
saveData();
|
||||
}
|
||||
log.info("所有数据解析完成!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 存储数据库
|
||||
* @return
|
||||
*/
|
||||
private void saveData() {
|
||||
log.info("{}条数据,开始存储数据库!", flag);
|
||||
try {
|
||||
faultRecorderService.batchProcessing(sysFaultRecordingDescArrayList,parent);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getMessage());
|
||||
}finally {
|
||||
clear();
|
||||
}
|
||||
log.info("存储数据库成功!");
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
//清理缓存
|
||||
sysFaultRecordingDescArrayList.clear();
|
||||
flag=0;
|
||||
log.info("缓存已清理");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,10 @@
|
||||
package com.das.modules.fdr.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SysFaultRecordingDescMapper extends BaseMapper<SysFaultRecordingDesc> {
|
||||
|
||||
}
|
@ -2,6 +2,8 @@ package com.das.modules.fdr.service;
|
||||
|
||||
import com.das.modules.equipment.entity.SysEquipment;
|
||||
import com.das.modules.fdr.domain.FileNode;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -23,4 +25,8 @@ public interface FaultRecorderService {
|
||||
String upload(String parent, String folderName, MultipartFile file);
|
||||
|
||||
void readFileToSteam(String path, OutputStream stream);
|
||||
|
||||
void exportFaultRecordingDesc(SysFaultRecordingDesc sysFaultRecordingDesc, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
List<SysFaultRecordingDesc> queryFaultRecordingDes(String madeinfactory, String model);
|
||||
}
|
||||
|
@ -1,19 +1,30 @@
|
||||
package com.das.modules.fdr.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.das.common.config.SessionUtil;
|
||||
import com.das.common.constant.FileConstants;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.utils.HuExcelUtils;
|
||||
import com.das.modules.auth.domain.vo.SysUserVo;
|
||||
import com.das.modules.curve.domain.entity.CurveItemEntity;
|
||||
import com.das.modules.curve.domain.entity.TheoreticalPowerCurveEntity;
|
||||
import com.das.modules.curve.mapper.TheoreticalPowerCurveMapper;
|
||||
import com.das.modules.equipment.domain.excel.SheetInfoBean;
|
||||
import com.das.modules.equipment.entity.SysEquipment;
|
||||
import com.das.modules.equipment.mapper.SysEquipmentMapper;
|
||||
import com.das.modules.fdr.config.MinioProperties;
|
||||
import com.das.modules.fdr.domain.FileNode;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import com.das.modules.fdr.domain.vo.FdrFormatVo;
|
||||
import com.das.modules.fdr.domain.vo.FileParseConfig;
|
||||
import com.das.modules.fdr.mapper.SysFaultRecordingDescMapper;
|
||||
import com.das.modules.fdr.service.FaultRecorderService;
|
||||
import com.das.modules.fdr.service.MinioViewsServcie;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import io.minio.MinioClient;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -46,6 +57,12 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
|
||||
@Autowired
|
||||
private SysEquipmentMapper sysEquipmentMapper;
|
||||
|
||||
@Autowired
|
||||
private SysFaultRecordingDescMapper sysFaultRecordingDescMapper;
|
||||
|
||||
@Autowired
|
||||
private TheoreticalPowerCurveMapper theoreticalPowerCurveMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<FileNode> getDirOrFileList(String fileType,String name, String startTime, String endTime) {
|
||||
@ -72,6 +89,38 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
|
||||
minioViewsServcie.readFileToStream(path, stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportFaultRecordingDesc(SysFaultRecordingDesc sysFaultRecordingDesc, HttpServletRequest request, HttpServletResponse response) {
|
||||
List<SheetInfoBean> exportList = new ArrayList<>();
|
||||
QueryWrapper<SysFaultRecordingDesc> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("PARENT",sysFaultRecordingDesc.getId());
|
||||
queryWrapper.orderByAsc("variable");
|
||||
List<SysFaultRecordingDesc> sysFaultRecordingDescList = sysFaultRecordingDescMapper.selectList(queryWrapper);
|
||||
TheoreticalPowerCurveEntity theoreticalPowerCurve = theoreticalPowerCurveMapper.selectById(sysFaultRecordingDesc.getId());
|
||||
LinkedHashMap<String, String> map = new LinkedHashMap<>();
|
||||
SheetInfoBean sheetDTO = new SheetInfoBean();
|
||||
map.put("variable", "英文名称");
|
||||
map.put("description", "中文描述");
|
||||
map.put("unit","单位");
|
||||
sheetDTO.setSheetName(theoreticalPowerCurve.getMadeinfactory());
|
||||
sheetDTO.setFieldAndAlias(map);
|
||||
sheetDTO.setCollection(sysFaultRecordingDescList);
|
||||
exportList.add(sheetDTO);
|
||||
HuExcelUtils.exportExcel(response, exportList, theoreticalPowerCurve.getMadeinfactory()+theoreticalPowerCurve.getModel()+"故障录波日志变量描述");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysFaultRecordingDesc> queryFaultRecordingDes(String madeinfactory, String model) {
|
||||
QueryWrapper<TheoreticalPowerCurveEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("madeinfactory",madeinfactory);
|
||||
queryWrapper.eq("MODEL",model);
|
||||
TheoreticalPowerCurveEntity theoreticalPowerCurveEntity = theoreticalPowerCurveMapper.selectOne(queryWrapper);
|
||||
QueryWrapper<SysFaultRecordingDesc> sysFaultRecordingDescQueryWrapper = new QueryWrapper<>();
|
||||
sysFaultRecordingDescQueryWrapper.eq("parent",theoreticalPowerCurveEntity.getId());
|
||||
sysFaultRecordingDescQueryWrapper.orderByAsc("variable");
|
||||
return sysFaultRecordingDescMapper.selectList(sysFaultRecordingDescQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(String path,HttpServletResponse httpServletResponse) throws IOException {
|
||||
Path tempDir = Files.createTempDirectory(null);
|
||||
@ -200,4 +249,22 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
|
||||
return sdf.parse(time).getTime();
|
||||
}
|
||||
|
||||
public void batchProcessing(List<SysFaultRecordingDesc> insertSysIotModelFieldList, Long parent) {
|
||||
//先删除制造商数据
|
||||
QueryWrapper<SysFaultRecordingDesc> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("PARENT",parent);
|
||||
sysFaultRecordingDescMapper.delete(queryWrapper);
|
||||
|
||||
//新增新的制造商数据
|
||||
for (SysFaultRecordingDesc item : insertSysIotModelFieldList){
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
item.setCreatedTime(new Date());
|
||||
item.setUpdatedTime(new Date());
|
||||
item.setCreatedBy(sysUserVo.getAccount());
|
||||
item.setUpdatedBy(sysUserVo.getAccount());
|
||||
item.setRevision(1);
|
||||
sysFaultRecordingDescMapper.insert(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,25 @@
|
||||
package com.das.modules.plc.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.das.common.result.R;
|
||||
import com.das.modules.equipment.entity.SysEquipment;
|
||||
import com.das.modules.fdr.domain.FileNode;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import com.das.modules.fdr.domain.dto.FileDownloadDto;
|
||||
import com.das.modules.fdr.domain.excel.SysFaultRecordingExcel;
|
||||
import com.das.modules.fdr.service.FaultRecorderService;
|
||||
import com.das.modules.plc.domain.Excel.SysRunLogExcel;
|
||||
import com.das.modules.plc.domain.SysRunLogDesc;
|
||||
import com.das.modules.plc.listener.SysRunLogListener;
|
||||
import com.das.modules.plc.service.PlcLogService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@ -30,6 +36,9 @@ public class PlcLogsController {
|
||||
@Autowired
|
||||
private PlcLogService plcLogService;
|
||||
|
||||
@Autowired
|
||||
private SysRunLogListener sysRunLogListener;
|
||||
|
||||
@RequestMapping(value = "/files", method = RequestMethod.POST)
|
||||
public R<List<FileNode>> findList(@RequestBody JSONObject jsonObject) {
|
||||
String code = jsonObject.getString("deviceCode");
|
||||
@ -56,4 +65,35 @@ public class PlcLogsController {
|
||||
|
||||
plcLogService.download(fileDownloadDto.getUrl(),httpServletResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述导出
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void exportTheoreticalPowerCurve(@RequestBody SysRunLogDesc sysRunLogDesc, HttpServletRequest request, HttpServletResponse response) {
|
||||
plcLogService.exportRunLogDesc(sysRunLogDesc,request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障录波描述导入
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public R<Void> importSysIotModel(String id, @RequestParam("file") MultipartFile file) throws IOException {
|
||||
sysRunLogListener.setParent(Long.valueOf(id));
|
||||
ExcelReaderBuilder read = EasyExcel.read(file.getInputStream(), SysRunLogExcel.class,sysRunLogListener);
|
||||
read.sheet().doRead();
|
||||
return R.success("导入成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据制造商厂家型号查询故障信息描述
|
||||
* @return 信息中英文描述
|
||||
*/
|
||||
@PostMapping("/queryPlcDesc")
|
||||
public R<List<SysRunLogDesc>> queryAllCurve(@RequestBody JSONObject jsonObject) {
|
||||
String madeinfactory = jsonObject.getString("madeinfactory");
|
||||
String model = jsonObject.getString("model");
|
||||
List<SysRunLogDesc> sysRunLogDescList = plcLogService.queryRunLogDesc(madeinfactory,model);
|
||||
return R.success(sysRunLogDescList);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package com.das.modules.plc.domain.Excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class SysRunLogExcel implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "英文名称",index = 0)
|
||||
private String variable;
|
||||
/**
|
||||
* 物模型ID
|
||||
*/
|
||||
@ExcelProperty(value = "中文描述",index = 1)
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位",index = 2)
|
||||
private String unit;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.das.modules.plc.domain;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@TableName("sys_run_log_var_desc")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysRunLogDesc {
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
@TableField("parent")
|
||||
private Long parent;
|
||||
|
||||
@TableField("variable")
|
||||
private String variable;
|
||||
|
||||
@TableField("description")
|
||||
private String description;
|
||||
|
||||
@TableField("revision")
|
||||
private Integer revision;
|
||||
|
||||
@TableField("created_by")
|
||||
private String createdBy;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("created_time")
|
||||
private Date createdTime;
|
||||
|
||||
@TableField("updated_by")
|
||||
private String updatedBy;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("updated_time")
|
||||
private Date updatedTime;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField("unit")
|
||||
private String unit;
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.das.modules.plc.listener;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.utils.BeanCopyUtils;
|
||||
import com.das.common.utils.CommonFunction;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import com.das.modules.fdr.domain.excel.SysFaultRecordingExcel;
|
||||
import com.das.modules.fdr.service.impl.FaultRecorderServiceImpl;
|
||||
import com.das.modules.plc.domain.Excel.SysRunLogExcel;
|
||||
import com.das.modules.plc.domain.SysRunLogDesc;
|
||||
import com.das.modules.plc.service.impl.PlcLogsServiceImpl;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* 物模型属性监听器
|
||||
*
|
||||
* @author huguanghan
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Data
|
||||
public class SysRunLogListener extends AnalysisEventListener<SysRunLogExcel> {
|
||||
@Autowired
|
||||
private PlcLogsServiceImpl plcLogsService;
|
||||
|
||||
public SysRunLogListener(PlcLogsServiceImpl plcLogsService) {
|
||||
this.plcLogsService = plcLogsService;
|
||||
}
|
||||
|
||||
//parentId
|
||||
private Long parent;
|
||||
|
||||
/**计数标记*/
|
||||
private Integer flag=0;
|
||||
|
||||
/**存放插入*/
|
||||
ArrayList<SysRunLogDesc> sysRunLogDescArrayList = new ArrayList<>();
|
||||
|
||||
|
||||
@Override
|
||||
public void invoke(SysRunLogExcel sysRunLogExcel, AnalysisContext analysisContext) {
|
||||
// 如果一行Excel数据均为空值,则不装载该行数据
|
||||
if (CommonFunction.objCheckIsNull(sysRunLogExcel)) {
|
||||
return;
|
||||
}
|
||||
log.info("解析到一条数据:{}", JSON.toJSONString(sysRunLogExcel));
|
||||
SysRunLogDesc sysRunLogDesc = new SysRunLogDesc();
|
||||
BeanCopyUtils.copy(sysRunLogExcel, sysRunLogDesc);
|
||||
sysRunLogDesc.setParent(parent);
|
||||
//加入集合
|
||||
sysRunLogDescArrayList.add(sysRunLogDesc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
//确保最后遗留的数据也存储到数据库
|
||||
if (!sysRunLogDescArrayList.isEmpty()){
|
||||
saveData();
|
||||
}
|
||||
log.info("所有数据解析完成!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 存储数据库
|
||||
* @return
|
||||
*/
|
||||
private void saveData() {
|
||||
log.info("{}条数据,开始存储数据库!", flag);
|
||||
try {
|
||||
plcLogsService.batchProcessing(sysRunLogDescArrayList,parent);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getMessage());
|
||||
}finally {
|
||||
clear();
|
||||
}
|
||||
log.info("存储数据库成功!");
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
//清理缓存
|
||||
sysRunLogDescArrayList.clear();
|
||||
flag=0;
|
||||
log.info("缓存已清理");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
package com.das.modules.plc.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import com.das.modules.plc.domain.SysRunLogDesc;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface SysRunLogDescMapper extends BaseMapper<SysRunLogDesc> {
|
||||
|
||||
}
|
@ -2,6 +2,8 @@ package com.das.modules.plc.service;
|
||||
|
||||
import com.das.modules.equipment.entity.SysEquipment;
|
||||
import com.das.modules.fdr.domain.FileNode;
|
||||
import com.das.modules.plc.domain.SysRunLogDesc;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -17,4 +19,8 @@ public interface PlcLogService {
|
||||
void updatePlcConfig(SysEquipment sysEquipment);
|
||||
|
||||
void download(String path, HttpServletResponse httpServletResponse) throws IOException;
|
||||
|
||||
void exportRunLogDesc(SysRunLogDesc sysRunLogDesc, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
List<SysRunLogDesc> queryRunLogDesc(String madeinfactory, String model);
|
||||
}
|
||||
|
@ -1,18 +1,29 @@
|
||||
package com.das.modules.plc.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.das.common.config.SessionUtil;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.utils.HuExcelUtils;
|
||||
import com.das.modules.auth.domain.vo.SysUserVo;
|
||||
import com.das.modules.curve.domain.entity.TheoreticalPowerCurveEntity;
|
||||
import com.das.modules.curve.mapper.TheoreticalPowerCurveMapper;
|
||||
import com.das.modules.equipment.domain.excel.SheetInfoBean;
|
||||
import com.das.modules.equipment.entity.SysEquipment;
|
||||
import com.das.modules.equipment.mapper.SysEquipmentMapper;
|
||||
import com.das.modules.fdr.domain.FileNode;
|
||||
import com.das.modules.fdr.domain.SysFaultRecordingDesc;
|
||||
import com.das.modules.fdr.domain.vo.FdrFormatVo;
|
||||
import com.das.modules.fdr.domain.vo.FileParseConfig;
|
||||
import com.das.modules.fdr.service.FaultRecorderService;
|
||||
import com.das.modules.fdr.service.MinioViewsServcie;
|
||||
import com.das.modules.plc.domain.SysRunLogDesc;
|
||||
import com.das.modules.plc.mapper.SysRunLogDescMapper;
|
||||
import com.das.modules.plc.service.PlcLogService;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import io.minio.MinioClient;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -39,6 +50,12 @@ public class PlcLogsServiceImpl implements PlcLogService {
|
||||
@Autowired
|
||||
private SysEquipmentMapper sysEquipmentMapper;
|
||||
|
||||
@Autowired
|
||||
private TheoreticalPowerCurveMapper theoreticalPowerCurveMapper;
|
||||
|
||||
@Autowired
|
||||
private SysRunLogDescMapper sysRunLogDescMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<FileNode> getDirOrFileList(String fileType, String name, String startTime, String endTime) {
|
||||
@ -93,6 +110,38 @@ public class PlcLogsServiceImpl implements PlcLogService {
|
||||
faultRecorderService.download(path,httpServletResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportRunLogDesc(SysRunLogDesc sysRunLogDesc, HttpServletRequest request, HttpServletResponse response) {
|
||||
List<SheetInfoBean> exportList = new ArrayList<>();
|
||||
QueryWrapper<SysRunLogDesc> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("PARENT",sysRunLogDesc.getId());
|
||||
queryWrapper.orderByAsc("variable");
|
||||
List<SysRunLogDesc> sysFaultRecordingDescList = sysRunLogDescMapper.selectList(queryWrapper);
|
||||
TheoreticalPowerCurveEntity theoreticalPowerCurve = theoreticalPowerCurveMapper.selectById(sysRunLogDesc.getId());
|
||||
LinkedHashMap<String, String> map = new LinkedHashMap<>();
|
||||
SheetInfoBean sheetDTO = new SheetInfoBean();
|
||||
map.put("variable", "英文名称");
|
||||
map.put("description", "中文描述");
|
||||
map.put("unit","单位");
|
||||
sheetDTO.setSheetName(theoreticalPowerCurve.getMadeinfactory());
|
||||
sheetDTO.setFieldAndAlias(map);
|
||||
sheetDTO.setCollection(sysFaultRecordingDescList);
|
||||
exportList.add(sheetDTO);
|
||||
HuExcelUtils.exportExcel(response, exportList, theoreticalPowerCurve.getMadeinfactory()+theoreticalPowerCurve.getModel()+"运行日志变量描述");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRunLogDesc> queryRunLogDesc(String madeinfactory, String model) {
|
||||
QueryWrapper<TheoreticalPowerCurveEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("madeinfactory",madeinfactory);
|
||||
queryWrapper.eq("MODEL",model);
|
||||
TheoreticalPowerCurveEntity theoreticalPowerCurveEntity = theoreticalPowerCurveMapper.selectOne(queryWrapper);
|
||||
QueryWrapper<SysRunLogDesc> sysRunLogDescQueryWrapper = new QueryWrapper<>();
|
||||
sysRunLogDescQueryWrapper.eq("parent",theoreticalPowerCurveEntity.getId());
|
||||
sysRunLogDescQueryWrapper.orderByAsc("variable");
|
||||
return sysRunLogDescMapper.selectList(sysRunLogDescQueryWrapper);
|
||||
}
|
||||
|
||||
public Map<String, List<Object>> parseFile(InputStream inputStream, String timeFormat, String delimiter, int validStartLine) {
|
||||
List<List<String>> result = new ArrayList<>();
|
||||
Map<String, List<Object>> stringListMap = null;
|
||||
@ -160,4 +209,23 @@ public class PlcLogsServiceImpl implements PlcLogService {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
|
||||
return sdf.parse(time).getTime();
|
||||
}
|
||||
|
||||
public void batchProcessing(List<SysRunLogDesc> sysRunLogDescArrayList, Long parent) {
|
||||
|
||||
//先删除制造商数据
|
||||
QueryWrapper<SysRunLogDesc> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("PARENT",parent);
|
||||
sysRunLogDescMapper.delete(queryWrapper);
|
||||
|
||||
//新增新的制造商数据
|
||||
for (SysRunLogDesc item : sysRunLogDescArrayList){
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
item.setCreatedTime(new Date());
|
||||
item.setUpdatedTime(new Date());
|
||||
item.setCreatedBy(sysUserVo.getAccount());
|
||||
item.setUpdatedBy(sysUserVo.getAccount());
|
||||
item.setRevision(1);
|
||||
sysRunLogDescMapper.insert(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,10 @@ export const delModelReq = (data: DelModelType) => {
|
||||
url: '/api/equipment/model/delete',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
},
|
||||
{
|
||||
showErrorMessage: false
|
||||
})
|
||||
}
|
||||
|
||||
export const getModelAttributeListReq = (data: GetModelAttributeType) => {
|
||||
@ -156,7 +159,7 @@ export const getRealValueListReq = (data: { deviceId: string, attributes?: strin
|
||||
})
|
||||
}
|
||||
|
||||
export const getRealValueRangeReq = (data: { startTime: number, endTime: number, devices: { deviceId: string, attributes?: string[] }[],interval?:string }) => {
|
||||
export const getRealValueRangeReq = (data: { startTime: number, endTime: number, devices: { deviceId: string, attributes?: string[] }[], interval?: string }) => {
|
||||
return createAxios<never, RequestReturnType<any>>({
|
||||
url: '/api/data/history',
|
||||
method: 'post',
|
||||
|
@ -48,4 +48,15 @@ export const downloadFileReq = (data: {
|
||||
}, {
|
||||
reductDataFormat: false
|
||||
})
|
||||
}
|
||||
|
||||
export const getFileKeyEnumsReq = (data: {
|
||||
madeinfactory: string
|
||||
model: string
|
||||
}) => {
|
||||
return createAxios<never, Promise<ReqReturnType<any>>>({
|
||||
url: '/api/plc/queryPlcDesc',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
@ -49,4 +49,15 @@ export const downloadFileReq = (data: {
|
||||
}, {
|
||||
reductDataFormat: false
|
||||
})
|
||||
}
|
||||
|
||||
export const getFileKeyEnumsReq = (data: {
|
||||
madeinfactory: string
|
||||
model: string
|
||||
}) => {
|
||||
return createAxios<never, Promise<ReqReturnType<any>>>({
|
||||
url: '/api/fdr/queryFdrDesc',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
@ -66,3 +66,73 @@ export function powerCurveQuery(madeinfactory: any, model: any) {
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
export const importfdrData = (data: FormData, v: string) => {
|
||||
const token = encrypt_aes(adminInfo.token, v)
|
||||
return createAxios(
|
||||
{
|
||||
url: '/api/fdr/import',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
v,
|
||||
token,
|
||||
},
|
||||
},
|
||||
{ customEncrypt: true }
|
||||
)
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportfdrData(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/fdr/export ',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
export const importplcData = (data: FormData, v: string) => {
|
||||
const token = encrypt_aes(adminInfo.token, v)
|
||||
return createAxios(
|
||||
{
|
||||
url: '/api/plc/import',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
v,
|
||||
token,
|
||||
},
|
||||
},
|
||||
{ customEncrypt: true }
|
||||
)
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportplcData(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/plc/export ',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
export function queryFdrDesc(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/fdr/queryFdrDesc',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
export function queryplcDesc(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/plc/queryPlcDesc',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
@ -239,6 +239,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item v-if="attributeForm.attributeType === 140" :label="ModelAttributeFieldsEnums['level']" prop="level">
|
||||
<el-select v-model="attributeForm.level" :placeholder="'请选择' + ModelAttributeFieldsEnums['level']">
|
||||
<el-option v-for="v in attributeFormDataLevelOptions" :key="v.value" :label="v.label" :value="v.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="formRowStyle">
|
||||
<el-form-item :label="ModelAttributeFieldsEnums['porder']" prop="porder">
|
||||
@ -768,6 +773,11 @@ const attributeFormDataTypeOptions: { value: attributeTypeDataType }[] = [
|
||||
{ value: 'int' },
|
||||
{ value: 'bigint' },
|
||||
]
|
||||
const attributeFormDataLevelOptions = [
|
||||
{ value: 0, label: '提示' },
|
||||
{ value: 1, label: '告警' },
|
||||
{ value: 2, label: '故障' },
|
||||
]
|
||||
const originAttributeForm: AddModelAttributeType & UpdateModelAttributeType = {
|
||||
id: null,
|
||||
iotModelId: '',
|
||||
@ -780,6 +790,7 @@ const originAttributeForm: AddModelAttributeType & UpdateModelAttributeType = {
|
||||
dataType: '',
|
||||
visible: true,
|
||||
unit: '',
|
||||
level: undefined,
|
||||
revision: 1,
|
||||
createdBy: undefined,
|
||||
createdTime: undefined,
|
||||
|
@ -67,6 +67,7 @@ export enum ModelAttributeFieldsEnums {
|
||||
'dataType' = '数据类型',
|
||||
'visible' = '是否可见',
|
||||
'unit' = '单位',
|
||||
'level' = '告警等级',
|
||||
'revision' = '乐观锁',
|
||||
'createdBy' = '创建人',
|
||||
'createdTime' = '创建时间',
|
||||
@ -111,6 +112,7 @@ export type AddModelAttributeType = {
|
||||
subSystem: string
|
||||
dataType: attributeTypeDataType | ''
|
||||
unit: string
|
||||
level?: 0 | 1 | 2
|
||||
visible: 0 | 1 | boolean
|
||||
revision: number
|
||||
createdBy?: string
|
||||
|
@ -69,7 +69,7 @@
|
||||
:data="tableData"
|
||||
:header-row-style="tableHaderStyle"
|
||||
@selectionChange="selectTable"
|
||||
max-height="100%"
|
||||
class="tableClass"
|
||||
>
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<template v-for="item in tableColumn" :key="item.prop">
|
||||
@ -619,6 +619,10 @@ getBlongLineList()
|
||||
.mainPart {
|
||||
width: 100%;
|
||||
height: calc(100% - 60px);
|
||||
.tableClass{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.tableColumnClick {
|
||||
text-decoration: underline;
|
||||
color: #00a4ff;
|
||||
|
@ -136,7 +136,7 @@
|
||||
import { ref, reactive, computed, onMounted, nextTick, onUnmounted } from 'vue'
|
||||
import { dayjs, ElMessage, FormInstance, TreeInstance } from 'element-plus'
|
||||
import { Search, Setting } from '@element-plus/icons-vue'
|
||||
import { getLogRecordListReq, setConfigReq, previewFileReq, downloadFileReq } from '/@/api/backend/logRecord/request'
|
||||
import { getLogRecordListReq, setConfigReq, previewFileReq, downloadFileReq, getFileKeyEnumsReq } from '/@/api/backend/logRecord/request'
|
||||
import { equipList } from '/@/api/backend/temperature/request'
|
||||
import * as echarts from 'echarts'
|
||||
import { tableItemData } from './type'
|
||||
@ -189,15 +189,19 @@ const curTreeData = ref<{
|
||||
id: string
|
||||
code: string
|
||||
options: any
|
||||
model: string
|
||||
madeinFactory: string
|
||||
children?: any[]
|
||||
}>({
|
||||
label: '风机列表',
|
||||
id: '0',
|
||||
code: '0',
|
||||
model: '',
|
||||
madeinFactory: '',
|
||||
options: {},
|
||||
})
|
||||
|
||||
const handleNodeClick = (target: { label: string; id: string; code: string; options: any }) => {
|
||||
const handleNodeClick = (target: { label: string; id: string; code: string; model: string; madeinFactory: string; options: any }) => {
|
||||
curTreeData.value = target
|
||||
if (target.id === '0') return
|
||||
getListForAirBlower()
|
||||
@ -211,6 +215,8 @@ const getTreeDataList = () => {
|
||||
label: item.name,
|
||||
code: item.code,
|
||||
id: item.id,
|
||||
model: item.model,
|
||||
madeinFactory: item.madeinFactory,
|
||||
options: item.options ? JSON.parse(item.options).plcFormat : {},
|
||||
}
|
||||
})
|
||||
@ -372,7 +378,9 @@ const setAirBlowerConfig = () => {
|
||||
const previewFileDialogVisible = ref(false)
|
||||
const readFile = (data: tableItemData) => {
|
||||
previewFileDialogVisible.value = true
|
||||
getFileData(data.path)
|
||||
getFileKeyEnum().finally(() => {
|
||||
getFileData(data.path)
|
||||
})
|
||||
}
|
||||
const downloadFile = (data: tableItemData) => {
|
||||
downloadFileReq({ url: data.path }).then((res) => {
|
||||
@ -415,6 +423,8 @@ const previewSearchTree = (val: string) => {
|
||||
const filterData = originPreviewTreeData.filter((item: any) => regex.test(item.label))
|
||||
previewTreeData.value = filterData
|
||||
nextTick(() => {
|
||||
// console.log('勾选-----',selectPreviewTree);
|
||||
|
||||
previewTreeRef.value?.setCheckedKeys(selectPreviewTree)
|
||||
})
|
||||
}
|
||||
@ -433,6 +443,7 @@ const handleCheckChange = (data: any, state: boolean) => {
|
||||
previewChartInstance && previewChartInstance.clear()
|
||||
if (state) {
|
||||
selectPreviewTree.push(data.key)
|
||||
// console.log('添加-----',selectPreviewTree);
|
||||
} else {
|
||||
const index = selectPreviewTree.findIndex((item: string) => item === data.key)
|
||||
selectPreviewTree.splice(index, 1)
|
||||
@ -467,7 +478,7 @@ const createSeriesData = () => {
|
||||
} else {
|
||||
const color = getRandomDarkColor()
|
||||
const data = {
|
||||
name: item,
|
||||
name: fileKeyEnums?.[item] ?? item,
|
||||
type: 'line',
|
||||
barWidth: 20,
|
||||
itemStyle: {
|
||||
@ -491,7 +502,7 @@ const initPreviewChart = () => {
|
||||
grid: {
|
||||
top: 50,
|
||||
right: 23,
|
||||
bottom: 10,
|
||||
bottom: 50,
|
||||
left: 18,
|
||||
containLabel: true,
|
||||
},
|
||||
@ -517,7 +528,7 @@ const initPreviewChart = () => {
|
||||
color: '#4E5969',
|
||||
interval: 'auto',
|
||||
formatter: function (value: any) {
|
||||
return value.slice(0, 10)
|
||||
return value.slice(11)
|
||||
},
|
||||
//rotate: 45
|
||||
},
|
||||
@ -599,7 +610,7 @@ const getFileData = (url: string) => {
|
||||
})
|
||||
} else {
|
||||
data.push({
|
||||
label: item,
|
||||
label: fileKeyEnums?.[item] ?? item,
|
||||
key: item,
|
||||
isLeaf: true,
|
||||
})
|
||||
@ -612,6 +623,22 @@ const getFileData = (url: string) => {
|
||||
})
|
||||
}
|
||||
|
||||
const fileKeyEnums: any = {}
|
||||
const getFileKeyEnum = () => {
|
||||
return new Promise((resolve) => {
|
||||
getFileKeyEnumsReq({
|
||||
madeinfactory: curTreeData.value.madeinFactory,
|
||||
model: curTreeData.value.model,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
res.data.forEach((item: any) => {
|
||||
fileKeyEnums[item.variable] = item.description
|
||||
})
|
||||
resolve(true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
getTreeDataList().then((data: any) => {
|
||||
treeRef.value && treeRef.value.setCurrentKey(data.id, true)
|
||||
|
@ -139,7 +139,7 @@
|
||||
import { ref, reactive, computed, onMounted, nextTick, onUnmounted } from 'vue'
|
||||
import { dayjs, ElMessage, FormInstance, TreeInstance } from 'element-plus'
|
||||
import { Search, Setting } from '@element-plus/icons-vue'
|
||||
import { getMalFunctionListReq, setConfigReq, previewFileReq, downloadFileReq } from '/@/api/backend/malfunction/request'
|
||||
import { getMalFunctionListReq, setConfigReq, previewFileReq, downloadFileReq, getFileKeyEnumsReq } from '/@/api/backend/malfunction/request'
|
||||
import { equipList } from '/@/api/backend/temperature/request'
|
||||
import * as echarts from 'echarts'
|
||||
import { tableItemData } from './type'
|
||||
@ -191,16 +191,20 @@ const curTreeData = ref<{
|
||||
label: string
|
||||
id: string
|
||||
code: string
|
||||
model: string
|
||||
madeinFactory: string
|
||||
options: any
|
||||
children?: any[]
|
||||
}>({
|
||||
label: '风机列表',
|
||||
id: '0',
|
||||
code: '0',
|
||||
model: '',
|
||||
madeinFactory: '',
|
||||
options: {},
|
||||
})
|
||||
|
||||
const handleNodeClick = (target: { label: string; id: string; code: string; options: any }) => {
|
||||
const handleNodeClick = (target: { label: string; id: string; code: string; model: string; madeinFactory: string; options: any }) => {
|
||||
curTreeData.value = target
|
||||
if (target.id === '0') return
|
||||
getListForAirBlower()
|
||||
@ -214,6 +218,8 @@ const getTreeDataList = () => {
|
||||
label: item.name,
|
||||
code: item.code,
|
||||
id: item.id,
|
||||
model: item.model,
|
||||
madeinFactory: item.madeinFactory,
|
||||
options: item.options ? JSON.parse(item.options).fdrFormat : {},
|
||||
}
|
||||
})
|
||||
@ -374,7 +380,9 @@ const setAirBlowerConfig = () => {
|
||||
const previewFileDialogVisible = ref(false)
|
||||
const readFile = (data: tableItemData) => {
|
||||
previewFileDialogVisible.value = true
|
||||
getFileData(data.path)
|
||||
getFileKeyEnum().finally(() => {
|
||||
getFileData(data.path)
|
||||
})
|
||||
}
|
||||
const downloadFile = (data: tableItemData) => {
|
||||
downloadFileReq({ url: data.path }).then((res) => {
|
||||
@ -475,7 +483,7 @@ const createSeriresData = () => {
|
||||
} else {
|
||||
const color = getRandomDarkColor()
|
||||
const data = {
|
||||
name: item,
|
||||
name: fileKeyEnums[item],
|
||||
type: 'line',
|
||||
barWidth: 20,
|
||||
itemStyle: {
|
||||
@ -499,7 +507,7 @@ const initPreviewChart = () => {
|
||||
grid: {
|
||||
top: 50,
|
||||
right: 23,
|
||||
bottom: 10,
|
||||
bottom: 50,
|
||||
left: 18,
|
||||
containLabel: true,
|
||||
},
|
||||
@ -525,7 +533,7 @@ const initPreviewChart = () => {
|
||||
color: '#4E5969',
|
||||
interval: 'auto',
|
||||
formatter: function (value: any) {
|
||||
return value.slice(0, 10)
|
||||
return value.slice(11)
|
||||
},
|
||||
//rotate: 45
|
||||
},
|
||||
@ -600,6 +608,8 @@ const getFileData = (url: string) => {
|
||||
previewChartData = res.data
|
||||
const attrName = Object.keys(res.data)
|
||||
const data: any = []
|
||||
console.log(fileKeyEnums);
|
||||
|
||||
attrName.forEach((item) => {
|
||||
if (item === 'TimeStamp') {
|
||||
previewChartData.TimeStamp = previewChartData.TimeStamp.map((item: any) => {
|
||||
@ -607,7 +617,7 @@ const getFileData = (url: string) => {
|
||||
})
|
||||
} else {
|
||||
data.push({
|
||||
label: item,
|
||||
label: fileKeyEnums?.[item] ?? item,
|
||||
key: item,
|
||||
isLeaf: true,
|
||||
})
|
||||
@ -619,6 +629,23 @@ const getFileData = (url: string) => {
|
||||
})
|
||||
}
|
||||
|
||||
const fileKeyEnums: any = {}
|
||||
const getFileKeyEnum = () => {
|
||||
return new Promise((resolve) => {
|
||||
getFileKeyEnumsReq({
|
||||
madeinfactory: curTreeData.value.madeinFactory,
|
||||
model: curTreeData.value.model,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
res.data.forEach((item: any) => {
|
||||
fileKeyEnums[item.variable] = item.description
|
||||
})
|
||||
resolve(true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getTreeDataList().then((data: any) => {
|
||||
treeRef.value && treeRef.value.setCurrentKey(data.id, true)
|
||||
|
@ -1,27 +1,21 @@
|
||||
<template>
|
||||
<div class="theoreticalpowerCurve">
|
||||
<el-container class="mainContainer">
|
||||
<el-header class="mainHeader">
|
||||
<el-button type="primary" @click="addItem">新增</el-button>
|
||||
</el-header>
|
||||
<el-main class="mainMain">
|
||||
<el-card class="box-card1">
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">风机规格型号列表</el-text>
|
||||
<el-button :icon="CirclePlusFilled" type="primary" @click="addItem">新增</el-button>
|
||||
</div>
|
||||
<div class="tabsPart">
|
||||
<el-table :data="theoreticalTableData" class="tablePart" @current-change="handleCurrentChange">
|
||||
<el-table :data="theoreticalTableData" class="tablePart" @current-change="handleCurrentChange" :row-class-name="rowClassName">
|
||||
<el-table-column prop="index" :label="theoreticalEnums['index']" align="center"> </el-table-column>
|
||||
<el-table-column prop="madeinfactory" :label="theoreticalEnums['madeinfactory']" align="center"> </el-table-column>
|
||||
<el-table-column prop="model" :label="theoreticalEnums['model']" align="center"> </el-table-column>
|
||||
<el-table-column prop="nominalCapacity" :label="theoreticalEnums['nominalCapacity']" align="center"> </el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="400" align="center">
|
||||
<template #default="scope">
|
||||
<div class="tableOperate">
|
||||
<a @click="viewDetails(scope.row)">查看 </a>
|
||||
<el-upload :show-file-list="false" :http-request="update">
|
||||
<template #trigger>
|
||||
<a>更新 </a>
|
||||
</template>
|
||||
</el-upload>
|
||||
<a @click="download(scope.row)">下载</a>
|
||||
<a @click="deleteDetails(scope.row)">删除</a>
|
||||
</div>
|
||||
</template>
|
||||
@ -36,12 +30,97 @@
|
||||
:page-sizes="paginationOptions.pageSizes"
|
||||
background
|
||||
:pager-count="7"
|
||||
layout="prev, pager, next, jumper,sizes,total"
|
||||
layout="prev, pager, next"
|
||||
@change="getcurrentPage"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card2">
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">理论功率曲线</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div ref="chartContainer" class="chartContainer"></div>
|
||||
</el-main>
|
||||
</el-card>
|
||||
<div class="bottom">
|
||||
<el-card class="box-card3 bottom-left">
|
||||
<div>
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">故障录波变量描述</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update1">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download1">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabsPart">
|
||||
<el-table :data="faultRecordingpageData" class="tablePart">
|
||||
<el-table-column prop="variable" label="变量" align="center"> </el-table-column>
|
||||
<el-table-column prop="description" label="中文" align="center"> </el-table-column>
|
||||
<el-table-column prop="unit" label="单位" align="center"> </el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="mainFooter">
|
||||
<el-pagination
|
||||
v-model:current-page="paginationOptions1.current"
|
||||
v-model:page-size="paginationOptions1.pageSize"
|
||||
:total="paginationOptions1.total"
|
||||
:page-sizes="paginationOptions1.pageSizes"
|
||||
background
|
||||
:pager-count="5"
|
||||
layout="prev, pager, next"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card3">
|
||||
<div>
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">运行日志变量描述</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update2">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download2">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabsPart">
|
||||
<el-table :data="runLogpageData" class="tablePart">
|
||||
<el-table-column prop="variable" label="变量" align="center"> </el-table-column>
|
||||
<el-table-column prop="description" label="中文" align="center"> </el-table-column>
|
||||
<el-table-column prop="unit" label="单位" align="center"> </el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="mainFooter">
|
||||
<el-pagination
|
||||
v-model:current-page="paginationOptions2.current"
|
||||
v-model:page-size="paginationOptions2.pageSize"
|
||||
:total="paginationOptions2.total"
|
||||
:page-sizes="paginationOptions2.pageSizes"
|
||||
background
|
||||
:pager-count="5"
|
||||
layout="prev, pager, next"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-container>
|
||||
<el-dialog v-model="dialogOpen" :title="dialogTitle" width="720">
|
||||
<el-form
|
||||
@ -84,6 +163,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted, markRaw } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Refresh, CirclePlusFilled, Download } from '@element-plus/icons-vue'
|
||||
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
||||
import { theoreticalEnums } from './type'
|
||||
import {
|
||||
@ -94,6 +174,12 @@ import {
|
||||
importData,
|
||||
exportData,
|
||||
powerCurveQuery,
|
||||
importfdrData,
|
||||
exportfdrData,
|
||||
importplcData,
|
||||
exportplcData,
|
||||
queryFdrDesc,
|
||||
queryplcDesc,
|
||||
} from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
import * as echarts from 'echarts'
|
||||
// 导入
|
||||
@ -108,6 +194,8 @@ const update = (file: any) => {
|
||||
if (res.success) {
|
||||
ElMessage.success('更新成功')
|
||||
getpowerCurve()
|
||||
getFaultRecording()
|
||||
getRunLog()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
@ -118,8 +206,9 @@ const update = (file: any) => {
|
||||
}
|
||||
|
||||
// 导出
|
||||
const download = (val: any) => {
|
||||
exportData({ id: val.id }).then((res: any) => {
|
||||
const download = () => {
|
||||
console.log(currentRow)
|
||||
exportData({ id: currentRow.value.id }).then((res: any) => {
|
||||
const downloadUrl = window.URL.createObjectURL(res)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
@ -131,6 +220,85 @@ const download = (val: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 导入
|
||||
const update1 = (file: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file.file)
|
||||
const v = generateRandomNumber(16)
|
||||
const id = encrypt_aes(currentRow.value.id, v)
|
||||
formData.append('id', id)
|
||||
return importfdrData(formData, v)
|
||||
.then((res: any) => {
|
||||
if (res.success) {
|
||||
ElMessage.success('更新成功')
|
||||
getFaultRecording()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error(err?.response?.data?.msg ?? '更新失败')
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
const download1 = () => {
|
||||
console.log(currentRow)
|
||||
exportfdrData({ id: currentRow.value.id }).then((res: any) => {
|
||||
const downloadUrl = window.URL.createObjectURL(res)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
a.download = '故障录波变量' + new Date().getTime()
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(downloadUrl)
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
// 导入
|
||||
const update2 = (file: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file.file)
|
||||
const v = generateRandomNumber(16)
|
||||
const id = encrypt_aes(currentRow.value.id, v)
|
||||
formData.append('id', id)
|
||||
return importplcData(formData, v)
|
||||
.then((res: any) => {
|
||||
if (res.success) {
|
||||
ElMessage.success('更新成功')
|
||||
getRunLog()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error(err?.response?.data?.msg ?? '更新失败')
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
const download2 = () => {
|
||||
console.log(currentRow)
|
||||
exportplcData({ id: currentRow.value.id }).then((res: any) => {
|
||||
const downloadUrl = window.URL.createObjectURL(res)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
a.download = '运行日志变量' + new Date().getTime()
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(downloadUrl)
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
const rowClassName = ({ row, rowIndex }: any) => {
|
||||
if (currentRow.value === row) {
|
||||
return 'current-row'
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
const option: any = reactive({
|
||||
tooltip: {
|
||||
formatter: function (params: any) {
|
||||
@ -285,7 +453,36 @@ const deleteDetails = (val: any) => {
|
||||
}
|
||||
|
||||
const theoreticalTableData: any = ref([])
|
||||
const faultRecordingData: any = ref([])
|
||||
const faultRecordingpageData: any = ref([])
|
||||
const runLogData: any = ref([])
|
||||
const runLogpageData: any = ref([])
|
||||
|
||||
const handleSizeChange1 = (val: any) => {
|
||||
paginationOptions1.pageSize = val
|
||||
paginationOptions1.current = 1
|
||||
faultRecordingpageData.value = faultRecordingData.value.slice(0, paginationOptions1.pageSize)
|
||||
}
|
||||
// 当前页改变时触发
|
||||
const handleCurrentChange1 = (val: any) => {
|
||||
paginationOptions1.current = val
|
||||
const start = (paginationOptions1.current - 1) * paginationOptions1.pageSize
|
||||
const end = start + paginationOptions1.pageSize
|
||||
faultRecordingpageData.value = faultRecordingData.value.slice(start, end)
|
||||
}
|
||||
|
||||
const handleSizeChange2 = (val: any) => {
|
||||
paginationOptions2.pageSize = val
|
||||
paginationOptions2.current = 1
|
||||
runLogpageData.value = runLogData.value.slice(0, paginationOptions1.pageSize)
|
||||
}
|
||||
// 当前页改变时触发
|
||||
const handleCurrentChange2 = (val: any) => {
|
||||
paginationOptions2.current = val
|
||||
const start = (paginationOptions2.current - 1) * paginationOptions2.pageSize
|
||||
const end = start + paginationOptions2.pageSize
|
||||
runLogpageData.value = runLogData.value.slice(start, end)
|
||||
}
|
||||
const getList = () => {
|
||||
const transparams = searchParams()
|
||||
theoreticalpowerCurveList(transparams)
|
||||
@ -299,6 +496,8 @@ const getList = () => {
|
||||
}
|
||||
})
|
||||
getpowerCurve()
|
||||
getFaultRecording()
|
||||
getRunLog()
|
||||
} else {
|
||||
ElMessage.error(res.msg ?? '查询失败')
|
||||
}
|
||||
@ -319,7 +518,11 @@ const currentRow = ref()
|
||||
const handleCurrentChange = (val: any) => {
|
||||
currentRow.value = val
|
||||
chart.value.clear()
|
||||
paginationOptions1.current = 1
|
||||
paginationOptions2.current = 1
|
||||
getpowerCurve()
|
||||
getFaultRecording()
|
||||
getRunLog()
|
||||
}
|
||||
const getpowerCurve = () => {
|
||||
currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
|
||||
@ -346,11 +549,48 @@ const getpowerCurve = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const getFaultRecording = () => {
|
||||
currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
|
||||
queryFdrDesc({ madeinfactory: currentRow.value.madeinfactory, model: currentRow.value.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
faultRecordingData.value = [...res.data]
|
||||
paginationOptions1.total = faultRecordingData.value.length
|
||||
faultRecordingpageData.value = faultRecordingData.value.slice(0, paginationOptions1.pageSize)
|
||||
} else {
|
||||
ElMessage.warning('查询失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
const getRunLog = () => {
|
||||
currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
|
||||
queryplcDesc({ madeinfactory: currentRow.value.madeinfactory, model: currentRow.value.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
runLogData.value = [...res.data]
|
||||
paginationOptions2.total = runLogData.value.length
|
||||
runLogpageData.value = runLogData.value.slice(0, paginationOptions2.pageSize)
|
||||
} else {
|
||||
ElMessage.warning('查询失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const paginationOptions = reactive({
|
||||
current: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 5,
|
||||
total: 0,
|
||||
pageSizes: [20, 50, 100],
|
||||
pageSizes: [5],
|
||||
})
|
||||
const paginationOptions1 = reactive({
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
total: 0,
|
||||
pageSizes: [5, 50, 100],
|
||||
})
|
||||
const paginationOptions2 = reactive({
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
total: 0,
|
||||
pageSizes: [5, 50, 100],
|
||||
})
|
||||
const getcurrentPage = () => {
|
||||
getList()
|
||||
@ -377,72 +617,121 @@ $paginationHeight: 32px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// background: transparent;
|
||||
.mainContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.mainHeader {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: $headerHeight;
|
||||
padding: 0 20px;
|
||||
border-bottom: 1px solid #eaebed;
|
||||
}
|
||||
.mainMain {
|
||||
height: calc(100% - $headerHeight);
|
||||
.tabsPart {
|
||||
height: calc(100% - $paginationHeight - 290px);
|
||||
padding-bottom: 5px;
|
||||
:deep(.el-tabs__content) {
|
||||
height: calc(100% - 55px);
|
||||
.el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.tablePart {
|
||||
height: 100%;
|
||||
.alarm {
|
||||
border: 1px solid rgb(228, 161, 18);
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 5px;
|
||||
border-radius: 6px;
|
||||
color: rgb(228, 161, 18);
|
||||
}
|
||||
.fault {
|
||||
border: 1px solid #a03b1d;
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 5px;
|
||||
border-radius: 6px;
|
||||
color: #a03b1d;
|
||||
}
|
||||
}
|
||||
.tableOperate {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
a {
|
||||
margin: 5px;
|
||||
color: #0064aa;
|
||||
font-weight: 600;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.title {
|
||||
border-left: 4px solid rgb(77, 147, 196);
|
||||
border-bottom: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-top: 4px solid transparent;
|
||||
padding: 4px;
|
||||
}
|
||||
.mainFooter {
|
||||
.right {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
background-color: #fff;
|
||||
flex-direction: row;
|
||||
:deep(div) {
|
||||
margin-right: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mainFooter {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
background-color: #fff;
|
||||
}
|
||||
.tabsPart {
|
||||
height: 300px;
|
||||
padding-bottom: 5px;
|
||||
:deep(.el-tabs__content) {
|
||||
height: 100%;
|
||||
.el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.box-card1 {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
.tablePart {
|
||||
.alarm {
|
||||
border: 1px solid rgb(228, 161, 18);
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 5px;
|
||||
border-radius: 6px;
|
||||
color: rgb(228, 161, 18);
|
||||
}
|
||||
.fault {
|
||||
border: 1px solid #a03b1d;
|
||||
width: fit-content;
|
||||
margin: 0 auto;
|
||||
padding: 5px;
|
||||
border-radius: 6px;
|
||||
color: #a03b1d;
|
||||
}
|
||||
}
|
||||
.tableOperate {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
a {
|
||||
margin: 5px;
|
||||
color: #0064aa;
|
||||
font-weight: 600;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chartContainer {
|
||||
width: 100%;
|
||||
height: 280px;
|
||||
height: 240px;
|
||||
border: 1px solid rgb(217, 217, 217);
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.current-row {
|
||||
background-color: #f0f9eb !important;
|
||||
}
|
||||
}
|
||||
.box-card2 {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
.chartContainer {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
border: 1px solid rgb(217, 217, 217);
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-bottom: 20px;
|
||||
.bottom-left {
|
||||
margin-right: 20px;
|
||||
}
|
||||
.tabsPart {
|
||||
height: 240px;
|
||||
padding-bottom: 5px;
|
||||
:deep(.el-table .cell) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
.box-card3 {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.modelOperate {
|
||||
|
Loading…
Reference in New Issue
Block a user