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.
1150 lines
48 KiB
1150 lines
48 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[9416],{
|
|
|
|
/***/ 22219:
|
|
/*!*****************************************************************!*\
|
|
!*** ./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 + 8 modules
|
|
var _umi_production_exports = __webpack_require__(66660);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
var skeleton = __webpack_require__(59981);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(11006);
|
|
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__(6557);
|
|
// 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__(27291);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/TeacherModule/index.tsx + 1 modules
|
|
var TeacherModule = __webpack_require__(82340);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(47015);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var utils_fetch = __webpack_require__(97174);
|
|
// 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__(6487);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(26508);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@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.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(91851);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@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
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_LinkOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(LinkOutlined_LinkOutlined));
|
|
// 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.2@@babel/runtime/helpers/createForOfIteratorHelper.js
|
|
var createForOfIteratorHelper = __webpack_require__(98190);
|
|
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
;// 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__(72020);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/HeadTitle/index.tsx + 1 modules
|
|
var HeadTitle = __webpack_require__(42109);
|
|
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
|
var PreviewAll = __webpack_require__(48058);
|
|
// 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__(76107);
|
|
;// 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));
|
|
|
|
/***/ })
|
|
|
|
}]); |