Commit 6e01f9ee by yuananting

fix:助学工具文件合并修改

parent 1ded60fc
......@@ -9,7 +9,7 @@
import React, { Component } from "react";
import Breadcrumbs from "@/components/Breadcrumbs";
import "./CourseCategoryManage.less";
import NewEditCourseCategoryModal from "../modal/NewEditCourseCategoryModal";
import OpearteCourseCategoryModal from "../modal/OpearteCourseCategoryModal";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import User from "@/common/js/user";
import {
......@@ -30,7 +30,7 @@ class CourseCategoryManage extends Component {
constructor(props) {
super(props);
this.state = {
newEditCourseCategoryModal: null, //新增或编辑分类模态框
operateCourseCategoryModal: null, //新增或编辑分类模态框
treeData: [],
originTreeData: [],
treeMap: {},
......@@ -297,7 +297,7 @@ class CourseCategoryManage extends Component {
break;
}
const m = (
<NewEditCourseCategoryModal
<OpearteCourseCategoryModal
node={node}
addLevelType={addLevelType}
type={type}
......@@ -306,12 +306,12 @@ class CourseCategoryManage extends Component {
close={() => {
this.queryCategoryTree("change", this.state.categoryName);
this.setState({
newEditCourseCategoryModal: null,
operateCourseCategoryModal: null,
});
}}
/>
);
this.setState({ newEditCourseCategoryModal: m });
this.setState({ operateCourseCategoryModal: m });
};
// 删除分类
......@@ -586,7 +586,7 @@ class CourseCategoryManage extends Component {
expandedKeys,
selectedKeys,
autoExpandParent,
newEditCourseCategoryModal,
operateCourseCategoryModal,
} = this.state;
return (
<div className="page course-category-manage">
......@@ -594,9 +594,7 @@ class CourseCategoryManage extends Component {
<Breadcrumbs
navList="课程分类"
goBack={() =>
window.RCHistory.push({
pathname: "/question-bank-index",
})
window.RCHistory.goBack()
}
/>
) : (
......@@ -649,7 +647,7 @@ class CourseCategoryManage extends Component {
></DirectoryTree>
</div>
</div>
{newEditCourseCategoryModal}
{operateCourseCategoryModal}
</div>
);
}
......
......@@ -3,7 +3,7 @@
* @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting
* @LastEditTime: 2021-04-01 14:15:23
* @Description: 助学工具-课程分类侧边栏
* @Description: 助学工具-侧边课程分类树
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
......
import React, { useState, useRef, useEffect, useContext } from 'react'
import { message, Modal } from 'antd';
import { withRouter } from 'react-router-dom';
import ExaminationPaperContent from '../examination-paper/ExaminationPaperContent'
import PaperContent from '../paper-manage/PaperContent'
import './AddExam.less';
import user from '@/common/js/user';
......@@ -26,7 +26,7 @@ function SelectPaperModal(props: any) {
}
onCancel={() => { props.close() }}
>
<ExaminationPaperContent paperId={item.paperId} onSelect={(item: any) => { setItem(item) }} type='modal-select'></ExaminationPaperContent>
<PaperContent paperId={item.paperId} onSelect={(item: any) => { setItem(item) }} type='modal-select'></PaperContent>
</Modal >
}
......
......@@ -3,14 +3,13 @@
* @Date: 2021-03-27 14:55:14
* @LastEditors: yuananting
* @LastEditTime: 2021-04-01 14:00:47
* @Description: 助学工具-试卷主页面
* @Description: 助学工具-试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
import "./ExaminationPaperIndex.less";
import ExaminationPaperContent from "./ExaminationPaperContent";
import PaperContent from "./PaperContent";
class ExaminationPaperIndex extends Component {
class PaperIndex extends Component {
constructor(props) {
super(props);
this.state = {};
......@@ -19,14 +18,14 @@ class ExaminationPaperIndex extends Component {
render() {
return (
<div className="examination-paper-index page">
<div className="paper-manage-index page">
<div className="content-header">试卷</div>
<div className="box content-body">
<ExaminationPaperContent type=''></ExaminationPaperContent>
<PaperContent type=''></PaperContent>
</div>
</div>
);
}
}
export default ExaminationPaperIndex;
export default PaperIndex;
/*
* @Author: yuananting
* @Date: 2021-02-25 13:52:01
* @LastEditors: yuananting
* @LastEditTime: 2021-03-31 16:06:32
* @Description: 助学工具-新建试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
.new-examination-paper {
.operate-paper-page {
position: relative !important;
.box {
margin-bottom: 66px !important;
......
......@@ -7,11 +7,11 @@
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
import "./ExaminationPaperIndex.less";
import "./PaperContent.less"
import CourseCategorySiderTree from "../components/CourseCategorySiderTree";
import ExaminationPaperContent from "./components/ExaminationPaperContent";
import PaperList from "./components/PaperList";
class ExaminationPaperIndex extends Component {
class PaperContent extends Component {
constructor(props) {
super(props);
this.state = {};
......@@ -29,7 +29,7 @@ class ExaminationPaperIndex extends Component {
render() {
return (
<div className='examination-paper-content'>
<div className='paper-content-page'>
<div
style={{ borderRight: "0.5px solid #EEEEEE", paddingRight: "4px" }}
>
......@@ -44,7 +44,7 @@ class ExaminationPaperIndex extends Component {
</div>
</div>
<div className="content">
<ExaminationPaperContent
<PaperList
paperId={this.props.paperId}
onSelect={this.props.onSelect}
type={this.props.type}
......@@ -53,10 +53,8 @@ class ExaminationPaperIndex extends Component {
/>
</div>
</div>
);
}
}
export default ExaminationPaperIndex;
export default PaperContent;
.examination-paper-content{
.paper-content-page {
display: flex;
.site-layout-background {
background: #fff;
}
.sider {
min-width: 244px;
}
......@@ -12,4 +8,4 @@
margin-left: 24px;
height: calc(100vh - 160px);
}
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
* @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting
* @LastEditTime: 2021-04-01 15:06:37
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Description: 助学工具-题库-试卷列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
......@@ -17,17 +17,19 @@ import {
Button,
Modal,
message,
ConfigProvider,
Empty,
} from "antd";
import { PageControl } from "@/components";
import "./ExaminationPaperContent.less";
import "./PaperList.less";
import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import _ from "underscore";
import PaperPreviewModal from "../modal/PaperPreviewModal";
import PaperPreviewModal from "../modal/PreviewPaperModal";
const { Search } = Input;
class ExaminationPaperContent extends Component {
class PaperList extends Component {
constructor(props) {
super(props);
this.state = {
......@@ -74,6 +76,7 @@ class ExaminationPaperContent extends Component {
previewPaper = (record) => {
const m = (
<PaperPreviewModal
previewPage="paper-list"
categoryId={this.state.query.categoryId}
paperId={record.paperId}
close={() => {
......@@ -87,13 +90,18 @@ class ExaminationPaperContent extends Component {
};
// 复制试卷
copyPaper = (record) => { };
copyPaper = (record) => {
const { categoryId } = this.state.query;
window.RCHistory.push({
pathname: `/paper-operate-page?type=copy&paperId=${record.paperId}&categoryId=${categoryId}`,
});
};
// 编辑试卷
editPaper = (record) => {
const { categoryId } = this.state.query;
window.RCHistory.push({
pathname: `/new-examination-paper?paperId=${record.paperId}&categoryId=${categoryId}`,
pathname: `/paper-operate-page/operate?type=edit&paperId=${record.paperId}&categoryId=${categoryId}`,
});
};
......@@ -133,6 +141,19 @@ class ExaminationPaperContent extends Component {
});
}
// 自定义表格空状态
customizeRenderEmpty = () => {
return (
<Empty
image="https://image.xiaomaiketang.com/xm/emptyTable.png"
imageStyle={{
height: 100,
}}
description={"还没有试卷"}
></Empty>
);
};
// 表头设置
parseColumns = () => {
const columns = [
......@@ -207,9 +228,7 @@ class ExaminationPaperContent extends Component {
<span className="record-operate__item split"> | </span>
<div
className="record-operate__item"
onClick={() =>
this.toEditQuetion(record.id, record.questionTypeEnum)
}
onClick={() => this.copyPaper(record)}
>
复制
</div>
......@@ -250,7 +269,6 @@ class ExaminationPaperContent extends Component {
};
onSelectChange = (selectedRowKeys, selectedRows) => {
console.log(selectedRowKeys, selectedRows)
this.setState({
selectedRowKeys
})
......@@ -268,8 +286,8 @@ class ExaminationPaperContent extends Component {
};
return (
<div className={"question-manage-content " + this.props.type}>
<div className="question-manage-filter">
<div className={"paper-list " + this.props.type}>
<div className="paper-list-filter">
<Row type="flex" justify="space-between" align="top">
<div className="search-condition">
<div className="search-condition__item">
......@@ -301,7 +319,7 @@ class ExaminationPaperContent extends Component {
type="primary"
onClick={() => {
window.RCHistory.push({
pathname: `/new-examination-paper?categoryId=${categoryId}`,
pathname: `/paper-operate-page?type=new&categoryId=${categoryId}`,
});
}}
>
......@@ -309,28 +327,30 @@ 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
<div className="paper-list-content">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}>
{(this.props.type !== 'modal-select') ? < Table
rowKey={(record) => record.id}
dataSource={dataSource}
rowKey={(item) => {
return item.paperId
}}
rowSelection={rowSelection}
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}
/>
}
</ConfigProvider>
{total > 0 && (
<div className="box-footer">
......@@ -356,4 +376,4 @@ class ExaminationPaperContent extends Component {
}
}
export default ExaminationPaperContent;
export default PaperList;
\ No newline at end of file
/*
* @Author: yuananting
* @Date: 2021-02-25 11:26:28
* @LastEditors: yuananting
* @LastEditTime: 2021-03-25 14:32:01
* @Description: 助学工具-题库-题目管理右侧内容样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
.question-manage-content {
.question-manage-filter {
.paper-list {
.paper-list-filter {
position: relative;
.search-condition {
......@@ -51,7 +42,7 @@
.data-icon {
cursor: pointer;
}
.question-manage-list {
.paper-list-content {
position: relative;
margin-top: 16px;
.empty-list-tip {
......
......@@ -15,17 +15,13 @@ import {
Input,
Select,
Tooltip,
Space,
Button,
Modal,
message,
} from "antd";
import { PageControl } from "@/components";
import "./SelectQuestionContent.less";
import "./SelectQuestionList.less";
import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import _ from "underscore";
import ShowTips from "@/components/ShowTips";
const { Search } = Input;
......@@ -60,7 +56,7 @@ const questionTypeList = [
},
];
class QuestionListContent extends Component {
class SelectQuestionList extends Component {
constructor(props) {
super(props);
this.state = {
......@@ -104,12 +100,6 @@ class QuestionListContent extends Component {
});
};
handleCreateQuestionBank = () => {
window.RCHistory.push({
pathname: `/create-new-question?categoryId=${this.state.query.categoryId}`,
});
};
// 清空搜索条件
handleReset = () => {
const _query = {
......@@ -298,7 +288,7 @@ class QuestionListContent extends Component {
(item) => item.questionTypeEnum === "INDEFINITE_CHOICE"
).length;
return (
<div className="select-question-content">
<div className="select-question-list">
<div className="select-question-filter">
<Row type="flex" justify="space-between" align="top">
<div className="search-condition">
......@@ -380,7 +370,7 @@ class QuestionListContent extends Component {
<span className="clear-btn" onClick={() => this.setState({selectQuestionKeys:[]})}>清空</span>
)}
</div>
<div className="question-manage-list">
<div className="select-question-content">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}>
<Table
rowSelection={rowSelection}
......@@ -412,4 +402,4 @@ class QuestionListContent extends Component {
}
}
export default QuestionListContent;
export default SelectQuestionList;
/*
* @Author: yuananting
* @Date: 2021-02-25 11:26:28
* @LastEditors: yuananting
* @LastEditTime: 2021-03-30 18:34:50
* @Description: 助学工具-题库-题目管理右侧内容样式
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
.select-question-content {
.select-question-list {
.select-question-filter {
position: relative;
.search-condition {
......@@ -49,7 +41,7 @@
.data-icon {
cursor: pointer;
}
.question-manage-list {
.select-question-content {
position: relative;
margin-top: 16px;
.empty-list-tip {
......
......@@ -10,7 +10,7 @@ import React, { Component } from "react";
import { Modal } from "antd";
import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import "./PaperPreviewModal.less";
import "./PreviewPaperModal.less";
import ScanFileModal from "@/modules/resource-disk/modal/ScanFileModal";
import _ from "underscore";
import XMAudio from "../../components/XMAudio";
......@@ -23,20 +23,22 @@ const questionTypeList = {
INDEFINITE_CHOICE: "不定项选择题",
};
class PaperPreviewModal extends Component {
class PreviewPaperModal extends Component {
formRef = React.createRef();
constructor(props) {
super(props);
this.state = {
paperInfo: {
paperName: null,
questionList: [],
},
paperInfo: {},
};
}
componentDidMount() {
this.queryPaperDetail();
const { previewPage, paperInfo } = this.props;
if (previewPage === "paper-list") {
this.queryPaperDetail();
} else if (previewPage === "paper-operate") {
this.setState({ paperInfo });
}
}
// 题目预览
......@@ -144,32 +146,30 @@ class PaperPreviewModal extends Component {
renderAnswer = (optionList, gapFillingAnswerList, questionType) => {
if (questionType === "GAP_FILLING") {
{
_.map(gapFillingAnswerList, (gapItem, gapIndex) => {
const { correctAnswerList } = gapItem;
return (
<div>
<span>【填空{gapIndex + 1}</span>
{_.map(correctAnswerList, (answerItem) => {
return <span>{answerItem}</span>;
})}
</div>
);
});
return (
<div className="answer-line__item">
<span>正确答案</span>
{_.map(gapFillingAnswerList, (gapItem, gapIndex) => {
const { correctAnswerList } = gapItem;
return (
<div className="gap-list">
<span>【填空{gapIndex + 1}</span>
{_.map(correctAnswerList, (answerItem) => {
return <span>{answerItem}</span>;
})}
</div>
);
})}
</div>
)
}
} else {
const correctAnswerOption = _.filter(
optionList,
(item) => item.isCorrectAnswer === 1
);
const correctOptionSort =
correctAnswerOption.length > 0 &&
correctAnswerOption.map((item) => {
return NUM_TO_WORD_MAP[item.optionSort];
});
const correctAnswerOption = _.filter(optionList, (item) => item.isCorrectAnswer === 1);
const correctOptionSort = correctAnswerOption.map((item) => { return NUM_TO_WORD_MAP[item.optionSort] });
return (
<div className="answer-line__item">
<span>正确答案</span>
{/* <span>【{correctOptionSort.join("、")}】</span> */}
<span>{correctOptionSort.length > 0 && correctOptionSort.join("、")}</span>
</div>
);
}
......@@ -247,7 +247,7 @@ class PaperPreviewModal extends Component {
>
<h2 style={{ textAlign: "center" }}>{paperName}</h2>
<div className="question-list-box">
{questionList.map((questionItem, questionIndex) => {
{_.map(questionList, (questionItem, questionIndex) => {
const {
questionStemList,
optionList,
......@@ -255,7 +255,6 @@ class PaperPreviewModal extends Component {
questionType,
score,
} = questionItem;
console.log(optionList);
return (
<div className="question-info-item">
{this.renderStem(
......@@ -281,4 +280,4 @@ class PaperPreviewModal extends Component {
);
}
}
export default PaperPreviewModal;
export default PreviewPaperModal;
......@@ -3,13 +3,13 @@
* @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting
* @LastEditTime: 2021-04-02 19:41:26
* @Description: 助学工具-新建试卷-选择题目弹窗
* @Description: 助学工具-试卷-新建选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
import { Modal } from "antd";
import CourseCategorySiderTree from "../../components/CourseCategorySiderTree";
import SelectQuestionContent from "../components/SelectQuestionContent";
import SelectQuestionList from "../components/SelectQuestionList";
import "./SelectQuestionModal.less";
class SelectQuestionModal extends Component {
......@@ -76,7 +76,7 @@ class SelectQuestionModal extends Component {
</div>
</div>
<div className="content">
<SelectQuestionContent
<SelectQuestionList
ref={this.listRef}
selectedCategoryId={this.state.selectedCategoryId}
/>
......
......@@ -3,15 +3,15 @@
* @Date: 2021-02-21 17:51:01
* @LastEditors: yuananting
* @LastEditTime: 2021-04-01 14:10:41
* @Description: 助学工具-题库-题库主页面
* @Description: 助学工具-题库
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
import "./QuestionBankIndex.less";
import "./Index.less";
import CourseCategorySiderTree from "../components/CourseCategorySiderTree";
import QuestionManageContent from "./components/QuestionManageContent";
import QuestionList from "./components/QuestionList";
class QuestionBankIndex extends Component {
class QuestionIndex extends Component {
constructor(props) {
super(props);
this.state = {};
......@@ -29,7 +29,7 @@ class QuestionBankIndex extends Component {
render() {
return (
<div className="question-bank-index page">
<div className="question-manage-index page">
<div className="content-header">题目</div>
<div className="box content-body">
<div
......@@ -45,7 +45,7 @@ class QuestionBankIndex extends Component {
</div>
</div>
<div className="content">
<QuestionManageContent
<QuestionList
updatedSiderTree={this.updatedSiderTreeFromList.bind(this)}
selectedCategoryId={this.state.selectedCategoryId}
/>
......@@ -56,4 +56,4 @@ class QuestionBankIndex extends Component {
}
}
export default QuestionBankIndex;
export default QuestionIndex;
.question-bank-index {
.question-manage-index {
.content-body {
display: flex;
.site-layout-background {
background: #fff;
}
.sider {
min-width: 244px;
}
......
......@@ -3,15 +3,15 @@
* @Date: 2021-02-25 13:46:35
* @LastEditors: yuananting
* @LastEditTime: 2021-03-29 20:24:01
* @Description: 助学工具-题库-新建题目
* @Description: 助学工具-题库-新建/编辑题目
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
import { Tabs, Button, Tooltip, message, Modal } from "antd";
import Breadcrumbs from "@/components/Breadcrumbs";
import ShowTips from "@/components/ShowTips";
import "./AddNewQuestion.less";
import NewQuestionTab from "./components/NewQuestionTab";
import "./OperateQuestion.less";
import OperateQuestionTab from "./components/OperateQuestionTab";
import {
defineJudgeOptionInfo,
defineOptionInfo,
......@@ -21,7 +21,7 @@ import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import User from "@/common/js/user";
const { TabPane } = Tabs;
class AddNewQuestion extends Component {
class OperateQuestion extends Component {
constructor(props) {
super(props);
let activeKey = "";
......@@ -161,7 +161,7 @@ class AddNewQuestion extends Component {
),
onOk: () => {
window.RCHistory.push({
pathname: `/question-bank-index?categoryId=${getParameterByName("categoryId")}`,
pathname: `/question-manage-index?categoryId=${getParameterByName("categoryId")}`,
});
},
});
......@@ -246,7 +246,7 @@ class AddNewQuestion extends Component {
}
if (next === "close") {
window.RCHistory.push({
pathname: `/question-bank-index?categoryId=${categoryId}`,
pathname: `/question-manage-index?categoryId=${categoryId}`,
});
}
}
......@@ -267,7 +267,7 @@ class AddNewQuestion extends Component {
}
if (next === "close") {
window.RCHistory.push({
pathname: `/question-bank-index?categoryId=${categoryId}`,
pathname: `/question-manage-index?categoryId=${categoryId}`,
});
}
}
......@@ -291,7 +291,7 @@ class AddNewQuestion extends Component {
} = this.state;
const categoryId = getParameterByName("categoryId");
return (
<div className="page add-new-question">
<div className="page operate-question-page">
<Breadcrumbs
navList={
getParameterByName("id") && this.state.currentOperate === "edit"
......@@ -328,7 +328,7 @@ class AddNewQuestion extends Component {
}
key="SINGLE_CHOICE"
>
<NewQuestionTab
<OperateQuestionTab
questionTypeKey={activeKey}
onRef={(ref) => {
this.singleChoiceRef = ref;
......@@ -357,7 +357,7 @@ class AddNewQuestion extends Component {
}
key="MULTI_CHOICE"
>
<NewQuestionTab
<OperateQuestionTab
questionTypeKey={activeKey}
onRef={(ref) => {
this.multiChoiceRef = ref;
......@@ -385,7 +385,7 @@ class AddNewQuestion extends Component {
}
key="JUDGE"
>
<NewQuestionTab
<OperateQuestionTab
questionTypeKey={activeKey}
onRef={(ref) => {
this.judgeRef = ref;
......@@ -413,7 +413,7 @@ class AddNewQuestion extends Component {
}
key="GAP_FILLING"
>
<NewQuestionTab
<OperateQuestionTab
questionTypeKey={activeKey}
onRef={(ref) => {
this.gapRef = ref;
......@@ -451,7 +451,7 @@ class AddNewQuestion extends Component {
}
key="INDEFINITE_CHOICE"
>
<NewQuestionTab
<OperateQuestionTab
questionTypeKey={activeKey}
onRef={(ref) => {
this.indefiniteRef = ref;
......@@ -496,4 +496,4 @@ class AddNewQuestion extends Component {
}
}
export default AddNewQuestion;
export default OperateQuestion;
.add-new-question {
.operate-question-page {
position: relative !important;
.box {
margin-bottom: 66px !important;
......
......@@ -3,7 +3,7 @@
* @Date: 2021-02-25 14:34:29
* @LastEditors: yuananting
* @LastEditTime: 2021-03-29 16:22:15
* @Description: 助学工具-题库-新建题目Tab
* @Description: 助学工具-题库-操作题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
......@@ -17,7 +17,7 @@ import {
Input,
Popover,
} from "antd";
import "./NewQuestionTab.less";
import "./OperateQuestionTab.less";
import QuestionEditor from "./QuestionEditor";
import { PlusOutlined, CloseOutlined } from "@ant-design/icons";
import {
......@@ -34,7 +34,7 @@ import ScanFileModal from "@/modules/resource-disk/modal/ScanFileModal";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import _ from "lodash";
class NewQuestionTab extends Component {
class OperateQuestionTab extends Component {
constructor(props) {
super(props);
const { questionInfo = {} } = props;
......@@ -1377,4 +1377,4 @@ class NewQuestionTab extends Component {
}
}
export default NewQuestionTab;
export default OperateQuestionTab;
......@@ -3,7 +3,7 @@
* @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting
* @LastEditTime: 2021-04-01 13:47:54
* @Description: 助学工具-题库-列表数据
* @Description: 助学工具-题库-题目列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import React, { Component } from "react";
......@@ -21,11 +21,11 @@ import {
message,
} from "antd";
import { PageControl } from "@/components";
import "./QuestionManageContent.less";
import "./QuestionList.less";
import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import _ from "underscore";
import QuestionPreviewModal from "../modal/QuestionPreviewModal";
import PreviewQuestionModal from "../modal/PreviewQuestionModal";
import BatchImportQuestionModal from "../modal/BatchImportQuestionModal";
const { Search } = Input;
......@@ -61,7 +61,7 @@ const questionTypeList = [
},
];
class QuestionManageContent extends Component {
class QuestionList extends Component {
constructor(props) {
super(props);
this.state = {
......@@ -77,7 +77,7 @@ class QuestionManageContent extends Component {
userId: User.getStoreUserId(),
},
dataSource: [], // 题库列表
questionPreviewModal: null, // 题目预览模态框
previewQuestionModal: null, // 题目预览模态框
batchImportQuestionModal: null, // 批量导入模态框
};
}
......@@ -156,7 +156,7 @@ class QuestionManageContent extends Component {
<span
className="empty-list-tip"
onClick={() => {
this.handleCreateQuestionBank();
this.handleCreateQuestion();
}}
>
新建一个
......@@ -315,23 +315,23 @@ class QuestionManageContent extends Component {
// 预览题目
previewQuestion = (id) => {
const m = (
<QuestionPreviewModal
<PreviewQuestionModal
id={id}
close={() => {
this.setState({
questionPreviewModal: null,
previewQuestionModal: null,
});
}}
/>
);
this.setState({ questionPreviewModal: m });
this.setState({ previewQuestionModal: m });
};
// 编辑题目
editQuestion = (id, type) => {
const { categoryId } = this.state.query;
window.RCHistory.push({
pathname: `/create-new-question?id=${id}&type=${type}&categoryId=${categoryId}`,
pathname: `question-operate-page?id=${id}&type=${type}&categoryId=${categoryId}`,
});
};
......@@ -376,9 +376,9 @@ class QuestionManageContent extends Component {
};
// 创建题目-跳转新建页
handleCreateQuestionBank = () => {
handleCreateQuestion = () => {
window.RCHistory.push({
pathname: `/create-new-question?categoryId=${this.state.query.categoryId}`,
pathname: `question-operate-page?categoryId=${this.state.query.categoryId}`,
});
};
......@@ -403,13 +403,13 @@ class QuestionManageContent extends Component {
dataSource = [],
total,
query,
questionPreviewModal,
previewQuestionModal,
batchImportQuestionModal,
} = this.state;
const { current, size, categoryId, questionName, questionType } = query;
return (
<div className="question-manage-content">
<div className="question-manage-filter">
<div className="question-list">
<div className="question-list-filter">
<Row type="flex" justify="space-between" align="top">
<div className="search-condition">
<div className="search-condition__item">
......@@ -475,13 +475,13 @@ class QuestionManageContent extends Component {
{["CloudManager", "StoreManager"].includes(User.getUserRole()) &&
categoryId && (
<Space size={16}>
<Button type="primary" onClick={this.handleCreateQuestionBank}>
<Button type="primary" onClick={this.handleCreateQuestion}>
新建题目
</Button>
<Button onClick={this.batchImportQuestion}>批量导入</Button>
</Space>
)}
<div className="question-manage-list">
<div className="question-list-content">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}>
<Table
rowKey={(record) => record.id}
......@@ -509,7 +509,7 @@ class QuestionManageContent extends Component {
/>
</div>
)}
{questionPreviewModal}
{previewQuestionModal}
{batchImportQuestionModal}
</div>
</div>
......@@ -517,4 +517,4 @@ class QuestionManageContent extends Component {
}
}
export default QuestionManageContent;
export default QuestionList;
.question-manage-content {
.question-manage-filter {
.question-list {
.question-list-filter {
position: relative;
.search-condition {
width: calc(100% - 80px);
......@@ -41,7 +41,7 @@
.data-icon {
cursor: pointer;
}
.question-manage-list {
.question-list-content {
position: relative;
margin-top: 16px;
.empty-list-tip {
......
......@@ -10,7 +10,7 @@ import React, { Component } from "react";
import { Modal } from "antd";
import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import "./QuestionPreviewModal.less";
import "./PreviewQuestionModal.less";
import ScanFileModal from "@/modules/resource-disk/modal/ScanFileModal";
import _ from "underscore";
import XMAudio from "../../components/XMAudio";
......@@ -23,7 +23,7 @@ const questionTypeList = {
INDEFINITE_CHOICE: "不定项选择题",
};
class QuestionPreviewModal extends Component {
class PreviewQuestionModal extends Component {
formRef = React.createRef();
constructor(props) {
super(props);
......@@ -98,7 +98,7 @@ class QuestionPreviewModal extends Component {
return (
<div>
<Modal
className="question-preview-modal"
className="preview-question-modal"
visible={true}
title="题目预览"
width={560}
......@@ -449,4 +449,4 @@ class QuestionPreviewModal extends Component {
);
}
}
export default QuestionPreviewModal;
export default PreviewQuestionModal;
......@@ -277,6 +277,6 @@
}
}
}
.question-preview-modal.ant-modal {
.preview-question-modal.ant-modal {
max-height: 60% !important;
}
......@@ -26,11 +26,10 @@ import AddPlanPage from '@/modules/plan-manage/AddPlan';
import LearningDataPage from '@/modules/plan-manage/LearningData';
import StoreInfoPage from '@/modules/store-manage/StoreInfo';
import CourseCategoryManage from '@/modules/teach-tool/components/CourseCategoryManage';
import QuestionBankIndex from '@/modules/teach-tool/question-bank/QuestionBankIndex';
import AddNewQuestion from '@/modules/teach-tool/question-bank/AddNewQuestion';
import ExaminationPaperIndex from '@/modules/teach-tool/examination-paper/ExaminationPaperIndex';
import NewExaminationPaper from '@/modules/teach-tool/examination-paper/NewExaminationPaper';
import QuestionManageIndex from '@/modules/teach-tool/question-manage/Index';
import OperateQuestion from "@/modules/teach-tool/question-manage/OperateQuestion";
import PaperManageIndex from '@/modules/teach-tool/paper-manage/Index';
import OperatePaper from "@/modules/teach-tool/paper-manage/OperatePaper";
import ExaminationManagerIndex from '@/modules/teach-tool/examination-manager/Index';
const mainRoutes = [
......@@ -100,33 +99,30 @@ const mainRoutes = [
name: '资料云盘'
},
{
path: '/question-bank-index',
component:QuestionBankIndex,
path: '/question-manage-index',
component:QuestionManageIndex,
name: '题库'
},
{
path: '/create-new-question',
component:AddNewQuestion,
name: '新增题目'
path: '/question-operate-page',
component:OperateQuestion,
name: '操作题目'
},
{
path: '/examination-paper-index',
component:ExaminationPaperIndex,
path: '/paper-manage-index',
component:PaperManageIndex,
name: '试卷'
},
{
path: '/new-examination-paper',
component:NewExaminationPaper,
name: '新建试卷'
path: '/paper-operate-page',
component:OperatePaper,
name: '操作试卷'
},
{
path: '/examination-manage-index',
component:ExaminationManagerIndex,
name: '考试'
},
{
path: '/course-category-manage',
component:CourseCategoryManage,
......
......@@ -61,12 +61,12 @@ export const menuList: any = [
{
groupName: "题库",
groupCode: "QuestionBank",
link: '/question-bank-index'
link: '/question-manage-index'
},
{
groupName: "试卷",
groupCode: "QuestionBank",
link: '/examination-paper-index'
link: '/paper-manage-index'
},
{
groupName: "考试",
......
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