jinlin
2024-10-28 79eab76ac1b4b77696c92d72cfbde1e122c4c28f
关于修改可靠性产品重复
17个文件已修改
245 ■■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/service/SysPictureBaseService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
starter/src/main/java/com/zt/life/StartupHandler.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
starter/src/main/java/com/zt/task/UpdateDataTask.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
starter/src/main/resources/application.yml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/public/index.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/baseReliability/ParamDataBasic.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/home.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/RBD-edit-img.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -6,6 +6,7 @@
import com.zt.common.annotation.QueryParam;
import com.zt.common.db.query.QueryFilter;
import com.zt.common.servlet.Result;
import com.zt.common.utils.CacheUtils;
import com.zt.common.utils.UUIDUtil;
import com.zt.common.validator.AssertUtils;
import com.zt.common.validator.ValidatorUtils;
@@ -34,6 +35,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -74,6 +76,7 @@
    public Result<List<XhProductModel>> getTreeList(Boolean showXdy, Integer ztShow, Long productId) {
        List<XhProductModel> list = xhProductModelService.getAllTree(showXdy, ztShow, productId);
        return Result.ok(list);
    }
@@ -93,9 +96,16 @@
        return Result.ok(data);
    }
    @GetMapping("getImg")
    @ApiOperation("信息")
    public void getImg(HttpServletResponse response, Long id) {
        xhProductModelService.getImg(response, id);
    }
    @GetMapping("getProductList")
    public Result<List<XhProductModel>> getProductList() {
        List<XhProductModel> list = xhProductModelService.getProductList();
    public Result<List<XhProductModel>> getProductList(Long shipId, Integer productType) {
        List<XhProductModel> list = xhProductModelService.getProductList(shipId, productType - 1);
        return Result.ok(list);
    }
@@ -125,8 +135,8 @@
    @GetMapping("exportData")
    @ApiOperation("导出产品模型")
    @LogOperation("导出产品模型")
    public Result exportDataExcel(HttpServletRequest request, HttpServletResponse response, Long shipId,String fileName) {
        xhProductModelService.exportDataExcel(request,response,shipId,fileName);
    public Result exportDataExcel(HttpServletRequest request, HttpServletResponse response, Long shipId, String fileName) {
        xhProductModelService.exportDataExcel(request, response, shipId, fileName);
        return null;
    }
@@ -156,7 +166,9 @@
        }
        xhProductModelService.insert(xhProductModel);
        Map<Long, XhProductModel> imgMap = new HashMap<>();
        imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache", "sysImgCache");
        imgMap.put(xhProductModel.getId(), xhProductModel);
        return Result.ok();
    }
@@ -184,6 +196,9 @@
        //效验数据
        ValidatorUtils.validateEntity(xhProductModel, UpdateGroup.class, DefaultGroup.class);
        xhProductModelService.update(xhProductModel);
        Map<Long, XhProductModel> imgMap = new HashMap<>();
        imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache", "sysImgCache");
        imgMap.put(xhProductModel.getId(), xhProductModel);
        return Result.ok();
    }
