Commit 24c21c2c by chenshu

fix:修复

parent 98a0b83a
...@@ -40,11 +40,7 @@ import GraphicsEditor from '../components/GraphicsEditor'; ...@@ -40,11 +40,7 @@ import GraphicsEditor from '../components/GraphicsEditor';
import MultipleDatePicker from '@/components/MultipleDatePicker'; import MultipleDatePicker from '@/components/MultipleDatePicker';
import './AddOfflineCourse.less'; import './AddOfflineCourse.less';
const EDIT_BOX_KEY = Math.random();
const fieldNames = { label: 'categoryName', value: 'id', children: 'sonCategoryList' };
const { Option } = Select; const { Option } = Select;
//添加课程时课程默认的一些值
const whetherVisitorsJoin = 'NO'
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png'; const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png';
let cutFlag = false; let cutFlag = false;
const unitList = [ const unitList = [
...@@ -152,10 +148,6 @@ class AddOfflineCourse extends React.Component { ...@@ -152,10 +148,6 @@ class AddOfflineCourse extends React.Component {
return newTreeData; return newTreeData;
}; };
catalogChange= (value, options) => {
this.setState({ categoryId: _.last(value), categoryName: _.pluck(options, 'categoryName').join('-') })
}
// 获取线下课详情 // 获取线下课详情
handleFetchScheudleDetail = (courseId) => { handleFetchScheudleDetail = (courseId) => {
return Service.Hades('public/hades/getOfflineCourseDetail',{ return Service.Hades('public/hades/getOfflineCourseDetail',{
...@@ -465,7 +457,7 @@ class AddOfflineCourse extends React.Component { ...@@ -465,7 +457,7 @@ class AddOfflineCourse extends React.Component {
preSubmit = () => { preSubmit = () => {
const { courseId } = this.state; const { courseId } = this.state;
courseId ? this.handleFetchScheudleDetail().then(bool => bool && this.handleSubmit()) : this.handleSubmit(); courseId ? this.handleFetchScheudleDetail(courseId).then(bool => bool && this.handleSubmit()) : this.handleSubmit();
} }
// 保存 // 保存
...@@ -723,8 +715,8 @@ class AddOfflineCourse extends React.Component { ...@@ -723,8 +715,8 @@ class AddOfflineCourse extends React.Component {
} }
} }
handleChangeCatalogList = (value) => { handleChangeCatalogList = (value, label) => {
this.setState({ categoryId: value }); this.setState({ categoryId: value, categoryName: label[0] });
}; };
render() { render() {
...@@ -830,8 +822,8 @@ class AddOfflineCourse extends React.Component { ...@@ -830,8 +822,8 @@ class AddOfflineCourse extends React.Component {
allowClear allowClear
value={categoryId} value={categoryId}
treeDefaultExpandAll treeDefaultExpandAll
onChange={(value) => { onChange={(value, label) => {
this.handleChangeCatalogList(value); this.handleChangeCatalogList(value, label);
}} }}
/> />
</div> </div>
...@@ -853,7 +845,6 @@ class AddOfflineCourse extends React.Component { ...@@ -853,7 +845,6 @@ class AddOfflineCourse extends React.Component {
placeholder="请选择讲师" placeholder="请选择讲师"
value={teacherName} value={teacherName}
style={{ width: 240 }} style={{ width: 240 }}
disabled={pageType === 'edit' ? true: false}
showSearch showSearch
allowClear allowClear
filterOption={(input, option) => option} filterOption={(input, option) => option}
...@@ -909,7 +900,7 @@ class AddOfflineCourse extends React.Component { ...@@ -909,7 +900,7 @@ class AddOfflineCourse extends React.Component {
<div> <div>
<div className="desc"> <div className="desc">
<div>开启:允许未绑定手机号的用户观看</div> <div>开启:允许未绑定手机号的用户观看</div>
<div>关闭:仅限绑定了手机号的用户可以进入观看图文</div> <div>关闭:仅限绑定了手机号的用户可以进入观看线下</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -1038,7 +1029,7 @@ class AddOfflineCourse extends React.Component { ...@@ -1038,7 +1029,7 @@ class AddOfflineCourse extends React.Component {
style={{ width: "calc(100% - 70px)" }} style={{ width: "calc(100% - 70px)" }}
renderExtraFooter={() => calendarTime[0] ? <div style={{ position: 'absolute', bottom: 8, cursor: 'pointer' }}> renderExtraFooter={() => calendarTime[0] ? <div style={{ position: 'absolute', bottom: 8, cursor: 'pointer' }}>
<span <span
onClick={() => this.setState({ startTimeApply: moment(calendarTime[0]).subtract(1, 'days').valueOf(), endTimeApply: calendarTime[0] })} onClick={() => this.setState({ startTimeApply: moment(`${moment(calendarTime[0]).format('YYYY-MM-DD')} ${moment(startTime).format('HH:mm')}`).subtract(1, 'days').valueOf(), endTimeApply: `${moment(calendarTime[0]).format('YYYY-MM-DD')} ${moment(startTime).format('HH:mm')}` })}
style={{ style={{
color: '#FFB714', color: '#FFB714',
border: '1px solid #FFB714', border: '1px solid #FFB714',
...@@ -1048,7 +1039,7 @@ class AddOfflineCourse extends React.Component { ...@@ -1048,7 +1039,7 @@ class AddOfflineCourse extends React.Component {
}} }}
>上课前1天</span> >上课前1天</span>
<span <span
onClick={() => this.setState({ startTimeApply: moment(calendarTime[0]).subtract(2, 'days').valueOf(), endTimeApply: calendarTime[0] })} onClick={() => this.setState({ startTimeApply: moment(`${moment(calendarTime[0]).format('YYYY-MM-DD')} ${moment(startTime).format('HH:mm')}`).subtract(2, 'days').valueOf(), endTimeApply: `${moment(calendarTime[0]).format('YYYY-MM-DD')} ${moment(startTime).format('HH:mm')}` })}
style={{ style={{
color: '#FFB714', color: '#FFB714',
border: '1px solid #FFB714', border: '1px solid #FFB714',
...@@ -1058,7 +1049,7 @@ class AddOfflineCourse extends React.Component { ...@@ -1058,7 +1049,7 @@ class AddOfflineCourse extends React.Component {
}} }}
>上课前2天</span> >上课前2天</span>
<span <span
onClick={() => this.setState({ startTimeApply: moment(calendarTime[0]).subtract(3, 'days').valueOf(), endTimeApply: calendarTime[0] })} onClick={() => this.setState({ startTimeApply: moment(`${moment(calendarTime[0]).format('YYYY-MM-DD')} ${moment(startTime).format('HH:mm')}`).subtract(3, 'days').valueOf(), endTimeApply: `${moment(calendarTime[0]).format('YYYY-MM-DD')} ${moment(startTime).format('HH:mm')}` })}
style={{ style={{
color: '#FFB714', color: '#FFB714',
border: '1px solid #FFB714', border: '1px solid #FFB714',
......
...@@ -111,15 +111,15 @@ export default class OfflineCourseData extends React.Component { ...@@ -111,15 +111,15 @@ export default class OfflineCourseData extends React.Component {
) )
}, },
}, },
{ ];
whetherSetApply === 'YES' && columns.push({
title: '报名时间', title: '报名时间',
key: 'joinTime', key: 'joinTime',
dataIndex: 'joinTime', dataIndex: 'joinTime',
render: (val, item) => { render: (val, item) => {
return <div>{formatDate('YYYY-MM-DD H:i', item.joinTime)}</div> return <div>{formatDate('YYYY-MM-DD H:i', item.joinTime)}</div>
} }
}, });
];
whetherSetSignIn === 'YES' && columns.push({ whetherSetSignIn === 'YES' && columns.push({
title: '签到时间', title: '签到时间',
key: 'joinInTime', key: 'joinInTime',
...@@ -252,7 +252,7 @@ export default class OfflineCourseData extends React.Component { ...@@ -252,7 +252,7 @@ export default class OfflineCourseData extends React.Component {
<div className="right-box"> <div className="right-box">
<div className="selected-date">{moment(currentDate).format('MM-DD')}</div> <div className="selected-date">{moment(currentDate).format('MM-DD')}</div>
<div className="detail-data"> <div className="detail-data">
{offlineCourseType !== 'ALL_DAY_OFFLINE' && <span className="icon iconfont">&#xe89f;</span>} {offlineCourseType !== 'ALL_DAY_OFFLINE' && whetherSetApply === 'YES' && <span className="icon iconfont">&#xe89f;</span>}
{offlineCourseType !== 'ALL_DAY_OFFLINE' && whetherSetApply === 'YES' && <span className="data-text">报名人数:{joinNum}</span>} {offlineCourseType !== 'ALL_DAY_OFFLINE' && whetherSetApply === 'YES' && <span className="data-text">报名人数:{joinNum}</span>}
{whetherSetSignInOut === 'YES' && <span className="icon iconfont">&#xe89e;</span>} {whetherSetSignInOut === 'YES' && <span className="icon iconfont">&#xe89e;</span>}
{whetherSetSignInOut === 'YES' && <span className="data-text">完成考勤数<Tooltip title="当日在规定时间内完成签到和签退的用户数"><span className="icon iconfont">&#xe7c4;</span></Tooltip>{fullJoinNum}</span>} {whetherSetSignInOut === 'YES' && <span className="data-text">完成考勤数<Tooltip title="当日在规定时间内完成签到和签退的用户数"><span className="icon iconfont">&#xe7c4;</span></Tooltip>{fullJoinNum}</span>}
......
...@@ -117,7 +117,7 @@ class OfflineCourseList extends React.Component { ...@@ -117,7 +117,7 @@ class OfflineCourseList extends React.Component {
{ {
title: <span> title: <span>
<span>学院展示</span> <span>学院展示</span>
<Tooltip title={<div>开启后,用户可在学院内查看到此课程。若课程“未成功开课”,则系统会自动“关闭”学院展示。<br/>关闭后,学院内不再展示此课程,但用户仍可通过分享的海报/链接查看此课程。</div>}><i className="icon iconfont" style={{ marginLeft: '5px',cursor:'pointer',color:'#bfbfbf',fontSize:'14px'}}>&#xe61d;</i></Tooltip> <Tooltip title={<div>开启后,用户可在学院内查看到此课程。<br/>关闭后,学院内不再展示此课程,但用户仍可通过分享的海报/链接查看此课程。</div>}><i className="icon iconfont" style={{ marginLeft: '5px',cursor:'pointer',color:'#bfbfbf',fontSize:'14px'}}>&#xe61d;</i></Tooltip>
</span>, </span>,
width: 120, width: 120,
dataIndex: "courseware", dataIndex: "courseware",
......
...@@ -39,7 +39,7 @@ export default class QRCodeModal extends React.Component { ...@@ -39,7 +39,7 @@ export default class QRCodeModal extends React.Component {
const htmlUrl = `${LIVE_SHARE}sign_in?id=${User.getStoreId()}&calendar=${selectedDate}&courseId=${data.courseId}&from=work_weixin`; const htmlUrl = `${LIVE_SHARE}sign_in?id=${User.getStoreId()}&calendar=${selectedDate}&courseId=${data.courseId}&from=work_weixin`;
list.push(htmlUrl); list.push(htmlUrl);
} }
if (data.whetherSetSignIn === 'YES') { if (data.whetherSetSignOut === 'YES') {
const htmlUrl = `${LIVE_SHARE}sign_out?id=${User.getStoreId()}&calendar=${selectedDate}&courseId=${data.courseId}&from=work_weixin`; const htmlUrl = `${LIVE_SHARE}sign_out?id=${User.getStoreId()}&calendar=${selectedDate}&courseId=${data.courseId}&from=work_weixin`;
list.push(htmlUrl); list.push(htmlUrl);
} }
...@@ -47,12 +47,12 @@ export default class QRCodeModal extends React.Component { ...@@ -47,12 +47,12 @@ export default class QRCodeModal extends React.Component {
urls: list urls: list
}).then((res) => { }).then((res) => {
const { result = [] } = res; const { result = [] } = res;
const qrcodeNode1 = new QRCode({ const qrcodeNode1 = qrcodeWrapDom1 && new QRCode({
text: result[0].shortUrl, text: result[0].shortUrl,
size: 170, size: 170,
}); });
const qrcodeNode2 = result[1] && new QRCode({ const qrcodeNode2 = qrcodeWrapDom2 && new QRCode({
text: result[1].shortUrl, text: result[data.whetherSetSignIn === 'YES' ? 1 : 0].shortUrl,
size: 170, size: 170,
}); });
qrcodeWrapDom1 && qrcodeWrapDom1.childNodes[0] && qrcodeWrapDom1.removeChild(qrcodeWrapDom1.childNodes[0]); qrcodeWrapDom1 && qrcodeWrapDom1.childNodes[0] && qrcodeWrapDom1.removeChild(qrcodeWrapDom1.childNodes[0]);
...@@ -90,10 +90,11 @@ export default class QRCodeModal extends React.Component { ...@@ -90,10 +90,11 @@ export default class QRCodeModal extends React.Component {
} }
downloadImg = () => { downloadImg = () => {
const { imgUrl1, imgUrl2 } = this.state; const { imgUrl1, imgUrl2, selectedDate, data } = this.state;
const fileName = '二维码.png'; let fileName1 = `签到二维码_${data.courseName}_${moment(selectedDate).format('YYYY-MM-DD')}.png`;
imgUrl1 && window.downloadFile(imgUrl1, fileName); let fileName2 = `签退二维码_${data.courseName}_${moment(selectedDate).format('YYYY-MM-DD')}.png`;
imgUrl2 && window.downloadFile(imgUrl2, fileName); imgUrl1 && setTimeout(() => window.downloadFile(imgUrl1, fileName1), 0);
imgUrl2 && setTimeout(() => window.downloadFile(imgUrl2, fileName2), 0);
} }
render() { render() {
...@@ -112,7 +113,7 @@ export default class QRCodeModal extends React.Component { ...@@ -112,7 +113,7 @@ export default class QRCodeModal extends React.Component {
startUnit = (data.signOutStartTimeUnit || '').toLocaleLowerCase() + 's'; startUnit = (data.signOutStartTimeUnit || '').toLocaleLowerCase() + 's';
start = moment(`${date} ${moment(data.startTime).format('HH:mm')}`).add(data.signOutStartTimeNum, startUnit); start = moment(`${date} ${moment(data.startTime).format('HH:mm')}`).add(data.signOutStartTimeNum, startUnit);
} }
const signOutTime = data.signOutType === 'START_LATER' ? `${moment(start).format('YYYY-MM-DD HH:mm')} ~ ${moment(end).format('YYYY-MM-DD HH:mm')}` : `${moment(data.endTime).format('YYYY-MM-DD HH:mm')} ~ ${moment(end).format('YYYY-MM-DD HH:mm')}`; const signOutTime = data.signOutType === 'START_LATER' ? `${moment(start).format('YYYY-MM-DD HH:mm')} ~ ${moment(end).format('YYYY-MM-DD HH:mm')}` : `${moment(`${date} ${moment(data.endTime).format('HH:mm')}`).format('YYYY-MM-DD HH:mm')} ~ ${moment(end).format('YYYY-MM-DD HH:mm')}`;
return ( return (
<Modal <Modal
title="考勤二维码" title="考勤二维码"
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
background: #fff; background: #fff;
width: ~'calc(50% - 8px)'; width: ~'calc(50% - 8px)';
padding: 16px; padding: 16px;
overflow: hidden;
.study-title { .study-title {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
......
...@@ -246,7 +246,7 @@ function Header(props) { ...@@ -246,7 +246,7 @@ function Header(props) {
}} }}
className="college-container" className="college-container"
> >
<div> <div style={{ width: '100%', height: '100%' }}>
<div className="college" onClick={() => setOpenDropdown(false)}> <div className="college" onClick={() => setOpenDropdown(false)}>
<span <span
className="college-name" className="college-name"
......
...@@ -189,6 +189,8 @@ ...@@ -189,6 +189,8 @@
align-items: center; align-items: center;
margin-right: 16px; margin-right: 16px;
cursor: pointer; cursor: pointer;
width: 100%;
height: 100%;
.select { .select {
cursor: pointer; cursor: pointer;
} }
......
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