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
1b0439ce
Commit
1b0439ce
authored
Aug 26, 2019
by
sujie@126.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
f6e9754e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
160 additions
and
11 deletions
+160
-11
api.js
src/common/api.js
+1
-0
classdetail.js
src/models/classdetail.js
+25
-1
indexstaic.js
src/models/indexstaic.js
+26
-1
studentclass.js
src/models/studentclass.js
+1
-1
AddCourseTime.js
src/pages/classdetail/AddCourseTime.js
+35
-7
AddCourseTime.less
src/pages/classdetail/AddCourseTime.less
+14
-1
index.js
src/pages/classdetail/index.js
+26
-0
index.js
src/pages/index/index.js
+25
-0
classroommgt.js
src/services/classroommgt.js
+7
-0
No files found.
src/common/api.js
View file @
1b0439ce
...
...
@@ -87,6 +87,7 @@ export default {
common
:
`
${
dakaapi
}
member/erp/plans`
,
},
classroomMgt
:
`
${
dakaapi
}
member/erp/rooms`
,
schedulestimeMgt
:
`
${
dakaapi
}
member/erp/schedules_time`
,
officaialweb
:
{
schoolDetail
:
`
${
dakaapi
}
member/website/school/detail`
,
courseDetail
:
`
${
dakaapi
}
member/website/course/detail`
,
...
...
src/models/classdetail.js
View file @
1b0439ce
...
...
@@ -1105,6 +1105,29 @@ export default {
});
}
},
*
delTime
({
payload
},
{
call
,
put
,
select
})
{
const
{
timeArr
}
=
yield
select
(
state
=>
state
.
classdetail
);
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
time
}
=
payload
;
const
timeArrtdata
=
yield
call
(
classroommgtAjax
.
schedulestimeDelete
,
{
id
:
time
.
id
,
});
if
(
timeArrtdata
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
timeArr
:
[...
timeArr
.
filter
(
ele
=>
ele
.
id
!=
time
.
id
)],
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
timeArrtdata
,
},
});
}
},
*
queryClassDetail
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
classId
}
=
yield
select
(
state
=>
state
.
classdetail
);
...
...
@@ -1255,12 +1278,13 @@ export default {
timeArr
.
push
({
start_time
:
value
.
start_time
,
end_time
:
value
.
end_time
,
id
:
timePutData
.
data
.
id
,
});
yield
put
({
type
:
'updateState'
,
payload
:
{
timeArr
:
[...
timeArr
],
addCourseTimeShow
:
false
,
//
addCourseTimeShow: false,
},
});
}
else
{
...
...
src/models/indexstaic.js
View file @
1b0439ce
...
...
@@ -120,12 +120,13 @@ export default {
timeArr
.
push
({
start_time
:
value
.
start_time
,
end_time
:
value
.
end_time
,
id
:
timePutData
.
data
.
id
,
});
yield
put
({
type
:
'updateState'
,
payload
:
{
timeArr
:
[...
timeArr
],
addCourseTimeShow
:
false
,
//
addCourseTimeShow: false,
},
});
}
else
{
...
...
@@ -266,6 +267,30 @@ export default {
});
}
},
*
delTime
({
payload
},
{
call
,
put
,
select
})
{
const
{
timeArr
}
=
yield
select
(
state
=>
state
.
indexstaic
);
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
time
}
=
payload
;
console
.
log
(
time
,
'time'
);
const
timeArrtdata
=
yield
call
(
classroommgtAjax
.
schedulestimeDelete
,
{
id
:
time
.
id
,
});
if
(
timeArrtdata
.
code
==
200
)
{
yield
put
({
type
:
'updateState'
,
payload
:
{
timeArr
:
[...
timeArr
.
filter
(
ele
=>
ele
.
id
!=
time
.
id
)],
},
});
}
else
{
yield
put
({
type
:
'webapp/errorrequestresolve'
,
payload
:
{
data
:
timeArrtdata
,
},
});
}
},
*
queryClassroomList
({
payload
},
{
call
,
put
,
select
})
{
const
{
classroomList
}
=
yield
select
(
state
=>
state
.
indexstaic
);
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
...
...
src/models/studentclass.js
View file @
1b0439ce
...
...
@@ -118,7 +118,7 @@ export default {
*
addClassRoom
({
payload
},
{
call
,
put
,
select
})
{
const
{
value
,
callBack
}
=
payload
;
const
{
sid
}
=
yield
select
(
state
=>
state
.
webapp
);
const
{
classRoomSubmitting
,
classroomList
}
=
yield
select
(
state
=>
state
.
classmgt
);
const
{
classRoomSubmitting
,
classroomList
}
=
yield
select
(
state
=>
state
.
studentclass
);
if
(
classRoomSubmitting
)
{
return
;
}
...
...
src/pages/classdetail/AddCourseTime.js
View file @
1b0439ce
import
{
connect
}
from
'dva'
;
import
React
from
'react'
;
import
{
TimePicker
,
Row
,
Col
,
Input
,
Modal
,
Form
,
message
}
from
'antd'
;
import
{
TimePicker
,
Row
,
Col
,
Input
,
Modal
,
Form
,
message
,
Button
,
Icon
}
from
'antd'
;
import
{
pageIn
}
from
'../../utils/index'
;
import
pageStyle
from
'./AddCourseTime.less'
;
class
AddCourseTime
extends
React
.
Component
{
componentDidMount
()
{
// 挂载
pageIn
(
'班级管理'
);
...
...
@@ -23,6 +24,7 @@ class AddCourseTime extends React.Component {
message
.
error
(
'开始时间必须小于结束时间'
,
1
);
return
;
}
console
.
log
(
22222
);
saveCourseTime
({
start_time
:
start_time
.
format
(
'HH:mm'
),
end_time
:
end_time
.
format
(
'HH:mm'
),
...
...
@@ -34,27 +36,31 @@ class AddCourseTime extends React.Component {
visible
,
close
,
addTimeSubmitting
,
timeArr
,
delTime
,
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
console
.
log
(
timeArr
,
'timeArr'
);
return
(
<
Modal
visible
=
{
visible
}
centered
title
=
"配置时间段"
onCancel
=
{
close
}
onOk
=
{
this
.
submit
}
width
=
{
3
00
}
footer
=
{
null
}
width
=
{
5
00
}
zIndex
=
{
111
}
className
=
"modifyclassModal"
maskClosable
=
{
false
}
bodyStyle
=
{{
paddingLeft
:
'0'
,
paddingRight
:
'0'
}}
confirmLoading
=
{
addTimeSubmitting
}
>
<
Row
>
<
Col
style
=
{{
lineHeight
:
'40px'
,
paddingBottom
:
'22px'
}}
lg
=
{{
span
:
8
}}
md
=
{{
span
:
8
}}
xs
=
{{
span
:
24
}}
>
<
Row
style
=
{{
paddingLeft
:
'20px'
,
paddingBottom
:
'20px'
}}
>
<
Col
style
=
{{
lineHeight
:
'40px'
}}
lg
=
{{
span
:
4
}}
md
=
{{
span
:
8
}}
xs
=
{{
span
:
24
}}
>
<
span
>
上课时间:
<
/span
>
<
/Col
>
<
Col
lg
=
{{
span
:
16
}}
md
=
{{
span
:
1
6
}}
xs
=
{{
span
:
24
}}
style
=
{{
paddingBottom
:
'22px'
}}
>
<
Form
className
=
"modalform"
>
<
Col
lg
=
{{
span
:
16
}}
md
=
{{
span
:
1
0
}}
xs
=
{{
span
:
24
}}
>
<
Form
className
=
"modalform"
layout
=
"inline"
>
<
Form
.
Item
>
{
getFieldDecorator
(
'start_time'
,
{
rules
:
[{
required
:
true
,
message
:
'请选择上课时间'
}],
...
...
@@ -77,6 +83,28 @@ class AddCourseTime extends React.Component {
<
/Form.Item
>
<
/Form
>
<
/Col
>
<
Col
style
=
{{
lineHeight
:
'40px'
}}
lg
=
{{
span
:
2
}}
md
=
{{
span
:
8
}}
xs
=
{{
span
:
24
}}
>
<
Button
type
=
"primary"
onClick
=
{
this
.
submit
}
>
添加
<
/Button
>
<
/Col
>
<
/Row
>
<
Row
style
=
{{
paddingLeft
:
'20px'
,
paddingTop
:
'20px'
,
borderTop
:
'1px solid rgba(0,0,0,.1)'
,
}}
>
<
Col
style
=
{{
lineHeight
:
'40px'
}}
lg
=
{{
span
:
5
}}
md
=
{{
span
:
8
}}
xs
=
{{
span
:
24
}}
>
<
span
style
=
{{
color
:
'#000'
}}
>
已配置时间段:
<
/span
>
<
/Col
>
<
Col
lg
=
{{
span
:
19
}}
md
=
{{
span
:
20
}}
xs
=
{{
span
:
24
}}
style
=
{{
}}
>
{
timeArr
&&
timeArr
.
map
(
ele
=>
(
<
div
className
=
{
pageStyle
.
timeitem
}
>
<
span
className
=
{
pageStyle
.
itemContent
}
>
{
ele
.
start_time
}
~
{
ele
.
end_time
}
<
/span
>
<
Icon
onClick
=
{()
=>
delTime
(
ele
)}
type
=
"close-circle"
theme
=
"twoTone"
style
=
{{
color
:
'#FF5252'
,
fontSize
:
'12px'
}}
twoToneColor
=
"#FF5252"
/>
<
/div
>
))}
<
/Col
>
<
/Row
>
<
/Modal
>
);
...
...
src/pages/classdetail/AddCourseTime.less
View file @
1b0439ce
...
...
@@ -4,4 +4,17 @@
padding-left: 0;
}
}
}
\ No newline at end of file
}
.timeitem {
width:160px;
height:32px;
background:rgba(255,255,255,1);
border-radius:4px;
border:1px solid rgba(217,217,217,1);
display: inline-block;
padding: 5px 12px;
margin: 10px;
}
.itemContent {
padding-right: 40px;
}
\ No newline at end of file
src/pages/classdetail/index.js
View file @
1b0439ce
...
...
@@ -857,6 +857,30 @@ class ClassDetailForm extends React.Component {
},
});
}
delTime
=
(
ele
)
=>
{
const
{
dispatch
}
=
this
.
props
;
Modal
.
confirm
({
title
:
`确定删除时间【
${
ele
.
start_time
}
~
${
ele
.
end_time
}
】吗`
,
okButtonProps
:
{
type
:
'danger'
,
style
:
{
color
:
'#fff'
,
backgroundColor
:
'#ff4d4f'
,
borderColor
:
'#ff4d4f'
,
},
},
centered
:
true
,
icon
:
<
Icon
type
=
"close-circle"
style
=
{{
color
:
'red'
}}
/>
,
onOk
:
()
=>
{
dispatch
({
type
:
'classdetail/delTime'
,
payload
:
{
time
:
ele
,
},
});
},
});
}
render
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
...
...
@@ -1374,6 +1398,8 @@ class ClassDetailForm extends React.Component {
saveCourseTime
=
{
this
.
saveCourseTime
}
close
=
{
this
.
closeAddCourseTime
}
addTimeSubmitting
=
{
addTimeSubmitting
}
delTime
=
{
this
.
delTime
}
timeArr
=
{
timeArr
}
/
>
<
div
className
=
{
pageStyle
.
classDetail
}
>
<
div
className
=
{
pageStyle
.
classdetailheader
}
>
...
...
src/pages/index/index.js
View file @
1b0439ce
...
...
@@ -165,6 +165,30 @@ class StaticCenter extends React.Component {
},
});
}
delTime
=
(
ele
)
=>
{
const
{
dispatch
}
=
this
.
props
;
Modal
.
confirm
({
title
:
`确定删除时间【
${
ele
.
start_time
}
~
${
ele
.
end_time
}
】吗`
,
okButtonProps
:
{
type
:
'danger'
,
style
:
{
color
:
'#fff'
,
backgroundColor
:
'#ff4d4f'
,
borderColor
:
'#ff4d4f'
,
},
},
centered
:
true
,
icon
:
<
Icon
type
=
"close-circle"
style
=
{{
color
:
'red'
}}
/>
,
onOk
:
()
=>
{
dispatch
({
type
:
'indexstaic/delTime'
,
payload
:
{
time
:
ele
,
},
});
},
});
}
addCourseTime
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
...
...
@@ -519,6 +543,7 @@ class StaticCenter extends React.Component {
close
=
{
this
.
closeAddCourseTime
}
timeArr
=
{
timeArr
}
addTimeSubmitting
=
{
addTimeSubmitting
}
delTime
=
{
this
.
delTime
}
/
>
<
/div
>
);
...
...
src/services/classroommgt.js
View file @
1b0439ce
...
...
@@ -25,3 +25,10 @@ export function classroomDelete(params) {
method
:
'DELETE'
,
});
}
export
function
schedulestimeDelete
(
params
)
{
return
request
({
url
:
`
${
api
.
schedulestimeMgt
}
/
${
params
.
id
}
`
,
method
:
'DELETE'
,
});
}
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