@@ -200,19 +215,15 @@
    }
    private void deleteByProduct(Long[] ids) {
        Map<Long, XhProductModel> imgMap = new HashMap<>();
        imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache", "sysImgCache");
        for (Long id : ids) {
            XhProductModel data = xhProductModelService.get(id);
            if (data.getProductType().equals("1") || data.getProductType().equals("3") || data.getProductType().equals("4")) {
                xhProductModelService.deleteLogic(id);
              /*  List<Long> list =xhProductModelService.getByPid(id);
                Long[] L = list.stream().toArray(Long[]::new);*/
                Long[] list = xhProductModelService.getByPid(id);
            Long[] list = xhProductModelService.getByPid(id);
            if (list.length > 0){
                this.deleteByProduct(list);
            } else if (data.getProductType().equals("2")) {
                xhProductModelService.deleteByShipId(data.getShipId());
            } else if (data.getProductType().equals("5")) {
                xhProductModelService.deleteLogic(id);
            }
            imgMap.remove(id);
            xhProductModelService.deleteLogic(id);
        }
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java
@@ -25,7 +25,7 @@
    Integer getNo(Long pid, String productType);
    List<XhProductModel> getProductList();
    List<XhProductModel> getProductList(Long shipId, Integer type);
    List<ProductImg> getProduct(Long productId, Long parentId);
@@ -47,4 +47,6 @@
    List<ProductDto> getProductByShip(Long shipId);
    List<XhProductModel> getProductListByShip(Long productId, int level1, int level2);
    List<XhProductModel> getProductListAll();
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -137,8 +137,8 @@
        return baseDao.getNo(pid, productType);
    }
    public List<XhProductModel> getProductList() {
        List<XhProductModel> ProductList = baseDao.getProductList();
    public List<XhProductModel> getProductList(Long shipId, Integer type) {
        List<XhProductModel> ProductList = baseDao.getProductList(shipId,type);
        return TreeUtils.build(ProductList);
    }
@@ -582,4 +582,19 @@
            writeList(dto.getChildren(), List);
        }
    }
    public void refreshCache() {
        List<XhProductModel> productList = baseDao.getProductListAll();
        Map<Long, XhProductModel> imgMap = new HashMap<>();
        for (XhProductModel product : productList) {
            imgMap.put(product.getId(), product);
        }
        CacheUtils.put("sysImgCache", "sysImgCache", imgMap);
    }
    public void getImg(HttpServletResponse response, Long id) {
        Map<Long, XhProductModel> imgMap = new HashMap<>();
        imgMap = (Map<Long, XhProductModel>) CacheUtils.get("sysImgCache","sysImgCache");
        XhProductModel product = imgMap.get(id);
        sysPictureBaseService.getSvgImage(response,product.getOperatImg());
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
@@ -111,17 +111,7 @@
    @RequestMapping("/getSvgImage")
    public void getSvgImage(HttpServletResponse response, Long id) {
        try {
            SysPictureBase data = sysPictureBaseService.get(id);
            String svgContent = data.getSvgContent();
            response.setContentType("image/svg+xml");
            response.getWriter().write(svgContent);
            response.getWriter().flush();
            response.getWriter().close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        sysPictureBaseService.getSvgImage(response,id);
    }
    @GetMapping("/getDefaultImg")
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/service/SysPictureBaseService.java
@@ -8,8 +8,10 @@
import org.springframework.stereotype.Service;
import com.zt.common.db.query.QueryFilter;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.IOException;
import java.util.List;
@@ -52,4 +54,18 @@
    public SysPictureBase getDefaultImg(Integer productType) {
        return baseDao.getDefaultImg(productType);
    }
    public void getSvgImage(HttpServletResponse response, Long id) {
        try {
            SysPictureBase data = this.get(id);
            String svgContent = data.getSvgContent();
            response.setContentType("image/svg+xml");
            response.getWriter().write(svgContent);
            response.getWriter().flush();
            response.getWriter().close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
@@ -582,6 +582,7 @@
                this.processJSONArray(jsonArray, item, taskId);
            }
        }
        childList.removeIf(item -> item.getStatusList().size() == 0);
        return childList;
    }
modules/mainPart/src/main/resources/mapper/baseReliability/ParamDataBasicDao.xml
@@ -79,9 +79,11 @@
        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}
@@ -92,12 +94,29 @@
        UPDATE param_data a, product_model b
        SET basic_mtbf_regulate = basic_mtbf_regulate_tmp
        where b.ship_id = ${shipId}
          and (reliab_distrib_type = 1 or reliab_distrib_type is null);
          and (reliab_distrib_type = 1 or reliab_distrib_type is null)
          and a.product_id = b.id
          and a.IS_DELETE = 0
          and b.IS_DELETE = 0;
        UPDATE param_data a, product_model b
        SET ai = basic_mtbf_regulate_tmp / (basic_mtbf_regulate_tmp + repair_mttcr)
        where b.ship_id = ${shipId}
          and a.product_id = b.id
          and a.IS_DELETE = 0
          and b.IS_DELETE = 0;
        UPDATE param_data a,(
            select pid, case when count(1) > 0 then 1 else 0 end as basic_join_compute
            from param_data a,
                 product_model b
            where b.ship_id = ${shipId}
              and a.product_id = b.id
              and a.basic_join_compute = 1
            group by b.pid
        ) b
        set a.basic_join_compute = b.basic_join_compute
        where a.product_id = b.pid;
    </update>
    <select id="getAI" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamData">
@@ -109,11 +128,13 @@
               b.repair_mttcr,
               b.basic_mtbf_operating_ratio,
               b.basic_mtbf_regul_succ_rate,
               b.basic_runs_num
               b.basic_runs_num,
               b.basic_unit_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
            and a.product_type &lt;&gt; 10
            and b.basic_join_compute = 1
            and a.ship_id = ${shipId}
           or a.id = ${shipId}
        ORDER BY a.product_type, a.sort
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
@@ -50,6 +50,12 @@
        select a.name, a.id
        from product_model a
        where a.is_delete = 0
        <if test="type!=null and type!=''">
            and a.product_type = ${type}
        </if>
        <if test="shipId!=null">
            and a.ship_id = ${shipId}
        </if>
    </select>
    <select id="getProduct" resultType="com.zt.life.modules.mainPart.basicInfo.model.ProductImg">
        SELECT a.operat_img                 as imgPath,
