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.
691 lines
33 KiB
691 lines
33 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[9416],{
|
|
|
|
/***/ 62951:
|
|
/*!*****************************************************************!*\
|
|
!*** ./src/pages/Graduations/Lists/Tasks/index.tsx + 5 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__(23852);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
var skeleton = __webpack_require__(2518);
|
|
// 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__(73598);
|
|
// 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__(75798);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/TeacherModule/index.tsx + 1 modules
|
|
var TeacherModule = __webpack_require__(74092);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(19351);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var utils_fetch = __webpack_require__(64841);
|
|
// 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__(20473);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/LinkOutlined.js + 1 modules
|
|
var LinkOutlined = __webpack_require__(86743);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/DetailsModal/index.tsx
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SettingModal = ({
|
|
visible,
|
|
data,
|
|
onClose = () => {
|
|
},
|
|
sendUrl
|
|
}) => {
|
|
var _a, _b, _c;
|
|
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
const dealFileList = fileList.map((e) => {
|
|
var _a2;
|
|
if (e.response) {
|
|
return __spreadProps(__spreadValues({}, e), {
|
|
linkProps: { download: true },
|
|
url: (_a2 = e == null ? void 0 : e.response) == null ? void 0 : _a2.url
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
if (visible) {
|
|
setFileList(((_a2 = data == null ? void 0 : data.attachments) == null ? void 0 : _a2.map((e) => ({
|
|
name: e.title,
|
|
status: "done",
|
|
linkProps: { download: true },
|
|
response: {
|
|
id: e.id,
|
|
url: e.url
|
|
}
|
|
}))) || []);
|
|
}
|
|
}, [visible]);
|
|
const uploadProps = {
|
|
multiple: true,
|
|
withCredentials: true,
|
|
fileList: dealFileList,
|
|
beforeUpload: (file) => {
|
|
const fileSize = file.size / 1024 / 1024;
|
|
if (fileSize > 150) {
|
|
message/* default */.ZP.error(`\u300A${file.name}\u300B\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(150M)`);
|
|
return upload["default"].LIST_IGNORE;
|
|
}
|
|
return true;
|
|
},
|
|
itemRender: (originNode, file) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", justify: "space-between", className: `ant-upload-list-item ant-upload-list-item-done ${DetailsModalmodules.File}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { download: "download", onClick: (e) => {
|
|
var _a3;
|
|
console.log(file, "file");
|
|
e.preventDefault();
|
|
(0,util/* downLoadLink */.Nd)("", `${env/* default */.Z.API_SERVER}${(_a3 = file == null ? void 0 : file.url) == null ? void 0 : _a3.replace("disposition=inline", "")}`);
|
|
}, title: file == null ? void 0 : file.name, href: file.url }, /* @__PURE__ */ _react_17_0_2_react.createElement(LinkOutlined/* default */.Z, { className: "mr10 c-grey-666" }), (0,util/* cutFileName */.tP)(file == null ? void 0 : file.name, 35)), ((_a2 = file == null ? void 0 : file.response) == null ? void 0 : _a2.id) && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `iconfont icon-shanchu14 font14 ${DetailsModalmodules.deletfileIcon}`, onClick: () => __async(void 0, null, function* () {
|
|
const res = yield postData(dealFileList == null ? void 0 : dealFileList.filter((item) => item.response.id != file.response.id));
|
|
if (res.status == 0) {
|
|
message/* default */.ZP.success("\u5220\u9664\u6210\u529F");
|
|
setFileList(dealFileList == null ? void 0 : dealFileList.filter((item) => {
|
|
var _a3, _b2;
|
|
return ((_a3 = item == null ? void 0 : item.response) == null ? void 0 : _a3.id) != ((_b2 = file == null ? void 0 : file.response) == null ? void 0 : _b2.id);
|
|
}));
|
|
}
|
|
}) }));
|
|
},
|
|
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
|
onChange: (info) => {
|
|
const list = (0,util/* dealUploadChange */.uD)(info);
|
|
setFileList(list);
|
|
if (list.every((e) => e.status !== "uploading")) {
|
|
postData(list);
|
|
}
|
|
}
|
|
};
|
|
const postData = (list) => __async(void 0, null, function* () {
|
|
const res = yield (0,utils_fetch/* default */.ZP)(sendUrl, {
|
|
method: "post",
|
|
body: {
|
|
graduation_task_id: data.id,
|
|
attachment_ids: list.filter((e) => e.status === "done").map((e) => {
|
|
var _a2;
|
|
return (_a2 = e == null ? void 0 : e.response) == null ? void 0 : _a2.id;
|
|
})
|
|
}
|
|
});
|
|
if (res.status === 0) {
|
|
}
|
|
return res;
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_modal["default"],
|
|
{
|
|
centered: true,
|
|
destroyOnClose: true,
|
|
onCancel: onClose,
|
|
open: visible,
|
|
footer: null,
|
|
title: "\u4EFB\u52A1\u4E66\u8BE6\u60C5",
|
|
width: 620,
|
|
className: "pb20",
|
|
afterClose: () => {
|
|
setFileList([]);
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DetailsModalmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DetailsModalmodules.row }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u8BFE\u9898\u540D\u79F0"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { title: data.name }, data.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DetailsModalmodules.row }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6307\u5BFC\u8001\u5E08"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, !!((_a = data == null ? void 0 : data.teachers) == null ? void 0 : _a.length) ? (_c = (_b = data == null ? void 0 : data.teachers) == null ? void 0 : _b.map((e) => e.real_name)) == null ? void 0 : _c.join("\u3001") : "--")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DetailsModalmodules.row }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u8BFE\u9898\u6765\u6E90"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, data.source || "--")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DetailsModalmodules.row }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u9009\u9898\u5B66\u751F"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, data.real_name || "--")), data.status === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${DetailsModalmodules.img} iconfont icon-yixiada` }), /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], __spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "mt10" }, /* @__PURE__ */ _react_17_0_2_react.createElement(ui_customization/* CustomButton */.op, { style: { borderRadius: 2 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "icon-shangchuan3 mr5" }), "\u4E0A\u4F20\u6587\u6863"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
className: "ml10 font14",
|
|
style: { color: "#5F6367" },
|
|
onClick: (e) => {
|
|
e.stopPropagation();
|
|
}
|
|
},
|
|
"\u4E0A\u4F20\u4EFB\u52A1\u4E66\uFF0C\u5355\u4E2A\u6587\u6863\u5927\u5C0F\u4E0D\u8D85\u8FC7150M"
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: "20px" } }))
|
|
);
|
|
};
|
|
/* harmony default export */ var DetailsModal = (SettingModal);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/Teacher/index.tsx
|
|
var Teacher_defProp = Object.defineProperty;
|
|
var Teacher_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Teacher_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Teacher_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Teacher_defNormalProp = (obj, key, value) => key in obj ? Teacher_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Teacher_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Teacher_hasOwnProp.call(b, prop))
|
|
Teacher_defNormalProp(a, prop, b[prop]);
|
|
if (Teacher_getOwnPropSymbols)
|
|
for (var prop of Teacher_getOwnPropSymbols(b)) {
|
|
if (Teacher_propIsEnum.call(b, prop))
|
|
Teacher_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Teacher_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Page = ({
|
|
graduations,
|
|
dispatch
|
|
}) => {
|
|
var _a;
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [data, setData] = (0,_react_17_0_2_react.useState)({});
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
const [updateKey, setUpdateKey] = (0,_react_17_0_2_react.useState)(1);
|
|
const taskId = (0,_react_17_0_2_react.useRef)(null);
|
|
const fileListIds = (0,_react_17_0_2_react.useRef)([]);
|
|
const tabKey = (_a = location.pathname.split("/")) == null ? void 0 : _a[3];
|
|
const { menus } = graduations;
|
|
const tabParams = menus.find((e) => e.clazz === tabKey) || {};
|
|
const sendUrl = `/api/graduations/${urlParams.id}/graduation_stages/${tabParams == null ? void 0 : tabParams.id}/submit.json`;
|
|
const uploadProps = {
|
|
multiple: true,
|
|
withCredentials: true,
|
|
fileList,
|
|
showUploadList: false,
|
|
beforeUpload: (file) => {
|
|
const fileSize = file.size / 1024 / 1024;
|
|
if (fileSize > 150) {
|
|
message/* default */.ZP.error(`\u300A${file.name}\u300B\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(150M)`);
|
|
return upload["default"].LIST_IGNORE;
|
|
}
|
|
return true;
|
|
},
|
|
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
|
onChange: (info) => {
|
|
dispatch({ type: "globalSetting/setGlobalLoading", payload: { show: true, text: "\u6B63\u5728\u4E0A\u4F20\u4E2D\uFF0C\u8BF7\u7A0D\u5019" } });
|
|
const list = (0,util/* dealUploadChange */.uD)(info);
|
|
setFileList(list);
|
|
if (list.every((e) => e.status !== "uploading")) {
|
|
postData(list);
|
|
}
|
|
}
|
|
};
|
|
const postData = (list) => Teacher_async(void 0, null, function* () {
|
|
var _a2;
|
|
const res = yield (0,utils_fetch/* default */.ZP)(sendUrl, {
|
|
method: "post",
|
|
body: {
|
|
graduation_task_id: taskId.current,
|
|
attachment_ids: (_a2 = list.filter((e) => e.status === "done").map((e) => {
|
|
var _a3;
|
|
return (_a3 = e == null ? void 0 : e.response) == null ? void 0 : _a3.id;
|
|
})) == null ? void 0 : _a2.concat(fileListIds.current)
|
|
}
|
|
});
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success("\u63D0\u4EA4\u6210\u529F");
|
|
setUpdateKey(updateKey + 1);
|
|
}
|
|
setFileList([]);
|
|
taskId.current = null;
|
|
fileListIds.current = [];
|
|
dispatch({ type: "globalSetting/setGlobalLoading", payload: { show: false, text: "" } });
|
|
});
|
|
const tags = [
|
|
{ id: "", name: "\u5168\u90E8" },
|
|
{ id: 0, name: "\u672A\u4E0B\u8FBE" },
|
|
{ id: 1, name: "\u5DF2\u4E0B\u8FBE" }
|
|
];
|
|
const columns = [
|
|
{
|
|
title: "\u8BFE\u9898\u540D\u79F0",
|
|
dataIndex: "name",
|
|
ellipsis: true,
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, text || "--"))
|
|
},
|
|
{
|
|
title: "\u6307\u5BFC\u8001\u5E08",
|
|
dataIndex: "teachers",
|
|
width: 156,
|
|
ellipsis: true,
|
|
render: (value) => {
|
|
var _a2;
|
|
const str = !!(value == null ? void 0 : value.length) ? (_a2 = value == null ? void 0 : value.map((e) => e.real_name)) == null ? void 0 : _a2.join("\u3001") : "";
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: str }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, str || "--"));
|
|
}
|
|
},
|
|
{
|
|
title: "\u9009\u9898\u5B66\u751F",
|
|
width: 156,
|
|
ellipsis: true,
|
|
dataIndex: "real_name",
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-black" }, text || "--"))
|
|
},
|
|
{
|
|
title: "\u6587\u6863",
|
|
dataIndex: "attachments",
|
|
width: 156,
|
|
ellipsis: { showTitle: false },
|
|
render: (value, v) => {
|
|
var _a2, _b;
|
|
if (!(value == null ? void 0 : value.length))
|
|
return "--";
|
|
let str = "";
|
|
if (!!(value == null ? void 0 : value.length)) {
|
|
str = (0,util/* cutFileName */.tP)((_a2 = value == null ? void 0 : value[0]) == null ? void 0 : _a2.title, 6);
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: (_b = value == null ? void 0 : value[0]) == null ? void 0 : _b.title }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => {
|
|
var _a3, _b2;
|
|
(0,util/* downLoadLink */.Nd)("", `${env/* default */.Z.API_SERVER}${(_b2 = (_a3 = value[0]) == null ? void 0 : _a3.url) == null ? void 0 : _b2.replace("disposition=inline", "")}`);
|
|
}, className: "current", style: { color: "#3061D0" } }, str));
|
|
}
|
|
},
|
|
{
|
|
title: "\u72B6\u6001",
|
|
dataIndex: "status",
|
|
width: 90,
|
|
render: (value) => /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, value === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-black" }, "\u672A\u4E0B\u8FBE"), value === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-black" }, "\u5DF2\u4E0B\u8FBE"))
|
|
},
|
|
{
|
|
title: "\u64CD\u4F5C",
|
|
dataIndex: "action",
|
|
align: "right",
|
|
width: 100,
|
|
render: (value, v) => /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "end" }, /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], Teacher_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => {
|
|
var _a2;
|
|
taskId.current = v.id;
|
|
fileListIds.current = (_a2 = v == null ? void 0 : v.attachments) == null ? void 0 : _a2.map((e) => e.id);
|
|
}, className: "current font14 c-light-primary" }, "\u63D0\u4EA4")), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => {
|
|
setVisible(true);
|
|
setData(Teacher_spreadValues({}, v));
|
|
}, className: "current font14 c-light-primary ml20" }, "\u8BE6\u60C5"))
|
|
}
|
|
];
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
TeacherModule/* default */.Z,
|
|
{
|
|
tags,
|
|
tagsTitle: "\u4E0B\u8FBE\u72B6\u6001",
|
|
tagsTitleWidth: 56,
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BFE\u9898\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
columns,
|
|
updateKey,
|
|
inputWidth: 222
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
DetailsModal,
|
|
{
|
|
visible,
|
|
data,
|
|
sendUrl,
|
|
onClose: () => {
|
|
setVisible(false);
|
|
setData({});
|
|
setUpdateKey(updateKey + 1);
|
|
}
|
|
}
|
|
));
|
|
};
|
|
/* harmony default export */ var Teacher = ((0,_umi_production_exports.connect)(({
|
|
graduations
|
|
}) => ({
|
|
graduations
|
|
}))(Page));
|
|
|
|
;// 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__(46948);
|
|
// EXTERNAL MODULE: ./src/pages/Graduations/components/HeadTitle/index.tsx + 1 modules
|
|
var HeadTitle = __webpack_require__(69068);
|
|
// EXTERNAL MODULE: ./src/components/PreviewAll/index.tsx + 1 modules
|
|
var PreviewAll = __webpack_require__(95391);
|
|
// 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_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Student_Page = ({
|
|
graduations,
|
|
dispatch
|
|
}) => {
|
|
var _a;
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
const [data, setData] = (0,_react_17_0_2_react.useState)([{}]);
|
|
const [previewData, setPreviewData] = (0,_react_17_0_2_react.useState)([{}]);
|
|
const [list, setList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [activeKey, setActiveKey] = (0,_react_17_0_2_react.useState)([]);
|
|
const [isEmptyStatus, setIsEmptyStatus] = (0,_react_17_0_2_react.useState)(0);
|
|
const monacoValueRef = (0,_react_17_0_2_react.useRef)();
|
|
const { menus, details } = graduations;
|
|
const tabParams = menus.find((e) => e.clazz === "tasks") || {};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (tabParams == null ? void 0 : tabParams.id) {
|
|
getData();
|
|
}
|
|
}, [tabParams == null ? void 0 : tabParams.id]);
|
|
const getData = () => Student_async(void 0, null, function* () {
|
|
var _a2, _b, _c, _d, _e, _f;
|
|
setLoading(true);
|
|
const res = yield (0,utils_fetch/* default */.ZP)(`/api/graduations/${urlParams.id}/graduation_stages/${tabParams == null ? void 0 : tabParams.id}.json`, {
|
|
method: "get"
|
|
});
|
|
if (res.status === 0) {
|
|
setData(((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2[0]) || {});
|
|
setList(((_c = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b[0]) == null ? void 0 : _c.attachments) || []);
|
|
let state = 0;
|
|
if ((0,lodash.isEmpty)((_d = res == null ? void 0 : res.data) == null ? void 0 : _d[0])) {
|
|
state = 1;
|
|
} else if (((_f = (_e = res == null ? void 0 : res.data) == null ? void 0 : _e[0]) == null ? void 0 : _f.status) === 0) {
|
|
state = 2;
|
|
}
|
|
setIsEmptyStatus(state);
|
|
}
|
|
setLoading(false);
|
|
});
|
|
const handleCheckBox = (value, id, type) => {
|
|
let keys = [];
|
|
if (type === "all" && value) {
|
|
keys = list.map((e) => e.id);
|
|
} else if (type !== "all") {
|
|
if (value) {
|
|
keys = [...activeKey, id];
|
|
} else {
|
|
keys = activeKey.filter((e) => e !== id);
|
|
}
|
|
}
|
|
setActiveKey(keys);
|
|
};
|
|
const batchDown = () => {
|
|
if (!activeKey.length) {
|
|
message/* default */.ZP.warning("\u8BF7\u9009\u62E9\u6587\u4EF6");
|
|
return;
|
|
}
|
|
const dealItem = list.filter((e) => activeKey.includes(e.id));
|
|
handleAllDownload((details == null ? void 0 : details.name) + "-\u4EFB\u52A1\u4E66", dealItem);
|
|
};
|
|
const handlePreviewClick = (item) => Student_async(void 0, null, function* () {
|
|
if (item.file_type === "txt") {
|
|
const res = yield (0,utils_fetch/* default */.ZP)(item.url, {
|
|
method: "get",
|
|
headers: {
|
|
"Content-Type": "application/xml"
|
|
}
|
|
});
|
|
monacoValueRef.current = res;
|
|
}
|
|
setPreviewData({
|
|
type: item.file_type,
|
|
content: env/* default */.Z.API_SERVER + item.url
|
|
});
|
|
});
|
|
const handleAllDownload = (_0, ..._1) => Student_async(void 0, [_0, ..._1], function* (name, urlList = []) {
|
|
const DownloadList = urlList == null ? void 0 : urlList.filter((item) => item.url != "");
|
|
if (DownloadList.length == 0) {
|
|
message/* default */.ZP.warning("\u6682\u65E0\u4E0B\u8F7D\u6587\u4EF6");
|
|
return;
|
|
}
|
|
const modal = es_modal["default"].info({
|
|
width: 500,
|
|
icon: null,
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6B63\u5728\u6279\u91CF\u5BFC\u51FA\u4EFB\u52A1\u6587\u4EF6,", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3")),
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5F53\u524D\u8FDB\u5EA6: ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, 0), "/", DownloadList.length),
|
|
maskClosable: false,
|
|
className: Studentmodules.modal,
|
|
onOk: () => {
|
|
}
|
|
});
|
|
const zip = new (jszip_min_default())();
|
|
const nameLsit = [];
|
|
const addzip = (data2, progress) => Student_async(void 0, null, function* () {
|
|
try {
|
|
const response = yield fetch(env/* default */.Z.API_SERVER + data2.url, { method: "get" });
|
|
const blob = yield response.blob();
|
|
const getZipFile = (name2, index = 0) => Student_async(void 0, null, function* () {
|
|
const filename = name2.split(".");
|
|
filename.pop();
|
|
const nextName = `${filename.join("")}(${index}).${name2.split(".").at(-1)}`;
|
|
if (index == 0 && nameLsit.includes(name2) || nameLsit.includes(nextName)) {
|
|
getZipFile(name2, index + 1);
|
|
} else {
|
|
nameLsit.push(index == 0 ? name2 : nextName);
|
|
zip.file(index == 0 ? name2 : nextName, blob);
|
|
}
|
|
});
|
|
yield getZipFile(data2 == null ? void 0 : data2.title);
|
|
modal.update({
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5F53\u524D\u8FDB\u5EA6: ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, progress), "/", DownloadList.length)
|
|
});
|
|
} catch (error) {
|
|
message/* default */.ZP.error(`${data2 == null ? void 0 : data2.title}\u4E0B\u8F7D\u5931\u8D25\uFF0C\u539F\u56E0\uFF1A${error}`);
|
|
}
|
|
});
|
|
if (DownloadList.length > 0) {
|
|
let i = 0;
|
|
for (let item of DownloadList) {
|
|
yield addzip(item, ++i);
|
|
}
|
|
zip.generateAsync({ type: "blob" }).then((blob) => {
|
|
(0,util/* downLoadFile */.FH)(name, window.URL.createObjectURL(blob));
|
|
});
|
|
}
|
|
modal.destroy();
|
|
});
|
|
console.log(previewData, "previewData");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Studentmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
HeadTitle/* default */.Z,
|
|
{
|
|
title: "\u4EFB\u52A1\u4E66",
|
|
status: tabParams == null ? void 0 : tabParams.status,
|
|
startAt: tabParams == null ? void 0 : tabParams.start_at,
|
|
endAt: tabParams == null ? void 0 : tabParams.end_at
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(skeleton/* default */.Z, { active: true, loading }, !!isEmptyStatus && /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { customText: isEmptyStatus === 1 ? "\u5F53\u524D\u9636\u6BB5\u6682\u65F6\u65E0\u6CD5\u5F00\u542F\uFF0C\u8BF7\u5148\u5B8C\u6210\u4E4B\u524D\u9636\u6BB5\u7684\u4EFB\u52A1" : "\u5F53\u524D\u8001\u5E08\u8FD8\u672A\u4E0B\u8FBE\u4EFB\u52A1\u4E66\u54E6" }), !isEmptyStatus && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Studentmodules.card }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5f6368" }, className: "mr20 font14" }, "\u8BFE\u9898\u540D\u79F0"), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: data == null ? void 0 : data.name }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333", fontSize: 16 } }, (0,util/* cutName */.Pq)(data == null ? void 0 : data.name, 59)))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Studentmodules.title }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flexShrink: 0, marginTop: 4, color: "#5f6368" }, className: "mr20" }, "\u6307\u5BFC\u8001\u5E08"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Studentmodules.teacherWrap }, (_a = data == null ? void 0 : data.teachers) == null ? void 0 : _a.map((e, i) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: i, className: Studentmodules.titleCol }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"img",
|
|
{
|
|
width: 28,
|
|
height: 28,
|
|
style: { borderRadius: "50%" },
|
|
src: `${(_a2 = env/* default */.Z) == null ? void 0 : _a2.IMG_SERVER}/images/${e == null ? void 0 : e.avatar_url}`
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333 ml10 font16" }, e.real_name));
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Studentmodules.head }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"],
|
|
{
|
|
onChange: (e) => handleCheckBox(e.target.checked, null, "all"),
|
|
checked: !!activeKey.length && activeKey.length === list.length,
|
|
indeterminate: !!activeKey.length && activeKey.length !== list.length
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10" }, "\u4EFB\u52A1\u4E66"), !!(activeKey == null ? void 0 : activeKey.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: batchDown, style: { marginLeft: "auto" }, className: "c-light-primary current" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xiazai4 mr5 font14" }), "\u6279\u91CF\u4E0B\u8F7D")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Studentmodules.rowWrap }, list == null ? void 0 : list.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: item.id, className: Studentmodules.row }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"],
|
|
{
|
|
onChange: (e) => handleCheckBox(e.target.checked, item.id),
|
|
checked: activeKey.includes(item.id)
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Studentmodules.name, title: item.title }, (0,util/* cutFileName */.tP)(item.title, 60)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Studentmodules.btns }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { className: "mr20", title: "\u9884\u89C8" }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => handlePreviewClick(item), className: "iconfont icon-chakanshenqingjilu c-light-primary current font14" })), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u4E0B\u8F7D" }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => {
|
|
var _a2;
|
|
(0,util/* downLoadLink */.Nd)("", `${env/* default */.Z.API_SERVER}${(_a2 = item.url) == null ? void 0 : _a2.replace("disposition=inline", "")}`);
|
|
}, className: "iconfont icon-xiazai4 c-light-primary current font14" })))))))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
PreviewAll/* default */.Z,
|
|
{
|
|
close: true,
|
|
data: previewData == null ? void 0 : previewData.content,
|
|
type: previewData == null ? void 0 : previewData.type,
|
|
hasMask: true,
|
|
monacoEditor: {
|
|
value: monacoValueRef.current,
|
|
language: "txt",
|
|
onChange: () => {
|
|
},
|
|
options: {
|
|
readOnly: true,
|
|
fontSize: 14,
|
|
minimap: {
|
|
enabled: false
|
|
}
|
|
}
|
|
},
|
|
onClose: () => {
|
|
setPreviewData({ content: "", type: "" });
|
|
}
|
|
}
|
|
));
|
|
};
|
|
/* harmony default export */ var Student = ((0,_umi_production_exports.connect)(({
|
|
graduations
|
|
}) => ({
|
|
graduations
|
|
}))(Student_Page));
|
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(77883);
|
|
;// CONCATENATED MODULE: ./src/pages/Graduations/Lists/Tasks/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Tasks_Page = ({
|
|
graduations,
|
|
dispatch,
|
|
loading
|
|
}) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(skeleton/* default */.Z, { style: { margin: "20px 0 0 45px" }, loading: loading.effects["graduations/getGraduationsDetails"] }, (0,authority/* isGPAdminOrTeacher */.tu)() ? /* @__PURE__ */ _react_17_0_2_react.createElement(Teacher, null) : /* @__PURE__ */ _react_17_0_2_react.createElement(Student, null));
|
|
};
|
|
/* harmony default export */ var Tasks = ((0,_umi_production_exports.connect)(({
|
|
loading,
|
|
graduations
|
|
}) => ({
|
|
loading,
|
|
graduations
|
|
}))(Tasks_Page));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |