Commit b5d37705 authored by wangxuelai's avatar wangxuelai

''

parent 99321189
......@@ -1189,29 +1189,6 @@ export default {
id,
},
});
// yield put({
// type: 'updateState',
// payload: {
// addCourseObj: {
// title: '',
// start_time: '',
// charge_type: '',
// created_at: '',
// cover: '',
// type: '',
// audio: '',
// intro: [
// { type: 'text', value: '' },
// ],
// remark: '',
// study_count: '',
// status: '',
// content: '',
// },
// },
// });
// yield delay(50);
// yield put(routerRedux.push('/sjd/coursegather'));
} else {
yield put({
type: 'webapp/errorrequestresolve',
......@@ -1255,7 +1232,7 @@ export default {
info,
},
});
} else if (info.from == 'materia') {
} else {
yield put({
type: 'sureSaveCourseWare',
payload: {
......@@ -1266,16 +1243,19 @@ export default {
},
},
});
} else {
yield put({
type: 'uploadcourseware/updateState',
type: 'createCourseMateria',
payload: {
visible: false,
info: {},
content: {
...info.properties,
images: info.type == 1 ? [info.src] : [],
},
filename: info.src,
type: info.type,
},
});
}
} else {
} else if (info.from == 'materia') {
yield put({
type: 'sureSaveCourseWare',
payload: {
......@@ -1286,6 +1266,14 @@ export default {
},
},
});
} else {
yield put({
type: 'uploadcourseware/updateState',
payload: {
visible: false,
info: {},
},
});
}
} else {
console.log('清楚的逻辑');
......@@ -1374,6 +1362,17 @@ export default {
},
},
});
yield put({
type: 'createCourseMateria',
payload: {
content: {
...info.properties,
images: data.result,
},
filename: info.src,
type: info.type,
},
});
} else if (code == 40060) {
yield delay(1000);
yield put({
......@@ -1587,6 +1586,17 @@ export default {
});
const { data, code } = transformData;
if (code == 200) {
yield put({
type: 'createCourseMateria',
payload: {
content: {
...info.properties,
images: transformData.data.result,
},
filename: info.src,
type: info.type,
},
});
if (editSingleCourseId == 0) {
if (info.from) {
delete info.from;
......@@ -1694,6 +1704,17 @@ export default {
},
});
} else {
yield put({
type: 'createCourseMateria',
payload: {
content: {
...info.properties,
images: info.type == 1 ? [info.src] : [],
},
filename: info.src,
type: info.type,
},
});
if (editSingleCourseId == 0) {
if (info.from) {
delete info.from;
......@@ -1864,10 +1885,7 @@ export default {
school_id: sid,
type,
src: filename,
content: JSON.stringify({
...content,
images,
}),
content: JSON.stringify(content),
});
},
},
......
......@@ -952,6 +952,17 @@ export default {
});
const { data, code } = transformData;
if (code == 200) {
yield put({
type: 'createCourseMateria',
payload: {
content: {
...info.properties,
images: data.result,
},
filename: info.src,
type: info.type,
},
});
yield put({
type: 'saveCourseWare',
payload: {
......@@ -1001,22 +1012,17 @@ export default {
},
},
});
// console.log()
// * createCourseMateria({ payload }, { call, put, select }) {
// const { sid } = yield select(state => state.webapp);
// const {
// content, filename, type, uploaderLoading, images,
// } = payload;
// const createCourseMateriaData = yield call(courseMateriaAjax.createMateria, {
// school_id: sid,
// type,
// src: filename,
// content: JSON.stringify({
// ...content,
// images,
// }),
// });
// },
yield put({
type: 'createCourseMateria',
payload: {
content: {
...info.properties,
images: info.type == 1 ? [info.src] : [],
},
filename: info.src,
type: info.type,
},
});
}
} else if (from == 'materia') { // 课件通过素材库选取得到
yield put({
......@@ -1100,10 +1106,7 @@ export default {
school_id: sid,
type,
src: filename,
content: JSON.stringify({
...content,
images,
}),
content: JSON.stringify(content),
});
},
},
......
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