xyc
2024-10-12 5cea5dff7f0d73c1b172252936b393fb390ab669
Merge remote-tracking branch 'origin/master'
19个文件已修改
2个文件已添加
410 ■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/dao/ParamDataBasicDao.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/service/ParamDataBasicService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/TimeDiagramDto.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/TimeDiagramStatusDto.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/model/TimeDiagram.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java 174 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/public/产品结构树导入模板.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/baseReliability/ParamDataBasic.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ParamData.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/ConfigNode/configNode.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/RBD-edit-img.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/SchemeCompar.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/SimulatCurve.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/TimeDiagram.vue 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/dao/ParamDataBasicDao.java
@@ -23,4 +23,6 @@
    void compute(Long shipId,Integer productType);
    void compute2(Long shipId);
    void compute1(Long shipId);
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/baseReliability/service/ParamDataBasicService.java
@@ -46,6 +46,7 @@
    }
    public void compute(Long shipId) {
        baseDao.compute1(shipId);
        baseDao.compute(shipId, 4);
        baseDao.compute(shipId, 3);
        baseDao.compute(shipId, 2);
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -120,6 +120,15 @@
        return result;
    }
    @GetMapping("exportData")
    @ApiOperation("导出产品模型")
    @LogOperation("导出产品模型")
    public Result exportDataExcel(Long shipId) {
        xhProductModelService.exportDataExcel(shipId);
        return null;
    }
    @PostMapping
    @ApiOperation("新增")
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java
@@ -42,4 +42,6 @@
    void deleteByPid(Long id);
    Long[] getByPid(Long id);
    void getProductByShip(Long shipId);
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -413,4 +413,8 @@
    public Long[] getByPid(Long id) {
        return baseDao.getByPid(id);
    }
    public void exportDataExcel(Long shipId) {
        baseDao.getProductByShip(shipId);
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/ModelLineController.java
@@ -127,6 +127,7 @@
        return result ? Result.ok() : Result.error("解析失败");
    }
    @PostMapping("layout")
    @ApiOperation("自动排版")
    @LogOperation("自动排版")
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
@@ -107,8 +107,8 @@
    }
    @GetMapping("getStatus")
    public Result<String> getTimeDiagram(Long productId, Long taskId, Long fzId) {
        String data = simulatAssessService.getTimeDiagram(productId, taskId, fzId);
    public Result<TimeDiagramDto> getTimeDiagram(Long productId, Long taskId, Long fzId, double smallWidth,double minPointNum) {
        TimeDiagramDto data = simulatAssessService.getTimeDiagram(productId, taskId, fzId, smallWidth,minPointNum);
        return Result.ok(data);
    }
@@ -160,6 +160,8 @@
    }
    @PutMapping
    @ApiOperation("修改")
    @LogOperation("修改")
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/TimeDiagramDto.java
New file
@@ -0,0 +1,13 @@
package com.zt.life.modules.mainPart.taskReliability.dto;
import lombok.Data;
@Data
public class TimeDiagramDto {
    private double smallWidth;
    private double totalWidth;
    private double minPointNum;
    private String smallDiagramJson;
    private String diagramJson;
    private String textDiagramJson;
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/TimeDiagramStatusDto.java
New file
@@ -0,0 +1,16 @@
package com.zt.life.modules.mainPart.taskReliability.dto;
import lombok.Data;
@Data
public class TimeDiagramStatusDto {
    private double x1;
    private double x2;
    private int status;
    public TimeDiagramStatusDto(double x1, double x2, int status) {
        this.x1 = x1;
        this.x2 = x2;
        this.status = status;
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/model/TimeDiagram.java
@@ -22,6 +22,8 @@
    @ApiModelProperty(value = "xml文档")
    private String content;
    @ApiModelProperty(value = "xml文档")
    private String content2;
    @ApiModelProperty(value = "发布文档")
    private String publishContent;
    @ApiModelProperty(value = "发布状态")
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
@@ -107,6 +107,7 @@
    String templetStr = "{\"cells\":[]}";
    Map<String, JSONObject> templetsMap = new HashMap<>();
    Map<String, String> templetsStrMap = new HashMap<>();
    Map<Integer, String> templetsStrMap2 = new HashMap<>();
    private JSONObject xmlJSONObj;
@@ -150,7 +151,10 @@
        return baseDao.getChildren(productId, taskId);
    }
    public String getTimeDiagram(Long productId, Long taskId, Long fzId) {
    public TimeDiagramDto getTimeDiagram(Long productId, Long taskId, Long fzId, double smallWidth, double minPointNum) {
        TimeDiagramDto timeDiagramDto = new TimeDiagramDto();
        timeDiagramDto.setSmallWidth(smallWidth);
        timeDiagramDto.setMinPointNum(minPointNum);
        String filePath = path + "/" + fzId + "/" + "status.json";
        ObjectMapper mapper = new ObjectMapper();
        String jsonStr = null;
@@ -178,7 +182,10 @@
        JSONObject jsonObject = new JSONObject(templetStr);
        JSONArray jsonArray = jsonObject.getJSONArray("cells");
        this.getPetsInfo();
        JSONObject jsonObject3 = new JSONObject(templetStr);
        JSONArray jsonArray3 = jsonObject3.getJSONArray("cells");
        String modelStr2 = this.getPetsInfo();
        double x1 = 0;
        double x2 = 0;
        int y = -10;
@@ -189,26 +196,39 @@
        double pointNumPerHour = 60.0 / simulatAssess.getSamplPeriod();
        //时序图线
        List<List<TimeDiagramStatusDto>> lineArray = new ArrayList();
        for (int i = 0; i < list.size(); i++) {
            List<TimeDiagramStatusDto> statusDtoList = new ArrayList<>();
            x1 = 0;
            groupY = groupHeight * i;
            ProductStatusDto dto = list.get(i);
            double startTime = 0.0;
            int status2 = 5;
            for (StatusDto status : dto.getStatusList()) {
                switch (status.getStatus()) {
                    case "O":
                        y = groupY;
                        status2 = 5;
                        break;
                    case "F":
                        y = groupY;// + spaceHeight;
                        status2 = 1;
                        break;
                    case "I":
                        y = groupY;// + spaceHeight;
                        status2 = 3;
                        break;
                    case "S":
                        y = groupY;// + spaceHeight;
                        status2 = 2;
                        break;
                    case "M":
                        y = groupY;// + 2 * spaceHeight;
                        status2 = 4;
                        break;
                }
                x2 = x1 + status.getTimes() * pointNumPerHour + 5;
                statusDtoList.add(new TimeDiagramStatusDto(x1, x2, status2));
                JSONObject lineJson = new JSONObject(templetsStrMap.get(status.getStatus()));
                setlineXy(lineJson, x1, y, x2, y, "");
                JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus());
@@ -219,34 +239,22 @@
                x1 = x2 - 5;
                jsonArray.add(lineJson);
            }
            lineArray.add(statusDtoList);
            JSONObject textJson = new JSONObject(templetsStrMap.get("text"));
            JsonUtils2.setJsonValueByPath(textJson, "id".split("/"), UUIDUtil.generateId().toString());
            JsonUtils2.setJsonValueByPath(textJson, "attrs/label/textWrap/text".split("/"), dto.getName());
            JsonUtils2.setJsonValueByPath(textJson, "position/x".split("/"), 20);
            JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y - 15);
            jsonArray.add(textJson);
        }
        //图例
        int spaceWitdth = 80;
        x1 = -spaceWitdth;
        x2 = -11;
        y = -110;
        String[] tlArr = "O,F,I,S,M".split(",");
        for (String s : tlArr) {
            JSONObject f = templetsMap.get(s);
            x1 = x1 + spaceWitdth;
            x2 = x2 + spaceWitdth;
            setlineXy(f, x1, y, x2, y, null);
            jsonArray.add(f);
            jsonArray3.add(textJson);
        }
        //阶段模型及刻度
        x1 = 0;
        x2 = 0;
        double y1 = -80;
        y = -60;
        double y2 = -50;
        double y1 = -60;
        y = -40;
        double y2 = -30;
        JSONObject modelJson = new JSONObject(templetsStrMap.get("model"));
        setlineXy(modelJson, 1, y1, 1, y2, null);
@@ -288,6 +296,7 @@
            jsonArray.add(textJson);
            x1 = x2;
        }
        JSONObject modelJson3 = new JSONObject(templetsStrMap.get("model"));
        setlineXy(modelJson3, 0, y, x2, y, null);
        jsonArray.add(modelJson3);
@@ -315,9 +324,122 @@
            curPointHour += periodHour;
        }
        timeDiagramDto.setTotalWidth(x2);
        double pointRate = timeDiagramDto.getTotalWidth() / timeDiagramDto.getSmallWidth();
        return jsonObject.toString();
        List<TimeDiagramStatusDto> subStatusDtoList = new ArrayList<>();
        int lastStatus = 5;
        boolean isFirst = true;
        x1 = 0;
        for (double i = 0; i < timeDiagramDto.getSmallWidth(); i = i + timeDiagramDto.getMinPointNum()) {
            int netStatus = 5;
            for (int j = 1; j < list.size(); j++) {
                if (i >= 448) {
                    System.out.println(111);
    }
                int tmpStatus = getPointStatus(lineArray.get(j), i * pointRate, (i + timeDiagramDto.getMinPointNum()) * pointRate - 1);
                if (tmpStatus < netStatus) {
                    netStatus = tmpStatus;
                }
            }
            if (!isFirst) {
                if (lastStatus != netStatus) {
                    subStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
                    lastStatus = netStatus;
                    x1 = i;
                }
            } else {
                lastStatus = netStatus;
                isFirst = false;
            }
            x2 = i + timeDiagramDto.getMinPointNum() - 1;
        }
        subStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
        List<TimeDiagramStatusDto> parentStatusDtoList = new ArrayList<>();
        lastStatus = 5;
        isFirst = true;
        x1 = 0;
        for (double i = 0; i < timeDiagramDto.getSmallWidth(); i = i + timeDiagramDto.getMinPointNum()) {
            if (i >= 448) {
                System.out.println(111);
            }
            int netStatus = getPointStatus(lineArray.get(0), i * pointRate, (i + timeDiagramDto.getMinPointNum()) * pointRate - 1);
            if (!isFirst) {
                if (lastStatus != netStatus) {
                    parentStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
                    lastStatus = netStatus;
                    x1 = i;
                }
            } else {
                lastStatus = netStatus;
                isFirst = false;
            }
            x2 = i + timeDiagramDto.getMinPointNum() - 1;
        }
        parentStatusDtoList.add(new TimeDiagramStatusDto(x1, x2, lastStatus));
        JSONObject jsonObject2 = new JSONObject(modelStr2);
        JSONArray jsonArray2 = jsonObject2.getJSONArray("cells");
        List<List<TimeDiagramStatusDto>> smallStatusDtoList = new ArrayList<>();
        smallStatusDtoList.add(parentStatusDtoList);
        smallStatusDtoList.add(subStatusDtoList);
        y = 10;
        for (int i = 0; i < smallStatusDtoList.size(); i++) {
            for (TimeDiagramStatusDto status : smallStatusDtoList.get(i)) {
                JSONObject lineJson = new JSONObject(templetsStrMap2.get(status.getStatus()));
                setlineXy(lineJson, status.getX1(), y, status.getX2() + 5, y, "");
                JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus());
                JsonUtils2.setJsonValueByPath(lineJson, "id".split("/"), UUIDUtil.generateId().toString());
                jsonArray2.add(lineJson);
            }
            y = y + 25;
        }
        //图例
        int spaceWitdth = 80;
        x1 = 0;
        x2 = spaceWitdth - 11;
        y = 60;
        String[] tlArr = "O,F,I,S,M".split(",");
        for (String s : tlArr) {
            JSONObject f = templetsMap.get(s);
            x1 = x1 + spaceWitdth;
            x2 = x2 + spaceWitdth;
            setlineXy(f, x1, y, x2, y, null);
            jsonArray2.add(f);
        }
        timeDiagramDto.setDiagramJson(jsonObject.toString());
        timeDiagramDto.setSmallDiagramJson(jsonObject2.toString());
        timeDiagramDto.setTextDiagramJson(jsonObject3.toString());
        return timeDiagramDto;
    }
    private int getPointStatus(List<TimeDiagramStatusDto> dtoList, double x1, double x2) {
        int status = 5;
        boolean findStart = false;
        for (int i = 0; i < dtoList.size(); i++) {
            if (x2 <= dtoList.get(i).getX1()) {
                break;
            }
            if (!findStart) {
                if (dtoList.get(i).getX1() >= x1 && x1 <= dtoList.get(i).getX2()) {
                    status = dtoList.get(i).getStatus();
                    findStart = true;
                }
            }
            if (dtoList.get(i).getX2() >= x2) {
                if (dtoList.get(i).getStatus() < status)
                    status = dtoList.get(i).getStatus();
            }
        }
        return status;
    }
    public void setlineXy(JSONObject lineJson, double x1, double y1, double x2, double y2, String text) {
        JsonUtils2.setJsonValueByPath(lineJson, "source/x".split("/"), x1);
@@ -330,12 +452,14 @@
        }
    }
    public void getPetsInfo() {
    public String getPetsInfo() {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("projectId", 10000);
        params.put("diagramId", 10000);
        String modelStr2 = "";
        List<TimeDiagram> list_style = baseDao.getTimeDiagram(params);
        if (list_style.size() > 0) {
            modelStr2 = list_style.get(0).getContent2();
            String modelStr = list_style.get(0).getContent();
            JSONObject modelJson = new JSONObject(modelStr);
            JSONArray modelJsonArray = modelJson.getJSONArray("cells");
@@ -349,22 +473,27 @@
                    if ("运行".equals(nodeMarker)) {
                        templetsMap.put("O", jsonObject);
                        templetsStrMap.put("O", jsonObject.toString());
                        templetsStrMap2.put(5, jsonObject.toString());
                    }
                    if ("故障".equals(nodeMarker)) {
                        templetsMap.put("F", jsonObject);
                        templetsStrMap.put("F", jsonObject.toString());
                        templetsStrMap2.put(1, jsonObject.toString());
                    }
                    if ("空闲".equals(nodeMarker)) {
                        templetsMap.put("I", jsonObject);
                        templetsStrMap.put("I", jsonObject.toString());
                        templetsStrMap2.put(3, jsonObject.toString());
                    }
                    if ("备份".equals(nodeMarker)) {
                        templetsMap.put("S", jsonObject);
                        templetsStrMap.put("S", jsonObject.toString());
                        templetsStrMap2.put(2, jsonObject.toString());
                    }
                    if ("未用".equals(nodeMarker)) {
                        templetsMap.put("M", jsonObject);
                        templetsStrMap.put("M", jsonObject.toString());
                        templetsStrMap2.put(4, jsonObject.toString());
                    }
                    if ("模型".equals(nodeMarker)) {
                        JsonUtils2.setJsonValueByPath(tmpJSONObject, "attrs/text/text".split("/"), "");
@@ -403,6 +532,7 @@
                }
            }
        }
        return modelStr2;
    }
    public List<ProductStatusDto> getStatusData(Long productId, Long taskId) {
modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
@@ -11,7 +11,7 @@
                               AND WeightedFailure > 0 THEN
                               1 / WeightedFailure
                           ELSE 0
                           END AS basic_mtbf_regulate,
                           END AS basic_mtbf_regulate_tmp,
                       CASE
                           WHEN WeightedFailure IS NOT NULL
                               AND WeightedFailure > 0 THEN
@@ -24,21 +24,21 @@
                                sum(
                                        CASE
                                            WHEN b.product_type &lt; 5 THEN
                                                1 * 1 / basic_mtbf_regulate
                                                1 * 1 / basic_mtbf_regulate_tmp
                                            WHEN a.reliab_distrib_type = 1 THEN
                                                1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regulate
                                            WHEN a.reliab_distrib_type = 2 THEN
                                                1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regulate_tmp
                                            WHEN a.reliab_distrib_type = 3 THEN
                                                1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regul_succ_rate
                                            ELSE 0 END
                                    ) AS WeightedFailure,
                                sum(
                                        CASE
                                            WHEN b.product_type &lt; 5 THEN
                                                1 * 1 * a.repair_mttcr / a.basic_mtbf_regulate
                                                1 * 1 * a.repair_mttcr / a.basic_mtbf_regulate_tmp
                                            WHEN a.repairable = 1 and a.reliab_distrib_type = 1 THEN
                                                    1 * a.basic_mtbf_operating_ratio * a.repair_mttcr /
                                                    a.basic_mtbf_regulate
                                            WHEN a.repairable = 1 and a.reliab_distrib_type = 2 THEN
                                                    a.basic_mtbf_regulate_tmp
                                            WHEN a.repairable = 1 and a.reliab_distrib_type = 3 THEN
                                                    1 * a.basic_mtbf_operating_ratio * a.repair_mttcr /
                                                    a.basic_mtbf_regul_succ_rate
                                            ELSE 0
@@ -59,23 +59,40 @@
                           AND ((b.product_type = 5 AND a.basic_join_compute = 1
                             and ((
                                          a.reliab_distrib_type = 1
                                          AND a.basic_mtbf_regulate > 0
                                          AND a.basic_mtbf_regulate_tmp > 0
                                      )
                                 OR (a.reliab_distrib_type = 2 AND a.basic_mtbf_regul_succ_rate > 0))
                                 OR (a.reliab_distrib_type = 3 AND a.basic_mtbf_regul_succ_rate > 0))
                                    )
                             || (b.product_type &lt; 5 AND a.basic_mtbf_regulate > 0))
                             || (b.product_type &lt; 5 AND a.basic_mtbf_regulate_tmp > 0))
                         GROUP BY c.id, c.name
                     ) c
            ) d
        set f.basic_mtbf_regulate = d.basic_mtbf_regulate,
        set f.basic_mtbf_regulate_tmp = d.basic_mtbf_regulate_tmp,
            f.repair_mttcr        = d.repair_mttcr
        where f.product_id = d.id;
    </update>
    <update id="compute1">
        UPDATE param_data a, product_model b
        SET repair_mttcr = 0
        where b.ship_id = ${shipId} and repair_mttcr is null;
        UPDATE param_data a, product_model b
        SET basic_mtbf_regulate_tmp = basic_mtbf_regulate
        where b.ship_id = ${shipId};
        UPDATE param_data a, product_model b
        SET basic_mtbf_regulate_tmp = basic_runs_num /basic_mtbf_regul_succ_rate
        where b.ship_id = ${shipId} and reliab_distrib_type = 3
    </update>
    <update id="compute2">
        UPDATE param_data a, product_model b
        SET ai = basic_mtbf_regulate / (basic_mtbf_regulate + repair_mttcr)
        SET  basic_mtbf_regulate = basic_mtbf_regulate_tmp
        where b.ship_id = ${shipId} and (reliab_distrib_type = 1 or reliab_distrib_type is null);
        UPDATE param_data a, product_model b
        SET ai = basic_mtbf_regulate_tmp / (basic_mtbf_regulate_tmp + repair_mttcr)
        where b.ship_id = ${shipId}
    </update>
    <select id="getAI" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamData">
