更新获取节点接口

master
pan 4 years ago
parent 4b113c0ed5
commit 65601fcede
  1. 2
      routes/project/hazop.js
  2. 19
      routes/project/prepare.js
  3. 2
      routes/project/project.js

@ -17,7 +17,7 @@ router.get('/analyse/all', function (req, res, next) {
}) })
Array.from(new Array(20).keys()).forEach(value => { Array.from(new Array(20).keys()).forEach(value => {
let t={t:`${JSON.stringify({node:Mock.Random.word(),nodeId:Mock.Random.integer(1,10)})}`} let t={t:`${JSON.stringify({node:Mock.Random.word(),id:Mock.Random.integer(1,10)})}`}
sst.si.push(t) sst.si.push(t)
}) })

@ -25,7 +25,7 @@ router.get('/hdivide', function (req, res, next) {
router.get('/hdivide/all', function (req, res, next) { router.get('/hdivide/all', function (req, res, next) {
var data=mock.page(req,'获取HAOZP节点划分成功',{ var data=mock.page(req,'获取HAOZP节点划分成功',{
//节点 //节点id
id:/\d{3}/, id:/\d{3}/,
//节点 //节点
node:()=>Mock.Random.word(), node:()=>Mock.Random.word(),
@ -37,8 +37,8 @@ router.get('/hdivide/all', function (req, res, next) {
res.json(data) res.json(data)
}) })
router.patch('/hdivide/:id', function (req, res, next) { router.patch('/hdivide/:nodeId', function (req, res, next) {
var data=mock.ok(`节点${req.params.id}更新成功`) var data=mock.ok(`节点${req.params.nodeId}更新成功`)
res.json(data) res.json(data)
}) })
@ -60,12 +60,14 @@ router.get('/hreuse', function (req, res, next) {
route.addContextMenu(router,'hreuse','HAZOP节点复用') route.addContextMenu(router,'hreuse','HAZOP节点复用')
//SIF节点划分 //SIF节点划分
router.get('/sdivide/:id', function (req, res, next) { router.get('/sdivide/:nodeId', function (req, res, next) {
var data=mock.page(req,`获取节点${req.params.id}SIF节点划分成功`,{ var data=mock.page(req,`获取节点${req.params.nodeId}SIF节点划分成功`,{
//sif_id
id:/\d{3}/,
//SIF名称 //SIF名称
name:()=>Mock.Random.name(), name:()=>Mock.Random.name(),
//SIF编号 //SIF编号
id:/SIF\d{3}/, sifId:/SIF\d{3}/,
//SIF描述 //SIF描述
desc:()=>Mock.Random.sentence(3, 5), desc:()=>Mock.Random.sentence(3, 5),
//SIF连带动作 //SIF连带动作
@ -91,6 +93,11 @@ router.get('/sdivide/:id', function (req, res, next) {
res.json(data) res.json(data)
}) })
router.patch('/sdivide/:nodeId/:id', function (req, res, next) {
var data=mock.ok(`节点:${req.params.nodeId},SIF:${req.params.id}更新成功`)
res.json(data)
})
route.addContextMenu(router,'sdivide','SIF节点划分') route.addContextMenu(router,'sdivide','SIF节点划分')
router.get('/matrix', function (req, res, next) { router.get('/matrix', function (req, res, next) {

@ -20,7 +20,7 @@ router.get('/menu', function (req, res, next) {
{name: 'SIF节点划分',path:'/project/prepare/sdivide'}, {name: 'SIF节点划分',path:'/project/prepare/sdivide'},
{name: '矩阵选择',path:'/project/prepare/matrix'}]} {name: '矩阵选择',path:'/project/prepare/matrix'}]}
,{name: 'HAZOP分析', childMenu: [{name: 'HAZOP分析',path:'/project/hazop/analyse'}, {name: 'HAZOP所有',path:'/project/hazop/all'}]} ,{name: 'HAZOP分析', childMenu: [{name: 'HAZOP分析',path:'/project/hazop/analyse'}, {name: 'HAZOP所有',path:'/project/hazop/all'}]}
,{name:'LOPA定级', childMenu: [{name:'LOPA'},{name:'LOPA表单'},{name:'LOPA所有节点'}]} ,{name:'LOPA定级', childMenu: [{name:'LOPA',path:'/project/lopa/lopa'},{name:'LOPA表单'},{name:'LOPA所有节点'}]}
,{name:'SIL验算', childMenu: [{name:'SIL验算'},{name:'SIL验算[Nodes]'},{name:'SIL验算-总'}]}] ,{name:'SIL验算', childMenu: [{name:'SIL验算'},{name:'SIL验算[Nodes]'},{name:'SIL验算-总'}]}]
config.forEach((item, index) => { config.forEach((item, index) => {
let menu = { let menu = {

Loading…
Cancel
Save