|
|
|
|
@ -161,7 +161,7 @@ var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var NewCoursePage = function NewCoursePage(_ref) {
|
|
|
|
|
var _team$team_leader, _team$members, _searchMemberList, _ref7;
|
|
|
|
|
var _team$team_leader, _team$members2, _searchMemberList, _ref7;
|
|
|
|
|
var shixunHomeworks = _ref.shixunHomeworks,
|
|
|
|
|
user = _ref.user,
|
|
|
|
|
newCourse = _ref.newCourse,
|
|
|
|
|
@ -313,13 +313,20 @@ var NewCoursePage = function NewCoursePage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
var handleSubmit = /*#__PURE__*/function () {
|
|
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(bodyData) {
|
|
|
|
|
var res;
|
|
|
|
|
var _team$members, res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
bodyData.user_ids = [].concat(toConsumableArray_default()((bodyData === null || bodyData === void 0 ? void 0 : bodyData.user_ids) || []), toConsumableArray_default()(selectArr === null || selectArr === void 0 ? void 0 : selectArr.map(function (item) {
|
|
|
|
|
return item.user_id;
|
|
|
|
|
})));
|
|
|
|
|
if ((studentWorkEditDefaultData === null || studentWorkEditDefaultData === void 0 ? void 0 : studentWorkEditDefaultData.group_type) === 1) {
|
|
|
|
|
bodyData.user_ids = (team === null || team === void 0 || (_team$members = team.members) === null || _team$members === void 0 ? void 0 : _team$members.map(function (item) {
|
|
|
|
|
return item.user_id;
|
|
|
|
|
})) || [];
|
|
|
|
|
} else {
|
|
|
|
|
// bodyData.user_ids = selectStudent?.map(item => item.user_id) || []
|
|
|
|
|
bodyData.user_ids = [].concat(toConsumableArray_default()((bodyData === null || bodyData === void 0 ? void 0 : bodyData.user_ids) || []), toConsumableArray_default()(selectArr === null || selectArr === void 0 ? void 0 : selectArr.map(function (item) {
|
|
|
|
|
return item.user_id;
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
_context3.next = 3;
|
|
|
|
|
return (0,service_shixunHomeworks/* editStudentWork */.z2)(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, params), bodyData), {}, {
|
|
|
|
|
type: 3
|
|
|
|
|
@ -354,26 +361,24 @@ var NewCoursePage = function NewCoursePage(_ref) {
|
|
|
|
|
return v.id || v.response.id;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if ((studentWorkEditDefaultData === null || studentWorkEditDefaultData === void 0 ? void 0 : studentWorkEditDefaultData.group_type) === 1) {
|
|
|
|
|
bodyData["group_leader_scores"] = team === null || team === void 0 ? void 0 : team.members.map(function (item) {
|
|
|
|
|
return {
|
|
|
|
|
user_id: item.user_id,
|
|
|
|
|
score: item.score
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
bodyData["group_leader_scores"] = [].concat(toConsumableArray_default()(selectStudent.map(function (item) {
|
|
|
|
|
return {
|
|
|
|
|
user_id: item.user_id,
|
|
|
|
|
score: item.score
|
|
|
|
|
};
|
|
|
|
|
})), toConsumableArray_default()(selectArr.map(function (item) {
|
|
|
|
|
return {
|
|
|
|
|
user_id: item.user_id,
|
|
|
|
|
score: item.score
|
|
|
|
|
};
|
|
|
|
|
})));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (studentWorkEditDefaultData?.group_type === 1) {
|
|
|
|
|
// bodyData["group_leader_scores"] = team?.members.map((item: any) => ({ user_id: item.user_id, score: item.score }))
|
|
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
bodyData["group_leader_scores"] = [].concat(toConsumableArray_default()(selectStudent.map(function (item) {
|
|
|
|
|
return {
|
|
|
|
|
user_id: item.user_id,
|
|
|
|
|
score: item.score
|
|
|
|
|
};
|
|
|
|
|
})), toConsumableArray_default()(selectArr.map(function (item) {
|
|
|
|
|
return {
|
|
|
|
|
user_id: item.user_id,
|
|
|
|
|
score: item.score
|
|
|
|
|
};
|
|
|
|
|
})));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if (bodyData.attachment_ids == '') {
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
@ -558,7 +563,7 @@ var NewCoursePage = function NewCoursePage(_ref) {
|
|
|
|
|
padding: '3px 10px'
|
|
|
|
|
},
|
|
|
|
|
children: "\u7EC4\u5458"
|
|
|
|
|
}), team === null || team === void 0 || (_team$members = team.members) === null || _team$members === void 0 ? void 0 : _team$members.map(function (item, index) {
|
|
|
|
|
}), team === null || team === void 0 || (_team$members2 = team.members) === null || _team$members2 === void 0 ? void 0 : _team$members2.map(function (item, index) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
style: {
|
|
|
|
|
marginLeft: index === 0 ? 10 : 0
|