Commit 82702b22 authored by baixian's avatar baixian

ERP oss上传修改

parent 60ea4b07
......@@ -18,5 +18,5 @@
</head>
<body>
<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>
\ No newline at end of file
......@@ -162,6 +162,28 @@ export default {
schoolIntroStatus: false, // 学校介绍保存状态
teachers: [], // 名师风采
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: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -277,7 +299,6 @@ export default {
if (!schoolDetail.data) {
const orgschoolDetail = yield call(officialwebajax.memberSchooldetail, { school_id: sid });
if (orgschoolDetail.code == 200) {
console.log(orgschoolDetail, 'orgschoolDetail111');
newpageInfo.forEach((ele) => {
const element = ele;
if (element.type == 'schoolinfo') {
......@@ -450,7 +471,7 @@ export default {
newpageInfo.forEach((ele) => {
const element = ele;
if (element.type == 'teacher') {
element.data = teacherData.data.list.slice(0, 2);
element.data = teacherData.data.list.slice(0, 4);
}
});
newTeacherData = teacherData.data.list;
......@@ -2283,6 +2304,28 @@ export default {
schoolIntroStatus: false, // 学校介绍保存状态
teachers: [], // 名师风采
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 {
schoolInfo,
collapsed,
screenIsBig,
avatorUploaderDefault,
} = this.props;
let renderDom;
const newPageInfo = pageInfo;
console.log(newPageInfo, 'newPageInfo');
const qrcodeBox = (
<div>
<img className={pageStyle.qrcodebox} src={imagify(previewQrcode)} alt="" />
......@@ -180,7 +180,10 @@ class Officialweb extends React.Component {
</div>
{moduleSelect == index &&
<div className={pageStyle.editbox}>
<BannerEditor banner={ele.data} />
<BannerEditor
banner={ele.data}
avatorUploaderDefault={avatorUploaderDefault}
/>
</div>
}
</div>
......@@ -211,7 +214,9 @@ class Officialweb extends React.Component {
}
{moduleSelect == index &&
<div className={pageStyle.editbox}>
<AdCarouselEditor />
<AdCarouselEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div>
}
</div>
......@@ -242,7 +247,9 @@ class Officialweb extends React.Component {
}
{moduleSelect == index &&
<div className={pageStyle.editbox}>
<SchoolIntroEditor />
<SchoolIntroEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div>
}
</div>
......@@ -273,7 +280,9 @@ class Officialweb extends React.Component {
}
{moduleSelect == index &&
<div className={pageStyle.editbox}>
<TeacherEditor />
<TeacherEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div>
}
</div>
......@@ -330,7 +339,9 @@ class Officialweb extends React.Component {
}
{moduleSelect == index &&
<div className={pageStyle.editbox}>
<ClassMomentsEditor />
<ClassMomentsEditor
avatorUploaderDefault={avatorUploaderDefault}
/>
</div>
}
</div>
......@@ -461,6 +472,7 @@ function mapStateToProps(state) {
course,
coursePostStatus,
schoolInfo,
avatorUploaderDefault,
} = state.officialweb;
const {
cropperboxShow,
......@@ -482,6 +494,7 @@ function mapStateToProps(state) {
schoolInfo,
collapsed,
screenIsBig,
avatorUploaderDefault,
};
}
export default connect(mapStateToProps)(Officialweb);
......
......@@ -272,9 +272,9 @@ class Officialweb extends React.Component {
<Button type="primary" onClick={this.editor} className={pageStyle.editBtn}>装修主页</Button>
</BtnPermission>
}
<BtnPermission btnId="80001">
<Button type="primary" onClick={this.editThemeClass} className={pageStyle.editBtn} style={{ marginLeft: 30 }}>装修主题课</Button>
</BtnPermission>
{/* <BtnPermission btnId="80001"> */}
{/* <Button type="primary" onClick={this.editThemeClass} className={pageStyle.editBtn} style={{ marginLeft: 30 }}>装修主题课</Button> */}
{/* </BtnPermission> */}
<div className={pageStyle.websiteeditdesc}>
左图是您微官网当前的预览效果。
<br />
......
......@@ -98,14 +98,14 @@ class AdCarouselEditor extends React.Component {
}, 200);
}
uploadAdBanner = (e, index) => {
const { dispatch } = this.props;
const { dispatch, avatorUploaderDefault } = this.props;
const { avatorUploader } = this.state;
dispatch({
type: 'uploader/queryimgsignature',
payload: {
files: e.target,
uploadtype: 'uploadAdBanner',
avatorUploader,
avatorUploader: avatorUploaderDefault,
imgIndex: index,
},
});
......
......@@ -11,7 +11,7 @@ function Banner(props) {
<div>
{banner.type == 'video' && banner.src.length > 0 &&
<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>
}
{banner.type == 'img' && banner.src.length > 1 &&
......
......@@ -74,14 +74,14 @@ class BannerEditor extends React.Component {
});
}
uploadImg = (e) => {
const { dispatch } = this.props;
const { dispatch, avatorUploaderDefault } = this.props;
const { avatorUploader } = this.state;
dispatch({
type: 'uploader/queryimgsignature',
payload: {
files: e.target,
uploadtype: 'banner',
avatorUploader,
avatorUploader: avatorUploaderDefault,
},
});
}
......
......@@ -110,7 +110,7 @@ class ClassMomentsEditor extends React.Component {
const REGEXP_VIDEO = /^video\/\w+/;
const REGEXP_IMG = /^image\/\w+/;
const { files } = e.target;
const { dispatch } = this.props;
const { dispatch, avatorUploaderDefault } = this.props;
if (files && files[0] && REGEXP_VIDEO.test(files[0].type)) {
dispatch({
type: 'officialweb/queryvideosignature',
......@@ -135,7 +135,7 @@ class ClassMomentsEditor extends React.Component {
payload: {
files: e.target,
uploadtype: 'uploadClassMomentImg',
avatorUploader,
avatorUploader: avatorUploaderDefault,
imgIndex: index,
},
});
......
......@@ -52,14 +52,14 @@ class SchoolIntroEditor extends React.Component {
}, 200);
}
uploadSchoolIntro = (e, index, type) => {
const { dispatch } = this.props;
const { dispatch, avatorUploaderDefault } = this.props;
const { avatorUploader } = this.state;
dispatch({
type: 'uploader/queryimgsignature',
payload: {
files: e.target,
uploadtype: 'uploadSchoolIntro',
avatorUploader,
avatorUploader: avatorUploaderDefault,
imgIndex: index,
orgType: type,
},
......
......@@ -69,7 +69,7 @@ class StudentClock extends React.Component {
}
{ele.subject && (ele.subject.subject_type == 2 || ele.subject.subject_type == 1) &&
<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>
......
......@@ -25,7 +25,6 @@ class Teacher extends React.Component {
}
render() {
const { data, schoolInfo, showStatus } = this.props;
console.log(data, 'data111');
return (
<div className={PageStyle.Bannercontainer}>
{
......@@ -50,7 +49,12 @@ class Teacher extends React.Component {
</div>
<div className={PageStyle.commonRight}>
<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>
);
......
......@@ -41,11 +41,10 @@
align-items: center;
margin-top: 10px;
.commonItem {
display: flex;
align-items: center;
margin-right: 5px;
//display: flex;
text-align: center;
margin-right: 20px;
.commonLeft {
margin-right: 11px;
&>img {
width: 52px;
height: 52px;
......@@ -70,6 +69,7 @@
line-height:18px;
display: flex;
align-items: center;
flex-direction: column;
}
}
}
......@@ -52,12 +52,13 @@ class TeacherEditor extends React.Component {
uploadTeacherAvatar = (e, index) => {
const { dispatch } = this.props;
const { avatorUploader } = this.state;
const { avatorUploaderDefault } = this.props;
dispatch({
type: 'uploader/queryimgsignature',
payload: {
files: e.target,
uploadtype: 'uploadTeacherAvatar',
avatorUploader,
avatorUploader: avatorUploaderDefault,
imgIndex: index,
},
});
......@@ -132,7 +133,6 @@ class TeacherEditor extends React.Component {
teacherStatus,
sid,
} = this.props;
console.log(teachers, 'teachersteachersteachers');
const formItemLayout = {
labelCol: {
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