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
ba3410c0
Commit
ba3410c0
authored
Mar 22, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:bug修复
parent
5cafb6c1
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
202 additions
and
136 deletions
+202
-136
src/modules/teach-tool/AddNewQuestion.jsx
+24
-11
src/modules/teach-tool/QuestionBankIndex.jsx
+3
-6
src/modules/teach-tool/QuestionCategoryManage.jsx
+28
-6
src/modules/teach-tool/components/NewQuestionTab.jsx
+70
-71
src/modules/teach-tool/components/NewQuestionTab.less
+23
-13
src/modules/teach-tool/components/QuestionBankSider.jsx
+12
-9
src/modules/teach-tool/components/QuestionEditor.jsx
+22
-8
src/modules/teach-tool/components/QuestionManageContent.jsx
+6
-8
src/modules/teach-tool/components/XMRecord.jsx
+4
-2
src/modules/teach-tool/components/audioRecord.js
+3
-0
src/modules/teach-tool/modal/BatchImportQuestionModal.jsx
+1
-1
src/modules/teach-tool/modal/NewEditQuestionBankCategory.jsx
+6
-1
No files found.
src/modules/teach-tool/AddNewQuestion.jsx
View file @
ba3410c0
...
@@ -15,7 +15,6 @@ import NewQuestionTab from "./components/NewQuestionTab";
...
@@ -15,7 +15,6 @@ import NewQuestionTab from "./components/NewQuestionTab";
import
{
defineJudgeOptionInfo
,
defineOptionInfo
,
defineQuestionInfo
}
from
"./components/model"
;
import
{
defineJudgeOptionInfo
,
defineOptionInfo
,
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
{
...
@@ -49,6 +48,13 @@ class AddNewQuestion extends Component {
...
@@ -49,6 +48,13 @@ class AddNewQuestion extends Component {
}
}
}
}
transferStemDocument
=
(
txt
)
=>
{
const
template
=
`<p class='content'>
${
txt
}
</p>`
;
let
doc
=
new
DOMParser
().
parseFromString
(
template
,
"text/html"
);
let
p
=
doc
.
querySelector
(
".content"
);
return
p
;
};
queryQuestionDetails
=
()
=>
{
queryQuestionDetails
=
()
=>
{
let
query
=
{
let
query
=
{
id
:
getParameterByName
(
"id"
),
id
:
getParameterByName
(
"id"
),
...
@@ -58,6 +64,10 @@ class AddNewQuestion extends Component {
...
@@ -58,6 +64,10 @@ class AddNewQuestion extends Component {
};
};
QuestionBankService
.
queryQuestionDetails
(
query
).
then
((
res
)
=>
{
QuestionBankService
.
queryQuestionDetails
(
query
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
const
{
result
=
[]
}
=
res
;
let
stemContent
=
_
.
find
(
result
.
questionStemList
,
(
contentItem
)
=>
contentItem
.
type
===
"RICH_TEXT"
);
const
{
questionTypeEnum
}
=
result
;
const
{
questionTypeEnum
}
=
result
;
switch
(
questionTypeEnum
)
{
switch
(
questionTypeEnum
)
{
case
"SINGLE_CHOICE"
:
case
"SINGLE_CHOICE"
:
...
@@ -70,6 +80,12 @@ class AddNewQuestion extends Component {
...
@@ -70,6 +80,12 @@ class AddNewQuestion extends Component {
this
.
setState
({
judgeContent
:
result
});
this
.
setState
({
judgeContent
:
result
});
break
;
break
;
case
"GAP_FILLING"
:
case
"GAP_FILLING"
:
stemContent
.
content
=
stemContent
.
content
.
split
(
''
).
map
((
item
)
=>
{
if
(
item
===
'_'
)
{
return
`<input class="add-fill-line" disabled correctAnswerList="" id=
${
window
.
random_string
(
16
)}
value="填空"/>`
}
return
item
;
}).
join
(
''
);
this
.
setState
({
gapFillingContent
:
result
});
this
.
setState
({
gapFillingContent
:
result
});
break
;
break
;
case
"INDEFINITE_CHOICE"
:
case
"INDEFINITE_CHOICE"
:
...
@@ -99,7 +115,7 @@ class AddNewQuestion extends Component {
...
@@ -99,7 +115,7 @@ class AddNewQuestion extends Component {
case
"JUDGE"
:
case
"JUDGE"
:
let
judgeContent
=
defineQuestionInfo
(
"JUDGE"
);
let
judgeContent
=
defineQuestionInfo
(
"JUDGE"
);
var
judgeOptions
=
[
"正确"
,
"错误"
];
var
judgeOptions
=
[
"正确"
,
"错误"
];
judgeOptions
.
forEach
(
item
=>
{
judgeOptions
.
forEach
(
item
=>
{
judgeContent
.
optionList
.
push
(
defineJudgeOptionInfo
(
item
));
judgeContent
.
optionList
.
push
(
defineJudgeOptionInfo
(
item
));
})
})
this
.
setState
({
judgeContent
});
this
.
setState
({
judgeContent
});
...
@@ -155,9 +171,6 @@ class AddNewQuestion extends Component {
...
@@ -155,9 +171,6 @@ class AddNewQuestion extends Component {
message
.
success
(
"保存成功"
);
message
.
success
(
"保存成功"
);
if
(
next
===
"add"
)
{
if
(
next
===
"add"
)
{
this
.
handleRest
(
type
);
this
.
handleRest
(
type
);
// window.RCHistory.push({
// pathname: `/create-new-question?categoryId=${params.categoryId}&key=${type}`,
// });
}
}
if
(
next
===
"close"
)
{
if
(
next
===
"close"
)
{
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
...
@@ -231,9 +244,9 @@ class AddNewQuestion extends Component {
...
@@ -231,9 +244,9 @@ class AddNewQuestion extends Component {
}
}
break
;
break
;
case
"GAP_FILLING"
:
case
"GAP_FILLING"
:
//
if (this.gapRef.checkInput() === 0) {
if
(
this
.
gapRef
.
checkInput
()
===
0
)
{
this
.
saveCurrentQuestion
(
gapFillingContent
,
"GAP_FILLING"
,
next
);
this
.
saveCurrentQuestion
(
gapFillingContent
,
"GAP_FILLING"
,
next
);
//
}
}
break
;
break
;
case
"INDEFINITE_CHOICE"
:
case
"INDEFINITE_CHOICE"
:
if
(
this
.
indefiniteRef
.
checkInput
()
===
0
)
{
if
(
this
.
indefiniteRef
.
checkInput
()
===
0
)
{
...
@@ -261,10 +274,11 @@ class AddNewQuestion extends Component {
...
@@ -261,10 +274,11 @@ class AddNewQuestion extends Component {
gapFillingContent
,
gapFillingContent
,
indefiniteChoiceContent
,
indefiniteChoiceContent
,
}
=
this
.
state
;
}
=
this
.
state
;
const
categoryId
=
getParameterByName
(
"categoryId"
);
return
(
return
(
<
div
className=
"page add-new-question"
>
<
div
className=
"page add-new-question"
>
<
Breadcrumbs
<
Breadcrumbs
navList=
{
getParameterByName
(
"id"
)
&&
this
.
state
.
currentOperate
===
"edit"
?
"编辑题目"
:
"新增题目"
}
navList=
{
getParameterByName
(
"id"
)
&&
this
.
state
.
currentOperate
===
"edit"
?
"编辑题目"
:
"新增题目"
}
goBack=
{
()
=>
this
.
handleGoBack
()
}
goBack=
{
()
=>
this
.
handleGoBack
()
}
/>
/>
<
div
className=
"box"
>
<
div
className=
"box"
>
...
@@ -336,7 +350,6 @@ class AddNewQuestion extends Component {
...
@@ -336,7 +350,6 @@ class AddNewQuestion extends Component {
}
}
}
}
questionInfo=
{
gapFillingContent
}
questionInfo=
{
gapFillingContent
}
onSetState=
{
(
newContent
)
=>
{
onSetState=
{
(
newContent
)
=>
{
console
.
log
(
"gapFillingContent:"
,
newContent
)
Object
.
assign
(
gapFillingContent
,
newContent
);
Object
.
assign
(
gapFillingContent
,
newContent
);
}
}
}
}
/>
/>
...
@@ -374,13 +387,13 @@ class AddNewQuestion extends Component {
...
@@ -374,13 +387,13 @@ class AddNewQuestion extends Component {
>
>
取消
取消
</
Button
>
</
Button
>
<
Button
{
(
categoryId
&&
categoryId
!==
"null"
)
&&
<
Button
onClick=
{
()
=>
{
onClick=
{
()
=>
{
this
.
confirmSaveQuestion
(
"add"
);
this
.
confirmSaveQuestion
(
"add"
);
}
}
}
}
>
>
保存并继续添加
保存并继续添加
</
Button
>
</
Button
>
}
<
Button
<
Button
type=
"primary"
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
...
src/modules/teach-tool/QuestionBankIndex.jsx
View file @
ba3410c0
...
@@ -19,9 +19,6 @@ class QuestionBankIndex extends Component {
...
@@ -19,9 +19,6 @@ class QuestionBankIndex extends Component {
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
selectedCategoryId
:
""
,
selectedCategoryId
:
""
,
loading
:
true
,
dataSource
:
[],
// 题库列表数据
totalCount
:
1
,
// 题库数据总条数
};
};
}
}
...
@@ -33,8 +30,8 @@ class QuestionBankIndex extends Component {
...
@@ -33,8 +30,8 @@ class QuestionBankIndex extends Component {
}
}
};
};
updatedSiderTreeFromList
=
(
updatedCategoryId
)
=>
{
updatedSiderTreeFromList
=
(
currentTotal
)
=>
{
this
.
setState
({
updatedCategoryId
});
this
.
setState
({
currentTotal
});
};
};
render
()
{
render
()
{
...
@@ -45,7 +42,7 @@ class QuestionBankIndex extends Component {
...
@@ -45,7 +42,7 @@ class QuestionBankIndex extends Component {
<
div
className=
"sider"
>
<
div
className=
"sider"
>
<
QuestionBankSider
<
QuestionBankSider
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
updatedCategoryId=
{
this
.
state
.
updatedCategoryId
}
currentTotal=
{
this
.
state
.
currentTotal
}
/>
/>
</
div
>
</
div
>
<
div
className=
"content"
>
<
div
className=
"content"
>
...
...
src/modules/teach-tool/QuestionCategoryManage.jsx
View file @
ba3410c0
...
@@ -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-
19 14:15:00
* @LastEditTime: 2021-03-
22 09:42:28
* @Description: 助学工具-题库-主页面分类管理
* @Description: 助学工具-题库-主页面分类管理
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -44,6 +44,7 @@ class QuestionCategoryManage extends Component {
...
@@ -44,6 +44,7 @@ class QuestionCategoryManage extends Component {
// 查询分类树
// 查询分类树
queryCategoryTree
=
(
categoryName
)
=>
{
queryCategoryTree
=
(
categoryName
)
=>
{
this
.
setState
({
categoryName
})
let
query
=
{
let
query
=
{
source
:
0
,
source
:
0
,
categoryName
,
categoryName
,
...
@@ -202,6 +203,9 @@ class QuestionCategoryManage extends Component {
...
@@ -202,6 +203,9 @@ class QuestionCategoryManage extends Component {
};
};
onDrop
=
(
info
)
=>
{
onDrop
=
(
info
)
=>
{
if
(
this
.
state
.
categoryName
)
{
return
}
// 未分类不可以拖拽
// 未分类不可以拖拽
if
(
if
(
info
.
dragNode
.
categoryName
===
"未分类"
||
info
.
dragNode
.
categoryName
===
"未分类"
||
...
@@ -215,10 +219,15 @@ class QuestionCategoryManage extends Component {
...
@@ -215,10 +219,15 @@ 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
)
{
return
message
.
info
(
"最多支持5级分类"
)
}
let
relatedNodes
=
this
.
getRelatedNodes
(
targetParentId
);
let
relatedNodes
=
this
.
getRelatedNodes
(
targetParentId
);
if
(
relatedNodes
&&
relatedNodes
.
length
===
30
)
{
return
message
.
info
(
"最多只能添加30个子分类"
)
}
const
dropKey
=
info
.
node
.
key
;
const
dropKey
=
info
.
node
.
key
;
const
dragKey
=
info
.
dragNode
.
key
;
const
dragKey
=
info
.
dragNode
.
key
;
const
dropPos
=
info
.
node
.
pos
.
split
(
"-"
);
const
dropPos
=
info
.
node
.
pos
.
split
(
"-"
);
...
@@ -458,7 +467,19 @@ class QuestionCategoryManage extends Component {
...
@@ -458,7 +467,19 @@ class QuestionCategoryManage extends Component {
});
});
let
map
=
{};
let
map
=
{};
this
.
setState
({
treeMap
:
this
.
getTreeMap
(
data
,
map
)
});
let
topItem
=
[]
data
.
forEach
((
item
)
=>
{
topItem
.
push
(
item
);
});
this
.
setState
({
treeMap
:
Object
.
assign
(
this
.
getTreeMap
(
data
,
map
),
{
"0"
:
{
sonCategoryList
:
topItem
},
})
});
return
newTreeData
;
return
newTreeData
;
};
};
...
@@ -469,6 +490,7 @@ class QuestionCategoryManage extends Component {
...
@@ -469,6 +490,7 @@ class QuestionCategoryManage extends Component {
this
.
getTreeMap
(
item
.
sonCategoryList
,
map
);
this
.
getTreeMap
(
item
.
sonCategoryList
,
map
);
}
}
});
});
return
map
;
return
map
;
};
};
...
@@ -484,17 +506,17 @@ class QuestionCategoryManage extends Component {
...
@@ -484,17 +506,17 @@ class QuestionCategoryManage extends Component {
selectedKeys
,
selectedKeys
,
autoExpandParent
,
autoExpandParent
,
}
=
this
.
state
;
}
=
this
.
state
;
console
.
log
(
"autoExpandParent:"
,
autoExpandParent
);
return
(
return
(
<
div
className=
"page question-category-manage"
>
<
div
className=
"page question-category-manage"
>
<
Breadcrumbs
{
getParameterByName
(
'from'
)
===
"aid"
?
<
Breadcrumbs
navList=
"课程分类"
navList=
"课程分类"
goBack=
{
()
=>
goBack=
{
()
=>
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
"/question-bank-index"
,
pathname
:
"/question-bank-index"
,
})
})
}
}
/>
/>
:
<
div
className=
"content-header"
>
课程分类
</
div
>
}
<
div
className=
"box"
>
<
div
className=
"box"
>
<
div
className=
"search-condition"
>
<
div
className=
"search-condition"
>
<
span
className=
"search-label"
>
搜索名称:
</
span
>
<
span
className=
"search-label"
>
搜索名称:
</
span
>
...
...
src/modules/teach-tool/components/NewQuestionTab.jsx
View file @
ba3410c0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-25 14:34:29
* @Date: 2021-02-25 14:34:29
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-
19 20:33
:05
* @LastEditTime: 2021-03-
22 09:45
:05
* @Description: 助学工具-题库-题目管理-新建题目Tab
* @Description: 助学工具-题库-题目管理-新建题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -99,7 +99,6 @@ class NewQuestionTab extends Component {
...
@@ -99,7 +99,6 @@ class NewQuestionTab extends Component {
const
{
questionInfo
}
=
nextProps
;
const
{
questionInfo
}
=
nextProps
;
if
(
this
.
props
.
questionInfo
!==
questionInfo
)
{
if
(
this
.
props
.
questionInfo
!==
questionInfo
)
{
if
(
questionInfo
.
gapFillingAnswerList
!==
this
.
state
.
gapFillingAnswer
)
{
if
(
questionInfo
.
gapFillingAnswerList
!==
this
.
state
.
gapFillingAnswer
)
{
console
.
log
(
999
,
questionInfo
.
gapFillingAnswerList
)
this
.
setState
({
this
.
setState
({
gapFillingAnswer
:
questionInfo
.
gapFillingAnswerList
gapFillingAnswer
:
questionInfo
.
gapFillingAnswerList
})
})
...
@@ -111,15 +110,12 @@ class NewQuestionTab extends Component {
...
@@ -111,15 +110,12 @@ class NewQuestionTab extends Component {
),
),
},
},
()
=>
{
()
=>
{
// if(this.props.questionTypeKey==="GAP_FillING") {
const
con
=
questionInfo
.
questionStemList
[
0
].
content
;
const
con
=
questionInfo
.
questionStemList
[
0
].
content
;
const
input
=
con
.
match
(
/<input
([^
<>
]
*
)
>/g
)
const
input
=
con
.
match
(
/<input
([^
<>
]
*
)
>/g
)
const
_blanksList
=
input
.
map
(
item
=>
{
let
_blanksList
=
input
&&
input
.
map
(
item
=>
{
return
this
.
transferStemDocument
(
item
).
firstChild
return
this
.
transferStemDocument
(
item
).
firstChild
})
})
console
.
log
(
"-----"
,
_blanksList
)
this
.
setState
({
blanksList
:
_blanksList
||
[]
})
this
.
setState
({
blanksList
:
_blanksList
})
// }
}
}
);
// 题干内容
);
// 题干内容
this
.
setState
({
this
.
setState
({
...
@@ -165,10 +161,11 @@ class NewQuestionTab extends Component {
...
@@ -165,10 +161,11 @@ class NewQuestionTab extends Component {
this
.
state
.
stemContent
,
this
.
state
.
stemContent
,
(
contentItem
)
=>
contentItem
.
type
===
"RICH_TEXT"
(
contentItem
)
=>
contentItem
.
type
===
"RICH_TEXT"
);
);
const
stem
=
stemContent
.
content
.
replace
(
/<
[^
>
]
+>/g
,
""
);
let
stem
=
stemContent
.
content
.
replace
(
/<
[^
>
]
+>/g
,
""
);
stem
=
stem
.
replace
(
/
\&
nbsp
\;
/gi
,
""
);
stem
=
stem
.
replace
(
/
\s
+/g
,
""
);
if
(
this
.
props
.
questionTypeKey
===
"GAP_FILLING"
)
{
if
(
this
.
props
.
questionTypeKey
===
"GAP_FILLING"
)
{
if
(
this
.
state
.
blanksList
.
length
===
0
)
{
if
(
this
.
state
.
blanksList
.
length
===
0
||
stem
.
length
===
0
)
{
this
.
setState
({
stemValidate
:
"error"
});
this
.
setState
({
stemValidate
:
"error"
});
this
.
setState
({
this
.
setState
({
stemText
:
(
stemText
:
(
...
@@ -204,7 +201,7 @@ class NewQuestionTab extends Component {
...
@@ -204,7 +201,7 @@ class NewQuestionTab extends Component {
let
optionUnChecked
=
0
;
let
optionUnChecked
=
0
;
const
{
chooseOptions
}
=
this
.
state
;
const
{
chooseOptions
}
=
this
.
state
;
if
(
this
.
props
.
questionTypeKey
===
"GAP_FILLING"
)
{
if
(
this
.
props
.
questionTypeKey
===
"GAP_FILLING"
)
{
this
.
state
.
blanksList
.
forEach
((
item
,
index
)
=>
{
this
.
state
.
gapFillingAnswer
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
correctAnswerList
.
length
===
0
)
{
if
(
item
.
correctAnswerList
.
length
===
0
)
{
this
.
setState
({
[
`optionsValidate_
${
index
}
`
]:
"error"
});
this
.
setState
({
[
`optionsValidate_
${
index
}
`
]:
"error"
});
this
.
setState
({
[
`optionsText_
${
index
}
`
]:
"请输入答案"
});
this
.
setState
({
[
`optionsText_
${
index
}
`
]:
"请输入答案"
});
...
@@ -326,8 +323,6 @@ class NewQuestionTab extends Component {
...
@@ -326,8 +323,6 @@ class NewQuestionTab extends Component {
* @memberof QuestionInputItem
* @memberof QuestionInputItem
*/
*/
handleChangeMedia
=
(
key
,
uploadItemTarget
,
contentType
)
=>
{
handleChangeMedia
=
(
key
,
uploadItemTarget
,
contentType
)
=>
{
this
.
setState
({
contentType
});
this
.
setState
({
mediaType
:
key
});
const
pictureMediaArr
=
_
.
filter
(
uploadItemTarget
,
(
mediaItem
)
=>
{
const
pictureMediaArr
=
_
.
filter
(
uploadItemTarget
,
(
mediaItem
)
=>
{
return
mediaItem
.
type
===
"PICTURE"
;
return
mediaItem
.
type
===
"PICTURE"
;
});
});
...
@@ -364,6 +359,9 @@ class NewQuestionTab extends Component {
...
@@ -364,6 +359,9 @@ class NewQuestionTab extends Component {
if
(
key
===
"VOICE"
&&
voiceMediaArr
.
length
>
2
)
{
if
(
key
===
"VOICE"
&&
voiceMediaArr
.
length
>
2
)
{
return
message
.
warning
(
"只能添加3个音频"
);
return
message
.
warning
(
"只能添加3个音频"
);
}
}
if
(
key
===
"AUDIO"
&&
audioMediaArr
.
length
>
2
)
{
return
message
.
warning
(
"只能添加3个录音"
);
}
if
(
key
===
"VIDEO"
&&
videodMediaArr
.
length
>
2
)
{
if
(
key
===
"VIDEO"
&&
videodMediaArr
.
length
>
2
)
{
return
message
.
warning
(
"只能添加3个视频"
);
return
message
.
warning
(
"只能添加3个视频"
);
}
}
...
@@ -419,33 +417,43 @@ class NewQuestionTab extends Component {
...
@@ -419,33 +417,43 @@ class NewQuestionTab extends Component {
}
}
break
;
break
;
}
}
var
that
=
this
function
change
()
{
that
.
setState
({
contentType
});
that
.
setState
({
mediaType
:
key
});
this
.
setState
(
that
.
setState
(
{
{
uploadItemTarget
,
uploadItemTarget
,
},
},
()
=>
{
()
=>
{
MEDIA_FILE_ACCEPT
[
key
]
&&
MEDIA_FILE_ACCEPT
[
key
]
&&
this
.
setState
(
that
.
setState
(
{
{
accept
:
MEDIA_FILE_ACCEPT
[
key
],
accept
:
MEDIA_FILE_ACCEPT
[
key
],
fileType
:
key
,
fileType
:
key
,
},
},
()
=>
{
()
=>
{
this
.
uploadInput
.
current
.
value
=
""
;
that
.
uploadInput
.
current
.
value
=
""
;
this
.
setState
({
showSelectFileModal
:
key
!==
"AUDIO"
});
that
.
setState
({
showSelectFileModal
:
key
!==
"AUDIO"
});
// this.uploadInput.current.click();
}
}
);
);
}
);
}
if
(
key
==
"AUDIO"
)
{
// 录音
// 录音
if
(
key
===
"AUDIO"
)
{
this
.
setState
({
this
.
setState
({
showRecord
:
true
,
showRecord
:
true
,
});
});
this
.
setState
({
onAudioFinish
:
function
()
{
change
();
}
}
})
}
else
{
change
();
}
}
);
};
};
async
uploadFile
(
mediaFile
)
{
async
uploadFile
(
mediaFile
)
{
...
@@ -474,10 +482,10 @@ class NewQuestionTab extends Component {
...
@@ -474,10 +482,10 @@ class NewQuestionTab extends Component {
message
.
warning
(
"文件格式不正确"
);
message
.
warning
(
"文件格式不正确"
);
return
;
return
;
}
}
if
(
mediaFile
.
folderSize
>
1
*
1024
*
1024
)
{
if
(
mediaFile
.
folderSize
>
5
*
1024
*
1024
)
{
Modal
.
warning
({
Modal
.
warning
({
title
:
"图片过大"
,
title
:
"图片过大"
,
content
:
"图片大小超过
1
M,请压缩后上传"
,
content
:
"图片大小超过
5
M,请压缩后上传"
,
});
});
return
;
return
;
}
}
...
@@ -533,21 +541,21 @@ class NewQuestionTab extends Component {
...
@@ -533,21 +541,21 @@ class NewQuestionTab extends Component {
}
}
changeBlankCount
=
(
data
,
idx
)
=>
{
changeBlankCount
=
(
data
,
idx
)
=>
{
console
.
log
(
"data:"
,
data
);
const
{
gapFillingAnswer
}
=
this
.
state
;
const
{
gapFillingAnswer
}
=
this
.
state
;
let
_gap
=
[...
gapFillingAnswer
];
let
_gap
=
[...
gapFillingAnswer
];
console
.
log
(
9
,
_gap
)
if
(
data
.
length
===
0
)
{
_gap
=
[]
}
data
&&
data
.
length
>
0
&&
data
.
forEach
((
item
,
index
)
=>
{
else
{
data
.
forEach
((
item
,
index
)
=>
{
if
(
index
===
idx
)
{
if
(
index
===
idx
)
{
if
(
_gap
.
length
<
data
.
length
)
{
if
(
_gap
.
length
<
data
.
length
)
{
_gap
.
splice
(
idx
,
0
,
{
correctAnswerList
:
[]
})
_gap
.
splice
(
idx
,
0
,
{
correctAnswerList
:
[]
})
}
else
if
(
_gap
.
length
>
data
.
length
)
{
}
else
if
(
_gap
.
length
>
data
.
length
)
{
_gap
.
splice
(
idx
,
1
)
_gap
.
splice
(
idx
,
1
)
}
else
{
}
else
{
_gap
.
splice
(
idx
,
1
,
{
correctAnswerList
:
[]
})
_gap
.
splice
(
idx
,
1
,
{
correctAnswerList
:
[]
})
}
}
}
}
if
(
!
item
.
correctAnswerList
)
{
if
(
!
item
.
correctAnswerList
)
{
...
@@ -558,15 +566,12 @@ class NewQuestionTab extends Component {
...
@@ -558,15 +566,12 @@ class NewQuestionTab extends Component {
item
.
editInput
=
false
;
item
.
editInput
=
false
;
return
item
;
return
item
;
});
});
}
console
.
log
(
'idx'
,
idx
)
console
.
log
(
'****'
,
_gap
)
this
.
setState
({
this
.
setState
({
blanksList
:
data
,
blanksList
:
data
,
gapFillingAnswer
:
_gap
gapFillingAnswer
:
_gap
});
}
,
()
=>
this
.
_onSetState
()
);
};
};
addAnswerTag
=
(
optionItem
)
=>
{
addAnswerTag
=
(
optionItem
)
=>
{
...
@@ -581,17 +586,16 @@ class NewQuestionTab extends Component {
...
@@ -581,17 +586,16 @@ class NewQuestionTab extends Component {
// 填空选项
// 填空选项
handleInputConfirm
=
(
optionItem
,
val
)
=>
{
handleInputConfirm
=
(
optionItem
,
val
)
=>
{
var
tagContent
=
val
.
replace
(
/
\&
nbsp
\;
/gi
,
""
);
tagContent
=
val
.
replace
(
/
\s
+/g
,
""
);
const
_blanksList
=
this
.
state
.
blanksList
;
const
_blanksList
=
this
.
state
.
blanksList
;
const
{
gapFillingAnswer
}
=
this
.
state
;
const
{
gapFillingAnswer
}
=
this
.
state
;
console
.
log
(
0.2
,
val
)
console
.
log
(
0.3
,
optionItem
)
let
_gapFillingAnswer
=
[...
gapFillingAnswer
];
let
_gapFillingAnswer
=
[...
gapFillingAnswer
];
console
.
log
(
0.4
,
_gapFillingAnswer
)
_blanksList
.
forEach
((
item
,
index
)
=>
{
_blanksList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
id
===
optionItem
.
id
)
{
if
(
item
.
id
===
optionItem
.
id
)
{
if
(
val
)
{
if
(
val
&&
tagContent
.
length
>
0
)
{
_gapFillingAnswer
[
index
].
correctAnswerList
.
push
(
val
);
_gapFillingAnswer
[
index
].
correctAnswerList
.
push
(
val
);
optionItem
.
inputVisible
=
false
;
optionItem
.
inputVisible
=
false
;
}
else
{
}
else
{
...
@@ -600,23 +604,37 @@ class NewQuestionTab extends Component {
...
@@ -600,23 +604,37 @@ class NewQuestionTab extends Component {
}
}
})
})
console
.
log
(
8888
,
_gapFillingAnswer
)
this
.
setState
({
gapFillingAnswer
:
_gapFillingAnswer
},
()
=>
this
.
_onSetState
());
this
.
setState
({
gapFillingAnswer
:
_gapFillingAnswer
},
()
=>
this
.
_onSetState
());
this
.
setState
({
blanksList
:
_blanksList
});
this
.
setState
({
blanksList
:
_blanksList
});
};
};
handle
Input
Close
=
(
optionItem
,
removedTag
)
=>
{
handle
Tag
Close
=
(
optionItem
,
removedTag
)
=>
{
const
_blanksList
=
this
.
state
.
blanksList
;
const
_blanksList
=
this
.
state
.
blanksList
;
_blanksList
.
forEach
((
item
)
=>
{
const
{
gapFillingAnswer
}
=
this
.
state
;
let
_gapFillingAnswer
=
[...
gapFillingAnswer
];
_blanksList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
id
===
optionItem
.
id
)
{
if
(
item
.
id
===
optionItem
.
id
)
{
optionItem
=
optionItem
.
correctAnswerList
.
filter
(
_gapFillingAnswer
[
index
].
correctAnswerList
=
_gapFillingAnswer
[
index
]
.
correctAnswerList
.
filter
(
(
tag
)
=>
tag
!==
removedTag
(
tag
)
=>
tag
!==
removedTag
)
;
)
}
}
});
});
this
.
setState
({
gapFillingAnswer
:
_gapFillingAnswer
},
()
=>
this
.
_onSetState
());
this
.
setState
({
blanksList
:
_blanksList
});
this
.
setState
({
blanksList
:
_blanksList
});
};
};
// 输入框关闭
handleInputClose
=
(
optionItem
)
=>
{
const
_blanksList
=
this
.
state
.
blanksList
;
_blanksList
.
forEach
((
item
)
=>
{
if
(
item
.
id
===
optionItem
.
id
)
{
item
.
inputVisible
=
false
;
optionItem
.
errorHold
=
false
;
}
});
this
.
setState
({
blanksList
:
_blanksList
});
}
handleInputEdit
=
(
optionItem
,
index
)
=>
{
handleInputEdit
=
(
optionItem
,
index
)
=>
{
const
_blanksList
=
this
.
state
.
blanksList
;
const
_blanksList
=
this
.
state
.
blanksList
;
_blanksList
.
forEach
((
item
)
=>
{
_blanksList
.
forEach
((
item
)
=>
{
...
@@ -628,9 +646,7 @@ class NewQuestionTab extends Component {
...
@@ -628,9 +646,7 @@ class NewQuestionTab extends Component {
};
};
renderGapFillingAnswer
=
(
optionItem
,
optionIndex
)
=>
{
renderGapFillingAnswer
=
(
optionItem
,
optionIndex
)
=>
{
console
.
log
(
11111
,
optionItem
)
const
{
gapFillingAnswer
}
=
this
.
state
;
const
{
gapFillingAnswer
}
=
this
.
state
;
console
.
log
(
222
,
gapFillingAnswer
)
const
list
=
gapFillingAnswer
[
optionIndex
]
&&
gapFillingAnswer
[
optionIndex
].
correctAnswerList
;
const
list
=
gapFillingAnswer
[
optionIndex
]
&&
gapFillingAnswer
[
optionIndex
].
correctAnswerList
;
return
(
return
(
<
div
className=
"gap-answer-box"
key=
{
optionIndex
}
>
<
div
className=
"gap-answer-box"
key=
{
optionIndex
}
>
...
@@ -640,31 +656,12 @@ class NewQuestionTab extends Component {
...
@@ -640,31 +656,12 @@ class NewQuestionTab extends Component {
</
span
>
</
span
>
<
div
className=
"gap-answer-content"
>
<
div
className=
"gap-answer-content"
>
{
list
&&
list
.
map
((
tag
,
index
)
=>
{
{
list
&&
list
.
map
((
tag
,
index
)
=>
{
return
optionItem
.
editInput
?
(
return
(
<
Input
placeholder=
{
optionItem
.
errorHold
?
"请输入"
:
""
}
style=
{
{
border
:
optionItem
.
errorHold
&&
"1px solid #FF4F4F"
,
}
}
value=
{
tag
}
size=
"small"
suffix=
{
<
CloseOutlined
onClick=
{
()
=>
this
.
handleInputConfirm
(
optionItem
)
}
style=
{
{
color
:
"#999999"
}
}
/>
}
onBlur=
{
(
e
)
=>
this
.
handleInputConfirm
(
optionItem
,
e
.
target
.
value
,
index
)
}
onPressEnter=
{
(
e
)
=>
this
.
handleInputConfirm
(
optionItem
,
e
.
target
.
value
,
index
)
}
/>
)
:
(
<
Tag
<
Tag
className=
"edit-tag"
className=
"edit-tag"
visible
closable
closable
onClose=
{
()
=>
this
.
handleInputClose
(
optionItem
,
tag
)
}
onClose=
{
()
=>
this
.
handleTagClose
(
optionItem
,
tag
)
}
onDoubleClick=
{
(
e
)
=>
{
this
.
handleInputEdit
(
optionItem
,
index
);
// e.preventDefault();
}
}
>
>
{
tag
}
{
tag
}
</
Tag
>
</
Tag
>
...
@@ -676,8 +673,9 @@ class NewQuestionTab extends Component {
...
@@ -676,8 +673,9 @@ class NewQuestionTab extends Component {
style=
{
{
style=
{
{
border
:
optionItem
.
errorHold
&&
"1px solid #FF4F4F"
,
border
:
optionItem
.
errorHold
&&
"1px solid #FF4F4F"
,
}
}
}
}
maxLength=
{
60
}
size=
"small"
size=
"small"
suffix=
{
<
CloseOutlined
style=
{
{
color
:
"#999999"
}
}
/>
}
suffix=
{
<
CloseOutlined
onClick=
{
()
=>
this
.
handleInputClose
(
optionItem
)
}
style=
{
{
color
:
"#999999"
}
}
/>
}
onBlur=
{
(
e
)
=>
onBlur=
{
(
e
)
=>
this
.
handleInputConfirm
(
optionItem
,
e
.
target
.
value
,
"save"
)
this
.
handleInputConfirm
(
optionItem
,
e
.
target
.
value
,
"save"
)
}
}
...
@@ -1127,6 +1125,7 @@ class NewQuestionTab extends Component {
...
@@ -1127,6 +1125,7 @@ class NewQuestionTab extends Component {
handleFinishRecord
=
(
mp3URL
,
duration
)
=>
{
handleFinishRecord
=
(
mp3URL
,
duration
)
=>
{
const
originArr
=
mp3URL
.
split
(
"."
);
const
originArr
=
mp3URL
.
split
(
"."
);
const
originType
=
originArr
[
originArr
.
length
-
1
];
const
originType
=
originArr
[
originArr
.
length
-
1
];
this
.
state
.
onAudioFinish
();
const
{
uploadItemTarget
,
contentType
}
=
this
.
state
;
const
{
uploadItemTarget
,
contentType
}
=
this
.
state
;
uploadItemTarget
.
push
({
uploadItemTarget
.
push
({
...
@@ -1402,7 +1401,7 @@ class NewQuestionTab extends Component {
...
@@ -1402,7 +1401,7 @@ class NewQuestionTab extends Component {
questionAnswerDesc
,
questionAnswerDesc
,
"1000字以内,可粘贴小图"
,
"1000字以内,可粘贴小图"
,
[
"VOICE"
,
"AUDIO"
,
"PICTURE"
,
"VIDEO"
],
[
"VOICE"
,
"AUDIO"
,
"PICTURE"
,
"VIDEO"
],
"QUESTION_ANSWER_DESC"
"QUESTION_ANSWER_DESC"
,
)
}
)
}
</
div
>
</
div
>
</
Form
.
Item
>
</
Form
.
Item
>
...
...
src/modules/teach-tool/components/NewQuestionTab.less
View file @
ba3410c0
...
@@ -337,16 +337,17 @@
...
@@ -337,16 +337,17 @@
position: relative;
position: relative;
display: inline-block;
display: inline-block;
width: 208px;
width: 208px;
//
height: calc(208px * 9 / 16);
height: calc(208px * 9 / 16);
position: relative;
position: relative;
overflow: hidden;
background-color: #000;
// background-color: #000;
padding-top: 12px;
margin: 0px 12px 12px 0;
margin: 0px 12px 12px 0;
&_content {
&_content {
max-width: 200px;
max-width: 100%;
max-height: 200px;
max-height: 100%;
border-radius: 4px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
&_btn {
&_btn {
width: 32px;
width: 32px;
...
@@ -354,13 +355,13 @@
...
@@ -354,13 +355,13 @@
position: absolute;
position: absolute;
top: 50%;
top: 50%;
left: 50%;
left: 50%;
margin-top: -
8
px;
margin-top: -
16
px;
margin-left: -16px;
margin-left: -16px;
}
}
.icon_arrow {
.icon_arrow {
position: absolute;
position: absolute;
top:
0
px;
top:
-12
px;
right:
0
px;
right:
-8
px;
color: #bfbfbf;
color: #bfbfbf;
cursor: pointer;
cursor: pointer;
font-size: 16px;
font-size: 16px;
...
@@ -380,19 +381,28 @@
...
@@ -380,19 +381,28 @@
width: 50px;
width: 50px;
}
}
.gap-answer-content {
.gap-answer-content {
display: flex;
//
display: flex;
background: #ffffff;
background: #ffffff;
border-radius: 4px;
border-radius: 4px;
border: 1px solid #e8e8e8;
border: 1px solid #e8e8e8;
padding:
6px 12px
;
padding:
8px 12px 0
;
width: calc(100% - 50px);
width: calc(100% - 50px);
word-wrap: break-word;
word-break: break-all;
overflow: hidden;
.ant-tag {
margin-bottom: 8px !important;
}
.gap-tag-input {
margin-right: 5px;
border: 1px solid rgb(165, 165, 165);
}
::-webkit-input-placeholder { /* WebKit browsers */
::-webkit-input-placeholder { /* WebKit browsers */
color: #FF4F4F;
color: #FF4F4F;
}
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #FF4F4F;
color: #FF4F4F;
}
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
:-ms-input-placeholder { /* Internet Explorer 10+ */
...
...
src/modules/teach-tool/components/QuestionBankSider.jsx
View file @
ba3410c0
...
@@ -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-
19 14:18:59
* @LastEditTime: 2021-03-
22 09:47:50
* @Description: 助学工具-题库-题库主页面侧边栏
* @Description: 助学工具-题库-题库主页面侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -26,7 +26,7 @@ class QuestionBankSider extends Component {
...
@@ -26,7 +26,7 @@ class QuestionBankSider extends Component {
NewEditQuestionBankCategory
:
null
,
//新增或编辑分类模态框
NewEditQuestionBankCategory
:
null
,
//新增或编辑分类模态框
ImportCourseCategory
:
null
,
// 引用课程分类模态框
ImportCourseCategory
:
null
,
// 引用课程分类模态框
treeData
:
this
.
props
.
treeData
||
[],
treeData
:
this
.
props
.
treeData
||
[],
autoExpandParent
:
false
autoExpandParent
:
false
,
};
};
}
}
...
@@ -40,11 +40,9 @@ class QuestionBankSider extends Component {
...
@@ -40,11 +40,9 @@ class QuestionBankSider extends Component {
}
}
shouldComponentUpdate
(
nextProps
,
nextState
)
{
shouldComponentUpdate
(
nextProps
,
nextState
)
{
const
{
updatedCategoryId
}
=
nextProps
;
const
{
currentTotal
}
=
nextProps
;
if
(
this
.
props
.
updatedCategoryId
!==
updatedCategoryId
)
{
if
(
this
.
props
.
currentTotal
!==
currentTotal
)
{
this
.
setState
({
selectedKeys
:
[
updatedCategoryId
]
},
()
=>
this
.
queryCategoryTree
();
this
.
queryCategoryTree
()
);
}
}
return
true
;
return
true
;
}
}
...
@@ -170,7 +168,12 @@ class QuestionBankSider extends Component {
...
@@ -170,7 +168,12 @@ class QuestionBankSider extends Component {
};
};
render
()
{
render
()
{
const
{
treeData
,
expandedKeys
,
selectedKeys
,
autoExpandParent
}
=
this
.
state
;
const
{
treeData
,
expandedKeys
,
selectedKeys
,
autoExpandParent
,
}
=
this
.
state
;
return
(
return
(
<
div
className=
"question-bank-sider"
>
<
div
className=
"question-bank-sider"
>
<
div
className=
"sider-title"
>
题目分类
</
div
>
<
div
className=
"sider-title"
>
题目分类
</
div
>
...
@@ -186,7 +189,7 @@ class QuestionBankSider extends Component {
...
@@ -186,7 +189,7 @@ class QuestionBankSider extends Component {
<
Button
<
Button
onClick=
{
()
=>
{
onClick=
{
()
=>
{
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
"/question-category-manage"
,
pathname
:
"/question-category-manage
?from=aid
"
,
});
});
}
}
}
}
>
>
...
...
src/modules/teach-tool/components/QuestionEditor.jsx
View file @
ba3410c0
...
@@ -139,15 +139,31 @@ class QuestionEditor extends Component {
...
@@ -139,15 +139,31 @@ class QuestionEditor extends Component {
let
prevList
=
[]
let
prevList
=
[]
let
counter
=
0
;
const
isEdit
=
getParameterByName
(
'id'
);
const
isEdit
=
getParameterByName
(
'id'
);
if
(
isEdit
)
{
if
(
isEdit
)
{
const
stemDom
=
document
.
getElementsByClassName
(
"add-fill-line"
);
const
stemDom
=
document
.
getElementsByClassName
(
"add-fill-line"
);
prevList
=
[...
stemDom
].
map
(
item
=>
item
.
id
)
prevList
=
[...
stemDom
].
map
(
item
=>
item
.
id
)
localStorage
.
setItem
(
'gap_ques_prevList'
,
JSON
.
stringify
(
prevList
));
localStorage
.
setItem
(
'gap_ques_prevList'
,
JSON
.
stringify
(
prevList
));
setTimeout
(
function
()
{
const
divHeight
=
document
.
getElementById
(
`editor
${
editorId
}
_content`
)
.
firstChild
.
offsetHeight
;
if
(
divHeight
>
30
)
{
this
.
setState
({
isShowSingleInput
:
false
});
}
else
{
this
.
setState
({
isShowSingleInput
:
true
});
}
}
let
counter
=
0
}.
bind
(
this
))
if
(
counter
===
0
)
{
this
.
props
.
changeBlankCount
(
stemDom
)
}
}
editorRoot
.
customConfig
.
onchange
=
(
html
)
=>
{
editorRoot
.
customConfig
.
onchange
=
(
html
)
=>
{
counter
++
;
const
conLen
=
html
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
).
length
;
counter
++
;
const
{
focusFlag
}
=
this
.
state
;
const
{
focusFlag
}
=
this
.
state
;
const
textLength
=
editorRoot
.
txt
.
text
().
replace
(
/
\&
nbsp
\;
/gi
,
" "
)
const
textLength
=
editorRoot
.
txt
.
text
().
replace
(
/
\&
nbsp
\;
/gi
,
" "
)
.
length
;
.
length
;
...
@@ -186,7 +202,7 @@ class QuestionEditor extends Component {
...
@@ -186,7 +202,7 @@ class QuestionEditor extends Component {
this
.
setState
({
blanksList
:
_blanksList
},
()
=>
this
.
props
.
changeBlankCount
(
_blanksList
,
idx
))
this
.
setState
({
blanksList
:
_blanksList
},
()
=>
this
.
props
.
changeBlankCount
(
_blanksList
,
idx
))
}
}
this
.
setState
(
this
.
setState
(
{
contentLength
,
visiblePlacehold
:
con
tentLength
===
0
&&
!
focusFlag
},
{
contentLength
,
visiblePlacehold
:
con
Len
===
0
&&
!
focusFlag
},
()
=>
{
()
=>
{
onChange
&&
onChange
(
html
,
this
.
state
.
contentLength
);
onChange
&&
onChange
(
html
,
this
.
state
.
contentLength
);
}
}
...
@@ -194,11 +210,12 @@ class QuestionEditor extends Component {
...
@@ -194,11 +210,12 @@ class QuestionEditor extends Component {
};
};
editorRoot
.
customConfig
.
onblur
=
(
html
)
=>
{
editorRoot
.
customConfig
.
onblur
=
(
html
)
=>
{
const
conLen
=
html
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
).
length
;
editorRoot
.
change
&&
editorRoot
.
change
();
editorRoot
.
change
&&
editorRoot
.
change
();
this
.
setState
({
this
.
setState
({
focusFlag
:
false
,
focusFlag
:
false
,
visibleMediaBox
:
false
,
visibleMediaBox
:
false
,
visiblePlacehold
:
_
.
isEmpty
(
html
.
replace
(
/
\<\/?[\w]
+
\>
/g
,
""
))
,
visiblePlacehold
:
conLen
===
0
,
zIndex
:
9
,
zIndex
:
9
,
});
});
};
};
...
@@ -262,10 +279,7 @@ class QuestionEditor extends Component {
...
@@ -262,10 +279,7 @@ class QuestionEditor extends Component {
var
_blanksList
=
[];
var
_blanksList
=
[];
_blanksList
=
document
.
getElementsByClassName
(
"add-fill-line"
);
_blanksList
=
document
.
getElementsByClassName
(
"add-fill-line"
);
this
.
setState
({
blanksList
:
_blanksList
});
this
.
setState
({
blanksList
:
_blanksList
});
this
.
setState
({
this
.
props
.
changeBlankCount
(
_blanksList
);
visiblePlacehold
:
false
,
});
// this.props.changeBlankCount(_blanksList);
};
};
render
()
{
render
()
{
...
...
src/modules/teach-tool/components/QuestionManageContent.jsx
View file @
ba3410c0
...
@@ -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-
18 14:21:22
* @LastEditTime: 2021-03-
22 09:44:27
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -105,7 +105,7 @@ class QuestionManageContent extends Component {
...
@@ -105,7 +105,7 @@ class QuestionManageContent extends Component {
QuestionBankService
.
queryQuestionPageList
(
_query
).
then
((
res
)
=>
{
QuestionBankService
.
queryQuestionPageList
(
_query
).
then
((
res
)
=>
{
const
{
records
=
[],
total
=
0
}
=
res
.
result
;
const
{
records
=
[],
total
=
0
}
=
res
.
result
;
this
.
setState
({
dataSource
:
records
});
this
.
setState
({
dataSource
:
records
});
this
.
setState
({
total
});
this
.
setState
({
total
}
,
()
=>
this
.
props
.
updatedSiderTree
(
total
)
);
});
});
};
};
...
@@ -141,7 +141,6 @@ class QuestionManageContent extends Component {
...
@@ -141,7 +141,6 @@ class QuestionManageContent extends Component {
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
"删除成功"
);
message
.
success
(
"删除成功"
);
this
.
queryQuestionPageList
();
this
.
queryQuestionPageList
();
this
.
props
.
updatedSiderTree
(
this
.
props
.
selectedCategoryId
);
}
}
});
});
};
};
...
@@ -163,7 +162,7 @@ class QuestionManageContent extends Component {
...
@@ -163,7 +162,7 @@ class QuestionManageContent extends Component {
sort
=
"UPDATED_DESC"
;
sort
=
"UPDATED_DESC"
;
}
}
const
_query
=
this
.
state
.
query
;
const
_query
=
this
.
state
.
query
;
_query
.
order
=
sort
;
_query
.
order
=
sort
||
"UPDATED_DESC"
;
_query
.
current
=
1
;
_query
.
current
=
1
;
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestionPageList
());
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestionPageList
());
};
};
...
@@ -243,7 +242,6 @@ class QuestionManageContent extends Component {
...
@@ -243,7 +242,6 @@ class QuestionManageContent extends Component {
key
:
"accuracy"
,
key
:
"accuracy"
,
dataIndex
:
"accuracy"
,
dataIndex
:
"accuracy"
,
sorter
:
true
,
sorter
:
true
,
sortDirections
:
[
"ascend"
,
"descend"
,
"ascend"
],
showSorterTooltip
:
false
,
showSorterTooltip
:
false
,
render
:
(
val
)
=>
{
render
:
(
val
)
=>
{
return
val
+
"%"
;
return
val
+
"%"
;
...
@@ -254,7 +252,6 @@ class QuestionManageContent extends Component {
...
@@ -254,7 +252,6 @@ class QuestionManageContent extends Component {
key
:
"updateTime"
,
key
:
"updateTime"
,
dataIndex
:
"updateTime"
,
dataIndex
:
"updateTime"
,
sorter
:
true
,
sorter
:
true
,
sortDirections
:
[
"ascend"
,
"descend"
,
"ascend"
],
showSorterTooltip
:
false
,
showSorterTooltip
:
false
,
render
:
(
val
)
=>
{
render
:
(
val
)
=>
{
return
formatDate
(
"YYYY-MM-DD H:i:s"
,
val
);
return
formatDate
(
"YYYY-MM-DD H:i:s"
,
val
);
...
@@ -300,6 +297,7 @@ class QuestionManageContent extends Component {
...
@@ -300,6 +297,7 @@ class QuestionManageContent extends Component {
// 自定义表格空状态
// 自定义表格空状态
customizeRenderEmpty
=
()
=>
{
customizeRenderEmpty
=
()
=>
{
const
{
categoryId
}
=
this
.
state
.
query
;
return
(
return
(
<
Empty
<
Empty
image=
"https://image.xiaomaiketang.com/xm/emptyTable.png"
image=
"https://image.xiaomaiketang.com/xm/emptyTable.png"
...
@@ -308,7 +306,7 @@ class QuestionManageContent extends Component {
...
@@ -308,7 +306,7 @@ class QuestionManageContent extends Component {
}
}
}
}
description=
{
description=
{
<
div
>
<
div
>
还没有题目
,快去
<
span
>
还没有题目
</
span
>
{
([
"CloudManager"
,
"StoreManager"
].
includes
(
User
.
getUserRole
())
&&
!
[
"0"
,
null
].
includes
(
categoryId
))
&&
(<
span
>
,快去
<
span
<
span
className=
"empty-list-tip"
className=
"empty-list-tip"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
...
@@ -317,7 +315,7 @@ class QuestionManageContent extends Component {
...
@@ -317,7 +315,7 @@ class QuestionManageContent extends Component {
>
>
新建一个
新建一个
</
span
>
</
span
>
吧!
吧!
</
span
>)
}
</
div
>
</
div
>
}
}
></
Empty
>
></
Empty
>
...
...
src/modules/teach-tool/components/XMRecord.jsx
View file @
ba3410c0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-03-18 10:01:28
* @Date: 2020-03-18 10:01:28
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-
02 10:59:09
* @LastEditTime: 2021-03-
22 09:46:07
* @Description: 录音组件
* @Description: 录音组件
*/
*/
...
@@ -35,7 +35,7 @@ class XMRecord extends Component {
...
@@ -35,7 +35,7 @@ class XMRecord extends Component {
this
.
getAudioRecorderDevice
();
this
.
getAudioRecorderDevice
();
}
}
componentWillUnmount
()
{}
componentWillUnmount
()
{
}
getAudioRecorderDevice
=
()
=>
{
getAudioRecorderDevice
=
()
=>
{
//仅用来进行录音
//仅用来进行录音
...
@@ -124,6 +124,7 @@ class XMRecord extends Component {
...
@@ -124,6 +124,7 @@ class XMRecord extends Component {
isFinished
:
true
,
isFinished
:
true
,
});
});
window
.
clearInterval
(
this
.
timer
);
window
.
clearInterval
(
this
.
timer
);
this
.
mMediaRecorder
.
stop
();
});
});
};
};
...
@@ -147,6 +148,7 @@ class XMRecord extends Component {
...
@@ -147,6 +148,7 @@ class XMRecord extends Component {
},
},
()
=>
{
()
=>
{
this
.
props
.
onCancel
();
this
.
props
.
onCancel
();
this
.
mMediaRecorder
.
stop
();
},
},
);
);
};
};
...
...
src/modules/teach-tool/components/audioRecord.js
View file @
ba3410c0
...
@@ -108,6 +108,9 @@ export default function AudioRecorder(stream, config) {
...
@@ -108,6 +108,9 @@ export default function AudioRecorder(stream, config) {
//停止
//停止
this
.
stop
=
function
()
{
this
.
stop
=
function
()
{
stream
.
getTracks
().
forEach
(
function
(
track
)
{
track
.
stop
();
});
recorder
.
disconnect
();
recorder
.
disconnect
();
}
}
...
...
src/modules/teach-tool/modal/BatchImportQuestionModal.jsx
View file @
ba3410c0
...
@@ -244,7 +244,7 @@ class BatchImportQuestionModal extends Component {
...
@@ -244,7 +244,7 @@ class BatchImportQuestionModal extends Component {
</
Modal
>
</
Modal
>
<
SelectPrepareFileModal
<
SelectPrepareFileModal
operateType=
"select"
operateType=
"select"
accept=
"
xls/xlsx
"
accept=
"
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel
"
selectTypeList=
{
[
selectTypeList=
{
[
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"
,
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"
,
"vnd.ms-excel"
,
"vnd.ms-excel"
,
...
...
src/modules/teach-tool/modal/NewEditQuestionBankCategory.jsx
View file @
ba3410c0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-22 17:51:28
* @Date: 2021-02-22 17:51:28
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-03-
18 09:32:59
* @LastEditTime: 2021-03-
22 09:43:18
* @Description: 助学工具-题库-题库新建或编辑题库分类模态框
* @Description: 助学工具-题库-题库新建或编辑题库分类模态框
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -126,6 +126,11 @@ class NewEditQuestionBankCategory extends Component {
...
@@ -126,6 +126,11 @@ class NewEditQuestionBankCategory extends Component {
// 查询是否重名
// 查询是否重名
checkExist
=
(
sameLevelNodes
,
categoryName
)
=>
{
checkExist
=
(
sameLevelNodes
,
categoryName
)
=>
{
if
((
sameLevelNodes
.
length
>
0
&&
sameLevelNodes
[
0
].
parentId
===
"0"
))
{
if
(
categoryName
===
"未分类"
)
{
return
true
;
}
}
var
result
=
null
;
var
result
=
null
;
sameLevelNodes
.
forEach
((
item
)
=>
{
sameLevelNodes
.
forEach
((
item
)
=>
{
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
...
...
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