Commit 4898b7f5 by yuananting

feat:新建试卷联调

parent 3cfa93ca
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-03 15:13:12
* @LastEditors: yuananting
* @LastEditTime: 2021-03-17 11:40:41
* @LastEditTime: 2021-03-31 18:14:09
* @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -29,10 +29,6 @@ export function editCategoryTree(params: object) {
return Service.Hades("public/hades/editCategoryTree", params);
}
export function queryQuestionCategoryTree(params: object) {
return Service.Hades("public/hades/queryQuestionCategoryTree", params);
}
export function queryQuestionPageList(params: object) {
return Service.Hades("public/hades/queryQuestionPageList", params);
}
......
/*
* @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01
* @LastEditTime: 2021-03-27 14:25:54
* @LastEditTime: 2021-03-31 18:26:22
* @LastEditors: yuananting
* @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
......@@ -9,7 +9,7 @@
import { MapInterface } from '@/domains/basic-domain/interface'
// 默认是 dev 环境
const ENV: string = process.env.DEPLOY_ENV || 'dev';
const ENV: string = process.env.DEPLOY_ENV || 'dev1';
console.log("process.env.DEPLOY_ENV",process)
const BASIC_HOST_MAP: MapInterface = {
dev: 'https://dev-heimdall.xiaomai5.com/',
......
......@@ -2,11 +2,11 @@
* @Author: yuananting
* @Date: 2021-03-11 11:34:37
* @LastEditors: yuananting
* @LastEditTime: 2021-03-16 15:12:09
* @LastEditTime: 2021-03-31 18:14:42
* @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import { queryCategoryTree, addCategory, delCategory, editCategory, editCategoryTree, queryQuestionCategoryTree, addQuestion, queryQuestionPageList, deleteQuestion, queryQuestionDetails, editQuestion, batchImport } from '@/data-source/questionBank/request-apis';
import { queryCategoryTree, addCategory, delCategory, editCategory, editCategoryTree, addQuestion, queryQuestionPageList, deleteQuestion, queryQuestionDetails, editQuestion, batchImport } from '@/data-source/questionBank/request-apis';
export default class QuestionBankService {
// 获取题目分类树
static queryCategoryTree(params: any) {
......@@ -33,11 +33,6 @@ export default class QuestionBankService {
return editCategoryTree(params);
}
// 查询分类树列表
static queryQuestionCategoryTree(params: any) {
return queryQuestionCategoryTree(params);
}
// 查询题目列表
static queryQuestionPageList(params: any) {
return queryQuestionPageList(params);
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-23 18:28:50
* @LastEditors: yuananting
* @LastEditTime: 2021-03-30 14:25:47
* @LastEditTime: 2021-03-31 18:36:34
* @Description: 助学工具-课程分类
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -45,20 +45,22 @@ class CourseCategoryManage extends Component {
getWholeTree = () => {
let query = {
bizType: "QUESTION",
count: false,
source: 0,
userId: User.getStoreUserId(),
tenantId: User.getStoreId(),
};
QuestionBankService.queryCategoryTree(query).then((res) => {
const { result } = res;
this.setState({ originTreeData: result }, () => {
const { categoryList = [] } = res.result;
this.setState({ originTreeData: categoryList }, () => {
let map = {};
let topItem = [];
result.forEach((item) => {
categoryList.forEach((item) => {
topItem.push(item);
});
this.setState({
treeMap: Object.assign(this.getTreeMap(result, map), {
treeMap: Object.assign(this.getTreeMap(categoryList, map), {
0: {
sonCategoryList: topItem,
},
......@@ -73,19 +75,21 @@ class CourseCategoryManage extends Component {
this.getWholeTree();
this.setState({ categoryName });
let query = {
bizType: "QUESTION",
count: false,
source: 0,
categoryName,
userId: User.getStoreUserId(),
tenantId: User.getStoreId(),
};
QuestionBankService.queryCategoryTree(query).then((res) => {
const { result = [] } = res;
const { categoryList = [] } = res.result;
let str = "未分类";
if (categoryName) {
this.setState({ autoExpandParent: true });
if (str.indexOf(categoryName) < 0) {
this.setState({
treeData: this.renderTreeNodes(result, categoryName),
treeData: this.renderTreeNodes(categoryList, categoryName),
});
let nodeId = [];
Object.keys(this.state.treeMap).forEach((item) => {
......@@ -100,9 +104,9 @@ class CourseCategoryManage extends Component {
parentId: "0",
categoryLevel: 0,
};
result.unshift(defaultNode);
categoryList.unshift(defaultNode);
this.setState({
treeData: this.renderTreeNodes(result, categoryName),
treeData: this.renderTreeNodes(categoryList, categoryName),
});
let nodeId = [];
Object.keys(this.state.treeMap).forEach((item) => {
......@@ -121,8 +125,8 @@ class CourseCategoryManage extends Component {
parentId: "0",
categoryLevel: 0,
};
result.unshift(defaultNode);
this.setState({ treeData: this.renderTreeNodes(result, categoryName) });
categoryList.unshift(defaultNode);
this.setState({ treeData: this.renderTreeNodes(categoryList, categoryName) });
if (operateType === "search") {
this.setState({ expandedKeys: [] });
}
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting
* @LastEditTime: 2021-03-30 16:40:58
* @LastEditTime: 2021-03-31 19:23:40
* @Description: 助学工具-课程分类侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -20,7 +20,7 @@ class CourseCategorySiderTree extends Component {
super(props);
this.state = {
selectedKeys:
props.fromModule === "index"
props.fromModule === "QUESTION_INDEX"
? [getParameterByName("categoryId") || "null"]
: ["null"],
treeData: props.treeData || [],
......@@ -31,7 +31,7 @@ class CourseCategorySiderTree extends Component {
componentDidMount() {
this.queryCategoryTree("change");
this.props.getSelectedCategoryId(
this.props.fromModule === "index"
this.props.fromModule === "QUESTION_INDEX"
? [getParameterByName("categoryId") || "null"]
: ["null"]
);
......@@ -40,7 +40,7 @@ class CourseCategorySiderTree extends Component {
shouldComponentUpdate(nextProps, nextState) {
const { currentTotal, updatedCategoryId } = nextProps;
if (
this.props.fromModule === "index" &&
this.props.fromModule === "QUESTION_INDEX" &&
this.props.currentTotal !== currentTotal &&
this.props.updatedCategoryId === updatedCategoryId
) {
......@@ -52,12 +52,14 @@ class CourseCategorySiderTree extends Component {
// 查询分类树
queryCategoryTree = (type, categoryName) => {
let query = {
source: 0,
bizType: ["QUESTION_INDEX", "QUESTION_MODAL"].includes(this.props.fromModule) ? "QUESTION" : "PAPER",
categoryName,
count: true,
source: 0,
userId: User.getStoreUserId(),
tenantId: User.getStoreId(),
};
QuestionBankService.queryQuestionCategoryTree(query).then((res) => {
QuestionBankService.queryCategoryTree(query).then((res) => {
const { categoryList = [], noCategoryCnt = 0 } = res.result;
let str = "未分类";
if (categoryName) {
......@@ -195,9 +197,10 @@ class CourseCategorySiderTree extends Component {
selectedKeys,
autoExpandParent,
} = this.state;
return (
<div className="category-tree-sider">
<div className="sider-title">题目分类</div>
{["QUESTION_INDEX", "PAPER_INDEX"].includes(this.props.fromModule) && <div className="sider-title">{this.props.fromModule==="QUESTION_INDEX" ? "题目分类" : "试卷分类"}</div>}
<Search
className="sider-search"
placeholder="搜索名称分类"
......@@ -206,7 +209,7 @@ class CourseCategorySiderTree extends Component {
}}
enterButton={<span className="icon iconfont">&#xe832;</span>}
/>
{this.props.fromModule==="index" && User.getUserRole() !== "CloudLecturer" && (
{["QUESTION_INDEX", "PAPER_INDEX"].includes(this.props.fromModule) && User.getUserRole() !== "CloudLecturer" && (
<div className="sider-btn">
<Button
onClick={() => {
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-27 14:55:14
* @LastEditors: yuananting
* @LastEditTime: 2021-03-30 16:08:38
* @LastEditTime: 2021-03-31 19:14:46
* @Description: 助学工具-试卷主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -37,7 +37,7 @@ class ExaminationPaperIndex extends Component {
>
<div className="sider">
<CourseCategorySiderTree
fromModule="index"
fromModule="PAPER_INDEX"
getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)}
currentTotal={this.state.currentTotal}
updatedCategoryId={this.state.updatedCategoryId}
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-25 13:52:01
* @LastEditors: yuananting
* @LastEditTime: 2021-03-30 19:34:05
* @LastEditTime: 2021-03-31 16:06:32
* @Description: 助学工具-新建试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -13,6 +13,23 @@
.ant-tabs {
color: #666666;
}
.record-operate {
display: flex;
&__item {
color: #5289fa;
cursor: pointer;
&.split {
margin: 0 8px;
color: #bfbfbf;
}
}
&__ban {
color: gray;
pointer-events: none;
}
}
}
.footer {
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting
* @LastEditTime: 2021-03-30 19:17:30
* @LastEditTime: 2021-03-31 19:15:49
* @Description: 助学工具-新建试卷-选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -34,11 +34,22 @@ class SelectQuestionModal extends Component {
title="选择题目"
visible={true}
width={1200}
onOk={() =>
onOk={() => {
this.props.setSelectedQuestion(
this.listRef.current.state.selectQuestionKeys
)
}
this.listRef.current.state.selectQuestionKeys.map((item) => {
item.questionType = item.questionTypeEnum;
item.score = 2;
if (
["MULTI_CHOICE", "GAP_FILLING", "INDEFINITE_CHOICE"].includes(
item.questionTypeEnum
)
) {
item.portionScore = 0;
}
return item;
})
);
}}
onCancel={this.props.close}
className="select-question-modal"
>
......@@ -48,14 +59,13 @@ class SelectQuestionModal extends Component {
>
<div className="sider">
<CourseCategorySiderTree
fromModule="modal"
fromModule="PAPER_MODAL"
getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)}
/>
</div>
</div>
<div className="content">
<SelectQuestionContent
fromModule="modal"
ref={this.listRef}
selectedCategoryId={this.state.selectedCategoryId}
/>
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-22 17:51:28
* @LastEditors: yuananting
* @LastEditTime: 2021-03-29 19:37:03
* @LastEditTime: 2021-03-31 18:33:23
* @Description: 助学工具-新建编辑课程分类模态框
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -28,6 +28,8 @@ class NewEditCourseCategoryModal extends Component {
// 查询分类树
queryCategoryTree = () => {
let query = {
bizType: "QUESTION",
count: false,
source: 0,
userId: User.getStoreUserId(),
tenantId: User.getStoreId(),
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-21 17:51:01
* @LastEditors: yuananting
* @LastEditTime: 2021-03-30 16:08:58
* @LastEditTime: 2021-03-31 19:15:27
* @Description: 助学工具-题库-题库主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -37,7 +37,7 @@ class QuestionBankIndex extends Component {
>
<div className="sider">
<CourseCategorySiderTree
fromModule="index"
fromModule="QUESTION_INDEX"
getSelectedCategoryId={this.getCategoryIdFromSider.bind(this)}
currentTotal={this.state.currentTotal}
updatedCategoryId={this.state.updatedCategoryId}
......
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