Commit f25a3534 authored by wangxuelai's avatar wangxuelai

''

parents 7a32c8d5 2f91843d
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<custom-configuration-file used="true" path="E:\work\biz.qingxiao.com\.eslintrc" />
</component>
</project>
\ No newline at end of file
......@@ -11,7 +11,7 @@
<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?1570804726564" rel="stylesheet">
<link href="/dist/index.css?1570847202572" rel="stylesheet">
<script src="/lib/vendor.dll.js?3" 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>
......@@ -24,7 +24,7 @@
<body>
<div id="root"></div>
<script src="/dist/index.js?1570804726564" charset="utf-8"></script>
<script src="/dist/index.js?1570847202572" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -75,6 +75,7 @@ export default {
studentsUnBindWx: `${dakaapi}member/erp/student/wechat/remove`,
},
teachers: `${dakaapi}member/erp/teachers`,
choose_teacher: `${dakaapi}member/erp/teacher/distribution`,
courses: {
courses: `${dakaapi}member/erp/courses`,
coursesBuyOrRenew: `${dakaapi}member/erp/course/make`,
......
......@@ -22,7 +22,7 @@ class CourseChart extends React.Component {
});
}
calculateStyle = (info) => {
const colorList = ['#FF9A6C', '#FF5971', '#82D7FE', '#38E0C9', '#BD9FFF'];
const colorList = ['#FF9A6C', '#FF5971', '#82D7FE', '#38E0C9', '#BD9FFF', '#ffd338', '#35c13a'];
const dayStartTimestamp = new Date(`${info.start_date} 06:00`.replace(/-/g, '/'));
const dayEndTimestamp = new Date(`${info.start_date} 23:59`.replace(/-/g, '/'));
const dayTotalTimestamp = (dayEndTimestamp.getTime() - dayStartTimestamp.getTime()) + 3600000;
......
......@@ -114,21 +114,23 @@ class SjdMenu extends React.Component {
))}
</div>
}
{!isDepartment &&
<div className={SjdHeaderStyle.useraccount}>
<span className={SjdHeaderStyle.usermobile}>{(schoolUserInfo && schoolUserInfo.nickname) || ''}</span>
<img alt={(schoolUserInfo && schoolUserInfo.name) || ''} src={(schoolUserInfo && imagify(schoolUserInfo.avatar)) || ''} className={SjdHeaderStyle.avator} />
</div>
}
{isDepartment &&
<div className={SjdHeaderStyle.useraccount}>
<span className={SjdHeaderStyle.usermobile}>{(userInfo && userInfo.nickname) || ''}</span>
<img alt={(userInfo && userInfo.name) || ''} src={(userInfo && imagify(schoolUserInfo.avatar)) || ''} className={SjdHeaderStyle.avator} />
</div>
}
<div className={SjdHeaderStyle.accountoperate}>
<Dropdown overlay={menu} trigger={['click']}>
<Icon type="caret-down" className={SjdHeaderStyle.caretDown} />
<Dropdown overlay={menu}>
<div className={SjdHeaderStyle.accountoperate}>
<Icon type="caret-down" className={SjdHeaderStyle.caretDown} />
{!isDepartment &&
<div className={SjdHeaderStyle.useraccount}>
<span className={SjdHeaderStyle.usermobile}>{(schoolUserInfo && schoolUserInfo.nickname) || ''}</span>
<img alt={(schoolUserInfo && schoolUserInfo.name) || ''} src={(schoolUserInfo && imagify(schoolUserInfo.avatar)) || ''} className={SjdHeaderStyle.avator} />
</div>
}
{isDepartment &&
<div className={SjdHeaderStyle.useraccount}>
<span className={SjdHeaderStyle.usermobile}>{(userInfo && userInfo.nickname) || ''}</span>
<img alt={(userInfo && userInfo.name) || ''} src={(userInfo && imagify(schoolUserInfo.avatar)) || ''} className={SjdHeaderStyle.avator} />
</div>
}
</div>
</Dropdown>
</div>
</Header>
......
......@@ -72,3 +72,10 @@
color: #fff;
}
}
:global {
.ant-menu.ant-menu-dark .ant-menu-item:hover {
background-color: #1890FF;
color: rgba(254, 254, 254, 1);
border-left: 5px solid #FFFFFF;
}
}
......@@ -39,6 +39,15 @@ export default {
value: 5,
color: '#BD9FFF',
},
{
value: 6,
color: '#ffd338',
},
{
value: 7,
color: '#35c13a',
},
],
editCourseInfo: {
id: 0,
......@@ -238,6 +247,14 @@ export default {
value: 5,
color: '#BD9FFF',
},
{
value: 6,
color: '#ffd338',
},
{
value: 7,
color: '#35c13a',
},
],
editCourseInfo: {
id: 0,
......
......@@ -9,6 +9,9 @@ import {
import errorcode from '../common/errorcode';
import * as teachersAjax from '../services/teachers';
import * as commonAjax from '../services/common';
import * as courseAjax from '../services/course';
import classmgt from './classmgt';
import * as classMgtAjax from '../services/classmgt';
export default {
namespace: 'teachers',
state: {
......@@ -51,8 +54,11 @@ export default {
invitationTeacherList: [],
invitationTeacherTotal: 0,
invitationShow: false,
inviteCodeShow: false,
inviteCode: '',
chooseClassVisible: false,
coursesList: [],
teacher_id: 0, // 老师id
allClassList: [],
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -331,6 +337,90 @@ export default {
// message.error(teacherstatus.msg, 1);
}
},
* checkClass({ payload }, { call, put, select }) {
const { courseId } = payload;
const { teacher_id } = yield select(state => state.teachers);
const { sid } = yield select(state => state.webapp);
const classInfo = yield call(classMgtAjax.getClassList, {
school_id: sid,
page: 1,
perPage: 100,
extra: 'teacher.course',
course_id: courseId,
check_in_class_teacher_id: teacher_id,
});
if (classInfo.code == 200) {
const Classlist = classInfo.data.list;
const defaultClassValues = [];
for (let i = 0; i < Classlist.length; i++) {
if (Classlist[i].teacher_in_class === true) {
defaultClassValues.push(Classlist[i].id);
}
}
yield put({
type: 'updateState',
payload: {
sid,
allClassList: classInfo.data && classInfo.data.list,
defaultClassValues,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: classInfo,
},
});
}
},
* saveChooseClass({ payload }, { call, put, select }) {
const { value } = payload;
const { class_ids, callBack } = value;
const { teacher_id, submitting } = yield select(state => state.teachers);
const { sid } = yield select(state => state.webapp);
if (submitting) {
return;
}
yield put({
type: 'updateState',
payload: {
submitting: true,
},
});
const loadmessage = message.loading('数据保存中...', 0);
const res = yield call(teachersAjax.teachersChoose, {
class_ids: JSON.stringify(class_ids),
teacher_id,
});
yield put({
type: 'updateState',
payload: {
submitting: false,
},
});
setTimeout(loadmessage);
if (res.code === 200) {
yield put({
type: 'updateState',
payload: {
chooseClassVisible: false,
teacher_id: 0,
allClassList: [],
},
});
if (callBack && (typeof callBack == 'function')) {
callBack();
}
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data: res,
},
});
}
},
* pageInit({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
......@@ -374,6 +464,13 @@ export default {
invitationTeacherList: [],
invitationTeacherTotal: 0,
invitationShow: false,
chooseClassVisible: false,
coursesList: [],
teacher_id: 0,
allClassList: [],
courseList: [],
classIdList: [],
courseId: '',
},
});
},
......
......@@ -858,9 +858,9 @@ export default {
},
* judgeexpire({ payload }, { put, select }) {
const webapp = yield select(state => state.webapp);
const { userInfo } = webapp;
const isexpire = isOnline((userInfo && userInfo.expiresDateTime) || 0);
if (!isexpire) {
const userInfo = LocalStorage.getItem('user') || {};
const systemIsOnline = isOnline((userInfo && userInfo.expiresDateTime) || 0);
if (systemIsOnline) {
window.location.href = `${location.protocol}//${location.hostname}${location.port == '' ? '' : `:${location.port}`}${location.pathname}#/erp/schoollist`;
}
},
......
......@@ -134,6 +134,18 @@ class DrawImg extends React.Component {
}
that.drawcanvas.width = this.state.canvasSizeObj.width;
that.drawcanvas.height = this.state.canvasSizeObj.height;
this.drawrectcanvas = document.getElementById('drawrectcanvas');
this.drawrectcontext = this.drawrectcanvas.getContext('2d');
this.drawrectcanvas.width = this.state.canvasSizeObj.width;
this.drawrectcanvas.height = this.state.canvasSizeObj.height;
this.drawcirclecanvas = document.getElementById('drawcirclecanvas');
this.drawcirclecontext = this.drawcirclecanvas.getContext('2d');
this.drawcirclecanvas.width = this.state.canvasSizeObj.width;
this.drawcirclecanvas.height = this.state.canvasSizeObj.height;
this.drawarrowcanvas = document.getElementById('drawarrowcanvas');
this.drawarrowcontext = this.drawarrowcanvas.getContext('2d');
this.drawarrowcanvas.width = this.state.canvasSizeObj.width;
this.drawarrowcanvas.height = this.state.canvasSizeObj.height;
this.setState({
imageLoading: false,
});
......@@ -155,28 +167,16 @@ class DrawImg extends React.Component {
this.setState({
action,
});
this.drawrectcanvas = document.getElementById('drawrectcanvas');
this.drawrectcontext = this.drawrectcanvas.getContext('2d');
this.drawrectcanvas.width = this.state.canvasSizeObj.width;
this.drawrectcanvas.height = this.state.canvasSizeObj.height;
break;
case 2:
this.setState({
action,
});
this.drawcirclecanvas = document.getElementById('drawcirclecanvas');
this.drawcirclecontext = this.drawcirclecanvas.getContext('2d');
this.drawcirclecanvas.width = this.state.canvasSizeObj.width;
this.drawcirclecanvas.height = this.state.canvasSizeObj.height;
break;
case 3:
this.setState({
action,
});
this.drawarrowcanvas = document.getElementById('drawarrowcanvas');
this.drawarrowcontext = this.drawarrowcanvas.getContext('2d');
this.drawarrowcanvas.width = this.state.canvasSizeObj.width;
this.drawarrowcanvas.height = this.state.canvasSizeObj.height;
break;
case 4:
this.setState({
......@@ -300,7 +300,7 @@ class DrawImg extends React.Component {
}
chooseImg = (obj) => {
const { copysrc } = obj;
const { currentDrawImage } = this.state;
const { currentDrawImage, action } = this.state;
if (currentDrawImage == copysrc) {
return;
}
......@@ -311,16 +311,32 @@ class DrawImg extends React.Component {
// },
// });
this.drawImageToFinalCanvas(() => {
this.setState({
currentDrawImage: copysrc,
});
if (action == 5) {
this.setState({
currentDrawImage: copysrc,
action: 0,
});
} else {
this.setState({
currentDrawImage: copysrc,
// action: 0,
});
}
this.caculateImgWidth(copysrc);
this.drawTrail = [];
});
} else {
this.setState({
currentDrawImage: copysrc,
});
if (action == 5) {
this.setState({
currentDrawImage: copysrc,
action: 0,
});
} else {
this.setState({
currentDrawImage: copysrc,
// action: 0,
});
}
this.caculateImgWidth(copysrc);
this.drawTrail = [];
}
......@@ -1309,6 +1325,7 @@ class DrawImg extends React.Component {
</div>
<div className={pageStyle.drawactionname}>撤销</div>
</div>
{/*
<div className={`${pageStyle.drawoperateitem} ${pageStyle.hoverdrawoperateitem}`} onClick={() => this.doaction(7)}>
<div className={`${pageStyle.iconbox} ${action == 7 ? pageStyle.iconboxselected : ''}`}>
<div className={pageStyle.tobig} />
......@@ -1321,8 +1338,9 @@ class DrawImg extends React.Component {
</div>
<div className={pageStyle.drawactionname}>缩小</div>
</div>
*/}
<div className={pageStyle.commonbtnbox}>
<div className={pageStyle.skipdrawbtn} onClick={this.skipDraw}>跳过涂鸦<br />直接批量打分</div>
<div className={pageStyle.skipdrawbtn} onClick={this.skipDraw}>跳过标记<br />直接批量打分</div>
<div className={pageStyle.drawcompletebtn} onClick={this.completeAllDraw}>完成</div>
</div>
</div>
......
......@@ -2,7 +2,7 @@
.drawModalBox {
.drawModalContent {
position: relative;
margin: 0 auto 40px;
margin: 22px auto 40px;
.canvastextFloat {
position: absolute;
z-index: 15;
......@@ -52,7 +52,7 @@
border: 1px dashed red;
word-break: break-all;
padding: 10px;
background-color: rgba(255, 255, 255, 0.6);
background-color: rgba(192,192,192, 0.9);
// position: fixed;
// top: 0;
// left: 0;
......@@ -100,9 +100,9 @@
.imagegallery {
display: flex;
align-items: flex-end;
margin: 24px 24px 0;
margin: 24px 24px 20px;
// padding-left: 24px;
overflow-x: scroll;
overflow-x: auto;
.imageitembox {
position: relative;
width: 64px;
......@@ -321,7 +321,7 @@
}
.finaldrawcanvas {
position: fixed;
left: 0;
top: -2000px;
left: -5000px;
top: -5000px;
z-index: 1000;
}
\ No newline at end of file
import { connect } from 'dva';
import React from 'react';
import { Icon, Button, Row, Col, Input, Select, Checkbox, Table, Modal, Form, Alert, message } from 'antd';
import pageStyle from './ChooseClassModal.less';
import { pageIn } from '../../utils/index';
const { Option } = Select;
const { TextArea } = Input;
const FormItem = Form.Item;
const CheckboxGroup = Checkbox.Group;
class ChooseClassModal extends React.Component {
componentDidMount() { // 挂载
pageIn('班级管理');
}
componentWillUnmount() { // 卸载
}
save = () => {
const {
form, save,
} = this.props;
form.validateFields((err, values) => {
if (!err) {
const {
class_ids,
} = values;
save({
class_ids,
callBack: () => {
form.resetFields();
},
});
}
});
}
close = () => {
const { form, close } = this.props;
form.resetFields();
close();
}
render() {
const {
visible,
submitting,
courseList,
selectChange,
classList,
handleCheckClass,
form: { getFieldDecorator, getFieldValue },
defaultClassValues,
} = this.props;
const formItemModalLineLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
},
};
return (
<Modal
visible={visible}
title="选班"
okText={submitting ? '保存中...' : '保存'}
onCancel={this.close}
onOk={this.save}
width={570}
heigh={432}
confirmLoading={submitting}
>
<Form labelAlign="left">
<FormItem {...formItemModalLineLayout} label="课程">
{getFieldDecorator('course_id', {
rules: [
{
required: true,
message: '请选择课程',
},
],
})(
<Select className={pageStyle.selectitem} placeholder="请选择课程" onChange={e => selectChange(e)}>
<Option value="">全部课程</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>,
)}
</FormItem>
{courseList.length > 0 &&
<div className={pageStyle.checkwrap}>
<FormItem {...formItemModalLineLayout}>
{getFieldDecorator('class_ids', {
initialValue: defaultClassValues,
rules: [
{
required: true,
message: '请选择班级',
},
],
})(
<CheckboxGroup
onChange={e => handleCheckClass(e)}
>
{ classList.map((item, index) =>
<div className={pageStyle.listwrap}> <Checkbox disabled={!item.can_cancel} value={item.id}>{item.title}</Checkbox></div>,
)}
</CheckboxGroup>,
)}
</FormItem>
</div> }
</Form>
</Modal>
);
}
}
ChooseClassModal.propTypes = {
};
const ChooseClass = Form.create()(ChooseClassModal);
export default ChooseClass;
.checkwrap {
:global {
.ant-form-item-control-wrapper {
width: 100%;
max-height: 300px;
overflow-y: scroll;
}
.ant-checkbox-group {
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
}
}
}
.listwrap {
width: 50%;
margin-bottom: 10px;
}
import { connect } from 'dva';
import React from 'react';
import { Icon, Button, Row, Col, Input, Select, Modal, InputNumber, Radio, Table, Form, Pagination } from 'antd';
import { Icon, Button, Row, Col, Input, Select, Modal, InputNumber, Radio, Table, Form, Pagination, message } from 'antd';
import pageStyle from './index.less';
import EditTeacher from './EditTeacher';
import InviteCodeDialog from '../../components/InviteCodeDialog';
import ChooseClass from './ChooseClassModal';
import { pageIn, hasBtnPower } from '../../utils/index';
import CouponAddModal from '../integralmanage/storesetting/CouponAddModal';
const { Option } = Select;
const { TextArea } = Input;
......@@ -193,6 +195,63 @@ class ClassMgt extends React.Component {
},
});
}
handleChooseClass = (record) => {
const { dispatch } = this.props;
dispatch({
type: 'teachers/updateState',
payload: {
chooseClassVisible: true,
teacher_id: record.id,
},
});
dispatch({
type: 'teachers/courseModelList',
payload: {
},
});
}
closeChooseClass = () => {
const { dispatch } = this.props;
dispatch({
type: 'teachers/updateState',
payload: {
chooseClassVisible: false,
teacher_id: 0,
allClassList: [],
courseListModal: [],
classIdList: [],
courseId: 0,
},
});
}
selectChangeCourse = (e) => {
const { dispatch } = this.props;
dispatch({
type: 'teachers/checkClass',
payload: {
chooseClassVisible: false,
courseId: e,
},
});
}
handleCheckClass = (e) => {
const { dispatch } = this.props;
dispatch({
type: 'teachers/updateState',
payload: {
classIdList: e,
},
});
}
saveChooseClass = (value) => {
const { dispatch } = this.props;
dispatch({
type: 'teachers/saveChooseClass',
payload: {
value,
},
});
}
render() {
const {
teachersinfo,
......@@ -209,6 +268,10 @@ class ClassMgt extends React.Component {
invitationShow,
inviteCodeShow,
inviteCode,
chooseClassVisible,
allClassList,
submitting,
defaultClassValues,
} = this.props;
const { getFieldDecorator } = this.props.form;
const columns = [
......@@ -289,6 +352,18 @@ class ClassMgt extends React.Component {
);
},
},
{
title: '启动状态',
dataIndex: 'status',
key: 'status',
render: (text, record) => {
return (
<div>
<a href="javascript:;" onClick={() => this.handleChooseClass(record)} >选班</a>
</div>
);
},
},
];
return (
<div className={pageStyle.container}>
......@@ -369,6 +444,17 @@ class ClassMgt extends React.Component {
editTeacherInfo={editTeacherInfo}
editType="add"
/>
<ChooseClass
visible={chooseClassVisible}
close={this.closeChooseClass}
save={this.saveChooseClass}
courseList={courseList}
selectChange={this.selectChangeCourse}
classList={allClassList}
submitting={submitting}
handleCheckClass={this.handleCheckClass}
defaultClassValues={defaultClassValues}
/>
<Modal
visible={invitationShow}
title={<span style={{ fontSize: '16px', fontWeight: 700 }}>老师加入通知</span>}
......@@ -430,6 +516,11 @@ function mapStateToProps(state) {
invitationShow,
inviteCodeShow,
inviteCode,
chooseClassVisible,
teacher_id,
allClassList,
submitting,
defaultClassValues,
} = state.teachers;
const {
courseList,
......@@ -449,6 +540,11 @@ function mapStateToProps(state) {
invitationShow,
inviteCodeShow,
inviteCode,
chooseClassVisible,
teacher_id,
allClassList,
submitting,
defaultClassValues,
};
}
export default connect(mapStateToProps)(ForgotPassword);
......
......@@ -16,6 +16,15 @@ export function teachersAdd(params) {
data,
});
}
export function teachersChoose(params) {
const data = qs.stringify(params);
return request({
url: `${api.choose_teacher}`,
method: 'POST',
data,
});
}
export function teachersPut(params) {
const data = qs.stringify(params);
return request({
......
......@@ -128,7 +128,7 @@ export function translateType(type) {
}
function isOnline(expiredate) {
const nowTime = Math.floor(Date.now() / 1000);
if (expiredate > nowTime || expiredate == 0) {
if (expiredate > nowTime && expiredate != 0) {
return true;
}
return false;
......
......@@ -12,6 +12,7 @@ module.exports = {
'cropper',
'bizcharts',
'xlsx',
'clipboard'
],
},
output: {
......
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