From e9da9d5b8e73b9cd703e939127527fb9a5e7e5ba Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Fri, 30 Oct 2020 20:51:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE=E5=87=86?= =?UTF-8?q?=E5=A4=87=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/project/prepare.js | 15 +++++++++++++-- routes/project/project.js | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/routes/project/prepare.js b/routes/project/prepare.js index 6d58312..07c7095 100644 --- a/routes/project/prepare.js +++ b/routes/project/prepare.js @@ -25,12 +25,23 @@ router.get('/hdivide', function (req, res, next) { router.get('/hdivide/node', function (req, res, next) { var data=mock.page(req,'获取HAOZP节点划分成功',{ + //节点 + id:/\d{3}/, //节点 node:()=>Mock.Random.word(), + //节点编号 + nodeId:/Node\d{3}/, + //节点描述 + nodeDesc:()=>Mock.Random.sentence(3, 5), }) res.json(data) }) +router.patch('/hdivide/:id', function (req, res, next) { + var data=mock.ok(`节点${req.params.id}更新成功`) + res.json(data) +}) + route.addContextMenu(router,'hdivide','HAZOP节点划分') //获取节点复用 @@ -49,8 +60,8 @@ router.get('/hreuse', function (req, res, next) { route.addContextMenu(router,'hreuse','HAZOP节点复用') //SIF节点划分 -router.get('/sdivide', function (req, res, next) { - var data=mock.page(req,'获取SIF节点划分成功',{ +router.get('/sdivide/:id', function (req, res, next) { + var data=mock.page(req,`获取节点${req.params.id}SIF节点划分成功`,{ //SIF名称 name:()=>Mock.Random.name(), //SIF编号 diff --git a/routes/project/project.js b/routes/project/project.js index 7f1cbbe..5bae18c 100644 --- a/routes/project/project.js +++ b/routes/project/project.js @@ -19,7 +19,7 @@ router.get('/menu', function (req, res, next) { {name: 'HAZOP节点复用',path: '/project/prepare/hreuse'}, {name: 'SIF节点划分',path:'/project/prepare/sdivide'}, {name: '矩阵选择',path:'/project/prepare/matrix'}]} - ,{name: 'HAZOP分析', childMenu: [{name: 'HAZOP分析'}, {name: 'HAZOP所有'}]} + ,{name: 'HAZOP分析', childMenu: [{name: 'HAZOP分析',path:'/project/hazop/analyse'}, {name: 'HAZOP所有'}]} ,{name:'LOPA定级', childMenu: [{name:'LOPA'},{name:'LOPA表单'},{name:'LOPA所有节点'}]} ,{name:'SIL验算', childMenu: [{name:'SIL验算'},{name:'SIL验算[Nodes]'},{name:'SIL验算-总'}]}] config.forEach((item, index) => {