| | |
| | | {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, |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initDigram() |
| | | //this.initDigram() |
| | | this.type = 'grid' |
| | | }, |
| | | methods: { |
| | |
| | | this.modelName = row.modelName |
| | | let modelId = row.id |
| | | this.dataForm.id = modelId |
| | | // this.productId = row.productId |
| | | // this.getProduct(row.productId) |
| | | this.initDigram(row.productId) |
| | | this.getDiagram(modelId) |
| | | console.log(row,'init(row){') |
| | | }, |
| | | async getDiagram(modelId) { |
| | | let params = { |
| | |
| | | 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') |
| | |
| | | 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: { |