You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2756 lines
107 KiB
2756 lines
107 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[9416,47845],{
|
|
|
|
/***/ 8877:
|
|
/*!************************************************************************************************************!*\
|
|
!*** ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules ***!
|
|
\************************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ icons_PlusCircleOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(66820);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/PlusCircleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var PlusCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "plus-circle", "theme": "outlined" };
|
|
/* harmony default export */ var asn_PlusCircleOutlined = (PlusCircleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(13814);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/PlusCircleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var PlusCircleOutlined_PlusCircleOutlined = function PlusCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_PlusCircleOutlined
|
|
}));
|
|
};
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(PlusCircleOutlined_PlusCircleOutlined);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_PlusCircleOutlined = (RefIcon);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 3463:
|
|
/*!*****************************************************************!*\
|
|
!*** ./src/pages/Graduations/Lists/Tasks/index.tsx + 7 modules ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ Tasks; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(46478);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
var skeleton = __webpack_require__(84578);
|
|
// 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/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/_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/upload/index.js + 24 modules
|
|
var upload = __webpack_require__(33556);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(67747);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/TeacherModule/index.tsx + 1 modules
|
|
var TeacherModule = __webpack_require__(58572);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(33083);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var utils_fetch = __webpack_require__(79539);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var es_modal = __webpack_require__(43418);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/DetailsModal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var DetailsModalmodules = ({"flex_box_center":"flex_box_center___dejrx","flex_space_between":"flex_space_between___WBGxf","flex_box_vertical_center":"flex_box_vertical_center___OMTvG","flex_box_center_end":"flex_box_center_end___FHZRS","flex_box_column":"flex_box_column___cDBl4","File":"File___Vzzv4","deletfileIcon":"deletfileIcon___snNZ9","wrap":"wrap___eGzSn","row":"row___qfnoA","img":"img___Ftdlp"});
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
|
var ui_customization = __webpack_require__(72143);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(66820);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/LinkOutlined.js
|
|
// This icon file is generated automatically.
|
|
var LinkOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z" } }] }, "name": "link", "theme": "outlined" };
|
|
/* harmony default export */ var asn_LinkOutlined = (LinkOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(13814);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/LinkOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var LinkOutlined_LinkOutlined = function LinkOutlined(props, ref) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_LinkOutlined
|
|
}));
|
|
};
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(LinkOutlined_LinkOutlined);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_LinkOutlined = (RefIcon);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/DetailsModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SettingModal = function SettingModal(_ref) {
|
|
var _data$teachers, _data$teachers2;
|
|
var visible = _ref.visible,
|
|
data = _ref.data,
|
|
_ref$onClose = _ref.onClose,
|
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
sendUrl = _ref.sendUrl;
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
fileList = _useState2[0],
|
|
setFileList = _useState2[1];
|
|
var dealFileList = fileList.map(function (e) {
|
|
if (e.response) {
|
|
var _e$response;
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
linkProps: {
|
|
download: true
|
|
},
|
|
url: e === null || e === void 0 || (_e$response = e.response) === null || _e$response === void 0 ? void 0 : _e$response.url
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (visible) {
|
|
var _data$attachments;
|
|
setFileList((data === null || data === void 0 || (_data$attachments = data.attachments) === null || _data$attachments === void 0 ? void 0 : _data$attachments.map(function (e) {
|
|
return {
|
|
name: e.title,
|
|
status: 'done',
|
|
linkProps: {
|
|
download: true
|
|
},
|
|
response: {
|
|
id: e.id,
|
|
url: e.url
|
|
}
|
|
};
|
|
})) || []);
|
|
}
|
|
}, [visible]);
|
|
var uploadProps = {
|
|
multiple: true,
|
|
withCredentials: true,
|
|
fileList: dealFileList,
|
|
beforeUpload: function beforeUpload(file) {
|
|
var fileSize = file.size / 1024 / 1024;
|
|
if (fileSize > 150) {
|
|
message/* default */.ZP.error("\u300A".concat(file.name, "\u300B\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(150M)"));
|
|
return upload/* default */.Z.LIST_IGNORE;
|
|
}
|
|
return true;
|
|
},
|
|
itemRender: function itemRender(originNode, file) {
|
|
var _file$response;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
wrap: false,
|
|
align: "middle",
|
|
justify: "space-between",
|
|
className: "ant-upload-list-item ant-upload-list-item-done ".concat(DetailsModalmodules.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)(icons_LinkOutlined, {
|
|
className: "mr10 c-grey-666"
|
|
}), (0,util/* cutFileName */.tP)(file === null || file === void 0 ? void 0 : file.name, 35)]
|
|
}), (file === null || file === void 0 || (_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.id) && /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shanchu14 font14 ".concat(DetailsModalmodules.deletfileIcon),
|
|
onClick: /*#__PURE__*/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:
|
|
_context.next = 2;
|
|
return postData(dealFileList === null || dealFileList === void 0 ? void 0 : dealFileList.filter(function (item) {
|
|
return item.response.id != file.response.id;
|
|
}));
|
|
case 2:
|
|
res = _context.sent;
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success("删除成功");
|
|
setFileList(dealFileList === null || dealFileList === void 0 ? void 0 : dealFileList.filter(function (item) {
|
|
var _item$response, _file$response2;
|
|
return (item === null || item === void 0 || (_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id) != (file === null || file === void 0 || (_file$response2 = file.response) === null || _file$response2 === void 0 ? void 0 : _file$response2.id);
|
|
}));
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}))
|
|
})]
|
|
});
|
|
},
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
|
|
onChange: function onChange(info) {
|
|
var list = (0,util/* dealUploadChange */.uD)(info);
|
|
setFileList(list);
|
|
if (list.every(function (e) {
|
|
return e.status !== 'uploading';
|
|
})) {
|
|
postData(list);
|
|
}
|
|
}
|
|
};
|
|
var postData = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(list) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
_context2.next = 2;
|
|
return (0,utils_fetch/* default */.ZP)(sendUrl, {
|
|
method: "post",
|
|
body: {
|
|
graduation_task_id: data.id,
|
|
attachment_ids: list.filter(function (e) {
|
|
return e.status === 'done';
|
|
}).map(function (e) {
|
|
var _e$response2;
|
|
return e === null || e === void 0 || (_e$response2 = e.response) === null || _e$response2 === void 0 ? void 0 : _e$response2.id;
|
|
})
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context2.sent;
|
|
if (res.status === 0) {}
|
|
return _context2.abrupt("return", res);
|
|
case 5:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function postData(_x) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
|
|
centered: true,
|
|
destroyOnClose: true,
|
|
onCancel: onClose,
|
|
open: visible,
|
|
footer: null,
|
|
title: '任务书详情',
|
|
width: 620,
|
|
className: "pb20",
|
|
afterClose: function afterClose() {
|
|
setFileList([]);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DetailsModalmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DetailsModalmodules.row,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u8BFE\u9898\u540D\u79F0"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
title: data.name,
|
|
children: data.name
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DetailsModalmodules.row,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u6307\u5BFC\u8001\u5E08"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: !!(data !== null && data !== void 0 && (_data$teachers = data.teachers) !== null && _data$teachers !== void 0 && _data$teachers.length) ? data === null || data === void 0 || (_data$teachers2 = data.teachers) === null || _data$teachers2 === void 0 || (_data$teachers2 = _data$teachers2.map(function (e) {
|
|
return e.real_name;
|
|
})) === null || _data$teachers2 === void 0 ? void 0 : _data$teachers2.join('、') : '--'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DetailsModalmodules.row,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u8BFE\u9898\u6765\u6E90"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: data.source || '--'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: DetailsModalmodules.row,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: "\u9009\u9898\u5B66\u751F"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: data.real_name || '--'
|
|
})]
|
|
}), data.status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(DetailsModalmodules.img, " iconfont icon-yixiada")
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
className: "mt10",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
style: {
|
|
borderRadius: 2
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon-shangchuan3 mr5"
|
|
}), "\u4E0A\u4F20\u6587\u6863"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "ml10 font14",
|
|
style: {
|
|
color: '#5F6367'
|
|
},
|
|
onClick: function onClick(e) {
|
|
e.stopPropagation();
|
|
},
|
|
children: "\u4E0A\u4F20\u4EFB\u52A1\u4E66\uFF0C\u5355\u4E2A\u6587\u6863\u5927\u5C0F\u4E0D\u8D85\u8FC7150M"
|
|
})]
|
|
})
|
|
})), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
height: '20px'
|
|
}
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var DetailsModal = (SettingModal);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/Teacher/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
var _location$pathname$sp;
|
|
var graduations = _ref.graduations,
|
|
dispatch = _ref.dispatch;
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
fileList = _useState2[0],
|
|
setFileList = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)({}),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
data = _useState4[0],
|
|
setData = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
visible = _useState6[0],
|
|
setVisible = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(1),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
updateKey = _useState8[0],
|
|
setUpdateKey = _useState8[1];
|
|
var taskId = (0,_react_17_0_2_react.useRef)(null);
|
|
var fileListIds = (0,_react_17_0_2_react.useRef)([]);
|
|
var tabKey = (_location$pathname$sp = location.pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[3];
|
|
var menus = graduations.menus;
|
|
var tabParams = menus.find(function (e) {
|
|
return e.clazz === tabKey;
|
|
}) || {};
|
|
var sendUrl = "/api/graduations/".concat(urlParams.id, "/graduation_stages/").concat(tabParams === null || tabParams === void 0 ? void 0 : tabParams.id, "/submit.json");
|
|
var uploadProps = {
|
|
multiple: true,
|
|
withCredentials: true,
|
|
fileList: fileList,
|
|
showUploadList: false,
|
|
beforeUpload: function beforeUpload(file) {
|
|
var fileSize = file.size / 1024 / 1024;
|
|
if (fileSize > 150) {
|
|
message/* default */.ZP.error("\u300A".concat(file.name, "\u300B\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(150M)"));
|
|
return upload/* default */.Z.LIST_IGNORE;
|
|
}
|
|
return true;
|
|
},
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
|
|
onChange: function onChange(info) {
|
|
dispatch({
|
|
type: "globalSetting/setGlobalLoading",
|
|
payload: {
|
|
show: true,
|
|
text: "正在上传中,请稍候"
|
|
}
|
|
});
|
|
var list = (0,util/* dealUploadChange */.uD)(info);
|
|
setFileList(list);
|
|
if (list.every(function (e) {
|
|
return e.status !== 'uploading';
|
|
})) {
|
|
postData(list);
|
|
}
|
|
}
|
|
};
|
|
var postData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(list) {
|
|
var _list$filter$map;
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
_context.next = 2;
|
|
return (0,utils_fetch/* default */.ZP)(sendUrl, {
|
|
method: "post",
|
|
body: {
|
|
graduation_task_id: taskId.current,
|
|
attachment_ids: (_list$filter$map = list.filter(function (e) {
|
|
return e.status === 'done';
|
|
}).map(function (e) {
|
|
var _e$response;
|
|
return e === null || e === void 0 || (_e$response = e.response) === null || _e$response === void 0 ? void 0 : _e$response.id;
|
|
})) === null || _list$filter$map === void 0 ? void 0 : _list$filter$map.concat(fileListIds.current)
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context.sent;
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success('提交成功');
|
|
setUpdateKey(updateKey + 1);
|
|
}
|
|
setFileList([]);
|
|
taskId.current = null;
|
|
fileListIds.current = [];
|
|
dispatch({
|
|
type: "globalSetting/setGlobalLoading",
|
|
payload: {
|
|
show: false,
|
|
text: ""
|
|
}
|
|
});
|
|
case 8:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function postData(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var tags = [{
|
|
id: '',
|
|
name: '全部'
|
|
}, {
|
|
id: 0,
|
|
name: '未下达'
|
|
}, {
|
|
id: 1,
|
|
name: '已下达'
|
|
}];
|
|
var columns = [{
|
|
title: '课题名称',
|
|
dataIndex: 'name',
|
|
ellipsis: true,
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "topLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-grey-333",
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '指导老师',
|
|
dataIndex: 'teachers',
|
|
width: 156,
|
|
ellipsis: true,
|
|
render: function render(value) {
|
|
var _value$map;
|
|
var str = !!(value !== null && value !== void 0 && value.length) ? value === null || value === void 0 || (_value$map = value.map(function (e) {
|
|
return e.real_name;
|
|
})) === null || _value$map === void 0 ? void 0 : _value$map.join('、') : '';
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "topLeft",
|
|
title: str,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-grey-333",
|
|
children: str || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '选题学生',
|
|
width: 156,
|
|
ellipsis: true,
|
|
dataIndex: 'real_name',
|
|
render: function render(text) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "topLeft",
|
|
title: text,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-black",
|
|
children: text || '--'
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '文档',
|
|
dataIndex: 'attachments',
|
|
width: 156,
|
|
ellipsis: {
|
|
showTitle: false
|
|
},
|
|
render: function render(value, v) {
|
|
var _value$2;
|
|
if (!(value !== null && value !== void 0 && value.length)) return '--';
|
|
var str = '';
|
|
if (!!(value !== null && value !== void 0 && value.length)) {
|
|
var _value$;
|
|
str = (0,util/* cutFileName */.tP)(value === null || value === void 0 || (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.title, 6);
|
|
}
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
placement: "topLeft",
|
|
title: value === null || value === void 0 || (_value$2 = value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.title,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: function onClick() {
|
|
var _value$3;
|
|
(0,util/* downLoadLink */.Nd)('', "".concat(env/* default */.Z.API_SERVER).concat((_value$3 = value[0]) === null || _value$3 === void 0 || (_value$3 = _value$3.url) === null || _value$3 === void 0 ? void 0 : _value$3.replace('disposition=inline', '')));
|
|
},
|
|
className: "current",
|
|
style: {
|
|
color: '#3061D0'
|
|
},
|
|
children: str
|
|
})
|
|
});
|
|
}
|
|
}, {
|
|
title: '状态',
|
|
dataIndex: 'status',
|
|
width: 90,
|
|
render: function render(value) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [value === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-black",
|
|
children: "\u672A\u4E0B\u8FBE"
|
|
}), value === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-black",
|
|
children: "\u5DF2\u4E0B\u8FBE"
|
|
})]
|
|
});
|
|
}
|
|
}, {
|
|
title: '操作',
|
|
dataIndex: 'action',
|
|
align: 'right',
|
|
width: 100,
|
|
render: function render(value, v) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
justify: "end",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: function onClick() {
|
|
var _v$attachments;
|
|
taskId.current = v.id;
|
|
fileListIds.current = v === null || v === void 0 || (_v$attachments = v.attachments) === null || _v$attachments === void 0 ? void 0 : _v$attachments.map(function (e) {
|
|
return e.id;
|
|
});
|
|
},
|
|
className: "current font14 c-light-primary",
|
|
children: "\u63D0\u4EA4"
|
|
})
|
|
})), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: function onClick() {
|
|
setVisible(true);
|
|
setData(objectSpread2_default()({}, v));
|
|
},
|
|
className: "current font14 c-light-primary ml20",
|
|
children: "\u8BE6\u60C5"
|
|
})]
|
|
});
|
|
}
|
|
}];
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TeacherModule/* default */.Z, {
|
|
tags: tags,
|
|
tagsTitle: "\u4E0B\u8FBE\u72B6\u6001",
|
|
tagsTitleWidth: 56,
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BFE\u9898\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
columns: columns,
|
|
updateKey: updateKey,
|
|
inputWidth: 222
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(DetailsModal, {
|
|
visible: visible,
|
|
data: data,
|
|
sendUrl: sendUrl,
|
|
onClose: function onClose() {
|
|
setVisible(false);
|
|
setData({});
|
|
setUpdateKey(updateKey + 1);
|
|
}
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Teacher = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var graduations = _ref3.graduations;
|
|
return {
|
|
graduations: graduations
|
|
};
|
|
})(Page));
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createForOfIteratorHelper.js
|
|
var createForOfIteratorHelper = __webpack_require__(91232);
|
|
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
|
|
// 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);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/Student/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Studentmodules = ({"flex_box_center":"flex_box_center___YhVJ8","flex_space_between":"flex_space_between___ZwNFf","flex_box_vertical_center":"flex_box_vertical_center___zVi38","flex_box_center_end":"flex_box_center_end___XiBd9","flex_box_column":"flex_box_column___wlJ_z","wrap":"wrap___btDZi","card":"card___ynWkb","title":"title___ZK2i5","teacherWrap":"teacherWrap___mwbsp","titleCol":"titleCol___Yw1us","head":"head___Eh7hH","rowWrap":"rowWrap___iqlIh","row":"row___ysuMF","name":"name___Vp5LK","btns":"btns___TQ4qx"});
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(72544);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/HeadTitle/index.tsx + 1 modules
|
|
var HeadTitle = __webpack_require__(38680);
|
|
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
|
var PreviewAll = __webpack_require__(92472);
|
|
// EXTERNAL MODULE: ./node_modules/_jszip@3.10.1@jszip/dist/jszip.min.js
|
|
var jszip_min = __webpack_require__(86129);
|
|
var jszip_min_default = /*#__PURE__*/__webpack_require__.n(jszip_min);
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/Student/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Student_Page = function Page(_ref) {
|
|
var _data$teachers;
|
|
var graduations = _ref.graduations,
|
|
dispatch = _ref.dispatch;
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
var _useState = (0,_react_17_0_2_react.useState)(true),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
loading = _useState2[0],
|
|
setLoading = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([{}]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
data = _useState4[0],
|
|
setData = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([{}]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
previewData = _useState6[0],
|
|
setPreviewData = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
list = _useState8[0],
|
|
setList = _useState8[1];
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
activeKey = _useState10[0],
|
|
setActiveKey = _useState10[1];
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(0),
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
isEmptyStatus = _useState12[0],
|
|
setIsEmptyStatus = _useState12[1];
|
|
var monacoValueRef = (0,_react_17_0_2_react.useRef)();
|
|
var menus = graduations.menus,
|
|
details = graduations.details;
|
|
var tabParams = menus.find(function (e) {
|
|
return e.clazz === 'tasks';
|
|
}) || {};
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (tabParams !== null && tabParams !== void 0 && tabParams.id) {
|
|
getData();
|
|
}
|
|
}, [tabParams === null || tabParams === void 0 ? void 0 : tabParams.id]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var res, _res$data, _res$data2, _res$data3, _res$data4, state;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setLoading(true);
|
|
_context.next = 3;
|
|
return (0,utils_fetch/* default */.ZP)("/api/graduations/".concat(urlParams.id, "/graduation_stages/").concat(tabParams === null || tabParams === void 0 ? void 0 : tabParams.id, ".json"), {
|
|
method: "get"
|
|
});
|
|
case 3:
|
|
res = _context.sent;
|
|
if (res.status === 0) {
|
|
setData((res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data[0]) || {});
|
|
setList((res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 || (_res$data2 = _res$data2[0]) === null || _res$data2 === void 0 ? void 0 : _res$data2.attachments) || []);
|
|
state = 0;
|
|
if ((0,lodash.isEmpty)(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3[0])) {
|
|
state = 1;
|
|
} else if ((res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 || (_res$data4 = _res$data4[0]) === null || _res$data4 === void 0 ? void 0 : _res$data4.status) === 0) {
|
|
state = 2;
|
|
}
|
|
setIsEmptyStatus(state);
|
|
}
|
|
setLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleCheckBox = function handleCheckBox(value, id, type) {
|
|
var keys = [];
|
|
if (type === 'all' && value) {
|
|
keys = list.map(function (e) {
|
|
return e.id;
|
|
});
|
|
} else if (type !== 'all') {
|
|
if (value) {
|
|
keys = [].concat(toConsumableArray_default()(activeKey), [id]);
|
|
} else {
|
|
keys = activeKey.filter(function (e) {
|
|
return e !== id;
|
|
});
|
|
}
|
|
}
|
|
setActiveKey(keys);
|
|
};
|
|
var batchDown = function batchDown() {
|
|
if (!activeKey.length) {
|
|
message/* default */.ZP.warning('请选择文件');
|
|
return;
|
|
}
|
|
var dealItem = list.filter(function (e) {
|
|
return activeKey.includes(e.id);
|
|
});
|
|
handleAllDownload((details === null || details === void 0 ? void 0 : details.name) + "-任务书", dealItem);
|
|
// dealItem.forEach((e: any) => {
|
|
// downLoadLink('', `${ENV.API_SERVER}${e.url?.replace('disposition=inline', '')}`)
|
|
// })
|
|
};
|
|
var handlePreviewClick = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(item) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
if (!(item.file_type === "txt")) {
|
|
_context2.next = 5;
|
|
break;
|
|
}
|
|
_context2.next = 3;
|
|
return (0,utils_fetch/* default */.ZP)(item.url, {
|
|
method: "get",
|
|
headers: {
|
|
"Content-Type": "application/xml"
|
|
}
|
|
});
|
|
case 3:
|
|
res = _context2.sent;
|
|
monacoValueRef.current = res;
|
|
case 5:
|
|
setPreviewData({
|
|
type: item.file_type,
|
|
content: env/* default */.Z.API_SERVER + item.url
|
|
});
|
|
case 6:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function handlePreviewClick(_x) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleAllDownload = /*#__PURE__*/function () {
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(name) {
|
|
var urlList,
|
|
DownloadList,
|
|
modal,
|
|
zip,
|
|
nameLsit,
|
|
addzip,
|
|
i,
|
|
_iterator,
|
|
_step,
|
|
item,
|
|
_args5 = arguments;
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
urlList = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : [];
|
|
DownloadList = urlList === null || urlList === void 0 ? void 0 : urlList.filter(function (item) {
|
|
return item.url != "";
|
|
});
|
|
if (!(DownloadList.length == 0)) {
|
|
_context5.next = 5;
|
|
break;
|
|
}
|
|
message/* default */.ZP.warning("暂无下载文件");
|
|
return _context5.abrupt("return");
|
|
case 5:
|
|
modal = es_modal/* default */.Z.info({
|
|
width: 500,
|
|
icon: null,
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u6B63\u5728\u6279\u91CF\u5BFC\u51FA\u4EFB\u52A1\u6587\u4EF6,", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-red",
|
|
children: "\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3"
|
|
})]
|
|
}),
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u5F53\u524D\u8FDB\u5EA6: ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-blue",
|
|
children: 0
|
|
}), "/", DownloadList.length]
|
|
}),
|
|
maskClosable: false,
|
|
className: Studentmodules.modal,
|
|
onOk: function onOk() {}
|
|
});
|
|
zip = new (jszip_min_default())();
|
|
nameLsit = [];
|
|
addzip = /*#__PURE__*/function () {
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(data, progress) {
|
|
var response, blob, getZipFile;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
_context4.prev = 0;
|
|
_context4.next = 3;
|
|
return fetch(env/* default */.Z.API_SERVER + data.url, {
|
|
method: "get"
|
|
});
|
|
case 3:
|
|
response = _context4.sent;
|
|
_context4.next = 6;
|
|
return response.blob();
|
|
case 6:
|
|
blob = _context4.sent;
|
|
getZipFile = /*#__PURE__*/function () {
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(name) {
|
|
var index,
|
|
filename,
|
|
nextName,
|
|
_args3 = arguments;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
index = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : 0;
|
|
filename = name.split(".");
|
|
filename.pop();
|
|
nextName = "".concat(filename.join(""), "(").concat(index, ").").concat(name.split(".").at(-1));
|
|
if (index == 0 && nameLsit.includes(name) || nameLsit.includes(nextName)) {
|
|
getZipFile(name, index + 1);
|
|
} else {
|
|
nameLsit.push(index == 0 ? name : nextName);
|
|
zip.file(index == 0 ? name : nextName, blob);
|
|
}
|
|
case 5:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
return function getZipFile(_x5) {
|
|
return _ref6.apply(this, arguments);
|
|
};
|
|
}();
|
|
_context4.next = 10;
|
|
return getZipFile(data === null || data === void 0 ? void 0 : data.title);
|
|
case 10:
|
|
modal.update({
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: ["\u5F53\u524D\u8FDB\u5EA6: ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-blue",
|
|
children: progress
|
|
}), "/", DownloadList.length]
|
|
})
|
|
});
|
|
_context4.next = 16;
|
|
break;
|
|
case 13:
|
|
_context4.prev = 13;
|
|
_context4.t0 = _context4["catch"](0);
|
|
message/* default */.ZP.error("".concat(data === null || data === void 0 ? void 0 : data.title, "\u4E0B\u8F7D\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A").concat(_context4.t0));
|
|
case 16:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4, null, [[0, 13]]);
|
|
}));
|
|
return function addzip(_x3, _x4) {
|
|
return _ref5.apply(this, arguments);
|
|
};
|
|
}();
|
|
if (!(DownloadList.length > 0)) {
|
|
_context5.next = 29;
|
|
break;
|
|
}
|
|
i = 0;
|
|
_iterator = createForOfIteratorHelper_default()(DownloadList);
|
|
_context5.prev = 12;
|
|
_iterator.s();
|
|
case 14:
|
|
if ((_step = _iterator.n()).done) {
|
|
_context5.next = 20;
|
|
break;
|
|
}
|
|
item = _step.value;
|
|
_context5.next = 18;
|
|
return addzip(item, ++i);
|
|
case 18:
|
|
_context5.next = 14;
|
|
break;
|
|
case 20:
|
|
_context5.next = 25;
|
|
break;
|
|
case 22:
|
|
_context5.prev = 22;
|
|
_context5.t0 = _context5["catch"](12);
|
|
_iterator.e(_context5.t0);
|
|
case 25:
|
|
_context5.prev = 25;
|
|
_iterator.f();
|
|
return _context5.finish(25);
|
|
case 28:
|
|
zip.generateAsync({
|
|
type: "blob"
|
|
}).then(function (blob) {
|
|
(0,util/* downLoadFile */.FH)(name, window.URL.createObjectURL(blob));
|
|
});
|
|
case 29:
|
|
modal.destroy();
|
|
case 30:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5, null, [[12, 22, 25, 28]]);
|
|
}));
|
|
return function handleAllDownload(_x2) {
|
|
return _ref4.apply(this, arguments);
|
|
};
|
|
}();
|
|
console.log(previewData, 'previewData');
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Studentmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(HeadTitle/* default */.Z, {
|
|
title: "\u4EFB\u52A1\u4E66",
|
|
status: tabParams === null || tabParams === void 0 ? void 0 : tabParams.status,
|
|
startAt: tabParams === null || tabParams === void 0 ? void 0 : tabParams.start_at,
|
|
endAt: tabParams === null || tabParams === void 0 ? void 0 : tabParams.end_at
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
active: true,
|
|
loading: loading,
|
|
children: [!!isEmptyStatus && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
customText: isEmptyStatus === 1 ? '当前阶段暂时无法开启,请先完成之前阶段的任务' : '当前老师还未下达任务书哦'
|
|
}), !isEmptyStatus && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Studentmodules.card,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#5f6368'
|
|
},
|
|
className: "mr20 font14",
|
|
children: "\u8BFE\u9898\u540D\u79F0"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: data === null || data === void 0 ? void 0 : data.name,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
color: '#333',
|
|
fontSize: 16
|
|
},
|
|
children: (0,util/* cutName */.Pq)(data === null || data === void 0 ? void 0 : data.name, 59)
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Studentmodules.title,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flexShrink: 0,
|
|
marginTop: 4,
|
|
color: '#5f6368'
|
|
},
|
|
className: "mr20",
|
|
children: "\u6307\u5BFC\u8001\u5E08"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Studentmodules.teacherWrap,
|
|
children: data === null || data === void 0 || (_data$teachers = data.teachers) === null || _data$teachers === void 0 ? void 0 : _data$teachers.map(function (e, i) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Studentmodules.titleCol,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
width: 28,
|
|
height: 28,
|
|
style: {
|
|
borderRadius: '50%'
|
|
},
|
|
src: "".concat(env/* default */.Z === null || env/* default */.Z === void 0 ? void 0 : env/* default */.Z.IMG_SERVER, "/images/").concat(e === null || e === void 0 ? void 0 : e.avatar_url)
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-grey-333 ml10 font16",
|
|
children: e.real_name
|
|
})]
|
|
}, i);
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Studentmodules.head,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
onChange: function onChange(e) {
|
|
return handleCheckBox(e.target.checked, null, 'all');
|
|
},
|
|
checked: !!activeKey.length && activeKey.length === list.length,
|
|
indeterminate: !!activeKey.length && activeKey.length !== list.length
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "ml10",
|
|
children: "\u4EFB\u52A1\u4E66"
|
|
}), !!(activeKey !== null && activeKey !== void 0 && activeKey.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
onClick: batchDown,
|
|
style: {
|
|
marginLeft: 'auto'
|
|
},
|
|
className: "c-light-primary current",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-xiazai4 mr5 font14"
|
|
}), "\u6279\u91CF\u4E0B\u8F7D"]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Studentmodules.rowWrap,
|
|
children: list === null || list === void 0 ? void 0 : list.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Studentmodules.row,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
onChange: function onChange(e) {
|
|
return handleCheckBox(e.target.checked, item.id);
|
|
},
|
|
checked: activeKey.includes(item.id)
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Studentmodules.name,
|
|
title: item.title,
|
|
children: (0,util/* cutFileName */.tP)(item.title, 60)
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: Studentmodules.btns,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(tooltip/* default */.Z, {
|
|
className: "mr20",
|
|
title: "\u9884\u89C8",
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
onClick: function onClick() {
|
|
return handlePreviewClick(item);
|
|
},
|
|
className: "iconfont icon-chakanshenqingjilu c-light-primary current font14"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(tooltip/* default */.Z, {
|
|
title: "\u4E0B\u8F7D",
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
onClick: function onClick() {
|
|
var _item$url;
|
|
(0,util/* downLoadLink */.Nd)('', "".concat(env/* default */.Z.API_SERVER).concat((_item$url = item.url) === null || _item$url === void 0 ? void 0 : _item$url.replace('disposition=inline', '')));
|
|
},
|
|
className: "iconfont icon-xiazai4 c-light-primary current font14"
|
|
})]
|
|
})]
|
|
})]
|
|
}, item.id);
|
|
})
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PreviewAll/* default */.Z, {
|
|
close: true,
|
|
data: previewData === null || previewData === void 0 ? void 0 : previewData.content,
|
|
type: previewData === null || previewData === void 0 ? void 0 : previewData.type,
|
|
hasMask: true,
|
|
monacoEditor: {
|
|
value: monacoValueRef.current,
|
|
language: "txt",
|
|
onChange: function onChange() {},
|
|
options: {
|
|
readOnly: true,
|
|
fontSize: 14,
|
|
minimap: {
|
|
enabled: false
|
|
}
|
|
}
|
|
},
|
|
onClose: function onClose() {
|
|
setPreviewData({
|
|
content: "",
|
|
type: ""
|
|
});
|
|
}
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Student = ((0,_umi_production_exports.connect)(function (_ref7) {
|
|
var graduations = _ref7.graduations;
|
|
return {
|
|
graduations: graduations
|
|
};
|
|
})(Student_Page));
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(40441);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Tasks_Page = function Page(_ref) {
|
|
var graduations = _ref.graduations,
|
|
dispatch = _ref.dispatch,
|
|
loading = _ref.loading;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
|
|
style: {
|
|
margin: '20px 0 0 45px'
|
|
},
|
|
loading: loading.effects['graduations/getGraduationsDetails'],
|
|
children: (0,authority/* isGPAdminOrTeacher */.tu)() ? /*#__PURE__*/(0,jsx_runtime.jsx)(Teacher, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(Student, {})
|
|
});
|
|
};
|
|
/* harmony default export */ var Tasks = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
var loading = _ref2.loading,
|
|
graduations = _ref2.graduations;
|
|
return {
|
|
loading: loading,
|
|
graduations: graduations
|
|
};
|
|
})(Tasks_Page));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 38680:
|
|
/*!**************************************************************************!*\
|
|
!*** ./src/pages/Graduations/components/HeadTitle/index.tsx + 1 modules ***!
|
|
\**************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_HeadTitle; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/components/HeadTitle/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var HeadTitlemodules = ({"flex_box_center":"flex_box_center___oGGi8","flex_space_between":"flex_space_between___e1At5","flex_box_vertical_center":"flex_box_vertical_center___K1Nl5","flex_box_center_end":"flex_box_center_end___IP1rf","flex_box_column":"flex_box_column____nxPW","title":"title___Ynb7w","time":"time___dxFRB"});
|
|
// 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: ./src/pages/Graduations/components/Tags/index.tsx + 1 modules
|
|
var Tags = __webpack_require__(92925);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(9498);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/components/HeadTitle/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var HeadTitle = function HeadTitle(_ref) {
|
|
var className = _ref.className,
|
|
status = _ref.status,
|
|
_ref$style = _ref.style,
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
startAt = _ref.startAt,
|
|
endAt = _ref.endAt,
|
|
title = _ref.title;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: _classnames_2_5_1_classnames_default()(HeadTitlemodules.title, className),
|
|
style: style,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
children: title
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Tags/* default */.Z, {
|
|
className: "ml10",
|
|
status: status
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: HeadTitlemodules.time,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u5F00\u542F\u65F6\u95F4", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "ml10",
|
|
children: startAt ? dayjs_min_default()(startAt).format("YYYY-MM-DD HH:mm") : '--'
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "ml30",
|
|
children: ["\u622A\u6B62\u65F6\u95F4", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "ml10",
|
|
children: endAt ? dayjs_min_default()(endAt).format("YYYY-MM-DD HH:mm") : '--'
|
|
})]
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var components_HeadTitle = (HeadTitle);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 92925:
|
|
/*!*********************************************************************!*\
|
|
!*** ./src/pages/Graduations/components/Tags/index.tsx + 1 modules ***!
|
|
\*********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_Tags; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/components/Tags/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Tagsmodules = ({"flex_box_center":"flex_box_center___Sswcw","flex_space_between":"flex_space_between___nBexI","flex_box_vertical_center":"flex_box_vertical_center___sPXvb","flex_box_center_end":"flex_box_center_end___c6nca","flex_box_column":"flex_box_column___Bq_gi","tag":"tag___NEywM"});
|
|
// 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/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/components/Tags/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
var Tags = function Tags(_ref) {
|
|
var className = _ref.className,
|
|
status = _ref.status;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
|
|
children: [status === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: _classnames_2_5_1_classnames_default()(Tagsmodules.tag, className),
|
|
children: "\u672A\u5F00\u59CB"
|
|
}), status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: _classnames_2_5_1_classnames_default()(Tagsmodules.tag, className),
|
|
style: {
|
|
background: "#19CB70"
|
|
},
|
|
children: "\u8FDB\u884C\u4E2D"
|
|
}), status === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: _classnames_2_5_1_classnames_default()(Tagsmodules.tag, className),
|
|
style: {
|
|
background: "#EE5D5D"
|
|
},
|
|
children: "\u5DF2\u7ED3\u675F"
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var components_Tags = (Tags);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 58572:
|
|
/*!******************************************************************************!*\
|
|
!*** ./src/pages/Graduations/components/TeacherModule/index.tsx + 1 modules ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ TeacherModule; }
|
|
});
|
|
|
|
// 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/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);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/components/TeacherModule/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var TeacherModulemodules = ({"flex_box_center":"flex_box_center___Q4rC9","flex_space_between":"flex_space_between___pzGZc","flex_box_vertical_center":"flex_box_vertical_center___DhNf8","flex_box_center_end":"flex_box_center_end___ALRjT","flex_box_column":"flex_box_column___p6z9Y","wrap":"wrap____H2XH"});
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(46478);
|
|
// 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/table/index.js + 85 modules
|
|
var table = __webpack_require__(90508);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
|
var ui_customization = __webpack_require__(72143);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/HeadTitle/index.tsx + 1 modules
|
|
var HeadTitle = __webpack_require__(38680);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(79539);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/SettingModal/index.tsx + 1 modules
|
|
var SettingModal = __webpack_require__(94507);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(72544);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(67747);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/components/TeacherModule/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
var _location$pathname$sp, _jsonItem$find, _menus;
|
|
var graduations = _ref.graduations,
|
|
dispatch = _ref.dispatch,
|
|
tags = _ref.tags,
|
|
tagsTitle = _ref.tagsTitle,
|
|
tagsTitleWidth = _ref.tagsTitleWidth,
|
|
placeholder = _ref.placeholder,
|
|
columns = _ref.columns,
|
|
updateKey = _ref.updateKey,
|
|
_ref$inputWidth = _ref.inputWidth,
|
|
inputWidth = _ref$inputWidth === void 0 ? 214 : _ref$inputWidth;
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
searchParams = _useSearchParams2[0];
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
loading = _useState2[0],
|
|
setLoading = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(0),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
total = _useState4[0],
|
|
setTotal = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
list = _useState6[0],
|
|
setList = _useState6[1];
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
settingVisible = _useState8[0],
|
|
setSettingVisible = _useState8[1];
|
|
var menus = graduations.menus;
|
|
var tabKey = (_location$pathname$sp = location.pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[3];
|
|
var tabParams = menus.find(function (e) {
|
|
return e.clazz === tabKey;
|
|
}) || {};
|
|
var tabIndex = menus.find(function (e) {
|
|
return e.clazz === tabKey;
|
|
}) || 1;
|
|
var getUrlState = searchParams !== null && searchParams !== void 0 && searchParams.get('state') ? Number(searchParams === null || searchParams === void 0 ? void 0 : searchParams.get('state')) : '';
|
|
var _useState9 = (0,_react_17_0_2_react.useState)({
|
|
keyword: '',
|
|
status: getUrlState,
|
|
page: 1,
|
|
limit: 20
|
|
}),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
params = _useState10[0],
|
|
setParams = _useState10[1];
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (tabParams !== null && tabParams !== void 0 && tabParams.id) {
|
|
getList(params);
|
|
}
|
|
}, [tabParams === null || tabParams === void 0 ? void 0 : tabParams.id, updateKey]);
|
|
var getList = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(record) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setLoading(true);
|
|
_context.next = 3;
|
|
return (0,fetch/* default */.ZP)("/api/graduations/".concat(urlParams.id, "/graduation_stages/").concat(tabParams === null || tabParams === void 0 ? void 0 : tabParams.id, ".json"), {
|
|
method: "get",
|
|
params: record
|
|
});
|
|
case 3:
|
|
res = _context.sent;
|
|
if (res.status === 0) {
|
|
setList((res === null || res === void 0 ? void 0 : res.data) || []);
|
|
setTotal(res === null || res === void 0 ? void 0 : res.total_count);
|
|
}
|
|
setLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getList(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleChangeStatus = function handleChangeStatus(status) {
|
|
params.status = status;
|
|
params.page = 1;
|
|
setParams(params);
|
|
getList(params);
|
|
};
|
|
var handleSearch = function handleSearch(v) {
|
|
params.keyword = v;
|
|
params.page = 1;
|
|
setParams(params);
|
|
getList(params);
|
|
};
|
|
var handlePagination = function handlePagination(page, pageSize) {
|
|
params.page = page;
|
|
params.limit = pageSize;
|
|
setParams(params);
|
|
getList(params);
|
|
};
|
|
var jsonItem = [{
|
|
name: '任务书',
|
|
key: 'tasks',
|
|
notStartText: '当前阶段还未开启'
|
|
}, {
|
|
name: '开题报告',
|
|
key: 'opening_report',
|
|
notStartText: '当前阶段还未开启'
|
|
}, {
|
|
name: '中期检查',
|
|
key: 'midterm_report',
|
|
notStartText: '当前阶段还未开启'
|
|
}, {
|
|
name: '毕业论文',
|
|
key: 'thesis',
|
|
notStartText: '当前阶段还未开启'
|
|
}, {
|
|
name: '毕业答辩',
|
|
key: 'final_defense',
|
|
notStartText: '当前阶段还未开启'
|
|
}, {
|
|
name: '论文定稿',
|
|
key: 'final_thesis',
|
|
notStartText: '当前阶段还未开启'
|
|
}];
|
|
var notStartText = jsonItem === null || jsonItem === void 0 || (_jsonItem$find = jsonItem.find(function (e) {
|
|
return e.key === (tabParams === null || tabParams === void 0 ? void 0 : tabParams.clazz);
|
|
})) === null || _jsonItem$find === void 0 ? void 0 : _jsonItem$find.notStartText;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: TeacherModulemodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(HeadTitle/* default */.Z, {
|
|
title: tabParams === null || tabParams === void 0 ? void 0 : tabParams.name,
|
|
className: "mb10",
|
|
status: tabParams === null || tabParams === void 0 ? void 0 : tabParams.status,
|
|
startAt: tabParams === null || tabParams === void 0 ? void 0 : tabParams.start_at,
|
|
endAt: tabParams === null || tabParams === void 0 ? void 0 : tabParams.end_at
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
justify: "end",
|
|
style: {
|
|
height: 66
|
|
},
|
|
children: [!!(tabParams !== null && tabParams !== void 0 && tabParams.status) && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
align: "middle",
|
|
style: {
|
|
flex: 1
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTags */.qp, {
|
|
title: tagsTitle,
|
|
value: params.status,
|
|
onChange: handleChangeStatus,
|
|
dataSource: tags,
|
|
className: "mt20",
|
|
titleWidth: tagsTitleWidth
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
|
|
style: {
|
|
width: inputWidth,
|
|
marginLeft: 'auto'
|
|
},
|
|
placeholder: placeholder,
|
|
value: params.keyword,
|
|
onChange: handleSearch
|
|
})]
|
|
}), (0,util/* timeContrast */.QB)(tabParams === null || tabParams === void 0 ? void 0 : tabParams.next_start_at) && /*#__PURE__*/(0,jsx_runtime.jsxs)(ui_customization/* CustomButton */.op, {
|
|
style: {
|
|
marginLeft: 15
|
|
},
|
|
onClick: function onClick() {
|
|
return setSettingVisible(true);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-anquanshezhi font14 mr5"
|
|
}), tabParams === null || tabParams === void 0 ? void 0 : tabParams.name, "\u8BBE\u7F6E"]
|
|
})]
|
|
}), (tabParams === null || tabParams === void 0 ? void 0 : tabParams.status) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
customText: notStartText
|
|
}), !!(tabParams !== null && tabParams !== void 0 && tabParams.status) && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
columns: columns,
|
|
dataSource: list,
|
|
loading: loading,
|
|
rowKey: "id",
|
|
locale: {
|
|
emptyText: /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {})
|
|
},
|
|
pagination: {
|
|
current: params.page,
|
|
hideOnSinglePage: !total,
|
|
showQuickJumper: true,
|
|
showSizeChanger: true,
|
|
pageSize: params.limit,
|
|
pageSizeOptions: ['10', '20', '50', '100', '200'],
|
|
total: total,
|
|
size: 'default',
|
|
showTotal: util/* showTotal */.rU,
|
|
onChange: handlePagination
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SettingModal/* default */.Z, {
|
|
visible: settingVisible,
|
|
data: objectSpread2_default()(objectSpread2_default()({}, tabParams), {}, {
|
|
disabled_time: menus === null || menus === void 0 || (_menus = menus[tabIndex - 1]) === null || _menus === void 0 ? void 0 : _menus.end_at
|
|
}),
|
|
onClose: function onClose() {
|
|
return setSettingVisible(false);
|
|
},
|
|
onSuccess: function onSuccess() {
|
|
setSettingVisible(false);
|
|
}
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var TeacherModule = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var graduations = _ref3.graduations;
|
|
return {
|
|
graduations: graduations
|
|
};
|
|
})(Page));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 28103:
|
|
/*!***********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules ***!
|
|
\***********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ divider; }
|
|
});
|
|
|
|
// 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/_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/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(87832);
|
|
// 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/divider/style/index.js
|
|
|
|
|
|
// ============================== Shared ==============================
|
|
const genSharedDividerStyle = token => {
|
|
const {
|
|
componentCls,
|
|
sizePaddingEdgeHorizontal,
|
|
colorSplit,
|
|
lineWidth,
|
|
textPaddingInline,
|
|
orientationMargin,
|
|
verticalMarginInline
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
borderBlockStart: `${lineWidth}px solid ${colorSplit}`,
|
|
// vertical
|
|
'&-vertical': {
|
|
position: 'relative',
|
|
top: '-0.06em',
|
|
display: 'inline-block',
|
|
height: '0.9em',
|
|
marginInline: verticalMarginInline,
|
|
marginBlock: 0,
|
|
verticalAlign: 'middle',
|
|
borderTop: 0,
|
|
borderInlineStart: `${lineWidth}px solid ${colorSplit}`
|
|
},
|
|
'&-horizontal': {
|
|
display: 'flex',
|
|
clear: 'both',
|
|
width: '100%',
|
|
minWidth: '100%',
|
|
margin: `${token.dividerHorizontalGutterMargin}px 0`
|
|
},
|
|
[`&-horizontal${componentCls}-with-text`]: {
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
|
|
color: token.colorTextHeading,
|
|
fontWeight: 500,
|
|
fontSize: token.fontSizeLG,
|
|
whiteSpace: 'nowrap',
|
|
textAlign: 'center',
|
|
borderBlockStart: `0 ${colorSplit}`,
|
|
'&::before, &::after': {
|
|
position: 'relative',
|
|
width: '50%',
|
|
borderBlockStart: `${lineWidth}px solid transparent`,
|
|
// Chrome not accept `inherit` in `border-top`
|
|
borderBlockStartColor: 'inherit',
|
|
borderBlockEnd: 0,
|
|
transform: 'translateY(50%)',
|
|
content: "''"
|
|
}
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-left`]: {
|
|
'&::before': {
|
|
width: `${orientationMargin * 100}%`
|
|
},
|
|
'&::after': {
|
|
width: `${100 - orientationMargin * 100}%`
|
|
}
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-right`]: {
|
|
'&::before': {
|
|
width: `${100 - orientationMargin * 100}%`
|
|
},
|
|
'&::after': {
|
|
width: `${orientationMargin * 100}%`
|
|
}
|
|
},
|
|
[`${componentCls}-inner-text`]: {
|
|
display: 'inline-block',
|
|
paddingBlock: 0,
|
|
paddingInline: textPaddingInline
|
|
},
|
|
'&-dashed': {
|
|
background: 'none',
|
|
borderColor: colorSplit,
|
|
borderStyle: 'dashed',
|
|
borderWidth: `${lineWidth}px 0 0`
|
|
},
|
|
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
|
|
'&::before, &::after': {
|
|
borderStyle: 'dashed none none'
|
|
}
|
|
},
|
|
[`&-vertical${componentCls}-dashed`]: {
|
|
borderInlineStartWidth: lineWidth,
|
|
borderInlineEnd: 0,
|
|
borderBlockStart: 0,
|
|
borderBlockEnd: 0
|
|
},
|
|
[`&-plain${componentCls}-with-text`]: {
|
|
color: token.colorText,
|
|
fontWeight: 'normal',
|
|
fontSize: token.fontSize
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-left${componentCls}-no-default-orientation-margin-left`]: {
|
|
'&::before': {
|
|
width: 0
|
|
},
|
|
'&::after': {
|
|
width: '100%'
|
|
},
|
|
[`${componentCls}-inner-text`]: {
|
|
paddingInlineStart: sizePaddingEdgeHorizontal
|
|
}
|
|
},
|
|
[`&-horizontal${componentCls}-with-text-right${componentCls}-no-default-orientation-margin-right`]: {
|
|
'&::before': {
|
|
width: '100%'
|
|
},
|
|
'&::after': {
|
|
width: 0
|
|
},
|
|
[`${componentCls}-inner-text`]: {
|
|
paddingInlineEnd: sizePaddingEdgeHorizontal
|
|
}
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var divider_style = ((0,genComponentStyleHook/* default */.Z)('Divider', token => {
|
|
const dividerToken = (0,statistic/* merge */.TS)(token, {
|
|
dividerHorizontalWithTextGutterMargin: token.margin,
|
|
dividerHorizontalGutterMargin: token.marginLG,
|
|
sizePaddingEdgeHorizontal: 0
|
|
});
|
|
return [genSharedDividerStyle(dividerToken)];
|
|
}, token => ({
|
|
textPaddingInline: '1em',
|
|
orientationMargin: 0.05,
|
|
verticalMarginInline: token.marginXS
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/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 Divider = props => {
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
divider
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
type = 'horizontal',
|
|
orientation = 'center',
|
|
orientationMargin,
|
|
className,
|
|
rootClassName,
|
|
children,
|
|
dashed,
|
|
plain,
|
|
style
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]);
|
|
const prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
const [wrapSSR, hashId] = divider_style(prefixCls);
|
|
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
|
|
const hasChildren = !!children;
|
|
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
|
|
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
|
|
const classString = _classnames_2_5_1_classnames_default()(prefixCls, divider === null || divider === void 0 ? void 0 : divider.className, hashId, `${prefixCls}-${type}`, {
|
|
[`${prefixCls}-with-text`]: hasChildren,
|
|
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
|
|
[`${prefixCls}-dashed`]: !!dashed,
|
|
[`${prefixCls}-plain`]: !!plain,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft,
|
|
[`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight
|
|
}, className, rootClassName);
|
|
const memoizedOrientationMargin = _react_17_0_2_react.useMemo(() => {
|
|
if (typeof orientationMargin === 'number') {
|
|
return orientationMargin;
|
|
}
|
|
if (/^\d+$/.test(orientationMargin)) {
|
|
return Number(orientationMargin);
|
|
}
|
|
return orientationMargin;
|
|
}, [orientationMargin]);
|
|
const innerStyle = Object.assign(Object.assign({}, hasCustomMarginLeft && {
|
|
marginLeft: memoizedOrientationMargin
|
|
}), hasCustomMarginRight && {
|
|
marginRight: memoizedOrientationMargin
|
|
});
|
|
// Warning children not work in vertical mode
|
|
if (false) {}
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
className: classString,
|
|
style: Object.assign(Object.assign({}, divider === null || divider === void 0 ? void 0 : divider.style), style)
|
|
}, restProps, {
|
|
role: "separator"
|
|
}), children && type !== 'vertical' && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-inner-text`,
|
|
style: innerStyle
|
|
}, children)));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var divider = (Divider);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 89884:
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/rate/index.js + 8 modules ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ rate; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(66820);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/StarFilled.js
|
|
// This icon file is generated automatically.
|
|
var StarFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" } }] }, "name": "star", "theme": "filled" };
|
|
/* harmony default export */ var asn_StarFilled = (StarFilled);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(13814);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/StarFilled.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var StarFilled_StarFilled = function StarFilled(props, ref) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_StarFilled
|
|
}));
|
|
};
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(StarFilled_StarFilled);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_StarFilled = (RefIcon);
|
|
// 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.24.1@@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(80999);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(38440);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(17313);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/hooks/useMergedState.js
|
|
var useMergedState = __webpack_require__(290);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/KeyCode.js
|
|
var KeyCode = __webpack_require__(81331);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/pickAttrs.js
|
|
var pickAttrs = __webpack_require__(90339);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/Star.js
|
|
|
|
|
|
|
|
function Star(props, ref) {
|
|
var disabled = props.disabled,
|
|
prefixCls = props.prefixCls,
|
|
character = props.character,
|
|
characterRender = props.characterRender,
|
|
index = props.index,
|
|
count = props.count,
|
|
value = props.value,
|
|
allowHalf = props.allowHalf,
|
|
focused = props.focused,
|
|
onHover = props.onHover,
|
|
onClick = props.onClick;
|
|
// =========================== Events ===========================
|
|
var onInternalHover = function onInternalHover(e) {
|
|
onHover(e, index);
|
|
};
|
|
var onInternalClick = function onInternalClick(e) {
|
|
onClick(e, index);
|
|
};
|
|
var onInternalKeyDown = function onInternalKeyDown(e) {
|
|
if (e.keyCode === KeyCode/* default */.Z.ENTER) {
|
|
onClick(e, index);
|
|
}
|
|
};
|
|
// =========================== Render ===========================
|
|
// >>>>> ClassName
|
|
var starValue = index + 1;
|
|
var classNameList = new Set([prefixCls]);
|
|
// TODO: Current we just refactor from CC to FC. This logic seems can be optimized.
|
|
if (value === 0 && index === 0 && focused) {
|
|
classNameList.add("".concat(prefixCls, "-focused"));
|
|
} else if (allowHalf && value + 0.5 >= starValue && value < starValue) {
|
|
classNameList.add("".concat(prefixCls, "-half"));
|
|
classNameList.add("".concat(prefixCls, "-active"));
|
|
if (focused) {
|
|
classNameList.add("".concat(prefixCls, "-focused"));
|
|
}
|
|
} else {
|
|
if (starValue <= value) {
|
|
classNameList.add("".concat(prefixCls, "-full"));
|
|
} else {
|
|
classNameList.add("".concat(prefixCls, "-zero"));
|
|
}
|
|
if (starValue === value && focused) {
|
|
classNameList.add("".concat(prefixCls, "-focused"));
|
|
}
|
|
}
|
|
// >>>>> Node
|
|
var characterNode = typeof character === 'function' ? character(props) : character;
|
|
var start = /*#__PURE__*/_react_17_0_2_react.createElement("li", {
|
|
className: _classnames_2_5_1_classnames_default()(Array.from(classNameList)),
|
|
ref: ref
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
onClick: disabled ? null : onInternalClick,
|
|
onKeyDown: disabled ? null : onInternalKeyDown,
|
|
onMouseMove: disabled ? null : onInternalHover,
|
|
role: "radio",
|
|
"aria-checked": value > index ? 'true' : 'false',
|
|
"aria-posinset": index + 1,
|
|
"aria-setsize": count,
|
|
tabIndex: disabled ? -1 : 0
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: "".concat(prefixCls, "-first")
|
|
}, characterNode), /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: "".concat(prefixCls, "-second")
|
|
}, characterNode)));
|
|
if (characterRender) {
|
|
start = characterRender(start, props);
|
|
}
|
|
return start;
|
|
}
|
|
/* harmony default export */ var es_Star = (/*#__PURE__*/_react_17_0_2_react.forwardRef(Star));
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/useRefs.js
|
|
|
|
function useRefs() {
|
|
var nodeRef = _react_17_0_2_react.useRef({});
|
|
function getRef(index) {
|
|
return nodeRef.current[index];
|
|
}
|
|
function setRef(index) {
|
|
return function (node) {
|
|
nodeRef.current[index] = node;
|
|
};
|
|
}
|
|
return [getRef, setRef];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/util.js
|
|
function getScroll(w) {
|
|
var ret = w.pageXOffset;
|
|
var method = 'scrollLeft';
|
|
if (typeof ret !== 'number') {
|
|
var d = w.document;
|
|
// ie6,7,8 standard mode
|
|
ret = d.documentElement[method];
|
|
if (typeof ret !== 'number') {
|
|
// quirks mode
|
|
ret = d.body[method];
|
|
}
|
|
}
|
|
return ret;
|
|
}
|
|
function getClientPosition(elem) {
|
|
var x;
|
|
var y;
|
|
var doc = elem.ownerDocument;
|
|
var body = doc.body;
|
|
var docElem = doc && doc.documentElement;
|
|
var box = elem.getBoundingClientRect();
|
|
x = box.left;
|
|
y = box.top;
|
|
x -= docElem.clientLeft || body.clientLeft || 0;
|
|
y -= docElem.clientTop || body.clientTop || 0;
|
|
return {
|
|
left: x,
|
|
top: y
|
|
};
|
|
}
|
|
function getOffsetLeft(el) {
|
|
var pos = getClientPosition(el);
|
|
var doc = el.ownerDocument;
|
|
// Only IE use `parentWindow`
|
|
var w = doc.defaultView || doc.parentWindow;
|
|
pos.left += getScroll(w);
|
|
return pos.left;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/Rate.js
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "defaultValue", "value", "count", "allowHalf", "allowClear", "character", "characterRender", "disabled", "direction", "tabIndex", "autoFocus", "onHoverChange", "onChange", "onFocus", "onBlur", "onKeyDown", "onMouseLeave"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Rate(props, ref) {
|
|
var _classNames;
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-rate' : _props$prefixCls,
|
|
className = props.className,
|
|
defaultValue = props.defaultValue,
|
|
propValue = props.value,
|
|
_props$count = props.count,
|
|
count = _props$count === void 0 ? 5 : _props$count,
|
|
_props$allowHalf = props.allowHalf,
|
|
allowHalf = _props$allowHalf === void 0 ? false : _props$allowHalf,
|
|
_props$allowClear = props.allowClear,
|
|
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
_props$character = props.character,
|
|
character = _props$character === void 0 ? '★' : _props$character,
|
|
characterRender = props.characterRender,
|
|
disabled = props.disabled,
|
|
_props$direction = props.direction,
|
|
direction = _props$direction === void 0 ? 'ltr' : _props$direction,
|
|
_props$tabIndex = props.tabIndex,
|
|
tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
|
|
autoFocus = props.autoFocus,
|
|
onHoverChange = props.onHoverChange,
|
|
onChange = props.onChange,
|
|
onFocus = props.onFocus,
|
|
onBlur = props.onBlur,
|
|
onKeyDown = props.onKeyDown,
|
|
onMouseLeave = props.onMouseLeave,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
var _useRefs = useRefs(),
|
|
_useRefs2 = (0,slicedToArray/* default */.Z)(_useRefs, 2),
|
|
getStarRef = _useRefs2[0],
|
|
setStarRef = _useRefs2[1];
|
|
var rateRef = _react_17_0_2_react.useRef(null);
|
|
// ============================ Ref =============================
|
|
var triggerFocus = function triggerFocus() {
|
|
if (!disabled) {
|
|
var _rateRef$current;
|
|
(_rateRef$current = rateRef.current) === null || _rateRef$current === void 0 ? void 0 : _rateRef$current.focus();
|
|
}
|
|
};
|
|
_react_17_0_2_react.useImperativeHandle(ref, function () {
|
|
return {
|
|
focus: triggerFocus,
|
|
blur: function blur() {
|
|
if (!disabled) {
|
|
var _rateRef$current2;
|
|
(_rateRef$current2 = rateRef.current) === null || _rateRef$current2 === void 0 ? void 0 : _rateRef$current2.blur();
|
|
}
|
|
}
|
|
};
|
|
});
|
|
// =========================== Value ============================
|
|
var _useMergedState = (0,useMergedState/* default */.Z)(defaultValue || 0, {
|
|
value: propValue
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
value = _useMergedState2[0],
|
|
setValue = _useMergedState2[1];
|
|
var _useMergedState3 = (0,useMergedState/* default */.Z)(null),
|
|
_useMergedState4 = (0,slicedToArray/* default */.Z)(_useMergedState3, 2),
|
|
cleanedValue = _useMergedState4[0],
|
|
setCleanedValue = _useMergedState4[1];
|
|
var getStarValue = function getStarValue(index, x) {
|
|
var reverse = direction === 'rtl';
|
|
var starValue = index + 1;
|
|
if (allowHalf) {
|
|
var starEle = getStarRef(index);
|
|
var leftDis = getOffsetLeft(starEle);
|
|
var width = starEle.clientWidth;
|
|
if (reverse && x - leftDis > width / 2) {
|
|
starValue -= 0.5;
|
|
} else if (!reverse && x - leftDis < width / 2) {
|
|
starValue -= 0.5;
|
|
}
|
|
}
|
|
return starValue;
|
|
};
|
|
// >>>>> Change
|
|
var changeValue = function changeValue(nextValue) {
|
|
setValue(nextValue);
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
|
|
};
|
|
// =========================== Focus ============================
|
|
var _React$useState = _react_17_0_2_react.useState(false),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
focused = _React$useState2[0],
|
|
setFocused = _React$useState2[1];
|
|
var onInternalFocus = function onInternalFocus() {
|
|
setFocused(true);
|
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
};
|
|
var onInternalBlur = function onInternalBlur() {
|
|
setFocused(false);
|
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
};
|
|
// =========================== Hover ============================
|
|
var _React$useState3 = _react_17_0_2_react.useState(null),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
hoverValue = _React$useState4[0],
|
|
setHoverValue = _React$useState4[1];
|
|
var onHover = function onHover(event, index) {
|
|
var nextHoverValue = getStarValue(index, event.pageX);
|
|
if (nextHoverValue !== cleanedValue) {
|
|
setHoverValue(nextHoverValue);
|
|
setCleanedValue(null);
|
|
}
|
|
onHoverChange === null || onHoverChange === void 0 ? void 0 : onHoverChange(nextHoverValue);
|
|
};
|
|
var onMouseLeaveCallback = function onMouseLeaveCallback(event) {
|
|
if (!disabled) {
|
|
setHoverValue(null);
|
|
setCleanedValue(null);
|
|
onHoverChange === null || onHoverChange === void 0 ? void 0 : onHoverChange(undefined);
|
|
}
|
|
if (event) {
|
|
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(event);
|
|
}
|
|
};
|
|
// =========================== Click ============================
|
|
var onClick = function onClick(event, index) {
|
|
var newValue = getStarValue(index, event.pageX);
|
|
var isReset = false;
|
|
if (allowClear) {
|
|
isReset = newValue === value;
|
|
}
|
|
onMouseLeaveCallback();
|
|
changeValue(isReset ? 0 : newValue);
|
|
setCleanedValue(isReset ? newValue : null);
|
|
};
|
|
var onInternalKeyDown = function onInternalKeyDown(event) {
|
|
var keyCode = event.keyCode;
|
|
var reverse = direction === 'rtl';
|
|
var nextValue = value;
|
|
if (keyCode === KeyCode/* default */.Z.RIGHT && nextValue < count && !reverse) {
|
|
if (allowHalf) {
|
|
nextValue += 0.5;
|
|
} else {
|
|
nextValue += 1;
|
|
}
|
|
changeValue(nextValue);
|
|
event.preventDefault();
|
|
} else if (keyCode === KeyCode/* default */.Z.LEFT && nextValue > 0 && !reverse) {
|
|
if (allowHalf) {
|
|
nextValue -= 0.5;
|
|
} else {
|
|
nextValue -= 1;
|
|
}
|
|
changeValue(nextValue);
|
|
event.preventDefault();
|
|
} else if (keyCode === KeyCode/* default */.Z.RIGHT && nextValue > 0 && reverse) {
|
|
if (allowHalf) {
|
|
nextValue -= 0.5;
|
|
} else {
|
|
nextValue -= 1;
|
|
}
|
|
changeValue(nextValue);
|
|
event.preventDefault();
|
|
} else if (keyCode === KeyCode/* default */.Z.LEFT && nextValue < count && reverse) {
|
|
if (allowHalf) {
|
|
nextValue += 0.5;
|
|
} else {
|
|
nextValue += 1;
|
|
}
|
|
changeValue(nextValue);
|
|
event.preventDefault();
|
|
}
|
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
};
|
|
// =========================== Effect ===========================
|
|
_react_17_0_2_react.useEffect(function () {
|
|
if (autoFocus && !disabled) {
|
|
triggerFocus();
|
|
}
|
|
}, []);
|
|
// =========================== Render ===========================
|
|
// >>> Star
|
|
var starNodes = new Array(count).fill(0).map(function (item, index) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_Star, {
|
|
ref: setStarRef(index),
|
|
index: index,
|
|
count: count,
|
|
disabled: disabled,
|
|
prefixCls: "".concat(prefixCls, "-star"),
|
|
allowHalf: allowHalf,
|
|
value: hoverValue === null ? value : hoverValue,
|
|
onClick: onClick,
|
|
onHover: onHover,
|
|
key: item || index,
|
|
character: character,
|
|
characterRender: characterRender,
|
|
focused: focused
|
|
});
|
|
});
|
|
var classString = _classnames_2_5_1_classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames));
|
|
// >>> Node
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("ul", (0,esm_extends/* default */.Z)({
|
|
className: classString,
|
|
onMouseLeave: onMouseLeaveCallback,
|
|
tabIndex: disabled ? -1 : tabIndex,
|
|
onFocus: disabled ? null : onInternalFocus,
|
|
onBlur: disabled ? null : onInternalBlur,
|
|
onKeyDown: disabled ? null : onInternalKeyDown,
|
|
ref: rateRef,
|
|
role: "radiogroup"
|
|
}, (0,pickAttrs/* default */.Z)(restProps, {
|
|
aria: true,
|
|
data: true,
|
|
attr: true
|
|
})), starNodes);
|
|
}
|
|
/* harmony default export */ var es_Rate = (/*#__PURE__*/_react_17_0_2_react.forwardRef(Rate));
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-rate@2.12.0@rc-rate/es/index.js
|
|
|
|
/* harmony default export */ var es = (es_Rate);
|
|
// 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/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(87832);
|
|
// 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/rate/style/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
const genRateStarStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-star`]: {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
color: 'inherit',
|
|
cursor: 'pointer',
|
|
'&:not(:last-child)': {
|
|
marginInlineEnd: token.marginXS
|
|
},
|
|
'> div': {
|
|
transition: `all ${token.motionDurationMid}, outline 0s`,
|
|
'&:hover': {
|
|
transform: token.starHoverScale
|
|
},
|
|
'&:focus': {
|
|
outline: 0
|
|
},
|
|
'&:focus-visible': {
|
|
outline: `${token.lineWidth}px dashed ${token.starColor}`,
|
|
transform: token.starHoverScale
|
|
}
|
|
},
|
|
'&-first, &-second': {
|
|
color: token.starBg,
|
|
transition: `all ${token.motionDurationMid}`,
|
|
userSelect: 'none',
|
|
[token.iconCls]: {
|
|
verticalAlign: 'middle'
|
|
}
|
|
},
|
|
'&-first': {
|
|
position: 'absolute',
|
|
top: 0,
|
|
insetInlineStart: 0,
|
|
width: '50%',
|
|
height: '100%',
|
|
overflow: 'hidden',
|
|
opacity: 0
|
|
},
|
|
[`&-half ${componentCls}-star-first, &-half ${componentCls}-star-second`]: {
|
|
opacity: 1
|
|
},
|
|
[`&-half ${componentCls}-star-first, &-full ${componentCls}-star-second`]: {
|
|
color: 'inherit'
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const genRateRtlStyle = token => ({
|
|
[`&-rtl${token.componentCls}`]: {
|
|
direction: 'rtl'
|
|
}
|
|
});
|
|
const genRateStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
display: 'inline-block',
|
|
margin: 0,
|
|
padding: 0,
|
|
color: token.starColor,
|
|
fontSize: token.starSize,
|
|
lineHeight: 'unset',
|
|
listStyle: 'none',
|
|
outline: 'none',
|
|
// disable styles
|
|
[`&-disabled${componentCls} ${componentCls}-star`]: {
|
|
cursor: 'default',
|
|
'> div:hover': {
|
|
transform: 'scale(1)'
|
|
}
|
|
}
|
|
}), genRateStarStyle(token)), {
|
|
// text styles
|
|
[`+ ${componentCls}-text`]: {
|
|
display: 'inline-block',
|
|
marginInlineStart: token.marginXS,
|
|
fontSize: token.fontSize
|
|
}
|
|
}), genRateRtlStyle(token))
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var rate_style = ((0,genComponentStyleHook/* default */.Z)('Rate', token => {
|
|
const rateToken = (0,statistic/* merge */.TS)(token, {});
|
|
return [genRateStyle(rateToken)];
|
|
}, token => ({
|
|
starColor: token.yellow6,
|
|
starSize: token.controlHeightLG * 0.5,
|
|
starHoverScale: 'scale(1.1)',
|
|
starBg: token.colorFillContent
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/rate/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 rate_Rate = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
tooltips,
|
|
character = /*#__PURE__*/_react_17_0_2_react.createElement(icons_StarFilled, null)
|
|
} = props,
|
|
rest = __rest(props, ["prefixCls", "className", "rootClassName", "style", "tooltips", "character"]);
|
|
const characterRender = (node, _ref) => {
|
|
let {
|
|
index
|
|
} = _ref;
|
|
if (!tooltips) {
|
|
return node;
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(tooltip/* default */.Z, {
|
|
title: tooltips[index]
|
|
}, node);
|
|
};
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
rate
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const ratePrefixCls = getPrefixCls('rate', prefixCls);
|
|
// Style
|
|
const [wrapSSR, hashId] = rate_style(ratePrefixCls);
|
|
const mergedStyle = Object.assign(Object.assign({}, rate === null || rate === void 0 ? void 0 : rate.style), style);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(es, Object.assign({
|
|
ref: ref,
|
|
character: character,
|
|
characterRender: characterRender
|
|
}, rest, {
|
|
className: _classnames_2_5_1_classnames_default()(className, rootClassName, hashId, rate === null || rate === void 0 ? void 0 : rate.className),
|
|
style: mergedStyle,
|
|
prefixCls: ratePrefixCls,
|
|
direction: direction
|
|
})));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var rate = (rate_Rate);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 31797:
|
|
/*!*************************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/statistic/index.js + 5 modules ***!
|
|
\*************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ es_statistic; }
|
|
});
|
|
|
|
// 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/_util/hooks/useForceUpdate.js
|
|
var useForceUpdate = __webpack_require__(56762);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(92343);
|
|
// 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/_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/skeleton/index.js + 12 modules
|
|
var skeleton = __webpack_require__(84578);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Number.js
|
|
"use client";
|
|
|
|
|
|
const StatisticNumber = props => {
|
|
const {
|
|
value,
|
|
formatter,
|
|
precision,
|
|
decimalSeparator,
|
|
groupSeparator = '',
|
|
prefixCls
|
|
} = props;
|
|
let valueNode;
|
|
if (typeof formatter === 'function') {
|
|
// Customize formatter
|
|
valueNode = formatter(value);
|
|
} else {
|
|
// Internal formatter
|
|
const val = String(value);
|
|
const cells = val.match(/^(-?)(\d*)(\.(\d+))?$/);
|
|
// Process if illegal number
|
|
if (!cells || val === '-') {
|
|
valueNode = val;
|
|
} else {
|
|
const negative = cells[1];
|
|
let int = cells[2] || '0';
|
|
let decimal = cells[4] || '';
|
|
int = int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
if (typeof precision === 'number') {
|
|
decimal = decimal.padEnd(precision, '0').slice(0, precision > 0 ? precision : 0);
|
|
}
|
|
if (decimal) {
|
|
decimal = `${decimalSeparator}${decimal}`;
|
|
}
|
|
valueNode = [/*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
key: "int",
|
|
className: `${prefixCls}-content-value-int`
|
|
}, negative, int), decimal && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
key: "decimal",
|
|
className: `${prefixCls}-content-value-decimal`
|
|
}, decimal)];
|
|
}
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-content-value`
|
|
}, valueNode);
|
|
};
|
|
/* harmony default export */ var statistic_Number = (StatisticNumber);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(87832);
|
|
// 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/statistic/style/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
const genStatisticStyle = token => {
|
|
const {
|
|
componentCls,
|
|
marginXXS,
|
|
padding,
|
|
colorTextDescription,
|
|
titleFontSize,
|
|
colorTextHeading,
|
|
contentFontSize,
|
|
fontFamily
|
|
} = token;
|
|
return {
|
|
[`${componentCls}`]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
[`${componentCls}-title`]: {
|
|
marginBottom: marginXXS,
|
|
color: colorTextDescription,
|
|
fontSize: titleFontSize
|
|
},
|
|
[`${componentCls}-skeleton`]: {
|
|
paddingTop: padding
|
|
},
|
|
[`${componentCls}-content`]: {
|
|
color: colorTextHeading,
|
|
fontSize: contentFontSize,
|
|
fontFamily,
|
|
[`${componentCls}-content-value`]: {
|
|
display: 'inline-block',
|
|
direction: 'ltr'
|
|
},
|
|
[`${componentCls}-content-prefix, ${componentCls}-content-suffix`]: {
|
|
display: 'inline-block'
|
|
},
|
|
[`${componentCls}-content-prefix`]: {
|
|
marginInlineEnd: marginXXS
|
|
},
|
|
[`${componentCls}-content-suffix`]: {
|
|
marginInlineStart: marginXXS
|
|
}
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var statistic_style = ((0,genComponentStyleHook/* default */.Z)('Statistic', token => {
|
|
const statisticToken = (0,statistic/* merge */.TS)(token, {});
|
|
return [genStatisticStyle(statisticToken)];
|
|
}, token => {
|
|
const {
|
|
fontSizeHeading3,
|
|
fontSize
|
|
} = token;
|
|
return {
|
|
titleFontSize: fontSize,
|
|
contentFontSize: fontSizeHeading3
|
|
};
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Statistic.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Statistic = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
valueStyle,
|
|
value = 0,
|
|
title,
|
|
valueRender,
|
|
prefix,
|
|
suffix,
|
|
loading = false,
|
|
onMouseEnter,
|
|
onMouseLeave,
|
|
decimalSeparator = '.',
|
|
groupSeparator = ','
|
|
} = props;
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
statistic
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('statistic', customizePrefixCls);
|
|
const [wrapSSR, hashId] = statistic_style(prefixCls);
|
|
const valueNode = /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Number, Object.assign({
|
|
decimalSeparator: decimalSeparator,
|
|
groupSeparator: groupSeparator,
|
|
prefixCls: prefixCls
|
|
}, props, {
|
|
value: value
|
|
}));
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, statistic === null || statistic === void 0 ? void 0 : statistic.className, className, rootClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: cls,
|
|
style: Object.assign(Object.assign({}, statistic === null || statistic === void 0 ? void 0 : statistic.style), style),
|
|
onMouseEnter: onMouseEnter,
|
|
onMouseLeave: onMouseLeave
|
|
}, title && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-title`
|
|
}, title), /*#__PURE__*/_react_17_0_2_react.createElement(skeleton/* default */.Z, {
|
|
paragraph: false,
|
|
loading: loading,
|
|
className: `${prefixCls}-skeleton`
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
style: valueStyle,
|
|
className: `${prefixCls}-content`
|
|
}, prefix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-content-prefix`
|
|
}, prefix), valueRender ? valueRender(valueNode) : valueNode, suffix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-content-suffix`
|
|
}, suffix)))));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var statistic_Statistic = (Statistic);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/utils.js
|
|
// Countdown
|
|
const timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], ['M', 1000 * 60 * 60 * 24 * 30], ['D', 1000 * 60 * 60 * 24], ['H', 1000 * 60 * 60], ['m', 1000 * 60], ['s', 1000], ['S', 1] // million seconds
|
|
];
|
|
|
|
function formatTimeStr(duration, format) {
|
|
let leftDuration = duration;
|
|
const escapeRegex = /\[[^\]]*]/g;
|
|
const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
|
|
const templateText = format.replace(escapeRegex, '[]');
|
|
const replacedText = timeUnits.reduce((current, _ref) => {
|
|
let [name, unit] = _ref;
|
|
if (current.includes(name)) {
|
|
const value = Math.floor(leftDuration / unit);
|
|
leftDuration -= value * unit;
|
|
return current.replace(new RegExp(`${name}+`, 'g'), match => {
|
|
const len = match.length;
|
|
return value.toString().padStart(len, '0');
|
|
});
|
|
}
|
|
return current;
|
|
}, templateText);
|
|
let index = 0;
|
|
return replacedText.replace(escapeRegex, () => {
|
|
const match = keepList[index];
|
|
index += 1;
|
|
return match;
|
|
});
|
|
}
|
|
function formatCountdown(value, config) {
|
|
const {
|
|
format = ''
|
|
} = config;
|
|
const target = new Date(value).getTime();
|
|
const current = Date.now();
|
|
const diff = Math.max(target - current, 0);
|
|
return formatTimeStr(diff, format);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Countdown.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const REFRESH_INTERVAL = 1000 / 30;
|
|
function getTime(value) {
|
|
return new Date(value).getTime();
|
|
}
|
|
const Countdown = props => {
|
|
const {
|
|
value,
|
|
format = 'HH:mm:ss',
|
|
onChange,
|
|
onFinish
|
|
} = props;
|
|
const forceUpdate = (0,useForceUpdate/* default */.Z)();
|
|
const countdown = _react_17_0_2_react.useRef(null);
|
|
const stopTimer = () => {
|
|
onFinish === null || onFinish === void 0 ? void 0 : onFinish();
|
|
if (countdown.current) {
|
|
clearInterval(countdown.current);
|
|
countdown.current = null;
|
|
}
|
|
};
|
|
const syncTimer = () => {
|
|
const timestamp = getTime(value);
|
|
if (timestamp >= Date.now()) {
|
|
countdown.current = setInterval(() => {
|
|
forceUpdate();
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(timestamp - Date.now());
|
|
if (timestamp < Date.now()) {
|
|
stopTimer();
|
|
}
|
|
}, REFRESH_INTERVAL);
|
|
}
|
|
};
|
|
_react_17_0_2_react.useEffect(() => {
|
|
syncTimer();
|
|
return () => {
|
|
if (countdown.current) {
|
|
clearInterval(countdown.current);
|
|
countdown.current = null;
|
|
}
|
|
};
|
|
}, [value]);
|
|
const formatter = (formatValue, config) => formatCountdown(formatValue, Object.assign(Object.assign({}, config), {
|
|
format
|
|
}));
|
|
const valueRender = node => (0,reactNode/* cloneElement */.Tm)(node, {
|
|
title: undefined
|
|
});
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Statistic, Object.assign({}, props, {
|
|
valueRender: valueRender,
|
|
formatter: formatter
|
|
}));
|
|
};
|
|
/* harmony default export */ var statistic_Countdown = (/*#__PURE__*/_react_17_0_2_react.memo(Countdown));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
statistic_Statistic.Countdown = statistic_Countdown;
|
|
/* harmony default export */ var es_statistic = (statistic_Statistic);
|
|
|
|
/***/ })
|
|
|
|
}]); |