| | |
| | | const nodes = this.graph.getNodes() |
| | | for (const node of nodes) { |
| | | if (node.getData().nodeType === 'dashedBox') { |
| | | this.$message({message: '该模型中存在虚框,无法保存', type: 'warning'}) |
| | | return false; // 取消添加节点操作 |
| | | this.$message({message: '该模型中存在虚框,无法提交', type: 'warning'}) |
| | | return false; |
| | | } |
| | | if (node.getData().nodeType === 'vote') { |
| | | const edges = this.graph.getConnectedEdges(node); |
| | | if (node.getData().voteNum === null || node.getData().voteNum === '') { |
| | | this.$message({message: '表决节点的表决数量未设置', type: 'warning'}) |
| | | return false; |
| | | } |
| | | const edges = this.graph.getIncomingEdges(node); |
| | | if (node.getData().voteNum >= edges.length) { |
| | | this.$message({message: '表决数量不能高于该节点的进线数量', type: 'warning'}) |
| | | return false; // 取消添加节点操作 |
| | | this.$message({message: '表决节点的表决数量必须小于该节点的进线数量', type: 'warning'}) |
| | | return false; |
| | | } |
| | | } |
| | | if (node.getData().nodeType === 'switch') { |
| | | if (node.getData().voteNum === null || node.getData().voteNum === '') { |
| | | this.$message({message: '旁联节点的备份数量未设置', type: 'warning'}) |
| | | return false; |
| | | } |
| | | const edges = this.graph.getIncomingEdges(node); |
| | | if (node.getData().voteNum >= edges.length) { |
| | | this.$message({message: '旁联节点的备份数量必须小于该节点的进线数量', type: 'warning'}) |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | await this.$http['post'](`/taskReliability/ModelLine/analyze`, this.dataForm).then(async res => { |
| | | if (res.msg === 'success') { |
| | | this.$emit('refreshDataList') |
| | | this.$alert('解析成功', '提示', { |
| | | this.$alert('提交成功', '提示', { |
| | | confirmButtonText: '确定' |
| | | }) |
| | | } |