Commit fb8a622e authored by wangxuelai's avatar wangxuelai

''

parent 66e9983a
......@@ -18,6 +18,6 @@
</head>
<body>
<div id="root"></div>
<script src="dist/main.js?1577678431815" charset="utf-8"></script>
<script src="dist/main.js?1577684940782" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
export default {
rootMap: {
'sjd/indexstaic': ['planSchedule'], // 首页: 一键排课
'sjd/student': ['addStudent', 'enrolCode', 'bundlingCode', 'checkClass', 'addCourseHours', 'removeCourseHours'], // 学员管理: 添加,自助报名二维码,自助绑定二维码,选班,续课,消课
'sjd/student': ['addStudent', 'enrolCode', 'bundlingCode', 'checkClass', 'addCourseHours', 'removeCourseHours', 'delstudent'], // 学员管理: 添加,自助报名二维码,自助绑定二维码,选班,续课,消课
'sjd/studentinfo': ['editStudent', 'addCourseHours', 'changeCourse', 'quitCourse'], // 学生详情: 续课,转课,退课
'sjd/classmgt': ['addClass', 'allWindingUp', 'callStudent', 'singleWindingUp'], // 班级管理: 添加班级,批量结业,点名,结业
'sjd/classmgt': ['addClass', 'allWindingUp', 'callStudent', 'singleWindingUp', 'classjoin', 'thememgt', 'delclass'], // 班级管理: 添加班级,批量结业,点名,结业
'sjd/classdetail': ['editClass', 'planAllSchedule', 'removeAllPlans', 'editPlan', 'removePlan', 'addClassStudent', 'changeClass', 'removeClass', 'removeStudent', 'noPlanCallStudent', 'callStudnet', 'changeCourse', 'removeSchedule'], // 班级详情: 编辑班级,一键排课,批量删除,编辑,删除,添加学员,调班,移除,未排课直接点评,点名,调课,删除点名
'sjd/teacher': ['addTeacher', 'onOroff'], // 老师管理: 添加,启动状态
'sjd/teacherinfo': ['editTeacher', 'callStudnet', 'changeCourse', 'removePlan'], // 老师详情: 编辑,点名,调课,删除
......
This diff is collapsed.
import React from 'react';
import { connect } from 'dva';
import { Icon, Layout, Menu, Dropdown, Modal, Breadcrumb, Divider } from 'antd';
import SjdHeaderStyle from './SjdHeader.less';
import { LocalStorage, imagify } from '../../src/utils/index';
const { Header } = Layout;
class HdqrHeader extends React.Component {
constructor(props) {
super(props);
this.state = {
// teachername: LocalStorage.getItem('schoolinfo') ? LocalStorage.getItem('schoolinfo').school_teacher.nickname : '',
// role: LocalStorage.getItem('role'),
};
}
componentWillMount() {
}
toggle = () => {
const { dispatch, collapsed, screenIsBig } = this.props;
dispatch({
type: 'webapp/menucollapse',
payload: {
collapsed: !collapsed,
},
});
}
signOut = ({ item, key, keyPath }) => {
const { dispatch } = this.props;
switch (key) {
case '1':
dispatch({
type: 'webapp/signout',
payload: {
dispatch,
},
});
break;
case '0':
dispatch({
type: 'webapp/shiftSchool',
});
break;
default:
console.log('default');
break;
}
}
routeChange = (path) => {
const { dispatch } = this.props;
if (window.location.hash.indexOf(path) == 1) {
return;
}
dispatch({
type: 'webapp/changeRoute',
payload: {
path,
},
});
}
render() {
const {
collapsed, schoolUserInfo, screenIsBig, breadcrumbList, isDepartment, userInfo, departMentInfo,
} = this.props;
// const { teachername, role } = this.state;
const menu = (
<Menu onClick={this.signOut}>
<Menu.Item key="0">
<span>切换校区</span>
</Menu.Item>
<Menu.Item key="1">
<span>退出</span>
</Menu.Item>
</Menu>
);
let headerPdl = 0;
if (screenIsBig) {
headerPdl = !collapsed ? 224 : 104;
} else {
headerPdl = 20;
}
return (
<Header
className={SjdHeaderStyle.header}
style={{
background: '#fff',
padding: 0,
paddingLeft: headerPdl,
paddingRight: 24,
position: 'fixed',
width: '100%',
left: 0,
top: 0,
zIndex: 99,
height: '60px',
lineHeight: '60px',
}}>
<Icon
className={SjdHeaderStyle.trigger}
type={collapsed ? 'menu-unfold' : 'menu-fold'}
onClick={this.toggle}
/>
{breadcrumbList.length == 1 &&
<div className={SjdHeaderStyle.breadbox}>
<div className={`${SjdHeaderStyle.breaditembold} ${SjdHeaderStyle.breaditem}`} onClick={() => { this.routeChange(breadcrumbList[0].path); }}>
{breadcrumbList[0].name}
</div>
</div>
}
{breadcrumbList.length > 1 &&
<div className={SjdHeaderStyle.breadbox}>
{breadcrumbList.map((ele, index) => (
<div key={index} className={`${(index + 1) == breadcrumbList.length ? SjdHeaderStyle.breaditembold : ''} ${SjdHeaderStyle.breaditem}`} onClick={() => { this.routeChange(ele.path); }}>
{ele.name}&nbsp;&nbsp;{index < breadcrumbList.length - 1 ? '/' : ''}&nbsp;&nbsp;
</div>
))}
</div>
}
<div className={SjdHeaderStyle.accountoperate}>
<Dropdown overlay={menu}>
<div className={SjdHeaderStyle.accountoperate}>
<div className={SjdHeaderStyle.useraccount}>
<span className={SjdHeaderStyle.usermobile}>{(departMentInfo && departMentInfo.title) || ''}(总部)</span>
<Icon type="caret-down" className={SjdHeaderStyle.caretDown} />
</div>
</div>
</Dropdown>
</div>
</Header>
);
}
}
HdqrHeader.propTypes = {
};
function mapStateToProps(state) {
const {
collapsed, departMentInfo, screenIsBig, breadcrumbList, isDepartment, userInfo,
} = state.webapp;
return {
collapsed,
departMentInfo,
screenIsBig,
breadcrumbList,
isDepartment,
userInfo,
};
}
export default connect(mapStateToProps)(HdqrHeader);
......@@ -8,8 +8,6 @@ class SjdMenu extends React.Component {
constructor(props) {
super(props);
this.state = {
teachername: LocalStorage.getItem('schoolinfo') ? LocalStorage.getItem('schoolinfo').school_teacher.nickname : '',
role: LocalStorage.getItem('role'),
};
}
componentWillMount() {
......@@ -60,7 +58,6 @@ class SjdMenu extends React.Component {
const {
collapsed, schoolUserInfo, screenIsBig, breadcrumbList, isDepartment, userInfo,
} = this.props;
const { teachername, role } = this.state;
const menu = (
<Menu onClick={this.signOut}>
<Menu.Item key="0">
......@@ -77,6 +74,7 @@ class SjdMenu extends React.Component {
} else {
headerPdl = 20;
}
console.log(isDepartment, 'isDepartment');
return (
<Header
className={SjdHeaderStyle.header}
......
......@@ -184,10 +184,12 @@ export default {
* goDepartmentSystem({ payload }, { call, put, select }) {
const { department, type } = payload;
LocalStorage.setItem('departmentid', department.id);
LocalStorage.setItem('departMentInfo', department);
yield put({
type: 'webapp/updateState',
payload: {
departmentid: department.id,
departMentInfo: department,
},
});
yield call(commonAjax.schoolLoginTime, {
......
......@@ -28,6 +28,7 @@ export default {
locationQuery: {},
userInfo: LocalStorage.getItem('user') || {}, // 登录状态的缓存 判断是否登录
schoolUserInfo: {}, // 在校区中展示的在该校区下的老师信息
departMentInfo: LocalStorage.getItem('departMentInfo') || {},
sid: LocalStorage.getItem('sid') || 0,
departmentid: LocalStorage.getItem('departmentid') || 0,
numberToChinese: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一'],
......
......@@ -4,7 +4,7 @@ import { Layout, Modal, Button, Drawer, Icon } from 'antd';
import { Redirect } from 'dva/router';
import SjdIndexStyle from './SjdIndex.less';
import HdqrsMenu from '../components/HdqrsMenu';
import SjdHeader from '../components/SjdHeader';
import HdqrHeader from '../components/HdqrHeader';
import {
LocalStorage,
SessionStorage,
......@@ -90,7 +90,7 @@ class SjdIndex extends React.Component {
</Sider>
}
<Layout>
<SjdHeader />
<HdqrHeader />
<Content
className={SjdIndexStyle.content}
style={{
......
......@@ -632,14 +632,20 @@ class ClassMgtForm extends React.Component {
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
<span className="hreflink" onClick={() => this.goClassInvite(record)}>班级报名</span>
<span className={pageStyle.divideline}>|</span>
{ hasBtnPower('sjd/classmgt', 'classjoin') &&
<span>
<span className="hreflink" onClick={() => this.goClassInvite(record)}>班级报名</span>
<span className={pageStyle.divideline}>|</span>
</span>
}
<span className="hreflink" onClick={() => this.goClassDetail(record, 2)}>学员管理</span>
<span className={pageStyle.divideline}>|</span>
<BtnPermission btnId="30002">
<span className="hreflink" onClick={() => this.goThemeMgt(record)}>主题管理</span>
<span className={pageStyle.divideline}>|</span>
</BtnPermission>
{hasBtnPower('sjd/classmgt', 'thememgt') &&
<BtnPermission btnId="30002">
<span className="hreflink" onClick={() => this.goThemeMgt(record)}>主题管理</span>
<span className={pageStyle.divideline}>|</span>
</BtnPermission>
}
{ hasBtnPower('sjd/classmgt', 'callStudent') &&
<span>
<span className="hreflink" onClick={() => this.goClassDetail(record, 3)}>点名</span>
......@@ -658,9 +664,11 @@ class ClassMgtForm extends React.Component {
<span className={pageStyle.divideline}>|</span>
</BtnPermission>
}
<BtnPermission btnId="30005">
<span className="hreflink" onClick={() => this.deleteClass(record)}>删除</span>
</BtnPermission>
{hasBtnPower('sjd/classmgt', 'delclass') &&
<BtnPermission btnId="30005">
<span className="hreflink" onClick={() => this.deleteClass(record)}>删除</span>
</BtnPermission>
}
</div>
);
},
......
......@@ -348,7 +348,16 @@ class StaticCenter extends React.Component {
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
{!record.call_time ? <div className={pageStyle.sizeColor1} onClick={() => this.toCallStudents(record)}><Badge color="#FF3434" />未点名</div> : <div className={pageStyle.sizeColor2} onClick={() => this.toEditCallStudents(record)}><Badge color="#7BD762" />已点名</div>}
{hasBtnPower('sjd/teacherinfo', 'callStudnet') &&
<span>
{!record.call_time ? <div className={pageStyle.sizeColor1} onClick={() => this.toCallStudents(record)}><Badge color="#FF3434" />未点名</div> : <div className={pageStyle.sizeColor2} onClick={() => this.toEditCallStudents(record)}><Badge color="#7BD762" />已点名</div>}
</span>
}
{!hasBtnPower('sjd/teacherinfo', 'callStudnet') &&
<span>
{!record.call_time ? <div className={pageStyle.sizeColor1}><Badge color="#FF3434" />未点名</div> : <div className={pageStyle.sizeColor2}><Badge color="#7BD762" />已点名</div>}
</span>
}
</div>
);
},
......
......@@ -1042,64 +1042,67 @@ class StaticCenter extends React.Component {
</div>
</div>
</Col>
<Col xs={{ span: 24 }} sm={{ span: 24 }} lg={{ span: 24 }} xl={{ span: 8 }} md={{ span: 24 }}>
<div className={pageStyle.makebox}>
<div className={pageStyle.cardtitle}>
<span>工作台</span>
</div>
<div className={pageStyle.makeitembox}>
<div className={pageStyle.makeitem} onClick={this.createTheme}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconb}`}>
<img src={`${__IMGCDN__}index/theme_1.png`} alt="" />
{hasBtnPower('sjd/indexstaic', 'planSchedule') &&
<Col xs={{ span: 24 }} sm={{ span: 24 }} lg={{ span: 24 }} xl={{ span: 8 }} md={{ span: 24 }}>
<div className={pageStyle.makebox}>
<div className={pageStyle.cardtitle}>
<span>工作台</span>
</div>
<div className={pageStyle.makeitembox}>
<div className={pageStyle.makeitem} onClick={this.createTheme}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconb}`}>
<img src={`${__IMGCDN__}index/theme_1.png`} alt="" />
</div>
<div className={pageStyle.themetypename}>新建作业打卡</div>
</div>
<div className={pageStyle.themetypename}>新建作业打卡</div>
</div>
</div>
<div className={pageStyle.makeitem} onClick={this.createCalendarTheme}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeicona}`}>
<img src={`${__IMGCDN__}index/theme_2.png`} alt="" />
<div className={pageStyle.makeitem} onClick={this.createCalendarTheme}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeicona}`}>
<img src={`${__IMGCDN__}index/theme_2.png`} alt="" />
</div>
<div className={pageStyle.themetypename}>新建日历打卡</div>
</div>
<div className={pageStyle.themetypename}>新建日历打卡</div>
</div>
</div>
<div className={pageStyle.makeitem} onClick={this.createUnlockTheme}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_3.png`} alt="" />
<div className={pageStyle.makeitem} onClick={this.createUnlockTheme}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_3.png`} alt="" />
</div>
<div className={pageStyle.themetypename}>新建闯关打卡</div>
</div>
<div className={pageStyle.themetypename}>新建闯关打卡</div>
</div>
</div>
<div className={pageStyle.makeitem} onClick={() => this.setModal1Visible(true)}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_4.png`} alt="" />
<div className={pageStyle.makeitem} onClick={() => this.setModal1Visible(true)}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_4.png`} alt="" />
</div>
<div className={pageStyle.themetypename}>学员报名</div>
</div>
<div className={pageStyle.themetypename}>学员报名</div>
</div>
</div>
<div className={pageStyle.makeitem} onClick={this.createClass}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_5.png`} alt="" />
<div className={pageStyle.makeitem} onClick={this.createClass}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_5.png`} alt="" />
</div>
<div className={pageStyle.themetypename}>新建班级</div>
</div>
<div className={pageStyle.themetypename}>新建班级</div>
</div>
</div>
<div className={pageStyle.makeitem} onClick={this.createCourse}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_6.png`} alt="" />
<div className={pageStyle.makeitem} onClick={this.createCourse}>
<div className={pageStyle.makeitemLeft}>
<div className={`${pageStyle.themeicon} ${pageStyle.themeiconc}`}>
<img src={`${__IMGCDN__}index/theme_6.png`} alt="" />
</div>
<div className={pageStyle.themetypename}>新建课程</div>
</div>
<div className={pageStyle.themetypename}>新建课程</div>
</div>
</div>
</div>
</div>
</Col>
</Col>
}
</Row>
{hasBtnPower('sjd/indexstaic', 'planSchedule') &&
<Card className={pageStyle.informList} bodyStyle={{ borderRadius: 6, padding: '36px 0' }} bordered={false}>
<Row gutter={24}>
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 1 }} lg={{ span: 4, offset: 0 }} xl={{ span: 4, offset: 0 }}>
......@@ -1155,6 +1158,7 @@ class StaticCenter extends React.Component {
}
</Row>
</Card>
}
</div>
<Row gutter={24}>
<Col span={24}>
......
......@@ -13,9 +13,9 @@
height: 147px;
background-color: #fff;
border-radius: 6px;
&:nth-child(1) {
margin-bottom: 14px;
}
margin-bottom: 14px;
// &:nth-child(1) {
// }
&:nth-child(2) {
.staticitembox {
.staticitem {
......@@ -206,7 +206,7 @@
}
.informList {
border-radius: 6px;
margin: 14px 0;
margin-bottom: 14px;
.informItem {
cursor: pointer;
text-align: center;
......
......@@ -284,7 +284,16 @@ class PersonManageForm extends React.Component {
render: (text, record, index) => {
return (
<div>
<Switch disabled={(!btnPermission(userPermission, 70002)) || record.type === 2} checked={text === 1} onChange={() => this.changeStatus(record)} /> {text === 1 ? '启用' : '禁用'}
{hasBtnPower('sjd/institutions', 'editInstitutions') &&
<div>
<Switch disabled={(!btnPermission(userPermission, 70002)) || record.type === 2} checked={text === 1} onChange={() => this.changeStatus(record)} /> {text === 1 ? '启用' : '禁用'}
</div>
}
{!hasBtnPower('sjd/institutions', 'editInstitutions') &&
<div>
<Switch disabled checked={text === 1} /> {text === 1 ? '启用' : '禁用'}
</div>
}
</div>
);
},
......@@ -297,7 +306,7 @@ class PersonManageForm extends React.Component {
return (
<div>
{
record.type === 1 ?
hasBtnPower('sjd/institutions', 'editInstitutions') && record.type === 1 ?
<div>
<BtnPermission btnId="70001">
<span className="hreflink" onClick={() => this.editPeople(record)}>编辑</span>
......@@ -308,7 +317,6 @@ class PersonManageForm extends React.Component {
</BtnPermission>
</div> : '-'
}
</div>
);
},
......
......@@ -940,14 +940,13 @@ class StudentMgt extends React.Component {
</BtnPermission>
}
{
record.status === 1 &&
hasBtnPower('sjd/student', 'delstudent') && record.status === 1 &&
<BtnPermission btnId="20004">
<span className="hreflink" onClick={() => this.toDeleteModal(record)}>删除</span>
<span className={pageStyle.divideline}>|</span>
</BtnPermission>
}
{
record.status === 2 &&
hasBtnPower('sjd/student', 'delstudent') && record.status === 2 &&
<span>
<span className="hreflink" onClick={() => this.toInSchoolStudent(record)}>转为在读学员</span>
<span className={pageStyle.divideline}>|</span>
......
......@@ -610,7 +610,16 @@ class teachersForm extends React.Component {
render: (text, record, index) => {
return (
<div className={pageStyle.tableoperatebox}>
{!record.call_time ? <div className={pageStyle.sizeColor1} onClick={() => this.toCallStudents(record)}><Badge color="#FF3434" />未点名</div> : <div className={pageStyle.sizeColor2} onClick={() => this.toEditCallStudents(record)}><Badge color="#7BD762" />已点名</div>}
{hasBtnPower('sjd/teacherinfo', 'callStudnet') &&
<span>
{!record.call_time ? <div className={pageStyle.sizeColor1} onClick={() => this.toCallStudents(record)}><Badge color="#FF3434" />未点名</div> : <div className={pageStyle.sizeColor2} onClick={() => this.toEditCallStudents(record)}><Badge color="#7BD762" />已点名</div>}
</span>
}
{!hasBtnPower('sjd/teacherinfo', 'callStudnet') &&
<span>
{!record.call_time ? <div className={pageStyle.sizeColor1}><Badge color="#FF3434" />未点名</div> : <div className={pageStyle.sizeColor2}><Badge color="#7BD762" />已点名</div>}
</span>
}
{/* {!record.call_time ? <div>未点名</div> : <span className="hreflink" >sss已点名</span>} */}
</div>
);
......
......@@ -936,10 +936,10 @@ function btnPermission(menus, btnId) {
const role = LocalStorage.getItem('role');
if (role == 2) {
flag = true;
} if (role == 5) {
flag = true;
} else if (menus.indexOf(btnId) == -1) {
flag = false;
} else {
flag = true;
}
return flag;
}
......
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