Commit 24c21c2c by chenshu

fix:修复

parent 98a0b83a
......@@ -40,11 +40,7 @@ import GraphicsEditor from '../components/GraphicsEditor';
import MultipleDatePicker from '@/components/MultipleDatePicker';
import './AddOfflineCourse.less';
const EDIT_BOX_KEY = Math.random();
const fieldNames = { label: 'categoryName', value: 'id', children: 'sonCategoryList' };
const { Option } = Select;
//添加课程时课程默认的一些值
const whetherVisitorsJoin = 'NO'
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/YNfi45JwFA.png';
let cutFlag = false;
const unitList = [
......@@ -152,10 +148,6 @@ class AddOfflineCourse extends React.Component {
return newTreeData;
};
catalogChange= (value, options) => {
this.setState({ categoryId: _.last(value), categoryName: _.pluck(options, 'categoryName').join('-') })
}
// 获取线下课详情
handleFetchScheudleDetail = (courseId) => {
return Service.Hades('public/hades/getOfflineCourseDetail',{
......@@ -465,7 +457,7 @@ class AddOfflineCourse extends React.Component {
preSubmit = () => {
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 {
}
}
handleChangeCatalogList = (value) => {
this.setState({ categoryId: value });
handleChangeCatalogList = (value, label) => {
this.setState({ categoryId: value, categoryName: label[0] });
};
render() {
......@@ -830,8 +822,8 @@ class AddOfflineCourse extends React.Component {
allowClear
value={categoryId}
treeDefaultExpandAll
onChange={(value) => {
this.handleChangeCatalogList(value);
onChange={(value, label) => {
this.handleChangeCatalogList(value, label);
}}
/>
</div>
......@@ -853,7 +845,6 @@ class AddOfflineCourse extends React.Component {
placeholder="请选择讲师"
value={teacherName}
style={{ width: 240 }}
disabled={pageType === 'edit' ? true: false}
showSearch
allowClear
filterOption={(input, option) => option}
......@@ -909,7 +900,7 @@ class AddOfflineCourse extends React.Component {
<div>
<div className="desc">
<div>开启:允许未绑定手机号的用户观看</div>
<div>关闭:仅限绑定了手机号的用户可以进入观看图文</div>
<div>关闭:仅限绑定了手机号的用户可以进入观看线下</div>
</div>
</div>
</div>
......@@ -1038,7 +1029,7 @@ class AddOfflineCourse extends React.Component {
style={{ width: "calc(100% - 70px)" }}
renderExtraFooter={() => calendarTime[0] ? <div style={{ position: 'absolute', bottom: 8, cursor: 'pointer' }}>
<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={{
color: '#FFB714',
border: '1px solid #FFB714',
......@@ -1048,7 +1039,7 @@ class AddOfflineCourse extends React.Component {
}}
>上课前1天</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={{
color: '#FFB714',
border: '1px solid #FFB714',
......@@ -1058,7 +1049,7 @@ class AddOfflineCourse extends React.Component {
}}
>上课前2天</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={{
color: '#FFB714',
border: '1px solid #FFB714',
......
......@@ -111,15 +111,15 @@ export default class OfflineCourseData extends React.Component {
)
},
},
{
];
whetherSetApply === 'YES' && columns.push({
title: '报名时间',
key: 'joinTime',
dataIndex: 'joinTime',
render: (val, item) => {
return <div>{formatDate('YYYY-MM-DD H:i', item.joinTime)}</div>
}
},
];
});
whetherSetSignIn === 'YES' && columns.push({
title: '签到时间',
key: 'joinInTime',
......@@ -252,7 +252,7 @@ export default class OfflineCourseData extends React.Component {
<div className="right-box">
<div className="selected-date">{moment(currentDate).format('MM-DD')}</div>
<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>}
{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>}
......
......@@ -117,7 +117,7 @@ class OfflineCourseList extends React.Component {
{
title: <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>,
width: 120,
dataIndex: "courseware",
......
......@@ -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`;
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`;
list.push(htmlUrl);
}
......@@ -47,12 +47,12 @@ export default class QRCodeModal extends React.Component {
urls: list
}).then((res) => {
const { result = [] } = res;
const qrcodeNode1 = new QRCode({
const qrcodeNode1 = qrcodeWrapDom1 && new QRCode({
text: result[0].shortUrl,
size: 170,
});
const qrcodeNode2 = result[1] && new QRCode({
text: result[1].shortUrl,
const qrcodeNode2 = qrcodeWrapDom2 && new QRCode({
text: result[data.whetherSetSignIn === 'YES' ? 1 : 0].shortUrl,
size: 170,
});
qrcodeWrapDom1 && qrcodeWrapDom1.childNodes[0] && qrcodeWrapDom1.removeChild(qrcodeWrapDom1.childNodes[0]);
......@@ -90,10 +90,11 @@ export default class QRCodeModal extends React.Component {
}
downloadImg = () => {
const { imgUrl1, imgUrl2 } = this.state;
const fileName = '二维码.png';
imgUrl1 && window.downloadFile(imgUrl1, fileName);
imgUrl2 && window.downloadFile(imgUrl2, fileName);
const { imgUrl1, imgUrl2, selectedDate, data } = this.state;
let fileName1 = `签到二维码_${data.courseName}_${moment(selectedDate).format('YYYY-MM-DD')}.png`;
let fileName2 = `签退二维码_${data.courseName}_${moment(selectedDate).format('YYYY-MM-DD')}.png`;
imgUrl1 && setTimeout(() => window.downloadFile(imgUrl1, fileName1), 0);
imgUrl2 && setTimeout(() => window.downloadFile(imgUrl2, fileName2), 0);
}
render() {
......@@ -112,7 +113,7 @@ export default class QRCodeModal extends React.Component {
startUnit = (data.signOutStartTimeUnit || '').toLocaleLowerCase() + 's';
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 (
<Modal
title="考勤二维码"
......
......@@ -115,6 +115,7 @@
background: #fff;
width: ~'calc(50% - 8px)';
padding: 16px;
overflow: hidden;
.study-title {
font-size: 16px;
color: #333;
......
......@@ -246,7 +246,7 @@ function Header(props) {
}}
className="college-container"
>
<div>
<div style={{ width: '100%', height: '100%' }}>
<div className="college" onClick={() => setOpenDropdown(false)}>
<span
className="college-name"
......
......@@ -189,6 +189,8 @@
align-items: center;
margin-right: 16px;
cursor: pointer;
width: 100%;
height: 100%;
.select {
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