|
|
|
|
@ -664,26 +664,30 @@ var VideoEdit_EditAttendance = function EditAttendance(_ref) {
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
imgLoading = _useState2[0],
|
|
|
|
|
setImgLoading = _useState2[1];
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
tabsList = _useState4[0],
|
|
|
|
|
setTabsList = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
btnLoading = _useState4[0],
|
|
|
|
|
setBtnLoading = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
video = _useState6[0],
|
|
|
|
|
setVideo = _useState6[1];
|
|
|
|
|
tabsList = _useState6[0],
|
|
|
|
|
setTabsList = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
video = _useState8[0],
|
|
|
|
|
setVideo = _useState8[1];
|
|
|
|
|
var files = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
var uploader = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
var fileTypes = ["avi", "flv", "f4v", "m4v", "mov", "mp4", "rmvb", "swf", "webm", "wmv"];
|
|
|
|
|
var uploadNameSizeSeperator = ' ';
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(null),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
videoId = _useState8[0],
|
|
|
|
|
setvideoId = _useState8[1];
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(null),
|
|
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
|
|
nowVideoId = _useState10[0],
|
|
|
|
|
setNowVideoId = _useState10[1];
|
|
|
|
|
videoId = _useState10[0],
|
|
|
|
|
setvideoId = _useState10[1];
|
|
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(null),
|
|
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
|
|
nowVideoId = _useState12[0],
|
|
|
|
|
setNowVideoId = _useState12[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
var _actionTabs$data, _actionTabs$data2, _actionTabs$data3;
|
|
|
|
|
if (classroomList.actionTabs.key === '编辑视频') form.setFieldsValue({
|
|
|
|
|
@ -877,12 +881,15 @@ var VideoEdit_EditAttendance = function EditAttendance(_ref) {
|
|
|
|
|
open: classroomList.actionTabs.key === '编辑视频' ? true : false,
|
|
|
|
|
okText: "\u786E\u5B9A",
|
|
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
|
|
width: 640,
|
|
|
|
|
width: 660,
|
|
|
|
|
destroyOnClose: true,
|
|
|
|
|
confirmLoading: imgLoading,
|
|
|
|
|
okButtonProps: {
|
|
|
|
|
disabled: imgLoading
|
|
|
|
|
},
|
|
|
|
|
confirmLoading: btnLoading,
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
|
|
var _actionTabs$data7;
|
|
|
|
|
var formValue, body, _user$userInfo2, _actionTabs$data6, res;
|
|
|
|
|
var _actionTabs$data8;
|
|
|
|
|
var formValue, body, _user$userInfo2, _actionTabs$data6, _actionTabs$data7, res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
@ -901,11 +908,12 @@ var VideoEdit_EditAttendance = function EditAttendance(_ref) {
|
|
|
|
|
_context5.t2 = _context5.sent;
|
|
|
|
|
formValue = (0, _context5.t0)(_context5.t1, _context5.t2);
|
|
|
|
|
body = objectSpread2_default()({}, formValue);
|
|
|
|
|
setBtnLoading(true);
|
|
|
|
|
if (!video) {
|
|
|
|
|
_context5.next = 15;
|
|
|
|
|
_context5.next = 16;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_context5.next = 13;
|
|
|
|
|
_context5.next = 14;
|
|
|
|
|
return (0,service_user/* batchPublish */.dt)({
|
|
|
|
|
username: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login,
|
|
|
|
|
videos: [{
|
|
|
|
|
@ -913,25 +921,25 @@ var VideoEdit_EditAttendance = function EditAttendance(_ref) {
|
|
|
|
|
title: form.getFieldValue("title"),
|
|
|
|
|
filename: video.file.name,
|
|
|
|
|
attachment_id: form.getFieldValue("attachment_id"),
|
|
|
|
|
course_id: params.coursesId,
|
|
|
|
|
category_id: '',
|
|
|
|
|
course_video_id: (_actionTabs$data6 = actionTabs.data) === null || _actionTabs$data6 === void 0 ? void 0 : _actionTabs$data6.course_video_id
|
|
|
|
|
course_id: params === null || params === void 0 ? void 0 : params.coursesId,
|
|
|
|
|
category_id: actionTabs === null || actionTabs === void 0 || (_actionTabs$data6 = actionTabs.data) === null || _actionTabs$data6 === void 0 ? void 0 : _actionTabs$data6.course_second_category_id,
|
|
|
|
|
course_video_id: (_actionTabs$data7 = actionTabs.data) === null || _actionTabs$data7 === void 0 ? void 0 : _actionTabs$data7.course_video_id
|
|
|
|
|
}]
|
|
|
|
|
});
|
|
|
|
|
case 13:
|
|
|
|
|
_context5.next = 16;
|
|
|
|
|
case 14:
|
|
|
|
|
_context5.next = 17;
|
|
|
|
|
break;
|
|
|
|
|
case 15:
|
|
|
|
|
case 16:
|
|
|
|
|
tabsList.forEach(function (item) {
|
|
|
|
|
if (item.checked) body["set_id"] = item.id;
|
|
|
|
|
});
|
|
|
|
|
case 16:
|
|
|
|
|
_context5.next = 18;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/course_videos/".concat(actionTabs === null || actionTabs === void 0 || (_actionTabs$data7 = actionTabs.data) === null || _actionTabs$data7 === void 0 ? void 0 : _actionTabs$data7.course_video_id, "/change_cover.json"), {
|
|
|
|
|
case 17:
|
|
|
|
|
_context5.next = 19;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/course_videos/".concat(actionTabs === null || actionTabs === void 0 || (_actionTabs$data8 = actionTabs.data) === null || _actionTabs$data8 === void 0 ? void 0 : _actionTabs$data8.course_video_id, "/change_cover.json"), {
|
|
|
|
|
method: 'put',
|
|
|
|
|
body: body
|
|
|
|
|
});
|
|
|
|
|
case 18:
|
|
|
|
|
case 19:
|
|
|
|
|
res = _context5.sent;
|
|
|
|
|
if (res) {
|
|
|
|
|
message/* default */.ZP.success('修改成功');
|
|
|
|
|
@ -945,7 +953,8 @@ var VideoEdit_EditAttendance = function EditAttendance(_ref) {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
setVideo(void 0);
|
|
|
|
|
case 21:
|
|
|
|
|
setBtnLoading(false);
|
|
|
|
|
case 23:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context5.stop();
|
|
|
|
|
}
|
|
|
|
|
|