| | |
| | | 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.basicInfo.model.ProductImg; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.TyProductModel; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel; |
| | | import com.zt.life.modules.mainPart.basicInfo.service.XhProductModelService; |
| | | import com.zt.life.modules.sysPictureBase.model.SysPictureBase; |
| | | import com.zt.life.modules.sysPictureBase.service.SysPictureBaseService; |
| | | import com.zt.modules.oss.service.SysOssService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | @GetMapping("getProduct") |
| | | public Result<List<ProductImg>> getProduct(Long productId) { |
| | | |
| | | List<ProductImg> list = xhProductModelService.getProduct(productId); |
| | | |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<XhProductModel> get(@PathVariable("id") Long id){ |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ProductImg; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel; |
| | | import com.zt.life.modules.sysPictureBase.model.SysPictureBase; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | |
| | | Integer getNo(Long pid); |
| | | |
| | | List<XhProductModel> getProductList(); |
| | | |
| | | List<ProductImg> getProduct(Long productId); |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import com.zt.common.entity.TreeNode; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * product_model |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-29 |
| | | */ |
| | | @Data |
| | | public class ProductImg { |
| | | @TableField(exist = false) |
| | | private String nodeType; |
| | | |
| | | @TableField(exist = false) |
| | | private String imgPath; |
| | | @TableField(exist = false) |
| | | private String imgName; |
| | | |
| | | @TableField(exist = false) |
| | | private String nodeTypeExt; |
| | | |
| | | @TableField(exist = false) |
| | | private int imgWidth; |
| | | |
| | | @TableField(exist = false) |
| | | private int imgHeight; |
| | | @TableField(exist = false) |
| | | private String dataId; |
| | | @TableField(exist = false) |
| | | private String statusImg; |
| | | @TableField(exist = false) |
| | | private String productType; |
| | | } |
| | |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "节点类型") |
| | | private String nodeType; |
| | | private String productType; |
| | | |
| | | @ApiModelProperty(value = "默认图片") |
| | | private String defaultImg; |
| | | |
| | | @ApiModelProperty(value = "运行状态图片") |
| | | private String operationalStatus; |
| | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.TreeUtils; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.XhProductModelDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ProductImg; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.TyProductModel; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel; |
| | | import com.zt.life.modules.sysPictureBase.model.SysPictureBase; |
| | | import com.zt.modules.sys.model.SysMenu; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | |
| | | List<XhProductModel> ProductList = baseDao.getProductList(); |
| | | return TreeUtils.build(ProductList); |
| | | } |
| | | |
| | | public List<ProductImg> getProduct(Long productId) { |
| | | return baseDao.getProduct(productId); |
| | | } |
| | | } |
| | |
| | | Group by node_type |
| | | </select> |
| | | <select id="getProductList" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel"> |
| | | select a.name,a.id |
| | | select a.name, a.id |
| | | from product_model a |
| | | where a.is_delete =0 and a.node_type = 5 |
| | | where a.is_delete = 0 |
| | | and a.node_type = 5 |
| | | </select> |
| | | <select id="getProduct" resultType="com.zt.life.modules.mainPart.basicInfo.model.ProductImg"> |
| | | SELECT a.operational_status as imgPath, |
| | | a.`NAME` as imgName, |
| | | 'node' as nodeType, |
| | | '' as nodeTypeExt, |
| | | 60 as imgWidth, |
| | | 60 as imgHeight, |
| | | a.id as dataId, |
| | | '' as statusImg, |
| | | d.dict_code as productType |
| | | FROM product_model a |
| | | left join sys_dict_data d on d.DICT_VALUE = a.node_type and dict_type_id = '1728965873022050306' -- |
| | | WHERE a.is_delete = 0 |
| | | AND a.PID = ${productId} |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="getList" resultType="com.zt.life.modules.taskReliability.model.ModelRbd"> |
| | | select a.*, |
| | | CASE |
| | | WHEN b.end =1 THEN '已报称' |
| | | WHEN b.end =1 THEN '已完成' |
| | | WHEN c.num >0 THEN '正在编辑' |
| | | ELSE '未编辑' END AS modelState |
| | | from model_rbd a |
| | |
| | | this.$nextTick(() => { |
| | | this.$refs.rbdEditImg.init(row) |
| | | }) |
| | | this.$refs.tableObj.query() |
| | | } |
| | | } |
| | | } |
| | |
| | | {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: { |