Commit c985b42e authored by wangxuelai's avatar wangxuelai

''

parent 2a46d761
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>轻校</title><link rel="shortcut icon" href="https://cdn.img.shangjiadao.cn/qingxiao/biz/image/qxlogo4.png"><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;" name="viewport"><meta http-equiv="X-UA-Compatible" content="IE=edge"><!-- Polyfills --><!--[if lt IE 10]>
<script src="js/console-polyfill.js"></script>
<![endif]--><script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script><link href="/dist/index.css?1565858173287" rel="stylesheet"><script src="/lib/vendor.dll.js?777" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?3" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?3" charset="utf-8"></script></head><body><div id="root"></div><script src="/dist/index.js?1565858173287" charset="utf-8"></script></body></html>
\ No newline at end of file
...@@ -3,42 +3,39 @@ export default { ...@@ -3,42 +3,39 @@ export default {
{ {
id: '7', id: '7',
name: '总部管理', name: '总部管理',
activeIcon: { style: {
backgroundPosition: '-99px -28px', width: '20px',
height: '20px',
}, },
defaultIcon: { isFather: false,
backgroundPosition: '-67px -28px', activeurl: `${__IMGCDN__}menu/indexactive.png`,
}, notactiveurl: `${__IMGCDN__}menu/index.png`,
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
path: '/sjd/headquarters/index', path: '/sjd/headquarters/index',
relativePath: ['/sjd/headquarters/index'], relativePath: ['/sjd/headquarters/index'],
}, },
{ {
id: '8', id: '8',
name: '校区信息', name: '校区信息',
activeIcon: { style: {
backgroundPosition: '-99px -28px', width: '20px',
}, height: '20px',
defaultIcon: {
backgroundPosition: '-67px -28px',
}, },
activeurl: `${__IMGCDN__}menu/officialwebactive.png`, isFather: false,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`, activeurl: `${__IMGCDN__}menu/schoolinfoactive.png`,
notactiveurl: `${__IMGCDN__}menu/schoolinfo.png`,
path: '/sjd/headquarters/detail', path: '/sjd/headquarters/detail',
relativePath: ['/sjd/headquarters/detail'], relativePath: ['/sjd/headquarters/detail'],
}, },
{ {
id: '9', id: '9',
name: '校区统计', name: '校区统计',
activeIcon: { style: {
backgroundPosition: '-99px -28px', width: '20px',
}, height: '20px',
defaultIcon: {
backgroundPosition: '-67px -28px',
}, },
activeurl: `${__IMGCDN__}menu/officialwebactive.png`, isFather: false,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`, activeurl: `${__IMGCDN__}menu/schoolstaticactive.png`,
notactiveurl: `${__IMGCDN__}menu/schoolstatic.png`,
path: '/sjd/headquarters/static', path: '/sjd/headquarters/static',
relativePath: ['/sjd/headquarters/static'], relativePath: ['/sjd/headquarters/static'],
}, },
......
...@@ -3,6 +3,7 @@ export default { ...@@ -3,6 +3,7 @@ export default {
{ {
id: '1', id: '1',
name: '首页', name: '首页',
isFather: false,
style: { style: {
width: '20px', width: '20px',
height: '22px', height: '22px',
...@@ -15,6 +16,7 @@ export default { ...@@ -15,6 +16,7 @@ export default {
{ {
id: '3', id: '3',
name: '班级管理', name: '班级管理',
isFather: false,
style: { style: {
width: '20px', width: '20px',
height: '20px', height: '20px',
...@@ -27,6 +29,7 @@ export default { ...@@ -27,6 +29,7 @@ export default {
{ {
id: '4', id: '4',
name: '老师管理', name: '老师管理',
isFather: false,
style: { style: {
width: '20px', width: '20px',
height: '20px', height: '20px',
...@@ -39,6 +42,7 @@ export default { ...@@ -39,6 +42,7 @@ export default {
{ {
id: '5', id: '5',
name: '学生管理', name: '学生管理',
isFather: false,
style: { style: {
width: '20px', width: '20px',
height: '20px', height: '20px',
...@@ -51,6 +55,7 @@ export default { ...@@ -51,6 +55,7 @@ export default {
{ {
id: '6', id: '6',
name: '课程管理', name: '课程管理',
isFather: false,
style: { style: {
width: '20px', width: '20px',
height: '20px', height: '20px',
...@@ -63,6 +68,7 @@ export default { ...@@ -63,6 +68,7 @@ export default {
{ {
id: '7', id: '7',
name: '机构管理', name: '机构管理',
isFather: false,
style: { style: {
width: '20px', width: '20px',
height: '20px', height: '20px',
...@@ -91,6 +97,7 @@ export default { ...@@ -91,6 +97,7 @@ export default {
width: '20px', width: '20px',
height: '20px', height: '20px',
}, },
isFather: false,
noIcon: true, noIcon: true,
path: '/sjd/officialweb', path: '/sjd/officialweb',
relativePath: ['/sjd/officialweb', '/sjd/officialwebeditor'], relativePath: ['/sjd/officialweb', '/sjd/officialwebeditor'],
......
...@@ -335,7 +335,19 @@ export default { ...@@ -335,7 +335,19 @@ export default {
} = payload; } = payload;
const defaultMenu = id; const defaultMenu = id;
const webapp = yield select(state => state.webapp); const webapp = yield select(state => state.webapp);
const currentMenu = webapp.menus.find(ele => ele.id === id) || {}; let currentMenu = {};
function menueSearch(menus) {
for (let i = 0; i < menus.length; i++) {
if (id == menus[i].id) {
currentMenu = menus[i];
return;
}
if (menus[i].isFather && menus[i].subMenues && (menus[i].subMenues instanceof Array) && menus[i].subMenues.length > 0) {
menueSearch(menus[i].subMenues);
}
}
}
menueSearch(webapp.menus);
if (!currentMenu.isFather) { if (!currentMenu.isFather) {
yield put({ yield put({
type: 'updateState', type: 'updateState',
...@@ -408,17 +420,22 @@ export default { ...@@ -408,17 +420,22 @@ export default {
const { pathname } = payload; const { pathname } = payload;
let newDefaultMenu = defaultMenu; let newDefaultMenu = defaultMenu;
let matchedmenu = null; let matchedmenu = null;
for (let i = 0; i < menus.length; i++) { function menueSearch(menus) {
const menu = menus[i]; for (let i = 0; i < menus.length; i++) {
if (menu.relativePath && menu.relativePath.length > 0) { const menu = menus[i];
for (let j = 0; j < menu.relativePath.length; j++) { if (menu.relativePath && menu.relativePath.length > 0) {
if (pathToRegexp(menu.relativePath[j]).exec(pathname)) { const manuMatch = menu.relativePath.find(ele => pathToRegexp(ele).exec(pathname));
if (manuMatch) {
matchedmenu = menu; matchedmenu = menu;
newDefaultMenu = menu.id; newDefaultMenu = menu.id;
} }
} }
if (menus[i].isFather && menus[i].subMenues && (menus[i].subMenues instanceof Array) && menus[i].subMenues.length > 0) {
menueSearch(menus[i].subMenues);
}
} }
} }
menueSearch(menus);
yield put({ yield put({
type: 'updateState', type: 'updateState',
payload: { payload: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment