Commit 10c39c66 by sunbingqing

fix: 解决冲突

parents 9413e388 56dac057
...@@ -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-15 15:14:10 * @LastEditTime: 2021-03-18 18:13:26
* @Description: 助学工具-题库-主页面分类管理 * @Description: 助学工具-题库-主页面分类管理
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -51,12 +51,24 @@ class QuestionCategoryManage extends Component { ...@@ -51,12 +51,24 @@ class QuestionCategoryManage extends Component {
}; };
QuestionBankService.queryCategoryTree(query).then((res) => { QuestionBankService.queryCategoryTree(query).then((res) => {
const { result = [] } = res; const { result = [] } = res;
const defaultNode = { id: "0", categoryName: "未分类", categoryCount: 0 }; let str = "未分类";
if (categoryName && str.indexOf(categoryName) < 0) {
this.setState({ treeData: this.renderTreeNodes(result, categoryName) });
this.setState({
expandedKeys: this.getFirstLevelKeys(result),
});
} else {
const defaultNode = {
id: "0",
categoryName: "未分类",
categoryCount: 0,
};
result.unshift(defaultNode); result.unshift(defaultNode);
this.setState({ treeData: this.renderTreeNodes(result, categoryName) }); this.setState({ treeData: this.renderTreeNodes(result, categoryName) });
this.setState({ this.setState({
expandedKeys: this.getFirstLevelKeys(result), expandedKeys: this.getFirstLevelKeys(result),
}); });
}
}); });
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 14:34:29 * @Date: 2021-02-25 14:34:29
* @LastEditors: sunbingqing * @LastEditors: sunbingqing
* @LastEditTime: 2021-03-18 18:44:09 * @LastEditTime: 2021-03-18 19:32:49
* @Description: 助学工具-题库-题目管理-新建题目Tab * @Description: 助学工具-题库-题目管理-新建题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -111,6 +111,7 @@ class NewQuestionTab extends Component { ...@@ -111,6 +111,7 @@ class NewQuestionTab extends Component {
), ),
}, },
() => { () => {
if(this.props.questionTypeKey==="GAP_FillING") {
const con = questionInfo.questionStemList[0].content; const con = questionInfo.questionStemList[0].content;
const input = con.match(/<input([^<>]*)>/g) const input = con.match(/<input([^<>]*)>/g)
const _blanksList = input.map(item => { const _blanksList = input.map(item => {
...@@ -119,6 +120,7 @@ class NewQuestionTab extends Component { ...@@ -119,6 +120,7 @@ class NewQuestionTab extends Component {
console.log("-----", _blanksList) console.log("-----", _blanksList)
this.setState({blanksList:_blanksList}) this.setState({blanksList:_blanksList})
} }
}
); // 题干内容 ); // 题干内容
this.setState({ this.setState({
chooseOptions: JSON.parse(JSON.stringify(questionInfo.optionList)), chooseOptions: JSON.parse(JSON.stringify(questionInfo.optionList)),
...@@ -646,7 +648,7 @@ class NewQuestionTab extends Component { ...@@ -646,7 +648,7 @@ class NewQuestionTab extends Component {
}} }}
value={tag} value={tag}
size="small" size="small"
suffix={<CloseOutlined style={{ color: "#999999" }} />} suffix={<CloseOutlined onClick={() => this.handleInputConfirm(optionItem)} style={{ color: "#999999" }} />}
onBlur={(e) => onBlur={(e) =>
this.handleInputConfirm(optionItem, e.target.value, index) this.handleInputConfirm(optionItem, e.target.value, index)
} }
...@@ -1185,7 +1187,6 @@ class NewQuestionTab extends Component { ...@@ -1185,7 +1187,6 @@ class NewQuestionTab extends Component {
); );
let acceptType = ""; let acceptType = "";
let selectTypeList = []; let selectTypeList = [];
console.log("mediaType", mediaType);
switch (mediaType) { switch (mediaType) {
case "PICTURE": case "PICTURE":
acceptType = MEDIA_FILE_ACCEPT.PICTURE; acceptType = MEDIA_FILE_ACCEPT.PICTURE;
...@@ -1201,8 +1202,6 @@ class NewQuestionTab extends Component { ...@@ -1201,8 +1202,6 @@ class NewQuestionTab extends Component {
break; break;
} }
console.log(acceptType, selectTypeList);
return ( return (
<div className="question-input-item_wrapper"> <div className="question-input-item_wrapper">
{/* 题干 */} {/* 题干 */}
......
...@@ -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-18 09:33:50 * @LastEditTime: 2021-03-18 18:16:16
* @Description: 助学工具-题库-题库主页面侧边栏 * @Description: 助学工具-题库-题库主页面侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -19,7 +19,9 @@ class QuestionBankSider extends Component { ...@@ -19,7 +19,9 @@ class QuestionBankSider extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
selectedKeys: getParameterByName("categoryId") ? [getParameterByName("categoryId")] : ["0"], selectedKeys: getParameterByName("categoryId")
? [getParameterByName("categoryId")]
: ["0"],
searchValue: null, searchValue: null,
NewEditQuestionBankCategory: null, //新增或编辑分类模态框 NewEditQuestionBankCategory: null, //新增或编辑分类模态框
ImportCourseCategory: null, // 引用课程分类模态框 ImportCourseCategory: null, // 引用课程分类模态框
...@@ -29,13 +31,19 @@ class QuestionBankSider extends Component { ...@@ -29,13 +31,19 @@ class QuestionBankSider extends Component {
componentDidMount() { componentDidMount() {
this.queryCategoryTree(); this.queryCategoryTree();
this.props.getSelectedCategoryId(getParameterByName("categoryId") ? [getParameterByName("categoryId")] : ["0"],) this.props.getSelectedCategoryId(
getParameterByName("categoryId")
? [getParameterByName("categoryId")]
: ["0"]
);
} }
shouldComponentUpdate(nextProps, nextState) { shouldComponentUpdate(nextProps, nextState) {
const { updatedCategoryId } = nextProps; const { updatedCategoryId } = nextProps;
if (this.props.updatedCategoryId !== updatedCategoryId) { if (this.props.updatedCategoryId !== updatedCategoryId) {
this.setState({ selectedKeys: [updatedCategoryId] }, () => this.queryCategoryTree()); this.setState({ selectedKeys: [updatedCategoryId] }, () =>
this.queryCategoryTree()
);
} }
return true; return true;
} }
...@@ -59,7 +67,7 @@ class QuestionBankSider extends Component { ...@@ -59,7 +67,7 @@ class QuestionBankSider extends Component {
/** 树状选中事件 */ /** 树状选中事件 */
onSelect = (selectedKeys) => { onSelect = (selectedKeys) => {
this.setState({ selectedKeys }); this.setState({ selectedKeys });
this.props.getSelectedCategoryId(selectedKeys) this.props.getSelectedCategoryId(selectedKeys);
}; };
// 查询分类树 // 查询分类树
...@@ -72,12 +80,29 @@ class QuestionBankSider extends Component { ...@@ -72,12 +80,29 @@ class QuestionBankSider extends Component {
}; };
QuestionBankService.queryQuestionCategoryTree(query).then((res) => { QuestionBankService.queryQuestionCategoryTree(query).then((res) => {
const { categoryList = [], noCategoryCnt = 0 } = res.result; const { categoryList = [], noCategoryCnt = 0 } = res.result;
const defaultNode = { id: "0", categoryName:"未分类", categoryCount: noCategoryCnt}
let str = "未分类";
if (categoryName && str.indexOf(categoryName) < 0) {
this.setState({
treeData: this.renderTreeNodes(categoryList, categoryName),
});
this.setState({
expandedKeys: this.getFirstLevelKeys(categoryList),
});
} else {
const defaultNode = {
id: "0",
categoryName: "未分类",
categoryCount: noCategoryCnt,
};
categoryList.unshift(defaultNode); categoryList.unshift(defaultNode);
this.setState({ treeData: this.renderTreeNodes(categoryList, categoryName) }); this.setState({
treeData: this.renderTreeNodes(categoryList, categoryName),
});
this.setState({ this.setState({
expandedKeys: this.getFirstLevelKeys(categoryList), expandedKeys: this.getFirstLevelKeys(categoryList),
}); });
}
}); });
}; };
......
...@@ -39,7 +39,6 @@ class BatchImportQuestionModal extends Component { ...@@ -39,7 +39,6 @@ class BatchImportQuestionModal extends Component {
// 选择云盘资源 // 选择云盘资源
handleSelectExcel = (file) => { handleSelectExcel = (file) => {
console.log(file);
this.setState({ uploadFile: file }); this.setState({ uploadFile: file });
this.setState({ this.setState({
showSelectFileModal: false, showSelectFileModal: false,
...@@ -133,6 +132,9 @@ class BatchImportQuestionModal extends Component { ...@@ -133,6 +132,9 @@ class BatchImportQuestionModal extends Component {
</div> </div>
<div className="step-section"> <div className="step-section">
<h4 className="step-title">2.选择需要导入的Excel文件</h4> <h4 className="step-title">2.选择需要导入的Excel文件</h4>
<p style={{ marginBottom: 16, color: "gray" }}>
导入限制:一次最多导入1000个题目
</p>
<Button <Button
type="primary" type="primary"
className="add-btn" className="add-btn"
...@@ -220,9 +222,9 @@ class BatchImportQuestionModal extends Component { ...@@ -220,9 +222,9 @@ class BatchImportQuestionModal extends Component {
type="primary" type="primary"
className="down-btn" className="down-btn"
onClick={() => { onClick={() => {
this.setState({ status: "init" }) this.setState({ status: "init" });
this.setState({ uploadFile: null }) this.setState({ uploadFile: null });
this.setState({ showSelectFileModal: true }) this.setState({ showSelectFileModal: true });
}} }}
> >
重新上传文件 重新上传文件
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
.step-title { .step-title {
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
margin-bottom: 16px;
color: #333; color: #333;
} }
.tip-box { .tip-box {
......
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