9个文件已修改
2 文件已重命名
7个文件已添加
8个文件已删除
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.controller; |
| | | |
| | | |
| | | import com.zt.common.annotation.LogOperation; |
| | | import com.zt.common.constant.Constant; |
| | | import com.zt.common.annotation.QueryParam; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.common.validator.AssertUtils; |
| | | import com.zt.common.validator.ValidatorUtils; |
| | | 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.ParamData; |
| | | import com.zt.life.modules.mainPart.basicInfo.service.ParamDataService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basicInfo/ParamData/") |
| | | public class ParamDataController { |
| | | @Autowired |
| | | private ParamDataService paramDataService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "pageCode", value = "", dataType = Constant.QT.STRING)}) |
| | | public Result<List<ParamData>> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { |
| | | |
| | | return Result.ok(paramDataService.page(queryFilter)); |
| | | } |
| | | |
| | | @PostMapping("get") |
| | | public Result getSelect(@RequestBody List<ParamData> list) { |
| | | for (ParamData ParamData : list) { |
| | | ParamData.setProductId(ParamData.getId()); |
| | | ParamData.setId(null); |
| | | paramDataService.insert(ParamData); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<ParamData> get(@PathVariable("id") Long id) { |
| | | ParamData data = paramDataService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping("save") |
| | | public Result save(@RequestBody ParamData paramData) { |
| | | //效验数据 |
| | | for (ParamData expect : paramData.getDataThreeList()) { |
| | | if (expect.getId()!=null){ |
| | | paramDataService.update(expect); |
| | | }else{ |
| | | expect.setPageCode(paramData.getPageCode()); |
| | | paramDataService.insert(expect); |
| | | } |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids) { |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | paramDataService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamData; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * param_data |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @Mapper |
| | | public interface ParamDataDao extends BaseDao<ParamData> { |
| | | |
| | | List<ParamData> getList(Map<String, Object> params); |
| | | |
| | | } |
File was renamed from modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamDataExpect.java |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("param_data_expect") |
| | | public class ParamDataExpect extends BusiEntity { |
| | | @TableName("param_data") |
| | | public class ParamData extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "源ID") |
| | |
| | | @TableField(exist = false) |
| | | private Long productIdInit; |
| | | |
| | | private String pageCode; |
| | | |
| | | @TableField(exist = false) |
| | | private List<ParamDataExpect> dataThreeList; |
| | | private List<ParamData> dataThreeList; |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.basicInfo.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.mainPart.basicInfo.dao.ParamDataDao; |
| | | import com.zt.life.modules.mainPart.basicInfo.model.ParamData; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @Service |
| | | public class ParamDataService extends BaseService<ParamDataDao, ParamData> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<ParamData> page(QueryFilter queryFilter) { |
| | | List<ParamData> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | for (ParamData expect :list){ |
| | | expect.setProductId(expect.getProductIdInit()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiOperation("解析") |
| | | @LogOperation("解析") |
| | | public Result analyze(@RequestBody ModelRbd modelRbd){ |
| | | modelLineService.update(modelRbd); |
| | | boolean result = modelLineService.analyze(modelRbd); |
| | | return result ? Result.ok() : Result.error("解析失败"); |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.taskReliability.controller; |
| | | |
| | | |
| | | import com.zt.common.annotation.LogOperation; |
| | | import com.zt.common.constant.Constant; |
| | | import com.zt.common.annotation.QueryParam; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.common.servlet.PageResult; |
| | | import com.zt.common.validator.AssertUtils; |
| | | import com.zt.common.validator.ValidatorUtils; |
| | | 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.taskReliability.model.ModelRbd; |
| | | import com.zt.life.modules.taskReliability.service.ModelRbdService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * model_rbd |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-10 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/taskReliability/ModelRbd/") |
| | | @Api(tags="model_rbd") |
| | | public class ModelRbdController { |
| | | @Autowired |
| | | private ModelRbdService modelRbdService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "productId", value = "节点ID", dataType = Constant.QT.STRING), |
| | | }) |
| | | public Result<List<ModelRbd>> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return Result.ok(modelRbdService.page(queryFilter)); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<ModelRbd> get(@PathVariable("id") Long id){ |
| | | ModelRbd data = modelRbdService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ModelRbd modelRbd){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(modelRbd, AddGroup.class, DefaultGroup.class); |
| | | modelRbdService.insert(modelRbd); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody ModelRbd modelRbd){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(modelRbd, UpdateGroup.class, DefaultGroup.class); |
| | | modelRbdService.update(modelRbd); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | modelRbdService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zt.life.modules.taskReliability.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.taskReliability.model.ModelNode; |
| | | import com.zt.life.modules.taskReliability.model.ModelRbd; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * model_line |
| | | * model_rbd |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | | * @since 1.0.0 2024-03-10 |
| | | */ |
| | | @Mapper |
| | | public interface ModelRbdDao extends BaseDao<ModelRbd> { |
| | | |
| | | List<ModelRbd> getList(Map<String, Object> params); |
| | | ModelRbd getDiagram(Long modelId); |
| | | void deleteByModelId(Long modelId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * model_line |
| | | * model_rbd |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-02-28 |
| | | * @since 1.0.0 2024-03-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Long pid; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Long modelId; |
| | | |
| | | @ApiModelProperty(value = "模型名称") |
| | | private String modelName; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | // 删除既有数据 |
| | | modelRbdDao.deleteByModelId(modelId); |
| | | |
| | | // 插入数据 |
| | | modelRbd.setId(UUIDUtil.generateId()); |
| | | modelRbdDao.insert(modelRbd); |
| | | } |
| | | |
| | |
| | | public boolean analyze(ModelRbd modelRbd) { |
| | | boolean result = true; |
| | | if (modelRbd==null) return result; |
| | | if (modelRbd.getModelId()==null) return result; |
| | | Long modelId = modelRbd.getModelId(); |
| | | |
| | | // 检查图的合理性并化简 |
| | | // checkRbd(modelRbd); |
| | | |
| | | // analyzeRbdAndSave(modelId, modelRbd.getContent(), true); |
| | | Long modelId = modelRbd.getId(); |
| | | result = analyzeRbd(modelId, modelRbd.getContent(), true); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public void checkRbd(ModelRbd modelRbd) { |
| | | if (modelRbd==null) return; |
| | | if (modelRbd.getModelId()==null) return; |
| | | Long modelId = modelRbd.getModelId(); |
| | | } |
| | | |
| | | private boolean analyzeRbd(Long modelId, String content, boolean saveFlag) { |
New file |
| | |
| | | package com.zt.life.modules.taskReliability.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.taskReliability.dao.ModelRbdDao; |
| | | import com.zt.life.modules.taskReliability.model.ModelRbd; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * model_rbd |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-10 |
| | | */ |
| | | @Service |
| | | public class ModelRbdService extends BaseService<ModelRbdDao, ModelRbd> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<ModelRbd> page(QueryFilter queryFilter) { |
| | | |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | } |
File was renamed from modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataAssignDao.xml |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.zt.life.modules.mainPart.basicInfo.dao.ParamDataAssignDao"> |
| | | <mapper namespace="com.zt.life.modules.mainPart.basicInfo.dao.ParamDataDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamDataAssign"> |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamData"> |
| | | SELECT |
| | | a.NAME, |
| | | b.*, |
| | |
| | | END AS productIdInit |
| | | FROM |
| | | product_model a |
| | | LEFT JOIN param_data_assign b ON b.product_id = a.id |
| | | LEFT JOIN param_data b ON b.product_id = a.id and b.page_code = '${pageCode}' |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="srcId!=null"> |
| | |
| | | |
| | | <mapper namespace="com.zt.life.modules.taskReliability.dao.ModelRbdDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.taskReliability.model.ModelRbd"> |
| | | select a.* |
| | | from model_rbd a |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="productId!=null and productId!=''"> |
| | | and a.product_id =${productId} |
| | | </if> |
| | | <if test="whereSql!=null"> |
| | | and ${whereSql} |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | </select> |
| | | <select id="getDiagram" resultType="com.zt.life.modules.taskReliability.model.ModelRbd"> |
| | | select a.* |
| | | from model_rbd a |
| | | <where> |
| | | a.is_delete = 0 |
| | | and a.model_id=#{modelId} |
| | | and a.id=#{modelId} |
| | | </where> |
| | | limit 1 |
| | | </select> |
| | | |
| | | <update id="deleteByModelId"> |
| | | delete from model_rbd where model_id=#{modelId} |
| | | delete |
| | | from model_rbd |
| | | where model_id = #{modelId} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | export default { |
| | | name: 'ZtTableWraper', |
| | | props: { |
| | | defaultNotQuery:{ |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | queryUrl: String, // 数据列表接口,API地址 |
| | | deleteUrl: String, // 删除接口,API地址, |
| | | exportUrl: String, // 导出接口,API地址 |
| | |
| | | } |
| | | } |
| | | |
| | | if (!this.lazy) { |
| | | if (!this.lazy && !this.defaultNotQuery) { |
| | | this._query() |
| | | } |
| | | }, |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <div class="mod-basicInfo-paramDataExpect}"> |
| | | <div class="mod-basicInfo-paramData}"> |
| | | <zt-table-wraper ref="tableObj" :query-url=queryUrl |
| | | :delete-url=deleteUrl |
| | | @dataLoaded="dataLoaded" |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | queryUrl: '/basicInfo/ParamDataExpect/page', |
| | | deleteUrl: '/basicInfo/ParamDataExpect', |
| | | queryUrl: '/basicInfo/ParamData/page', |
| | | deleteUrl: '/basicInfo/ParamData', |
| | | pageCode: '', |
| | | key: '', |
| | | typeS: '', |
| | |
| | | mounted() { |
| | | this.pageCode = this.$route.query.pageCode |
| | | this.dataForm.pageCode = this.$route.query.pageCode |
| | | if (this.pageCode === 'assign') { |
| | | this.queryUrl = '/basicInfo/ParamDataAssign/page' |
| | | this.deleteUrl = '/basicInfo/ParamDataAssign' |
| | | } |
| | | console.log(this.pageCode, 'this.pageCode this.pageCode') |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null, { |
| | | type: this.dataForm.nodeType - 1, |
| | | id: this.dataForm.id, |
| | | id: this.dataForm.srcId, |
| | | pageCode: this.pageCode |
| | | }) |
| | | console.log(this.dataForm.srcId, 'add') |
| | | }, |
| | | //批量保存 |
| | | async handleSaveRows() { |
| | | this.dataForm.dataThreeList = this.$refs.tableObj.dataList |
| | | console.log(this.dataForm, 'this.dataForm this.dataForm') |
| | | let res |
| | | if (this.pageCode === 'Expect') { |
| | | res = await this.$http.post('/basicInfo/ParamDataExpect/save', this.dataForm) |
| | | } else { |
| | | res = await this.$http.post('/basicInfo/ParamDataAssign/save', this.dataForm) |
| | | } |
| | | let res = await this.$http.post('/basicInfo/ParamData/save', this.dataForm) |
| | | if (res.success) { |
| | | console.log(res.data) |
| | | await this.$tip.success() |
| | |
| | | name: 'SelectTyModel', |
| | | data() { |
| | | return { |
| | | url:'/basicInfo/TyProductModel/page', |
| | | url: '/basicInfo/XhProductModel/page', |
| | | selectList: [], |
| | | data: '', |
| | | pageCode:'', |
| | | dataForm: { |
| | | type: 'noTree', |
| | | nodeType: '', |
| | |
| | | this.dataForm.nodeType = params.type |
| | | this.dataForm.pid = params.id |
| | | this.pageCode = params.pageCode |
| | | if (this.pageCode ==='expect'||this.pageCode==='assign'){ |
| | | this.url='/basicInfo/XhProductModel/page' |
| | | if (!this.pageCode) { |
| | | this.url = '/basicInfo/TyProductModel/page' |
| | | } |
| | | console.log(this.dataForm.pid, 'init()') |
| | | console.log(params, 'init()') |
| | | }, |
| | | changeRow(selection) { |
| | | console.log(selection, ' changeRow(selection)') |
| | |
| | | item.pid = this.dataForm.pid |
| | | } |
| | | this.selectList = selection |
| | | this.selectList.forEach( item => { |
| | | item.pageCode = this.pageCode |
| | | }) |
| | | }, |
| | | async formSubmit() { |
| | | let res |
| | | if (this.pageCode && this.pageCode === 'expect'){ |
| | | res = await this.$http.post('/basicInfo/ParamDataExpect/get', this.selectList) |
| | | }else if(this.pageCode && this.pageCode === 'assign') { |
| | | res = await this.$http.post('/basicInfo/ParamDataAssign/get', this.selectList) |
| | | }else |
| | | { |
| | | if (this.pageCode) { |
| | | if (this.pageCode === 'expect' || this.pageCode === 'assign') { |
| | | res = await this.$http.post('/basicInfo/ParamData/get', this.selectList) |
| | | } |
| | | } else { |
| | | res = await this.$http.post('/basicInfo/XhProductModel/get', this.selectList) |
| | | } |
| | | |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
New file |
| | |
| | | <template> |
| | | <zt-dialog ref="dialog" @confirm="formSubmit"> |
| | | <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> |
| | | <zt-form-item label="模型名称" prop="modelName" rules="required"> |
| | | <el-input v-model="dataForm.modelName"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="模型标识" prop="modelName"> |
| | | <el-input v-model="dataForm.modelSign"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="备注" prop="remark"> |
| | | <el-input v-model="dataForm.remark"></el-input> |
| | | </zt-form-item> |
| | | </el-form> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | id: '', |
| | | pid: '', |
| | | modelId: '', |
| | | modelName: '', |
| | | productId: '', |
| | | modelSign:'', |
| | | content: '', |
| | | remark: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | init(id, productId) { |
| | | this.dataForm.productId = productId |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let res = await this.$http.get(`/taskReliability/ModelRbd/${this.dataForm.id}`) |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/ModelRbd/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a"> |
| | | <product-model-tree @on-selected="onProductSelected"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <div class="mod-taskReliability-modelRbd}"> |
| | | <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/ModelRbd/page" delete-url="/taskReliability/ModelRbd" |
| | | :paging='false' |
| | | v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <zt-button type="query" @click="table.query()"/> |
| | | <zt-button type="add" @click="add()"/> |
| | | <zt-button type="delete" @click="table.deleteHandle()"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}" |
| | | border @selection-change="table.selectionChangeHandle"> |
| | | <el-table-column type="selection" width="40" align="center"/> |
| | | <el-table-column prop="modelName" label="模型名称"/> |
| | | <el-table-column prop="modelSign" label="模型标识"/> |
| | | <el-table-column prop="citedNum" label="被引用数"/> |
| | | <el-table-column prop="modelState" label="模型状态"/> |
| | | <el-table-column prop="modelDataState" label="模型数据状态"/> |
| | | <el-table-column prop="remark" label="备注"/> |
| | | <zt-table-column-handle :table="table" edit-perm="taskReliability:update" |
| | | delete-perm="taskReliability::delete" :has-view="false"> |
| | | <template v-slot="{ row }"> |
| | | <el-button type="primary" @click="drawRBD(row)">模型设计</el-button> |
| | | </template> |
| | | </zt-table-column-handle> |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update @refreshDataList="table.query" ref="AddOrUpdate"/> |
| | | <el-dialog v-dialogDrag title="模型设计" top="1vh" width='95%' :visible.sync="dialogVisible2"> |
| | | <RBDEditImg ref="rbdEditImg"></RBDEditImg> |
| | | </el-dialog> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddOrUpdate from './ModelRbd-AddOrUpdate' |
| | | import ProductModelTree from "../basicInfo/ProductModelTree"; |
| | | import RBDEditImg from './RBD-edit-img' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible2: false, |
| | | dataForm: { |
| | | modelName:'', |
| | | productId: '', |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | components: { |
| | | ProductModelTree, |
| | | AddOrUpdate, |
| | | RBDEditImg |
| | | }, |
| | | methods: { |
| | | add(){ |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null,this.dataForm.productId) |
| | | }, |
| | | onProductSelected(data) { |
| | | this.dataForm.productId = data.id |
| | | console.log(data, 'onProductSelected(data)') |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | drawRBD(row) { |
| | | this.dialogVisible2 = true |
| | | this.$nextTick(()=>{ |
| | | this.$refs.rbdEditImg.init(row) |
| | | }) |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <div class="fa-card-a"> |
| | | <el-form :inline="true"> |
| | | <el-form-item> |
| | | 模型ID |
| | | 模型名称:{{modelName}} |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input placeholder="搜索模型ID" v-model="dataForm.modelId" clearable class="input-with-select"> |
| | | <el-button slot="append" icon="el-icon-search" @click="search()"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button type="primary" @click="saveDiagram()">保存</el-button> |
| | | <el-button type="primary" @click="analyzeDiagram()">解析</el-button> |
| | | <el-button type="primary" @click="saveDiagram()">暂存</el-button> |
| | | <el-button type="primary" @click="analyzeDiagram()">保存</el-button> |
| | | <el-button type="primary" @click="clearDiagram()">清空图形</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | modelId: '', |
| | | modelName: '', |
| | | modelType:'', |
| | | timer: null, |
| | | imgsList:[ |
| | | {imgPath:'start',imgName:'start',nodeType:'start',imgWidth:60,imgHeight:60,imgId:'1',data:{}}, |
| | |
| | | diagramIdDisabled: false, |
| | | dataForm: { |
| | | id: null, |
| | | projectId: null, |
| | | diagramId: null, |
| | | content: null, |
| | | publishContent: null, |
| | | hasPublish: 0, |
| | | modelId: '1', |
| | | }, |
| | | flowInfo: { |
| | | bizId: '', |
| | | bizGroupId: '', |
| | | flowCode: '', |
| | | flowStepMark: '', |
| | | status: 0, |
| | | myStatus: 0 |
| | | }, |
| | | // emptyJson: { |
| | | // // 节点 |
| | |
| | | //this.diagramId = this.$route.params.diagramId |
| | | console.log(this.$route.params.projectId, 'this.$route.params.projectId') |
| | | console.log(this.$route.params.diagramId, 'this.$route.params.diagramId') |
| | | this.projectChange2(this.$route.params.diagramId) |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getProject() |
| | | this.init() |
| | | this.initDigram() |
| | | this.type = 'grid' |
| | | }, |
| | | methods: { |
| | | async finish() { |
| | | if (await this.$tip.confirm('确定要进行提交操纵吗?')) { |
| | | let submitForm = { |
| | | params: { |
| | | wfIdCode: 'wltFlow', |
| | | bizId: this.dataForm.projectId, |
| | | stepIdMark: this.pageCode |
| | | } |
| | | } |
| | | let res = await this.$http.get('/wf/approvePass', submitForm) |
| | | if (res.success) { |
| | | await this.$alert('提交成功', '友情提示') |
| | | removeCurrentTabHandle(this) |
| | | this.$EventBus.$emit('taskRefeshEvent', '网络图') |
| | | } |
| | | } |
| | | init(row){ |
| | | this.modelName = row.modelName |
| | | let modelId = row.id |
| | | this.dataForm.id = modelId |
| | | this.getDiagram(modelId) |
| | | }, |
| | | async getProject() { |
| | | //let res = await this.$http.get(`/maintain/projectNetworkDiagram/getProjectList`) |
| | | let res = await this.$http.get(`/homeFunction/projectSelect`) |
| | | |
| | | this.projectList = res.data |
| | | if (this.$store.state.user.isAdmin || this.$store.state.user.isAssistant) { |
| | | this.projectList.push({id: '10000', name: '样式模板'}) |
| | | } |
| | | if (this.$route.params.projectId) { |
| | | this.projectId = this.$route.params.projectId |
| | | this.diagramId = this.$route.params.diagramId |
| | | } else { |
| | | if (this.projectList.length > 0) { |
| | | this.projectId = this.projectList[0].id |
| | | this.diagramId = this.projectId |
| | | console.log(this.diagramId, '123456789') |
| | | } |
| | | } |
| | | await this.projectChange2(this.diagramId) |
| | | }, |
| | | |
| | | /* projectChange() { |
| | | // alert(555) |
| | | this.projectChange2(this.projectId) |
| | | }, |
| | | |
| | | async projectChange2(diagramId) { |
| | | // alert(1) |
| | | async getDiagram(modelId) { |
| | | let params = { |
| | | wfIdCodes: 'wltFlow', |
| | | bizId: this.projectId, |
| | | stepIdMark: 'wlt_pz' |
| | | } |
| | | this.$http.get(`/wf/getFlowStepStatus`, {params: params}).then(res => { |
| | | console.log(res, 'getFlowStepStatus res') |
| | | if (res.data) { |
| | | this.flowInfo = res.data |
| | | } |
| | | }) |
| | | |
| | | this.diagramName = '' |
| | | this.dataForm.projectId = this.projectId |
| | | this.dataForm.diagramId = diagramId |
| | | this.diagramId = diagramId |
| | | if (!this.$store.state.user.isZcRole && !this.$store.state.user.isAdmin) { |
| | | this.diagramIdDisabled = true |
| | | console.log(this.$store.state.user.deptId, 'this.$store.state.user.deptId') |
| | | this.diagramId = this.$store.state.user.deptId |
| | | this.dataForm.diagramId = this.diagramId |
| | | } else { |
| | | this.diagramIdDisabled = false |
| | | } |
| | | //this.getDiagramIdList(this.projectId) |
| | | let res = await this.$http.get(`/maintain/projectNetworkDiagram/getDiagramCjList?projectId=${this.projectId}`) |
| | | this.diagramList = res.data |
| | | console.log(this.diagramList, 'this.diagramId asdfgh') |
| | | if (this.diagramList.length > 0) { |
| | | this.diagramId = this.diagramList[0].diagramId |
| | | console.log(this.dataForm.diagramId, 'this.dataForm.diagramId.........................') |
| | | } |
| | | await this.getDiagram() |
| | | },*/ |
| | | |
| | | /* diagramIdChanges() { |
| | | this.dataForm.diagramId = this.diagramId |
| | | // this.diagramIdChange(this.diagramId) |
| | | this.getDiagram() |
| | | },*/ |
| | | async clearDiagram() { |
| | | this.dataForm.id = null |
| | | // this.graph.fromJSON(this.emptyJson) |
| | | this.graph.fromJSON('') |
| | | this.graph.centerContent() |
| | | this.graph.zoomToFit() |
| | | // this.graph.freeze() |
| | | }, |
| | | async getDiagram() { |
| | | let params = { |
| | | modelId : this.dataForm.modelId |
| | | modelId : modelId |
| | | } |
| | | let res = await this.$http.get(`/taskReliability/ModelLine/getDiagram`, {params: params}) |
| | | if (res.data !== null && res.data.content != null) { |
| | |
| | | await this.clearDiagram() |
| | | } |
| | | }, |
| | | init() { |
| | | async clearDiagram() { |
| | | this.dataForm.id = null |
| | | // this.graph.fromJSON(this.emptyJson) |
| | | this.graph.fromJSON('') |
| | | this.graph.centerContent() |
| | | this.graph.zoomToFit() |
| | | // this.graph.freeze() |
| | | }, |
| | | initDigram() { |
| | | this.timer = setHartBeat(10, 240); |
| | | |
| | | console.log(document.documentElement.clientWidth, 'document.documentElement.clientWidth') |
| | | console.log(document.documentElement.clientHeight, 'document.documentElement.clientHeight') |
| | | this.graph = new Graph({ |