@@ -85,7 +102,9 @@
               b.ai,
               b.basic_mtbf_regulate,
               b.repair_mttcr,
               b.basic_mtbf_operating_ratio
               b.basic_mtbf_operating_ratio,
               b.basic_mtbf_regul_succ_rate,
               b.basic_runs_num
        FROM product_model a
                 LEFT JOIN param_data b ON b.product_id = a.id and b.is_delete = 0
        where a.is_delete = 0
web/public/²úÆ·½á¹¹Ê÷µ¼ÈëÄ£°å.xlsx
Binary files differ
web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -39,6 +39,16 @@
                  <span>{{  keepNumber(scope.row.repairMttcr) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="basicMtbfRegulSuccRate" label="成功率" align="right">
                <template slot-scope="scope">
                  <span>{{keepNumber(scope.row.basicMtbfRegulSuccRate) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="basicRunsNum" label="运行次数" align="right">
                <template slot-scope="scope">
                  <span>{{scope.row.basicRunsNum}}</span>
                </template>
              </el-table-column>
              <el-table-column prop="basicMtbfOperatingRatio" label="运行比" align="right">
                <template slot-scope="scope">
                  <span>{{keepNumber(scope.row.basicMtbfOperatingRatio) }}</span>
@@ -68,7 +78,9 @@
          basicMtbfRegulate: '',
          repairMttcr: '',
          basicMtbfOperatingRatio: '',
          ai: ''
          ai: '',
          basicMtbfRegulSuccRate:'',
          basicRunsNum:''
        },
        defultKey: []
      }
@@ -79,8 +91,12 @@
    computed: {
      keepNumber() { //过滤器保留4为小数
        return function (val) {        // å¯¹è®¡ç®—属性进行传参
          const numM = Number(val).toFixed(5);
          return numM.substring(0, numM.length - 1);
          let numM = 0.0
          if (val){
            numM = Number(val).toFixed(4);
            numM.substring(0, numM.length - 1)
          }
          return numM;
        }
      },
    },
web/src/views/modules/basicInfo/ParamData.vue
@@ -120,12 +120,12 @@
                         <span v-else v-text="scope.row.basicMtbfAcceptSuccRate"></span>
                       </template>
                     </el-table-column>-->
                    <el-table-column prop="basicUnitNum" label="单元数量" :key="11" width="100" align="center">
              <!--      <el-table-column prop="basicUnitNum" label="单元数量" :key="11" width="100" align="center">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicUnitNum"></el-input>
                        <span v-else v-text="scope.row.basicUnitNum"></span>
                      </template>
                    </el-table-column>
                    </el-table-column>-->
                    <el-table-column prop="basicRunsNum" label="运行次数" :key="12" width="100" align="center">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicRunsNum"></el-input>
@@ -336,13 +336,9 @@
            value: 1,
            label: '指数分布'
          }, {
            value: 2,
            label: '二项分布'
          },
          {
            value: 3,
            label: '威布尔分布'
          },
            label: '二项分布'
          }
        ],
        // editingCell:null,
        dataList: [],
