New file |
| | |
| | | package com.zt.life.modules.mainPart.TestScheme.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.mainPart.TestScheme.dto.ConditionDto; |
| | | import com.zt.life.modules.mainPart.TestScheme.dto.ResultDto; |
| | | import com.zt.life.modules.mainPart.TestScheme.model.TestScheme; |
| | | import com.zt.life.modules.mainPart.TestScheme.service.TestSchemeService; |
| | | 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; |
| | | |
| | | |
| | | /** |
| | | * test_scheme |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-08-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/TestScheme/TestScheme/") |
| | | @Api(tags="test_scheme") |
| | | public class TestSchemeController { |
| | | @Autowired |
| | | private TestSchemeService testSchemeService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @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), |
| | | }) |
| | | public PageResult<TestScheme> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(null); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<TestScheme> get(@PathVariable("id") Long id){ |
| | | TestScheme data = testSchemeService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @GetMapping("condition") |
| | | public Result<List<ResultDto>> getResult1(ConditionDto dto){ |
| | | List<ResultDto> data = testSchemeService.getResult(dto); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody TestScheme testScheme){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(testScheme, AddGroup.class, DefaultGroup.class); |
| | | testSchemeService.insert(testScheme); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody TestScheme testScheme){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(testScheme, UpdateGroup.class, DefaultGroup.class); |
| | | testSchemeService.update(testScheme); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | testSchemeService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.TestScheme.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.mainPart.TestScheme.model.TestScheme; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * test_scheme |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-08-07 |
| | | */ |
| | | @Mapper |
| | | public interface TestSchemeDao extends BaseDao<TestScheme> { |
| | | |
| | | List<TestScheme> getList(); |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.TestScheme.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ConditionDto { |
| | | |
| | | private String tjlx; |
| | | private Double specifiedValue; |
| | | private Double minAccepValue; |
| | | private Double productionRisk; |
| | | private Double userRisk; |
| | | private Integer showFailureTime; |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.TestScheme.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | |
| | | @Data |
| | | public class ResultDto { |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private int acceptNumber; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String totalTestTime; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String number; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String productionRiskReal; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private String userRiskReal; |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.TestScheme.model; |
| | | |
| | | 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; |
| | | |
| | | /** |
| | | * test_scheme |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-08-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("test_scheme") |
| | | public class TestScheme extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Integer pc; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Double pa; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Double value; |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.TestScheme.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.mainPart.TestScheme.dao.TestSchemeDao; |
| | | import com.zt.life.modules.mainPart.TestScheme.dto.ConditionDto; |
| | | import com.zt.life.modules.mainPart.TestScheme.dto.ResultDto; |
| | | import com.zt.life.modules.mainPart.TestScheme.model.TestScheme; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Formatter; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * test_scheme |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-08-07 |
| | | */ |
| | | @Service |
| | | public class TestSchemeService extends BaseService<TestSchemeDao, TestScheme> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | /* public List<TestScheme> page(QueryFilter queryFilter) { |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | } |
| | | */ |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | public List<ResultDto> getResult(ConditionDto dto) { |
| | | List<ResultDto> result = new ArrayList<>(); |
| | | List<TestScheme> list = baseDao.getList(); |
| | | if (dto.getTjlx().equals("条件1")) { |
| | | result = this.getCondition1(dto, list); |
| | | } else if (dto.getTjlx().equals("条件2")) { |
| | | result = this.getCondition2(dto, list); |
| | | } else if (dto.getTjlx().equals("条件3")) { |
| | | result = this.getCondition3(dto, list); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private List<ResultDto> getCondition1(ConditionDto dto, List<TestScheme> list) { |
| | | List<ResultDto> result = new ArrayList<>(); |
| | | int C = 0; |
| | | double oldvalue = 0; |
| | | for (int i = 1; i <= 10; i++) { |
| | | Integer finalI = i; |
| | | TestScheme data1 = list.stream().filter(k -> k.getPa().equals(dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).findFirst().get();// |
| | | TestScheme data2 = list.stream().filter(k -> k.getPa().equals(1 - dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).findFirst().get();// |
| | | if (data1 != null && data2 != null) { |
| | | Double value = data2.getValue() / data1.getValue(); |
| | | double strate = dto.getMinAccepValue() / dto.getSpecifiedValue(); |
| | | |
| | | if (value >= strate) { |
| | | C = i; |
| | | if (strate - oldvalue < value - strate) |
| | | C = i - 1; |
| | | break; |
| | | } |
| | | oldvalue = value; |
| | | } |
| | | } |
| | | |
| | | double T = 0; //总试验时间 |
| | | double TST1 = 0; //T/θ1 |
| | | double TST0 = 0; //T/θ0 |
| | | Integer finalC = C; |
| | | TestScheme data3 = list.stream().filter(k -> k.getPa().equals(1 - dto.getUserRisk()) && k.getPc() == (2 * finalC + 2)).findFirst().get();// |
| | | if (data3 != null) { |
| | | TST1 = data3.getValue() / 2; //T/θ1 |
| | | //TST1 = Convert.ToDouble(TST1.ToString("G2")); //取两位有效数字 |
| | | if (TST1 < 10) TST1 = TST1 + 0.1; |
| | | T = TST1 * dto.getMinAccepValue(); //总试验时间 |
| | | TST0 = T / dto.getSpecifiedValue(); //T/θ0 TST1 * minAccepValue / specifiedValue |
| | | } |
| | | |
| | | double productionRisk = 0; //生产方风险实际值 |
| | | double userRisk = 0; //使用方风险实际值 |
| | | double e = 2.71828182845904523536; //自然数e |
| | | |
| | | for (int r = 0; r <= C; r++) { |
| | | productionRisk = productionRisk + Math.pow(TST0, r) * Math.pow(e, -TST0) / getjc(r); |
| | | userRisk = userRisk + Math.pow(TST1, r) * Math.pow(e, -TST1) / getjc(r); |
| | | } |
| | | ResultDto resultDto = new ResultDto(); |
| | | productionRisk = 1 - productionRisk; |
| | | resultDto.setAcceptNumber(C); |
| | | resultDto.setTotalTestTime(String.valueOf(Math.round(T))); |
| | | resultDto.setProductionRiskReal(new Formatter().format("%.2f", productionRisk * 100).toString()); |
| | | resultDto.setUserRiskReal(new Formatter().format("%.2f", userRisk * 100).toString()); |
| | | result.add(resultDto); |
| | | return result; |
| | | } |
| | | |
| | | public List<ResultDto> getCondition2(ConditionDto dto, List<TestScheme> list) { |
| | | List<ResultDto> result = new ArrayList<>(); |
| | | for (Integer i = 0; i < dto.getShowFailureTime(); i++) { |
| | | Integer finalI = i; |
| | | List<TestScheme> data = list.stream().filter(k -> k.getPa().equals(dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).collect(Collectors.toList());// |
| | | ResultDto resultDto = new ResultDto(); |
| | | double T = 0; |
| | | double TST1 = 0; // T/θ1 |
| | | double TST0 = 0;// T/θ0 |
| | | for (TestScheme item : data) { |
| | | TST1 = item.getValue() / 2; |
| | | T = TST1 * dto.getMinAccepValue(); |
| | | TST0 = T / dto.getSpecifiedValue(); // T/θ0 |
| | | } |
| | | double productionRisk = 0; |
| | | double userRisk = 0; |
| | | double e = 2.71828182845904523536; |
| | | for (int r = 0; r <= i; r++) { |
| | | productionRisk = productionRisk + Math.pow(TST0, r) * Math.pow(e, -TST0) / getjc(r); |
| | | userRisk = userRisk + Math.pow(TST1, r) * Math.pow(e, -TST1) / getjc(r); |
| | | } |
| | | productionRisk = 1 - productionRisk; |
| | | |
| | | resultDto.setAcceptNumber(i + 1); |
| | | resultDto.setTotalTestTime(String.valueOf(Math.round(T))); |
| | | resultDto.setProductionRiskReal(new Formatter().format("%.2f", productionRisk * 100).toString()); |
| | | resultDto.setUserRiskReal(new Formatter().format("%.2f", userRisk * 100).toString()); |
| | | result.add(resultDto); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private List<ResultDto> getCondition3(ConditionDto dto, List<TestScheme> list) { |
| | | List<ResultDto> result = new ArrayList<>(); |
| | | for (int i = 0; i <= dto.getShowFailureTime(); i++) { |
| | | Integer finalI = i; |
| | | List<TestScheme> data = list.stream().filter(k -> k.getPa().equals(dto.getUserRisk()) && k.getPc() == (2 * finalI + 2)).collect(Collectors.toList());// |
| | | List<TestScheme> data2 = list.stream().filter(k -> k.getPa().equals(1 - dto.getProductionRisk()) && k.getPc() == (2 * finalI + 2)).collect(Collectors.toList());// |
| | | double T = 0; |
| | | double TST1 = 0; // T/θ1 |
| | | double TST0 = 0;// T/θ0 |
| | | double ST0 = 0; // θ0 |
| | | for (TestScheme item : data) { |
| | | TST1 = item.getValue() / 2; |
| | | T = TST1 * dto.getMinAccepValue(); |
| | | for (TestScheme item2 : data2) { |
| | | ST0 = item.getValue() * dto.getMinAccepValue() / item2.getValue(); |
| | | } |
| | | TST0 = T / ST0; |
| | | } |
| | | |
| | | double productionRisk = 0; |
| | | double userRisk = 0; |
| | | double e = 2.71828182845904523536; |
| | | for (int r = 0; r <= i; r++) { |
| | | productionRisk = productionRisk + Math.pow(TST0, r) * Math.pow(e, -TST0) / getjc(r); |
| | | userRisk = userRisk + Math.pow(TST1, r) * Math.pow(e, -TST1) / getjc(r); |
| | | } |
| | | ResultDto resultDto = new ResultDto(); |
| | | resultDto.setAcceptNumber(i); |
| | | resultDto.setTotalTestTime(String.valueOf(Math.round(T))); |
| | | resultDto.setNumber(String.valueOf(Math.round(ST0))); |
| | | resultDto.setProductionRiskReal(new Formatter().format("%.2f", productionRisk * 100).toString()); |
| | | resultDto.setUserRiskReal(new Formatter().format("%.2f", userRisk * 100).toString()); |
| | | result.add(resultDto); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | //计算阶乘 |
| | | int getjc(int a) { |
| | | int result = 1; |
| | | for (int i = a; i > 0; i--) |
| | | result = result * i; |
| | | return result; |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private ModelRbdNodeService modelRbdNodeService; |
| | | |
| | | @Autowired |
| | | private PythonLib pythonLib; |
| | | |
| | | /* |
| | | @GetMapping("callPythonCalc") |
| | | @ApiOperation("信息") |
| | | public Result callPythonCalc() { |
| | | Result result = pythonLib.callPython(); |
| | | |
| | | return result; |
| | | } |
| | | */ |
| | | |
| | | /* |
| | | @GetMapping("getPythonCalcResult") |
| | | @ApiOperation("信息") |
| | | public Result<String> getPythonCalcResult() { |
| | | String result = pythonLib.getPythonCalcResult(); |
| | | |
| | | return Result.ok(result); |
| | | } |
| | | */ |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @PostMapping("getResultXML") |
| | | public Result<SimulaDataDto> getResultXML(@RequestBody SimulatAssess simulatAssess) { |
| | | simulatAssessService.deleteSimInfoInRedis(simulatAssess.getId()); |
| | | if (simulatAssess.getDataType().equals("fz")) { |
| | | Integer num = simulatAssessService.getNumById(simulatAssess.getProductId(), simulatAssess.getTaskModelId()); |
| | | simulatAssess.setName("仿真记录" + (num + 1)); |
| | |
| | | String key = taskId.toString() + simulatAssessService.RELIA_SIM_TASK_TYPE_PROGRESS; |
| | | String progress = (String) redisTemplate.opsForValue().get(key); |
| | | if (progress == null) progress = "0"; |
| | | if(Objects.equals(progress, "100")){ |
| | | simulatAssessService.deleteSimInfoInRedis(taskId); |
| | | } |
| | | return Result.ok(progress); |
| | | } |
| | | |
New file |
| | |
| | | <?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.TestScheme.dao.TestSchemeDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.TestScheme.model.TestScheme"> |
| | | select a.* |
| | | from test_scheme a |
| | | where a.is_delete = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | }, |
| | | |
| | | onStrokeChange(e) { |
| | | console.log(e,'eee') |
| | | const val = e |
| | | this.globalGridAttr.stroke = val |
| | | this.curCell.attr('line/stroke', val) |
New file |
| | |
| | | <template> |
| | | <div> |
| | | <el-table ref="table" :data="tjDataList" height="230px"> |
| | | <el-table-column align="center" prop="tjlx" width="100" label="条件类型"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="specifiedValue" label="已知规定值"> |
| | | <template v-slot="{ row }"> |
| | | <el-input v-model="row.specifiedValue" style="width:100%" :disabled="row.tjlx==='条件3'"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="minAccepValue" label="最低可接受值"> |
| | | <template v-slot="{ row }"> |
| | | <el-input v-model="row.minAccepValue" style="width:100%"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="productionRisk" label="生产方风险"> |
| | | <template v-slot="{ row }"> |
| | | <el-select style="width: 100%" :value-key="key" v-model="row.productionRisk" |
| | | @change="onChange()" :disabled="row.tjlx==='条件2'"> |
| | | <el-option v-for="item in riskList" :key="item.value" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="userRisk" label="使用方风险"> |
| | | <template v-slot="{ row }"> |
| | | <el-select style="width: 100%" :value-key="key" v-model="row.userRisk" |
| | | @change="onChange()"> |
| | | <el-option v-for="item in riskList" :key="item.value" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="showFailureTime" label="故障接受值最大显示"> |
| | | <template v-slot="{ row }"> |
| | | <el-input v-model="row.showFailureTime" style="width:100%" :disabled="row.tjlx==='条件1'"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" width="100" label="操作"> |
| | | <template v-slot="{ row }"> |
| | | <el-button type="primary" @click="check(row)">查询</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-table ref="tableObj" height="570px" :data="dataList"> |
| | | <el-table-column align="center" prop="acceptNumber" label="故障接受值"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="totalTestTime" label="总试验时间(h)"> |
| | | </el-table-column> |
| | | <el-table-column v-if="isShow" align="center" prop="number" label="规定值"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="productionRiskReal" label="生产方风险实际值(%)"> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="userRiskReal" label="使用方风险实际值(%)"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddOrUpdate from './Task-AddOrUpdate' |
| | | import TaskBinoParam from "./TaskBinoParam"; |
| | | import TaskRepairParam from "./TaskRepairParam"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | dataList: [], |
| | | isShow: false, |
| | | tjDataList: [{ |
| | | tjlx: '条件1', |
| | | specifiedValue: null, |
| | | minAccepValue: null, |
| | | productionRisk: null, |
| | | userRisk: null, |
| | | showFailureTime: null |
| | | }, |
| | | { |
| | | tjlx: '条件2', |
| | | specifiedValue: null, |
| | | minAccepValue: null, |
| | | productionRisk: null, |
| | | userRisk: null, |
| | | showFailureTime: null |
| | | }, |
| | | { |
| | | tjlx: '条件3', |
| | | specifiedValue: null, |
| | | minAccepValue: null, |
| | | productionRisk: null, |
| | | userRisk: null, |
| | | showFailureTime: null |
| | | } |
| | | ], |
| | | riskList: [ |
| | | { |
| | | value: 0.1, |
| | | label: '10%' |
| | | }, { |
| | | value: 0.2, |
| | | label: '20%' |
| | | }, { |
| | | value: 0.3, |
| | | label: '30%' |
| | | }, { |
| | | value: 0.4, |
| | | label: '40%' |
| | | }, { |
| | | value: 0.5, |
| | | label: '50%' |
| | | }, { |
| | | value: 0.6, |
| | | label: '60%' |
| | | }, { |
| | | value: 0.7, |
| | | label: '70%' |
| | | }, { |
| | | value: 0.8, |
| | | label: '80%' |
| | | }, { |
| | | value: 0.9, |
| | | label: '90%' |
| | | } |
| | | ], |
| | | |
| | | } |
| | | }, |
| | | components: {}, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | async check(row) { |
| | | let flag = true; |
| | | if (row.specifiedValue < row.minAccepValue && row.specifiedValue) { |
| | | this.$tip.alert("最低可接受值不能大于规定值") |
| | | flag =false |
| | | } |
| | | if (row.tjlx === "条件1"){ |
| | | if (!row.specifiedValue ||!row.minAccepValue || !row.productionRisk||!userRisk) { |
| | | this.$tip.alert("有未填写的值") |
| | | flag =false |
| | | } |
| | | } |
| | | if (row.tjlx === "条件2"){ |
| | | if (!row.specifiedValue ||!row.minAccepValue || !row.showFailureTime||!row.userRisk) { |
| | | this.$tip.alert("有未填写的值") |
| | | flag =false |
| | | } |
| | | } |
| | | if (row.tjlx === "条件3"){ |
| | | if (!row.showFailureTime ||!row.minAccepValue || !row.productionRisk||!userRisk) { |
| | | this.$tip.alert("有未填写的值") |
| | | flag =false |
| | | } |
| | | } |
| | | if (!flag){ |
| | | return |
| | | } |
| | | let res = await this.$http.get(`/TestScheme/TestScheme/condition`, {params: row}) |
| | | this.dataList = res.data |
| | | if (row.tjlx === "条件3") { |
| | | this.isShow = true |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .el-table .select-row { |
| | | background: rgba(23, 179, 163, 0.2) !important; |
| | | } |
| | | </style> |
| | |
| | | <div style="height: 80vh"> |
| | | <div class="fa-card-a"> |
| | | <div id="stencil"></div> |
| | | |
| | | <div style="height: 42vh;margin-top: 30px;background: #f5f5f5;padding-bottom:20px "> |
| | | <h3 style="background: #ededed;font-size: 12px;height: 32px;line-height: 32px;padding: 0 5px 0 8px"> |
| | | 对齐方式</h3> |
| | | <div style="text-align: center"> |
| | | <el-tooltip class="item" effect="dark" content="左对齐" placement="left"> |
| | | <el-button class="" style="margin-left: 0;padding: 2px;border: 1px solid #5F95FF;" |
| | | @click="leftAlign()"><i style="font-size: 2rem;color: #5F95FF" |
| | | class="wt-iconfont icon-zuoduiqi"></i></el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | <div style="text-align: center"> |
| | | <el-tooltip class="item" effect="dark" content="居中对齐" placement="left"> |
| | | <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF" |
| | | @click="centerAlign()"><i style="font-size: 2rem;color: #5F95FF" |
| | | class="wt-iconfont icon-chuizhiduiqi"></i></el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | <div style="text-align: center"> |
| | | <el-tooltip class="item" effect="dark" content="右对齐" placement="left"> |
| | | <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF" |
| | | @click="rightAlign()"><i style="font-size: 2rem;color: #5F95FF" |
| | | class="wt-iconfont icon-youduiqi"></i></el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | <div style="text-align: center"> |
| | | <el-tooltip class="item" effect="dark" content="顶部对齐" placement="left"> |
| | | <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF" |
| | | @click="topAlign()"><i style="font-size: 2rem;color:#5F95FF" |
| | | class="wt-iconfont icon-dingduiqi"></i></el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | <div style="text-align: center"> |
| | | <el-tooltip class="item" effect="dark" content="水平对齐" placement="left"> |
| | | <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF" |
| | | @click="shuipingAlign()"><i style="font-size: 2rem;color:#5F95FF" |
| | | class="wt-iconfont icon-shuipingduiqi"></i></el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | <div style="text-align: center"> |
| | | <el-tooltip class="item" effect="dark" content="底部对齐" placement="left"> |
| | | <el-button style="margin-left: 0;margin-top: 10px;padding: 2px;border: 1px solid #5F95FF" |
| | | @click="bottomAlign()"><i style="font-size: 2rem;color:#5F95FF" |
| | | class="wt-iconfont icon-diduiqi"></i></el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | |
| | | }, |
| | | watch: { |
| | | '$route.params.configId'() { |
| | | // alert('$route.params.projectId change') |
| | | this.projectId = this.$route.params.projectId |
| | | //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) |
| | |
| | | }, |
| | | true, |
| | | ) |
| | | // 一级网络图的日期文字节点 |
| | | const r5 = this.graph.createNode({ |
| | | shape: 'custom-circle', |
| | | data: { |
| | | dataId: '', |
| | | finishDate: '', |
| | | inspectName: '' |
| | | }, |
| | | label: '阶段', |
| | | }) |
| | | // 二级网络图日期节点 |
| | | const r6 = this.graph.createNode({ |
| | | shape: 'custom-circle1', |
| | | data: { |
| | | dataId: '', |
| | | finishDate: '', |
| | | inspectName: '' |
| | | }, |
| | | }) |
| | | // 二级网络图文字节点 |
| | | const r9 = this.graph.createNode({ |
| | | shape: 'custom-rect' |
| | | }) |
| | | |
| | | const scaleImgCenter = this.graph.createNode({ |
| | | shape: 'image', |
| | | imageUrl: require('@/assets/img/scale/center.jpg'), |
| | | width: 36, |
| | | height: 20, |
| | | data: { |
| | | imagePost: 'center' |
| | | } |
| | | }) |
| | | |
| | | const scaleImgTop = this.graph.createNode({ |
| | | shape: 'image', |
| | | imageUrl: require('@/assets/img/scale/top.jpg'), |
| | | width: 36, |
| | | height: 20, |
| | | data: { |
| | | imagePost: 'top' |
| | | } |
| | | }) |
| | | |
| | | const scaleImgRight = this.graph.createNode({ |
| | | shape: 'image', |
| | | imageUrl: require('@/assets/img/scale/right.jpg'), |
| | | width: 36, |
| | | height: 20, |
| | | data: { |
| | | imagePost: 'right' |
| | | } |
| | | }) |
| | | const scaleImgBottom = this.graph.createNode({ |
| | | shape: 'image', |
| | | imageUrl: require('@/assets/img/scale/bottom.jpg'), |
| | | width: 36, |
| | | height: 20, |
| | | data: { |
| | | imagePost: 'bottom' |
| | | } |
| | | }) |
| | | const scaleImgLeft = this.graph.createNode({ |
| | | shape: 'image', |
| | | imageUrl: require('@/assets/img/scale/left.jpg'), |
| | | width: 36, |
| | | height: 20, |
| | | data: { |
| | | imagePost: 'left' |
| | | } |
| | | }) |
| | | |
| | | // scaleImgTop.setAttribute('crossOrigin', 'Anonymous') |
| | | stencil.load([r5, r6, r9, scaleImgTop, scaleImgCenter, scaleImgRight, scaleImgBottom, scaleImgLeft], 'group1') |
| | | stencil.load([r9], 'group1') |
| | | this.graph.bindKey(['meta+c', 'ctrl+c'], () => { |
| | | const cells = this.graph.getSelectedCells() |
| | | if (cells.length) { |
| | |
| | | }) |
| | | //单击边节点 |
| | | this.graph.on('edge:click', ({edge}) => { |
| | | // this.reset() |
| | | edge.attr('line/stroke', '#5F95FF') |
| | | edge.prop('labels/0', { |
| | | attrs: { |
| | | body: { |
| | | stroke: '#5F95FF', |
| | | }, |
| | | }, |
| | | |
| | | }) |
| | | }) |
| | | // 单击node节点 |
| | | this.graph.on('node:click', ({node}) => { |