From 12b1901605e51506a0fde960a376eb8fc6b2a593 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期四, 07 三月 2024 08:57:03 +0800 Subject: [PATCH] 修改 --- modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataExpectDao.xml | 34 + web/src/views/modules/basicInfo/ProductModelTree.vue | 5 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataAssignController.java | 110 ++++ modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataAssignService.java | 45 + modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml | 12 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/TyProductModelController.java | 8 web/src/views/modules/basicInfo/ParamDataAssign.vue | 138 +++++ modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataAssignDao.xml | 34 + web/src/views/modules/basicInfo/ParamDataExpect.vue | 384 ++++++++++++++ modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataExpectDao.java | 23 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/TyProductModelService.java | 2 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataExpectController.java | 111 ++++ modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java | 16 web/packages/components/zt-table-column-dict/src/zt-table-column-dict.vue | 6 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataExpect.java | 108 ++++ modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java | 7 web/src/views/modules/basicInfo/ParamDataAssign-AddOrUpdate.vue | 144 +++++ modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataAssignDao.java | 23 web/src/views/modules/basicInfo/XhProductModel.vue | 12 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/TyProductModelDao.java | 2 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java | 2 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/TyProductModel.java | 4 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataAssign.java | 102 +++ modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java | 2 web/src/views/modules/basicInfo/SelectTyModel.vue | 46 + modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataExpectService.java | 44 + modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml | 12 web/src/views/modules/basicInfo/ParamDataExpect-AddOrUpdate.vue | 145 +++++ 28 files changed, 1,537 insertions(+), 44 deletions(-) diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataAssignController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataAssignController.java new file mode 100644 index 0000000..b5ae346 --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataAssignController.java @@ -0,0 +1,110 @@ +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(); + } + +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataExpectController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataExpectController.java new file mode 100644 index 0000000..91f1eba --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataExpectController.java @@ -0,0 +1,111 @@ +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(); + } + +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/TyProductModelController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/TyProductModelController.java index 3bf2c60..8be74ca 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/TyProductModelController.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/TyProductModelController.java @@ -32,14 +32,14 @@ /** - * 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; @@ -59,7 +59,9 @@ @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)); diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java index 8b4b488..6d60d9e 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java @@ -31,14 +31,14 @@ /** - * 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; @@ -58,7 +58,7 @@ @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)); @@ -115,6 +115,16 @@ 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("淇敼") diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataAssignDao.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataAssignDao.java new file mode 100644 index 0000000..f208206 --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataAssignDao.java @@ -0,0 +1,23 @@ +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); + +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataExpectDao.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataExpectDao.java new file mode 100644 index 0000000..0af236d --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataExpectDao.java @@ -0,0 +1,23 @@ +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); + +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/TyProductModelDao.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/TyProductModelDao.java index de44506..8a530e5 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/TyProductModelDao.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/TyProductModelDao.java @@ -9,7 +9,7 @@ /** - * ty_product_model + * product_model_common * * @author zt generator * @since 1.0.0 2024-02-28 diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java index b8c107f..98c8322 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java @@ -10,7 +10,7 @@ /** - * xh_product_model + * product_model * * @author zt generator * @since 1.0.0 2024-02-29 diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataAssign.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataAssign.java new file mode 100644 index 0000000..9281fcf --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataAssign.java @@ -0,0 +1,102 @@ +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 = "婧怚D") + 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; +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataExpect.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataExpect.java new file mode 100644 index 0000000..178e1c4 --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataExpect.java @@ -0,0 +1,108 @@ +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 = "婧怚D") + 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; + +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/TyProductModel.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/TyProductModel.java index 06114bd..e3c2269 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/TyProductModel.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/TyProductModel.java @@ -12,14 +12,14 @@ 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; diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java index 0faecf3..c635287 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java @@ -14,20 +14,21 @@ 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 = "婧怚D") + private Long srcId; @ApiModelProperty(value = "鍚嶇О") private String name; diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataAssignService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataAssignService.java new file mode 100644 index 0000000..6288c98 --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataAssignService.java @@ -0,0 +1,45 @@ +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); + } + +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataExpectService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataExpectService.java new file mode 100644 index 0000000..b82f7d9 --- /dev/null +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataExpectService.java @@ -0,0 +1,44 @@ +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); + } + +} diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/TyProductModelService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/TyProductModelService.java index a61252c..b4bbeef 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/TyProductModelService.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/TyProductModelService.java @@ -13,7 +13,7 @@ /** - * ty_product_model + * product_model_common * * @author zt generator * @since 1.0.0 2024-02-28 diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java index 4f5143d..5a13481 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java @@ -15,7 +15,7 @@ /** - * xh_product_model + * product_model * * @author zt generator * @since 1.0.0 2024-02-29 diff --git a/modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataAssignDao.xml b/modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataAssignDao.xml new file mode 100644 index 0000000..8e0ba60 --- /dev/null +++ b/modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataAssignDao.xml @@ -0,0 +1,34 @@ +<?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> diff --git a/modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataExpectDao.xml b/modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataExpectDao.xml new file mode 100644 index 0000000..01184d0 --- /dev/null +++ b/modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataExpectDao.xml @@ -0,0 +1,34 @@ +<?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> diff --git a/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml b/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml index c728ca0..30b878d 100644 --- a/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml +++ b/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml @@ -5,11 +5,17 @@ <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"> @@ -18,12 +24,12 @@ </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"> diff --git a/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml b/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml index 19b8e44..b6e6b28 100644 --- a/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml +++ b/modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml @@ -5,13 +5,13 @@ <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"> @@ -24,7 +24,7 @@ </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"> @@ -38,7 +38,7 @@ </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> diff --git a/web/packages/components/zt-table-column-dict/src/zt-table-column-dict.vue b/web/packages/components/zt-table-column-dict/src/zt-table-column-dict.vue index feef20a..a2f0baf 100644 --- a/web/packages/components/zt-table-column-dict/src/zt-table-column-dict.vue +++ b/web/packages/components/zt-table-column-dict/src/zt-table-column-dict.vue @@ -1,5 +1,5 @@ <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> @@ -7,6 +7,9 @@ export default { name: 'ZtTableColumnDict', props: { + keys:{ + type:String + }, label: String, width: { type: String, @@ -33,6 +36,7 @@ return { } }, + mounted() { }, methods: { diff --git a/web/src/views/modules/basicInfo/ParamDataAssign-AddOrUpdate.vue b/web/src/views/modules/basicInfo/ParamDataAssign-AddOrUpdate.vue new file mode 100644 index 0000000..9713088 --- /dev/null +++ b/web/src/views/modules/basicInfo/ParamDataAssign-AddOrUpdate.vue @@ -0,0 +1,144 @@ +<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> diff --git a/web/src/views/modules/basicInfo/ParamDataAssign.vue b/web/src/views/modules/basicInfo/ParamDataAssign.vue new file mode 100644 index 0000000..fd18827 --- /dev/null +++ b/web/src/views/modules/basicInfo/ParamDataAssign.vue @@ -0,0 +1,138 @@ +<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> diff --git a/web/src/views/modules/basicInfo/ParamDataExpect-AddOrUpdate.vue b/web/src/views/modules/basicInfo/ParamDataExpect-AddOrUpdate.vue new file mode 100644 index 0000000..fb6f074 --- /dev/null +++ b/web/src/views/modules/basicInfo/ParamDataExpect-AddOrUpdate.vue @@ -0,0 +1,145 @@ +<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> diff --git a/web/src/views/modules/basicInfo/ParamDataExpect.vue b/web/src/views/modules/basicInfo/ParamDataExpect.vue new file mode 100644 index 0000000..e6f4498 --- /dev/null +++ b/web/src/views/modules/basicInfo/ParamDataExpect.vue @@ -0,0 +1,384 @@ +<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> diff --git a/web/src/views/modules/basicInfo/ProductModelTree.vue b/web/src/views/modules/basicInfo/ProductModelTree.vue index a2ec468..fba71fb 100644 --- a/web/src/views/modules/basicInfo/ProductModelTree.vue +++ b/web/src/views/modules/basicInfo/ProductModelTree.vue @@ -2,12 +2,12 @@ <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" @@ -59,6 +59,7 @@ 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'}) diff --git a/web/src/views/modules/basicInfo/SelectTyModel.vue b/web/src/views/modules/basicInfo/SelectTyModel.vue index fba603c..f290609 100644 --- a/web/src/views/modules/basicInfo/SelectTyModel.vue +++ b/web/src/views/modules/basicInfo/SelectTyModel.vue @@ -3,14 +3,13 @@ @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> @@ -25,30 +24,57 @@ name: 'SelectTyModel', data() { return { + url:'/basicInfo/TyProductModel/page', + selectList: [], + data: '', dataForm: { - type:'noTree', + 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() } } } diff --git a/web/src/views/modules/basicInfo/XhProductModel.vue b/web/src/views/modules/basicInfo/XhProductModel.vue index 001de71..052fc11 100644 --- a/web/src/views/modules/basicInfo/XhProductModel.vue +++ b/web/src/views/modules/basicInfo/XhProductModel.vue @@ -9,14 +9,11 @@ <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()"/> @@ -73,7 +70,8 @@ name: '', nodeType: '', type:'', - id: '' + pid: '', + srcId:'' } } }, @@ -97,7 +95,7 @@ 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 === '鍚嶇О') { @@ -109,7 +107,7 @@ 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() } -- Gitblit v1.9.1