|
|
|
|
@ -20129,7 +20129,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
_Form$useForm4 = slicedToArray_default()(_Form$useForm3, 1),
|
|
|
|
|
form2 = _Form$useForm4[0];
|
|
|
|
|
var _useState37 = (0,_react_17_0_2_react.useState)({
|
|
|
|
|
type: 1
|
|
|
|
|
mode_type: 1
|
|
|
|
|
}),
|
|
|
|
|
_useState38 = slicedToArray_default()(_useState37, 2),
|
|
|
|
|
formValue2 = _useState38[0],
|
|
|
|
|
@ -20392,7 +20392,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
var getLearnDetail = /*#__PURE__*/function () {
|
|
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
|
|
var res, _res$data5, _res$data6, _res$data7, _res$data8, _res$data9, _res$data10, _res$data11, templabel, tempValue, learnModes, temp, treeDataList;
|
|
|
|
|
var res, _res$data5, _res$data6, _res$data7, _res$data8, _res$data9, _res$data10, _res$data11, _res$data12, _res$data13, templabel, tempValue, learnModes, temp, treeDataList, tempList;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
@ -20409,16 +20409,19 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
mode: Number(res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.mode),
|
|
|
|
|
status: Number(res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.status)
|
|
|
|
|
});
|
|
|
|
|
templabel = res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.course_groups.map(function (item) {
|
|
|
|
|
formValue.mode = Number(res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.mode);
|
|
|
|
|
formValue.status = Number(res === null || res === void 0 || (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.status);
|
|
|
|
|
setFormValue(objectSpread2_default()({}, formValue));
|
|
|
|
|
templabel = res === null || res === void 0 || (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.course_groups.map(function (item) {
|
|
|
|
|
return item === null || item === void 0 ? void 0 : item.course_group_name;
|
|
|
|
|
});
|
|
|
|
|
tempValue = res === null || res === void 0 || (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.course_groups.map(function (item) {
|
|
|
|
|
tempValue = res === null || res === void 0 || (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.course_groups.map(function (item) {
|
|
|
|
|
return item === null || item === void 0 ? void 0 : item.course_group_id;
|
|
|
|
|
});
|
|
|
|
|
setCheckedClassLabel(templabel);
|
|
|
|
|
setCheckedClassValue(tempValue);
|
|
|
|
|
learnModes = res === null || res === void 0 || (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.subject_learning_modes;
|
|
|
|
|
if (Number((res === null || res === void 0 || (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.mode) === 1)) {
|
|
|
|
|
learnModes = res === null || res === void 0 || (_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : _res$data12.subject_learning_modes;
|
|
|
|
|
if (Number((res === null || res === void 0 || (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : _res$data13.mode) === 1)) {
|
|
|
|
|
temp = learnModes.map(function (item, index) {
|
|
|
|
|
checkedKeys.push([].concat(toConsumableArray_default()(item === null || item === void 0 ? void 0 : item.stage_ids), toConsumableArray_default()(item === null || item === void 0 ? void 0 : item.stage_shixun_ids)));
|
|
|
|
|
return item === null || item === void 0 ? void 0 : item.subject_learning_assocs;
|
|
|
|
|
@ -20429,7 +20432,18 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
});
|
|
|
|
|
setCheckedKeys(checkedKeys);
|
|
|
|
|
setCheckedNodes(treeDataList);
|
|
|
|
|
} else {}
|
|
|
|
|
} else {
|
|
|
|
|
tempList = learnModes.map(function (item) {
|
|
|
|
|
var relation_pro = {
|
|
|
|
|
selectShixunRowKeys: (item === null || item === void 0 ? void 0 : item.stage_shixun_ids) || [],
|
|
|
|
|
selectShixunRows: (item === null || item === void 0 ? void 0 : item.shixuns) || []
|
|
|
|
|
};
|
|
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
|
|
|
relation_pro: relation_pro
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
setShixunModeList(toConsumableArray_default()(tempList));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
@ -20447,10 +20461,11 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
getShixunData();
|
|
|
|
|
}, []);
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (!!learningPathId) {
|
|
|
|
|
if (!!learningPathId && visable) {
|
|
|
|
|
getLearnDetail();
|
|
|
|
|
}
|
|
|
|
|
}, [learningPathId]);
|
|
|
|
|
}, [learningPathId, visable]);
|
|
|
|
|
console.log('learningPathId--', learningPathId);
|
|
|
|
|
|
|
|
|
|
// 将勾选的数据按原始树结构重新组合
|
|
|
|
|
function buildNewTree(tree, checkedIds) {
|
|
|
|
|
@ -20593,11 +20608,11 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
name: item.type === 1 ? "\u7B2C".concat(index + 1, "\u6A21\u5757") : item.mode_name,
|
|
|
|
|
mode_type: item.type,
|
|
|
|
|
name: item.type === 1 ? "\u7B2C".concat(index + 1, "\u6A21\u5757") : item.name,
|
|
|
|
|
mode_type: item.mode_type,
|
|
|
|
|
cover_id: (item === null || item === void 0 ? void 0 : item.cover_id) || null,
|
|
|
|
|
stage_ids: item.type === 1 ? stage_ids : [],
|
|
|
|
|
stage_shixun_ids: item.type === 1 ? stage_shixun_ids : item.relation_pro.selectShixunRowKeys
|
|
|
|
|
stage_shixun_ids: item.mode_type === 1 ? stage_shixun_ids : item.relation_pro.selectShixunRowKeys
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -20610,6 +20625,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
return (0,paths/* updateShixunList */.TR)(objectSpread2_default()(objectSpread2_default()({
|
|
|
|
|
id: params.pathId
|
|
|
|
|
}, values), {}, {
|
|
|
|
|
subject_learning_path_id: learningPathId,
|
|
|
|
|
learning_modes: learning_modes
|
|
|
|
|
}));
|
|
|
|
|
case 7:
|
|
|
|
|
@ -20710,8 +20726,12 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
case 0:
|
|
|
|
|
console.log('values---', values);
|
|
|
|
|
console.log('attachment_id_b', attachment_id_b);
|
|
|
|
|
shixunModeList.push(values);
|
|
|
|
|
setShixunModeList(shixunModeList);
|
|
|
|
|
if (currShixunIndex > -1) {
|
|
|
|
|
shixunModeList.splice(currShixunIndex, 1, values);
|
|
|
|
|
} else {
|
|
|
|
|
shixunModeList.push(values);
|
|
|
|
|
}
|
|
|
|
|
setShixunModeList(toConsumableArray_default()(shixunModeList));
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context6.stop();
|
|
|
|
|
@ -20743,12 +20763,12 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
href: "/paths/".concat(params.pathId),
|
|
|
|
|
children: "\u5B9E\u8DF5\u8BFE\u7A0B\u8BE6\u60C5"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
|
|
|
children: !!learningPathId ? '新建学习路径' : '编辑学习路径'
|
|
|
|
|
children: !!learningPathId ? '编辑学习路径' : '新建学习路径'
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
|
|
className: AddLearnPathmodules.title,
|
|
|
|
|
children: !!learningPathId ? '新建学习路径' : '编辑学习路径'
|
|
|
|
|
children: !!learningPathId ? '编辑学习路径' : '新建学习路径'
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
|
|
form: form,
|
|
|
|
|
scrollToFirstError: true
|
|
|
|
|
@ -20802,6 +20822,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
setCurrEditIndex(-1);
|
|
|
|
|
setStageVis(true);
|
|
|
|
|
} else {
|
|
|
|
|
setCurrShixunIndex(-1);
|
|
|
|
|
setModeVis(true);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -20873,20 +20894,27 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "".concat(AddLearnPathmodules.editIcon, " current iconfont icon-bianji14"),
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
var _shixunModeList$index;
|
|
|
|
|
if (((_shixunModeList$index = shixunModeList[index]) === null || _shixunModeList$index === void 0 ? void 0 : _shixunModeList$index.type) === 2) {
|
|
|
|
|
var _shixunModeList$index2, _shixunModeList$index3;
|
|
|
|
|
setCurrShixunIndex(index);
|
|
|
|
|
if ((item === null || item === void 0 ? void 0 : item.mode_type) === 2) {
|
|
|
|
|
var _item$relation_pro, _item$relation_pro2;
|
|
|
|
|
console.log('shixunModeList[index]', shixunModeList[index]);
|
|
|
|
|
setSelectShixunRowKeys(toConsumableArray_default()(((_shixunModeList$index2 = shixunModeList[index]) === null || _shixunModeList$index2 === void 0 || (_shixunModeList$index2 = _shixunModeList$index2.relation_pro) === null || _shixunModeList$index2 === void 0 ? void 0 : _shixunModeList$index2.selectShixunRowKeys) || []));
|
|
|
|
|
setSelectShixunRows(toConsumableArray_default()(((_shixunModeList$index3 = shixunModeList[index]) === null || _shixunModeList$index3 === void 0 || (_shixunModeList$index3 = _shixunModeList$index3.relation_pro) === null || _shixunModeList$index3 === void 0 ? void 0 : _shixunModeList$index3.selectShixunRows) || []));
|
|
|
|
|
console.log("item--", item);
|
|
|
|
|
setSelectShixunRowKeys(toConsumableArray_default()(((_item$relation_pro = item.relation_pro) === null || _item$relation_pro === void 0 ? void 0 : _item$relation_pro.selectShixunRowKeys) || []));
|
|
|
|
|
setSelectShixunRows(toConsumableArray_default()((item === null || item === void 0 || (_item$relation_pro2 = item.relation_pro) === null || _item$relation_pro2 === void 0 ? void 0 : _item$relation_pro2.selectShixunRows) || []));
|
|
|
|
|
} else {
|
|
|
|
|
var _shixunModeList$index4, _shixunModeList$index5;
|
|
|
|
|
setCheckedNodes(toConsumableArray_default()(((_shixunModeList$index4 = shixunModeList[index]) === null || _shixunModeList$index4 === void 0 || (_shixunModeList$index4 = _shixunModeList$index4.relation_pro) === null || _shixunModeList$index4 === void 0 ? void 0 : _shixunModeList$index4.checkedNodes) || []));
|
|
|
|
|
setCheckedKeys(toConsumableArray_default()(((_shixunModeList$index5 = shixunModeList[index]) === null || _shixunModeList$index5 === void 0 || (_shixunModeList$index5 = _shixunModeList$index5.relation_pro) === null || _shixunModeList$index5 === void 0 ? void 0 : _shixunModeList$index5.checkedKeys) || []));
|
|
|
|
|
var _item$relation_pro3, _item$relation_pro4;
|
|
|
|
|
setCheckedNodes(toConsumableArray_default()(((_item$relation_pro3 = item.relation_pro) === null || _item$relation_pro3 === void 0 ? void 0 : _item$relation_pro3.checkedNodes) || []));
|
|
|
|
|
setCheckedKeys(toConsumableArray_default()((item === null || item === void 0 || (_item$relation_pro4 = item.relation_pro) === null || _item$relation_pro4 === void 0 ? void 0 : _item$relation_pro4.checkedKeys) || []));
|
|
|
|
|
}
|
|
|
|
|
setImageUrls(item === null || item === void 0 ? void 0 : item.cover_id);
|
|
|
|
|
setCurrShixunIndex(index);
|
|
|
|
|
form2.setFieldsValue(item);
|
|
|
|
|
var initialVal = {
|
|
|
|
|
name: item === null || item === void 0 ? void 0 : item.name,
|
|
|
|
|
mode_type: item.mode_type,
|
|
|
|
|
cover_id: item === null || item === void 0 ? void 0 : item.cover_id,
|
|
|
|
|
relation_pro: item === null || item === void 0 ? void 0 : item.relation_pro
|
|
|
|
|
};
|
|
|
|
|
form2.setFieldsValue(initialVal);
|
|
|
|
|
setFormValue2(objectSpread2_default()({}, initialVal));
|
|
|
|
|
setModeVis(true);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
@ -20912,7 +20940,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: AddLearnPathmodules.textWrap,
|
|
|
|
|
children: item === null || item === void 0 ? void 0 : item.mode_name
|
|
|
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
|
|
|
})]
|
|
|
|
|
}, index);
|
|
|
|
|
})
|
|
|
|
|
@ -20986,6 +21014,11 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
className: AddLearnPathmodules.close_button,
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
form.resetFields();
|
|
|
|
|
setCheckedClassLabel([]);
|
|
|
|
|
setCheckedClassValue([]);
|
|
|
|
|
setCheckedKeys([]);
|
|
|
|
|
setCheckedNodes([]);
|
|
|
|
|
setShixunModeList([]);
|
|
|
|
|
onCancel();
|
|
|
|
|
},
|
|
|
|
|
children: "\u53D6\u6D88"
|
|
|
|
|
@ -21147,7 +21180,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
maskClosable: false,
|
|
|
|
|
destroyOnClose: true,
|
|
|
|
|
afterClose: function afterClose() {
|
|
|
|
|
if (formValue2.type === 1) {
|
|
|
|
|
if (formValue2.mode_type === 1) {
|
|
|
|
|
setCheckedKeys([]);
|
|
|
|
|
setCheckedNodes([]);
|
|
|
|
|
}
|
|
|
|
|
@ -21158,7 +21191,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
title: "\u6DFB\u52A0\u5B66\u4E60\u6A21\u5757",
|
|
|
|
|
open: modeVis,
|
|
|
|
|
onOk: function onOk() {
|
|
|
|
|
if (formValue2.type === 2) {
|
|
|
|
|
if (formValue2.mode_type === 2) {
|
|
|
|
|
form2.setFieldValue('relation_pro', {
|
|
|
|
|
selectShixunRowKeys: selectShixunRowKeys,
|
|
|
|
|
selectShixunRows: selectShixunRows
|
|
|
|
|
@ -21184,14 +21217,14 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
form: form2,
|
|
|
|
|
scrollToFirstError: true,
|
|
|
|
|
initialValues: {
|
|
|
|
|
type: 1
|
|
|
|
|
mode_type: 1
|
|
|
|
|
},
|
|
|
|
|
onFinish: handleFinish2,
|
|
|
|
|
onValuesChange: function onValuesChange() {
|
|
|
|
|
setFormValue2(objectSpread2_default()({}, form2.getFieldsValue()));
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "mode_name",
|
|
|
|
|
name: "name",
|
|
|
|
|
label: "\u6A21\u5757\u540D\u79F0",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
@ -21203,7 +21236,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6A21\u5757\u540D\u79F0"
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "type",
|
|
|
|
|
name: "mode_type",
|
|
|
|
|
label: "\u7C7B\u578B",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
@ -21250,19 +21283,19 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, {
|
|
|
|
|
shape: "default",
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
if (formValue2.type === 2) {
|
|
|
|
|
if (formValue2.mode_type === 2) {
|
|
|
|
|
setRelateVis(true);
|
|
|
|
|
} else {
|
|
|
|
|
setStageVis(true);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
children: formValue2.type === 1 ? '选择章节' : '选择项目'
|
|
|
|
|
children: formValue2.mode_type === 1 ? '选择章节' : '选择项目'
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
marginLeft: '82px'
|
|
|
|
|
},
|
|
|
|
|
children: [formValue2.type === 2 && !relateVis && (selectShixunRows === null || selectShixunRows === void 0 ? void 0 : selectShixunRows.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: [formValue2.mode_type === 2 && !relateVis && (selectShixunRows === null || selectShixunRows === void 0 ? void 0 : selectShixunRows.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: selectShixunRows.map(function (item) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
@ -21293,7 +21326,7 @@ var NewLearnPathPage = function NewLearnPathPage(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
}, item.stage_shixun_id);
|
|
|
|
|
})
|
|
|
|
|
}), formValue2.type === 1 && !stageVis && (checkedNodes === null || checkedNodes === void 0 ? void 0 : checkedNodes.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
}), formValue2.mode_type === 1 && !stageVis && (checkedNodes === null || checkedNodes === void 0 ? void 0 : checkedNodes.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: AddLearnPathmodules.stageBox,
|
|
|
|
|
children: checkedNodes.map(function (item, index) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|