jinlin
2024-03-12 c400e8082b202fbf20ea0e740a306aa3c62e8fb5
web/src/views/modules/taskReliability/RBD-edit-img.vue
@@ -124,7 +124,7 @@
          {imgPath:'voteRight',imgName:'vote',nodeType:'vote',imgWidth:60,imgHeight:60,imgId:'6',data:{}},
        ],
        imgsList2:[
          {imgPath:'logo',imgName:'logo',nodeType:'node',statusImg:'',imgWidth:60,imgHeight:60,imgId:'100',data:{dataId:'123456',nodeTypeExt:''}},
         // {imgPath:'logo',imgName:'logo',nodeType:'node',,nodeTypeExt:'',productType:'',statusImg:'',imgWidth:60,imgHeight:60,imgId:'100',dataId:'123456'},
        ],
        nodeType:'',
        first: true,
@@ -295,22 +295,25 @@
      }
    },
    mounted() {
      this.initDigram()
      //this.initDigram()
      this.type = 'grid'
    },
    methods: {
      init(row){
        this.modelName = row.modelName
        let modelId = row.id
        this.dataForm.id = modelId
        this.getDiagram(modelId)
        this.dataForm.id = row.id
        // this.productId = row.productId
        // this.getProduct(row.productId)
        this.initDigram(row.productId)
        console.log(this.dataForm,'init(row){')
      },
      async getDiagram(modelId) {
        let params = {
          modelId : modelId
        }
          let res = await this.$http.get(`/taskReliability/ModelLine/getDiagram`, {params: params})
          if (res.data !== null && res.data.content != null) {
        console.log(res,'async getDiagram( res')
        if (res.data !== null && res.data.content != null) {
            this.dataForm = res.data
            console.log(this.dataForm, 'this.dataForm in getDiagram')
            this.diagramJson = JSON.parse(this.dataForm.content)
@@ -331,7 +334,9 @@
        this.graph.zoomToFit()
        // this.graph.freeze()
      },
      initDigram() {
      async initDigram(productId) {
        this.timer = setHartBeat(10, 240);
        console.log(document.documentElement.clientWidth, 'document.documentElement.clientWidth')
        console.log(document.documentElement.clientHeight, 'document.documentElement.clientHeight')
@@ -791,18 +796,25 @@
              ports: {...this.ports},
            }),
        )
        let params = {
          productId : productId
        }
        let res = await this.$http.get(`/basicInfo/XhProductModel/getProduct`, {params: params})
        this.imgsList2 = res.data
        console.log(this.imgsList2 ,'getProduct(productId)234567890')
        const imageNodes2 = this.imgsList2.map((item) =>
            this.graph.createNode({
              shape: 'image',
              imageUrl: require('/public/modelImg/'+item.imgPath+'.png'),
              imageUrl: `${window.SITE_CONFIG['apiURL']}/sys/oss/content2?fileId=${item.imgPath}`,
              width:item.imgWidth,
              height:item.imgHeight,
              x:item.imgWidth,
              y:item.imgHeight,
              data: {
                dataId: item.data.dataId,
                dataId: item.dataId,
                nodeType: item.nodeType,
                nodeTypeExt: item.data.nodeTypeExt,
                nodeTypeExt: item.nodeTypeExt,
                productType: item.productType,
                statusImg:item.statusImg
              },
              attrs: {
@@ -1053,7 +1065,7 @@
          cell.removeTools()
        })
        this.getDiagram()
        await this.getDiagram(this.dataForm.id)
      },
      showPorts(ports, show) {
        for (let i = 0, len = ports.length; i < len; i = i + 1) {