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
6a844944
Commit
6a844944
authored
Apr 01, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:接口联调
parent
4898b7f5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
504 additions
and
118 deletions
+504
-118
src/data-source/aidTool/request-apis.ts
+22
-1
src/domains/aid-tool-domain/AidToolService.ts
+30
-4
src/modules/teach-tool/components/CourseCategoryManage.jsx
+6
-6
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
+34
-24
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.jsx
+1
-1
src/modules/teach-tool/examination-paper/NewExaminationPaper.jsx
+0
-0
src/modules/teach-tool/examination-paper/components/ExaminationPaperContent.jsx
+69
-54
src/modules/teach-tool/examination-paper/components/SelectQuestionContent.jsx
+2
-2
src/modules/teach-tool/examination-paper/modal/PaperPreviewModal.jsx
+249
-0
src/modules/teach-tool/examination-paper/modal/PaperPreviewModal.less
+67
-0
src/modules/teach-tool/examination-paper/modal/SelectQuestionModal.jsx
+2
-2
src/modules/teach-tool/modal/NewEditCourseCategoryModal.jsx
+7
-8
src/modules/teach-tool/question-bank/AddNewQuestion.jsx
+4
-4
src/modules/teach-tool/question-bank/QuestionBankIndex.jsx
+1
-1
src/modules/teach-tool/question-bank/components/QuestionManageContent.jsx
+5
-6
src/modules/teach-tool/question-bank/modal/BatchImportQuestionModal.jsx
+2
-2
src/modules/teach-tool/question-bank/modal/QuestionPreviewModal.jsx
+3
-3
No files found.
src/data-source/
questionBank
/request-apis.ts
→
src/data-source/
aidTool
/request-apis.ts
View file @
6a844944
...
@@ -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-0
3-31 18:14:09
* @LastEditTime: 2021-0
4-01 15:36:48
* @Description: 助学工具接口
* @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -51,4 +51,24 @@ export function editQuestion(params: object) {
...
@@ -51,4 +51,24 @@ export function editQuestion(params: object) {
export
function
batchImport
(
params
:
object
)
{
export
function
batchImport
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/batchImport"
,
params
);
return
Service
.
Hades
(
"public/hades/batchImport"
,
params
);
}
export
function
createPaper
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/createPaper"
,
params
);
}
export
function
queryPaperPageList
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/queryPaperPageList"
,
params
);
}
export
function
deletePaper
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/deletePaper"
,
params
);
}
export
function
queryPaperDetail
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/queryPaperDetail"
,
params
);
}
export
function
viewPaper
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/viewPaper"
,
params
);
}
}
\ No newline at end of file
src/domains/
question-bank-domain/QuestionBank
Service.ts
→
src/domains/
aid-tool-domain/AidTool
Service.ts
View file @
6a844944
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-11 11:34:37
* @Date: 2021-03-11 11:34:37
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-0
3-31 18:14:4
2
* @LastEditTime: 2021-0
4-01 20:09:1
2
* @Description:
描述一下咯
* @Description:
助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
{
queryCategoryTree
,
addCategory
,
delCategory
,
editCategory
,
editCategoryTree
,
addQuestion
,
queryQuestionPageList
,
deleteQuestion
,
queryQuestionDetails
,
editQuestion
,
batchImport
}
from
'@/data-source/questionBank
/request-apis'
;
import
{
queryCategoryTree
,
addCategory
,
delCategory
,
editCategory
,
editCategoryTree
,
addQuestion
,
queryQuestionPageList
,
deleteQuestion
,
queryQuestionDetails
,
editQuestion
,
batchImport
,
createPaper
,
queryPaperPageList
,
deletePaper
,
queryPaperDetail
,
viewPaper
}
from
'@/data-source/aidTool
/request-apis'
;
export
default
class
QuestionBank
Service
{
export
default
class
AidTool
Service
{
// 获取题目分类树
// 获取题目分类树
static
queryCategoryTree
(
params
:
any
)
{
static
queryCategoryTree
(
params
:
any
)
{
return
queryCategoryTree
(
params
);
return
queryCategoryTree
(
params
);
...
@@ -62,4 +62,29 @@ export default class QuestionBankService {
...
@@ -62,4 +62,29 @@ export default class QuestionBankService {
static
batchImport
(
params
:
any
)
{
static
batchImport
(
params
:
any
)
{
return
batchImport
(
params
);
return
batchImport
(
params
);
}
}
// 创建试卷
static
createPaper
(
params
:
any
)
{
return
createPaper
(
params
);
}
// 查询试卷列表
static
queryPaperPageList
(
params
:
any
)
{
return
queryPaperPageList
(
params
);
}
// 删除试卷
static
deletePaper
(
params
:
any
)
{
return
deletePaper
(
params
);
}
// 编辑前查询试卷信息
static
queryPaperDetail
(
params
:
any
)
{
return
queryPaperDetail
(
params
);
}
// 预览试卷
static
viewPaper
(
params
:
any
)
{
return
viewPaper
(
params
);
}
}
}
\ No newline at end of file
src/modules/teach-tool/components/CourseCategoryManage.jsx
View file @
6a844944
...
@@ -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-0
3-31 18:36:34
* @LastEditTime: 2021-0
4-01 20:10:29
* @Description: 助学工具-课程分类
* @Description: 助学工具-课程分类
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -10,7 +10,7 @@ import React, { Component } from "react";
...
@@ -10,7 +10,7 @@ import React, { Component } from "react";
import
Breadcrumbs
from
"@/components/Breadcrumbs"
;
import
Breadcrumbs
from
"@/components/Breadcrumbs"
;
import
"./CourseCategoryManage.less"
;
import
"./CourseCategoryManage.less"
;
import
NewEditCourseCategoryModal
from
"../modal/NewEditCourseCategoryModal"
;
import
NewEditCourseCategoryModal
from
"../modal/NewEditCourseCategoryModal"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
{
import
{
Tree
,
Tree
,
...
@@ -51,7 +51,7 @@ class CourseCategoryManage extends Component {
...
@@ -51,7 +51,7 @@ class CourseCategoryManage extends Component {
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
};
};
QuestionBank
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
AidTool
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
categoryList
=
[]
}
=
res
.
result
;
const
{
categoryList
=
[]
}
=
res
.
result
;
this
.
setState
({
originTreeData
:
categoryList
},
()
=>
{
this
.
setState
({
originTreeData
:
categoryList
},
()
=>
{
let
map
=
{};
let
map
=
{};
...
@@ -82,7 +82,7 @@ class CourseCategoryManage extends Component {
...
@@ -82,7 +82,7 @@ class CourseCategoryManage extends Component {
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
};
};
QuestionBank
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
AidTool
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
categoryList
=
[]
}
=
res
.
result
;
const
{
categoryList
=
[]
}
=
res
.
result
;
let
str
=
"未分类"
;
let
str
=
"未分类"
;
if
(
categoryName
)
{
if
(
categoryName
)
{
...
@@ -332,7 +332,7 @@ class CourseCategoryManage extends Component {
...
@@ -332,7 +332,7 @@ class CourseCategoryManage extends Component {
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
};
};
QuestionBank
Service
.
delCategory
(
params
).
then
((
res
)
=>
{
AidTool
Service
.
delCategory
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
"删除分类成功"
);
message
.
success
(
"删除分类成功"
);
this
.
queryCategoryTree
(
"change"
,
this
.
state
.
categoryName
);
this
.
queryCategoryTree
(
"change"
,
this
.
state
.
categoryName
);
...
@@ -551,7 +551,7 @@ class CourseCategoryManage extends Component {
...
@@ -551,7 +551,7 @@ class CourseCategoryManage extends Component {
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
};
};
QuestionBank
Service
.
editCategoryTree
(
params
).
then
((
res
)
=>
{
AidTool
Service
.
editCategoryTree
(
params
).
then
((
res
)
=>
{
this
.
queryCategoryTree
(
"change"
);
this
.
queryCategoryTree
(
"change"
);
});
});
};
};
...
...
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
View file @
6a844944
...
@@ -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-0
3-31 19:23:40
* @LastEditTime: 2021-0
4-01 14:15:23
* @Description: 助学工具-课程分类侧边栏
* @Description: 助学工具-课程分类侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -10,7 +10,7 @@ import React, { Component } from "react";
...
@@ -10,7 +10,7 @@ import React, { Component } from "react";
import
{
Input
,
Button
,
Tree
}
from
"antd"
;
import
{
Input
,
Button
,
Tree
}
from
"antd"
;
import
"./CourseCategorySiderTree.less"
;
import
"./CourseCategorySiderTree.less"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
const
{
DirectoryTree
}
=
Tree
;
const
{
DirectoryTree
}
=
Tree
;
...
@@ -19,10 +19,9 @@ class CourseCategorySiderTree extends Component {
...
@@ -19,10 +19,9 @@ class CourseCategorySiderTree extends Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
selectedKeys
:
selectedKeys
:
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
props
.
fromModule
)
props
.
fromModule
===
"QUESTION_INDEX"
?
[
getParameterByName
(
"categoryId"
)
||
"null"
]
?
[
getParameterByName
(
"categoryId"
)
||
"null"
]
:
[
"null"
],
:
[
"null"
],
treeData
:
props
.
treeData
||
[],
treeData
:
props
.
treeData
||
[],
autoExpandParent
:
false
,
autoExpandParent
:
false
,
};
};
...
@@ -31,7 +30,7 @@ class CourseCategorySiderTree extends Component {
...
@@ -31,7 +30,7 @@ class CourseCategorySiderTree extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
queryCategoryTree
(
"change"
);
this
.
queryCategoryTree
(
"change"
);
this
.
props
.
getSelectedCategoryId
(
this
.
props
.
getSelectedCategoryId
(
this
.
props
.
fromModule
===
"QUESTION_INDEX"
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
?
[
getParameterByName
(
"categoryId"
)
||
"null"
]
?
[
getParameterByName
(
"categoryId"
)
||
"null"
]
:
[
"null"
]
:
[
"null"
]
);
);
...
@@ -40,7 +39,7 @@ class CourseCategorySiderTree extends Component {
...
@@ -40,7 +39,7 @@ class CourseCategorySiderTree extends Component {
shouldComponentUpdate
(
nextProps
,
nextState
)
{
shouldComponentUpdate
(
nextProps
,
nextState
)
{
const
{
currentTotal
,
updatedCategoryId
}
=
nextProps
;
const
{
currentTotal
,
updatedCategoryId
}
=
nextProps
;
if
(
if
(
this
.
props
.
fromModule
===
"QUESTION_INDEX"
&&
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
this
.
props
.
currentTotal
!==
currentTotal
&&
this
.
props
.
currentTotal
!==
currentTotal
&&
this
.
props
.
updatedCategoryId
===
updatedCategoryId
this
.
props
.
updatedCategoryId
===
updatedCategoryId
)
{
)
{
...
@@ -52,14 +51,18 @@ class CourseCategorySiderTree extends Component {
...
@@ -52,14 +51,18 @@ class CourseCategorySiderTree extends Component {
// 查询分类树
// 查询分类树
queryCategoryTree
=
(
type
,
categoryName
)
=>
{
queryCategoryTree
=
(
type
,
categoryName
)
=>
{
let
query
=
{
let
query
=
{
bizType
:
[
"QUESTION_INDEX"
,
"QUESTION_MODAL"
].
includes
(
this
.
props
.
fromModule
)
?
"QUESTION"
:
"PAPER"
,
bizType
:
[
"QUESTION_INDEX"
,
"QUESTION_MODAL"
].
includes
(
this
.
props
.
fromModule
)
?
"QUESTION"
:
"PAPER"
,
categoryName
,
categoryName
,
count
:
true
,
count
:
true
,
source
:
0
,
source
:
0
,
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
};
};
QuestionBank
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
AidTool
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
categoryList
=
[],
noCategoryCnt
=
0
}
=
res
.
result
;
const
{
categoryList
=
[],
noCategoryCnt
=
0
}
=
res
.
result
;
let
str
=
"未分类"
;
let
str
=
"未分类"
;
if
(
categoryName
)
{
if
(
categoryName
)
{
...
@@ -200,7 +203,13 @@ class CourseCategorySiderTree extends Component {
...
@@ -200,7 +203,13 @@ class CourseCategorySiderTree extends Component {
return
(
return
(
<
div
className=
"category-tree-sider"
>
<
div
className=
"category-tree-sider"
>
{
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
<
div
className=
"sider-title"
>
{
this
.
props
.
fromModule
===
"QUESTION_INDEX"
?
"题目分类"
:
"试卷分类"
}
</
div
>
}
{
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
(
<
div
className=
"sider-title"
>
{
this
.
props
.
fromModule
===
"QUESTION_INDEX"
?
"题目分类"
:
"试卷分类"
}
</
div
>
)
}
<
Search
<
Search
className=
"sider-search"
className=
"sider-search"
placeholder=
"搜索名称分类"
placeholder=
"搜索名称分类"
...
@@ -209,19 +218,20 @@ class CourseCategorySiderTree extends Component {
...
@@ -209,19 +218,20 @@ class CourseCategorySiderTree extends Component {
}
}
}
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
/>
/>
{
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
User
.
getUserRole
()
!==
"CloudLecturer"
&&
(
{
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
<
div
className=
"sider-btn"
>
User
.
getUserRole
()
!==
"CloudLecturer"
&&
(
<
Button
<
div
className=
"sider-btn"
>
onClick=
{
()
=>
{
<
Button
window
.
RCHistory
.
push
({
onClick=
{
()
=>
{
pathname
:
"/course-category-manage?from=aid"
,
window
.
RCHistory
.
push
({
});
pathname
:
"/course-category-manage?from=aid"
,
}
}
});
>
}
}
分类管理
>
</
Button
>
分类管理
</
div
>
</
Button
>
)
}
</
div
>
)
}
<
div
className=
"sider-tree"
>
<
div
className=
"sider-tree"
>
<
DirectoryTree
<
DirectoryTree
expandedKeys=
{
expandedKeys
}
expandedKeys=
{
expandedKeys
}
...
...
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.jsx
View file @
6a844944
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-27 14:55:14
* @Date: 2021-03-27 14:55:14
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-0
3-31 19:14:46
* @LastEditTime: 2021-0
4-01 14:00:47
* @Description: 助学工具-试卷主页面
* @Description: 助学工具-试卷主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
...
src/modules/teach-tool/examination-paper/NewExaminationPaper.jsx
View file @
6a844944
This diff is collapsed.
Click to expand it.
src/modules/teach-tool/examination-paper/components/ExaminationPaperContent.jsx
View file @
6a844944
...
@@ -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-0
3-30 19:32:28
* @LastEditTime: 2021-0
4-01 15:06:37
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -21,8 +21,9 @@ import {
...
@@ -21,8 +21,9 @@ import {
import
{
PageControl
}
from
"@/components"
;
import
{
PageControl
}
from
"@/components"
;
import
"./ExaminationPaperContent.less"
;
import
"./ExaminationPaperContent.less"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
import
_
from
"underscore"
;
import
_
from
"underscore"
;
import
PaperPreviewModal
from
"../modal/PaperPreviewModal"
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
...
@@ -34,44 +35,69 @@ class ExaminationPaperContent extends Component {
...
@@ -34,44 +35,69 @@ class ExaminationPaperContent extends Component {
current
:
1
,
current
:
1
,
size
:
10
,
size
:
10
,
categoryId
:
null
,
// 当前题库分类Id
categoryId
:
null
,
// 当前题库分类Id
examinationP
aperName
:
null
,
// 试卷名称
p
aperName
:
null
,
// 试卷名称
source
:
0
,
source
:
0
,
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
},
},
dataSource
:
[],
dataSource
:
[],
questionPreviewModal
:
null
,
// 题目
预览模态框
paperPreviewModal
:
null
,
// 试卷
预览模态框
};
};
}
}
componentDidMount
()
{}
shouldComponentUpdate
(
nextProps
,
nextState
)
{
shouldComponentUpdate
(
nextProps
,
nextState
)
{
let
{
selectedCategoryId
}
=
nextProps
;
let
{
selectedCategoryId
}
=
nextProps
;
const
_query
=
this
.
state
.
query
;
const
_query
=
this
.
state
.
query
;
if
(
this
.
props
.
selectedCategoryId
!==
selectedCategoryId
)
{
if
(
this
.
props
.
selectedCategoryId
!==
selectedCategoryId
)
{
_query
.
categoryId
=
selectedCategoryId
===
"null"
?
null
:
selectedCategoryId
;
_query
.
categoryId
=
_query
.
examinationPaperName
=
null
;
selectedCategoryId
===
"null"
?
null
:
selectedCategoryId
;
_query
.
paperName
=
null
;
_query
.
current
=
1
;
_query
.
current
=
1
;
this
.
setState
({
query
:
_query
},
()
=>
this
.
query
ExaminationPaper
List
());
this
.
setState
({
query
:
_query
},
()
=>
this
.
query
PaperPage
List
());
}
}
return
true
;
return
true
;
}
}
// 查询试卷列表
// 查询试卷列表
queryExaminationPaperList
=
()
=>
{};
queryPaperPageList
=
()
=>
{
const
_query
=
this
.
state
.
query
;
AidToolService
.
queryPaperPageList
(
_query
).
then
((
res
)
=>
{
const
{
records
=
[],
total
=
0
}
=
res
.
result
;
this
.
setState
({
dataSource
:
records
,
total
},
()
=>
this
.
props
.
updatedSiderTree
(
total
,
this
.
props
.
selectedCategoryId
)
);
});
};
// 预览试卷
// 预览试卷
previewExaminationPaper
=
(
record
)
=>
{};
previewPaper
=
(
record
)
=>
{
const
m
=
(
<
PaperPreviewModal
categoryId=
{
this
.
state
.
query
.
categoryId
}
paperId=
{
record
.
paperId
}
close=
{
()
=>
{
this
.
setState
({
paperPreviewModal
:
null
,
});
}
}
/>
);
this
.
setState
({
paperPreviewModal
:
m
});
};
// 复制试卷
// 复制试卷
copy
Examination
Paper
=
(
record
)
=>
{};
copyPaper
=
(
record
)
=>
{};
// 编辑试卷
// 编辑试卷
editExaminationPaper
=
(
record
)
=>
{};
editPaper
=
(
record
)
=>
{
const
{
categoryId
}
=
this
.
state
.
query
;
window
.
RCHistory
.
push
({
pathname
:
`/new-examination-paper?paperId=
${
record
.
paperId
}
&categoryId=
${
categoryId
}
`
,
});
};
// 删除试卷
// 删除试卷
del
Examination
Paper
(
record
)
{
del
ete
Paper
(
record
)
{
return
Modal
.
confirm
({
return
Modal
.
confirm
({
title
:
"提示"
,
title
:
"提示"
,
content
:
"确定要删除此试卷吗?"
,
content
:
"确定要删除此试卷吗?"
,
...
@@ -82,12 +108,13 @@ class ExaminationPaperContent extends Component {
...
@@ -82,12 +108,13 @@ class ExaminationPaperContent extends Component {
cancelText
:
"取消"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
onOk
:
()
=>
{
let
params
=
{
let
params
=
{
id
:
record
.
id
,
categoryId
:
this
.
state
.
query
.
categoryId
,
paperId
:
record
.
paperId
,
source
:
0
,
source
:
0
,
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
};
};
QuestionBankService
.
deleteQuestion
(
params
).
then
((
res
)
=>
{
AidToolService
.
deletePaper
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
"删除成功"
);
message
.
success
(
"删除成功"
);
const
{
query
,
total
}
=
this
.
state
;
const
{
query
,
total
}
=
this
.
state
;
...
@@ -98,9 +125,7 @@ class ExaminationPaperContent extends Component {
...
@@ -98,9 +125,7 @@ class ExaminationPaperContent extends Component {
_query
.
current
=
1
;
_query
.
current
=
1
;
}
}
}
}
this
.
setState
({
query
:
_query
},
()
=>
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryPaperPageList
());
this
.
queryQuestionPageList
()
);
}
}
});
});
},
},
...
@@ -112,8 +137,8 @@ class ExaminationPaperContent extends Component {
...
@@ -112,8 +137,8 @@ class ExaminationPaperContent extends Component {
const
columns
=
[
const
columns
=
[
{
{
title
:
"试卷"
,
title
:
"试卷"
,
key
:
"
examinationP
aperName"
,
key
:
"
p
aperName"
,
dataIndex
:
"
examinationP
aperName"
,
dataIndex
:
"
p
aperName"
,
ellipsis
:
{
ellipsis
:
{
showTitle
:
false
,
showTitle
:
false
,
},
},
...
@@ -151,14 +176,14 @@ class ExaminationPaperContent extends Component {
...
@@ -151,14 +176,14 @@ class ExaminationPaperContent extends Component {
},
},
{
{
title
:
"题目数量"
,
title
:
"题目数量"
,
key
:
"
cou
nt"
,
key
:
"
questionC
nt"
,
dataIndex
:
"
cou
nt"
,
dataIndex
:
"
questionC
nt"
,
width
:
"14%"
,
width
:
"14%"
,
},
},
{
{
title
:
"关联考试数"
,
title
:
"关联考试数"
,
key
:
"related
Count
"
,
key
:
"related
Exam
"
,
dataIndex
:
"related
Count
"
,
dataIndex
:
"related
Exam
"
,
width
:
"14%"
,
width
:
"14%"
,
},
},
{
{
...
@@ -171,7 +196,7 @@ class ExaminationPaperContent extends Component {
...
@@ -171,7 +196,7 @@ class ExaminationPaperContent extends Component {
<
div
className=
"record-operate"
>
<
div
className=
"record-operate"
>
<
div
<
div
className=
"record-operate__item"
className=
"record-operate__item"
onClick=
{
()
=>
this
.
preview
Question
(
record
.
i
d
)
}
onClick=
{
()
=>
this
.
preview
Paper
(
recor
d
)
}
>
>
预览
预览
</
div
>
</
div
>
...
@@ -185,7 +210,7 @@ class ExaminationPaperContent extends Component {
...
@@ -185,7 +210,7 @@ class ExaminationPaperContent extends Component {
复制
复制
</
div
>
</
div
>
<
span
className=
"record-operate__item split"
>
|
</
span
>
<
span
className=
"record-operate__item split"
>
|
</
span
>
<
Dropdown
overlay=
{
this
.
initDropMenu
(
val
)
}
>
<
Dropdown
overlay=
{
this
.
initDropMenu
(
record
)
}
>
<
div
className=
"record-operate__item"
>
更多
</
div
>
<
div
className=
"record-operate__item"
>
更多
</
div
>
</
Dropdown
>
</
Dropdown
>
</
div
>
</
div
>
...
@@ -201,10 +226,10 @@ class ExaminationPaperContent extends Component {
...
@@ -201,10 +226,10 @@ class ExaminationPaperContent extends Component {
return
(
return
(
<
Menu
>
<
Menu
>
<
Menu
.
Item
key=
"edit"
>
<
Menu
.
Item
key=
"edit"
>
<
span
onClick=
{
()
=>
this
.
edit
Examination
Paper
(
item
)
}
>
编辑
</
span
>
<
span
onClick=
{
()
=>
this
.
editPaper
(
item
)
}
>
编辑
</
span
>
</
Menu
.
Item
>
</
Menu
.
Item
>
<
Menu
.
Item
key=
"del"
>
<
Menu
.
Item
key=
"del"
>
<
span
onClick=
{
()
=>
this
.
del
Examination
Paper
(
item
)
}
>
删除
</
span
>
<
span
onClick=
{
()
=>
this
.
del
ete
Paper
(
item
)
}
>
删除
</
span
>
</
Menu
.
Item
>
</
Menu
.
Item
>
</
Menu
>
</
Menu
>
);
);
...
@@ -217,29 +242,12 @@ class ExaminationPaperContent extends Component {
...
@@ -217,29 +242,12 @@ class ExaminationPaperContent extends Component {
}
}
let
_query
=
this
.
state
.
query
;
let
_query
=
this
.
state
.
query
;
_query
.
size
=
size
;
_query
.
size
=
size
;
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestionPageList
());
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryPaperPageList
());
};
// 改变搜索条件
handleChangeQuery
=
(
searchType
,
value
)
=>
{
this
.
setState
(
{
query
:
{
...
this
.
state
.
query
,
[
searchType
]:
value
||
null
,
current
:
1
,
},
},
()
=>
{
if
(
searchType
===
"questionName"
)
return
;
this
.
queryQuestionPageList
();
}
);
};
};
render
()
{
render
()
{
const
{
dataSource
=
[],
total
,
query
}
=
this
.
state
;
const
{
dataSource
=
[],
total
,
query
,
paperPreviewModal
}
=
this
.
state
;
const
{
current
,
size
,
categoryId
,
questionName
,
questionTyp
e
}
=
query
;
const
{
current
,
size
,
categoryId
,
paperNam
e
}
=
query
;
return
(
return
(
<
div
className=
"question-manage-content"
>
<
div
className=
"question-manage-content"
>
<
div
className=
"question-manage-filter"
>
<
div
className=
"question-manage-filter"
>
...
@@ -249,13 +257,19 @@ class ExaminationPaperContent extends Component {
...
@@ -249,13 +257,19 @@ class ExaminationPaperContent extends Component {
<
span
className=
"search-label"
>
试卷:
</
span
>
<
span
className=
"search-label"
>
试卷:
</
span
>
<
Search
<
Search
placeholder=
"搜索试卷名称"
placeholder=
"搜索试卷名称"
value=
{
question
Name
}
value=
{
paper
Name
}
style=
{
{
width
:
"calc(100% - 100px)"
}
}
style=
{
{
width
:
"calc(100% - 100px)"
}
}
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
this
.
handleChangeQuery
(
"questionName"
,
e
.
target
.
value
);
this
.
setState
({
query
:
{
...
query
,
paperName
:
e
.
target
.
value
.
trim
(),
current
:
1
,
},
});
}
}
}
}
onSearch=
{
()
=>
{
onSearch=
{
()
=>
{
this
.
query
Question
PageList
();
this
.
query
Paper
PageList
();
}
}
}
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
/>
/>
...
@@ -267,7 +281,7 @@ class ExaminationPaperContent extends Component {
...
@@ -267,7 +281,7 @@ class ExaminationPaperContent extends Component {
type=
"primary"
type=
"primary"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
`/new-examination-paper?categoryId=${
this.state.query.
categoryId}`
,
pathname
:
`/new-examination-paper?categoryId=${categoryId}`
,
});
});
}
}
}
}
>
>
...
@@ -291,7 +305,7 @@ class ExaminationPaperContent extends Component {
...
@@ -291,7 +305,7 @@ class ExaminationPaperContent extends Component {
toPage=
{
(
page
)
=>
{
toPage=
{
(
page
)
=>
{
const
_query
=
{
...
query
,
current
:
page
+
1
};
const
_query
=
{
...
query
,
current
:
page
+
1
};
this
.
setState
({
query
:
_query
},
()
=>
this
.
setState
({
query
:
_query
},
()
=>
this
.
query
Question
PageList
()
this
.
query
Paper
PageList
()
);
);
}
}
}
}
showSizeChanger=
{
true
}
showSizeChanger=
{
true
}
...
@@ -299,6 +313,7 @@ class ExaminationPaperContent extends Component {
...
@@ -299,6 +313,7 @@ class ExaminationPaperContent extends Component {
/>
/>
</
div
>
</
div
>
)
}
)
}
{
paperPreviewModal
}
</
div
>
</
div
>
</
div
>
</
div
>
);
);
...
...
src/modules/teach-tool/examination-paper/components/SelectQuestionContent.jsx
View file @
6a844944
...
@@ -23,7 +23,7 @@ import {
...
@@ -23,7 +23,7 @@ import {
import
{
PageControl
}
from
"@/components"
;
import
{
PageControl
}
from
"@/components"
;
import
"./SelectQuestionContent.less"
;
import
"./SelectQuestionContent.less"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
import
_
from
"underscore"
;
import
_
from
"underscore"
;
import
ShowTips
from
"@/components/ShowTips"
;
import
ShowTips
from
"@/components/ShowTips"
;
...
@@ -98,7 +98,7 @@ class QuestionListContent extends Component {
...
@@ -98,7 +98,7 @@ class QuestionListContent extends Component {
queryQuestionPageList
=
()
=>
{
queryQuestionPageList
=
()
=>
{
const
_query
=
this
.
state
.
query
;
const
_query
=
this
.
state
.
query
;
QuestionBank
Service
.
queryQuestionPageList
(
_query
).
then
((
res
)
=>
{
AidTool
Service
.
queryQuestionPageList
(
_query
).
then
((
res
)
=>
{
const
{
records
=
[],
total
=
0
}
=
res
.
result
;
const
{
records
=
[],
total
=
0
}
=
res
.
result
;
this
.
setState
({
dataSource
:
records
,
total
});
this
.
setState
({
dataSource
:
records
,
total
});
});
});
...
...
src/modules/teach-tool/examination-paper/modal/PaperPreviewModal.jsx
0 → 100644
View file @
6a844944
/*
* @Author: yuananting
* @Date: 2021-03-27 11:15:03
* @LastEditors: yuananting
* @LastEditTime: 2021-04-01 20:12:01
* @Description: 助学工具-试卷-预览试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
React
,
{
Component
}
from
"react"
;
import
{
Modal
}
from
"antd"
;
import
User
from
"@/common/js/user"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidToolService"
;
import
"./PaperPreviewModal.less"
;
import
ScanFileModal
from
"@/modules/resource-disk/modal/ScanFileModal"
;
import
_
from
"underscore"
;
import
XMAudio
from
"../../components/XMAudio"
;
import
{
NUM_TO_WORD_MAP
}
from
"@/common/constants/punchClock/punchClock"
;
const
questionTypeList
=
{
SINGLE_CHOICE
:
"单选题"
,
MULTI_CHOICE
:
"多选题"
,
JUDGE
:
"判断题"
,
GAP_FILLING
:
"填空题"
,
INDEFINITE_CHOICE
:
"不定项选择题"
,
};
class
PaperPreviewModal
extends
Component
{
formRef
=
React
.
createRef
();
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
paperInfo
:
{
paperName
:
null
,
questionList
:
[],
},
};
}
componentDidMount
()
{
this
.
queryPaperDetail
();
}
// 题目预览
queryPaperDetail
=
()
=>
{
let
query
=
{
categoryId
:
this
.
props
.
categoryId
,
paperId
:
this
.
props
.
paperId
,
source
:
0
,
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
};
AidToolService
.
viewPaper
(
query
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
this
.
setState
({
paperInfo
:
result
});
});
};
// 查看图片或视频
handleScanFile
=
(
scanFileType
,
scanFileAddress
)
=>
{
this
.
setState
({
showScanFile
:
true
,
scanFileAddress
,
scanFileType
,
});
};
renderStem
=
(
questionStemList
,
questionType
,
score
,
questionIndex
)
=>
{
const
textContent
=
_
.
filter
(
questionStemList
,
(
item
)
=>
{
return
item
.
type
==
"RICH_TEXT"
;
});
const
mediaContent
=
_
.
filter
(
questionStemList
,
(
item
)
=>
{
return
item
.
type
!==
"RICH_TEXT"
;
});
let
content
=
textContent
.
length
>
0
&&
textContent
[
0
].
content
;
if
(
questionType
===
"GAP_FILLING"
)
{
content
=
content
.
replace
(
/_/g
,
`<input
class="add-fill-line"
disabled
correctAnswerList=""
id=
${
window
.
random_string
(
16
)}
value="填空"
/>`
);
}
let
textDom
=
(
<
span
key=
{
0
}
className=
"input-box"
dangerouslySetInnerHTML=
{
{
__html
:
content
,
}
}
/>
);
return
(
<
div
className=
"stem-line__item"
>
<
div
className=
"text"
>
<
span
>
{
questionIndex
+
1
}
.
</
span
>
<
span
>
【
{
questionTypeList
[
questionType
]
}
】
</
span
>
{
textDom
}
<
span
>
(
{
score
}
分)
</
span
>
</
div
>
{
this
.
renderMediaContent
(
mediaContent
)
}
</
div
>
);
};
renderOption
=
(
optionItem
,
questionType
)
=>
{
const
{
questionOptionContentList
,
optionSort
}
=
optionItem
const
textContent
=
_
.
filter
(
questionOptionContentList
,
(
item
)
=>
{
return
item
.
type
==
"RICH_TEXT"
;
});
const
mediaContent
=
_
.
filter
(
questionOptionContentList
,
(
item
)
=>
{
return
item
.
type
!==
"RICH_TEXT"
;
});
let
content
=
textContent
.
length
>
0
&&
textContent
[
0
].
content
;
if
(
questionType
!==
"GAP_FILLING"
)
{
let
textDom
=
(
<
span
key=
{
0
}
className=
"input-box"
dangerouslySetInnerHTML=
{
{
__html
:
content
,
}
}
/>
);
return
(
<
div
className=
"option-line__item"
>
<
div
className=
"text"
>
{
NUM_TO_WORD_MAP
[
optionSort
]
}
.
{
textDom
}
</
div
>
{
mediaContent
.
length
>
0
&&
this
.
renderMediaContent
(
mediaContent
)
}
</
div
>
);
}
};
renderMediaContent
=
(
mediaContent
)
=>
{
return
(
<
div
className=
"media"
>
{
_
.
map
(
mediaContent
,
(
mediaItem
,
mediaIndex
)
=>
{
let
dom
=
""
;
let
{
type
,
content
,
size
}
=
mediaItem
;
switch
(
type
)
{
case
"PICTURE"
:
dom
=
(
<
div
key=
{
mediaIndex
+
1
}
className=
"picture-box"
>
<
img
src=
{
content
}
onClick=
{
()
=>
this
.
handleScanFile
(
"JPG"
,
content
)
}
/>
</
div
>
);
break
;
case
"VOICE"
:
dom
=
(
<
div
key=
{
mediaIndex
+
1
}
className=
"voice-box"
>
<
XMAudio
forbidParse
url=
{
content
}
getDuration=
{
(
durationSize
)
=>
{
size
=
durationSize
;
this
.
setState
({});
}
}
index=
{
mediaIndex
+
1
}
size=
{
size
||
1000
}
/>
</
div
>
);
break
;
case
"AUDIO"
:
dom
=
(
<
div
key=
{
mediaIndex
}
className=
"voice-box"
>
<
XMAudio
forbidParse
url=
{
content
}
getDuration=
{
(
durationSize
)
=>
{
size
=
durationSize
;
this
.
setState
({});
}
}
index=
{
mediaIndex
}
size=
{
size
||
1000
}
/>
</
div
>
);
break
;
}
return
dom
;
})
}
</
div
>
);
};
render
()
{
const
{
paperInfo
}
=
this
.
state
;
const
{
paperName
,
questionList
}
=
paperInfo
;
return
(
<
div
>
<
Modal
className=
"paper-preview-modal"
visible=
{
true
}
title=
"试卷预览"
width=
{
560
}
centered=
{
true
}
footer=
{
null
}
onCancel=
{
this
.
props
.
close
}
>
<
h2
style=
{
{
textAlign
:
"center"
}
}
>
{
paperName
}
</
h2
>
<
div
className=
"question-list-box"
>
{
questionList
.
map
((
questionItem
,
questionIndex
)
=>
{
const
{
questionStemList
,
optionList
,
gapFillingAnswerList
,
questionType
,
score
,
}
=
questionItem
;
return
(
<
div
className=
"question-info-item"
>
{
this
.
renderStem
(
questionStemList
,
questionType
,
score
,
questionIndex
)
}
{
_
.
map
(
optionList
,
(
optionItem
,
optionIndex
)
=>
{
return
this
.
renderOption
(
optionItem
,
questionType
,
optionIndex
);
})
}
{
/* {this.renderAnswer(gapFillingAnswerList, questionType)} */
}
</
div
>
);
})
}
</
div
>
</
Modal
>
</
div
>
);
}
}
export
default
PaperPreviewModal
;
src/modules/teach-tool/examination-paper/modal/PaperPreviewModal.less
0 → 100644
View file @
6a844944
.paper-preview-modal {
.question-list-box {
.question-info-item {
margin-bottom: 16px;
.stem-line {
margin-bottom: 16px;
border-bottom: 1px solid #e8e8e8;
padding-bottom: 16px;
&__item {
font-size: 14px;
font-weight: 400;
color: #666666;
margin-bottom: 16px;
}
}
}
.text {
margin-bottom: 8px;
.input-box {
margin-bottom: 8px;
* {
display: inline;
}
.add-fill-line {
padding: 0 10px;
border-bottom: 1px solid !important;
margin: 0 4px;
text-align: center;
border: none;
width: 54px;
}
}
}
.media {
.picture-box {
width: 88px;
height: 88px;
border-radius: 4px;
overflow: hidden;
align-items: center;
justify-content: center;
margin-right: 12px;
position: relative;
display: inline-flex;
border: 1px solid #e8e8e8;
img {
max-width: 100%;
max-height: 100%;
border-radius: 4px;
vertical-align: middle;
width: auto;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.voice-box {
margin-bottom: 12px;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);
padding: 10px 20px;
width: 320px;
}
}
}
}
src/modules/teach-tool/examination-paper/modal/SelectQuestionModal.jsx
View file @
6a844944
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-29 10:52:26
* @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-0
3-31 19:15:49
* @LastEditTime: 2021-0
4-01 14:01:06
* @Description: 助学工具-新建试卷-选择题目弹窗
* @Description: 助学工具-新建试卷-选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -59,7 +59,7 @@ class SelectQuestionModal extends Component {
...
@@ -59,7 +59,7 @@ class SelectQuestionModal extends Component {
>
>
<
div
className=
"sider"
>
<
div
className=
"sider"
>
<
CourseCategorySiderTree
<
CourseCategorySiderTree
fromModule=
"
PAPER
_MODAL"
fromModule=
"
QUESTION
_MODAL"
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
/>
/>
</
div
>
</
div
>
...
...
src/modules/teach-tool/modal/NewEditCourseCategoryModal.jsx
View file @
6a844944
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-22 17:51:28
* @Date: 2021-02-22 17:51:28
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-0
3-31 18:33:23
* @LastEditTime: 2021-0
4-01 11:21:09
* @Description: 助学工具-新建编辑课程分类模态框
* @Description: 助学工具-新建编辑课程分类模态框
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
React
,
{
Component
}
from
"react"
;
import
React
,
{
Component
}
from
"react"
;
import
{
Modal
,
Form
,
Input
}
from
"antd"
;
import
{
Modal
,
Form
,
Input
}
from
"antd"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
class
NewEditCourseCategoryModal
extends
Component
{
class
NewEditCourseCategoryModal
extends
Component
{
formRef
=
React
.
createRef
();
formRef
=
React
.
createRef
();
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -34,9 +34,9 @@ class NewEditCourseCategoryModal extends Component {
...
@@ -34,9 +34,9 @@ class NewEditCourseCategoryModal extends Component {
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
};
};
QuestionBank
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
AidTool
Service
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
const
{
categoryList
=
[]
}
=
res
.
result
;
this
.
setState
({
treeData
:
resul
t
});
this
.
setState
({
treeData
:
categoryLis
t
});
});
});
};
};
...
@@ -61,7 +61,7 @@ class NewEditCourseCategoryModal extends Component {
...
@@ -61,7 +61,7 @@ class NewEditCourseCategoryModal extends Component {
}
}
try
{
try
{
await
this
.
formRef
.
current
.
validateFields
();
await
this
.
formRef
.
current
.
validateFields
();
QuestionBank
Service
.
addCategory
(
params
).
then
((
res
)
=>
{
AidTool
Service
.
addCategory
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
this
.
props
.
close
();
this
.
props
.
close
();
}
}
...
@@ -77,7 +77,7 @@ class NewEditCourseCategoryModal extends Component {
...
@@ -77,7 +77,7 @@ class NewEditCourseCategoryModal extends Component {
params
.
categoryName
=
categoryName
;
params
.
categoryName
=
categoryName
;
try
{
try
{
await
this
.
formRef
.
current
.
validateFields
();
await
this
.
formRef
.
current
.
validateFields
();
QuestionBank
Service
.
editCategory
(
params
).
then
((
res
)
=>
{
AidTool
Service
.
editCategory
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
this
.
props
.
close
();
this
.
props
.
close
();
}
}
...
@@ -132,7 +132,6 @@ class NewEditCourseCategoryModal extends Component {
...
@@ -132,7 +132,6 @@ class NewEditCourseCategoryModal extends Component {
nodes
.
push
(...
this
.
getChildLevelNodes
(
item
.
sonCategoryList
,
id
));
nodes
.
push
(...
this
.
getChildLevelNodes
(
item
.
sonCategoryList
,
id
));
}
}
});
});
console
.
log
(
nodes
)
return
nodes
;
return
nodes
;
};
};
...
...
src/modules/teach-tool/question-bank/AddNewQuestion.jsx
View file @
6a844944
...
@@ -17,7 +17,7 @@ import {
...
@@ -17,7 +17,7 @@ import {
defineOptionInfo
,
defineOptionInfo
,
defineQuestionInfo
,
defineQuestionInfo
,
}
from
"../components/model"
;
}
from
"../components/model"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
...
@@ -67,7 +67,7 @@ class AddNewQuestion extends Component {
...
@@ -67,7 +67,7 @@ class AddNewQuestion extends Component {
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
};
};
QuestionBank
Service
.
queryQuestionDetails
(
query
).
then
((
res
)
=>
{
AidTool
Service
.
queryQuestionDetails
(
query
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
const
{
result
=
[]
}
=
res
;
let
stemContent
=
_
.
find
(
let
stemContent
=
_
.
find
(
result
.
questionStemList
,
result
.
questionStemList
,
...
@@ -238,7 +238,7 @@ class AddNewQuestion extends Component {
...
@@ -238,7 +238,7 @@ class AddNewQuestion extends Component {
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
};
};
QuestionBank
Service
.
editQuestion
(
params
).
then
((
res
)
=>
{
AidTool
Service
.
editQuestion
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
"保存成功"
);
message
.
success
(
"保存成功"
);
if
(
next
===
"add"
)
{
if
(
next
===
"add"
)
{
...
@@ -259,7 +259,7 @@ class AddNewQuestion extends Component {
...
@@ -259,7 +259,7 @@ class AddNewQuestion extends Component {
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
};
};
QuestionBank
Service
.
addQuestion
(
params
).
then
((
res
)
=>
{
AidTool
Service
.
addQuestion
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
"保存成功"
);
message
.
success
(
"保存成功"
);
if
(
next
===
"add"
)
{
if
(
next
===
"add"
)
{
...
...
src/modules/teach-tool/question-bank/QuestionBankIndex.jsx
View file @
6a844944
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-02-21 17:51:01
* @Date: 2021-02-21 17:51:01
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-0
3-31 19:15:27
* @LastEditTime: 2021-0
4-01 14:10:41
* @Description: 助学工具-题库-题库主页面
* @Description: 助学工具-题库-题库主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
...
src/modules/teach-tool/question-bank/components/QuestionManageContent.jsx
View file @
6a844944
...
@@ -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-0
3-30 19:33:39
* @LastEditTime: 2021-0
4-01 13:47:54
* @Description: 助学工具-题库-列表数据
* @Description: 助学工具-题库-列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -23,7 +23,7 @@ import {
...
@@ -23,7 +23,7 @@ import {
import
{
PageControl
}
from
"@/components"
;
import
{
PageControl
}
from
"@/components"
;
import
"./QuestionManageContent.less"
;
import
"./QuestionManageContent.less"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
import
_
from
"underscore"
;
import
_
from
"underscore"
;
import
QuestionPreviewModal
from
"../modal/QuestionPreviewModal"
;
import
QuestionPreviewModal
from
"../modal/QuestionPreviewModal"
;
import
BatchImportQuestionModal
from
"../modal/BatchImportQuestionModal"
;
import
BatchImportQuestionModal
from
"../modal/BatchImportQuestionModal"
;
...
@@ -129,10 +129,9 @@ class QuestionManageContent extends Component {
...
@@ -129,10 +129,9 @@ class QuestionManageContent extends Component {
// 题库列表查询
// 题库列表查询
queryQuestionPageList
=
()
=>
{
queryQuestionPageList
=
()
=>
{
const
_query
=
this
.
state
.
query
;
const
_query
=
this
.
state
.
query
;
QuestionBank
Service
.
queryQuestionPageList
(
_query
).
then
((
res
)
=>
{
AidTool
Service
.
queryQuestionPageList
(
_query
).
then
((
res
)
=>
{
const
{
records
=
[],
total
=
0
}
=
res
.
result
;
const
{
records
=
[],
total
=
0
}
=
res
.
result
;
this
.
setState
({
dataSource
:
records
});
this
.
setState
({
dataSource
:
records
,
total
},
()
=>
this
.
setState
({
total
},
()
=>
this
.
props
.
updatedSiderTree
(
total
,
this
.
props
.
selectedCategoryId
)
this
.
props
.
updatedSiderTree
(
total
,
this
.
props
.
selectedCategoryId
)
);
);
});
});
...
@@ -360,7 +359,7 @@ class QuestionManageContent extends Component {
...
@@ -360,7 +359,7 @@ class QuestionManageContent extends Component {
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
};
};
QuestionBank
Service
.
deleteQuestion
(
params
).
then
((
res
)
=>
{
AidTool
Service
.
deleteQuestion
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
"删除成功"
);
message
.
success
(
"删除成功"
);
const
{
query
,
total
}
=
this
.
state
;
const
{
query
,
total
}
=
this
.
state
;
...
...
src/modules/teach-tool/question-bank/modal/BatchImportQuestionModal.jsx
View file @
6a844944
...
@@ -11,7 +11,7 @@ import { Modal, Button, message, Spin } from "antd";
...
@@ -11,7 +11,7 @@ import { Modal, Button, message, Spin } from "antd";
import
"./BatchImportQuestionModal.less"
;
import
"./BatchImportQuestionModal.less"
;
import
SelectPrepareFileModal
from
"@/modules/prepare-lesson/modal/SelectPrepareFileModal"
;
import
SelectPrepareFileModal
from
"@/modules/prepare-lesson/modal/SelectPrepareFileModal"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
import
{
LoadingOutlined
}
from
"@ant-design/icons"
;
import
{
LoadingOutlined
}
from
"@ant-design/icons"
;
class
BatchImportQuestionModal
extends
Component
{
class
BatchImportQuestionModal
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -66,7 +66,7 @@ class BatchImportQuestionModal extends Component {
...
@@ -66,7 +66,7 @@ class BatchImportQuestionModal extends Component {
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
};
};
const
res
=
await
QuestionBank
Service
.
batchImport
(
params
);
const
res
=
await
AidTool
Service
.
batchImport
(
params
);
const
{
result
}
=
res
;
const
{
result
}
=
res
;
const
{
bizSuccess
,
bizMessage
}
=
result
;
const
{
bizSuccess
,
bizMessage
}
=
result
;
if
(
res
)
{
if
(
res
)
{
...
...
src/modules/teach-tool/question-bank/modal/QuestionPreviewModal.jsx
View file @
6a844944
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-27 11:15:03
* @Date: 2021-03-27 11:15:03
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-0
3-29 16:19:35
* @LastEditTime: 2021-0
4-01 19:47:12
* @Description: 助学工具-题库-预览题目
* @Description: 助学工具-题库-预览题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
React
,
{
Component
}
from
"react"
;
import
React
,
{
Component
}
from
"react"
;
import
{
Modal
}
from
"antd"
;
import
{
Modal
}
from
"antd"
;
import
User
from
"@/common/js/user"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBank
Service"
;
import
AidToolService
from
"@/domains/aid-tool-domain/AidTool
Service"
;
import
"./QuestionPreviewModal.less"
;
import
"./QuestionPreviewModal.less"
;
import
ScanFileModal
from
"@/modules/resource-disk/modal/ScanFileModal"
;
import
ScanFileModal
from
"@/modules/resource-disk/modal/ScanFileModal"
;
import
_
from
"underscore"
;
import
_
from
"underscore"
;
...
@@ -44,7 +44,7 @@ class QuestionPreviewModal extends Component {
...
@@ -44,7 +44,7 @@ class QuestionPreviewModal extends Component {
userId
:
User
.
getStoreUserId
(),
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
tenantId
:
User
.
getStoreId
(),
};
};
QuestionBank
Service
.
queryQuestionDetails
(
query
).
then
((
res
)
=>
{
AidTool
Service
.
queryQuestionDetails
(
query
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
const
{
result
=
[]
}
=
res
;
this
.
setState
({
questionInfo
:
result
});
this
.
setState
({
questionInfo
:
result
});
});
});
...
...
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