diff --git a/85274.72610a64.async.js b/45289.262a7407.async.js
similarity index 97%
rename from 85274.72610a64.async.js
rename to 45289.262a7407.async.js
index ed8bcac4ac..e3bd7fb4e1 100644
--- a/85274.72610a64.async.js
+++ b/45289.262a7407.async.js
@@ -1,5 +1,5 @@
"use strict";
-(self["webpackChunk"] = self["webpackChunk"] || []).push([[85274,96738,80638,63276],{
+(self["webpackChunk"] = self["webpackChunk"] || []).push([[45289,96738,99531,63276],{
/***/ 5929:
/*!**********************************************!*\
@@ -1453,9 +1453,9 @@ var FileDownloadList = function FileDownloadList(_ref) {
/***/ }),
-/***/ 80638:
+/***/ 99531:
/*!**********************************************************!*\
- !*** ./src/components/MultiUpload/index.tsx + 3 modules ***!
+ !*** ./src/components/MultiUpload/index.tsx + 2 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -1486,7 +1486,7 @@ var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
var upload = __webpack_require__(46651);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
-var es_message = __webpack_require__(8591);
+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/button/index.js
@@ -1495,136 +1495,8 @@ var es_button = __webpack_require__(3113);
var env = __webpack_require__(17985);
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
var service = __webpack_require__(52989);
-// 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;
- 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__*/_jsx(Button, {
- type: "primary",
- title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
- disabled: value.length > 0,
- ghost: true,
- children: title
- }), /*#__PURE__*/_jsxs("span", {
- onClick: onCancel,
- style: {
- marginLeft: 10
- },
- children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", ' ']
- })]
- }))
- });
-});
+// EXTERNAL MODULE: ./src/components/SingleUpload/index.tsx
+var SingleUpload = __webpack_require__(95081);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
var InboxOutlined = __webpack_require__(93737);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
@@ -1680,6 +1552,8 @@ var SvgUploadImg = function SvgUploadImg(props) {
};
/* harmony default export */ var uploadImg = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
+// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
+var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
@@ -1705,7 +1579,7 @@ function coverToFileList(data) {
return {
uid: item.id,
id: item.id,
- name: item.title + uploadNameSizeSeperator + item.filesize,
+ name: item.title + SingleUpload/* uploadNameSizeSeperator */.sX + item.filesize,
url: item.url,
filesize: item.filesize,
status: 'done',
@@ -1778,7 +1652,7 @@ function coverToFileList(data) {
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"));
+ message/* default */.ZP.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(number, "\u4E2A\u6587\u4EF6"));
if (aloneClear) {
return Promise.reject();
}
@@ -1786,7 +1660,7 @@ function coverToFileList(data) {
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, "MB)."));
+ message/* default */.ZP.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB)."));
if (aloneClear) {
return Promise.reject();
}
@@ -1807,7 +1681,7 @@ function coverToFileList(data) {
}
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);
+ 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);
@@ -1818,8 +1692,8 @@ function coverToFileList(data) {
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));
+ if (file.name.indexOf(SingleUpload/* uploadNameSizeSeperator */.sX) === -1) {
+ file.name = "".concat(file.name).concat(SingleUpload/* uploadNameSizeSeperator */.sX).concat((0,SingleUpload/* bytesToSize */.RD)(file.size));
}
return objectSpread2_default()({}, file);
});
@@ -1885,7 +1759,7 @@ function coverToFileList(data) {
return remove();
case 2:
res = _context2.sent;
- es_message/* default */.ZP.success('删除成功');
+ message/* default */.ZP.success('删除成功');
resolve(true);
case 5:
case "end":
@@ -1953,6 +1827,158 @@ function coverToFileList(data) {
/***/ }),
+/***/ 95081:
+/*!***********************************************!*\
+ !*** ./src/components/SingleUpload/index.tsx ***!
+ \***********************************************/
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
+
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ RD: function() { return /* binding */ bytesToSize; },
+/* harmony export */ sX: function() { return /* binding */ uploadNameSizeSeperator; }
+/* harmony export */ });
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_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_test4_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_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_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_test4_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_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_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_test4_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_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
+/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/env */ 17985);
+/* harmony import */ var _pages_MoopCases_FormPanel_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/pages/MoopCases/FormPanel/service */ 52989);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
+
+
+
+
+
+
+
+
+
+
+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];
+}
+/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (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;
+ 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__*/_jsx(Button, {
+ type: "primary",
+ title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
+ disabled: value.length > 0,
+ ghost: true,
+ children: title
+ }), /*#__PURE__*/_jsxs("span", {
+ onClick: onCancel,
+ style: {
+ marginLeft: 10
+ },
+ children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", ' ']
+ })]
+ }))
+ });
+});
+
+/***/ }),
+
/***/ 819:
/*!***************************************************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/CommonHomework/Detail/components/ConfigWorks/HiddenSetting/GroupAppeal.tsx ***!
diff --git a/62861.d79e7f38.async.js b/62861.1499f3d8.async.js
similarity index 99%
rename from 62861.d79e7f38.async.js
rename to 62861.1499f3d8.async.js
index f44336625a..7088ca3c22 100644
--- a/62861.d79e7f38.async.js
+++ b/62861.1499f3d8.async.js
@@ -377,8 +377,8 @@ var PoweroffOutlined = __webpack_require__(84078);
var lib = __webpack_require__(56102);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(12712);
-// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 3 modules
-var MultiUpload = __webpack_require__(80638);
+// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 2 modules
+var MultiUpload = __webpack_require__(99531);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(17985);
// EXTERNAL MODULE: ./src/utils/fetch.ts
diff --git a/80638.c584e2ea.async.js b/99531.0694127f.async.js
similarity index 83%
rename from 80638.c584e2ea.async.js
rename to 99531.0694127f.async.js
index bebb3db72c..978bfd13ee 100644
--- a/80638.c584e2ea.async.js
+++ b/99531.0694127f.async.js
@@ -1,9 +1,9 @@
"use strict";
-(self["webpackChunk"] = self["webpackChunk"] || []).push([[80638],{
+(self["webpackChunk"] = self["webpackChunk"] || []).push([[99531],{
-/***/ 80638:
+/***/ 99531:
/*!**********************************************************!*\
- !*** ./src/components/MultiUpload/index.tsx + 3 modules ***!
+ !*** ./src/components/MultiUpload/index.tsx + 2 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -34,7 +34,7 @@ var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
var upload = __webpack_require__(46651);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
-var es_message = __webpack_require__(8591);
+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/button/index.js
@@ -43,136 +43,8 @@ var es_button = __webpack_require__(3113);
var env = __webpack_require__(17985);
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
var service = __webpack_require__(52989);
-// 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;
- 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__*/_jsx(Button, {
- type: "primary",
- title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
- disabled: value.length > 0,
- ghost: true,
- children: title
- }), /*#__PURE__*/_jsxs("span", {
- onClick: onCancel,
- style: {
- marginLeft: 10
- },
- children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", ' ']
- })]
- }))
- });
-});
+// EXTERNAL MODULE: ./src/components/SingleUpload/index.tsx
+var SingleUpload = __webpack_require__(95081);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
var InboxOutlined = __webpack_require__(93737);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
@@ -228,6 +100,8 @@ var SvgUploadImg = function SvgUploadImg(props) {
};
/* harmony default export */ var uploadImg = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
+// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
+var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
@@ -253,7 +127,7 @@ function coverToFileList(data) {
return {
uid: item.id,
id: item.id,
- name: item.title + uploadNameSizeSeperator + item.filesize,
+ name: item.title + SingleUpload/* uploadNameSizeSeperator */.sX + item.filesize,
url: item.url,
filesize: item.filesize,
status: 'done',
@@ -326,7 +200,7 @@ function coverToFileList(data) {
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"));
+ message/* default */.ZP.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(number, "\u4E2A\u6587\u4EF6"));
if (aloneClear) {
return Promise.reject();
}
@@ -334,7 +208,7 @@ function coverToFileList(data) {
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, "MB)."));
+ message/* default */.ZP.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB)."));
if (aloneClear) {
return Promise.reject();
}
@@ -355,7 +229,7 @@ function coverToFileList(data) {
}
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);
+ 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);
@@ -366,8 +240,8 @@ function coverToFileList(data) {
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));
+ if (file.name.indexOf(SingleUpload/* uploadNameSizeSeperator */.sX) === -1) {
+ file.name = "".concat(file.name).concat(SingleUpload/* uploadNameSizeSeperator */.sX).concat((0,SingleUpload/* bytesToSize */.RD)(file.size));
}
return objectSpread2_default()({}, file);
});
@@ -433,7 +307,7 @@ function coverToFileList(data) {
return remove();
case 2:
res = _context2.sent;
- es_message/* default */.ZP.success('删除成功');
+ message/* default */.ZP.success('删除成功');
resolve(true);
case 5:
case "end":
@@ -501,6 +375,158 @@ function coverToFileList(data) {
/***/ }),
+/***/ 95081:
+/*!***********************************************!*\
+ !*** ./src/components/SingleUpload/index.tsx ***!
+ \***********************************************/
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
+
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ RD: function() { return /* binding */ bytesToSize; },
+/* harmony export */ sX: function() { return /* binding */ uploadNameSizeSeperator; }
+/* harmony export */ });
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_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_test4_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_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_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_test4_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_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_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_test4_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_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
+/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test4_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
+/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/env */ 17985);
+/* harmony import */ var _pages_MoopCases_FormPanel_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/pages/MoopCases/FormPanel/service */ 52989);
+/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
+
+
+
+
+
+
+
+
+
+
+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];
+}
+/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (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;
+ 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__*/_jsx(Button, {
+ type: "primary",
+ title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
+ disabled: value.length > 0,
+ ghost: true,
+ children: title
+ }), /*#__PURE__*/_jsxs("span", {
+ onClick: onCancel,
+ style: {
+ marginLeft: 10
+ },
+ children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", ' ']
+ })]
+ }))
+ });
+});
+
+/***/ }),
+
/***/ 52989:
/*!**************************************************!*\
!*** ./src/pages/MoopCases/FormPanel/service.ts ***!
diff --git a/index.html b/index.html
index 28b6c45a15..9793c433cb 100644
--- a/index.html
+++ b/index.html
@@ -27,7 +27,7 @@
display: block !important;
}
-
+