增加HAZOP节点划分接口

master
pan 4 years ago
parent cc4b30da12
commit 020f925fc0
  1. 3
      app.js
  2. 28
      routes/project/prepare.js
  3. 2
      routes/project/project.js

@ -11,6 +11,7 @@ var projectRouter=require('./routes/main/project')
var dataRouter=require('./routes/main/data')
var projectDetailRouter=require('./routes/project/project')
var infoRouter=require('./routes/project/info')
var prepareRouter=require('./routes/project/prepare')
const server = require("inspector");
var app = express();
@ -34,7 +35,7 @@ app.use(cors({
app.use('/', indexRouter);
app.use('/api/account',accountRouter)
app.use('/api/main',mainRouter,projectRouter,dataRouter)
app.use('/api/project',projectDetailRouter,infoRouter)
app.use('/api/project',projectDetailRouter,infoRouter,prepareRouter)
// catch 404 and forward to error handler
app.use(function(req, res, next) {

@ -0,0 +1,28 @@
var express = require('express');
var router = express.Router();
var mock = require('../../public/javascripts/mock')
var Mock = require("mockjs")
var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
var moment = require("moment")
var util=require("../../public/javascripts/util")
var route=require('../../public/javascripts/route')
//获取HAZOP节点划分
router.get('/hdivide', function (req, res, next) {
var data=mock.page(req,'获取HAOZP节点划分成功',{
//节点
node:()=>Mock.Random.word(),
//节点编号
nodeId:/Node\d{3}/,
//节点描述
nodeDesc:()=>Mock.Random.sentence(3, 5),
//节点PID号
nodePid:/PID\d{3}/
})
res.json(data)
})
route.addContextMenu(router,'hdivide','HAZOP节点划分')
module.exports=router

@ -15,7 +15,7 @@ router.get('/menu', function (req, res, next) {
let config = [{name: '项目基本信息', isOpen:true,childMenu: [
{name: '一般信息',path:'/project/info/baseinfo',selected:true},
{name: '团队成员',path:'/project/info/team_members'}, {name: '会议信息',path:'/project/info/meeting'}]}
,{name: '项目准备', childMenu: [{name: 'HAZOP节点划分'}, {name: 'HAZOP节点复用'}, {name: 'SIF节点划分'}, {name: '矩阵选择'}]}
,{name: '项目准备', childMenu: [{name: 'HAZOP节点划分',path:'/project/prepare/hdivide'}, {name: 'HAZOP节点复用'}, {name: 'SIF节点划分'}, {name: '矩阵选择'}]}
,{name: 'HAZOP分析', childMenu: [{name: 'HAZOP分析'}, {name: 'HAZOP所有'}]}
,{name:'LOPA定级', childMenu: [{name:'LOPA'},{name:'LOPA表单'},{name:'LOPA所有节点'}]}
,{name:'SIL验算', childMenu: [{name:'SIL验算'},{name:'SIL验算[Nodes]'},{name:'SIL验算-总'}]}]

Loading…
Cancel
Save