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
6fbc53fd
Commit
6fbc53fd
authored
May 21, 2021
by
chenshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复
parent
34e9e15f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
30 deletions
+42
-30
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
+42
-30
No files found.
src/modules/course-manage/offline-course/AddOfflineCourse.jsx
View file @
6fbc53fd
...
@@ -14,7 +14,7 @@ import {
...
@@ -14,7 +14,7 @@ import {
Radio
,
Radio
,
message
,
message
,
Modal
,
Modal
,
Cascader
,
TreeSelect
,
Select
,
Select
,
Switch
,
Switch
,
TimePicker
,
TimePicker
,
...
@@ -101,6 +101,8 @@ class AddOfflineCourse extends React.Component {
...
@@ -101,6 +101,8 @@ class AddOfflineCourse extends React.Component {
whetherSetSignIn
:
'YES'
,
whetherSetSignIn
:
'YES'
,
whetherSetSignOut
:
'YES'
,
whetherSetSignOut
:
'YES'
,
isEditDisablie
:
false
,
isEditDisablie
:
false
,
startTime
:
new
Date
().
getTime
()
+
300000
,
// 批量开始时分
endTime
:
new
Date
().
getTime
()
+
300000
,
// 批量结束时分
}
}
}
}
...
@@ -128,11 +130,29 @@ class AddOfflineCourse extends React.Component {
...
@@ -128,11 +130,29 @@ class AddOfflineCourse extends React.Component {
//获取分类列表
//获取分类列表
getCourseCatalogList
=
()
=>
{
getCourseCatalogList
=
()
=>
{
Service
.
Hades
(
'public/hades/queryCategoryTree'
,
{
source
:
0
,
tenantId
:
User
.
getStoreId
(),
count
:
false
,
userId
:
User
.
getUserId
()
}).
then
((
res
)
=>
{
Service
.
Hades
(
'public/hades/queryCategoryTree'
,
{
source
:
0
,
tenantId
:
User
.
getStoreId
(),
count
:
false
,
userId
:
User
.
getUserId
()
}).
then
((
res
)
=>
{
this
.
setState
({
const
{
categoryList
=
[]
}
=
res
.
result
;
courseCatalogList
:
res
.
result
.
categoryList
this
.
setState
({
})
courseCatalogList
:
this
.
renderTreeNodes
(
categoryList
),
})
});
});
}
}
renderTreeNodes
=
(
data
)
=>
{
let
newTreeData
=
data
.
map
((
item
)
=>
{
item
.
title
=
(
<
span
>
{
item
.
categoryName
}
</
span
>
);
item
.
value
=
item
.
id
;
item
.
key
=
item
.
id
;
if
(
item
.
sonCategoryList
)
{
item
.
children
=
this
.
renderTreeNodes
(
item
.
sonCategoryList
);
}
return
item
;
});
return
newTreeData
;
};
catalogChange
=
(
value
,
options
)
=>
{
catalogChange
=
(
value
,
options
)
=>
{
this
.
setState
({
categoryId
:
_
.
last
(
value
),
categoryName
:
_
.
pluck
(
options
,
'categoryName'
).
join
(
'-'
)
})
this
.
setState
({
categoryId
:
_
.
last
(
value
),
categoryName
:
_
.
pluck
(
options
,
'categoryName'
).
join
(
'-'
)
})
...
@@ -699,6 +719,10 @@ class AddOfflineCourse extends React.Component {
...
@@ -699,6 +719,10 @@ class AddOfflineCourse extends React.Component {
}
}
}
}
handleChangeCatalogList
=
(
value
)
=>
{
this
.
setState
({
categoryId
:
value
});
};
render
()
{
render
()
{
const
{
const
{
courseId
,
courseId
,
...
@@ -706,7 +730,7 @@ class AddOfflineCourse extends React.Component {
...
@@ -706,7 +730,7 @@ class AddOfflineCourse extends React.Component {
courseName
,
courseName
,
coverUrl
,
coverUrl
,
introduce
,
introduce
,
category
Name
,
category
Id
,
courseCatalogList
,
courseCatalogList
,
whetherVisitorsJoin
,
whetherVisitorsJoin
,
loadintroduce
,
loadintroduce
,
...
@@ -791,31 +815,18 @@ class AddOfflineCourse extends React.Component {
...
@@ -791,31 +815,18 @@ class AddOfflineCourse extends React.Component {
</
div
>
</
div
>
<
div
className=
"course-catalog"
>
<
div
className=
"course-catalog"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
课程分类:
</
span
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
课程分类:
</
span
>
{
(
pageType
===
'add'
)
&&
<
TreeSelect
<
Cascader
style=
{
{
width
:
240
}
}
showSearch
dropdownStyle=
{
{
maxHeight
:
240
,
overflow
:
"auto"
}
}
defaultValue=
{
categoryName
?
[
categoryName
]
:
undefined
}
treeData=
{
courseCatalogList
}
options=
{
courseCatalogList
}
placeholder=
"请选择课程类型"
displayRender=
{
label
=>
label
.
join
(
'-'
)
}
allowClear
fieldNames=
{
fieldNames
}
value=
{
categoryId
}
onChange=
{
this
.
catalogChange
}
treeDefaultExpandAll
style=
{
{
width
:
240
}
}
onChange=
{
(
value
)
=>
{
placeholder=
"请选择课程分类"
suffixIcon=
{
<
span
className=
"icon iconfont"
style=
{
{
fontSize
:
'12px'
,
color
:
'#BFBFBF'
}
}
>

</
span
>
}
this
.
handleChangeCatalogList
(
value
);
/>
}
}
}
/>
{
(
pageType
===
'edit'
&&
categoryName
)
&&
<
Cascader
showSearch
defaultValue=
{
[
categoryName
]
}
options=
{
courseCatalogList
}
displayRender=
{
label
=>
label
.
join
(
'-'
)
}
fieldNames=
{
fieldNames
}
onChange=
{
this
.
catalogChange
}
style=
{
{
width
:
240
}
}
placeholder=
"请选择课程分类"
suffixIcon=
{
<
span
className=
"icon iconfont"
style=
{
{
fontSize
:
'12px'
,
color
:
'#BFBFBF'
}
}
>

</
span
>
}
/>
}
</
div
>
</
div
>
<
div
className=
"course-catalog"
>
<
div
className=
"course-catalog"
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
上课地点:
</
span
>
<
span
className=
"label"
><
span
className=
"require"
>
*
</
span
>
上课地点:
</
span
>
...
@@ -1071,6 +1082,7 @@ class AddOfflineCourse extends React.Component {
...
@@ -1071,6 +1082,7 @@ class AddOfflineCourse extends React.Component {
}
}
}
}
/>
/>
<
span
className=
"switch-label"
>
人
</
span
>
<
span
className=
"switch-label"
>
人
</
span
>
<
span
className=
"switch-tip"
>
未填写时默认为不限制
</
span
>
</
div
>
}
</
div
>
}
</
div
>
</
div
>
</
div
>
</
div
>
...
...
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