Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
biz.qingxiao.com
Commits
f25a3534
Commit
f25a3534
authored
Oct 12, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Plain Diff
''
parents
7a32c8d5
2f91843d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
487 additions
and
123 deletions
+487
-123
eslint.xml
.idea/jsLinters/eslint.xml
+6
-0
index.html
index.html
+2
-2
vendor-manifest.json
lib/vendor-manifest.json
+1
-1
vendor.dll.js
lib/vendor.dll.js
+42
-73
api.js
src/common/api.js
+1
-0
CourseChart.js
src/components/CourseChart.js
+1
-1
SjdHeader.js
src/components/SjdHeader.js
+16
-14
SjdMenu.less
src/components/SjdMenu.less
+7
-0
course.js
src/models/course.js
+17
-0
teachers.js
src/models/teachers.js
+98
-1
webapp.js
src/models/webapp.js
+3
-3
drawimg.js
src/pages/clockmgt/drawimg.js
+38
-20
drawimg.less
src/pages/clockmgt/drawimg.less
+6
-6
ChooseClassModal.js
src/pages/teacher/ChooseClassModal.js
+122
-0
ChooseClassModal.less
src/pages/teacher/ChooseClassModal.less
+19
-0
index.js
src/pages/teacher/index.js
+97
-1
teachers.js
src/services/teachers.js
+9
-0
index.js
src/utils/index.js
+1
-1
webpack.dll.config.js
webpackconfig/webpack.dll.config.js
+1
-0
No files found.
.idea/jsLinters/eslint.xml
0 → 100644
View file @
f25a3534
<?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
index.html
View file @
f25a3534
...
...
@@ -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?15708
04726564
"
rel=
"stylesheet"
>
<link
href=
"/dist/index.css?15708
47202572
"
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?15708
04726564
"
charset=
"utf-8"
></script>
<script
src=
"/dist/index.js?15708
47202572
"
charset=
"utf-8"
></script>
</body>
</html>
\ No newline at end of file
lib/vendor-manifest.json
View file @
f25a3534
This source diff could not be displayed because it is too large. You can
view the blob
instead.
lib/vendor.dll.js
View file @
f25a3534
This diff is collapsed.
Click to expand it.
src/common/api.js
View file @
f25a3534
...
...
@@ -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`
,
...
...
src/components/CourseChart.js
View file @
f25a3534
...
...
@@ -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
;
...
...
src/components/SjdHeader.js
View file @
f25a3534
...
...
@@ -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
>
...
...
src/components/SjdMenu.less
View file @
f25a3534
...
...
@@ -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;
}
}
src/models/course.js
View file @
f25a3534
...
...
@@ -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
,
...
...
src/models/teachers.js
View file @
f25a3534
...
...
@@ -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
:
''
,
},
});
},
...
...
src/models/webapp.js
View file @
f25a3534
...
...
@@ -858,9 +858,9 @@ export default {
},
*
judgeexpire
({
payload
},
{
put
,
select
})
{
const
webapp
=
yield
select
(
state
=>
state
.
webapp
);
const
{
userInfo
}
=
webapp
;
const
isexpir
e
=
isOnline
((
userInfo
&&
userInfo
.
expiresDateTime
)
||
0
);
if
(
!
isexpir
e
)
{
const
userInfo
=
LocalStorage
.
getItem
(
'user'
)
||
{}
;
const
systemIsOnlin
e
=
isOnline
((
userInfo
&&
userInfo
.
expiresDateTime
)
||
0
);
if
(
systemIsOnlin
e
)
{
window
.
location
.
href
=
`
${
location
.
protocol
}
//
${
location
.
hostname
}${
location
.
port
==
''
?
''
:
`:
${
location
.
port
}
`
}${
location
.
pathname
}
#/erp/schoollist`
;
}
},
...
...
src/pages/clockmgt/drawimg.js
View file @
f25a3534
...
...
@@ -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
>
...
...
src/pages/clockmgt/drawimg.less
View file @
f25a3534
...
...
@@ -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: -
2
000px;
left:
-5000px
;
top: -
5
000px;
z-index: 1000;
}
\ No newline at end of file
src/pages/teacher/ChooseClassModal.js
0 → 100644
View file @
f25a3534
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
;
src/pages/teacher/ChooseClassModal.less
0 → 100644
View file @
f25a3534
.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;
}
src/pages/teacher/index.js
View file @
f25a3534
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
);
...
...
src/services/teachers.js
View file @
f25a3534
...
...
@@ -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
({
...
...
src/utils/index.js
View file @
f25a3534
...
...
@@ -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
;
...
...
webpackconfig/webpack.dll.config.js
View file @
f25a3534
...
...
@@ -12,6 +12,7 @@ module.exports = {
'cropper'
,
'bizcharts'
,
'xlsx'
,
'clipboard'
],
},
output
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment