Commit a8671c79 authored by wangxuelai's avatar wangxuelai

''

parent 3a7bab8c
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<script src="js/console-polyfill.js"></script> <script src="js/console-polyfill.js"></script>
<![endif]--> <![endif]-->
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script> <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="/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/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> <script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3" charset="utf-8"></script>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<body> <body>
<div id="root"></div> <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> </body>
</html> </html
\ No newline at end of file \ 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 @@ ...@@ -26,6 +26,8 @@
"eventsource-polyfill": "^0.9.6", "eventsource-polyfill": "^0.9.6",
"fetch-ie8": "^1.5.0", "fetch-ie8": "^1.5.0",
"fetch-jsonp": "^1.1.3", "fetch-jsonp": "^1.1.3",
"griffith": "^1.5.0",
"history": "^4.9.0",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"lodash": "^4.17.5", "lodash": "^4.17.5",
"mockjs": "^1.0.1-beta3", "mockjs": "^1.0.1-beta3",
...@@ -33,7 +35,9 @@ ...@@ -33,7 +35,9 @@
"qrcode.react": "^0.8.0", "qrcode.react": "^0.8.0",
"qs": "^6.5.1", "qs": "^6.5.1",
"react": "^16.2.0", "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": { "devDependencies": {
"babel-eslint": "^8.2.2", "babel-eslint": "^8.2.2",
......
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
activeurl: `${__IMGCDN__}menu/officialwebactive.png`, activeurl: `${__IMGCDN__}menu/officialwebactive.png`,
notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`, notactiveurl: `${__IMGCDN__}menu/officialwebnotactive.png`,
path: '/sjd/classmgt', 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) { ...@@ -5,6 +5,7 @@ html, body, :global(#root) {
height: 100%; height: 100%;
min-height: 500px; min-height: 500px;
} }
:global{ :global{
.clearfix::aftre{ .clearfix::aftre{
content: ''; content: '';
......
This diff is collapsed.
...@@ -58,6 +58,9 @@ export default { ...@@ -58,6 +58,9 @@ export default {
}); });
message.error(classListData.msg, 1); message.error(classListData.msg, 1);
} }
yield put({
type: 'thememgt/pageInit',
});
}, },
* gothememgt({ payload }, { call, put, select }) { * gothememgt({ payload }, { call, put, select }) {
console.log(payload, 'payload'); console.log(payload, 'payload');
......
...@@ -311,13 +311,21 @@ export default { ...@@ -311,13 +311,21 @@ export default {
delete newSelectClockObj[clock.id]; delete newSelectClockObj[clock.id];
} }
let newallClockSelected = true; let newallClockSelected = true;
for (let j = 0, Length = tabBClockList.length; j < Length; j++) { const selectClockIdArr = [];
for (const i in selectClockObj) { for (const i in selectClockObj) {
if (!selectClockObj[tabBClockList[j].id]) { selectClockIdArr.push(i);
newallClockSelected = false; }
break; 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({ yield put({
type: 'updateState', type: 'updateState',
...@@ -395,15 +403,6 @@ export default { ...@@ -395,15 +403,6 @@ export default {
const { const {
batchCommentParams, batchPrivitecommentOpen, selectClockObj, batchCommentSubmiting, batchCommentParams, batchPrivitecommentOpen, selectClockObj, batchCommentSubmiting,
} = yield select(state => state.clockmgt); } = yield select(state => state.clockmgt);
if (batchCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
batchCommentSubmiting: true,
},
});
const { common, privite } = batchCommentParams; const { common, privite } = batchCommentParams;
const idsArr = []; const idsArr = [];
const priviteReviewsIds = []; const priviteReviewsIds = [];
...@@ -433,6 +432,15 @@ export default { ...@@ -433,6 +432,15 @@ export default {
message.warn('请输入私密点评评语', 1); message.warn('请输入私密点评评语', 1);
return; return;
} }
if (batchCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
batchCommentSubmiting: true,
},
});
const commonBatchReviewData = yield call(clockmgtajax.batchReview, newcommon); const commonBatchReviewData = yield call(clockmgtajax.batchReview, newcommon);
let batchBatchReviewData = null; let batchBatchReviewData = null;
let batchReviewDeleteData = null; let batchReviewDeleteData = null;
...@@ -486,7 +494,7 @@ export default { ...@@ -486,7 +494,7 @@ export default {
if (clock.review && clock.review[1]) { if (clock.review && clock.review[1]) {
singleCommentParams.common = { singleCommentParams.common = {
flag: clock.review[1].flag, flag: clock.review[1].flag,
content: clock.review[1].content, content: clock.review[1].content || '',
video: clock.review[1].video, video: clock.review[1].video,
audio: clock.review[1].audio, audio: clock.review[1].audio,
img: clock.review[1].img, img: clock.review[1].img,
...@@ -497,6 +505,20 @@ export default { ...@@ -497,6 +505,20 @@ export default {
school_id: clock.review[1].school_id, school_id: clock.review[1].school_id,
id: clock.review[1].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]) { if (clock.review && clock.review[2]) {
singleCommentParams.privite = { singleCommentParams.privite = {
...@@ -514,6 +536,19 @@ export default { ...@@ -514,6 +536,19 @@ export default {
}; };
newsinglePrivitecommentOpen = true; newsinglePrivitecommentOpen = true;
} else { } else {
singleCommentParams.privite = {
flag: '',
content: '',
video: '',
audio: '',
img: [],
score: 0,
status_type: 2,
record_ids: 0,
type: 2,
id: 0,
school_id: '',
};
newsinglePrivitecommentOpen = false; newsinglePrivitecommentOpen = false;
} }
yield put({ yield put({
...@@ -668,15 +703,6 @@ export default { ...@@ -668,15 +703,6 @@ export default {
}, },
* singleCommentPost({ payload }, { call, put, select }) { * singleCommentPost({ payload }, { call, put, select }) {
const { singleCommentParams, singlePrivitecommentOpen, singleCommentSubmiting } = yield select(state => state.clockmgt); const { singleCommentParams, singlePrivitecommentOpen, singleCommentSubmiting } = yield select(state => state.clockmgt);
if (singleCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
singleCommentSubmiting: true,
},
});
const { common, privite } = singleCommentParams; const { common, privite } = singleCommentParams;
const newcommon = JSON.parse(JSON.stringify(common)); const newcommon = JSON.parse(JSON.stringify(common));
newcommon.img = newcommon.img == '' ? '' : JSON.stringify(newcommon.img); newcommon.img = newcommon.img == '' ? '' : JSON.stringify(newcommon.img);
...@@ -698,6 +724,15 @@ export default { ...@@ -698,6 +724,15 @@ export default {
message.warn('请输入私密点评评语', 1); message.warn('请输入私密点评评语', 1);
return; return;
} }
if (singleCommentSubmiting) {
return;
}
yield put({
type: 'updateState',
payload: {
singleCommentSubmiting: true,
},
});
const commonBatchReviewData = yield call(clockmgtajax.batchReview, newcommon); const commonBatchReviewData = yield call(clockmgtajax.batchReview, newcommon);
let priviteReviewDeleteData = null; let priviteReviewDeleteData = null;
if (singlePrivitecommentOpen) { if (singlePrivitecommentOpen) {
...@@ -896,6 +931,15 @@ export default { ...@@ -896,6 +931,15 @@ export default {
} }
} }
}, },
* resetCheckedStatus({ payload }, { call, put, select }) {
yield put({
type: 'updateState',
payload: {
allClockSelected: false,
selectClockObj: { },
},
});
},
* unlockSubjectLocksSelect({ payload }, { call, put, select }) { * unlockSubjectLocksSelect({ payload }, { call, put, select }) {
const { lockid } = payload; const { lockid } = payload;
yield put({ yield put({
...@@ -1474,6 +1518,155 @@ export default { ...@@ -1474,6 +1518,155 @@ export default {
} }
setTimeout(uploaderLoading); 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: { reducers: {
save(state, action) { save(state, action) {
......
...@@ -18,6 +18,7 @@ import webappModel from './webapp'; ...@@ -18,6 +18,7 @@ import webappModel from './webapp';
import classmgtModel from './classmgt'; import classmgtModel from './classmgt';
import thememgtModel from './thememgt'; import thememgtModel from './thememgt';
import clockmgtModel from './clockmgt'; import clockmgtModel from './clockmgt';
import playaudioModel from './playaudio';
export default { export default {
loginModel, loginModel,
indexstaicModel, indexstaicModel,
...@@ -30,4 +31,5 @@ export default { ...@@ -30,4 +31,5 @@ export default {
classmgtModel, classmgtModel,
thememgtModel, thememgtModel,
clockmgtModel, 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 { ...@@ -129,8 +129,8 @@ export default {
endTime, endTime,
subjectType, subjectType,
} = yield select(state => state.thememgt); } = yield select(state => state.thememgt);
themeListSearchQuery.start_time = (startTime && `${startTime.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')} 00:00:00`) || ''; themeListSearchQuery.end_time = (endTime && `${endTime.format('YYYY-MM-DD')}`) || '';
themeListSearchQuery.subject_type = subjectType; themeListSearchQuery.subject_type = subjectType;
yield put({ yield put({
type: 'updateState', type: 'updateState',
...@@ -175,6 +175,32 @@ export default { ...@@ -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: { reducers: {
save(state, action) { save(state, action) {
......
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Table, Button, Rate, Input, Icon, Popover } from 'antd'; import { Table, Button, Rate, Input, Icon, Popover } from 'antd';
import pageStyle from './clockitem.less'; 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; const { TextArea } = Input;
class ClockItem extends React.Component { class ClockItem extends React.Component {
...@@ -16,7 +16,6 @@ class ClockItem extends React.Component { ...@@ -16,7 +16,6 @@ class ClockItem extends React.Component {
} }
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
} }
render() { render() {
const { const {
...@@ -26,6 +25,8 @@ class ClockItem extends React.Component { ...@@ -26,6 +25,8 @@ class ClockItem extends React.Component {
placeTop, placeTop,
delClock, delClock,
imgPreview, imgPreview,
playVideo,
playAudio,
} = this.props; } = this.props;
return ( return (
<div className={pageStyle.clockitem}> <div className={pageStyle.clockitem}>
...@@ -61,7 +62,7 @@ class ClockItem extends React.Component { ...@@ -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').length > 0 &&
JSON.parse(clock.video).filter(ele => ele.type == 'video').map((video) => { JSON.parse(clock.video).filter(ele => ele.type == 'video').map((video) => {
return ( 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="汪雪来" /> <img className={pageStyle.videoposter} src={videoPoster(video.src, 'image/resize,w_320/format,jpg/quality,q_50')} alt="汪雪来" />
<div className={pageStyle.playbox}> <div className={pageStyle.playbox}>
<Icon type="caret-right" /> <Icon type="caret-right" />
...@@ -74,13 +75,16 @@ class ClockItem extends React.Component { ...@@ -74,13 +75,16 @@ class ClockItem extends React.Component {
<div className={pageStyle.audiobox}> <div className={pageStyle.audiobox}>
{JSON.parse(clock.audio).map((audio) => { {JSON.parse(clock.audio).map((audio) => {
return ( return (
<div className={pageStyle.audioitem}> <audio className={pageStyle.audioitem} controls id={audio.src} src={audioorigin(audio.src)} />
<span>播放</span>
<span>{voiceTimeFormat(audio.duration)}</span>
</div>
); );
}) })
} }
{/*
<div className={pageStyle.audioitem} onClick={() => playAudio(audio)}>
<span>播放</span>
<span>{voiceTimeFormat(audio.duration)}</span>
</div>
*/}
</div> </div>
} }
<div className={pageStyle.operatebox}> <div className={pageStyle.operatebox}>
...@@ -104,12 +108,15 @@ class ClockItem extends React.Component { ...@@ -104,12 +108,15 @@ class ClockItem extends React.Component {
<span className={pageStyle.teachername}>老师点评:</span> <span className={pageStyle.teachername}>老师点评:</span>
<span className={pageStyle.teacherassesment}>{clock.review[1].content}</span> <span className={pageStyle.teacherassesment}>{clock.review[1].content}</span>
</div> </div>
{clock.review[1].audio && {clock.review[1].audio && clock.review[1].audio.length > 0 &&
<div className={pageStyle.teacheraudiobox}> <div className={pageStyle.teacheraudiobox}>
<div className={pageStyle.teacheraudio}> {/*
<div className={pageStyle.teacheraudio} onClick={() => playAudio(clock.review[1].audio)}>
<span>播放</span> <span>播放</span>
<span>{voiceTimeFormat(clock.review[1].audio).duration}</span> <span>{voiceTimeFormat(clock.review[1].audio.duration)}</span>
</div> </div>
*/}
<audio controls id={clock.review[1].audio.src} src={audioorigin(clock.review[1].audio.src)} />
</div> </div>
} }
{clock.review[1].img && clock.review[1].img.length > 0 && {clock.review[1].img && clock.review[1].img.length > 0 &&
...@@ -122,15 +129,18 @@ class ClockItem extends React.Component { ...@@ -122,15 +129,18 @@ class ClockItem extends React.Component {
{clock.review[2] && {clock.review[2] &&
<div className={pageStyle.teacherpriviteassesmentbox}> <div className={pageStyle.teacherpriviteassesmentbox}>
<div className={pageStyle.teacherassesmenttext}> <div className={pageStyle.teacherassesmenttext}>
<span className={pageStyle.teachername}>老师点评:</span> <span className={pageStyle.teachername}>私密点评:</span>
<span className={pageStyle.teacherassesment}>{clock.review[2].content}</span> <span className={pageStyle.teacherassesment}>{clock.review[2].content}</span>
</div> </div>
{clock.review[2].audio && {clock.review[2].audio && clock.review[2].audio.length > 0 &&
<div className={pageStyle.teacheraudiobox}> <div className={pageStyle.teacheraudiobox}>
<div className={pageStyle.teacheraudio}> {/*
<span>播放</span> <div className={pageStyle.teacheraudio} onClick={() => playAudio(clock.review[2].audio)}>
<span>{voiceTimeFormat(clock.review[2].audio.duration)}</span> <span>播放</span>
</div> <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>
} }
</div> </div>
......
...@@ -161,6 +161,9 @@ ...@@ -161,6 +161,9 @@
} }
.teacherpriviteassesmentbox { .teacherpriviteassesmentbox {
padding: 20px 40px 14px 49px; padding: 20px 40px 14px 49px;
.teacherassesmenttext {
margin-bottom: 14px;
}
.teacherimgbox { .teacherimgbox {
margin-bottom: 0; margin-bottom: 0;
.teacherimg { .teacherimg {
......
...@@ -37,7 +37,7 @@ class CommentEditorBox extends React.Component { ...@@ -37,7 +37,7 @@ class CommentEditorBox extends React.Component {
<Rate value={commentParams.common.score / 10} onChange={scoreChange} /> <Rate value={commentParams.common.score / 10} onChange={scoreChange} />
</div> </div>
<div className={pageStyle.textareabox}> <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>
<div className={pageStyle.shortwordbox}> <div className={pageStyle.shortwordbox}>
<div className={pageStyle.shortwordboxtitle}> <div className={pageStyle.shortwordboxtitle}>
...@@ -76,7 +76,7 @@ class CommentEditorBox extends React.Component { ...@@ -76,7 +76,7 @@ class CommentEditorBox extends React.Component {
</div> </div>
{privitecommentOpen && {privitecommentOpen &&
<div className={pageStyle.textareabox}> <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>
} }
</div> </div>
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Table, Row, Col, Icon, Form, Select, Input, Button, Tabs, Rate, Switch, Pagination, Drawer, Checkbox, Modal, Empty } from 'antd'; 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 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 CommentEditorBox from './commenteditorbox';
import ClockItem from './clockitem'; import ClockItem from './clockitem';
import ImagePreview from '../../components/ImagePreview'; import ImagePreview from '../../components/ImagePreview';
import VideoPlay from '../../components/VideoPlay';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { Option } = Select; const { Option } = Select;
const { TextArea } = Input; const { TextArea } = Input;
...@@ -16,6 +18,8 @@ class ClockMgt extends React.Component { ...@@ -16,6 +18,8 @@ class ClockMgt extends React.Component {
currentIndex: 0, currentIndex: 0,
urls: [], urls: [],
imgPreviewShow: false, imgPreviewShow: false,
videoPlayShow: false,
videoSrc: '',
}; };
} }
componentDidMount() { // 挂载 componentDidMount() { // 挂载
...@@ -24,6 +28,10 @@ class ClockMgt extends React.Component { ...@@ -24,6 +28,10 @@ class ClockMgt extends React.Component {
componentDidUpdate() { componentDidUpdate() {
} }
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
const { dispatch } = this.props;
dispatch({
type: 'clockmgt/initialpage',
});
} }
callback = () => { callback = () => {
} }
...@@ -32,6 +40,8 @@ class ClockMgt extends React.Component { ...@@ -32,6 +40,8 @@ class ClockMgt extends React.Component {
if (index == tabIndex) { if (index == tabIndex) {
return; return;
} }
this.closeCommentDrawer();
this.closeBatchCommentDrawer();
dispatch({ dispatch({
type: 'clockmgt/tabChange', type: 'clockmgt/tabChange',
payload: { payload: {
...@@ -79,6 +89,9 @@ class ClockMgt extends React.Component { ...@@ -79,6 +89,9 @@ class ClockMgt extends React.Component {
}, },
}, },
}); });
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
} }
tabBPageChange = (current, size) => { tabBPageChange = (current, size) => {
const { dispatch } = this.props; const { dispatch } = this.props;
...@@ -92,6 +105,9 @@ class ClockMgt extends React.Component { ...@@ -92,6 +105,9 @@ class ClockMgt extends React.Component {
}, },
}, },
}); });
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
} }
reviewTypeChange = (reviewtype) => { reviewTypeChange = (reviewtype) => {
const { dispatch } = this.props; const { dispatch } = this.props;
...@@ -105,6 +121,25 @@ class ClockMgt extends React.Component { ...@@ -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 = () => { resetsearch = () => {
const { dispatch } = this.props; const { dispatch } = this.props;
...@@ -114,6 +149,7 @@ class ClockMgt extends React.Component { ...@@ -114,6 +149,7 @@ class ClockMgt extends React.Component {
tabindex: 2, tabindex: 2,
params: { params: {
is_review: 0, is_review: 0,
sort_type: 2,
page: 1, page: 1,
}, },
}, },
...@@ -142,21 +178,31 @@ class ClockMgt extends React.Component { ...@@ -142,21 +178,31 @@ class ClockMgt extends React.Component {
} }
unlockSubjectLocksSelect = (lock) => { unlockSubjectLocksSelect = (lock) => {
const { dispatch } = this.props; const { dispatch } = this.props;
this.closeCommentDrawer();
this.closeBatchCommentDrawer();
dispatch({ dispatch({
type: 'clockmgt/unlockSubjectLocksSelect', type: 'clockmgt/unlockSubjectLocksSelect',
payload: { payload: {
lockid: lock.id, lockid: lock.id,
}, },
}); });
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
} }
calendarSelect = (day) => { calendarSelect = (day) => {
const { dispatch } = this.props; const { dispatch } = this.props;
this.closeCommentDrawer();
this.closeBatchCommentDrawer();
dispatch({ dispatch({
type: 'clockmgt/unlockSubjectLocksSelect', type: 'clockmgt/unlockSubjectLocksSelect',
payload: { payload: {
lockid: day.day, lockid: day.day,
}, },
}); });
dispatch({
type: 'clockmgt/resetCheckedStatus',
});
} }
quickScoreChange = (score) => { quickScoreChange = (score) => {
const { dispatch } = this.props; const { dispatch } = this.props;
...@@ -414,6 +460,26 @@ class ClockMgt extends React.Component { ...@@ -414,6 +460,26 @@ class ClockMgt extends React.Component {
imgPreviewShow: false, 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() { render() {
const { const {
themetype, themetype,
...@@ -446,6 +512,7 @@ class ClockMgt extends React.Component { ...@@ -446,6 +512,7 @@ class ClockMgt extends React.Component {
batchCommentSubmiting, batchCommentSubmiting,
quickCommentSubmiting, quickCommentSubmiting,
tabIndex, tabIndex,
audio,
} = this.props; } = this.props;
return ( return (
<div className={`${pageStyle.classmgtcontainer} clockmgtcontainer`}> <div className={`${pageStyle.classmgtcontainer} clockmgtcontainer`}>
...@@ -479,7 +546,7 @@ class ClockMgt extends React.Component { ...@@ -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.themeitem} ${selectId == ele.id ? pageStyle.themeitemselected : ''}`} onClick={() => this.unlockSubjectLocksSelect(ele)}>
<div className={pageStyle.themetitle}>{index + 1}</div> <div className={pageStyle.themetitle}>{index + 1}</div>
<div className={pageStyle.themetitle}>{ele.title}</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> </div>
); );
}) })
...@@ -500,6 +567,8 @@ class ClockMgt extends React.Component { ...@@ -500,6 +567,8 @@ class ClockMgt extends React.Component {
placeTop={this.placeTop} placeTop={this.placeTop}
delClock={this.delClock} delClock={this.delClock}
imgPreview={this.imgPreview} imgPreview={this.imgPreview}
playVideo={this.playVideo}
playAudio={this.playAudio}
/> />
))} ))}
</div> </div>
...@@ -546,11 +615,9 @@ class ClockMgt extends React.Component { ...@@ -546,11 +615,9 @@ class ClockMgt extends React.Component {
xl: { span: 24 }, xl: { span: 24 },
}} }}
> >
<Select> <Select value={tabBQueryClockListParasms.sort_type} onChange={this.sortTypeChange}>
<Option value="">全部</Option> <Option value={1}>时间升序</Option>
<Option value="1">作业模式</Option> <Option value={2}>时间降序</Option>
<Option value="2">日历类型</Option>
<Option value="3">闯关类型</Option>
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -580,6 +647,8 @@ class ClockMgt extends React.Component { ...@@ -580,6 +647,8 @@ class ClockMgt extends React.Component {
placeTop={this.placeTop} placeTop={this.placeTop}
delClock={this.delClock} delClock={this.delClock}
imgPreview={this.imgPreview} imgPreview={this.imgPreview}
playVideo={this.playVideo}
playAudio={this.playAudio}
/> />
</div> </div>
))} ))}
...@@ -626,6 +695,8 @@ class ClockMgt extends React.Component { ...@@ -626,6 +695,8 @@ class ClockMgt extends React.Component {
placeTop={this.placeTop} placeTop={this.placeTop}
delClock={this.delClock} delClock={this.delClock}
imgPreview={this.imgPreview} imgPreview={this.imgPreview}
playVideo={this.playVideo}
playAudio={this.playAudio}
/> />
} }
</div> </div>
...@@ -708,6 +779,12 @@ class ClockMgt extends React.Component { ...@@ -708,6 +779,12 @@ class ClockMgt extends React.Component {
closeImgPreview={this.closeImgPreview} closeImgPreview={this.closeImgPreview}
/> />
} }
{this.state.videoPlayShow &&
<VideoPlay
src={this.state.videoSrc}
closeVideoPlay={this.closeVideoPlay}
/>
}
</div> </div>
); );
} }
...@@ -751,6 +828,9 @@ function mapStateToProps(state) { ...@@ -751,6 +828,9 @@ function mapStateToProps(state) {
quickCommentSubmiting, quickCommentSubmiting,
tabIndex, tabIndex,
} = state.clockmgt; } = state.clockmgt;
const {
audio,
} = state.playaudio;
return { return {
themetype, themetype,
selectId, selectId,
...@@ -784,6 +864,7 @@ function mapStateToProps(state) { ...@@ -784,6 +864,7 @@ function mapStateToProps(state) {
batchCommentSubmiting, batchCommentSubmiting,
quickCommentSubmiting, quickCommentSubmiting,
tabIndex, tabIndex,
audio,
}; };
} }
export default connect(mapStateToProps)(ClockMgt); export default connect(mapStateToProps)(ClockMgt);
......
...@@ -30,17 +30,6 @@ class ThemeMgt extends React.Component { ...@@ -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) => { disabledEndDate = (endValue) => {
const { startTime } = this.props; const { startTime } = this.props;
if (!endValue || !startTime) { if (!endValue || !startTime) {
...@@ -55,14 +44,25 @@ class ThemeMgt extends React.Component { ...@@ -55,14 +44,25 @@ class ThemeMgt extends React.Component {
} }
return startValue.valueOf() > endTime.valueOf(); return startValue.valueOf() > endTime.valueOf();
} }
handleStartOpenChange = (open) => {
const { dispatch, startTime } = this.props;
// if (!open && startTime) {
// dispatch({
// type: 'thememgt/endopenchange',
// payload: {
// endOpen: true,
// },
// });
// }
};
handleEndOpenChange = (open) => { handleEndOpenChange = (open) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ // dispatch({
type: 'thememgt/endopenchange', // type: 'thememgt/endopenchange',
payload: { // payload: {
endOpen: open, // endOpen: open,
}, // },
}); // });
}; };
changePagination = (page, perPage) => { changePagination = (page, perPage) => {
const { dispatch } = this.props; const { dispatch } = this.props;
...@@ -119,6 +119,22 @@ class ThemeMgt extends React.Component { ...@@ -119,6 +119,22 @@ class ThemeMgt extends React.Component {
type: 'thememgt/resetsearch', 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() { render() {
const { const {
themeTotal, themeTotal,
...@@ -166,9 +182,9 @@ class ThemeMgt extends React.Component { ...@@ -166,9 +182,9 @@ class ThemeMgt extends React.Component {
key: 'clock_count', key: 'clock_count',
render: (text, record, index) => ( render: (text, record, index) => (
<div className={pageStyle.tablecell}> <div className={pageStyle.tablecell}>
{record.subject_type == 1 && record.clock_record_count} {record.subject_type == 1 && record.student_total}
{record.subject_type == 2 && record.all_record_count} {record.subject_type == 2 && record.student_total}
{record.subject_type == 3 && record.clock_people} {record.subject_type == 3 && record.class_students_count}
</div> </div>
), ),
}, },
...@@ -179,9 +195,9 @@ class ThemeMgt extends React.Component { ...@@ -179,9 +195,9 @@ class ThemeMgt extends React.Component {
key: 'clock_count', key: 'clock_count',
render: (text, record, index) => ( render: (text, record, index) => (
<div className={pageStyle.tablecell}> <div className={pageStyle.tablecell}>
{record.subject_type == 1 && record.clock_count} {record.subject_type == 1 && record.clock_record_count}
{record.subject_type == 2 && record.clock_count} {record.subject_type == 2 && record.clock_record_count}
{record.subject_type == 3 && record.unlock_clock_count} {record.subject_type == 3 && record.clock_people}
</div> </div>
), ),
}, },
...@@ -192,7 +208,11 @@ class ThemeMgt extends React.Component { ...@@ -192,7 +208,11 @@ class ThemeMgt extends React.Component {
key: 'clock_count', key: 'clock_count',
render: (text, record, index) => ( render: (text, record, index) => (
<div className={pageStyle.tablecell}> <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> </div>
), ),
}, },
...@@ -203,7 +223,9 @@ class ThemeMgt extends React.Component { ...@@ -203,7 +223,9 @@ class ThemeMgt extends React.Component {
key: 'clock_count', key: 'clock_count',
render: (text, record, index) => ( render: (text, record, index) => (
<div className={pageStyle.tablecell}> <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> </div>
), ),
}, },
...@@ -276,7 +298,6 @@ class ThemeMgt extends React.Component { ...@@ -276,7 +298,6 @@ class ThemeMgt extends React.Component {
format="YYYY-MM-DD" format="YYYY-MM-DD"
disabledDate={this.disabledEndDate} disabledDate={this.disabledEndDate}
onChange={this.onEndChange} onChange={this.onEndChange}
open={endOpen}
onOpenChange={this.handleEndOpenChange} onOpenChange={this.handleEndOpenChange}
value={endTime} value={endTime}
/> />
......
...@@ -570,7 +570,26 @@ function getBetweenDays(startDate, endDate) { ...@@ -570,7 +570,26 @@ function getBetweenDays(startDate, endDate) {
} }
return dateArr; 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 { export {
audioorigin,
videoorigin,
pageIn, pageIn,
SessionStorage, SessionStorage,
LocalStorage, LocalStorage,
......
...@@ -9,7 +9,7 @@ module.exports = { ...@@ -9,7 +9,7 @@ module.exports = {
'dva', 'dva',
'antd', 'antd',
'jquery', 'jquery',
'cropper', 'cropper'
], ],
}, },
output: { 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