| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "productType", value = "检索关键字", dataType = Constant.QT.STRING, format = "CONTENT_TYPE^LK"), @ApiImplicitParam(name = "systemMark", value = "系统标识", dataType = Constant.QT.STRING, format = "SYSTEM_MARK^LK")}) |
| | | @ApiImplicitParam(name = "productType", value = "检索关键字", dataType = Constant.QT.STRING, format = "PRODUCT_TYPE^EQ"), |
| | | @ApiImplicitParam(name = "systemMark", value = "系统标识", dataType = Constant.QT.STRING, format = "SYSTEM_MARK^LK")}) |
| | | public Result<List<SysPictureBase>> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { |
| | | |
| | | return Result.ok(sysPictureBaseService.page(queryFilter)); |
| | |
| | | public Result save(@RequestBody MultipartFile file, Long id, Integer isDefault, |
| | | String name, String contentType, Integer productType, String remark) { |
| | | SysPictureBase sysPictureBase; |
| | | SysPictureBase pictureBase = sysPictureBaseService.getDefaultImg(productType); |
| | | if (id != 0) { |
| | | sysPictureBase = sysPictureBaseService.get(id); |
| | | sysPictureBase.setIsDefault(isDefault); |
| | |
| | | sysPictureBaseService.insert(sysPictureBase); |
| | | } |
| | | if (sysPictureBase.getIsDefault()==1){ |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType()); |
| | | if (!sysPictureBase.getId().equals(pictureBase.getId())){ |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),pictureBase.getId()); |
| | | } |
| | | } |
| | | if (file != null) { |
| | | BufferedImage bufferedImage = null; |
| | |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/getDefaultImg") |
| | | public Result<SysPictureBase> getDefaultImg(Integer productType) { |
| | | SysPictureBase data = sysPictureBaseService.getDefaultImg(productType); |
| | | return Result.ok(data); |
| | | } |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | |
| | | |
| | | void updateByDefault(Long id, Integer productType); |
| | | |
| | | void updateProdeuctImg(Long id, Integer productType); |
| | | void updateProdeuctImg(Long id, Integer productType, Long pictureBaseId); |
| | | |
| | | SysPictureBase getDefaultImg(Integer productType); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | baseDao.updateByDefault(id,productType); |
| | | } |
| | | |
| | | public void updateProdeuctImg(Long id, Integer productType) { |
| | | baseDao.updateProdeuctImg(id,productType); |
| | | public void updateProdeuctImg(Long id, Integer productType,Long pictureBaseId) { |
| | | baseDao.updateProdeuctImg(id,productType,pictureBaseId); |
| | | } |
| | | |
| | | public SysPictureBase getDefaultImg(Integer productType) { |
| | | return baseDao.getDefaultImg(productType); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.controller; |
| | | |
| | | |
| | | import com.zt.common.annotation.LogOperation; |
| | | import com.zt.common.constant.Constant; |
| | | import com.zt.common.annotation.QueryParam; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.common.servlet.PageResult; |
| | | import com.zt.common.validator.AssertUtils; |
| | | import com.zt.common.validator.ValidatorUtils; |
| | | import com.zt.common.validator.group.AddGroup; |
| | | import com.zt.common.validator.group.DefaultGroup; |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatCondit; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.OperatConditService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * operat_condit |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/taskReliability/OperatCondit/") |
| | | @Api(tags="operat_condit") |
| | | public class OperatConditController { |
| | | @Autowired |
| | | private OperatConditService operatConditService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "productId", value = "产品节点ID", dataType = Constant.QT.STRING), |
| | | }) |
| | | public Result<List<OperatCondit>> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return Result.ok(operatConditService.page(queryFilter)); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<OperatCondit> get(@PathVariable("id") Long id){ |
| | | OperatCondit data = operatConditService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody OperatCondit operatCondit){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(operatCondit, AddGroup.class, DefaultGroup.class); |
| | | operatConditService.insert(operatCondit); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody OperatCondit operatCondit){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(operatCondit, UpdateGroup.class, DefaultGroup.class); |
| | | operatConditService.update(operatCondit); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | operatConditService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.controller; |
| | | |
| | | |
| | | import com.zt.common.annotation.LogOperation; |
| | | import com.zt.common.constant.Constant; |
| | | import com.zt.common.annotation.QueryParam; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.common.servlet.PageResult; |
| | | import com.zt.common.validator.AssertUtils; |
| | | import com.zt.common.validator.ValidatorUtils; |
| | | import com.zt.common.validator.group.AddGroup; |
| | | import com.zt.common.validator.group.DefaultGroup; |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.OperatConditModelService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * operat_condit_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/taskReliability/OperatConditModel/") |
| | | @Api(tags="operat_condit_model") |
| | | public class OperatConditModelController { |
| | | @Autowired |
| | | private OperatConditModelService operatConditModelService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "productId", value = "产品节点Id", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "operatConditId", value = "阶段Id", dataType = Constant.QT.STRING), |
| | | }) |
| | | public Result<List<OperatConditModel>> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return Result.ok(operatConditModelService.page(queryFilter)); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<OperatConditModel> get(@PathVariable("id") Long id){ |
| | | OperatConditModel data = operatConditModelService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody OperatConditModel operatConditModel){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(operatConditModel, AddGroup.class, DefaultGroup.class); |
| | | operatConditModelService.insert(operatConditModel); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody OperatConditModel operatConditModel){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(operatConditModel, UpdateGroup.class, DefaultGroup.class); |
| | | operatConditModelService.update(operatConditModel); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | operatConditModelService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zt.common.validator.group.AddGroup; |
| | | import com.zt.common.validator.group.DefaultGroup; |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamData; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.TaskPhaseModel; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.TaskPhaseModelService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody TaskPhaseModel taskPhaseModel){ |
| | | @PostMapping("save") |
| | | public Result save(@RequestBody TaskPhaseModel model) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(taskPhaseModel, AddGroup.class, DefaultGroup.class); |
| | | taskPhaseModelService.insert(taskPhaseModel); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody TaskPhaseModel taskPhaseModel){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(taskPhaseModel, UpdateGroup.class, DefaultGroup.class); |
| | | taskPhaseModelService.update(taskPhaseModel); |
| | | |
| | | for (TaskPhaseModel taskPhaseModel : model.getDataThreeList()) { |
| | | if (taskPhaseModel.getId()!=null){ |
| | | taskPhaseModelService.update(taskPhaseModel); |
| | | }else{ |
| | | taskPhaseModelService.insert(taskPhaseModel); |
| | | } |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatCondit; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * operat_condit |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Mapper |
| | | public interface OperatConditDao extends BaseDao<OperatCondit> { |
| | | |
| | | List<OperatCondit> getList(Map<String, Object> params); |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * operat_condit_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Mapper |
| | | public interface OperatConditModelDao extends BaseDao<OperatConditModel> { |
| | | |
| | | List<OperatConditModel> getList(Map<String, Object> params); |
| | | |
| | | } |
| | |
| | | private String modelState; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "被引用数量") |
| | | private Integer quoteNum ; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "访问后端网站前缀") |
| | | private String urlPref; |
| | | |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * operat_condit |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("operat_condit") |
| | | public class OperatCondit extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "产品节点ID(总体)") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "工况名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import com.zt.common.entity.TreeNode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * operat_condit_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("operat_condit_model") |
| | | public class OperatConditModel extends BusiEntity implements TreeNode<OperatConditModel> { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "工况ID") |
| | | private Long operatConditId; |
| | | |
| | | @ApiModelProperty(value = "产品节点ID") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "模型ID") |
| | | private Long modelId; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @TableField(exist = false) |
| | | private String product; |
| | | |
| | | @TableField(exist = false) |
| | | private String modelName; |
| | | |
| | | @TableField(exist = false) |
| | | private Long operatConditModelId; |
| | | |
| | | @ApiModelProperty(value = "子节点") |
| | | @TableField(exist = false) |
| | | private List<OperatConditModel> children = new ArrayList<>(); |
| | | |
| | | @TableField(exist = false) |
| | | private Long pid; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "任务阶段名称") |
| | | private String phaseName; |
| | | |
| | | @ApiModelProperty(value = "阶段时长") |
| | | private Double phaseDuration; |
| | | @ApiModelProperty(value = "阶段时长比") |
| | | private Double phaseDurationRate; |
| | | |
| | | @ApiModelProperty(value = "阶段时速") |
| | | private Double phaseSpeed; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import com.zt.common.entity.TreeNode; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamData; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("task_phase_model") |
| | | public class TaskPhaseModel extends BusiEntity implements TreeNode<TaskPhaseModel> { |
| | | public class TaskPhaseModel extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "阶段ID") |
| | | private Long phaseId; |
| | | |
| | | @ApiModelProperty(value = "产品节点ID") |
| | | @TableField(exist = false) |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "模型ID") |
| | | private Long modelId; |
| | | @ApiModelProperty(value = "工况ID") |
| | | private Long operatConditId; |
| | | |
| | | @ApiModelProperty(value = "工况名称") |
| | | private String operatConditName; |
| | | |
| | | @ApiModelProperty(value = "工况运行比") |
| | | private Double operatConditDurationRate; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Integer status; |
| | | @TableField(exist = false) |
| | | private List<TaskPhaseModel> dataThreeList; |
| | | |
| | | @TableField(exist = false) |
| | | private String system; |
| | | |
| | | @TableField(exist = false) |
| | | private String modelName; |
| | | |
| | | @ApiModelProperty(value = "子节点") |
| | | @TableField(exist = false) |
| | | private List<TaskPhaseModel> children = new ArrayList<>(); |
| | | |
| | | @TableField(exist = false) |
| | | private Long pid; |
| | | private String isCheck; |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.TreeUtils; |
| | | import com.zt.life.modules.mainPart.taskReliability.dao.OperatConditModelDao; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * operat_condit_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Service |
| | | public class OperatConditModelService extends BaseService<OperatConditModelDao, OperatConditModel> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<OperatConditModel> page(QueryFilter queryFilter) { |
| | | List<OperatConditModel> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | return TreeUtils.build(list); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.mainPart.taskReliability.dao.OperatConditDao; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatCondit; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * operat_condit |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Service |
| | | public class OperatConditService extends BaseService<OperatConditDao, OperatCondit> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<OperatCondit> page(QueryFilter queryFilter) { |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public List<TaskPhaseModel> page(QueryFilter queryFilter) { |
| | | List<TaskPhaseModel> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | return TreeUtils.build(list); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | </update> |
| | | <update id="updateProdeuctImg"> |
| | | UPDATE product_model_common |
| | | set operat_img = ${id} |
| | | set operat_img = ${id} |
| | | where node_type = ${productType} |
| | | and operat_img =${pictureBaseId} |
| | | and is_delete = 0; |
| | | update product_model |
| | | set operat_img=${id} |
| | | where product_type = ${productType} |
| | | and operat_img =${pictureBaseId} |
| | | and is_delete = 0 |
| | | </update> |
| | | |
| | |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | </select> |
| | | <select id="getDefaultImg" resultType="com.zt.life.modules.mainPart.sysPictureBase.model.SysPictureBase"> |
| | | select a.name, a.id |
| | | from sys_picture_base a |
| | | where a.is_delete = 0 |
| | | and a.is_default = 1 |
| | | and a.product_type = ${productType} |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.ModelRbd"> |
| | | select a.*, |
| | | CASE |
| | | WHEN b.end =1 THEN '已完成' |
| | | WHEN c.num >0 THEN '正在编辑' |
| | | ELSE '未编辑' END AS modelState |
| | | WHEN b.end =1 THEN '已完成' |
| | | WHEN c.num >0 THEN '正在编辑' |
| | | ELSE '未编辑' END AS modelState, |
| | | d.num as quoteNum |
| | | from model_rbd a |
| | | left join (select model_id,1 as end from algorithm where model_type = 'end' ) b on b.model_id = a.id |
| | | left join (select model_id, count(1) as num from algorithm group by model_id ) c on c.model_id = a.id |
| | | left join (select model_id,1 as end from algorithm where model_type = 'end' and is_delete=0 ) b on b.model_id = |
| | | a.id |
| | | left join (select model_id, count(1) as num from algorithm where is_delete=0 group by model_id ) c on c.model_id |
| | | = a.id |
| | | left join (select model_id,count(1) as num from operat_condit_model where is_delete=0 group by model_id ) d on |
| | | d.model_id = a.id |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="productId!=null and productId!=''"> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.OperatConditDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.OperatCondit"> |
| | | select a.* |
| | | from operat_condit a |
| | | <where> |
| | | a.is_delete = 0 |
| | | and a.product_id=${productId} |
| | | <if test="whereSql!=null"> |
| | | and ${whereSql} |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.OperatConditModelDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel"> |
| | | SELECT a.id , |
| | | a.pid , |
| | | a.`NAME` as product, |
| | | c.model_name, |
| | | b.model_id, |
| | | b.id as operatConditModelId |
| | | FROM product_model a |
| | | LEFT JOIN operat_condit_model b |
| | | ON b.product_id = a.id |
| | | AND b.operat_condit_id = ${operatConditId} |
| | | LEFT JOIN model_rbd c ON c.id = b.model_id |
| | | WHERE a.id in ( |
| | | SELECT DATA.id |
| | | FROM ( |
| | | SELECT @ids as ids, |
| | | (SELECT @ids := GROUP_CONCAT(id) |
| | | FROM product_model |
| | | WHERE FIND_IN_SET(pid, @ids) |
| | | ) as cids |
| | | FROM product_model |
| | | WHERE @ids IS NOT NULL AND @ids := ${productId} |
| | | ) id, |
| | | product_model DATA |
| | | WHERE FIND_IN_SET(DATA.id, ID.ids) |
| | | ) |
| | | and a.product_type in (4, 3, 2, 10) |
| | | AND a.is_delete = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.TaskPhaseModelDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskPhaseModel"> |
| | | SELECT a.id AS id, |
| | | a.pid , |
| | | a.`NAME` as `system`, |
| | | c.model_name, |
| | | b.model_id, |
| | | b.id as productId |
| | | FROM product_model a |
| | | LEFT JOIN task_phase_model b |
| | | ON b.product_id = a.id |
| | | AND b.phase_id = ${phaseId} |
| | | LEFT JOIN model_rbd c ON c.id = b.model_id |
| | | WHERE a.id in ( |
| | | SELECT DATA.id |
| | | FROM ( |
| | | SELECT @ids as ids, |
| | | (SELECT @ids := GROUP_CONCAT(id) |
| | | FROM product_model |
| | | WHERE FIND_IN_SET(pid, @ids) |
| | | ) as cids |
| | | FROM product_model |
| | | WHERE @ids IS NOT NULL AND @ids := ${productId} |
| | | ) id, |
| | | product_model DATA |
| | | WHERE FIND_IN_SET(DATA.id, ID.ids) |
| | | ) |
| | | and a.product_type in (4, 3, 2, 10) |
| | | AND a.is_delete = 0 |
| | | SELECT b.id |
| | | , b.operat_condit_duration_rate |
| | | , a.NAME as operatConditName |
| | | , a.id as operatConditId |
| | | , case |
| | | when b.id is null then 0 |
| | | else 1 end as isCheck |
| | | FROM operat_condit a |
| | | left join task_phase_model b |
| | | on a.id = b.operat_condit_id and b.is_delete = 0 and b.phase_id = ${phaseId} |
| | | WHERE a.IS_DELETE = 0 |
| | | and a.product_id = ${productId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <zt-table-wraper query-url="/sysPictureBase/page" |
| | | :paging='false' |
| | | v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}" |
| | | border |
| | | @row-dblclick="selectedPicture" |
| | |
| | | id:'', |
| | | contentType: '', |
| | | systemMark: '', |
| | | productType:'', |
| | | sortNo: '' |
| | | }, |
| | | } |
| | |
| | | components: {}, |
| | | methods: { |
| | | init(type) { |
| | | this.type = type |
| | | this.dataForm.productType = type |
| | | console.log(this.dataForm.productType) |
| | | }, |
| | | async selectedPicture(row) { |
| | | await this.$tip.success() |
| | |
| | | <el-input v-model="dataForm.name"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="节点类型" prop="nodeType" rules="required"> |
| | | <zt-dict v-model="dataForm.nodeType" dict="product"></zt-dict> |
| | | <zt-dict v-model="dataForm.nodeType" dict="product" @input="getDefaultImg"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item label="基本计算" prop="baseCompute"> |
| | | <zt-dict v-model="dataForm.baseCompute" dict="is_or_not" placeholder="基本计算"></zt-dict> |
| | |
| | | </zt-form-item> |
| | | <zt-form-item label="运行图片" prop="operatImg"> |
| | | <el-input v-model="dataForm.operatImgName" @focus="selectPicture()" :readonly="readonly"></el-input> |
| | | <el-image v-if="dataForm.operatImg" :src="url+dataForm.operatImg" style="height: 50px;width: 50px"></el-image> |
| | | </zt-form-item> |
| | | <zt-form-item label="排序" prop="sort"> |
| | | <el-input v-model="dataForm.sort" :readonly="readonly"></el-input> |
| | |
| | | |
| | | <script> |
| | | import PictureSelect from "@/views/modules/basicInfo/SelectPicture"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | name:'TyProductModel', |
| | | name: 'TyProductModel', |
| | | data() { |
| | | return { |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`, |
| | | fileId: '', |
| | | productList: [], |
| | | dataForm: { |
| | |
| | | reliabDistrib: '', |
| | | repairDistrib: '', |
| | | operatImg: '', |
| | | operatImgName:'', |
| | | operatImgName: '', |
| | | sort: '', |
| | | } |
| | | } |
| | |
| | | methods: { |
| | | init() { |
| | | this.getProductList() |
| | | |
| | | }, |
| | | // 获取系统列表 |
| | | async getProductList() { |
| | |
| | | console.log(this.productList, 'getProductList') |
| | | }, |
| | | selectPicture() { |
| | | this.$refs.pictureSelect.$refs.dialog.init() |
| | | this.$refs.pictureSelect.$refs.dialog.init(this.dataForm.nodeType) |
| | | }, |
| | | openAddWin(row) { |
| | | this.dataForm.operatImgName = row.name |
| | | this.dataForm.operatImg = row.id |
| | | console.log(row, 'openAddWin(row)') |
| | | }, |
| | | async getDefaultImg(selected) { |
| | | console.log(selected, 'async getDefaultImg') |
| | | let params = { |
| | | productType: selected |
| | | } |
| | | let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params:params}) |
| | | this.dataForm.operatImgName = res.data.name |
| | | this.dataForm.operatImg = res.data.id |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let res = await this.$http.get(`/basicInfo/TyProductModel/${this.dataForm.id}`) |
| | |
| | | <el-input v-model="dataForm.name"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="节点类型" prop="productType" rules="required"> |
| | | <zt-dict v-model="dataForm.productType" dict="product"></zt-dict> |
| | | <zt-dict v-model="dataForm.productType" dict="product" @input="getDefaultImg"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item label="运行状态图" prop="operatImg" v-if="isShow"> |
| | | <el-input v-model="dataForm.operatImgName" @focus="selectPicture()" |
| | | :readonly="readonly"></el-input> |
| | | <el-image v-if="dataForm.operatImg" :src="url+dataForm.operatImg" style="height: 50px;width: 50px"></el-image> |
| | | </zt-form-item> |
| | | <zt-form-item label="排序" prop="sort"> |
| | | <el-input v-model="dataForm.sort" :readonly="readonly"></el-input> |
| | |
| | | |
| | | <script> |
| | | import PictureSelect from "@/views/modules/basicInfo/SelectPicture"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`, |
| | | isTree: false, |
| | | isShow: true, |
| | | fileId: '', |
| | |
| | | this.productList = res.data |
| | | console.log(this.productList, 'getProductList') |
| | | }, |
| | | async getDefaultImg(selected) { |
| | | console.log(selected, 'async getDefaultImg') |
| | | let params = { |
| | | productType: selected |
| | | } |
| | | let res = await this.$http.get(`/sysPictureBase/getDefaultImg`, {params:params}) |
| | | this.dataForm.operatImgName = res.data.name |
| | | this.dataForm.operatImg = res.data.id |
| | | }, |
| | | selectPicture() { |
| | | this.$refs.pictureSelect.$refs.dialog.init() |
| | | this.$refs.pictureSelect.$refs.dialog.init(this.dataForm.productType) |
| | | }, |
| | | openAddWin(row) { |
| | | this.dataForm.operatImgName = row.name |
| | |
| | | this.$message.error("最大上传5M") |
| | | return false |
| | | } |
| | | if (fileSize = 0) { |
| | | this.$message.error("未上传图片") |
| | | return false |
| | | } |
| | | }, |
| | | // 文件数量过多时提醒 |
| | | handleExceed() { |
| | |
| | | <el-table-column type="selection" width="40" align="center"/> |
| | | <el-table-column prop="modelName" label="模型名称"/> |
| | | <el-table-column prop="modelTag" label="模型标识"/> |
| | | <el-table-column prop="citedNum" label="被引用数"/> |
| | | <el-table-column prop="quoteNum" label="被引用数"/> |
| | | <el-table-column prop="modelState" label="模型状态" align="center"/> |
| | | <el-table-column prop="modelDataState" label="模型数据状态" align="center"/> |
| | | <el-table-column prop="remark" label="备注"/> |
New file |
| | |
| | | <template> |
| | | <zt-dialog ref="dialog" @confirm="formSubmit"> |
| | | <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> |
| | | <zt-form-item label="工况名称" prop="name" rules="required"> |
| | | <el-input v-model="dataForm.name"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="备注" prop="remark"> |
| | | <el-input v-model="dataForm.remark"></el-input> |
| | | </zt-form-item> |
| | | </el-form> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | id: '', |
| | | productId: '', |
| | | name: '', |
| | | remark: '', |
| | | status: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | init(id,param){ |
| | | this.dataForm.productId =param.productId |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let res = await this.$http.get(`/taskReliability/OperatCondit/${this.dataForm.id}`) |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/OperatCondit/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-row :gutter="16"> |
| | | <el-col :span="14"> |
| | | <div class="mod-taskReliability-operatCondit}"> |
| | | <div class="fa-card-a"> |
| | | <div> |
| | | 产品节点: |
| | | <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/> |
| | | </div> |
| | | <zt-table-wraper ref="tableObj" query-url="/taskReliability/OperatCondit/page" defaultNotQuery="true" delete-url="/taskReliability/OperatCondit" |
| | | v-slot="{ table }" :paging='false'> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <zt-button type="query" @click="table.query()"/> |
| | | <zt-button type="add" @click="add()"/> |
| | | <zt-button type="delete" @click="table.deleteHandle()"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" |
| | | v-adaptive="{bottomOffset:70}" |
| | | border @row-click="selectOperatCondit" @selection-change="table.selectionChangeHandle"> |
| | | <el-table-column type="selection" width="40" align="center"/> |
| | | <el-table-column prop="name" label="工况名称"/> |
| | | <el-table-column prop="remark" label="备注"/> |
| | | <zt-table-column-handle :table="table" |
| | | delete-perm="taskReliability::delete"/> |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update @refreshDataList="table.query" ref="AddOrUpdate"/> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <div class="fa-card-a"> |
| | | <opera-condit-model ref="model"/> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddOrUpdate from './OperatCondit-AddOrUpdate' |
| | | import OperaConditModel from "./OperatConditModel"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | productList: [], |
| | | dataForm: { |
| | | productId: '', |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getTaskProductList() |
| | | }, |
| | | components: { |
| | | OperaConditModel, |
| | | AddOrUpdate |
| | | }, |
| | | |
| | | methods: { |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null,{productId: this.dataForm.productId}) |
| | | }, |
| | | onProductSelected(data) { |
| | | console.log(data, ' onProductSelected(data)') |
| | | this.dataForm.productId = data.id |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | async getTaskProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | console.log(this.productList, ' async getTaskProductList()') |
| | | }, |
| | | selectOperatCondit(row) { |
| | | this.$emit('selectOperatCondit', row) |
| | | let param = { |
| | | row: row, |
| | | productId: this.dataForm.productId |
| | | } |
| | | this.$refs.model.init(param) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div class="mod-taskReliability-operatConditModel}"> |
| | | <zt-table-wraper ref="tableObj" :paging='false' defaultNotQuery="true" query-url="/taskReliability/OperatConditModel/page" delete-url="/taskReliability/OperatConditModel/" v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" |
| | | v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle" |
| | | row-key="id" |
| | | :cell-style="cellStyle" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | :default-expand-all="true"> |
| | | <el-table-column prop="product" label="产品节点" width="160"/> |
| | | <el-table-column prop="modelName" label="产品模型"/> |
| | | <zt-table-column-handle :table="table" edit-perm="taskReliability:update" |
| | | delete-perm="taskReliability::delete" :has-view="false"> |
| | | <template v-slot="{ row }"> |
| | | <zt-table-button @click="openSelectModel(row)">选择模型</zt-table-button> |
| | | </template> |
| | | </zt-table-column-handle> |
| | | </el-table> |
| | | <select-model-rbd ref="SelectModelRbd" ></select-model-rbd> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import SelectModelRbd from "./SelectModelRbd"; |
| | | export default { |
| | | name: 'OperaConditModel', |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | operatConditId:'', |
| | | productId:'', |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | SelectModelRbd |
| | | }, |
| | | methods:{ |
| | | init(param) { |
| | | console.log(param, '') |
| | | this.dataForm.operatConditId = param.row.id |
| | | this.dataForm.productId = param.productId |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | cellStyle({column}) { |
| | | if (column.label === '系统') { |
| | | return 'text-align: left !important;' |
| | | } |
| | | }, |
| | | openSelectModel(row) { |
| | | console.log(row, 'selectModel'); |
| | | if (!row.operatConditId) |
| | | row.operatConditId = this.dataForm.operatConditId |
| | | this.$refs.SelectModelRbd.$refs.dialog.init(row) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | name: 'SelectModelRbd', |
| | | data() { |
| | | return { |
| | | param: null, |
| | | dataForm: { |
| | | id: '', |
| | | modelName: '', |
| | | modelState: '', |
| | | productId: '', |
| | | phaseId: '', |
| | | operatConditId: '', |
| | | modelId: '', |
| | | } |
| | | } |
| | |
| | | methods: { |
| | | init(param) { |
| | | console.log(param) |
| | | this.dataForm.productId = param.row.id |
| | | this.dataForm.phaseId = param.phaseId |
| | | this.dataForm.id = param.row.productId |
| | | this.param = param |
| | | this.dataForm.productId = param.id |
| | | this.dataForm.operatConditId = param.operatConditId |
| | | this.dataForm.id = param.operatConditModelId |
| | | }, |
| | | async selectModel(row) { |
| | | async selectModel(selectRow) { |
| | | console.log(this.dataForm) |
| | | this.dataForm.modelId = row.id |
| | | this.dataForm.productId = row.productId |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/TaskPhaseModel/', this.dataForm) |
| | | this.dataForm.modelId = selectRow.id |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/OperatConditModel/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('setModel') |
| | | this.param.modelName = selectRow.modelName |
| | | } |
| | | } |
| | | } |
| | |
| | | <zt-form-item label="任务阶段名称" prop="phaseName" rules="required"> |
| | | <el-input v-model="dataForm.phaseName"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="阶段时长" prop="phaseDuration"> |
| | | <el-input v-model="dataForm.phaseDuration"></el-input> |
| | | <zt-form-item label="阶段时长比" prop="phaseDuration"> |
| | | <el-input v-model="dataForm.phaseDurationRate"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="阶段时速" prop="phaseSpeed"> |
| | | <el-input v-model="dataForm.phaseSpeed"></el-input> |
| | |
| | | id: '', |
| | | taskId: '', |
| | | phaseName: '', |
| | | phaseDuration: '', |
| | | phaseDurationRate: '', |
| | | phaseSpeed: '', |
| | | phaseSort: '', |
| | | remark: '', |
| | | productId: '' |
| | | } |
| | | }, |
| | | time: null |
| | | } |
| | | }, |
| | | methods: { |
| | | init(id,param){ |
| | | init(id, param) { |
| | | this.dataForm.taskId = param.taskId |
| | | this.dataForm.productId = param.productId |
| | | this.time = param.time |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | | console.log(this.time,'dataLoaded') |
| | | if (this.time + Number(this.dataForm.phaseDurationRate > 1)) { |
| | | this.$alert("当前运行时长比已超出,请重新设置") |
| | | return |
| | | } |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/TaskPhase/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | |
| | | <div class="mod-taskReliability-taskPhase fa-card-a" style="margin-left: 5px;margin-right: 5px;"> |
| | | <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/TaskPhase/page" |
| | | delete-url="/taskReliability/TaskPhase/" |
| | | @dataLoaded="dataLoaded" |
| | | :paging='false' v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}" |
| | | @row-click="selectPhase" @selection-change="table.selectionChangeHandle"> |
| | | |
| | | @row-click="selectPhase" @selection-change="table.selectionChangeHandle"> |
| | | <el-table-column type="selection" width="40" align="center"/> |
| | | <el-table-column prop="phaseName" label="任务阶段名称"/> |
| | | <el-table-column prop="phaseDuration" label="阶段时长"/> |
| | | <el-table-column prop="phaseDurationRate" label="阶段时长比"/> |
| | | <el-table-column prop="phaseSpeed" label="阶段时速"/> |
| | | <el-table-column prop="phaseSort" label="阶段顺序"/> |
| | | <zt-table-column-handle :table="table" |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="7"> |
| | | <task-phase-model ref="model"/> |
| | | <task-phase-model ref="model"/> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | dataForm: { |
| | | taskId: '', |
| | | productId: '' |
| | | } |
| | | }, |
| | | dataList: [], |
| | | time: null |
| | | } |
| | | }, |
| | | components: { |
| | |
| | | AddOrUpdate |
| | | }, |
| | | methods: { |
| | | dataLoaded(data) { |
| | | this.time = null |
| | | this.dataList = data |
| | | for (let i = 0; i < this.dataList.length; i++) { |
| | | this.time = this.time + Number(this.dataList[i].phaseDurationRate) |
| | | } |
| | | console.log( this.time,'dataLoaded') |
| | | if (this.time>1){ |
| | | this.$alert("当前运行时长比已超出,请重新设置") |
| | | } |
| | | }, |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null, { |
| | | taskId: this.dataForm.taskId, |
| | | productId: this.dataForm.productId |
| | | productId: this.dataForm.productId, |
| | | time: this.time |
| | | }) |
| | | }, |
| | | onTaskSelected(row) { |
| | |
| | | <div class="mod-taskReliability-taskPhaseModel fa-card-a" style="margin-left: 5px;"> |
| | | <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/TaskPhaseModel/page" |
| | | :paging='false' |
| | | @dataLoaded="dataLoaded" |
| | | delete-url="/taskReliability/TaskPhaseModel/" v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <zt-button type="warning" @click="handleSaveRows">保存</zt-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" |
| | | v-adaptive="{bottomOffset:30}" border @selection-change="table.selectionChangeHandle" |
| | | row-key="id" |
| | | :cell-style="cellStyle" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | :default-expand-all="true"> |
| | | <el-table-column prop="system" label="系统" width="160"/> |
| | | <el-table-column prop="modelName" label="系统模型"/> |
| | | <zt-table-column-handle :table="table" edit-perm="taskReliability:update" |
| | | delete-perm="taskReliability::delete" :has-view="false"> |
| | | <template v-slot="{ row }"> |
| | | <zt-table-button @click="selectModel(row)">选择模型</zt-table-button> |
| | | v-adaptive="{bottomOffset:30}" border |
| | | @cell-click="handleCellClick" |
| | | @selection-change="table.selectionChangeHandle"> |
| | | <el-table-column prop="operatConditName" label="工况名称" width="160"/> |
| | | <el-table-column prop="operatConditDurationRate" label="工况时长比"> |
| | | <template slot-scope="scope"> |
| | | <span |
| | | v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property"> |
| | | <el-input ref="editInput" |
| | | autosize v-model="scope.row.operatConditDurationRate" |
| | | placeholder="工况时长比"></el-input> |
| | | </span> |
| | | <span v-else>{{scope.row.operatConditDurationRate}}</span> |
| | | </template> |
| | | </zt-table-column-handle> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="选用"> |
| | | <template v-slot="{ row }"> |
| | | <el-checkbox true-label="1" false-label="0" v-model="row.isCheck"></el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <select-model-rbd ref="SelectModelRbd" @setModel="selectModelRbd"></select-model-rbd> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import SelectModelRbd from "./SelectModelRbd"; |
| | | |
| | | export default { |
| | | name: 'TaskPhaseModel', |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | phaseId: '', |
| | | modelName: '', |
| | | productId: '', |
| | | modelId: '', |
| | | } |
| | | phaseId: '', |
| | | operatConditName: '', |
| | | operatConditId: '', |
| | | operatConditDurationRate: '', |
| | | dataList: [], |
| | | isCheck: '' |
| | | }, |
| | | editingCell: null, |
| | | dataList: [], |
| | | originalTableData: [], |
| | | originalData: null, |
| | | } |
| | | }, |
| | | components: { |
| | | SelectModelRbd |
| | | }, |
| | | components: {}, |
| | | methods: { |
| | | init(param) { |
| | | console.log(param, '') |
| | |
| | | this.dataForm.productId = param.productId |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | cellStyle({column}) { |
| | | if (column.label === '系统') { |
| | | return 'text-align: left !important;' |
| | | //批量保存 |
| | | async handleSaveRows() { |
| | | let time = null |
| | | let flag = true |
| | | let list = [] |
| | | this.dataForm.dataThreeList = this.$refs.tableObj.dataList |
| | | for (let i = 0; i < this.dataForm.dataThreeList.length; i++) { |
| | | time = time + Number(this.dataForm.dataThreeList[i].operatConditDurationRate) |
| | | if (this.dataForm.dataThreeList[i].isCheck === '0' && this.dataForm.dataThreeList[i].operatConditDurationRate != null) { |
| | | this.$alert("有未勾选的工况") |
| | | flag = false |
| | | } else if (this.dataForm.dataThreeList[i].isCheck === '1' && this.dataForm.dataThreeList[i].operatConditDurationRate == null) { |
| | | this.$alert("有未填写的工况时长") |
| | | flag = false |
| | | } |
| | | |
| | | if (this.dataForm.dataThreeList[i].isCheck==='1'){ |
| | | list.push(this.dataForm.dataThreeList[i]) |
| | | } |
| | | } |
| | | this.dataForm.dataThreeList = list |
| | | console.log(time, 'async handleSaveRows') |
| | | if (time > 1) { |
| | | this.$alert("时长比和已超过,请重新设置") |
| | | return |
| | | } |
| | | if (!flag) { |
| | | return |
| | | } |
| | | let res = await this.$http.post('/taskReliability/TaskPhaseModel/save', this.dataForm) |
| | | if (res.success) { |
| | | console.log(res.data) |
| | | await this.$tip.success() |
| | | this.originalData = null |
| | | this.dataForm.dataThreeList = null |
| | | this.$refs.tableObj.query() |
| | | this.originalTableData = JSON.parse(JSON.stringify(this.dataList)); // 更新初始数据为当前数据 |
| | | console.log(this.originalTableData, 'this.originalTableData 当前表格json数据') |
| | | } |
| | | }, |
| | | selectModel(row) { |
| | | console.log(row, 'selectModel'); |
| | | let param = { |
| | | row: row, |
| | | phaseId: this.dataForm.phaseId |
| | | dataLoaded(data) { |
| | | this.dataList = data |
| | | for (let i = 0; i < this.dataList.length; i++) { |
| | | this.dataList[i].productId = this.dataForm.productId |
| | | this.dataList[i].phaseId = this.dataForm.phaseId |
| | | } |
| | | this.$refs.SelectModelRbd.$refs.dialog.init(param) |
| | | }, |
| | | selectModelRbd(row) { |
| | | console.log(row, 'selectModelRbd') |
| | | this.$refs.tableObj.query() |
| | | handleCellClick(row, column) { |
| | | this.editingCell = {row, column} |
| | | this.$nextTick(() => { |
| | | if (this.$refs.editInput) { |
| | | this.$refs.editInput.focus() |
| | | } |
| | | }) |
| | | console.log(this.editingCell, 'this.editingCell') |
| | | } |
| | | , |
| | | |
| | | } |
| | | } |
| | | </script> |