Commit 679a3038 by wufan

Merge branch 'feature/yuananting/20210602/replace-defaul-cover' into 'master'

Feature/yuananting/20210602/replace defaul cover

See merge request !36
parents 315dfe46 eecff8bd
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:12:45 * @Date: 2020-08-05 10:12:45
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-05-27 20:13:53 * @LastEditTime: 2021-06-02 15:05:54
* @Description: 视频课-列表模块 * @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -364,7 +364,7 @@ class GraphicsCourseList extends React.Component { ...@@ -364,7 +364,7 @@ class GraphicsCourseList extends React.Component {
<ShareLiveModal <ShareLiveModal
needStr={needStr} needStr={needStr}
data={shareData} data={shareData}
type="videoClass" type="graphicsClass"
title="图文课" title="图文课"
close={() => { close={() => {
this.setState({ this.setState({
......
...@@ -18,8 +18,6 @@ import CourseService from '@/domains/course-domain/CourseService' ...@@ -18,8 +18,6 @@ import CourseService from '@/domains/course-domain/CourseService'
import './ShareLiveModal.less' import './ShareLiveModal.less'
const DEFAULT_COVER = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'
class ShareLiveModal extends React.Component { class ShareLiveModal extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
...@@ -98,27 +96,31 @@ class ShareLiveModal extends React.Component { ...@@ -98,27 +96,31 @@ class ShareLiveModal extends React.Component {
render() { render() {
const { courseDivision, data, type, title } = this.props const { courseDivision, data, type, title } = this.props
const { courseName, coverUrl = DEFAULT_COVER, scheduleVideoUrl } = data const { courseName, scheduleVideoUrl, courseMediaVOS, coverUrl } = data
const { shareUrl, showImg, time } = this.state const { shareUrl, showImg, time } = this.state
// 判断是否是默认图, 默认图不需要在URL后面增加字符串 // 判断是否是默认图, 默认图不需要在URL后面增加字符串
const isDefaultCover = coverUrl === DEFAULT_COVER let coverImgSrc = '';
switch (type) {
let coverImgSrc = coverUrl case 'liveClass': // 直播课
if (type === 'videoClass') { if (courseMediaVOS && courseMediaVOS.length > 0) {
if ((!coverUrl || isDefaultCover) && title !== '图文课' && title !== '线下课') { data.courseMediaVOS.map((item, index) => {
if (courseDivision === 'external') { if (item.contentType === 'COVER') {
coverImgSrc = 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png' coverImgSrc = item.mediaUrl
}
})
} else { } else {
coverImgSrc = `${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring` coverImgSrc = 'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png';
}
}
} else {
data.courseMediaVOS.map((item, index) => {
if (item.contentType === 'COVER') {
coverImgSrc = item.mediaUrl
} }
}) break;
case 'videoClass': // 视频课
coverImgSrc = coverUrl || (courseDivision === 'internal' ? `${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring` : 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png')
break;
case 'graphicsClass': // 图文课
coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png';
break;
case 'offlineClass': // 线下课
coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png';
break;
} }
return ( return (
...@@ -137,7 +139,7 @@ class ShareLiveModal extends React.Component { ...@@ -137,7 +139,7 @@ class ShareLiveModal extends React.Component {
<span className='text'>{User.getStoreName()}</span> <span className='text'>{User.getStoreName()}</span>
</div> </div>
<div className='course-name-title'>{type === 'videoClass' ? `${courseName}开课啦` : `邀请你观看直播:`}</div> <div className='course-name-title'>{type === 'liveClass' ? `邀请你观看直播:` : `${courseName}开课啦`}</div>
{type === 'liveClass' && <div class='live-couse-name'>{courseName}</div>} {type === 'liveClass' && <div class='live-couse-name'>{courseName}</div>}
<Choose> <Choose>
<When condition={showImg}> <When condition={showImg}>
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: wufan * @LastEditors: yuananting
* @LastEditTime: 2021-05-27 19:25:48 * @LastEditTime: 2021-06-07 15:06:26
* @Description: 线下课新增/编辑页 * @Description: 线下课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -518,6 +518,11 @@ class AddOfflineCourse extends React.Component { ...@@ -518,6 +518,11 @@ class AddOfflineCourse extends React.Component {
if(coverId){ if(coverId){
scheduleMediaRequests = [coverObj] scheduleMediaRequests = [coverObj]
} }
// 编辑且使用默认图时不传
if (pageType === 'edit' && coverUrl === defaultCoverUrl) {
scheduleMediaRequests = []
}
const commonParams = { const commonParams = {
categoryId, categoryId,
courseName, courseName,
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:12:45 * @Date: 2020-08-05 10:12:45
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-05-27 20:14:01 * @LastEditTime: 2021-06-02 16:15:55
* @Description: 视频课-列表模块 * @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -25,7 +25,7 @@ import QRCodeModal from '../modal/QRCodeModal'; ...@@ -25,7 +25,7 @@ import QRCodeModal from '../modal/QRCodeModal';
import './OfflineCourseList.less'; import './OfflineCourseList.less';
const ENV = process.env.DEPLOY_ENV || 'dev'; const ENV = process.env.DEPLOY_ENV || 'dev';
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'; const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png';
class OfflineCourseList extends React.Component { class OfflineCourseList extends React.Component {
...@@ -358,7 +358,7 @@ class OfflineCourseList extends React.Component { ...@@ -358,7 +358,7 @@ class OfflineCourseList extends React.Component {
<ShareLiveModal <ShareLiveModal
needStr={needStr} needStr={needStr}
data={shareData} data={shareData}
type="videoClass" type="offlineClass"
title="线下课" title="线下课"
close={() => { close={() => {
this.setState({ this.setState({
......
...@@ -6,7 +6,7 @@ import Service from "@/common/js/service"; ...@@ -6,7 +6,7 @@ import Service from "@/common/js/service";
import './PreviewOfflineModal.less'; import './PreviewOfflineModal.less';
import ENUM from '@/modules/knowledge-base/ENUM'; import ENUM from '@/modules/knowledge-base/ENUM';
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'; const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png';
class PreviewOfflineModal extends React.Component { class PreviewOfflineModal extends React.Component {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: * @Description:
* @Author: zangsuyun * @Author: zangsuyun
* @Date: 2021-03-13 09:54:26 * @Date: 2021-03-13 09:54:26
* @LastEditors: fusanqiasng * @LastEditors: yuananting
* @LastEditTime: 2021-06-01 10:26:46 * @LastEditTime: 2021-06-10 19:55:24
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -324,7 +324,7 @@ class AddCourse extends React.Component { ...@@ -324,7 +324,7 @@ class AddCourse extends React.Component {
return <img className='course-cover' src={item.mediaUrl} alt='' />; return <img className='course-cover' src={item.mediaUrl} alt='' />;
} }
})} })}
{!hasCover && <img className='course-cover' src={'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'} alt='' />} {!hasCover && <img className='course-cover' src={'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png'} alt='' />}
<div> <div>
<Choose> <Choose>
<When condition={record.courseName.length > 17}> <When condition={record.courseName.length > 17}>
...@@ -501,8 +501,7 @@ class AddCourse extends React.Component { ...@@ -501,8 +501,7 @@ class AddCourse extends React.Component {
const { coverUrl } = record; const { coverUrl } = record;
return ( return (
<div className='record__item'> <div className='record__item'>
{/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */} <img className='course-cover' src={coverUrl || 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png'} alt='' />
<img className='course-cover' src={coverUrl || 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'} alt='' />
<Choose> <Choose>
<When condition={record.courseName.length > 25}> <When condition={record.courseName.length > 25}>
<Tooltip title={record.courseName}> <Tooltip title={record.courseName}>
......
...@@ -16,7 +16,7 @@ import CourseService from '@/domains/course-domain/CourseService' ...@@ -16,7 +16,7 @@ import CourseService from '@/domains/course-domain/CourseService'
import './SharePlanModal.less' import './SharePlanModal.less'
const DEFAULT_COVER = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png' const DEFAULT_COVER = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'
class ShareLiveModal extends React.Component { class ShareLiveModal extends React.Component {
constructor(props) { constructor(props) {
......
...@@ -304,7 +304,7 @@ class SelectOperatorModal extends React.Component { ...@@ -304,7 +304,7 @@ class SelectOperatorModal extends React.Component {
return null return null
})} })}
<If condition={!hasCover}> <If condition={!hasCover}>
<img className='course-cover' src={"https://image.xiaomaiketang.com/xm/YNfi45JwFA.png"} alt='' /> <img className='course-cover' src={"https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png"} alt='' />
</If> </If>
<div> <div>
...@@ -432,8 +432,7 @@ class SelectOperatorModal extends React.Component { ...@@ -432,8 +432,7 @@ class SelectOperatorModal extends React.Component {
const { coverUrl } = record const { coverUrl } = record
return ( return (
<div className='course-info'> <div className='course-info'>
{/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */} <img className='course-cover' src={coverUrl || "https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png"} alt='' />
<img className='course-cover' src={coverUrl || "https://image.xiaomaiketang.com/xm/YNfi45JwFA.png"} alt='' />
<div className='course-name'>{record.courseName}</div> <div className='course-name'>{record.courseName}</div>
</div> </div>
) )
......
...@@ -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-06-01 17:07:30 * @LastEditTime: 2021-06-10 19:57:55
* @Description: 助学工具-新建/复制/编辑试卷 * @Description: 助学工具-新建/复制/编辑试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -19,6 +19,8 @@ import { ...@@ -19,6 +19,8 @@ import {
message, message,
Modal, Modal,
Spin, Spin,
Space,
Radio,
} from "antd"; } from "antd";
import { PlusOutlined } from "@ant-design/icons"; import { PlusOutlined } from "@ant-design/icons";
import { XMTable } from "@/components"; import { XMTable } from "@/components";
...@@ -30,6 +32,7 @@ import PaperPreviewModal from "./modal/PreviewPaperModal"; ...@@ -30,6 +32,7 @@ import PaperPreviewModal from "./modal/PreviewPaperModal";
import User from "@/common/js/user"; import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService"; import AidToolService from "@/domains/aid-tool-domain/AidToolService";
import Bus from "@/core/bus"; import Bus from "@/core/bus";
import _ from "underscore";
import { Route, withRouter } from "react-router-dom"; import { Route, withRouter } from "react-router-dom";
import * as paperEmpty from '../../lottie/paperEmpty/data.json'; import * as paperEmpty from '../../lottie/paperEmpty/data.json';
import AddExam from "@/modules/teach-tool/examination-manager/AddExam"; import AddExam from "@/modules/teach-tool/examination-manager/AddExam";
...@@ -70,12 +73,38 @@ class OperatePaper extends Component { ...@@ -70,12 +73,38 @@ class OperatePaper extends Component {
}, },
selectQuestionModal: null, selectQuestionModal: null,
paperPreviewModal: null, paperPreviewModal: null,
quickSortModalVisible: false, // 快捷排序弹窗显隐
selectQuestionList: [], selectQuestionList: [],
currentOperate: "", currentOperate: "",
currentNav: "", currentNav: "",
currentCategoryPapers: [], currentCategoryPapers: [],
loading: false, loading: false,
check: false, check: false,
sorterMethod: "addOrder",
sorterBy: [
"SINGLE_CHOICE",
"MULTI_CHOICE",
"JUDGE",
"GAP_FILLING",
"INDEFINITE_CHOICE",
],
sorterTypeList: [
{
typeKey: "SINGLE_CHOICE",
},
{
typeKey: "MULTI_CHOICE",
},
{
typeKey: "JUDGE",
},
{
typeKey: "GAP_FILLING",
},
{
typeKey: "INDEFINITE_CHOICE",
},
],
}; };
} }
...@@ -128,10 +157,10 @@ class OperatePaper extends Component { ...@@ -128,10 +157,10 @@ class OperatePaper extends Component {
}; };
const res = await AidToolService.queryPaperDetail(query); const res = await AidToolService.queryPaperDetail(query);
const { result } = res; const { result } = res;
const { paperName, passRate } = result; const { paperName, passRate, questionList } = result;
this.setState( this.setState(
{ {
selectQuestionList: result.questionList, selectQuestionList: questionList,
formData: { formData: {
...result, ...result,
paperId: getParameterByName("paperId"), paperId: getParameterByName("paperId"),
...@@ -145,7 +174,11 @@ class OperatePaper extends Component { ...@@ -145,7 +174,11 @@ class OperatePaper extends Component {
paperName: this.state.formData.paperName, paperName: this.state.formData.paperName,
passRate, passRate,
}); });
this.setFormData(result.questionList); questionList.map((item, index) => {
item.sorterIndex = index;
return item;
});
this.setFormData(questionList);
} }
); );
}; };
...@@ -196,30 +229,8 @@ class OperatePaper extends Component { ...@@ -196,30 +229,8 @@ class OperatePaper extends Component {
return prev + Number(cur.score) || 0; return prev + Number(cur.score) || 0;
}, 0); }, 0);
const sortedTableData = [
...singleQuestion,
...multiQuestion,
...indefiniteQuestion,
...judgeQuestion,
...gapQuestion,
];
let currentQuestionList = [];
switch (sorter) {
case "ascend":
currentQuestionList = sortedTableData;
break;
case "descend":
currentQuestionList = sortedTableData.reverse();
break;
default:
currentQuestionList = _selectQuestionList;
break;
}
const passScore = Math.round(totalScore * formData.passRate * 0.01); const passScore = Math.round(totalScore * formData.passRate * 0.01);
this.setState({ this.setState({
selectQuestionList: currentQuestionList,
formData: { formData: {
...formData, ...formData,
singleChoiceCnt: singleQuestion.length, singleChoiceCnt: singleQuestion.length,
...@@ -241,12 +252,14 @@ class OperatePaper extends Component { ...@@ -241,12 +252,14 @@ class OperatePaper extends Component {
// 选择题目 // 选择题目
chooseQuestion = () => { chooseQuestion = () => {
const { selectQuestionList, sorterMethod, sorterBy } = this.state;
const m = ( const m = (
<SelectQuestionModal <SelectQuestionModal
getSelectedQuestion={this.state.selectQuestionList} getSelectedQuestion={selectQuestionList}
setSelectedQuestion={(list) => { setSelectedQuestion={(list) => {
this.setState({ selectQuestionModal: null }, () => { this.setState({ selectQuestionModal: null }, () => {
this.setFormData(list); this.setFormData(list);
this.quickSorter(list, sorterMethod, sorterBy);
}); });
}} }}
close={() => { close={() => {
...@@ -261,7 +274,7 @@ class OperatePaper extends Component { ...@@ -261,7 +274,7 @@ class OperatePaper extends Component {
// 移动已选题目 // 移动已选题目
handleMoveItem = (index, moveLength) => { handleMoveItem = (index, moveLength) => {
const { selectQuestionList } = this.state; const selectQuestionList = [...this.state.selectQuestionList];
const item = selectQuestionList.splice(index + moveLength, 1); const item = selectQuestionList.splice(index + moveLength, 1);
selectQuestionList.splice(index, 0, item[0]); selectQuestionList.splice(index, 0, item[0]);
this.setState({ selectQuestionList }, () => this.setState({ selectQuestionList }, () =>
...@@ -472,14 +485,6 @@ class OperatePaper extends Component { ...@@ -472,14 +485,6 @@ class OperatePaper extends Component {
}); });
}; };
// 题型排序
sortByQuestionType = (pagination, filters, sorter) => {
const { columnKey, order } = sorter;
if (columnKey === "questionType") {
this.setFormData(this.state.selectQuestionList, order);
}
};
// 表头设置 // 表头设置
parseColumns = () => { parseColumns = () => {
const { selectQuestionList } = this.state; const { selectQuestionList } = this.state;
...@@ -498,8 +503,6 @@ class OperatePaper extends Component { ...@@ -498,8 +503,6 @@ class OperatePaper extends Component {
dataIndex: "questionType", dataIndex: "questionType",
key: "questionType", key: "questionType",
width: "12%", width: "12%",
sorter: true,
showSorterTooltip: false,
filters: [ filters: [
{ {
text: "单选题", text: "单选题",
...@@ -559,8 +562,7 @@ class OperatePaper extends Component { ...@@ -559,8 +562,7 @@ class OperatePaper extends Component {
<Tooltip title="多选题和填空题的漏选/半对得分不能高于题目本身分值"> <Tooltip title="多选题和填空题的漏选/半对得分不能高于题目本身分值">
<span <span
className="icon iconfont" className="icon iconfont"
style={{ color: "#BFBFBF", fontSize: 14,fontWeight:"400" style={{ color: "#BFBFBF", fontSize: 14, fontWeight: "400" }}
}}
> >
&#xe7c4; &#xe7c4;
</span> </span>
...@@ -679,11 +681,37 @@ class OperatePaper extends Component { ...@@ -679,11 +681,37 @@ class OperatePaper extends Component {
return columns; return columns;
}; };
// 上下移题型
handleMoveTypeSorter = (index, moveLength) => {
const sorterTypeList = [...this.state.sorterTypeList];
const item = sorterTypeList.splice(index + moveLength, 1);
sorterTypeList.splice(index, 0, item[0]);
const sorterBy = _.pluck(sorterTypeList, "typeKey");
this.setState({ sorterTypeList, sorterBy });
};
// 快捷排序
quickSorter = (list, sorterMethod, sorterBy) => {
this.setState({
selectQuestionList:
sorterMethod === "addOrder"
? list.sort((a, b) => a.sorterIndex - b.sorterIndex)
: list.sort(
(a, b) =>
sorterBy.indexOf(a.questionTypeEnum || a.questionType) -
sorterBy.indexOf(b.questionTypeEnum || b.questionType)
),
});
};
render() { render() {
const { const {
selectQuestionModal, selectQuestionModal,
paperPreviewModal, paperPreviewModal,
selectQuestionList, quickSortModalVisible,
sorterMethod,
sorterTypeList,
sorterBy,
currentNav, currentNav,
formData, formData,
loading, loading,
...@@ -708,6 +736,50 @@ class OperatePaper extends Component { ...@@ -708,6 +736,50 @@ class OperatePaper extends Component {
totalScore, totalScore,
} = formData; } = formData;
const { match } = this.props; const { match } = this.props;
const selectQuestionList = [...this.state.selectQuestionList];
const questionTypeEnum = {
SINGLE_CHOICE: "【单选题】",
MULTI_CHOICE: "【多选题】",
JUDGE: "【判断题】",
GAP_FILLING: "【填空题】",
INDEFINITE_CHOICE: "【不定项选择题】",
};
const typeColumns = [
{
title: "题型",
dataIndex: "typeKey",
key: "typeKey",
render: (text, record, index) => <span style={{color: '#333333'}}>{questionTypeEnum[text]}</span>,
},
{
title: "操作",
key: "action",
align: 'right',
render: (text, record, index) => (
<Space size="middle">
<span
style={{color: index > 0 ? '#2966FF' : '#CCCCCC', cursor: 'pointer'}}
onClick={() => {
index > 0 && this.handleMoveTypeSorter(index, -1);
}}
>
上移
</span>
<span style={{color: '#BFBFBF'}}> | </span>
<span
style={{color: index < 4 ? '#2966FF' : '#CCCCCC', cursor: 'pointer'}}
onClick={() => {
index < 4 && this.handleMoveTypeSorter(index, 1);
}}
>
下移
</span>
</Space>
),
},
];
return ( return (
<div> <div>
<div className="page operate-paper-page"> <div className="page operate-paper-page">
...@@ -780,15 +852,26 @@ class OperatePaper extends Component { ...@@ -780,15 +852,26 @@ class OperatePaper extends Component {
</span> </span>
</div> </div>
</Form.Item> </Form.Item>
<Space size={8}>
<Button <Button
className="choose-btn" className="choose-btn"
type="primary" type="primary"
icon={<PlusOutlined />} icon={<PlusOutlined />}
onClick={this.chooseQuestion} onClick={this.chooseQuestion}
> >
自选题目 自选题目
</Button> </Button>
<Button
className="choose-btn"
onClick={() => {
this.setState({
quickSortModalVisible: true,
});
}}
>
快捷排序
</Button>
</Space>
{questionCnt > 0 && ( {questionCnt > 0 && (
<div <div
className="paper-info-tip" className="paper-info-tip"
...@@ -836,6 +919,47 @@ class OperatePaper extends Component { ...@@ -836,6 +919,47 @@ class OperatePaper extends Component {
</Spin> </Spin>
{selectQuestionModal} {selectQuestionModal}
{paperPreviewModal} {paperPreviewModal}
<Modal
maskClosable={false}
className="type-order-modal"
title="快捷排序"
width={560}
visible={quickSortModalVisible}
onOk={() => {
this.setState(
{
quickSortModalVisible: false,
},
() => this.quickSorter(selectQuestionList, sorterMethod, sorterBy)
);
}}
onCancel={() => {
this.setState({ quickSortModalVisible: false });
}}
>
<Radio.Group
onChange={(e) =>
this.setState({
sorterMethod: e.target.value,
})
}
value={sorterMethod}
>
<Radio value={"addOrder"}>按添加顺序排序</Radio>
<Radio value={"typeOrder"}>按题型排序</Radio>
</Radio.Group>
{sorterMethod === "typeOrder" && (
<Table
className="type-order-table"
style={{marginTop: '24px'}}
showHeader={false}
columns={typeColumns}
dataSource={sorterTypeList}
pagination={false}
bordered={false}
/>
)}
</Modal>
</div> </div>
<Route <Route
path={`${match.url}/exam-operate-page`} path={`${match.url}/exam-operate-page`}
......
...@@ -88,4 +88,23 @@ ...@@ -88,4 +88,23 @@
.ant-dropdown-menu-item-selected > span { .ant-dropdown-menu-item-selected > span {
color: #333333; color: #333333;
} }
\ No newline at end of file
.type-order-modal {
.type-order-table {
tr {
background: #F7F8F9 !important;
display: flex;
margin-bottom: 8px;
width: 521px;
justify-content: space-between;
td {
border: none !important;
}
}
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td {
background: #F7F8F9 !important;
}
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-29 10:52:26 * @Date: 2021-03-29 10:52:26
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-05-08 16:11:27 * @LastEditTime: 2021-06-07 14:45:02
* @Description: 助学工具-试卷-新建选择题目弹窗 * @Description: 助学工具-试卷-新建选择题目弹窗
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -42,7 +42,8 @@ class SelectQuestionModal extends Component { ...@@ -42,7 +42,8 @@ class SelectQuestionModal extends Component {
width={1080} width={1080}
onOk={() => { onOk={() => {
this.props.setSelectedQuestion( this.props.setSelectedQuestion(
this.listRef.current.state.selectQuestionKeys.map((item) => { this.listRef.current.state.selectQuestionKeys.map((item, index) => {
item.sorterIndex = index;
item.questionId = item.id || item.questionId; item.questionId = item.id || item.questionId;
item.questionType = item.questionTypeEnum || item.questionType; item.questionType = item.questionTypeEnum || item.questionType;
item.score = item.score || 2; item.score = item.score || 2;
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 14:34:29 * @Date: 2021-02-25 14:34:29
* @LastEditors: wufan * @LastEditors: yuananting
* @LastEditTime: 2021-05-14 18:17:08 * @LastEditTime: 2021-06-09 12:00:12
* @Description: 助学工具-题库-操作题目Tab * @Description: 助学工具-题库-操作题目Tab
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -66,23 +66,25 @@ class OperateQuestionTab extends Component { ...@@ -66,23 +66,25 @@ class OperateQuestionTab extends Component {
} }
componentDidMount() { componentDidMount() {
const { chooseOptions } = this.state; const { questionTypeKey } = this.props;
const isEditCurrent =
getParameterByName("id") &&
getParameterByName("type") === questionTypeKey;
const optionSize = isEditCurrent ? 20 : 4;
if ( if (
["INDEFINITE_CHOICE", "MULTI_CHOICE", "SINGLE_CHOICE"].includes( ["INDEFINITE_CHOICE", "MULTI_CHOICE", "SINGLE_CHOICE"].includes(
this.props.questionTypeKey questionTypeKey
) )
) { ) {
if (chooseOptions.length === 0) { // 选择题(单选 多选 不定项)-插入4条默认选项
// 选择题(单选 多选 不定项)-插入4条默认选项 for (var i = 0; i < optionSize; i++) {
for (var i = 0; i < 4; i++) { this.handleAddOption();
this.handleAddOption(); this.setState({
this.setState({ [`optionsValidate_${i}`]: "success",
[`optionsValidate_${i}`]: "success", [`optionsText_${i}`]: "",
[`optionsText_${i}`]: "", });
});
}
} }
} else if (this.props.questionTypeKey === "JUDGE") { } else if (questionTypeKey === "JUDGE") {
this.initJudgeOption("正确"); this.initJudgeOption("正确");
this.initJudgeOption("错误"); this.initJudgeOption("错误");
} }
...@@ -634,9 +636,9 @@ class OperateQuestionTab extends Component { ...@@ -634,9 +636,9 @@ class OperateQuestionTab extends Component {
this.state.stemContent, this.state.stemContent,
(contentItem) => contentItem.type === "RICH_TEXT" (contentItem) => contentItem.type === "RICH_TEXT"
); );
if(stemContent.textLength > 1000) { if (stemContent.textLength > 1000) {
validateError++; validateError++;
} }
let stem = stemContent.content.replace(/<[^>]+>/g, ""); let stem = stemContent.content.replace(/<[^>]+>/g, "");
stem = stem.replace(/\&nbsp\;/gi, ""); stem = stem.replace(/\&nbsp\;/gi, "");
stem = stem.replace(/\s+/g, ""); stem = stem.replace(/\s+/g, "");
...@@ -694,7 +696,7 @@ class OperateQuestionTab extends Component { ...@@ -694,7 +696,7 @@ class OperateQuestionTab extends Component {
optionUnChecked = item.isCorrectAnswer optionUnChecked = item.isCorrectAnswer
? optionUnChecked ? optionUnChecked
: optionUnChecked + 1; : optionUnChecked + 1;
if(optionContent[0].textLength > 1000) { if (optionContent[0].textLength > 1000) {
validateError++; validateError++;
} }
let optionInput = optionContent[0].content.replace(/<[^>]+>/g, ""); let optionInput = optionContent[0].content.replace(/<[^>]+>/g, "");
...@@ -1040,11 +1042,11 @@ class OperateQuestionTab extends Component { ...@@ -1040,11 +1042,11 @@ class OperateQuestionTab extends Component {
return dom ? ( return dom ? (
<div <div
className="question-item_question-content" className="question-item_question-content"
style={{ style={
display: ["PICTURE", "VIDEO"].includes(type) !["PICTURE", "VIDEO"].includes(type)
? "inline-grid" ? { display: "flex" }
: "flex", : { float: "left" }
}} }
key={index} key={index}
> >
{dom} {dom}
...@@ -1194,10 +1196,8 @@ class OperateQuestionTab extends Component { ...@@ -1194,10 +1196,8 @@ class OperateQuestionTab extends Component {
data-label="正确答案" data-label="正确答案"
> >
{_.map(chooseOptions, (optionItem, optionIndex) => { {_.map(chooseOptions, (optionItem, optionIndex) => {
const { const { questionOptionContentList, isCorrectAnswer } =
questionOptionContentList, optionItem;
isCorrectAnswer,
} = optionItem;
optionItem.optionSort = optionIndex; optionItem.optionSort = optionIndex;
const mediaBtn = ["VOICE", "AUDIO", "PICTURE"]; const mediaBtn = ["VOICE", "AUDIO", "PICTURE"];
const placeHold = const placeHold =
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
border-radius: 2px; border-radius: 2px;
padding: 16px; padding: 16px;
position: relative; position: relative;
margin-bottom: 35px; margin-bottom: 70px;
.editor-fill-box_single { .editor-fill-box_single {
border-radius: 4px; border-radius: 4px;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
color: #666666; color: #666666;
.input-box { .input-box {
margin-bottom: 8px; margin-bottom: 8px;
display: inline-block; // display: inline-block;
*:not(p) { *:not(p) {
font-weight: normal !important; font-weight: normal !important;
font-size: 14px !important; font-size: 14px !important;
......
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