增加项目团队成员接口

master
pan 4 years ago
parent 7fcdbadb84
commit 84dbf885ee
  1. 16
      routes/project/info.js
  2. 7
      routes/project/project.js

@ -30,4 +30,20 @@ router.post('/info', multipartMiddleware,function (req, res, next) {
res.json(mock.ok(`数据自动保存成功,最后更新时间:${moment().format(util.dateFormat)}`)) res.json(mock.ok(`数据自动保存成功,最后更新时间:${moment().format(util.dateFormat)}`))
}) })
//获取团队成员
router.get('/member', function (req, res, next) {
var data=mock.page(req,'获取团队成员成功',{
name:()=>Mock.Random.name(),
email:()=>Mock.Random.email(),
cellphone:/1[34578][0-9]{9}/,
post:()=>Mock.Random.word(),
company:()=>Mock.Random.word(),
department:()=>Mock.Random.word(),
specialty:()=>Mock.Random.word(),
time:()=>Mock.Random.datetime(),
note:()=>Mock.Random.sentence(3, 5)
})
res.json(data)
})
module.exports = router module.exports = router

@ -10,7 +10,9 @@ router.get('/menu', function (req, res, next) {
body: { body: {
menus: function () { menus: function () {
let menus = [] let menus = []
let config = [{name: '项目基本信息', childMenu: [{name: '一般信息',path:'/project/info/baseinfo',selected:true}, {name: '团队成员'}, {name: '会议信息'}]} let config = [{name: '项目基本信息', isOpen:true,childMenu: [
{name: '一般信息',path:'/project/info/baseinfo',selected:true},
{name: '团队成员',path:'/project/info/team_members'}, {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所有节点'}]}
@ -19,14 +21,13 @@ router.get('/menu', function (req, res, next) {
let menu = { let menu = {
menuId: `a${index}`, menuId: `a${index}`,
menuName: item.name, menuName: item.name,
isOpen: Mock.Random.boolean() isOpen: item.isOpen?item.isOpen:false
} }
let childMenu = [] let childMenu = []
item.childMenu.forEach((item, index) => { item.childMenu.forEach((item, index) => {
childMenu.push({ childMenu.push({
menuId: index, menuId: index,
menuName: item.name, menuName: item.name,
isSelected: item.selected?item.selected:false,
path:item.path?item.path:'' path:item.path?item.path:''
}) })
}) })

Loading…
Cancel
Save