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
591affaa
Commit
591affaa
authored
Jan 12, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理排序和返回问题
parent
172c142a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
24 deletions
+49
-24
src/modules/course-manage/DataList/CourseData.jsx
+2
-2
src/modules/course-manage/video-course/AddVideoCourse.jsx
+41
-16
src/modules/course-manage/video-course/components/VideoCourseList.jsx
+6
-6
No files found.
src/modules/course-manage/DataList/CourseData.jsx
View file @
591affaa
...
@@ -151,8 +151,8 @@ class DataList extends React.Component {
...
@@ -151,8 +151,8 @@ class DataList extends React.Component {
},
},
{
{
title
:
"累计在线时长"
,
title
:
"累计在线时长"
,
dataIndex
:
"
watch
Duration"
,
dataIndex
:
"
total
Duration"
,
sorter
:
(
a
,
b
)
=>
a
.
watchDuration
-
b
.
watch
Duration
,
sorter
:
(
a
,
b
)
=>
a
.
totalDuration
-
b
.
total
Duration
,
sortDirections
:
[
"descend"
,
"ascend"
],
sortDirections
:
[
"descend"
,
"ascend"
],
render
:
(
text
,
record
)
=>
{
render
:
(
text
,
record
)
=>
{
//如无离开时间,就置空
//如无离开时间,就置空
...
...
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
591affaa
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-05 10:07:47
* @Date: 2020-08-05 10:07:47
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-
09 16:15:43
* @LastEditTime: 2021-01-
12 11:34:42
* @Description: 视频课新增/编辑页
* @Description: 视频课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -22,11 +22,23 @@ import PreviewCourseModal from '../modal/PreviewCourseModal';
...
@@ -22,11 +22,23 @@ import PreviewCourseModal from '../modal/PreviewCourseModal';
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
CourseService
from
"@/domains/course-domain/CourseService"
;
import
User
from
'@/common/js/user'
;
import
User
from
'@/common/js/user'
;
import
_
from
"underscore"
;
import
'./AddVideoCourse.less'
;
import
'./AddVideoCourse.less'
;
const
EDIT_BOX_KEY
=
Math
.
random
(
16
);
const
EDIT_BOX_KEY
=
Math
.
random
();
const
fieldNames
=
{
label
:
'categoryName'
,
value
:
'id'
,
children
:
'sonCategoryList'
};
const
fieldNames
=
{
label
:
'categoryName'
,
value
:
'id'
,
children
:
'sonCategoryList'
};
//添加课程时课程默认的一些值
const
defaultShelfState
=
'YES'
;
const
defaultScheduleMedia
=
[{
contentType
:
'INTRO'
,
mediaType
:
'TEXT'
,
mediaContent
:
''
,
key
:
EDIT_BOX_KEY
}]
const
whetherVisitorsJoin
=
'NO'
class
AddVideoCourse
extends
React
.
Component
{
class
AddVideoCourse
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -39,7 +51,6 @@ class AddVideoCourse extends React.Component {
...
@@ -39,7 +51,6 @@ class AddVideoCourse extends React.Component {
id
,
// 视频课ID,编辑的时候从URL上带过来
id
,
// 视频课ID,编辑的时候从URL上带过来
pageType
,
// 页面类型: add->新建 edit->编辑
pageType
,
// 页面类型: add->新建 edit->编辑
imageFile
:
null
,
// 需要被截取的图片
imageFile
:
null
,
// 需要被截取的图片
courseName
:
null
,
// 视频课名称
courseName
:
null
,
// 视频课名称
scheduleVideoId
:
null
,
// 视频课链接
scheduleVideoId
:
null
,
// 视频课链接
coverId
:
null
,
// 视频封面的recourceId
coverId
:
null
,
// 视频封面的recourceId
...
@@ -50,7 +61,7 @@ class AddVideoCourse extends React.Component {
...
@@ -50,7 +61,7 @@ class AddVideoCourse extends React.Component {
contentType
:
"INTRO"
,
contentType
:
"INTRO"
,
mediaType
:
'TEXT'
,
mediaType
:
'TEXT'
,
mediaContent
:
''
,
mediaContent
:
''
,
key
:
Math
.
random
()
key
:
EDIT_BOX_KEY
}],
}],
diskList
:
[],
// 机构可见磁盘目录
diskList
:
[],
// 机构可见磁盘目录
selectedFileList
:
[],
// 已经从资料云盘中勾选的文件
selectedFileList
:
[],
// 已经从资料云盘中勾选的文件
...
@@ -171,22 +182,36 @@ class AddVideoCourse extends React.Component {
...
@@ -171,22 +182,36 @@ class AddVideoCourse extends React.Component {
categoryName
,
categoryName
,
categoryId
categoryId
});
});
})
})
}
}
handleGoBack
=
()
=>
{
handleGoBack
=
()
=>
{
Modal
.
confirm
({
const
{
title
:
'确认要返回吗?'
,
coverId
,
content
:
'返回后,本次编辑的内容将不被保存。'
,
videoName
,
okText
:
'确认返回'
,
videoDuration
,
cancelText
:
'留在本页'
,
courseName
,
icon
:
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>,
scheduleMedia
,
onOk
:
()
=>
{
scheduleVideoId
,
RCHistory
.
goBack
();
categoryId
,
}
shelfState
,
});
whetherVisitorsJoin
}
=
this
.
state
;
if
(
videoName
||
videoDuration
||
scheduleVideoId
||
!
_
.
isEqual
(
scheduleMedia
,
defaultScheduleMedia
)
||
categoryId
||
courseName
||
coverId
||
shelfState
!==
defaultShelfState
||
whetherVisitorsJoin
!==
whetherVisitorsJoin
){
Modal
.
confirm
({
title
:
'确认要返回吗?'
,
content
:
'返回后,本次编辑的内容将不被保存。'
,
okText
:
'确认返回'
,
cancelText
:
'留在本页'
,
icon
:
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>,
onOk
:
()
=>
{
RCHistory
.
goBack
();
}
});
}
else
{
RCHistory
.
goBack
();
}
}
}
// 修改表单
// 修改表单
...
...
src/modules/course-manage/video-course/components/VideoCourseList.jsx
View file @
591affaa
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-08-05 10:12:45
* @Date: 2020-08-05 10:12:45
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-
08 17:03:46
* @LastEditTime: 2021-01-
12 10:58:47
* @Description: 视频课-列表模块
* @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -269,17 +269,17 @@ class VideoCourseList extends React.Component {
...
@@ -269,17 +269,17 @@ class VideoCourseList extends React.Component {
const
{
query
}
=
this
.
props
;
const
{
query
}
=
this
.
props
;
let
{
order
:
_order
}
=
query
;
let
{
order
:
_order
}
=
query
;
// 按创建时间升序排序
// 按创建时间升序排序
if
(
columnKey
===
'create
Time
'
&&
order
===
'ascend'
)
{
_order
=
'CREATED_ASC'
;
}
if
(
columnKey
===
'create
d
'
&&
order
===
'ascend'
)
{
_order
=
'CREATED_ASC'
;
}
// 按创建时间降序排序
// 按创建时间降序排序
if
(
columnKey
===
'create
Time
'
&&
order
===
'descend'
)
{
_order
=
'CREATED_DESC'
;
}
if
(
columnKey
===
'create
d
'
&&
order
===
'descend'
)
{
_order
=
'CREATED_DESC'
;
}
// 按更新时间升序排序
// 按更新时间升序排序
if
(
columnKey
===
'update
Time
'
&&
order
===
'ascend'
)
{
_order
=
'UPDATED_ASC'
;
}
if
(
columnKey
===
'update
d
'
&&
order
===
'ascend'
)
{
_order
=
'UPDATED_ASC'
;
}
// 按更新时间降序排序
// 按更新时间降序排序
if
(
columnKey
===
'update
Time
'
&&
order
===
'descend'
)
{
_order
=
'UPDATED_DESC'
;
}
if
(
columnKey
===
'update
d
'
&&
order
===
'descend'
)
{
_order
=
'UPDATED_DESC'
;
}
const
_query
=
{
const
_query
=
{
...
query
,
...
query
,
order
:
_order
order
Enum
:
_order
};
};
this
.
props
.
onChange
(
_query
);
this
.
props
.
onChange
(
_query
);
}
}
...
...
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