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
10c39c66
Commit
10c39c66
authored
Mar 18, 2021
by
sunbingqing
Browse files
Options
Browse Files
Download
Plain Diff
fix: 解决冲突
parents
9413e388
56dac057
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
35 deletions
+72
-35
src/modules/teach-tool/QuestionCategoryManage.jsx
+19
-7
src/modules/teach-tool/components/NewQuestionTab.jsx
+11
-12
src/modules/teach-tool/components/QuestionBankSider.jsx
+36
-11
src/modules/teach-tool/modal/BatchImportQuestionModal.jsx
+6
-4
src/modules/teach-tool/modal/BatchImportQuestionModal.less
+0
-1
No files found.
src/modules/teach-tool/QuestionCategoryManage.jsx
View file @
10c39c66
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-23 18:28:50
* @LastEditors: yuananting
* @LastEditTime: 2021-03-1
5 15:14:10
* @LastEditTime: 2021-03-1
8 18:13:26
* @Description: 助学工具-题库-主页面分类管理
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -51,12 +51,24 @@ class QuestionCategoryManage extends Component {
};
QuestionBankService
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
const
defaultNode
=
{
id
:
"0"
,
categoryName
:
"未分类"
,
categoryCount
:
0
};
result
.
unshift
(
defaultNode
);
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
result
,
categoryName
)
});
this
.
setState
({
expandedKeys
:
this
.
getFirstLevelKeys
(
result
),
});
let
str
=
"未分类"
;
if
(
categoryName
&&
str
.
indexOf
(
categoryName
)
<
0
)
{
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
result
,
categoryName
)
});
this
.
setState
({
expandedKeys
:
this
.
getFirstLevelKeys
(
result
),
});
}
else
{
const
defaultNode
=
{
id
:
"0"
,
categoryName
:
"未分类"
,
categoryCount
:
0
,
};
result
.
unshift
(
defaultNode
);
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
result
,
categoryName
)
});
this
.
setState
({
expandedKeys
:
this
.
getFirstLevelKeys
(
result
),
});
}
});
};
...
...
src/modules/teach-tool/components/NewQuestionTab.jsx
View file @
10c39c66
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-25 14:34:29
* @LastEditors: sunbingqing
* @LastEditTime: 2021-03-18 1
8:44:0
9
* @LastEditTime: 2021-03-18 1
9:32:4
9
* @Description: 助学工具-题库-题目管理-新建题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -111,13 +111,15 @@ class NewQuestionTab extends Component {
),
},
()
=>
{
const
con
=
questionInfo
.
questionStemList
[
0
].
content
;
const
input
=
con
.
match
(
/<input
([^
<>
]
*
)
>/g
)
const
_blanksList
=
input
.
map
(
item
=>
{
return
this
.
transferStemDocument
(
item
).
firstChild
})
console
.
log
(
"-----"
,
_blanksList
)
this
.
setState
({
blanksList
:
_blanksList
})
if
(
this
.
props
.
questionTypeKey
===
"GAP_FillING"
)
{
const
con
=
questionInfo
.
questionStemList
[
0
].
content
;
const
input
=
con
.
match
(
/<input
([^
<>
]
*
)
>/g
)
const
_blanksList
=
input
.
map
(
item
=>
{
return
this
.
transferStemDocument
(
item
).
firstChild
})
console
.
log
(
"-----"
,
_blanksList
)
this
.
setState
({
blanksList
:
_blanksList
})
}
}
);
// 题干内容
this
.
setState
({
...
...
@@ -646,7 +648,7 @@ class NewQuestionTab extends Component {
}
}
value=
{
tag
}
size=
"small"
suffix=
{
<
CloseOutlined
style=
{
{
color
:
"#999999"
}
}
/>
}
suffix=
{
<
CloseOutlined
onClick=
{
()
=>
this
.
handleInputConfirm
(
optionItem
)
}
style=
{
{
color
:
"#999999"
}
}
/>
}
onBlur=
{
(
e
)
=>
this
.
handleInputConfirm
(
optionItem
,
e
.
target
.
value
,
index
)
}
...
...
@@ -1185,7 +1187,6 @@ class NewQuestionTab extends Component {
);
let
acceptType
=
""
;
let
selectTypeList
=
[];
console
.
log
(
"mediaType"
,
mediaType
);
switch
(
mediaType
)
{
case
"PICTURE"
:
acceptType
=
MEDIA_FILE_ACCEPT
.
PICTURE
;
...
...
@@ -1201,8 +1202,6 @@ class NewQuestionTab extends Component {
break
;
}
console
.
log
(
acceptType
,
selectTypeList
);
return
(
<
div
className=
"question-input-item_wrapper"
>
{
/* 题干 */
}
...
...
src/modules/teach-tool/components/QuestionBankSider.jsx
View file @
10c39c66
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting
* @LastEditTime: 2021-03-18
09:33:50
* @LastEditTime: 2021-03-18
18:16:16
* @Description: 助学工具-题库-题库主页面侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -19,7 +19,9 @@ class QuestionBankSider extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
selectedKeys
:
getParameterByName
(
"categoryId"
)
?
[
getParameterByName
(
"categoryId"
)]
:
[
"0"
],
selectedKeys
:
getParameterByName
(
"categoryId"
)
?
[
getParameterByName
(
"categoryId"
)]
:
[
"0"
],
searchValue
:
null
,
NewEditQuestionBankCategory
:
null
,
//新增或编辑分类模态框
ImportCourseCategory
:
null
,
// 引用课程分类模态框
...
...
@@ -29,13 +31,19 @@ class QuestionBankSider extends Component {
componentDidMount
()
{
this
.
queryCategoryTree
();
this
.
props
.
getSelectedCategoryId
(
getParameterByName
(
"categoryId"
)
?
[
getParameterByName
(
"categoryId"
)]
:
[
"0"
],)
this
.
props
.
getSelectedCategoryId
(
getParameterByName
(
"categoryId"
)
?
[
getParameterByName
(
"categoryId"
)]
:
[
"0"
]
);
}
shouldComponentUpdate
(
nextProps
,
nextState
)
{
const
{
updatedCategoryId
}
=
nextProps
;
if
(
this
.
props
.
updatedCategoryId
!==
updatedCategoryId
)
{
this
.
setState
({
selectedKeys
:
[
updatedCategoryId
]
},
()
=>
this
.
queryCategoryTree
());
this
.
setState
({
selectedKeys
:
[
updatedCategoryId
]
},
()
=>
this
.
queryCategoryTree
()
);
}
return
true
;
}
...
...
@@ -59,7 +67,7 @@ class QuestionBankSider extends Component {
/** 树状选中事件 */
onSelect
=
(
selectedKeys
)
=>
{
this
.
setState
({
selectedKeys
});
this
.
props
.
getSelectedCategoryId
(
selectedKeys
)
this
.
props
.
getSelectedCategoryId
(
selectedKeys
)
;
};
// 查询分类树
...
...
@@ -72,12 +80,29 @@ class QuestionBankSider extends Component {
};
QuestionBankService
.
queryQuestionCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
categoryList
=
[],
noCategoryCnt
=
0
}
=
res
.
result
;
const
defaultNode
=
{
id
:
"0"
,
categoryName
:
"未分类"
,
categoryCount
:
noCategoryCnt
}
categoryList
.
unshift
(
defaultNode
);
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
categoryList
,
categoryName
)
});
this
.
setState
({
expandedKeys
:
this
.
getFirstLevelKeys
(
categoryList
),
});
let
str
=
"未分类"
;
if
(
categoryName
&&
str
.
indexOf
(
categoryName
)
<
0
)
{
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
categoryList
,
categoryName
),
});
this
.
setState
({
expandedKeys
:
this
.
getFirstLevelKeys
(
categoryList
),
});
}
else
{
const
defaultNode
=
{
id
:
"0"
,
categoryName
:
"未分类"
,
categoryCount
:
noCategoryCnt
,
};
categoryList
.
unshift
(
defaultNode
);
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
categoryList
,
categoryName
),
});
this
.
setState
({
expandedKeys
:
this
.
getFirstLevelKeys
(
categoryList
),
});
}
});
};
...
...
src/modules/teach-tool/modal/BatchImportQuestionModal.jsx
View file @
10c39c66
...
...
@@ -39,7 +39,6 @@ class BatchImportQuestionModal extends Component {
// 选择云盘资源
handleSelectExcel
=
(
file
)
=>
{
console
.
log
(
file
);
this
.
setState
({
uploadFile
:
file
});
this
.
setState
({
showSelectFileModal
:
false
,
...
...
@@ -133,6 +132,9 @@ class BatchImportQuestionModal extends Component {
</
div
>
<
div
className=
"step-section"
>
<
h4
className=
"step-title"
>
2.选择需要导入的Excel文件
</
h4
>
<
p
style=
{
{
marginBottom
:
16
,
color
:
"gray"
}
}
>
导入限制:一次最多导入1000个题目
</
p
>
<
Button
type=
"primary"
className=
"add-btn"
...
...
@@ -220,9 +222,9 @@ class BatchImportQuestionModal extends Component {
type=
"primary"
className=
"down-btn"
onClick=
{
()
=>
{
this
.
setState
({
status
:
"init"
})
this
.
setState
({
uploadFile
:
null
})
this
.
setState
({
showSelectFileModal
:
true
})
this
.
setState
({
status
:
"init"
})
;
this
.
setState
({
uploadFile
:
null
})
;
this
.
setState
({
showSelectFileModal
:
true
})
;
}
}
>
重新上传文件
...
...
src/modules/teach-tool/modal/BatchImportQuestionModal.less
View file @
10c39c66
...
...
@@ -6,7 +6,6 @@
.step-title {
font-size: 16px;
font-weight: 400;
margin-bottom: 16px;
color: #333;
}
.tip-box {
...
...
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