Commit a8671c79 authored by wangxuelai's avatar wangxuelai

''

parent 3a7bab8c
......@@ -11,7 +11,7 @@
<script src="js/console-polyfill.js"></script>
<![endif]-->
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script>
<link href="/dist/index.css?1564366830940" rel="stylesheet">
<link href="/dist/index.css?1564389304844" rel="stylesheet">
<script src="/lib/vendor.dll.js?3" charset="utf-8"></script>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3" charset="utf-8"></script>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3" charset="utf-8"></script>
......@@ -24,7 +24,7 @@
<body>
<div id="root"></div>
<script src="/dist/index.js?1564366830940" charset="utf-8"></script>
<script src="/dist/index.js?1564389304844" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
</html
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -26,6 +26,8 @@
"eventsource-polyfill": "^0.9.6",
"fetch-ie8": "^1.5.0",
"fetch-jsonp": "^1.1.3",
"griffith": "^1.5.0",
"history": "^4.9.0",
"jquery": "^3.3.1",
"lodash": "^4.17.5",
"mockjs": "^1.0.1-beta3",
......@@ -33,7 +35,9 @@
"qrcode.react": "^0.8.0",
"qs": "^6.5.1",
"react": "^16.2.0",
"react-dom": "^16.2.0"
"react-audio-player": "^0.11.0",
"react-dom": "^16.2.0",
"video-react": "^0.14.1"
},
"devDependencies": {
"babel-eslint": "^8.2.2",
......
......@@ -40,7 +40,7 @@ export default {
activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
path: '/sjd/classmgt',
relativePath: ['/sjd/classmgt', '/sjd/thememgt', '/sjd/clockmgt'],
relativePath: ['/sjd/classmgt', '/sjd/thememgt/:classid', '/sjd/clockmgt/:themetype/:classid/:themeid'],
},
],
};
import React from 'react';
import { Icon } from 'antd';
import { Player } from 'video-react';
import componentStyle from './VideoPlay.less';
import { videoorigin } from '../utils/index';
class VideoPlay extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
componentDidMount() {
}
componentWillUpdate() {
}
cancelCropper = () => {
}
sureCropper = () => {
}
rotateLeft = () => {
}
rotateRight = () => {
}
closeImgPreview = () => {
}
render() {
const { src, closeVideoPlay } = this.props;
return (
<div className={`${componentStyle.VideoPlayBox} VideoPlayBox`}>
<Icon type="close-circle" className={componentStyle.closeIcon} onClick={closeVideoPlay} />
<Player className={componentStyle.videoitem}>
<source src={videoorigin(src)} />
</Player>
</div>
);
}
}
export default VideoPlay;
This diff is collapsed.
......@@ -5,6 +5,7 @@ html, body, :global(#root) {
height: 100%;
min-height: 500px;
}
:global{
.clearfix::aftre{
content: '';
......
This diff is collapsed.
......@@ -58,6 +58,9 @@ export default {
});
message.error(classListData.msg, 1);
}
yield put({
type: 'thememgt/pageInit',
});
},
* gothememgt({ payload }, { call, put, select }) {
console.log(payload, 'payload');
......
......@@ -311,13 +311,21 @@ export default {
delete newSelectClockObj[clock.id];
}
let newallClockSelected = true;
for (let j = 0, Length = tabBClockList.length; j < Length; j++) {
for (const i in selectClockObj) {
if (!selectClockObj[tabBClockList[j].id]) {
newallClockSelected = false;
break;
const selectClockIdArr = [];
for (const i in selectClockObj) {
selectClockIdArr.push(i);
}
if (selectClockIdArr.length > 0) {
for (let j = 0, Length = tabBClockList.length; j < Length; j++) {
for (const i in selectClockObj) {
if (!selectClockObj[tabBClockList[j].id]) {
newallClockSelected = false;
break;
}
}
}
} else {
newallClockSelected = false;
}
yield put({
type: 'updateState',
......@@ -395,15 +403,6 @@ export default {
const {
batchCommentParams, batchPrivitecommentOpen, selectClockObj, batchCommentSubmiting,
} = yield select(state => state.clockmgt);
if (batchCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
batchCommentSubmiting: true,
},
});
const { common, privite } = batchCommentParams;
const idsArr = [];
const priviteReviewsIds = [];
......@@ -433,6 +432,15 @@ export default {
message.warn('请输入私密点评评语', 1);
return;
}
if (batchCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
batchCommentSubmiting: true,
},
});
const commonBatchReviewData = yield call(clockmgtajax.batchReview, newcommon);
let batchBatchReviewData = null;
let batchReviewDeleteData = null;
......@@ -486,7 +494,7 @@ export default {
if (clock.review && clock.review[1]) {
singleCommentParams.common = {
flag: clock.review[1].flag,
content: clock.review[1].content,
content: clock.review[1].content || '',
video: clock.review[1].video,
audio: clock.review[1].audio,
img: clock.review[1].img,
......@@ -497,6 +505,20 @@ export default {
school_id: clock.review[1].school_id,
id: clock.review[1].id,
};
} else {
singleCommentParams.common = {
flag: 3,
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 1,
record_ids: 0,
type: 1,
id: 0,
school_id: '',
};
}
if (clock.review && clock.review[2]) {
singleCommentParams.privite = {
......@@ -514,6 +536,19 @@ export default {
};
newsinglePrivitecommentOpen = true;
} else {
singleCommentParams.privite = {
flag: '',
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 2,
record_ids: 0,
type: 2,
id: 0,
school_id: '',
};
newsinglePrivitecommentOpen = false;
}
yield put({
......@@ -668,15 +703,6 @@ export default {
},
* singleCommentPost({ payload }, { call, put, select }) {
const { singleCommentParams, singlePrivitecommentOpen, singleCommentSubmiting } = yield select(state => state.clockmgt);
if (singleCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
singleCommentSubmiting: true,
},
});
const { common, privite } = singleCommentParams;
const newcommon = JSON.parse(JSON.stringify(common));
newcommon.img = newcommon.img == '' ? '' : JSON.stringify(newcommon.img);
......@@ -698,6 +724,15 @@ export default {
message.warn('请输入私密点评评语', 1);
return;
}
if (singleCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
singleCommentSubmiting: true,
},
});
const commonBatchReviewData = yield call(clockmgtajax.batchReview, newcommon);
let priviteReviewDeleteData = null;
if (singlePrivitecommentOpen) {
......@@ -896,6 +931,15 @@ export default {
}
}
},
* resetCheckedStatus({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
payload: {
allClockSelected: false,
selectClockObj: { },
},
});
},
* unlockSubjectLocksSelect({ payload }, { call, put, select }) {
const { lockid } = payload;
yield put({
......@@ -1474,6 +1518,155 @@ export default {
}
setTimeout(uploaderLoading);
},
* initialpage({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
payload: {
classId: 0,
themeId: 0,
themetype: 1,
selectId: 0,
themeDetail: {},
tabAQueryClockListParasms: {
is_review: 0,
subject_id: 0,
now_consumer_id: '',
page: 1,
perPage: 10,
school_id: 0,
keyword: '',
sort_type: 2,
},
tabBQueryClockListParasms: {
is_review: 0,
subject_id: 0,
now_consumer_id: '',
page: 1,
perPage: 10,
school_id: 0,
keyword: '',
sort_type: 2,
},
tabCQueryClockListParasms: {
is_review: 0,
subject_id: 0,
now_consumer_id: '',
page: 1,
perPage: 10,
school_id: 0,
keyword: '',
sort_type: 2,
},
tabAClockList: [],
tabAClockCount: 0,
tabBClockList: [],
tabBClockCount: 0,
tabCClockList: [],
tabCClockCount: 0,
tabCClockIndex: 0,
tabCClockDetail: null,
unlockSubjectLocks: [],
calendarDays: [],
quickPrivitecommentOpen: false,
singlePrivitecommentOpen: false,
batchPrivitecommentOpen: true,
quickCommentParams: {
common: {
flag: 3,
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 1,
record_ids: 0,
type: 1,
id: 0,
school_id: '',
},
privite: {
flag: '',
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 2,
record_ids: 0,
type: 2,
id: 0,
school_id: '',
},
},
singleCommentParams: {
common: {
flag: 3,
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 1,
record_ids: 0,
type: 1,
id: 0,
school_id: '',
},
privite: {
flag: '',
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 2,
record_ids: 0,
type: 2,
id: 0,
school_id: '',
},
},
batchCommentParams: {
common: {
flag: 3,
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 1,
record_ids: 0,
type: 1,
id: 0,
school_id: '',
},
privite: {
flag: '',
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 2,
record_ids: 0,
type: 2,
id: 0,
school_id: '',
},
},
commentDrawerShow: false,
batchcommentDrawerShow: false,
singleClock: null,
selectClockObj: {},
allClockSelected: false,
singleCommentSubmiting: false,
batchCommentSubmiting: false,
quickCommentSubmiting: false,
tabIndex: 1,
placeTopSubmiting: false,
},
});
},
},
reducers: {
save(state, action) {
......
......@@ -18,6 +18,7 @@ import webappModel from './webapp';
import classmgtModel from './classmgt';
import thememgtModel from './thememgt';
import clockmgtModel from './clockmgt';
import playaudioModel from './playaudio';
export default {
loginModel,
indexstaicModel,
......@@ -30,4 +31,5 @@ export default {
classmgtModel,
thememgtModel,
clockmgtModel,
playaudioModel,
};
import { routerRedux } from 'dva/router';
import { message } from 'antd';
import { delay } from 'redux-saga';
import * as uploader from '../services/uploader';
import * as thememgtajax from '../services/thememgt';
import * as clockmgtajax from '../services/clockmgt';
import errorcode from '../common/errorcode';
import { getBetweenDays, getRandomFilename } from '../utils/index';
export default {
namespace: 'playaudio',
state: {
audio: {
src: '',
duration: 0,
},
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
},
},
effects: {
* playAudio({ payload }, { call, put, select }) {
const { audio } = payload;
yield put({
type: 'updateState',
payload: {
audio,
},
});
yield delay(500);
const audioBox = document.getElementById(audio.src);
audioBox.play();
},
},
reducers: {
save(state, action) {
return { ...state, ...action.payload };
},
updateState(state, action) {
return { ...state, ...action.payload };
},
},
};
......@@ -129,8 +129,8 @@ export default {
endTime,
subjectType,
} = yield select(state => state.thememgt);
themeListSearchQuery.start_time = (startTime && `${startTime.format('YYYY-MM-DD')} 00:00:00`) || '';
themeListSearchQuery.end_time = (endTime && `${endTime.format('YYYY-MM-DD')} 00:00:00`) || '';
themeListSearchQuery.start_time = (startTime && `${startTime.format('YYYY-MM-DD')}`) || '';
themeListSearchQuery.end_time = (endTime && `${endTime.format('YYYY-MM-DD')}`) || '';
themeListSearchQuery.subject_type = subjectType;
yield put({
type: 'updateState',
......@@ -175,6 +175,32 @@ export default {
},
});
},
* pageInit({ payload }, { call, put, select }) {
console.log('ssssssssssssssssss');
yield put({
type: 'updateState',
payload: {
classId: 0,
themeListSearchQuery: {
sort_type: 1,
class_id: 0,
type: '',
page: 1,
perPage: 10,
school_id: 0,
start_time: '',
end_time: '',
subject_type: '',
},
subjectType: '',
startTime: '',
endTime: '',
themeList: [],
themeTotal: 0,
endOpen: false,
},
});
},
},
reducers: {
save(state, action) {
......
......@@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'dva';
import { Table, Button, Rate, Input, Icon, Popover } from 'antd';
import pageStyle from './clockitem.less';
import { timeCompare, imagify, videoPoster, voiceTimeFormat } from '../../utils/index';
import { timeCompare, imagify, videoPoster, voiceTimeFormat, audioorigin } from '../../utils/index';
const { TextArea } = Input;
class ClockItem extends React.Component {
......@@ -16,7 +16,6 @@ class ClockItem extends React.Component {
}
componentWillUnmount() { // 卸载
}
render() {
const {
......@@ -26,6 +25,8 @@ class ClockItem extends React.Component {
placeTop,
delClock,
imgPreview,
playVideo,
playAudio,
} = this.props;
return (
<div className={pageStyle.clockitem}>
......@@ -61,7 +62,7 @@ class ClockItem extends React.Component {
{JSON.parse(clock.video).filter(ele => ele.type == 'video').length > 0 &&
JSON.parse(clock.video).filter(ele => ele.type == 'video').map((video) => {
return (
<div className={pageStyle.videoitem}>
<div className={pageStyle.videoitem} onClick={() => playVideo(video.src)}>
<img className={pageStyle.videoposter} src={videoPoster(video.src, 'image/resize,w_320/format,jpg/quality,q_50')} alt="汪雪来" />
<div className={pageStyle.playbox}>
<Icon type="caret-right" />
......@@ -74,13 +75,16 @@ class ClockItem extends React.Component {
<div className={pageStyle.audiobox}>
{JSON.parse(clock.audio).map((audio) => {
return (
<div className={pageStyle.audioitem}>
<span>播放</span>
<span>{voiceTimeFormat(audio.duration)}</span>
</div>
<audio className={pageStyle.audioitem} controls id={audio.src} src={audioorigin(audio.src)} />
);
})
}
{/*
<div className={pageStyle.audioitem} onClick={() => playAudio(audio)}>
<span>播放</span>
<span>{voiceTimeFormat(audio.duration)}</span>
</div>
*/}
</div>
}
<div className={pageStyle.operatebox}>
......@@ -104,12 +108,15 @@ class ClockItem extends React.Component {
<span className={pageStyle.teachername}>老师点评:</span>
<span className={pageStyle.teacherassesment}>{clock.review[1].content}</span>
</div>
{clock.review[1].audio &&
{clock.review[1].audio && clock.review[1].audio.length > 0 &&
<div className={pageStyle.teacheraudiobox}>
<div className={pageStyle.teacheraudio}>
{/*
<div className={pageStyle.teacheraudio} onClick={() => playAudio(clock.review[1].audio)}>
<span>播放</span>
<span>{voiceTimeFormat(clock.review[1].audio).duration}</span>
<span>{voiceTimeFormat(clock.review[1].audio.duration)}</span>
</div>
*/}
<audio controls id={clock.review[1].audio.src} src={audioorigin(clock.review[1].audio.src)} />
</div>
}
{clock.review[1].img && clock.review[1].img.length > 0 &&
......@@ -122,15 +129,18 @@ class ClockItem extends React.Component {
{clock.review[2] &&
<div className={pageStyle.teacherpriviteassesmentbox}>
<div className={pageStyle.teacherassesmenttext}>
<span className={pageStyle.teachername}>老师点评:</span>
<span className={pageStyle.teachername}>私密点评:</span>
<span className={pageStyle.teacherassesment}>{clock.review[2].content}</span>
</div>
{clock.review[2].audio &&
{clock.review[2].audio && clock.review[2].audio.length > 0 &&
<div className={pageStyle.teacheraudiobox}>
<div className={pageStyle.teacheraudio}>
<span>播放</span>
<span>{voiceTimeFormat(clock.review[2].audio.duration)}</span>
</div>
{/*
<div className={pageStyle.teacheraudio} onClick={() => playAudio(clock.review[2].audio)}>
<span>播放</span>
<span>{voiceTimeFormat(clock.review[2].audio.duration)}</span>
</div>
*/}
<audio controls id={clock.review[2].audio.src} src={audioorigin(clock.review[2].audio.src)} />
</div>
}
</div>
......
......@@ -161,6 +161,9 @@
}
.teacherpriviteassesmentbox {
padding: 20px 40px 14px 49px;
.teacherassesmenttext {
margin-bottom: 14px;
}
.teacherimgbox {
margin-bottom: 0;
.teacherimg {
......
......@@ -37,7 +37,7 @@ class CommentEditorBox extends React.Component {
<Rate value={commentParams.common.score / 10} onChange={scoreChange} />
</div>
<div className={pageStyle.textareabox}>
<TextArea autosize={() => true} className={pageStyle.textareabox} value={commentParams.common.content} onChange={contentChange} style={{ minHeight: '100px' }} />
<TextArea autosize={() => true} maxlength={500} className={pageStyle.textareabox} value={commentParams.common.content} onChange={contentChange} style={{ minHeight: '100px' }} />
</div>
<div className={pageStyle.shortwordbox}>
<div className={pageStyle.shortwordboxtitle}>
......@@ -76,7 +76,7 @@ class CommentEditorBox extends React.Component {
</div>
{privitecommentOpen &&
<div className={pageStyle.textareabox}>
<TextArea autosize={() => true} value={commentParams.privite.content} className={pageStyle.textareabox} onChange={priviteContentChange} style={{ minHeight: '100px' }} />
<TextArea maxlength={500} autosize={() => true} value={commentParams.privite.content} className={pageStyle.textareabox} onChange={priviteContentChange} style={{ minHeight: '100px' }} />
</div>
}
</div>
......
import React from 'react';
import { connect } from 'dva';
import { Table, Row, Col, Icon, Form, Select, Input, Button, Tabs, Rate, Switch, Pagination, Drawer, Checkbox, Modal, Empty } from 'antd';
import { Player } from 'video-react';
import pageStyle from './index.less';
import { pageIn, imagify, timeCompare, videoPoster, voiceTimeFormat } from '../../utils/index';
import { pageIn, imagify, timeCompare, videoPoster, voiceTimeFormat, audioorigin } from '../../utils/index';
import CommentEditorBox from './commenteditorbox';
import ClockItem from './clockitem';
import ImagePreview from '../../components/ImagePreview';
import VideoPlay from '../../components/VideoPlay';
const { TabPane } = Tabs;
const { Option } = Select;
const { TextArea } = Input;
......@@ -16,6 +18,8 @@ class ClockMgt extends React.Component {
currentIndex: 0,
urls: [],
imgPreviewShow: false,
videoPlayShow: false,
videoSrc: '',
};
}
componentDidMount() { // 挂载
......@@ -24,6 +28,10 @@ class ClockMgt extends React.Component {
componentDidUpdate() {
}
componentWillUnmount() { // 卸载
const { dispatch } = this.props;
dispatch({
type: 'clockmgt/initialpage',
});
}
callback = () => {
}
......@@ -32,6 +40,8 @@ class ClockMgt extends React.Component {
if (index == tabIndex) {
return;
}
this.closeCommentDrawer();
this.closeBatchCommentDrawer();
dispatch({
type: 'clockmgt/tabChange',
payload: {
......@@ -79,6 +89,9 @@ class ClockMgt extends React.Component {
},
},
});
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
}
tabBPageChange = (current, size) => {
const { dispatch } = this.props;
......@@ -92,6 +105,9 @@ class ClockMgt extends React.Component {
},
},
});
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
}
reviewTypeChange = (reviewtype) => {
const { dispatch } = this.props;
......@@ -105,6 +121,25 @@ class ClockMgt extends React.Component {
},
},
});
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
}
sortTypeChange = (sorttype) => {
const { dispatch } = this.props;
dispatch({
type: 'clockmgt/queryClockList',
payload: {
tabindex: 2,
params: {
sort_type: sorttype,
page: 1,
},
},
});
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
}
resetsearch = () => {
const { dispatch } = this.props;
......@@ -114,6 +149,7 @@ class ClockMgt extends React.Component {
tabindex: 2,
params: {
is_review: 0,
sort_type: 2,
page: 1,
},
},
......@@ -142,21 +178,31 @@ class ClockMgt extends React.Component {
}
unlockSubjectLocksSelect = (lock) => {
const { dispatch } = this.props;
this.closeCommentDrawer();
this.closeBatchCommentDrawer();
dispatch({
type: 'clockmgt/unlockSubjectLocksSelect',
payload: {
lockid: lock.id,
},
});
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
}
calendarSelect = (day) => {
const { dispatch } = this.props;
this.closeCommentDrawer();
this.closeBatchCommentDrawer();
dispatch({
type: 'clockmgt/unlockSubjectLocksSelect',
payload: {
lockid: day.day,
},
});
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
}
quickScoreChange = (score) => {
const { dispatch } = this.props;
......@@ -414,6 +460,26 @@ class ClockMgt extends React.Component {
imgPreviewShow: false,
});
}
playVideo = (src) => {
this.setState({
videoPlayShow: true,
videoSrc: src,
});
}
closeVideoPlay = () => {
this.setState({
videoPlayShow: false,
});
}
playAudio = (audio) => {
const { dispatch } = this.props;
dispatch({
type: 'playaudio/playAudio',
payload: {
audio,
},
});
};
render() {
const {
themetype,
......@@ -446,6 +512,7 @@ class ClockMgt extends React.Component {
batchCommentSubmiting,
quickCommentSubmiting,
tabIndex,
audio,
} = this.props;
return (
<div className={`${pageStyle.classmgtcontainer} clockmgtcontainer`}>
......@@ -479,7 +546,7 @@ class ClockMgt extends React.Component {
<div className={`${pageStyle.themeitem} ${selectId == ele.id ? pageStyle.themeitemselected : ''}`} onClick={() => this.unlockSubjectLocksSelect(ele)}>
<div className={pageStyle.themetitle}>{index + 1}</div>
<div className={pageStyle.themetitle}>{ele.title}</div>
<div className={pageStyle.themeduration}>{ele.clock_count}人打卡</div>
<div className={pageStyle.themeduration}>{ele.clock_count}打卡</div>
</div>
);
})
......@@ -500,6 +567,8 @@ class ClockMgt extends React.Component {
placeTop={this.placeTop}
delClock={this.delClock}
imgPreview={this.imgPreview}
playVideo={this.playVideo}
playAudio={this.playAudio}
/>
))}
</div>
......@@ -546,11 +615,9 @@ class ClockMgt extends React.Component {
xl: { span: 24 },
}}
>
<Select>
<Option value="">全部</Option>
<Option value="1">作业模式</Option>
<Option value="2">日历类型</Option>
<Option value="3">闯关类型</Option>
<Select value={tabBQueryClockListParasms.sort_type} onChange={this.sortTypeChange}>
<Option value={1}>时间升序</Option>
<Option value={2}>时间降序</Option>
</Select>
</Form.Item>
</Col>
......@@ -580,6 +647,8 @@ class ClockMgt extends React.Component {
placeTop={this.placeTop}
delClock={this.delClock}
imgPreview={this.imgPreview}
playVideo={this.playVideo}
playAudio={this.playAudio}
/>
</div>
))}
......@@ -626,6 +695,8 @@ class ClockMgt extends React.Component {
placeTop={this.placeTop}
delClock={this.delClock}
imgPreview={this.imgPreview}
playVideo={this.playVideo}
playAudio={this.playAudio}
/>
}
</div>
......@@ -708,6 +779,12 @@ class ClockMgt extends React.Component {
closeImgPreview={this.closeImgPreview}
/>
}
{this.state.videoPlayShow &&
<VideoPlay
src={this.state.videoSrc}
closeVideoPlay={this.closeVideoPlay}
/>
}
</div>
);
}
......@@ -751,6 +828,9 @@ function mapStateToProps(state) {
quickCommentSubmiting,
tabIndex,
} = state.clockmgt;
const {
audio,
} = state.playaudio;
return {
themetype,
selectId,
......@@ -784,6 +864,7 @@ function mapStateToProps(state) {
batchCommentSubmiting,
quickCommentSubmiting,
tabIndex,
audio,
};
}
export default connect(mapStateToProps)(ClockMgt);
......
......@@ -30,17 +30,6 @@ class ThemeMgt extends React.Component {
},
});
}
handleStartOpenChange = (open) => {
const { dispatch } = this.props;
if (!open) {
dispatch({
type: 'thememgt/endopenchange',
payload: {
endOpen: true,
},
});
}
};
disabledEndDate = (endValue) => {
const { startTime } = this.props;
if (!endValue || !startTime) {
......@@ -55,14 +44,25 @@ class ThemeMgt extends React.Component {
}
return startValue.valueOf() > endTime.valueOf();
}
handleStartOpenChange = (open) => {
const { dispatch, startTime } = this.props;
// if (!open && startTime) {
// dispatch({
// type: 'thememgt/endopenchange',
// payload: {
// endOpen: true,
// },
// });
// }
};
handleEndOpenChange = (open) => {
const { dispatch } = this.props;
dispatch({
type: 'thememgt/endopenchange',
payload: {
endOpen: open,
},
});
// dispatch({
// type: 'thememgt/endopenchange',
// payload: {
// endOpen: open,
// },
// });
};
changePagination = (page, perPage) => {
const { dispatch } = this.props;
......@@ -119,6 +119,22 @@ class ThemeMgt extends React.Component {
type: 'thememgt/resetsearch',
});
}
judgeTimeStatuc = (endTime, startTime) => {
const endStamp = Date.parse(endTime.replace(/\-/g, '/'));
const startStamp = Date.parse(startTime.replace(/\-/g, '/'));
const nowStamp = (new Date()).getTime();
let status = '';
if (startStamp <= nowStamp) {
status = 'notstart';
}
if (endStamp < nowStamp) {
status = 'end';
}
if (endStamp > nowStamp && startStamp < nowStamp) {
status = 'doing';
}
return status;
}
render() {
const {
themeTotal,
......@@ -166,9 +182,9 @@ class ThemeMgt extends React.Component {
key: 'clock_count',
render: (text, record, index) => (
<div className={pageStyle.tablecell}>
{record.subject_type == 1 && record.clock_record_count}
{record.subject_type == 2 && record.all_record_count}
{record.subject_type == 3 && record.clock_people}
{record.subject_type == 1 && record.student_total}
{record.subject_type == 2 && record.student_total}
{record.subject_type == 3 && record.class_students_count}
</div>
),
},
......@@ -179,9 +195,9 @@ class ThemeMgt extends React.Component {
key: 'clock_count',
render: (text, record, index) => (
<div className={pageStyle.tablecell}>
{record.subject_type == 1 && record.clock_count}
{record.subject_type == 2 && record.clock_count}
{record.subject_type == 3 && record.unlock_clock_count}
{record.subject_type == 1 && record.clock_record_count}
{record.subject_type == 2 && record.clock_record_count}
{record.subject_type == 3 && record.clock_people}
</div>
),
},
......@@ -192,7 +208,11 @@ class ThemeMgt extends React.Component {
key: 'clock_count',
render: (text, record, index) => (
<div className={pageStyle.tablecell}>
进度
{record.subject_type == 1 && '-'}
{record.subject_type == 2 && this.judgeTimeStatuc(record.end_time, record.start_time) == 'notstart' ? '未开始' : ''}
{record.subject_type == 2 && this.judgeTimeStatuc(record.end_time, record.start_time) == 'end' ? '已结束' : ''}
{record.subject_type == 2 && this.judgeTimeStatuc(record.end_time, record.start_time) == 'doing' ? `${record.today_days}/${record.days}` : ''}
{record.subject_type == 3 && `${record.unlock_subject_count}/${record.subject_count}`}
</div>
),
},
......@@ -203,7 +223,9 @@ class ThemeMgt extends React.Component {
key: 'clock_count',
render: (text, record, index) => (
<div className={pageStyle.tablecell}>
{record.no_review}
{record.subject_type == 1 && record.no_review}
{record.subject_type == 2 && record.no_review}
{record.subject_type == 3 && record.unreview_clock_record_count}
</div>
),
},
......@@ -276,7 +298,6 @@ class ThemeMgt extends React.Component {
format="YYYY-MM-DD"
disabledDate={this.disabledEndDate}
onChange={this.onEndChange}
open={endOpen}
onOpenChange={this.handleEndOpenChange}
value={endTime}
/>
......
......@@ -570,7 +570,26 @@ function getBetweenDays(startDate, endDate) {
}
return dateArr;
}
function videoorigin(src) {
let url = src || '';
url = `https://omedia.shangjiadao.cn/${url}`;
return url;
}
function audioorigin(src) {
if (!src) {
return '';
}
let Src = src;
if (src.indexOf('omedia.shangjiadao.cn') == -1) {
Src = `https://omedia.shangjiadao.cn/${src}`;
}
return Src;
}
export {
audioorigin,
videoorigin,
pageIn,
SessionStorage,
LocalStorage,
......
......@@ -9,7 +9,7 @@ module.exports = {
'dva',
'antd',
'jquery',
'cropper',
'cropper'
],
},
output: {
......
This diff is collapsed.
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