Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
1bf6cc7a
Commit
1bf6cc7a
authored
Jul 13, 2021
by
guomingpang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style:表格中的滑动开关使用small 型号
parent
7b685e7a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
232 additions
and
241 deletions
+232
-241
src/modules/course-manage/components/LiveCourseList.jsx
+2
-1
src/modules/course-manage/graphics-course/components/GraphicsCourseList.jsx
+31
-25
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
+0
-0
src/modules/course-manage/offline-course/components/AddGraphicsIntro.jsx
+75
-76
src/modules/course-manage/offline-course/components/OfflineCourseList.jsx
+8
-5
src/modules/course-manage/video-course/components/AddVideoIntro.jsx
+69
-73
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+1
-0
src/modules/plan-manage/components/BasicInfo.jsx
+14
-8
src/modules/plan-manage/components/PlanList.jsx
+1
-0
src/modules/teach-tool/examination-manager/AddExam.tsx
+0
-0
src/routes/index.tsx
+31
-53
No files found.
src/modules/course-manage/components/LiveCourseList.jsx
View file @
1bf6cc7a
...
...
@@ -125,7 +125,7 @@ class LiveCourseList extends React.Component {
columns
=
[
{
title
:
'直播课'
,
width
:
'23%'
,
key
:
'course'
,
fixed
:
'left'
,
dataIndex
:
'courseName'
,
...
...
@@ -284,6 +284,7 @@ class LiveCourseList extends React.Component {
render
:
(
val
,
item
,
index
)
=>
{
return
(
<
Switch
size=
'small'
checked=
{
item
.
shelfState
===
'YES'
}
defaultChecked=
{
item
.
shelfState
===
'YES'
?
true
:
false
}
onChange=
{
(
checked
)
=>
this
.
changeShelfState
(
index
,
item
,
checked
)
}
...
...
src/modules/course-manage/graphics-course/components/GraphicsCourseList.jsx
View file @
1bf6cc7a
...
...
@@ -9,7 +9,7 @@
import
User
from
'@/common/js/user'
;
import
college
from
'@/common/lottie/college'
;
import
{
PageControl
,
XMTable
}
from
'@/components'
;
import
{
appId
,
LIVE_SHARE
}
from
'@/domains/course-domain/constants'
;
import
{
LIVE_SHARE
}
from
'@/domains/course-domain/constants'
;
import
CourseService
from
'@/domains/course-domain/CourseService'
;
import
ShareLiveModal
from
'@/modules/course-manage/modal/ShareLiveModal'
;
import
{
Dropdown
,
message
,
Modal
,
Switch
,
Tooltip
}
from
'antd'
;
...
...
@@ -57,7 +57,7 @@ class GraphicsCourseList extends React.Component {
handlePlanName
=
(
planArray
)
=>
{
let
planStr
=
''
;
planArray
.
map
((
item
,
index
)
=>
{
planArray
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
planArray
.
length
-
1
)
{
planStr
=
planStr
+
item
.
planName
+
'、'
;
}
else
{
...
...
@@ -76,18 +76,21 @@ class GraphicsCourseList extends React.Component {
width
:
321
,
fixed
:
'left'
,
render
:
(
val
,
record
)
=>
{
const
{
coverUrl
,
scheduleVideoUrl
}
=
record
;
const
{
coverUrl
}
=
record
;
return
(
<
div
className=
'record__item'
>
{
/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */
}
<
img
className=
'course-cover'
src=
{
coverUrl
||
defaultCoverUrl
}
/>
{
record
.
courseName
.
length
>
25
?
(
<
img
className=
'course-cover'
src=
{
coverUrl
||
defaultCoverUrl
}
alt=
''
/>
<
Choose
>
<
When
condition=
{
record
.
courseName
.
length
>
25
}
>
<
Tooltip
title=
{
record
.
courseName
}
>
<
div
className=
'course-name'
>
{
record
.
courseName
}
</
div
>
</
Tooltip
>
)
:
(
</
When
>
<
Otherwise
>
<
div
className=
'course-name'
>
{
record
.
courseName
}
</
div
>
)
}
</
Otherwise
>
</
Choose
>
</
div
>
);
},
...
...
@@ -146,10 +149,12 @@ class GraphicsCourseList extends React.Component {
render
:
(
val
,
item
,
index
)
=>
{
return
(
<
Switch
checked=
{
item
.
shelfState
===
"YES"
}
defaultChecked=
{
item
.
shelfState
===
"YES"
?
true
:
false
}
onChange=
{
(
checked
)
=>
this
.
changeShelfState
(
index
,
item
,
checked
)
}
/>
)
size=
'small'
checked=
{
item
.
shelfState
===
'YES'
}
defaultChecked=
{
item
.
shelfState
===
'YES'
?
true
:
false
}
onChange=
{
(
checked
)
=>
this
.
changeShelfState
(
index
,
item
,
checked
)
}
/>
);
},
},
{
...
...
@@ -168,7 +173,7 @@ class GraphicsCourseList extends React.Component {
dataIndex
:
'created'
,
sorter
:
true
,
render
:
(
val
)
=>
{
return
formatDate
(
'YYYY-MM-DD H:i'
,
val
);
return
window
.
formatDate
(
'YYYY-MM-DD H:i'
,
val
);
},
},
{
...
...
@@ -178,7 +183,7 @@ class GraphicsCourseList extends React.Component {
dataIndex
:
'updated'
,
sorter
:
true
,
render
:
(
val
)
=>
{
return
formatDate
(
'YYYY-MM-DD H:i'
,
val
);
return
window
.
formatDate
(
'YYYY-MM-DD H:i'
,
val
);
},
},
{
...
...
@@ -189,7 +194,8 @@ class GraphicsCourseList extends React.Component {
render
:
(
val
,
record
)
=>
{
return
(
<
div
className=
'related-task'
>
{
record
.
relatedPlanList
?
(
<
Choose
>
<
When
condition=
{
record
.
relatedPlanList
}
>
<
Tooltip
title=
{
this
.
handlePlanName
(
record
.
relatedPlanList
)
}
placement=
'top'
arrowPointAtCenter
>
{
record
.
relatedPlanList
.
map
((
item
,
index
)
=>
{
return
(
...
...
@@ -199,9 +205,11 @@ class GraphicsCourseList extends React.Component {
);
})
}
</
Tooltip
>
)
:
(
</
When
>
<
Otherwise
>
<
span
></
span
>
)
}
</
Otherwise
>
</
Choose
>
</
div
>
);
},
...
...
@@ -297,7 +305,7 @@ class GraphicsCourseList extends React.Component {
className=
'operate__item'
key=
'edit'
onClick=
{
()
=>
{
RCHistory
.
push
(
`/create-graphics-course?type=edit&id=${item.id}`
);
window
.
RCHistory
.
push
(
`/create-graphics-course?type=edit&id=${item.id}`
);
}
}
>
编辑
</
div
>
...
...
@@ -305,17 +313,17 @@ class GraphicsCourseList extends React.Component {
删除
</
div
>
</
div
>
)
}
)
;
}
;
//改变上架状态
changeShelfState
=
(
index
,
item
,
checked
)
=>
{
let
_shelfState
=
checked
?
"YES"
:
"NO"
changeShelfState
=
(
index
,
item
,
checked
)
=>
{
let
_shelfState
=
checked
?
'YES'
:
'NO'
;
// if(_shelfState==='NO'){
// _shelfState = "YES";
// }else{
// _shelfState = "NO"
// }
const
params
=
{
const
params
=
{
courseId
:
item
.
id
,
shelfState
:
_shelfState
,
};
...
...
@@ -326,7 +334,7 @@ class GraphicsCourseList extends React.Component {
}
else
{
message
.
success
(
'已取消展示'
);
}
this
.
props
.
changeShelfState
(
index
,
_shelfState
)
this
.
props
.
changeShelfState
(
index
,
_shelfState
);
}
});
};
...
...
@@ -355,8 +363,6 @@ class GraphicsCourseList extends React.Component {
// 显示分享弹窗
handleShowShareModal
=
(
record
,
needStr
=
false
)
=>
{
const
{
id
,
scheduleVideoUrl
}
=
record
;
const
_appId
=
appId
;
const
htmlUrl
=
`
${
LIVE_SHARE
}
graphics_detail/
${
id
}
?id=
${
User
.
getStoreId
()}
`
;
const
longUrl
=
htmlUrl
;
const
{
coverUrl
,
courseName
}
=
record
;
...
...
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
View file @
1bf6cc7a
This diff is collapsed.
Click to expand it.
src/modules/course-manage/offline-course/components/AddGraphicsIntro.jsx
View file @
1bf6cc7a
...
...
@@ -6,28 +6,20 @@
* @Description: 添加直播-简介
*/
import
SelectPrepareFileModal
from
'@/modules/prepare-lesson/modal/SelectPrepareFileModal'
;
import
{
Col
,
message
,
Row
,
Switch
}
from
'antd'
;
import
React
from
'react'
;
import
{
Input
,
message
,
Upload
,
Radio
,
Row
,
Col
,
Button
,
Popover
,
Switch
}
from
'antd'
;
import
Service
from
'@/common/js/service'
;
import
GraphicsEditor
from
'../../components/GraphicsEditor'
;
import
User
from
'@/common/js/user'
;
import
UploadOss
from
'@/core/upload'
;
import
'./AddGraphicsIntro.less'
;
import
SelectPrepareFileModal
from
'@/modules/prepare-lesson/modal/SelectPrepareFileModal'
;
import
{
DISK_MAP
}
from
'@/common/constants/academic/lessonEnum'
;
import
{
ImgCutModalNew
}
from
'@/components'
;
const
{
TextArea
}
=
Input
;
class
AddGraphicsIntro
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
showSelectFileModal
:
false
,
diskList
:
[],
selectType
:
null
,
}
}
;
}
// 上传封面图
...
...
@@ -38,34 +30,34 @@ class AddGraphicsIntro extends React.Component {
imageFile
,
showCutModal
:
true
,
});
}
}
;
// 选择暖场资源
handleSelectVideo
=
(
file
)
=>
{
const
{
selectType
}
=
this
.
state
;
this
.
setState
({
showSelectFileModal
:
false
})
showSelectFileModal
:
false
,
})
;
const
{
ossUrl
,
resourceId
,
folderName
,
folderFormat
,
folderSize
}
=
file
;
if
(
selectType
===
'WARMUP'
)
{
if
(
selectType
===
'WARMUP'
)
{
const
liveCourseWarmMedia
=
{
contentType
:
'WARMUP'
,
mediaType
:
folderFormat
===
'MP4'
?
'VIDEO'
:
'PICTURE'
,
mediaContent
:
resourceId
,
mediaUrl
:
ossUrl
,
mediaName
:
folderName
,
size
:
folderSize
}
size
:
folderSize
,
}
;
this
.
props
.
onChange
(
'liveCourseWarmMedia'
,
liveCourseWarmMedia
);
}
else
{
}
else
{
// 最多添加九图片
const
{
liveCourseMediaRequests
}
=
this
.
props
.
data
;
const
list
=
_
.
filter
(
liveCourseMediaRequests
,
(
item
)
=>
{
return
item
.
mediaType
==
"PICTURE"
;
return
item
.
mediaType
==
'PICTURE'
;
});
if
(
list
.
length
>
8
)
{
message
.
warning
(
"最多添加9张图片"
);
message
.
warning
(
'最多添加9张图片'
);
return
;
}
liveCourseMediaRequests
.
push
({
...
...
@@ -78,61 +70,62 @@ class AddGraphicsIntro extends React.Component {
});
this
.
props
.
onChange
(
'liveCourseMediaRequests'
,
liveCourseMediaRequests
);
}
}
};
changeDetail
=
(
value
)
=>
{
this
.
props
.
onChange
(
'courseMedia'
,
value
);
}
}
;
changeIntro
=
(
value
)
=>
{
this
.
props
.
onChange
(
'introduce'
,
value
);
}
}
;
whetherVisitorsJoinChange
=
()
=>
{
if
(
this
.
props
.
data
.
whetherVisitorsJoin
===
"NO"
){
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'YES'
)
}
else
{
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'NO'
)
}
whetherVisitorsJoinChange
=
()
=>
{
if
(
this
.
props
.
data
.
whetherVisitorsJoin
===
'NO'
)
{
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'YES'
);
}
else
{
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'NO'
);
}
};
shelfStateChange
=
()
=>
{
if
(
this
.
props
.
data
.
shelfState
===
"NO"
){
this
.
props
.
onChange
(
'shelfState'
,
'YES'
)
}
else
{
this
.
props
.
onChange
(
'shelfState'
,
'NO'
)
}
shelfStateChange
=
()
=>
{
if
(
this
.
props
.
data
.
shelfState
===
'NO'
)
{
this
.
props
.
onChange
(
'shelfState'
,
'YES'
);
}
else
{
this
.
props
.
onChange
(
'shelfState'
,
'NO'
);
}
};
render
()
{
const
{
data
:
{
id
,
whetherVisitorsJoin
,
courseMedia
,
introduce
,
shelfState
,
loadcourseMedia
,
loadintroduce
}
}
=
this
.
props
;
const
{
data
:
{
id
,
whetherVisitorsJoin
,
courseMedia
,
introduce
,
shelfState
,
loadcourseMedia
,
loadintroduce
},
}
=
this
.
props
;
const
{
showSelectFileModal
,
selectType
}
=
this
.
state
;
return
(
<
div
className=
"add-video__intro-info"
>
<
div
className=
"allow-tourist-join"
>
<
span
className=
"label"
>
观看设置:
</
span
>
<
div
className=
"content"
>
<
div
className=
'add-video__intro-info'
>
<
div
className=
'allow-tourist-join'
>
<
span
className=
'label'
>
观看设置:
</
span
>
<
div
className=
'content'
>
<
div
>
<
Switch
checked=
{
whetherVisitorsJoin
===
"YES"
?
true
:
false
}
onChange=
{
this
.
whetherVisitorsJoinChange
}
/>
<
Switch
checked=
{
whetherVisitorsJoin
===
'YES'
?
true
:
false
}
onChange=
{
this
.
whetherVisitorsJoinChange
}
/>
</
div
>
<
div
>
<
div
className=
"desc"
>
<
div
className=
'desc'
>
<
div
>
开启:允许未绑定手机号的学员观看
</
div
>
<
div
>
关闭:仅限绑定了手机号的学员可以进入观看图文课
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"store-show"
>
<
span
className=
"label"
>
学院展示:
</
span
>
<
div
className=
"content"
>
<
div
className=
'store-show'
>
<
span
className=
'label'
>
学院展示:
</
span
>
<
div
className=
'content'
>
<
Row
>
<
Col
span=
{
3
}
>
<
Switch
checked=
{
shelfState
===
"YES"
?
true
:
false
}
onChange=
{
this
.
shelfStateChange
}
/>
<
Switch
checked=
{
shelfState
===
'YES'
?
true
:
false
}
onChange=
{
this
.
shelfStateChange
}
/>
</
Col
>
<
Col
span=
{
21
}
>
<
div
className=
"desc"
>
<
div
className=
'desc'
>
<
div
>
开启:图文课将在学员学院图文课列表中展示
</
div
>
<
div
>
关闭:图文课将在学员学院图文课列表中隐藏
</
div
>
</
div
>
...
...
@@ -140,59 +133,65 @@ class AddGraphicsIntro extends React.Component {
</
Row
>
</
div
>
</
div
>
<
div
className=
"introduce required"
>
<
span
className=
"label"
style=
{
{
marginTop
:
5
}
}
>
课程内容:
</
span
>
<
div
className=
"content"
>
<
div
className=
"intro-list"
>
<
div
className=
"intro-list__item content-editor"
>
{
(
!
id
||
loadcourseMedia
)
&&
<
div
className=
'introduce required'
>
<
span
className=
'label'
style=
{
{
marginTop
:
5
}
}
>
课程内容:
</
span
>
<
div
className=
'content'
>
<
div
className=
'intro-list'
>
<
div
className=
'intro-list__item content-editor'
>
{
(
!
id
||
loadcourseMedia
)
&&
(
<
GraphicsEditor
id=
"content"
id=
'content'
detail=
{
{
content
:
courseMedia
content
:
courseMedia
,
}
}
onChange=
{
(
val
)
=>
{
this
.
changeDetail
(
val
);
}
}
onChange=
{
(
val
)
=>
{
this
.
changeDetail
(
val
)
}
}
/>
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"introduce"
>
<
span
className=
"label"
>
课程简介:
</
span
>
<
div
className=
"content"
>
<
div
className=
"intro-list"
>
<
div
className=
"intro-list__item introduce-editor"
>
{
(
!
id
||
loadintroduce
)
&&
<
div
className=
'introduce'
>
<
span
className=
'label'
>
课程简介:
</
span
>
<
div
className=
'content'
>
<
div
className=
'intro-list'
>
<
div
className=
'intro-list__item introduce-editor'
>
{
(
!
id
||
loadintroduce
)
&&
(
<
GraphicsEditor
id=
"intro"
id=
'intro'
isIntro=
{
true
}
detail=
{
{
content
:
introduce
content
:
introduce
,
}
}
onChange=
{
(
val
)
=>
{
this
.
changeIntro
(
val
);
}
}
onChange=
{
(
val
)
=>
{
this
.
changeIntro
(
val
)
}
}
/>
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
{
/* 选择暖场图文件弹窗 */
}
{
showSelectFileModal
&&
{
showSelectFileModal
&&
(
<
SelectPrepareFileModal
operateType=
"select"
accept=
{
selectType
===
"INTRO"
?
"image/jpeg,image/png,image/jpg"
:
"video/mp4,image/jpeg,image/png,image/jpg"
}
selectTypeList=
{
selectType
===
"INTRO"
?
[
'JPG'
,
'JPEG'
,
'PNG'
]:
[
'MP4'
,
'JPG'
,
'JPEG'
,
'PNG'
]
}
tooltip=
{
selectType
===
"INTRO"
?
'支持文件类型:jpg、jpeg、png'
:
'支持文件类型:jpg、jpeg、png、mp4'
}
operateType=
'select'
accept=
{
selectType
===
'INTRO'
?
'image/jpeg,image/png,image/jpg'
:
'video/mp4,image/jpeg,image/png,image/jpg'
}
selectTypeList=
{
selectType
===
'INTRO'
?
[
'JPG'
,
'JPEG'
,
'PNG'
]
:
[
'MP4'
,
'JPG'
,
'JPEG'
,
'PNG'
]
}
tooltip=
{
selectType
===
'INTRO'
?
'支持文件类型:jpg、jpeg、png'
:
'支持文件类型:jpg、jpeg、png、mp4'
}
isOpen=
{
showSelectFileModal
}
onClose=
{
()
=>
{
this
.
setState
({
showSelectFileModal
:
false
})
this
.
setState
({
showSelectFileModal
:
false
})
;
}
}
onSelect=
{
this
.
handleSelectVideo
}
/>
}
)
}
</
div
>
)
)
;
}
}
...
...
src/modules/course-manage/offline-course/components/OfflineCourseList.jsx
View file @
1bf6cc7a
...
...
@@ -17,6 +17,7 @@ import OfflineCourseData from '@/modules/course-manage/offline-course/OfflineCou
import
{
Dropdown
,
message
,
Modal
,
Switch
,
Tooltip
}
from
'antd'
;
import
moment
from
'moment'
;
import
React
from
'react'
;
import
{
find
,
reduce
,
last
}
from
'underscore'
;
import
{
Route
,
withRouter
}
from
'react-router-dom'
;
import
ENUM
from
'../../../knowledge-base/ENUM.js'
;
import
PreviewOfflineModal
from
'../modal/PreviewOfflineModal'
;
...
...
@@ -44,7 +45,7 @@ class OfflineCourseList extends React.Component {
handlePlanName
=
(
planArray
)
=>
{
let
planStr
=
''
;
planArray
.
map
((
item
,
index
)
=>
{
planArray
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
planArray
.
length
-
1
)
{
planStr
=
planStr
+
item
.
planName
+
'、'
;
}
else
{
...
...
@@ -64,13 +65,13 @@ class OfflineCourseList extends React.Component {
fixed
:
'left'
,
render
:
(
val
,
record
)
=>
{
const
{
courseMediaVOS
,
courseName
,
offlinePlace
,
calendarTime
,
startTime
,
endTime
}
=
record
;
const
coverUrl
=
(
_
.
find
(
courseMediaVOS
,
(
data
)
=>
data
.
contentType
===
'COVER'
)
||
{}).
mediaUrl
;
const
coverUrl
=
(
find
(
courseMediaVOS
,
(
data
)
=>
data
.
contentType
===
'COVER'
)
||
{}).
mediaUrl
;
let
isContinue
=
calendarTime
.
length
>
1
;
_
.
reduce
(
calendarTime
,
(
a
,
b
)
=>
{
reduce
(
calendarTime
,
(
a
,
b
)
=>
{
isContinue
=
isContinue
&&
b
-
a
===
86400000
;
return
b
;
});
const
lastTime
=
_
.
last
(
calendarTime
);
const
lastTime
=
last
(
calendarTime
);
const
time
=
`
${
!
isContinue
?
calendarTime
.
map
((
item
)
=>
moment
(
item
).
format
(
'MM-DD'
)).
join
(
'、'
)
...
...
@@ -138,7 +139,9 @@ class OfflineCourseList extends React.Component {
width
:
120
,
dataIndex
:
'courseware'
,
render
:
(
val
,
item
,
index
)
=>
{
return
<
Switch
disabled=
{
item
.
courseState
===
'EXPIRED'
}
checked=
{
item
.
shelfState
===
'YES'
}
onChange=
{
()
=>
this
.
changeShelfState
(
item
)
}
/>;
return
(
<
Switch
size=
'small'
disabled=
{
item
.
courseState
===
'EXPIRED'
}
checked=
{
item
.
shelfState
===
'YES'
}
onChange=
{
()
=>
this
.
changeShelfState
(
item
)
}
/>
);
},
},
{
...
...
src/modules/course-manage/video-course/components/AddVideoIntro.jsx
View file @
1bf6cc7a
...
...
@@ -6,30 +6,23 @@
* @Description: 添加直播-简介
*/
import
SelectPrepareFileModal
from
'@/modules/prepare-lesson/modal/SelectPrepareFileModal'
;
import
{
Col
,
message
,
Row
,
Switch
}
from
'antd'
;
import
React
from
'react'
;
import
{
Input
,
message
,
Upload
,
Radio
,
Row
,
Col
,
Button
,
Popover
,
Switch
}
from
'antd'
;
import
Service
from
'@/common/js/service'
;
import
GraphicsEditor
from
'../../components/GraphicsEditor'
;
import
User
from
'@/common/js/user'
;
import
UploadOss
from
'@/core/upload'
;
import
{
filter
}
from
'underscore'
;
import
'./AddVideoIntro.less'
;
import
SelectPrepareFileModal
from
'@/modules/prepare-lesson/modal/SelectPrepareFileModal'
;
import
{
DISK_MAP
}
from
'@/common/constants/academic/lessonEnum'
;
import
{
ImgCutModalNew
}
from
'@/components'
;
const
{
TextArea
}
=
Input
;
const
defaultCover
=
'https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1599635741526.png'
;
class
AddVideoIntro
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
warmUrl
:
defaultCover
,
showSelectFileModal
:
false
,
diskList
:
[],
selectType
:
null
}
selectType
:
null
,
}
;
}
// 上传封面图
...
...
@@ -40,34 +33,34 @@ class AddVideoIntro extends React.Component {
imageFile
,
showCutModal
:
true
,
});
}
}
;
// 选择暖场资源
handleSelectVideo
=
(
file
)
=>
{
const
{
selectType
}
=
this
.
state
;
this
.
setState
({
showSelectFileModal
:
false
})
showSelectFileModal
:
false
,
})
;
const
{
ossUrl
,
resourceId
,
folderName
,
folderFormat
,
folderSize
}
=
file
;
if
(
selectType
===
'WARMUP'
)
{
if
(
selectType
===
'WARMUP'
)
{
const
liveCourseWarmMedia
=
{
contentType
:
'WARMUP'
,
mediaType
:
folderFormat
===
'MP4'
?
'VIDEO'
:
'PICTURE'
,
mediaContent
:
resourceId
,
mediaUrl
:
ossUrl
,
mediaName
:
folderName
,
size
:
folderSize
}
size
:
folderSize
,
}
;
this
.
props
.
onChange
(
'liveCourseWarmMedia'
,
liveCourseWarmMedia
);
}
else
{
}
else
{
// 最多添加九图片
const
{
liveCourseMediaRequests
}
=
this
.
props
.
data
;
const
list
=
_
.
filter
(
liveCourseMediaRequests
,
(
item
)
=>
{
return
item
.
mediaType
==
"PICTURE"
;
const
list
=
filter
(
liveCourseMediaRequests
,
(
item
)
=>
{
return
item
.
mediaType
===
'PICTURE'
;
});
if
(
list
.
length
>
8
)
{
message
.
warning
(
"最多添加9张图片"
);
message
.
warning
(
'最多添加9张图片'
);
return
;
}
liveCourseMediaRequests
.
push
({
...
...
@@ -80,62 +73,63 @@ class AddVideoIntro extends React.Component {
});
this
.
props
.
onChange
(
'liveCourseMediaRequests'
,
liveCourseMediaRequests
);
}
}
};
changeIntro
=
(
value
)
=>
{
this
.
props
.
onChange
(
'introduce'
,
value
);
}
}
;
handleUpload
=
(
Blob
)
=>
{
this
.
setState
({
showSelectFileModal
:
true
,
selectType
:
'INTRO'
})
}
whetherVisitorsJoinChange
=
()
=>
{
if
(
this
.
props
.
data
.
whetherVisitorsJoin
===
"NO"
)
{
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'YES'
)
}
else
{
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'NO'
)
}
}
shelfStateChange
=
()
=>
{
if
(
this
.
props
.
data
.
shelfState
===
"NO"
)
{
this
.
props
.
onChange
(
'shelfState'
,
'YES'
)
}
else
{
this
.
props
.
onChange
(
'shelfState'
,
'NO'
)
}
}
selectType
:
'INTRO'
,
})
;
}
;
whetherVisitorsJoinChange
=
()
=>
{
if
(
this
.
props
.
data
.
whetherVisitorsJoin
===
'NO'
)
{
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'YES'
);
}
else
{
this
.
props
.
onChange
(
'whetherVisitorsJoin'
,
'NO'
);
}
}
;
shelfStateChange
=
()
=>
{
if
(
this
.
props
.
data
.
shelfState
===
'NO'
)
{
this
.
props
.
onChange
(
'shelfState'
,
'YES'
);
}
else
{
this
.
props
.
onChange
(
'shelfState'
,
'NO'
);
}
}
;
render
()
{
const
{
data
:
{
whetherVisitorsJoin
,
liveCourseMediaRequests
=
[],
shelfState
,
id
,
introduce
,
loadintroduce
}
}
=
this
.
props
;
const
{
showSelectFileModal
,
selectType
}
=
this
.
state
const
{
data
:
{
whetherVisitorsJoin
,
shelfState
,
id
,
introduce
,
loadintroduce
},
}
=
this
.
props
;
const
{
showSelectFileModal
,
selectType
}
=
this
.
state
;
return
(
<
div
className=
"add-video__intro-info"
>
<
div
className=
"allow-tourist-join"
>
<
span
className=
"label"
>
观看设置:
</
span
>
<
div
className=
"content"
>
<
div
className=
'add-video__intro-info'
>
<
div
className=
'allow-tourist-join'
>
<
span
className=
'label'
>
观看设置:
</
span
>
<
div
className=
'content'
>
<
div
>
<
Switch
checked=
{
whetherVisitorsJoin
===
"YES"
?
true
:
false
}
onChange=
{
this
.
whetherVisitorsJoinChange
}
/>
<
Switch
checked=
{
whetherVisitorsJoin
===
'YES'
?
true
:
false
}
onChange=
{
this
.
whetherVisitorsJoinChange
}
/>
</
div
>
<
div
>
<
div
className=
"desc"
>
<
div
className=
'desc'
>
<
div
>
开启:允许未绑定手机号的学员观看
</
div
>
<
div
>
关闭:仅限绑定了手机号的学员可以进入观看视频
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"store-show"
>
<
span
className=
"label"
>
学院展示:
</
span
>
<
div
className=
"content"
>
<
div
className=
'store-show'
>
<
span
className=
'label'
>
学院展示:
</
span
>
<
div
className=
'content'
>
<
Row
>
<
Col
span=
{
3
}
>
<
Switch
checked=
{
shelfState
===
"YES"
?
true
:
false
}
onChange=
{
this
.
shelfStateChange
}
/>
<
Switch
checked=
{
shelfState
===
'YES'
?
true
:
false
}
onChange=
{
this
.
shelfStateChange
}
/>
</
Col
>
<
Col
span=
{
21
}
>
<
div
className=
"desc"
>
<
div
className=
'desc'
>
<
div
>
开启:此视频将在学员学院的视频列表中出现
</
div
>
<
div
>
关闭:此视频将在学员学院的视频列表中隐藏
</
div
>
</
div
>
...
...
@@ -143,41 +137,43 @@ class AddVideoIntro extends React.Component {
</
Row
>
</
div
>
</
div
>
<
div
className=
"introduce"
>
<
span
className=
"label"
>
视频课简介:
</
span
>
<
div
className=
"content"
>
<
div
className=
"intro-list"
>
<
div
className=
"intro-list__item introduce-editor"
>
{
(
!
id
||
loadintroduce
)
&&
<
div
className=
'introduce'
>
<
span
className=
'label'
>
视频课简介:
</
span
>
<
div
className=
'content'
>
<
div
className=
'intro-list'
>
<
div
className=
'intro-list__item introduce-editor'
>
{
(
!
id
||
loadintroduce
)
&&
(
<
GraphicsEditor
id=
"intro"
id=
'intro'
isIntro=
{
true
}
detail=
{
{
content
:
introduce
content
:
introduce
,
}
}
onChange=
{
(
val
)
=>
{
this
.
changeIntro
(
val
);
}
}
onChange=
{
(
val
)
=>
{
this
.
changeIntro
(
val
)
}
}
/>
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
{
/* 选择暖场图文件弹窗 */
}
{
showSelectFileModal
&&
{
showSelectFileModal
&&
(
<
SelectPrepareFileModal
operateType=
"select"
accept=
{
selectType
===
"INTRO"
?
"image/jpeg,image/png,image/jpg"
:
"video/mp4,image/jpeg,image/png,image/jpg"
}
selectTypeList=
{
selectType
===
"INTRO"
?
[
'JPG'
,
'JPEG'
,
'PNG'
]:
[
'MP4'
,
'JPG'
,
'JPEG'
,
'PNG'
]
}
tooltip=
{
selectType
===
"INTRO"
?
'支持文件类型:jpg、jpeg、png'
:
'支持文件类型:jpg、jpeg、png、mp4'
}
operateType=
'select'
accept=
{
selectType
===
'INTRO'
?
'image/jpeg,image/png,image/jpg'
:
'video/mp4,image/jpeg,image/png,image/jpg'
}
selectTypeList=
{
selectType
===
'INTRO'
?
[
'JPG'
,
'JPEG'
,
'PNG'
]
:
[
'MP4'
,
'JPG'
,
'JPEG'
,
'PNG'
]
}
tooltip=
{
selectType
===
'INTRO'
?
'支持文件类型:jpg、jpeg、png'
:
'支持文件类型:jpg、jpeg、png、mp4'
}
isOpen=
{
showSelectFileModal
}
onClose=
{
()
=>
{
this
.
setState
({
showSelectFileModal
:
false
})
this
.
setState
({
showSelectFileModal
:
false
})
;
}
}
onSelect=
{
this
.
handleSelectVideo
}
/>
}
)
}
</
div
>
)
)
;
}
}
...
...
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
1bf6cc7a
...
...
@@ -159,6 +159,7 @@ class VideoCourseList extends React.Component {
render
:
(
val
,
item
,
index
)
=>
{
return
(
<
Switch
size=
'small'
loading=
{
ShelfLoading
}
checked=
{
item
.
shelfState
===
'YES'
}
defaultChecked=
{
item
.
shelfState
}
...
...
src/modules/plan-manage/components/BasicInfo.jsx
View file @
1bf6cc7a
...
...
@@ -7,17 +7,16 @@
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
React
from
'react'
;
import
{
Button
,
Input
,
Switch
,
Radio
,
Row
,
Col
,
Modal
,
message
,
Tooltip
}
from
'antd'
;
import
{
Button
,
Input
,
Switch
,
Radio
,
Row
,
Col
,
message
,
Tooltip
}
from
'antd'
;
import
{
withRouter
}
from
'react-router-dom'
;
import
SelectOperatorModal
from
'../modal/SelectOperatorModal'
;
import
SelectPrepareFileModal
from
'@/modules/prepare-lesson/modal/SelectPrepareFileModal'
;
import
Upload
from
'@/core/upload'
;
import
ImgClipModal
from
'@/components/ImgClipModal'
import
ImgClipModal
from
'@/components/ImgClipModal'
;
import
'./BasicInfo.less'
;
const
{
TextArea
}
=
Input
;
const
defaultCover
=
'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'
;
let
cutFlag
=
false
;
class
BasicInfo
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
@@ -74,7 +73,7 @@ class BasicInfo extends React.Component {
handleSelectCover
=
(
file
)
=>
{
this
.
setState
({
visible
:
true
,
imageFile
:
file
imageFile
:
file
,
});
};
//获取resourceId
...
...
@@ -125,7 +124,7 @@ class BasicInfo extends React.Component {
};
render
()
{
const
{
operatorModalVisible
,
showSelectFileModal
,
visible
,
hasImgReady
,
cutImageBlob
,
imageFile
}
=
this
.
state
;
const
{
operatorModalVisible
,
showSelectFileModal
,
visible
,
imageFile
}
=
this
.
state
;
const
{
data
}
=
this
.
props
;
const
{
planName
,
coverUrl
,
instro
,
enableState
,
operateType
,
selectOperatorList
,
percentCompleteLive
,
percentCompleteVideo
,
percentCompletePicture
}
=
data
;
...
...
@@ -325,9 +324,16 @@ class BasicInfo extends React.Component {
onSelect=
{
this
.
handleSelectCover
}
/>
)
}
{
visible
&&
<
ImgClipModal
visible=
{
visible
}
imgUrl=
{
imageFile
.
ossUrl
}
onConfirm=
{
this
.
getSignature
}
onClose=
{
()
=>
{
this
.
setState
({
visible
:
false
});}
}
/>
}
{
visible
&&
(
<
ImgClipModal
visible=
{
visible
}
imgUrl=
{
imageFile
.
ossUrl
}
onConfirm=
{
this
.
getSignature
}
onClose=
{
()
=>
{
this
.
setState
({
visible
:
false
});
}
}
/>
)
}
</
div
>
);
}
...
...
src/modules/plan-manage/components/PlanList.jsx
View file @
1bf6cc7a
...
...
@@ -64,6 +64,7 @@ function PlanList(props) {
render
:
(
val
,
item
,
index
)
=>
{
return
(
<
Switch
size=
'small'
checked=
{
item
.
enableState
===
'NO'
?
false
:
true
}
onChange=
{
()
=>
changeEnableState
(
item
)
}
disabled=
{
User
.
getUserRole
()
===
'CloudManager'
||
User
.
getUserRole
()
===
'StoreManager'
?
false
:
true
}
...
...
src/modules/teach-tool/examination-manager/AddExam.tsx
View file @
1bf6cc7a
This diff is collapsed.
Click to expand it.
src/routes/index.tsx
View file @
1bf6cc7a
...
...
@@ -7,104 +7,82 @@
*/
import
mainRoutes
from
'./config/mainRoutes'
;
import
redirectRoutes
from
'./config/redirectRoutes'
;
import
React
from
'react'
import
{
Redirect
,
HashRouter
as
Router
,
Route
,
Switch
}
from
'react-router-dom'
;
import
React
from
'react'
;
import
{
HashRouter
as
Router
,
Route
,
Switch
}
from
'react-router-dom'
;
import
{
createHashHistory
}
from
'history'
;
import
App
from
'../modules/root/App'
;
import
AppContext
from
'@/modules/root/AppContent'
;
import
Login
from
'../modules/root/Login'
;
import
CollegeManagePage
from
'../modules/root/CollegeManagePage'
;
import
CreateCollege
from
'../modules/root/CreateCollege'
;
import
_
from
'underscore'
;
import
{
asyncComponent
}
from
'react-async-component'
import
SwitchRoute
from
'@/modules/root/SwitchRoute'
;
import
ErrorCollege
from
'@/modules/root/ErrorCollege'
;
const
history
=
createHashHistory
();
window
.
RCHistory
=
_
.
extend
({},
history
,
{
push
:
(
obj
:
any
)
=>
{
history
.
push
(
obj
)
history
.
push
(
obj
);
},
pushState
:
(
obj
:
any
)
=>
{
history
.
push
(
obj
)
history
.
push
(
obj
);
},
pushStateWithStatus
:
(
obj
:
any
)
=>
{
history
.
push
(
obj
)
history
.
push
(
obj
);
},
goBack
:
history
.
goBack
,
location
:
history
.
location
,
replace
:
(
obj
:
any
)
=>
{
history
.
replace
(
obj
)
}
});
const
cache
:
any
=
{
path
:
''
,
component
:
null
}
function
dynamic
(
component
:
any
)
{
const
resolveComponent
=
component
return
asyncComponent
({
resolve
:
()
=>
{
const
ts
=
resolveComponent
()
return
ts
history
.
replace
(
obj
);
},
})
}
});
export
const
RootRouter
=
()
=>
{
return
(
<
Router
{
...
history
}
>
<
Switch
>
<
Route
key=
"1"
exact
path=
"/login"
render=
{
()
=>
<
Login
/>
}
/>
<
Route
key=
"2"
exact
path=
"/switch-route"
render=
{
()
=>
<
SwitchRoute
/>
}
/>
<
Route
key=
"3"
exact
path=
"/college-manage"
render=
{
()
=>
<
CollegeManagePage
/>
}
/>
<
Route
key=
"4"
exact
path=
"/college-manage/create"
render=
{
()
=>
<
CreateCollege
/>
}
/>
<
Route
key=
"6"
exact
path=
"/error-college"
render=
{
()
=>
<
ErrorCollege
/>
}
/>
<
Route
key=
"5"
path=
"/"
render=
{
()
=>
<
AppContext
/>
}
/>
<
Route
key=
'1'
exact
path=
'/login'
render=
{
()
=>
<
Login
/>
}
/>
<
Route
key=
'2'
exact
path=
'/switch-route'
render=
{
()
=>
<
SwitchRoute
/>
}
/>
<
Route
key=
'3'
exact
path=
'/college-manage'
render=
{
()
=>
<
CollegeManagePage
/>
}
/>
<
Route
key=
'4'
exact
path=
'/college-manage/create'
render=
{
()
=>
<
CreateCollege
/>
}
/>
<
Route
key=
'6'
exact
path=
'/error-college'
render=
{
()
=>
<
ErrorCollege
/>
}
/>
<
Route
key=
'5'
path=
'/'
render=
{
()
=>
<
AppContext
/>
}
/>
</
Switch
>
</
Router
>
)
}
);
}
;
export
const
MainRoutes
=
()
=>
{
return
(
<
Switch
>
{
_
.
map
(
mainRoutes
,
({
path
,
component
,
},
key
)
=>
{
return
<
Route
{
_
.
map
(
mainRoutes
,
({
path
,
component
},
key
)
=>
{
return
(
<
Route
key=
{
key
}
path=
{
path
}
render=
{
()
=>
{
const
Component
=
component
;
return
<
Component
/>
return
<
Component
/>;
}
}
/>
})
}
);
})
}
</
Switch
>
)
}
);
}
;
export
const
RedirectRoutes
=
()
=>
{
return
(
<
Switch
>
{
_
.
map
(
redirectRoutes
,
({
path
,
component
,
},
key
)
=>
{
return
<
Route
{
_
.
map
(
redirectRoutes
,
({
path
,
component
},
key
)
=>
{
return
(
<
Route
key=
{
key
}
path=
{
path
}
render=
{
()
=>
{
const
Component
=
component
;
return
<
Component
/>
return
<
Component
/>;
}
}
/>
})
}
);
})
}
</
Switch
>
)
}
);
}
;
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