Commit 3cfa93ca by yuananting

feat:新建题目

parent f48a2dd4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-23 18:28:50 * @Date: 2021-02-23 18:28:50
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-29 19:50:28 * @LastEditTime: 2021-03-30 14:25:47
* @Description: 助学工具-课程分类 * @Description: 助学工具-课程分类
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -30,7 +30,7 @@ class CourseCategoryManage extends Component { ...@@ -30,7 +30,7 @@ class CourseCategoryManage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
NewEditCourseCategoryModal: null, //新增或编辑分类模态框 newEditCourseCategoryModal: null, //新增或编辑分类模态框
treeData: [], treeData: [],
originTreeData: [], originTreeData: [],
treeMap: {}, treeMap: {},
...@@ -302,12 +302,12 @@ class CourseCategoryManage extends Component { ...@@ -302,12 +302,12 @@ class CourseCategoryManage extends Component {
close={() => { close={() => {
this.queryCategoryTree("change", this.state.categoryName); this.queryCategoryTree("change", this.state.categoryName);
this.setState({ this.setState({
NewEditCourseCategoryModal: null, newEditCourseCategoryModal: null,
}); });
}} }}
/> />
); );
this.setState({ NewEditCourseCategoryModal: m }); this.setState({ newEditCourseCategoryModal: m });
}; };
// 删除分类 // 删除分类
...@@ -582,7 +582,7 @@ class CourseCategoryManage extends Component { ...@@ -582,7 +582,7 @@ class CourseCategoryManage extends Component {
expandedKeys, expandedKeys,
selectedKeys, selectedKeys,
autoExpandParent, autoExpandParent,
NewEditCourseCategoryModal, newEditCourseCategoryModal,
} = this.state; } = this.state;
return ( return (
<div className="page course-category-manage"> <div className="page course-category-manage">
...@@ -645,7 +645,7 @@ class CourseCategoryManage extends Component { ...@@ -645,7 +645,7 @@ class CourseCategoryManage extends Component {
></DirectoryTree> ></DirectoryTree>
</div> </div>
</div> </div>
{NewEditCourseCategoryModal} {newEditCourseCategoryModal}
</div> </div>
); );
} }
......
...@@ -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-03-29 16:17:53 * @LastEditTime: 2021-03-30 16:40:58
* @Description: 助学工具-课程分类侧边栏 * @Description: 助学工具-课程分类侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -19,22 +19,28 @@ class CourseCategorySiderTree extends Component { ...@@ -19,22 +19,28 @@ class CourseCategorySiderTree extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
selectedKeys: [getParameterByName("categoryId") || "null"], selectedKeys:
treeData: this.props.treeData || [], props.fromModule === "index"
? [getParameterByName("categoryId") || "null"]
: ["null"],
treeData: props.treeData || [],
autoExpandParent: false, autoExpandParent: false,
}; };
} }
componentDidMount() { componentDidMount() {
this.queryCategoryTree("change"); this.queryCategoryTree("change");
this.props.getSelectedCategoryId([ this.props.getSelectedCategoryId(
getParameterByName("categoryId") || "null", this.props.fromModule === "index"
]); ? [getParameterByName("categoryId") || "null"]
: ["null"]
);
} }
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
const { currentTotal, updatedCategoryId } = nextProps; const { currentTotal, updatedCategoryId } = nextProps;
if ( if (
this.props.fromModule === "index" &&
this.props.currentTotal !== currentTotal && this.props.currentTotal !== currentTotal &&
this.props.updatedCategoryId === updatedCategoryId this.props.updatedCategoryId === updatedCategoryId
) { ) {
...@@ -200,7 +206,7 @@ class CourseCategorySiderTree extends Component { ...@@ -200,7 +206,7 @@ class CourseCategorySiderTree extends Component {
}} }}
enterButton={<span className="icon iconfont">&#xe832;</span>} enterButton={<span className="icon iconfont">&#xe832;</span>}
/> />
{User.getUserRole() !== "CloudLecturer" && ( {this.props.fromModule==="index" && User.getUserRole() !== "CloudLecturer" && (
<div className="sider-btn"> <div className="sider-btn">
<Button <Button
onClick={() => { onClick={() => {
......
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-27 14:55:14 * @Date: 2021-03-27 14:55:14
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-27 15:21:06 * @LastEditTime: 2021-03-30 16:08:38
* @Description: 助学工具-试卷主页面 * @Description: 助学工具-试卷主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import "./ExaminationPaperIndex.less"; import "./ExaminationPaperIndex.less";
import CourseCategorySiderTree from "../components/CourseCategorySiderTree"; import CourseCategorySiderTree from "../components/CourseCategorySiderTree";
...@@ -15,13 +14,9 @@ import ExaminationPaperContent from "./components/ExaminationPaperContent"; ...@@ -15,13 +14,9 @@ import ExaminationPaperContent from "./components/ExaminationPaperContent";
class ExaminationPaperIndex extends Component { class ExaminationPaperIndex extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {};
selectedCategoryId: "",
};
} }
componentDidMount() {}
getCategoryIdFromSider = (selectedCategoryId) => { getCategoryIdFromSider = (selectedCategoryId) => {
if (selectedCategoryId && selectedCategoryId.length > 0) { if (selectedCategoryId && selectedCategoryId.length > 0) {
this.setState({ selectedCategoryId: selectedCategoryId[0] }); this.setState({ selectedCategoryId: selectedCategoryId[0] });
...@@ -42,6 +37,7 @@ class ExaminationPaperIndex extends Component { ...@@ -42,6 +37,7 @@ class ExaminationPaperIndex extends Component {
> >
<div className="sider"> <div className="sider">
<CourseCategorySiderTree <CourseCategorySiderTree
fromModule="index"
getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)} getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)}
currentTotal={this.state.currentTotal} currentTotal={this.state.currentTotal}
updatedCategoryId={this.state.updatedCategoryId} updatedCategoryId={this.state.updatedCategoryId}
......
/* .examination-paper-index {
* @Author: yuananting
* @Date: 2021-02-21 18:27:43
* @LastEditors: yuananting
* @LastEditTime: 2021-03-27 15:18:26
* @Description: 助学工具-题库-试卷主页面样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
.examination-paper-index {
.content-body { .content-body {
display: flex; display: flex;
.site-layout-background { .site-layout-background {
......
...@@ -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-03-29 10:54:49 * @LastEditTime: 2021-03-30 19:38:00
* @Description: 助学工具-新建试卷 * @Description: 助学工具-新建试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,38 +10,50 @@ import React, { Component } from "react"; ...@@ -10,38 +10,50 @@ import React, { Component } from "react";
import { import {
Form, Form,
Button, Button,
Select,
Input, Input,
Space,
Table, Table,
InputNumber, InputNumber,
ConfigProvider, ConfigProvider,
Empty, Empty,
Tooltip,
} from "antd"; } from "antd";
import { PlusOutlined } from "@ant-design/icons"; import { PlusOutlined } from "@ant-design/icons";
import ShowTips from "@/components/ShowTips"; import ShowTips from "@/components/ShowTips";
import Breadcrumbs from "@/components/Breadcrumbs"; import Breadcrumbs from "@/components/Breadcrumbs";
import { PageControl } from "@/components";
import "./NewExaminationPaper.less"; import "./NewExaminationPaper.less";
import SelectQuestionModal from "./modal/SelectQuestionModal"; import SelectQuestionModal from "./modal/SelectQuestionModal";
const formItemLayout = { const questionTypeEnum = {
labelCol: { SINGLE_CHOICE: "单选题",
xs: { span: 24 }, MULTI_CHOICE: "多选题",
sm: { span: 2 }, JUDGE: "判断题",
}, GAP_FILLING: "填空题",
wrapperCol: { INDEFINITE_CHOICE: "不定项选择题",
xs: { span: 24 },
sm: { span: 22 },
},
}; };
class NewExaminationPaper extends Component { class NewExaminationPaper extends Component {
formRef = React.createRef();
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
current: 1, questionFormData: {
size: 10, examinationPaperName: null, // 试卷名称
total: 20, passScore: null, // 及格线
questionList: [], // 题目列表
},
questionData: {
totalScore: 0,
totalCount: 0,
singleCount: 0,
singleScore: 0,
multiCount: 0,
multiScore: 0,
judgeCount: 0,
judgeScore: 0,
gapCount: 0,
gapScore: 0,
indefiniteCount: 0,
indefiniteScore: 0,
},
}; };
} }
...@@ -62,25 +74,55 @@ class NewExaminationPaper extends Component { ...@@ -62,25 +74,55 @@ class NewExaminationPaper extends Component {
chooseQuestion = () => { chooseQuestion = () => {
const m = ( const m = (
<SelectQuestionModal <SelectQuestionModal
setSelectedQuestion={(list) => {
this.setState(
{
questionList: list,
selectQuestionModal: null,
},
() => {
console.log(this.state.questionList);
}
);
}}
close={() => { close={() => {
this.setState({ this.setState({
SelectQuestionModal: null, selectQuestionModal: null,
}); });
}} }}
/> />
); );
this.setState({ SelectQuestionModal: m }); this.setState({ selectQuestionModal: m });
} };
// 保存题目
saveExaminationPaper = async () => {
try {
await this.formRef.current.validateFields();
} catch (e) {
console.log(e);
}
};
render() { render() {
const formItemLayout = {
labelCol: { span: 2 },
wrapperCol: { span: 10 },
};
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
dataIndex: "index", dataIndex: "index",
width: "10%",
render: (val, record, index) => {
return <span>{index + 1}</span>;
},
}, },
{ {
title: "题型", title: "题型",
dataIndex: "questionType", dataIndex: "questionTypeEnum",
width: "16%",
filters: [ filters: [
{ {
text: "单选题", text: "单选题",
...@@ -104,21 +146,45 @@ class NewExaminationPaper extends Component { ...@@ -104,21 +146,45 @@ class NewExaminationPaper extends Component {
}, },
], ],
filterMultiple: false, filterMultiple: false,
onFilter: (value, record) => record.address.indexOf(value) === 0, onFilter: (value, record) => record.questionTypeEnum.indexOf(value) === 0,
render: (val) => questionTypeEnum[val]
}, },
{ {
title: "题目", title: "题目",
dataIndex: "questionContent", dataIndex: "questionStem",
ellipsis: {
showTitle: false,
},
render: (val) => {
var handleVal = val;
handleVal = handleVal.replace(/<(?!img|input).*?>/g, "");
handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、");
handleVal = handleVal.replace(/\&nbsp\;/gi, " ");
return (
<Tooltip
overlayClassName="aid-tool-list"
title={
<div style={{ maxWidth: 700, width: "auto" }}>{handleVal}</div>
}
placement="topLeft"
overlayStyle={{ maxWidth: 700 }}
>
{handleVal}
</Tooltip>
);
},
}, },
{ {
title: "分值", title: "分值",
dataIndex: "score", dataIndex: "score",
width: "12%",
render: (val) => { render: (val) => {
return <InputNumber min={1} max={100} defaultValue={2} />; return <InputNumber min={1} max={100} defaultValue={2} />;
}, },
}, },
{ {
dataIndex: "extraScore", dataIndex: "extraScore",
width: "18%",
render: (val) => { render: (val) => {
return ( return (
<div> <div>
...@@ -131,12 +197,32 @@ class NewExaminationPaper extends Component { ...@@ -131,12 +197,32 @@ class NewExaminationPaper extends Component {
{ {
title: "操作", title: "操作",
dataIndex: "operate", dataIndex: "operate",
width: "10%",
render: (val, record) => <span>移除</span>, render: (val, record) => <span>移除</span>,
}, },
]; ];
const {
selectQuestionModal,
questionData,
examinationPaperName,
passScore = 60,
questionList = [],
} = this.state;
const data = []; const {
const { current, size, total, SelectQuestionModal } = this.state; totalScore = 0,
totalCount = 0,
singleCount = 0,
singleScore = 0,
multiCount = 0,
multiScore = 0,
judgeCount = 0,
judgeScore = 0,
gapCount = 0,
gapScore = 0,
indefiniteCount = 0,
indefiniteScore = 0,
} = questionData;
return ( return (
<div className="page new-examination-paper"> <div className="page new-examination-paper">
...@@ -145,68 +231,100 @@ class NewExaminationPaper extends Component { ...@@ -145,68 +231,100 @@ class NewExaminationPaper extends Component {
<div className="show-tips"> <div className="show-tips">
<ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企培保有依据国家规定及平台规则进行处理的权利" /> <ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企培保有依据国家规定及平台规则进行处理的权利" />
</div> </div>
<Form {...formItemLayout} style={{ marginTop: 40 }}> <Form
ref={this.formRef}
{...formItemLayout}
style={{ width: 1020, marginTop: 32 }}
>
<h1 style={{ fontSize: 16 }}>基本信息</h1> <h1 style={{ fontSize: 16 }}>基本信息</h1>
<Form.Item label="试卷名称:"> <Form.Item
<Input maxLength={40} placeholder="请输入试卷名称(40字以内)" /> name="examinationPaperName"
</Form.Item> label="试卷名称:"
<Form.Item label="试卷分类:"> required
<Select placeholder="请选择试卷分类" /> rules={[
{
required: true,
message: "请输入试卷名称",
},
]}
>
<Input
value={examinationPaperName}
autoComplete="off"
maxLength={40}
placeholder="请输入试卷名称(40字以内)"
/>
</Form.Item> </Form.Item>
<div <div
style={{ style={{
display: "flex", display: "flex",
justifyContent: "space-between", justifyContent: "space-between",
marginTop: 30, marginTop: 32,
}} }}
> >
<h1 style={{ fontSize: 16 }}>题目管理</h1> <h1 style={{ fontSize: 16 }}>题目管理</h1>
<Space> <Button icon={<PlusOutlined />} onClick={this.chooseQuestion}>
<Button icon={<PlusOutlined />} onClick={this.chooseQuestion}>自选题目</Button> 自选题目
<Button icon={<PlusOutlined />}>系统抽题</Button> </Button>
<Button icon={<PlusOutlined />}>一人一卷</Button>
</Space>
</div> </div>
<Form.Item> <div style={{ margin: "10px 0 20px" }}>
<div> 总计{totalScore}分,共{totalCount}题。 单选题{singleCount}题,共
总计40分,共20题。 {singleScore}分;多选题{multiCount}题,共{multiScore}分;判断题
单选题5题,共10分;多选题2题,共4分;判断题3题,共6分,填空题5题,共10分,不定项选择题5题,共10分 {judgeCount}题,共{judgeScore}分,填空题{gapCount}题,共{gapScore}
</div> 分,不定项选择题{indefiniteCount}题,共{indefiniteScore}
<ConfigProvider renderEmpty={this.customizeRenderEmpty}> </div>
<Table columns={columns} dataSource={data} pagination={false} /> <Form.Item label="及格线:" required>
</ConfigProvider>
<div className="box-footer">
<PageControl
current={current - 1}
pageSize={size}
total={total}
toPage={(page) => {
const _query = { ...query, current: page + 1 };
this.setState({ query: _query }, () =>
this.queryQuestionPageList()
);
}}
showSizeChanger={true}
onShowSizeChange={this.onShowSizeChange}
/>
</div>
</Form.Item>
<Form.Item label="及格线:">
<div> <div>
<InputNumber min={1} defaultValue={60} /> % <Form.Item
noStyle
initialValue={60}
name="passScore"
rules={[
({ getFieldValue }) => ({
validator(_, value) {
if (!value) {
return Promise.reject("请输入及格线");
} else {
return Promise.resolve();
}
},
}),
]}
>
<InputNumber
min={1}
max={100}
value={passScore}
onChange={(value) => {
this.setState({
passScore: value,
});
}}
/>
</Form.Item>{" "}
%
<span style={{ marginLeft: 20 }}> <span style={{ marginLeft: 20 }}>
总分(0)*及格线(60%)=及格分数(0) 总分(0)*及格线({passScore || 0}%)=及格分数(0)
</span> </span>
</div> </div>
</Form.Item> </Form.Item>
<ConfigProvider renderEmpty={this.customizeRenderEmpty}>
<Table
columns={columns}
dataSource={questionList}
pagination={false}
/>
</ConfigProvider>
</Form> </Form>
</div> </div>
<div className="footer"> <div className="footer">
<Button>取消</Button> <Button>取消</Button>
<Button>预览</Button> <Button>预览</Button>
<Button type="primary">保存</Button> <Button type="primary" onClick={this.saveExaminationPaper}>
保存
</Button>
</div> </div>
{SelectQuestionModal} {selectQuestionModal}
</div> </div>
); );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 13:52:01 * @Date: 2021-02-25 13:52:01
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-27 17:22:05 * @LastEditTime: 2021-03-30 19:34:05
* @Description: 助学工具-新建试卷 * @Description: 助学工具-新建试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -32,3 +32,9 @@ ...@@ -32,3 +32,9 @@
} }
} }
} }
.aid-tool-list {
.ant-tooltip-inner {
max-width: 700px !important;
}
}
...@@ -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-03-29 13:57:20 * @LastEditTime: 2021-03-30 19:32:28
* @Description: 助学工具-题库-题目管理主页面列表数据 * @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -12,7 +12,6 @@ import { ...@@ -12,7 +12,6 @@ import {
Dropdown, Dropdown,
Row, Row,
Input, Input,
Select,
Tooltip, Tooltip,
Menu, Menu,
Button, Button,
...@@ -24,34 +23,9 @@ import "./ExaminationPaperContent.less"; ...@@ -24,34 +23,9 @@ import "./ExaminationPaperContent.less";
import User from "@/common/js/user"; import User from "@/common/js/user";
import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService"; import QuestionBankService from "@/domains/question-bank-domain/QuestionBankService";
import _ from "underscore"; import _ from "underscore";
// import QuestionPreviewModal from "../modal/QuestionPreviewModal";
// import BatchImportQuestionModal from "../modal/BatchImportQuestionModal";
const { Search } = Input; const { Search } = Input;
const questionTypeList = [
{
label: "单选题",
value: "SINGLE_CHOICE",
},
{
label: "多选题",
value: "MULTI_CHOICE",
},
{
label: "判断题",
value: "JUDGE",
},
{
label: "填空题",
value: "GAP_FILLING",
},
{
label: "不定项选择题",
value: "INDEFINITE_CHOICE",
},
];
class ExaminationPaperContent extends Component { class ExaminationPaperContent extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -59,98 +33,87 @@ class ExaminationPaperContent extends Component { ...@@ -59,98 +33,87 @@ class ExaminationPaperContent extends Component {
query: { query: {
current: 1, current: 1,
size: 10, size: 10,
order: "UPDATED_DESC", // 排序规则[ ACCURACY_DESC, ACCURACY_ASC, CREATED_DESC, CREATED_ASC, UPDATED_DESC, UPDATED_ASC ]
categoryId: null, // 当前题库分类Id categoryId: null, // 当前题库分类Id
questionName: null, // 题目名称 examinationPaperName: null, // 试卷名称
questionType: null, // 题目类型
source: 0, source: 0,
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
}, },
questionTypeList: [], // 题型列表
dataSource: [], dataSource: [],
totalCount: 0, questionPreviewModal: null, // 题目预览模态框
QuestionPreviewModal: null, // 题目预览模态框
}; };
} }
componentDidMount() { componentDidMount() {}
this.setState({
dataSource: [
{
examinationName: "一二三四五六七八九十",
passScore: 60,
totalScore: 100,
count: 12,
relatedCount: 12,
},
],
});
}
queryQuestionPageList = (remain) => { shouldComponentUpdate(nextProps, nextState) {
let { selectedCategoryId } = nextProps;
const _query = this.state.query; const _query = this.state.query;
if (_query.categoryId === "0") _query.categoryId = null; if (this.props.selectedCategoryId !== selectedCategoryId) {
QuestionBankService.queryQuestionPageList(_query).then((res) => { _query.categoryId = selectedCategoryId === "null" ? null : selectedCategoryId;
const { records = [], total = 0 } = res.result; _query.examinationPaperName = null;
this.setState({ dataSource: records }); _query.current = 1;
this.setState({ total }, () => this.setState({ query: _query }, () => this.queryExaminationPaperList());
this.props.updatedSiderTree(total, this.props.selectedCategoryId) }
); return true;
}); }
};
// 查询试卷列表
queryExaminationPaperList = () => {};
// 预览试卷
previewExaminationPaper = (record) => {};
// 复制试卷
copyExaminationPaper = (record) => {};
// 编辑试卷
editExaminationPaper = (record) => {};
delCategoryConfirm(record) { // 删除试卷
delExaminationPaper(record) {
return Modal.confirm({ return Modal.confirm({
title: "提示", title: "提示",
content: "确定要删除此题目吗?", content: "确定要删除此试卷吗?",
icon: ( icon: (
<span className="icon iconfont default-confirm-icon">&#xe839; </span> <span className="icon iconfont default-confirm-icon">&#xe839; </span>
), ),
okText: "删除", okText: "删除",
cancelText: "取消", cancelText: "取消",
onOk: () => { onOk: () => {
this.deleteQuestion(record); let params = {
id: record.id,
source: 0,
tenantId: User.getStoreId(),
userId: User.getStoreUserId(),
};
QuestionBankService.deleteQuestion(params).then((res) => {
if (res.success) {
message.success("删除成功");
const { query, total } = this.state;
const { size, current } = query;
const _query = query;
if (total / size < current) {
if (total % size === 1) {
_query.current = 1;
}
}
this.setState({ query: _query }, () =>
this.queryQuestionPageList()
);
}
});
}, },
}); });
} }
deleteQuestion = (record) => {
let params = {
id: record.id,
source: 0,
tenantId: User.getStoreId(),
userId: User.getStoreUserId(),
};
QuestionBankService.deleteQuestion(params).then((res) => {
if (res.success) {
message.success("删除成功");
const { query, total } = this.state;
const { size, current } = query;
const _query = query;
if (total / size < current) {
if (total % size === 1) {
_query.current = 1;
}
}
this.setState({ query: _query }, () => this.queryQuestionPageList());
}
});
};
// 预览试卷
previewExaminationPaper = () => {};
// 编辑试卷
toEditExaminationPaper = () => {};
// 表头设置 // 表头设置
parseColumns = () => { parseColumns = () => {
const columns = [ const columns = [
{ {
title: "试卷", title: "试卷",
key: "examinationName", key: "examinationPaperName",
dataIndex: "examinationName", dataIndex: "examinationPaperName",
ellipsis: { ellipsis: {
showTitle: false, showTitle: false,
}, },
...@@ -158,7 +121,6 @@ class ExaminationPaperContent extends Component { ...@@ -158,7 +121,6 @@ class ExaminationPaperContent extends Component {
var handleVal = val; var handleVal = val;
handleVal = handleVal.replace(/<(?!img|input).*?>/g, ""); handleVal = handleVal.replace(/<(?!img|input).*?>/g, "");
handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、"); handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、");
handleVal = handleVal.replace(/<\s?img[^>]*>/gi, "【图片】");
handleVal = handleVal.replace(/\&nbsp\;/gi, " "); handleVal = handleVal.replace(/\&nbsp\;/gi, " ");
return ( return (
<Tooltip <Tooltip
...@@ -234,19 +196,21 @@ class ExaminationPaperContent extends Component { ...@@ -234,19 +196,21 @@ class ExaminationPaperContent extends Component {
return columns; return columns;
}; };
// 操作更多下拉项
initDropMenu = (item) => { initDropMenu = (item) => {
return ( return (
<Menu> <Menu>
<Menu.Item key="0"> <Menu.Item key="edit">
<span>编辑</span> <span onClick={() => this.editExaminationPaper(item)}>编辑</span>
</Menu.Item> </Menu.Item>
<Menu.Item key="1"> <Menu.Item key="del">
<span>删除</span> <span onClick={() => this.delExaminationPaper(item)}>删除</span>
</Menu.Item> </Menu.Item>
</Menu> </Menu>
); );
}; };
// 页展示数修改
onShowSizeChange = (current, size) => { onShowSizeChange = (current, size) => {
if (current == size) { if (current == size) {
return; return;
...@@ -303,7 +267,7 @@ class ExaminationPaperContent extends Component { ...@@ -303,7 +267,7 @@ class ExaminationPaperContent extends Component {
type="primary" type="primary"
onClick={() => { onClick={() => {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/new-examination-paper`, pathname: `/new-examination-paper?categoryId=${this.state.query.categoryId}`,
}); });
}} }}
> >
......
...@@ -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-03-29 14:23:42 * @LastEditTime: 2021-03-30 18:36:32
* @Description: 助学工具-新建试卷-选择题目列表 * @Description: 助学工具-新建试卷-选择题目列表
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -67,7 +67,7 @@ class QuestionListContent extends Component { ...@@ -67,7 +67,7 @@ class QuestionListContent extends Component {
query: { query: {
current: 1, current: 1,
size: 10, size: 10,
order: "UPDATED_DESC", // 排序规则[ ACCURACY_DESC, ACCURACY_ASC, CREATED_DESC, CREATED_ASC, UPDATED_DESC, UPDATED_ASC ] order: "ACCURACY_DESC",
categoryId: null, // 当前题库分类Id categoryId: null, // 当前题库分类Id
questionName: null, // 题目名称 questionName: null, // 题目名称
questionType: null, // 题目类型 questionType: null, // 题目类型
...@@ -75,10 +75,8 @@ class QuestionListContent extends Component { ...@@ -75,10 +75,8 @@ class QuestionListContent extends Component {
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
}, },
questionTypeList: [], // 题型列表
dataSource: [], dataSource: [],
totalCount: 0, selectQuestionKeys: [],
selectedRowKeys: [],
}; };
} }
...@@ -88,10 +86,8 @@ class QuestionListContent extends Component { ...@@ -88,10 +86,8 @@ class QuestionListContent extends Component {
let { selectedCategoryId } = nextProps; let { selectedCategoryId } = nextProps;
const _query = this.state.query; const _query = this.state.query;
if (this.props.selectedCategoryId !== selectedCategoryId) { if (this.props.selectedCategoryId !== selectedCategoryId) {
if (selectedCategoryId === "null") { _query.categoryId =
selectedCategoryId = null; selectedCategoryId === "null" ? null : selectedCategoryId;
}
_query.categoryId = selectedCategoryId;
_query.questionName = null; _query.questionName = null;
_query.questionType = null; _query.questionType = null;
_query.current = 1; _query.current = 1;
...@@ -100,15 +96,11 @@ class QuestionListContent extends Component { ...@@ -100,15 +96,11 @@ class QuestionListContent extends Component {
return true; return true;
} }
queryQuestionPageList = (remain) => { queryQuestionPageList = () => {
const _query = this.state.query; const _query = this.state.query;
if (_query.categoryId === "0") _query.categoryId = null;
QuestionBankService.queryQuestionPageList(_query).then((res) => { QuestionBankService.queryQuestionPageList(_query).then((res) => {
const { records = [], total = 0 } = res.result; const { records = [], total = 0 } = res.result;
this.setState({ dataSource: records }); this.setState({ dataSource: records, total });
this.setState({ total }, () =>
this.props.updatedSiderTree(total, this.props.selectedCategoryId)
);
}); });
}; };
...@@ -118,66 +110,6 @@ class QuestionListContent extends Component { ...@@ -118,66 +110,6 @@ class QuestionListContent extends Component {
}); });
}; };
delQuestionConfirm(record) {
return Modal.confirm({
title: "提示",
content: "确定要删除此题目吗?",
icon: (
<span className="icon iconfont default-confirm-icon">&#xe839; </span>
),
okText: "删除",
cancelText: "取消",
onOk: () => {
this.deleteQuestion(record);
},
});
}
deleteQuestion = (record) => {
let params = {
id: record.id,
source: 0,
tenantId: User.getStoreId(),
userId: User.getStoreUserId(),
};
QuestionBankService.deleteQuestion(params).then((res) => {
if (res.success) {
message.success("删除成功");
const { query, total } = this.state;
const { size, current } = query;
const _query = query;
if (total / size < current) {
if (total % size === 1) {
_query.current = 1;
}
}
this.setState({ query: _query }, () => this.queryQuestionPageList());
}
});
};
// 排序
handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter;
let sort = null;
if (columnKey === "accuracy" && order === "ascend") {
sort = "ACCURACY_ASC";
}
if (columnKey === "accuracy" && order === "descend") {
sort = "ACCURACY_DESC";
}
if (columnKey === "updateTime" && order === "ascend") {
sort = "UPDATED_ASC";
}
if (columnKey === "updateTime" && order === "descend") {
sort = "UPDATED_DESC";
}
const _query = this.state.query;
_query.order = sort || "UPDATED_DESC";
_query.current = 1;
this.setState({ query: _query }, () => this.queryQuestionPageList());
};
// 清空搜索条件 // 清空搜索条件
handleReset = () => { handleReset = () => {
const _query = { const _query = {
...@@ -192,24 +124,8 @@ class QuestionListContent extends Component { ...@@ -192,24 +124,8 @@ class QuestionListContent extends Component {
}); });
}; };
toEditQuestion = (id, type) => {
const { categoryId } = this.state.query;
if (categoryId) {
window.RCHistory.push({
pathname: `/create-new-question?id=${id}&type=${type}&categoryId=${categoryId}`,
});
} else {
window.RCHistory.push({
pathname: `/create-new-question?id=${id}&type=${type}`,
});
}
};
// 表头设置 // 表头设置
parseColumns = () => { parseColumns = () => {
const isPermiss = ["CloudManager", "StoreManager"].includes(
User.getUserRole()
);
const columns = [ const columns = [
{ {
title: "题目", title: "题目",
...@@ -218,11 +134,10 @@ class QuestionListContent extends Component { ...@@ -218,11 +134,10 @@ class QuestionListContent extends Component {
ellipsis: { ellipsis: {
showTitle: false, showTitle: false,
}, },
render: (val, record) => { render: (val) => {
var handleVal = val; var handleVal = val;
handleVal = handleVal.replace(/<(?!img|input).*?>/g, ""); handleVal = handleVal.replace(/<(?!img|input).*?>/g, "");
handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、"); handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、");
handleVal = handleVal.replace(/<\s?img[^>]*>/gi, "【图片】");
handleVal = handleVal.replace(/\&nbsp\;/gi, " "); handleVal = handleVal.replace(/\&nbsp\;/gi, " ");
return ( return (
<Tooltip <Tooltip
...@@ -262,33 +177,13 @@ class QuestionListContent extends Component { ...@@ -262,33 +177,13 @@ class QuestionListContent extends Component {
// 自定义表格空状态 // 自定义表格空状态
customizeRenderEmpty = () => { customizeRenderEmpty = () => {
const { categoryId } = this.state.query;
return ( return (
<Empty <Empty
image="https://image.xiaomaiketang.com/xm/emptyTable.png" image="https://image.xiaomaiketang.com/xm/emptyTable.png"
imageStyle={{ imageStyle={{
height: 100, height: 100,
}} }}
description={ description={"还没有题目"}
<div>
<span>还没有题目</span>
{["CloudManager", "StoreManager"].includes(User.getUserRole()) &&
!["0", null].includes(categoryId) && (
<span>
,快去
<span
className="empty-list-tip"
onClick={() => {
this.handleCreateQuestionBank();
}}
>
新建一个
</span>
吧!
</span>
)}
</div>
}
></Empty> ></Empty>
); );
}; };
...@@ -319,13 +214,89 @@ class QuestionListContent extends Component { ...@@ -319,13 +214,89 @@ class QuestionListContent extends Component {
); );
}; };
// 选择题目-单项选择
selectQuestionRow = (record, selected) => {
const { selectQuestionKeys } = this.state;
let _list = [];
if (
selected ||
!_.find(selectQuestionKeys, (item) => item.id == record.id)
) {
_list = _.uniq(
selectQuestionKeys.concat([record]),
false,
(item) => item.id
);
} else {
_list = _.reject(selectQuestionKeys, (item) => item.id === record.id);
}
if (_list.length > 150) {
return message.warning("一份试卷最多支持150道题目");
}
this.setState({ selectQuestionKeys: _list });
};
// 选择题目-当前全选
selectQuestionAll = (selected, selectedRows, changeRows) => {
const { selectQuestionKeys } = this.state;
let _list = [];
if (selected) {
_list = _.uniq(
selectQuestionKeys.concat(changeRows),
false,
(item) => item.id
);
} else {
_list = _.reject(selectQuestionKeys, (item) =>
_.find(changeRows, (data) => data.id === item.id)
);
}
if (_list.length > 150) {
message.warning("一份试卷最多支持150道题目");
const extraLength = _list.length - 150;
_list.splice(_list.length - extraLength, extraLength);
}
this.setState({ selectQuestionKeys: _list });
};
render() { render() {
const { dataSource = [], total, query, selectedRowKeys } = this.state; const {
const { current, size, categoryId, questionName, questionType } = query; dataSource = [],
total,
query,
selectQuestionKeys = [],
} = this.state;
const { current, size, questionName, questionType } = query;
const rowSelection = { const rowSelection = {
selectedRowKeys, columnWidth: 48,
columnWidth: "48px", selectedRowKeys: _.pluck(selectQuestionKeys, "id"),
onSelect: (record, selected) => {
this.selectQuestionRow(record, selected);
},
onSelectAll: (selected, selectedRows, changeRows) => {
this.selectQuestionAll(selected, selectedRows, changeRows);
},
}; };
const singleCount = _.filter(
selectQuestionKeys,
(item) => item.questionTypeEnum === "SINGLE_CHOICE"
).length;
const multiCount = _.filter(
selectQuestionKeys,
(item) => item.questionTypeEnum === "MULTI_CHOICE"
).length;
const judgeCount = _.filter(
selectQuestionKeys,
(item) => item.questionTypeEnum === "JUDGE"
).length;
const gapCount = _.filter(
selectQuestionKeys,
(item) => item.questionTypeEnum === "GAP_FILLING"
).length;
const indefiniteCount = _.filter(
selectQuestionKeys,
(item) => item.questionTypeEnum === "INDEFINITE_CHOICE"
).length;
return ( return (
<div className="select-question-content"> <div className="select-question-content">
<div className="select-question-filter"> <div className="select-question-filter">
...@@ -391,17 +362,24 @@ class QuestionListContent extends Component { ...@@ -391,17 +362,24 @@ class QuestionListContent extends Component {
</div> </div>
</Row> </Row>
</div> </div>
<ShowTips <div className="select-tip-box">
message={ <div>
<div> <span className="icon iconfont tip-icon">&#xe61d;</span>
<span>已选{selectQuestionKeys.length}</span>
{selectQuestionKeys.length > 0 && (
<span> <span>
已选{200}题(单选题{1}题、多选题{2}题、判断题{3} {singleCount > 0 && `、单选题${singleCount}题`}
题、填空题{4}题、不定项选择题{5}题) {multiCount > 0 && `、多选题${multiCount}题`}
{judgeCount > 0 && `、判断题${judgeCount}题`}
{gapCount > 0 && `、填空题${gapCount}题`}
{indefiniteCount > 0 && `、不定项选择题${indefiniteCount}题`}
</span> </span>
<span style={{marginLeft: 20}}>清空</span> )}
</div> </div>
} {selectQuestionKeys.length > 0 && (
/> <span className="clear-btn" onClick={() => this.setState({selectQuestionKeys:[]})}>清空</span>
)}
</div>
<div className="question-manage-list"> <div className="question-manage-list">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}> <ConfigProvider renderEmpty={this.customizeRenderEmpty}>
<Table <Table
...@@ -411,7 +389,6 @@ class QuestionListContent extends Component { ...@@ -411,7 +389,6 @@ class QuestionListContent extends Component {
columns={this.parseColumns()} columns={this.parseColumns()}
pagination={false} pagination={false}
bordered bordered
onChange={this.handleChangeTable}
/> />
</ConfigProvider> </ConfigProvider>
<div className="box-footer"> <div className="box-footer">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:26:28 * @Date: 2021-02-25 11:26:28
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-29 13:39:28 * @LastEditTime: 2021-03-30 18:34:50
* @Description: 助学工具-题库-题目管理右侧内容样式 * @Description: 助学工具-题库-题目管理右侧内容样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -75,6 +75,28 @@ ...@@ -75,6 +75,28 @@
} }
} }
} }
.select-tip-box {
background: #fff4dd;
border-radius: 4px;
padding: 6px 16px;
margin-right: 8px;
display: flex;
justify-content: space-between;
.tip-icon {
color: #ff9d14;
font-size: 14px;
margin-right: 4px;
}
.select-num {
color: #666666;
font-size: 14px;
}
.clear-btn {
color: #5289fa;
font-size: 14px;
cursor: pointer;
}
}
} }
.tool-list { .tool-list {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-29 10:52:26 * @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-29 14:09:08 * @LastEditTime: 2021-03-30 19:17:30
* @Description: 助学工具-新建试卷-选择题目弹窗 * @Description: 助学工具-新建试卷-选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,13 +10,13 @@ import React, { Component } from "react"; ...@@ -10,13 +10,13 @@ import React, { Component } from "react";
import { Modal } from "antd"; import { Modal } from "antd";
import CourseCategorySiderTree from "../../components/CourseCategorySiderTree"; import CourseCategorySiderTree from "../../components/CourseCategorySiderTree";
import SelectQuestionContent from "../components/SelectQuestionContent"; import SelectQuestionContent from "../components/SelectQuestionContent";
import "./SelectQuestionModal.less" import "./SelectQuestionModal.less";
class SelectQuestionModal extends Component { class SelectQuestionModal extends Component {
listRef = React.createRef();
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
updatedCategoryId: null,
selectedCategoryId: null, selectedCategoryId: null,
}; };
} }
...@@ -27,18 +27,18 @@ class SelectQuestionModal extends Component { ...@@ -27,18 +27,18 @@ class SelectQuestionModal extends Component {
} }
}; };
updatedSiderTreeFromList = (updatedCategoryId) => {
this.setState({ updatedCategoryId });
};
render() { render() {
const { updatedCategoryId, selectedCategoryId } = this.state;
return ( return (
<Modal <Modal
destroyOnClose={true}
title="选择题目" title="选择题目"
visible={true} visible={true}
width={1200} width={1200}
// onOk={handleOk} onOk={() =>
this.props.setSelectedQuestion(
this.listRef.current.state.selectQuestionKeys
)
}
onCancel={this.props.close} onCancel={this.props.close}
className="select-question-modal" className="select-question-modal"
> >
...@@ -48,15 +48,16 @@ class SelectQuestionModal extends Component { ...@@ -48,15 +48,16 @@ class SelectQuestionModal extends Component {
> >
<div className="sider"> <div className="sider">
<CourseCategorySiderTree <CourseCategorySiderTree
fromModule="modal"
getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)} getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)}
updatedCategoryId
/> />
</div> </div>
</div> </div>
<div className="content"> <div className="content">
<SelectQuestionContent <SelectQuestionContent
updatedSiderTree={this.updatedSiderTreeFromList.bind(this)} fromModule="modal"
selectedCategoryId ref={this.listRef}
selectedCategoryId={this.state.selectedCategoryId}
/> />
</div> </div>
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-21 17:51:01 * @Date: 2021-02-21 17:51:01
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-03-29 16:11:41 * @LastEditTime: 2021-03-30 16:08:58
* @Description: 助学工具-题库-题库主页面 * @Description: 助学工具-题库-题库主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -37,6 +37,7 @@ class QuestionBankIndex extends Component { ...@@ -37,6 +37,7 @@ class QuestionBankIndex extends Component {
> >
<div className="sider"> <div className="sider">
<CourseCategorySiderTree <CourseCategorySiderTree
fromModule="index"
getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)} getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)}
currentTotal={this.state.currentTotal} currentTotal={this.state.currentTotal}
updatedCategoryId={this.state.updatedCategoryId} updatedCategoryId={this.state.updatedCategoryId}
......
...@@ -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-03-29 16:21:50 * @LastEditTime: 2021-03-30 19:33:39
* @Description: 助学工具-题库-列表数据 * @Description: 助学工具-题库-列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -77,8 +77,8 @@ class QuestionManageContent extends Component { ...@@ -77,8 +77,8 @@ class QuestionManageContent extends Component {
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
}, },
dataSource: [], // 题库列表 dataSource: [], // 题库列表
QuestionPreviewModal: null, // 题目预览模态框 questionPreviewModal: null, // 题目预览模态框
BatchImportQuestionModal: null, // 批量导入模态框 batchImportQuestionModal: null, // 批量导入模态框
}; };
} }
...@@ -86,10 +86,7 @@ class QuestionManageContent extends Component { ...@@ -86,10 +86,7 @@ class QuestionManageContent extends Component {
let { selectedCategoryId } = nextProps; let { selectedCategoryId } = nextProps;
const _query = this.state.query; const _query = this.state.query;
if (this.props.selectedCategoryId !== selectedCategoryId) { if (this.props.selectedCategoryId !== selectedCategoryId) {
if (selectedCategoryId === "null") { _query.categoryId = selectedCategoryId === "null" ? null : selectedCategoryId;
selectedCategoryId = null;
}
_query.categoryId = selectedCategoryId;
_query.questionName = null; _query.questionName = null;
_query.questionType = null; _query.questionType = null;
_query.current = 1; _query.current = 1;
...@@ -214,11 +211,10 @@ class QuestionManageContent extends Component { ...@@ -214,11 +211,10 @@ class QuestionManageContent extends Component {
var handleVal = val; var handleVal = val;
handleVal = handleVal.replace(/<(?!img|input).*?>/g, ""); handleVal = handleVal.replace(/<(?!img|input).*?>/g, "");
handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、"); handleVal = handleVal.replace(/<\s?input[^>]*>/gi, "_、");
handleVal = handleVal.replace(/<\s?img[^>]*>/gi, "【图片】");
handleVal = handleVal.replace(/\&nbsp\;/gi, " "); handleVal = handleVal.replace(/\&nbsp\;/gi, " ");
return ( return (
<Tooltip <Tooltip
overlayClassName="tool-list" overlayClassName="aid-tool-list"
title={ title={
<div style={{ maxWidth: 700, width: "auto" }}>{handleVal}</div> <div style={{ maxWidth: 700, width: "auto" }}>{handleVal}</div>
} }
...@@ -324,12 +320,12 @@ class QuestionManageContent extends Component { ...@@ -324,12 +320,12 @@ class QuestionManageContent extends Component {
id={id} id={id}
close={() => { close={() => {
this.setState({ this.setState({
QuestionPreviewModal: null, questionPreviewModal: null,
}); });
}} }}
/> />
); );
this.setState({ QuestionPreviewModal: m }); this.setState({ questionPreviewModal: m });
}; };
// 编辑题目 // 编辑题目
...@@ -393,14 +389,14 @@ class QuestionManageContent extends Component { ...@@ -393,14 +389,14 @@ class QuestionManageContent extends Component {
const m = ( const m = (
<BatchImportQuestionModal <BatchImportQuestionModal
close={() => { close={() => {
this.setState({ BatchImportQuestionModal: null }, () => { this.setState({ batchImportQuestionModal: null }, () => {
this.queryQuestionPageList(); this.queryQuestionPageList();
}); });
}} }}
categoryId={categoryId} categoryId={categoryId}
/> />
); );
this.setState({ BatchImportQuestionModal: m }); this.setState({ batchImportQuestionModal: m });
}; };
render() { render() {
...@@ -408,8 +404,8 @@ class QuestionManageContent extends Component { ...@@ -408,8 +404,8 @@ class QuestionManageContent extends Component {
dataSource = [], dataSource = [],
total, total,
query, query,
QuestionPreviewModal, questionPreviewModal,
BatchImportQuestionModal, batchImportQuestionModal,
} = this.state; } = this.state;
const { current, size, categoryId, questionName, questionType } = query; const { current, size, categoryId, questionName, questionType } = query;
return ( return (
...@@ -514,8 +510,8 @@ class QuestionManageContent extends Component { ...@@ -514,8 +510,8 @@ class QuestionManageContent extends Component {
/> />
</div> </div>
)} )}
{QuestionPreviewModal} {questionPreviewModal}
{BatchImportQuestionModal} {batchImportQuestionModal}
</div> </div>
</div> </div>
); );
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
} }
} }
} }
.tool-list { .aid-tool-list {
.ant-tooltip-inner { .ant-tooltip-inner {
max-width: 700px !important; max-width: 700px !important;
} }
......
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