28个文件已修改
1 文件已重命名
5个文件已添加
| | |
| | | |
| | | @GetMapping("getProduct") |
| | | public Result<List<ProductImg>> getProduct(Long productId) { |
| | | |
| | | List<ProductImg> list = xhProductModelService.getProduct(productId); |
| | | |
| | | return Result.ok(list); |
| | | } |
| | | |
| | |
| | | |
| | | List<XhProductModel> getProductList(); |
| | | |
| | | List<ProductImg> getProduct(Long productId); |
| | | List<ProductImg> getProduct(Long productId, Long parentId); |
| | | |
| | | List<XhProductModel> getTaskProductList(); |
| | | XhProductModel getById(Long id); |
| | |
| | | private String productType; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer reliabDistribType; |
| | | private int reliabDistribType; |
| | | @TableField(exist = false) |
| | | private String taskMtbcf; |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private Integer isRepair; |
| | | @TableField(exist = false) |
| | | private Integer repairDistribType; |
| | | private int repairDistribType; |
| | | @TableField(exist = false) |
| | | private String RepairMttcr; |
| | | @TableField(exist = false) |
| | |
| | | } |
| | | |
| | | public List<ProductImg> getProduct(Long productId) { |
| | | return baseDao.getProduct(productId); |
| | | XhProductModel model =this.get(productId); |
| | | Long parentId = model.getPid(); |
| | | return baseDao.getProduct(productId,parentId); |
| | | } |
| | | |
| | | public List<XhProductModel> getTaskProductList() { |
| | |
| | | } else { |
| | | sysPictureBaseService.insert(sysPictureBase); |
| | | } |
| | | if (sysPictureBase.getIsDefault()==1){ |
| | | if (sysPictureBase.getId()==null){ |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),null); |
| | | }else{ |
| | | if (!sysPictureBase.getId().equals(sysPictureBase.getId())){ |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),sysPictureBase.getId()); |
| | | } |
| | | } |
| | | if (sysPictureBase.getIsDefault() == 1) { |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(), sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(), sysPictureBase.getProductType(), null); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | |
| | | //关流 |
| | | outputStream.close(); |
| | | in.close(); |
| | | } catch (IOException e) { |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | response.getWriter().flush(); |
| | | response.getWriter().close(); |
| | | |
| | | } catch (IOException e) { |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | SysPictureBase data = sysPictureBaseService.getDefaultImg(productType); |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelLine; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelRbd; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.ModelLineService; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.ModelRbdNodeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | @Autowired |
| | | private ModelLineService modelLineService; |
| | | |
| | | @Autowired |
| | | private ModelRbdNodeService modelRbdNodeService; |
| | | |
| | | @Autowired |
| | | private PythonLib pythonLib; |
| | |
| | | ValidatorUtils.validateEntity(modelRbd, AddGroup.class, DefaultGroup.class); |
| | | modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR)); |
| | | modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR)); |
| | | modelRbdNodeService.saveNodeArr(modelRbd); |
| | | modelLineService.insert(modelRbd); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | |
| | | ValidatorUtils.validateEntity(modelRbd, UpdateGroup.class, DefaultGroup.class); |
| | | modelRbd.setContent(modelRbd.getContent().replace(modelRbd.getUrlPref(), URL_REPLACE_STR)); |
| | | modelRbd.setContent(modelRbd.getContent().replaceAll(TOKEN_REPLACE_REGEX, TOKEN_REPLACE_STR)); |
| | | modelRbdNodeService.saveNodeArr(modelRbd); |
| | | modelLineService.update(modelRbd); |
| | | |
| | | return Result.ok(); |
| | |
| | | import com.zt.common.validator.group.AddGroup; |
| | | import com.zt.common.validator.group.DefaultGroup; |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelNodes; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.OperatConditModelService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | return Result.ok(operatConditModelService.page(queryFilter)); |
| | | } |
| | | |
| | | @GetMapping("getModelNodes") |
| | | @ApiOperation("模型") |
| | | public Result<Map> getModelNodes(Long shipId) { |
| | | Map data = operatConditModelService.getModelNodes(shipId); |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<OperatConditModel> get(@PathVariable("id") Long id){ |
| | | OperatConditModel data = operatConditModelService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody OperatConditModel operatConditModel){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(operatConditModel, AddGroup.class, DefaultGroup.class); |
| | | operatConditModelService.insert(operatConditModel); |
| | | |
| | | //ValidatorUtils.validateEntity(operatConditModel, AddGroup.class, DefaultGroup.class); |
| | | operatConditModelService.save(operatConditModel); |
| | | return Result.ok(); |
| | | } |
| | | |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelRbdNode; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * model_line |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | | */ |
| | | @Mapper |
| | | public interface ModelRbdNodeDao extends BaseDao<ModelRbdNode> { |
| | | |
| | | } |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelNodes; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelRbd; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | |
| | | |
| | | List<OperatConditModel> getList(Map<String, Object> params); |
| | | |
| | | List<ModelRbd> getModelList(Long productId); |
| | | |
| | | List<ModelNodes> getModelNodes(Long shipId); |
| | | |
| | | void deleteByOperatConditId(Long operatConditId); |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * model_rbd |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-10 |
| | | */ |
| | | @Data |
| | | public class ModelNodes extends BusiEntity { |
| | | @ApiModelProperty(value = "") |
| | | private Long modelId; |
| | | |
| | | private String nodeIds; |
| | | } |
| | |
| | | @ApiModelProperty(value = "") |
| | | private Long productId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "") |
| | | private Long[] nodeArr; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String content; |
| | | |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * model_rbd |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("model_rbd_node") |
| | | public class ModelRbdNode extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Long pid; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Long modelId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Long nodeId; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.constant.Constant; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import com.zt.common.entity.TreeNode; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @TableField(exist = false) |
| | | private List<OperatConditModel> children = new ArrayList<>(); |
| | | |
| | | @ApiModelProperty(value = "对应模型列表") |
| | | @TableField(exist = false) |
| | | private List<ModelRbd> modelList = new ArrayList<>(); |
| | | |
| | | private Integer isDisabled; |
| | | |
| | | @TableField(exist = false) |
| | | private Long pid; |
| | | |
| | |
| | | modelRbdDao.insert(modelRbd); |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(ModelRbd modelRbd) { |
| | | if (modelRbd==null) return; |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.service; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.JsonUtils2; |
| | | import com.zt.common.utils.UUIDUtil; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.ParamDataDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.XhProductModelDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamData; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ProductImg; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel; |
| | | import com.zt.life.modules.mainPart.taskReliability.dao.*; |
| | | import com.zt.life.modules.mainPart.taskReliability.dto.ModelLinePair; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.dom4j.Document; |
| | | import org.dom4j.DocumentHelper; |
| | | import org.dom4j.Element; |
| | | import org.dom4j.io.OutputFormat; |
| | | import org.dom4j.io.XMLWriter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.StringWriter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * model_line |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | | */ |
| | | @Service |
| | | public class ModelRbdNodeService extends BaseService<ModelRbdNodeDao, ModelRbdNode> { |
| | | public void saveNodeArr(ModelRbd modelRbd) { |
| | | // |
| | | ModelRbdNode node = new ModelRbdNode(); |
| | | node.setProductId(modelRbd.getProductId()); |
| | | node.setModelId(modelRbd.getId()); |
| | | Long[] nodeArr = modelRbd.getNodeArr(); |
| | | for(Long nodeId :nodeArr){ |
| | | node.setId(UUIDUtil.generateId()); |
| | | node.setNodeId(nodeId); |
| | | baseDao.insert(node); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.TreeUtils; |
| | | import com.zt.life.modules.mainPart.taskReliability.dao.OperatConditModelDao; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelNodes; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.ModelRbd; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * operat_condit_model |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Service |
| | | public class OperatConditModelService extends BaseService<OperatConditModelDao, OperatConditModel> { |
| | | public class OperatConditModelService extends BaseService<OperatConditModelDao, OperatConditModel> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | */ |
| | | public List<OperatConditModel> page(QueryFilter queryFilter) { |
| | | List<OperatConditModel> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | for (OperatConditModel conditModel : list) { |
| | | List<ModelRbd> modelList = baseDao.getModelList(conditModel.getId()); |
| | | conditModel.setModelList(modelList); |
| | | } |
| | | return TreeUtils.build(list); |
| | | } |
| | | |
| | | |
| | | public Map getModelNodes(Long shipId) { |
| | | List<ModelNodes> list = baseDao.getModelNodes(shipId); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (ModelNodes node : list) { |
| | | map.put(node.getModelId().toString(), node.getNodeIds()); |
| | | } |
| | | //String json= JSON.toJSONString(map); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | public void save(OperatConditModel parent) { |
| | | Long operatConditId = parent.getOperatConditId(); |
| | | baseDao.deleteByOperatConditId(operatConditId); |
| | | this.saveIteration(parent); |
| | | } |
| | | public void saveIteration(OperatConditModel parent) { |
| | | baseDao.insert(parent); |
| | | for (OperatConditModel sub : parent.getChildren()) { |
| | | this.saveIteration(sub); |
| | | } |
| | | } |
| | | } |
| | |
| | | <if test="pid==null"> |
| | | and pid is null |
| | | </if> |
| | | and product_type =${productType} |
| | | and product_type =${productType} |
| | | </where> |
| | | Group by product_type |
| | | </select> |
| | |
| | | AND ((a.PID = ${productId}) |
| | | or (a.PID in (select pid from product_model where id = ${productId} and product_type = 10) and |
| | | a.product_type <> 10)) |
| | | and a.id not in ( |
| | | select node_id |
| | | from model_rbd_node |
| | | where product_id in ( |
| | | select pid |
| | | from product_model |
| | | where id = ${productId} |
| | | and is_delete = 0 |
| | | union |
| | | select id |
| | | from product_model |
| | | where is_delete = 0 |
| | | and pid = ${parentId} |
| | | and id <> ${productId} |
| | | ) |
| | | union |
| | | select node_id |
| | | from model_rbd_node |
| | | where product_id in ( |
| | | select id |
| | | from product_model |
| | | where is_delete = 0 and pid = ${productId} |
| | | ) |
| | | ) |
| | | |
| | | |
| | | |
| | | </select> |
| | | <select id="getTaskProductList" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel"> |
| | |
| | | <update id="updateByDefault"> |
| | | update sys_picture_base |
| | | set is_default=2 |
| | | where id != ${id} |
| | | where id <> ${id} |
| | | and product_type = ${productType} |
| | | and is_delete = 0 |
| | | </update> |
| | |
| | | and ${whereSql} |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | ORDER BY is_default,product_type,id |
| | | </select> |
| | | <select id="getDefaultImg" resultType="com.zt.life.modules.mainPart.sysPictureBase.model.SysPictureBase"> |
| | | select a.name, a.id |
| | |
| | | from model_rbd a |
| | | left join (select model_id,1 as end from algorithm where model_type = 'end' and is_delete=0 ) b on b.model_id = |
| | | a.id |
| | | left join (select model_id, count(1) as num from algorithm where is_delete=0 group by model_id ) c on c.model_id |
| | | left join (select id, count(1) as num from model_rbd where is_delete=0 group by id ) c on c.id |
| | | = a.id |
| | | left join (select model_id,count(1) as num from operat_condit_model where is_delete=0 group by model_id ) d on |
| | | d.model_id = a.id |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.OperatConditModelDao"> |
| | | <delete id="deleteByOperatConditId"> |
| | | delete |
| | | from operat_condit_model |
| | | where operat_condit_id = ${operatConditId} |
| | | </delete> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel"> |
| | | SELECT a.id , |
| | | a.pid , |
| | | a.`NAME` as product, |
| | | SELECT a.id, |
| | | a.pid, |
| | | a.`NAME` as product, |
| | | c.model_name, |
| | | a.id as product_id, |
| | | b.model_id, |
| | | b.id as operatConditModelId |
| | | case when b.is_disabled is null or b.is_disabled = 1 then 1 else 0 end as is_disabled, |
| | | ${operatConditId} as operatConditId |
| | | FROM product_model a |
| | | LEFT JOIN operat_condit_model b |
| | | ON b.product_id = a.id |
| | |
| | | and a.product_type in (4, 3, 2, 10) |
| | | AND a.is_delete = 0 |
| | | </select> |
| | | <select id="getModelList" resultType="com.zt.life.modules.mainPart.taskReliability.model.ModelRbd"> |
| | | select * |
| | | from model_rbd |
| | | where product_id = ${productId} |
| | | and is_delete = 0 |
| | | </select> |
| | | <select id="getModelNodes" resultType="com.zt.life.modules.mainPart.taskReliability.model.ModelNodes"> |
| | | SELECT model_id, GROUP_CONCAT(node_id) as nodeIds |
| | | FROM `model_rbd_node` |
| | | group by model_id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <template> |
| | | <el-tag :color="tagColor" v-if="$store.getters.getDictLabel(dict, value)!=null" :type="tagType" :size="size" :effect="effect" :hit="hit">{{$store.getters.getDictLabel(dict, value)}} |
| | | <el-tag :color="tagColor" :type="tagType" :size="size" :effect="effect" :hit="hit">{{dictLabel}} |
| | | </el-tag> |
| | | </template> |
| | | <script> |
| | |
| | | dict: { // 字典类型 |
| | | type: String, |
| | | required: true |
| | | }, |
| | | additional: {// 添加的 |
| | | type: Array, |
| | | default: function () { |
| | | return [] |
| | | } |
| | | }, |
| | | value: [String, Number, Boolean], |
| | | typeS: String, |
| | |
| | | return { |
| | | tagType: 'primary', |
| | | tagColor: '', |
| | | colorArr:['primary','success','info','warning','danger'] |
| | | colorArr: ['primary', 'success', 'info', 'warning', 'danger'] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.init() |
| | | }, |
| | | computed: { |
| | | dictLabel() { |
| | | let result = this.$store.getters.getDictLabel(this.dict, this.value) |
| | | if ("" + result == "" + this.value) { |
| | | for (let item of this.additional) { |
| | | if (item.dictValue == "" + this.value) { |
| | | result = item.dictLabel |
| | | } |
| | | } |
| | | } |
| | | return result |
| | | } |
| | | }, |
| | | methods: { |
| | | async init() { |
| | |
| | | if (!this.typeS && !this.typeI && !this.typeW && !this.typeD && !this.typeColor) { // 没有指定颜色 |
| | | if (this.value === false || this.value === 0 || this.value === '0' || this.value === 'false') { |
| | | this.tagType = 'primary' |
| | | }else{ |
| | | this.tagType = this.colorArr[this.value%5] |
| | | } else { |
| | | this.tagType = this.colorArr[this.value % 5] |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div> |
| | | <el-select :value="dictValue" @change="changeProjectMajor" @input="$emit('input', $event)" :placeholder="placeholder" clearable style="width: 100%;" v-if="showType === 'select'" :disabled="disabled"> |
| | | <el-select v-if="showType === 'select'" :value="dictValue" @change="changeProjectMajor" @input="$emit('input', $event)" :placeholder="placeholder" clearable style="width: 100%;" :disabled="disabled"> |
| | | <el-option :label="data.dictLabel" v-for="data in dicts" :key="data.dictValue" :value ="data.dictValue">{{data.dictLabel}}</el-option> |
| | | </el-select> |
| | | <div v-if="showType === 'radio'"> |
| | |
| | | <el-input class="radio-input" v-if="isOtherOptionSelected" v-model="inputName"></el-input> |
| | | </el-radio-group> |
| | | </div> |
| | | <zt-combo-tree v-model="dictValue" :datas="dictTrees" :disabled-filter="disabledFilter" @input="$emit('input', $event)" v-if="showType === 'tree'" :placeholder="placeholder"/> |
| | | <zt-combo-tree v-if="showType === 'tree'" v-model="dictValue" :datas="dictTrees" :disabled-filter="disabledFilter" @input="$emit('input', $event)" :placeholder="placeholder"/> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | required: true |
| | | }, |
| | | excluded: {// 排除的 |
| | | type: Array, |
| | | default: function () { |
| | | return [] |
| | | } |
| | | }, |
| | | additional: {// 添加的 |
| | | type: Array, |
| | | default: function () { |
| | | return [] |
| | |
| | | if (this.excluded.length > 0) { |
| | | let excludedArray = [] |
| | | this.excluded.forEach(value => excludedArray.push(value + '')) |
| | | return dicts.filter(option => excludedArray.indexOf(option.dictValue + '') < 0) |
| | | } else { |
| | | return dicts |
| | | dicts = dicts.filter(option => excludedArray.indexOf(option.dictValue + '') < 0) |
| | | } |
| | | return dicts.concat(this.additional); |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | <template> |
| | | <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"/> |
| | | <zt-dict-tag :dict="dict" :additional=additional :value="row[prop]" :typeS="typeS" :typeI="typeI" :typeW="typeW" :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </el-table-column> |
| | | </template> |
| | | <script> |
| | |
| | | keys:{ |
| | | type:String |
| | | }, |
| | | additional: {// 添加的 |
| | | type: Array, |
| | | default: function () { |
| | | return [] |
| | | } |
| | | }, |
| | | label: String, |
| | | width: { |
| | | type: String, |
| | |
| | | <el-input v-model="dataForm.name"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="产品类型" prop="productType" rules="required"> |
| | | <zt-dict v-model="dataForm.productType" dict="product"></zt-dict> |
| | | <zt-dict v-model="dataForm.productType" dict="product" :additional=additional></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item label="是否默认" prop="isDefault" rules="required"> |
| | | <zt-dict v-model="dataForm.isDefault" dict="is_or_not"></zt-dict> |
| | |
| | | <el-input v-model="dataForm.contentType"></el-input> |
| | | </zt-form-item> |
| | | <input type="hidden" id="svgContentId" :value="dataForm.svgContent"/> |
| | | <zt-form-item> |
| | | <!-- <el-upload action="*" :on-change="uploadSvgContent">--> |
| | | <!-- <el-button slot="trigger" size="small" type="primary">选取文件</el-button>--> |
| | | <!-- </el-upload>--> |
| | | <label class="custom-file-upload"> |
| | | <input type="file" @change="uploadSvgContent" /> |
| | | </label> |
| | | </zt-form-item> |
| | | <zt-form-item> |
| | | <!-- <el-upload action="*" :on-change="uploadSvgContent">--> |
| | | <!-- <el-button slot="trigger" size="small" type="primary">选取文件</el-button>--> |
| | | <!-- </el-upload>--> |
| | | <label class="custom-file-upload"> |
| | | <input type="file" @change="uploadSvgContent"/> |
| | | </label> |
| | | </zt-form-item> |
| | | </el-form> |
| | | <iframe :src='SVGEditorUrl' ref="myIframe" width="100%" id="iframe" |
| | | style="height:calc(100vh - 300px)"> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | additional: [{dictValue: '20', dictLabel: '运算图元', remark: ''}], |
| | | SVGEditorUrl: `/SVGOrigin/Method-Draw-master/editor/index.html`, |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`, |
| | | fileList: [], |
| | |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | console.log(this.dataForm,'this.dataForm this.dataForm') |
| | | console.log(this.dataForm, 'this.dataForm this.dataForm') |
| | | } |
| | | }, |
| | | httpRequest(option) { |
| | |
| | | async formSubmit() { |
| | | const iframeWindow = this.$refs.myIframe.contentWindow; |
| | | this.dataForm.svgContent = iframeWindow.getSVGContentTest() |
| | | console.log(this.dataForm.svgContent+'this.dataForm.svgContent') |
| | | console.log(this.dataForm.svgContent + 'this.dataForm.svgContent') |
| | | this.$http.post('/sysPictureBase/save', this.dataForm).then(res => { |
| | | if (res.success) { |
| | | console.log(this.dataForm,'this.dataForm') |
| | | console.log(this.dataForm, 'this.dataForm') |
| | | this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | |
| | | async uploadSvgContent(event) { |
| | | const iframeWindow = this.$refs.myIframe.contentWindow |
| | | const file = event.target.files[0]; |
| | | console.log(file,'file file') |
| | | console.log(file, 'file file') |
| | | // 可以在这里进行进一步的文件处理,比如读取文件内容等操作 |
| | | if (file && file.type==='image/svg+xml') { |
| | | if (file && file.type === 'image/svg+xml') { |
| | | const reader = new FileReader(); |
| | | reader.onload = (e) => { |
| | | const fileContent = e.target.result; |
| | |
| | | iframeWindow.setSvgContent(fileContent) |
| | | } |
| | | reader.readAsText(file); // 以文本形式读取文件内容 |
| | | }else { |
| | | } else { |
| | | this.$message({message: '请选择SVG图片', type: 'warning'}) |
| | | return false; // 取消操作 |
| | | } |
| | |
| | | cursor: pointer; |
| | | background-color: #f9f9f9; |
| | | } |
| | | |
| | | .img-sc > .el-form-item > .el-form-item__content { |
| | | width: 100%; |
| | | } |
| | |
| | | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-dict v-model="dataForm.productType" dict="product" placeholder="请选择产品类型" clearable></zt-dict> |
| | | <zt-dict v-model="dataForm.productType" dict="product" :additional=additional placeholder="请选择产品类型" clearable></zt-dict> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-button type="query" @click="table.query()"/> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="contentType" label="检索关键字"/> |
| | | <zt-table-column-dict prop="productType" label="产品类型" dict="product"/> |
| | | <zt-table-column-dict prop="productType" label="产品类型" dict="product" :additional=additional /> |
| | | <zt-table-column-handle :table="table" |
| | | delete-perm="sysPictureBase::delete"/> |
| | | </el-table> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | additional: [{dictValue: '20', dictLabel: '运算图元', remark: ''}], |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`, |
| | | dataForm: { |
| | | contentType: '', |
File was renamed from web/src/views/modules/taskReliability/ConfigEdge/index.vue |
| | |
| | | <script> |
| | | import { Edge} from '@antv/x6'; |
| | | export default { |
| | | name: "index", |
| | | name: "configEdit", |
| | | data(){ |
| | | return{ |
| | | left_p:document.documentElement.clientHeight*0.9, |
New file |
| | |
| | | <template> |
| | | <div ref="" style="position: absolute;top:0;right:0;background:#cccccc;width: 400px;" |
| | | :style="'height:'+ left_p + 'px'"> |
| | | <el-card style="height: 100%"> |
| | | <el-tabs v-model="activeName" id="tabPane"> |
| | | <el-tab-pane label="属性" name="first"> |
| | | <el-form :model="globalGridAttr"> |
| | | <el-form-item v-show="shape!=='custom-circle1'" label="节点名称" prop="nodeText" label-width="80px"> |
| | | <el-input v-model="globalGridAttr.nodeText" style="width:100%" @change="onTextChange"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-show="nodeType=='vote' || (nodeType=='node' && showNumberInput)" label="表决数量" prop="voteNum" |
| | | label-width="80px"> |
| | | <el-input type="number" v-model="globalGridAttr.voteNum" @change="onNumberInputValue" |
| | | placeholder="请输入数字"></el-input> |
| | | </el-form-item> |
| | | <div v-show="globalGridAttr.productType!=='product_xdy'"> |
| | | <el-form-item v-show="nodeType=='node'" label="可靠性分布类型" prop="reliabDistribType" label-width="125px"> |
| | | <zt-dict style="width: 100%" v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" |
| | | dict="ReliabDistribType" placeholder="可靠性分布类型" clearable/> |
| | | </el-form-item> |
| | | <el-form-item v-show="nodeType=='node'" label="MTBCF" prop="taskMtbcf" label-width="80px"> |
| | | <el-input v-model="globalGridAttr.taskMtbcf" @change="onTaskMtbcfChange"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-show="nodeType=='node'" label="参数2" prop="taskMtbcfOther" label-width="80px"> |
| | | <el-input v-model="globalGridAttr.taskMtbcfOther" @change="onTaskMtbcfOtherChange"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-show="nodeType=='node'" label="是否可维修" prop="isRepair" label-width="100px"> |
| | | <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange"> |
| | | <el-option |
| | | v-for="item in isRepair" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <div v-show="nodeType=='node' && showRepairInput"> |
| | | <el-form-item label="可维修性分布类型" prop="repairDistribType" label-width="140px"> |
| | | <zt-dict v-model="globalGridAttr.repairDistribType" dict="RepairDistribType" |
| | | @input="onRepairDistribTypeChange" placeholder="维修性分布类型" clearable/> |
| | | </el-form-item> |
| | | <el-form-item label="MTTCR" prop="repairMttcr" label-width="80px"> |
| | | <el-input v-model="globalGridAttr.repairMttcr" @change="onRepairMttcrChange"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="参数2" prop="repairMttcrOther" label-width="80px"> |
| | | <el-input v-model="globalGridAttr.repairMttcrOther" @change="onRepairMttcrOtherChange"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="样式" name="second"> |
| | | <el-row :gutter="5" align="middle" style="margin-top:20px"> |
| | | <el-col :span=8 style="font-size: 16px;line-height: 38px">文本大小</el-col> |
| | | <el-col :span=16> |
| | | <el-slider :min=8 :max=20 :step=1 v-model="globalGridAttr.nodeFontSize" |
| | | @change="onFontSizeChange"></el-slider> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="5" align="middle" style="margin-top:20px"> |
| | | <el-col :span=8 style="font-size: 16px;line-height: 40px">字体颜色</el-col> |
| | | <el-col :span=16> |
| | | <el-color-picker v-model="globalGridAttr.nodeColor" style="width: 100%" |
| | | @change="onColorChange"></el-color-picker> |
| | | </el-col> |
| | | </el-row> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-card> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "configNode", |
| | | data() { |
| | | return { |
| | | globalGridAttr: { |
| | | nodeText: '', |
| | | nodeStroke: '', |
| | | nodeStrokeWidth: '', |
| | | nodeFill: '', |
| | | nodeFontSize: '', |
| | | nodeColor: '', |
| | | nodeUsers: '', |
| | | nodeDate: '', |
| | | dataId: '', |
| | | inspectName: '', |
| | | nodeTypeExt: '', |
| | | statusImg: '', |
| | | reliabDistribType: '', |
| | | repairDistribType: '', |
| | | repairMttcr: '', |
| | | repairMttcrOther: '', |
| | | taskMtbcf: '', |
| | | taskMtbcfOther: '', |
| | | isRepair: '', |
| | | voteNum: 0, |
| | | productType: '' |
| | | }, |
| | | data: { |
| | | dataId: '', |
| | | finishDate: '', |
| | | inspectName: '' |
| | | }, |
| | | showNumberInput: false, |
| | | showRepairInput: false, |
| | | isRepair: [ |
| | | { |
| | | value: 0, |
| | | label: '否' |
| | | }, { |
| | | value: 1, |
| | | label: '是' |
| | | } |
| | | ], |
| | | text: '', |
| | | dialogVisible: false, |
| | | activeName: 'first', |
| | | curCel: null, |
| | | left_p: document.documentElement.clientHeight * 0.75, |
| | | } |
| | | }, |
| | | components: {}, |
| | | props: { |
| | | }, |
| | | watch: { |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | // 改变字体大小 |
| | | onFontSizeChange(e) { |
| | | let val = e |
| | | this.globalGridAttr.nodeFontSize = val |
| | | this.curCel.attr('text/fontSize', val) |
| | | this.curCel.attr('title/fontSize', val) |
| | | }, |
| | | // 改变字体颜色 |
| | | onColorChange(e) { |
| | | let val = e |
| | | this.globalGridAttr.nodeColor = val |
| | | this.curCel.attr('text/fill', val) |
| | | this.curCel.attr('title/fill', val) |
| | | this.curCel.attr('text/style/color', val) |
| | | this.curCel.attr('title/style/color', val) |
| | | }, |
| | | // 改变文本 |
| | | onTextChange(e) { |
| | | this.text = e |
| | | this.curCel.attr('text/text', this.text) |
| | | }, |
| | | onNodeTypeExtChange(e) { |
| | | if (this.globalGridAttr.nodeTypeExt === 'vote') { |
| | | this.showNumberInput = true; |
| | | } else { |
| | | this.showNumberInput = false; |
| | | this.globalGridAttr.numberInputValue = ''; |
| | | } |
| | | this.globalGridAttr.nodeTypeExt = e |
| | | let nodeTypeExt = { |
| | | nodeTypeExt: this.globalGridAttr.nodeTypeExt |
| | | } |
| | | this.curCel.setData(nodeTypeExt) |
| | | }, |
| | | // 表决数量 |
| | | onNumberInputValue(e) { |
| | | this.globalGridAttr.voteNum = e |
| | | let voteNum = { |
| | | voteNum: this.globalGridAttr.voteNum |
| | | } |
| | | this.curCel.setData(voteNum) |
| | | }, |
| | | // 可靠性分布类型 |
| | | onReliabDistribType(e) { |
| | | this.globalGridAttr.reliabDistribType = e |
| | | let reliabDistribType = { |
| | | reliabDistribType: this.globalGridAttr.reliabDistribType |
| | | } |
| | | this.curCel.setData(reliabDistribType) |
| | | }, |
| | | // mtbf |
| | | onTaskMtbcfChange(e) { |
| | | const numberRegex = /^-?\d+(\.\d+)?$/ |
| | | if (numberRegex.test(e)) { |
| | | this.globalGridAttr.taskMtbcf = e |
| | | let taskMtbcf = { |
| | | taskMtbcf: this.globalGridAttr.taskMtbcf |
| | | } |
| | | this.curCel.setData(taskMtbcf) |
| | | } else { |
| | | this.$message.error('输入格式有误,请输入实数') |
| | | } |
| | | }, |
| | | // 参数2 |
| | | onTaskMtbcfOtherChange(e) { |
| | | const numberRegex = /^-?\d+(\.\d+)?$/ |
| | | console.log(e, 'eeeee') |
| | | if (numberRegex.test(e)) { |
| | | this.globalGridAttr.taskMtbcfOther = e |
| | | let taskMtbcfOther = { |
| | | taskMtbcfOther: this.globalGridAttr.taskMtbcfOther |
| | | } |
| | | this.curCel.setData(taskMtbcfOther) |
| | | } else { |
| | | this.$message.error('输入格式有误,请输入实数') |
| | | } |
| | | |
| | | }, |
| | | // 是否可维修 |
| | | onIsRepairChange(e) { |
| | | this.showRepairInput = this.globalGridAttr.isRepair === 1; |
| | | this.globalGridAttr.isRepair = e |
| | | let isRepair = { |
| | | isRepair: this.globalGridAttr.isRepair |
| | | } |
| | | this.curCel.setData(isRepair) |
| | | }, |
| | | // 可维修性分布类型 |
| | | onRepairDistribTypeChange(e) { |
| | | this.globalGridAttr.repairDistribType = e |
| | | let repairDistribType = { |
| | | repairDistribType: this.globalGridAttr.repairDistribType |
| | | } |
| | | this.curCel.setData(repairDistribType) |
| | | }, |
| | | // Mttcr |
| | | onRepairMttcrChange(e) { |
| | | const numberRegex = /^-?\d+(\.\d+)?$/ |
| | | if (numberRegex.test(e)) { |
| | | this.globalGridAttr.repairMttcr = e |
| | | let repairMttcr = { |
| | | repairMttcr: this.globalGridAttr.repairMttcr |
| | | } |
| | | this.curCel.setData(repairMttcr) |
| | | } else { |
| | | this.$message.error('输入格式有误,请输入实数') |
| | | } |
| | | |
| | | }, |
| | | // 可维修性分布类型 参数2 |
| | | onRepairMttcrOtherChange(e) { |
| | | const numberRegex = /^-?\d+(\.\d+)?$/ |
| | | if (numberRegex.test(e)) { |
| | | this.globalGridAttr.repairMttcrOther = e |
| | | let repairMttcrOther = { |
| | | repairMttcrOther: this.globalGridAttr.repairMttcrOther |
| | | } |
| | | this.curCel.setData(repairMttcrOther) |
| | | } else { |
| | | this.$message.error('输入格式有误,请输入实数') |
| | | } |
| | | }, |
| | | onStatusImgChange(e) { |
| | | this.globalGridAttr.statusImg = e |
| | | let statusImg = { |
| | | statusImg: this.globalGridAttr.statusImg |
| | | } |
| | | this.curCel.setData(statusImg) |
| | | console.log(this.globalGridAttr.statusImg, 'this.globalGridAttr.statusImg') |
| | | console.log(this.curCel, 'this.curCel') |
| | | console.log(this.curCel.attr, 'this.curCel.attr') |
| | | this.curCel.removeTools() |
| | | this.curCel.addTools([ |
| | | { |
| | | name: 'button', |
| | | args: { |
| | | markup: [ |
| | | { |
| | | tagName: 'image', |
| | | selector: 'icon', |
| | | attrs: { |
| | | // 'xlink:href': 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*evDjT5vjkX0AAAAAAAAAAAAAARQnAQ', |
| | | 'xlink:href': statusImg.statusImg, |
| | | width: 30, |
| | | height: 30, |
| | | x: 0, |
| | | y: 0 |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | ]) |
| | | }, |
| | | loadData(cell) { |
| | | this.curCel = cell |
| | | if (cell.id) { |
| | | this.nodeType = cell.getData().nodeType |
| | | this.showNumberInput = false |
| | | this.globalGridAttr.nodeStroke = cell.attr('body/stroke') |
| | | this.globalGridAttr.nodeStrokeWidth = cell.attr('body/strokeWidth') |
| | | this.globalGridAttr.nodeFill = cell.attr('body/fill') |
| | | // globalGridAttr.nodeFontSize = cell.attr('text/fontSize') |
| | | // globalGridAttr.nodeFontSize = cell.attr('title/fontSize') |
| | | this.globalGridAttr.nodeFontSize = cell.attr('text/fontSize') ? cell.attr('text/fontSize') : cell.attr('title/fontSize') |
| | | this.globalGridAttr.nodeColor = cell.attr('text/fill') ? cell.attr('text/fill') : cell.attr('title/fill') ? cell.attr('title/fill') : cell.attr('label/text/fill') |
| | | // globalGridAttr.nodeColor = cell.attr('text/fill') |
| | | // globalGridAttr.nodeColor = cell.attr('title/fill') |
| | | // globalGridAttr.nodeColor = cell.attr('text/style/color') |
| | | // globalGridAttr.nodeColor = cell.attr('title/style/color') |
| | | this.globalGridAttr.nodeUsers = cell.attr('approve/users') |
| | | this.globalGridAttr.nodeText = cell.attr('text/text') |
| | | this.globalGridAttr.nodeDate = cell.attr('title/text') |
| | | this.globalGridAttr.dataId = cell.getData().dataId |
| | | this.globalGridAttr.inspectName = cell.getData().inspectName |
| | | this.globalGridAttr.nodeTypeExt = cell.getData().nodeTypeExt |
| | | this.globalGridAttr.statusImg = cell.getData().statusImg |
| | | this.globalGridAttr.reliabDistribType = cell.getData().reliabDistribType |
| | | this.globalGridAttr.repairDistribType = cell.getData().repairDistribType |
| | | this.globalGridAttr.repairMttcr = cell.getData().repairMttcr |
| | | this.globalGridAttr.repairMttcrOther = cell.getData().repairMttcrOther |
| | | this.globalGridAttr.taskMtbcf = cell.getData().taskMtbcf |
| | | this.globalGridAttr.taskMtbcfOther = cell.getData().taskMtbcfOther |
| | | this.globalGridAttr.isRepair = cell.getData().isRepair |
| | | this.globalGridAttr.voteNum = cell.getData().voteNum |
| | | this.globalGridAttr.productType = cell.getData().productType |
| | | if (this.nodeType === 'vote' || this.globalGridAttr.nodeTypeExt === 'vote' || (cell.getData().voteNum !== undefined && cell.getData().voteNum !== '')) { |
| | | console.log(cell.getData().voteNum, 'cell.getData().voteNum') |
| | | this.showNumberInput = true |
| | | } |
| | | this.showRepairInput = cell.getData().isRepair |
| | | cell.removeTools() |
| | | cell.addTools([ |
| | | { |
| | | name: 'button', |
| | | args: { |
| | | markup: [ |
| | | { |
| | | tagName: 'image', |
| | | selector: 'icon', |
| | | attrs: { |
| | | // 'xlink:href': 'https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*evDjT5vjkX0AAAAAAAAAAAAAARQnAQ', |
| | | 'xlink:href': this.globalGridAttr.statusImg, |
| | | width: 30, |
| | | height: 30, |
| | | x: 0, |
| | | y: 0 |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | ]) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | #tabPane .el-tabs__header.is-top .el-tabs__nav-scroll { |
| | | width: 100% !important; |
| | | } |
| | | |
| | | #tabPane .el-color-picker__trigger { |
| | | width: 100%; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="mod-taskReliability-operatConditModel}"> |
| | | <zt-table-wraper ref="tableObj" :paging='false' defaultNotQuery="true" query-url="/taskReliability/OperatConditModel/page" delete-url="/taskReliability/OperatConditModel/" v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" |
| | | v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle" |
| | | row-key="id" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | :default-expand-all="true"> |
| | | <el-table-column prop="product" label="产品节点" width="160"/> |
| | | <el-table-column prop="modelName" label="产品模型"/> |
| | | <zt-table-column-handle :table="table" edit-perm="taskReliability:update" |
| | | delete-perm="taskReliability::delete" :has-view="false"> |
| | | <template v-slot="{ row }"> |
| | | <zt-table-button @click="openSelectModel(row)">选择模型</zt-table-button> |
| | | </template> |
| | | </zt-table-column-handle> |
| | | </el-table> |
| | | <select-model-rbd ref="SelectModelRbd" ></select-model-rbd> |
| | | </zt-table-wraper> |
| | | </div> |
| | | <div class="mod-taskReliability-operatConditModel}"> |
| | | <zt-table-wraper @dataLoaded="dataLoaded" ref="tableObj" :paging='false' defaultNotQuery="true" |
| | | query-url="/taskReliability/OperatConditModel/page" |
| | | delete-url="/taskReliability/OperatConditModel/" v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <el-button v-if="dataForm.productId" type="primary" @click="save()">保存</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" |
| | | v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle" |
| | | row-key="id" |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | :default-expand-all="true"> |
| | | <el-table-column prop="product" label="产品节点"/> |
| | | <el-table-column prop="modelId" label="产品模型"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.modelId" :disabled="scope.row.isDisabled == 1" placeholder="请选择" |
| | | style="width:100%" @change="modelChanged(scope.row)"> |
| | | <el-option on |
| | | v-for="item in scope.row.modelList" |
| | | :key="item.id" |
| | | :label="item.modelName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="100px"> |
| | | <template v-slot="{ row }"> |
| | | <el-button v-if="row.modelId" type="primary" size="small" @click="drawRBD(row)">查看模型</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-dialog v-dialogDrag title="模型设计" top="1vh" width='95%' :visible.sync="dialogVisible2" v-if="dialogVisible2"> |
| | | <RBDEditImg ref="rbdEditImg"></RBDEditImg> |
| | | </el-dialog> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import SelectModelRbd from "./SelectModelRbd"; |
| | | import RBDEditImg from './RBD-edit-img' |
| | | |
| | | export default { |
| | | name: 'OperaConditModel', |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | operatConditId:'', |
| | | productId:'', |
| | | } |
| | | operatConditId: '', |
| | | productId: '', |
| | | }, |
| | | mapModelNodes: {}, |
| | | dialogVisible2: false, |
| | | } |
| | | }, |
| | | components: { |
| | | SelectModelRbd |
| | | RBDEditImg |
| | | }, |
| | | methods:{ |
| | | mounted() { |
| | | this.getModelNodes() |
| | | }, |
| | | methods: { |
| | | init(param) { |
| | | console.log(param, '') |
| | | this.dataForm.operatConditId = param.row.id |
| | | this.dataForm.productId = param.productId |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | openSelectModel(row) { |
| | | console.log(row, 'selectModel'); |
| | | if (!row.operatConditId) |
| | | row.operatConditId = this.dataForm.operatConditId |
| | | this.$refs.SelectModelRbd.$refs.dialog.init(row) |
| | | dataLoaded(dataList) { |
| | | dataList[0].isDisabled = 0 |
| | | if (!dataList[0].modelId && dataList[0].modelList.length == 1) { |
| | | console.log(dataList[0].modelList[0].id, ' dataList[0].modelList[0].modelId') |
| | | dataList[0].modelId = dataList[0].modelList[0].id |
| | | console.log(dataList[0], 'dataLoaded(dataList)') |
| | | this.modelChanged(dataList[0]) |
| | | } |
| | | }, |
| | | async save() { |
| | | let res = await this.$http.post('/taskReliability/OperatConditModel/', this.$refs.tableObj.dataList[0]) |
| | | if (res.success) { |
| | | this.$refs.tableObj.query() |
| | | } |
| | | }, |
| | | async getModelNodes() { |
| | | let res = await this.$http.get(`/taskReliability/OperatConditModel/getModelNodes?shipId=0`) |
| | | console.log(res, 'res taskReliability') |
| | | console.log(res.data, 'res.data taskReliability') |
| | | if (res.data) { |
| | | this.mapModelNodes = res.data |
| | | |
| | | } |
| | | }, |
| | | modelChanged(row) { |
| | | let modelId = row.modelId |
| | | let modelNodes = this.mapModelNodes[modelId] |
| | | console.log(modelId, 'modelChanged modelId') |
| | | console.log(modelNodes, 'modelChanged modelNodes') |
| | | |
| | | for (let subRow of row.children) { |
| | | if (modelNodes.indexOf(subRow.productId)) { |
| | | subRow.isDisabled = 0 |
| | | if (subRow.modelList.length == 1) { |
| | | subRow.modelId = subRow.modelList[0].id |
| | | } else { |
| | | //subRow.modelId = null |
| | | } |
| | | } else { |
| | | subRow.isDisabled = 1 |
| | | subRow.modelId = null |
| | | } |
| | | this.nodeIteration(subRow) |
| | | } |
| | | }, |
| | | nodeIteration(parentRow) { |
| | | for (let subRow of parentRow.children) { |
| | | if (parentRow.modelId) { |
| | | subRow.isDisabled = 0 |
| | | if (subRow.modelList.length == 1) { |
| | | subRow.modelId = subRow.modelList[0].id |
| | | } |
| | | } else { |
| | | subRow.isDisabled = 1 |
| | | subRow.modelId = null |
| | | } |
| | | this.nodeIteration(subRow) |
| | | } |
| | | }, |
| | | drawRBD(row) { |
| | | this.dialogVisible2 = true |
| | | let param = { |
| | | id: row.modelId, |
| | | model: row.modelName, |
| | | productId: row.productId |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.rbdEditImg.init(param) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | <div id="containerImg" style="border: 1px solid #EAEBEE;border-radius: 6px; |
| | | box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);height: 100%"> |
| | | </div> |
| | | <config-node v-show="type === 'node'" :id="id" :diagramId="diagramId" :globalGridAttr="globalGridAttr" |
| | | :graph="graph" |
| | | :nodeType="nodeType" |
| | | :projectId="projectId" |
| | | :shape="shape"/> |
| | | <config-edge v-show="type === 'edge'" :id="id" :globalGridAttr="globalGridAttr" :graph="graph"/> |
| | | <config-node ref="configNode" v-show="type === 'node'"/> |
| | | <config-edge ref="configEdge" v-show="type === 'edge'"/> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | |
| | | <script> |
| | | import {Graph, Shape, Addon, Cell} from '@antv/x6' |
| | | import ConfigNode from './ConfigNode/index.vue' |
| | | import ConfigEdge from './ConfigEdge/index.vue' |
| | | import {removeCurrentTabHandle} from '@/commonJS/common' |
| | | import ConfigNode from './ConfigNode/configNode.vue' |
| | | import ConfigEdge from './ConfigEdge/configEdge.vue' |
| | | import {setHartBeat} from '@/commonJS/common'; |
| | | import Cookies from 'js-cookie' |
| | | import {getUUID} from '../../../../packages/utils' |
| | | import RBDDefault from './RBD-default.json' |
| | | // import RBDDefault from './RBD-default.json' |
| | | |
| | | export default { |
| | | name: 'RBD-edit-img', |
| | | /*props: { |
| | | |
| | | },*/ |
| | | props: { |
| | | projectId: { |
| | | type: String |
| | |
| | | ConfigNode, |
| | | ConfigEdge |
| | | }, |
| | | computed: { |
| | | RBDDefault() { |
| | | let url = `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=` |
| | | let result = ` |
| | | { |
| | | "cells": |
| | | [ |
| | | { |
| | | "position": { |
| | | "x": -600, |
| | | "y": 0 |
| | | }, |
| | | "size": { |
| | | "width": 60, |
| | | "height": 60 |
| | | }, |
| | | "attrs": { |
| | | "text": { |
| | | "refY": "100%", |
| | | "textVerticalAnchor": "top", |
| | | "text": "start", |
| | | "refY2": 4 |
| | | }, |
| | | "image": { |
| | | "xlink:href": "${url}10011" |
| | | } |
| | | }, |
| | | "visible": true, |
| | | "shape": "image", |
| | | "id": "10000", |
| | | "data": { |
| | | "type": "imageNodes", |
| | | "endNodeId": "20000", |
| | | "dataId": "", |
| | | "nodeType": "start", |
| | | "nodeTypeExt": "", |
| | | "voteNum": "" |
| | | }, |
| | | "ports": { |
| | | "groups": { |
| | | "top": { |
| | | "position": { |
| | | "name": "top" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "right": { |
| | | "position": { |
| | | "name": "right" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "bottom": { |
| | | "position": { |
| | | "name": "bottom" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "left": { |
| | | "position": { |
| | | "name": "left" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "items": [ |
| | | { |
| | | "id": "top1", |
| | | "group": "top" |
| | | }, |
| | | { |
| | | "id": "right1", |
| | | "group": "right" |
| | | }, |
| | | { |
| | | "id": "bottom1", |
| | | "group": "bottom" |
| | | }, |
| | | { |
| | | "id": "left1", |
| | | "group": "left" |
| | | } |
| | | ] |
| | | }, |
| | | "zIndex": 1 |
| | | }, |
| | | { |
| | | "position": { |
| | | "x": 0, |
| | | "y": 0 |
| | | }, |
| | | "size": { |
| | | "width": 100, |
| | | "height": 60 |
| | | }, |
| | | "attrs": { |
| | | "text": { |
| | | "refY": "100%", |
| | | "textVerticalAnchor": "top", |
| | | "text": "dashedBox", |
| | | "refY2": 4 |
| | | }, |
| | | "image": { |
| | | "xlink:href": "${url}10015" |
| | | } |
| | | }, |
| | | "visible": true, |
| | | "shape": "image", |
| | | "id": 15000, |
| | | "data": { |
| | | "type": "imageNodes", |
| | | "dataId": "", |
| | | "nodeType": "dashedBox", |
| | | "nodeTypeExt": "", |
| | | "voteNum": "" |
| | | }, |
| | | "ports": { |
| | | "groups": { |
| | | "top": { |
| | | "position": { |
| | | "name": "top" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "right": { |
| | | "position": { |
| | | "name": "right" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "bottom": { |
| | | "position": { |
| | | "name": "bottom" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "left": { |
| | | "position": { |
| | | "name": "left" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "items": [ |
| | | { |
| | | "id": "top1", |
| | | "group": "top" |
| | | }, |
| | | { |
| | | "id": "right1", |
| | | "group": "right" |
| | | }, |
| | | { |
| | | "id": "bottom1", |
| | | "group": "bottom" |
| | | }, |
| | | { |
| | | "id": "left1", |
| | | "group": "left" |
| | | } |
| | | ] |
| | | }, |
| | | "zIndex": 2 |
| | | }, |
| | | { |
| | | "position": { |
| | | "x": 600, |
| | | "y": 0 |
| | | }, |
| | | "size": { |
| | | "width": 60, |
| | | "height": 60 |
| | | }, |
| | | "attrs": { |
| | | "text": { |
| | | "refY": "100%", |
| | | "textVerticalAnchor": "top", |
| | | "text": "end", |
| | | "refY2": 4 |
| | | }, |
| | | "image": { |
| | | "xlink:href": "${url}10012" |
| | | } |
| | | }, |
| | | "visible": true, |
| | | "shape": "image", |
| | | "id": "20000", |
| | | "data": { |
| | | "type": "imageNodes", |
| | | "startNodeId": "10000", |
| | | "dataId": "", |
| | | "nodeType": "end", |
| | | "nodeTypeExt": "", |
| | | "voteNum": "" |
| | | }, |
| | | "ports": { |
| | | "groups": { |
| | | "top": { |
| | | "position": { |
| | | "name": "top" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "right": { |
| | | "position": { |
| | | "name": "right" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "bottom": { |
| | | "position": { |
| | | "name": "bottom" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "left": { |
| | | "position": { |
| | | "name": "left" |
| | | }, |
| | | "attrs": { |
| | | "circle": { |
| | | "r": 4, |
| | | "magnet": true, |
| | | "stroke": "#5F95FF", |
| | | "strokeWidth": 1, |
| | | "fill": "#fff", |
| | | "style": { |
| | | "visibility": "hidden" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "items": [ |
| | | { |
| | | "id": "top1", |
| | | "group": "top" |
| | | }, |
| | | { |
| | | "id": "right1", |
| | | "group": "right" |
| | | }, |
| | | { |
| | | "id": "bottom1", |
| | | "group": "bottom" |
| | | }, |
| | | { |
| | | "id": "left1", |
| | | "group": "left" |
| | | } |
| | | ] |
| | | }, |
| | | "zIndex": 3 |
| | | }, |
| | | { |
| | | "shape": "edge", |
| | | "id": "66c81c68-0827-4a3c-8343-e2c453d3e9e7", |
| | | "router": { |
| | | "name": "manhattan" |
| | | }, |
| | | "connector": { |
| | | "name": "rounded" |
| | | }, |
| | | "source": { |
| | | "cell": "10000", |
| | | "port": "right1" |
| | | }, |
| | | "target": { |
| | | "cell": 15000, |
| | | "port": "left1" |
| | | }, |
| | | "zIndex": 4 |
| | | }, |
| | | { |
| | | "shape": "edge", |
| | | "id": "a0f3cf90-6d37-4ee0-a254-90b4ec2b6a7f", |
| | | "router": { |
| | | "name": "manhattan" |
| | | }, |
| | | "connector": { |
| | | "name": "rounded" |
| | | }, |
| | | "source": { |
| | | "cell": 15000, |
| | | "port": "right1" |
| | | }, |
| | | "target": { |
| | | "cell": "20000", |
| | | "port": "left1" |
| | | }, |
| | | "zIndex": 5 |
| | | } |
| | | ] |
| | | } |
| | | ` |
| | | return JSON.parse(result) |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | isFirstLoad: true, |
| | |
| | | modelType: '', |
| | | timer: null, |
| | | imagesList: [ |
| | | // {imgPath: 'start', imgName: 'start', nodeType: 'start', imgWidth: 60, imgHeight: 60, imgId: '1', data: {}}, |
| | | // {imgPath: 'end', imgName: 'end', nodeType: 'end', imgWidth: 60, imgHeight: 60, imgId: '2', data: {}}, |
| | | // { |
| | | // imgPath: 'connect', |
| | | // imgName: 'connect', |
| | | // nodeType: 'connect', |
| | | // imgWidth: 30, |
| | | // imgHeight: 30, |
| | | // imgId: '3', |
| | | // data: {} |
| | | // }, |
| | | // { |
| | | // imgPath: 'connect', |
| | | // imgName: 'bridge', |
| | | // nodeType: 'bridge', |
| | | // imgWidth: 50, |
| | | // imgHeight: 50, |
| | | // imgId: '12', |
| | | // data: {} |
| | | // }, |
| | | { |
| | | imgPath: 'parallel', |
| | | imgName: 'parallel', |
| | |
| | | diagramIdDisabled: false, |
| | | dataForm: { |
| | | id: null, |
| | | pid: null, |
| | | model_tag: '', |
| | | model_name: '', |
| | | product_id: null, |
| | | content: null, |
| | | publishContent: null, |
| | | hasPublish: 0, |
| | | urlPref: '', |
| | | nodeArr: [] |
| | | }, |
| | | type: '', |
| | | id: '', |
| | |
| | | token: Cookies.get('token'), |
| | | } |
| | | let res = await this.$http.get(`/taskReliability/ModelLine/getDiagram`, {params: params}) |
| | | if (res.data !== null && (res.data.content != null)) { |
| | | this.dataForm = res.data |
| | | this.dataForm = res.data |
| | | if (res.data.content != null) { |
| | | console.log(this.dataForm, 'getDiagram datafrom') |
| | | console.log(res.data, 'getDiagram res.data') |
| | | this.diagramJson = JSON.parse(this.dataForm.content) |
| | | this.graph.fromJSON(this.diagramJson) |
| | | this.isFirstLoad = false; |
| | |
| | | // this.graph.centerContent() |
| | | // this.graph.zoomToFit() |
| | | } else { |
| | | this.graph.fromJSON(RBDDefault) |
| | | this.graph.fromJSON(this.RBDDefault) |
| | | this.isFirstLoad = false |
| | | } |
| | | }, |
| | | async clearDiagram() { |
| | | this.dataForm.id = null |
| | | // this.graph.fromJSON(this.emptyJson) |
| | | this.graph.fromJSON(RBDDefault) |
| | | console.log(this.RBDDefault, 'clearDiagram') |
| | | this.graph.fromJSON(this.RBDDefault) |
| | | this.graph.positionContent('left') |
| | | this.isFirstLoad = false; |
| | | // this.graph.centerContent() |
| | |
| | | } |
| | | }, |
| | | }, |
| | | // panning: { |
| | | // enabled: true, |
| | | // }, |
| | | scroller: { |
| | | enabled: true, |
| | | pageVisible: true, |
| | |
| | | connecting: { |
| | | router: { |
| | | name: 'manhattan', |
| | | // args: { |
| | | // padding: 1, |
| | | // }, |
| | | }, |
| | | connector: { |
| | | name: 'rounded', |
| | |
| | | } |
| | | let res = await this.$http.get(`/basicInfo/XhProductModel/getProduct`, {params: params}) |
| | | this.imagesList2 = res.data |
| | | console.log(this.imagesList2, 'getProduct(productId)234567890') |
| | | let urlObject = window.URL || window.webkitURL || window; |
| | | /*for(let i =0;i<this.imagesList2.length;i++){ |
| | | |
| | | }*/ |
| | | console.log(this.imagesList2, 'getProduct(productId)234567890') |
| | | const imageNodes2 = this.imagesList2.map((item) => |
| | | this.graph.createNode({ |
| | | shape: 'image', |
| | |
| | | id: item.dataId, // 手动设置节点的 ID |
| | | data: { |
| | | type: 'imageNodes2', |
| | | isRepair: item.isRepair, |
| | | dataId: item.dataId, |
| | | nodeType: item.nodeType, |
| | | nodeTypeExt: item.nodeTypeExt, |
| | | productType: item.productType, |
| | | statusImg: item.statusImg, |
| | | reliabDistribType: item.reliabDistribType, |
| | | repairDistribType: item.repairDistribType, |
| | | repairMttcr: item.repairMttcr, |
| | | repairMttcrOther: item.repairMttcrOther, |
| | | |
| | | reliabDistribType: item.reliabDistribType ? item.reliabDistribType : 1, |
| | | taskMtbcf: item.taskMtbcf, |
| | | taskMtbcfOther: item.taskMtbcfOther, |
| | | |
| | | isRepair: item.isRepair, |
| | | repairDistribType: item.repairDistribType ? item.repairDistribType : 1, |
| | | repairMttcr: item.repairMttcr, |
| | | repairMttcrOther: item.repairMttcrOther, |
| | | |
| | | imgHeight: item.imgHeight, |
| | | imgWidth: item.imgWidth, |
| | | voteNum: '', |
| | |
| | | } |
| | | } |
| | | node.remove() |
| | | |
| | | /*//如果节点与节点相交 |
| | | console.log(node.position().x, node.position().x, 'node.position().x') |
| | | if (nodeType === 'bridgeConnection') { |
| | | this.getBridgeConnection() |
| | | }*/ |
| | | }); |
| | | this.graph.on('cell:contextmenu', ({cell}) => { |
| | | // this.type.value = cell.isNode() ? "node" : "edge" |
| | | this.type = cell.isNode() ? 'node' : 'edge' |
| | | this.shape = cell.shape |
| | | this.id = cell.id |
| | | /* this.shape = cell.shape |
| | | this.id = cell.id*/ |
| | | if (this.type === 'node') { |
| | | this.nodeType = cell.getData().nodeType |
| | | // console.log(this.nodeType, cell.id, 'this.nodeType') |
| | | //this.nodeType = cell.getData().nodeType |
| | | this.$refs.configNode.loadData(cell) |
| | | } else { |
| | | this.$refs.configNode.loadData(cell) |
| | | } |
| | | // console.log(this.shape, 'this.shape') |
| | | // this.nodeOpt(this.id, this.globalGridAttr) |
| | | }) |
| | | //单击边节点 |
| | | this.graph.on('edge:click', ({edge}) => { |
| | |
| | | }, |
| | | async saveDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | const nodes = this.graph.getNodes() |
| | | let nodeArr2 = [] |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | for (const node of nodes) { |
| | | console.log(node, 'saveDiagram node') |
| | | if (node.getData().nodeType == 'node' && node.getData().productType != 'product_xdy' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | this.dataForm.content = JSON.stringify(this.graph.toJSON()) |
| | | this.dataForm.urlPref = window.SITE_CONFIG['apiURL'] |
| | | console.log(this.dataForm, 'dataFrom') |
| | |
| | | }, |
| | | async analyzeDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | const nodes = this.graph.getNodes() |
| | | let nodeArr2 = [] |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | for (const node of nodes) { |
| | | if (node.getData().nodeType === 'node' && node.getData().productType !== 'product_xdy' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | this.dataForm.content = JSON.stringify(this.graph.toJSON()) |
| | | this.dataForm.urlPref = window.SITE_CONFIG['apiURL'] |
| | | await this.$http['post'](`/taskReliability/ModelLine/analyze`, this.dataForm).then(async res => { |
| | |
| | | <zt-form-item label="总体任务" prop="task"> |
| | | <zt-select v-model="dataForm.task" :datas="taskList" @change="onTaskSelected"/> |
| | | </zt-form-item> |
| | | <zt-form-item label="任务时长" prop="simulatTime"> |
| | | <el-input type="number" :min="1" v-model="dataForm.simulatTime"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="数据类型" prop="dataType"> |
| | | <zt-dict v-model="dataForm.dataType" dict="dataType"></zt-dict> |
| | | </zt-form-item> |
| | |
| | | <template slot="append">分钟</template> |
| | | </el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="仿真时长" prop="simulatTime"> |
| | | <el-input type="number" :min="1" v-model="dataForm.simulatTime"> |
| | | <template slot="append">分钟</template> |
| | | </el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="仿真次数" prop="simulatFrequency"> |
| | | <el-input type="number" :min="1" v-model="dataForm.simulatFrequency"> |
| | | <template slot="append">次数</template> |
| | |
| | | </zt-form-item> |
| | | <zt-form-item> |
| | | <zt-button @click="analyze()">仿真分析</zt-button> |
| | | <zt-button>分析结果</zt-button> |
| | | <zt-button @click="getresult()">分析结果</zt-button> |
| | | </zt-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | <el-col :span="18"> |
| | | <div class="fa-card-a"> |
| | | <SimulatCurve ref="SimulatCurve"></SimulatCurve> |
| | | <SimulatData></SimulatData> |
| | | <SimulatData ref="SimulatData"></SimulatData> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | console.log(res.data) |
| | | this.taskList = res.data |
| | | }, |
| | | getresult(){ |
| | | this.$refs.SimulatData.init(); |
| | | }, |
| | | async analyze() { |
| | | let res = await this.$http.post('/taskReliability/SimulatAssess/analyze', this.dataForm) |
| | | /* let res = await this.$http.post('/taskReliability/SimulatAssess/analyze', this.dataForm) |
| | | if (res.success) { |
| | | console.log(res.data, 'analyze') |
| | | let stopPolling = false |
| | | if (!stopPolling) { |
| | | let timer = setInterval(async () => { |
| | | let res2 = await this.$http.get(`/taskReliability/SimulatAssess/${res.data}`) |
| | | console.log(res2.data, 'setInterval') |
| | | if (res2.data) { |
| | | if (res2.data.code === '0' || res2.data.errorMsg === '0') { |
| | | stopPolling = true |
| | | // 中止轮询 |
| | | clearInterval(timer) |
| | | alert('已获取') |
| | | this.$refs.SimulatCurve.initEcharts(res2.data.curveData); |
| | | alert('已获取')*/ |
| | | this.$refs.SimulatCurve.initEcharts(); |
| | | // 清除定时器 |
| | | } else { |
| | | /* } else { |
| | | stopPolling = true |
| | | // 中止轮询 |
| | | clearInterval(timer) |
| | |
| | | }, 400) |
| | | } |
| | | |
| | | } |
| | | }*/ |
| | | } |
| | | } |
| | | } |
| | |
| | | initEcharts(CurveData) { |
| | | console.log(eval(CurveData), 'initEcharts(CurveData)') |
| | | const option = { |
| | | title:{ |
| | | text:'仿真可靠度收敛曲线图', |
| | | textStyle: { // 主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"} |
| | | fontFamily: 'Arial', |
| | | fontSize: 20, |
| | | fontStyle: 'normal', |
| | | fontWeight: 'normal', |
| | | } |
| | | }, |
| | | xAxis: { |
| | | data: eval(CurveData)[0] |
| | | data: [10, 30, 50, 70, 90, 110, 130,150,170], |
| | | name:'仿真次数' |
| | | }, |
| | | yAxis: {}, |
| | | series: [ |
| | | { |
| | | data: eval(CurveData)[1], |
| | | data: [15, 85, 75, 25, 65,35,55,45,50], |
| | | type: 'line', |
| | | smooth: true |
| | | } |
| | |
| | | <template> |
| | | <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="" |
| | | :paging='false' |
| | | delete-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" |
| | | @selection-change="table.selectionChangeHandle" |
| | | height="100px" v-adaptive="{bottomOffset:30}"> |
| | | <el-table-column prop="name" label="名称" /> |
| | | <el-table-column prop="totalTime" label="总时间"/> |
| | | <el-table-column prop="faultNum" label="故障次数"/> |
| | | <el-table-column prop="repairTime" label="修理时间"/> |
| | | <el-table-column prop="availability" label="可用度"/> |
| | | <el-table-column prop="mtbcf" label="MTBCF"/> |
| | | <el-table-column prop="mttcr" label="MTTCR"/> |
| | | </el-table> |
| | | </zt-table-wraper> |
| | | <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="" |
| | | :paging='false' |
| | | delete-url="" v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="dataList" |
| | | @selection-change="table.selectionChangeHandle" |
| | | height="100px" v-adaptive="{bottomOffset:30}"> |
| | | <el-table-column prop="name" label="名称"/> |
| | | <el-table-column prop="totalTime" label="总时间(小时)" align="center"/> |
| | | <el-table-column prop="faultNum" label="故障次数" align="center"/> |
| | | <el-table-column prop="repairTime" label="修理时间(分钟)" align="center"/> |
| | | <el-table-column prop="availability" label="可用度(百分比)" align="center"/> |
| | | <el-table-column prop="mtbcf" label="MTBCF" align="center"/> |
| | | <el-table-column prop="mttcr" label="MTTCR" align="center"/> |
| | | </el-table> |
| | | </zt-table-wraper> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | productList: [], |
| | | dataForm: { |
| | | productId: '' |
| | | } |
| | | }, |
| | | dataList:[], |
| | | fzdataList: [ |
| | | { |
| | | name: '总体', |
| | | totalTime:'15000', |
| | | faultNum:'2', |
| | | repairTime:'20', |
| | | availability:'99.96', |
| | | mtbcf:'5000', |
| | | mttcr:'20' |
| | | },{ |
| | | name: ' 系统1', |
| | | totalTime:'15000', |
| | | faultNum:'0', |
| | | repairTime:'0', |
| | | availability:'100', |
| | | mtbcf:'15000', |
| | | mttcr:'0' |
| | | },{ |
| | | name: ' 设备1-1', |
| | | totalTime:'9000', |
| | | faultNum:'2', |
| | | repairTime:'30', |
| | | availability:'99.98', |
| | | mtbcf:'3000', |
| | | mttcr:'15' |
| | | },{ |
| | | name: ' 设备1-2', |
| | | totalTime:'15000', |
| | | faultNum:'4', |
| | | repairTime:'120', |
| | | availability:'98.79', |
| | | mtbcf:'5000', |
| | | mttcr:'30' |
| | | },{ |
| | | name: ' 设备1-3', |
| | | totalTime:'12000', |
| | | faultNum:'3', |
| | | repairTime:'100', |
| | | availability:'98.88', |
| | | mtbcf:'3000', |
| | | mttcr:'33' |
| | | }, |
| | | { |
| | | name: ' 系统2', |
| | | totalTime:'10000', |
| | | faultNum:'2', |
| | | repairTime:'30', |
| | | availability:'99.75', |
| | | mtbcf:'5000', |
| | | mttcr:'15' |
| | | },{ |
| | | name: ' 设备2-1', |
| | | totalTime:'7000', |
| | | faultNum:'5', |
| | | repairTime:'200', |
| | | availability:'88.84', |
| | | mtbcf:'1167', |
| | | mttcr:'40' |
| | | },{ |
| | | name: ' 设备2-2', |
| | | totalTime:'5000', |
| | | faultNum:'3', |
| | | repairTime:'60', |
| | | availability:'98.78', |
| | | mtbcf:'1250', |
| | | mttcr:'30' |
| | | },{ |
| | | name: ' 设备2-3', |
| | | totalTime:'10000', |
| | | faultNum:'1', |
| | | repairTime:'20', |
| | | availability:'99.97', |
| | | mtbcf:'5000', |
| | | mttcr:'20' |
| | | },] |
| | | } |
| | | }, |
| | | components: { |
| | | |
| | | }, |
| | | components: {}, |
| | | mounted() { |
| | | this.getTaskProductList() |
| | | }, |
| | | methods: { |
| | | init() { |
| | | |
| | | this.dataList =this.fzdataList |
| | | }, |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null,{productId: this.dataForm.productId}) |
| | | }, |
| | | selectTask(row){ |
| | | this.$emit('onTaskSelected',row) |
| | | }, |
| | | async getTaskProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | console.log(this.productList, ' async getTaskProductList()') |
| | | }, |
| | | onProductSelected(data){ |
| | | console.log(data, ' onProductSelected(data)') |
| | | this.dataForm.productId = data.id |
| | | this.$refs.tableObj.query() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <zt-form-item label="阶段时长比" prop="phaseDuration"> |
| | | <el-input v-model="dataForm.phaseDurationRate" @change="check"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="阶段时速" prop="phaseSpeed"> |
| | | <!-- <zt-form-item label="阶段时速" prop="phaseSpeed"> |
| | | <el-input v-model="dataForm.phaseSpeed"></el-input> |
| | | </zt-form-item> |
| | | </zt-form-item>--> |
| | | <!-- <zt-form-item label="阶段顺序" prop="phaseSort"> |
| | | <el-input v-model="dataForm.phaseSort"></el-input> |
| | | </zt-form-item>--> |
| | |
| | | <el-table-column type="selection" width="40" align="center"/> |
| | | <el-table-column prop="phaseName" label="阶段名称" align="center"/> |
| | | <el-table-column prop="phaseDurationRate" label="阶段时长比" align="right"/> |
| | | <el-table-column prop="phaseSpeed" label="阶段时速" align="right"/> |
| | | <!-- <el-table-column prop="phaseSpeed" label="阶段时速" align="right"/>--> |
| | | <!--<el-table-column prop="phaseSort" label="阶段顺序" align="center"/>--> |
| | | <el-table-column prop="operatConditDuration" label="工况时长分配" align="center"/> |
| | | <!--<el-table-column prop="operatConditDuration" label="工况时长分配" align="center"/>--> |
| | | <zt-table-column-handle :table="table" edit-perm="testReviewComment:update" |
| | | delete-perm="taskReliability::delete"> |
| | | <template v-slot="{row}"> |