@@ -189,9 +195,9 @@
    <select id="getProductListByShip" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel">
        select a.*, b.basic_unit_num as sameSbNum
        from product_model a,
             param_data b
        param_data b
        where a.IS_DELETE = 0 and b.IS_DELETE = 0
          and a.id = b.product_id
        and a.id = b.product_id
        <if test="productId !=null">
            and a.ship_id = #{productId}
        </if>
@@ -202,4 +208,9 @@
            and a.product_type &lt;= #{level2}
        </if>
    </select>
    <select id="getProductListAll" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel">
        select id, operat_img
        from product_model
        where IS_DELETE = 0
    </select>
</mapper>
starter/src/main/java/com/zt/life/StartupHandler.java
@@ -1,14 +1,19 @@
package com.zt.life;
import com.zt.life.modules.mainPart.basicInfo.service.ParamDataService;
import com.zt.life.modules.mainPart.basicInfo.service.XhProductModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
@Component
public class StartupHandler implements ApplicationRunner {
    @Autowired
    XhProductModelService xhProductModelService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        // 刷新缓存
        xhProductModelService.refreshCache();
    }
}
starter/src/main/java/com/zt/task/UpdateDataTask.java
@@ -1,6 +1,7 @@
package com.zt.task;
import com.zt.common.utils.CommonUtils;
import com.zt.life.modules.mainPart.basicInfo.service.XhProductModelService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -21,13 +22,15 @@
    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
    XhProductModelService xhProductModelService;
    @Scheduled(cron = "0 0 3 * * ?") //每天3点执行
    public void task() {
        logger.info("更新数据task开始");
        Date beginDate = new Date();
        xhProductModelService.refreshCache();
        purgeRedis();
        logger.info("更新数据task耗时:" + CommonUtils.getDatePoor(new Date(), beginDate));
starter/src/main/resources/application.yml
@@ -6,7 +6,7 @@
    min-spare-threads: 30
  port: 8066
  servlet:
    context-path: /test-project
    context-path: /reliability_simulat
    session:
      cookie:
        http-only: true
@@ -18,7 +18,7 @@
    druid:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.31.26:3366/reliability_simulat?allowMultiQueries=true&hive.exec.orc.split.strategy=ETL&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
#      url: jdbc:mysql://127.0.0.1:3305/reliability_simulat?allowMultiQueries=true&hive.exec.orc.split.strategy=ETL&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
      #url: jdbc:mysql://127.0.0.1:3306/reliability_simulat?allowMultiQueries=true&hive.exec.orc.split.strategy=ETL&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8
      username: root
      password: root
      #password: 123456
@@ -110,15 +110,15 @@
  #    secure: false
  #  serviceRegistry:
  #    initFromJson: true
  server-url-prefix: http://localhost:8100/cas
  server-login-url: http://localhost:8100/cas/login
  client-host-url: http://localhost:8050
  validation-type: cas
  #CAS服务地址
  server-url: http://192.168.31.13:8080/cas/
  #本地客户端ip端口,不是首页地址
  client-host: http://192.168.31.148:8066/reliability_simulat
zt:
  oss:
    type: local
    local-domain: http://127.0.0.1:8050/test-project/
    local-domain: http://127.0.0.1:8066/reliability_simulat/
    local-path: D:/ReliabilitySimulation/ #附件存储目录
    local-qd-path: D:/TestProjectFiles/ #附件存储目录
    local-prefix: accessories #附件存储子目录
@@ -159,3 +159,4 @@
    mainPy: D:/relia_sim/assess.py
    # 算法库仿真结果存放根目录
    resultHome: d:/relia_sim/sim_result
web/public/index.html
@@ -219,8 +219,8 @@
    window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = false; // 动态(菜单)路由是否已经添加的状态标示(用于判断是否需要重新拉取数据并进行动态添加操作)
    // 服务地址
    window.SITE_CONFIG['apiURL'] = 'http://' + location.hostname + ':8066/test-project';
    window.SITE_CONFIG['apiURL2'] = 'http://' + location.hostname + ':8066/test-project';
    window.SITE_CONFIG['apiURL'] = 'http://' + location.hostname + ':8066/reliability_simulat';
    window.SITE_CONFIG['apiURL2'] = 'http://' + location.hostname + ':8066/reliability_simulat';
    //window.SITE_CONFIG['apiURL2'] = 'http://'+location.hostname+':8066';
    //window.SITE_CONFIG['apiURL'] = '<%= process.env.VUE_APP_API_URL %>';
@@ -228,7 +228,7 @@
    // WebSocket地址
    window.SITE_CONFIG['socketURL'] = 'http://' + location.hostname + ':8066/test-project';
    window.SITE_CONFIG['socketURL'] = 'http://' + location.hostname + ':8066/reliability_simulat';
    //window.SITE_CONFIG['socketURL'] ='<%= process.env.VUE_APP_SOCKET_URL %>';
  </script>
web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -29,6 +29,7 @@
                      border @selection-change="table.selectionChangeHandle">
              <!--<el-table-column type="selection" width="40"/>-->
              <el-table-column prop="name" label="名称"/>
              <el-table-column prop="basicUnitNum" label="单元数量"/>
              <el-table-column prop="basicMtbfRegulate" label="MTBF" align="right">
                <template slot-scope="scope">
                  <span>{{  keepNumber(scope.row.basicMtbfRegulate) }}</span>
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
@@ -11,10 +11,10 @@
        <el-input v-model="dataForm.equipType"></el-input>
      </zt-form-item>
      <zt-form-item label="节点类型" prop="productType" rules="required">
        <zt-dict v-model="dataForm.productType" dict="product" @input="getDefaultImg"
        <zt-dict v-model="dataForm.productType" dict="product" @input="changeType"
                 :disabled="disabled"></zt-dict>
      </zt-form-item>
      <zt-form-item  v-if="dataForm.productType!=='1'" label="运行状态图" prop="operatImg">
      <zt-form-item v-if="dataForm.productType!=='1'" label="运行状态图" prop="operatImg">
        <el-input v-model="dataForm.operatImgName" @focus="selectPicture()"></el-input>
        <el-image v-if="dataForm.operatImg" :src="url+dataForm.operatImg" style="height: 50px;width: 50px"></el-image>
      </zt-form-item>
@@ -58,7 +58,7 @@
    },
    methods: {
      init(id, params) {
        this.getProductList()
        console.log(params)
        if (params.shipId) {
          this.dataForm.shipId = params.shipId
        }
@@ -73,19 +73,32 @@
          this.getDefaultImg(this.dataForm.productType)
        } else {
          this.dataForm.pid = params.pid
          this.dataForm.productType = params.type
          console.log(params.productType,'type')
          console.log(parseInt(params.productType),'parseInttype')
          this.dataForm.productType = parseInt(params.productType)
          this.getDefaultImg(this.dataForm.productType)
        }
        if (this.dataForm.productType === '10' && id == null) {
          this.isShow = false
          this.getDefaultImg(this.dataForm.productType)
        }
        this.getProductList()
      },
      // 获取系统列表
      async getProductList() {
        let res = await this.$http.get('/basicInfo/XhProductModel/getProductList')
        let params = {
          productType: this.dataForm.productType,
          shipId: this.dataForm.shipId
        }
        let res = await this.$http.get('/basicInfo/XhProductModel/getProductList', {params: params})
        this.productList = res.data
        console.log(this.productList, 'getProductList')
      },
      changeType(selected) {
        this.dataForm.productType = selected
        this.getDefaultImg(selected)
        this.getProductList()
      },
      async getDefaultImg(selected) {
        console.log(selected, 'async getDefaultImg')
        let params = {
web/src/views/modules/basicInfo/XhProductModel.vue
@@ -101,14 +101,15 @@
        this.dataForm.type = this.productType
        if (this.dataForm.type !== '1') {
          this.$refs.SelectTyModel.$refs.dialog.init(null, {
          /*this.$refs.SelectTyModel.$refs.dialog.init(null, {
            type: this.dataForm.type,
            id: this.dataForm.pid,
            shipId: this.shipId,
            namePath: this.namePath
          })
          })*/
          this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, productType: parseInt(this.dataForm.type)+1 , pid: this.dataForm.pid,shipId: this.shipId})
        } else {
          this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'zt', pid: this.dataForm.pid})
          this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'zt', pid: this.dataForm.pid,shipId: this.shipId})
        }
      },
      addCell() {
web/src/views/modules/home.vue
@@ -1,11 +1,11 @@
<template>
  <div class="fa-card-b">
    <div style="margin: 0 0 10px 0">
      <span class="size">系统登录次数:</span>
      <span class="font">{{dataForm.loginNum}}</span>
      <span class="size">试验方案制定次数:</span>
      <span class="font">{{dataForm.planMakeNum}}</span>
    </div>
    <div class="fa-card-b">
      <div style="margin: 0 0 10px 0">
        <span class="size">系统登录次数:</span>
        <span class="font">{{dataForm.loginNum}}</span>
        <span class="size">试验方案制定次数:</span>
        <span class="font">{{dataForm.planMakeNum}}</span>
      </div>
      <el-table ref="taskTable" class="DataTable" :data="dataForm.taskReliabList" height="330px" border>
        <el-table-column label="任务可靠性数据" align="center">
          <el-table-column align="center" prop="name" label="名称">
@@ -64,12 +64,15 @@
          baseReliabList: [],
          loginNum: '',
          planMakeNum: ''
        }
        },
        userId: ''
      }
    },
    components: {},
    created() {
    },
    mounted() {
      this.init()
      this.init2()
    },
    computed: {
      keepNumber() { //过滤器保留4为小数
@@ -80,7 +83,7 @@
      },
    },
    methods: {
      init() {
      init2() {
        this.getInfo2()
      },
      async getInfo2() {
@@ -102,12 +105,13 @@
    background: #edf6ff;
  }
  .size{
  .size {
    font-size: 20px;
    margin: 10px;
    color: #000000;
  }
  .font{
  .font {
    font-size: 20px;
    margin: 10px;
    color: #0aa0bf;
web/src/views/modules/taskReliability/RBD-edit-img.vue
@@ -1026,7 +1026,7 @@
          this.graph.createNode({
            shape: 'image',
            //imageUrl: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=${item.imgPath}`,
            width: 100,
            width: 60,
            height: 70,
            //id: item.dataId, // 手动设置节点的 ID
            data: {
@@ -1057,11 +1057,11 @@
            },
            attrs: {
              image: {
                'xlink:href': `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=${item.imgPath}`,
                'xlink:href': `${window.SITE_CONFIG['apiURL']}/basicInfo/XhProductModel/getImg?token=${Cookies.get('token')}&id=${item.dataId}&t=${new Date().getTime()}`,
                //'xlink:href': urlObject.createObjectURL(new Blob([item.svgContent])),
              },
              title: {
                text: item.basicUnitNum>=1?item.basicUnitNum:'',
                text: item.basicUnitNum>1?item.basicUnitNum:'',
                refX: 15,
                refY: 10,
                fill: '#748be7',
@@ -1739,7 +1739,7 @@
        let dragNodeType = dragNode.getData().nodeType
        let offHeight = 50
        if (dragNodeType === 'node') {
          offHeight = 60
          offHeight = 70
        } else if (dragNodeType === 'bridgeConnection') {
          offHeight = 175
        } else {
@@ -1797,13 +1797,13 @@
          this.getYRange(inEdges, graphNodeStartNode, pointXY)
          console.log(pointXY, 'new')
          let minX = graphNodeStartNode.position().x + graphNode.getBBox().width + 15
          let maxX = graphNode.position().x
          let minX = graphNodeStartNode.position().x + graphNode.getBBox().width
          let maxX = graphNode.position().x - dragNode.getBBox().width / 2
          let centerX = minX + (maxX - minX) / 2
          let centerY = graphNodeY + graphNode.getBBox().height / 2 - pointXY.minY > pointXY.maxY - (graphNodeY + graphNode.getBBox().height / 2) ?
            pointXY.maxY + offHeight / 2 + 30 : pointXY.minY - offHeight / 2 - 30
          let result = this.addNodeAndConnect(null, dragNode, minX, centerY)
          let result = this.addNodeAndConnect(null, dragNode, centerX, centerY)
          console.log(result, 'result111')
          this.graph.addEdge({
            source: {cell: graphNodeStartNode},
@@ -1844,8 +1844,8 @@
          leftTopY = centerY
        let dragNodeType = dragNode.getData().nodeType
        if (dragNodeType === 'node') {
          width = 60
          height = 60
          width = 100
          height = 70
        } else if (dragNodeType === 'dashedBox') {
          width = 60
          height = 40
@@ -1854,7 +1854,7 @@
          height = 175
        } else {
          width = 270
          height = 60
          height = 70
        }
        leftTopX = centerX - width / 2
        leftTopY = centerY - height / 2