Commit 8d3049f2 by zhujian

'feat:添加悬浮提示'

parent 51719bb9
...@@ -113,7 +113,7 @@ class PaperList extends Component { ...@@ -113,7 +113,7 @@ class PaperList extends Component {
// 编辑试卷 // 编辑试卷
editPaper = (record) => { editPaper = (record) => {
const { match } = this.props; const { match } = this.props;
if (record.relatedExam === 0) { if (record.relatedExam === 0) {
const { categoryId } = this.state.query; const { categoryId } = this.state.query;
const { match } = this.props; const { match } = this.props;
...@@ -232,18 +232,46 @@ class PaperList extends Component { ...@@ -232,18 +232,46 @@ class PaperList extends Component {
dataIndex: "questionCnt", dataIndex: "questionCnt",
width: this.props.type !== "modal-select" ? "12%" : "20%", width: this.props.type !== "modal-select" ? "12%" : "20%",
align: "right", align: "right",
render: (val, record) => {
return (
this.props.type !== "modal-select" ?
<span>
{record.questionCnt}
</span> :
<Tooltip
overlayClassName="tool-list"
title={
<div>
<div className="item">单选题:{record.singleChoiceCnt || 0}</div>
<div className="item">多选题:{record.multiChoiceCnt || 0}</div>
<div className="item">判断题:{record.judgeCnt || 0}</div>
<div className="item">填空题:{record.gapFillingCnt || 0}</div>
<div className="item">不定项选择题:{record.indefiniteChoiceCnt || 0}</div>
</div>
}
placement="top"
overlayStyle={{ maxWidth: 700 }}
>
<span>
{record.questionCnt}
</span>
</Tooltip>
);
},
}, },
{
];
if (this.props.type !== "modal-select") {
const isPermiss = ["CloudManager", "StoreManager"].includes(User.getUserRole());
columns.push({
title: "关联考试数", title: "关联考试数",
key: "relatedExam", key: "relatedExam",
dataIndex: "relatedExam", dataIndex: "relatedExam",
width: this.props.type !== "modal-select" ? "16%" : "24%", width: this.props.type !== "modal-select" ? "16%" : "24%",
align: "right", align: "right",
}, })
];
if (this.props.type !== "modal-select") {
const isPermiss = ["CloudManager", "StoreManager"].includes(User.getUserRole());
columns.push({ columns.push({
title: "操作", title: "操作",
key: "operate", key: "operate",
...@@ -355,17 +383,17 @@ class PaperList extends Component { ...@@ -355,17 +383,17 @@ class PaperList extends Component {
</div> </div>
{this.props.type !== "modal-select" && isPermiss && {this.props.type !== "modal-select" && isPermiss &&
categoryId && ( categoryId && (
<Button <Button
type="primary" type="primary"
onClick={() => { onClick={() => {
window.RCHistory.push({ window.RCHistory.push({
pathname: `${match.url}/paper-operate-page?type=new&categoryId=${categoryId}`, pathname: `${match.url}/paper-operate-page?type=new&categoryId=${categoryId}`,
}); });
}} }}
> >
新建试卷 新建试卷
</Button> </Button>
)} )}
<div className="paper-list-content"> <div className="paper-list-content">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}> <ConfigProvider renderEmpty={this.customizeRenderEmpty}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment