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
afdb5e13
Commit
afdb5e13
authored
Jul 09, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:删除重复合并的代码
parent
23a66d95
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
141 deletions
+2
-141
src/modules/course-manage/video-course/AddVideoCourse.jsx
+2
-141
No files found.
src/modules/course-manage/video-course/AddVideoCourse.jsx
View file @
afdb5e13
...
@@ -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: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-07-09 18:1
2:19
* @LastEditTime: 2021-07-09 18:1
0:37
* @Description: 线上课新增/编辑页
* @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -330,8 +330,8 @@ class AddVideoCourse extends React.Component {
...
@@ -330,8 +330,8 @@ class AddVideoCourse extends React.Component {
mediaType
:
"VIDEO"
,
mediaType
:
"VIDEO"
,
mediaName
:
folderName
.
replace
(
'.mp4'
,
''
),
mediaName
:
folderName
.
replace
(
'.mp4'
,
''
),
videoDuration
:
videoDom
.
duration
,
videoDuration
:
videoDom
.
duration
,
mediaUrl
:
ossUrl
,
resourceId
,
resourceId
,
mediaUrl
:
ossUrl
,
sort
:
_courseChapterList
.
length
sort
:
_courseChapterList
.
length
})
})
...
@@ -379,145 +379,6 @@ class AddVideoCourse extends React.Component {
...
@@ -379,145 +379,6 @@ class AddVideoCourse extends React.Component {
})
})
}
}
// 重命名
handleRenameCourseChapter
=
(
chapterId
)
=>
{
const
{
mediaNameAlias
}
=
this
.
state
;
this
.
handleValidateChapterName
(
mediaNameAlias
).
then
((
res
)
=>
{
// 校验不通过不能点确定保存修改课节名称
if
(
!
res
)
{
this
.
setState
({
chapterNameValidateStatus
:
''
,
chapterNameHelpMsg
:
''
,
mediaNameAlias
:
''
,
});
return
message
.
warning
(
'重命名失败'
);
}
let
{
courseChapterList
}
=
this
.
state
;
let
_courseChapterList
=
[];
_courseChapterList
=
courseChapterList
.
map
((
item
,
index
)
=>
{
if
(
item
.
id
===
chapterId
)
{
item
.
mediaName
=
mediaNameAlias
;
}
return
item
;
});
this
.
setState
({
courseChapterList
:
_courseChapterList
,
chapterNameValidateStatus
:
''
,
chapterNameHelpMsg
:
''
,
mediaNameAlias
:
''
,
});
});
};
// 校验课节名称
handleValidateChapterName
=
(
chapterName
)
=>
{
let
hasError
=
false
;
return
new
Promise
((
resolve
)
=>
{
if
(
!
chapterName
)
{
this
.
setState
({
chapterNameValidateStatus
:
'error'
,
chapterNameHelpMsg
:
'请输入课节名称'
,
});
hasError
=
true
;
resolve
(
false
);
return
false
;
}
if
(
chapterName
.
length
>
40
)
{
this
.
setState
({
chapterNameValidateStatus
:
'error'
,
chapterNameHelpMsg
:
'不要超过40字'
,
});
hasError
=
true
;
resolve
(
false
);
return
false
;
}
if
(
!
hasError
)
{
resolve
(
true
);
this
.
setState
({
chapterNameValidateStatus
:
''
,
chapterNameHelpMsg
:
''
,
});
}
});
};
handleDeleteCourseChapter
=
(
chapterId
)
=>
{
console
.
log
(
'chapterId---'
,
chapterId
);
let
{
courseChapterList
}
=
this
.
state
;
let
_courseChapterList
=
courseChapterList
.
filter
((
item
,
index
)
=>
{
return
item
.
id
!==
chapterId
;
});
this
.
setState
({
courseChapterList
:
_courseChapterList
,
});
};
renderChapterTitle
=
(
item
)
=>
{
const
{
chapterNameValidateStatus
,
chapterNameHelpMsg
}
=
this
.
state
;
return
(
<
div
className=
'course-chapter-title-popover'
>
<
div
className=
'tag-title'
>
课节名称
</
div
>
<
Form
>
<
Form
.
Item
validateStatus=
{
chapterNameValidateStatus
}
help=
{
chapterNameHelpMsg
}
>
<
TextArea
defaultValue=
{
item
.
mediaName
}
placeholder=
'请输入课节名称'
maxLength=
{
40
}
autoSize
style=
{
{
width
:
'318px'
}
}
onChange=
{
(
e
)
=>
{
this
.
setState
(
{
mediaNameAlias
:
e
.
target
.
value
.
trim
(),
},
()
=>
{
this
.
handleValidateChapterName
(
this
.
state
.
mediaNameAlias
);
}
);
}
}
/>
</
Form
.
Item
>
</
Form
>
</
div
>
);
};
// 上下移动
handleChangeIndex
=
(
isUp
,
sortIndex
)
=>
{
const
{
courseChapterList
}
=
this
.
state
;
// 第一个上移和最后一个下移不能使用
if
((
isUp
&&
sortIndex
===
0
)
||
(
!
isUp
&&
sortIndex
===
courseChapterList
.
length
-
1
))
{
return
;
}
let
_courseChapterList
=
[...
courseChapterList
];
const
temp
=
courseChapterList
[
sortIndex
];
// 若上移
if
(
isUp
)
{
_courseChapterList
[
sortIndex
-
1
]
=
temp
;
_courseChapterList
[
sortIndex
-
1
].
sort
=
sortIndex
-
1
;
_courseChapterList
[
sortIndex
]
=
courseChapterList
[
sortIndex
-
1
];
_courseChapterList
[
sortIndex
].
sort
=
sortIndex
;
}
else
{
// 若下移
_courseChapterList
[
sortIndex
+
1
]
=
temp
;
_courseChapterList
[
sortIndex
+
1
].
sort
=
sortIndex
+
1
;
_courseChapterList
[
sortIndex
]
=
courseChapterList
[
sortIndex
+
1
];
_courseChapterList
[
sortIndex
].
sort
=
sortIndex
;
}
this
.
setState
({
courseChapterList
:
_courseChapterList
,
});
};
// 保存
// 保存
handleSubmit
=
()
=>
{
handleSubmit
=
()
=>
{
//过期判断
//过期判断
...
...
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