Commit 1918be5a authored by wangxuelai's avatar wangxuelai

''

parent 05463a43
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>商家岛PC后台</title><link rel="shortcut icon" href="http://biz.shangjiadao.com/images/webapp/sjd_logo_a.png"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge"><!-- Polyfills --><!--[if lt IE 10]>
<script src="js/console-polyfill.js"></script>
<![endif]--><script src="js/console-polyfill.js"></script><script src="js/es6-shim.min.js"></script><script src="js/es5-shim.js"></script><script src="js/es5-sham.min.js"></script><script src="js/json3.min.js"></script><script src="js/html5shiv.min.js"></script><script src="js/polyfill.js"></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?1562308853703" rel="stylesheet"><script src="lib/vendor.dll.js?3" charset="utf-8"></script></head><body><div id="root"></div><script src="dist/index.js?1562308853704" charset="utf-8"></script></body></html>
\ No newline at end of file
<![endif]--><script src="js/console-polyfill.js"></script><script src="js/es6-shim.min.js"></script><script src="js/es5-shim.js"></script><script src="js/es5-sham.min.js"></script><script src="js/json3.min.js"></script><script src="js/html5shiv.min.js"></script><script src="js/polyfill.js"></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?1562548602921" rel="stylesheet"><script src="lib/vendor.dll.js?3" charset="utf-8"></script></head><body><div id="root"></div><script src="dist/index.js?1562548602922" charset="utf-8"></script></body></html>
\ No newline at end of file
......@@ -26,8 +26,9 @@ export default {
bannerVideo: [],
orgdescs: [],
schoolInfoPostStatus: false, // 机构信息保存中状态
bannerPostStatus: false, // 机构信息保存中状态
coursePostStatus: false, // 机构信息保存中状态
bannerPostStatus: false, // banner保存中状态
coursePostStatus: false, // 体验课保存中状态
orgPostStatus: false, // 机构介绍保存中状态
course: {
school_id: 0,
title: '',
......@@ -688,47 +689,49 @@ export default {
}
},
* saveorgdesc({ payload }, { call, put, select }) {
const { orgdescs, pageInfo, sid } = yield select(state => state.officialweb);
const schoolIntroAjax = [];
const {
orgdescs, pageInfo, sid, orgPostStatus,
} = yield select(state => state.officialweb);
if (orgPostStatus) {
return;
}
yield put({
type: 'updateState',
payload: {
orgPostStatus: true,
},
});
const { values } = payload;
let schoolIntroAjax;
const newpageInfo = JSON.parse(JSON.stringify(pageInfo));
for (let i = 0, Length = orgdescs.length; i < Length; i++) {
if (orgdescs[i].id == 0) {
schoolIntroAjax.push(officialwebajax.schoolIntroAdd({
id: orgdescs[i].id,
school_id: orgdescs[i].school_id,
title: values.title[i],
type: orgdescs[i].type,
content: JSON.stringify(orgdescs[i].content),
}));
} else {
schoolIntroAjax.push(officialwebajax.schoolIntroUpdate({
id: orgdescs[i].id,
school_id: orgdescs[i].school_id,
title: values.title[i],
type: orgdescs[i].type,
content: JSON.stringify(orgdescs[i].content),
}));
}
const Length = orgdescs.length;
let i = 0;
while (i < Length) {
schoolIntroAjax = yield call(officialwebajax.schoolIntroAdd, {
id: orgdescs[i].id,
school_id: orgdescs[i].school_id,
title: values.title[i],
type: orgdescs[i].type,
content: JSON.stringify(orgdescs[i].content),
});
i++;
}
Promise.all(schoolIntroAjax).then((res) => {
});
yield delay(2000);
const schoolIntro = yield call(officialwebajax.schoolIntroGet, { school_id: sid });
schoolIntro.data.data.list.forEach((ele) => {
schoolIntro.data.list.forEach((ele) => {
const Ele = ele;
Ele.content = JSON.parse(Ele.content);
});
newpageInfo.forEach((ele) => {
const element = ele;
if (element.type == 'orgdesc') {
element.data = schoolIntro.data.data.list;
element.data = schoolIntro.data.list;
}
});
yield put({
type: 'updateState',
payload: {
pageInfo: newpageInfo,
orgPostStatus: false,
},
});
},
......
......@@ -90,8 +90,12 @@ class OrgdescEditorForm extends React.Component {
}
handleSubmit = (e) => {
e.preventDefault();
const { dispatch } = this.props;
const { dispatch, handleSubmit } = this.props;
if (handleSubmit) {
return;
}
this.props.form.validateFields((err, values) => {
console.log(values, 'valuesvaluesvaluesvalues');
if (!err) {
const { dispatch } = this.props;
dispatch({
......@@ -127,7 +131,7 @@ class OrgdescEditorForm extends React.Component {
render() {
const { orgdescs } = this.props;
const { currentIndex } = this.state;
const { getFieldDecorator, getFieldValue } = this.props.form;
const { getFieldDecorator, getFieldValue, orgPostStatus } = this.props.form;
const menuItemStyle = {
fontSize: '16px',
};
......@@ -265,7 +269,7 @@ class OrgdescEditorForm extends React.Component {
</div>
<div className={PageStyle.divideLine} />
<div className={PageStyle.btnbox}>
<Button type="primary" className={PageStyle.SubmitBtn} htmlType="submit">保存</Button>
<Button type="primary" className={PageStyle.SubmitBtn} htmlType="submit" loading={orgPostStatus}>{orgPostStatus ? '保存中...' : '保存'}</Button>
</div>
</Form>
</div>
......@@ -278,10 +282,11 @@ OrgdescEditor.propTypes = {
};
function mapStateToProps(state) {
const {
orgdescs,
orgdescs, orgPostStatus,
} = state.officialweb;
return {
orgdescs,
orgPostStatus,
};
}
export default connect(mapStateToProps)(OrgdescEditor);
......@@ -34,7 +34,7 @@
}
.SubmitBtn {
// background-color: #ECECEC;
width: 70px;
// width: 70px;
height: 34px;
line-height: 34px;
}
......
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