Commit af3d0ef9 by chenshu

fix:merge

parents 2da43422 effbafa7
/*
* @Author: yuananting
* @Date: 2021-02-23 18:28:50
* @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-21 17:57:59
* @LastEditors: yuananting
* @LastEditTime: 2021-06-02 14:25:06
* @Description: 助学工具-课程分类
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -153,9 +153,7 @@ class CourseCategoryManage extends Component {
<Space className='title-opts' size={16}>
<span
onClick={() => {
let nodesCount = 0
const { originTreeData } = this.state
console.log('orororo', originTreeData)
const { originTreeData } = this.state;
if (
(item.categoryLevel === 0 && originTreeData.length >= 29) ||
(item.categoryLevel > 0 && this.getRelatedNodes(item.parentId).length >= 30)
......@@ -343,8 +341,10 @@ class CourseCategoryManage extends Component {
let dragNodes = []
dragNodes.push(dragNode.id)
if (dragNode.parentId != 0) {
dragNodes = dragNodes.concat(this.getParentDragNodesLevel(this.state.treeMap[dragNode.parentId]))
if (dragNode.parentId !== "0") {
dragNodes = dragNodes.concat(
this.getParentDragNodesLevel(this.state.treeMap[dragNode.parentId])
);
}
return dragNodes
}
......@@ -365,14 +365,24 @@ class CourseCategoryManage extends Component {
// 拖拽
onDrop = (info) => {
if (this.state.categoryName) {
return
// 带搜索时的分类树不允许拖拽
// 不允许其他节点拖拽到未分类中
// 不允许其他节点拖拽到未分类之前
if (
this.state.categoryName ||
(info.node.categoryName === "未分类" && info.dropPosition === 0) ||
(info.node.categoryName === "未分类" &&
info.dropToGap &&
info.dropPosition === -1)
) {
return;
}
// 未分类不可以拖拽
if (info.dragNode.categoryName === '未分类' && info.dragNode.categoryLevel === 0) return message.info('未分类”为默认分类暂不支持移动')
// 不允许其他节点拖拽到未分类之前
if (info.node.categoryName === '未分类' && info.dropToGap && info.dropPosition === -1) return
if (
info.dragNode.categoryName === "未分类" &&
info.dragNode.categoryLevel === 0
)
return message.info("“未分类”为默认分类暂不支持移动");
let targetParentId = info.dropToGap ? info.node.parentId : info.node.id
let relatedNodes = this.getRelatedNodes(targetParentId)
......@@ -383,8 +393,7 @@ class CourseCategoryManage extends Component {
let nodesArr = this.getDragNodesLevel(this.state.treeMap[info.dragNode.id])
let parentArr = this.getParentDragNodesLevel(this.state.treeMap[targetParentId])
if (nodesArr.length + parentArr.length > 4) {
console.log(nodesArr.length, parentArr.length)
return message.info('最多支持5级分类')
return message.info("最多支持5级分类");
}
}
if (relatedNodes && relatedNodes.length >= 30) {
......
.examPage{
padding-bottom: 50px;
.box {
padding-bottom: 40px!important;
padding-bottom: 66px!important;
}
.ant-form-item{
margin-bottom: 24px !important;
&:last-child{
margin-bottom: 0px !important;
}
}
.form{
margin-top: 12px;
margin-top: 24px;
margin-bottom: 32px;
width: 1000px;
.title{
font-size: 16px;
......@@ -18,7 +20,7 @@
font-weight: bold;
color: #333333;
line-height: 22px;
margin-bottom: 8px;
margin-bottom: 24px;
}
}
......
......@@ -132,6 +132,11 @@ function AddExam(props: any) {
return
}
if (param.examName && param.examName.length > 40) {
message.warning('考试名称最多40字');
return
}
if (!paperId) {
message.warning('请选择试卷');
return
......@@ -240,7 +245,7 @@ function AddExam(props: any) {
cancelText: '留在本页',
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => {
props.history.goBack();
window.RCHistory.push("/examination-manage-index")
}
})
}
......@@ -276,8 +281,8 @@ function AddExam(props: any) {
layout="horizontal"
>
<Form.Item label="考试名称"
validateStatus={(check && !examName) ? 'error' : ''}
help={check && !examName && '请选择课程'}
validateStatus={(check && (!examName ? '请输入考试名称' : (examName.length > 40) && '考试名称最多40字')) ? 'error' : ''}
help={check && (!examName ? '请输入考试名称' : (examName.length > 40) && '考试名称最多40字')}
required>
<Input placeholder='请输入考试名称(40字以内)' maxLength={40} value={examName} onChange={(e) => {
......
......@@ -68,8 +68,8 @@ function ExaminationManager(props: any) {
descend: 'PASS_CNT_DESC'
},
examCreateTime: {
ascend: 'EXAM_START_TIME_ASC',
descend: 'EXAM_START_TIME_DESC'
ascend: 'CREATED_ASC',
descend: 'CREATED_DESC'
}
}
......
......@@ -33,18 +33,18 @@ function PreviewModal(props: any) {
<div className="phone">
<div className="content">
<div className="topContent">
<div className="title" style={{ fontSize: props.info.examName.length > 24 ? 13 : 22 ,marginTop:props.info.examName.length > 24?44:20}}>{props.info.examName || ' '}</div>
<div className="title" style={{ fontSize: props.info.examName.length > 24 ? 13 : 22 ,marginTop: 20 }}>{(props.info.examName.length > 40 ? props.info.examName.substring(0, 40) : props.info.examName) || ' '}</div>
{
props.info.examStartTime && <div className="time">{moment(props.info.examStartTime).format("YYYY-MM-DD HH:mm")}~{moment(props.info.examEndTime).format("YYYY-MM-DD HH:mm")}</div>
}
<div className="rule">
<div className="item">
<div className="num">{props.info.totalScore || 0}</div>
<div className="num">{props.info.totalScore || props.info.examPaper.totalScore || 0}</div>
<div className="text">总分 <span className="dw" style={{color:'#999'}}>(分)</span></div>
</div>
<div className="item">
<div className="num">{props.info.examTotal || 0}</div>
<div className="num">{props.info.examTotal || props.info.examPaper.questionCnt || 0}</div>
<div className="text">总题数<span className="dw" style={{color:'#999'}} >(道)</span></div>
</div>
<div className="item">
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-27 16:15:13
* @LastEditors: yuananting
* @LastEditTime: 2021-05-30 21:22:25
* @LastEditTime: 2021-06-01 17:07:30
* @Description: 助学工具-新建/复制/编辑试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -325,6 +325,10 @@ class OperatePaper extends Component {
if (this.checkExist(paperName)) {
return "该试卷名称已存在";
}
if (paperName && paperName.length > 40) {
return "试卷名称最多40字";
}
};
// 保存试卷
......@@ -337,7 +341,8 @@ class OperatePaper extends Component {
if (
!formData.passRate ||
!formData.paperName ||
this.checkExist(formData.paperName)
this.checkExist(formData.paperName) ||
(formData.paperName && formData.paperName.length > 40)
) {
return;
}
......@@ -472,6 +477,8 @@ class OperatePaper extends Component {
"categoryId"
)}`,
});
Bus.trigger("queryCategoryTree", "remain");
Bus.trigger("queryPaperPageList", getParameterByName("categoryId"), 0);
},
});
};
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-03-27 11:15:03
* @LastEditors: yuananting
* @LastEditTime: 2021-04-15 13:22:10
* @LastEditTime: 2021-06-01 17:28:21
* @Description: 助学工具-试卷-预览试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -284,7 +284,7 @@ class PreviewPaperModal extends Component {
footer={null}
onCancel={this.props.close}
>
{paperName && <div className="paper-title">{paperName}</div>}
{paperName && <div className="paper-title">{paperName.length > 40 ? paperName.substring(0, 40) : paperName}</div>}
{questionList && questionList.length > 0 ? (
<div className="question-list-box">
{_.map(questionList, (questionItem, questionIndex) => {
......
......@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting
* @LastEditTime: 2021-05-20 11:35:07
* @LastEditTime: 2021-06-01 11:31:17
* @Description: 助学工具-题库-题目列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -534,7 +534,7 @@ class QuestionList extends Component {
Service.Hades('public/hades/batchMoveQuestion', data, { reject: true }).then((res) => {
if (res.success) {
message.success('移动成功');
Bus.trigger('queryCategoryTree', 'init');
Bus.trigger('queryCategoryTree', 'remain');
this.queryQuestionPageList();
this.clearSelect();
} else {
......@@ -569,7 +569,7 @@ class QuestionList extends Component {
Service.Hades('public/hades/batchDeleteQuestion', data, { reject: true }).then((res) => {
if (res.success) {
message.success('删除成功');
Bus.trigger('queryCategoryTree', 'init');
Bus.trigger('queryCategoryTree', 'remain');
this.queryQuestionPageList();
this.clearSelect();
} else {
......
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