Commit 82702b22 authored by baixian's avatar baixian

ERP oss上传修改

parent 60ea4b07
...@@ -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="/dist/main.4bc31f.js"></script></body> <script type="text/javascript" src="/dist/main.98a3f4.js"></script></body>
</html> </html>
\ No newline at end of file
...@@ -162,6 +162,28 @@ export default { ...@@ -162,6 +162,28 @@ export default {
schoolIntroStatus: false, // 学校介绍保存状态 schoolIntroStatus: false, // 学校介绍保存状态
teachers: [], // 名师风采 teachers: [], // 名师风采
teacherStatus: false, // 名师保存状态 teacherStatus: false, // 名师保存状态
avatorUploaderDefault: { // 裁剪不限制
maxsize: 8192, // 奖品图片最大尺寸KBcropper: {
cropper: {
croppered_params: [], // 图片裁剪后的参数
config: {
dragMode: 'move',
viewMode: 1,
aspectRatio: NaN,
autoCropArea: 0.8,
guides: !1,
center: !0,
highlight: !1,
dragCrop: !1,
cropBoxMovable: !0,
cropBoxResizable: !0,
zoom: -0.2,
checkImageOrigin: !0,
background: !1,
rotatable: !0,
},
},
},
}, },
subscriptions: { subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line setup({ dispatch, history }) { // eslint-disable-line
...@@ -277,7 +299,6 @@ export default { ...@@ -277,7 +299,6 @@ export default {
if (!schoolDetail.data) { if (!schoolDetail.data) {
const orgschoolDetail = yield call(officialwebajax.memberSchooldetail, { school_id: sid }); const orgschoolDetail = yield call(officialwebajax.memberSchooldetail, { school_id: sid });
if (orgschoolDetail.code == 200) { if (orgschoolDetail.code == 200) {
console.log(orgschoolDetail, 'orgschoolDetail111');
newpageInfo.forEach((ele) => { newpageInfo.forEach((ele) => {
const element = ele; const element = ele;
if (element.type == 'schoolinfo') { if (element.type == 'schoolinfo') {
...@@ -450,7 +471,7 @@ export default { ...@@ -450,7 +471,7 @@ export default {
newpageInfo.forEach((ele) => { newpageInfo.forEach((ele) => {
const element = ele; const element = ele;
if (element.type == 'teacher') { if (element.type == 'teacher') {
element.data = teacherData.data.list.slice(0, 2); element.data = teacherData.data.list.slice(0, 4);
} }
}); });
newTeacherData = teacherData.data.list; newTeacherData = teacherData.data.list;
...@@ -2283,6 +2304,28 @@ export default { ...@@ -2283,6 +2304,28 @@ export default {
schoolIntroStatus: false, // 学校介绍保存状态 schoolIntroStatus: false, // 学校介绍保存状态
teachers: [], // 名师风采 teachers: [], // 名师风采
teacherStatus: false, // 名师保存状态 teacherStatus: false, // 名师保存状态
avatorUploaderDefault: { // 裁剪不限制
maxsize: 8192, // 奖品图片最大尺寸KBcropper: {
cropper: {
croppered_params: [], // 图片裁剪后的参数
config: {
dragMode: 'move',
viewMode: 1,
aspectRatio: NaN,
autoCropArea: 0.8,
guides: !1,
center: !0,
highlight: !1,
dragCrop: !1,
cropBoxMovable: !0,
cropBoxResizable: !0,
zoom: -0.2,
checkImageOrigin: !0,
background: !1,
rotatable: !0,
},
},
},
}, },
}); });
}, },
......
...@@ -129,10 +129,10 @@ class Officialweb extends React.Component { ...@@ -129,10 +129,10 @@ class Officialweb extends React.Component {
schoolInfo, schoolInfo,
collapsed, collapsed,
screenIsBig, screenIsBig,
avatorUploaderDefault,
} = this.props; } = this.props;
let renderDom; let renderDom;
const newPageInfo = pageInfo; const newPageInfo = pageInfo;
console.log(newPageInfo, 'newPageInfo');
const qrcodeBox = ( const qrcodeBox = (
<div> <div>
<img className={pageStyle.qrcodebox} src={imagify(previewQrcode)} alt="" /> <img className={pageStyle.qrcodebox} src={imagify(previewQrcode)} alt="" />
...@@ -180,7 +180,10 @@ class Officialweb extends React.Component { ...@@ -180,7 +180,10 @@ class Officialweb extends React.Component {
</div> </div>
{moduleSelect == index && {moduleSelect == index &&
<div className={pageStyle.editbox}> <div className={pageStyle.editbox}>
<BannerEditor banner={ele.data} /> <BannerEditor
banner={ele.data}
avatorUploaderDefault={avatorUploaderDefault}
/>
</div> </div>
} }
</div> </div>
...@@ -211,7 +214,9 @@ class Officialweb extends React.Component { ...@@ -211,7 +214,9 @@ class Officialweb extends React.Component {
} }
{moduleSelect == index && {moduleSelect == index &&
<div className={pageStyle.editbox}> <div className={pageStyle.editbox}>
<AdCarouselEditor /> <AdCarouselEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div> </div>
} }
</div> </div>
...@@ -242,7 +247,9 @@ class Officialweb extends React.Component { ...@@ -242,7 +247,9 @@ class Officialweb extends React.Component {
} }
{moduleSelect == index && {moduleSelect == index &&
<div className={pageStyle.editbox}> <div className={pageStyle.editbox}>
<SchoolIntroEditor /> <SchoolIntroEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div> </div>
} }
</div> </div>
...@@ -273,7 +280,9 @@ class Officialweb extends React.Component { ...@@ -273,7 +280,9 @@ class Officialweb extends React.Component {
} }
{moduleSelect == index && {moduleSelect == index &&
<div className={pageStyle.editbox}> <div className={pageStyle.editbox}>
<TeacherEditor /> <TeacherEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div> </div>
} }
</div> </div>
...@@ -330,7 +339,9 @@ class Officialweb extends React.Component { ...@@ -330,7 +339,9 @@ class Officialweb extends React.Component {
} }
{moduleSelect == index && {moduleSelect == index &&
<div className={pageStyle.editbox}> <div className={pageStyle.editbox}>
<ClassMomentsEditor /> <ClassMomentsEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div> </div>
} }
</div> </div>
...@@ -461,6 +472,7 @@ function mapStateToProps(state) { ...@@ -461,6 +472,7 @@ function mapStateToProps(state) {
course, course,
coursePostStatus, coursePostStatus,
schoolInfo, schoolInfo,
avatorUploaderDefault,
} = state.officialweb; } = state.officialweb;
const { const {
cropperboxShow, cropperboxShow,
...@@ -482,6 +494,7 @@ function mapStateToProps(state) { ...@@ -482,6 +494,7 @@ function mapStateToProps(state) {
schoolInfo, schoolInfo,
collapsed, collapsed,
screenIsBig, screenIsBig,
avatorUploaderDefault,
}; };
} }
export default connect(mapStateToProps)(Officialweb); export default connect(mapStateToProps)(Officialweb);
......
...@@ -272,9 +272,9 @@ class Officialweb extends React.Component { ...@@ -272,9 +272,9 @@ class Officialweb extends React.Component {
<Button type="primary" onClick={this.editor} className={pageStyle.editBtn}>装修主页</Button> <Button type="primary" onClick={this.editor} className={pageStyle.editBtn}>装修主页</Button>
</BtnPermission> </BtnPermission>
} }
<BtnPermission btnId="80001"> {/* <BtnPermission btnId="80001"> */}
<Button type="primary" onClick={this.editThemeClass} className={pageStyle.editBtn} style={{ marginLeft: 30 }}>装修主题课</Button> {/* <Button type="primary" onClick={this.editThemeClass} className={pageStyle.editBtn} style={{ marginLeft: 30 }}>装修主题课</Button> */}
</BtnPermission> {/* </BtnPermission> */}
<div className={pageStyle.websiteeditdesc}> <div className={pageStyle.websiteeditdesc}>
左图是您微官网当前的预览效果。 左图是您微官网当前的预览效果。
<br /> <br />
......
...@@ -98,14 +98,14 @@ class AdCarouselEditor extends React.Component { ...@@ -98,14 +98,14 @@ class AdCarouselEditor extends React.Component {
}, 200); }, 200);
} }
uploadAdBanner = (e, index) => { uploadAdBanner = (e, index) => {
const { dispatch } = this.props; const { dispatch, avatorUploaderDefault } = this.props;
const { avatorUploader } = this.state; const { avatorUploader } = this.state;
dispatch({ dispatch({
type: 'uploader/queryimgsignature', type: 'uploader/queryimgsignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadAdBanner', uploadtype: 'uploadAdBanner',
avatorUploader, avatorUploader: avatorUploaderDefault,
imgIndex: index, imgIndex: index,
}, },
}); });
......
...@@ -11,7 +11,7 @@ function Banner(props) { ...@@ -11,7 +11,7 @@ function Banner(props) {
<div> <div>
{banner.type == 'video' && banner.src.length > 0 && {banner.type == 'video' && banner.src.length > 0 &&
<div className={PageStyle.videobox}> <div className={PageStyle.videobox}>
<video controls="controls" className={PageStyle.videoPoster} src={ossVideofy(banner.src[0])} /> <video autoPlay={false} controls="controls" className={PageStyle.videoPoster} src={ossVideofy(banner.src[0])} />
</div> </div>
} }
{banner.type == 'img' && banner.src.length > 1 && {banner.type == 'img' && banner.src.length > 1 &&
......
...@@ -74,14 +74,14 @@ class BannerEditor extends React.Component { ...@@ -74,14 +74,14 @@ class BannerEditor extends React.Component {
}); });
} }
uploadImg = (e) => { uploadImg = (e) => {
const { dispatch } = this.props; const { dispatch, avatorUploaderDefault } = this.props;
const { avatorUploader } = this.state; const { avatorUploader } = this.state;
dispatch({ dispatch({
type: 'uploader/queryimgsignature', type: 'uploader/queryimgsignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'banner', uploadtype: 'banner',
avatorUploader, avatorUploader: avatorUploaderDefault,
}, },
}); });
} }
......
...@@ -110,7 +110,7 @@ class ClassMomentsEditor extends React.Component { ...@@ -110,7 +110,7 @@ class ClassMomentsEditor extends React.Component {
const REGEXP_VIDEO = /^video\/\w+/; const REGEXP_VIDEO = /^video\/\w+/;
const REGEXP_IMG = /^image\/\w+/; const REGEXP_IMG = /^image\/\w+/;
const { files } = e.target; const { files } = e.target;
const { dispatch } = this.props; const { dispatch, avatorUploaderDefault } = this.props;
if (files && files[0] && REGEXP_VIDEO.test(files[0].type)) { if (files && files[0] && REGEXP_VIDEO.test(files[0].type)) {
dispatch({ dispatch({
type: 'officialweb/queryvideosignature', type: 'officialweb/queryvideosignature',
...@@ -135,7 +135,7 @@ class ClassMomentsEditor extends React.Component { ...@@ -135,7 +135,7 @@ class ClassMomentsEditor extends React.Component {
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadClassMomentImg', uploadtype: 'uploadClassMomentImg',
avatorUploader, avatorUploader: avatorUploaderDefault,
imgIndex: index, imgIndex: index,
}, },
}); });
......
...@@ -52,14 +52,14 @@ class SchoolIntroEditor extends React.Component { ...@@ -52,14 +52,14 @@ class SchoolIntroEditor extends React.Component {
}, 200); }, 200);
} }
uploadSchoolIntro = (e, index, type) => { uploadSchoolIntro = (e, index, type) => {
const { dispatch } = this.props; const { dispatch, avatorUploaderDefault } = this.props;
const { avatorUploader } = this.state; const { avatorUploader } = this.state;
dispatch({ dispatch({
type: 'uploader/queryimgsignature', type: 'uploader/queryimgsignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadSchoolIntro', uploadtype: 'uploadSchoolIntro',
avatorUploader, avatorUploader: avatorUploaderDefault,
imgIndex: index, imgIndex: index,
orgType: type, orgType: type,
}, },
......
...@@ -69,7 +69,7 @@ class StudentClock extends React.Component { ...@@ -69,7 +69,7 @@ class StudentClock extends React.Component {
} }
{ele.subject && (ele.subject.subject_type == 2 || ele.subject.subject_type == 1) && {ele.subject && (ele.subject.subject_type == 2 || ele.subject.subject_type == 1) &&
<div className={PageStyle.playstatus}> <div className={PageStyle.playstatus}>
{timeCompare(ele.created_at_time)} &nbsp;&nbsp;已坚持{ele.clock_days} && {ele.visit_pv_count != 0 ? ele.visit_pv_count : 1} {timeCompare(ele.created_at_time)} &nbsp;&nbsp;已坚持{ele.clock_days} {ele.visit_pv_count != 0 ? ele.visit_pv_count : 1}
</div> </div>
} }
</div> </div>
......
...@@ -25,7 +25,6 @@ class Teacher extends React.Component { ...@@ -25,7 +25,6 @@ class Teacher extends React.Component {
} }
render() { render() {
const { data, schoolInfo, showStatus } = this.props; const { data, schoolInfo, showStatus } = this.props;
console.log(data, 'data111');
return ( return (
<div className={PageStyle.Bannercontainer}> <div className={PageStyle.Bannercontainer}>
{ {
...@@ -50,7 +49,12 @@ class Teacher extends React.Component { ...@@ -50,7 +49,12 @@ class Teacher extends React.Component {
</div> </div>
<div className={PageStyle.commonRight}> <div className={PageStyle.commonRight}>
<div className={PageStyle.commonName}>{item.name}</div> <div className={PageStyle.commonName}>{item.name}</div>
<div className={PageStyle.commonDesc}><Tooltip title={item.course}>{item.course.substr(0, 4)}</Tooltip>&nbsp;{item.seniority}年教龄</div> <div className={PageStyle.commonDesc}>
<div>
<Tooltip title={item.course}>{item.course.substr(0, 4)}</Tooltip>
</div>
<div>&nbsp;{item.seniority}年教龄</div>
</div>
</div> </div>
</div> </div>
); );
......
...@@ -41,11 +41,10 @@ ...@@ -41,11 +41,10 @@
align-items: center; align-items: center;
margin-top: 10px; margin-top: 10px;
.commonItem { .commonItem {
display: flex; //display: flex;
align-items: center; text-align: center;
margin-right: 5px; margin-right: 20px;
.commonLeft { .commonLeft {
margin-right: 11px;
&>img { &>img {
width: 52px; width: 52px;
height: 52px; height: 52px;
...@@ -70,6 +69,7 @@ ...@@ -70,6 +69,7 @@
line-height:18px; line-height:18px;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column;
} }
} }
} }
...@@ -52,12 +52,13 @@ class TeacherEditor extends React.Component { ...@@ -52,12 +52,13 @@ class TeacherEditor extends React.Component {
uploadTeacherAvatar = (e, index) => { uploadTeacherAvatar = (e, index) => {
const { dispatch } = this.props; const { dispatch } = this.props;
const { avatorUploader } = this.state; const { avatorUploader } = this.state;
const { avatorUploaderDefault } = this.props;
dispatch({ dispatch({
type: 'uploader/queryimgsignature', type: 'uploader/queryimgsignature',
payload: { payload: {
files: e.target, files: e.target,
uploadtype: 'uploadTeacherAvatar', uploadtype: 'uploadTeacherAvatar',
avatorUploader, avatorUploader: avatorUploaderDefault,
imgIndex: index, imgIndex: index,
}, },
}); });
...@@ -132,7 +133,6 @@ class TeacherEditor extends React.Component { ...@@ -132,7 +133,6 @@ class TeacherEditor extends React.Component {
teacherStatus, teacherStatus,
sid, sid,
} = this.props; } = this.props;
console.log(teachers, 'teachersteachersteachers');
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 4 }, xs: { span: 4 },
......
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