| | |
| | | ValidatorUtils.validateEntity(xhProductModel, AddGroup.class, DefaultGroup.class); |
| | | |
| | | Integer no = xhProductModelService.getNo(xhProductModel.getPid(),xhProductModel.getProductType()); |
| | | if (xhProductModel.getSort() < no) { |
| | | if (xhProductModel.getSort() == null || xhProductModel.getSort() < no) { |
| | | xhProductModel.setSort(no + 1); |
| | | } |
| | | xhProductModelService.insert(xhProductModel); |
| | |
| | | @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), |
| | | @ApiImplicitParam(name = "taskId", value = "任务Id", dataType = Constant.QT.STRING), |
| | | }) |
| | | public PageResult<TaskBinoParam> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | public Result<List<TaskBinoParam>> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(taskBinoParamService.page(queryFilter)); |
| | | return Result.ok(taskBinoParamService.page(queryFilter)); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | |
| | | AND is_delete = 0 |
| | | ) |
| | | ) |
| | | and ((node_type = 1) or (node_type <> 1 and id not in (select src_id from product_model where pid = |
| | | and ((node_type > ${nodeType}) or ( id not in (select src_id from product_model where pid = |
| | | ${pid} and is_delete=0))) |
| | | ORDER BY |
| | | node_type,sort |
| | |
| | | ) |
| | | and a.product_type in (4, 3, 2, 10) |
| | | AND a.is_delete = 0 |
| | | ORDER BY a.product_type, a.sort |
| | | </select> |
| | | <select id="getModelList" resultType="com.zt.life.modules.mainPart.taskReliability.model.ModelRbd"> |
| | | select * |
| | |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)"> |
| | | <product-model-tree ref="modelTree" @on-selected="onProductSelected" @on-default="onDefault" showXdy="false" |
| | | basic="3"/> |
| | | basic="3" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | |
| | | }) |
| | | }, |
| | | setDefultKey() { |
| | | console.log(this.$refs.tableObj.dataList[0].id,'this.$refs.tableObj.dataList[0].id') |
| | | this.defultKey.push(this.dataForm.shipId + "") |
| | | }, |
| | | onDefault(defaultId) { |
| | |
| | | <el-row :gutter="5"> |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)"> |
| | | <product-model-tree @on-selected="onProductSelected" showXdy="false"/> |
| | | <product-model-tree @on-selected="onProductSelected" showXdy="false" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | |
| | | size="small" |
| | | clearable |
| | | ></el-input> |
| | | <el-button type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增型号</el-button> |
| | | <el-button v-if="isShow" type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增型号</el-button> |
| | | <el-divider></el-divider> |
| | | <el-tree |
| | | style="height: 90%;overflow: auto" |
| | |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | isShow: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | basic: { |
| | | type: Number, |
| | | default: 1 |
| | |
| | | <zt-dict v-model="dataForm.productType" dict="product" @input="getDefaultImg" |
| | | :disabled="disabled"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item label="运行状态图" prop="operatImg" v-if="isShow"> |
| | | <zt-form-item label="运行状态图" prop="operatImg"> |
| | | <el-input v-model="dataForm.operatImgName" @focus="selectPicture()"></el-input> |
| | | <el-image v-if="dataForm.operatImg" :src="url+dataForm.operatImg" style="height: 50px;width: 50px"></el-image> |
| | | </zt-form-item> |
| | |
| | | this.isShow = false |
| | | this.dataForm.pid = null |
| | | this.dataForm.productType = 1 |
| | | this.getDefaultImg(this.dataForm.productType) |
| | | } else if (params.type === 'zt') { |
| | | this.dataForm.pid = params.pid |
| | | this.dataForm.productType = 2 |
| | | this.getProductList() |
| | | this.getDefaultImg(this.dataForm.productType) |
| | | } else { |
| | | this.dataForm.pid = params.pid |
| | | this.dataForm.productType = params.type |
| | | } |
| | | if (this.dataForm.productType === 10 && id == null) { |
| | | this.isShow = false |
| | | this.getDefaultImg(this.dataForm.productType) |
| | | } |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | add() { |
| | | console.log(this.dataForm.type,'this.dataForm.type') |
| | | this.dataForm.type = this.productType |
| | | if (this.dataForm.type !== '1') { |
| | | if (this.dataForm.type !== '3') { |
| | | this.dataForm.type = this.dataForm.type + 1 |
| | | } else if (this.dataForm.type === '3') { |
| | | this.dataForm.type = this.dataForm.type + 2 |
| | | } else if (this.dataForm.type === '0') { |
| | | this.$alert("当前节点不可新增子节点,请重新设置") |
| | | return |
| | | } |
| | | console.log(this.dataForm.type,'this.dataForm.type') |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null, {type: this.dataForm.type, id: this.dataForm.pid}) |
| | | } else { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'zt', pid: this.dataForm.pid}) |
| | |
| | | <el-row :gutter="5"> |
| | | <el-col :span="5"> |
| | | <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)"> |
| | | <product-model-tree @on-selected="onProductSelected" showXdy="true"/> |
| | | <product-model-tree @on-selected="onProductSelected" showXdy="true" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="19"> |
| | |
| | | async save() { |
| | | let res = await this.$http.post('/taskReliability/OperatConditModel/', this.$refs.tableObj.dataList[0]) |
| | | if (res.success) { |
| | | this.$tip.success() |
| | | this.isChange = false |
| | | this.$refs.tableObj.query() |
| | | } |
| | |
| | | }, |
| | | async saveDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | const nodes = this.graph.getNodes() |
| | | let nodeArr2 = [] |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | for (const node of nodes) { |
| | | console.log(node, 'saveDiagram node') |
| | | if (node.getData().nodeType == 'node' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | // 获取所有子节点 |
| | | this.getNodeArr() |
| | | this.dataForm.content = JSON.stringify(this.graph.toJSON()) |
| | | this.dataForm.urlPref = window.SITE_CONFIG['apiURL'] |
| | | console.log(this.dataForm, 'dataFrom') |
| | |
| | | } |
| | | }) |
| | | }, |
| | | async analyzeDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | getNodeArr(){ |
| | | const nodes = this.graph.getNodes() |
| | | let nodeArr2 = [] |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | for (const node of nodes) { |
| | | console.log(node, 'saveDiagram node') |
| | | if (node.getData().nodeType == 'node' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | }, |
| | | async analyzeDiagram() { |
| | | console.log(JSON.stringify(this.graph.toJSON()), 'graph.toJSON()') |
| | | // 检查除当前节点之外的所有节点的包围框是否相交 |
| | | // 获取所有子节点 |
| | | this.getNodeArr() |
| | | const nodes = this.graph.getNodes() |
| | | for (const node of nodes) { |
| | | if(node.getData().nodeType === 'dashedBox'){ |
| | | this.$message({message: '该模型中存在虚框,无法保存', type: 'warning'}) |
| | |
| | | return false; // 取消添加节点操作 |
| | | } |
| | | } |
| | | if (node.getData().nodeType === 'node' && node.getData().dataId) { |
| | | nodeArr2.push(node.getData().dataId) |
| | | } |
| | | } |
| | | this.dataForm.nodeArr = nodeArr2 |
| | | this.dataForm.content = JSON.stringify(this.graph.toJSON()) |
| | | this.dataForm.urlPref = window.SITE_CONFIG['apiURL'] |
| | | await this.$http['post'](`/taskReliability/ModelLine/analyze`, this.dataForm).then(async res => { |
| | |
| | | <template> |
| | | <zt-dialog ref="dialog" column="3" title="二项参数" append-to-body :editAble="false" :hasConfirm="false"> |
| | | <zt-table-wraper ref="tableObj" query-url="/taskReliability/TaskBinoParam/page" delete-url="/taskReliability/TaskBinoParam" |
| | | <zt-table-wraper :paging='false' ref="tableObj" query-url="/taskReliability/TaskBinoParam/page" delete-url="/taskReliability/TaskBinoParam" |
| | | v-slot="{ table }" > |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | |
| | | height="600px" |
| | | border @selection-change="table.selectionChangeHandle" @cell-click="handleCellClick"> |
| | | <!-- <el-table-column type="selection" width="40"/>--> |
| | | <el-table-column prop="phaseName" label="阶段" align="center" width="100"/> |
| | | <el-table-column prop="phaseName" label="阶段" align="center" /> |
| | | <el-table-column prop="operatConditName" label="工况" align="center"/> |
| | | <el-table-column prop="productName" label="二项分布设备" align="center"/> |
| | | <el-table-column prop="successRate" label="成功率" align="right"> |
| | | <el-table-column prop="successRate" label="成功率" align="right" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span |
| | | v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property"> |
| | |
| | | <span v-else>{{scope.row.successRate}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="simulatTimes" label="仿真次数" align="center"> |
| | | <el-table-column prop="simulatTimes" label="仿真次数" align="center" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span |
| | | v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property"> |
| | |
| | | <span v-else>{{scope.row.simulatTimes}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="successTimes" label="成功次数" align="center"> |
| | | <el-table-column prop="successTimes" label="成功次数" align="center" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span |
| | | v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property"> |