Commit af3d0ef9 by chenshu

fix:merge

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