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
1
Merge Requests
1
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
fcd6c2fb
Commit
fcd6c2fb
authored
Aug 05, 2021
by
maolipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:assadadasd
parent
1b5821c3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
98 deletions
+40
-98
src/core/routeHook.js
+4
-0
src/index.tsx
+1
-0
src/modules/course-manage/components/CreateWorkWXCourse.jsx
+27
-98
src/modules/course-manage/components/LiveCourseList.jsx
+8
-0
No files found.
src/core/routeHook.js
View file @
fcd6c2fb
...
...
@@ -23,6 +23,7 @@ class routeHook {
}
cancel
()
{
//取消跳转
console
.
log
(
'jhgjh'
)
this
.
routeFun
.
pop
()
}
...
...
@@ -42,7 +43,10 @@ class routeHook {
// **
addSaveCase
()
{
//离开保存校验时将方法注入
setTimeout
(()
=>
{
this
.
add
(
this
.
saveBeforeLeave
.
bind
(
this
))
},
100
)
}
saveBeforeLeave
()
{
//离开保存时触发的方法
...
...
src/index.tsx
View file @
fcd6c2fb
...
...
@@ -61,6 +61,7 @@ window.RCHistory = _.extend({}, history, {
});
window
.
onhashchange
=
()
=>
{
console
.
log
(
132121
)
routeHook
.
cancel
()
}
...
...
src/modules/course-manage/components/CreateWorkWXCourse.jsx
View file @
fcd6c2fb
...
...
@@ -195,11 +195,6 @@ function CreateWorkWXCourse() {
}
}
// 修改简介
function
handleChangeIntroInfo
(
field
,
value
)
{
};
// 完成创建/编辑
function
handleSubmit
()
{
//过期判断
...
...
@@ -223,8 +218,8 @@ function CreateWorkWXCourse() {
});
return
;
}
// this.handleValidate(addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, isEdit, editorTextLength
).then((res) => {
//
if (!res) return;
handleValidate
(
).
then
((
res
)
=>
{
if
(
!
res
)
return
;
//上传简介
Upload
.
uploadTextToOSS
(
introduce
,
...
...
@@ -234,7 +229,7 @@ function CreateWorkWXCourse() {
},
()
=>
message
.
warning
(
'上传课程简介失败'
)
);
//
});
});
};
function
submitRemote
({
introduceId
,
id
})
{
...
...
@@ -242,7 +237,9 @@ function CreateWorkWXCourse() {
}
else
{
}
console
.
log
(
'取消'
)
routeHook
.
cancel
()
if
(
type
===
'add'
)
{
if
(
endTime
!==
0
)
{
classInfo
.
duration
=
String
((
endTime
-
classInfo
.
startTime
)
/
1000
)
...
...
@@ -257,6 +254,7 @@ function CreateWorkWXCourse() {
CourseService
.
createWorkWXLiveCourse
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
message
.
success
(
'新建成功'
);
Bus
.
trigger
(
'freshCourseList'
)
window
.
RCHistory
.
push
({
pathname
:
`/live-course`
,
});
...
...
@@ -276,6 +274,7 @@ function CreateWorkWXCourse() {
};
CourseService
.
updateWorkWXLiveCourse
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
Bus
.
trigger
(
'freshCourseList'
)
message
.
success
(
'更新成功'
);
window
.
RCHistory
.
push
({
pathname
:
`/live-course`
,
...
...
@@ -284,103 +283,33 @@ function CreateWorkWXCourse() {
});
}
};
/*
handleValidate = (addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, isEdit, editorTextLength) => {
return new Promise((resolve) => {
const { type } = this.state;
const { courseName, categoryId } = addLiveBasicInfo;
const { liveDate, timeHorizonStart, timeHorizonEnd, teacherId, calendarTime } = addLiveClassInfo;
const { liveCourseMediaRequests } = addLiveIntroInfo;
const currentTime = +new Date();
if (!courseName) {
message.warning('请输入课程名称');
resolve(false);
return;
}
if (!categoryId) {
message.warning('请选择课程分类');
resolve(false);
return;
}
if (type === 'add') {
const { startTime, endTime } = addLiveClassInfo;
if (calendarTime.length === 0) {
message.warning('请选择上课日期');
resolve(false);
return;
} else if (startTime === endTime || startTime > endTime) {
message.warning('结束时间必须晚于开始时间');
resolve(false);
return;
}
// 若有今日排课 校验当前时间
const currentDay = moment(currentTime).format('YYYY-MM-DD');
const itemToday = _.find(calendarTime, (item) => {
const itemDay = moment(item).format('YYYY-MM-DD');
return itemDay === currentDay;
});
if (itemToday) {
const itemDay = moment(itemToday).format('YYYY-MM-DD');
const itemHour = moment(startTime).format('HH:mm');
if (itemDay === currentDay) {
if (moment(itemDay + ' ' + itemHour).format('x') < currentTime) {
message.warning('开始时间不能早于现在');
resolve(false);
return;
}
}
}
} else {
const _liveDate = moment(liveDate).format('YYYY-MM-DD');
const _timeHorizonStart = moment(timeHorizonStart).format('HH:mm');
const _timeHorizonEnd = moment(timeHorizonEnd).format('HH:mm');
const startTime = moment(_liveDate + ' ' + _timeHorizonStart).format('x');
const endTime = moment(_liveDate + ' ' + _timeHorizonEnd).format('x');
if (!startTime || !endTime) {
message.warning('日期不能为空');
resolve(false);
return;
} else if (!timeHorizonStart) {
message.warning('开始时间不能为空');
resolve(false);
return;
} else if (!timeHorizonEnd) {
message.warning('结束时间不能为空');
resolve(false);
return;
} else if (isEdit && startTime < currentTime) {
message.warning('开始时间不能早于当前时间');
resolve(false);
return;
} else if (isEdit && endTime < currentTime) {
message.warning('结束时间不能早于当前时间');
resolve(false);
return;
} else if (isEdit && endTime <= startTime) {
message.warning('结束时间不能早于开始时间');
resolve(false);
return;
function
handleValidate
()
{
return
new
Promise
((
resolve
)
=>
{
if
(
_
.
isEmpty
(
basicInfo
.
courseName
))
{
message
.
warning
(
"课程名称不能为空"
)
resolve
(
false
)
return
}
if
(
_
.
isEmpty
(
basicInfo
.
categoryId
))
{
message
.
warning
(
"课程分类未选择"
)
resolve
(
false
)
return
}
if (!
teacherId
) {
message.warning(
'请选择讲师');
resolve(false)
;
return
;
if
(
!
classInfo
.
startTime
)
{
message
.
warning
(
"未设置开始时间"
)
resolve
(
false
)
return
}
if (editorTextLength > 1000) {
message.warning('课程简介超过字数限定');
resolve(false);
return;
if
(
_
.
isEmpty
(
classInfo
.
teacherId
))
{
message
.
warning
(
"课程分类未选择"
)
resolve
(
false
)
return
}
resolve(true)
;
resolve
(
true
)
});
};
*/
// 显示预览课程弹窗
function
handleShowPreviewModal
()
{
...
...
src/modules/course-manage/components/LiveCourseList.jsx
View file @
fcd6c2fb
...
...
@@ -24,6 +24,7 @@ import DataList from '../DataList/DataList';
import
ManageCoursewareModal
from
'../modal/ManageCoursewareModal'
;
import
RelatedPlanModal
from
'../modal/RelatedPlanModal'
;
import
ShareLiveModal
from
'../modal/ShareLiveModal'
;
import
Bus
from
'@/core/bus'
;
import
'./LiveCourseList.less'
;
const
{
confirm
}
=
Modal
;
...
...
@@ -64,7 +65,14 @@ class LiveCourseList extends React.Component {
this
.
parseColumns
();
}
componentDidMount
()
{
<
<<<<<<
feature
/
zhujian
/0726/
qwLiving
this
.
getDownloadVersion
();
=======
this
.
getDownloadVersion
()
Bus
.
bind
('
freshCourseList
',()=
>
{
this
.
refreshCourseList
()
}
)
>>>>>>>
local
}
// 显示分享弹窗
handleShowShareModal = (item, needStr = false) =
>
{
...
...
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