Commit 8d3049f2 by zhujian

'feat:添加悬浮提示'

parent 51719bb9
......@@ -113,7 +113,7 @@ class PaperList extends Component {
// 编辑试卷
editPaper = (record) => {
const { match } = this.props;
if (record.relatedExam === 0) {
const { categoryId } = this.state.query;
const { match } = this.props;
......@@ -232,18 +232,46 @@ class PaperList extends Component {
dataIndex: "questionCnt",
width: this.props.type !== "modal-select" ? "12%" : "20%",
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: "关联考试数",
key: "relatedExam",
dataIndex: "relatedExam",
width: this.props.type !== "modal-select" ? "16%" : "24%",
align: "right",
},
];
if (this.props.type !== "modal-select") {
const isPermiss = ["CloudManager", "StoreManager"].includes(User.getUserRole());
})
columns.push({
title: "操作",
key: "operate",
......@@ -355,17 +383,17 @@ class PaperList extends Component {
</div>
{this.props.type !== "modal-select" && isPermiss &&
categoryId && (
<Button
type="primary"
onClick={() => {
window.RCHistory.push({
pathname: `${match.url}/paper-operate-page?type=new&categoryId=${categoryId}`,
});
}}
>
新建试卷
</Button>
)}
<Button
type="primary"
onClick={() => {
window.RCHistory.push({
pathname: `${match.url}/paper-operate-page?type=new&categoryId=${categoryId}`,
});
}}
>
新建试卷
</Button>
)}
<div className="paper-list-content">
<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