Commit a096ee83 authored by wangtao's avatar wangtao

'最新代码提交'

parents 5a760857 a6321435
...@@ -18,5 +18,5 @@ ...@@ -18,5 +18,5 @@
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script type="text/javascript" src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.828990.js"></script></body> <script type="text/javascript" src="/dist/main.05bc89.js"></script></body>
</html> </html>
\ No newline at end of file
This diff is collapsed.
...@@ -1064,11 +1064,11 @@ export default { ...@@ -1064,11 +1064,11 @@ export default {
}); });
} }
if (pathname === '/sjd/newtheme') { if (pathname === '/sjd/newtheme') {
dispatch({ // dispatch({
type: 'createtheme/pageInit', // type: 'createtheme/pageInit',
payload: { // payload: {
}, // },
}); // });
dispatch({ dispatch({
type: 'createtheme/queryClassList', type: 'createtheme/queryClassList',
payload: { payload: {
......
...@@ -10,7 +10,6 @@ class Errorpage extends React.Component { ...@@ -10,7 +10,6 @@ class Errorpage extends React.Component {
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
} }
goback = () => { goback = () => {
console.log('dsadasdsa');
const { const {
dispatch, dispatch,
} = this.props; } = this.props;
......
import { connect } from 'dva'; import { connect } from 'dva';
import React from 'react'; import React from 'react';
import { Icon, Divider, Tabs, Select, Form, Upload, Row, Col, Input, Radio, Modal, message } from 'antd'; import { Icon, Divider, Tabs, Select, Form, Upload, Row, Col, Input, Radio, Modal, message, Progress } from 'antd';
import pageStyle from './ThemeEditor.less'; import pageStyle from './ThemeEditor.less';
import { pageIn, hasBtnPower, imagify, ossVideofy, audioorigin } from '../../utils/index'; import { pageIn, hasBtnPower, imagify, ossVideofy, audioorigin } from '../../utils/index';
const upImg = `${__IMGCDN__}subjectUp.png`; const upImg = `${__IMGCDN__}subjectUp.png`;
...@@ -45,9 +45,16 @@ class ThemeEditor extends React.Component { ...@@ -45,9 +45,16 @@ class ThemeEditor extends React.Component {
editorAddText, editorAddText,
moveContent, moveContent,
editorUploadVoice, editorUploadVoice,
progressRate,
} = this.props; } = this.props;
return ( return (
<div className={pageStyle.container}> <div className={pageStyle.container}>
{progressRate && progressRate > 0 ?
<div className={pageStyle.progressWrap}>
<Progress width={150} type="circle" percent={progressRate} />
<p> {progressRate == 100 ? '上传成功' : '上传中。。。'}</p>
</div> : ''
}
<div className={pageStyle.editorwrap}> <div className={pageStyle.editorwrap}>
{/* eslint-disable-next-line array-callback-return,consistent-return */} {/* eslint-disable-next-line array-callback-return,consistent-return */}
{commentParams.content.length > 0 && commentParams.content.map((item, index) => { {commentParams.content.length > 0 && commentParams.content.map((item, index) => {
...@@ -124,6 +131,7 @@ class ThemeEditor extends React.Component { ...@@ -124,6 +131,7 @@ class ThemeEditor extends React.Component {
<div className={pageStyle.uploadimg}><input type="file" id="uploadVoice" className={pageStyle.fileuploadinput} onChange={editorUploadVoice} accept="audio/mp3" /><Icon style={{ marginRight: 10 }} type="audio" />添加录音</div> <div className={pageStyle.uploadimg}><input type="file" id="uploadVoice" className={pageStyle.fileuploadinput} onChange={editorUploadVoice} accept="audio/mp3" /><Icon style={{ marginRight: 10 }} type="audio" />添加录音</div>
<div className={pageStyle.uploadimg}><input type="file" id="uploadVideo" className={pageStyle.fileuploadinput} onChange={editorUploadAudio} accept="video/mp4,video/*" /><Icon style={{ marginRight: 10 }} type="video-camera" />添加视频</div> <div className={pageStyle.uploadimg}><input type="file" id="uploadVideo" className={pageStyle.fileuploadinput} onChange={editorUploadAudio} accept="video/mp4,video/*" /><Icon style={{ marginRight: 10 }} type="video-camera" />添加视频</div>
</div> </div>
<p className={pageStyle.tip}>请上传视频小于1G,支持MP4格式</p>
<Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}> <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
<img alt="图片" style={{ width: '100%' }} src={imagify(previewImage)} /> <img alt="图片" style={{ width: '100%' }} src={imagify(previewImage)} />
</Modal> </Modal>
......
...@@ -182,3 +182,28 @@ ...@@ -182,3 +182,28 @@
z-index: 1; z-index: 1;
} }
} }
.progressWrap {
width: 300px;
height: 300px;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #f1f1f1;
border-radius: 15px;
z-index: 9999;
&>p {
font-size: 18px;
margin-top: 30px;
color: #1e8bff;
}
}
.tip {
color: #888;
margin-top: 8px;
line-height: 20px;
}
\ No newline at end of file
...@@ -137,6 +137,14 @@ class CalendarClockForm extends React.Component { ...@@ -137,6 +137,14 @@ class CalendarClockForm extends React.Component {
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadVideoCalendar', uploadtype: 'uploadVideoCalendar',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
}, },
}); });
} }
...@@ -262,6 +270,7 @@ class CalendarClockForm extends React.Component { ...@@ -262,6 +270,7 @@ class CalendarClockForm extends React.Component {
currentTimestamp, currentTimestamp,
selectPlanDays, selectPlanDays,
isCopy, isCopy,
progressRate,
} = this.props; } = this.props;
let new_rest_dates = []; let new_rest_dates = [];
new_rest_dates = [...new Set(new_rest_dates.concat(...rest_dates))]; new_rest_dates = [...new Set(new_rest_dates.concat(...rest_dates))];
...@@ -632,6 +641,7 @@ class CalendarClockForm extends React.Component { ...@@ -632,6 +641,7 @@ class CalendarClockForm extends React.Component {
deleteThemeImg={this.deleteCalendarImg} deleteThemeImg={this.deleteCalendarImg}
editorAddText={this.calendarAddText} editorAddText={this.calendarAddText}
moveContent={this.calendarMoveContent} moveContent={this.calendarMoveContent}
progressRate={progressRate}
/> />
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}> <FormItem {...submitFormLayout} style={{ marginTop: 32 }}>
<Button type="primary" htmlType="submit" loading={themeAddLoading}> <Button type="primary" htmlType="submit" loading={themeAddLoading}>
...@@ -659,6 +669,7 @@ function mapStateToProps(state) { ...@@ -659,6 +669,7 @@ function mapStateToProps(state) {
currentTimestamp, currentTimestamp,
selectPlanDays, selectPlanDays,
isCopy, isCopy,
progressRate,
} = state.createtheme; } = state.createtheme;
return { return {
themeAddLoading, themeAddLoading,
...@@ -671,6 +682,7 @@ function mapStateToProps(state) { ...@@ -671,6 +682,7 @@ function mapStateToProps(state) {
currentTimestamp, currentTimestamp,
selectPlanDays, selectPlanDays,
isCopy, isCopy,
progressRate,
}; };
} }
export default connect(mapStateToProps)(CalendarClock); export default connect(mapStateToProps)(CalendarClock);
......
...@@ -103,6 +103,14 @@ class ContentSettingForm extends React.Component { ...@@ -103,6 +103,14 @@ class ContentSettingForm extends React.Component {
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadVideoEmigrate', uploadtype: 'uploadVideoEmigrate',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
}, },
}); });
} }
...@@ -233,6 +241,7 @@ class ContentSettingForm extends React.Component { ...@@ -233,6 +241,7 @@ class ContentSettingForm extends React.Component {
screenIsBig, screenIsBig,
isShowCustoms, isShowCustoms,
subjectList, subjectList,
progressRate,
} = this.props; } = this.props;
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
...@@ -330,6 +339,7 @@ class ContentSettingForm extends React.Component { ...@@ -330,6 +339,7 @@ class ContentSettingForm extends React.Component {
editorUploadAudio={this.emigrateUploadAudio} editorUploadAudio={this.emigrateUploadAudio}
editorChange={this.changeEmigrateText} editorChange={this.changeEmigrateText}
deleteThemeImg={this.deleteEmigrate} deleteThemeImg={this.deleteEmigrate}
progressRate={progressRate}
/> />
</div> </div>
</FormItem> </FormItem>
...@@ -488,6 +498,7 @@ function mapStateToProps(state) { ...@@ -488,6 +498,7 @@ function mapStateToProps(state) {
customsNumberList, customsNumberList,
isShowCustoms, isShowCustoms,
subjectList, subjectList,
progressRate,
} = state.createtheme; } = state.createtheme;
const { collapsed, screenIsBig } = state.webapp; const { collapsed, screenIsBig } = state.webapp;
return { return {
...@@ -502,6 +513,7 @@ function mapStateToProps(state) { ...@@ -502,6 +513,7 @@ function mapStateToProps(state) {
screenIsBig, screenIsBig,
isShowCustoms, isShowCustoms,
subjectList, subjectList,
progressRate,
}; };
} }
export default connect(mapStateToProps)(ContentSetting); export default connect(mapStateToProps)(ContentSetting);
......
...@@ -15,11 +15,12 @@ import { ...@@ -15,11 +15,12 @@ import {
Collapse, Collapse,
DatePicker, DatePicker,
Select, Radio, InputNumber, Input, message, Select, Radio, InputNumber, Input, message,
Progress,
} from 'antd'; } from 'antd';
import moment from 'moment'; import moment from 'moment';
import pageStyle from './Unclock.less'; import pageStyle from './Unclock.less';
import { hasBtnPower, imagify } from '../../../utils'; import { hasBtnPower, imagify } from '../../../utils/index';
import ThemeEditor from '../ThemeEditor'; import ThemeEditorOne from './components/ThemeEditor';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const FormItem = Form.Item; const FormItem = Form.Item;
const { Option } = Select; const { Option } = Select;
...@@ -139,37 +140,48 @@ class UnClockForm extends React.Component { ...@@ -139,37 +140,48 @@ class UnClockForm extends React.Component {
}, },
}); });
} }
customsUploadImg = (e) => { customsUploadImg = (e, sort) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'createtheme/queryimagesignature', type: 'createtheme/queryimagesignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'quickCustomsImg', uploadtype: 'quickCustomsImg',
contentSort: sort,
}, },
}); });
} }
customsUploadAudio = (e) => { customsUploadAudio = (e, sort) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'createtheme/queryvideosignature', type: 'createtheme/queryvideosignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadVideoCustoms', uploadtype: 'uploadVideoCustoms',
contentSort: sort,
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
}, },
}); });
} }
customsUploadVoice = (e) => { customsUploadVoice = (e, sort) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'createtheme/queryvoicesignature', type: 'createtheme/queryvoicesignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadVoiceCustoms', uploadtype: 'uploadVoiceCustoms',
contentSort: sort,
}, },
}); });
} }
customsChangeSize = (e, index) => { customsChangeSize = (e, index, sort) => {
const { dispatch } = this.props; const { dispatch } = this.props;
const textValue = e.target.value; const textValue = e.target.value;
if (textValue.length > 500) { if (textValue.length > 500) {
...@@ -181,36 +193,72 @@ class UnClockForm extends React.Component { ...@@ -181,36 +193,72 @@ class UnClockForm extends React.Component {
payload: { payload: {
textValue, textValue,
index, index,
sort,
},
});
}
customsChangeTitle = (e, sort) => {
const { dispatch } = this.props;
const textValue = e.target.value;
if (textValue.length > 20) {
message.warning('最多20字', 0.5);
return;
}
dispatch({
type: 'createtheme/customsChangeTitle',
payload: {
textValue,
sort,
}, },
}); });
} }
deleteCustomsImg = (index) => { deleteCustomsImg = (index, sort) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'createtheme/deleteCustomsImg', type: 'createtheme/deleteCustomsImg',
payload: { payload: {
index, index,
sort,
}, },
}); });
} }
customsAddText = () => { customsAddText = (index) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'createtheme/changeCustomsText', type: 'createtheme/changeCustomsText',
payload: {
index,
},
});
}
customsAddPlate = () => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/customsAddPlate',
payload: { payload: {
}, },
}); });
} }
customsMoveContent = (index, direction) => { customsMoveContent = (index, sort, direction) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'createtheme/customsMoveContent', type: 'createtheme/customsMoveContent',
payload: { payload: {
index, index,
sort,
direction, direction,
}, },
}); });
} }
customsDeletePlate = (sort) => {
const { dispatch } = this.props;
dispatch({
type: 'createtheme/customsDeletePlate',
payload: {
sort,
},
});
}
uploadBanner = (e) => { uploadBanner = (e) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
...@@ -249,6 +297,7 @@ class UnClockForm extends React.Component { ...@@ -249,6 +297,7 @@ class UnClockForm extends React.Component {
radioList, radioList,
collapsed, collapsed,
screenIsBig, screenIsBig,
progressRate,
} = this.props; } = this.props;
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
...@@ -480,7 +529,7 @@ class UnClockForm extends React.Component { ...@@ -480,7 +529,7 @@ class UnClockForm extends React.Component {
</FormItem> </FormItem>
<FormItem {...formItemModaltypeLayout} label="闯关介绍"> <FormItem {...formItemModaltypeLayout} label="闯关介绍">
<div className={pageStyle.introduceWrap}> <div className={pageStyle.introduceWrap}>
<ThemeEditor <ThemeEditorOne
commentParams={customsParams} commentParams={customsParams}
editorUploadImg={this.customsUploadImg} editorUploadImg={this.customsUploadImg}
editorUploadAudio={this.customsUploadAudio} editorUploadAudio={this.customsUploadAudio}
...@@ -489,6 +538,10 @@ class UnClockForm extends React.Component { ...@@ -489,6 +538,10 @@ class UnClockForm extends React.Component {
deleteThemeImg={this.deleteCustomsImg} deleteThemeImg={this.deleteCustomsImg}
moveContent={this.customsMoveContent} moveContent={this.customsMoveContent}
editorAddText={this.customsAddText} editorAddText={this.customsAddText}
editorAddPlate={this.customsAddPlate}
editorChangeTitle={this.customsChangeTitle}
editorDeletePlate={this.customsDeletePlate}
progressRate={progressRate}
/> />
</div> </div>
</FormItem> </FormItem>
...@@ -533,6 +586,7 @@ function mapStateToProps(state) { ...@@ -533,6 +586,7 @@ function mapStateToProps(state) {
customsParams, customsParams,
radioname, radioname,
radioList, radioList,
progressRate,
} = state.createtheme; } = state.createtheme;
const { collapsed, screenIsBig } = state.webapp; const { collapsed, screenIsBig } = state.webapp;
return { return {
...@@ -543,6 +597,7 @@ function mapStateToProps(state) { ...@@ -543,6 +597,7 @@ function mapStateToProps(state) {
radioList, radioList,
collapsed, collapsed,
screenIsBig, screenIsBig,
progressRate,
}; };
} }
export default connect(mapStateToProps)(UnClock); export default connect(mapStateToProps)(UnClock);
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
.introduceWrap { .introduceWrap {
width: 650px; width: 650px;
min-height: 319px; min-height: 319px;
padding: 0 40px 126px; padding:20px;
background-color: #fafafa; background-color: #fafafa;
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
......
...@@ -103,6 +103,14 @@ class UnclockDetailForm extends React.Component { ...@@ -103,6 +103,14 @@ class UnclockDetailForm extends React.Component {
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadVideoEmigrate', uploadtype: 'uploadVideoEmigrate',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
}, },
}); });
} }
...@@ -204,6 +212,7 @@ class UnclockDetailForm extends React.Component { ...@@ -204,6 +212,7 @@ class UnclockDetailForm extends React.Component {
collapsed, collapsed,
screenIsBig, screenIsBig,
emigratedObj, emigratedObj,
progressRate,
} = this.props; } = this.props;
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
...@@ -284,6 +293,7 @@ class UnclockDetailForm extends React.Component { ...@@ -284,6 +293,7 @@ class UnclockDetailForm extends React.Component {
editorUploadAudio={this.emigrateUploadAudio} editorUploadAudio={this.emigrateUploadAudio}
editorChange={this.changeEmigrateText} editorChange={this.changeEmigrateText}
deleteThemeImg={this.deleteEmigrate} deleteThemeImg={this.deleteEmigrate}
progressRate={progressRate}
/> />
</div> </div>
</FormItem> </FormItem>
...@@ -434,6 +444,7 @@ function mapStateToProps(state) { ...@@ -434,6 +444,7 @@ function mapStateToProps(state) {
emigratedObj, emigratedObj,
releaseLoading, releaseLoading,
customsNumberList, customsNumberList,
progressRate,
} = state.createtheme; } = state.createtheme;
const { collapsed, screenIsBig } = state.webapp; const { collapsed, screenIsBig } = state.webapp;
return { return {
...@@ -444,6 +455,7 @@ function mapStateToProps(state) { ...@@ -444,6 +455,7 @@ function mapStateToProps(state) {
customsNumberList, customsNumberList,
collapsed, collapsed,
screenIsBig, screenIsBig,
progressRate,
}; };
} }
export default connect(mapStateToProps)(UnclockDetail); export default connect(mapStateToProps)(UnclockDetail);
......
...@@ -99,6 +99,14 @@ class UnclockDetailForm extends React.Component { ...@@ -99,6 +99,14 @@ class UnclockDetailForm extends React.Component {
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadVideoEmigrate', uploadtype: 'uploadVideoEmigrate',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
}, },
}); });
} }
...@@ -192,6 +200,7 @@ class UnclockDetailForm extends React.Component { ...@@ -192,6 +200,7 @@ class UnclockDetailForm extends React.Component {
collapsed, collapsed,
screenIsBig, screenIsBig,
emigratedObj, emigratedObj,
progressRate,
} = this.props; } = this.props;
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
...@@ -256,6 +265,7 @@ class UnclockDetailForm extends React.Component { ...@@ -256,6 +265,7 @@ class UnclockDetailForm extends React.Component {
editorUploadAudio={this.emigrateUploadAudio} editorUploadAudio={this.emigrateUploadAudio}
editorChange={this.changeEmigrateText} editorChange={this.changeEmigrateText}
deleteThemeImg={this.deleteEmigrate} deleteThemeImg={this.deleteEmigrate}
progressRate={progressRate}
/> />
</div> </div>
</FormItem> </FormItem>
...@@ -406,6 +416,7 @@ function mapStateToProps(state) { ...@@ -406,6 +416,7 @@ function mapStateToProps(state) {
emigratedObj, emigratedObj,
releaseLoading, releaseLoading,
customsNumberList, customsNumberList,
progressRate,
} = state.createtheme; } = state.createtheme;
const { collapsed, screenIsBig } = state.webapp; const { collapsed, screenIsBig } = state.webapp;
return { return {
...@@ -416,6 +427,7 @@ function mapStateToProps(state) { ...@@ -416,6 +427,7 @@ function mapStateToProps(state) {
customsNumberList, customsNumberList,
collapsed, collapsed,
screenIsBig, screenIsBig,
progressRate,
}; };
} }
export default connect(mapStateToProps)(UnclockDetail); export default connect(mapStateToProps)(UnclockDetail);
......
This diff is collapsed.
.textWrap {
width: 560px;
height: auto;
position: relative;
margin-bottom:10px;
:global {
.ant-input {
padding: 6px 15px 20px;
}
}
.sizeNumber {
position: absolute;
bottom: 8px;
right: 10px;
}
}
.editorwrap {
//width: 563px;
margin-top: 15px;
.videowrap {
width: 100%;
height: 200px;
position: relative;
margin-bottom: 10px;
.videoPoster {
width: 100%;
height: 100%;
}
}
.videowrap:hover {
cursor: pointer;
.videohide {
opacity: 1;
background-color: rgba(0,0,0,0.5);
transition: all .3s;
z-index: 1;
color: #fff;
}
}
.videohide {
position: absolute;
width: 100%;
height: 100%;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
color: #fff;
z-index: -1;
a {
color: #fff;
}
}
.uploadimgbox {
display: flex;
align-items: flex-end;
margin-bottom: 18px;
flex-wrap: wrap;
.imgwrap {
width: 100%;
// height: 120px;
border-radius: 4px;
margin-right: 6px;
position: relative;
.uploadimgwrap {
width: 100%;
// height: 120px;
overflow: hidden;
}
}
.imgwrap:hover {
cursor: pointer;
.imghide {
opacity: 1;
background-color: rgba(0,0,0,0.5);
transition: all .3s;
z-index: 1;
color: #fff;
}
}
.imghide {
position: absolute;
width: 100%;
height: 100%;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
color: #fff;
z-index: -1;
a {
color: #fff;
}
}
.teacheruploadimg {
object-fit: contain;
border-radius: 4px;
width: 100%;
}
.teacheruploadimg:nth-child(4n){
margin-right: 0;
}
}
}
.uploadflex {
display: flex;
align-items: center;
margin-top: 20px;
.uploadimg {
cursor: pointer;
width: 106px;
height: 32px;
line-height: 32px;
text-align: center;
border: 1px solid #D9D9D9;
border-radius: 4px;
color: rgba(0,0,0,0.65);
position: relative;
margin-right: 30px;
.fileuploadinput {
cursor: pointer;
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
opacity: 0;
left: 0;
top: 0;
}
}
}
.toolList {
position: absolute;
right: -30px;
top: 0;
width: 30px;
height: 90px;
display: flex;
flex-direction: column;
background-color: #D3D3D3;
opacity: 0;
border-radius: 2px;
z-index: -1;
div {
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 14px;
cursor: pointer;
}
div>img {
width: 14px;
height: 14px;
}
.up:hover {
background-color: #1890FF;
}
.down,.nodown {
transform: rotate(180deg);
}
.nodown,.noup {
cursor: not-allowed;
}
.down:hover {
background-color: #1890FF;
}
.delete:hover {
background-color: #FF6060;
}
}
.textWrap:hover,.imgwrap:hover,.videowrap:hover {
.toolList {
opacity: 1;
z-index: 1;
}
}
.addPlate {
width: 214px;
height: 34px;
line-height: 34px;
text-align: center;
color: #65B8F4;
border: 1px solid #65B8F4;
border-radius: 17px;
margin: 40px auto 0;
cursor: pointer;
}
.plateWrap {
border:2px dashed rgba(208,208,208,1);
padding: 20px;
margin-bottom: 30px;
position: relative;
}
.plateDelete {
position: absolute;
right: -20px;
top: -25px;
font-size: 30px;
color: #FF6060;
cursor: pointer;
}
.progressWrap {
width: 300px;
height: 300px;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #f1f1f1;
border-radius: 15px;
z-index: 9999;
&>p {
font-size: 18px;
margin-top: 30px;
color: #1e8bff;
}
}
\ No newline at end of file
...@@ -118,6 +118,14 @@ class JobClockForm extends React.Component { ...@@ -118,6 +118,14 @@ class JobClockForm extends React.Component {
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadVideoJob', uploadtype: 'uploadVideoJob',
progressCallBack(res) {
dispatch({
type: 'createtheme/updateState',
payload: {
progressRate: ((res.loaded / res.total) * 100).toFixed(0),
},
});
},
}, },
}); });
} }
...@@ -205,6 +213,7 @@ class JobClockForm extends React.Component { ...@@ -205,6 +213,7 @@ class JobClockForm extends React.Component {
jobParams, jobParams,
editorText, editorText,
isCopy, isCopy,
progressRate,
} = this.props; } = this.props;
const formItemModalLineLayout = { const formItemModalLineLayout = {
labelCol: { labelCol: {
...@@ -469,6 +478,7 @@ class JobClockForm extends React.Component { ...@@ -469,6 +478,7 @@ class JobClockForm extends React.Component {
deleteThemeImg={this.deleteJobImg} deleteThemeImg={this.deleteJobImg}
moveContent={this.jobMoveContent} moveContent={this.jobMoveContent}
editorAddText={this.jobAddText} editorAddText={this.jobAddText}
progressRate={progressRate}
/> />
<FormItem {...submitFormLayout} style={{ marginTop: 32 }}> <FormItem {...submitFormLayout} style={{ marginTop: 32 }}>
<Button type="primary" htmlType="submit" loading={themeAddLoading}> <Button type="primary" htmlType="submit" loading={themeAddLoading}>
...@@ -491,6 +501,7 @@ function mapStateToProps(state) { ...@@ -491,6 +501,7 @@ function mapStateToProps(state) {
jobParams, jobParams,
editorText, editorText,
isCopy, isCopy,
progressRate,
} = state.createtheme; } = state.createtheme;
return { return {
themeAddLoading, themeAddLoading,
...@@ -498,6 +509,7 @@ function mapStateToProps(state) { ...@@ -498,6 +509,7 @@ function mapStateToProps(state) {
jobParams, jobParams,
editorText, editorText,
isCopy, isCopy,
progressRate,
}; };
} }
export default connect(mapStateToProps)(JobClock); export default connect(mapStateToProps)(JobClock);
......
...@@ -272,14 +272,12 @@ class ThemeMgt extends React.Component { ...@@ -272,14 +272,12 @@ class ThemeMgt extends React.Component {
}, },
{ {
title: '打卡人数', title: '打卡人数',
dataIndex: 'clock_count', dataIndex: 'clock_student_count',
align: 'center', align: 'center',
key: 'student_total', key: 'clock_student_count',
render: (text, record, index) => ( render: (text, record, index) => (
<div className={pageStyle.tablecell}> <div className={pageStyle.tablecell}>
{record.subject_type == 1 && record.student_total} {text}
{record.subject_type == 2 && record.student_total}
{record.subject_type == 3 && record.class_students_count}
</div> </div>
), ),
}, },
......
...@@ -27,7 +27,7 @@ export function uploadVideoSignature({ type, token, schoolId }) { ...@@ -27,7 +27,7 @@ export function uploadVideoSignature({ type, token, schoolId }) {
}); });
} }
export function uploadVideo(params) { export function uploadVideo(params, progressCallback) {
const { const {
OSSAccessKeyId, OSSAccessKeyId,
file, file,
...@@ -35,12 +35,17 @@ export function uploadVideo(params) { ...@@ -35,12 +35,17 @@ export function uploadVideo(params) {
policy, policy,
signature, signature,
url, url,
callback,
} = params; } = params;
const formData = new FormData(); const formData = new FormData();
formData.append('key', key); formData.append('key', key);
formData.append('policy', policy); formData.append('policy', policy);
formData.append('OSSAccessKeyId', OSSAccessKeyId); formData.append('OSSAccessKeyId', OSSAccessKeyId);
formData.append('signature', signature); formData.append('signature', signature);
if (callback) {
formData.append('callback', callback);
}
formData.append('success_action_status', 200);
formData.append('file', file); formData.append('file', file);
return request({ return request({
url: params.url, url: params.url,
...@@ -50,6 +55,16 @@ export function uploadVideo(params) { ...@@ -50,6 +55,16 @@ export function uploadVideo(params) {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
}, },
data: formData, data: formData,
retry: 0,
onUploadProgress(progressEvent) { // 原生获取上传进度的事件
if (progressEvent.lengthComputable) {
// 属性lengthComputable主要表明总共需要完成的工作量和已经完成的工作是否可以被测量
// 如果lengthComputable为false,就获取不到progressEvent.total和progressEvent.loaded
if (progressCallback && (typeof progressCallback == 'function')) {
progressCallback(progressEvent);
}
}
},
}); });
} }
export function uploadImageSignature({ type, token, schoolId }) { export function uploadImageSignature({ type, token, schoolId }) {
......
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