|
@@ -32,20 +32,16 @@ export default class extends Page {
|
|
|
}
|
|
|
|
|
|
formatRecord(row) {
|
|
|
- if (row.number > 1 && row.number === row.appointments.length) {
|
|
|
- row.status = 'end';
|
|
|
- } else if (row.useEndTime) {
|
|
|
- if (new Date(row.useEndTime).getTime() > new Date().getTime()) {
|
|
|
- row.status = 'end';
|
|
|
- } else if (row.isSuspend && !row.restoreTime) {
|
|
|
+ if (row.useEndTime) {
|
|
|
+ if (row.isSuspend && !row.restoreTime) {
|
|
|
row.status = 'suspend';
|
|
|
+ } else if (new Date(row.useEndTime).getTime() < new Date().getTime()) {
|
|
|
+ row.status = 'end';
|
|
|
} else {
|
|
|
row.status = 'ing';
|
|
|
}
|
|
|
- } else if (new Date(row.useEndTime).getTime() < new Date().getTime()) {
|
|
|
- row.status = 'end';
|
|
|
} else {
|
|
|
- row.status = 'no';
|
|
|
+ row.status = 'not';
|
|
|
}
|
|
|
row.paperMap = {};
|
|
|
row.appointmentPaperMap = {};
|
|
@@ -78,15 +74,22 @@ export default class extends Page {
|
|
|
row.currentNo = 0;
|
|
|
}
|
|
|
// 如果已经最新预约结束,则添加一个空记录作为最新预约
|
|
|
- if (!row.appointments || row.appointments.length === 0) {
|
|
|
- row.appointments = [{}];
|
|
|
- } else {
|
|
|
+ if (row.appointments) {
|
|
|
row.appointments.forEach(r => {
|
|
|
r.paper = row.appointmentPaperMap[r.id];
|
|
|
- r.noteList = (row.comments || []).map(c => c.type === 'note' && c.appointmentId === r.id);
|
|
|
- r.supplyList = (row.comments || []).map(c => c.type === 'supply' && c.appointmentId === r.id);
|
|
|
+ r.noteList = (row.comments || []).filter(c => c.type === 'note' && c.appointmentId === r.id);
|
|
|
+ r.supplyList = (row.comments || []).filter(c => c.type === 'supply' && c.appointmentId === r.id);
|
|
|
});
|
|
|
// 是否是最后一课时,是否过预约时间
|
|
|
+ const last = row.appointments.length - 1;
|
|
|
+ const appointment = row.appointments[last];
|
|
|
+
|
|
|
+ if (new Date(appointment.endTime).getTime() < new Date().getTime()) {
|
|
|
+ // row.status = 'end';
|
|
|
+ if (row.number !== row.appointments.length) {
|
|
|
+ row.appointments.push([{}]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
row.days = new Date(row.userEndTime);
|
|
@@ -126,7 +129,7 @@ export default class extends Page {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- onAction() {}
|
|
|
+ onAction() { }
|
|
|
|
|
|
onTabChange(tab) {
|
|
|
const data = { tab };
|
|
@@ -200,7 +203,8 @@ export default class extends Page {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- submitAppointmentComment(data) {
|
|
|
+ submitAppointmentComment(data, type) {
|
|
|
+ data.type = type;
|
|
|
if (data.id) {
|
|
|
My.editAppointmentComment(data).then(() => {
|
|
|
this.refreshDetail(data.recordId);
|
|
@@ -326,7 +330,7 @@ export default class extends Page {
|
|
|
onChange={key => this.onStatusChange(key)}
|
|
|
/>
|
|
|
{this[`renderTab${tab}`]()}
|
|
|
- <Modal show={showTime} className="clock-modal" title="打卡表" width={460} onClose={() => {}}>
|
|
|
+ <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>
|
|
@@ -354,7 +358,9 @@ export default class extends Page {
|
|
|
</div>
|
|
|
<DatePlane
|
|
|
hideInput
|
|
|
- disabledDate={current => {
|
|
|
+ show={showTime}
|
|
|
+ onChange={() => { }}
|
|
|
+ disabledDate={(current) => {
|
|
|
const date = current.format('YYYY-MM-DD');
|
|
|
return data.stopTimeMap[date];
|
|
|
}}
|
|
@@ -440,7 +446,7 @@ export default class extends Page {
|
|
|
title="上传笔记"
|
|
|
width={630}
|
|
|
confirmText="提交"
|
|
|
- onConfirm={() => this.submitAppointmentComment(note)}
|
|
|
+ onConfirm={() => this.submitAppointmentComment(note, 'note')}
|
|
|
onCancel={() => this.setState({ showUploadNote: false, note: {} })}
|
|
|
>
|
|
|
<textarea
|
|
@@ -455,15 +461,19 @@ 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">支持 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">放开文件立刻上传{supply.file && `上传文件:${supply.name} 成功`}</span>
|
|
|
+ <span className="f-w-b t-s-18">放开文件立刻上传</span>
|
|
|
</div>
|
|
|
<FileUpload
|
|
|
type="none"
|
|
|
onDragEnter={() => this.setState({ draging: true })}
|
|
|
onDragLeave={() => this.setState({ draging: false })}
|
|
|
- onUpload={file => this.uploadNote(file)}
|
|
|
+ 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" />
|
|
@@ -497,7 +507,7 @@ export default class extends Page {
|
|
|
title="上传留言"
|
|
|
width={630}
|
|
|
confirmText="提交"
|
|
|
- onConfirm={() => this.submitAppointmentComment(supply)}
|
|
|
+ onConfirm={() => this.submitAppointmentComment(supply, 'supply')}
|
|
|
onCancel={() => this.setState({ showUploadSupply: false, supply: {} })}
|
|
|
>
|
|
|
<textarea
|
|
@@ -512,15 +522,19 @@ 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">支持 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">放开文件立刻上传{supply.file && `上传文件:${supply.name} 成功`}</span>
|
|
|
+ <span className="f-w-b t-s-18">放开文件立刻上传</span>
|
|
|
</div>
|
|
|
<FileUpload
|
|
|
type="none"
|
|
|
onDragEnter={() => this.setState({ draging: true })}
|
|
|
onDragLeave={() => this.setState({ draging: false })}
|
|
|
- onUpload={file => this.uploadSupply(file)}
|
|
|
+ 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" />
|
|
@@ -531,7 +545,6 @@ export default class extends Page {
|
|
|
|
|
|
renderTabonline() {
|
|
|
const { list = [] } = this.state;
|
|
|
- console.log(list);
|
|
|
return list.map(item => {
|
|
|
return (
|
|
|
<CourseOnline
|
|
@@ -561,44 +574,23 @@ 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)}
|
|
|
- onNote={appointment => this.setState({ showNote: true, appointment, data: item })}
|
|
|
- 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)}
|
|
|
- onSupply={appointment => this.setState({ whoSupply: 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)} />;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -832,9 +824,7 @@ class CourseOnline extends Component {
|
|
|
<div className="t1">授课老师</div>
|
|
|
<div className="t2">{data.course.teacher}</div>
|
|
|
<div className="t1">有效期</div>
|
|
|
- <div className="t2">
|
|
|
- {formatDate(data.useStartTime, 'YYYY-MM-DD')}至{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">
|
|
@@ -982,21 +972,22 @@ const statusMap = {
|
|
|
},
|
|
|
3: (appointment, data) => {
|
|
|
if (!data.cctalkName) return 'not';
|
|
|
+ // if (new Date(appointment.endTime).getTime() > new Date()) return 'not';
|
|
|
return '';
|
|
|
},
|
|
|
- 4: appointment => {
|
|
|
- if (!appointment.noteList && appointment.noteList.length === 0) return 'not';
|
|
|
+ 4: (appointment) => {
|
|
|
+ if (!appointment.noteList || appointment.noteList.length === 0) return 'not';
|
|
|
return '';
|
|
|
},
|
|
|
- 5: appointment => {
|
|
|
- if (!appointment.supplyList && appointment.supplyList.length === 0) return 'not';
|
|
|
+ 5: (appointment) => {
|
|
|
+ if (!appointment.supplyList || appointment.supplyList.length === 0) return 'not';
|
|
|
return '';
|
|
|
},
|
|
|
6: () => {
|
|
|
return '';
|
|
|
},
|
|
|
- 7: appointment => {
|
|
|
- const { paper } = appointment;
|
|
|
+ 7: (appointment) => {
|
|
|
+ const { paper = {} } = appointment;
|
|
|
if (!paper.report || formatPercent(paper.report.userNumber, paper.report.questionNumber) < 100) return 'not';
|
|
|
return '';
|
|
|
},
|
|
@@ -1070,7 +1061,7 @@ class CourseVs extends Component {
|
|
|
title: '课后补充',
|
|
|
key: 'supply',
|
|
|
render: (text, record) => {
|
|
|
- this.props.onSupply(record);
|
|
|
+ return <a onClick={() => this.props.onSupply(record)}>查看</a>;
|
|
|
},
|
|
|
},
|
|
|
],
|
|
@@ -1119,7 +1110,7 @@ class CourseVs extends Component {
|
|
|
|
|
|
renderIng() {
|
|
|
const { data, onComment, closeCommentTips } = this.props;
|
|
|
- const { tab, showTips } = this.state;
|
|
|
+ const { tab, showTips, open } = this.state;
|
|
|
return (
|
|
|
<div className="education-item ing">
|
|
|
<div className="title">
|
|
@@ -1141,12 +1132,10 @@ class CourseVs extends Component {
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- {showTips && (
|
|
|
- <div className="continue" onClick={() => closeCommentTips()}>
|
|
|
- <Assets name="notice" />
|
|
|
- 课程已过半,可以来写写评价啦<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} />
|
|
@@ -1171,20 +1160,21 @@ class CourseVs extends Component {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div className="open">
|
|
|
+ <GIcon name={open ? 'up' : 'down'} onClick={() => this.setState({ open: !open })} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- {(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 })}
|
|
|
- />
|
|
|
- )}
|
|
|
- {tab === 'ing' ? this.renderTimeLine() : this.renderTable()}
|
|
|
+ {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>
|
|
|
);
|
|
|
}
|
|
@@ -1258,12 +1248,10 @@ class CourseVs extends Component {
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- {showTips && (
|
|
|
- <div className="continue" onClick={() => closeCommentTips()}>
|
|
|
- <Assets name="notice" />
|
|
|
- 课程已结束,可以来写写评价啦<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} />
|
|
@@ -1292,19 +1280,17 @@ class CourseVs extends Component {
|
|
|
<GIcon name={open ? 'up' : 'down'} onClick={() => this.setState({ open: !open })} />
|
|
|
</div>
|
|
|
</div>
|
|
|
- {(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 })}
|
|
|
- />
|
|
|
- )}
|
|
|
- {tab === 'ing' ? this.renderTimeLine() : this.renderTable()}
|
|
|
+ {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>
|
|
|
);
|
|
|
}
|
|
@@ -1377,41 +1363,24 @@ class CourseVs extends Component {
|
|
|
let status = '';
|
|
|
return [
|
|
|
<div className="class-hour">
|
|
|
- <div className="text">
|
|
|
- 课时 {appointment.no}:{appointment.title}
|
|
|
- </div>
|
|
|
- <div className="right">
|
|
|
+ {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>
|
|
|
+ <GIcon name="next" onClick={() => this.setState({ index: index >= data.appointments.length - 1 ? index : index + 1 })} />
|
|
|
+ </div>}
|
|
|
</div>,
|
|
|
<div className="time-line">
|
|
|
{list.map(item => {
|
|
|
if (status === '') {
|
|
|
// 上一阶段完成
|
|
|
- status = statusMap(appointment, data);
|
|
|
+ status = statusMap[item](appointment, data);
|
|
|
} else {
|
|
|
// 上一阶段未完成
|
|
|
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>,
|
|
|
];
|
|
@@ -1420,7 +1389,7 @@ class CourseVs extends Component {
|
|
|
renderTable() {
|
|
|
const { data = {} } = this.props;
|
|
|
const { appointments = [] } = data;
|
|
|
- return <UserTable size="small" columns={this.columns[data.course.vsType]} data={appointments} />;
|
|
|
+ return <UserTable size="small" columns={this.columns[data.course.vsType]} data={appointments.filter(row => row.id)} />;
|
|
|
}
|
|
|
}
|
|
|
class TimeLineItem extends Component {
|
|
@@ -1442,7 +1411,7 @@ class TimeLineItem extends Component {
|
|
|
return (
|
|
|
<div className={`time-line-item ${status}`}>
|
|
|
<div className="icon-title">
|
|
|
- <GIcon name={iconMap[type]} active={status !== 'not'} noHover />
|
|
|
+ <GIcon name={iconMap[type]} active={!status} noHover />
|
|
|
<div className="title">{titleMap[type]}</div>
|
|
|
</div>
|
|
|
<div className="time-line-detail">{this.renderDetail()}</div>
|
|
@@ -1472,7 +1441,7 @@ class TimeLineItem extends Component {
|
|
|
return (
|
|
|
<span>
|
|
|
请尽快与老师预约上课时间,老师微信:{data.teacher.wechat}扫码加微信{' '}
|
|
|
- <Dropdown overlay={<Assets name="qrcode" />}>
|
|
|
+ <Dropdown overlay={<Assets name="qrcode" src={data.teacher.qr} />}>
|
|
|
<span>
|
|
|
<Assets className="m-l-1" name="erweima" />
|
|
|
</span>
|
|
@@ -1492,15 +1461,9 @@ 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">
|
|
@@ -1511,16 +1474,19 @@ class TimeLineItem extends Component {
|
|
|
case '3':
|
|
|
switch (status) {
|
|
|
case 'end':
|
|
|
- return <input placeholder="请输入CCtalk用户名查看授课频道" />;
|
|
|
+ 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 (
|
|
|
- <input
|
|
|
- placeholder="请输入CCtalk用户名查看授课频道"
|
|
|
- onChange={e => {
|
|
|
- setCCTalkName(e.target.value);
|
|
|
- }}
|
|
|
- />
|
|
|
- );
|
|
|
+ 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>
|
|
@@ -1536,47 +1502,30 @@ class TimeLineItem extends Component {
|
|
|
case 'end':
|
|
|
return <span className="link">点此上传</span>;
|
|
|
case 'not':
|
|
|
- return (
|
|
|
- <span className="link" onClick={() => onUploadNote(appointment)}>
|
|
|
- 点此上传
|
|
|
- </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)}>
|
|
|
- 点此上传
|
|
|
- </span>
|
|
|
+ <span className="link" onClick={() => onUploadNote(appointment, { appointmentId: appointment.id, recordId: appointment.recordId })}>点此上传</span>
|
|
|
</div>
|
|
|
<div className="note-list">
|
|
|
{appointment.noteList.map(row => {
|
|
|
- return (
|
|
|
- <Note
|
|
|
- user={this.props.user}
|
|
|
- teacher={data.teacher}
|
|
|
- data={row}
|
|
|
- reply={!row.userId}
|
|
|
- actionList={[
|
|
|
- row.userId && { key: 'edit', title: '编辑' },
|
|
|
- row.userId && { key: 'delete', title: '删除' },
|
|
|
- ]}
|
|
|
- onAction={key => {
|
|
|
- switch (key) {
|
|
|
- case 'edit':
|
|
|
- onUploadNote(appointment, row);
|
|
|
- break;
|
|
|
- case 'delete':
|
|
|
- onDeleteNote(appointment, row);
|
|
|
- break;
|
|
|
- case 'reply':
|
|
|
- onUploadNote(appointment, { parentId: row.id });
|
|
|
- break;
|
|
|
- default:
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- );
|
|
|
+ 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:
|
|
|
+ }
|
|
|
+ }} />;
|
|
|
})}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -1587,47 +1536,29 @@ class TimeLineItem extends Component {
|
|
|
case 'end':
|
|
|
return <span className="link">写留言</span>;
|
|
|
case 'not':
|
|
|
- return (
|
|
|
- <span className="link" onClick={() => onUploadSupply(appointment)}>
|
|
|
- 写留言
|
|
|
- </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)}>
|
|
|
- 写留言
|
|
|
- </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', title: '编辑' },
|
|
|
- row.userId && { key: 'delete', title: '删除' },
|
|
|
- ]}
|
|
|
- onAction={key => {
|
|
|
- switch (key) {
|
|
|
- case 'edit':
|
|
|
- onUploadSupply(appointment, row);
|
|
|
- break;
|
|
|
- case 'delete':
|
|
|
- onDeleteSupply(appointment, row);
|
|
|
- break;
|
|
|
- case 'reply':
|
|
|
- onUploadSupply(appointment, { parentId: row.id });
|
|
|
- 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>
|