web/src/views/modules/basicInfo/XhProductModel.vue
@@ -45,6 +45,9 @@
                  <zt-table-button v-if="productType==='1'" size="small" type="primary"
                                   @click="importData(row)">导入
                  </zt-table-button>
                  <zt-table-button v-if="productType==='1'" size="small" type="primary"
                                   @click="exportData(row)">导出
                  </zt-table-button>
                </template>
              </zt-table-column-handle>
            </el-table>
@@ -142,6 +145,14 @@
      importData(row) {
        this.$refs.ProductImport.$refs.dialog.init(row)
      },
      async exportData(row) {
        let params = {
          shipId:row.id
        }
        let res = await this.$http.get(`/basicInfo/XhProductModel/exportData`,{params:params})
      },
      exportProduct() {
        window.location.href = './产品结构树导入模板.xlsx'
      },
web/src/views/modules/taskReliability/ConfigNode/configNode.vue
@@ -8,11 +8,12 @@
            <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"
            <el-form-item v-show="showNumberInput" :label='nodeType=="vote"?"表决数量":"备份数量"' 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"
@@ -175,7 +176,8 @@
        this.curCel.attr('text/text', this.text)
      },
      onNodeTypeExtChange(e) {
        if (this.globalGridAttr.nodeTypeExt === 'vote') {
        alert(this.globalGridAttr.nodeTypeExt)
        if (this.globalGridAttr.nodeTypeExt === 'vote' || this.globalGridAttr.nodeTypeExt === 'switch') {
          this.showNumberInput = true;
        } else {
          this.showNumberInput = false;
@@ -406,7 +408,7 @@
          this.globalGridAttr.successRate = cell.getData().successRate
          this.globalGridAttr.simulatTimes = cell.getData().simulatTimes
          this.globalGridAttr.successTimes = cell.getData().successTimes
          if (this.nodeType === 'vote' || this.globalGridAttr.nodeTypeExt === 'vote' || (cell.getData().voteNum !== undefined && cell.getData().voteNum !== '')) {
          if (this.nodeType === 'vote' || this.nodeType === 'switch') {
            console.log(cell.getData().voteNum, 'cell.getData().voteNum')
            this.showNumberInput = true
          }
web/src/views/modules/taskReliability/RBD-edit-img.vue
@@ -1926,6 +1926,12 @@
      createParallelBrach(x, y, dragNode) {
        dragNode.position(x + 320, y - dragNode.size().height / 2)
        const connectNode = this.createConnectNode(x + 50, y)
        this.createBrach(dragNode,connectNode,x,y-50)
        this.createBrach(dragNode,connectNode,x,y+50)
        return {newStartNode: connectNode, newEndNode: dragNode}
      },
      createBrach(dragNode,connectNode,x,y){
        const dashedBox = this.createDashedBox(x + 150, y)
        dragNode.setData({startNodeId: connectNode.id})
@@ -1935,7 +1941,7 @@
          router: {
            name: 'manhattan',
            args: {
              startDirections: ['right'], // ä»Žä¸‹æ–¹å¼€å§‹
              startDirections: ['top','bottom'], // ä»Žä¸‹æ–¹å¼€å§‹
              endDirections: ['left'],      // å‘左方结束
            },
          },
@@ -1949,25 +1955,12 @@
            name: 'manhattan',
            args: {
              startDirections: ['right'], // ä»Žä¸‹æ–¹å¼€å§‹
              endDirections: ['left'],      // å‘左方结束
              endDirections: ['top','bottom'],      // å‘左方结束
            },
          },
          connector: {name: 'rounded'},
          zIndex: -1
        })
        return {newStartNode: connectNode, newEndNode: dragNode}
        /*        this.graph.addEdge({
                  source: {cell: startNode, port: 'right1'},
                  target: {cell: connectNode, port: 'left1'},
                  router: {name: 'manhattan'},
                  connector: {name: 'rounded'}
                })
                this.graph.addEdge({
                  source: {cell: dragNode, port: 'right1'},
                  target: {cell: endNode, port: 'left1'},
                  router: {name: 'manhattan'},
                  connector: {name: 'rounded'}
                })*/
      },
      createBridgeConnection(x, y, dragNode) {
        console.log(x, y, 'leftX centerY')
web/src/views/modules/taskReliability/SchemeCompar.vue
@@ -35,7 +35,7 @@
                </el-table-column>
                <el-table-column
                  prop="mtbf"
                  label="MTBF"
                  label="MTTF"
                  width="100px"
                  align="right">
                  <template slot-scope="scope">
web/src/views/modules/taskReliability/SimulatCurve.vue
@@ -36,7 +36,7 @@
        }
        this.option = {
          title: {
            text: "mtbf:" + this.mtbf + "    mttr:" + this.mttr + "    msr:" + this.msr,
            text: "mttf:" + this.mtbf + "    mttr:" + this.mttr + "    msr:" + this.msr,
            textStyle: { // ä¸»æ ‡é¢˜æ–‡æœ¬æ ·å¼{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
              fontFamily: 'Arial',
              fontSize: 30,
@@ -94,7 +94,7 @@
        }
        this.option = {
          title: {
            text: "mtbf:" + this.mtbf + "    mttr:" + this.mttr + "    msr:" + this.msr,
            text: "mttf:" + this.mtbf + "    mttr:" + this.mttr + "    msr:" + this.msr,
            textStyle: { // ä¸»æ ‡é¢˜æ–‡æœ¬æ ·å¼{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
              fontFamily: 'Arial',
              fontSize: 30,
web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -22,7 +22,7 @@
            </el-input>
          </zt-form-item>
          <zt-form-item >
            <zt-button @click="getDiagram()">查看时序图</zt-button>
            <zt-button @click="getDiagram(null)">查看时序图</zt-button>
          </zt-form-item>
        </el-form>
        <div>
@@ -518,37 +518,7 @@
        console.log(res.data)
        this.simulatList = res.data
      },
      async onTreeSelected(data) {
        this.graph.unfreeze()
        if (!this.dataForm.taskModelId) {
          this.$alert("请先选择具体任务")
          return
        }
        if (!this.dataForm.id) {
          this.$alert("请先选择具体仿真记录")
          return
        }
        let params = {
          productId: data.id,
          taskId: this.dataForm.taskModelId,
          fzId: this.dataForm.id
        }
        let res = await this.$http.get('/taskReliability/SimulatAssess/getStatus', {params: params})
        if (res.data !== null) {
          this.diagramJson = JSON.parse(res.data)
          console.log(this.diagramJson, 'this.Diagram json')
          this.graph.fromJSON(this.diagramJson)
          this.graph.positionContent('left')
          //this.graph.zoomToFit()
          this.graph.freeze()
        } else {
          this.graph.fromJSON(this.emptyJson)
          //this.graph.centerContent()
          //this.graph.zoomToFit()
          this.graph.freeze()
        }
        console.log(res.data)
      },
      // èŽ·å–ä¿¡æ¯
      onProductSelected(data) {
        this.isSelect = true
@@ -578,25 +548,30 @@
        this.dataForm.samplPeriod = result.data.samplPeriod
        this.dataForm.simulatFrequency = result.data.simulatFrequency
      },
      async getDiagram() {
      async onTreeSelected(data) {
        await this.getDiagram(data.id)
      },
      async getDiagram(productId) {
        this.graph.unfreeze()
        let params = {
          productId: this.dataForm.productId,
          productId: productId ? productId : this.dataForm.productId,
          taskId: this.dataForm.taskModelId,
          fzId: this.dataForm.id
          fzId: this.dataForm.id,
          smallWidth: 1200,
          minPointNum: 5
        }
        let res = await this.$http.get('/taskReliability/SimulatAssess/getStatus', {params: params})
        if (res.data !== null) {
          this.diagramJson = JSON.parse(res.data)
          this.diagramJson = JSON.parse(res.data.smallDiagramJson)
          console.log(this.diagramJson, 'this.Diagram json')
          this.graph.fromJSON(this.diagramJson)
          this.graph.centerContent()
          this.graph.zoomToFit()
          //this.graph.zoomToFit()
          this.graph.freeze()
        } else {
          this.graph.fromJSON(this.emptyJson)
          this.graph.centerContent()
          this.graph.zoomToFit()
          //this.graph.zoomToFit()
          this.graph.freeze()
        }
        console.log(res.data)
@@ -610,9 +585,11 @@
    border: 1px solid #dfe3e8;
    width: 100% !important;
  }
  #timeDiagram .x6-cell.x6-node {
    cursor: inherit;
  }
  .x6-graph-scroller.x6-graph-scroller-pannable {
    width: 100% !important;
  }