Commit 9ce18f7d by yuananting

fix:解决合并代码的冲突

parents 9e46dec4 5aef17a1
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-07-23 14:54:16 * @Date: 2020-07-23 14:54:16
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-07-14 18:19:22 * @LastEditTime: 2021-07-18 16:53:35
* @Description: 大班直播课预览弹窗 * @Description: 大班直播课预览弹窗
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-15 12:08:28 * @LastEditTime: 2021-07-18 16:54:11
* @Description: 线下课新增/编辑页 * @Description: 线下课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
import React from 'react'; import React from 'react';
import { Button, Input, Radio, message, Modal, TreeSelect, Select, Switch, TimePicker, InputNumber, Tooltip } from 'antd'; import { Button, Input, Radio, message, Modal, TreeSelect, Select, Switch, TimePicker, InputNumber, Tooltip } from 'antd';
import $ from 'jquery'; import $ from 'jquery';
import Bus from '@/core/bus';
import RangePicker from '@/modules/common/DateRangePicker'; import RangePicker from '@/modules/common/DateRangePicker';
import ShowTips from '@/components/ShowTips'; import ShowTips from '@/components/ShowTips';
import Breadcrumbs from '@/components/Breadcrumbs'; import Breadcrumbs from '@/components/Breadcrumbs';
...@@ -27,6 +26,7 @@ import GraphicsEditor from '../components/GraphicsEditor'; ...@@ -27,6 +26,7 @@ import GraphicsEditor from '../components/GraphicsEditor';
import MultipleDatePicker from '@/components/MultipleDatePicker'; import MultipleDatePicker from '@/components/MultipleDatePicker';
import ImgClipModal from '@/components/ImgClipModal'; import ImgClipModal from '@/components/ImgClipModal';
import './AddOfflineCourse.less'; import './AddOfflineCourse.less';
import Bus from '@/core/bus';
const { Option } = Select; const { Option } = Select;
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png'; const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png';
...@@ -342,8 +342,7 @@ class AddOfflineCourse extends React.Component { ...@@ -342,8 +342,7 @@ class AddOfflineCourse extends React.Component {
visible: true, visible: true,
imageFile: file imageFile: file
}); });
} };
//获取resourceId //获取resourceId
getSignature = (blob, fileName) => { getSignature = (blob, fileName) => {
...@@ -626,11 +625,7 @@ class AddOfflineCourse extends React.Component { ...@@ -626,11 +625,7 @@ class AddOfflineCourse extends React.Component {
}); });
} }
changeIntro = (value, textLength) => { changeIntro = (value) => {
// const isMore = textLength > 1000;
// if (isMore) {
// message.warning('内容过长,不能超过1000字');
// }
this.setState({ introduce: value }); this.setState({ introduce: value });
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-15 12:04:40 * @LastEditTime: 2021-07-18 16:54:33
* @Description: 线上课新增/编辑页 * @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -45,7 +45,14 @@ const defaultScheduleMedia = [ ...@@ -45,7 +45,14 @@ const defaultScheduleMedia = [
] ]
const whetherVisitorsJoin = 'NO' const whetherVisitorsJoin = 'NO'
let cutFlag = false let cutFlag = false;
const SUPPORT_WORD_PDF = [
"application/msword",
"application/wps-writer",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/pdf",
"application/wps-office.pdf"
];
class AddVideoCourse extends React.Component { class AddVideoCourse extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
...@@ -87,7 +94,6 @@ class AddVideoCourse extends React.Component { ...@@ -87,7 +94,6 @@ class AddVideoCourse extends React.Component {
], // 课节列表 ], // 课节列表
// videoType: "MP4", // videoType: "MP4",
mediaNameAlias: '', // 任一视频重命名的名称(气泡框) mediaNameAlias: '', // 任一视频重命名的名称(气泡框)
popConfirmVisible: false,
selectTypeList:['MP4'], selectTypeList:['MP4'],
accept:'video/mp4' accept:'video/mp4'
} }
...@@ -318,10 +324,11 @@ class AddVideoCourse extends React.Component { ...@@ -318,10 +324,11 @@ class AddVideoCourse extends React.Component {
return; return;
} }
selectedFileList.map((file,index) => { selectedFileList.map((file,index) => {
console.log('')
const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file; const { ossUrl, resourceId, folderName, folderFormat, folderSize } = file;
const _mediaName =folderName.replace(`.${_.last(folderName.split('.')).toLowerCase()}`,'')
console.log('folderFormat',folderFormat); console.log('folderFormat',folderFormat);
if(folderFormat === 'MP4'){ if(folderFormat === 'MP4' || folderFormat === 'video/mp4'){
const videoDom = document.createElement('video') const videoDom = document.createElement('video')
videoDom.src = ossUrl videoDom.src = ossUrl
videoDom.onloadedmetadata = () => { videoDom.onloadedmetadata = () => {
...@@ -329,26 +336,17 @@ class AddVideoCourse extends React.Component { ...@@ -329,26 +336,17 @@ class AddVideoCourse extends React.Component {
mediaContent: resourceId, mediaContent: resourceId,
contentType: 'SCHEDULE', contentType: 'SCHEDULE',
mediaType: "VIDEO", mediaType: "VIDEO",
mediaName: folderName.replace('.mp4',''), mediaName: _mediaName,
videoDuration: videoDom.duration, videoDuration: videoDom.duration,
resourceId, resourceId,
mediaUrl: ossUrl, mediaUrl: ossUrl,
sort: _courseChapterList.length sort: _courseChapterList.length
}) })
this.setState({ this.setState({
// size: folderSize,
// videoName: folderName,
// videoType: folderFormat,
courseChapterList: _courseChapterList courseChapterList: _courseChapterList
}) })
} }
}else{ }else if( folderFormat==="WORD" || folderFormat==="PDF" || SUPPORT_WORD_PDF.indexOf(folderFormat)>-1){
let _mediaName = folderName;
if(folderFormat === 'PDF'){
_mediaName = folderName.replace('.pdf','')
}else{
_mediaName = folderName.replace('.doc','') && folderName.replace('.docx','')
}
const suffix = _.last(folderName.split('.')).toUpperCase(); const suffix = _.last(folderName.split('.')).toUpperCase();
_courseChapterList.push({ _courseChapterList.push({
mediaContent: resourceId, mediaContent: resourceId,
...@@ -556,7 +554,6 @@ class AddVideoCourse extends React.Component { ...@@ -556,7 +554,6 @@ class AddVideoCourse extends React.Component {
chapterNameValidateStatus: '', chapterNameValidateStatus: '',
        chapterNameHelpMsg: '',         chapterNameHelpMsg: '',
mediaNameAlias: '', mediaNameAlias: '',
popConfirmVisible: false
}) })
}); });
...@@ -684,6 +681,14 @@ class AddVideoCourse extends React.Component { ...@@ -684,6 +681,14 @@ class AddVideoCourse extends React.Component {
}) })
} }
} }
renderToolTipTitle = ()=> {
return (<div>
<p>视频支持mp4格式,大小不超过2G;</p>
<p>文件支持PDF、docx、doc格式,大小不超过100M</p>
</div>)
}
render() { render() {
const { const {
pageType, pageType,
...@@ -706,7 +711,6 @@ class AddVideoCourse extends React.Component { ...@@ -706,7 +711,6 @@ class AddVideoCourse extends React.Component {
id, id,
courseChapterList, courseChapterList,
imageFile, imageFile,
popConfirmVisible,
selectTypeList, selectTypeList,
accept accept
} = this.state } = this.state
...@@ -738,7 +742,7 @@ class AddVideoCourse extends React.Component { ...@@ -738,7 +742,7 @@ class AddVideoCourse extends React.Component {
<div className='upload-video mt16'> <div className='upload-video mt16'>
<div className='content flex'> <div className='content flex'>
<span className='label required'>上传课节:</span> <span className='label required upload-chapter'>上传课节:</span>
</div> </div>
<div className='sub-content'> <div className='sub-content'>
<div className="btn-wrap"> <div className="btn-wrap">
...@@ -761,7 +765,7 @@ class AddVideoCourse extends React.Component { ...@@ -761,7 +765,7 @@ class AddVideoCourse extends React.Component {
</div> </div>
<div className='tips'> <div className='tips'>
课节数量限制20个,文件规格说明 课节数量限制20个,文件规格说明
<Tooltip title="视频支持mp4格式,大小不超过2G;文件支持PDF、docx、doc格式,大小不超过100M"> <Tooltip title={this.renderToolTipTitle()} overlayClassName="my-chapter-tooltip">
<i className='icon iconfont' style={{ cursor: 'pointer', color: '#bfbfbf', fontSize: '14px'}}> &#xe61d;</i> <i className='icon iconfont' style={{ cursor: 'pointer', color: '#bfbfbf', fontSize: '14px'}}> &#xe61d;</i>
</Tooltip> </Tooltip>
</div> </div>
...@@ -821,7 +825,7 @@ class AddVideoCourse extends React.Component { ...@@ -821,7 +825,7 @@ class AddVideoCourse extends React.Component {
</If> </If>
<div className='cover-url flex mt16'> <div className='cover-url flex mt16'>
<div className='label'>封面图:</div> <div className='label cover'>封面图:</div>
<div className='cover-url__wrap'> <div className='cover-url__wrap'>
<div className='opt-btns'> <div className='opt-btns'>
<div> <div>
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
display:inline-block; display:inline-block;
text-align:right; text-align:right;
width:85px; width:85px;
&.upload-chapter {
margin-top: 6px;
}
&.cover {
margin-top: 2px;
}
} }
.required { .required {
position: relative; position: relative;
...@@ -172,10 +178,9 @@ ...@@ -172,10 +178,9 @@
} }
.course-chapter-list { .course-chapter-list {
max-height: 245px; max-height: 245px;
min-height: 130px;
overflow-y: auto ; overflow-y: auto ;
border-radius: 4px; border-radius: 4px;
padding: 16px; padding: 12px 16px 16px 16px;
.course-ware { .course-ware {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -258,3 +263,26 @@ ...@@ -258,3 +263,26 @@
min-height: 0; min-height: 0;
} }
} }
.course-chapter-title-popover {
.tag-title {
color: #333333;
margin-bottom: 8px;
width: 318px;
}
.chapter-btns {
margin-top: 16px;
display: flex;
justify-content: flex-end;
.confirm {
margin-left: 8px;
}
}
.ant-form-item {
margin-bottom: 0 !important;
}
}
.my-chapter-tooltip {
max-width: 600px!important;
}
\ No newline at end of file
/* /*
* @Author: wufan * @Author: wufan
* @Date: 2020-04-28 18:05:30 * @Date: 2020-04-28 18:05:30
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-07-13 15:26:11 * @LastEditTime: 2021-07-15 14:04:21
* @Description: 线上课课程课节详情 * @Description: 线上课课程课节详情
*/ */
......
...@@ -111,12 +111,12 @@ class AddVideoIntro extends React.Component { ...@@ -111,12 +111,12 @@ class AddVideoIntro extends React.Component {
<span className='label'>观看设置:</span> <span className='label'>观看设置:</span>
<div className='content'> <div className='content'>
<div> <div>
<Switch checked={whetherVisitorsJoin === 'NO' ? true : false} onChange={this.whetherVisitorsJoinChange} /> <Switch checked={whetherVisitorsJoin==="NO"? true:false} onChange={this.whetherVisitorsJoinChange}/>
</div> </div>
<div> <div>
<div className='desc'> <div className="desc">
<Choose> <Choose>
<When condition={whetherVisitorsJoin === 'NO'}> <When condition={whetherVisitorsJoin==="NO"}>
<div>已开启,学员需绑定手机号才可观看</div> <div>已开启,学员需绑定手机号才可观看</div>
</When> </When>
<Otherwise> <Otherwise>
...@@ -127,17 +127,17 @@ class AddVideoIntro extends React.Component { ...@@ -127,17 +127,17 @@ class AddVideoIntro extends React.Component {
</div> </div>
</div> </div>
</div> </div>
<div className='store-show'> <div className="store-show">
<span className='label'>学院展示:</span> <span className="label">学院展示:</span>
<div className='content'> <div className="content">
<Row> <Row>
<Col span={3}> <Col span={3}>
<Switch checked={shelfState === 'YES' ? true : false} onChange={this.shelfStateChange} /> <Switch checked={shelfState==="YES"? true:false} onChange={this.shelfStateChange}/>
</Col> </Col>
<Col span={21}> <Col span={21}>
<div className='desc'> <div className="desc">
<Choose> <Choose>
<When condition={shelfState === 'YES'}> <When condition={shelfState==="YES"}>
<div>已开启,课程将在该学院的学员课程列表中显示</div> <div>已开启,课程将在该学院的学员课程列表中显示</div>
</When> </When>
<Otherwise> <Otherwise>
...@@ -149,15 +149,15 @@ class AddVideoIntro extends React.Component { ...@@ -149,15 +149,15 @@ class AddVideoIntro extends React.Component {
</Row> </Row>
</div> </div>
</div> </div>
<div className='introduce'> <div className="introduce">
<span className='label'>课程简介:</span> <span className="label">课程简介:</span>
<div className='content'> <div className="content">
<div className='intro-list'> <div className="intro-list">
<div className='intro-list__item introduce-editor'> <div className="intro-list__item introduce-editor">
{(!id || loadintroduce) && ( {(!id || loadintroduce) && (
<GraphicsEditor <GraphicsEditor
maxLimit={1000} maxLimit={1000}
id='intro' id="intro"
isIntro={true} isIntro={true}
detail={{ detail={{
content: introduce, content: introduce,
......
import React from 'react'; import React from 'react';
import './ChapterList.less'; import './ChapterList.less';
import { FileTypeIcon } from '@/common/constants/academic/lessonEnum'
const FileTypeIconMap = FileTypeIcon;
function ChapterList(props){ function ChapterList(props){
const { courseChapterList } = props; const { courseChapterList } = props;
...@@ -9,7 +12,8 @@ function ChapterList(props){ ...@@ -9,7 +12,8 @@ function ChapterList(props){
{ {
_.map(courseChapterList,(item,index) => { _.map(courseChapterList,(item,index) => {
return <div className='course-ware'> return <div className='course-ware'>
<div className='course-ware__index'>{index < 9 ? `0${index + 1 } ` : `${index + 1 } `}</div> <img className='course-ware__img' src={FileTypeIconMap[item.mediaType]} alt='' />
<div className='course-ware__index'>{index < 9 ? `0${index + 1 }` : `${index + 1 }`}</div>
<div className="course-ware__detail"> <div className="course-ware__detail">
<div className='course-ware__detail__name'>{item.mediaName}</div> <div className='course-ware__detail__name'>{item.mediaName}</div>
{ item.mediaType === 'VIDEO' && { item.mediaType === 'VIDEO' &&
......
...@@ -14,18 +14,24 @@ ...@@ -14,18 +14,24 @@
font-weight: 500; font-weight: 500;
color: #999999; color: #999999;
line-height: 18px; line-height: 18px;
white-space: nowrap;
margin-left: 8px;
margin-right: 6px;
line-height: 20px;
}
&__img {
width: 20px;
height: 20px;
} }
&__detail { &__detail {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: calc(~'100% - 18px');
&__name { &__name {
width: 267px;
font-size: 13px; font-size: 13px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 21px; line-height: 20px;
margin-bottom: 4px; margin-bottom: 4px;
} }
&__duration { &__duration {
......
import React from 'react'; import React from "react"
import { Modal, message, Tooltip, Switch, Dropdown } from 'antd'; import { Modal, message, Tooltip, Switch, Dropdown } from "antd"
import _ from 'underscore'; import _ from "underscore"
import { PageControl } from '@/components'; import { PageControl } from "@/components"
import { LIVE_SHARE } from '@/domains/course-domain/constants'; import { LIVE_SHARE } from "@/domains/course-domain/constants"
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom';
import ShareLiveModal from '@/modules/course-manage/modal/ShareLiveModal'; import ShareLiveModal from "@/modules/course-manage/modal/ShareLiveModal"
import CourseService from '@/domains/course-domain/CourseService'; import CourseService from "@/domains/course-domain/CourseService"
import RelatedPlanModal from '../../modal/RelatedPlanModal'; import RelatedPlanModal from "../../modal/RelatedPlanModal"
import User from '@/common/js/user'; import User from "@/common/js/user"
import VideoCourseDetail from '../VideoCourseDetail'; import VideoCourseDetail from '../VideoCourseDetail';
import WatchData from './WatchData'; import WatchData from "./WatchData";
import { XMTable } from '@/components'; import { XMTable } from '@/components';
import college from '@/common/lottie/college'; import college from '@/common/lottie/college';
import './VideoCourseList.less'; import './VideoCourseList.less';
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: * @Description:
* @Author: zangsuyun * @Author: zangsuyun
* @Date: 2021-03-12 14:49:40 * @Date: 2021-03-12 14:49:40
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-07-13 15:28:04 * @LastEditTime: 2021-07-18 16:58:23
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangleyuan * @Author: zhangleyuan
* @Date: 2021-02-20 16:13:39 * @Date: 2021-02-20 16:13:39
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-08 10:52:05 * @LastEditTime: 2021-07-18 16:06:17
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -65,6 +65,7 @@ function AddPlan() { ...@@ -65,6 +65,7 @@ function AddPlan() {
planId: id, planId: id,
}).then((res) => { }).then((res) => {
const { const {
planId,
planName, planName,
enableState, enableState,
operateType, operateType,
...@@ -78,6 +79,7 @@ function AddPlan() { ...@@ -78,6 +79,7 @@ function AddPlan() {
let coverId; let coverId;
let coverUrl; let coverUrl;
let instro; let instro;
let hasIntro = false;
courseMediaVOS.map((item) => { courseMediaVOS.map((item) => {
switch (item.contentType) { switch (item.contentType) {
case 'COVER': case 'COVER':
...@@ -85,6 +87,7 @@ function AddPlan() { ...@@ -85,6 +87,7 @@ function AddPlan() {
coverUrl = item.mediaUrl; coverUrl = item.mediaUrl;
break; break;
case 'INTRO': case 'INTRO':
hasIntro = true;
instro = item.mediaContent; instro = item.mediaContent;
break; break;
default: default:
...@@ -102,6 +105,7 @@ function AddPlan() { ...@@ -102,6 +105,7 @@ function AddPlan() {
} }
setTaskList(trainingTaskList); setTaskList(trainingTaskList);
setBasicData({ setBasicData({
planId,
planName, planName,
coverUrl: coverUrl || defaultCover, coverUrl: coverUrl || defaultCover,
coverId, coverId,
...@@ -282,7 +286,7 @@ function AddPlan() { ...@@ -282,7 +286,7 @@ function AddPlan() {
<div className='add-plan-page__form'> <div className='add-plan-page__form'>
<div className='basic-info__wrap'> <div className='basic-info__wrap'>
<div className='title'>基本信息</div> <div className='title'>基本信息</div>
<BasicInfo data={basicData} onChange={handleChangeBasicInfo} /> <BasicInfo data={{ ...basicData, id}} onChange={handleChangeBasicInfo} />
</div> </div>
<div className='basic-info__wrap'> <div className='basic-info__wrap'>
<div className='title'>培训任务</div> <div className='title'>培训任务</div>
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-05 10:48:08 * @Date: 2021-07-05 10:48:08
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-07-09 11:51:46 * @LastEditTime: 2021-07-18 16:58:40
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
...@@ -22,7 +22,7 @@ import SelectOperatorModal from '../modal/SelectOperatorModal'; ...@@ -22,7 +22,7 @@ import SelectOperatorModal from '../modal/SelectOperatorModal';
import SelectPrepareFileModal from '@/modules/prepare-lesson/modal/SelectPrepareFileModal'; import SelectPrepareFileModal from '@/modules/prepare-lesson/modal/SelectPrepareFileModal';
import Upload from '@/core/upload'; import Upload from '@/core/upload';
import GraphicsEditor from '@/modules/course-manage/components/GraphicsEditor'; import GraphicsEditor from '@/modules/course-manage/components/GraphicsEditor';
import ImgClipModal from '@/components/ImgClipModal'; import ImgClipModal from '@/components/ImgClipModal'
import './BasicInfo.less'; import './BasicInfo.less';
const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png'; const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png';
...@@ -133,13 +133,13 @@ class BasicInfo extends React.Component { ...@@ -133,13 +133,13 @@ class BasicInfo extends React.Component {
}; };
changeIntro = (value) => { changeIntro = (value) => {
this.props.onChange('introduce', value); this.props.onChange('instro', value);
}; };
render() { render() {
const { operatorModalVisible, showSelectFileModal, visible, imageFile } = this.state; const { operatorModalVisible, showSelectFileModal, visible, imageFile } = this.state;
const { data } = this.props; const { data } = this.props;
const { planName, coverUrl, introduce, enableState, operateType, selectOperatorList, percentCompleteLive, percentCompleteVideo, percentCompletePicture } = const { planName, coverUrl, instro, enableState, operateType, selectOperatorList, percentCompleteLive, percentCompleteVideo, percentCompletePicture, planId, id } =
data; data;
// 当前是否使用的是默认图片 // 当前是否使用的是默认图片
const isDefaultCover = coverUrl === defaultCover; const isDefaultCover = coverUrl === defaultCover;
...@@ -182,17 +182,17 @@ class BasicInfo extends React.Component { ...@@ -182,17 +182,17 @@ class BasicInfo extends React.Component {
</div> </div>
<div className='introduction'> <div className='introduction'>
<span className='label'>简介:</span> <span className='label'>简介:</span>
<GraphicsEditor {(!id || planId ) && (<GraphicsEditor
id='intro' id='intro'
isIntro={true} isIntro={true}
maxLimit={1000} maxLimit={1000}
detail={{ detail={{
content: introduce, content: instro,
}} }}
onChange={(val) => { onChange={(val) => {
this.changeIntro(val); this.changeIntro(val);
}} }}
/> />)}
</div> </div>
<div className='wether-use'> <div className='wether-use'>
<span className='label'>是否启用:</span> <span className='label'>是否启用:</span>
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
} }
.choose-business { .choose-business {
margin-top: 12px; margin-top: 12px;
margin-left: 24px;
.ant-btn { .ant-btn {
margin-right: 12px; margin-right: 12px;
} }
......
/* /*
* @Author: zhangleyuan * @Author: zhangleyuan
* @Date: 2021-02-20 16:46:46 * @Date: 2021-02-20 16:46:46
* @LastEditors: fusanqiasng * @LastEditors: yuananting
* @LastEditTime: 2021-06-15 14:37:20 * @LastEditTime: 2021-07-18 16:58:52
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -52,7 +52,6 @@ function PlanList(props) { ...@@ -52,7 +52,6 @@ function PlanList(props) {
title: '课程总数量', title: '课程总数量',
key: 'courseNum', key: 'courseNum',
dataIndex: 'courseNum', dataIndex: 'courseNum',
width: 110,
render: (val, record) => { render: (val, record) => {
return <div className='course-number'>{val}</div>; return <div className='course-number'>{val}</div>;
}, },
......
.plan-list { .plan-list {
margin-top: 12px; margin-top: 12px;
.course-number { .course-number {
text-align: right;
margin-right: 45px; margin-right: 45px;
} }
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-07-05 10:50:10 * @Date: 2021-07-05 10:50:10
* @LastEditors: yuananting * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-13 19:55:29 * @LastEditTime: 2021-07-18 10:47:02
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React from 'react'; import React from 'react';
import _ from 'underscore'; import _ from 'underscore';
import { Table, Radio, Tabs, Modal, Input, message, Button, Tooltip } from 'antd'; import { Radio, Tabs, Modal, Input, message, Button, Tooltip } from 'antd';
import { PageControl } from '@/components'; import { PageControl, XMTable } from '@/components';
import college from '@/common/lottie/college';
import CourseService from '@/domains/course-domain/CourseService'; import CourseService from '@/domains/course-domain/CourseService';
import User from '@/common/js/user'; import User from '@/common/js/user';
...@@ -732,7 +733,11 @@ class SelectOperatorModal extends React.Component { ...@@ -732,7 +733,11 @@ class SelectOperatorModal extends React.Component {
</div> </div>
</div> </div>
<div> <div>
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据',
}}
rowKey={(record) => record.liveCourseId} rowKey={(record) => record.liveCourseId}
dataSource={liveDataSource} dataSource={liveDataSource}
columns={this.parseLiveColumns()} columns={this.parseLiveColumns()}
...@@ -824,7 +829,11 @@ class SelectOperatorModal extends React.Component { ...@@ -824,7 +829,11 @@ class SelectOperatorModal extends React.Component {
</div> </div>
</div> </div>
<div> <div>
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据',
}}
rowKey={(record) => record.id} rowKey={(record) => record.id}
dataSource={videoDataSource[videoCourseDivision]} dataSource={videoDataSource[videoCourseDivision]}
columns={this.parseVideoColumns()} columns={this.parseVideoColumns()}
...@@ -929,7 +938,11 @@ class SelectOperatorModal extends React.Component { ...@@ -929,7 +938,11 @@ class SelectOperatorModal extends React.Component {
</div> </div>
</div> </div>
<div> <div>
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据',
}}
rowKey={(record) => record.id} rowKey={(record) => record.id}
dataSource={pictureDataSource} dataSource={pictureDataSource}
columns={this.parsePictureColumns()} columns={this.parsePictureColumns()}
......
...@@ -290,7 +290,8 @@ class SelectPrepareFileModal extends React.Component { ...@@ -290,7 +290,8 @@ class SelectPrepareFileModal extends React.Component {
const { fileListRef } = this.refs; const { fileListRef } = this.refs;
// const hasReachBottom = fileListRef.scrollTop + fileListRef.clientHeight === fileListRef.scrollHeight; // const hasReachBottom = fileListRef.scrollTop + fileListRef.clientHeight === fileListRef.scrollHeight;
const hasReachBottom = fileListRef.scrollTop + fileListRef.clientHeight > fileListRef.scrollHeight - 1; const hasReachBottom = fileListRef.scrollTop + fileListRef.clientHeight > fileListRef.scrollHeight - 10;
console.log("fileListRef.scrollTop + fileListRef.clientHeight",hasReachBottom,fileListRef.scrollTop , fileListRef.clientHeight,fileListRef.scrollHeight)
if (!hasReachBottom || !hasMore) return; if (!hasReachBottom || !hasMore) return;
const currentFolder = folderPathList[folderPathList.length - 1]; const currentFolder = folderPathList[folderPathList.length - 1];
...@@ -325,14 +326,16 @@ class SelectPrepareFileModal extends React.Component { ...@@ -325,14 +326,16 @@ class SelectPrepareFileModal extends React.Component {
// 上传文件 // 上传文件
handleUpload = (event) => { handleUpload = (event) => {
const { selectType,accept} = this.props;
const { selectType } = this.props;
const fileList = event.target.files; const fileList = event.target.files;
// 判断文件的大小是否超出了限制 // 判断文件的大小是否超出了限制
const nonCompliantFileList = []; const nonCompliantFileList = [];
const _fileList = [...fileList]; const _fileList = [...fileList];
const _accept = accept.split(',');
console.log("_fileList",_fileList);
console.log('accept',_accept);
_fileList.map((file, index) => { _fileList.map((file, index) => {
console.log('file',file);
let { size, type, name } = file; let { size, type, name } = file;
if (!type) { if (!type) {
type = getFileTypeByName(name); type = getFileTypeByName(name);
...@@ -341,6 +344,11 @@ class SelectPrepareFileModal extends React.Component { ...@@ -341,6 +344,11 @@ class SelectPrepareFileModal extends React.Component {
nonCompliantFileList.push(file); nonCompliantFileList.push(file);
_fileList.splice(index, 1); _fileList.splice(index, 1);
} }
console.log('type',type);
//mac的企业微信环境下加accept不起作用,所以需要我们在选择完成后做一层限制
// if(accept && _accept.indexOf("."+_.last(name.split('.')).toLowerCase()) === -1){
// _fileList.splice(index, 1);
// }
file.key = count++; file.key = count++;
}); });
console.log("nonCompliantFileList",nonCompliantFileList); console.log("nonCompliantFileList",nonCompliantFileList);
...@@ -573,7 +581,8 @@ class SelectPrepareFileModal extends React.Component { ...@@ -573,7 +581,8 @@ class SelectPrepareFileModal extends React.Component {
} }
</div> </div>
{ {
!_.isEmpty(folderList) ? <Choose>
<When condition={!_.isEmpty(folderList)}>
<div> <div>
<div className="file-list" <div className="file-list"
onScrollCapture={() => this.handleScrollEvent()} onScrollCapture={() => this.handleScrollEvent()}
...@@ -611,8 +620,7 @@ class SelectPrepareFileModal extends React.Component { ...@@ -611,8 +620,7 @@ class SelectPrepareFileModal extends React.Component {
// 文件禁止点击的情况(移动、直播场景下文件为Excel、文件已经被关联了、文件不合法) // 文件禁止点击的情况(移动、直播场景下文件为Excel、文件已经被关联了、文件不合法)
const disabled = hiddenVideo || (!isFolder && operateType === 'move') || (scene === 'liveCourse' && folder.folderFormat === 'EXCEL') || !!hasRelation || (!isFolder && !FILE_SUFFIX_LIST.includes(suffix)); const disabled = hiddenVideo || (!isFolder && operateType === 'move') || (scene === 'liveCourse' && folder.folderFormat === 'EXCEL') || !!hasRelation || (!isFolder && !FILE_SUFFIX_LIST.includes(suffix));
// console.log('currentFile',currentFile);
// console.log('folder',folder);
let currentFileCheck = false; let currentFileCheck = false;
if(currentFile){ if(currentFile){
currentFileCheck = (currentFile.id===folder.id) currentFileCheck = (currentFile.id===folder.id)
...@@ -660,12 +668,16 @@ class SelectPrepareFileModal extends React.Component { ...@@ -660,12 +668,16 @@ class SelectPrepareFileModal extends React.Component {
}) })
} }
</div> </div>
</div> : </div>
</When>
<Otherwise>
<LottieIcon <LottieIcon
title={<span className="desc">这个文件夹是空的</span>} title={<span className="desc">这个文件夹是空的</span>}
type="college" type="college"
size={150} size={150}
/> />
</Otherwise>
</Choose>
} }
<UploadProgressModal <UploadProgressModal
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-09-10 18:26:03 * @Date: 2019-09-10 18:26:03
* @LastEditors: yuananting * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-06 14:37:49 * @LastEditTime: 2021-07-14 14:14:16
* @Description: * @Description:
*/ */
import React, { useRef, useContext, useEffect, useState } from 'react'; import React, { useRef, useContext, useEffect, useState } from 'react';
...@@ -344,7 +344,7 @@ function Header(props) { ...@@ -344,7 +344,7 @@ function Header(props) {
<div className='h5-url'> <div className='h5-url'>
<div className='name'>手机端学院</div> <div className='name'>手机端学院</div>
<div id='h5-qrcode'></div> <div id='h5-qrcode'></div>
<div className='tip'>微信扫码,打开学院</div> <div className='tip'>企业员工扫码登录学院</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
.name, .name,
.tip { .tip {
width: 70px; width: 70px;
font-size: 14px; font-size: 13px;
color: #333333; color: #333333;
line-height: 52px; line-height: 52px;
margin: 0 auto; margin: 0 auto;
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
.ant-menu-item { .ant-menu-item {
padding-left: 46px !important; padding-left: 46px !important;
&:hover { &:hover {
color: @active-color!important; color: #333!important;
} }
} }
} }
...@@ -131,17 +131,20 @@ ...@@ -131,17 +131,20 @@
.ant-menu-item-selected { .ant-menu-item-selected {
color: @active-color; color: @active-color;
font-weight: 500; font-weight: 500;
&:hover {
color: @active-color!important;
}
.listType { .listType {
background: @active-color; background: @active-color;
} }
} }
.ant-menu-submenu-arrow { .ant-menu-submenu-arrow {
right: 22px; right: 10px!important;
color: @active-color; color: @active-color;
} }
} }
.ant-menu-submenu-arrow { .ant-menu-submenu-arrow {
right: 22px; right: 10px!important;
color: #5e606a; color: #5e606a;
} }
} }
...@@ -277,6 +280,10 @@ ...@@ -277,6 +280,10 @@
left: 74px; left: 74px;
} }
} }
.ant-menu-inline .ant-menu-item, .ant-menu-inline .ant-menu-submenu-title {
width: calc(100% - 15px)!important;
}
.ant-menu-submenu:hover { .ant-menu-submenu:hover {
// background: rgba(41, 102, 255, .05) !important; // background: rgba(41, 102, 255, .05) !important;
&.ant-menu-submenu-title:hover { &.ant-menu-submenu-title:hover {
......
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect, useContext } from 'react'
import Breadcrumbs from '@/components/Breadcrumbs'; import Breadcrumbs from "@/components/Breadcrumbs";
import { Form, Input, Button, InputNumber, DatePicker, Switch, Radio, message, Modal, Tooltip } from 'antd'; import { Form, Alert, Input, Button, InputNumber, DatePicker, Switch, Radio, message, Modal, Tooltip } from 'antd';
import { withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom';
import User from '@/common/js/user'; import User from "@/common/js/user";
import moment from 'moment'; import moment from 'moment'
import Service from '@/common/js/service'; import Service from "@/common/js/service";
import _ from 'underscore'; import _ from 'underscore'
import GraphicsEditor from '../../course-manage/components/GraphicsEditor'; import GraphicsEditor from '../../course-manage/components/GraphicsEditor';
import SelectPaperModal from './SelectPaperModal'; import SelectPaperModal from './SelectPaperModal'
import PreviewModal from './PreviewModal'; import PreviewModal from './PreviewModal'
import ShowTips from '@/components/ShowTips'; import ShowTips from "@/components/ShowTips";
import './AddExam.less'; import './AddExam.less';
...@@ -20,7 +20,7 @@ function AddExam(props: any) { ...@@ -20,7 +20,7 @@ function AddExam(props: any) {
const [showModal, setShowModal] = useState(false); const [showModal, setShowModal] = useState(false);
const [paperInfo, setPaperInfo] = useState(paperInfoInit); const [paperInfo, setPaperInfo] = useState(paperInfoInit);
const [paperId, setPaperId] = useState(''); const [paperId, setPaperId] = useState('');
const [passRate, setPassRate] = useState(60); //及格线 const [passRate, setPassRate] = useState(60);//及格线
const [examStartTime, setStartTime] = useState(''); const [examStartTime, setStartTime] = useState('');
const [examEndTime, setExamEndTime] = useState(''); const [examEndTime, setExamEndTime] = useState('');
const [examName, setExamName] = useState(''); const [examName, setExamName] = useState('');
...@@ -45,38 +45,30 @@ function AddExam(props: any) { ...@@ -45,38 +45,30 @@ function AddExam(props: any) {
useEffect(() => { useEffect(() => {
queryExamList(); queryExamList();
switch (props.type) { switch (props.type) {
case 'copy': // 考试列表-复制考试进入 case "copy": // 考试列表-复制考试进入
case 'edit': // 考试列表-编辑考试进入 case "edit": // 考试列表-编辑考试进入
queryExamDetail(); queryExamDetail();
break; break;
case 'organizeExam': // 试卷列表-组织考试进入 case "organizeExam": // 试卷列表-组织考试进入
case 'newPaperToAddExam': // 组卷页面-新建保存试卷并组织考试 case "newPaperToAddExam": // 组卷页面-新建保存试卷并组织考试
case 'editPaperToAddExam': // 组卷页面-编辑保存试卷并组织考试 case "editPaperToAddExam": // 组卷页面-编辑保存试卷并组织考试
setGetData(true); setGetData(true);
setPaperInfo(props.paperInfo); setPaperInfo(props.paperInfo);
setExamName(props.paperInfo?.paperName); setExamName(props.paperInfo?.paperName)
break; break;
} }
}, [props.paperInfo, props.type, queryExamDetail]); }, [])
useEffect(() => { useEffect(() => {
setPaperId(paperInfo.paperId); setPaperId(paperInfo.paperId)
setPassRate(paperInfo.passRate); setPassRate(paperInfo.passRate)
}, [paperInfo.paperId, paperInfo.passRate]);
}, [paperInfo.paperId])
useEffect(() => { useEffect(() => {
setPassScore(Math.round((((paperInfo.totalScore || 0) * (passRate || 0)) as any) / 100)); setPassScore(Math.round((paperInfo.totalScore || 0) * (passRate || 0) as any / 100))
setExamTotal(paperInfo.singleChoiceCnt + paperInfo.multiChoiceCnt + paperInfo.judgeCnt + paperInfo.gapFillingCnt + paperInfo.indefiniteChoiceCnt || 0); setExamTotal(paperInfo.singleChoiceCnt + paperInfo.multiChoiceCnt + paperInfo.judgeCnt + paperInfo.gapFillingCnt + paperInfo.indefiniteChoiceCnt || 0)
}, [ }, [paperInfo.paperId, passRate])
paperInfo.gapFillingCnt,
paperInfo.indefiniteChoiceCnt,
paperInfo.judgeCnt,
paperInfo.multiChoiceCnt,
paperInfo.paperId,
paperInfo.singleChoiceCnt,
paperInfo.totalScore,
passRate,
]);
function disabledDate(current: any) { function disabledDate(current: any) {
// Can not select days before today and today // Can not select days before today and today
...@@ -91,43 +83,44 @@ function AddExam(props: any) { ...@@ -91,43 +83,44 @@ function AddExam(props: any) {
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
source: 0, source: 0,
}; }
Service.Hades('public/hades/queryExamPageList', param).then((res) => { Service.Hades('public/hades/queryExamPageList', param).then(res=> {
console.log(res); console.log(res)
const { result = {} } = res; const { result = {} } = res;
setExamList(result.records); setExamList(result.records)
}); })
} }
function queryExamDetail() { function queryExamDetail() {
Service.Hades('public/hades/queryExamDetail', { Service.Hades("public/hades/queryExamDetail", {
examId: match.params.id, examId: match.params.id,
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
source: 0, source: 0
}).then((res) => { }).then((res) => {
const { result } = res; const { result } = res
setPaperInfo(result.examPaper); setPaperInfo(result.examPaper)
setPaperId(result.examPaper.paperId); setPaperId(result.examPaper.paperId)
setStartTime(props.type === 'edit' ? result.examStartTime : ''); setStartTime(props.type === 'edit' ? result.examStartTime : '')
setExamEndTime(props.type === 'edit' ? result.examEndTime : ''); setExamEndTime(props.type === 'edit' ? result.examEndTime : '')
setExamName(props.type === 'edit' ? result.examName : `${result.examName}(复制)`); setExamName(props.type === 'edit' ? result.examName : `${result.examName}(复制)`)
setPassRate(result.passRate * 100); setPassRate(result.passRate * 100)
setNeedPhone(result.needPhone); setNeedPhone(result.needPhone)
setExamDesc(result.examDesc); setExamDesc(result.examDesc)
setExamDuration((result.examDuration / 60 / 1000) as any); setExamDuration(result.examDuration / 60 / 1000 as any)
setAnswerAnalysis(result.answerAnalysis); setAnswerAnalysis(result.answerAnalysis)
setNeedOptionDisorder(result.needOptionDisorder); setNeedOptionDisorder(result.needOptionDisorder)
setPassScore(result.passScore); setPassScore(result.passScore)
setResultContent(result.resultContent); setResultContent(result.resultContent)
setResultShow(result.resultShow); setResultShow(result.resultShow)
setGetData(true); setGetData(true)
});
})
} }
function handleSave() { function handleSave() {
if (request.current) { if (request.current) {
return; return
} }
setCheck(true); setCheck(true);
...@@ -150,87 +143,92 @@ function AddExam(props: any) { ...@@ -150,87 +143,92 @@ function AddExam(props: any) {
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
source: 0, source: 0,
examId: '', examId: ''
}; }
if (!param.examName) { if (!param.examName) {
message.warning('请输入考试名称'); message.warning('请输入考试名称');
return; return
} }
if (param.examName && param.examName.length > 40) { if (param.examName && param.examName.length > 40) {
message.warning('考试名称最多40字'); message.warning('考试名称最多40字');
return; return
} }
if (checkExist(param.examName)) { if(checkExist(param.examName)) {
message.warning('此考试名称已存在'); message.warning('此考试名称已存在');
return; return
} }
if (!paperId) { if (!paperId) {
message.warning('请选择试卷'); message.warning('请选择试卷');
return; return
} }
if (!passRate) { if (!passRate) {
message.warning('请输入及格线'); message.warning('请输入及格线');
return; return
} }
if (!examStartTime || !examEndTime) { if (!examStartTime || !examEndTime) {
message.warning('请选择考试起止时间'); message.warning('请选择考试起止时间');
return; return
} }
if (Number(examStartTime) < moment().valueOf()) { if (Number(examStartTime) < moment().valueOf()) {
message.warning('开始时间不能早于现在'); message.warning('开始时间不能早于现在');
return; return
} }
if (!examDuration) { if (!examDuration) {
message.warning('请输入考试时长'); message.warning('请输入考试时长');
return; return
} }
if (examStartTime + (examDuration as any) * 60 * 1000 > examEndTime) { if (examStartTime + (examDuration as any) * 60 * 1000 > examEndTime) {
message.warning('考试时长不得超过考试有效期时长'); message.warning('考试时长不得超过考试有效期时长');
return; return
} }
if (desclen > 1000) { if (desclen > 1000) {
message.warning('内容过长,不能超过1000字'); message.warning('内容过长,不能超过1000字');
return; return
} }
request.current = true; request.current = true;
setTimeout(() => { setTimeout(() => {
request.current = false; request.current = false
}, 2000); }, 2000)
if (props.type === 'edit') { if (props.type === 'edit') {
param.examId = match.params.id; param.examId = match.params.id;
} }
Service.Hades(props.type === 'edit' ? 'public/hades/editExam' : 'public/hades/createExam', param).then((res) => { Service.Hades(props.type === 'edit' ? 'public/hades/editExam' : "public/hades/createExam", param).then((res) => {
message.success(props.type === 'edit' ? '编辑成功' : '创建成功'); message.success(props.type === 'edit' ? '编辑成功' : '创建成功');
switch (props.type) { switch (props.type) {
case 'organizeExam': // 试卷列表-组织考试进入 case "organizeExam": // 试卷列表-组织考试进入
case 'newPaperToAddExam': // 组卷保存组织考试 case "newPaperToAddExam": // 组卷保存组织考试
case 'editPaperToAddExam': case "editPaperToAddExam":
window.RCHistory.push('/examination-manage-index'); window.RCHistory.push("/examination-manage-index")
break; break;
case 'add': case "add":
case 'edit': // 考试列表-新建或编辑 case "edit": // 考试列表-新建或编辑
case 'copy': // 考试列表-新建或编辑 case "copy": // 考试列表-新建或编辑
props.freshList(); props.freshList()
props.history.goBack(); props.history.goBack();
break; break;
} }
}); })
} }
function disabledRangeTime(date: any, type: any) { function disabledRangeTime(date: any, type: any) {
if (moment(date).isSame(moment(), 'day')) { if (moment(date).isSame(moment(), 'day')) {
return { return {
disabledHours: () => { disabledHours: () => {
...@@ -251,6 +249,7 @@ function AddExam(props: any) { ...@@ -251,6 +249,7 @@ function AddExam(props: any) {
} }
return minutes; return minutes;
}, },
}; };
} }
return { return {
...@@ -260,23 +259,25 @@ function AddExam(props: any) { ...@@ -260,23 +259,25 @@ function AddExam(props: any) {
}; };
} }
function handleGoBack() { function handleGoBack() {
Modal.confirm({ Modal.confirm({
title: '确定要返回吗?', title: '确定要返回吗?',
content: '返回后,本次编辑的内容将不被保存', content: '返回后,本次编辑的内容将不被保存',
okText: '确认返回', okText: '确认返回',
cancelText: '留在本页', cancelText: '留在本页',
icon: <span className='icon iconfont default-confirm-icon'>&#xe6f4;</span>, icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span>,
onOk: () => { onOk: () => {
window.RCHistory.push('/examination-manage-index'); window.RCHistory.push("/examination-manage-index")
}, }
}); })
} }
// 校验考试名称是否存在 // 校验考试名称是否存在
function checkExist(examName: any) { function checkExist(examName: any) {
var result: any = null; var result:any = null;
examList.forEach((item: any) => { examList.forEach((item:any) => {
if (result != null) { if (result != null) {
return result; return result;
} }
...@@ -291,14 +292,14 @@ function AddExam(props: any) { ...@@ -291,14 +292,14 @@ function AddExam(props: any) {
} }
}); });
return result; return result;
} };
let title = ''; let title = '';
switch (props.type) { switch (props.type) {
case 'add': case 'add':
case 'organizeExam': case "organizeExam":
case 'newPaperToAddExam': case "newPaperToAddExam":
case 'editPaperToAddExam': case "editPaperToAddExam":
title = '新建考试'; title = '新建考试';
break; break;
case 'edit': case 'edit':
...@@ -310,253 +311,213 @@ function AddExam(props: any) { ...@@ -310,253 +311,213 @@ function AddExam(props: any) {
default: default:
break; break;
} }
return ( return <div className="page examPage">
<div className='page examPage'>
<Breadcrumbs navList={title} goBack={handleGoBack} /> <Breadcrumbs navList={title} goBack={handleGoBack} />
<div className='box'> <div className="box">
<div className='show-tips'> <div className="show-tips">
<ShowTips message='请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利' /> <ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企学院保有依据国家规定及平台规则进行处理的权利" />
</div>{' '} </div> <div className="form">
<div className='form'> <div className="title">基本信息</div>
<div className='title'>基本信息</div> <Form
<Form labelCol={{ span: 3 }} wrapperCol={{ span: 14 }} layout='horizontal'> labelCol={{ span: 3 }}
<Form.Item wrapperCol={{ span: 14 }}
label='考试名称' layout="horizontal"
validateStatus={check && (!examName || examName.length > 40 || checkExist(examName)) ? 'error' : ''} >
help={check && (!examName ? '请输入考试名称' : examName.length > 40 ? '考试名称最多40字' : checkExist(examName) && '此考试名称已存在')} <Form.Item label="考试名称"
validateStatus={(check && (!examName || (examName.length > 40 || checkExist(examName)) )) ? 'error' : ''}
help={check && (!examName ? '请输入考试名称' : (examName.length > 40 ? '考试名称最多40字' : (checkExist(examName) && '此考试名称已存在')))}
required> required>
<Input
placeholder='请输入考试名称(40字以内)' <Input placeholder='请输入考试名称(40字以内)' maxLength={40} value={examName} onChange={(e) => {
maxLength={40} setExamName(e.target.value)
value={examName} }} style={{ width: 320 }} />
onChange={(e) => {
setExamName(e.target.value);
}}
style={{ width: 320 }}
/>
</Form.Item> </Form.Item>
<Form.Item label='选择试卷' validateStatus={check && !paperId ? 'error' : ''} help={check && !paperId && '请选择试卷'} required> <Form.Item label="选择试卷"
<Button validateStatus={(check && !paperId) ? 'error' : ''}
onClick={() => { help={check && !paperId && '请选择试卷'}
setShowModal(true); required>
}}> <Button onClick={() => { setShowModal(true) }} >{paperInfo.paperId ? '重新选择' : '选择试卷'}</Button>
{paperInfo.paperId ? '重新选择' : '选择试卷'}
</Button> {
paperInfo.paperId && <div className="paperTitle"><img src="https://image.xiaomaiketang.com/xm/pY5imEhjzw.png" alt="" /> {paperInfo.paperName}</div>
{paperInfo.paperId && ( }
<div className='paperTitle'>
<img src='https://image.xiaomaiketang.com/xm/pY5imEhjzw.png' alt='' /> {paperInfo.paperName}
</div>
)} {
paperInfo.paperId && <div className="table">
{paperInfo.paperId && ( <div className="header">
<div className='table'> <div className="item">单选题</div>
<div className='header'> <div className="item">多选题</div>
<div className='item'>单选题</div> <div className="item">判断题</div>
<div className='item'>多选题</div> <div className="item">填空题</div>
<div className='item'>判断题</div> <div className="item long">不定项选择题</div>
<div className='item'>填空题</div> <div className="item">合计</div>
<div className='item long'>不定项选择题</div>
<div className='item'>合计</div>
</div> </div>
<div className='body-list'> <div className="body-list">
<div className='item'>{paperInfo.singleChoiceCnt || 0}</div> <div className="item">{paperInfo.singleChoiceCnt || 0}</div>
<div className='item'>{paperInfo.multiChoiceCnt || 0}</div> <div className="item">{paperInfo.multiChoiceCnt || 0}</div>
<div className='item'>{paperInfo.judgeCnt || 0}</div> <div className="item">{paperInfo.judgeCnt || 0}</div>
<div className='item'>{paperInfo.gapFillingCnt || 0}</div> <div className="item">{paperInfo.gapFillingCnt || 0}</div>
<div className='item long'>{paperInfo.indefiniteChoiceCnt || 0}</div> <div className="item long">{paperInfo.indefiniteChoiceCnt || 0}</div>
<div className='item'>{examTotal}</div> <div className="item">{examTotal}</div>
</div> </div>
<div className='body-list'> <div className="body-list">
<div className='item'>{paperInfo.singleChoiceScore || 0}</div> <div className="item">{paperInfo.singleChoiceScore || 0}</div>
<div className='item'>{paperInfo.multiChoiceScore || 0}</div> <div className="item">{paperInfo.multiChoiceScore || 0}</div>
<div className='item'>{paperInfo.judgeScore || 0}</div> <div className="item">{paperInfo.judgeScore || 0}</div>
<div className='item'>{paperInfo.gapFillingScore || 0}</div> <div className="item">{paperInfo.gapFillingScore || 0}</div>
<div className='item long'>{paperInfo.indefiniteChoiceScore || 0}</div> <div className="item long">{paperInfo.indefiniteChoiceScore || 0}</div>
<div className='item'>{paperInfo.totalScore || 0}</div> <div className="item">{paperInfo.totalScore || 0}</div>
</div> </div>
</div> </div>
)} }
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={ label={<div>
<div>
<span>及格线</span> <span>及格线</span>
<Tooltip title='默认为选中试卷所设置的及格线,可修改'> <Tooltip title="默认为选中试卷所设置的及格线,可修改">
<span className='icon iconfont' style={{ color: '#BFBFBF', marginLeft: 4 }}> <span className="icon iconfont" style={{ color: '#BFBFBF', marginLeft: 4 }}>&#xe61d;</span>
&#xe61d;
</span>
</Tooltip> </Tooltip>
</div> </div>}
}
style={{ marginTop: 24 }} style={{ marginTop: 24 }}
validateStatus={check && !passRate ? 'error' : ''} validateStatus={(check && !passRate) ? 'error' : ''}
help={check && !passRate && '请输入及格线'} help={check && !passRate && '请输入及格线'}
required> required
<InputNumber >
value={passRate} <InputNumber value={passRate} min={0} max={100} onChange={(value: any) => { setPassRate(parseInt(value)) }} style={{ width: 100 }} />
min={0} <span style={{ marginLeft: 4 }}>%
max={100}
onChange={(value: any) => {
setPassRate(parseInt(value));
}}
style={{ width: 100 }}
/>
<span style={{ marginLeft: 4 }}>%</span>
<span style={{ marginLeft: 16, color: '#999' }}>
{` 总分(${paperInfo.totalScore || 0})*及格线(${passRate || 0}%)=及格分数(${passScore})`}
</span> </span>
<span style={{ marginLeft: 16, color: "#999" }}>
{` 总分(${paperInfo.totalScore || 0})*及格线(${passRate || 0}%)=及格分数(${passScore})`}</span>
</Form.Item> </Form.Item>
<Form.Item <Form.Item label="考试有效期"
label='考试有效期' validateStatus={(check && !examStartTime) ? 'error' : ''}
validateStatus={check && !examStartTime ? 'error' : ''}
help={check && !examStartTime && '请选择考试起止时间'} help={check && !examStartTime && '请选择考试起止时间'}
required> required>
<RangePicker <RangePicker
style={{ width: 320 }} style={{ width: 320 }}
showTime={{ defaultValue: [moment().add(5, 'minutes'), moment().add(5, 'minutes')] }} showTime={{ defaultValue: [moment().add(5, 'minutes'), moment().add(5, 'minutes')] }}
ranges={{ ranges={{
近七天: [moment().add(5, 'minute'), moment().add(6, 'day').endOf('day')], '近七天': [moment().add(5, 'minute'), moment().add(6, 'day').endOf('day')],
1个月: [moment().add(5, 'minute'), moment().add(1, 'month').endOf('day')], '近1个月': [moment().add(5, 'minute'), moment().add(1, 'month').endOf('day')],
3个月: [moment().add(5, 'minute'), moment().add(3, 'month').endOf('day')], '近3个月': [moment().add(5, 'minute'), moment().add(3, 'month').endOf('day')],
}} }}
disabledDate={disabledDate} disabledDate={disabledDate}
value={[examStartTime ? moment(Number(examStartTime)) : null, examEndTime ? moment(Number(examEndTime)) : null]} value={[
examStartTime ? moment(Number(examStartTime)) : null,
examEndTime ? moment(Number(examEndTime)) : null
]}
disabledTime={disabledRangeTime} disabledTime={disabledRangeTime}
format='YYYY/MM/DD HH:mm' format="YYYY/MM/DD HH:mm"
onChange={(date: any) => { onChange={(date: any) => {
setStartTime(date && date[0]?.valueOf()); setStartTime(date && date[0]?.valueOf());
setExamEndTime(date && date[1]?.valueOf()); setExamEndTime(date && date[1]?.valueOf());
}} }}
/> />
</Form.Item> </Form.Item>
<Form.Item label='考试时长' validateStatus={check && !examDuration ? 'error' : ''} help={check && !examDuration && '请输入考试时长'} required> <Form.Item label="考试时长"
<InputNumber validateStatus={(check && !examDuration) ? 'error' : ''}
value={examDuration} help={check && !examDuration && '请输入考试时长'}
max={1440} required>
min={1} <InputNumber value={examDuration} max={1440} min={1} onChange={(value: any) => { setExamDuration(parseInt(value) as any) }} style={{ width: 100 }} />
onChange={(value: any) => { <span style={{ marginLeft: 4 }}>分钟
setExamDuration(parseInt(value) as any); </span>
}} <span style={{ marginLeft: 16, color: "#999" }}>
style={{ width: 100 }} {` 时长不能超过1440分钟(24小时)`}</span>
/>
<span style={{ marginLeft: 4 }}>分钟</span>
<span style={{ marginLeft: 16, color: '#999' }}>{` 时长不能超过1440分钟(24小时)`}</span>
</Form.Item> </Form.Item>
<Form.Item label='考试说明' validateStatus={check && desclen > 1000 ? 'error' : ''} help={check && desclen > 1000 && '最多只能输入1000个字'}> <Form.Item label="考试说明"
{(getData || props.type === 'add') && ( validateStatus={(check && (desclen > 1000)) ? 'error' : ''}
<GraphicsEditor help={check && (desclen > 1000) && '最多只能输入1000个字'}
>
{
(getData || (props.type === 'add')) && <GraphicsEditor
maxLimit={1000} maxLimit={1000}
isIntro={true} isIntro={true}
detail={{ detail={{
content: examDesc, content: examDesc
}}
onChange={(val: any, len: any) => {
setExamDesc(val);
setDescLen(len);
}} }}
onChange={(val: any, len: any) => { setExamDesc(val); setDescLen(len) }}
/> />
)} }
</Form.Item> </Form.Item>
<div className='title' style={{ marginTop: 40 }}> <div className="title" style={{ marginTop: 40 }}>考试设置</div>
考试设置 <Form.Item label="身份验证" required>
</div> <div style={{ display: 'flex', marginLeft: 4, }}>
<Form.Item label='身份验证' required> <Switch style={{ position: 'relative', top: 6 }}
<div style={{ display: 'flex', marginLeft: 4 }}>
<Switch
style={{ position: 'relative', top: 6 }}
checked={needPhone == 'NEED_PHONE_VERIFY'} checked={needPhone == 'NEED_PHONE_VERIFY'}
onChange={(val) => { onChange={(val) => { setNeedPhone(val ? 'NEED_PHONE_VERIFY' : 'DO_NOT_NEED_PHONE_VERIFY') }}
setNeedPhone(val ? 'NEED_PHONE_VERIFY' : 'DO_NOT_NEED_PHONE_VERIFY'); ></Switch>
}}></Switch> <div style={{ position: 'relative', top: 3, left: 8, color: "#999" }}><p>开启:需要绑定手机号的学员才能参加考试</p>
<div style={{ position: 'relative', top: 3, left: 8, color: '#999' }}> <p>关闭:微信/企业微信登陆直接参加考试</p></div>
<p>开启:需要绑定手机号的学员才能参加考试</p>
<p>关闭:微信/企业微信登陆直接参加考试</p>
</div>
</div> </div>
</Form.Item> </Form.Item>
<Form.Item label='选项乱序' required> <Form.Item label="选项乱序" required>
<div style={{ display: 'flex', marginLeft: 4 }}> <div style={{ display: 'flex', marginLeft: 4, }}>
<Switch <Switch style={{ position: 'relative', top: 6 }}
style={{ position: 'relative', top: 6 }}
checked={needOptionDisorder == 'OPTION_RANDOM'} checked={needOptionDisorder == 'OPTION_RANDOM'}
onChange={(val) => { onChange={(val) => { setNeedOptionDisorder(val ? 'OPTION_RANDOM' : 'OPTION_SORT') }}
setNeedOptionDisorder(val ? 'OPTION_RANDOM' : 'OPTION_SORT'); ></Switch>
}}></Switch> <div style={{ position: 'relative', top: 3, left: 8, color: "#999" }}><p>开启:选择题的选项随机排序</p>
<div style={{ position: 'relative', top: 3, left: 8, color: '#999' }}> <p>关闭:选择题按题目原有顺序展示</p></div>
<p>开启:选择题的选项随机排序</p>
<p>关闭:选择题按题目原有顺序展示</p>
</div>
</div> </div>
</Form.Item> </Form.Item>
<Form.Item label='考试结果查看' required> <Form.Item label="考试结果查看" required>
<Radio.Group <Radio.Group onChange={(e: any) => { setResultShow(e.target.value) }} value={resultShow}>
onChange={(e: any) => {
setResultShow(e.target.value);
}}
value={resultShow}>
<Radio value={'IMMEDIATELY'}>交卷后立即显示考试结果</Radio> <Radio value={'IMMEDIATELY'}>交卷后立即显示考试结果</Radio>
<Radio value={'AFTER_EXAM_END'}>到达考试截止日期才显示结果</Radio> <Radio value={'AFTER_EXAM_END'}>到达考试截止日期才显示结果</Radio>
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item label=' 考试结果内容' required> <Form.Item label=" 考试结果内容" required>
<Radio.Group <Radio.Group onChange={(e: any) => { setResultContent(e.target.value) }} value={resultContent}>
onChange={(e: any) => {
setResultContent(e.target.value);
}}
value={resultContent}>
<Radio value={'PASS_AND_SCORE'}>显示考试分数和是否及格</Radio> <Radio value={'PASS_AND_SCORE'}>显示考试分数和是否及格</Radio>
<Radio value={'ONLY_SCORE'}>仅显示考试分数</Radio> <Radio value={'ONLY_SCORE'}>仅显示考试分数</Radio>
<Radio value={'ONLY_PASS'}>仅显示是否及格</Radio> <Radio value={'ONLY_PASS'}>仅显示是否及格</Radio>
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item label='答案与解析' required> <Form.Item label="答案与解析" required>
<Radio.Group <Radio.Group onChange={(e: any) => { setAnswerAnalysis(e.target.value) }} value={answerAnalysis}>
onChange={(e: any) => {
setAnswerAnalysis(e.target.value);
}}
value={answerAnalysis}>
<Radio value={'ANALYSE_AND_RIGHT_OR_WRONG'}>显示对错与解析</Radio> <Radio value={'ANALYSE_AND_RIGHT_OR_WRONG'}>显示对错与解析</Radio>
<Radio value={'RIGHT_OR_WRONG'}>仅显示对错</Radio> <Radio value={'RIGHT_OR_WRONG'}>仅显示对错</Radio>
<Radio value={'CAN_NOT_CHECK'}>都不显示</Radio> <Radio value={'CAN_NOT_CHECK'}>都不显示</Radio>
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
</Form> </Form>
</div> </div>
</div> </div>
{showModal && ( {
<SelectPaperModal showModal && <SelectPaperModal onSelect={(info: any) => {
onSelect={(info: any) => { setPaperInfo(info)
setPaperInfo(info); }} paperInfo={paperInfo} close={() => { setShowModal(false) }}></SelectPaperModal>
}} }
paperInfo={paperInfo} <div className="footer shrink-footer">
close={() => {
setShowModal(false);
}}></SelectPaperModal>
)}
<div className='footer shrink-footer'>
<Button onClick={handleGoBack}>取消</Button> <Button onClick={handleGoBack}>取消</Button>
<Button <Button onClick={() => { setPreview(true) }}>预览</Button>
onClick={() => { <Button type="primary" onClick={handleSave}>保存</Button>
setPreview(true);
}}>
预览
</Button>
<Button type='primary' onClick={handleSave}>
保存
</Button>
</div> </div>
{preview && ( {
<PreviewModal preview && <PreviewModal
info={{ info={{
paperId, paperId,
startTime: examStartTime, startTime: examStartTime,
...@@ -574,14 +535,12 @@ function AddExam(props: any) { ...@@ -574,14 +535,12 @@ function AddExam(props: any) {
examDuration, examDuration,
passScore, passScore,
examTotal, examTotal,
totalScore: paperInfo.totalScore, totalScore: paperInfo.totalScore
}} }}
onClose={() => { onClose={() => { setPreview(false) }}></PreviewModal>
setPreview(false); }
}}></PreviewModal>
)}
</div> </div>
);
} }
export default withRouter(AddExam); export default withRouter(AddExam);
\ No newline at end of file
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