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
4898b7f5
Commit
4898b7f5
authored
Mar 31, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:新建试卷联调
parent
3cfa93ca
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
71 additions
and
44 deletions
+71
-44
src/data-source/questionBank/request-apis.ts
+1
-5
src/domains/basic-domain/constants.ts
+2
-2
src/domains/question-bank-domain/QuestionBankService.ts
+2
-7
src/modules/teach-tool/components/CourseCategoryManage.jsx
+15
-11
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
+11
-8
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.jsx
+2
-2
src/modules/teach-tool/examination-paper/NewExaminationPaper.jsx
+0
-0
src/modules/teach-tool/examination-paper/NewExaminationPaper.less
+18
-1
src/modules/teach-tool/examination-paper/modal/SelectQuestionModal.jsx
+15
-5
src/modules/teach-tool/modal/NewEditCourseCategoryModal.jsx
+3
-1
src/modules/teach-tool/question-bank/QuestionBankIndex.jsx
+2
-2
No files found.
src/data-source/questionBank/request-apis.ts
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-03 15:13:12
* @LastEditors: yuananting
* @LastEditTime: 2021-03-
17 11:40:41
* @LastEditTime: 2021-03-
31 18:14:09
* @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -29,10 +29,6 @@ export function editCategoryTree(params: object) {
return
Service
.
Hades
(
"public/hades/editCategoryTree"
,
params
);
}
export
function
queryQuestionCategoryTree
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/queryQuestionCategoryTree"
,
params
);
}
export
function
queryQuestionPageList
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/queryQuestionPageList"
,
params
);
}
...
...
src/domains/basic-domain/constants.ts
View file @
4898b7f5
/*
* @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01
* @LastEditTime: 2021-03-
27 14:25:54
* @LastEditTime: 2021-03-
31 18:26:22
* @LastEditors: yuananting
* @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
...
...
@@ -9,7 +9,7 @@
import
{
MapInterface
}
from
'@/domains/basic-domain/interface'
// 默认是 dev 环境
const
ENV
:
string
=
process
.
env
.
DEPLOY_ENV
||
'dev'
;
const
ENV
:
string
=
process
.
env
.
DEPLOY_ENV
||
'dev
1
'
;
console
.
log
(
"process.env.DEPLOY_ENV"
,
process
)
const
BASIC_HOST_MAP
:
MapInterface
=
{
dev
:
'https://dev-heimdall.xiaomai5.com/'
,
...
...
src/domains/question-bank-domain/QuestionBankService.ts
View file @
4898b7f5
...
...
@@ -2,11 +2,11 @@
* @Author: yuananting
* @Date: 2021-03-11 11:34:37
* @LastEditors: yuananting
* @LastEditTime: 2021-03-
16 15:12:09
* @LastEditTime: 2021-03-
31 18:14:42
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
queryCategoryTree
,
addCategory
,
delCategory
,
editCategory
,
editCategoryTree
,
queryQuestionCategoryTree
,
addQuestion
,
queryQuestionPageList
,
deleteQuestion
,
queryQuestionDetails
,
editQuestion
,
batchImport
}
from
'@/data-source/questionBank/request-apis'
;
import
{
queryCategoryTree
,
addCategory
,
delCategory
,
editCategory
,
editCategoryTree
,
addQuestion
,
queryQuestionPageList
,
deleteQuestion
,
queryQuestionDetails
,
editQuestion
,
batchImport
}
from
'@/data-source/questionBank/request-apis'
;
export
default
class
QuestionBankService
{
// 获取题目分类树
static
queryCategoryTree
(
params
:
any
)
{
...
...
@@ -33,11 +33,6 @@ export default class QuestionBankService {
return
editCategoryTree
(
params
);
}
// 查询分类树列表
static
queryQuestionCategoryTree
(
params
:
any
)
{
return
queryQuestionCategoryTree
(
params
);
}
// 查询题目列表
static
queryQuestionPageList
(
params
:
any
)
{
return
queryQuestionPageList
(
params
);
...
...
src/modules/teach-tool/components/CourseCategoryManage.jsx
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-23 18:28:50
* @LastEditors: yuananting
* @LastEditTime: 2021-03-3
0 14:25:47
* @LastEditTime: 2021-03-3
1 18:36:34
* @Description: 助学工具-课程分类
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -45,20 +45,22 @@ class CourseCategoryManage extends Component {
getWholeTree
=
()
=>
{
let
query
=
{
bizType
:
"QUESTION"
,
count
:
false
,
source
:
0
,
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
};
QuestionBankService
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
result
}
=
res
;
this
.
setState
({
originTreeData
:
resul
t
},
()
=>
{
const
{
categoryList
=
[]
}
=
res
.
result
;
this
.
setState
({
originTreeData
:
categoryLis
t
},
()
=>
{
let
map
=
{};
let
topItem
=
[];
resul
t
.
forEach
((
item
)
=>
{
categoryLis
t
.
forEach
((
item
)
=>
{
topItem
.
push
(
item
);
});
this
.
setState
({
treeMap
:
Object
.
assign
(
this
.
getTreeMap
(
resul
t
,
map
),
{
treeMap
:
Object
.
assign
(
this
.
getTreeMap
(
categoryLis
t
,
map
),
{
0
:
{
sonCategoryList
:
topItem
,
},
...
...
@@ -73,19 +75,21 @@ class CourseCategoryManage extends Component {
this
.
getWholeTree
();
this
.
setState
({
categoryName
});
let
query
=
{
bizType
:
"QUESTION"
,
count
:
false
,
source
:
0
,
categoryName
,
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
};
QuestionBankService
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
const
{
categoryList
=
[]
}
=
res
.
result
;
let
str
=
"未分类"
;
if
(
categoryName
)
{
this
.
setState
({
autoExpandParent
:
true
});
if
(
str
.
indexOf
(
categoryName
)
<
0
)
{
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
resul
t
,
categoryName
),
treeData
:
this
.
renderTreeNodes
(
categoryLis
t
,
categoryName
),
});
let
nodeId
=
[];
Object
.
keys
(
this
.
state
.
treeMap
).
forEach
((
item
)
=>
{
...
...
@@ -100,9 +104,9 @@ class CourseCategoryManage extends Component {
parentId
:
"0"
,
categoryLevel
:
0
,
};
resul
t
.
unshift
(
defaultNode
);
categoryLis
t
.
unshift
(
defaultNode
);
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
resul
t
,
categoryName
),
treeData
:
this
.
renderTreeNodes
(
categoryLis
t
,
categoryName
),
});
let
nodeId
=
[];
Object
.
keys
(
this
.
state
.
treeMap
).
forEach
((
item
)
=>
{
...
...
@@ -121,8 +125,8 @@ class CourseCategoryManage extends Component {
parentId
:
"0"
,
categoryLevel
:
0
,
};
resul
t
.
unshift
(
defaultNode
);
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
resul
t
,
categoryName
)
});
categoryLis
t
.
unshift
(
defaultNode
);
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
categoryLis
t
,
categoryName
)
});
if
(
operateType
===
"search"
)
{
this
.
setState
({
expandedKeys
:
[]
});
}
...
...
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting
* @LastEditTime: 2021-03-3
0 16:40:58
* @LastEditTime: 2021-03-3
1 19:23:40
* @Description: 助学工具-课程分类侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -20,7 +20,7 @@ class CourseCategorySiderTree extends Component {
super
(
props
);
this
.
state
=
{
selectedKeys
:
props
.
fromModule
===
"
index
"
props
.
fromModule
===
"
QUESTION_INDEX
"
?
[
getParameterByName
(
"categoryId"
)
||
"null"
]
:
[
"null"
],
treeData
:
props
.
treeData
||
[],
...
...
@@ -31,7 +31,7 @@ class CourseCategorySiderTree extends Component {
componentDidMount
()
{
this
.
queryCategoryTree
(
"change"
);
this
.
props
.
getSelectedCategoryId
(
this
.
props
.
fromModule
===
"
index
"
this
.
props
.
fromModule
===
"
QUESTION_INDEX
"
?
[
getParameterByName
(
"categoryId"
)
||
"null"
]
:
[
"null"
]
);
...
...
@@ -40,7 +40,7 @@ class CourseCategorySiderTree extends Component {
shouldComponentUpdate
(
nextProps
,
nextState
)
{
const
{
currentTotal
,
updatedCategoryId
}
=
nextProps
;
if
(
this
.
props
.
fromModule
===
"
index
"
&&
this
.
props
.
fromModule
===
"
QUESTION_INDEX
"
&&
this
.
props
.
currentTotal
!==
currentTotal
&&
this
.
props
.
updatedCategoryId
===
updatedCategoryId
)
{
...
...
@@ -52,12 +52,14 @@ class CourseCategorySiderTree extends Component {
// 查询分类树
queryCategoryTree
=
(
type
,
categoryName
)
=>
{
let
query
=
{
source
:
0
,
bizType
:
[
"QUESTION_INDEX"
,
"QUESTION_MODAL"
].
includes
(
this
.
props
.
fromModule
)
?
"QUESTION"
:
"PAPER"
,
categoryName
,
count
:
true
,
source
:
0
,
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
};
QuestionBankService
.
query
Question
CategoryTree
(
query
).
then
((
res
)
=>
{
QuestionBankService
.
queryCategoryTree
(
query
).
then
((
res
)
=>
{
const
{
categoryList
=
[],
noCategoryCnt
=
0
}
=
res
.
result
;
let
str
=
"未分类"
;
if
(
categoryName
)
{
...
...
@@ -195,9 +197,10 @@ class CourseCategorySiderTree extends Component {
selectedKeys
,
autoExpandParent
,
}
=
this
.
state
;
return
(
<
div
className=
"category-tree-sider"
>
<
div
className=
"sider-title"
>
题目分类
</
div
>
{
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
<
div
className=
"sider-title"
>
{
this
.
props
.
fromModule
===
"QUESTION_INDEX"
?
"题目分类"
:
"试卷分类"
}
</
div
>
}
<
Search
className=
"sider-search"
placeholder=
"搜索名称分类"
...
...
@@ -206,7 +209,7 @@ class CourseCategorySiderTree extends Component {
}
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
/>
{
this
.
props
.
fromModule
===
"index"
&&
User
.
getUserRole
()
!==
"CloudLecturer"
&&
(
{
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
User
.
getUserRole
()
!==
"CloudLecturer"
&&
(
<
div
className=
"sider-btn"
>
<
Button
onClick=
{
()
=>
{
...
...
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.jsx
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-27 14:55:14
* @LastEditors: yuananting
* @LastEditTime: 2021-03-3
0 16:08:38
* @LastEditTime: 2021-03-3
1 19:14:46
* @Description: 助学工具-试卷主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -37,7 +37,7 @@ class ExaminationPaperIndex extends Component {
>
<
div
className=
"sider"
>
<
CourseCategorySiderTree
fromModule=
"
index
"
fromModule=
"
PAPER_INDEX
"
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
currentTotal=
{
this
.
state
.
currentTotal
}
updatedCategoryId=
{
this
.
state
.
updatedCategoryId
}
...
...
src/modules/teach-tool/examination-paper/NewExaminationPaper.jsx
View file @
4898b7f5
This diff is collapsed.
Click to expand it.
src/modules/teach-tool/examination-paper/NewExaminationPaper.less
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-25 13:52:01
* @LastEditors: yuananting
* @LastEditTime: 2021-03-3
0 19:34:05
* @LastEditTime: 2021-03-3
1 16:06:32
* @Description: 助学工具-新建试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -13,6 +13,23 @@
.ant-tabs {
color: #666666;
}
.record-operate {
display: flex;
&__item {
color: #5289fa;
cursor: pointer;
&.split {
margin: 0 8px;
color: #bfbfbf;
}
}
&__ban {
color: gray;
pointer-events: none;
}
}
}
.footer {
...
...
src/modules/teach-tool/examination-paper/modal/SelectQuestionModal.jsx
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting
* @LastEditTime: 2021-03-3
0 19:17:30
* @LastEditTime: 2021-03-3
1 19:15:49
* @Description: 助学工具-新建试卷-选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -34,11 +34,22 @@ class SelectQuestionModal extends Component {
title=
"选择题目"
visible=
{
true
}
width=
{
1200
}
onOk=
{
()
=>
onOk=
{
()
=>
{
this
.
props
.
setSelectedQuestion
(
this
.
listRef
.
current
.
state
.
selectQuestionKeys
this
.
listRef
.
current
.
state
.
selectQuestionKeys
.
map
((
item
)
=>
{
item
.
questionType
=
item
.
questionTypeEnum
;
item
.
score
=
2
;
if
(
[
"MULTI_CHOICE"
,
"GAP_FILLING"
,
"INDEFINITE_CHOICE"
].
includes
(
item
.
questionTypeEnum
)
)
{
item
.
portionScore
=
0
;
}
return
item
;
})
);
}
}
onCancel=
{
this
.
props
.
close
}
className=
"select-question-modal"
>
...
...
@@ -48,14 +59,13 @@ class SelectQuestionModal extends Component {
>
<
div
className=
"sider"
>
<
CourseCategorySiderTree
fromModule=
"
modal
"
fromModule=
"
PAPER_MODAL
"
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
/>
</
div
>
</
div
>
<
div
className=
"content"
>
<
SelectQuestionContent
fromModule=
"modal"
ref=
{
this
.
listRef
}
selectedCategoryId=
{
this
.
state
.
selectedCategoryId
}
/>
...
...
src/modules/teach-tool/modal/NewEditCourseCategoryModal.jsx
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-22 17:51:28
* @LastEditors: yuananting
* @LastEditTime: 2021-03-
29 19:37:0
3
* @LastEditTime: 2021-03-
31 18:33:2
3
* @Description: 助学工具-新建编辑课程分类模态框
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -28,6 +28,8 @@ class NewEditCourseCategoryModal extends Component {
// 查询分类树
queryCategoryTree
=
()
=>
{
let
query
=
{
bizType
:
"QUESTION"
,
count
:
false
,
source
:
0
,
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
...
...
src/modules/teach-tool/question-bank/QuestionBankIndex.jsx
View file @
4898b7f5
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-21 17:51:01
* @LastEditors: yuananting
* @LastEditTime: 2021-03-3
0 16:08:58
* @LastEditTime: 2021-03-3
1 19:15:27
* @Description: 助学工具-题库-题库主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -37,7 +37,7 @@ class QuestionBankIndex extends Component {
>
<
div
className=
"sider"
>
<
CourseCategorySiderTree
fromModule=
"
index
"
fromModule=
"
QUESTION_INDEX
"
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
currentTotal=
{
this
.
state
.
currentTotal
}
updatedCategoryId=
{
this
.
state
.
updatedCategoryId
}
...
...
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