"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[74582,60783,1510],{
/***/ 46852:
/*!********************************************************!*\
!*** ./src/components/CutOffNow/index.tsx + 1 modules ***!
\********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ CutOffNow; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
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: ./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/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 12 modules
var date_picker = __webpack_require__(47119);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
var input = __webpack_require__(92832);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(1710);
// 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/_dayjs@1.11.19@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(66649);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(20681);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(25789);
;// CONCATENATED MODULE: ./src/components/CutOffNow/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var CutOffNowmodules = ({"tips":"tips___e8J4O","homeworkType":"homeworkType___ZjN2X","antdTable":"antdTable___amDdp","modalWrapper":"modalWrapper___XPojI"});
// EXTERNAL MODULE: ./src/service/classrooms.ts
var classrooms = __webpack_require__(16709);
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/Detail/components/ConfigWorks/Releasesetting.tsx
var Releasesetting = __webpack_require__(6295);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/CutOffNow/index.tsx
var CuttOffNow = function CuttOffNow(_ref) {
var dispatch = _ref.dispatch,
courseEndTime = _ref.courseEndTime,
classroomList = _ref.classroomList,
_ref$successCallback = _ref.successCallback,
successCallback = _ref$successCallback === void 0 ? function () {} : _ref$successCallback,
visible = _ref.visible,
homeworkIds = _ref.homeworkIds,
courseId = _ref.courseId,
isBatch = _ref.isBatch,
shixunHomeworks = _ref.shixunHomeworks;
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)(false),
_useState2 = slicedToArray_default()(_useState, 2),
tableLoading = _useState2[0],
setTableLoading = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
confirmLoading = _useState4[0],
setConfirmLoading = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
noGroup = _useState6[0],
setNoGroup = _useState6[1];
//作业截止
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
submitCourseGroups = _useState8[0],
setSubmitCourseGroups = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)([]),
_useState10 = slicedToArray_default()(_useState9, 2),
submitCourseTableData = _useState10[0],
setSubmitCourseTableData = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)([]),
_useState12 = slicedToArray_default()(_useState11, 2),
selectedSubmitCourseIds = _useState12[0],
setSelectedSubmitCourseIds = _useState12[1];
//补交截止
var _useState13 = (0,_react_17_0_2_react.useState)([]),
_useState14 = slicedToArray_default()(_useState13, 2),
lateCourseGroups = _useState14[0],
setLateCourseGroups = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)([]),
_useState16 = slicedToArray_default()(_useState15, 2),
lateCourseTableData = _useState16[0],
setLateCourseTableData = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)([]),
_useState18 = slicedToArray_default()(_useState17, 2),
selectedLateCourseIds = _useState18[0],
setSelectedLateCourseIds = _useState18[1];
//批量截止
var _useState19 = (0,_react_17_0_2_react.useState)([]),
_useState20 = slicedToArray_default()(_useState19, 2),
allCourseGroups = _useState20[0],
setAllCourseGroups = _useState20[1];
var _useState21 = (0,_react_17_0_2_react.useState)([]),
_useState22 = slicedToArray_default()(_useState21, 2),
allCourseTableData = _useState22[0],
setAllCourseTableData = _useState22[1];
var _useState23 = (0,_react_17_0_2_react.useState)([]),
_useState24 = slicedToArray_default()(_useState23, 2),
selectedAllCourseIds = _useState24[0],
setSelectedAllCourseIds = _useState24[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (visible) {
getData();
} else {
clear();
}
}, [visible]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setTableLoading(true);
_context.next = 3;
return (0,classrooms/* getAllowEndGroups */.oR)(homeworkIds[0], {
course_id: courseId
});
case 3:
res = _context.sent;
setNoGroup(res.no_group);
if (isBatch) {
setAllCourseGroups(res.all_course_groups);
setAllCourseTableData(res.all_course_groups);
} else {
setLateCourseGroups(res.late_course_groups);
setLateCourseTableData(res.late_course_groups);
setSubmitCourseGroups(res.submit_course_groups);
setSubmitCourseTableData(res.submit_course_groups);
}
setTableLoading(false);
form.setFieldsValue({
'end_time': dayjs_min_default()()
});
case 8:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var handleOk = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var formValue, endTimeString, selectNothing, res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
formValue = form.getFieldsValue();
endTimeString = dayjs_min_default()(formValue.end_time).format('YYYY-MM-DD HH:mm');
selectNothing = isBatch ? selectedAllCourseIds.length === 0 : selectedSubmitCourseIds.length === 0 && selectedLateCourseIds.length === 0;
if (!(selectNothing && !noGroup)) {
_context2.next = 6;
break;
}
message/* default */.ZP.warning('请选择需要操作的班级');
return _context2.abrupt("return");
case 6:
setConfirmLoading(true);
_context2.next = 9;
return (0,classrooms/* stopHomework */.Mc)(courseId, {
no_group: noGroup,
homework_ids: homeworkIds,
group_ids: isBatch ? selectedAllCourseIds : selectedSubmitCourseIds,
end_time: endTimeString,
late_group_ids: isBatch ? selectedAllCourseIds : selectedLateCourseIds
});
case 9:
res = _context2.sent;
setConfirmLoading(false);
if (res.status === 0) {
clear();
message/* default */.ZP.success('操作成功');
successCallback();
dispatch({
type: 'classroomList/setActionTabs',
payload: {
key: '清除选择数据'
}
});
}
case 12:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleOk() {
return _ref3.apply(this, arguments);
};
}();
var clear = function clear() {
setSelectedSubmitCourseIds([]);
setSelectedLateCourseIds([]);
setSubmitCourseTableData([]);
setLateCourseTableData([]);
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
centered: true,
title: "\u7ACB\u5373\u622A\u6B62",
className: CutOffNowmodules.modalWrapper,
width: isBatch || noGroup ? 520 : 760,
open: visible,
confirmLoading: confirmLoading,
destroyOnClose: true,
okText: "\u622A\u6B62",
cancelText: "\u53D6\u6D88",
onOk: function onOk() {
return handleOk();
},
onCancel: function onCancel() {
clear();
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: CutOffNowmodules.tips,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "1\u3001\u622A\u6B62\u540E\u5B66\u5458\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "2\u3001\u672C\u64CD\u4F5C\u53EA\u5BF9\u201C\u63D0\u4EA4\u4E2D\u201D\u3001\u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548\u3002"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
form: form,
layout: "vertical",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "end_time",
label: "\u622A\u6B62\u65F6\u95F4",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
style: {
width: '100%'
},
disabledDate: function disabledDate(current) {
return (0,Releasesetting/* disabledDate */.Q8)(current, courseEndTime);
},
disabledTime: function disabledTime(current) {
return (0,Releasesetting/* disabledTime */.d0)(current);
},
placeholder: '请选择结束时间',
showTime: {
format: 'HH:mm',
defaultValue: dayjs_min_default()((0,util/* HalfPastOne */.U6)(), 'HH:mm')
},
format: "YYYY-MM-DD HH:mm",
allowClear: false
})
})
}), !noGroup && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: isBatch ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
placeholder: "\u641C\u7D22\u73ED\u7EA7"
// suffix={}
,
onChange: function onChange(e) {
setAllCourseTableData(allCourseGroups.filter(function (item) {
return item.name.indexOf(e.target.value) > -1;
}));
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
style: {
marginTop: '10px',
height: '300px',
overflow: 'auto'
},
className: CutOffNowmodules.antdTable,
rowSelection: {
type: 'checkbox',
onChange: function onChange(selectedRowKeys) {
setSelectedAllCourseIds(selectedRowKeys);
}
},
rowKey: "id",
pagination: false,
dataSource: allCourseTableData,
loading: tableLoading,
columns: [{
title: '班级',
dataIndex: 'name'
}]
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: 24,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 14,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CutOffNowmodules.homeworkType,
children: "\u4F5C\u4E1A\u622A\u6B62"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
placeholder: "\u641C\u7D22\u73ED\u7EA7"
// suffix={}
,
onChange: function onChange(e) {
setSubmitCourseTableData(submitCourseGroups.filter(function (item) {
return item.name.indexOf(e.target.value) > -1;
}));
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CutOffNowmodules.tableWrapper,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
style: {
marginTop: '10px',
height: '260px',
overflow: 'auto'
},
className: CutOffNowmodules.antdTable,
rowSelection: {
type: 'checkbox',
onChange: function onChange(selectedRowKeys) {
setSelectedSubmitCourseIds(selectedRowKeys);
}
},
rowKey: "id",
pagination: false,
dataSource: submitCourseTableData,
loading: tableLoading,
columns: [{
title: '班级',
dataIndex: 'name',
ellipsis: true
}, {
title: '发布时间',
dataIndex: 'publish_time'
}, {
title: '截止时间',
dataIndex: 'end_time'
}]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: 10,
style: {
maxWidth: "280px"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CutOffNowmodules.homeworkType,
children: "\u8865\u4EA4\u622A\u6B62"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
placeholder: "\u641C\u7D22\u73ED\u7EA7",
onChange: function onChange(e) {
setLateCourseTableData(lateCourseGroups.filter(function (item) {
return item.name.indexOf(e.target.value) > -1;
}));
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CutOffNowmodules.tableWrapper,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
style: {
marginTop: '10px',
height: '260px',
overflow: 'auto',
maxWidth: "280px"
},
className: CutOffNowmodules.antdTable,
rowSelection: {
type: 'checkbox',
onChange: function onChange(selectedRowKeys) {
setSelectedLateCourseIds(selectedRowKeys);
}
},
rowKey: "id",
pagination: false,
loading: tableLoading,
dataSource: lateCourseTableData,
columns: [{
title: '班级',
dataIndex: 'name',
ellipsis: true,
width: 120
}, {
title: '截止时间',
dataIndex: 'late_time'
}]
})
})]
})]
})
})]
});
};
/* harmony default export */ var CutOffNow = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunHomeworks = _ref4.shixunHomeworks,
classroomList = _ref4.classroomList;
return {
shixunHomeworks: shixunHomeworks,
classroomList: classroomList
};
})(CuttOffNow));
/***/ }),
/***/ 60783:
/*!**********************************************************!*\
!*** ./src/components/MultiUpload/index.tsx + 3 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
z: function() { return /* binding */ coverToFileList; },
Z: function() { return /* binding */ MultiUpload; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(37205);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
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: ./node_modules/_antd@5.9.0@antd/es/upload/index.js
var upload = __webpack_require__(60028);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var es_message = __webpack_require__(8591);
// 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/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(14160);
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
var service = __webpack_require__(61580);
// EXTERNAL MODULE: ./src/assets/images/uploadImg.svg
var images_uploadImg = __webpack_require__(12803);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/SingleUpload/index.tsx
var uploadNameSizeSeperator = ' ';
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt('' + Math.floor(Math.log(bytes) / Math.log(1024)), 10);
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
}
/* harmony default export */ var SingleUpload = (function (_ref) {
var _ref$value = _ref.value,
value = _ref$value === void 0 ? [] : _ref$value,
action = _ref.action,
_onChange = _ref.onChange,
className = _ref.className,
_ref$maxSize = _ref.maxSize,
maxSize = _ref$maxSize === void 0 ? 150 : _ref$maxSize,
_ref$title = _ref.title,
title = _ref$title === void 0 ? '文件上传' : _ref$title,
_ref$accept = _ref.accept,
accept = _ref$accept === void 0 ? null : _ref$accept,
_ref$tip = _ref.tip,
tip = _ref$tip === void 0 ? undefined : _ref$tip;
var uploadProps = {
multiple: false,
fileList: value,
accept: accept,
withCredentials: true,
beforeUpload: function beforeUpload(file) {
var fileSize = file.size / 1024 / 1024;
if (!(fileSize < maxSize)) {
message.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"));
return Promise.reject();
}
return true;
},
action: "".concat(ENV.API_SERVER, "/api/attachments.json"),
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
onChange: function onChange(info) {
var _info$file;
var fileList = _toConsumableArray(info.fileList);
fileList = fileList.map(function (file) {
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
}
return _objectSpread({}, file);
});
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
var _info$file2;
message.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
_onChange([]);
return;
}
_onChange(fileList);
},
onRemove: function () {
var _onRemove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
var fileSize, id, rs;
return _regeneratorRuntime().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
fileSize = file.size / 1024 / 1024;
if (!(file.status === 'uploading')) {
_context.next = 3;
break;
}
return _context.abrupt("return", true);
case 3:
if (fileSize < maxSize) {
_context.next = 7;
break;
}
return _context.abrupt("return", true);
case 7:
id = file.response ? file.response.id : file.uid;
if (!id) {
_context.next = 15;
break;
}
_context.next = 11;
return removeAttachment(file.response ? file.response.id : file.id);
case 11:
rs = _context.sent;
return _context.abrupt("return", rs);
case 15:
return _context.abrupt("return", true);
case 16:
case "end":
return _context.stop();
}
}, _callee);
}));
function onRemove(_x) {
return _onRemove.apply(this, arguments);
}
return onRemove;
}()
};
function onCancel(e) {
e.preventDefault();
e.stopPropagation();
}
return /*#__PURE__*/_jsx("div", {
className: "single-upload ".concat(className ? className : ''),
children: /*#__PURE__*/_jsxs(Upload, _objectSpread(_objectSpread({}, uploadProps), {}, {
children: [/*#__PURE__*/_jsxs(Button
// type="primary"
, {
title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
disabled: value.length > 0
// ghost
,
className: "upload_button",
children: [/*#__PURE__*/_jsx("img", {
className: "aBtn_img",
src: uploadImg
}), title]
}), /*#__PURE__*/_jsx("span", {
onClick: onCancel,
className: "upload_text",
children: tip ? tip : "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927".concat(maxSize, "M)")
})]
}))
});
});
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LinkOutlined.js + 1 modules
var LinkOutlined = __webpack_require__(15278);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
var InboxOutlined = __webpack_require__(61481);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.23@lodash/lodash.js
var lodash = __webpack_require__(78267);
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.less
// extracted by mini-css-extract-plugin
;// CONCATENATED MODULE: ./src/assets/images/disupload.png
var disupload_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAAXNSR0IArs4c6QAAAT1JREFUSEvtljFOxDAQRT1GSKk4CFwgNGOLhmIrhIAGiQ5atuUAtGwLHRINIERFQYPsacgF4CBUkRAzyKsUq8DGToKonNbz/xtPfkYBNeBxzp0FmbX2vK8c+gqI6JSZL4JOaz1FxFkfj15A7/2xiFwuAgDgxBhzlQpNBhLRoYhci4huARkAjhDxJgWaBCSiXWa+VUqtLDH90lofIOJDDBoFEtFERB5FZLXLDAA+AWAHEZ8667oOvfdbIhIMiljnzXkNABNjzMuy+ugN20IiWmfmtyalG4j4ntjMvCwDf0wrjzQWoP8PjXNOmq72rbX3sQ6HvEPn3J5S6m7+WWTgX2yaPNLOoOaU/jaeUaGpqmqtruvtYFwUxXNZlh+xZTEKGDPvc8Pwr/k6xDBBs6mUmrZXW4JufMniLh3vluDwDTtJLJ7BMSj1AAAAAElFTkSuQmCC";
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(20681);
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
var Dragger = upload/* default */.Z.Dragger;
function coverToFileList(data) {
var rs = [];
if (data && data.length > 0) {
rs = data.map(function (item) {
return {
uid: item.id,
id: item.id,
name: item.title + uploadNameSizeSeperator + item.filesize,
url: item.url,
filesize: item.filesize,
status: 'done',
response: {
id: item.id
}
};
});
}
return rs;
}
/* harmony default export */ var MultiUpload = (function (_ref) {
var value = _ref.value,
_onChange = _ref.onChange,
action = _ref.action,
data = _ref.data,
className = _ref.className,
_ref$maxSize = _ref.maxSize,
maxSize = _ref$maxSize === void 0 ? 5 : _ref$maxSize,
_ref$title = _ref.title,
title = _ref$title === void 0 ? '上传附件' : _ref$title,
_ref$showRemoveModal = _ref.showRemoveModal,
showRemoveModal = _ref$showRemoveModal === void 0 ? false : _ref$showRemoveModal,
_ref$accept = _ref.accept,
accept = _ref$accept === void 0 ? '' : _ref$accept,
additionalText = _ref.additionalText,
isDragger = _ref.isDragger,
_ref$number = _ref.number,
number = _ref$number === void 0 ? 1000 : _ref$number,
_ref$aloneClear = _ref.aloneClear,
aloneClear = _ref$aloneClear === void 0 ? false : _ref$aloneClear,
_ref$tip = _ref.tip,
tip = _ref$tip === void 0 ? '' : _ref$tip,
_ref$tipStyle = _ref.tipStyle,
tipStyle = _ref$tipStyle === void 0 ? {} : _ref$tipStyle,
_ref$showDeleteButton = _ref.showDeleteButton,
showDeleteButton = _ref$showDeleteButton === void 0 ? true : _ref$showDeleteButton;
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
disabled = _useState2[0],
setDisabled = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(value || []),
_useState4 = slicedToArray_default()(_useState3, 2),
fileList = _useState4[0],
setFileList = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(1),
_useState6 = slicedToArray_default()(_useState5, 2),
nums = _useState6[0],
setnums = _useState6[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (value) {
if (nums === 1) {
setFileList(toConsumableArray_default()(value));
}
setnums(2);
if (number === (value === null || value === void 0 ? void 0 : value.length)) {
setDisabled(true);
}
}
}, [value]);
var clearLastFile = function clearLastFile() {
setTimeout(function () {
fileList.pop();
setFileList(toConsumableArray_default()(fileList));
}, 500);
};
var uploadProps = {
multiple: true,
disabled: false,
accept: accept,
withCredentials: true,
fileList: fileList,
// fileList: fileList?.length ? fileList : value,
beforeUpload: function beforeUpload(file, fileArr) {
var fileSize = file.size / 1024 / 1024 / 1024;
if (fileList.concat(fileArr).length > number) {
fileList.pop();
setFileList(toConsumableArray_default()(fileList));
es_message/* default */.ZP.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(number, "\u4E2A\u6587\u4EF6"));
if (aloneClear) {
return Promise.reject();
}
clearLastFile();
return false;
}
if (!(fileSize < maxSize)) {
es_message/* default */.ZP.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "GB)."));
if (aloneClear) {
return Promise.reject();
}
clearLastFile();
return false;
}
return true;
},
data: data,
itemRender: function itemRender(originNode, file) {
return showDeleteButton ? originNode : /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
wrap: false,
align: "middle",
justify: "space-between",
className: "ant-upload-list-item ant-upload-list-item-done File",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
download: "download",
onClick: function onClick(e) {
var _file$url;
console.log(file, 'file');
e.preventDefault();
(0,util/* downLoadLink */.Nd)('', "".concat(env/* default */.Z.API_SERVER).concat(file === null || file === void 0 || (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.replace('disposition=inline', '')));
},
title: file === null || file === void 0 ? void 0 : file.name,
href: file.url,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LinkOutlined/* default */.Z, {
className: "mr10 c-grey-666"
}), (0,util/* cutFileName */.tP)(file === null || file === void 0 ? void 0 : file.name, 35)]
})
});
},
action: action || "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
onChange: function onChange(info) {
var _info$file;
if (info.file.status === "removed") {
fileList = info.fileList;
} else {
fileList = (0,lodash.uniqBy)([].concat(toConsumableArray_default()(info.fileList), toConsumableArray_default()(fileList)), 'uid');
}
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 || (_info$file = _info$file.response) === null || _info$file === void 0 ? void 0 : _info$file.status) === -1) {
var _info$file2;
es_message/* default */.ZP.error((_info$file2 = info.file) === null || _info$file2 === void 0 || (_info$file2 = _info$file2.response) === null || _info$file2 === void 0 ? void 0 : _info$file2.message);
return;
}
if (fileList.length >= number) setDisabled(true);else setDisabled(false);
setFileList(toConsumableArray_default()(fileList));
fileList = fileList.map(function (file) {
var _file$response;
if (file !== null && file !== void 0 && (_file$response = file.response) !== null && _file$response !== void 0 && _file$response.id) {
var _file$response2;
file.url = "/api/attachments/".concat(file === null || file === void 0 || (_file$response2 = file.response) === null || _file$response2 === void 0 ? void 0 : _file$response2.id);
}
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
}
return objectSpread2_default()({}, file);
});
console.log('info:', info, fileList);
_onChange(fileList);
},
onRemove: function () {
var _onRemove = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(file) {
var remove;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
remove = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var id, rs;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
id = file.response ? file.response.id : file.id;
if (!id) {
_context.next = 8;
break;
}
_context.next = 4;
return (0,service/* removeAttachment */.JZ)(file.response ? file.response.id : file.uid);
case 4:
rs = _context.sent;
return _context.abrupt("return", Promise.resolve(rs));
case 8:
return _context.abrupt("return", true);
case 9:
case "end":
return _context.stop();
}
}, _callee);
}));
return function remove() {
return _ref2.apply(this, arguments);
};
}();
if (!showRemoveModal) {
_context3.next = 5;
break;
}
return _context3.abrupt("return", new Promise(function (resolve, reject) {
modal/* default */.Z.confirm({
centered: true,
width: 530,
okText: '确定',
cancelText: '取消',
title: '提示',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc font16",
children: "\u662F\u5426\u786E\u8BA4\u5220\u9664?"
}),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return remove();
case 2:
res = _context2.sent;
es_message/* default */.ZP.success('删除成功');
resolve(true);
case 5:
case "end":
return _context2.stop();
}
}, _callee2);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}(),
onCancel: function onCancel() {
return resolve(false);
}
});
}));
case 5:
_context3.next = 7;
return remove();
case 7:
return _context3.abrupt("return", _context3.sent);
case 8:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function onRemove(_x) {
return _onRemove.apply(this, arguments);
}
return onRemove;
}()
};
function onCancel(e) {
e.preventDefault();
e.stopPropagation();
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "multi-upload ".concat(className ? className : ''),
children: [isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(Dragger, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "ant-upload-drag-icon",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(InboxOutlined/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "ant-upload-text",
children: ["\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A", maxSize, "MB)", ' ']
}), additionalText]
})), !isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
disabled: disabled,
className: disabled ? 'disable_upload_button' : 'upload_button',
title: disabled ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: "aBtn_img",
src: !disabled ? images_uploadImg/* default */.Z : disupload_namespaceObject
}), title]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: onCancel,
className: "upload_text",
style: objectSpread2_default()({}, tipStyle),
children: tip ? tip : "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927".concat(maxSize, "GB)")
})]
}))]
});
});
/***/ }),
/***/ 25402:
/*!*******************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/GroupHomework/components/AfterAppendix.tsx ***!
\*******************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 92832);
/* harmony import */ var _service_shixunHomeworks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/service/shixunHomeworks */ 35457);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! umi */ 25789);
/* harmony import */ var _components_MultiUpload__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/MultiUpload */ 60783);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var PublishShixun = function PublishShixun(_ref) {
var classroomList = _ref.classroomList,
loading = _ref.loading,
dispatch = _ref.dispatch;
var params = (0,umi__WEBPACK_IMPORTED_MODULE_6__.useParams)();
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.useForm(),
_Form$useForm2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_Form$useForm, 1),
form = _Form$useForm2[0];
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
centered: true,
title: "\u8865\u4EA4\u9644\u4EF6",
open: classroomList.actionTabs.key === '补交附件' ? true : false,
bodyStyle: {
minHeight: 200
},
onOk: /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee() {
var _formValue$attachment;
var formValue, selectArrs, res;
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return form.validateFields();
case 2:
formValue = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, form.getFieldValue());
selectArrs = classroomList.actionTabs.selectArrs;
formValue.attachment_ids = (_formValue$attachment = formValue.attachment_ids) === null || _formValue$attachment === void 0 ? void 0 : _formValue$attachment.map(function (item) {
return item.response.id;
});
_context.next = 7;
return (0,_service_shixunHomeworks__WEBPACK_IMPORTED_MODULE_5__/* .reviseAttachment */ .mz)(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, formValue), {}, {
homeworkId: selectArrs.work_id
}));
case 7:
res = _context.sent;
if (res.status === 0) {
// history.push(`/classrooms/${params.coursesId}/group_homework/${selectArrs.homework_id}/review/${selectArrs.work_id}`)
form.resetFields();
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
}
case 9:
case "end":
return _context.stop();
}
}, _callee);
})),
onCancel: function onCancel() {
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
form: form,
initialValues: {},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.Item, {
name: "attachment_ids",
rules: [{
required: true,
message: "请上传附件"
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_MultiUpload__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.Item, {
name: "description",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z.TextArea, {
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",
rows: 7
})
})]
})
});
};
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_6__.connect)(function (_ref3) {
var classroomList = _ref3.classroomList,
loading = _ref3.loading;
return {
classroomList: classroomList,
loading: loading
};
})(PublishShixun));
/***/ }),
/***/ 75030:
/*!************************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/GroupHomework/components/AssociatedProjects.tsx ***!
\************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 61621);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 92832);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 69140);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-infinite-scroller */ 26724);
/* harmony import */ var react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _service_shixunHomeworks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/service/shixunHomeworks */ 35457);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! umi */ 25789);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var PublishShixun = function PublishShixun(_ref) {
var _user$navigationInfo, _searchMemberList;
var classroomList = _ref.classroomList,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch;
var params = (0,umi__WEBPACK_IMPORTED_MODULE_8__.useParams)();
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.useForm(),
_Form$useForm2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(true),
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
hasMore = _useState2[0],
setHasmore = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)([]),
_useState4 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState3, 2),
searchMemberList = _useState4[0],
setSearchMemberList = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)({
page: 1,
limit: 20,
keyword: ''
}),
_useState6 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState5, 2),
memberSearchParams = _useState6[0],
setMemberSearchParams = _useState6[1];
var getData = /*#__PURE__*/function () {
var _ref2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee() {
var _res$projects;
var res;
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunHomeworks/getProjectList',
payload: _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, params), memberSearchParams)
});
case 2:
res = _context.sent;
if (res.projects) {
setSearchMemberList([].concat(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(searchMemberList), _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(res.projects)));
}
if (((_res$projects = res.projects) === null || _res$projects === void 0 ? void 0 : _res$projects.length) < 20) setHasmore(false);
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
(0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {
if (classroomList.actionTabs.key === '关联项目') {
getData();
searchMemberList = [];
memberSearchParams.page = 1;
memberSearchParams.keyword = '';
}
}, [classroomList.actionTabs.key]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
centered: true,
title: "\u5173\u8054\u9879\u76EE",
open: classroomList.actionTabs.key === '关联项目' ? true : false,
bodyStyle: {
minHeight: 100
},
onOk: /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee2() {
var formValue, _classroomList$action, selectArrs, cb, res;
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return form.validateFields();
case 2:
formValue = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, form.getFieldValue());
_classroomList$action = classroomList.actionTabs, selectArrs = _classroomList$action.selectArrs, cb = _classroomList$action.cb;
_context2.next = 6;
return (0,_service_shixunHomeworks__WEBPACK_IMPORTED_MODULE_7__/* .relateProject */ .co)(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, formValue), {}, {
homeworkId: selectArrs.homework_id
}));
case 6:
res = _context2.sent;
if (res.status === 0) {
if (cb) {
cb();
} else {
dispatch({
type: 'classroomList/getClassroomCommonHomeworksList',
payload: _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2___default()({}, classroomList.actionTabs.params)
});
}
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
}
case 8:
case "end":
return _context2.stop();
}
}, _callee2);
})),
onCancel: function onCancel() {
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
loading: loading['shixunHomeworks/getProjectList'],
active: true,
children: searchMemberList == '' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("aside", {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
className: "tc font14 pt20",
children: ["\u60A8\u5F53\u524D\u5C1A\u672A\u7BA1\u7406\u4EFB\u4F55\u9879\u76EE\uFF0C\u8BF7\u5148", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("a", {
href: "".concat((_user$navigationInfo = user.navigationInfo) === null || _user$navigationInfo === void 0 || (_user$navigationInfo = _user$navigationInfo.top) === null || _user$navigationInfo === void 0 ? void 0 : _user$navigationInfo.old_url, "/projects/deposit/new"),
target: "_blank",
children: "\u521B\u5EFA\u9879\u76EE"
}), "\u518D\u5173\u8054"]
})
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("aside", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
className: " mb20",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z.Search, {
onSearch: function onSearch(value) {
if (value === '') {
delete memberSearchParams.keyword;
} else {
memberSearchParams.keyword = value;
}
searchMemberList = [];
setHasmore(true);
getData();
},
placeholder: "\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
allowClear: true,
size: 'middle'
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
form: form,
initialValues: {},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z.Item, {
name: "project_id",
rules: [{
required: true,
message: '请选择项目'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"].Group */ .ZP.Group, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)((react_infinite_scroller__WEBPACK_IMPORTED_MODULE_6___default()), {
initialLoad: false,
pageStart: 1,
threshold: 20,
loadMore: function loadMore(page) {
memberSearchParams.page++;
getData();
},
hasMore: hasMore,
useWindow: false,
children: (_searchMemberList = searchMemberList) === null || _searchMemberList === void 0 ? void 0 : _searchMemberList.map(function (item, key) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .ZP, {
value: item.id,
children: item.name
})
})
}, key);
})
})
})
})
})]
})
})
});
};
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_8__.connect)(function (_ref4) {
var classroomList = _ref4.classroomList,
user = _ref4.user,
loading = _ref4.loading;
return {
classroomList: classroomList,
user: user,
loading: loading.effects
};
})(PublishShixun));
/***/ }),
/***/ 54796:
/*!*********************************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.tsx + 2 modules ***!
\*********************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_TrfList; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
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: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
var input = __webpack_require__(92832);
// 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/row/index.js
var row = __webpack_require__(95237);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var TrfListmodules = ({"leftdiv":"leftdiv___aBzsX","listClass":"listClass___bxIEW","spantitle":"spantitle___v_Vc4","rightdiv":"rightdiv___xWu4M"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/delete.png
var delete_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC";
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(61983);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/components/TrfList/index.tsx
//滚动加载
var TrfList = function TrfList(_ref) {
var data = _ref.data,
_ref$value = _ref.value,
value = _ref$value === void 0 ? [] : _ref$value,
handleChangePage = _ref.handleChangePage,
setSelectedRowKeys = _ref.setSelectedRowKeys,
selectedRowKeys = _ref.selectedRowKeys,
_ref$onChange = _ref.onChange,
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
leftList = _useState2[0],
setleftList = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
rightList = _useState4[0],
setRightList = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
checkoutList = _useState6[0],
setCheckoutList = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(1),
_useState8 = slicedToArray_default()(_useState7, 2),
page = _useState8[0],
setpage = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(),
_useState10 = slicedToArray_default()(_useState9, 2),
sechar = _useState10[0],
setsechar = _useState10[1];
(0,_react_17_0_2_react.useEffect)(function () {
setleftList(data);
setRightList([]);
setCheckoutList([]);
}, [data]);
(0,_react_17_0_2_react.useEffect)(function () {
if (setSelectedRowKeys) {
setRightList(selectedRowKeys);
setCheckoutList(selectedRowKeys);
}
}, [selectedRowKeys]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
justifyContent: 'space-between'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: TrfListmodules.leftdiv,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
size: 'middle',
onChange: ( /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e) {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
// const res = await Fetch(`/api/common_exercises/exercise_users/student_groups.json`, { method: "get", params: {page: 1, per_page: 200,student_group:e} });
// if (res.status === 0) {
// setleftList(res?.data)
// setsechar(e);
// }
// if(!e){
// setsechar('');
// }
// setpage(1);
setleftList(data.filter(function (item) {
var _item$name;
return item === null || item === void 0 || (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.includes(e.target.value);
}));
case 1:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref2.apply(this, arguments);
};
}()),
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
}), leftList.length === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
styles: {
margin: '70px auto'
},
customText: '暂无分班'
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
height: '85%',
overflow: 'auto',
overflowX: 'hidden'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
value: rightList.map(function (item) {
return "".concat(item.id);
}),
onChange: function onChange(e) {
setSelectedRowKeys(leftList.filter(function (item) {
return e.includes("".concat(item.id));
}));
},
style: {
marginTop: '10px',
flexDirection: "column"
},
children: leftList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
style: {
marginTop: '10px',
lineHeight: '24px',
display: 'flex',
width: 200
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
style: {
display: 'flex',
height: '24px',
alignItems: 'center'
},
disabled: item.is_published,
value: "".concat(item.id),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: TrfListmodules.listClass,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: TrfListmodules.spantitle,
style: {
width: item.is_published ? '108px' : '170px'
},
children: item.name
}), item.is_published && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
width: '52px',
height: '24px',
background: '#B8B8B8',
borderRadius: '13px',
color: 'white',
lineHeight: '24px',
textAlign: 'center',
display: 'inline-block'
},
children: "\u5DF2\u53D1\u5E03"
})]
})
})
}, item.id);
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: TrfListmodules.rightdiv,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
onChange: function onChange(e) {
setCheckoutList(rightList.filter(function (item) {
return item.name.includes(e.target.value);
}));
},
size: 'middle',
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
}), checkoutList.length === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
styles: {
margin: '70px auto'
},
customText: '暂未选择分班'
}), checkoutList.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
marginTop: '10px',
height: '85%',
overflow: 'hidden',
position: 'relative'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
overflowX: 'hidden',
overflowY: 'scroll',
position: 'absolute',
left: 0,
top: 0,
right: -17,
bottom: 0
},
children: checkoutList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
justify: "space-between",
style: {
marginTop: '10px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
marginRight: '5px',
marginLeft: '5px',
width: '75%'
},
children: item.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: delete_namespaceObject,
style: {
cursor: 'pointer',
height: '16px',
marginRight: 17
},
onClick: function onClick() {
setSelectedRowKeys(rightList.filter(function (items) {
return "".concat(items.id) != "".concat(item.id);
}));
}
})]
}, item.id);
})
})
})]
})]
});
};
/* harmony default export */ var components_TrfList = (TrfList);
/***/ }),
/***/ 61580:
/*!**************************************************!*\
!*** ./src/pages/MoopCases/FormPanel/service.ts ***!
\**************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ $J: function() { return /* binding */ getMoopCase; },
/* harmony export */ JZ: function() { return /* binding */ removeAttachment; },
/* harmony export */ bN: function() { return /* binding */ updateMoopCase; },
/* harmony export */ jP: function() { return /* binding */ addMoopCase; },
/* harmony export */ rO: function() { return /* binding */ getLibraryTags; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/fetch */ 55794);
function getMoopCase(id) {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)("libraries/".concat(id, ".json"));
}
function getLibraryTags() {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)('library_tags.json');
}
function removeAttachment(_x) {
return _removeAttachment.apply(this, arguments);
}
function _removeAttachment() {
_removeAttachment = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(id) {
var response;
return _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .del */ .IV)("attachments/".concat(id, ".json"));
case 2:
response = _context.sent;
return _context.abrupt("return", response.status === 0);
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return _removeAttachment.apply(this, arguments);
}
function addMoopCase(params) {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .post */ .v_)("libraries.json", params);
}
function updateMoopCase(id, params) {
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .put */ .gz)("libraries/".concat(id, ".json"), params);
}
/***/ }),
/***/ 12803:
/*!*****************************************!*\
!*** ./src/assets/images/uploadImg.svg ***!
\*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* unused harmony export ReactComponent */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = function __defNormalProp(obj, key, value) {
return key in obj ? __defProp(obj, key, {
enumerable: true,
configurable: true,
writable: true,
value: value
}) : obj[key] = value;
};
var __spreadValues = function __spreadValues(a, b) {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols) {
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var prop = _step.value;
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
return a;
};
var SvgUploadImg = function SvgUploadImg(props) {
return /* @__PURE__ */React.createElement("svg", __spreadValues({
width: 14,
height: 14,
xmlns: "http://www.w3.org/2000/svg"
}, props), /* @__PURE__ */React.createElement("title", null, "\u5F62\u72B6"), /* @__PURE__ */React.createElement("path", {
d: "M10.354 3.5h-2.77v8.167H6.416V3.5H3.646L7 0l3.354 3.5ZM14 7h-1.167v5.833H1.167V7H0v7h14V7Z",
fill: "#3061D0",
fillRule: "nonzero"
}));
};
/* harmony default export */ __webpack_exports__.Z = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
/***/ }),
/***/ 78673:
/*!**********************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules ***!
\**********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ es_switch; }
});
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
var LoadingOutlined = __webpack_require__(58617);
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
var _classnames_2_5_1_classnames = __webpack_require__(92310);
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.6@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(60499);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.6@@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__(18642);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.6@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
var slicedToArray = __webpack_require__(72190);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.6@@babel/runtime/helpers/esm/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(42244);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/hooks/useMergedState.js
var useMergedState = __webpack_require__(18929);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/KeyCode.js
var KeyCode = __webpack_require__(10228);
;// CONCATENATED MODULE: ./node_modules/_rc-switch@4.1.0@rc-switch/es/index.js
var _excluded = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"];
var Switch = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (_ref, ref) {
var _classNames;
var _ref$prefixCls = _ref.prefixCls,
prefixCls = _ref$prefixCls === void 0 ? 'rc-switch' : _ref$prefixCls,
className = _ref.className,
checked = _ref.checked,
defaultChecked = _ref.defaultChecked,
disabled = _ref.disabled,
loadingIcon = _ref.loadingIcon,
checkedChildren = _ref.checkedChildren,
unCheckedChildren = _ref.unCheckedChildren,
onClick = _ref.onClick,
onChange = _ref.onChange,
onKeyDown = _ref.onKeyDown,
restProps = (0,objectWithoutProperties/* default */.Z)(_ref, _excluded);
var _useMergedState = (0,useMergedState/* default */.Z)(false, {
value: checked,
defaultValue: defaultChecked
}),
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
innerChecked = _useMergedState2[0],
setInnerChecked = _useMergedState2[1];
function triggerChange(newChecked, event) {
var mergedChecked = innerChecked;
if (!disabled) {
mergedChecked = newChecked;
setInnerChecked(mergedChecked);
onChange === null || onChange === void 0 ? void 0 : onChange(mergedChecked, event);
}
return mergedChecked;
}
function onInternalKeyDown(e) {
if (e.which === KeyCode/* default */.Z.LEFT) {
triggerChange(false, e);
} else if (e.which === KeyCode/* default */.Z.RIGHT) {
triggerChange(true, e);
}
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
}
function onInternalClick(e) {
var ret = triggerChange(!innerChecked, e);
// [Legacy] trigger onClick with value
onClick === null || onClick === void 0 ? void 0 : onClick(ret, e);
}
var switchClassName = _classnames_2_5_1_classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-checked"), innerChecked), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
return /*#__PURE__*/_react_17_0_2_react.createElement("button", (0,esm_extends/* default */.Z)({}, restProps, {
type: "button",
role: "switch",
"aria-checked": innerChecked,
disabled: disabled,
className: switchClassName,
ref: ref,
onKeyDown: onInternalKeyDown,
onClick: onInternalClick
}), loadingIcon, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: "".concat(prefixCls, "-inner")
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: "".concat(prefixCls, "-inner-checked")
}, checkedChildren), /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: "".concat(prefixCls, "-inner-unchecked")
}, unCheckedChildren)));
});
Switch.displayName = 'Switch';
/* harmony default export */ var es = (Switch);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
var wave = __webpack_require__(14088);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
var DisabledContext = __webpack_require__(1684);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
var useSize = __webpack_require__(19716);
// EXTERNAL MODULE: ./node_modules/_@ctrl_tinycolor@3.6.1@@ctrl/tinycolor/dist/module/index.js
var dist_module = __webpack_require__(64993);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
var style = __webpack_require__(17313);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
var genComponentStyleHook = __webpack_require__(83116);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
var statistic = __webpack_require__(37613);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/style/index.js
const genSwitchSmallStyle = token => {
const {
componentCls,
trackHeightSM,
trackPadding,
trackMinWidthSM,
innerMinMarginSM,
innerMaxMarginSM,
handleSizeSM
} = token;
const switchInnerCls = `${componentCls}-inner`;
return {
[componentCls]: {
[`&${componentCls}-small`]: {
minWidth: trackMinWidthSM,
height: trackHeightSM,
lineHeight: `${trackHeightSM}px`,
[`${componentCls}-inner`]: {
paddingInlineStart: innerMaxMarginSM,
paddingInlineEnd: innerMinMarginSM,
[`${switchInnerCls}-checked`]: {
marginInlineStart: `calc(-100% + ${handleSizeSM + trackPadding * 2}px - ${innerMaxMarginSM * 2}px)`,
marginInlineEnd: `calc(100% - ${handleSizeSM + trackPadding * 2}px + ${innerMaxMarginSM * 2}px)`
},
[`${switchInnerCls}-unchecked`]: {
marginTop: -trackHeightSM,
marginInlineStart: 0,
marginInlineEnd: 0
}
},
[`${componentCls}-handle`]: {
width: handleSizeSM,
height: handleSizeSM
},
[`${componentCls}-loading-icon`]: {
top: (handleSizeSM - token.switchLoadingIconSize) / 2,
fontSize: token.switchLoadingIconSize
},
[`&${componentCls}-checked`]: {
[`${componentCls}-inner`]: {
paddingInlineStart: innerMinMarginSM,
paddingInlineEnd: innerMaxMarginSM,
[`${switchInnerCls}-checked`]: {
marginInlineStart: 0,
marginInlineEnd: 0
},
[`${switchInnerCls}-unchecked`]: {
marginInlineStart: `calc(100% - ${handleSizeSM + trackPadding * 2}px + ${innerMaxMarginSM * 2}px)`,
marginInlineEnd: `calc(-100% + ${handleSizeSM + trackPadding * 2}px - ${innerMaxMarginSM * 2}px)`
}
},
[`${componentCls}-handle`]: {
insetInlineStart: `calc(100% - ${handleSizeSM + trackPadding}px)`
}
},
[`&:not(${componentCls}-disabled):active`]: {
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
[`${switchInnerCls}-unchecked`]: {
marginInlineStart: token.marginXXS / 2,
marginInlineEnd: -token.marginXXS / 2
}
},
[`&${componentCls}-checked ${switchInnerCls}`]: {
[`${switchInnerCls}-checked`]: {
marginInlineStart: -token.marginXXS / 2,
marginInlineEnd: token.marginXXS / 2
}
}
}
}
}
};
};
const genSwitchLoadingStyle = token => {
const {
componentCls,
handleSize
} = token;
return {
[componentCls]: {
[`${componentCls}-loading-icon${token.iconCls}`]: {
position: 'relative',
top: (handleSize - token.fontSize) / 2,
color: token.switchLoadingIconColor,
verticalAlign: 'top'
},
[`&${componentCls}-checked ${componentCls}-loading-icon`]: {
color: token.switchColor
}
}
};
};
const genSwitchHandleStyle = token => {
const {
componentCls,
motion,
trackPadding,
handleBg,
handleShadow,
handleSize
} = token;
const switchHandleCls = `${componentCls}-handle`;
return {
[componentCls]: {
[switchHandleCls]: {
position: 'absolute',
top: trackPadding,
insetInlineStart: trackPadding,
width: handleSize,
height: handleSize,
transition: `all ${token.switchDuration} ease-in-out`,
'&::before': {
position: 'absolute',
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
backgroundColor: handleBg,
borderRadius: handleSize / 2,
boxShadow: handleShadow,
transition: `all ${token.switchDuration} ease-in-out`,
content: '""'
}
},
[`&${componentCls}-checked ${switchHandleCls}`]: {
insetInlineStart: `calc(100% - ${handleSize + trackPadding}px)`
},
[`&:not(${componentCls}-disabled):active`]: motion ? {
[`${switchHandleCls}::before`]: {
insetInlineEnd: token.switchHandleActiveInset,
insetInlineStart: 0
},
[`&${componentCls}-checked ${switchHandleCls}::before`]: {
insetInlineEnd: 0,
insetInlineStart: token.switchHandleActiveInset
}
} : /* istanbul ignore next */
{}
}
};
};
const genSwitchInnerStyle = token => {
const {
componentCls,
trackHeight,
trackPadding,
innerMinMargin,
innerMaxMargin,
handleSize
} = token;
const switchInnerCls = `${componentCls}-inner`;
return {
[componentCls]: {
[switchInnerCls]: {
display: 'block',
overflow: 'hidden',
borderRadius: 100,
height: '100%',
paddingInlineStart: innerMaxMargin,
paddingInlineEnd: innerMinMargin,
transition: `padding-inline-start ${token.switchDuration} ease-in-out, padding-inline-end ${token.switchDuration} ease-in-out`,
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
display: 'block',
color: token.colorTextLightSolid,
fontSize: token.fontSizeSM,
transition: `margin-inline-start ${token.switchDuration} ease-in-out, margin-inline-end ${token.switchDuration} ease-in-out`,
pointerEvents: 'none'
},
[`${switchInnerCls}-checked`]: {
marginInlineStart: `calc(-100% + ${handleSize + trackPadding * 2}px - ${innerMaxMargin * 2}px)`,
marginInlineEnd: `calc(100% - ${handleSize + trackPadding * 2}px + ${innerMaxMargin * 2}px)`
},
[`${switchInnerCls}-unchecked`]: {
marginTop: -trackHeight,
marginInlineStart: 0,
marginInlineEnd: 0
}
},
[`&${componentCls}-checked ${switchInnerCls}`]: {
paddingInlineStart: innerMinMargin,
paddingInlineEnd: innerMaxMargin,
[`${switchInnerCls}-checked`]: {
marginInlineStart: 0,
marginInlineEnd: 0
},
[`${switchInnerCls}-unchecked`]: {
marginInlineStart: `calc(100% - ${handleSize + trackPadding * 2}px + ${innerMaxMargin * 2}px)`,
marginInlineEnd: `calc(-100% + ${handleSize + trackPadding * 2}px - ${innerMaxMargin * 2}px)`
}
},
[`&:not(${componentCls}-disabled):active`]: {
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: {
[`${switchInnerCls}-unchecked`]: {
marginInlineStart: trackPadding * 2,
marginInlineEnd: -trackPadding * 2
}
},
[`&${componentCls}-checked ${switchInnerCls}`]: {
[`${switchInnerCls}-checked`]: {
marginInlineStart: -trackPadding * 2,
marginInlineEnd: trackPadding * 2
}
}
}
}
};
};
const genSwitchStyle = token => {
const {
componentCls,
trackHeight,
trackMinWidth
} = token;
return {
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
position: 'relative',
display: 'inline-block',
boxSizing: 'border-box',
minWidth: trackMinWidth,
height: trackHeight,
lineHeight: `${trackHeight}px`,
verticalAlign: 'middle',
background: token.colorTextQuaternary,
border: '0',
borderRadius: 100,
cursor: 'pointer',
transition: `all ${token.motionDurationMid}`,
userSelect: 'none',
[`&:hover:not(${componentCls}-disabled)`]: {
background: token.colorTextTertiary
}
}), (0,style/* genFocusStyle */.Qy)(token)), {
[`&${componentCls}-checked`]: {
background: token.switchColor,
[`&:hover:not(${componentCls}-disabled)`]: {
background: token.colorPrimaryHover
}
},
[`&${componentCls}-loading, &${componentCls}-disabled`]: {
cursor: 'not-allowed',
opacity: token.switchDisabledOpacity,
'*': {
boxShadow: 'none',
cursor: 'not-allowed'
}
},
// rtl style
[`&${componentCls}-rtl`]: {
direction: 'rtl'
}
})
};
};
// ============================== Export ==============================
/* harmony default export */ var switch_style = ((0,genComponentStyleHook/* default */.Z)('Switch', token => {
const switchToken = (0,statistic/* merge */.TS)(token, {
switchDuration: token.motionDurationMid,
switchColor: token.colorPrimary,
switchDisabledOpacity: token.opacityLoading,
switchLoadingIconSize: token.fontSizeIcon * 0.75,
switchLoadingIconColor: `rgba(0, 0, 0, ${token.opacityLoading})`,
switchHandleActiveInset: '-30%'
});
return [genSwitchStyle(switchToken),
// inner style
genSwitchInnerStyle(switchToken),
// handle style
genSwitchHandleStyle(switchToken),
// loading style
genSwitchLoadingStyle(switchToken),
// small style
genSwitchSmallStyle(switchToken)];
}, token => {
const {
fontSize,
lineHeight,
controlHeight,
colorWhite
} = token;
const height = fontSize * lineHeight;
const heightSM = controlHeight / 2;
const padding = 2; // Fixed value
const handleSize = height - padding * 2;
const handleSizeSM = heightSM - padding * 2;
return {
trackHeight: height,
trackHeightSM: heightSM,
trackMinWidth: handleSize * 2 + padding * 4,
trackMinWidthSM: handleSizeSM * 2 + padding * 2,
trackPadding: padding,
handleBg: colorWhite,
handleSize,
handleSizeSM,
handleShadow: `0 2px 4px 0 ${new dist_module/* TinyColor */.C('#00230b').setAlpha(0.2).toRgbString()}`,
innerMinMargin: handleSize / 2,
innerMaxMargin: handleSize + padding + padding * 2,
innerMinMarginSM: handleSizeSM / 2,
innerMaxMarginSM: handleSizeSM + padding + padding * 2
};
}));
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/index.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const switch_Switch = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
const {
prefixCls: customizePrefixCls,
size: customizeSize,
disabled: customDisabled,
loading,
className,
rootClassName,
style
} = props,
restProps = __rest(props, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style"]);
false ? 0 : void 0;
const {
getPrefixCls,
direction,
switch: SWITCH
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
// ===================== Disabled =====================
const disabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
const mergedDisabled = (customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled) || loading;
const prefixCls = getPrefixCls('switch', customizePrefixCls);
const loadingIcon = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
className: `${prefixCls}-handle`
}, loading && /*#__PURE__*/_react_17_0_2_react.createElement(LoadingOutlined/* default */.Z, {
className: `${prefixCls}-loading-icon`
}));
// Style
const [wrapSSR, hashId] = switch_style(prefixCls);
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
const classes = _classnames_2_5_1_classnames_default()(SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.className, {
[`${prefixCls}-small`]: mergedSize === 'small',
[`${prefixCls}-loading`]: loading,
[`${prefixCls}-rtl`]: direction === 'rtl'
}, className, rootClassName, hashId);
const mergedStyle = Object.assign(Object.assign({}, SWITCH === null || SWITCH === void 0 ? void 0 : SWITCH.style), style);
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
component: "Switch"
}, /*#__PURE__*/_react_17_0_2_react.createElement(es, Object.assign({}, restProps, {
prefixCls: prefixCls,
className: classes,
style: mergedStyle,
disabled: mergedDisabled,
ref: ref,
loadingIcon: loadingIcon
}))));
});
switch_Switch.__ANT_SWITCH = true;
if (false) {}
/* harmony default export */ var es_switch = (switch_Switch);
/***/ })
}]);