You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
516 lines
26 KiB
516 lines
26 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[43442],{
|
|
|
|
/***/ 77199:
|
|
/*!********************************************************************!*\
|
|
!*** ./src/pages/Classrooms/Lists/Board/Add/index.tsx + 1 modules ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ Add; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(11006);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(4781);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
var markdown_editor = __webpack_require__(61816);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(87885);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(7181);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules
|
|
var breadcrumb = __webpack_require__(66104);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(1056);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
var es_radio = __webpack_require__(5112);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
|
|
var date_picker = __webpack_require__(52409);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowLeftOutlined.js + 1 modules
|
|
var ArrowLeftOutlined = __webpack_require__(68742);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Board/Add/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Addmodules = ({"flex_box_center":"flex_box_center___Zr62V","flex_space_between":"flex_space_between___MocyP","flex_box_vertical_center":"flex_box_vertical_center___q9TyA","flex_box_center_end":"flex_box_center_end___uv4oS","flex_box_column":"flex_box_column___Tkhbw","title":"title___vcf30","export":"export___WECx3","bg":"bg___cLnNg","tabs":"tabs___fDuTh","btn":"btn___ckSh1","sticky":"sticky___Jdoog","publishRuleContent":"publishRuleContent___t7UUq","groupSelector":"groupSelector___DpKup","addAndDelete":"addAndDelete___BPOVW","deleteIcon":"deleteIcon___oqgJJ","addIcon":"addIcon___Bb3Pt"});
|
|
// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 3 modules
|
|
var MultiUpload = __webpack_require__(81882);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(71633);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(9498);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/MinusCircleOutlined.js + 1 modules
|
|
var MinusCircleOutlined = __webpack_require__(87306);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules
|
|
var PlusCircleOutlined = __webpack_require__(71029);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Board/Add/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddBoard = function AddBoard(_ref) {
|
|
var _userInfo$course, _boardsCategoryList$b, _value$subject, _detailCourseGroupsLi, _groupSettings;
|
|
var shixunHomeworks = _ref.shixunHomeworks,
|
|
classroomList = _ref.classroomList,
|
|
globalSetting = _ref.globalSetting,
|
|
boards = _ref.boards,
|
|
loading = _ref.loading,
|
|
user = _ref.user,
|
|
dispatch = _ref.dispatch;
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,_react_17_0_2_react.useState)({
|
|
content: ""
|
|
}),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
value = _useState2[0],
|
|
setValue = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([{}]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
groupSettings = _useState4[0],
|
|
setGroupSetting = _useState4[1];
|
|
var userInfo = user.userInfo;
|
|
var detailLeftMenus = classroomList.detailLeftMenus,
|
|
detailCourseGroupsList = classroomList.detailCourseGroupsList;
|
|
var boardsCategoryList = boards.boardsCategoryList;
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({
|
|
unified_setting: true //分班统一发布选择框
|
|
}),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
data = _useState6[0],
|
|
setData = _useState6[1];
|
|
console.log("boardsCategoryList", boardsCategoryList, detailCourseGroupsList);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
dispatch({
|
|
type: 'boards/getBoardsCategoryList',
|
|
payload: {
|
|
board_id: params.categoryId
|
|
}
|
|
});
|
|
dispatch({
|
|
type: 'classroomList/getCourseGroupsList',
|
|
payload: {
|
|
page: 1,
|
|
id: params.coursesId,
|
|
limit: 1000,
|
|
nonenavigate: true
|
|
}
|
|
});
|
|
}, [params.categoryId]);
|
|
// useEffect(() => {
|
|
// if (detailCourseGroupsList?.course_groups?.length > 0) {
|
|
// groupSettings = detailCourseGroupsList?.course_groups?.map((item: any) => {
|
|
// return {
|
|
// course_group_id: item.course_group_id,
|
|
// end_time: item.course_end_time,
|
|
// publish_time: item.course_publish_time
|
|
// }
|
|
// }) || [{}]
|
|
// setGroupSetting(groupSettings.length > 0 ? groupSettings : [{}])
|
|
|
|
// }
|
|
|
|
// }, [detailCourseGroupsList])
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
form.setFieldsValue({
|
|
select_board_id: parseInt(params.categoryId)
|
|
});
|
|
// console.log(JSON.stringify(classroomList.detailLeftMenus))
|
|
}, [classroomList.detailLeftMenus]);
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
className: Addmodules.bg,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "edu-container",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: "animated fadeIn",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: "mt10",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
|
|
separator: ">",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/board/").concat(params.categoryId || ''),
|
|
children: userInfo === null || userInfo === void 0 || (_userInfo$course = userInfo.course) === null || _userInfo$course === void 0 ? void 0 : _userInfo$course.course_name
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/board/").concat(params.categoryId || ''),
|
|
children: boardsCategoryList === null || boardsCategoryList === void 0 || (_boardsCategoryList$b = boardsCategoryList.boards) === null || _boardsCategoryList$b === void 0 || (_boardsCategoryList$b = _boardsCategoryList$b.filter(function (item) {
|
|
return item.id == params.categoryId;
|
|
})) === null || _boardsCategoryList$b === void 0 || (_boardsCategoryList$b = _boardsCategoryList$b[0]) === null || _boardsCategoryList$b === void 0 ? void 0 : _boardsCategoryList$b.name
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: "\u5E16\u5B50\u65B0\u5EFA"
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
className: [Addmodules.title, 'mt20'].join(' '),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/board/").concat(params.categoryId || ''),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ArrowLeftOutlined/* default */.Z, {
|
|
className: "font16 c-black"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
className: "font20 ml5",
|
|
children: "\u65B0\u5EFA\u5E16\u5B50"
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
layout: 'vertical',
|
|
form: form,
|
|
initialValues: {
|
|
name: "",
|
|
// .defaultValue={[params.categoryId]}
|
|
//select_board_id: parseInt(params.categoryId),
|
|
sticky: false
|
|
},
|
|
scrollToFirstError: true,
|
|
onValuesChange: function onValuesChange(value) {
|
|
setValue(objectSpread2_default()({}, value));
|
|
},
|
|
onFinish: /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(v) {
|
|
var _v$attachment_ids, _boardsCategoryList$b2;
|
|
var select_board_id, res, _res$data;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
v.attachment_ids = (_v$attachment_ids = v.attachment_ids) === null || _v$attachment_ids === void 0 ? void 0 : _v$attachment_ids.map(function (v) {
|
|
return v.response.id;
|
|
});
|
|
if (!(0,authority/* isAdmins */.eB)()) {
|
|
_context.next = 9;
|
|
break;
|
|
}
|
|
v.unified_setting = data.unified_setting;
|
|
v.group_settings = groupSettings;
|
|
if (data.unified_setting) {
|
|
_context.next = 9;
|
|
break;
|
|
}
|
|
if (groupSettings.length) {
|
|
_context.next = 8;
|
|
break;
|
|
}
|
|
message/* default */.ZP.warning('提交失败:分班发布设置不能为空');
|
|
return _context.abrupt("return");
|
|
case 8:
|
|
groupSettings.map(function (item) {
|
|
if (!item.group_id) {
|
|
message/* default */.ZP.error('分班不能为空');
|
|
throw new String("分班不能为空");
|
|
}
|
|
if (!item.publish_time) {
|
|
message/* default */.ZP.error('发布时间不能为空');
|
|
throw new String("发布时间不能为空");
|
|
}
|
|
});
|
|
case 9:
|
|
select_board_id = boardsCategoryList === null || boardsCategoryList === void 0 || (_boardsCategoryList$b2 = boardsCategoryList.boards) === null || _boardsCategoryList$b2 === void 0 || (_boardsCategoryList$b2 = _boardsCategoryList$b2.filter(function (item) {
|
|
return item.name == "未分配目录";
|
|
})) === null || _boardsCategoryList$b2 === void 0 || (_boardsCategoryList$b2 = _boardsCategoryList$b2[0]) === null || _boardsCategoryList$b2 === void 0 ? void 0 : _boardsCategoryList$b2.id;
|
|
v = objectSpread2_default()(objectSpread2_default()({}, v), {}, {
|
|
select_board_id: select_board_id
|
|
});
|
|
_context.next = 13;
|
|
return (0,fetch/* default */.ZP)("/api/boards/".concat(params.categoryId, "/messages.json"), {
|
|
method: "post",
|
|
body: v
|
|
});
|
|
case 13:
|
|
res = _context.sent;
|
|
if (res.status === 0) {
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '讨论', '发帖']);
|
|
message/* default */.ZP.success("发布成功");
|
|
_umi_production_exports.history.push("/classrooms/".concat(params.coursesId, "/board/").concat(params.categoryId, "/Detail/").concat(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.id));
|
|
}
|
|
case 15:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function (_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}(),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
className: "mt30 relative bg-white pl30 pr30 pt30 w100 inline-block",
|
|
children: [(0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "",
|
|
name: "sticky",
|
|
valuePropName: "checked",
|
|
className: Addmodules.sticky,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
children: "\u7F6E\u9876"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u6807\u9898",
|
|
name: "subject",
|
|
rules: [{
|
|
required: true,
|
|
message: "请输入标题"
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
suffix: "".concat(((_value$subject = value.subject) === null || _value$subject === void 0 ? void 0 : _value$subject.length) || 0, "/60"),
|
|
maxLength: 60
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
label: "\u5185\u5BB9",
|
|
name: "content",
|
|
rules: [{
|
|
required: true,
|
|
message: "请输入内容"
|
|
}],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
watch: true,
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u5E16\u5B50\u8BE6\u60C5\uFF0C\u6700\u5927\u9650\u5236\u4E3A10000\u4E2A\u5B57\u7B26"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
name: "attachment_ids",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {})
|
|
}), (0,authority/* isAdmins */.eB)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
onChange: function onChange() {
|
|
data.unified_setting = !data.unified_setting;
|
|
setData(Object.assign({}, data));
|
|
},
|
|
value: data.unified_setting,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: true,
|
|
children: "\u7EDF\u4E00\u53D1\u5E03"
|
|
}), (detailCourseGroupsList === null || detailCourseGroupsList === void 0 || (_detailCourseGroupsLi = detailCourseGroupsList.course_groups) === null || _detailCourseGroupsLi === void 0 ? void 0 : _detailCourseGroupsLi.length) > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
value: false,
|
|
children: "\u5206\u73ED\u53D1\u5E03"
|
|
})]
|
|
}), (data === null || data === void 0 ? void 0 : data.unified_setting) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
style: {
|
|
marginTop: 16
|
|
},
|
|
rules: [{
|
|
required: true,
|
|
message: "请选择发布时间"
|
|
}],
|
|
label: "\u53D1\u5E03\u65F6\u95F4",
|
|
name: "publish_time",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
showTime: {
|
|
format: 'HH:mm'
|
|
},
|
|
disabledDate: function disabledDate(current) {
|
|
return current && current < dayjs_min_default()().subtract(1, "days");
|
|
},
|
|
style: {
|
|
width: '100%'
|
|
}
|
|
})
|
|
}), !data.unified_setting && /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
children: groupSettings && ((_groupSettings = groupSettings) === null || _groupSettings === void 0 ? void 0 : _groupSettings.map(function (v, k) {
|
|
var _detailCourseGroupsLi2;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
span: 24,
|
|
style: {
|
|
marginTop: 30
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
className: "".concat(Addmodules.publishRuleIndex),
|
|
align: "middle",
|
|
children: ["\u53D1\u5E03\u89C4\u5219 ", k + 1]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
className: "".concat(Addmodules.publishRuleContent, " ").concat(Addmodules.contentInterval),
|
|
align: "middle",
|
|
wrap: false,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
children: "\u73ED\u7EA7"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
className: Addmodules.groupSelector,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
showArrow: true,
|
|
allowClear: true
|
|
// disabled={disabled || rulesDiabledCourses(v)}
|
|
,
|
|
style: {
|
|
width: '100%'
|
|
},
|
|
mode: "multiple",
|
|
size: 'middle',
|
|
value: v.course_group_id,
|
|
placeholder: "\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",
|
|
optionFilterProp: "label",
|
|
onChange: function onChange(value) {
|
|
groupSettings[k]['group_id'] = value;
|
|
setGroupSetting(groupSettings.slice());
|
|
detailCourseGroupsList.course_groups.map(function (item, index) {
|
|
value.map(function (val, j) {
|
|
if (item.id === val) {
|
|
item.cilckkey = k;
|
|
item.isselect = true;
|
|
}
|
|
});
|
|
});
|
|
// console.log('---', value);
|
|
},
|
|
|
|
onDeselect: function onDeselect(value) {
|
|
detailCourseGroupsList.course_groups.map(function (item, index) {
|
|
if (item.id === value && item.cilckkey === k) {
|
|
item.cilckkey = k;
|
|
item.isselect = false;
|
|
}
|
|
});
|
|
},
|
|
children: detailCourseGroupsList.course_groups && ((_detailCourseGroupsLi2 = detailCourseGroupsList.course_groups) === null || _detailCourseGroupsLi2 === void 0 ? void 0 : _detailCourseGroupsLi2.filter(function (item) {
|
|
return item.edit_auth;
|
|
}).map(function (v, k1) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
|
|
disabled: (v === null || v === void 0 ? void 0 : v.isselect) && v.cilckkey != k,
|
|
label: v.course_group_name,
|
|
value: v.id,
|
|
children: v.name
|
|
}, v.id);
|
|
}))
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
children: "\u53D1\u5E03\u65F6\u95F4"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: 1,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
showTime: {
|
|
format: 'HH:mm'
|
|
},
|
|
onChange: function onChange(value, valuelist) {
|
|
groupSettings[k]['publish_time'] = value;
|
|
setGroupSetting(toConsumableArray_default()(groupSettings));
|
|
},
|
|
disabledDate: function disabledDate(current) {
|
|
return current && current < dayjs_min_default()().subtract(1, "days");
|
|
},
|
|
style: {
|
|
width: '100%'
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
className: Addmodules.addAndDelete,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(MinusCircleOutlined/* default */.Z, {
|
|
style: {
|
|
visibility: (v !== null && v !== void 0 && v.publish_time && dayjs_min_default()() < dayjs_min_default()(v === null || v === void 0 ? void 0 : v.publish_time) || !(v !== null && v !== void 0 && v.publish_time)) && k != 0 ? 'visible' : 'hidden'
|
|
},
|
|
className: Addmodules.deleteIcon,
|
|
onClick: function onClick() {
|
|
groupSettings = groupSettings.filter(function (val, key) {
|
|
return k !== key;
|
|
});
|
|
setGroupSetting(toConsumableArray_default()(groupSettings));
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PlusCircleOutlined/* default */.Z, {
|
|
className: Addmodules.addIcon,
|
|
onClick: function onClick() {
|
|
setGroupSetting(groupSettings.concat({
|
|
"new": true
|
|
}));
|
|
}
|
|
})]
|
|
})]
|
|
})]
|
|
}, k);
|
|
}))
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: [Addmodules.btn, 'mt20'].join(' '),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
htmlType: "submit",
|
|
size: 'middle',
|
|
type: "primary",
|
|
children: "\u63D0\u4EA4"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
size: 'middle',
|
|
ghost: true,
|
|
type: "primary",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/board/").concat(params.categoryId),
|
|
children: "\u53D6\u6D88"
|
|
})
|
|
})]
|
|
})
|
|
})]
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var Add = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var shixunHomeworks = _ref3.shixunHomeworks,
|
|
classroomList = _ref3.classroomList,
|
|
loading = _ref3.loading,
|
|
user = _ref3.user,
|
|
boards = _ref3.boards,
|
|
globalSetting = _ref3.globalSetting;
|
|
return {
|
|
shixunHomeworks: shixunHomeworks,
|
|
globalSetting: globalSetting,
|
|
classroomList: classroomList,
|
|
user: user,
|
|
boards: boards,
|
|
loading: loading.effects
|
|
};
|
|
})(AddBoard));
|
|
|
|
/***/ })
|
|
|
|
}]); |