增加项目菜单接口

master
pan 4 years ago
parent 1f56d906eb
commit 2c3183b326
  1. 8
      routes/project/info.js
  2. 5
      routes/project/project.js

@ -0,0 +1,8 @@
var express = require('express');
var router = express.Router();
var mock = require('../../public/javascripts/mock')
var Mock = require("mockjs")
module.exports = router

@ -10,7 +10,7 @@ router.get('/menu', function (req, res, next) {
body: { body: {
menus: function () { menus: function () {
let menus = [] let menus = []
let config = [{name: '项目基本信息', childMenu: [{name: '一般信息'}, {name: '团队成员'}, {name: '会议信息'}]} let config = [{name: '项目基本信息', childMenu: [{name: '一般信息',path:'/project/info/baseinfo',selected:true}, {name: '团队成员'}, {name: '会议信息'}]}
,{name: '项目准备', childMenu: [{name: 'HAZOP节点划分'}, {name: 'HAZOP节点复用'}, {name: 'SIF节点划分'}, {name: '矩阵选择'}]} ,{name: '项目准备', childMenu: [{name: 'HAZOP节点划分'}, {name: 'HAZOP节点复用'}, {name: 'SIF节点划分'}, {name: '矩阵选择'}]}
,{name: 'HAZOP分析', childMenu: [{name: 'HAZOP分析'}, {name: 'HAZOP所有'}]} ,{name: 'HAZOP分析', childMenu: [{name: 'HAZOP分析'}, {name: 'HAZOP所有'}]}
,{name:'LOPA定级', childMenu: [{name:'LOPA'},{name:'LOPA表单'},{name:'LOPA所有节点'}]} ,{name:'LOPA定级', childMenu: [{name:'LOPA'},{name:'LOPA表单'},{name:'LOPA所有节点'}]}
@ -26,7 +26,8 @@ router.get('/menu', function (req, res, next) {
childMenu.push({ childMenu.push({
menuId: index, menuId: index,
menuName: item.name, menuName: item.name,
isSelected: false isSelected: item.selected?item.selected:false,
path:item.path?item.path:''
}) })
}) })
menu.childMenu = childMenu menu.childMenu = childMenu

Loading…
Cancel
Save