|
|
|
|
@ -5444,6 +5444,7 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setShowTip(true);
|
|
|
|
|
flag = false;
|
|
|
|
|
(_rateSetting = rateSetting) === null || _rateSetting === void 0 || _rateSetting.find(function (item) {
|
|
|
|
|
if (item.name === '' || item.score === '') {
|
|
|
|
|
@ -5452,25 +5453,25 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (!flag) {
|
|
|
|
|
_context2.next = 4;
|
|
|
|
|
_context2.next = 5;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context2.abrupt("return");
|
|
|
|
|
case 4:
|
|
|
|
|
case 5:
|
|
|
|
|
if (!(calcScore().toFixed(2) != 100)) {
|
|
|
|
|
_context2.next = 7;
|
|
|
|
|
_context2.next = 8;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
message/* default */.ZP.warning('整个作业最终的满分值必须为100分');
|
|
|
|
|
return _context2.abrupt("return");
|
|
|
|
|
case 7:
|
|
|
|
|
case 8:
|
|
|
|
|
if (!hasDuplicateName(rateSetting)) {
|
|
|
|
|
_context2.next = 10;
|
|
|
|
|
_context2.next = 11;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
message/* default */.ZP.warning('维度名称不能重复');
|
|
|
|
|
return _context2.abrupt("return");
|
|
|
|
|
case 10:
|
|
|
|
|
case 11:
|
|
|
|
|
bodyData = JSON.parse(JSON.stringify(data));
|
|
|
|
|
bodyData.categoryId = params.categoryId;
|
|
|
|
|
if (!data.unified_setting) (_groupSettings = groupSettings) === null || _groupSettings === void 0 || _groupSettings.map(function (item) {
|
|
|
|
|
@ -5497,30 +5498,30 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
bodyData.group_settings = groupSettings;
|
|
|
|
|
bodyData.score_details = rateSetting;
|
|
|
|
|
if (!data.allow_late) {
|
|
|
|
|
_context2.next = 27;
|
|
|
|
|
_context2.next = 28;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (!data.unified_late) {
|
|
|
|
|
_context2.next = 25;
|
|
|
|
|
_context2.next = 26;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (!(data.late_penalty === null || data.late_penalty === undefined || data.late_penalty < 0 || data.late_penalty > 100)) {
|
|
|
|
|
_context2.next = 20;
|
|
|
|
|
_context2.next = 21;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
message/* default */.ZP.error('迟交扣分填写区间为0~100');
|
|
|
|
|
throw new String('迟交扣分填写区间为0~100');
|
|
|
|
|
case 20:
|
|
|
|
|
case 21:
|
|
|
|
|
if (data.late_time) {
|
|
|
|
|
_context2.next = 23;
|
|
|
|
|
_context2.next = 24;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
message/* default */.ZP.error('请把截止时间填写完整');
|
|
|
|
|
throw new String('请把截止时间填写完整');
|
|
|
|
|
case 23:
|
|
|
|
|
_context2.next = 27;
|
|
|
|
|
case 24:
|
|
|
|
|
_context2.next = 28;
|
|
|
|
|
break;
|
|
|
|
|
case 25:
|
|
|
|
|
case 26:
|
|
|
|
|
repairSettings = (_repairSettings = repairSettings) === null || _repairSettings === void 0 ? void 0 : _repairSettings.map(function (item) {
|
|
|
|
|
var _item$group_name2;
|
|
|
|
|
if (item.late_penalty === null || item.late_penalty === undefined || item.late_penalty < 0 || item.late_penalty > 100) {
|
|
|
|
|
@ -5546,7 +5547,7 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
bodyData.allow_late_settings = repairSettings;
|
|
|
|
|
case 27:
|
|
|
|
|
case 28:
|
|
|
|
|
Object.keys(bodyData).map(function (item) {
|
|
|
|
|
if (item.indexOf("proportion") > -1) {
|
|
|
|
|
bodyData[item] = bodyData[item] / 100;
|
|
|
|
|
@ -5557,7 +5558,7 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
// payload: bodyData,
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
if (!(JSON.stringify(rateSetting) !== JSON.stringify(workSetting === null || workSetting === void 0 ? void 0 : workSetting.score_details) || (workSetting === null || workSetting === void 0 ? void 0 : workSetting.single_score) != (data === null || data === void 0 ? void 0 : data.single_score))) {
|
|
|
|
|
_context2.next = 33;
|
|
|
|
|
_context2.next = 34;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
modal/* default */.Z.confirm({
|
|
|
|
|
@ -5620,15 +5621,15 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
}()
|
|
|
|
|
});
|
|
|
|
|
setTipShow(true);
|
|
|
|
|
_context2.next = 37;
|
|
|
|
|
_context2.next = 38;
|
|
|
|
|
break;
|
|
|
|
|
case 33:
|
|
|
|
|
_context2.next = 35;
|
|
|
|
|
case 34:
|
|
|
|
|
_context2.next = 36;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/homework_commons/".concat(params.categoryId, "/score_setting_with_normal.json"), {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: objectSpread2_default()({}, bodyData)
|
|
|
|
|
});
|
|
|
|
|
case 35:
|
|
|
|
|
case 36:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
if (res.status === 0) {
|
|
|
|
|
message/* default */.ZP.success('更新成功');
|
|
|
|
|
@ -5657,7 +5658,7 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
case 37:
|
|
|
|
|
case 38:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
@ -5743,6 +5744,7 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
setDisabled(true);
|
|
|
|
|
getData();
|
|
|
|
|
setShowTip(false);
|
|
|
|
|
},
|
|
|
|
|
children: "\u53D6\u6D88"
|
|
|
|
|
})]
|
|
|
|
|
@ -5903,10 +5905,10 @@ var ScoreSetting_WorkList = function WorkList(_ref) {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#E30000'
|
|
|
|
|
}
|
|
|
|
|
}), !rateSetting[index].name && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
}), !rateSetting[index].name && showtip && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: ConfigWorksmodules.tip1,
|
|
|
|
|
children: "\u8BF7\u8F93\u5165\u7EF4\u5EA6\u540D\u79F0"
|
|
|
|
|
}), !rateSetting[index].score && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
}), !rateSetting[index].score && showtip && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: ConfigWorksmodules.tip2,
|
|
|
|
|
children: "\u8BF7\u8F93\u5165\u6EE1\u5206\u5206\u503C"
|
|
|
|
|
})]
|