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
0b0dddf3
Commit
0b0dddf3
authored
Jun 02, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Plain Diff
fix:解决合并冲突
parents
605c3df2
19120af7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
15 deletions
+24
-15
src/modules/teach-tool/components/CourseCategoryManage.jsx
+24
-15
No files found.
src/modules/teach-tool/components/CourseCategoryManage.jsx
View file @
0b0dddf3
/*
* @Author: yuananting
* @Date: 2021-02-23 18:28:50
* @LastEditors:
fusanqias
ng
* @LastEditTime: 2021-0
5-21 17:57:59
* @LastEditors:
yuananti
ng
* @LastEditTime: 2021-0
6-02 14:29:04
* @Description: 助学工具-课程分类
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -153,9 +153,7 @@ class CourseCategoryManage extends Component {
<
Space
className=
'title-opts'
size=
{
16
}
>
<
span
onClick=
{
()
=>
{
let
nodesCount
=
0
const
{
originTreeData
}
=
this
.
state
console
.
log
(
'orororo'
,
originTreeData
)
const
{
originTreeData
}
=
this
.
state
;
if
(
(
item
.
categoryLevel
===
0
&&
originTreeData
.
length
>=
29
)
||
(
item
.
categoryLevel
>
0
&&
this
.
getRelatedNodes
(
item
.
parentId
).
length
>=
30
)
...
...
@@ -343,8 +341,10 @@ class CourseCategoryManage extends Component {
let
dragNodes
=
[]
dragNodes
.
push
(
dragNode
.
id
)
if
(
dragNode
.
parentId
!=
0
)
{
dragNodes
=
dragNodes
.
concat
(
this
.
getParentDragNodesLevel
(
this
.
state
.
treeMap
[
dragNode
.
parentId
]))
if
(
dragNode
.
parentId
!==
"0"
)
{
dragNodes
=
dragNodes
.
concat
(
this
.
getParentDragNodesLevel
(
this
.
state
.
treeMap
[
dragNode
.
parentId
])
);
}
return
dragNodes
}
...
...
@@ -365,14 +365,24 @@ class CourseCategoryManage extends Component {
// 拖拽
onDrop
=
(
info
)
=>
{
if
(
this
.
state
.
categoryName
)
{
return
// 带搜索时的分类树不允许拖拽
// 不允许其他节点拖拽到未分类中
// 不允许其他节点拖拽到未分类之前
if
(
this
.
state
.
categoryName
||
(
info
.
node
.
categoryName
===
"未分类"
&&
info
.
dropPosition
===
0
)
||
(
info
.
node
.
categoryName
===
"未分类"
&&
info
.
dropToGap
&&
info
.
dropPosition
===
-
1
)
)
{
return
;
}
// 未分类不可以拖拽
if
(
info
.
dragNode
.
categoryName
===
'未分类'
&&
info
.
dragNode
.
categoryLevel
===
0
)
return
message
.
info
(
'未分类”为默认分类暂不支持移动'
)
// 不允许其他节点拖拽到未分类之前
if
(
info
.
node
.
categoryName
===
'未分类'
&&
info
.
dropToGap
&&
info
.
dropPosition
===
-
1
)
return
if
(
info
.
dragNode
.
categoryName
===
"未分类"
&&
info
.
dragNode
.
categoryLevel
===
0
)
return
message
.
info
(
"“未分类”为默认分类暂不支持移动"
);
let
targetParentId
=
info
.
dropToGap
?
info
.
node
.
parentId
:
info
.
node
.
id
let
relatedNodes
=
this
.
getRelatedNodes
(
targetParentId
)
...
...
@@ -383,8 +393,7 @@ class CourseCategoryManage extends Component {
let
nodesArr
=
this
.
getDragNodesLevel
(
this
.
state
.
treeMap
[
info
.
dragNode
.
id
])
let
parentArr
=
this
.
getParentDragNodesLevel
(
this
.
state
.
treeMap
[
targetParentId
])
if
(
nodesArr
.
length
+
parentArr
.
length
>
4
)
{
console
.
log
(
nodesArr
.
length
,
parentArr
.
length
)
return
message
.
info
(
'最多支持5级分类'
)
return
message
.
info
(
"最多支持5级分类"
);
}
}
if
(
relatedNodes
&&
relatedNodes
.
length
>=
30
)
{
...
...
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