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
ab61605c
Commit
ab61605c
authored
Apr 13, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:未选题校验,接口替换
parent
3c1b158e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
50 deletions
+62
-50
src/data-source/aidTool/request-apis.ts
+6
-1
src/domains/aid-tool-domain/AidToolService.ts
+8
-1
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
+2
-2
src/modules/teach-tool/paper-manage/OperatePaper.jsx
+33
-33
src/modules/teach-tool/paper-manage/components/SelectQuestionList.jsx
+13
-13
No files found.
src/data-source/aidTool/request-apis.ts
View file @
ab61605c
...
@@ -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-04-
06 10:44:47
* @LastEditTime: 2021-04-
13 13:58:40
* @Description: 助学工具接口
* @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -80,3 +80,7 @@ export function editPaper(params: object) {
...
@@ -80,3 +80,7 @@ export function editPaper(params: object) {
export
function
batchQueryQuestionDetails
(
params
:
object
)
{
export
function
batchQueryQuestionDetails
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/batchQueryQuestionDetails"
,
params
);
return
Service
.
Hades
(
"public/hades/batchQueryQuestionDetails"
,
params
);
}
}
export
function
queryQuestionPageListWithContent
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/queryQuestionPageListWithContent"
,
params
);
}
\ No newline at end of file
src/domains/aid-tool-domain/AidToolService.ts
View file @
ab61605c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-11 11:34:37
* @Date: 2021-03-11 11:34:37
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-04-
06 10:44:18
* @LastEditTime: 2021-04-
13 13:58:11
* @Description: 助学工具接口
* @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -25,6 +25,7 @@ import {
...
@@ -25,6 +25,7 @@ import {
viewPaper
,
viewPaper
,
editPaper
,
editPaper
,
batchQueryQuestionDetails
,
batchQueryQuestionDetails
,
queryQuestionPageListWithContent
,
}
from
'@/data-source/aidTool/request-apis'
;
}
from
'@/data-source/aidTool/request-apis'
;
export
default
class
AidToolService
{
export
default
class
AidToolService
{
// 获取题目分类树
// 获取题目分类树
...
@@ -116,4 +117,9 @@ export default class AidToolService {
...
@@ -116,4 +117,9 @@ export default class AidToolService {
static
batchQueryQuestionDetails
(
params
:
any
)
{
static
batchQueryQuestionDetails
(
params
:
any
)
{
return
batchQueryQuestionDetails
(
params
);
return
batchQueryQuestionDetails
(
params
);
}
}
// 操作试卷-选择题目列表带题目详情
static
queryQuestionPageListWithContent
(
params
:
any
)
{
return
queryQuestionPageListWithContent
(
params
);
}
}
}
\ No newline at end of file
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
View file @
ab61605c
...
@@ -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-04-1
0 15:36:29
* @LastEditTime: 2021-04-1
3 13:55:37
* @Description: 助学工具-侧边课程分类树
* @Description: 助学工具-侧边课程分类树
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -129,7 +129,7 @@ class CourseCategorySiderTree extends Component {
...
@@ -129,7 +129,7 @@ class CourseCategorySiderTree extends Component {
if
(
this
.
props
.
fromModule
===
"QUESTION_INDEX"
)
{
if
(
this
.
props
.
fromModule
===
"QUESTION_INDEX"
)
{
Bus
.
trigger
(
"queryQuestionPageList"
,
selectedKeys
[
0
]);
Bus
.
trigger
(
"queryQuestionPageList"
,
selectedKeys
[
0
]);
}
else
if
(
this
.
props
.
fromModule
===
"QUESTION_MODAL"
)
{
}
else
if
(
this
.
props
.
fromModule
===
"QUESTION_MODAL"
)
{
Bus
.
trigger
(
"queryQuestion
ModalLis
t"
,
selectedKeys
[
0
]);
Bus
.
trigger
(
"queryQuestion
PageListWithConten
t"
,
selectedKeys
[
0
]);
}
else
{
}
else
{
Bus
.
trigger
(
"queryPaperPageList"
,
selectedKeys
[
0
],
0
);
Bus
.
trigger
(
"queryPaperPageList"
,
selectedKeys
[
0
],
0
);
}
}
...
...
src/modules/teach-tool/paper-manage/OperatePaper.jsx
View file @
ab61605c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Author: yuananting
* @Date: 2021-03-27 16:15:13
* @Date: 2021-03-27 16:15:13
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-04-1
2 20:15:51
* @LastEditTime: 2021-04-1
3 15:12:49
* @Description: 助学工具-新建/复制/编辑试卷
* @Description: 助学工具-新建/复制/编辑试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -300,6 +300,9 @@ class OperatePaper extends Component {
...
@@ -300,6 +300,9 @@ class OperatePaper extends Component {
const
{
selectQuestionList
,
formData
,
currentOperate
}
=
this
.
state
;
const
{
selectQuestionList
,
formData
,
currentOperate
}
=
this
.
state
;
const
categoryId
=
getParameterByName
(
"categoryId"
);
const
categoryId
=
getParameterByName
(
"categoryId"
);
let
questionList
=
[];
let
questionList
=
[];
if
(
selectQuestionList
.
length
===
0
)
{
return
message
.
warning
(
"请选择题目"
);
}
selectQuestionList
.
forEach
((
item
,
index
)
=>
{
selectQuestionList
.
forEach
((
item
,
index
)
=>
{
questionList
.
push
({
questionList
.
push
({
categoryId
:
item
.
categoryId
,
categoryId
:
item
.
categoryId
,
...
@@ -319,7 +322,8 @@ class OperatePaper extends Component {
...
@@ -319,7 +322,8 @@ class OperatePaper extends Component {
},
},
()
=>
{
()
=>
{
if
([
"new"
,
"copy"
].
includes
(
currentOperate
))
{
if
([
"new"
,
"copy"
].
includes
(
currentOperate
))
{
AidToolService
.
createPaper
(
this
.
state
.
formData
).
then
((
res
)
=>
{
AidToolService
.
createPaper
(
this
.
state
.
formData
)
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
message
.
success
(
currentOperate
===
"new"
?
"新建成功"
:
"复制成功"
currentOperate
===
"new"
?
"新建成功"
:
"复制成功"
...
@@ -327,34 +331,53 @@ class OperatePaper extends Component {
...
@@ -327,34 +331,53 @@ class OperatePaper extends Component {
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
});
});
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
}
}
}).
catch
((
e
)
=>
{
})
.
catch
((
e
)
=>
{
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
});
});
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
});
});
}
else
if
(
currentOperate
===
"edit"
)
{
}
else
if
(
currentOperate
===
"edit"
)
{
AidToolService
.
editPaper
({
AidToolService
.
editPaper
({
...
this
.
state
.
formData
,
...
this
.
state
.
formData
,
paperId
:
getParameterByName
(
"paperId"
),
paperId
:
getParameterByName
(
"paperId"
),
}).
then
((
res
)
=>
{
})
.
then
((
res
)
=>
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
message
.
success
(
"编辑成功"
);
message
.
success
(
"编辑成功"
);
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
});
});
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
}
}
}).
catch
((
e
)
=>
{
})
.
catch
((
e
)
=>
{
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
pathname
:
`/paper-manage-index?categoryId=
${
categoryId
}
`
,
});
});
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryPaperPageList"
,
categoryId
,
selectQuestionList
.
length
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
Bus
.
trigger
(
"queryCategoryTree"
,
"remain"
);
});
});
}
}
...
@@ -368,32 +391,10 @@ class OperatePaper extends Component {
...
@@ -368,32 +391,10 @@ class OperatePaper extends Component {
// 预览试卷
// 预览试卷
previewPaper
=
()
=>
{
previewPaper
=
()
=>
{
const
{
selectQuestionList
,
formData
}
=
this
.
state
;
const
{
selectQuestionList
,
formData
}
=
this
.
state
;
const
questionIdList
=
selectQuestionList
.
map
((
item
)
=>
{
return
item
.
questionId
;
});
let
param
=
{
questionIdList
,
source
:
0
,
userId
:
User
.
getStoreUserId
(),
tenantId
:
User
.
getStoreId
(),
};
AidToolService
.
batchQueryQuestionDetails
(
param
).
then
((
res
)
=>
{
const
{
result
=
[]
}
=
res
;
result
.
map
((
item
)
=>
{
selectQuestionList
.
map
((
selectItem
)
=>
{
if
(
item
.
id
===
selectItem
.
questionId
)
{
item
.
questionId
=
item
.
id
;
item
.
questionType
=
item
.
questionTypeEnum
;
item
.
score
=
selectItem
.
score
||
2
;
item
.
portionScore
=
selectItem
.
portionScore
||
0
;
}
});
return
item
;
});
const
m
=
(
const
m
=
(
<
PaperPreviewModal
<
PaperPreviewModal
previewPage=
"paper-operate"
previewPage=
"paper-operate"
paperInfo=
{
{
...
formData
,
questionList
:
res
.
resul
t
}
}
paperInfo=
{
{
...
formData
,
questionList
:
selectQuestionLis
t
}
}
close=
{
()
=>
{
close=
{
()
=>
{
this
.
setState
({
this
.
setState
({
paperPreviewModal
:
null
,
paperPreviewModal
:
null
,
...
@@ -402,7 +403,6 @@ class OperatePaper extends Component {
...
@@ -402,7 +403,6 @@ class OperatePaper extends Component {
/>
/>
);
);
this
.
setState
({
paperPreviewModal
:
m
});
this
.
setState
({
paperPreviewModal
:
m
});
});
};
};
// 取消/返回
// 取消/返回
...
...
src/modules/teach-tool/paper-manage/components/SelectQuestionList.jsx
View file @
ab61605c
...
@@ -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-04-1
2 14:13:39
* @LastEditTime: 2021-04-1
3 13:56:05
* @Description: 助学工具-新建试卷-选择题目列表
* @Description: 助学工具-新建试卷-选择题目列表
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -78,15 +78,15 @@ class SelectQuestionList extends Component {
...
@@ -78,15 +78,15 @@ class SelectQuestionList extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
queryQuestion
ModalLis
t
()
this
.
queryQuestion
PageListWithConten
t
()
Bus
.
bind
(
'queryQuestion
ModalLis
t'
,
(
selectedCategoryId
)
=>
{
Bus
.
bind
(
'queryQuestion
PageListWithConten
t'
,
(
selectedCategoryId
)
=>
{
selectedCategoryId
=
selectedCategoryId
===
"null"
?
null
:
selectedCategoryId
;
selectedCategoryId
=
selectedCategoryId
===
"null"
?
null
:
selectedCategoryId
;
this
.
InitSearch
(
selectedCategoryId
)
this
.
InitSearch
(
selectedCategoryId
)
})
})
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
Bus
.
unbind
(
'queryQuestion
ModalList'
,
this
.
queryQuestionModalLis
t
)
Bus
.
unbind
(
'queryQuestion
PageListWithContent'
,
this
.
queryQuestionPageListWithConten
t
)
}
}
// 初始化列表查询
// 初始化列表查询
...
@@ -100,7 +100,7 @@ class SelectQuestionList extends Component {
...
@@ -100,7 +100,7 @@ class SelectQuestionList extends Component {
questionType
:
null
,
// 题目类型
questionType
:
null
,
// 题目类型
};
};
this
.
setState
({
query
:
_query
},
()
=>
{
this
.
setState
({
query
:
_query
},
()
=>
{
this
.
queryQuestion
ModalLis
t
();
this
.
queryQuestion
PageListWithConten
t
();
});
});
};
};
...
@@ -117,11 +117,11 @@ class SelectQuestionList extends Component {
...
@@ -117,11 +117,11 @@ class SelectQuestionList extends Component {
const
_query
=
this
.
state
.
query
;
const
_query
=
this
.
state
.
query
;
_query
.
order
=
sort
;
_query
.
order
=
sort
;
_query
.
current
=
1
;
_query
.
current
=
1
;
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestion
ModalLis
t
());
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestion
PageListWithConten
t
());
};
};
queryQuestion
ModalLis
t
=
()
=>
{
queryQuestion
PageListWithConten
t
=
()
=>
{
AidToolService
.
queryQuestionPageList
(
this
.
state
.
query
).
then
((
res
)
=>
{
AidToolService
.
queryQuestionPageList
WithContent
(
this
.
state
.
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
});
});
});
...
@@ -137,7 +137,7 @@ class SelectQuestionList extends Component {
...
@@ -137,7 +137,7 @@ class SelectQuestionList extends Component {
questionType
:
null
,
// 题目类型
questionType
:
null
,
// 题目类型
};
};
this
.
setState
({
query
:
_query
},
()
=>
{
this
.
setState
({
query
:
_query
},
()
=>
{
this
.
queryQuestion
ModalLis
t
();
this
.
queryQuestion
PageListWithConten
t
();
});
});
};
};
...
@@ -211,7 +211,7 @@ class SelectQuestionList extends Component {
...
@@ -211,7 +211,7 @@ class SelectQuestionList extends Component {
}
}
let
_query
=
this
.
state
.
query
;
let
_query
=
this
.
state
.
query
;
_query
.
size
=
size
;
_query
.
size
=
size
;
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestion
ModalLis
t
());
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestion
PageListWithConten
t
());
};
};
// 改变搜索条件
// 改变搜索条件
...
@@ -226,7 +226,7 @@ class SelectQuestionList extends Component {
...
@@ -226,7 +226,7 @@ class SelectQuestionList extends Component {
},
},
()
=>
{
()
=>
{
if
(
searchType
===
"questionName"
)
return
;
if
(
searchType
===
"questionName"
)
return
;
this
.
queryQuestion
ModalLis
t
();
this
.
queryQuestion
PageListWithConten
t
();
}
}
);
);
};
};
...
@@ -329,7 +329,7 @@ class SelectQuestionList extends Component {
...
@@ -329,7 +329,7 @@ class SelectQuestionList extends Component {
this
.
handleChangeQuery
(
"questionName"
,
e
.
target
.
value
);
this
.
handleChangeQuery
(
"questionName"
,
e
.
target
.
value
);
}
}
}
}
onSearch=
{
()
=>
{
onSearch=
{
()
=>
{
this
.
queryQuestion
ModalLis
t
();
this
.
queryQuestion
PageListWithConten
t
();
}
}
}
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
/>
/>
...
@@ -417,7 +417,7 @@ class SelectQuestionList extends Component {
...
@@ -417,7 +417,7 @@ class SelectQuestionList 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
.
queryQuestion
ModalLis
t
()
this
.
queryQuestion
PageListWithConten
t
()
);
);
}
}
}
}
showSizeChanger=
{
true
}
showSizeChanger=
{
true
}
...
...
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