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
84e85600
Commit
84e85600
authored
Mar 23, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:拖拽bug修复+导入刷新bug修复
parent
10ada5b6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
src/modules/teach-tool/QuestionCategoryManage.jsx
+14
-9
src/modules/teach-tool/components/QuestionBankSider.jsx
+3
-1
src/modules/teach-tool/components/QuestionManageContent.jsx
+1
-2
No files found.
src/modules/teach-tool/QuestionCategoryManage.jsx
View file @
84e85600
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-23 18:28:50
* @Date: 2021-02-23 18:28:50
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-2
2 21:22:03
* @LastEditTime: 2021-03-2
3 12:15:56
* @Description: 助学工具-题库-主页面分类管理
* @Description: 助学工具-题库-主页面分类管理
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -70,6 +70,7 @@ class QuestionCategoryManage extends Component {
...
@@ -70,6 +70,7 @@ class QuestionCategoryManage extends Component {
id
:
"0"
,
id
:
"0"
,
categoryName
:
"未分类"
,
categoryName
:
"未分类"
,
categoryCount
:
0
,
categoryCount
:
0
,
parentId
:
"0"
,
};
};
result
.
unshift
(
defaultNode
);
result
.
unshift
(
defaultNode
);
this
.
setState
({
this
.
setState
({
...
@@ -89,6 +90,7 @@ class QuestionCategoryManage extends Component {
...
@@ -89,6 +90,7 @@ class QuestionCategoryManage extends Component {
id
:
"0"
,
id
:
"0"
,
categoryName
:
"未分类"
,
categoryName
:
"未分类"
,
categoryCount
:
0
,
categoryCount
:
0
,
parentId
:
"0"
,
};
};
result
.
unshift
(
defaultNode
);
result
.
unshift
(
defaultNode
);
this
.
setState
({
this
.
setState
({
...
@@ -211,15 +213,16 @@ class QuestionCategoryManage extends Component {
...
@@ -211,15 +213,16 @@ class QuestionCategoryManage extends Component {
return
[];
return
[];
}
}
let
dragNodes
=
[];
let
dragNodes
=
[];
dragNodes
.
push
(
dragNode
.
id
)
dragNodes
.
push
(
dragNode
.
id
)
;
if
(
dragNode
.
parentId
!=
0
)
{
if
(
dragNode
.
parentId
!=
0
)
{
dragNodes
=
dragNodes
.
concat
(
this
.
getParentDragNodesLevel
(
this
.
state
.
treeMap
[
dragNode
.
parentId
]))
dragNodes
=
dragNodes
.
concat
(
this
.
getParentDragNodesLevel
(
this
.
state
.
treeMap
[
dragNode
.
parentId
])
);
}
}
return
dragNodes
;
return
dragNodes
;
};
};
getDragNodesLevel
=
(
dragNode
)
=>
{
getDragNodesLevel
=
(
dragNode
)
=>
{
let
dragNodes
=
[];
let
dragNodes
=
[];
if
(
dragNode
.
sonCategoryList
&&
dragNode
.
sonCategoryList
.
length
>
0
)
{
if
(
dragNode
.
sonCategoryList
&&
dragNode
.
sonCategoryList
.
length
>
0
)
{
...
@@ -238,11 +241,12 @@ class QuestionCategoryManage extends Component {
...
@@ -238,11 +241,12 @@ class QuestionCategoryManage extends Component {
return
;
return
;
}
}
// 未分类不可以拖拽
// 未分类不可以拖拽
if
(
// if (
info
.
dragNode
.
categoryName
===
"未分类"
||
// info.dragNode.categoryName === "未分类" ||
info
.
node
.
categoryName
===
"未分类"
// info.node.categoryName === "未分类"
)
// )
return
;
// return
// 不允许其他节点拖拽到未分类之前
// 不允许其他节点拖拽到未分类之前
if
(
if
(
info
.
node
.
categoryName
===
"未分类"
&&
info
.
node
.
categoryName
===
"未分类"
&&
...
@@ -250,6 +254,7 @@ class QuestionCategoryManage extends Component {
...
@@ -250,6 +254,7 @@ class QuestionCategoryManage extends Component {
info
.
dropPosition
===
-
1
info
.
dropPosition
===
-
1
)
)
return
;
return
;
let
targetParentId
=
info
.
dropToGap
?
info
.
node
.
parentId
:
info
.
node
.
id
;
let
targetParentId
=
info
.
dropToGap
?
info
.
node
.
parentId
:
info
.
node
.
id
;
if
(
this
.
state
.
treeMap
[
targetParentId
].
categoryLevel
===
4
)
{
if
(
this
.
state
.
treeMap
[
targetParentId
].
categoryLevel
===
4
)
{
return
message
.
info
(
"最多支持5级分类"
);
return
message
.
info
(
"最多支持5级分类"
);
...
...
src/modules/teach-tool/components/QuestionBankSider.jsx
View file @
84e85600
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-22 10:59:43
* @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-2
2 15:26
:27
* @LastEditTime: 2021-03-2
3 12:15
:27
* @Description: 助学工具-题库-题库主页面侧边栏
* @Description: 助学工具-题库-题库主页面侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -102,6 +102,7 @@ class QuestionBankSider extends Component {
...
@@ -102,6 +102,7 @@ class QuestionBankSider extends Component {
id
:
"0"
,
id
:
"0"
,
categoryName
:
"未分类"
,
categoryName
:
"未分类"
,
categoryCount
:
noCategoryCnt
,
categoryCount
:
noCategoryCnt
,
parentId
:
"0"
,
};
};
categoryList
.
unshift
(
defaultNode
);
categoryList
.
unshift
(
defaultNode
);
this
.
setState
({
this
.
setState
({
...
@@ -119,6 +120,7 @@ class QuestionBankSider extends Component {
...
@@ -119,6 +120,7 @@ class QuestionBankSider extends Component {
id
:
"0"
,
id
:
"0"
,
categoryName
:
"未分类"
,
categoryName
:
"未分类"
,
categoryCount
:
noCategoryCnt
,
categoryCount
:
noCategoryCnt
,
parentId
:
"0"
,
};
};
categoryList
.
unshift
(
defaultNode
);
categoryList
.
unshift
(
defaultNode
);
this
.
setState
({
this
.
setState
({
...
...
src/modules/teach-tool/components/QuestionManageContent.jsx
View file @
84e85600
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-25 11:23:47
* @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-2
2 15:26:55
* @LastEditTime: 2021-03-2
3 12:14:29
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -376,7 +376,6 @@ class QuestionManageContent extends Component {
...
@@ -376,7 +376,6 @@ class QuestionManageContent extends Component {
close=
{
()
=>
{
close=
{
()
=>
{
this
.
setState
({
ImportQuestionModal
:
null
},
()
=>
{
this
.
setState
({
ImportQuestionModal
:
null
},
()
=>
{
this
.
queryQuestionPageList
();
this
.
queryQuestionPageList
();
this
.
props
.
updatedSiderTree
(
this
.
props
.
selectedCategoryId
);
});
});
}
}
}
}
categoryId=
{
categoryId
}
categoryId=
{
categoryId
}
...
...
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