|
@@ -1,7 +1,7 @@
|
|
|
import React, { Component } from 'react';
|
|
|
import { Link } from 'react-router-dom';
|
|
|
import './index.less';
|
|
|
-import { Icon, Dropdown } from 'antd';
|
|
|
+import { Icon, Popover } from 'antd';
|
|
|
import FileUpload from '@src/components/FileUpload';
|
|
|
import Page from '@src/containers/Page';
|
|
|
import Assets from '@src/components/Assets';
|
|
@@ -131,7 +131,7 @@ export default class extends Page {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- onAction() { }
|
|
|
+ onAction() {}
|
|
|
|
|
|
onTabChange(tab) {
|
|
|
const data = { tab };
|
|
@@ -332,7 +332,13 @@ export default class extends Page {
|
|
|
onChange={key => this.onStatusChange(key)}
|
|
|
/>
|
|
|
{this[`renderTab${tab}`]()}
|
|
|
- <Modal show={showTime} className="clock-modal" title="打卡表" width={460} onClose={() => this.setState({ showTime: false })}>
|
|
|
+ <Modal
|
|
|
+ show={showTime}
|
|
|
+ className="clock-modal"
|
|
|
+ title="打卡表"
|
|
|
+ width={460}
|
|
|
+ onClose={() => this.setState({ showTime: false })}
|
|
|
+ >
|
|
|
<div>
|
|
|
<div className="d-i-b w-3">
|
|
|
<div className="t-2 t-s-14">听课频率</div>
|
|
@@ -361,8 +367,8 @@ export default class extends Page {
|
|
|
<DatePlane
|
|
|
hideInput
|
|
|
show={showTime}
|
|
|
- onChange={() => { }}
|
|
|
- disabledDate={(current) => {
|
|
|
+ onChange={() => {}}
|
|
|
+ disabledDate={current => {
|
|
|
const date = current.format('YYYY-MM-DD');
|
|
|
return data.stopTimeMap[date];
|
|
|
}}
|
|
@@ -463,7 +469,9 @@ export default class extends Page {
|
|
|
/>
|
|
|
<div className={`t-c drag-upload ${this.state.draging ? 'draging' : ''}`}>
|
|
|
<Button theme="file">上传文件</Button>
|
|
|
- <span className="m-l-1 t-3 t-s-14">{note.file ? `上传文件:${note.name} 成功` : '支持 docx, xls, PDF, rar, zip, PNG, JPG 等类型的文件'}</span>
|
|
|
+ <span className="m-l-1 t-3 t-s-14">
|
|
|
+ {note.file ? `上传文件:${note.name} 成功` : '支持 docx, xls, PDF, rar, zip, PNG, JPG 等类型的文件'}
|
|
|
+ </span>
|
|
|
<div className="fixed">
|
|
|
<span className="f-w-b t-s-18">放开文件立刻上传</span>
|
|
|
</div>
|
|
@@ -471,11 +479,13 @@ export default class extends Page {
|
|
|
type="none"
|
|
|
onDragEnter={() => this.setState({ draging: true })}
|
|
|
onDragLeave={() => this.setState({ draging: false })}
|
|
|
- onUpload={({ file }) => Common.upload(file).then(result => {
|
|
|
- note.file = result.url;
|
|
|
- note.name = file.name;
|
|
|
- this.setState({ note });
|
|
|
- })}
|
|
|
+ onUpload={({ file }) => {
|
|
|
+ Common.upload(file).then(result => {
|
|
|
+ note.file = result.url;
|
|
|
+ note.name = file.name;
|
|
|
+ this.setState({ note });
|
|
|
+ });
|
|
|
+ }}
|
|
|
/>
|
|
|
</div>
|
|
|
<div className="b-b m-t-2" />
|
|
@@ -524,7 +534,9 @@ export default class extends Page {
|
|
|
/>
|
|
|
<div className={`t-c drag-upload ${this.state.draging ? 'draging' : ''}`}>
|
|
|
<Button theme="file">上传文件</Button>
|
|
|
- <span className="m-l-1 t-3 t-s-14">{supply.file ? `上传文件:${supply.name} 成功` : '支持 docx, xls, PDF, rar, zip, PNG, JPG 等类型的文件'}</span>
|
|
|
+ <span className="m-l-1 t-3 t-s-14">
|
|
|
+ {supply.file ? `上传文件:${supply.name} 成功` : '支持 docx, xls, PDF, rar, zip, PNG, JPG 等类型的文件'}
|
|
|
+ </span>
|
|
|
<div className="fixed">
|
|
|
<span className="f-w-b t-s-18">放开文件立刻上传</span>
|
|
|
</div>
|
|
@@ -532,11 +544,13 @@ export default class extends Page {
|
|
|
type="none"
|
|
|
onDragEnter={() => this.setState({ draging: true })}
|
|
|
onDragLeave={() => this.setState({ draging: false })}
|
|
|
- onUpload={({ file }) => Common.upload(file).then(result => {
|
|
|
- supply.file = result.url;
|
|
|
- supply.name = file.name;
|
|
|
- this.setState({ supply });
|
|
|
- })}
|
|
|
+ onUpload={({ file }) => {
|
|
|
+ Common.upload(file).then(result => {
|
|
|
+ supply.file = result.url;
|
|
|
+ supply.name = file.name;
|
|
|
+ this.setState({ supply });
|
|
|
+ });
|
|
|
+ }}
|
|
|
/>
|
|
|
</div>
|
|
|
<div className="b-b m-t-2" />
|
|
@@ -576,23 +590,44 @@ export default class extends Page {
|
|
|
renderTabvs() {
|
|
|
const { list = [] } = this.state;
|
|
|
return list.map(item => {
|
|
|
- return <CourseVs data={item} user={this.props.user} refreshDetail={(recordId) => {
|
|
|
- this.refreshDetail(recordId);
|
|
|
- }} onRestore={() => {
|
|
|
- this.setState({ showRestore: true, restore: item });
|
|
|
- }} onSuspend={() => {
|
|
|
- this.setState({ showSuspend: true, suspend: item });
|
|
|
- }} onComment={() => {
|
|
|
- this.setState({ showComment: true, comment: { channel: 'course-vs', position: item.course.id } });
|
|
|
- }} closeCommentTips={() => this.closeCommentTips(item.id)}
|
|
|
- onUploadNote={(appointment, row) => this.setState({ showUploadNote: true, appointment, data: item, note: row || {} })}
|
|
|
- onUploadSupply={(appointment, row) => this.setState({ showUploadSupply: true, appointment, data: item, supply: row || {} })}
|
|
|
- onDeleteNote={(appointment, row) => this.deleteAppointmentComment(row)}
|
|
|
- onDeleteSupply={(appointment, row) => this.deleteAppointmentComment(row)}
|
|
|
- onNote={(appointment) => this.setState({ showNote: true, appointment, data: item })}
|
|
|
- onSupply={(appointment) => this.setState({ showSupply: true, appointment, data: item })}
|
|
|
- onUploadQuestion={(appointment, file, name) => this.submitQuestionFile({ id: appointment.id, recordId: appointment.recordId, questionFile: file, questionFileName: name })}
|
|
|
- setCCTalkName={(appointment, cctalkName) => this.setCCTalkName(appointment.recordId, cctalkName)} />;
|
|
|
+ return (
|
|
|
+ <CourseVs
|
|
|
+ data={item}
|
|
|
+ user={this.props.user}
|
|
|
+ refreshDetail={recordId => {
|
|
|
+ this.refreshDetail(recordId);
|
|
|
+ }}
|
|
|
+ onRestore={() => {
|
|
|
+ this.setState({ showRestore: true, restore: item });
|
|
|
+ }}
|
|
|
+ onSuspend={() => {
|
|
|
+ this.setState({ showSuspend: true, suspend: item });
|
|
|
+ }}
|
|
|
+ onComment={() => {
|
|
|
+ this.setState({ showComment: true, comment: { channel: 'course-vs', position: item.course.id } });
|
|
|
+ }}
|
|
|
+ closeCommentTips={() => this.closeCommentTips(item.id)}
|
|
|
+ onUploadNote={(appointment, row) => {
|
|
|
+ this.setState({ showUploadNote: true, appointment, data: item, note: row || {} });
|
|
|
+ }}
|
|
|
+ onUploadSupply={(appointment, row) => {
|
|
|
+ this.setState({ showUploadSupply: true, appointment, data: item, supply: row || {} });
|
|
|
+ }}
|
|
|
+ onDeleteNote={(appointment, row) => this.deleteAppointmentComment(row)}
|
|
|
+ onDeleteSupply={(appointment, row) => this.deleteAppointmentComment(row)}
|
|
|
+ onNote={appointment => this.setState({ showNote: true, appointment, data: item })}
|
|
|
+ onSupply={appointment => this.setState({ showSupply: true, appointment, data: item })}
|
|
|
+ onUploadQuestion={(appointment, file, name) => {
|
|
|
+ this.submitQuestionFile({
|
|
|
+ id: appointment.id,
|
|
|
+ recordId: appointment.recordId,
|
|
|
+ questionFile: file,
|
|
|
+ questionFileName: name,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ setCCTalkName={(appointment, cctalkName) => this.setCCTalkName(appointment.recordId, cctalkName)}
|
|
|
+ />
|
|
|
+ );
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -611,38 +646,64 @@ class CourseOnline extends Component {
|
|
|
{
|
|
|
title: '预习作业',
|
|
|
key: 'paper',
|
|
|
- render: (text) => {
|
|
|
+ render: text => {
|
|
|
const progress = text.report ? formatPercent(text.report.userNumber, text.report.questionNumber) : 0;
|
|
|
const times = text.paper ? text.paper.times : 0;
|
|
|
- return <div>
|
|
|
- <div className="v-a-m d-i-b">
|
|
|
- <ProgressText width={50} size="small" times={times} progress={progress} unit="次" />
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <div className="v-a-m d-i-b">
|
|
|
+ <ProgressText width={50} size="small" times={times} progress={progress} unit="次" />
|
|
|
+ </div>
|
|
|
+ {!text.report && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-2"
|
|
|
+ type="start"
|
|
|
+ tip="Start"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.startLink('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {text.report && !text.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-2"
|
|
|
+ type="continue"
|
|
|
+ tip="Continue"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.continueLink('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {text.report && !!text.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-2"
|
|
|
+ type="restart"
|
|
|
+ tip="Restart"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.restart('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {text.report && !!text.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-5"
|
|
|
+ type="report"
|
|
|
+ tip="Report"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.reportLink('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</div>
|
|
|
- {!text.report && <IconButton className="m-l-2" type="start" tip="Start" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.startLink('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- {text.report && !text.report.isFinish && <IconButton className="m-l-2" type="continue" tip="Continue" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.continueLink('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- {text.report && !!text.report.isFinish && <IconButton className="m-l-2" type="restart" tip="Restart" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.restart('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- {text.report && !!text.report.isFinish && <IconButton className="m-l-5" type="report" tip="Report" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.reportLink('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- </div>;
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -651,7 +712,8 @@ class CourseOnline extends Component {
|
|
|
render: (text, record) => {
|
|
|
const { paper = {} } = record;
|
|
|
return `${paper.paper && paper.paper.times > 0 ? `${paper.paper.times}次+` : ''}${
|
|
|
- paper.report ? formatPercent(paper.report.userNumber, paper.report.questionNumber, false) : '0%'}`;
|
|
|
+ paper.report ? formatPercent(paper.report.userNumber, paper.report.questionNumber, false) : '0%'
|
|
|
+ }`;
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -845,7 +907,10 @@ class CourseOnline extends Component {
|
|
|
<div className="t1">授课老师</div>
|
|
|
<div className="t2">{data.course.teacher}</div>
|
|
|
<div className="t1">有效期</div>
|
|
|
- <div className="t-s-12">{formatDate(data.useStartTime, 'YYYY-MM-DD')}<br />至{formatDate(data.useEndTime, 'YYYY-MM-DD')}</div>
|
|
|
+ <div className="t-s-12">
|
|
|
+ {formatDate(data.useStartTime, 'YYYY-MM-DD')}
|
|
|
+ <br />至{formatDate(data.useEndTime, 'YYYY-MM-DD')}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className="right">
|
|
@@ -996,18 +1061,18 @@ const statusMap = {
|
|
|
// if (new Date(appointment.endTime).getTime() > new Date()) return 'not';
|
|
|
return '';
|
|
|
},
|
|
|
- 4: (appointment) => {
|
|
|
+ 4: appointment => {
|
|
|
if (!appointment.noteList || appointment.noteList.length === 0) return 'not';
|
|
|
return '';
|
|
|
},
|
|
|
- 5: (appointment) => {
|
|
|
+ 5: appointment => {
|
|
|
if (!appointment.supplyList || appointment.supplyList.length === 0) return 'not';
|
|
|
return '';
|
|
|
},
|
|
|
6: () => {
|
|
|
return '';
|
|
|
},
|
|
|
- 7: (appointment) => {
|
|
|
+ 7: appointment => {
|
|
|
const { paper = {} } = appointment;
|
|
|
if (!paper.report || formatPercent(paper.report.userNumber, paper.report.questionNumber) < 100) return 'not';
|
|
|
return '';
|
|
@@ -1022,38 +1087,64 @@ class CourseVs extends Component {
|
|
|
{
|
|
|
title: '预习作业',
|
|
|
key: 'paper',
|
|
|
- render: (text) => {
|
|
|
+ render: text => {
|
|
|
const progress = text.report ? formatPercent(text.report.userNumber, text.report.questionNumber) : 0;
|
|
|
const times = text.paper ? text.paper.times : 0;
|
|
|
- return <div>
|
|
|
- <div className="v-a-m d-i-b">
|
|
|
- <ProgressText width={50} size="small" times={times} progress={progress} unit="次" />
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <div className="v-a-m d-i-b">
|
|
|
+ <ProgressText width={50} size="small" times={times} progress={progress} unit="次" />
|
|
|
+ </div>
|
|
|
+ {!text.report && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-2"
|
|
|
+ type="start"
|
|
|
+ tip="Start"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.startLink('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {text.report && !text.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-2"
|
|
|
+ type="continue"
|
|
|
+ tip="Continue"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.continueLink('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {text.report && !!text.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-2"
|
|
|
+ type="restart"
|
|
|
+ tip="Restart"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.restart('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {text.report && !!text.report.isFinish && (
|
|
|
+ <IconButton
|
|
|
+ className="m-l-5"
|
|
|
+ type="report"
|
|
|
+ tip="Report"
|
|
|
+ onClick={() => {
|
|
|
+ User.needLogin().then(() => {
|
|
|
+ Question.reportLink('preview', text);
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</div>
|
|
|
- {!text.report && <IconButton className="m-l-2" type="start" tip="Start" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.startLink('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- {text.report && !text.report.isFinish && <IconButton className="m-l-2" type="continue" tip="Continue" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.continueLink('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- {text.report && !!text.report.isFinish && <IconButton className="m-l-2" type="restart" tip="Restart" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.restart('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- {text.report && !!text.report.isFinish && <IconButton className="m-l-5" type="report" tip="Report" onClick={() => {
|
|
|
- User.needLogin()
|
|
|
- .then(() => {
|
|
|
- Question.reportLink('preview', text);
|
|
|
- });
|
|
|
- }} />}
|
|
|
- </div>;
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -1173,10 +1264,12 @@ class CourseVs extends Component {
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- {showTips && <div className="continue">
|
|
|
- <Icon className='close m-r-5 t-3' type="close-circle" theme="filled" onClick={() => closeCommentTips()} />
|
|
|
- 课程已过半,可以来写写评价啦<a onClick={() => onComment()}>去写评价 ></a>
|
|
|
- </div>}
|
|
|
+ {showTips && (
|
|
|
+ <div className="continue">
|
|
|
+ <Icon className="close m-r-5 t-3" type="close-circle" theme="filled" onClick={() => closeCommentTips()} />
|
|
|
+ 课程已过半,可以来写写评价啦<a onClick={() => onComment()}>去写评价 ></a>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<div className="detail">
|
|
|
<div className="left">
|
|
|
<Assets name="sun_blue" src={data.course.cover} />
|
|
@@ -1205,16 +1298,18 @@ class CourseVs extends Component {
|
|
|
<GIcon name={open ? 'up' : 'down'} onClick={() => this.setState({ open: !open })} />
|
|
|
</div>
|
|
|
</div>
|
|
|
- {open && (data.course.vsType === 'system' || data.course.vsType === 'answer') && <Tabs
|
|
|
- className="t-l"
|
|
|
- type="line"
|
|
|
- theme="theme"
|
|
|
- size="small"
|
|
|
- width={80}
|
|
|
- active={tab}
|
|
|
- tabs={[{ key: 'ing', title: '授课中' }, { key: 'end', title: '已结课' }]}
|
|
|
- onChange={key => this.setState({ tab: key })}
|
|
|
- />}
|
|
|
+ {open && (data.course.vsType === 'system' || data.course.vsType === 'answer') && (
|
|
|
+ <Tabs
|
|
|
+ className="t-l"
|
|
|
+ type="line"
|
|
|
+ theme="theme"
|
|
|
+ size="small"
|
|
|
+ width={80}
|
|
|
+ active={tab}
|
|
|
+ tabs={[{ key: 'ing', title: '授课中' }, { key: 'end', title: '已结课' }]}
|
|
|
+ onChange={key => this.setState({ tab: key })}
|
|
|
+ />
|
|
|
+ )}
|
|
|
{open && (tab === 'ing' ? this.renderTimeLine() : this.renderTable())}
|
|
|
</div>
|
|
|
);
|
|
@@ -1289,10 +1384,12 @@ class CourseVs extends Component {
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- {showTips && <div className="continue">
|
|
|
- <Icon className='close m-r-5 t-3' type="close-circle" theme="filled" onClick={() => closeCommentTips()} />
|
|
|
- 课程已结束,可以来写写评价啦<a onClick={() => onComment()}>去写评价 ></a>
|
|
|
- </div>}
|
|
|
+ {showTips && (
|
|
|
+ <div className="continue">
|
|
|
+ <Icon className="close m-r-5 t-3" type="close-circle" theme="filled" onClick={() => closeCommentTips()} />
|
|
|
+ 课程已结束,可以来写写评价啦<a onClick={() => onComment()}>去写评价 ></a>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
<div className="detail">
|
|
|
<div className="left">
|
|
|
<Assets name="sun_blue" src={data.course.cover} />
|
|
@@ -1321,16 +1418,18 @@ class CourseVs extends Component {
|
|
|
<GIcon name={open ? 'up' : 'down'} onClick={() => this.setState({ open: !open })} />
|
|
|
</div>
|
|
|
</div>
|
|
|
- {open && (data.course.vsType === 'system' || data.course.vsType === 'answer') && <Tabs
|
|
|
- className="t-l"
|
|
|
- type="line"
|
|
|
- theme="theme"
|
|
|
- size="small"
|
|
|
- width={80}
|
|
|
- active={tab}
|
|
|
- tabs={[{ key: 'ing', title: '授课中' }, { key: 'end', title: '已结课' }]}
|
|
|
- onChange={key => this.setState({ tab: key })}
|
|
|
- />}
|
|
|
+ {open && (data.course.vsType === 'system' || data.course.vsType === 'answer') && (
|
|
|
+ <Tabs
|
|
|
+ className="t-l"
|
|
|
+ type="line"
|
|
|
+ theme="theme"
|
|
|
+ size="small"
|
|
|
+ width={80}
|
|
|
+ active={tab}
|
|
|
+ tabs={[{ key: 'ing', title: '授课中' }, { key: 'end', title: '已结课' }]}
|
|
|
+ onChange={key => this.setState({ tab: key })}
|
|
|
+ />
|
|
|
+ )}
|
|
|
{open && (tab === 'ing' ? this.renderTimeLine() : this.renderTable())}
|
|
|
</div>
|
|
|
);
|
|
@@ -1404,13 +1503,22 @@ class CourseVs extends Component {
|
|
|
let status = '';
|
|
|
return [
|
|
|
<div className="class-hour">
|
|
|
- {data.number > 1 && <div className="text">课时 {appointment.no}:{appointment.title}</div>}
|
|
|
- {data.number > 1 && <div className="right">
|
|
|
- <GIcon name="prev" onClick={() => this.setState({ index: index === 0 ? index : index - 1 })} />
|
|
|
- <span>上一课时</span>
|
|
|
- <span>下一课时</span>
|
|
|
- <GIcon name="next" onClick={() => this.setState({ index: index >= data.appointments.length - 1 ? index : index + 1 })} />
|
|
|
- </div>}
|
|
|
+ {data.number > 1 && (
|
|
|
+ <div className="text">
|
|
|
+ 课时 {appointment.no}:{appointment.title}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ {data.number > 1 && (
|
|
|
+ <div className="right">
|
|
|
+ <GIcon name="prev" onClick={() => this.setState({ index: index === 0 ? index : index - 1 })} />
|
|
|
+ <span>上一课时</span>
|
|
|
+ <span>下一课时</span>
|
|
|
+ <GIcon
|
|
|
+ name="next"
|
|
|
+ onClick={() => this.setState({ index: index >= data.appointments.length - 1 ? index : index + 1 })}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
</div>,
|
|
|
<div className="time-line">
|
|
|
{list.map(item => {
|
|
@@ -1421,7 +1529,19 @@ class CourseVs extends Component {
|
|
|
// 上一阶段未完成
|
|
|
status = 'end';
|
|
|
}
|
|
|
- return <TimeLineItem type={`${item}`} user={this.props.user} appointment={appointment} data={data} status={status} onUploadNote={onUploadNote} onUploadSupply={onUploadSupply} onUploadQuestion={onUploadQuestion} setCCTalkName={setCCTalkName} />;
|
|
|
+ return (
|
|
|
+ <TimeLineItem
|
|
|
+ type={`${item}`}
|
|
|
+ user={this.props.user}
|
|
|
+ appointment={appointment}
|
|
|
+ data={data}
|
|
|
+ status={status}
|
|
|
+ onUploadNote={onUploadNote}
|
|
|
+ onUploadSupply={onUploadSupply}
|
|
|
+ onUploadQuestion={onUploadQuestion}
|
|
|
+ setCCTalkName={setCCTalkName}
|
|
|
+ />
|
|
|
+ );
|
|
|
})}
|
|
|
</div>,
|
|
|
];
|
|
@@ -1430,7 +1550,9 @@ class CourseVs extends Component {
|
|
|
renderTable() {
|
|
|
const { data = {} } = this.props;
|
|
|
const { appointments = [] } = data;
|
|
|
- return <UserTable size="small" columns={this.columns[data.course.vsType]} data={appointments.filter(row => row.id)} />;
|
|
|
+ return (
|
|
|
+ <UserTable size="small" columns={this.columns[data.course.vsType]} data={appointments.filter(row => row.id)} />
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
class TimeLineItem extends Component {
|
|
@@ -1482,11 +1604,11 @@ class TimeLineItem extends Component {
|
|
|
return (
|
|
|
<span>
|
|
|
请尽快与老师预约上课时间,老师微信:{data.teacher.wechat}扫码加微信{' '}
|
|
|
- <Dropdown overlay={<Assets name="qrcode" src={data.teacher.qr} />}>
|
|
|
+ <Popover content={<Assets name="qrcode" src={data.teacher.qr} />}>
|
|
|
<span>
|
|
|
<Assets className="m-l-1" name="erweima" />
|
|
|
</span>
|
|
|
- </Dropdown>
|
|
|
+ </Popover>
|
|
|
</span>
|
|
|
);
|
|
|
default:
|
|
@@ -1502,9 +1624,15 @@ class TimeLineItem extends Component {
|
|
|
case 'end':
|
|
|
return <span className="link">点此上传</span>;
|
|
|
case 'not':
|
|
|
- return <FileUpload onUpload={(file) => {
|
|
|
- return Common.upload({ file }).then((result => onUploadQuestion(appointment, result.url, file.name)));
|
|
|
- }}><span className="link">点此上传</span></FileUpload>;
|
|
|
+ return (
|
|
|
+ <FileUpload
|
|
|
+ onUpload={file => {
|
|
|
+ return Common.upload({ file }).then(result => onUploadQuestion(appointment, result.url, file.name));
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <span className="link">点此上传</span>
|
|
|
+ </FileUpload>
|
|
|
+ );
|
|
|
default:
|
|
|
return (
|
|
|
<a href={appointment.questionFile} target="_blank">
|
|
@@ -1515,19 +1643,57 @@ class TimeLineItem extends Component {
|
|
|
case '3':
|
|
|
switch (status) {
|
|
|
case 'end':
|
|
|
- return data.cctalkName ? <span>
|
|
|
- CCtalk 频道号 :{appointment.cctalkChannel} <a className="link" href="" target="_black">CC talk使用手册</a>
|
|
|
- </span> : <div><input style={{ width: 200 }} className='b-c-1 p-l-1 p-r-1 t-s-12 m-r-1' placeholder="请输入CCtalk用户名查看授课频道" onChange={(e) => {
|
|
|
- this.setState({ cctalkName: e.target.value });
|
|
|
- }} /><Button size="small" radius disabled>提交</Button></div>;
|
|
|
+ return data.cctalkName ? (
|
|
|
+ <span>
|
|
|
+ CCtalk 频道号 :{appointment.cctalkChannel}{' '}
|
|
|
+ <a className="link" href="" target="_black">
|
|
|
+ CC talk使用手册
|
|
|
+ </a>
|
|
|
+ </span>
|
|
|
+ ) : (
|
|
|
+ <div>
|
|
|
+ <input
|
|
|
+ style={{ width: 200 }}
|
|
|
+ className="b-c-1 p-l-1 p-r-1 t-s-12 m-r-1"
|
|
|
+ placeholder="请输入CCtalk用户名查看授课频道"
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ cctalkName: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Button size="small" radius disabled>
|
|
|
+ 提交
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
case 'not':
|
|
|
- return data.cctalkName ? <span>
|
|
|
- CCtalk 频道号 :{appointment.cctalkChannel} <a className="link" href="" target="_black">CC talk使用手册</a>
|
|
|
- </span> : <div><input style={{ width: 200 }} className='b-c-1 p-l-1 p-r-1 t-s-12 m-r-1' placeholder="请输入CCtalk用户名查看授课频道" onChange={(e) => {
|
|
|
- this.setState({ cctalkName: e.target.value });
|
|
|
- }} /><Button size="small" radius onClick={() => {
|
|
|
- if (this.state.cctalkName) setCCTalkName(appointment, this.state.cctalkName);
|
|
|
- }} >提交</Button></div>;
|
|
|
+ return data.cctalkName ? (
|
|
|
+ <span>
|
|
|
+ CCtalk 频道号 :{appointment.cctalkChannel}{' '}
|
|
|
+ <a className="link" href="" target="_black">
|
|
|
+ CC talk使用手册
|
|
|
+ </a>
|
|
|
+ </span>
|
|
|
+ ) : (
|
|
|
+ <div>
|
|
|
+ <input
|
|
|
+ style={{ width: 200 }}
|
|
|
+ className="b-c-1 p-l-1 p-r-1 t-s-12 m-r-1"
|
|
|
+ placeholder="请输入CCtalk用户名查看授课频道"
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ cctalkName: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ radius
|
|
|
+ onClick={() => {
|
|
|
+ if (this.state.cctalkName) setCCTalkName(appointment, this.state.cctalkName);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 提交
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
default:
|
|
|
return (
|
|
|
<span>
|
|
@@ -1543,30 +1709,60 @@ class TimeLineItem extends Component {
|
|
|
case 'end':
|
|
|
return <span className="link">点此上传</span>;
|
|
|
case 'not':
|
|
|
- return <span className="link" onClick={() => onUploadNote(appointment, { appointmentId: appointment.id, recordId: appointment.recordId })}>点此上传</span>;
|
|
|
+ return (
|
|
|
+ <span
|
|
|
+ className="link"
|
|
|
+ onClick={() => {
|
|
|
+ onUploadNote(appointment, { appointmentId: appointment.id, recordId: appointment.recordId });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 点此上传
|
|
|
+ </span>
|
|
|
+ );
|
|
|
default:
|
|
|
return (
|
|
|
<div>
|
|
|
<div>
|
|
|
- <span className="link" onClick={() => onUploadNote(appointment, { appointmentId: appointment.id, recordId: appointment.recordId })}>点此上传</span>
|
|
|
+ <span
|
|
|
+ className="link"
|
|
|
+ onClick={() => {
|
|
|
+ onUploadNote(appointment, { appointmentId: appointment.id, recordId: appointment.recordId });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 点此上传
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<div className="note-list">
|
|
|
{appointment.noteList.map(row => {
|
|
|
- console.log(row);
|
|
|
- return <Note user={this.props.user} teacher={data.teacher} data={row} reply={!row.userId} actionList={row.userId ? [{ key: 'edit', label: '编辑' }, { key: 'delete', label: '删除' }] : null} onAction={(key) => {
|
|
|
- switch (key) {
|
|
|
- case 'edit':
|
|
|
- onUploadNote(appointment, row);
|
|
|
- break;
|
|
|
- case 'delete':
|
|
|
- onDeleteNote(appointment, row);
|
|
|
- break;
|
|
|
- case 'reply':
|
|
|
- onUploadNote(appointment, { parentId: row.id, appointmentId: appointment.id, recordId: appointment.recordId });
|
|
|
- break;
|
|
|
- default:
|
|
|
- }
|
|
|
- }} />;
|
|
|
+ return (
|
|
|
+ <Note
|
|
|
+ user={this.props.user}
|
|
|
+ teacher={data.teacher}
|
|
|
+ data={row}
|
|
|
+ reply={!row.userId}
|
|
|
+ actionList={
|
|
|
+ row.userId ? [{ key: 'edit', label: '编辑' }, { key: 'delete', label: '删除' }] : null
|
|
|
+ }
|
|
|
+ onAction={key => {
|
|
|
+ switch (key) {
|
|
|
+ case 'edit':
|
|
|
+ onUploadNote(appointment, row);
|
|
|
+ break;
|
|
|
+ case 'delete':
|
|
|
+ onDeleteNote(appointment, row);
|
|
|
+ break;
|
|
|
+ case 'reply':
|
|
|
+ onUploadNote(appointment, {
|
|
|
+ parentId: row.id,
|
|
|
+ appointmentId: appointment.id,
|
|
|
+ recordId: appointment.recordId,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ );
|
|
|
})}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -1577,29 +1773,60 @@ class TimeLineItem extends Component {
|
|
|
case 'end':
|
|
|
return <span className="link">写留言</span>;
|
|
|
case 'not':
|
|
|
- return <span className="link" onClick={() => onUploadSupply(appointment, { appointmentId: appointment.id, recordId: appointment.recordId })}>写留言</span>;
|
|
|
+ return (
|
|
|
+ <span
|
|
|
+ className="link"
|
|
|
+ onClick={() => {
|
|
|
+ onUploadSupply(appointment, { appointmentId: appointment.id, recordId: appointment.recordId });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 写留言
|
|
|
+ </span>
|
|
|
+ );
|
|
|
default:
|
|
|
return (
|
|
|
<div>
|
|
|
<div>
|
|
|
- <span className="link" onClick={() => onUploadSupply(appointment, { appointmentId: appointment.id, recordId: appointment.recordId })}>写留言</span>
|
|
|
+ <span
|
|
|
+ className="link"
|
|
|
+ onClick={() => {
|
|
|
+ onUploadSupply(appointment, { appointmentId: appointment.id, recordId: appointment.recordId });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 写留言
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<div className="note-list">
|
|
|
{appointment.supplyList.map(row => {
|
|
|
- return <Note user={this.props.user} teacher={data.teacher} data={row} reply={!row.userId} actionList={row.userId ? [{ key: 'edit', label: '编辑' }, { key: 'delete', label: '删除' }] : null} onAction={(key) => {
|
|
|
- switch (key) {
|
|
|
- case 'edit':
|
|
|
- onUploadSupply(appointment, row);
|
|
|
- break;
|
|
|
- case 'delete':
|
|
|
- onDeleteSupply(appointment, row);
|
|
|
- break;
|
|
|
- case 'reply':
|
|
|
- onUploadSupply(appointment, { parentId: row.id, appointmentId: appointment.id, recordId: appointment.recordId });
|
|
|
- break;
|
|
|
- default:
|
|
|
- }
|
|
|
- }} />;
|
|
|
+ return (
|
|
|
+ <Note
|
|
|
+ user={this.props.user}
|
|
|
+ teacher={data.teacher}
|
|
|
+ data={row}
|
|
|
+ reply={!row.userId}
|
|
|
+ actionList={
|
|
|
+ row.userId ? [{ key: 'edit', label: '编辑' }, { key: 'delete', label: '删除' }] : null
|
|
|
+ }
|
|
|
+ onAction={key => {
|
|
|
+ switch (key) {
|
|
|
+ case 'edit':
|
|
|
+ onUploadSupply(appointment, row);
|
|
|
+ break;
|
|
|
+ case 'delete':
|
|
|
+ onDeleteSupply(appointment, row);
|
|
|
+ break;
|
|
|
+ case 'reply':
|
|
|
+ onUploadSupply(appointment, {
|
|
|
+ parentId: row.id,
|
|
|
+ appointmentId: appointment.id,
|
|
|
+ recordId: appointment.recordId,
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ );
|
|
|
})}
|
|
|
</div>
|
|
|
</div>
|