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 {
{
id: '7',
name: '总部管理',
activeIcon: {
backgroundPosition: '-99px -28px',
style: {
width: '20px',
height: '20px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
isFather: false,
activeurl: `${__IMGCDN__}menu/indexactive.png`,
notactiveurl: `${__IMGCDN__}menu/index.png`,
path: '/sjd/headquarters/index',
relativePath: ['/sjd/headquarters/index'],
},
{
id: '8',
name: '校区信息',
activeIcon: {
backgroundPosition: '-99px -28px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
style: {
width: '20px',
height: '20px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
isFather: false,
activeurl: `${__IMGCDN__}menu/schoolinfoactive.png`,
notactiveurl: `${__IMGCDN__}menu/schoolinfo.png`,
path: '/sjd/headquarters/detail',
relativePath: ['/sjd/headquarters/detail'],
},
{
id: '9',
name: '校区统计',
activeIcon: {
backgroundPosition: '-99px -28px',
},
defaultIcon: {
backgroundPosition: '-67px -28px',
style: {
width: '20px',
height: '20px',
},
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
isFather: false,
activeurl: `${__IMGCDN__}menu/schoolstaticactive.png`,
notactiveurl: `${__IMGCDN__}menu/schoolstatic.png`,
path: '/sjd/headquarters/static',
relativePath: ['/sjd/headquarters/static'],
},
......
......@@ -3,6 +3,7 @@ export default {
{
id: '1',
name: '首页',
isFather: false,
style: {
width: '20px',
height: '22px',
......@@ -15,6 +16,7 @@ export default {
{
id: '3',
name: '班级管理',
isFather: false,
style: {
width: '20px',
height: '20px',
......@@ -27,6 +29,7 @@ export default {
{
id: '4',
name: '老师管理',
isFather: false,
style: {
width: '20px',
height: '20px',
......@@ -39,6 +42,7 @@ export default {
{
id: '5',
name: '学生管理',
isFather: false,
style: {
width: '20px',
height: '20px',
......@@ -51,6 +55,7 @@ export default {
{
id: '6',
name: '课程管理',
isFather: false,
style: {
width: '20px',
height: '20px',
......@@ -63,6 +68,7 @@ export default {
{
id: '7',
name: '机构管理',
isFather: false,
style: {
width: '20px',
height: '20px',
......@@ -91,6 +97,7 @@ export default {
width: '20px',
height: '20px',
},
isFather: false,
noIcon: true,
path: '/sjd/officialweb',
relativePath: ['/sjd/officialweb', '/sjd/officialwebeditor'],
......
......@@ -335,7 +335,19 @@ export default {
} = payload;
const defaultMenu = id;
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) {
yield put({
type: 'updateState',
......@@ -408,17 +420,22 @@ export default {
const { pathname } = payload;
let newDefaultMenu = defaultMenu;
let matchedmenu = null;
for (let i = 0; i < menus.length; i++) {
const menu = menus[i];
if (menu.relativePath && menu.relativePath.length > 0) {
for (let j = 0; j < menu.relativePath.length; j++) {
if (pathToRegexp(menu.relativePath[j]).exec(pathname)) {
function menueSearch(menus) {
for (let i = 0; i < menus.length; i++) {
const menu = menus[i];
if (menu.relativePath && menu.relativePath.length > 0) {
const manuMatch = menu.relativePath.find(ele => pathToRegexp(ele).exec(pathname));
if (manuMatch) {
matchedmenu = menu;
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({
type: 'updateState',
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