New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.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.basicInfo.model.ParamDataAssign; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamDataExpect; |
| | | import com.zt.life.modules.mainPart.basicInfo.service.ParamDataAssignService; |
| | | 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; |
| | | |
| | | |
| | | /** |
| | | * param_data_assign |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-05 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basicInfo/ParamDataAssign/") |
| | | @Api(tags="param_data_assign") |
| | | public class ParamDataAssignController { |
| | | @Autowired |
| | | private ParamDataAssignService paramDataAssignService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @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 = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "id", value = "上级ID", dataType = Constant.QT.STRING) |
| | | }) |
| | | public PageResult<ParamDataAssign> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(paramDataAssignService.page(queryFilter)); |
| | | } |
| | | |
| | | @PostMapping("get") |
| | | public Result getSelect(@RequestBody List<ParamDataAssign> list){ |
| | | for(ParamDataAssign assign:list){ |
| | | assign.setProductId(assign.getId()); |
| | | assign.setId(null); |
| | | this.insert(assign); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<ParamDataAssign> get(@PathVariable("id") Long id){ |
| | | ParamDataAssign data = paramDataAssignService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ParamDataAssign paramDataAssign){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(paramDataAssign, AddGroup.class, DefaultGroup.class); |
| | | paramDataAssignService.insert(paramDataAssign); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody ParamDataAssign paramDataAssign){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(paramDataAssign, UpdateGroup.class, DefaultGroup.class); |
| | | paramDataAssignService.update(paramDataAssign); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | paramDataAssignService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.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.basicInfo.model.ParamDataExpect; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel; |
| | | import com.zt.life.modules.mainPart.basicInfo.service.ParamDataExpectService; |
| | | 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; |
| | | |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basicInfo/ParamDataExpect/") |
| | | @Api(tags="param_data_expect") |
| | | public class ParamDataExpectController { |
| | | @Autowired |
| | | private ParamDataExpectService paramDataExpectService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @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 = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING)}) |
| | | public PageResult<ParamDataExpect> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(paramDataExpectService.page(queryFilter)); |
| | | } |
| | | |
| | | @PostMapping("get") |
| | | public Result getSelect(@RequestBody List<ParamDataExpect> list){ |
| | | for(ParamDataExpect ParamDataExpect:list){ |
| | | ParamDataExpect.setProductId(ParamDataExpect.getId()); |
| | | ParamDataExpect.setId(null); |
| | | this.insert(ParamDataExpect); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<ParamDataExpect> get(@PathVariable("id") Long id){ |
| | | ParamDataExpect data = paramDataExpectService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ParamDataExpect paramDataExpect){ |
| | | //效验数据 |
| | | |
| | | ValidatorUtils.validateEntity(paramDataExpect, AddGroup.class, DefaultGroup.class); |
| | | paramDataExpectService.insert(paramDataExpect); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody ParamDataExpect paramDataExpect){ |
| | | //效验数据 |
| | | for (ParamDataExpect expect:paramDataExpect.getDataThreeList()){ |
| | | ValidatorUtils.validateEntity(expect, UpdateGroup.class, DefaultGroup.class); |
| | | paramDataExpectService.update(expect); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | paramDataExpectService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * ty_product_model |
| | | * product_model_common |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basicInfo/TyProductModel/") |
| | | @Api(tags="ty_product_model") |
| | | @Api(tags="product_model_common") |
| | | public class TyProductModelController { |
| | | @Autowired |
| | | private TyProductModelService tyProductModelService; |
| | |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "nodeType", value = "节点类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "reliabDistrib", value = "可靠性分布", dataType = Constant.QT.STRING, format = "reliab_distrib^EQ"), |
| | | @ApiImplicitParam(name = "repairDistrib", value = "维修分布", dataType = Constant.QT.STRING, format = "repair_distrib^EQ") }) |
| | | @ApiImplicitParam(name = "repairDistrib", value = "维修分布", dataType = Constant.QT.STRING, format = "repair_distrib^EQ"), |
| | | @ApiImplicitParam(name = "pid", value = "上级节点", dataType = Constant.QT.STRING) |
| | | }) |
| | | public PageResult<TyProductModel> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(tyProductModelService.page(queryFilter)); |
| | |
| | | |
| | | |
| | | /** |
| | | * xh_product_model |
| | | * product_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basicInfo/XhProductModel/") |
| | | @Api(tags="xh_product_model") |
| | | @Api(tags="product_model") |
| | | public class XhProductModelController { |
| | | @Autowired |
| | | private XhProductModelService xhProductModelService; |
| | |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "节点类型", dataType = Constant.QT.STRING, format = "node_type^EQ"), |
| | | @ApiImplicitParam(name = "id", value = "上级ID", dataType = Constant.QT.STRING) |
| | | @ApiImplicitParam(name = "pid", value = "上级ID", dataType = Constant.QT.STRING) |
| | | }) |
| | | public PageResult<XhProductModel> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | return PageResult.ok(xhProductModelService.page(queryFilter)); |
| | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PostMapping("get") |
| | | public Result getSelect(@RequestBody List<XhProductModel> list){ |
| | | for(XhProductModel xhProductModel:list){ |
| | | xhProductModel.setSrcId(xhProductModel.getId()); |
| | | xhProductModel.setId(null); |
| | | this.insert(xhProductModel); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamDataAssign; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * param_data_assign |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-05 |
| | | */ |
| | | @Mapper |
| | | public interface ParamDataAssignDao extends BaseDao<ParamDataAssign> { |
| | | |
| | | List<ParamDataAssign> getList(Map<String, Object> params); |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamDataExpect; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @Mapper |
| | | public interface ParamDataExpectDao extends BaseDao<ParamDataExpect> { |
| | | |
| | | List<ParamDataExpect> getList(Map<String, Object> params); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * ty_product_model |
| | | * product_model_common |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | |
| | | |
| | | |
| | | /** |
| | | * xh_product_model |
| | | * product_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-29 |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | 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; |
| | | |
| | | /** |
| | | * param_data_assign |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-05 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("param_data_assign") |
| | | public class ParamDataAssign extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "源ID") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "基本可靠性运行比") |
| | | private String baseOperatRatio; |
| | | |
| | | @ApiModelProperty(value = "实际运行时间") |
| | | private String actualRunTime; |
| | | |
| | | @ApiModelProperty(value = "参加计算") |
| | | private Integer joinCompute; |
| | | |
| | | @ApiModelProperty(value = "规定MTBF") |
| | | private String regulateMtbf; |
| | | |
| | | @ApiModelProperty(value = "可接受的MTBF") |
| | | private String acceptMtbf; |
| | | |
| | | @ApiModelProperty(value = "MTBF规定成功率") |
| | | private String regulSuccRateMtbf; |
| | | |
| | | @ApiModelProperty(value = "MTBF可接受成功率") |
| | | private String acceptSuccRateMtbf; |
| | | |
| | | @ApiModelProperty(value = "单元数量") |
| | | private Integer unitNum; |
| | | |
| | | @ApiModelProperty(value = "运行次数") |
| | | private Integer runsNum; |
| | | |
| | | @ApiModelProperty(value = "MTBF运行比") |
| | | private String operatingRatioMtbf; |
| | | |
| | | @ApiModelProperty(value = "单次运行时间") |
| | | private String singleRunTime; |
| | | |
| | | @ApiModelProperty(value = "规定MTBCF") |
| | | private String regulateMtbcf; |
| | | |
| | | @ApiModelProperty(value = "可接受的MTBCF") |
| | | private String acceptMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF规定成功率") |
| | | private String regulSuccRateMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF可接受成功率") |
| | | private String acceptSuccRateMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF运行比") |
| | | private String operatingRatioMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF其他参数") |
| | | private String otherParamsMtbcf; |
| | | |
| | | @ApiModelProperty(value = "可维修") |
| | | private Integer repairable; |
| | | |
| | | @ApiModelProperty(value = "维修分布类型") |
| | | private Integer repairDistribType; |
| | | |
| | | @ApiModelProperty(value = "MTTCR") |
| | | private String mttcr; |
| | | |
| | | @ApiModelProperty(value = "MTTCR其他参数") |
| | | private String otherParamsMttcr; |
| | | |
| | | @ApiModelProperty(value = "可靠性分布类型") |
| | | private Integer reliabDistribType; |
| | | |
| | | @ApiModelProperty(value = "运行时间") |
| | | private String runTime; |
| | | |
| | | @TableField(exist = false) |
| | | private Long productIdInit; |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | 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; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("param_data_expect") |
| | | public class ParamDataExpect extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "源ID") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "基本可靠性运行比") |
| | | private String baseOperatRatio; |
| | | |
| | | @ApiModelProperty(value = "实际运行时间") |
| | | private String actualRunTime; |
| | | |
| | | @ApiModelProperty(value = "参加计算") |
| | | private Integer joinCompute; |
| | | |
| | | @ApiModelProperty(value = "规定MTBF") |
| | | private String regulateMtbf; |
| | | |
| | | @ApiModelProperty(value = "可接受的MTBF") |
| | | private String acceptMtbf; |
| | | |
| | | @ApiModelProperty(value = "MTBF规定成功率") |
| | | private String regulSuccRateMtbf; |
| | | |
| | | @ApiModelProperty(value = "MTBF可接受成功率") |
| | | private String acceptSuccRateMtbf; |
| | | |
| | | @ApiModelProperty(value = "单元数量") |
| | | private Integer unitNum; |
| | | |
| | | @ApiModelProperty(value = "运行次数") |
| | | private Integer runsNum; |
| | | |
| | | @ApiModelProperty(value = "MTBF运行比") |
| | | private String operatingRatioMtbf; |
| | | |
| | | @ApiModelProperty(value = "单次运行时间") |
| | | private String singleRunTime; |
| | | |
| | | @ApiModelProperty(value = "规定MTBCF") |
| | | private String regulateMtbcf; |
| | | |
| | | @ApiModelProperty(value = "可接受的MTBCF") |
| | | private String acceptMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF规定成功率") |
| | | private String regulSuccRateMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF可接受成功率") |
| | | private String acceptSuccRateMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF运行比") |
| | | private String operatingRatioMtbcf; |
| | | |
| | | @ApiModelProperty(value = "MTBCF其他参数") |
| | | private String otherParamsMtbcf; |
| | | |
| | | @ApiModelProperty(value = "可维修") |
| | | private Integer repairable; |
| | | |
| | | @ApiModelProperty(value = "维修分布类型") |
| | | private Integer repairDistribType; |
| | | |
| | | @ApiModelProperty(value = "MTTCR") |
| | | private String mttcr; |
| | | |
| | | @ApiModelProperty(value = "MTTCR其他参数") |
| | | private String otherParamsMttcr; |
| | | |
| | | @ApiModelProperty(value = "可靠性分布类型") |
| | | private Integer reliabDistribType; |
| | | |
| | | @ApiModelProperty(value = "运行时间") |
| | | private String runTime; |
| | | |
| | | @TableField(exist = false) |
| | | private Long productIdInit; |
| | | |
| | | @lombok.Getter |
| | | @TableField(exist = false) |
| | | private List<ParamDataExpect> dataThreeList; |
| | | |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ty_product_model |
| | | * product_model_common |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("ty_product_model") |
| | | @TableName("product_model_common") |
| | | public class TyProductModel extends BusiEntity implements TreeNode<TyProductModel> { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * xh_product_model |
| | | * product_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("xh_product_model") |
| | | @TableName("product_model") |
| | | public class XhProductModel extends BusiEntity implements TreeNode<XhProductModel> { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "上级ID") |
| | | private Long pid; |
| | | |
| | | @ApiModelProperty(value = "源ID") |
| | | private Long srcId; |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.ParamDataAssignDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamDataAssign; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamDataExpect; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * param_data_assign |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-05 |
| | | */ |
| | | @Service |
| | | public class ParamDataAssignService extends BaseService<ParamDataAssignDao, ParamDataAssign> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<ParamDataAssign> page(QueryFilter queryFilter) { |
| | | List<ParamDataAssign> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | for (ParamDataAssign assign :list){ |
| | | assign.setProductId(assign.getProductIdInit()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.ParamDataExpectDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamDataExpect; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @Service |
| | | public class ParamDataExpectService extends BaseService<ParamDataExpectDao, ParamDataExpect> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<ParamDataExpect> page(QueryFilter queryFilter) { |
| | | List<ParamDataExpect> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | for (ParamDataExpect expect :list){ |
| | | expect.setProductId(expect.getProductIdInit()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * ty_product_model |
| | | * product_model_common |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | |
| | | |
| | | |
| | | /** |
| | | * xh_product_model |
| | | * product_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-29 |
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.basicInfo.dao.ParamDataAssignDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamDataAssign"> |
| | | SELECT |
| | | a.NAME, |
| | | b.*, |
| | | CASE |
| | | WHEN b.product_id IS NULL THEN a.id |
| | | ELSE b.product_id |
| | | END AS productIdInit |
| | | FROM |
| | | product_model a |
| | | LEFT JOIN param_data_assign b ON b.product_id = a.id |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="id!=null"> |
| | | and a.pid =${id} |
| | | </if> |
| | | <if test="id==null"> |
| | | and a.pid is null |
| | | </if> |
| | | <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.basicInfo.dao.ParamDataExpectDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamDataExpect"> |
| | | SELECT |
| | | a.NAME, |
| | | b.*, |
| | | CASE |
| | | WHEN b.product_id IS NULL THEN a.id |
| | | ELSE b.product_id |
| | | END AS productIdInit |
| | | FROM |
| | | product_model a |
| | | LEFT JOIN param_data_expect b ON b.product_id = a.id |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="srcId!=null"> |
| | | and a.pid =${srcId} |
| | | </if> |
| | | <if test="srcId==null"> |
| | | and a.pid is null |
| | | </if> |
| | | <if test="whereSql!=null"> |
| | | and ${whereSql} |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel"> |
| | | select a.* |
| | | from ty_product_model a |
| | | from product_model_common a |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="nodeType!=null and nodeType!=''"> |
| | | and a.node_type = ${nodeType} |
| | | <if test="nodeType==1"> |
| | | and a.pid = (select src_id from product_model where id = ${pid}) |
| | | </if> |
| | | <if test="nodeType==2"> |
| | | and a.id not in (select src_id from product_model where PID = ${pid}) |
| | | </if> |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | |
| | | </select> |
| | | <select id="getProductList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel"> |
| | | select a.name,a.id |
| | | from ty_product_model a |
| | | from product_model_common a |
| | | where a.is_delete =0 and a.node_type != 1 |
| | | </select> |
| | | <select id="getNo" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) |
| | | FROM ty_product_model |
| | | FROM product_model_common |
| | | <where> |
| | | is_delete = 0 |
| | | <if test="pid!=null"> |
| | |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel"> |
| | | select a.* |
| | | from xh_product_model a |
| | | from product_model a |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="id!=null"> |
| | | and pid =${id} |
| | | <if test="pid!=null"> |
| | | and pid =${pid} |
| | | </if> |
| | | <if test="id==null"> |
| | | <if test="pid==null"> |
| | | and pid is null |
| | | </if> |
| | | <if test="whereSql!=null"> |
| | |
| | | </select> |
| | | <select id="getNo" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) |
| | | FROM xh_product_model |
| | | FROM product_model |
| | | <where> |
| | | is_delete = 0 |
| | | <if test="pid!=null"> |
| | |
| | | </select> |
| | | <select id="getProductList" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel"> |
| | | select a.name,a.id |
| | | from xh_product_model a |
| | | from product_model a |
| | | where a.is_delete =0 and a.node_type = 5 |
| | | </select> |
| | | </mapper> |
| | |
| | | <template> |
| | | <el-table-column :label="label" header-align="center" align="center" :width="width" v-slot="{ row }"> |
| | | <el-table-column :label="label" :key="keys" header-align="center" align="center" :width="width" v-slot="{ row }"> |
| | | <zt-dict-tag :dict="dict" :value="row[prop]" :typeS="typeS" :typeI="typeI" :typeW="typeW" :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | export default { |
| | | name: 'ZtTableColumnDict', |
| | | props: { |
| | | keys:{ |
| | | type:String |
| | | }, |
| | | label: String, |
| | | width: { |
| | | type: String, |
| | |
| | | return { |
| | | } |
| | | }, |
| | | |
| | | mounted() { |
| | | }, |
| | | methods: { |
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 v-if="type==='4'" label="基本可靠性运行比" prop="baseOperatRatio" > |
| | | <el-input v-model="dataForm.baseOperatRatio"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='4'||type==='5'" label="实际运行时间" prop="actualRunTime" > |
| | | <el-input v-model="dataForm.actualRunTime"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="参加计算" prop="joinCompute" > |
| | | <zt-dict v-model="dataForm.joinCompute" dict="is_or_not"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="规定MTBF" prop="regulateMtbf" > |
| | | <el-input v-model="dataForm.regulateMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可接受的MTBF" prop="acceptMtbf" > |
| | | <el-input v-model="dataForm.acceptMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBF规定成功率" prop="regulSuccRateMtbf" > |
| | | <el-input v-model="dataForm.regulSuccRateMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBF可接受成功率" prop="acceptSuccRateMtbf" > |
| | | <el-input v-model="dataForm.acceptSuccRateMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="单元数量" prop="unitNum" > |
| | | <el-input v-model="dataForm.unitNum"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="运行次数" prop="runsNum" > |
| | | <el-input v-model="dataForm.runsNum"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBF运行比" prop="operatingRatioMtbf" > |
| | | <el-input v-model="dataForm.operatingRatioMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="单次运行时间" prop="singleRunTime" > |
| | | <el-input v-model="dataForm.singleRunTime"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="规定MTBCF" prop="regulateMtbcf" > |
| | | <el-input v-model="dataForm.regulateMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可接受的MTBCF" prop="acceptMtbcf" > |
| | | <el-input v-model="dataForm.acceptMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF规定成功率" prop="regulSuccRateMtbcf" > |
| | | <el-input v-model="dataForm.regulSuccRateMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF可接受成功率" prop="acceptSuccRateMtbcf" > |
| | | <el-input v-model="dataForm.acceptSuccRateMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF运行比" prop="operatingRatioMtbcf" > |
| | | <el-input v-model="dataForm.operatingRatioMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF其他参数" prop="otherParamsMtbcf" > |
| | | <el-input v-model="dataForm.otherParamsMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可维修" prop="repairable" > |
| | | <zt-dict v-model="dataForm.repairable" dict="is_or_not"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="维修分布类型" prop="repairDistribType" > |
| | | <zt-dict v-model="dataForm.repairDistribType" dict="RepairDistribType"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTTCR" prop="mttcr" > |
| | | <el-input v-model="dataForm.mttcr"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTTCR其他参数" prop="otherParamsMttcr" > |
| | | <el-input v-model="dataForm.otherParamsMttcr"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可靠性分布类型" prop="reliabDistribType" > |
| | | <zt-dict v-model="dataForm.reliabDistribType" dict="ReliabDistribType"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="运行时间" prop="runTime" > |
| | | <el-input v-model="dataForm.runTime"></el-input> |
| | | </zt-form-item> |
| | | </el-form> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | type:'', |
| | | dataForm: { |
| | | id: '', |
| | | pid: '', |
| | | name: '', |
| | | baseOperatRatio: '', |
| | | actualRunTime: '', |
| | | joinCompute: '', |
| | | regulateMtbf: '', |
| | | acceptMtbf: '', |
| | | regulSuccRateMtbf: '', |
| | | acceptSuccRateMtbf: '', |
| | | unitNum: '', |
| | | runsNum: '', |
| | | operatingRatioMtbf: '', |
| | | |
| | | singleRunTime: '', |
| | | regulateMtbcf: '', |
| | | acceptMtbcf: '', |
| | | regulSuccRateMtbcf: '', |
| | | acceptSuccRateMtbcf: '', |
| | | operatingRatioMtbcf: '', |
| | | otherParamsMtbcf: '', |
| | | repairable: '', |
| | | repairDistribType: '', |
| | | mttcr: '', |
| | | otherParamsMttcr: '', |
| | | reliabDistribType: '', |
| | | runTime: '', |
| | | productId: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | init(id,params){ |
| | | this.dataForm.id =id |
| | | this.type =params.type |
| | | this.dataForm.name =params.name |
| | | this.dataForm.productId =params.productId |
| | | console.log(this.type,'init') |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let res = await this.$http.get(`/basicInfo/ParamDataAssign/${this.dataForm.id}`) |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/basicInfo/ParamDataAssign/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a"> |
| | | <product-model-tree @on-selected="onProductSelected"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <div class="mod-basicInfo-paramDataAssign}"> |
| | | <zt-table-wraper query-url="/basicInfo/ParamDataAssign/page" delete-url="/basicInfo/ParamDataAssign" |
| | | v-slot="{ table }"> |
| | | <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" v-if="dataForm.nodeType==='2'" @click="add()"/> |
| | | <zt-button type="delete" perm="basicInfo:delete" @click="table.deleteHandle()"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" |
| | | class="paramsDataTable" |
| | | v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle"> |
| | | <el-table-column type="selection" :key="1" width="40" align="center"/> |
| | | <el-table-column prop="name" :key="2" label="名称"/> |
| | | <el-table-column v-if="dataForm.nodeType==='4'" :key="3" prop="baseOperatRatio" label="基本可靠性运行比"/> |
| | | <el-table-column v-if="dataForm.nodeType==='5'||dataForm.nodeType==='4'" :key="4" prop="actualRunTime" |
| | | label="实际运行时间"/> |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="5" label="基本可靠性计算"> |
| | | <!-- <zt-table-column-dict prop="joinCompute" :keys="6" label="参加计算" width="100" dict="is_or_not"/>--> |
| | | <el-table-column prop="joinCompute" label="参加计算" :key="6" v-slot="{ row }" width="100"> |
| | | <zt-dict-tag dict="is_or_not" :value="row.joinCompute" :typeS="typeS" :typeI="typeI" :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </el-table-column> |
| | | <el-table-column prop="regulateMtbf" :key="7" label="规定MTBF" width="120"/> |
| | | <el-table-column prop="acceptMtbf" :key="8" label="可接受的MTBF" width="160"/> |
| | | <el-table-column prop="regulSuccRateMtbf" :key="9" label="MTBF规定成功率" width="180"/> |
| | | <el-table-column prop="acceptSuccRateMtbf" :key="10" label="MTBF可接受成功率" width="180"/> |
| | | <el-table-column prop="unitNum" label="单元数量" :key="11" width="100"/> |
| | | <el-table-column prop="runsNum" label="运行次数" :key="12" width="100"/> |
| | | <el-table-column prop="operatingRatioMtbf" :key="13" label="MTBF运行比" width="140"/> |
| | | <el-table-column prop="singleRunTime" :key="14" label="单次运行时间" width="140"/> |
| | | </el-table-column> |
| | | |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="15" label="任务可靠性计算"> |
| | | <el-table-column prop="regulateMtbcf" :key="16" label="规定MTBCF" width="120"/> |
| | | <el-table-column prop="acceptMtbcf" :key="17" label="可接受的MTBCF" width="160"/> |
| | | <el-table-column prop="regulSuccRateMtbcf" :key="18" label="MTBCF规定成功率" width="180"/> |
| | | <el-table-column prop="acceptSuccRateMtbcf" :key="19" label="MTBCF可接受成功率" width="200"/> |
| | | <el-table-column prop="operatingRatioMtbcf" :key="20" label="MTBCF运行比" width="140"/> |
| | | <el-table-column prop="otherParamsMtbcf" :key="21" label="MTBCF其他参数" width="160"/> |
| | | </el-table-column> |
| | | |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="22" label="维修分布"> |
| | | <!-- <zt-table-column-dict prop="repairable" :keys="23" label="可维修" dict="is_or_not"/>--> |
| | | <el-table-column prop="repairable" label="可维修" :key="23" v-slot="{ row }"> |
| | | <zt-dict-tag dict="is_or_not" :value="row.repairable" :typeS="typeS" :typeI="typeI" :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </el-table-column> |
| | | <!-- <zt-table-column-dict prop="repairDistribType" :keys="24" label="维修分布类型" width="140" dict="RepairDistribType"/>--> |
| | | <el-table-column prop="repairDistribType" label="维修分布类型" :key="24" v-slot="{ row }" width="140"> |
| | | <zt-dict-tag dict="RepairDistribType" :value="row.repairDistribType" :typeS="typeS" :typeI="typeI" :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </el-table-column> |
| | | <el-table-column prop="mttcr" label="MTTCR" :key="25" width="100"/> |
| | | <el-table-column prop="otherParamsMttcr" :key="26" label="MTTCR其他参数" width="180"/> |
| | | </el-table-column> |
| | | |
| | | <!-- <zt-table-column-dict v-if="dataForm.nodeType==='2'" :key="27" prop="reliabDistribType" label="可靠性分布类型" |
| | | width="160"/>--> |
| | | <el-table-column prop="reliabDistribType" label="可靠性分布类型" :key="27" v-slot="{ row }" width="160"> |
| | | <zt-dict-tag dict="ReliabDistribType" :value="row.repairDistribType" :typeS="typeS" :typeI="typeI" :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </el-table-column> |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="28" prop="runTime" label="运行时间" width="100" |
| | | dict="ReliabDistribType"/> |
| | | <zt-table-column-handle :table="table" delete-perm="basicInfo::delete" edit-perm="basicInfo::update"> |
| | | <template v-slot="{ row }"> |
| | | <zt-table-button @click="update(row)">修改</zt-table-button> |
| | | </template> |
| | | </zt-table-column-handle> |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update ref="AddOrUpdate" @refreshDataList="table.query"/> |
| | | <select-ty-model @refreshDataList="table.query" ref="SelectTyModel"/> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddOrUpdate from './ParamDataAssign-AddOrUpdate' |
| | | import ProductModelTree from "./ProductModelTree"; |
| | | import SelectTyModel from "./SelectTyModel"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | key:'', |
| | | typeS: '', |
| | | typeI: '', |
| | | typeW: '', |
| | | typeD: '', |
| | | typeColor: {}, |
| | | size: '', |
| | | effect: '', |
| | | hit: false, |
| | | dataForm: { |
| | | name: '', |
| | | id: '', |
| | | nodeType: '5' |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | AddOrUpdate, |
| | | ProductModelTree, |
| | | SelectTyModel |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null,{type: this.dataForm.nodeType - 1, id: this.dataForm.id,data:'assign'}) |
| | | }, |
| | | update(row){ |
| | | console.log(row,'update') |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(row.id,{type: this.dataForm.nodeType,name:row.name,productId:row.productId}) |
| | | }, |
| | | onProductSelected(data) { |
| | | this.dataForm.id = data.id |
| | | this.dataForm.nodeType = data.nodeType |
| | | console.log(data, 'onProductSelected(data)') |
| | | this.$refs.tableObj.query() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .paramsDataTable.el-table thead.is-group th { |
| | | background: #edf6ff; |
| | | } |
| | | </style> |
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 v-if="type==='4'" label="基本可靠性运行比" prop="baseOperatRatio" > |
| | | <el-input v-model="dataForm.baseOperatRatio"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='4'||type==='5'" label="实际运行时间" prop="actualRunTime" > |
| | | <el-input v-model="dataForm.actualRunTime"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="参加计算" prop="joinCompute" > |
| | | <zt-dict v-model="dataForm.joinCompute" dict="is_or_not"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="规定MTBF" prop="regulateMtbf" > |
| | | <el-input v-model="dataForm.regulateMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可接受的MTBF" prop="acceptMtbf" > |
| | | <el-input v-model="dataForm.acceptMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBF规定成功率" prop="regulSuccRateMtbf" > |
| | | <el-input v-model="dataForm.regulSuccRateMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBF可接受成功率" prop="acceptSuccRateMtbf" > |
| | | <el-input v-model="dataForm.acceptSuccRateMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="单元数量" prop="unitNum" > |
| | | <el-input v-model="dataForm.unitNum"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="运行次数" prop="runsNum" > |
| | | <el-input v-model="dataForm.runsNum"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBF运行比" prop="operatingRatioMtbf" > |
| | | <el-input v-model="dataForm.operatingRatioMtbf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="单次运行时间" prop="singleRunTime" > |
| | | <el-input v-model="dataForm.singleRunTime"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="规定MTBCF" prop="regulateMtbcf" > |
| | | <el-input v-model="dataForm.regulateMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可接受的MTBCF" prop="acceptMtbcf" > |
| | | <el-input v-model="dataForm.acceptMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF规定成功率" prop="regulSuccRateMtbcf" > |
| | | <el-input v-model="dataForm.regulSuccRateMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF可接受成功率" prop="acceptSuccRateMtbcf" > |
| | | <el-input v-model="dataForm.acceptSuccRateMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF运行比" prop="operatingRatioMtbcf" > |
| | | <el-input v-model="dataForm.operatingRatioMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTBCF其他参数" prop="otherParamsMtbcf" > |
| | | <el-input v-model="dataForm.otherParamsMtbcf"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可维修" prop="repairable" > |
| | | <zt-dict v-model="dataForm.repairable" dict="is_or_not"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="维修分布类型" prop="repairDistribType" > |
| | | <zt-dict v-model="dataForm.repairDistribType" dict="RepairDistribType"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTTCR" prop="mttcr" > |
| | | <el-input v-model="dataForm.mttcr"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="MTTCR其他参数" prop="otherParamsMttcr" > |
| | | <el-input v-model="dataForm.otherParamsMttcr"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="可靠性分布类型" prop="reliabDistribType" > |
| | | <zt-dict v-model="dataForm.reliabDistribType" dict="ReliabDistribType"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="type==='2'" label="运行时间" prop="runTime" > |
| | | <el-input v-model="dataForm.runTime"></el-input> |
| | | </zt-form-item> |
| | | </el-form> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | type:'', |
| | | dataForm: { |
| | | id: '', |
| | | pid: '', |
| | | srcId: '', |
| | | name: '', |
| | | baseOperatRatio: '', |
| | | actualRunTime: '', |
| | | joinCompute: '', |
| | | regulateMtbf: '', |
| | | acceptMtbf: '', |
| | | regulSuccRateMtbf: '', |
| | | acceptSuccRateMtbf: '', |
| | | unitNum: '', |
| | | runsNum: '', |
| | | operatingRatioMtbf: '', |
| | | |
| | | singleRunTime: '', |
| | | regulateMtbcf: '', |
| | | acceptMtbcf: '', |
| | | regulSuccRateMtbcf: '', |
| | | acceptSuccRateMtbcf: '', |
| | | operatingRatioMtbcf: '', |
| | | otherParamsMtbcf: '', |
| | | repairable: '', |
| | | repairDistribType: '', |
| | | mttcr: '', |
| | | otherParamsMttcr: '', |
| | | reliabDistribType: '', |
| | | runTime: '', |
| | | productId: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | init(id,params){ |
| | | this.dataForm.id =id |
| | | this.type =params.type |
| | | this.dataForm.name =params.name |
| | | this.dataForm.productId =params.productId |
| | | console.log(this.type,'init') |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let res = await this.$http.get(`/basicInfo/ParamDataExpect/${this.dataForm.id}`) |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/basicInfo/ParamDataExpect/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a"> |
| | | <product-model-tree @on-selected="onProductSelected"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <div class="mod-basicInfo-paramDataExpect}"> |
| | | <zt-table-wraper ref="tableObj" query-url="/basicInfo/ParamDataExpect/page" |
| | | delete-url="/basicInfo/ParamDataExpect/" |
| | | @dataLoaded="dataLoaded" |
| | | v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <el-input v-model="dataForm.name" placeholder="请输入名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-button type="warning" @click="handleSaveRows">保存</zt-button> |
| | | <zt-button type="query" @click="table.query()"/> |
| | | <zt-button type="add" v-if="dataForm.nodeType==='2'" @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}" |
| | | class="paramsDataTable" |
| | | |
| | | border @selection-change="table.selectionChangeHandle"> |
| | | <el-table-column type="selection" :key="1" width="40" align="center"/> |
| | | <el-table-column prop="name" :key="2" label="名称" fixed="left"/> |
| | | <el-table-column v-if="dataForm.nodeType==='4'" :key="3" prop="baseOperatRatio" label="基本可靠性运行比"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.baseOperatRatio"></el-input> |
| | | <span v-else v-text="scope.row.baseOperatRatio"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="dataForm.nodeType==='5'||dataForm.nodeType==='4'" :key="4" prop="actualRunTime" |
| | | label="实际运行时间"> |
| | | <!-- <template slot-scope="scope"> |
| | | <span v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property"> |
| | | <el-input ref="editInput" v-model="scope.row.actualRunTime" placeholder="实际运行时间"></el-input> |
| | | </span> |
| | | <span v-else>{{scope.row.actualRunTime}}</span> |
| | | </template>--> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.actualRunTime"></el-input> |
| | | <span v-else v-text="scope.row.actualRunTime"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="5" label="基本可靠性计算"> |
| | | <!-- <zt-table-column-dict prop="joinCompute" :keys="6" label="参加计算" width="100" dict="is_or_not"/>--> |
| | | <el-table-column prop="joinCompute" label="参加计算" :key="6" v-slot="{ row }" width="100"> |
| | | <template v-slot="{ row }"> |
| | | <el-select v-if="row.isEdit" v-model="row.joinCompute" |
| | | placeholder="参加计算"> |
| | | <el-option v-for="item in isOrNot" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <zt-dict-tag dict="is_or_not" :value="row.joinCompute" :typeS="typeS" :typeI="typeI" :typeD="typeD" |
| | | :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="regulateMtbf" :key="7" label="规定MTBF" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.regulateMtbf"></el-input> |
| | | <span v-else v-text="scope.row.regulateMtbf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="acceptMtbf" :key="8" label="可接受的MTBF" width="160"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.acceptMtbf"></el-input> |
| | | <span v-else v-text="scope.row.acceptMtbf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="regulSuccRateMtbf" :key="9" label="MTBF规定成功率" width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.regulSuccRateMtbf"></el-input> |
| | | <span v-else v-text="scope.row.regulSuccRateMtbf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="acceptSuccRateMtbf" :key="10" label="MTBF可接受成功率" width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.acceptSuccRateMtbf"></el-input> |
| | | <span v-else v-text="scope.row.acceptSuccRateMtbf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitNum" label="单元数量" :key="11" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.unitNum"></el-input> |
| | | <span v-else v-text="scope.row.unitNum"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="runsNum" label="运行次数" :key="12" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.runsNum"></el-input> |
| | | <span v-else v-text="scope.row.runsNum"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="operatingRatioMtbf" :key="13" label="MTBF运行比" width="140"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.operatingRatioMtbf"></el-input> |
| | | <span v-else v-text="scope.row.operatingRatioMtbf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="singleRunTime" :key="14" label="单次运行时间" width="140"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.singleRunTime"></el-input> |
| | | <span v-else v-text="scope.row.singleRunTime"></span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | | |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="15" label="任务可靠性计算"> |
| | | <el-table-column prop="regulateMtbcf" :key="16" label="规定MTBCF" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.regulateMtbcf"></el-input> |
| | | <span v-else v-text="scope.row.regulateMtbcf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="acceptMtbcf" :key="17" label="可接受的MTBCF" width="160"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.acceptMtbcf"></el-input> |
| | | <span v-else v-text="scope.row.acceptMtbcf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="regulSuccRateMtbcf" :key="18" label="MTBCF规定成功率" width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.regulSuccRateMtbcf"></el-input> |
| | | <span v-else v-text="scope.row.regulSuccRateMtbcf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="acceptSuccRateMtbcf" :key="19" label="MTBCF可接受成功率" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.acceptSuccRateMtbcf"></el-input> |
| | | <span v-else v-text="scope.row.acceptSuccRateMtbcf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="operatingRatioMtbcf" :key="20" label="MTBCF运行比" width="140"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.operatingRatioMtbcf"></el-input> |
| | | <span v-else v-text="scope.row.operatingRatioMtbcf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="otherParamsMtbcf" :key="21" label="MTBCF其他参数" width="160"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.otherParamsMtbcf"></el-input> |
| | | <span v-else v-text="scope.row.otherParamsMtbcf"></span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | | |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="22" label="维修分布"> |
| | | <!-- <zt-table-column-dict prop="repairable" :keys="23" label="可维修" dict="is_or_not"/>--> |
| | | <el-table-column prop="repairable" label="可维修" :key="23" v-slot="{ row }"> |
| | | <template v-slot="{ row }"> |
| | | <el-select v-if="row.isEdit" v-model="row.repairable" |
| | | placeholder="当前状态"> |
| | | <el-option v-for="item in isOrNot" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <zt-dict-tag dict="is_or_not" :value="row.repairable" :typeS="typeS" :typeI="typeI" :typeD="typeD" |
| | | :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <zt-table-column-dict prop="repairDistribType" :keys="24" label="维修分布类型" width="140" dict="RepairDistribType"/>--> |
| | | <el-table-column prop="repairDistribType" label="维修分布类型" :key="24" v-slot="{ row }" width="140"> |
| | | <template v-slot="{ row }"> |
| | | <el-select v-if="row.isEdit" v-model="row.repairDistribType" |
| | | placeholder="当前状态"> |
| | | <el-option v-for="item in repairDistribType" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <zt-dict-tag dict="RepairDistribType" :value="row.repairDistribType" :typeS="typeS" :typeI="typeI" |
| | | :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="mttcr" label="MTTCR" :key="25" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.mttcr"></el-input> |
| | | <span v-else v-text="scope.row.mttcr"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="otherParamsMttcr" :key="26" label="MTTCR其他参数" width="180"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.mttcr"></el-input> |
| | | <span v-else v-text="scope.row.mttcr"></span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | | |
| | | <!-- <zt-table-column-dict v-if="dataForm.nodeType==='2'" :key="27" prop="reliabDistribType" label="可靠性分布类型" |
| | | width="160"/>--> |
| | | <el-table-column prop="reliabDistribType" label="可靠性分布类型" :key="27" width="160"> |
| | | <template v-slot="{ row }"> |
| | | <el-select v-if="row.isEdit" v-model="row.reliabDistribType" |
| | | placeholder="当前状态"> |
| | | <el-option v-for="item in reliabDistribType" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <zt-dict-tag v-else dict="ReliabDistribType" :value="row.repairDistribType" :typeS="typeS" |
| | | :typeI="typeI" :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" |
| | | :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="28" prop="runTime" label="运行时间" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isEdit" v-model="scope.row.runTime"></el-input> |
| | | <span v-else v-text="scope.row.runTime"></span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" align="center" label="操作" width="150"> |
| | | <template slot-scope="scope"> |
| | | <zt-table-button size="small" type="primary" @click="edit(scope.row)">修改 |
| | | </zt-table-button> |
| | | <zt-table-button v-if="scope.row.isCanel" size="small" type="primary" @click="canel(scope.row)">取消 |
| | | </zt-table-button> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update ref="AddOrUpdate" @refreshDataList="table.query"/> |
| | | <select-ty-model @refreshDataList="table.query" ref="SelectTyModel"/> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddOrUpdate from './ParamDataExpect-AddOrUpdate' |
| | | import ProductModelTree from "./ProductModelTree"; |
| | | import SelectTyModel from "./SelectTyModel"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | key: '', |
| | | typeS: '', |
| | | typeI: '', |
| | | typeW: '', |
| | | typeD: '', |
| | | typeColor: {}, |
| | | size: '', |
| | | effect: '', |
| | | hit: false, |
| | | dataForm: { |
| | | id: '', |
| | | pid: '', |
| | | srcId: '', |
| | | name: '', |
| | | dataThreeList: null, |
| | | nodeType: '5' |
| | | }, |
| | | isOrNot: [{ |
| | | value: 1, |
| | | label: '是' |
| | | }], |
| | | repairDistribType: [{ |
| | | value: 1, |
| | | label: '指数分布' |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: '威布尔分布' |
| | | }, |
| | | ], |
| | | reliabDistribType: [ |
| | | { |
| | | value: 1, |
| | | label: '二项分布' |
| | | }, { |
| | | value: 2, |
| | | label: '威布尔分布' |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: '指数分布' |
| | | }, |
| | | ], |
| | | // editingCell:null, |
| | | dataList: [], |
| | | originalData: null, // 记录修改前的数据 |
| | | } |
| | | }, |
| | | components: { |
| | | AddOrUpdate, |
| | | ProductModelTree, |
| | | SelectTyModel |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null, { |
| | | type: this.dataForm.nodeType - 1, |
| | | id: this.dataForm.id, |
| | | data: 'expect' |
| | | }) |
| | | }, |
| | | //批量保存 |
| | | async handleSaveRows() { |
| | | this.dataForm.dataThreeList = this.$refs.tableObj.dataList |
| | | console.log(this.dataForm, 'this.dataForm this.dataForm') |
| | | let res = await this.$http.post('/basicInfo/ParamDataExpect/', this.dataForm) |
| | | if (res.success) { |
| | | console.log(res.data) |
| | | await this.$tip.success() |
| | | this.originalData = null |
| | | this.dataForm.dataThreeList = null |
| | | this.$refs.tableObj.query() |
| | | } |
| | | }, |
| | | edit(row) { |
| | | row.isCanel = true |
| | | row.isEdit = true |
| | | row.isRemove = false |
| | | this.originalData = {...row} |
| | | }, |
| | | canel(row) { |
| | | // 如果原始数据为空,则记录原始数据 |
| | | if (!this.originalData) { |
| | | this.originalData = {...row} |
| | | } |
| | | // 将当前数据恢复为原始数据 |
| | | Object.assign(row, this.originalData) |
| | | console.log(this.originalData, 'console.log(this.originalData)') |
| | | // 恢复成功后,将 originalData 设为 null |
| | | this.originalData = null |
| | | row.isEdit = false |
| | | row.isCanel = false |
| | | }, |
| | | // handleCellClick(row, column) { |
| | | // this.editingCell = {row, column} |
| | | // this.$nextTick(() => { |
| | | // if(this.$refs.editInput){ |
| | | // this.$refs.editInput.focus() |
| | | // } |
| | | // }) |
| | | // console.log(this.editingCell, 'this.editingCell') |
| | | // }, |
| | | update(row) { |
| | | console.log(row, 'update') |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(row.id, { |
| | | type: this.dataForm.nodeType, |
| | | name: row.name, |
| | | productId: row.productId |
| | | }) |
| | | }, |
| | | onProductSelected(data) { |
| | | this.dataForm.srcId = data.id |
| | | this.dataForm.nodeType = data.nodeType |
| | | console.log(data, 'onProductSelected(data)') |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | dataLoaded(data) { |
| | | this.dataList = data |
| | | for (let dataList of data) { |
| | | this.$set(dataList, 'isEdit', false) |
| | | this.$set(dataList, 'isCanel', false) |
| | | this.$set(dataList, 'isRemove', false) |
| | | console.log(dataList, 'dataList') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .paramsDataTable.el-table thead.is-group th { |
| | | background: #edf6ff; |
| | | } |
| | | </style> |
| | |
| | | <div class="product-tree-container " :style="'height:' + tree_Hei +'px'"> |
| | | <el-input |
| | | placeholder="输入名称进行过滤" |
| | | style="width: 80%" |
| | | style="width: 60%" |
| | | v-model="filterText" |
| | | size="small" |
| | | clearable |
| | | ></el-input> |
| | | <el-button type="primary" @click="add()" style="margin-top: 10px">新增</el-button> |
| | | <el-button type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增</el-button> |
| | | <el-divider></el-divider> |
| | | <el-tree |
| | | style="height: 90%;overflow: auto" |
| | |
| | | async getProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/tree') |
| | | this.productList = res.data |
| | | console.log(res.data,'async getProductList()') |
| | | }, |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null,{id: null, type: 'tree'}) |
| | |
| | | @confirm="formSubmit"> |
| | | <el-card shadow="never" class="aui-card--fill"> |
| | | <div class="mod-tyProductModel-tyProductModel}"> |
| | | <zt-table-wraper query-url="/basicInfo/TyProductModel/page" |
| | | <zt-table-wraper :query-url=url |
| | | 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 |
| | | @selection-change="table.selectionChangeHandle" |
| | | @selected="onSelected"> |
| | | @selection-change="changeRow"> |
| | | <el-table-column type="selection" width="40" align="center"/> |
| | | <el-table-column prop="name" label="名称"/> |
| | | </el-table> |
| | |
| | | name: 'SelectTyModel', |
| | | data() { |
| | | return { |
| | | url:'/basicInfo/TyProductModel/page', |
| | | selectList: [], |
| | | data: '', |
| | | dataForm: { |
| | | type:'noTree', |
| | | nodeType: '', |
| | | id: '', |
| | | pid: '', |
| | | name: '', |
| | | operationalStatus: '', |
| | | standbyState: '', |
| | | faultState: '', |
| | | sort: '' |
| | | } |
| | | } |
| | | }, |
| | | components: {}, |
| | | methods: { |
| | | init(type) { |
| | | this.dataForm.nodeType = type |
| | | console.log(this.dataForm.nodeType, 'init()') |
| | | init(id,params) { |
| | | this.dataForm.nodeType = params.type |
| | | this.dataForm.pid = params.id |
| | | this.data = params.data |
| | | if (this.data ==='expect'||this.data==='assign'){ |
| | | this.url='/basicInfo/XhProductModel/page' |
| | | } |
| | | console.log(this.dataForm.pid, 'init()') |
| | | }, |
| | | async onSelected() { |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/basicInfo/XhProductModel/', this.dataForm) |
| | | changeRow(selection) { |
| | | console.log(selection, ' changeRow(selection)') |
| | | let item = {} |
| | | for (item of selection) { |
| | | console.log(item) |
| | | item.pid = this.dataForm.pid |
| | | } |
| | | this.selectList = selection |
| | | }, |
| | | async formSubmit() { |
| | | let res |
| | | if (this.data && this.data === 'expect'){ |
| | | res = await this.$http.post('/basicInfo/ParamDataExpect/get', this.selectList) |
| | | }else if(this.data && this.data === 'assign') { |
| | | res = await this.$http.post('/basicInfo/ParamDataAssign/get', this.selectList) |
| | | }else |
| | | { |
| | | res = await this.$http.post('/basicInfo/XhProductModel/get', this.selectList) |
| | | } |
| | | |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | this.map.clear() |
| | | } |
| | | } |
| | | } |
| | |
| | | <el-col :span="19"> |
| | | <div class="mod-basicInfo-xhProductModel}"> |
| | | <zt-table-wraper ref="tableObj" query-url="/basicInfo/XhProductModel/page" |
| | | delete-url="/basicInfo/XhProductModel " |
| | | delete-url="/basicInfo/XhProductModel/ " |
| | | v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <el-input v-model="dataForm.name" placeholder="请输入名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-dict v-model="dataForm.nodeType" dict="product" clearable></zt-dict> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-button type="query" @click="table.query()"/> |
| | |
| | | name: '', |
| | | nodeType: '', |
| | | type:'', |
| | | id: '' |
| | | pid: '', |
| | | srcId:'' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.$alert("当前节点不可新增子节点,请重新设置") |
| | | return |
| | | } |
| | | this.$refs.SelectTyModel.$refs.dialog.init(this.dataForm.type ) |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null,{type:this.dataForm.type,id:this.dataForm.pid}) |
| | | }, |
| | | cellStyle({column}) { |
| | | if (column.label === '名称') { |
| | |
| | | return `${window.SITE_CONFIG['apiURL']}/sys/oss/content2?fileId=${id}` |
| | | }, |
| | | onProductSelected(data) { |
| | | this.dataForm.id = data.id |
| | | this.dataForm.pid = data.id |
| | | this.dataForm.type = data.nodeType |
| | | this.$refs.tableObj.query() |
| | | } |