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-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: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