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
8bde2114
Commit
8bde2114
authored
Apr 02, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'feat:试卷改造'
parent
a24eaa07
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
143 additions
and
53 deletions
+143
-53
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
+1
-1
src/modules/teach-tool/examination-manager/AddExam.tsx
+2
-2
src/modules/teach-tool/examination-manager/SelectPaperModal.tsx
+10
-4
src/modules/teach-tool/examination-paper/ExaminationPaperContent.jsx
+62
-0
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.jsx
+2
-29
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.less
+2
-3
src/modules/teach-tool/examination-paper/components/ExaminationPaperContent.jsx
+50
-14
src/modules/teach-tool/examination-paper/components/ExaminationPaperContent.less
+14
-0
No files found.
src/modules/teach-tool/components/CourseCategorySiderTree.jsx
View file @
8bde2114
...
...
@@ -219,7 +219,7 @@ class CourseCategorySiderTree extends Component {
enterButton=
{
<
span
className=
"icon iconfont"
>

</
span
>
}
/>
{
[
"QUESTION_INDEX"
,
"PAPER_INDEX"
].
includes
(
this
.
props
.
fromModule
)
&&
User
.
getUserRole
()
!==
"CloudLecturer"
&&
(
User
.
getUserRole
()
!==
"CloudLecturer"
&&
(
this
.
props
.
type
!==
'modal-select'
)
&&
(
<
div
className=
"sider-btn"
>
<
Button
onClick=
{
()
=>
{
...
...
src/modules/teach-tool/examination-manager/AddExam.tsx
View file @
8bde2114
...
...
@@ -26,7 +26,7 @@ function AddExam(props: any) {
</
Form
.
Item
>
<
Form
.
Item
label=
"选择试卷"
name=
"size"
required
>
<
Button
onClick=
{
()
=>
{
setShowModal
(
true
)
}
}
>
选择试卷
</
Button
>
<
Button
onClick=
{
()
=>
{
setShowModal
(
true
)
}
}
>
选择试卷
</
Button
>
</
Form
.
Item
>
...
...
@@ -36,7 +36,7 @@ function AddExam(props: any) {
</
div
>
{
showModal
&&
<
SelectPaperModal
></
SelectPaperModal
>
showModal
&&
<
SelectPaperModal
close=
{
()
=>
{
setShowModal
(
false
)
}
}
></
SelectPaperModal
>
}
</
div
>
...
...
src/modules/teach-tool/examination-manager/SelectPaperModal.tsx
View file @
8bde2114
import
React
,
{
useState
,
useRef
,
useEffect
,
useContext
}
from
'react'
import
{
Modal
}
from
'antd'
;
import
{
withRouter
}
from
'react-router-dom'
;
import
ExaminationPaper
Index
from
'../examination-paper/ExaminationPaperIndex
'
import
ExaminationPaper
Content
from
'../examination-paper/ExaminationPaperContent
'
import
'./AddExam.less'
;
function
SelectPaperModal
(
props
:
any
)
{
const
[
item
,
setItem
]
=
useState
({
paperId
:
''
});
useEffect
(()
=>
{
console
.
log
(
item
)
},
[
item
])
return
<
Modal
width=
{
8
00
}
width=
{
9
00
}
title=
"选择试卷"
visible=
{
true
}
onOk=
{
()
=>
{
}
}
onCancel=
{
()
=>
{
}
}
onCancel=
{
()
=>
{
props
.
close
()
}
}
>
<
ExaminationPaper
Index
></
ExaminationPaperIndex
>
<
ExaminationPaper
Content
paperId=
{
item
.
paperId
}
onSelect=
{
(
item
:
any
)
=>
{
setItem
(
item
)
}
}
type=
'modal-select'
></
ExaminationPaperContent
>
</
Modal
>
}
...
...
src/modules/teach-tool/examination-paper/ExaminationPaperContent.jsx
0 → 100644
View file @
8bde2114
/*
* @Author: yuananting
* @Date: 2021-03-27 14:55:14
* @LastEditors: yuananting
* @LastEditTime: 2021-04-01 14:00:47
* @Description: 助学工具-试卷主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
React
,
{
Component
}
from
"react"
;
import
"./ExaminationPaperIndex.less"
;
import
CourseCategorySiderTree
from
"../components/CourseCategorySiderTree"
;
import
ExaminationPaperContent
from
"./components/ExaminationPaperContent"
;
class
ExaminationPaperIndex
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{};
}
getCategoryIdFromSider
=
(
selectedCategoryId
)
=>
{
if
(
selectedCategoryId
&&
selectedCategoryId
.
length
>
0
)
{
this
.
setState
({
selectedCategoryId
:
selectedCategoryId
[
0
]
});
}
};
updatedSiderTreeFromList
=
(
currentTotal
,
updatedCategoryId
)
=>
{
this
.
setState
({
currentTotal
,
updatedCategoryId
});
};
render
()
{
return
(
<
div
className=
'examination-paper-content'
>
<
div
style=
{
{
borderRight
:
"0.5px solid #EEEEEE"
,
paddingRight
:
"4px"
}
}
>
<
div
className=
"sider"
>
<
CourseCategorySiderTree
type=
{
this
.
props
.
type
}
fromModule=
"PAPER_INDEX"
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
currentTotal=
{
this
.
state
.
currentTotal
}
updatedCategoryId=
{
this
.
state
.
updatedCategoryId
}
/>
</
div
>
</
div
>
<
div
className=
"content"
>
<
ExaminationPaperContent
paperId=
{
this
.
props
.
paperId
}
onSelect=
{
this
.
props
.
onSelect
}
type=
{
this
.
props
.
type
}
updatedSiderTree=
{
this
.
updatedSiderTreeFromList
.
bind
(
this
)
}
selectedCategoryId=
{
this
.
state
.
selectedCategoryId
}
/>
</
div
>
</
div
>
);
}
}
export
default
ExaminationPaperIndex
;
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.jsx
View file @
8bde2114
...
...
@@ -8,8 +8,7 @@
*/
import
React
,
{
Component
}
from
"react"
;
import
"./ExaminationPaperIndex.less"
;
import
CourseCategorySiderTree
from
"../components/CourseCategorySiderTree"
;
import
ExaminationPaperContent
from
"./components/ExaminationPaperContent"
;
import
ExaminationPaperContent
from
"./ExaminationPaperContent"
;
class
ExaminationPaperIndex
extends
Component
{
constructor
(
props
)
{
...
...
@@ -17,39 +16,13 @@ class ExaminationPaperIndex extends Component {
this
.
state
=
{};
}
getCategoryIdFromSider
=
(
selectedCategoryId
)
=>
{
if
(
selectedCategoryId
&&
selectedCategoryId
.
length
>
0
)
{
this
.
setState
({
selectedCategoryId
:
selectedCategoryId
[
0
]
});
}
};
updatedSiderTreeFromList
=
(
currentTotal
,
updatedCategoryId
)
=>
{
this
.
setState
({
currentTotal
,
updatedCategoryId
});
};
render
()
{
return
(
<
div
className=
"examination-paper-index page"
>
<
div
className=
"content-header"
>
试卷
</
div
>
<
div
className=
"box content-body"
>
<
div
style=
{
{
borderRight
:
"0.5px solid #EEEEEE"
,
paddingRight
:
"4px"
}
}
>
<
div
className=
"sider"
>
<
CourseCategorySiderTree
fromModule=
"PAPER_INDEX"
getSelectedCategoryId=
{
this
.
getCategoryIdFromSider
.
bind
(
this
)
}
currentTotal=
{
this
.
state
.
currentTotal
}
updatedCategoryId=
{
this
.
state
.
updatedCategoryId
}
/>
</
div
>
</
div
>
<
div
className=
"content"
>
<
ExaminationPaperContent
updatedSiderTree=
{
this
.
updatedSiderTreeFromList
.
bind
(
this
)
}
selectedCategoryId=
{
this
.
state
.
selectedCategoryId
}
/>
</
div
>
<
ExaminationPaperContent
type=
''
></
ExaminationPaperContent
>
</
div
>
</
div
>
);
...
...
src/modules/teach-tool/examination-paper/ExaminationPaperIndex.less
View file @
8bde2114
.examination-paper-index {
.content-body
{
.examination-paper-content
{
display: flex;
.site-layout-background {
background: #fff;
...
...
@@ -12,5 +12,4 @@
margin-left: 24px;
height: calc(100vh - 160px);
}
}
}
src/modules/teach-tool/examination-paper/components/ExaminationPaperContent.jsx
View file @
8bde2114
...
...
@@ -40,6 +40,7 @@ class ExaminationPaperContent extends Component {
tenantId
:
User
.
getStoreId
(),
userId
:
User
.
getStoreUserId
(),
},
selectedRowKeys
:
[
this
.
props
.
paperId
],
dataSource
:
[],
paperPreviewModal
:
null
,
// 试卷预览模态框
};
...
...
@@ -86,7 +87,7 @@ class ExaminationPaperContent extends Component {
};
// 复制试卷
copyPaper
=
(
record
)
=>
{};
copyPaper
=
(
record
)
=>
{
};
// 编辑试卷
editPaper
=
(
record
)
=>
{
...
...
@@ -139,9 +140,9 @@ class ExaminationPaperContent extends Component {
title
:
"试卷"
,
key
:
"paperName"
,
dataIndex
:
"paperName"
,
ellipsis
:
{
showTitle
:
false
,
},
//
ellipsis: {
//
showTitle: false,
//
},
render
:
(
val
,
record
)
=>
{
var
handleVal
=
val
;
handleVal
=
handleVal
.
replace
(
/<
(?!
img|input
)
.*
?
>/g
,
""
);
...
...
@@ -165,7 +166,7 @@ class ExaminationPaperContent extends Component {
title
:
"及格分/总分"
,
key
:
"score"
,
dataIndex
:
"score"
,
width
:
"16%"
,
render
:
(
val
,
record
)
=>
{
return
(
<
span
>
...
...
@@ -178,15 +179,18 @@ class ExaminationPaperContent extends Component {
title
:
"题目数量"
,
key
:
"questionCnt"
,
dataIndex
:
"questionCnt"
,
width
:
"14%"
,
},
{
title
:
"关联考试数"
,
key
:
"relatedExam"
,
dataIndex
:
"relatedExam"
,
width
:
"14%"
,
},
{
];
if
((
this
.
props
.
type
!==
'modal-select'
))
{
columns
.
push
({
title
:
"操作"
,
key
:
"operate"
,
dataIndex
:
"operate"
,
...
...
@@ -216,8 +220,8 @@ class ExaminationPaperContent extends Component {
</
div
>
);
},
}
,
];
}
)
}
return
columns
;
};
...
...
@@ -245,11 +249,26 @@ class ExaminationPaperContent extends Component {
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryPaperPageList
());
};
onSelectChange
=
(
selectedRowKeys
,
selectedRows
)
=>
{
console
.
log
(
selectedRowKeys
,
selectedRows
)
this
.
setState
({
selectedRowKeys
})
this
.
props
.
onSelect
(
selectedRows
)
}
render
()
{
const
{
dataSource
=
[],
total
,
query
,
paperPreviewModal
}
=
this
.
state
;
const
{
dataSource
=
[],
total
,
query
,
paperPreviewModal
,
selectedRowKeys
}
=
this
.
state
;
const
{
current
,
size
,
categoryId
,
paperName
}
=
query
;
const
rowSelection
=
{
type
:
'radio'
,
selectedRowKeys
,
onChange
:
this
.
onSelectChange
,
};
return
(
<
div
className=
"question-manage-content"
>
<
div
className=
{
"question-manage-content "
+
this
.
props
.
type
}
>
<
div
className=
"question-manage-filter"
>
<
Row
type=
"flex"
justify=
"space-between"
align=
"top"
>
<
div
className=
"search-condition"
>
...
...
@@ -258,7 +277,7 @@ class ExaminationPaperContent extends Component {
<
Search
placeholder=
"搜索试卷名称"
value=
{
paperName
}
style=
{
{
width
:
"calc(100% - 100px)"
}
}
style=
{
{
width
:
200
}
}
onChange=
{
(
e
)
=>
{
this
.
setState
({
query
:
{
...
...
@@ -277,7 +296,8 @@ class ExaminationPaperContent extends Component {
</
div
>
</
Row
>
</
div
>
<
Button
{
(
this
.
props
.
type
!==
'modal-select'
)
&&
<
Button
type=
"primary"
onClick=
{
()
=>
{
window
.
RCHistory
.
push
({
...
...
@@ -287,15 +307,31 @@ class ExaminationPaperContent extends Component {
>
新建试卷
</
Button
>
}
<
div
className=
"question-manage-list"
>
{
(
this
.
props
.
type
!==
'modal-select'
)
?
<
Table
rowKey=
{
(
record
)
=>
record
.
id
}
dataSource=
{
dataSource
}
columns=
{
this
.
parseColumns
()
}
pagination=
{
false
}
bordered
onChange=
{
this
.
handleChangeTable
}
/>
:
<
Table
rowKey=
{
(
record
)
=>
record
.
id
}
dataSource=
{
dataSource
}
rowKey=
{
(
item
)
=>
{
return
item
.
paperId
}
}
rowSelection=
{
rowSelection
}
columns=
{
this
.
parseColumns
()
}
pagination=
{
false
}
bordered
onChange=
{
this
.
handleChangeTable
}
/>
}
{
total
>
0
&&
(
<
div
className=
"box-footer"
>
<
PageControl
...
...
src/modules/teach-tool/examination-paper/components/ExaminationPaperContent.less
View file @
8bde2114
...
...
@@ -7,8 +7,10 @@
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
.question-manage-content {
.question-manage-filter {
position: relative;
.search-condition {
width: calc(100% - 80px);
display: flex;
...
...
@@ -75,6 +77,18 @@
}
}
}
&.modal-select{
.search-condition {
width: calc(100% - 80px);
display: flex;
align-items: center;
flex-wrap: wrap;
&__item {
width: auto;
}
}
}
}
.tool-list {
.ant-tooltip-inner {
...
...
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