| | |
| | | package com.zt.life.modules.mainPart.taskReliability.controller; |
| | | |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.XML; |
| | | import com.zt.common.annotation.LogOperation; |
| | |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.common.servlet.PageResult; |
| | | import com.zt.common.utils.JsonUtils; |
| | | import com.zt.common.validator.AssertUtils; |
| | | import com.zt.common.validator.ValidatorUtils; |
| | | import com.zt.common.validator.group.DefaultGroup; |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.mainPart.async.PythonLib; |
| | | import com.zt.life.modules.mainPart.taskReliability.dto.SimulaDataDto; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.CurveParam; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess; |
| | | import com.zt.life.modules.mainPart.taskReliability.model.Task; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.SimulatAssessService; |
| | | import com.zt.life.modules.mainPart.taskReliability.service.TaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private PythonLib pythonLib; |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | @Value("${data.reliaSimLib.resultHome}") |
| | | private String path; |
| | | |
| | | @Autowired |
| | | private SimulatAssessService simulatAssessService; |
| | | |
| | | @GetMapping("page") |
| | | private JSONObject xmlJSONObj; |
| | | |
| | | /* @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | |
| | | public PageResult<SimulatAssess> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { |
| | | |
| | | return PageResult.ok(simulatAssessService.page(queryFilter)); |
| | | } |
| | | }*/ |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<SimulatAssess> get(@PathVariable("id") Long id) { |
| | | SimulatAssess data = simulatAssessService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @GetMapping("getSimulatList") |
| | | @ApiOperation("信息") |
| | | public Result<List<SimulatAssess>> getSimulatList(Long productId,Long taskModelId) { |
| | | List<SimulatAssess> data = simulatAssessService.getList(productId,taskModelId); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping("getResultXML") |
| | | public Result getResultXML(Long taskId) { |
| | | String filePath = path + "/"+taskId+"/"+"result.xml"; |
| | | InputStream in = JsonUtils.class.getResourceAsStream(filePath); |
| | | @PostMapping("getResultXML") |
| | | public Result<SimulaDataDto> getResultXML(@RequestBody SimulatAssess simulatAssess) { |
| | | if (simulatAssess.getDataType().equals("fz")){ |
| | | Integer num = simulatAssessService.getNumById(simulatAssess.getProductId(),simulatAssess.getTaskModelId()); |
| | | simulatAssess.setName("仿真记录" + (num+1)); |
| | | simulatAssessService.insert(simulatAssess); |
| | | } |
| | | String filePath = path + "/" + simulatAssess.getId() + "/" + "result.xml"; |
| | | String xml = null; |
| | | try { |
| | | InputStream in = new FileInputStream(filePath); |
| | | xml = IOUtils.toString(in); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | JSONObject xmlJSONObj = XML.toJSONObject(xml); |
| | | xmlJSONObj = XML.toJSONObject(xml); |
| | | simulatAssess.setShowProductId(simulatAssess.getProductId()); |
| | | SimulaDataDto data = this.getResultData(simulatAssess); |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping("getResultData") |
| | | public Result<SimulaDataDto> getData(@RequestBody SimulatAssess simulatAssess) { |
| | | SimulaDataDto data = this.getResultData(simulatAssess); |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | return Result.ok(); |
| | | public SimulaDataDto getResultData(SimulatAssess simulatAssess) { |
| | | SimulaDataDto data = new SimulaDataDto(); |
| | | CurveParam param = new CurveParam(); |
| | | Double samplPeriod = simulatAssess.getSamplPeriod().doubleValue(); |
| | | Task task = taskService.get(simulatAssess.getTaskModelId()); |
| | | samplPeriod = samplPeriod / 60; |
| | | List<Double> xList = new ArrayList<>(); |
| | | for (Double i = 0.0; i + samplPeriod <= task.getTaskDuration(); i += samplPeriod) { |
| | | xList.add(i); |
| | | } |
| | | param.setXData(xList); |
| | | JSONArray jsonArray = xmlJSONObj.getJSONObject("ResultNodes").getJSONArray("ResultNode"); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | Long productId = null; |
| | | Object nameValue = jsonArray.getJSONObject(i).get("name"); |
| | | if (nameValue instanceof Long) { |
| | | productId = (Long) nameValue; |
| | | if (productId.equals(simulatAssess.getShowProductId())) { |
| | | JSONArray jsonArray2 = jsonArray.getJSONObject(i).getJSONArray("phase"); |
| | | List<Double> doubleArray = new ArrayList<>(); |
| | | String availability = null; |
| | | for (int j = 0; j < jsonArray2.size(); j++) { |
| | | if (availability != null) { |
| | | availability = availability + " " + jsonArray2.getJSONObject(j).get("availability"); |
| | | } else { |
| | | availability = (String) jsonArray2.getJSONObject(j).get("availability"); |
| | | } |
| | | } |
| | | String[] arr = availability.split(" "); |
| | | // 遍历子字符串数组,将每个元素转换为double并存储到double数组中 |
| | | for (int a = 0; a < arr.length; a++) { |
| | | doubleArray.add(Double.parseDouble(arr[a])); |
| | | } |
| | | param.setYData(doubleArray); |
| | | data.setMtbf((Double) jsonArray.getJSONObject(i).get("mttf")); |
| | | data.setMttr((Double) jsonArray.getJSONObject(i).get("mttr")); |
| | | } |
| | | data.setCurveParam(param); |
| | | } |
| | | } |
| | | |
| | | return data; |
| | | } |
| | | |
| | | @GetMapping("getCalcProgress") |
| | | public Result getCalcProgress(Long taskId) { |
| | | String key = taskId.toString() + taskTypeProgress; |
| | | String progress = (String)redisTemplate.opsForValue().get(key); |
| | | if (progress==null) progress = "0"; |
| | | String progress = (String) redisTemplate.opsForValue().get(key); |
| | | if (progress == null) progress = "0"; |
| | | return Result.ok(progress); |
| | | } |
| | | |
| | |
| | | @Mapper |
| | | public interface SimulatAssessDao extends BaseDao<SimulatAssess> { |
| | | |
| | | List<SimulatAssess> getList(Map<String, Object> params); |
| | | List<SimulatAssess> getList(Long productId, Long taskModelId); |
| | | |
| | | |
| | | Integer getNumById(Long productId, Long taskModelId); |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.dto; |
| | | |
| | | import com.zt.life.modules.mainPart.taskReliability.model.CurveParam; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SimulaDataDto { |
| | | private Double Mttr; |
| | | private Double Mtbf; |
| | | private Long productId; |
| | | private CurveParam curveParam; |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.mainPart.taskReliability.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * operat_condit |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | public class CurveParam extends BusiEntity { |
| | | @ApiModelProperty(value = "X坐标数据") |
| | | private List<Double> xData; |
| | | |
| | | @ApiModelProperty(value = "Y坐标数据") |
| | | private List<Double> yData; |
| | | |
| | | @ApiModelProperty(value = "X坐标间隔") |
| | | private Integer xInterval; |
| | | } |
| | |
| | | @ApiModelProperty(value = "总体任务模型ID") |
| | | private Long taskModelId; |
| | | |
| | | @ApiModelProperty(value = "数据类型") |
| | | private Integer dataType; |
| | | |
| | | @ApiModelProperty(value = "是否可修") |
| | | private Integer isRepair; |
| | | |
| | | @ApiModelProperty(value = "采样周期") |
| | | private Integer samplPeriod; |
| | | |
| | | @ApiModelProperty(value = "仿真次数") |
| | | private Integer simulatFrequency; |
| | | |
| | | @ApiModelProperty(value = "") |
| | | private Integer status; |
| | | @TableField(exist = false) |
| | | private Long showProductId; |
| | | |
| | | private String code; |
| | | |
| | | private String errorMsg; |
| | | private String curveData; |
| | | @TableField(exist = false) |
| | | private String dataType; |
| | | |
| | | @ApiModelProperty(value = "传给算法库的xml") |
| | | private String xml; |
| | | |
| | | private String name; |
| | | } |
| | |
| | | import com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<SimulatAssess> page(QueryFilter queryFilter) { |
| | | /* public List<SimulatAssess> page(QueryFilter queryFilter) { |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | public Integer getNumById(Long productId, Long taskModelId) { |
| | | return baseDao.getNumById(productId,taskModelId); |
| | | } |
| | | |
| | | public List<SimulatAssess> getList(Long productId, Long taskModelId) { |
| | | return baseDao.getList(productId,taskModelId); |
| | | } |
| | | } |
| | |
| | | <mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.SimulatAssessDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess"> |
| | | select a.* |
| | | from simulat_assess a |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="whereSql!=null"> |
| | | and ${whereSql} |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | select * |
| | | from simulat_assess |
| | | where product_id = ${productId} |
| | | and task_model_id = ${taskModelId} |
| | | and IS_DELETE = 0 |
| | | order by name desc |
| | | </select> |
| | | <select id="getNumById" resultType="java.lang.Integer"> |
| | | select COUNT(*) |
| | | from simulat_assess |
| | | where product_id = ${productId} |
| | | and task_model_id = ${taskModelId} |
| | | and IS_DELETE = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </zt-form-item> |
| | | <zt-form-item label="是否刷新" prop="isRefresh"> |
| | | <el-radio-group v-model="dataForm.isRefresh"> |
| | | <el-radio :label="0">是</el-radio> |
| | | <el-radio :label="1">否</el-radio> |
| | | </el-radio-group> |
| | | </zt-form-item> |
| | | <el-form-item prop="params" label="菜单参数"> |
| | | <el-input v-model="dataForm.params"></el-input> |
| | | </el-form-item> |
| | |
| | | prop="type"/> |
| | | <el-table-column :label="$t('menu.sort')" align="center" min-width="60" prop="sort"/> |
| | | <el-table-column align="center" label="显示" min-width="60" prop="showMenu"/> |
| | | <el-table-column align="center" label="不刷新" min-width="60" prop="isRefresh"/> |
| | | <el-table-column :label="$t('menu.url')" :show-overflow-tooltip="true" prop="url" width="400"/> |
| | | <el-table-column :label="$t('menu.permissions')" :show-overflow-tooltip="true" prop="permissions" |
| | | width="150"/> |
| | |
| | | component: () => import('./views/modules/sys/task/taskCenter'), |
| | | name: 'home', |
| | | meta: {title: '首页', isTab: true} |
| | | } |
| | | }, |
| | | { |
| | | path: '/home', |
| | | component: () => import('./views/modules/home2'), |
| | | name: 'home', |
| | | meta: {title: '首页',isRefresh: 1, isTab: true} |
| | | }, |
| | | ] |
| | | } |
| | | |
| | |
| | | <div> |
| | | <el-col :span="4"> |
| | | <div style="margin-right: 5px;height: calc(88vh - 100px)" v-if="isSelect"> |
| | | <product-model-tree :isShow="false"></product-model-tree> |
| | | <product-model-tree @on-selected="onTreeSelected" showXdy="false" |
| | | ref="ProductModelTree" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | |
| | | <div style="margin-top: 20px"> |
| | | <div style="margin-left: 400px" v-if="isShow"> |
| | | <el-tag type="info" effect="dark" style="font-size: 20px">MTBF:{{MTBF}}</el-tag> |
| | | <el-tag type="info" effect="dark" style="margin-left: 50px;font-size: 20px">MTTR:{{MTTR}}</el-tag> |
| | | </div> |
| | | <div> |
| | | <SimulatCurve ref="SimulatCurve"></SimulatCurve> |
| | | </div> |
| | |
| | | id: '', |
| | | pid: '', |
| | | productId: '', |
| | | showProductId: '', |
| | | taskModelId: '', |
| | | dataType: '', |
| | | isRepair: '', |
| | | dataType: 'fz', |
| | | samplPeriod: '', |
| | | simulatFrequency: '', |
| | | simulatTime: '' |
| | |
| | | watch: { |
| | | percentage() { |
| | | if (this.percentage === 100) { |
| | | this.$refs.SimulatCurve.initEcharts(this.dataForm.id,this.dataForm.taskModelId, this.dataForm.samplPeriod); |
| | | this.$refs.SimulatCurve.initEcharts(this.dataForm); |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | onTreeSelected(data) { |
| | | console.log(data, 'onProductSelected') |
| | | this.dataForm.showProductId = data.id |
| | | this.$refs.SimulatCurve.getProductEcharts(this.dataForm); |
| | | }, |
| | | // 获取信息 |
| | | onProductSelected(data) { |
| | | this.isSelect = true |
| | |
| | | ) |
| | | } else { |
| | | clearInterval(this.timers) |
| | | this.percentage = 0 |
| | | } |
| | | }, |
| | | async analyze() { |
| | |
| | | <template> |
| | | <div class="mod-taskReliability-taskPhase"> |
| | | <div class="echart" id="mychart" :style="myChartStyle"></div> |
| | | <div class="echart" id="myChart" :style="myChartStyle"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from "echarts"; |
| | | import echart from "echarts"; |
| | | |
| | | export default { |
| | | name: 'SimulatCurve', |
| | |
| | | return { |
| | | xDataList: [], |
| | | yDataList: [], |
| | | mttr: '', |
| | | mtbf: '', |
| | | myChart: {}, |
| | | myChartStyle: {float: "left", width: "100%", height: "600px"}, //图表样式 |
| | | option: {} |
| | |
| | | }, |
| | | components: {}, |
| | | methods: { |
| | | initEcharts(id,taskId, samplPeriod) { |
| | | async initEcharts(Param) { |
| | | let res = await this.$http.post(`/taskReliability/SimulatAssess/getResultXML`, Param) |
| | | console.log(res.data) |
| | | if (res.data) { |
| | | this.yDataList = res.data.curveParam.ydata |
| | | this.xDataList = res.data.curveParam.xdata |
| | | this.mttr = res.data.mttr.toFixed(4) |
| | | this.mtbf = res.data.mtbf.toFixed(4) |
| | | } |
| | | this.option = { |
| | | title: { |
| | | text: '', |
| | | text: "mttr:" + this.mttr + " mtbf:" + this.mtbf, |
| | | textStyle: { // 主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"} |
| | | fontFamily: 'Arial', |
| | | fontSize: 20, |
| | | fontSize: 30, |
| | | fontStyle: 'normal', |
| | | fontWeight: 'normal', |
| | | } |
| | | }, |
| | | textAlign:'auto',//整体(包括 text 和 subtext)的水平对齐 |
| | | textVerticalAlign:'auto',//整体(包括 text 和 subtext)的垂直对齐 |
| | | padding:0,//[5,10] | [ 5,6, 7, 8] ,标题内边距 |
| | | left:'center',//'5' | '5%',title 组件离容器左侧的距离 |
| | | right:'auto',//'title 组件离容器右侧的距离 |
| | | top:'auto',//title 组件离容器上侧的距离 |
| | | bottom:'auto',//title 组件离容器下侧的距离 |
| | | }, |
| | | xAxis: { |
| | | data: [], |
| | | data: this.xDataList, |
| | | name: '仿真次数' |
| | | }, |
| | | yAxis: {}, |
| | | yAxis: { |
| | | |
| | | name: '', |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [], |
| | | data: this.yDataList, |
| | | type: 'line', |
| | | smooth: true |
| | | } |
| | | ] |
| | | }; |
| | | this.getEchart(id,taskId, samplPeriod) |
| | | this.myChart = echart.init(document.getElementById("myChart")); |
| | | console.log(this.option, ' this.option ') |
| | | this.myChart.setOption(this.option); |
| | | //随着屏幕大小调节图表 |
| | | window.addEventListener("resize", () => { |
| | | this.myChart.resize(); |
| | | }); |
| | | }, |
| | | async getEchart(id,taskId, samplPeriod) { |
| | | let task = await this.$http.get(`/taskReliability/Task/${taskId}`) |
| | | samplPeriod = samplPeriod / 60 |
| | | let i = 0 |
| | | for (i = 0; i + samplPeriod <= task.taskDuration; i += samplPeriod) { |
| | | this.series[0].data.push(i); |
| | | async getProductEcharts(Param) { |
| | | let res = await this.$http.post(`/taskReliability/SimulatAssess/getResultData`, Param) |
| | | console.log(res.data) |
| | | if (res.data) { |
| | | this.yDataList = res.data.curveParam.ydata |
| | | this.xDataList = res.data.curveParam.xdata |
| | | this.mttr = res.data.mttr.toFixed(4) |
| | | this.mtbf = res.data.mtbf.toFixed(4) |
| | | } |
| | | if (i !== task.taskDuration) { |
| | | this.series[0].data.push(task.taskDuration); |
| | | } |
| | | this.option = { |
| | | title: { |
| | | text: "mttr:" + this.mttr + " mtbf:" + this.mtbf, |
| | | textStyle: { // 主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"} |
| | | fontFamily: 'Arial', |
| | | fontSize: 30, |
| | | fontStyle: 'normal', |
| | | fontWeight: 'normal', |
| | | }, |
| | | textAlign: 'auto',//整体(包括 text 和 subtext)的水平对齐 |
| | | textVerticalAlign: 'auto',//整体(包括 text 和 subtext)的垂直对齐 |
| | | padding: 0,//[5,10] | [ 5,6, 7, 8] ,标题内边距 |
| | | left: 'center',//'5' | '5%',title 组件离容器左侧的距离 |
| | | right: 'auto',//'title 组件离容器右侧的距离 |
| | | top: 'auto',//title 组件离容器上侧的距离 |
| | | bottom: 'auto',//title 组件离容器下侧的距离 |
| | | }, |
| | | xAxis: { |
| | | data: this.xDataList, |
| | | name: '仿真总时长', |
| | | splitNumber: 10 |
| | | }, |
| | | yAxis: { |
| | | |
| | | let res = await this.$http.get(`/taskReliability/SimulatAssess/${id}`) |
| | | |
| | | |
| | | |
| | | this.myChart = echarts.init(document.getElementById("mychart")); |
| | | name: '', |
| | | }, |
| | | series: [ |
| | | { |
| | | data: this.yDataList, |
| | | type: 'line', |
| | | smooth: true |
| | | } |
| | | ] |
| | | }; |
| | | this.myChart = echart.init(document.getElementById("myChart")); |
| | | console.log(this.option, ' this.option ') |
| | | this.myChart.setOption(this.option); |
| | | //随着屏幕大小调节图表 |
| | | window.addEventListener("resize", () => { |
New file |
| | |
| | | <template> |
| | | <div class="fa-card-a"> |
| | | <el-row :gutter="5"> |
| | | <div class="mod-taskReliability-simulatAssess"> |
| | | <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="80px"> |
| | | <zt-form-item label="产品节点" prop="productId"> |
| | | <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/> |
| | | </zt-form-item> |
| | | <zt-form-item label="总体任务" prop="taskModelId"> |
| | | <zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/> |
| | | </zt-form-item> |
| | | <zt-form-item label="仿真记录" prop="simulatHis"> |
| | | <zt-select v-model="dataForm.id" :datas="simulatList" @change="onSimulatSelected"/> |
| | | </zt-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-col :span="4"> |
| | | <div style="margin-right: 5px;height: calc(88vh - 100px)" v-if="isSelect"> |
| | | <product-model-tree @on-selected="onTreeSelected" showXdy="false" |
| | | ref="ProductModelTree" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <div style="margin-top: 20px"> |
| | | <div> |
| | | <SimulatCurve ref="SimulatCurve"></SimulatCurve> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </div> |
| | | </div> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import SimulatCurve from "./SimulatCurve"; |
| | | import SimulatData from "./SimulatData"; |
| | | import ProductModelTree from "../basicInfo/ProductModelTree"; |
| | | |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | timers: '', |
| | | isSelect: false, |
| | | isShow: false, |
| | | productList: [], |
| | | simulatList: [], |
| | | taskList: [], |
| | | MTBF: '', |
| | | MTTR: '', |
| | | dataForm: { |
| | | id: '', |
| | | pid: '', |
| | | productId: '', |
| | | showProductId: '', |
| | | taskModelId: '', |
| | | dataType: 'his', |
| | | samplPeriod: '', |
| | | simulatFrequency: '', |
| | | simulatTime: '' |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getProductList() |
| | | }, |
| | | components: { |
| | | ProductModelTree, |
| | | SimulatCurve, |
| | | SimulatData |
| | | }, |
| | | |
| | | methods: { |
| | | async getProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | }, |
| | | async getTaskList() { |
| | | let params = { |
| | | productId: this.dataForm.productId |
| | | } |
| | | let res = await this.$http.get('/taskReliability/Task/getTaskList', {params: params}) |
| | | console.log(res.data) |
| | | this.taskList = res.data |
| | | }, |
| | | async getSimulatList() { |
| | | let params = { |
| | | productId: this.dataForm.productId, |
| | | taskModelId: this.dataForm.taskModelId |
| | | } |
| | | let res = await this.$http.get('/taskReliability/SimulatAssess/getSimulatList', {params: params}) |
| | | console.log(res.data) |
| | | this.simulatList = res.data |
| | | }, |
| | | onTreeSelected(data) { |
| | | console.log(data, 'onProductSelected') |
| | | this.dataForm.showProductId = data.id |
| | | this.$refs.SimulatCurve.getProductEcharts(this.dataForm); |
| | | }, |
| | | // 获取信息 |
| | | onProductSelected(data) { |
| | | this.isSelect = true |
| | | console.log(data, ' onProductSelected(data)') |
| | | this.dataForm.productId = data.id |
| | | this.getTaskList() |
| | | this.dataForm.taskModelId = '' |
| | | }, |
| | | onTaskSelected(data) { |
| | | console.log(data, ' onProductSelected(data)') |
| | | this.dataForm.taskModelId = data.id |
| | | this.getSimulatList() |
| | | this.dataForm.id = '' |
| | | }, |
| | | onSimulatSelected(data) { |
| | | this.dataForm.id = data.id |
| | | this.dataForm.samplPeriod = data.samplPeriod |
| | | this.$refs.SimulatCurve.initEcharts(this.dataForm); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="fa-card-a"> |
| | | <el-row :gutter="5"> |
| | | <div class="mod-taskReliability-simulatAssess"> |
| | | <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="80px"> |
| | | <zt-form-item label="产品节点" prop="productId"> |
| | | <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/> |
| | | </zt-form-item> |
| | | <zt-form-item label="总体任务" prop="taskModelId"> |
| | | <zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/> |
| | | </zt-form-item> |
| | | <zt-form-item label="仿真记录" prop="simulatHis"> |
| | | <zt-select v-model="dataForm.id" :datas="simulatList" @change="onSimulatSelected"/> |
| | | </zt-form-item> |
| | | </el-form> |
| | | <div> |
| | | <el-col :span="4"> |
| | | <div style="margin-right: 5px;height: calc(88vh - 100px)" v-if="isSelect"> |
| | | <product-model-tree @on-selected="onTreeSelected" showXdy="false" |
| | | ref="ProductModelTree" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | <div style="margin-top: 20px"> |
| | | <div> |
| | | <SimulatCurve ref="SimulatCurve"></SimulatCurve> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </div> |
| | | </div> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import SimulatCurve from "./SimulatCurve"; |
| | | import SimulatData from "./SimulatData"; |
| | | import ProductModelTree from "../basicInfo/ProductModelTree"; |
| | | |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | timers: '', |
| | | isSelect: false, |
| | | isShow: false, |
| | | productList: [], |
| | | simulatList: [], |
| | | taskList: [], |
| | | MTBF: '', |
| | | MTTR: '', |
| | | dataForm: { |
| | | id: '', |
| | | pid: '', |
| | | productId: '', |
| | | showProductId: '', |
| | | taskModelId: '', |
| | | dataType: 'his', |
| | | samplPeriod: '', |
| | | simulatFrequency: '', |
| | | simulatTime: '' |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getProductList() |
| | | }, |
| | | components: { |
| | | ProductModelTree, |
| | | SimulatCurve, |
| | | SimulatData |
| | | }, |
| | | |
| | | methods: { |
| | | async getProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | }, |
| | | async getTaskList() { |
| | | let params = { |
| | | productId: this.dataForm.productId |
| | | } |
| | | let res = await this.$http.get('/taskReliability/Task/getTaskList', {params: params}) |
| | | console.log(res.data) |
| | | this.taskList = res.data |
| | | }, |
| | | async getSimulatList() { |
| | | let params = { |
| | | productId: this.dataForm.productId, |
| | | taskModelId: this.dataForm.taskModelId |
| | | } |
| | | let res = await this.$http.get('/taskReliability/SimulatAssess/getSimulatList', {params: params}) |
| | | console.log(res.data) |
| | | this.simulatList = res.data |
| | | }, |
| | | onTreeSelected(data) { |
| | | console.log(data, 'onProductSelected') |
| | | this.dataForm.showProductId = data.id |
| | | this.$refs.SimulatCurve.getProductEcharts(this.dataForm); |
| | | }, |
| | | // 获取信息 |
| | | onProductSelected(data) { |
| | | this.isSelect = true |
| | | console.log(data, ' onProductSelected(data)') |
| | | this.dataForm.productId = data.id |
| | | this.getTaskList() |
| | | this.dataForm.taskModelId = '' |
| | | }, |
| | | onTaskSelected(data) { |
| | | console.log(data, ' onProductSelected(data)') |
| | | this.dataForm.taskModelId = data.id |
| | | this.getSimulatList() |
| | | this.dataForm.id = '' |
| | | }, |
| | | onSimulatSelected(data) { |
| | | this.dataForm.id = data.id |
| | | this.dataForm.samplPeriod = data.samplPeriod |
| | | this.$refs.SimulatCurve.initEcharts(this.dataForm); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | |
| | | </style> |
| | |
| | | @NotNull(message="上级ID,不能为空", groups = DefaultGroup.class) |
| | | private Long pid; |
| | | |
| | | |
| | | @ApiModelProperty(value = "菜单名称") |
| | | @NotBlank(message="菜单名称不能为空", groups = DefaultGroup.class) |
| | | private String name; |