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
df2d853f
Commit
df2d853f
authored
Aug 19, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
3130d81f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
733 additions
and
4 deletions
+733
-4
api.js
src/common/api.js
+1
-0
students.js
src/models/students.js
+88
-0
SelfJoin.js
src/pages/student/SelfJoin.js
+455
-0
SelfJoin.less
src/pages/student/SelfJoin.less
+7
-0
index.js
src/pages/student/index.js
+145
-4
common.js
src/services/common.js
+37
-0
No files found.
src/common/api.js
View file @
df2d853f
...
...
@@ -21,6 +21,7 @@ export default {
generateQrcode
:
`
${
dakaapi
}
common/qr_code_unlimit`
,
myNickname
:
`
${
dakaapi
}
member/me`
,
schedulesTime
:
`
${
dakaapi
}
member/erp/schedules_time`
,
courseTemplate
:
`
${
dakaapi
}
member/erp/course_template`
,
newLogin
:
{
loginPost
:
`
${
dakaapi
}
common/business_login`
,
},
...
...
src/models/students.js
View file @
df2d853f
...
...
@@ -12,6 +12,7 @@ import * as studentsAjax from '../services/students';
import
*
as
teachersAjax
from
'../services/teachers'
;
import
*
as
courseAjax
from
'../services/course'
;
import
*
as
classMgtAjax
from
'../services/classmgt'
;
import
*
as
commonAjax
from
'../services/common'
;
export
default
{
namespace
:
'students'
,
...
...
@@ -107,6 +108,19 @@ export default {
id
:
''
,
nickname
:
''
,
},
courseModuleList
:
[],
courseModuleTotal
:
0
,
selfJoinShow
:
false
,
queryCourseModuleLoading
:
false
,
courseModuleInfo
:
{
id
:
0
,
teacher_id
:
''
,
course_id
:
''
,
mode_type
:
''
,
buy
:
''
,
give
:
''
,
class_ids
:
''
,
},
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// eslint-disable-line
...
...
@@ -651,6 +665,80 @@ export default {
message
.
error
(
classListData
.
msg
);
}
},
// 自主报名相关代码
*
queryCourseModule
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
queryCourseModuleLoading
}
=
yield
select
(
state
=>
state
.
students
);
yield
put
({
type
:
'updateState'
,
payload
:
{
queryCourseModuleLoading
:
true
,
},
});
const
listData
=
yield
call
(
commonAjax
.
courseTemplateList
,
{
school_id
:
sid
,
});
yield
put
({
type
:
'updateState'
,
payload
:
{
queryCourseModuleLoading
:
false
,
},
});
if
(
listData
.
code
==
200
)
{
// courseModuleList: [],
// courseModuleTotal: 0,
yield
put
({
type
:
'updateState'
,
payload
:
{
courseModuleTotal
:
listData
.
data
.
total
,
courseModuleList
:
listData
.
data
.
list
,
},
});
}
else
{
message
.
error
(
listData
.
msg
,
1
);
}
},
*
saveAddCourseModule
({
payload
},
{
call
,
put
,
select
})
{
const
{
values
,
callback
,
errorCallback
}
=
payload
;
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
saveData
=
yield
call
(
commonAjax
.
courseTemplateAdd
,
{
school_id
:
sid
,
teacher_id
:
values
.
operator_id
,
course_id
:
values
.
course_id
,
mode_type
:
values
.
mode_type
,
buy
:
values
.
buy
||
0
,
give
:
values
.
give
||
0
,
class_ids
:
!
values
.
class_ids
?
''
:
values
.
class_ids
.
join
(
','
),
});
if
(
saveData
.
code
==
200
)
{
yield
put
({
type
:
'queryCourseModule'
,
});
if
(
callback
&&
(
typeof
callback
==
'function'
))
{
callback
();
}
}
else
{
if
(
errorCallback
&&
(
typeof
errorCallback
==
'function'
))
{
errorCallback
();
}
message
.
error
(
saveData
.
msg
,
1
);
}
},
*
delCourseModule
({
payload
},
{
call
,
put
,
select
})
{
const
{
info
}
=
payload
;
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
delData
=
yield
call
(
commonAjax
.
courseTemplateDelete
,
{
id
:
info
.
id
,
});
if
(
delData
.
code
==
200
)
{
message
.
success
(
'删除成功'
,
1
);
yield
put
({
type
:
'queryCourseModule'
,
});
}
else
{
message
.
error
(
delData
.
msg
,
1
);
}
},
},
reducers
:
{
save
(
state
,
action
)
{
...
...
src/pages/student/SelfJoin.js
0 → 100644
View file @
df2d853f
This diff is collapsed.
Click to expand it.
src/pages/student/SelfJoin.less
0 → 100644
View file @
df2d853f
.changeOperate {
margin-left: 10px;
}
.divideline {
color: #E9E9E9;
padding: 0 8px;
}
\ No newline at end of file
src/pages/student/index.js
View file @
df2d853f
...
...
@@ -6,15 +6,13 @@ import { pageIn, hasBtnPower } from '../../utils/index';
import
RenewEdit
from
'./RenewEdit'
;
import
OperatorChange
from
'../../components/operatorChange'
;
import
EliminateEdit
from
'./eliminateEdit'
;
import
SelfJoin
from
'./SelfJoin'
;
import
StudentAdd
from
'./StudentAdd'
;
const
{
Option
}
=
Select
;
const
{
TextArea
}
=
Input
;
class
StudentMgt
extends
React
.
Component
{
state
=
{
cage
:
0
,
// ages: 0,
// addVisible: false,
// delVisible: false,
};
componentDidMount
()
{
// 挂载
pageIn
(
'学员管理'
);
...
...
@@ -260,6 +258,116 @@ class StudentMgt extends React.Component {
},
});
}
// 自主报名相关代码
toSetSelfJoin
=
()
=>
{
const
{
dispatch
,
schoolUserInfo
}
=
this
.
props
;
dispatch
({
type
:
'students/updateState'
,
payload
:
{
selfJoinShow
:
true
,
operator
:
{
...
schoolUserInfo
},
},
});
dispatch
({
type
:
'students/queryCourseModule'
,
});
}
hideSelfJoin
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'students/updateState'
,
payload
:
{
selfJoinShow
:
false
,
},
});
}
saveAddCourseModule
=
(
values
,
callback
,
errorCallback
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'students/saveAddCourseModule'
,
payload
:
{
values
,
callback
,
errorCallback
,
},
});
}
delCourseModule
=
(
info
)
=>
{
const
{
dispatch
}
=
this
.
props
;
Modal
.
confirm
({
title
:
'确定删除报名课程模板吗?'
,
okButtonProps
:
{
type
:
'danger'
,
style
:
{
color
:
'#fff'
,
backgroundColor
:
'#ff4d4f'
,
borderColor
:
'#ff4d4f'
,
},
},
centered
:
true
,
icon
:
<
Icon
type
=
"close-circle"
style
=
{{
color
:
'red'
}}
/>
,
onOk
:
()
=>
{
dispatch
({
type
:
'students/delCourseModule'
,
payload
:
{
info
,
},
});
},
});
}
editCourseModule
=
(
info
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'students/updateState'
,
payload
:
{
courseModuleInfo
:
{
id
:
info
.
id
,
teacher_id
:
info
.
operator_id
,
course_id
:
info
.
course_id
,
mode_type
:
info
.
course_mode
,
buy
:
info
.
buy
,
give
:
info
.
give
,
class_ids
:
JSON
.
parse
(
info
.
class_ids
),
},
},
});
}
closeCourseQrcode
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'students/updateState'
,
payload
:
{
courseModuleInfo
:
{
id
:
0
,
teacher_id
:
''
,
course_id
:
''
,
mode_type
:
''
,
buy
:
''
,
give
:
''
,
class_ids
:
''
,
},
},
});
}
toAddCourseQrcode
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'students/updateState'
,
payload
:
{
courseModuleInfo
:
{
id
:
0
,
teacher_id
:
''
,
course_id
:
''
,
mode_type
:
''
,
buy
:
''
,
give
:
''
,
class_ids
:
''
,
},
},
});
}
// 自主报名相关代码
render
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
...
...
@@ -285,6 +393,11 @@ class StudentMgt extends React.Component {
schoolUserInfo
,
changeOperatorShow
,
operator
,
selfJoinShow
,
queryCourseModuleLoading
,
courseModuleTotal
,
courseModuleList
,
courseModuleInfo
,
}
=
this
.
props
;
const
columns
=
[
{
...
...
@@ -386,7 +499,7 @@ class StudentMgt extends React.Component {
<
div
className
=
{
pageStyle
.
headerbox
}
>
{
hasBtnPower
(
'sjd/student'
,
'addStudent'
)
&&
<
Button
icon
=
"plus"
className
=
{
pageStyle
.
headerbtn
}
type
=
"primary"
onClick
=
{()
=>
this
.
setModal1Visible
(
true
)}
>
添加
<
/Button>
}
{
/* <Button className={pageStyle.headerbtn}>批量操作</Button> */
}
{
hasBtnPower
(
'sjd/student'
,
'enrolCode'
)
&&
<
Button
className
=
{
pageStyle
.
headerbtn
}
>
自助报名二维码
<
/Button>
}
{
hasBtnPower
(
'sjd/student'
,
'enrolCode'
)
&&
<
Button
className
=
{
pageStyle
.
headerbtn
}
onClick
=
{
this
.
toSetSelfJoin
}
>
自助报名二维码
<
/Button>
}
{
hasBtnPower
(
'sjd/student'
,
'bundlingCode'
)
&&
<
Button
className
=
{
pageStyle
.
headerbtn
}
>
自助绑定二维码
<
/Button>
}
<
/div
>
<
div
className
=
{
pageStyle
.
search
}
>
...
...
@@ -547,6 +660,24 @@ class StudentMgt extends React.Component {
onHide
=
{()
=>
this
.
toChangeOperator
(
false
)}
sureOperateChange
=
{
this
.
sureOperateChange
}
/
>
<
SelfJoin
courseList
=
{
courseList
}
classList
=
{
courseRelateClassList
}
searchCourseRelateClass
=
{
this
.
searchCourseRelateClass
}
saveAddCourseModule
=
{
this
.
saveAddCourseModule
}
operator
=
{
operator
}
toChangeOperator
=
{
this
.
toChangeOperator
}
visible
=
{
selfJoinShow
}
hide
=
{
this
.
hideSelfJoin
}
queryCourseModuleLoading
=
{
queryCourseModuleLoading
}
courseModuleTotal
=
{
courseModuleTotal
}
courseModuleList
=
{
courseModuleList
}
delCourseModule
=
{
this
.
delCourseModule
}
courseModuleInfo
=
{
courseModuleInfo
}
editCourseModule
=
{
this
.
editCourseModule
}
closeCourseQrcode
=
{
this
.
closeCourseQrcode
}
toAddCourseQrcode
=
{
this
.
toAddCourseQrcode
}
/
>
<
/div
>
);
}
...
...
@@ -577,6 +708,11 @@ function mapStateToProps(state) {
teacherList
,
changeOperatorShow
,
operator
,
selfJoinShow
,
queryCourseModuleLoading
,
courseModuleTotal
,
courseModuleList
,
courseModuleInfo
,
}
=
state
.
students
;
const
{
schoolUserInfo
,
...
...
@@ -603,6 +739,11 @@ function mapStateToProps(state) {
schoolUserInfo
,
changeOperatorShow
,
operator
,
selfJoinShow
,
queryCourseModuleLoading
,
courseModuleTotal
,
courseModuleList
,
courseModuleInfo
,
};
}
export
default
connect
(
mapStateToProps
)(
ForgotPassword
);
...
...
src/services/common.js
View file @
df2d853f
...
...
@@ -29,3 +29,40 @@ export function schedulesTimeList(params) {
method
:
'GET'
,
});
}
export
function
courseTemplateList
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
courseTemplate
}
?
${
data
}
`
,
method
:
'GET'
,
});
}
export
function
courseTemplateAdd
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
courseTemplate
}
`
,
method
:
'POST'
,
data
,
});
}
export
function
courseTemplateUpdate
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
courseTemplate
}
/
${
params
.
id
}
`
,
method
:
'PUT'
,
data
,
});
}
export
function
courseTemplateDelete
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
courseTemplate
}
/
${
params
.
id
}
`
,
method
:
'DELETE'
,
});
}
export
function
courseTemplateDetail
(
params
)
{
const
data
=
qs
.
stringify
(
params
);
return
request
({
url
:
`
${
api
.
courseTemplate
}
/
${
params
.
id
}
`
,
method
:
'GET'
,
});
}
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