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
462c5b38
Commit
462c5b38
authored
Mar 16, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:填空修改暂存
parent
96b7a4c4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
341 additions
and
32 deletions
+341
-32
src/data-source/questionBank/request-apis.ts
+6
-1
src/domains/question-bank-domain/QuestionBankService.ts
+8
-2
src/modules/store-manage/StoreWebDecorationTab.jsx
+2
-2
src/modules/teach-tool/AddNewQuestion.jsx
+10
-4
src/modules/teach-tool/components/GapFillingStem.jsx
+10
-7
src/modules/teach-tool/components/GapFillingStem.less
+2
-1
src/modules/teach-tool/components/NewQuestionTab.jsx
+0
-0
src/modules/teach-tool/components/NewQuestionTab.less
+5
-4
src/modules/teach-tool/components/QuestionManageContent.jsx
+31
-9
src/modules/teach-tool/components/QuestionManageContent.less
+6
-1
src/modules/teach-tool/modal/BatchImportQuestionModal.jsx
+107
-0
src/modules/teach-tool/modal/BatchImportQuestionModal.less
+84
-0
src/modules/teach-tool/modal/QuestionPreviewModal.jsx
+47
-1
src/modules/teach-tool/modal/QuestionPreviewModal.less
+23
-0
No files found.
src/data-source/questionBank/request-apis.ts
View file @
462c5b38
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-03 15:13:12
* @Date: 2021-03-03 15:13:12
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-1
5 19:44:31
* @LastEditTime: 2021-03-1
6 15:11:25
* @Description: 助学工具接口
* @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -52,3 +52,7 @@ export function queryQuestionDetails(params: object) {
...
@@ -52,3 +52,7 @@ export function queryQuestionDetails(params: object) {
export
function
editQuestion
(
params
:
object
)
{
export
function
editQuestion
(
params
:
object
)
{
return
Service
.
Hades
(
"anon/hades/question/editQuestion"
,
params
);
return
Service
.
Hades
(
"anon/hades/question/editQuestion"
,
params
);
}
}
export
function
batchImport
(
params
:
object
)
{
return
Service
.
Hades
(
"anon/hades/question/batchImport"
,
params
);
}
\ No newline at end of file
src/domains/question-bank-domain/QuestionBankService.ts
View file @
462c5b38
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-11 11:34:37
* @Date: 2021-03-11 11:34:37
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-1
5 19:45:10
* @LastEditTime: 2021-03-1
6 15:12:09
* @Description: 描述一下咯
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
{
queryCategoryTree
,
addCategory
,
delCategory
,
editCategory
,
editCategoryTree
,
queryQuestionCategoryTree
,
addQuestion
,
queryQuestionPageList
,
deleteQuestion
,
queryQuestionDetails
,
editQuestion
}
from
'@/data-source/questionBank/request-apis'
;
import
{
queryCategoryTree
,
addCategory
,
delCategory
,
editCategory
,
editCategoryTree
,
queryQuestionCategoryTree
,
addQuestion
,
queryQuestionPageList
,
deleteQuestion
,
queryQuestionDetails
,
editQuestion
,
batchImport
}
from
'@/data-source/questionBank/request-apis'
;
export
default
class
QuestionBankService
{
export
default
class
QuestionBankService
{
// 获取题目分类树
// 获取题目分类树
static
queryCategoryTree
(
params
:
any
)
{
static
queryCategoryTree
(
params
:
any
)
{
...
@@ -62,4 +62,9 @@ export default class QuestionBankService {
...
@@ -62,4 +62,9 @@ export default class QuestionBankService {
static
editQuestion
(
params
:
any
)
{
static
editQuestion
(
params
:
any
)
{
return
editQuestion
(
params
);
return
editQuestion
(
params
);
}
}
// 批量导入
static
batchImport
(
params
:
any
)
{
return
batchImport
(
params
);
}
}
}
\ No newline at end of file
src/modules/store-manage/StoreWebDecorationTab.jsx
View file @
462c5b38
/*
/*
* @Author: wufan
* @Author: wufan
* @Date: 2020-11-30 10:47:38
* @Date: 2020-11-30 10:47:38
* @LastEditors:
wufan
* @LastEditors:
yuananting
* @LastEditTime: 2021-0
1-18 14:59:57
* @LastEditTime: 2021-0
3-16 15:28:55
* @Description: web店铺banner页面
* @Description: web店铺banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
...
src/modules/teach-tool/AddNewQuestion.jsx
View file @
462c5b38
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-25 13:46:35
* @Date: 2021-02-25 13:46:35
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-1
5 21:14:47
* @LastEditTime: 2021-03-1
6 16:44:23
* @Description: 助学工具-题库-题目管理-新增题目
* @Description: 助学工具-题库-题目管理-新增题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -15,6 +15,7 @@ import NewQuestionTab from "./components/NewQuestionTab";
...
@@ -15,6 +15,7 @@ import NewQuestionTab from "./components/NewQuestionTab";
import
{
defineQuestionInfo
}
from
"./components/model"
;
import
{
defineQuestionInfo
}
from
"./components/model"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBankService"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBankService"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
UploadOss
from
"@/core/upload"
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
class
AddNewQuestion
extends
Component
{
class
AddNewQuestion
extends
Component
{
...
@@ -144,10 +145,14 @@ class AddNewQuestion extends Component {
...
@@ -144,10 +145,14 @@ class AddNewQuestion extends Component {
}
}
break
;
break
;
case
"JUDGE"
:
case
"JUDGE"
:
this
.
judgeRef
.
checkInput
();
if
(
this
.
judgeRef
.
checkInput
()
===
0
)
{
this
.
saveCurrentQuestion
(
judgeContent
);
}
break
;
break
;
case
"GAP_FILLING"
:
case
"GAP_FILLING"
:
this
.
CompletionRef
.
checkInput
();
if
(
this
.
gapRef
.
checkInput
()
===
0
)
{
// this.saveCurrentQuestion(gapFillingContent);
}
break
;
break
;
case
"INDEFINITE_CHOICE"
:
case
"INDEFINITE_CHOICE"
:
if
(
this
.
indefiniteRef
.
checkInput
()
===
0
)
{
if
(
this
.
indefiniteRef
.
checkInput
()
===
0
)
{
...
@@ -242,10 +247,11 @@ class AddNewQuestion extends Component {
...
@@ -242,10 +247,11 @@ class AddNewQuestion extends Component {
<
NewQuestionTab
<
NewQuestionTab
questionTypeKey=
"GAP_FILLING"
questionTypeKey=
"GAP_FILLING"
onRef=
{
(
ref
)
=>
{
onRef=
{
(
ref
)
=>
{
this
.
Completion
Ref
=
ref
;
this
.
gap
Ref
=
ref
;
}
}
}
}
questionInfo=
{
gapFillingContent
}
questionInfo=
{
gapFillingContent
}
onSetState=
{
(
newContent
)
=>
{
onSetState=
{
(
newContent
)
=>
{
console
.
log
(
"gapFillingContent:"
,
newContent
);
Object
.
assign
(
gapFillingContent
,
newContent
);
Object
.
assign
(
gapFillingContent
,
newContent
);
}
}
}
}
/>
/>
...
...
src/modules/teach-tool/components/
Completion
Stem.jsx
→
src/modules/teach-tool/components/
GapFilling
Stem.jsx
View file @
462c5b38
import
React
,
{
Component
}
from
"react"
;
import
React
,
{
Component
}
from
"react"
;
import
{
message
,
Button
}
from
"antd"
;
import
{
message
,
Button
}
from
"antd"
;
import
UploadOss
from
"@/core/upload"
;
import
UploadOss
from
"@/core/upload"
;
import
"./
Completion
Stem.less"
;
import
"./
GapFilling
Stem.less"
;
const
MEDIA_MAP
=
[
const
MEDIA_MAP
=
[
{
{
title
:
"音频"
,
title
:
"音频"
,
...
@@ -24,7 +24,7 @@ const MEDIA_MAP = [
...
@@ -24,7 +24,7 @@ const MEDIA_MAP = [
key
:
"VIDEO"
,
key
:
"VIDEO"
,
},
},
];
];
class
Completion
Stem
extends
Component
{
class
GapFilling
Stem
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
...
@@ -48,13 +48,14 @@ class CompletionStem extends Component {
...
@@ -48,13 +48,14 @@ class CompletionStem extends Component {
var
_blanksList
=
[];
var
_blanksList
=
[];
const
stemInput
=
document
.
getElementById
(
"editor-box_content"
);
const
stemInput
=
document
.
getElementById
(
"editor-box_content"
);
stemInput
.
childNodes
.
forEach
((
item
)
=>
{
stemInput
.
childNodes
.
forEach
((
item
)
=>
{
if
(
item
.
nodeName
===
"SPAN"
)
{
if
(
item
.
nodeName
===
"SPAN"
&&
item
.
id
)
{
_blanksList
.
push
(
item
);
_blanksList
.
push
(
item
);
}
}
});
});
this
.
setState
({
blanksList
:
_blanksList
})
this
.
setState
({
blanksList
:
_blanksList
})
this
.
handleStemStyle
();
this
.
handleStemStyle
();
this
.
props
.
changeBlankCount
(
this
.
state
.
blanksList
);
this
.
props
.
onChange
(
stemInput
.
innerHTML
)
this
.
props
.
changeBlankCount
(
_blanksList
);
};
};
/**
/**
...
@@ -66,6 +67,7 @@ class CompletionStem extends Component {
...
@@ -66,6 +67,7 @@ class CompletionStem extends Component {
insertBlanks
=
()
=>
{
insertBlanks
=
()
=>
{
document
.
getElementById
(
"editor-box_content"
).
focus
();
document
.
getElementById
(
"editor-box_content"
).
focus
();
const
_blanksList
=
this
.
state
.
blanksList
;
const
_blanksList
=
this
.
state
.
blanksList
;
console
.
log
(
"888888888888:"
,
_blanksList
);
var
blanks
=
document
.
createElement
(
"span"
);
var
blanks
=
document
.
createElement
(
"span"
);
blanks
.
className
=
"fill-line"
;
blanks
.
className
=
"fill-line"
;
blanks
.
innerHTML
=
"填空"
;
blanks
.
innerHTML
=
"填空"
;
...
@@ -75,6 +77,7 @@ class CompletionStem extends Component {
...
@@ -75,6 +77,7 @@ class CompletionStem extends Component {
this
.
setState
({
blanksList
:
_blanksList
});
this
.
setState
({
blanksList
:
_blanksList
});
var
sel
,
range
;
var
sel
,
range
;
sel
=
window
.
getSelection
();
sel
=
window
.
getSelection
();
console
.
log
(
"*****:"
,
sel
)
if
(
sel
.
getRangeAt
&&
sel
.
rangeCount
)
{
if
(
sel
.
getRangeAt
&&
sel
.
rangeCount
)
{
range
=
sel
.
getRangeAt
(
0
);
range
=
sel
.
getRangeAt
(
0
);
range
.
deleteContents
();
range
.
deleteContents
();
...
@@ -134,7 +137,7 @@ class CompletionStem extends Component {
...
@@ -134,7 +137,7 @@ class CompletionStem extends Component {
}
=
this
.
props
;
}
=
this
.
props
;
return
(
return
(
<
div
<
div
className=
"
completion
-question-edtior_box"
className=
"
gap
-question-edtior_box"
style=
{
{
zIndex
}
}
style=
{
{
zIndex
}
}
onMouseEnter=
{
()
=>
{
onMouseEnter=
{
()
=>
{
if
(
visibleMediaBox
||
focusFlag
)
return
;
if
(
visibleMediaBox
||
focusFlag
)
return
;
...
@@ -177,7 +180,7 @@ class CompletionStem extends Component {
...
@@ -177,7 +180,7 @@ class CompletionStem extends Component {
/
{
limitLength
}
/
{
limitLength
}
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"editor-fill-info"
>
<
div
className=
"editor-fill-info"
style=
{
{
top
:
this
.
props
.
validateStatus
===
"error"
?
"56px"
:
"36px"
}
}
>
在需要填写答案的地方
在需要填写答案的地方
<
Button
<
Button
type=
"link"
type=
"link"
...
@@ -227,4 +230,4 @@ class CompletionStem extends Component {
...
@@ -227,4 +230,4 @@ class CompletionStem extends Component {
);
);
}
}
}
}
export
default
Completion
Stem
;
export
default
GapFilling
Stem
;
src/modules/teach-tool/components/
Completion
Stem.less
→
src/modules/teach-tool/components/
GapFilling
Stem.less
View file @
462c5b38
.
completion
-question-edtior_box {
.
gap
-question-edtior_box {
position: relative;
position: relative;
.editor-box-single {
.editor-box-single {
border-radius: 4px;
border-radius: 4px;
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
}
}
.editor-fill-info {
.editor-fill-info {
// position: absolute;
height: 20px;
height: 20px;
font-size: 14px;
font-size: 14px;
line-height: 20px;
line-height: 20px;
...
...
src/modules/teach-tool/components/NewQuestionTab.jsx
View file @
462c5b38
This diff is collapsed.
Click to expand it.
src/modules/teach-tool/components/NewQuestionTab.less
View file @
462c5b38
...
@@ -12,7 +12,8 @@
...
@@ -12,7 +12,8 @@
// display: flex;
// display: flex;
// justify-content: space-between;
// justify-content: space-between;
.fill-line {
.fill-line {
text-decoration: underline;
padding: 0 10px;
border-bottom: 1px solid;
}
}
}
}
.editor-fill-box_single:focus {
.editor-fill-box_single:focus {
...
@@ -369,16 +370,16 @@
...
@@ -369,16 +370,16 @@
}
}
}
}
.
completion
-answer-box {
.
gap
-answer-box {
display: inline-flex;
display: inline-flex;
width: 100%;
width: 100%;
padding: 6px 0;
padding: 6px 0;
.
completion
-answer-label {
.
gap
-answer-label {
margin-right: 16px;
margin-right: 16px;
padding-top: 6px;
padding-top: 6px;
width: 50px;
width: 50px;
}
}
.
completion
-answer-content {
.
gap
-answer-content {
display: flex;
display: flex;
background: #ffffff;
background: #ffffff;
border-radius: 4px;
border-radius: 4px;
...
...
src/modules/teach-tool/components/QuestionManageContent.jsx
View file @
462c5b38
...
@@ -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-1
5 21:08:28
* @LastEditTime: 2021-03-1
6 15:34:57
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -27,6 +27,8 @@ import User from "@/common/js/user";
...
@@ -27,6 +27,8 @@ import User from "@/common/js/user";
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBankService"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBankService"
;
import
_
from
"underscore"
;
import
_
from
"underscore"
;
import
QuestionPreviewModal
from
"../modal/QuestionPreviewModal"
;
import
QuestionPreviewModal
from
"../modal/QuestionPreviewModal"
;
import
BatchImportQuestionModal
from
"../modal/BatchImportQuestionModal"
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
const
questionTypeEnum
=
{
const
questionTypeEnum
=
{
...
@@ -273,7 +275,9 @@ class QuestionManageContent extends Component {
...
@@ -273,7 +275,9 @@ class QuestionManageContent extends Component {
<
span
className=
"record-operate__item split"
>
|
</
span
>
<
span
className=
"record-operate__item split"
>
|
</
span
>
<
div
<
div
className=
"record-operate__item"
className=
"record-operate__item"
onClick=
{
()
=>
this
.
toEditQuetion
(
record
.
id
,
record
.
questionTypeEnum
)
}
onClick=
{
()
=>
this
.
toEditQuetion
(
record
.
id
,
record
.
questionTypeEnum
)
}
>
>
编辑
编辑
</
div
>
</
div
>
...
@@ -346,6 +350,29 @@ class QuestionManageContent extends Component {
...
@@ -346,6 +350,29 @@ class QuestionManageContent extends Component {
);
);
};
};
batchImportQuestion
=
()
=>
{
const
ImportQuestionModal
=
<
BatchImportQuestionModal
close=
{
()
=>
{
this
.
setState
({
ImportQuestionModal
:
null
});
}
}
onEdit=
{
(
record
)
=>
{
this
.
handleEditRecord
(
record
);
}
}
showTip=
{
()
=>
{
Modal
.
confirm
({
title
:
`提醒`
,
content
:
'系统拼命处理中,为避免你等待时间过长,请前往“任务中心”查看导入结果'
,
onOk
:
()
=>
{
RCHistory
.
push
(
`/download_center/import_record`
);
},
okText
:
'前往任务中心'
,
cancelText
:
'关闭'
,
});
}
}
/>;
this
.
setState
({
ImportQuestionModal
});
}
render
()
{
render
()
{
const
{
dataSource
=
[],
total
,
query
}
=
this
.
state
;
const
{
dataSource
=
[],
total
,
query
}
=
this
.
state
;
const
{
current
,
size
,
categoryId
,
questionName
,
questionType
}
=
query
;
const
{
current
,
size
,
categoryId
,
questionName
,
questionType
}
=
query
;
...
@@ -417,13 +444,7 @@ class QuestionManageContent extends Component {
...
@@ -417,13 +444,7 @@ class QuestionManageContent extends Component {
<
Button
type=
"primary"
onClick=
{
this
.
handleCreateQuestionBank
}
>
<
Button
type=
"primary"
onClick=
{
this
.
handleCreateQuestionBank
}
>
新建题目
新建题目
</
Button
>
</
Button
>
<
Button
<
Button
onClick=
{
this
.
batchImportQuestion
}
>
批量导入
</
Button
>
onClick=
{
()
=>
{
console
.
log
(
"批量导入"
);
}
}
>
批量导入
</
Button
>
</
Space
>
</
Space
>
)
}
)
}
<
div
className=
"question-manage-list"
>
<
div
className=
"question-manage-list"
>
...
@@ -455,6 +476,7 @@ class QuestionManageContent extends Component {
...
@@ -455,6 +476,7 @@ class QuestionManageContent extends Component {
</
div
>
</
div
>
)
}
)
}
{
this
.
state
.
QuestionPreviewModal
}
{
this
.
state
.
QuestionPreviewModal
}
{
this
.
state
.
ImportQuestionModal
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/modules/teach-tool/components/QuestionManageContent.less
View file @
462c5b38
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-25 11:26:28
* @Date: 2021-02-25 11:26:28
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-1
5 09:42:30
* @LastEditTime: 2021-03-1
6 11:14:55
* @Description: 助学工具-题库-题目管理右侧内容样式
* @Description: 助学工具-题库-题目管理右侧内容样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -77,3 +77,8 @@
...
@@ -77,3 +77,8 @@
}
}
}
}
}
}
.fill-line {
padding: 0 10px;
border-bottom: 1px solid;
}
src/modules/teach-tool/modal/BatchImportQuestionModal.jsx
0 → 100644
View file @
462c5b38
/*
* @Author: zhangyi
* @Date: 2019-12-09 10:29:55
* @Last Modified by: mikey.wanghaofeng
* @Last Modified time: 2020-09-25 11:03:47
*/
import
React
,
{
Component
}
from
"react"
;
import
{
Modal
,
Button
,
Upload
,
message
}
from
"antd"
;
import
"./BatchImportQuestionModal.less"
;
import
SelectPrepareFileModal
from
"@/modules/prepare-lesson/modal/SelectPrepareFileModal"
;
class
BatchImportQuestionModal
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
showSelectFileModal
:
false
,
// 云盘列表弹窗显隐
diskList
:
[],
// 资料云盘文件列表
fileList
:
[],
// 上传的文件列表
uploadBtnType
:
"add"
,
// 上传按钮类型(上传文件 | 重新上传)
uploadBlob
:
null
,
// 上传的文件
uploadProps
:
{
accept
:
"application/vnd.ms-excel"
,
beforeUpload
(
file
)
{
this
.
setState
({
uploadBtnType
:
"reAdd"
});
this
.
setState
({
uploadBlob
:
file
});
return
false
;
},
onChange
(
info
)
{
let
fileList
=
[...
info
.
fileList
];
fileList
=
fileList
.
slice
(
-
1
);
this
.
setState
({
fileList
});
},
onRemove
()
{
this
.
setState
({
uploadBtnType
:
"add"
});
},
},
};
}
// 下载题目模板
handleDownTemplate
=
()
=>
{
console
.
log
(
"下载"
);
const
a
=
document
.
createElement
(
"a"
);
a
.
href
=
"https://image.xiaomaiketang.com/xm/question_template.xlsx"
;
a
.
click
();
};
render
()
{
const
{
diskList
,
showSelectFileModal
,
uploadBtnType
,
uploadProps
,
}
=
this
.
state
;
return
(
<
div
>
<
Modal
className=
"import-score-modal"
title=
"导入题目信息"
visible=
{
true
}
width=
{
560
}
maskClosable=
{
false
}
footer=
{
[
<
Button
onClick=
{
this
.
props
.
close
}
>
取消
</
Button
>,
<
Button
type=
"primary"
onClick=
{
this
.
handleImport
}
>
导入
</
Button
>,
]
}
onCancel=
{
()
=>
{
this
.
props
.
close
();
}
}
>
<
div
className=
"step-section"
>
<
h4
className=
"step-title"
>
1.下载导入模板,按要求填写信息
</
h4
>
<
div
className=
"down-btn"
style=
{
{
fontSize
:
"14px"
}
}
onClick=
{
this
.
handleDownTemplate
}
>
下载题目导入模板
</
div
>
</
div
>
<
div
className=
"step-section"
>
<
h4
className=
"step-title"
>
2.选择需要导入的Excel文件
</
h4
>
<
Button
type=
"primary"
className=
"add-btn"
onClick=
{
()
=>
this
.
setState
({
showSelectFileModal
:
true
})
}
>
{
uploadBtnType
==
"reAdd"
?
"重新添加"
:
"添加文件"
}
</
Button
>
</
div
>
</
Modal
>
<
SelectPrepareFileModal
operateType=
"select"
accept=
"image/jpeg,image/png,image/jpg"
selectTypeList=
{
[
"JPG"
,
"JPEG"
,
"PNG"
]
}
tooltip=
"支持文件类型:jpg、jpeg、png"
isOpen=
{
showSelectFileModal
}
diskList=
{
diskList
}
onClose=
{
()
=>
{
this
.
setState
({
showSelectFileModal
:
false
});
}
}
onSelect=
{
this
.
handleSelectImg
}
/>
</
div
>
);
}
}
export
default
BatchImportQuestionModal
;
src/modules/teach-tool/modal/BatchImportQuestionModal.less
0 → 100644
View file @
462c5b38
@import '../../../core/mixins.less';
.import-score-modal {
.step-section {
margin-bottom: 24px;
.step-title {
font-size: 16px;
font-weight: 400;
margin-bottom: 16px;
color: #333;
}
.tip-box {
border: 1px dashed #e8e8e8;
padding: 8px;
margin-bottom: 16px;
.tip-title {
margin-bottom: 4px;
}
.tip-content {
font-size: 12px;
}
}
.add-btn {
border-radius: 2px;
font-size: 14px;
box-shadow: none;
text-shadow: none;
span {
font-weight: 400;
}
}
.remark-input {
width: 304px;
margin-bottom: 8px;
}
.remark-tip {
color: #999;
font-size: 12px;
}
.down-btn {
text-align: left;
color: #FC9C6B;
font-size: 12px;
display: block;
margin-top: 8px;
cursor: pointer;
}
.upload-box {
width: 200px;
.ant-upload-list-item-name {
.text-overflow-ellipsis();
width:70%;
}
}
}
.import-status-box {
height:430px;
overflow: hidden;
.status-content {
margin:auto;
text-align: center;
margin-top:100px;
>img {
width: 76px;
}
.status {
font-size: 16px;
font-weight: 500;
margin: 18px 0 16px;
}
.status-tip {
line-height: 20px;
.num {
color: #FC9C6B;
}
}
.down-btn {
margin-top: 16px;
}
}
}
}
\ No newline at end of file
src/modules/teach-tool/modal/QuestionPreviewModal.jsx
View file @
462c5b38
...
@@ -60,6 +60,7 @@ class QuestionPreviewModal extends Component {
...
@@ -60,6 +60,7 @@ class QuestionPreviewModal extends Component {
const
{
const
{
questionTypeEnum
,
questionTypeEnum
,
questionStemList
,
questionStemList
,
gapFillingAnswerList
,
optionList
,
optionList
,
questionAnswerDescList
,
questionAnswerDescList
,
}
=
questionInfo
;
}
=
questionInfo
;
...
@@ -152,6 +153,12 @@ class QuestionPreviewModal extends Component {
...
@@ -152,6 +153,12 @@ class QuestionPreviewModal extends Component {
</
div
>
</
div
>
</
div
>
</
div
>
<
hr
style=
{
{
margin
:
"16px 0"
,
color
:
"#E8E8E8"
,
height
:
"1px"
}
}
/>
<
hr
style=
{
{
margin
:
"16px 0"
,
color
:
"#E8E8E8"
,
height
:
"1px"
}
}
/>
{
[
"INDEFINITE_CHOICE"
,
"MULTI_CHOICE"
,
"SINGLE_CHOICE"
,
"JUDGE"
,
].
includes
(
questionTypeEnum
)
&&
(
<
div
className=
"question-option"
>
<
div
className=
"question-option"
>
<
div
className=
"question-option__title"
>
选项:
</
div
>
<
div
className=
"question-option__title"
>
选项:
</
div
>
<
div
className=
"question-option__content"
>
<
div
className=
"question-option__content"
>
...
@@ -169,14 +176,29 @@ class QuestionPreviewModal extends Component {
...
@@ -169,14 +176,29 @@ class QuestionPreviewModal extends Component {
<
div
className=
"option-sort"
>
<
div
className=
"option-sort"
>
{
NUM_TO_WORD_MAP
[
optionIndex
]
}
.
{
NUM_TO_WORD_MAP
[
optionIndex
]
}
.
</
div
>
</
div
>
{
[
"INDEFINITE_CHOICE"
,
"MULTI_CHOICE"
,
"SINGLE_CHOICE"
,
].
includes
(
questionTypeEnum
)
&&
(
<
div
<
div
className=
"input-box"
className=
"input-box"
dangerouslySetInnerHTML=
{
{
dangerouslySetInnerHTML=
{
{
__html
:
inputcontent
[
0
].
content
,
__html
:
inputcontent
[
0
].
content
,
}
}
}
}
/>
/>
)
}
{
[
"JUDGE"
].
includes
(
questionTypeEnum
)
&&
_
.
map
(
questionOptionContentList
,
(
item
,
index
)
=>
{
return
<
span
key=
{
index
}
>
{
item
.
content
}
</
span
>;
})
}
</
div
>
</
div
>
{
_
.
map
(
questionOptionContentList
,
(
item
,
index
)
=>
{
{
[
"INDEFINITE_CHOICE"
,
"MULTI_CHOICE"
,
"SINGLE_CHOICE"
,
].
includes
(
questionTypeEnum
)
&&
_
.
map
(
questionOptionContentList
,
(
item
,
index
)
=>
{
let
dom
=
""
;
let
dom
=
""
;
let
{
type
,
content
,
size
}
=
item
;
let
{
type
,
content
,
size
}
=
item
;
switch
(
type
)
{
switch
(
type
)
{
...
@@ -216,8 +238,15 @@ class QuestionPreviewModal extends Component {
...
@@ -216,8 +238,15 @@ class QuestionPreviewModal extends Component {
})
}
})
}
</
div
>
</
div
>
</
div
>
</
div
>
)
}
<
div
className=
"question-answer"
>
<
div
className=
"question-answer"
>
<
div
className=
"question-answer__title"
>
答案:
</
div
>
<
div
className=
"question-answer__title"
>
答案:
</
div
>
{
[
"INDEFINITE_CHOICE"
,
"MULTI_CHOICE"
,
"SINGLE_CHOICE"
,
"JUDGE"
,
].
includes
(
questionTypeEnum
)
&&
(
<
div
className=
"question-answer__content"
>
<
div
className=
"question-answer__content"
>
{
_
.
map
(
rightAnswerSort
,
(
item
,
index
)
=>
{
{
_
.
map
(
rightAnswerSort
,
(
item
,
index
)
=>
{
return
(
return
(
...
@@ -227,6 +256,23 @@ class QuestionPreviewModal extends Component {
...
@@ -227,6 +256,23 @@ class QuestionPreviewModal extends Component {
);
);
})
}
})
}
</
div
>
</
div
>
)
}
{
questionTypeEnum
===
"GAP_FILLING"
&&
(
<
div
className=
"question-gap-answer"
>
{
_
.
map
(
gapFillingAnswerList
,
(
item
,
index
)
=>
{
return
(
<
div
>
<
div
className=
"gap-label"
>
填空
{
index
+
1
}
.
</
div
>
<
div
className=
"gap-content"
key=
{
index
}
>
{
_
.
map
(
item
.
correctAnswerList
,
(
childItem
,
childIndex
)
=>
{
return
<
span
>
{
childItem
}
</
span
>
})
}
</
div
>
</
div
>
);
})
}
</
div
>
)
}
</
div
>
</
div
>
<
hr
style=
{
{
margin
:
"16px 0"
,
color
:
"#E8E8E8"
,
height
:
"1px"
}
}
/>
<
hr
style=
{
{
margin
:
"16px 0"
,
color
:
"#E8E8E8"
,
height
:
"1px"
}
}
/>
<
div
className=
"question-desc"
>
<
div
className=
"question-desc"
>
...
...
src/modules/teach-tool/modal/QuestionPreviewModal.less
View file @
462c5b38
...
@@ -117,6 +117,25 @@
...
@@ -117,6 +117,25 @@
margin-right: 8px;
margin-right: 8px;
}
}
}
}
.question-gap-answer {
margin-bottom: 8px;
.gap-label {
display: inline-block;
width: 48px;
height: 20px;
color: #666666;
line-height: 20px;
}
.gap-content {
display: inline-block;
span {
background: #F7F8F9;
border-radius: 2px;
padding: 2px 12px;
margin-right: 8px;
}
}
}
}
}
.question-desc {
.question-desc {
margin-bottom: 16px;
margin-bottom: 16px;
...
@@ -195,3 +214,7 @@
...
@@ -195,3 +214,7 @@
.question-preview-modal.ant-modal {
.question-preview-modal.ant-modal {
max-height: 60% !important;
max-height: 60% !important;
}
}
.fill-line {
padding: 0 10px;
border-bottom: 1px solid;
}
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