|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[6758],{
|
|
|
|
|
|
/***/ 98915:
|
|
|
/*!***********************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules ***!
|
|
|
\***********************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_ArrowDownOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
// 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.3.1@@ant-design/icons-svg/es/asn/ArrowDownOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var ArrowDownOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z" } }] }, "name": "arrow-down", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_ArrowDownOutlined = (ArrowDownOutlined);
|
|
|
|
|
|
// 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/ArrowDownOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ArrowDownOutlined_ArrowDownOutlined = function ArrowDownOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_ArrowDownOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_ArrowDownOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(ArrowDownOutlined_ArrowDownOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 48058:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
|
|
|
\*********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ PreviewAll; }
|
|
|
});
|
|
|
|
|
|
// 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/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
|
|
|
var ArrowDownOutlined = __webpack_require__(98915);
|
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
|
|
|
var monaco_editor = __webpack_require__(14654);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(27291);
|
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
|
var exercise = __webpack_require__(6303);
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(72020);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(47015);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var PreviewAll = (function (_ref) {
|
|
|
var _data, _data2, _data3, _data4, _data5, _data6;
|
|
|
var _ref$editOffice = _ref.editOffice,
|
|
|
editOffice = _ref$editOffice === void 0 ? 'view' : _ref$editOffice,
|
|
|
data = _ref.data,
|
|
|
theme = _ref.theme,
|
|
|
type = _ref.type,
|
|
|
filename = _ref.filename,
|
|
|
monacoEditor = _ref.monacoEditor,
|
|
|
className = _ref.className,
|
|
|
style = _ref.style,
|
|
|
close = _ref.close,
|
|
|
onClose = _ref.onClose,
|
|
|
hasMask = _ref.hasMask,
|
|
|
disabledDownload = _ref.disabledDownload,
|
|
|
onImgDimensions = _ref.onImgDimensions,
|
|
|
showNodata = _ref.showNodata;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
src = _useState2[0],
|
|
|
setSrc = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(""),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
token = _useState4[0],
|
|
|
setToken = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
officeData = _useState6[0],
|
|
|
setOfficeData = _useState6[1];
|
|
|
var officePath = window.ENV === "build" ? "/react/build" : "";
|
|
|
var apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
|
|
|
// let size;
|
|
|
var unit = 1024 * 1024;
|
|
|
var maxSize = 10 * unit;
|
|
|
var closeRef = (0,_react_17_0_2_react.useRef)();
|
|
|
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
|
|
|
data = env/* default */.Z.API_SERVER + data;
|
|
|
}
|
|
|
// if (type === "office") {
|
|
|
// size = parseUrl(data).filesize
|
|
|
// if (size > maxSize) {
|
|
|
// type = "other"
|
|
|
// }
|
|
|
// }
|
|
|
if (filename) monacoEditor.filename = filename;
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _document$cookie;
|
|
|
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 || (_document$cookie = _document$cookie.replace(/\s/g, "")) === null || _document$cookie === void 0 ? void 0 : _document$cookie.split(";");
|
|
|
cookies === null || cookies === void 0 || cookies.map(function (item) {
|
|
|
var i = item.split("=");
|
|
|
if (i[0] === '_educoder_session') {
|
|
|
setToken(i[1]);
|
|
|
}
|
|
|
});
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (type === "office") getData();
|
|
|
}, [type, data]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _url, _id, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
console.log("data:", data);
|
|
|
_url = data;
|
|
|
if (!data.startsWith("http")) {
|
|
|
_url = location.origin + _url;
|
|
|
}
|
|
|
_id = new URL(_url).pathname.split("/").pop();
|
|
|
_context.next = 6;
|
|
|
return (0,exercise/* setEcsAttachment */.gJ)({
|
|
|
attachment_id: _id
|
|
|
});
|
|
|
case 6:
|
|
|
res = _context.sent;
|
|
|
setOfficeData(res);
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleClick = function handleClick() {
|
|
|
if (data.startsWith("http") || data.startsWith('blob:')) {
|
|
|
handleDown();
|
|
|
return;
|
|
|
}
|
|
|
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
|
|
|
};
|
|
|
var handleDown = function handleDown() {
|
|
|
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: objectSpread2_default()({}, style || {}),
|
|
|
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
|
|
|
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: PreviewAllmodules.close,
|
|
|
ref: closeRef,
|
|
|
children: [!!onImgDimensions && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return closeRef.current;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
onClose();
|
|
|
onImgDimensions();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "icon-yulanpizhu"
|
|
|
})
|
|
|
})
|
|
|
}), !disabledDownload && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return closeRef.current;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: handleDown,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "icon-quxiaozhiding"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5173\u95ED",
|
|
|
getPopupContainer: function getPopupContainer() {
|
|
|
return closeRef.current;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "",
|
|
|
onClick: onClose,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "icon-guanbi1"
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
|
|
|
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
|
|
|
})
|
|
|
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
|
|
|
src: "".concat(((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.indexOf("http://")) > -1 || ((_data3 = data) === null || _data3 === void 0 ? void 0 : _data3.indexOf("https://")) > -1 ? "" : "data:audio/mp3;base64,").concat(data),
|
|
|
autoPlay: true
|
|
|
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.indexOf("http")) > -1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
controls: true,
|
|
|
src: "".concat(data),
|
|
|
autoPlay: true
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
|
controls: true,
|
|
|
src: "data:video/mp4;base64,".concat(data),
|
|
|
autoPlay: true
|
|
|
})
|
|
|
}), type === 'office' && officeData && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
src: "".concat(officePath, "/office.html?key=").concat(officeData.key, "&url=").concat(apiServer + officeData.url, "&callbackUrl=").concat(apiServer + officeData.callbackUrl, "&fileType=").concat(officeData.fileType, "&title=").concat(officeData.title, "&model=").concat(editOffice, "&officeServer=").concat(env/* default */.Z.ONLYOFFICE, "&disabledDownload=").concat(!!disabledDownload)
|
|
|
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
src: data + '&disposition=inline'
|
|
|
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
src: "".concat(officePath, "/js/pdfview/index.html?url=").concat(data, "&disabledDownload=").concat(!!disabledDownload)
|
|
|
}) //<embed className={styles.embed + "#toolbar=0"} src={data} />
|
|
|
, type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: "".concat(((_data5 = data) === null || _data5 === void 0 ? void 0 : _data5.indexOf("http://")) > -1 || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.indexOf("https://")) > -1 ? "" : "data:image/png;base64,").concat(data)
|
|
|
}), (type === "other" || type === "download") && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: showNodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",
|
|
|
ButtonTwo: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xiazai4 font14"
|
|
|
}),
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: handleClick,
|
|
|
children: "\u4E0B\u8F7D"
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: handleClick,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 50133:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./src/components/ReleaseTime/index.tsx ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ tF: function() { return /* binding */ DATEFORMAT; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony export formatReleaseDate */
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 52409);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! moment */ 9498);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function disabledDate(current) {
|
|
|
var currentTime = new Date().getTime();
|
|
|
return current && current < currentTime;
|
|
|
}
|
|
|
var DATEFORMAT = 'YYYY-MM-DD HH:mm';
|
|
|
function formatReleaseDate(dateString) {
|
|
|
var _dateString$split = dateString.split(':'),
|
|
|
_dateString$split2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_1___default()(_dateString$split, 2),
|
|
|
dt = _dateString$split2[0],
|
|
|
minute = _dateString$split2[1];
|
|
|
if (minute === '00' || minute === '30') {
|
|
|
return moment__WEBPACK_IMPORTED_MODULE_3___default()(dateString);
|
|
|
}
|
|
|
var m = parseInt(minute, 10);
|
|
|
if (m < 30) {
|
|
|
return moment__WEBPACK_IMPORTED_MODULE_3___default()("".concat(dt, ":30"));
|
|
|
}
|
|
|
if (m > 30) {
|
|
|
return moment__WEBPACK_IMPORTED_MODULE_3___default()("".concat(dt, ":00")).add(1, 'hours');
|
|
|
}
|
|
|
return moment__WEBPACK_IMPORTED_MODULE_3___default()(dateString);
|
|
|
}
|
|
|
//发布时间组件,取最近的整点和半点
|
|
|
/* harmony default export */ __webpack_exports__.ZP = (function (_ref) {
|
|
|
var value = _ref.value,
|
|
|
onChange = _ref.onChange,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$disabled = _ref.disabled,
|
|
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
|
showTimeConfig = _ref.showTimeConfig;
|
|
|
function onChangeTime(_, dateString) {
|
|
|
onChange(_ ? formatReleaseDate(dateString) : _);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd__WEBPACK_IMPORTED_MODULE_5__["default"], {
|
|
|
showTime: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
|
format: 'HH:mm',
|
|
|
minuteStep: 30
|
|
|
}, showTimeConfig),
|
|
|
showToday: false,
|
|
|
value: value,
|
|
|
format: DATEFORMAT,
|
|
|
placeholder: "\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",
|
|
|
style: style,
|
|
|
onChange: onChangeTime,
|
|
|
disabled: disabled,
|
|
|
disabledDate: disabledDate
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 50710:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Attachment/components/Download.tsx ***!
|
|
|
\***********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js */ 10574);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js */ 93923);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js */ 39343);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js */ 26801);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js */ 11006);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 78241);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 43418);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 59981);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! antd */ 95237);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd */ 43604);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! antd */ 6848);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! antd */ 12563);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! moment */ 9498);
|
|
|
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_6__);
|
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! umi */ 66660);
|
|
|
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/env */ 47015);
|
|
|
/* harmony import */ var _components_PreviewAll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/PreviewAll */ 48058);
|
|
|
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/util */ 27291);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var defaultFormValue = {
|
|
|
delay_publish: 0,
|
|
|
is_public: [false],
|
|
|
description: "",
|
|
|
title: "",
|
|
|
link: "",
|
|
|
publish_time: ""
|
|
|
};
|
|
|
var SetPublic = function SetPublic(_ref) {
|
|
|
var attachment = _ref.attachment,
|
|
|
dispatch = _ref.dispatch,
|
|
|
loading = _ref.loading,
|
|
|
globalSetting = _ref.globalSetting;
|
|
|
var params = (0,umi__WEBPACK_IMPORTED_MODULE_7__.useParams)();
|
|
|
var detail = attachment.detail;
|
|
|
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z.useForm(),
|
|
|
_Form$useForm2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
|
|
|
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
|
|
|
visible = _useState2[0],
|
|
|
setVisible = _useState2[1];
|
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)([]),
|
|
|
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState3, 2),
|
|
|
histories = _useState4[0],
|
|
|
setHistories = _useState4[1];
|
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, defaultFormValue)),
|
|
|
_useState6 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState5, 2),
|
|
|
formValue = _useState6[0],
|
|
|
setFormValue = _useState6[1];
|
|
|
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)({
|
|
|
name: "",
|
|
|
filename: "",
|
|
|
type: "",
|
|
|
className: "",
|
|
|
data: "",
|
|
|
close: true,
|
|
|
style: {
|
|
|
position: "fixed",
|
|
|
zIndex: 9999,
|
|
|
background: "rgba(0,0,0,.7)"
|
|
|
},
|
|
|
monacoEditor: {
|
|
|
value: "",
|
|
|
language: "",
|
|
|
theme: 'vs',
|
|
|
// onChange: onCodeChange,
|
|
|
// onSave: onSave,
|
|
|
// forbidCopy: forbidCopy,
|
|
|
options: {
|
|
|
readOnly: true
|
|
|
}
|
|
|
}
|
|
|
}),
|
|
|
_useState8 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState7, 2),
|
|
|
preview = _useState8[0],
|
|
|
setPreview = _useState8[1];
|
|
|
var disabledDate = function disabledDate(current) {
|
|
|
return current && current < moment__WEBPACK_IMPORTED_MODULE_6___default()().startOf('day');
|
|
|
};
|
|
|
params['id'] = params['coursesId'];
|
|
|
params['course_id'] = params['coursesId'];
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee() {
|
|
|
var _attachment$actionTab, _res$attachment_histo;
|
|
|
var obj, res;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
obj = {};
|
|
|
if ((attachment === null || attachment === void 0 || (_attachment$actionTab = attachment.actionTabs) === null || _attachment$actionTab === void 0 || (_attachment$actionTab = _attachment$actionTab.params) === null || _attachment$actionTab === void 0 ? void 0 : _attachment$actionTab.openType) == '课程内教学课件预览') {
|
|
|
obj = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, attachment.actionTabs.params);
|
|
|
} else {
|
|
|
obj = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, params);
|
|
|
}
|
|
|
_context.next = 4;
|
|
|
return dispatch({
|
|
|
type: 'attachment/getDetail',
|
|
|
payload: obj
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context.sent;
|
|
|
res.delay_publish = res.delay_publish ? 1 : 0;
|
|
|
formValue["is_public"] = [res.is_public];
|
|
|
formValue["description"] = res.description;
|
|
|
formValue["delay_publish"] = res.delay_publish;
|
|
|
formValue["publish_time"] = res.publish_time;
|
|
|
form.setFieldsValue(formValue);
|
|
|
setHistories([_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, res)].concat(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(res === null || res === void 0 ? void 0 : res.attachment_histories)));
|
|
|
if (!(res !== null && res !== void 0 && (_res$attachment_histo = res.attachment_histories) !== null && _res$attachment_histo !== void 0 && _res$attachment_histo.length)) {
|
|
|
if (res.link || res.content_type === 'application/pdf') {
|
|
|
(0,_utils_util__WEBPACK_IMPORTED_MODULE_10__/* .openNewWindow */ .xg)(_utils_env__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.IMG_SERVER + res.url);
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
} else {
|
|
|
preview.type = res.file_type;
|
|
|
preview.data = _utils_env__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.API_SERVER + res.url;
|
|
|
if (res.file_type === "txt") {
|
|
|
preview.monacoEditor.value = res.content;
|
|
|
}
|
|
|
setPreview(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, preview));
|
|
|
}
|
|
|
} else {
|
|
|
setVisible(true);
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {
|
|
|
if (attachment.actionTabs.key === "资源下载") {
|
|
|
var _attachment$actionTab2;
|
|
|
params.id = (_attachment$actionTab2 = attachment.actionTabs.selectArrs) === null || _attachment$actionTab2 === void 0 ? void 0 : _attachment$actionTab2["id"];
|
|
|
form.resetFields();
|
|
|
getData();
|
|
|
} else {
|
|
|
setVisible(false);
|
|
|
}
|
|
|
}, [attachment.actionTabs.key, params.id]);
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_5__.useEffect)(function () {
|
|
|
return function () {
|
|
|
setPreview(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, preview), {}, {
|
|
|
type: ''
|
|
|
}));
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
};
|
|
|
}, []);
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, {
|
|
|
centered: true,
|
|
|
title: "\u8D44\u6E90\u4E0B\u8F7D",
|
|
|
open: visible,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
destroyOnClose: true,
|
|
|
maskClosable: false,
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
width: 600,
|
|
|
onOk: /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee2() {
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
setFormValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, defaultFormValue));
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("section", {
|
|
|
className: "pl20 pr20 pt10",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z, {
|
|
|
loading: loading['attachment/getDetail'],
|
|
|
active: true,
|
|
|
avatar: {
|
|
|
size: 40
|
|
|
},
|
|
|
paragraph: {
|
|
|
rows: 5
|
|
|
},
|
|
|
className: "mt30",
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
align: "middle",
|
|
|
justify: "center",
|
|
|
style: {
|
|
|
background: "#eee"
|
|
|
},
|
|
|
gutter: [20, 8],
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
flex: "307px",
|
|
|
children: "\u8D44\u6E90\u540D\u79F0"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
flex: "80px",
|
|
|
children: "\u4E0B\u8F7D"
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
flex: "140px",
|
|
|
children: "\u7248\u672C\u53F7"
|
|
|
})]
|
|
|
}), histories === null || histories === void 0 ? void 0 : histories.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
align: "middle",
|
|
|
justify: "center",
|
|
|
style: {
|
|
|
borderBottom: "1px solid #eaeaea"
|
|
|
},
|
|
|
gutter: [20, 8],
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
flex: "307px",
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {
|
|
|
title: val.title,
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("a", {
|
|
|
href: _utils_env__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.API_SERVER + val.url,
|
|
|
target: "_blank",
|
|
|
className: "multi_ellipsis1 c-grey-333 mr5",
|
|
|
onClick: function onClick(e) {
|
|
|
if (val.link || val.content_type === 'application/pdf' || globalSetting.setting.is_local) return;
|
|
|
e.preventDefault();
|
|
|
preview.type = val.file_type;
|
|
|
preview.data = _utils_env__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.API_SERVER + val.url;
|
|
|
if (val.file_type === "txt") {
|
|
|
preview.monacoEditor.value = val.content;
|
|
|
}
|
|
|
setPreview(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, preview));
|
|
|
},
|
|
|
children: val.title
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__/* ["default"] */ .Z, {
|
|
|
className: "",
|
|
|
color: key === 0 ? "green" : "orange",
|
|
|
children: key === 0 ? "当前版本" : "历史版本"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
flex: "80px",
|
|
|
children: val.downloads_count
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
|
|
|
flex: "140px",
|
|
|
children: moment__WEBPACK_IMPORTED_MODULE_6___default()(val.created_on).format("YYYY-MM-DD HH:mm")
|
|
|
})]
|
|
|
}, key);
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_components_PreviewAll__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, preview), {}, {
|
|
|
onClose: function onClose() {
|
|
|
setPreview(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_2_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3___default()({}, preview), {}, {
|
|
|
type: ''
|
|
|
}));
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
}
|
|
|
}))]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_7__.connect)(function (_ref4) {
|
|
|
var attachment = _ref4.attachment,
|
|
|
loading = _ref4.loading,
|
|
|
globalSetting = _ref4.globalSetting;
|
|
|
return {
|
|
|
attachment: attachment,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(SetPublic));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 91360:
|
|
|
/*!**********************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Attachment/index.tsx + 17 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 */ Attachment; }
|
|
|
});
|
|
|
|
|
|
// 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);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/typeof.js
|
|
|
var helpers_typeof = __webpack_require__(5773);
|
|
|
var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
|
|
|
// 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/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/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/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(97174);
|
|
|
// 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/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
|
var skeleton = __webpack_require__(59981);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(72315);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(41867);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/affix/index.js + 2 modules
|
|
|
var affix = __webpack_require__(81228);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(27291);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(76107);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/DelCompontent.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DelShixun = function DelShixun(_ref) {
|
|
|
var classroomList = _ref.classroomList,
|
|
|
user = _ref.user,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
visible = _useState2[0],
|
|
|
setVisible = _useState2[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (classroomList.actionTabs.key === '删除') {
|
|
|
var _user$userInfo;
|
|
|
if ((0,authority/* isSuperAdmin */.j5)() || user !== null && user !== void 0 && (_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && (_user$userInfo = _user$userInfo.course) !== null && _user$userInfo !== void 0 && _user$userInfo.own) {
|
|
|
setVisible(true);
|
|
|
return;
|
|
|
}
|
|
|
var selectNum = {
|
|
|
hasNum: 0,
|
|
|
noHasNum: 0
|
|
|
};
|
|
|
classroomList.actionTabs.selectArrsAll.map(function (item) {
|
|
|
var _user$userInfo2;
|
|
|
if (item.author_login === ((_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login)) {
|
|
|
++selectNum.hasNum;
|
|
|
} else {
|
|
|
++selectNum.noHasNum;
|
|
|
}
|
|
|
});
|
|
|
if (selectNum.noHasNum > 0) {
|
|
|
modal/* default */.Z.info({
|
|
|
title: "权限提示",
|
|
|
className: "custom-modal-divider ",
|
|
|
icon: null,
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [classroomList.actionTabs.isdelete !== '1' && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u5F53\u524D\u9009\u4E2D\u8D44\u6E90\u4E2D\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue",
|
|
|
children: selectNum.hasNum
|
|
|
}), "\u4E2A\u7531\u60A8\u672C\u4EBA\u53D1\u5E03\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: selectNum.noHasNum
|
|
|
}), " \u4E2A\u7531\u5176\u4ED6\u8001\u5E08\u53D1\u5E03\u3002", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
|
|
|
}), "\u8BFE\u5802\u5185\u53EA\u80FD\u5220\u9664\u672C\u4EBA\u53D1\u5E03\u7684\u8D44\u6E90\uFF0C\u8BF7\u53D6\u6D88\u9009\u4E2D\u5176\u4ED6\u8001\u5E08\u53D1\u5E03\u7684\u8D44\u6E90\u3002"]
|
|
|
}),
|
|
|
onOk: function onOk() {
|
|
|
cancel();
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
setVisible(true);
|
|
|
}
|
|
|
} else {
|
|
|
setVisible(false);
|
|
|
}
|
|
|
}, [classroomList.actionTabs.key]);
|
|
|
var cancel = function cancel() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
};
|
|
|
console.log('---', classroomList.actionTabs);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: visible,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: /*#__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 (0,fetch/* default */.ZP)("/api/files/bulk_delete.json", {
|
|
|
method: 'delete',
|
|
|
body: {
|
|
|
ids: toConsumableArray_default()(classroomList.actionTabs.selectArrs),
|
|
|
course_id: params.id
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('删除成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, classroomList.actionTabs.params)
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: {
|
|
|
id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
cancel();
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var DelCompontent = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var classroomList = _ref3.classroomList,
|
|
|
user = _ref3.user;
|
|
|
return {
|
|
|
classroomList: classroomList,
|
|
|
user: user
|
|
|
};
|
|
|
})(DelShixun));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/Publish.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SetPublic = function SetPublic(_ref) {
|
|
|
var classroomList = _ref.classroomList,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
params['id'] = params['coursesId'];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: classroomList.actionTabs.key === '立即发布1111' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: /*#__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 (0,fetch/* default */.ZP)("/api/files/bulk_publish.json", {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
course_id: params.id,
|
|
|
ids: toConsumableArray_default()(classroomList.actionTabs.selectArrs)
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, classroomList.actionTabs.params)
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u5B66\u751F\u5C06\u80FD\u7ACB\u5373\u6536\u5230\u8D44\u6E90"
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Publish = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var classroomList = _ref3.classroomList;
|
|
|
return {
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(SetPublic));
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/defineProperty.js
|
|
|
var defineProperty = __webpack_require__(22060);
|
|
|
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
|
var col = __webpack_require__(43604);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
|
|
|
var date_picker = __webpack_require__(52409);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(5112);
|
|
|
// 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/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/TrfList/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var TrfListmodules = ({"leftdiv":"leftdiv___KFnZz","listClass":"listClass___FfLSv","spantitle":"spantitle___UgKSB","rightdiv":"rightdiv___Citnr"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/TrfList/delete.png
|
|
|
var delete_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC";
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(72020);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/TrfList/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//滚动加载
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TrfList = function TrfList(_ref) {
|
|
|
var data = _ref.data,
|
|
|
_ref$value = _ref.value,
|
|
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
|
handleChangePage = _ref.handleChangePage,
|
|
|
setSelectedRowKeys = _ref.setSelectedRowKeys,
|
|
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
|
_ref$onChange = _ref.onChange,
|
|
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
leftList = _useState2[0],
|
|
|
setleftList = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
rightList = _useState4[0],
|
|
|
setRightList = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
checkoutList = _useState6[0],
|
|
|
setCheckoutList = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
page = _useState8[0],
|
|
|
setpage = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
sechar = _useState10[0],
|
|
|
setsechar = _useState10[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setleftList(data);
|
|
|
setRightList([]);
|
|
|
setCheckoutList([]);
|
|
|
}, [data]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (setSelectedRowKeys) {
|
|
|
setRightList(selectedRowKeys);
|
|
|
setCheckoutList(selectedRowKeys);
|
|
|
}
|
|
|
}, [selectedRowKeys]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TrfListmodules.leftdiv,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
size: 'middle',
|
|
|
onChange: /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
// const res = await Fetch(`/api/common_exercises/exercise_users/student_groups.json`, { method: "get", params: {page: 1, per_page: 200,student_group:e} });
|
|
|
// if (res.status === 0) {
|
|
|
// setleftList(res?.data)
|
|
|
// setsechar(e);
|
|
|
// }
|
|
|
// if(!e){
|
|
|
// setsechar('');
|
|
|
// }
|
|
|
// setpage(1);
|
|
|
setleftList(data.filter(function (item) {
|
|
|
var _item$name;
|
|
|
return item === null || item === void 0 || (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.includes(e.target.value);
|
|
|
}));
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
|
|
|
}), leftList.length === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
styles: {
|
|
|
margin: '70px auto'
|
|
|
},
|
|
|
customText: '暂无分班'
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
height: '85%',
|
|
|
overflow: 'auto',
|
|
|
overflowX: 'hidden'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
value: rightList.map(function (item) {
|
|
|
return "".concat(item.course_group_id);
|
|
|
}),
|
|
|
onChange: function onChange(e) {
|
|
|
setSelectedRowKeys(leftList.filter(function (item) {
|
|
|
return e.includes("".concat(item.course_group_id));
|
|
|
}));
|
|
|
},
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
flexDirection: "column"
|
|
|
},
|
|
|
children: leftList.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
lineHeight: '24px',
|
|
|
display: 'flex',
|
|
|
width: 200
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
height: '24px',
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
disabled: item.is_published,
|
|
|
value: "".concat(item.course_group_id),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TrfListmodules.listClass,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: TrfListmodules.spantitle,
|
|
|
style: {
|
|
|
width: item.is_published ? '108px' : '170px'
|
|
|
},
|
|
|
children: item.name
|
|
|
}), item.is_published && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
width: '52px',
|
|
|
height: '24px',
|
|
|
background: '#B8B8B8',
|
|
|
borderRadius: '13px',
|
|
|
color: 'white',
|
|
|
lineHeight: '24px',
|
|
|
textAlign: 'center',
|
|
|
display: 'inline-block'
|
|
|
},
|
|
|
children: "\u5DF2\u53D1\u5E03"
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
}, item.course_group_id);
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TrfListmodules.rightdiv,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
onChange: function onChange(e) {
|
|
|
setCheckoutList(rightList.filter(function (item) {
|
|
|
return item.name.includes(e.target.value);
|
|
|
}));
|
|
|
},
|
|
|
size: 'middle',
|
|
|
placeholder: "\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"
|
|
|
}), checkoutList.length === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
styles: {
|
|
|
margin: '70px auto'
|
|
|
},
|
|
|
customText: '暂未选择分班'
|
|
|
}), checkoutList.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginTop: '10px',
|
|
|
height: '85%',
|
|
|
overflow: 'hidden',
|
|
|
position: 'relative'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
overflowX: 'hidden',
|
|
|
overflowY: 'scroll',
|
|
|
position: 'absolute',
|
|
|
left: 0,
|
|
|
top: 0,
|
|
|
right: -17,
|
|
|
bottom: 0
|
|
|
},
|
|
|
children: checkoutList.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
justify: "space-between",
|
|
|
style: {
|
|
|
marginTop: '10px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
overflow: 'hidden',
|
|
|
whiteSpace: 'nowrap',
|
|
|
textOverflow: 'ellipsis',
|
|
|
marginRight: '5px',
|
|
|
marginLeft: '5px',
|
|
|
width: '75%'
|
|
|
},
|
|
|
children: item.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: delete_namespaceObject,
|
|
|
style: {
|
|
|
cursor: 'pointer',
|
|
|
height: '16px',
|
|
|
marginRight: 17
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
setSelectedRowKeys(rightList.filter(function (items) {
|
|
|
return "".concat(items.course_group_id) != "".concat(item.course_group_id);
|
|
|
}));
|
|
|
}
|
|
|
})]
|
|
|
}, item.course_group_id);
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_TrfList = (TrfList);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/ShixunHomeworks/Detail/components/ConfigWorks/Releasesetting.tsx
|
|
|
var Releasesetting = __webpack_require__(4647);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/PublishResoure.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PublishShixun = function PublishShixun(_ref) {
|
|
|
var classroomList = _ref.classroomList,
|
|
|
dispatch = _ref.dispatch,
|
|
|
courseEndTime = _ref.courseEndTime,
|
|
|
getFileData = _ref.getFileData;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
page = _useState2[0],
|
|
|
setPage = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
list = _useState4[0],
|
|
|
setList = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
count = _useState6[0],
|
|
|
setCount = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(20),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
limit = _useState8[0],
|
|
|
setLimit = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
loading = _useState10[0],
|
|
|
setLoading = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
targetKeys = _useState12[0],
|
|
|
settargetKeys = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
radiovalue = _useState14[0],
|
|
|
setradiovalue = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
time = _useState16[0],
|
|
|
settime = _useState16[1];
|
|
|
params['id'] = params.coursesId;
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (classroomList.actionTabs.key === '立即发布') {
|
|
|
clear();
|
|
|
getData();
|
|
|
// if (classroomList.actionTabs.type === 2) {
|
|
|
var selectItem = classroomList.actionTabs.selectArrsAll[0];
|
|
|
console.log(selectItem.publish_time);
|
|
|
|
|
|
// setradiovalue(selectItem.unified_setting)
|
|
|
if (selectItem.publish_time) {
|
|
|
form.setFieldsValue(defineProperty_default()({}, 'publish_time', dayjs_min_default()(selectItem.publish_time)));
|
|
|
} else {
|
|
|
form.setFieldsValue(defineProperty_default()({}, 'publish_time', dayjs_min_default()(dayjs_min_default()(new Date()).add(0, 'days').format('YYYY-MM-DD HH:mm'))));
|
|
|
}
|
|
|
setradiovalue((!selectItem.is_publish || selectItem.unified_setting) && classroomList.actionTabs.manage_all_group);
|
|
|
settime(selectItem.publish_time);
|
|
|
// }
|
|
|
}
|
|
|
}, [classroomList.actionTabs]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(nextPage) {
|
|
|
var _res$course_group;
|
|
|
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/files/get_batches_publish_info.json", {
|
|
|
// ...params,
|
|
|
// page: nextPage ? nextPage : page,
|
|
|
// limit: 20000,
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
course_id: params.id,
|
|
|
attachment_id: classroomList.actionTabs.selectArrs[0]
|
|
|
}
|
|
|
// homework_id:
|
|
|
// classroomList.actionTabs.type === 1
|
|
|
// ? ''
|
|
|
// : classroomList.actionTabs.selectArrs[0],
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
res === null || res === void 0 || (_res$course_group = res.course_group) === null || _res$course_group === void 0 || _res$course_group.map(function (item, index) {
|
|
|
item.key = item.course_group_id;
|
|
|
item.title = item.name;
|
|
|
item.disabled = item.is_published;
|
|
|
// item.disabled=item.id===2381;
|
|
|
});
|
|
|
|
|
|
if (res) {
|
|
|
setList(toConsumableArray_default()(res === null || res === void 0 ? void 0 : res.course_groups));
|
|
|
setCount(res === null || res === void 0 ? void 0 : res.course_groups_count);
|
|
|
setLoading(false);
|
|
|
// if (!nextPage) {
|
|
|
// form.setFieldsValue({
|
|
|
// // ['group_ids']: res?.course_groups?.map((e: any) => String(e.id)),
|
|
|
// ['publish_time']: moment(
|
|
|
// moment(new Date())
|
|
|
// .add(0, 'days')
|
|
|
// .format('YYYY-MM-DD HH:mm'),
|
|
|
// ),
|
|
|
// ['end_time']: moment(
|
|
|
// moment(new Date(DayHalfPastOne('/')))
|
|
|
// .add(7, 'days')
|
|
|
// .format('YYYY-MM-DD HH:mm'),
|
|
|
// ),
|
|
|
// });
|
|
|
// }
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
|
|
|
// const onLoadMore = (nextPage: number) => {
|
|
|
// setPage(nextPage);
|
|
|
// getData(nextPage);
|
|
|
// };
|
|
|
|
|
|
var handleOk = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var _classroomList$detail;
|
|
|
var formValue, bodys, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
// if (isAssistant() && !classroomList.AssistantObject?.practice?.can_publish) {
|
|
|
// message.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
// setisLoading(false)
|
|
|
// return
|
|
|
// }
|
|
|
formValue = objectSpread2_default()({}, form.getFieldsValue());
|
|
|
if (!(formValue.end_time <= formValue.publish_time)) {
|
|
|
_context2.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('截止时间不能大于或等于发布时间');
|
|
|
setisLoading(false);
|
|
|
return _context2.abrupt("return");
|
|
|
case 5:
|
|
|
if (!((targetKeys === null || targetKeys === void 0 ? void 0 : targetKeys.length) <= 0 && !radiovalue && list.length > 0)) {
|
|
|
_context2.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('发布班级不能为空');
|
|
|
setisLoading(false);
|
|
|
return _context2.abrupt("return");
|
|
|
case 9:
|
|
|
bodys = {
|
|
|
attachment_id: toConsumableArray_default()(classroomList.actionTabs.selectArrs),
|
|
|
course_id: params.id,
|
|
|
course_group_ids: targetKeys.length > 0 ? targetKeys.map(function (item) {
|
|
|
return item.course_group_id;
|
|
|
}) : (_classroomList$detail = classroomList.detailShixunsList) === null || _classroomList$detail === void 0 ? void 0 : _classroomList$detail.course_groups,
|
|
|
// end_time: moment(formValue.end_time).format('YYYY-MM-DD HH:mm'),
|
|
|
publish_time: dayjs_min_default()(formValue.publish_time).format('YYYY-MM-DD HH:mm'),
|
|
|
// unified_setting: !targetKeys.length,
|
|
|
publish_type: !targetKeys.length ? 0 : 1
|
|
|
};
|
|
|
setisLoading(true);
|
|
|
_context2.next = 13;
|
|
|
return (0,fetch/* default */.ZP)("/api/files/batches_publish.json", {
|
|
|
method: 'post',
|
|
|
body: objectSpread2_default()({}, bodys)
|
|
|
});
|
|
|
case 13:
|
|
|
res = _context2.sent;
|
|
|
if (res.status === 0) {
|
|
|
setisLoading(false);
|
|
|
clear();
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '课程实验', '立即发布']);
|
|
|
message/* default */.ZP.success('发布成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '清除选择数据'
|
|
|
}
|
|
|
});
|
|
|
// dispatch({
|
|
|
// type: 'classroomList/getClassroomShixunsList',
|
|
|
// payload: { ...classroomList.actionTabs.params },
|
|
|
// })
|
|
|
|
|
|
// if (isAdmin()) {
|
|
|
// if (classroomList.actionTabs.detail) {
|
|
|
// dispatch({
|
|
|
// type: 'shixunHomeworks/setActionTabs',
|
|
|
// payload: {},
|
|
|
// });
|
|
|
// dispatch({
|
|
|
// type: 'shixunHomeworks/getWorkList',
|
|
|
// payload: { ...params },
|
|
|
// });
|
|
|
// dispatch({
|
|
|
// type: 'shixunHomeworks/getWorkSetting',
|
|
|
// payload: { ...params },
|
|
|
// });
|
|
|
// } else {
|
|
|
// dispatch({
|
|
|
// type: 'classroomList/getClassroomTeacherShixunsList',
|
|
|
// payload: { ...classroomList.actionTabs.params, type: 4 },
|
|
|
// });
|
|
|
// }
|
|
|
// } else {
|
|
|
// dispatch({
|
|
|
// type: 'classroomList/getClassroomShixunsList',
|
|
|
// payload: { ...classroomList.actionTabs.params },
|
|
|
// });
|
|
|
// }
|
|
|
if ((0,authority/* isAdmin */.GJ)()) {
|
|
|
getFileData();
|
|
|
}
|
|
|
if (localStorage.getItem('Noviceguide') === '0') {} else {
|
|
|
dispatch({
|
|
|
type: 'shixunHomeworks/setActionTabs',
|
|
|
payload: {
|
|
|
key: '底部弹窗',
|
|
|
type: 13,
|
|
|
text: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~"
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
setisLoading(false);
|
|
|
}
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleOk() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var clear = function clear() {
|
|
|
setPage(1);
|
|
|
setList([]);
|
|
|
settargetKeys([]);
|
|
|
};
|
|
|
var hasMore = count > page * limit;
|
|
|
var detailShixunsList = classroomList.detailShixunsList;
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
isLoading = _useState18[0],
|
|
|
setisLoading = _useState18[1];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
width: 600,
|
|
|
centered: true,
|
|
|
confirmLoading: isLoading,
|
|
|
title: "\u53D1\u5E03\u6559\u5B66\u8D44\u6599",
|
|
|
open: classroomList.actionTabs.key === '立即发布',
|
|
|
okText: "\u786E\u5B9A\u53D1\u5E03",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: function onOk() {
|
|
|
return handleOk();
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
clear();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
paddingLeft: 0
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
className: "mt30",
|
|
|
align: "middle",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "publish_time",
|
|
|
label: "\u53D1\u5E03\u65F6\u95F4",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
|
style: {
|
|
|
width: 170,
|
|
|
marginRight: '25px'
|
|
|
},
|
|
|
disabledDate: function disabledDate(current) {
|
|
|
return (0,Releasesetting/* disabledDate */.Q8)(current, courseEndTime);
|
|
|
},
|
|
|
disabledTime: function disabledTime(current) {
|
|
|
return (0,Releasesetting/* disabledTime */.d0)(current);
|
|
|
}
|
|
|
// disabled={moment()> moment(time)&&radiovalue}
|
|
|
,
|
|
|
placeholder: '请选择发布时间',
|
|
|
showTime: {
|
|
|
format: 'HH:mm'
|
|
|
// defaultValue: moment(time),
|
|
|
},
|
|
|
|
|
|
format: "YYYY-MM-DD HH:mm",
|
|
|
allowClear: false
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), classroomList.actionTabs.type === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
style: {
|
|
|
marginBottom: '10px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr5",
|
|
|
children: "\u53D1\u5E03\u89C4\u5219:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
value: radiovalue,
|
|
|
onChange: function onChange(e) {
|
|
|
setradiovalue(e.target.value);
|
|
|
// getData();
|
|
|
settargetKeys([]);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: true,
|
|
|
disabled: !classroomList.actionTabs.manage_all_group || !classroomList.actionTabs.selectArrsAll[0].unified_setting && classroomList.actionTabs.selectArrsAll[0].is_publish,
|
|
|
children: "\u7EDF\u4E00\u53D1\u5E03"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
className: "ml20",
|
|
|
disabled: list.length <= 0 || classroomList.actionTabs.selectArrsAll[0].unified_setting,
|
|
|
value: false,
|
|
|
children: "\u5206\u73ED\u53D1\u5E03"
|
|
|
})]
|
|
|
})]
|
|
|
}), list.length <= 0 && classroomList.actionTabs.type === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginLeft: '65px',
|
|
|
color: 'rgba(0, 0, 0, 0.25)'
|
|
|
},
|
|
|
children: "\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\""
|
|
|
})]
|
|
|
}), (classroomList.actionTabs.type === 1 || !radiovalue) && list.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between',
|
|
|
marginBottom: '10px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: 1
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
checked: targetKeys.length === list.length,
|
|
|
onChange: function onChange(e) {
|
|
|
if (targetKeys.length === list.length) {
|
|
|
settargetKeys([]);
|
|
|
} else {
|
|
|
settargetKeys(list);
|
|
|
}
|
|
|
},
|
|
|
children: "\u5168\u9009"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
width: 16
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
flex: 1
|
|
|
},
|
|
|
children: ["\u5DF2\u9009\u62E9", targetKeys.length || 0, "\u4E2A\u5206\u73ED"]
|
|
|
})]
|
|
|
}), (classroomList.actionTabs.type === 1 || !radiovalue) && list.length > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(components_TrfList, {
|
|
|
data: list,
|
|
|
selectedRowKeys: targetKeys,
|
|
|
setSelectedRowKeys: settargetKeys
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: "\u6CE8\u610F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "1\u3001\u9009\u62E9\u7EDF\u4E00\u53D1\u5E03\u5E76\u786E\u8BA4\u53D1\u5E03\u65F6\uFF0C\u53EF\u5C06\u6559\u5B66\u8D44\u6599\u53D1\u9001\u81F3\u8BFE\u5802\u7684\u5168\u90E8\u73ED\u7EA7(\u5305\u62EC\u672A\u5206\u73ED)"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "2\u3001\u9009\u62E9\u5206\u73ED\u53D1\u5E03\u5E76\u786E\u8BA4\u53D1\u5E03\u65F6\uFF0C\u53EF\u5C06\u4F5C\u4E1A\u53D1\u5E03\u81F3\u6307\u5B9A\u73ED\u7EA7\u3002"
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var PublishResoure = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var classroomList = _ref4.classroomList;
|
|
|
return {
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(PublishShixun));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/SetPublic.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SetPublic_SetPublic = function SetPublic(_ref) {
|
|
|
var classroomList = _ref.classroomList,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
params['id'] = params['coursesId'];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: classroomList.actionTabs.key === '设为公开' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
onOk: /*#__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 (0,fetch/* default */.ZP)("/api/files/bulk_public.json", {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
course_id: params.id,
|
|
|
ids: toConsumableArray_default()(classroomList.actionTabs.selectArrs)
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomShixunsList',
|
|
|
payload: objectSpread2_default()({}, classroomList.actionTabs.params)
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u8BBE\u4E3A\u516C\u5F00\u540E\uFF0C\u975E\u8BFE\u5802\u6210\u5458\u4E5F\u53EF\u4EE5\u8BBF\u95EE\u67E5\u770B", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u8BBE\u4E3A\u516C\u5F00\uFF1F"]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_SetPublic = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var classroomList = _ref3.classroomList;
|
|
|
return {
|
|
|
classroomList: classroomList
|
|
|
};
|
|
|
})(SetPublic_SetPublic));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/AddCategory.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AddCategory_PublishShixun = function PublishShixun(_ref) {
|
|
|
var _actionTabs$selectArr, _actionTabs$selectArr2;
|
|
|
var classroomList = _ref.classroomList,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var actionTabs = classroomList.actionTabs;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: 'classroomList/getCourseGroups',
|
|
|
payload: {
|
|
|
id: params.id,
|
|
|
nonenavigate: true
|
|
|
}
|
|
|
});
|
|
|
}, [classroomList.name]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u65B0\u5EFA\u5B50\u76EE\u5F55",
|
|
|
open: classroomList.actionTabs.key === '新建目录' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
bodyStyle: {
|
|
|
minHeight: 200
|
|
|
},
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _classroomList$detail;
|
|
|
var formValue, attachmentId, fetchUrl, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
formValue = form.getFieldValue();
|
|
|
attachmentId = (_classroomList$detail = classroomList.detailLeftMenus) === null || _classroomList$detail === void 0 || (_classroomList$detail = _classroomList$detail.course_modules) === null || _classroomList$detail === void 0 || (_classroomList$detail = _classroomList$detail.find(function (item) {
|
|
|
return item.type === "attachment";
|
|
|
})) === null || _classroomList$detail === void 0 ? void 0 : _classroomList$detail.id;
|
|
|
fetchUrl = "/api/course_modules/".concat(attachmentId, "/add_second_category.json");
|
|
|
_context.next = 5;
|
|
|
return (0,fetch/* default */.ZP)(fetchUrl, {
|
|
|
method: 'post',
|
|
|
body: objectSpread2_default()(objectSpread2_default()({}, formValue), {}, {
|
|
|
parent_id: params.categoryId
|
|
|
})
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
form.resetFields();
|
|
|
message/* default */.ZP.success('添加成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: {
|
|
|
id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "tc",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})
|
|
|
}), classroomList.courseGroups.course_groups && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: defineProperty_default()({}, 'name', ""),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "name",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "mt30",
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: "\u5B50\u76EE\u5F55\u540D\u79F0\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
defaultValue: ((_actionTabs$selectArr = actionTabs.selectArrs) === null || _actionTabs$selectArr === void 0 ? void 0 : _actionTabs$selectArr.category_name) || ((_actionTabs$selectArr2 = actionTabs.selectArrs) === null || _actionTabs$selectArr2 === void 0 ? void 0 : _actionTabs$selectArr2.name)
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var AddCategory = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var classroomList = _ref4.classroomList,
|
|
|
loading = _ref4.loading;
|
|
|
return {
|
|
|
classroomList: classroomList,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(AddCategory_PublishShixun));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/CategoryRename.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CategoryRename_PublishShixun = function PublishShixun(_ref) {
|
|
|
var _actionTabs$selectArr;
|
|
|
var classroomList = _ref.classroomList,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var actionTabs = classroomList.actionTabs;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u91CD\u547D\u540D",
|
|
|
open: classroomList.actionTabs.key === '重命名' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
bodyStyle: {
|
|
|
minHeight: 200
|
|
|
},
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var formValue, fetchUrl, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
formValue = form.getFieldValue();
|
|
|
fetchUrl = "/api/homework_commons/".concat(classroomList.actionTabs.selectArrs.homework_id, "/alter_name.json");
|
|
|
_context.next = 4;
|
|
|
return (0,fetch/* default */.ZP)(fetchUrl, {
|
|
|
method: 'post',
|
|
|
body: objectSpread2_default()({}, formValue)
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('修改成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomShixunsList',
|
|
|
payload: objectSpread2_default()({}, classroomList.actionTabs.params)
|
|
|
});
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "tc",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})
|
|
|
}), classroomList.courseGroups.course_groups && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: defineProperty_default()({}, 'name', "1"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "name",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "mt30",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: "\u4F5C\u4E1A\u540D\u79F0\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
defaultValue: (_actionTabs$selectArr = actionTabs.selectArrs) === null || _actionTabs$selectArr === void 0 ? void 0 : _actionTabs$selectArr.name
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var CategoryRename = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var classroomList = _ref4.classroomList,
|
|
|
loading = _ref4.loading;
|
|
|
return {
|
|
|
classroomList: classroomList,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(CategoryRename_PublishShixun));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
|
var tabs = __webpack_require__(99313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller = __webpack_require__(26724);
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller_default = /*#__PURE__*/__webpack_require__.n(_react_infinite_scroller_1_2_4_react_infinite_scroller);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/SelectAttchment.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var SelectAttchmentmodules = ({"flex_box_center":"flex_box_center___FUkdm","flex_space_between":"flex_space_between___b5tWy","flex_box_vertical_center":"flex_box_vertical_center___tvrPT","flex_box_center_end":"flex_box_center_end___pZ3xg","flex_box_column":"flex_box_column___F0xEu","wrp":"wrp___C97Wf","itemTitleWrp":"itemTitleWrp___JQdEU","itemTitle":"itemTitle___cQoNO","search":"search___PvZbz","simple-table":"simple-table___H8BYb","table":"table___r82iu"});
|
|
|
// EXTERNAL MODULE: ./src/components/ReleaseTime/index.tsx
|
|
|
var ReleaseTime = __webpack_require__(50133);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/SelectAttchment.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabPane = tabs/* default */.Z.TabPane;
|
|
|
var loadingData = false;
|
|
|
var CuttOffNowShixun = function CuttOffNowShixun(_ref) {
|
|
|
var _ref4;
|
|
|
var attachment = _ref.attachment,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isDelay = _useState2[0],
|
|
|
setIsDelay = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
hasMore = _useState4[0],
|
|
|
setHasMore = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)("public"),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
tabKey = _useState6[0],
|
|
|
setTabKey = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
tabData = _useState8[0],
|
|
|
setTabData = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)({
|
|
|
page: 0,
|
|
|
page_size: 20,
|
|
|
search: ""
|
|
|
}),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
query = _useState10[0],
|
|
|
setQuery = _useState10[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (attachment.actionTabs.key === "选用资源" && hasMore) {
|
|
|
getData();
|
|
|
}
|
|
|
if (attachment.actionTabs.key !== "选用资源" && hasMore) {
|
|
|
setTabData([]);
|
|
|
}
|
|
|
}, [attachment.actionTabs.key, hasMore, tabKey]);
|
|
|
var groupIdsInitialValues = [];
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _res$object_list, res, _res$data;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!loadingData) {
|
|
|
_context.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return");
|
|
|
case 2:
|
|
|
loadingData = true;
|
|
|
if (!hasMore) {
|
|
|
_context.next = 19;
|
|
|
break;
|
|
|
}
|
|
|
++query.page;
|
|
|
if (!(tabKey === 'public')) {
|
|
|
_context.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 8;
|
|
|
return dispatch({
|
|
|
type: 'attachment/allAttachment',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
case 8:
|
|
|
res = _context.sent;
|
|
|
tabData = toConsumableArray_default()(tabData.concat(res.data.files));
|
|
|
_context.next = 16;
|
|
|
break;
|
|
|
case 12:
|
|
|
_context.next = 14;
|
|
|
return dispatch({
|
|
|
type: 'attachment/mineAttachment',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
case 14:
|
|
|
res = _context.sent;
|
|
|
tabData = toConsumableArray_default()(tabData.concat((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.files));
|
|
|
case 16:
|
|
|
if (((_res$object_list = res.object_list) === null || _res$object_list === void 0 ? void 0 : _res$object_list.length) < query.page_size) {
|
|
|
setHasMore(false);
|
|
|
} else {
|
|
|
setHasMore(true);
|
|
|
}
|
|
|
loadingData = false;
|
|
|
setTabData(toConsumableArray_default()(tabData));
|
|
|
case 19:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
function onChangeDelayPublish(e) {
|
|
|
setIsDelay(e.target.value);
|
|
|
}
|
|
|
var disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
var columns = [{
|
|
|
title: '资源名称',
|
|
|
dataIndex: 'title',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
onChange: function onChange(e) {},
|
|
|
value: String(record.id),
|
|
|
defaultChecked: true,
|
|
|
className: SelectAttchmentmodules.itemTitleWrp,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: text,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ["c-black", SelectAttchmentmodules.itemTitle].join(" "),
|
|
|
children: text
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '大小',
|
|
|
dataIndex: 'filesize'
|
|
|
}, {
|
|
|
title: '发布人',
|
|
|
dataIndex: 'author',
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: text.name
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
function onSubmit(_x) {
|
|
|
return _onSubmit.apply(this, arguments);
|
|
|
}
|
|
|
function _onSubmit() {
|
|
|
_onSubmit = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
|
|
|
var group_ids, delay_publish, publish_time, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
group_ids = values.group_ids, delay_publish = values.delay_publish, publish_time = values.publish_time;
|
|
|
_context3.next = 3;
|
|
|
return dispatch({
|
|
|
type: 'attachment/fileImport',
|
|
|
payload: {
|
|
|
course_id: params.coursesId,
|
|
|
course_second_category_id: parseInt(params.categoryId),
|
|
|
delay_publish: delay_publish,
|
|
|
//0立即发布 1延迟发布
|
|
|
publish_time: publish_time,
|
|
|
//发布时间
|
|
|
attachment_ids: toConsumableArray_default()(group_ids)
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context3.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.success('发布成功');
|
|
|
groupIdsInitialValues = [];
|
|
|
form.resetFields();
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: {
|
|
|
id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, attachment.actionTabs.params)
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: {
|
|
|
id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return _onSubmit.apply(this, arguments);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u9009\u7528\u8D44\u6E90",
|
|
|
open: attachment.actionTabs.key === '选用资源' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
destroyOnClose: true,
|
|
|
width: 600,
|
|
|
maskClosable: false,
|
|
|
bodyStyle: {
|
|
|
minHeight: 200
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
form.submit();
|
|
|
},
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
setQuery({
|
|
|
page: 0,
|
|
|
page_size: 20,
|
|
|
search: ""
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
className: SelectAttchmentmodules.search,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
allowClear: true,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u53D1\u5E03\u4EBA\u6216\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
|
onSearch: function onSearch(value) {
|
|
|
query.page = 0;
|
|
|
query.search = value;
|
|
|
tabData = [];
|
|
|
getData();
|
|
|
setHasMore(true);
|
|
|
},
|
|
|
style: {
|
|
|
width: 260
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
|
|
|
defaultActiveKey: tabKey,
|
|
|
onChange: /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(key) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
setTabData([]);
|
|
|
setTabKey(key);
|
|
|
query.page = 0;
|
|
|
setHasMore(true);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
|
|
|
tab: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: " \u5168\u90E8 "
|
|
|
})
|
|
|
}, "public"), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
|
|
|
tab: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: " \u6211\u7684\u8D44\u6E90 "
|
|
|
})
|
|
|
}, "myself")]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: (_ref4 = {}, defineProperty_default()(_ref4, 'group_ids', groupIdsInitialValues), defineProperty_default()(_ref4, "delay_publish", 0), _ref4),
|
|
|
onChange: function onChange(value) {
|
|
|
var formValue = form.getFieldValue();
|
|
|
groupIdsInitialValues = formValue;
|
|
|
},
|
|
|
onFinish: onSubmit,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "group_ids",
|
|
|
valuePropName: "checked",
|
|
|
rules: [{
|
|
|
validator: function validator(_, value) {
|
|
|
return value.length > 0 ? Promise.resolve() : Promise.reject('请选择一个资源');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
style: {
|
|
|
width: "100%"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
maxHeight: 248,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)((_react_infinite_scroller_1_2_4_react_infinite_scroller_default()), {
|
|
|
initialLoad: false,
|
|
|
pageStart: 0,
|
|
|
threshold: 800,
|
|
|
loadMore: function loadMore() {
|
|
|
getData();
|
|
|
},
|
|
|
hasMore: hasMore,
|
|
|
useWindow: false,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(SimpleTable, {
|
|
|
data: tabData
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var SelectAttchment = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
var attachment = _ref5.attachment,
|
|
|
loading = _ref5.loading;
|
|
|
return {
|
|
|
attachment: attachment,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(CuttOffNowShixun));
|
|
|
function SimpleTable(_ref6) {
|
|
|
var data = _ref6.data;
|
|
|
var columns = [{
|
|
|
title: '资源名称',
|
|
|
dataIndex: 'title',
|
|
|
width: 200,
|
|
|
ellipsis: true,
|
|
|
key: 'title',
|
|
|
render: function render(text, item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
value: String(item.id),
|
|
|
defaultChecked: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ["c-black"].join(" "),
|
|
|
style: {
|
|
|
whiteSpace: "nowrap",
|
|
|
overflow: "hidden",
|
|
|
display: "inline-block",
|
|
|
textOverflow: "ellipsis",
|
|
|
position: "relative",
|
|
|
top: 6,
|
|
|
maxWidth: 150
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: item.title,
|
|
|
placement: "topLeft",
|
|
|
children: item.title
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '大小',
|
|
|
dataIndex: 'filesize',
|
|
|
key: 'filesize',
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '发布人',
|
|
|
dataIndex: 'author',
|
|
|
key: 'author',
|
|
|
ellipsis: true,
|
|
|
render: function render(text) {
|
|
|
return text.name;
|
|
|
}
|
|
|
}, {
|
|
|
title: '时间',
|
|
|
dataIndex: 'created_on',
|
|
|
key: 'created_on',
|
|
|
width: 140,
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "font12",
|
|
|
children: dayjs_min_default()(text).format(ReleaseTime/* DATEFORMAT */.tF)
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
loading: loadingData,
|
|
|
pagination: false,
|
|
|
columns: columns,
|
|
|
className: SelectAttchmentmodules.table,
|
|
|
dataSource: data || []
|
|
|
});
|
|
|
}
|
|
|
// 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/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(47015);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/Upload.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var defaultFormValue = {
|
|
|
delay_publish: 0,
|
|
|
is_public: 0,
|
|
|
description: ""
|
|
|
// publish_time:""
|
|
|
};
|
|
|
|
|
|
var Upload_SetPublic = function SetPublic(_ref) {
|
|
|
var attachment = _ref.attachment,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(objectSpread2_default()({}, defaultFormValue)),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
formValue = _useState2[0],
|
|
|
setFormValue = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
fileList = _useState4[0],
|
|
|
setFileList = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
disabled = _useState6[0],
|
|
|
setDisabled = _useState6[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (attachment.actionTabs.key === '上传资源') form.resetFields();
|
|
|
}, [attachment.actionTabs.key]);
|
|
|
var disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
params['id'] = params['coursesId'];
|
|
|
var fileTypes = ["pdf", "docx", "doc", "xlsx", "xls", "ppt", "pptx", "zip"];
|
|
|
var uploadProps = {
|
|
|
multiple: true,
|
|
|
maxCount: 10,
|
|
|
// accept: ".pdf, .docx, .doc, .xlsx, .xls, .ppt, .pptx, .zip,",
|
|
|
withCredentials: true,
|
|
|
beforeUpload: function beforeUpload(file) {
|
|
|
var fileSize = file.size / 1024 / 1024;
|
|
|
var fileType = file.name.split(".").slice(-1)[0].toLowerCase();
|
|
|
if (fileSize > 500 || fileSize == 0) {
|
|
|
message/* default */.ZP.error("".concat(file.name, " \u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002").concat(fileSize == 0 ? "文件内容不能为空" : '超过文件大小限制(500MB)'));
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
// if(fileTypes.indexOf(fileType)==-1){
|
|
|
// message.error(`${file.name} 文件无法上传,当前仅限支持pdf、word、excel、ppt、zip文件`)
|
|
|
// return Promise.reject()
|
|
|
// }
|
|
|
return true;
|
|
|
},
|
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json"),
|
|
|
onChange: function onChange(data) {
|
|
|
var _data$file;
|
|
|
console.log("data--", data);
|
|
|
if (((_data$file = data.file) === null || _data$file === void 0 || (_data$file = _data$file.response) === null || _data$file === void 0 ? void 0 : _data$file.status) == -1) {
|
|
|
message/* default */.ZP.warning(data.file.response.message);
|
|
|
setDisabled(true);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u4E0A\u4F20\u8D44\u6E90",
|
|
|
open: attachment.actionTabs.key === '上传资源' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
destroyOnClose: true,
|
|
|
maskClosable: false,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var value, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return form.validateFields();
|
|
|
case 2:
|
|
|
value = form.getFieldValue();
|
|
|
value = Object.assign({}, formValue, value);
|
|
|
console.log(value.attachment_ids);
|
|
|
_context.next = 7;
|
|
|
return (0,fetch/* default */.ZP)("/api/files/upload.json", {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
attachment_ids: value.attachment_ids.map(function (v) {
|
|
|
return v.response.id;
|
|
|
}),
|
|
|
//value.attachment_ids.map(v => v.response.id)
|
|
|
course_id: params.id,
|
|
|
course_second_category_id: params.categoryId * 1,
|
|
|
is_public: !!value.is_public,
|
|
|
delay_publish: value.delay_publish,
|
|
|
description: value.description,
|
|
|
publish_time: value.publish_time
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '资源', '上传资源']);
|
|
|
setFormValue(objectSpread2_default()({}, defaultFormValue));
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, attachment.actionTabs.params)
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: {
|
|
|
id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
setFileList([]);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
setFileList([]);
|
|
|
setFormValue(objectSpread2_default()({}, defaultFormValue));
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: formValue,
|
|
|
onChange: function onChange() {
|
|
|
var value = form.getFieldValue();
|
|
|
setFormValue(Object.assign({}, formValue, value));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "attachment_ids",
|
|
|
valuePropName: "fileList",
|
|
|
getValueFromEvent: function getValueFromEvent(e) {
|
|
|
if (Array.isArray(e)) {
|
|
|
return e;
|
|
|
}
|
|
|
return e === null || e === void 0 ? void 0 : e.fileList;
|
|
|
},
|
|
|
normalize: function normalize(value) {
|
|
|
var uploadNameSizeSeperator = ' ';
|
|
|
var fileList = value.filter(function (item) {
|
|
|
var fileSize = item.size / 1024 / 1024;
|
|
|
var fileType = item.originFileObj.name.split(".").slice(-1)[0].toLowerCase();
|
|
|
if (item.name.indexOf(uploadNameSizeSeperator) === -1) item.name = "".concat(item.name).concat(uploadNameSizeSeperator).concat((0,util/* bytesToSize */.RD)(item.size));
|
|
|
// if (fileSize > 150||(fileTypes.indexOf(fileType)==-1)) return false;
|
|
|
if (fileSize > 500 || fileSize == 0) return false;
|
|
|
return true;
|
|
|
});
|
|
|
setFileList(fileList);
|
|
|
return fileList;
|
|
|
},
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请上传资源"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
disabled: fileList.length > 9 || disabled,
|
|
|
ghost: true,
|
|
|
children: "\u6587\u4EF6\u4E0A\u4F20"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
placement: "right",
|
|
|
overlayStyle: {
|
|
|
maxWidth: 600
|
|
|
},
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u63D0\u793A\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "1. \u4E00\u6B21\u6700\u591A\u4E0A\u4F2010\u4E2A\u6587\u4EF6\u3002"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["2. \u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7", (0,authority/* isSuperAdmins */.Ny)() ? '1G' : '150M', "\u3002"]
|
|
|
})]
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
className: "iconfont icon-tishixiaowenhao ml5",
|
|
|
style: {
|
|
|
cursor: 'pointer',
|
|
|
color: '#4C6FFF'
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
}))
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u516C\u5F00\uFF1A",
|
|
|
name: "is_public",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
value: 1,
|
|
|
children: "\u9009\u4E2D\uFF0C\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF0C\u5426\u5219\u8BFE\u5802\u6210\u5458\u53EF\u89C1"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "description",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
|
maxLength: 100,
|
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u8D44\u6E90\u63CF\u8FF0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",
|
|
|
rows: 6
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Upload = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var attachment = _ref3.attachment;
|
|
|
return {
|
|
|
attachment: attachment
|
|
|
};
|
|
|
})(Upload_SetPublic));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/ExternalLinks.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ExternalLinks_defaultFormValue = {
|
|
|
delay_publish: 0,
|
|
|
is_public: [false],
|
|
|
description: "",
|
|
|
name: "",
|
|
|
link: ""
|
|
|
// publish_time:""
|
|
|
};
|
|
|
|
|
|
var ExternalLinks_SetPublic = function SetPublic(_ref) {
|
|
|
var attachment = _ref.attachment,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(objectSpread2_default()({}, ExternalLinks_defaultFormValue)),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
formValue = _useState2[0],
|
|
|
setFormValue = _useState2[1];
|
|
|
var disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
params['id'] = params['coursesId'];
|
|
|
var props = {
|
|
|
name: 'file',
|
|
|
multiple: true,
|
|
|
action: env/* default */.Z.API_SERVER + '/api/attachments.json',
|
|
|
onChange: function onChange(info) {
|
|
|
var status = info.file.status;
|
|
|
if (status !== 'uploading') {}
|
|
|
if (status === 'done') {
|
|
|
message/* default */.ZP.success("".concat(info.file.name, " \u6587\u4EF6\u4E0A\u4F20\u6210\u529F"));
|
|
|
} else if (status === 'error') {
|
|
|
message/* default */.ZP.error("".concat(info.file.name, " \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"));
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u6DFB\u52A0\u5916\u94FE",
|
|
|
open: attachment.actionTabs.key === '添加外链' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
destroyOnClose: true,
|
|
|
maskClosable: false,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _value$is_public;
|
|
|
var value, res, _attachment$actionTab;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return form.validateFields();
|
|
|
case 2:
|
|
|
value = form.getFieldsValue();
|
|
|
value = Object.assign({}, formValue, value);
|
|
|
_context.next = 6;
|
|
|
return (0,fetch/* default */.ZP)("/api/files/upload.json", {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
course_id: params.id,
|
|
|
course_second_category_id: params.categoryId * 1,
|
|
|
is_public: (_value$is_public = value.is_public) === null || _value$is_public === void 0 ? void 0 : _value$is_public[0],
|
|
|
delay_publish: value.delay_publish,
|
|
|
description: value.description,
|
|
|
publish_time: value.publish_time,
|
|
|
name: value.name,
|
|
|
link: value.link
|
|
|
}
|
|
|
});
|
|
|
case 6:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
form.resetFields();
|
|
|
(0,util/* trackEvent */.L9)(['教学课堂', '资源', '添加外链']);
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, attachment === null || attachment === void 0 || (_attachment$actionTab = attachment.actionTabs) === null || _attachment$actionTab === void 0 ? void 0 : _attachment$actionTab.params)
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getClassroomLeftMenus',
|
|
|
payload: {
|
|
|
id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
form.resetFields();
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: ExternalLinks_defaultFormValue,
|
|
|
onChange: function onChange() {
|
|
|
var value = form.getFieldsValue();
|
|
|
setFormValue(Object.assign({}, formValue, value));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u8D44\u6E90\u540D\u79F0\uFF1A",
|
|
|
name: "name",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入资源名称,最大限制60字符"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [formValue.name.length, "/60"]
|
|
|
}),
|
|
|
maxLength: 60,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8D44\u6E90\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u5B57\u7B26"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u94FE\u63A5\u5730\u5740\uFF1A",
|
|
|
name: "link",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入外链url"
|
|
|
}, {
|
|
|
type: "url",
|
|
|
message: "请输入正确的url"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u5916\u94FEurl"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u516C\u5F00\uFF1A",
|
|
|
name: "is_public",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
value: true,
|
|
|
children: "\u9009\u4E2D\uFF0C\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF0C\u5426\u5219\u8BFE\u5802\u6210\u5458\u53EF\u89C1"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "description",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
|
maxLength: 100,
|
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u8D44\u6E90\u63CF\u8FF0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",
|
|
|
rows: 6
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ExternalLinks = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var attachment = _ref3.attachment;
|
|
|
return {
|
|
|
attachment: attachment
|
|
|
};
|
|
|
})(ExternalLinks_SetPublic));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
|
var es_select = __webpack_require__(57809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
|
|
|
var DeleteOutlined = __webpack_require__(47966);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusCircleOutlined.js + 1 modules
|
|
|
var PlusCircleOutlined = __webpack_require__(71029);
|
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
|
var lodash = __webpack_require__(89392);
|
|
|
// EXTERNAL MODULE: ./src/service/attachment.ts
|
|
|
var service_attachment = __webpack_require__(14579);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/Config.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Config_defaultFormValue = {
|
|
|
delay_publish: 0,
|
|
|
is_public: [false],
|
|
|
description: "",
|
|
|
title: "",
|
|
|
link: "",
|
|
|
publish_time: ""
|
|
|
};
|
|
|
var RangePicker = date_picker["default"].RangePicker;
|
|
|
var Config_Option = es_select["default"].Option;
|
|
|
var Config_SetPublic = function SetPublic(_ref) {
|
|
|
var _histories$, _histories$2, _histories$3, _histories$4;
|
|
|
var attachment = _ref.attachment,
|
|
|
shixunHomeworks = _ref.shixunHomeworks,
|
|
|
dispatch = _ref.dispatch,
|
|
|
loading = _ref.loading,
|
|
|
getFileData = _ref.getFileData;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
// const { workSetting, workList, changeData } = shixunHomeworks
|
|
|
var _useState = (0,_react_17_0_2_react.useState)({
|
|
|
group_settings: []
|
|
|
}),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
workSetting = _useState2[0],
|
|
|
setworksetting = _useState2[1];
|
|
|
var detail = attachment.detail;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
histories = _useState4[0],
|
|
|
setHistories = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(objectSpread2_default()({}, Config_defaultFormValue)),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
formValue = _useState6[0],
|
|
|
setFormValue = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
allpublish = _useState8[0],
|
|
|
setallpublish = _useState8[1];
|
|
|
var _disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
params['id'] = params['coursesId'];
|
|
|
params['course_id'] = params['coursesId'];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)({
|
|
|
unified_setting: true,
|
|
|
//是否统一设置
|
|
|
publish_time: '' // string 统一设置的发布时间
|
|
|
}),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
data = _useState10[0],
|
|
|
setData = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([{
|
|
|
is_admin: true
|
|
|
}]),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
groupSettings = _useState12[0],
|
|
|
setGroupSetting = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
othergroupSettings = _useState14[0],
|
|
|
setOtherGroupSetting = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
repairSettings = _useState16[0],
|
|
|
setRepairSetting = _useState16[1];
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _res$course_groups2;
|
|
|
var res, _res$course_groups, newarr, _res$course_groups3, _res$course_groups4, arr, otherarr;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return dispatch({
|
|
|
type: 'attachment/getDetail',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
res.delay_publish = res.delay_publish ? 1 : 0;
|
|
|
formValue["is_public"] = [res.is_public];
|
|
|
formValue["description"] = res.description;
|
|
|
formValue["delay_publish"] = res.delay_publish;
|
|
|
formValue["publish_time"] = res.publish_time;
|
|
|
form.setFieldsValue(formValue);
|
|
|
// data.unified_setting = res?.unified_setting || res?.batches_publish_info.length==0
|
|
|
setallpublish(res === null || res === void 0 ? void 0 : res.unified_setting);
|
|
|
if (attachment.actionTabs.manage_all_group) {
|
|
|
if ((res === null || res === void 0 || (_res$course_groups = res.course_groups) === null || _res$course_groups === void 0 ? void 0 : _res$course_groups.length) > 0) {
|
|
|
data.unified_setting = false;
|
|
|
} else {
|
|
|
data.unified_setting = true;
|
|
|
}
|
|
|
} else {
|
|
|
if (res !== null && res !== void 0 && res.unified_setting) {
|
|
|
data.unified_setting = true;
|
|
|
} else {
|
|
|
data.unified_setting = false;
|
|
|
}
|
|
|
}
|
|
|
data.publish_time = res.publish_time ? res.publish_time : dayjs_min_default()(dayjs_min_default()(new Date()).add(0, 'days').format('YYYY-MM-DD HH:mm'));
|
|
|
console.log(data.unified_setting);
|
|
|
setData(Object.assign({}, data));
|
|
|
setHistories([objectSpread2_default()({}, res)].concat(toConsumableArray_default()(res === null || res === void 0 ? void 0 : res.attachment_histories)));
|
|
|
newarr = objectSpread2_default()({}, workSetting);
|
|
|
newarr.group_settings = res === null || res === void 0 ? void 0 : res.batches_publish_info;
|
|
|
console.log(newarr);
|
|
|
setworksetting(newarr);
|
|
|
if ((res === null || res === void 0 || (_res$course_groups2 = res.course_groups) === null || _res$course_groups2 === void 0 ? void 0 : _res$course_groups2.length) > 0) {
|
|
|
arr = res === null || res === void 0 || (_res$course_groups3 = res.course_groups) === null || _res$course_groups3 === void 0 ? void 0 : _res$course_groups3.filter(function (item) {
|
|
|
return item.is_admin;
|
|
|
});
|
|
|
otherarr = res === null || res === void 0 || (_res$course_groups4 = res.course_groups) === null || _res$course_groups4 === void 0 ? void 0 : _res$course_groups4.filter(function (item) {
|
|
|
return !item.is_admin;
|
|
|
});
|
|
|
if ((arr === null || arr === void 0 ? void 0 : arr.length) > 0) {
|
|
|
setGroupSetting(arr);
|
|
|
} else {
|
|
|
setGroupSetting([{
|
|
|
is_admin: true
|
|
|
}]);
|
|
|
}
|
|
|
if ((otherarr === null || otherarr === void 0 ? void 0 : otherarr.length) > 0) {
|
|
|
setOtherGroupSetting(otherarr);
|
|
|
} else {
|
|
|
setOtherGroupSetting([]);
|
|
|
}
|
|
|
} else {
|
|
|
console.log(groupSettings);
|
|
|
}
|
|
|
case 20:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (attachment.actionTabs.key === "资源设置") {
|
|
|
var _attachment$actionTab;
|
|
|
params.id = (_attachment$actionTab = attachment.actionTabs.selectArrs) === null || _attachment$actionTab === void 0 ? void 0 : _attachment$actionTab["id"];
|
|
|
form.resetFields();
|
|
|
getData();
|
|
|
}
|
|
|
}, [attachment.actionTabs.key, params.id]);
|
|
|
var deleteFlies = function deleteFlies(flies_id, key) {
|
|
|
if (histories.length === 1) {
|
|
|
modal/* default */.Z.info({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '删除提示',
|
|
|
icon: null,
|
|
|
className: 'custom-modal-divider',
|
|
|
content: '资源不能全部删除'
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '删除提示',
|
|
|
icon: null,
|
|
|
className: 'custom-modal-divider',
|
|
|
content: '删除资源后将无法恢复,请确认是否删除?',
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var record, res, _attachment$actionTab2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
record = key ? {
|
|
|
type: 'history'
|
|
|
} : {};
|
|
|
_context2.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/attachments/".concat(flies_id, ".json"), {
|
|
|
method: 'delete',
|
|
|
body: record
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context2.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
params.id = (_attachment$actionTab2 = attachment.actionTabs.selectArrs) === null || _attachment$actionTab2 === void 0 ? void 0 : _attachment$actionTab2["id"];
|
|
|
getData();
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var fileTypes = ["pdf", "docx", "doc", "xlsx", "xls", "ppt", "pptx", "zip"];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
fileList = _useState18[0],
|
|
|
setFileList = _useState18[1];
|
|
|
var uploadProps = {
|
|
|
multiple: false,
|
|
|
maxCount: 1,
|
|
|
accept: ".pdf, .docx, .doc, .xlsx, .xls, .ppt, .pptx, .zip,",
|
|
|
withCredentials: true,
|
|
|
beforeUpload: function beforeUpload(file) {
|
|
|
var fileSize = file.size / 1024 / 1024;
|
|
|
var fileType = file.name.split(".").slice(-1)[0].toLowerCase();
|
|
|
if (fileSize > 500) {
|
|
|
message/* default */.ZP.error("".concat(file.name, " \u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(500MB)"));
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
if (fileTypes.indexOf(fileType) == -1) {
|
|
|
message/* default */.ZP.error("".concat(file.name, " \u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20,\u5F53\u524D\u4EC5\u9650\u652F\u6301pdf\u3001word\u3001excel\u3001ppt\u3001zip\u6587\u4EF6"));
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json")
|
|
|
};
|
|
|
function SimpleTable(_ref3) {
|
|
|
var data = _ref3.data;
|
|
|
console.log("data", data);
|
|
|
var columns = [{
|
|
|
title: '资源名称',
|
|
|
key: 'id',
|
|
|
width: 307,
|
|
|
ellipsis: true,
|
|
|
render: function render(text) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: text.title,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: env/* default */.Z.API_SERVER + text.url,
|
|
|
target: "_blank",
|
|
|
className: "multi_ellipsis1 c-grey-333",
|
|
|
children: text.title
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '下载',
|
|
|
dataIndex: 'downloads_count',
|
|
|
key: 'downloads_count',
|
|
|
ellipsis: true,
|
|
|
width: 50
|
|
|
}, {
|
|
|
title: '版本号',
|
|
|
dataIndex: 'created_on',
|
|
|
key: 'created_on',
|
|
|
ellipsis: true,
|
|
|
width: 140,
|
|
|
render: function render(text) {
|
|
|
return text ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: dayjs_min_default()(text).format("YYYY-MM-DD HH:mm")
|
|
|
}) : '--';
|
|
|
}
|
|
|
}, {
|
|
|
title: '操作',
|
|
|
width: 60,
|
|
|
render: function render(text, item, i) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return deleteFlies(item === null || item === void 0 ? void 0 : item.id, i);
|
|
|
},
|
|
|
className: "c-red current",
|
|
|
children: "\u5220\u9664"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
pagination: false,
|
|
|
columns: columns,
|
|
|
style: {
|
|
|
fontSize: 12,
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
dataSource: data || []
|
|
|
});
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u8D44\u6E90\u8BBE\u7F6E",
|
|
|
open: attachment.actionTabs.key === '资源设置' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
destroyOnClose: true,
|
|
|
maskClosable: false,
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
width: 600
|
|
|
// width={900}
|
|
|
,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var _groupSettings, _value$is_public, _value$attachment_ids;
|
|
|
var value, bodyData, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
// if(allpublish&&!data.unified_setting){
|
|
|
// message.error('资料已统一发布,不能再分班发布')
|
|
|
// return
|
|
|
// }
|
|
|
if (!data.unified_setting) groupSettings = (_groupSettings = groupSettings) === null || _groupSettings === void 0 ? void 0 : _groupSettings.map(function (item) {
|
|
|
var _workSetting$group_se;
|
|
|
if (!item.course_group_name) {
|
|
|
message/* default */.ZP.error('请选择分班名称');
|
|
|
throw new String('请选择分班名称');
|
|
|
}
|
|
|
if (!item.publish_time) {
|
|
|
message/* default */.ZP.error('请把发布时间填写完整');
|
|
|
throw new String('请把发布时间填写完整');
|
|
|
}
|
|
|
// item.group_name = typeof item?.group_name === 'string' ? [item?.group_name] : item?.group_name
|
|
|
item.course_group_id = (_workSetting$group_se = workSetting.group_settings) === null || _workSetting$group_se === void 0 ? void 0 : _workSetting$group_se.filter(function (v) {
|
|
|
return item === null || item === void 0 ? void 0 : item.course_group_name.includes(v.name);
|
|
|
}).map(function (v) {
|
|
|
return v.course_group_id || v.id;
|
|
|
}).toString().split(",");
|
|
|
console.log(item.course_group_id);
|
|
|
return item;
|
|
|
});
|
|
|
console.log(groupSettings);
|
|
|
_context3.next = 4;
|
|
|
return form.validateFields();
|
|
|
case 4:
|
|
|
value = form.getFieldValue();
|
|
|
value = Object.assign({}, formValue, value);
|
|
|
bodyData = JSON.parse(JSON.stringify(data));
|
|
|
bodyData.group_settings = groupSettings.concat(othergroupSettings);
|
|
|
_context3.next = 10;
|
|
|
return (0,service_attachment/* updateFiles */.Ot)(objectSpread2_default()({
|
|
|
id: detail.id,
|
|
|
course_id: params.id,
|
|
|
course_second_category_id: params.categoryId || 0,
|
|
|
is_public: (_value$is_public = value.is_public) === null || _value$is_public === void 0 ? void 0 : _value$is_public[0],
|
|
|
delay_publish: value.delay_publish,
|
|
|
publish_type: data !== null && data !== void 0 && data.unified_setting ? 0 : 1,
|
|
|
description: value.description,
|
|
|
publish_time: formValue.publish_time,
|
|
|
new_attachment_id: (_value$attachment_ids = value.attachment_ids) === null || _value$attachment_ids === void 0 ? void 0 : _value$attachment_ids.map(function (v) {
|
|
|
var _v$response;
|
|
|
return (_v$response = v.response) === null || _v$response === void 0 ? void 0 : _v$response.id;
|
|
|
})
|
|
|
}, bodyData));
|
|
|
case 10:
|
|
|
res = _context3.sent;
|
|
|
if (res.status === 0) {
|
|
|
setFormValue(objectSpread2_default()({}, Config_defaultFormValue));
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, attachment.actionTabs.params)
|
|
|
});
|
|
|
getFileData();
|
|
|
}
|
|
|
setFileList([]);
|
|
|
setGroupSetting([{}]);
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
setFileList([]);
|
|
|
setGroupSetting([{}]);
|
|
|
setFormValue(objectSpread2_default()({}, Config_defaultFormValue));
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, attachment.actionTabs.params)
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
className: "",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
|
loading: loading['attachment/getDetail'],
|
|
|
active: true,
|
|
|
avatar: {
|
|
|
size: 40
|
|
|
},
|
|
|
paragraph: {
|
|
|
rows: 5
|
|
|
},
|
|
|
className: "mt30",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SimpleTable, {
|
|
|
data: histories
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: formValue,
|
|
|
onChange: function onChange() {
|
|
|
var value = form.getFieldValue();
|
|
|
setFormValue(Object.assign({}, formValue, value));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "attachment_ids",
|
|
|
valuePropName: "fileList",
|
|
|
getValueFromEvent: function getValueFromEvent(e) {
|
|
|
if (Array.isArray(e)) {
|
|
|
return e;
|
|
|
}
|
|
|
return e === null || e === void 0 ? void 0 : e.fileList;
|
|
|
},
|
|
|
normalize: function normalize(value) {
|
|
|
var uploadNameSizeSeperator = ' ';
|
|
|
var fileList = value.filter(function (item) {
|
|
|
var fileSize = item.size / 1024 / 1024;
|
|
|
var fileType = item.originFileObj.name.split(".").slice(-1)[0].toLowerCase();
|
|
|
if (item.name.indexOf(uploadNameSizeSeperator) === -1) item.name = "".concat(item.name).concat(uploadNameSizeSeperator).concat((0,util/* bytesToSize */.RD)(item.size));
|
|
|
if (fileSize > 500 || fileTypes.indexOf(fileType) == -1) return false;
|
|
|
return true;
|
|
|
});
|
|
|
setFileList(fileList);
|
|
|
return fileList;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
disabled: fileList.length > 0,
|
|
|
ghost: true,
|
|
|
style: {
|
|
|
marginRight: 5
|
|
|
},
|
|
|
children: "\u66F4\u65B0\u7248\u672C"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
placement: "right",
|
|
|
overlayStyle: {
|
|
|
maxWidth: 600
|
|
|
},
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u63D0\u793A\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["1. \u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7", (0,authority/* isSuperAdmins */.Ny)() ? '1G' : '150M', "\u3002"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "2. \u5F53\u524D\u4EC5\u9650\u652F\u6301pdf\u3001word\u3001excel\u3001ppt\u3001zip\u6587\u4EF6\u3002"
|
|
|
})]
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
className: "iconfont icon-tishixiaowenhao ml5",
|
|
|
style: {
|
|
|
cursor: 'pointer',
|
|
|
color: '#4C6FFF'
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
}))
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u516C\u5F00\uFF1A",
|
|
|
name: "is_public",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
value: true,
|
|
|
disabled: ((_histories$ = histories[0]) === null || _histories$ === void 0 || (_histories$ = _histories$.course_groups) === null || _histories$ === void 0 ? void 0 : _histories$.length) > 0 || !attachment.actionTabs.manage_all_group,
|
|
|
children: "\u9009\u4E2D\uFF0C\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF0C\u5426\u5219\u8BFE\u5802\u6210\u5458\u53EF\u89C1"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "mb20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr5",
|
|
|
children: "\u53D1\u5E03\u8BBE\u7F6E:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
value: data.unified_setting,
|
|
|
onChange: function onChange(e) {
|
|
|
// if (histories[0]?.is_publish) {
|
|
|
// message.error(`已发布,不能再修改统一设置`)
|
|
|
// return
|
|
|
// }
|
|
|
data.unified_setting = !data.unified_setting;
|
|
|
setData(Object.assign({}, data));
|
|
|
if (data.unified_setting === false && groupSettings == '') {
|
|
|
setGroupSetting(groupSettings.concat({}));
|
|
|
return;
|
|
|
}
|
|
|
// if (data.unified_setting) {
|
|
|
// setGroupSetting([])
|
|
|
// setRepairSetting([{ late_penalty: 5 }])
|
|
|
// }
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: true,
|
|
|
disabled: ((_histories$2 = histories[0]) === null || _histories$2 === void 0 || (_histories$2 = _histories$2.course_groups) === null || _histories$2 === void 0 ? void 0 : _histories$2.length) > 0 || !attachment.actionTabs.manage_all_group,
|
|
|
children: "\u7EDF\u4E00\u53D1\u5E03"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: false,
|
|
|
disabled: (_histories$3 = histories[0]) === null || _histories$3 === void 0 ? void 0 : _histories$3.unified_setting,
|
|
|
children: "\u5206\u73ED\u53D1\u5E03"
|
|
|
})]
|
|
|
})]
|
|
|
}), data.unified_setting && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
className: "mb30",
|
|
|
style: {
|
|
|
paddingLeft: 65
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: "\u53D1\u5E03\u65F6\u95F4:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: "ml5",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"]
|
|
|
// disabled={(disabled ? disabled : (workList?.homework_status?.includes("未发布") || workList?.homework_status?.includes("未开始")) ? false : true) || (isAssistant() && !classroomList.AssistantObject.practice?.can_publish)}
|
|
|
, {
|
|
|
style: {
|
|
|
width: 170
|
|
|
},
|
|
|
placeholder: '请选择发布时间',
|
|
|
showTime: {
|
|
|
format: 'HH:mm'
|
|
|
},
|
|
|
allowClear: false,
|
|
|
format: "YYYY-MM-DD HH:mm",
|
|
|
disabledDate: function disabledDate(current) {
|
|
|
return _disabledDate(current, workSetting === null || workSetting === void 0 ? void 0 : workSetting.course_end_date);
|
|
|
},
|
|
|
disabledTime: function disabledTime(current) {
|
|
|
return (0,Releasesetting/* disabledTime */.d0)(current);
|
|
|
},
|
|
|
disabled: dayjs_min_default()() > dayjs_min_default()((_histories$4 = histories[0]) === null || _histories$4 === void 0 ? void 0 : _histories$4.publish_time) || !attachment.actionTabs.manage_all_group,
|
|
|
value: data.publish_time ? dayjs_min_default()(data.publish_time) : '',
|
|
|
onChange: function onChange(value, time) {
|
|
|
data.publish_time = time;
|
|
|
// if ((data.end_time == '' || !data.end_time) && data.unified_setting) {
|
|
|
// data.end_time = moment(value).add(1, 'month').format('YYYY-MM-DD HH:mm:ss')
|
|
|
// }
|
|
|
setData(Object.assign({}, data));
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-c ml10",
|
|
|
children: "(\u5B66\u751F\u53EF\u67E5\u770B\u6559\u5B66\u8D44\u6599\u7684\u65F6\u95F4)"
|
|
|
})
|
|
|
})]
|
|
|
}), !data.unified_setting && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z
|
|
|
// style={{
|
|
|
// marginTop: 30,
|
|
|
// paddingTop: 40,
|
|
|
// marginLeft: 40,
|
|
|
// borderTop: '1px solid #eee',
|
|
|
// }}
|
|
|
, {
|
|
|
style: {
|
|
|
paddingLeft: 65,
|
|
|
marginBottom: 30,
|
|
|
maxHeight: 216,
|
|
|
overflow: 'hidden auto'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: "\u5206\u73ED\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: "\u53D1\u5E03\u65F6\u95F4\uFF1A"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 4
|
|
|
})]
|
|
|
})
|
|
|
}), groupSettings && groupSettings.map(function (v, k) {
|
|
|
var _workSetting$group_se2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
gutter: [8, 16],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 10,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
gutter: [8, 16],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: '1',
|
|
|
style: {
|
|
|
maxWidth: 200
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"]
|
|
|
// disabled={disabled || (!workList?.homework_status?.includes("未发布") && v.id) || (isAssistant() && !classroomList.AssistantObject.practice?.can_publish)}
|
|
|
// disabled={(moment()>=moment(v.publish_time))&& v.publish_time}
|
|
|
, {
|
|
|
disabled: v.course_group_id,
|
|
|
mode: "multiple",
|
|
|
style: {
|
|
|
width: '100%'
|
|
|
},
|
|
|
value: v.course_group_name,
|
|
|
placeholder: "\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",
|
|
|
onChange: function onChange(value, option) {
|
|
|
// if (isAssistant() && !classroomList.AssistantObject.practice?.can_publish) {
|
|
|
// message.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
// return
|
|
|
// }
|
|
|
|
|
|
console.log(option);
|
|
|
groupSettings[k]['course_group_name'] = value;
|
|
|
groupSettings[k]['course_group_id'] = v.course_group_id;
|
|
|
var items = (0,lodash.flattenDeep)(groupSettings.map(function (e) {
|
|
|
return e.course_group_name;
|
|
|
}));
|
|
|
var newRepairSettings = repairSettings.map(function (e) {
|
|
|
var ar = (e === null || e === void 0 ? void 0 : e.course_group_name) || [];
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
|
course_group_name: (0,lodash.remove)(ar, function (k) {
|
|
|
return items.includes(k);
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
setRepairSetting(newRepairSettings);
|
|
|
setGroupSetting(groupSettings.slice());
|
|
|
},
|
|
|
children: (workSetting === null || workSetting === void 0 ? void 0 : workSetting.group_settings) && (workSetting === null || workSetting === void 0 ? void 0 : workSetting.group_settings.map(function (v) {
|
|
|
var groupNameInGroupSettings = groupSettings.map(function (item) {
|
|
|
return item.course_group_name;
|
|
|
}).flat();
|
|
|
if (!groupNameInGroupSettings.includes(v.name)) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Config_Option, {
|
|
|
value: v.name,
|
|
|
children: v.name
|
|
|
}, v.course_group_id);
|
|
|
}
|
|
|
}))
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 10,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "ml30",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
|
placeholder: '请选择发布时间',
|
|
|
showTime: {
|
|
|
format: 'HH:mm'
|
|
|
},
|
|
|
allowClear: false,
|
|
|
format: "YYYY-MM-DD HH:mm",
|
|
|
disabledDate: function disabledDate(current) {
|
|
|
return _disabledDate(current, workSetting === null || workSetting === void 0 ? void 0 : workSetting.course_end_date);
|
|
|
},
|
|
|
disabledTime: function disabledTime(current) {
|
|
|
return (0,Releasesetting/* disabledTime */.d0)(current);
|
|
|
},
|
|
|
disabled: v.is_timeout,
|
|
|
value: v.publish_time ? dayjs_min_default()(v.publish_time) : '',
|
|
|
onChange: function onChange(value, time) {
|
|
|
// data.publish_time = time
|
|
|
// if ((data.end_time == '' || !data.end_time) && data.unified_setting) {
|
|
|
// data.end_time = moment(value).add(1, 'month').format('YYYY-MM-DD HH:mm:ss')
|
|
|
// }
|
|
|
// setData(Object.assign({}, data))
|
|
|
groupSettings[k]['publish_time'] = time;
|
|
|
setGroupSetting(toConsumableArray_default()(groupSettings));
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
span: 4,
|
|
|
children: [k > 0 && (dayjs_min_default()() <= dayjs_min_default()(v.publish_time) || !v.course_group_id) && /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
|
|
|
onClick: function onClick() {
|
|
|
// 数据同步
|
|
|
var repairSettingsCopy = (0,lodash.cloneDeep)(repairSettings);
|
|
|
console.log(repairSettingsCopy, "repairSettingsCopyrepairSettingsCopyrepairSettingsCopy");
|
|
|
repairSettingsCopy.forEach(function (i, key) {
|
|
|
if (i.group_name) {
|
|
|
i.group_name = i.group_name.filter(function (item) {
|
|
|
var _groupSettings$k$grou;
|
|
|
return !((_groupSettings$k$grou = groupSettings[k].group_name) !== null && _groupSettings$k$grou !== void 0 && _groupSettings$k$grou.includes(item));
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
groupSettings = groupSettings.filter(function (val, key) {
|
|
|
return k !== key;
|
|
|
});
|
|
|
setRepairSetting(repairSettingsCopy);
|
|
|
setGroupSetting(groupSettings.slice());
|
|
|
setTimeout(function () {
|
|
|
return setGroupSetting(groupSettings.slice());
|
|
|
}, 10);
|
|
|
}
|
|
|
}), groupSettings.length < (workSetting === null || workSetting === void 0 || (_workSetting$group_se2 = workSetting.group_settings) === null || _workSetting$group_se2 === void 0 ? void 0 : _workSetting$group_se2.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(PlusCircleOutlined/* default */.Z, {
|
|
|
className: "c-green ml20",
|
|
|
style: {
|
|
|
position: 'absolute',
|
|
|
left: 20,
|
|
|
top: 4
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
console.log(groupSettings);
|
|
|
|
|
|
// if (isAssistant() && !classroomList.AssistantObject.practice?.can_publish) {
|
|
|
// message.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
// return
|
|
|
// }
|
|
|
setGroupSetting(groupSettings.concat({}));
|
|
|
}
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}, k);
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "description",
|
|
|
label: "\u8D44\u6E90\u63CF\u8FF0\uFF1A",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
|
maxLength: 100,
|
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u8D44\u6E90\u63CF\u8FF0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",
|
|
|
rows: 6
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Config = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
var attachment = _ref5.attachment,
|
|
|
loading = _ref5.loading;
|
|
|
return {
|
|
|
attachment: attachment,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(Config_SetPublic));
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Attachment/components/Download.tsx
|
|
|
var Download = __webpack_require__(50710);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/OutLinkConfig.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var OutLinkConfig_defaultFormValue = {
|
|
|
delay_publish: 0,
|
|
|
is_public: [false],
|
|
|
description: "",
|
|
|
title: "",
|
|
|
link: "",
|
|
|
publish_time: ""
|
|
|
};
|
|
|
var OutLinkConfig_SetPublic = function SetPublic(_ref) {
|
|
|
var _histories$, _histories$2, _histories$3, _histories$4;
|
|
|
var attachment = _ref.attachment,
|
|
|
dispatch = _ref.dispatch,
|
|
|
getFileData = _ref.getFileData;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var detail = attachment.detail;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(objectSpread2_default()({}, OutLinkConfig_defaultFormValue)),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
formValue = _useState2[0],
|
|
|
setFormValue = _useState2[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (attachment.actionTabs.key === "外链设置") {
|
|
|
form.resetFields();
|
|
|
}
|
|
|
}, [attachment.actionTabs.key]);
|
|
|
var _disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
params['id'] = params['coursesId'];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
histories = _useState4[0],
|
|
|
setHistories = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({
|
|
|
unified_setting: true,
|
|
|
//是否统一设置
|
|
|
publish_time: '' // string 统一设置的发布时间
|
|
|
}),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
data = _useState6[0],
|
|
|
setData = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)({
|
|
|
group_settings: [{
|
|
|
"group_id": 18454,
|
|
|
"group_name": "分班1",
|
|
|
"publish_time": null
|
|
|
}, {
|
|
|
"group_id": 18455,
|
|
|
"group_name": "分班2",
|
|
|
"publish_time": null
|
|
|
}]
|
|
|
}),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
workSetting = _useState8[0],
|
|
|
setworksetting = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([{
|
|
|
is_admin: true
|
|
|
}]),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
groupSettings = _useState10[0],
|
|
|
setGroupSetting = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
othergroupSettings = _useState12[0],
|
|
|
setOtherGroupSetting = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
repairSettings = _useState14[0],
|
|
|
setRepairSetting = _useState14[1];
|
|
|
var props = {
|
|
|
name: 'file',
|
|
|
multiple: true,
|
|
|
action: env/* default */.Z.API_SERVER + '/api/attachments.json',
|
|
|
onChange: function onChange(info) {
|
|
|
var status = info.file.status;
|
|
|
if (status !== 'uploading') {}
|
|
|
if (status === 'done') {
|
|
|
message/* default */.ZP.success("".concat(info.file.name, " \u6587\u4EF6\u4E0A\u4F20\u6210\u529F"));
|
|
|
} else if (status === 'error') {
|
|
|
message/* default */.ZP.error("".concat(info.file.name, " \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"));
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _res$course_groups2;
|
|
|
var res, _res$course_groups, newarr, _res$course_groups3, _res$course_groups4, arr, otherarr;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return dispatch({
|
|
|
type: 'attachment/getDetail',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
course_id: params.coursesId
|
|
|
})
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
res.delay_publish = res.delay_publish ? 1 : 0;
|
|
|
formValue["title"] = res.title;
|
|
|
formValue["link"] = res.link;
|
|
|
formValue["is_public"] = [res.is_public];
|
|
|
formValue["description"] = res.description;
|
|
|
formValue["publish_time"] = res.publish_time;
|
|
|
formValue["delay_publish"] = res.delay_publish;
|
|
|
setFormValue(objectSpread2_default()({}, formValue));
|
|
|
form.setFieldsValue(formValue);
|
|
|
// data.unified_setting = res?.unified_setting || res?.batches_publish_info.length==0
|
|
|
if (attachment.actionTabs.manage_all_group) {
|
|
|
if ((res === null || res === void 0 || (_res$course_groups = res.course_groups) === null || _res$course_groups === void 0 ? void 0 : _res$course_groups.length) > 0) {
|
|
|
data.unified_setting = false;
|
|
|
} else {
|
|
|
data.unified_setting = true;
|
|
|
}
|
|
|
} else {
|
|
|
if (res !== null && res !== void 0 && res.unified_setting) {
|
|
|
data.unified_setting = true;
|
|
|
} else {
|
|
|
data.unified_setting = false;
|
|
|
}
|
|
|
}
|
|
|
data.publish_time = res.publish_time ? res.publish_time : dayjs_min_default()(dayjs_min_default()(new Date()).add(0, 'days').format('YYYY-MM-DD HH:mm'));
|
|
|
setData(Object.assign({}, data));
|
|
|
setHistories([objectSpread2_default()({}, res)].concat(toConsumableArray_default()(res === null || res === void 0 ? void 0 : res.attachment_histories)));
|
|
|
newarr = objectSpread2_default()({}, workSetting);
|
|
|
newarr.group_settings = res === null || res === void 0 ? void 0 : res.batches_publish_info;
|
|
|
console.log(newarr);
|
|
|
setworksetting(newarr);
|
|
|
if ((res === null || res === void 0 || (_res$course_groups2 = res.course_groups) === null || _res$course_groups2 === void 0 ? void 0 : _res$course_groups2.length) > 0) {
|
|
|
arr = res === null || res === void 0 || (_res$course_groups3 = res.course_groups) === null || _res$course_groups3 === void 0 ? void 0 : _res$course_groups3.filter(function (item) {
|
|
|
return item.is_admin;
|
|
|
});
|
|
|
otherarr = res === null || res === void 0 || (_res$course_groups4 = res.course_groups) === null || _res$course_groups4 === void 0 ? void 0 : _res$course_groups4.filter(function (item) {
|
|
|
return !item.is_admin;
|
|
|
});
|
|
|
if ((arr === null || arr === void 0 ? void 0 : arr.length) > 0) {
|
|
|
setGroupSetting(arr);
|
|
|
} else {
|
|
|
setGroupSetting([{
|
|
|
is_admin: true
|
|
|
}]);
|
|
|
}
|
|
|
if ((otherarr === null || otherarr === void 0 ? void 0 : otherarr.length) > 0) {
|
|
|
setOtherGroupSetting(otherarr);
|
|
|
} else {
|
|
|
setOtherGroupSetting([]);
|
|
|
}
|
|
|
} else {
|
|
|
console.log(groupSettings);
|
|
|
}
|
|
|
// form.setFieldsValue({...res})
|
|
|
case 21:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (attachment.actionTabs.key === "外链设置") {
|
|
|
var _attachment$actionTab;
|
|
|
params.id = (_attachment$actionTab = attachment.actionTabs.selectArrs) === null || _attachment$actionTab === void 0 ? void 0 : _attachment$actionTab["id"];
|
|
|
getData();
|
|
|
}
|
|
|
}, [attachment.actionTabs.key]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u5916\u94FE\u8BBE\u7F6E",
|
|
|
open: attachment.actionTabs.key === '外链设置' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
width: 600,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var _groupSettings, _value$is_public;
|
|
|
var value, bodyData, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (!data.unified_setting) groupSettings = (_groupSettings = groupSettings) === null || _groupSettings === void 0 ? void 0 : _groupSettings.map(function (item) {
|
|
|
var _workSetting$group_se;
|
|
|
if (!item.course_group_name) {
|
|
|
message/* default */.ZP.error('请选择分班名称');
|
|
|
throw new String('请选择分班名称');
|
|
|
}
|
|
|
if (!item.publish_time) {
|
|
|
message/* default */.ZP.error('请把发布时间填写完整');
|
|
|
throw new String('请把发布时间填写完整');
|
|
|
}
|
|
|
// item.group_name = typeof item?.group_name === 'string' ? [item?.group_name] : item?.group_name
|
|
|
console.log(workSetting.group_settings);
|
|
|
console.log(item);
|
|
|
item.course_group_id = (_workSetting$group_se = workSetting.group_settings) === null || _workSetting$group_se === void 0 ? void 0 : _workSetting$group_se.filter(function (v) {
|
|
|
return item === null || item === void 0 ? void 0 : item.course_group_name.includes(v.name);
|
|
|
}).map(function (v) {
|
|
|
return v.course_group_id || v.id;
|
|
|
}).toString().split(",");
|
|
|
console.log(item.course_group_id);
|
|
|
return item;
|
|
|
});
|
|
|
console.log(groupSettings);
|
|
|
_context2.next = 4;
|
|
|
return form.validateFields();
|
|
|
case 4:
|
|
|
value = form.getFieldValue();
|
|
|
value = Object.assign({}, formValue, value);
|
|
|
bodyData = JSON.parse(JSON.stringify(data));
|
|
|
bodyData.group_settings = groupSettings.concat(othergroupSettings);
|
|
|
_context2.next = 10;
|
|
|
return (0,service_attachment/* updateFiles */.Ot)(objectSpread2_default()({
|
|
|
id: detail.id,
|
|
|
course_id: params.id,
|
|
|
course_second_category_id: params.categoryId * 1,
|
|
|
is_public: (_value$is_public = value.is_public) === null || _value$is_public === void 0 ? void 0 : _value$is_public[0],
|
|
|
delay_publish: value.delay_publish,
|
|
|
publish_type: data !== null && data !== void 0 && data.unified_setting ? 0 : 1,
|
|
|
description: value.description,
|
|
|
publish_time: formValue.publish_time,
|
|
|
link: value.link,
|
|
|
name: value.title
|
|
|
}, bodyData));
|
|
|
case 10:
|
|
|
res = _context2.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, attachment.actionTabs.params)
|
|
|
});
|
|
|
getFileData();
|
|
|
}
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
setGroupSetting([{}]);
|
|
|
setFormValue(objectSpread2_default()({}, OutLinkConfig_defaultFormValue));
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
className: "pl20 pr20 pt10",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: formValue,
|
|
|
onChange: function onChange() {
|
|
|
var value = form.getFieldValue();
|
|
|
setFormValue(Object.assign({}, formValue, value));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u8D44\u6E90\u540D\u79F0\uFF1A",
|
|
|
name: "title",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入资源名称"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8D44\u6E90\u540D\u79F0"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u94FE\u63A5\u5730\u5740\uFF1A",
|
|
|
name: "link",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入外链url"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u5916\u94FEurl"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u516C\u5F00\uFF1A",
|
|
|
name: "is_public",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
value: true,
|
|
|
disabled: ((_histories$ = histories[0]) === null || _histories$ === void 0 || (_histories$ = _histories$.course_groups) === null || _histories$ === void 0 ? void 0 : _histories$.length) > 0 || !attachment.actionTabs.manage_all_group,
|
|
|
children: "\u9009\u4E2D\uFF0C\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF0C\u5426\u5219\u8BFE\u5802\u6210\u5458\u53EF\u89C1"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "mb20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr5",
|
|
|
children: "\u53D1\u5E03\u8BBE\u7F6E:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
value: data.unified_setting,
|
|
|
onChange: function onChange(e) {
|
|
|
// if (histories[0]?.is_publish) {
|
|
|
// message.error(`已发布,不能再修改统一设置`)
|
|
|
// return
|
|
|
// }
|
|
|
data.unified_setting = !data.unified_setting;
|
|
|
setData(Object.assign({}, data));
|
|
|
if (data.unified_setting === false && groupSettings == '') {
|
|
|
setGroupSetting(groupSettings.concat({}));
|
|
|
return;
|
|
|
}
|
|
|
// if (data.unified_setting) {
|
|
|
// setGroupSetting([])
|
|
|
// setRepairSetting([{ late_penalty: 5 }])
|
|
|
// }
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: true,
|
|
|
disabled: ((_histories$2 = histories[0]) === null || _histories$2 === void 0 || (_histories$2 = _histories$2.course_groups) === null || _histories$2 === void 0 ? void 0 : _histories$2.length) > 0 || !attachment.actionTabs.manage_all_group,
|
|
|
children: "\u7EDF\u4E00\u53D1\u5E03"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: false,
|
|
|
disabled: (_histories$3 = histories[0]) === null || _histories$3 === void 0 ? void 0 : _histories$3.unified_setting,
|
|
|
children: "\u5206\u73ED\u53D1\u5E03"
|
|
|
})]
|
|
|
})]
|
|
|
}), data.unified_setting && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
className: "mb30",
|
|
|
style: {
|
|
|
paddingLeft: 65
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: "\u53D1\u5E03\u65F6\u95F4:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: "ml5",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"]
|
|
|
// disabled={(disabled ? disabled : (workList?.homework_status?.includes("未发布") || workList?.homework_status?.includes("未开始")) ? false : true) || (isAssistant() && !classroomList.AssistantObject.practice?.can_publish)}
|
|
|
, {
|
|
|
style: {
|
|
|
width: 170
|
|
|
},
|
|
|
placeholder: '请选择发布时间',
|
|
|
showTime: {
|
|
|
format: 'HH:mm'
|
|
|
},
|
|
|
allowClear: false,
|
|
|
format: "YYYY-MM-DD HH:mm",
|
|
|
disabledDate: function disabledDate(current) {
|
|
|
return _disabledDate(current, workSetting === null || workSetting === void 0 ? void 0 : workSetting.course_end_date);
|
|
|
},
|
|
|
disabledTime: function disabledTime(current) {
|
|
|
return (0,Releasesetting/* disabledTime */.d0)(current);
|
|
|
},
|
|
|
disabled: dayjs_min_default()() > dayjs_min_default()((_histories$4 = histories[0]) === null || _histories$4 === void 0 ? void 0 : _histories$4.publish_time) || !attachment.actionTabs.manage_all_group,
|
|
|
value: data.publish_time ? dayjs_min_default()(data.publish_time) : '',
|
|
|
onChange: function onChange(value, time) {
|
|
|
data.publish_time = time;
|
|
|
// if ((data.end_time == '' || !data.end_time) && data.unified_setting) {
|
|
|
// data.end_time = moment(value).add(1, 'month').format('YYYY-MM-DD HH:mm:ss')
|
|
|
// }
|
|
|
setData(Object.assign({}, data));
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-c ml10",
|
|
|
children: "(\u5B66\u751F\u53EF\u67E5\u770B\u6559\u5B66\u8D44\u6599\u7684\u65F6\u95F4)"
|
|
|
})
|
|
|
})]
|
|
|
}), !data.unified_setting && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z
|
|
|
// style={{
|
|
|
// marginTop: 30,
|
|
|
// paddingTop: 40,
|
|
|
// marginLeft: 40,
|
|
|
// borderTop: '1px solid #eee',
|
|
|
// }}
|
|
|
, {
|
|
|
style: {
|
|
|
paddingLeft: 65,
|
|
|
marginBottom: 30,
|
|
|
maxHeight: 216,
|
|
|
overflow: 'hidden auto'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: "\u5206\u73ED\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: "\u53D1\u5E03\u65F6\u95F4\uFF1A"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 4
|
|
|
})]
|
|
|
})
|
|
|
}), groupSettings && groupSettings.map(function (v, k) {
|
|
|
var _workSetting$group_se2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
gutter: [8, 16],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 10,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
gutter: [8, 16],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: '1',
|
|
|
style: {
|
|
|
maxWidth: 200
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"]
|
|
|
// disabled={disabled || (!workList?.homework_status?.includes("未发布") && v.id) || (isAssistant() && !classroomList.AssistantObject.practice?.can_publish)}
|
|
|
// disabled={(moment()>=moment(v.publish_time))&& v.publish_time}
|
|
|
, {
|
|
|
disabled: v.course_group_id,
|
|
|
mode: "multiple",
|
|
|
style: {
|
|
|
width: '100%'
|
|
|
},
|
|
|
value: v.course_group_name,
|
|
|
placeholder: "\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",
|
|
|
onChange: function onChange(value, option) {
|
|
|
// if (isAssistant() && !classroomList.AssistantObject.practice?.can_publish) {
|
|
|
// message.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
// return
|
|
|
// }
|
|
|
|
|
|
console.log(option);
|
|
|
groupSettings[k]['course_group_name'] = value;
|
|
|
groupSettings[k]['course_group_id'] = v.course_group_id;
|
|
|
var items = (0,lodash.flattenDeep)(groupSettings.map(function (e) {
|
|
|
return e.course_group_name;
|
|
|
}));
|
|
|
var newRepairSettings = repairSettings.map(function (e) {
|
|
|
var ar = (e === null || e === void 0 ? void 0 : e.course_group_name) || [];
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
|
course_group_name: (0,lodash.remove)(ar, function (k) {
|
|
|
return items.includes(k);
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
setRepairSetting(newRepairSettings);
|
|
|
setGroupSetting(groupSettings.slice());
|
|
|
},
|
|
|
children: (workSetting === null || workSetting === void 0 ? void 0 : workSetting.group_settings) && (workSetting === null || workSetting === void 0 ? void 0 : workSetting.group_settings.map(function (v) {
|
|
|
var groupNameInGroupSettings = groupSettings.map(function (item) {
|
|
|
return item.course_group_name;
|
|
|
}).flat();
|
|
|
if (!groupNameInGroupSettings.includes(v.name)) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
|
|
|
value: v.name,
|
|
|
children: v.name
|
|
|
}, v.course_group_id);
|
|
|
}
|
|
|
}))
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 10,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "ml30",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
|
placeholder: '请选择发布时间',
|
|
|
showTime: {
|
|
|
format: 'HH:mm'
|
|
|
},
|
|
|
allowClear: false,
|
|
|
format: "YYYY-MM-DD HH:mm",
|
|
|
disabledDate: function disabledDate(current) {
|
|
|
return _disabledDate(current, workSetting === null || workSetting === void 0 ? void 0 : workSetting.course_end_date);
|
|
|
},
|
|
|
disabledTime: function disabledTime(current) {
|
|
|
return (0,Releasesetting/* disabledTime */.d0)(current);
|
|
|
},
|
|
|
disabled: v.is_timeout,
|
|
|
value: v.publish_time ? dayjs_min_default()(v.publish_time) : '',
|
|
|
onChange: function onChange(value, time) {
|
|
|
// data.publish_time = time
|
|
|
// if ((data.end_time == '' || !data.end_time) && data.unified_setting) {
|
|
|
// data.end_time = moment(value).add(1, 'month').format('YYYY-MM-DD HH:mm:ss')
|
|
|
// }
|
|
|
// setData(Object.assign({}, data))
|
|
|
groupSettings[k]['publish_time'] = time;
|
|
|
setGroupSetting(toConsumableArray_default()(groupSettings));
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
span: 4,
|
|
|
children: [k > 0 && (dayjs_min_default()() <= dayjs_min_default()(v.publish_time) || !v.course_group_id) && /*#__PURE__*/(0,jsx_runtime.jsx)(DeleteOutlined/* default */.Z, {
|
|
|
onClick: function onClick() {
|
|
|
// 数据同步
|
|
|
var repairSettingsCopy = (0,lodash.cloneDeep)(repairSettings);
|
|
|
console.log(repairSettingsCopy, "repairSettingsCopyrepairSettingsCopyrepairSettingsCopy");
|
|
|
repairSettingsCopy.forEach(function (i, key) {
|
|
|
if (i.group_name) {
|
|
|
i.group_name = i.group_name.filter(function (item) {
|
|
|
var _groupSettings$k$grou;
|
|
|
return !((_groupSettings$k$grou = groupSettings[k].group_name) !== null && _groupSettings$k$grou !== void 0 && _groupSettings$k$grou.includes(item));
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
groupSettings = groupSettings.filter(function (val, key) {
|
|
|
return k !== key;
|
|
|
});
|
|
|
setRepairSetting(repairSettingsCopy);
|
|
|
setGroupSetting(groupSettings.slice());
|
|
|
setTimeout(function () {
|
|
|
return setGroupSetting(groupSettings.slice());
|
|
|
}, 10);
|
|
|
}
|
|
|
}), groupSettings.length < (workSetting === null || workSetting === void 0 || (_workSetting$group_se2 = workSetting.group_settings) === null || _workSetting$group_se2 === void 0 ? void 0 : _workSetting$group_se2.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(PlusCircleOutlined/* default */.Z, {
|
|
|
className: "c-green ml20",
|
|
|
style: {
|
|
|
position: 'absolute',
|
|
|
left: 20,
|
|
|
top: 4
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
console.log(groupSettings);
|
|
|
|
|
|
// if (isAssistant() && !classroomList.AssistantObject.practice?.can_publish) {
|
|
|
// message.warning('您未获取此权限,需向管理员申请权限才能使用此功能');
|
|
|
// return
|
|
|
// }
|
|
|
setGroupSetting(groupSettings.concat({}));
|
|
|
}
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}, k);
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 24,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "description",
|
|
|
label: "\u8D44\u6E90\u63CF\u8FF0\uFF1A",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
|
maxLength: 100,
|
|
|
placeholder: "\u8BF7\u5728\u6B64\u8F93\u5165\u8D44\u6E90\u63CF\u8FF0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",
|
|
|
rows: 6
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var OutLinkConfig = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var attachment = _ref4.attachment;
|
|
|
return {
|
|
|
attachment: attachment
|
|
|
};
|
|
|
})(OutLinkConfig_SetPublic));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Attachmentmodules = ({"flex_box_center":"flex_box_center___Q71DS","flex_space_between":"flex_space_between___TNuTq","flex_box_vertical_center":"flex_box_vertical_center___rhfhG","flex_box_center_end":"flex_box_center_end___MsQQ8","flex_box_column":"flex_box_column___MYvbv","bg":"bg___WkKTX","containerTitle":"containerTitle___x4her","containerDesc":"containerDesc___yNjjw","listItem":"listItem___pzdI9","info":"info___FH9ox","title":"title___TGy6D","titleLeft":"titleLeft___jaNs9","titleRight":"titleRight___X9mA2","acitons":"acitons___CPj4f","menu":"menu___Vr5C0","spanSize":"spanSize___hidB_","table":"table___UIeZ8","flexBox":"flexBox___VZsop","iconV":"iconV___bHhod"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/components/Send.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Send_PublishShixun = function PublishShixun(_ref) {
|
|
|
var _ref4;
|
|
|
var classroomList = _ref.classroomList,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
tableData = _useState2[0],
|
|
|
setTableData = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isRadio = _useState4[0],
|
|
|
setIsRadio = _useState4[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
new Promise( /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(resolve, reject) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: 'classroomList/getCoursesMine',
|
|
|
payload: {
|
|
|
id: params.id,
|
|
|
page_size: 50
|
|
|
}
|
|
|
}).then(function (result) {
|
|
|
setTableData(tableData.concat(result));
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x, _x2) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}());
|
|
|
}, [classroomList.name]);
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var groupIdsInitialValues = [];
|
|
|
if (classroomList.courseGroups.course_groups) classroomList.courseGroups.course_groups.map(function (v) {
|
|
|
return groupIdsInitialValues.push(v.id + '');
|
|
|
});
|
|
|
var disabledDate = function disabledDate(current) {
|
|
|
return current && current < dayjs_min_default()().startOf('day');
|
|
|
};
|
|
|
var columns = [{
|
|
|
title: '',
|
|
|
width: 40,
|
|
|
dataIndex: 'id',
|
|
|
key: 'id',
|
|
|
render: function render(id, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
value: String(id)
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '课堂名称',
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
width: 482,
|
|
|
ellipsis: true
|
|
|
}, {
|
|
|
title: '创建时间',
|
|
|
dataIndex: 'created_at',
|
|
|
key: 'created_at',
|
|
|
width: 130
|
|
|
}, {
|
|
|
title: '结束时间',
|
|
|
dataIndex: 'end_date',
|
|
|
key: 'end_date',
|
|
|
width: 130
|
|
|
}];
|
|
|
// console.log('------',);
|
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u53D1\u9001\u8D44\u6E90",
|
|
|
open: classroomList.actionTabs.key === '发送' ? true : false,
|
|
|
okText: "\u786E\u5B9A",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
width: 820,
|
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
height: '48px',
|
|
|
minHeight: '48px',
|
|
|
display: 'flex',
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
flex: '1',
|
|
|
textAlign: 'start'
|
|
|
},
|
|
|
children: ["\u53D1\u5E03\u72B6\u6001\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
value: isRadio,
|
|
|
onChange: function onChange(e) {
|
|
|
setIsRadio(e.target.value);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 1,
|
|
|
children: "\u53D1\u5E03"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: 0,
|
|
|
children: "\u4E0D\u53D1\u5E03"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var formValue, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
formValue = form.getFieldValue();
|
|
|
_context2.next = 3;
|
|
|
return (0,fetch/* default */.ZP)("/api/files/bulk_send.json", {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
ids: toConsumableArray_default()(classroomList.actionTabs.selectArrs),
|
|
|
to_course_ids: toConsumableArray_default()(formValue.group_ids),
|
|
|
course_id: params.id,
|
|
|
is_publish: isRadio
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context2.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('发送成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
type: "primary",
|
|
|
children: "\u786E\u8BA4"
|
|
|
})]
|
|
|
}),
|
|
|
bodyStyle: {
|
|
|
minHeight: 200
|
|
|
}
|
|
|
// onOk={async () => {
|
|
|
// const formValue = form.getFieldValue();
|
|
|
// const res = await Fetch(`/api/files/bulk_send.json`, {
|
|
|
// method: 'post',
|
|
|
// body: {
|
|
|
// ids: [...classroomList.actionTabs.selectArrs],
|
|
|
// to_course_ids: [...formValue.group_ids],
|
|
|
// course_id: params.id,
|
|
|
// },
|
|
|
// });
|
|
|
// if (res.status === 0) {
|
|
|
// message.success('发布成功');
|
|
|
// dispatch({
|
|
|
// type: 'classroomList/setActionTabs',
|
|
|
// payload: {},
|
|
|
// });
|
|
|
// }
|
|
|
// }}
|
|
|
,
|
|
|
onCancel: function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "tc bold mb20",
|
|
|
children: ["\u9009\u62E9\u7684\u8D44\u6E90\u53D1\u9001\u5230", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-orange",
|
|
|
children: "\u6307\u5B9A\u8BFE\u5802"
|
|
|
})]
|
|
|
}), classroomList.courseGroups.course_groups && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
initialValues: (_ref4 = {}, defineProperty_default()(_ref4, 'group_ids', groupIdsInitialValues), defineProperty_default()(_ref4, 'end_time', dayjs_min_default()(dayjs_min_default()().add(7, 'days').format('YYYY-MM-DD HH:mm'))), _ref4),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "group_ids",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
loading: loading['effects']['classroomList/getCourseGroups'],
|
|
|
columns: columns,
|
|
|
className: Attachmentmodules.table,
|
|
|
dataSource: tableData === null || tableData === void 0 ? void 0 : tableData.filter(function (item) {
|
|
|
return (item === null || item === void 0 ? void 0 : item.id) != params.id;
|
|
|
}),
|
|
|
scroll: {
|
|
|
y: 240
|
|
|
},
|
|
|
pagination: false
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Send = ((0,_umi_production_exports.connect)(function (_ref5) {
|
|
|
var classroomList = _ref5.classroomList,
|
|
|
loading = _ref5.loading;
|
|
|
return {
|
|
|
classroomList: classroomList,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(Send_PublishShixun));
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/components/TabMenu/index.tsx + 1 modules
|
|
|
var TabMenu = __webpack_require__(63989);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/components/SearchSortController/index.tsx + 1 modules
|
|
|
var SearchSortController = __webpack_require__(54957);
|
|
|
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx + 1 modules
|
|
|
var BottomControl = __webpack_require__(9046);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Attachment/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import CutOffNow from './components/CutOffNow';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ShixunsListPage = function ShixunsListPage(_ref) {
|
|
|
var _user$userInfo2, _detailLeftMenus$cour, _detailAttachmentList3;
|
|
|
var classroomList = _ref.classroomList,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
user = _ref.user,
|
|
|
dispatch = _ref.dispatch,
|
|
|
match = _ref.match;
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var param = (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)({
|
|
|
sort_type: 'publish_time',
|
|
|
sort: 'desc',
|
|
|
page_size: 20,
|
|
|
clazz: searchParams.get("tabs") === '0' ? '' : searchParams.get("tabs") === '1' ? '2' : searchParams.get("tabs") === '2' ? '3' : searchParams.get("tabs") === '3' ? '1' : ''
|
|
|
}),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
params = _useState2[0],
|
|
|
setParams = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(Array.from({
|
|
|
length: 20
|
|
|
}, function () {
|
|
|
return false;
|
|
|
})),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isshow = _useState4[0],
|
|
|
setisshow = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
lists = _useState6[0],
|
|
|
setlists = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
fileindex = _useState8[0],
|
|
|
setfileindex = _useState8[1];
|
|
|
var currenttime = new Date();
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
selectArrs = _useState10[0],
|
|
|
setSelectArrs = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)('发布时间降序排列'),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
SortMenuName = _useState12[0],
|
|
|
setSortMenuName = _useState12[1];
|
|
|
var detailAttachmentList = classroomList.detailAttachmentList,
|
|
|
detailLeftMenus = classroomList.detailLeftMenus,
|
|
|
detailTopBanner = classroomList.detailTopBanner;
|
|
|
var selectkey = searchParams.get("tabs") ? parseInt(searchParams.get("tabs")) : 0;
|
|
|
// 批量显隐状态
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
batchStatus = _useState14[0],
|
|
|
useBatchStatus = _useState14[1];
|
|
|
var userInfo = user.userInfo;
|
|
|
var courseModules;
|
|
|
params['course_id'] = param.coursesId;
|
|
|
if (param.categoryId) params['course_second_category_id'] = param.categoryId;else {
|
|
|
delete params['course_second_category_id'];
|
|
|
}
|
|
|
function getlist(_x, _x2) {
|
|
|
return _getlist.apply(this, arguments);
|
|
|
}
|
|
|
function _getlist() {
|
|
|
_getlist = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(id, k) {
|
|
|
var res, newlists;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
_context7.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/files/group_settings_statistics.json", {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
attachment_id: id,
|
|
|
course_id: param.course_id
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context7.sent;
|
|
|
newlists = toConsumableArray_default()(lists);
|
|
|
newlists[k] = res === null || res === void 0 ? void 0 : res.data;
|
|
|
setlists(newlists);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}));
|
|
|
return _getlist.apply(this, arguments);
|
|
|
}
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setisshow(Array.from({
|
|
|
length: 20
|
|
|
}, function () {
|
|
|
return false;
|
|
|
}));
|
|
|
setlists([]);
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _user$userInfo;
|
|
|
var localRecordValue = util/* localSort */.cX.getItem("".concat(user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login).concat((0,authority/* isAdmin */.GJ)() ? 'Teacher' : 'Student'), 'Attachment');
|
|
|
if (localRecordValue) {
|
|
|
params.sort_by = localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue.type;
|
|
|
params.sort_direction = localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue.direction;
|
|
|
console.log("localRecordValue", localRecordValue);
|
|
|
setSortMenuName(localRecordValue === null || localRecordValue === void 0 ? void 0 : localRecordValue.name);
|
|
|
}
|
|
|
getData();
|
|
|
}, [user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login, location.pathname]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (classroomList.actionTabs.key === '目录重命名成功') {
|
|
|
getData();
|
|
|
}
|
|
|
}, [classroomList.actionTabs.key]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setSelectArrs([]);
|
|
|
}, [detailAttachmentList]);
|
|
|
var onShowSizeChange = function onShowSizeChange(current, pageSize) {
|
|
|
setlists([]);
|
|
|
setisshow(Array.from({
|
|
|
length: 20
|
|
|
}, function () {
|
|
|
return false;
|
|
|
}));
|
|
|
params.page = current;
|
|
|
params.page_size = pageSize;
|
|
|
getData();
|
|
|
};
|
|
|
var getData = function getData() {
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
setSelectArrs([]);
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
};
|
|
|
var updateVisits = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(v) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!v.link) {
|
|
|
_context.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 3;
|
|
|
return dispatch({
|
|
|
type: 'attachment/updateVisits',
|
|
|
payload: {
|
|
|
id: v.id
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function updateVisits(_x3) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
if (detailLeftMenus.course_modules) {
|
|
|
courseModules = classroomList.detailLeftMenus.course_modules.filter(function (v) {
|
|
|
return v.type === 'attachment';
|
|
|
})[0];
|
|
|
}
|
|
|
var onMenuClick = /*#__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 (!(selectArrs == '')) {
|
|
|
_context2.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error('请选择你要操作的任务');
|
|
|
return _context2.abrupt("return");
|
|
|
case 3:
|
|
|
_context2.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/files/bulk_move.json", {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
course_id: param.course_id,
|
|
|
ids: selectArrs,
|
|
|
to_category_id: item === null || item === void 0 ? void 0 : item.key
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context2.sent;
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
dispatch({
|
|
|
type: 'classroomList/getAttachmentList',
|
|
|
payload: objectSpread2_default()({}, params)
|
|
|
});
|
|
|
setSelectArrs([]);
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function onMenuClick(_x4) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var getHref = function getHref(v) {
|
|
|
if (v.link) {
|
|
|
return v.link;
|
|
|
} else {
|
|
|
return env/* default */.Z.API_SERVER + v.url;
|
|
|
}
|
|
|
};
|
|
|
var actionsArr = [{
|
|
|
name: '删除',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-piliangshanchu2"
|
|
|
})
|
|
|
}, {
|
|
|
name: '发送',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-fasong"
|
|
|
})
|
|
|
}, {
|
|
|
name: '立即发布',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-fabu5"
|
|
|
})
|
|
|
}, {
|
|
|
name: '设为公开',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-sheweigongkai2"
|
|
|
})
|
|
|
}].filter(function (item) {
|
|
|
if (detailTopBanner.is_public) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return item.name !== '设为公开';
|
|
|
}
|
|
|
});
|
|
|
var Menus = [{
|
|
|
name: '全部',
|
|
|
id: '',
|
|
|
total: detailAttachmentList.total_count,
|
|
|
index: 0
|
|
|
}, {
|
|
|
name: '未发布',
|
|
|
id: '2',
|
|
|
total: (0,authority/* isAdmin */.GJ)() ? detailAttachmentList.unpublish_count : null,
|
|
|
index: 1
|
|
|
}, {
|
|
|
name: '未开始',
|
|
|
id: '3',
|
|
|
total: (0,authority/* isAdmin */.GJ)() ? detailAttachmentList.not_started_count : null,
|
|
|
index: 2
|
|
|
}, {
|
|
|
name: '已发布',
|
|
|
id: '1',
|
|
|
total: (0,authority/* isAdmin */.GJ)() ? detailAttachmentList.publish_count : null,
|
|
|
index: 3
|
|
|
}];
|
|
|
var SortMenus = [{
|
|
|
name: '默认排序',
|
|
|
type: '',
|
|
|
direction: ''
|
|
|
}, {
|
|
|
name: '创建时间降序排列',
|
|
|
type: 'created_on',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '创建时间升序排列',
|
|
|
type: 'created_on',
|
|
|
direction: 'asc'
|
|
|
}, {
|
|
|
name: '发布时间降序排列',
|
|
|
type: 'publish_time',
|
|
|
direction: 'desc'
|
|
|
}, {
|
|
|
name: '发布时间升序排列',
|
|
|
type: 'publish_time',
|
|
|
direction: 'asc'
|
|
|
}];
|
|
|
var columns = [{
|
|
|
title: '班级',
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
width: 240
|
|
|
},
|
|
|
// {
|
|
|
// title: '状态',
|
|
|
// dataIndex: 'status',
|
|
|
// key: 'status',
|
|
|
// width: 80,
|
|
|
// render: (v:any,record:any) => currenttime < moment(record.publish_time).toDate() ? '未开始':'已发布'
|
|
|
// },
|
|
|
{
|
|
|
title: '状态',
|
|
|
dataIndex: 'status',
|
|
|
key: 'status',
|
|
|
width: 80,
|
|
|
filters: [{
|
|
|
text: '未开始',
|
|
|
value: '未开始'
|
|
|
}, {
|
|
|
text: '已发布',
|
|
|
value: '已发布'
|
|
|
}],
|
|
|
onFilter: function onFilter(value, record) {
|
|
|
return record.status.indexOf(value) === 0;
|
|
|
}
|
|
|
}, {
|
|
|
title: '发布时间',
|
|
|
dataIndex: 'publish_time',
|
|
|
key: 'publish_time',
|
|
|
width: 200,
|
|
|
sorter: true,
|
|
|
showSorterTooltip: false,
|
|
|
sortOrder: params.order_by === 'publish_time' ? params.sort_direction === 'desc' ? 'descend' : 'ascend' : null,
|
|
|
render: function render(v) {
|
|
|
return v ? dayjs_min_default()(v).format("YYYY-MM-DD HH:mm") : '--';
|
|
|
}
|
|
|
}, {
|
|
|
title: '分班老师',
|
|
|
dataIndex: 'member_manager',
|
|
|
key: 'member_manager',
|
|
|
// width: 240,
|
|
|
ellipsis: {
|
|
|
showTitle: false
|
|
|
},
|
|
|
render: function render(v) {
|
|
|
return v === '--' || !v ? '--' : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
title: v,
|
|
|
children: v
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var onMenuSelect = function onMenuSelect(v) {
|
|
|
console.log(v.key);
|
|
|
if (v.key === '0' || v.key === '1' || v.key === '2') {
|
|
|
params.sort_type = 'created_on';
|
|
|
params.sort = 'desc';
|
|
|
setSortMenuName('创建时间降序排列');
|
|
|
}
|
|
|
if (v.key === '3') {
|
|
|
params.sort_type = 'publish_time';
|
|
|
params.sort = 'desc';
|
|
|
setSortMenuName('发布时间降序排列');
|
|
|
}
|
|
|
params.clazz = Menus[v.key]['id'];
|
|
|
params.page = 1;
|
|
|
_umi_production_exports.history.replace("".concat(location.pathname, "?tabs=").concat(v.key));
|
|
|
|
|
|
// let selectkey=searchParams.get("tabs");
|
|
|
setisshow(Array.from({
|
|
|
length: 20
|
|
|
}, function () {
|
|
|
return false;
|
|
|
}));
|
|
|
setlists([]);
|
|
|
getData();
|
|
|
};
|
|
|
var handleMenuChange = function handleMenuChange(item) {
|
|
|
var _user$userInfo3;
|
|
|
params.sort_type = item.type;
|
|
|
params.sort = item.direction;
|
|
|
params.page = 1;
|
|
|
util/* localSort */.cX.setItem("".concat(user === null || user === void 0 || (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login).concat((0,authority/* isAdmin */.GJ)() ? 'Teacher' : 'Student'), item, 'Attachment');
|
|
|
setSortMenuName(item.name);
|
|
|
getData();
|
|
|
};
|
|
|
var handleBottomControlClick = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(item) {
|
|
|
var val, _detailAttachmentList;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
val = item.name;
|
|
|
if (selectArrs == '') {
|
|
|
message/* default */.ZP.error('请选择你要操作的任务');
|
|
|
} else {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: val,
|
|
|
selectArrs: selectArrs,
|
|
|
selectArrsAll: (_detailAttachmentList = detailAttachmentList.files) === null || _detailAttachmentList === void 0 ? void 0 : _detailAttachmentList.filter(function (item) {
|
|
|
return selectArrs.includes(item.id);
|
|
|
}),
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleBottomControlClick(_x5) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabMenu/* default */.Z, {
|
|
|
isLoading: loading['classroomList/getAttachmentList'],
|
|
|
tabDataSource: (0,authority/* isAdmin */.GJ)() ? Menus : [],
|
|
|
isAdmin: (0,authority/* isAdmin */.GJ)(),
|
|
|
onTabMenuClick: onMenuSelect,
|
|
|
defaultSelectedKeys: [selectkey + ''],
|
|
|
showControlButton: (0,authority/* isAdmin */.GJ)(),
|
|
|
buttonText: "\u9009\u7528\u8D44\u6E90",
|
|
|
extraNode: (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
className: "mr20",
|
|
|
children: [!(detailAttachmentList !== null && detailAttachmentList !== void 0 && detailAttachmentList.parent_category_id) && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue font16 ml20 current",
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '新建目录'
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u65B0\u5EFA\u5B50\u76EE\u5F55",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xinjianmulu1 font14"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-blue font16 ml20 current",
|
|
|
style: {
|
|
|
paddingTop: 2
|
|
|
},
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '目录重命名',
|
|
|
params: params,
|
|
|
selectArrs: objectSpread2_default()(objectSpread2_default()({}, detailAttachmentList), {}, {
|
|
|
category_id: params === null || params === void 0 ? void 0 : params.course_second_category_id,
|
|
|
main_id: typeof_default()(detailAttachmentList.parent_category_id) === 'object' ? detailAttachmentList.id : undefined
|
|
|
}),
|
|
|
cb: getData
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u76EE\u5F55\u91CD\u547D\u540D",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-zhongmingming1 font17"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-blue font14 ml20 current",
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {
|
|
|
key: '上传资源',
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shangchuan3 font14 mr5"
|
|
|
}), "\u4E0A\u4F20\u8D44\u6E90"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-blue font14 ml20 current",
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {
|
|
|
key: '添加外链',
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-lianjie2 font14 mr5"
|
|
|
}), "\u6DFB\u52A0\u5916\u94FE"]
|
|
|
})]
|
|
|
}),
|
|
|
onButtonClick: function onButtonClick() {
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {
|
|
|
key: '选用资源',
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SearchSortController/* default */.Z, {
|
|
|
dataSource: detailAttachmentList.files || [],
|
|
|
isAdmin: (0,authority/* isAdmin */.GJ)(),
|
|
|
batchStatus: batchStatus,
|
|
|
SortMenuName: SortMenuName,
|
|
|
setSortMenuName: setSortMenuName,
|
|
|
SortMenus: SortMenus,
|
|
|
onSearch: function onSearch(value) {
|
|
|
params.search = value;
|
|
|
params.page = 1;
|
|
|
getData();
|
|
|
},
|
|
|
onSort: handleMenuChange,
|
|
|
onBatch: function onBatch(status) {
|
|
|
return useBatchStatus(status);
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
|
loading: loading['classroomList/getAttachmentList'],
|
|
|
active: true,
|
|
|
avatar: {
|
|
|
size: 40
|
|
|
},
|
|
|
paragraph: {
|
|
|
rows: 5
|
|
|
},
|
|
|
className: "mt30",
|
|
|
children: [detailAttachmentList.total_count === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), detailAttachmentList.files && detailAttachmentList.files.map(function (v, k) {
|
|
|
var _lists$k, _lists$k2, _lists$k3;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Attachmentmodules.listItem,
|
|
|
children: [(0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
checked: selectArrs.includes(v.id),
|
|
|
value: v.id,
|
|
|
className: "mr20",
|
|
|
onChange: function onChange(e) {
|
|
|
var key = selectArrs.indexOf(v.id);
|
|
|
if (selectArrs.indexOf(v.id) > -1) {
|
|
|
setSelectArrs(selectArrs.filter(function (val) {
|
|
|
return val !== v.id;
|
|
|
}));
|
|
|
} else {
|
|
|
setSelectArrs(selectArrs.concat(v.id));
|
|
|
}
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Attachmentmodules.info,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Attachmentmodules.title,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Attachmentmodules.titleLeft,
|
|
|
children: [(0,authority/* isAdminOrStudent */.RV)() || v.is_public ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: function onClick(e) {
|
|
|
updateVisits(v);
|
|
|
debugger;
|
|
|
if (v.link || v.content_type === 'application/pdf') return;
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {
|
|
|
key: v.link ? '资源下载' : '资源下载',
|
|
|
selectArrs: v,
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
// if (v.link || v.content_type === 'application/pdf') return;
|
|
|
// preview.type = v.file_type
|
|
|
// preview.data = ENV.IMG_SERVER + v.url
|
|
|
// setPreview({ ...preview })
|
|
|
},
|
|
|
|
|
|
href: getHref(v),
|
|
|
target: "_blank",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: v.title
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: v.title
|
|
|
}), v.link && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "tag-style-border-small c-orange border-orange ml10",
|
|
|
children: [' ', "\u5916\u94FE", ' ']
|
|
|
}), v.is_publish && v.publish_status && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "tag-style bg-light-blue ml10",
|
|
|
children: "\u5DF2\u53D1\u5E03"
|
|
|
}), v.is_publish && !v.publish_status && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "tag-style bg-c5d6ff ml10soft",
|
|
|
children: "\u672A\u5F00\u59CB"
|
|
|
}), !v.is_publish && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "tag-style bgB8B8B8 ml10soft",
|
|
|
children: "\u672A\u53D1\u5E03"
|
|
|
}), (0,authority/* isAdmin */.GJ)() && !v.link && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u4E0B\u8F7D",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xiazai6",
|
|
|
style: {
|
|
|
marginLeft: 10,
|
|
|
fontSize: 14,
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
(0,util/* downLoadLink */.Nd)((v === null || v === void 0 ? void 0 : v.title) || 'educoder', decodeURIComponent(env/* default */.Z.API_SERVER + v.url));
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Attachmentmodules.titleRight,
|
|
|
children: [(0,authority/* isAdmin */.GJ)() && !(v !== null && v !== void 0 && v.is_publish) && /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
target: "_blank",
|
|
|
to: "/",
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(e) {
|
|
|
var arr;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '立即发布',
|
|
|
index: k,
|
|
|
selectArrs: [v === null || v === void 0 ? void 0 : v.id],
|
|
|
selectArrsAll: [v],
|
|
|
params: params,
|
|
|
type: 2,
|
|
|
manage_all_group: detailAttachmentList === null || detailAttachmentList === void 0 ? void 0 : detailAttachmentList.manage_all_group
|
|
|
}
|
|
|
});
|
|
|
arr = toConsumableArray_default()(isshow);
|
|
|
arr[k] = false;
|
|
|
setisshow(arr);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function (_x6) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: Attachmentmodules.flexBox,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-yishezhifabushijian1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u53D1\u5E03"
|
|
|
})]
|
|
|
})
|
|
|
}), (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
placement: "bottomCenter",
|
|
|
overlayClassName: Attachmentmodules.dro,
|
|
|
dropdownRender: function dropdownRender() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
style: {
|
|
|
textAlign: 'center'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(e) {
|
|
|
var arr;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '立即发布',
|
|
|
index: k,
|
|
|
selectArrs: [v === null || v === void 0 ? void 0 : v.id],
|
|
|
selectArrsAll: [v],
|
|
|
params: params,
|
|
|
type: 2,
|
|
|
manage_all_group: detailAttachmentList === null || detailAttachmentList === void 0 ? void 0 : detailAttachmentList.manage_all_group
|
|
|
}
|
|
|
});
|
|
|
arr = toConsumableArray_default()(isshow);
|
|
|
arr[k] = false;
|
|
|
setisshow(arr);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function (_x7) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: "\u7ACB\u5373\u53D1\u5E03"
|
|
|
})
|
|
|
}, 1), /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
style: {
|
|
|
textAlign: 'center'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
target: "_blank",
|
|
|
to: "/",
|
|
|
onClick: function onClick(e) {
|
|
|
var _detailAttachmentList2;
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {
|
|
|
key: '删除',
|
|
|
selectArrs: [v.id],
|
|
|
selectArrsAll: (_detailAttachmentList2 = detailAttachmentList.files) === null || _detailAttachmentList2 === void 0 ? void 0 : _detailAttachmentList2.filter(function (item) {
|
|
|
return [v.id].includes(item.id);
|
|
|
}),
|
|
|
isdelete: '1',
|
|
|
params: params
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
children: "\u7ACB\u5373\u5220\u9664"
|
|
|
})
|
|
|
}, 22), /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
style: {
|
|
|
textAlign: 'center'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
onClick: function onClick(e) {
|
|
|
e.preventDefault();
|
|
|
dispatch({
|
|
|
type: 'attachment/setActionTabs',
|
|
|
payload: {
|
|
|
key: v.link ? '外链设置' : '资源设置',
|
|
|
index: k,
|
|
|
selectArrs: v,
|
|
|
params: params,
|
|
|
manage_all_group: detailAttachmentList === null || detailAttachmentList === void 0 ? void 0 : detailAttachmentList.manage_all_group
|
|
|
}
|
|
|
});
|
|
|
var arr = toConsumableArray_default()(isshow);
|
|
|
arr[k] = false;
|
|
|
setisshow(arr);
|
|
|
},
|
|
|
to: "/",
|
|
|
children: "\u8D44\u6E90\u8BBE\u7F6E"
|
|
|
})
|
|
|
}, 6)]
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
onClick: function onClick(e) {
|
|
|
return e.stopPropagation();
|
|
|
},
|
|
|
className: Attachmentmodules.flexBox,
|
|
|
style: {
|
|
|
marginRight: 6,
|
|
|
cursor: 'default'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-gengduo4"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u66F4\u591A"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-wrp",
|
|
|
children: [v.link && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "flex1",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: v.author.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml15",
|
|
|
children: ["\u70B9\u51FB\u6B21\u6570\uFF1A", v.downloads_count]
|
|
|
}), currenttime < dayjs_min_default()(v === null || v === void 0 ? void 0 : v.publish_time).toDate() && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml15",
|
|
|
children: [" \u5C06\u4E8E ", dayjs_min_default()(v === null || v === void 0 ? void 0 : v.publish_time).format("YYYY-MM-DD HH:mm"), " \u53D1\u5E03 "]
|
|
|
})]
|
|
|
})
|
|
|
}), !v.link && /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "flex1",
|
|
|
children: [v.folder_name ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#888',
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: ["\u6240\u5C5E\u76EE\u5F55\uFF1A", v.folder_name && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: v.folder_name
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#888',
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: "\u6240\u5C5E\u76EE\u5F55\uFF1A\u65E0"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u4E0A\u4F20\u4EBA\uFF1A", v.author.name]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml15",
|
|
|
children: [" \u5927\u5C0F\uFF1A", v.filesize, " "]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml15",
|
|
|
children: [" \u4E0B\u8F7D\u6570\uFF1A", v.downloads_count, " "]
|
|
|
}), currenttime < dayjs_min_default()(v === null || v === void 0 ? void 0 : v.publish_time).toDate() && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml15",
|
|
|
children: [" \u5C06\u4E8E ", dayjs_min_default()(v === null || v === void 0 ? void 0 : v.publish_time).format("YYYY-MM-DD HH:mm"), " \u53D1\u5E03 "]
|
|
|
}), (0,authority/* isStudent */.dE)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "ml15",
|
|
|
children: ["\u53D1\u5E03\u65F6\u95F4\uFF1A", dayjs_min_default()(v === null || v === void 0 ? void 0 : v.publish_time).format("YYYY-MM-DD HH:mm")]
|
|
|
})]
|
|
|
}), (v === null || v === void 0 ? void 0 : v.is_publish) && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: Attachmentmodules.iconV,
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(e) {
|
|
|
var arr;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
if (!isshow[k]) {
|
|
|
getlist(v === null || v === void 0 ? void 0 : v.id, k);
|
|
|
}
|
|
|
arr = toConsumableArray_default()(isshow);
|
|
|
arr[k] = !arr[k];
|
|
|
setisshow(arr);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function (_x8) {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-".concat(isshow[k] ? 'shouqi' : 'xiala2')
|
|
|
}), ' ']
|
|
|
})]
|
|
|
}), (0,authority/* isAdmin */.GJ)() && (v === null || v === void 0 ? void 0 : v.is_publish) && isshow[k] && ((_lists$k = lists[k]) === null || _lists$k === void 0 ? void 0 : _lists$k.length) > 5 && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
rowKey: "shixun_identifier",
|
|
|
scroll: {
|
|
|
y: 240
|
|
|
},
|
|
|
onRow: function onRow(e) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
onHeaderRow: function onHeaderRow(columns, index) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
} // 点击表头行
|
|
|
};
|
|
|
},
|
|
|
|
|
|
pagination: false,
|
|
|
dataSource: lists[k],
|
|
|
style: {
|
|
|
marginTop: 14,
|
|
|
marginRight: 6,
|
|
|
cursor: 'default'
|
|
|
},
|
|
|
onChange: function onChange(a, b, c) {
|
|
|
if (c.field) params.order_by = c.field;
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'ascend') params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'descend') params['sort_direction'] = 'desc';
|
|
|
// if (!c.order) delete params['b_order'];
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
getlist(v === null || v === void 0 ? void 0 : v.id, k);
|
|
|
},
|
|
|
columns: columns
|
|
|
}), (0,authority/* isAdmin */.GJ)() && (v === null || v === void 0 ? void 0 : v.is_publish) && isshow[k] && ((_lists$k2 = lists[k]) === null || _lists$k2 === void 0 ? void 0 : _lists$k2.length) > 0 && ((_lists$k3 = lists[k]) === null || _lists$k3 === void 0 ? void 0 : _lists$k3.length) < 6 && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
rowKey: "shixun_identifier",
|
|
|
onRow: function onRow(e) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
onHeaderRow: function onHeaderRow(columns, index) {
|
|
|
return {
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
} // 点击表头行
|
|
|
};
|
|
|
},
|
|
|
|
|
|
pagination: false,
|
|
|
dataSource: lists[k],
|
|
|
style: {
|
|
|
marginTop: 14,
|
|
|
marginRight: 6,
|
|
|
cursor: 'default'
|
|
|
},
|
|
|
onChange: function onChange(a, b, c) {
|
|
|
if (c.field) params.order_by = c.field;
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'ascend') params['sort_direction'] = 'asc';
|
|
|
if (c.order === 'descend') params['sort_direction'] = 'desc';
|
|
|
// if (!c.order) delete params['b_order'];
|
|
|
if (!c.order) params['sort_direction'] = 'asc';
|
|
|
getlist(v === null || v === void 0 ? void 0 : v.id, k);
|
|
|
},
|
|
|
columns: columns
|
|
|
}), v.description && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "flex-wrp",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "flex1",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: " \u8D44\u6E90\u63CF\u8FF0\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml15",
|
|
|
children: v.description || '暂无描述'
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}, k);
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "tc mb50 mt30",
|
|
|
children: detailAttachmentList.attachments_count > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z
|
|
|
// hideOnSinglePage
|
|
|
, {
|
|
|
current: params.page || 1,
|
|
|
showSizeChanger: true,
|
|
|
onChange: onShowSizeChange,
|
|
|
defaultCurrent: 1,
|
|
|
pageSize: params.page_size || 20,
|
|
|
total: detailAttachmentList.attachments_count
|
|
|
})
|
|
|
})]
|
|
|
}), selectArrs.length > 0 && (0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(affix/* default */.Z, {
|
|
|
offsetBottom: 0,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(BottomControl/* default */.Z, {
|
|
|
buttonDataSource: actionsArr,
|
|
|
onButtonClick: handleBottomControlClick,
|
|
|
useBatchStatus: useBatchStatus,
|
|
|
catalogue: (detailLeftMenus === null || detailLeftMenus === void 0 || (_detailLeftMenus$cour = detailLeftMenus.course_modules) === null || _detailLeftMenus$cour === void 0 || (_detailLeftMenus$cour = _detailLeftMenus$cour.find(function (v) {
|
|
|
return v.type === "attachment";
|
|
|
})) === null || _detailLeftMenus$cour === void 0 ? void 0 : _detailLeftMenus$cour.second_category) || [],
|
|
|
allSelect: selectArrs.length ? selectArrs.length === ((_detailAttachmentList3 = detailAttachmentList.files) === null || _detailAttachmentList3 === void 0 ? void 0 : _detailAttachmentList3.length) : false,
|
|
|
setSeleArr: setSelectArrs,
|
|
|
setAllSelect: function setAllSelect(e) {
|
|
|
if (e.target.checked) {
|
|
|
setSelectArrs(detailAttachmentList.files.map(function (v) {
|
|
|
return v.id;
|
|
|
}));
|
|
|
} else {
|
|
|
setSelectArrs([]);
|
|
|
}
|
|
|
},
|
|
|
selectArrs: selectArrs,
|
|
|
onMenuClick: onMenuClick
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(DelCompontent, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Publish, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(PublishResoure, {
|
|
|
getFileData: getData
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_SetPublic, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Send, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(AddCategory, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(CategoryRename, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(SelectAttchment, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Upload, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(ExternalLinks, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(Config, {
|
|
|
getFileData: getData
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Download/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(OutLinkConfig, {
|
|
|
getFileData: getData
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Attachment = ((0,_umi_production_exports.connect)(function (_ref8) {
|
|
|
var classroomList = _ref8.classroomList,
|
|
|
loading = _ref8.loading,
|
|
|
user = _ref8.user,
|
|
|
globalSetting = _ref8.globalSetting;
|
|
|
return {
|
|
|
classroomList: classroomList,
|
|
|
globalSetting: globalSetting,
|
|
|
user: user,
|
|
|
loading: loading.effects
|
|
|
};
|
|
|
})(ShixunsListPage));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 9046:
|
|
|
/*!***********************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx + 1 modules ***!
|
|
|
\***********************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_BottomControl; }
|
|
|
});
|
|
|
|
|
|
// 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/_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/menu/index.js + 11 modules
|
|
|
var es_menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var BottomControlmodules = ({"bottomControlContainer":"bottomControlContainer___woAeo","buttonWrap":"buttonWrap___iRw4K","moveCategory":"moveCategory___oiQqw"});
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(76107);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
|
var DownOutlined = __webpack_require__(42884);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/BottomControl/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var BottomControl = function BottomControl(_ref) {
|
|
|
var buttonDataSource = _ref.buttonDataSource,
|
|
|
onButtonClick = _ref.onButtonClick,
|
|
|
useBatchStatus = _ref.useBatchStatus,
|
|
|
allSelect = _ref.allSelect,
|
|
|
setAllSelect = _ref.setAllSelect,
|
|
|
selectArrs = _ref.selectArrs,
|
|
|
onMenuClick = _ref.onMenuClick,
|
|
|
setSeleArr = _ref.setSeleArr,
|
|
|
catalogue = _ref.catalogue,
|
|
|
addCatalogue = _ref.addCatalogue;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
moveVisible = _useState2[0],
|
|
|
setMoveVisible = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
keyword = _useState4[0],
|
|
|
setKeyword = _useState4[1];
|
|
|
console.log('---', catalogue);
|
|
|
var menu = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: BottomControlmodules.moveCategory,
|
|
|
onMouseLeave: function onMouseLeave(e) {
|
|
|
return setMoveVisible(false);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_menu/* default */.Z, {
|
|
|
onClick: onMenuClick,
|
|
|
style: {
|
|
|
maxHeight: 300,
|
|
|
width: 240,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: "ant-menu-item multi-llipsis1e ant-menu-item-only-child",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
onChange: function onChange(e) {
|
|
|
setKeyword(e.target.value);
|
|
|
}
|
|
|
})
|
|
|
}), catalogue === null || catalogue === void 0 ? void 0 : catalogue.map(function (item, key) {
|
|
|
var _item$third_category;
|
|
|
if (keyword !== '' && item.category_name.indexOf(keyword) < 0) {
|
|
|
return;
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
className: "multi-llipsis1e",
|
|
|
children: item.category_name
|
|
|
}, item.category_id), item === null || item === void 0 || (_item$third_category = item.third_category) === null || _item$third_category === void 0 ? void 0 : _item$third_category.map(function (val) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
className: "multi-llipsis1e",
|
|
|
children: val.category_name
|
|
|
}, val.category_id);
|
|
|
})]
|
|
|
});
|
|
|
}), addCatalogue && /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: "ant-menu-item multi-llipsis1e ant-menu-item-only-child",
|
|
|
onClick: addCatalogue,
|
|
|
children: "\u65B0\u5EFA\u5B50\u76EE\u5F55..."
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: BottomControlmodules.bottomControlContainer,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
|
|
|
checked: allSelect,
|
|
|
onChange: setAllSelect,
|
|
|
children: ["\u5168\u9009\u672C\u9875\uFF08", selectArrs.length, "\uFF09"]
|
|
|
})
|
|
|
}), (0,authority/* isAdmin */.GJ)() && buttonDataSource.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
icon: item.icon,
|
|
|
className: BottomControlmodules.buttonWrap,
|
|
|
onClick: function onClick() {
|
|
|
return onButtonClick(item);
|
|
|
},
|
|
|
children: item.name
|
|
|
})
|
|
|
}, item.name);
|
|
|
}), (0,authority/* isAdmin */.GJ)() && (addCatalogue || catalogue) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
open: moveVisible,
|
|
|
placement: "topLeft",
|
|
|
autoAdjustOverflow: false,
|
|
|
dropdownRender: function dropdownRender() {
|
|
|
return menu;
|
|
|
},
|
|
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
|
return trigger.parentNode;
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ant-dropdown-link",
|
|
|
onMouseEnter: function onMouseEnter(e) {
|
|
|
return setMoveVisible(true);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: BottomControlmodules.buttonWrap,
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-yidongmulu"
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u79FB\u52A8\u5230\u76EE\u5F55 ", /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {})]
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
onClick: function onClick() {
|
|
|
useBatchStatus(false);
|
|
|
setSeleArr([]);
|
|
|
},
|
|
|
children: "\u53D6\u6D88\u64CD\u4F5C"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_BottomControl = (BottomControl);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 54957:
|
|
|
/*!******************************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/components/SearchSortController/index.tsx + 1 modules ***!
|
|
|
\******************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_SearchSortController; }
|
|
|
});
|
|
|
|
|
|
// 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/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// 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/_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/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
// 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/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/SearchSortController/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var SearchSortControllermodules = ({"searchSortControllerContainer":"searchSortControllerContainer___Xca1m","btn":"btn___sNJPX","btnSort":"btnSort___Fx9OM","tips":"tips___LrmpR"});
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(76107);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/UpOutlined.js + 1 modules
|
|
|
var UpOutlined = __webpack_require__(20114);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
|
var DownOutlined = __webpack_require__(42884);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-infinite-scroller@1.2.4@react-infinite-scroller/index.js
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller = __webpack_require__(26724);
|
|
|
var _react_infinite_scroller_1_2_4_react_infinite_scroller_default = /*#__PURE__*/__webpack_require__.n(_react_infinite_scroller_1_2_4_react_infinite_scroller);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(66660);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/SearchSortController/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SearchSortController = function SearchSortController(_ref) {
|
|
|
var isAdmin = _ref.isAdmin,
|
|
|
dataSource = _ref.dataSource,
|
|
|
batchStatus = _ref.batchStatus,
|
|
|
SortMenuName = _ref.SortMenuName,
|
|
|
setSortMenuName = _ref.setSortMenuName,
|
|
|
detailCourseGroupsList = _ref.detailCourseGroupsList,
|
|
|
onSearch = _ref.onSearch,
|
|
|
onBoard = _ref.onBoard,
|
|
|
onSort = _ref.onSort,
|
|
|
isboard = _ref.isboard,
|
|
|
dispatch = _ref.dispatch,
|
|
|
onBatch = _ref.onBatch,
|
|
|
SortMenus = _ref.SortMenus;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
submenuVisible = _useState2[0],
|
|
|
setSubmenuVisible = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
selectArrs = _useState4[0],
|
|
|
setSelectArrs = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
hasMore = _useState6[0],
|
|
|
setHasmore = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
tableData = _useState8[0],
|
|
|
setTableData = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
page = _useState10[0],
|
|
|
setPage = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
isLoading = _useState12[0],
|
|
|
setIsLoading = _useState12[1];
|
|
|
var paramsFromRouter = (0,_umi_production_exports.useParams)();
|
|
|
/**
|
|
|
* 排序点击事件
|
|
|
*/
|
|
|
var sortClick = function sortClick(data) {
|
|
|
setSortMenuName(data.name);
|
|
|
onSort(data);
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (isboard) {
|
|
|
handleInfiniteOnLoad();
|
|
|
}
|
|
|
}, [isboard]);
|
|
|
var handleInfiniteOnLoad = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _res$course_groups, res, items;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!(hasMore && !isLoading)) {
|
|
|
_context.next = 10;
|
|
|
break;
|
|
|
}
|
|
|
setIsLoading(true);
|
|
|
setPage(page + 1);
|
|
|
_context.next = 5;
|
|
|
return dispatch({
|
|
|
type: 'classroomList/getCourseGroupsList',
|
|
|
payload: {
|
|
|
page: page,
|
|
|
id: paramsFromRouter.coursesId,
|
|
|
limit: 20,
|
|
|
nonenavigate: true
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context.sent;
|
|
|
items = toConsumableArray_default()((res === null || res === void 0 ? void 0 : res.course_groups) || []);
|
|
|
if ((res === null || res === void 0 || (_res$course_groups = res.course_groups) === null || _res$course_groups === void 0 ? void 0 : _res$course_groups.length) < 20) {
|
|
|
setHasmore(false);
|
|
|
items.push({
|
|
|
id: 0,
|
|
|
name: '未分班'
|
|
|
});
|
|
|
}
|
|
|
setIsLoading(false);
|
|
|
setTableData([].concat(toConsumableArray_default()(tableData), toConsumableArray_default()(items)));
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleInfiniteOnLoad() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var submenu = /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: SearchSortControllermodules.dropmenu,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
maxHeight: 200,
|
|
|
overflow: 'auto'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)((_react_infinite_scroller_1_2_4_react_infinite_scroller_default()), {
|
|
|
initialLoad: false,
|
|
|
pageStart: 1,
|
|
|
threshold: 20,
|
|
|
loadMore: function loadMore(page) {
|
|
|
handleInfiniteOnLoad();
|
|
|
},
|
|
|
hasMore: hasMore,
|
|
|
useWindow: false,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
|
|
|
style: {
|
|
|
width: 240,
|
|
|
zIndex: 10
|
|
|
},
|
|
|
children: (detailCourseGroupsList === null || detailCourseGroupsList === void 0 ? void 0 : detailCourseGroupsList.group_count) > 0 && (tableData === null || tableData === void 0 ? void 0 : tableData.filter(function (item) {
|
|
|
return item.edit_auth || item.name === '未分班';
|
|
|
}).map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
checked: selectArrs.includes(item.id),
|
|
|
value: item.id,
|
|
|
onChange: function onChange(e) {
|
|
|
var key = selectArrs.indexOf(item.id);
|
|
|
if (selectArrs.indexOf(item.id) > -1) {
|
|
|
setSelectArrs(selectArrs.filter(function (val) {
|
|
|
return val !== item.id;
|
|
|
}));
|
|
|
} else {
|
|
|
setSelectArrs(selectArrs.concat(item.id));
|
|
|
}
|
|
|
},
|
|
|
children: item.name
|
|
|
})
|
|
|
}, item.id);
|
|
|
}))
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
style: {
|
|
|
background: "#fff"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "link",
|
|
|
onClick: function onClick() {
|
|
|
// if (selectArrs == '') {
|
|
|
// message.error('请选择你要操作的任务');
|
|
|
// return null;
|
|
|
// }
|
|
|
onBoard(selectArrs);
|
|
|
// params.group_ids = selectArrs;
|
|
|
// params.page = 1;
|
|
|
// setparams({ ...params })
|
|
|
},
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "link",
|
|
|
onClick: function onClick() {
|
|
|
setSelectArrs([]);
|
|
|
},
|
|
|
children: "\u91CD\u7F6E"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
// 默认排序
|
|
|
var isDefault = SortMenuName === '默认排序';
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: SearchSortControllermodules.searchSortControllerContainer,
|
|
|
children: [!!(SortMenus !== null && SortMenus !== void 0 && SortMenus.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
dropdownRender: function dropdownRender() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
|
|
|
selectedKeys: [SortMenuName],
|
|
|
children: SortMenus.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return sortClick(item);
|
|
|
},
|
|
|
children: item.name
|
|
|
}, item.name);
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "".concat(SearchSortControllermodules.btn, " ").concat(isDefault ? SearchSortControllermodules.btnSort : ''),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-paixu font14 mr5"
|
|
|
}), SortMenuName]
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), isDefault && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u4F18\u5148\u6309\u7167\u8C03\u6574\u6392\u5E8F\u7ED3\u679C\u5C55\u793A\uFF0C\u672A\u8BBE\u7F6E\u6392\u5E8F\u65F6\uFF0C\u6309\u7167\u521B\u5EFA\u65F6\u95F4\u964D\u5E8F\u6392\u5217",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: SearchSortControllermodules.tips,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-a-wenhaobeifen2"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
allowClear: true,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
|
onSearch: onSearch,
|
|
|
style: {
|
|
|
width: 220,
|
|
|
marginLeft: 'auto',
|
|
|
marginRight: 10
|
|
|
}
|
|
|
}), (0,authority/* isAdmins */.eB)() && isboard && /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
dropdownRender: function dropdownRender() {
|
|
|
return submenu;
|
|
|
},
|
|
|
open: submenuVisible,
|
|
|
onOpenChange: function onOpenChange(flag) {
|
|
|
setSubmenuVisible(flag);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
children: ["\u5206\u73ED", submenuVisible ? /*#__PURE__*/(0,jsx_runtime.jsx)(UpOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
marginLeft: 6
|
|
|
}
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
marginLeft: 6
|
|
|
}
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_SearchSortController = (SearchSortController);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 63989:
|
|
|
/*!*****************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/components/TabMenu/index.tsx + 1 modules ***!
|
|
|
\*****************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_TabMenu; }
|
|
|
});
|
|
|
|
|
|
// 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/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
|
var col = __webpack_require__(43604);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/TabMenu/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var TabMenumodules = ({"tabMenuContainer":"tabMenuContainer___uf5IP","control":"control___GheLs","iconH":"iconH___Wzw_r","selectBtn":"selectBtn___mfEnI"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/components/TabMenu/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabMenu = function TabMenu(_ref) {
|
|
|
var isLoading = _ref.isLoading,
|
|
|
addText = _ref.addText,
|
|
|
tabDataSource = _ref.tabDataSource,
|
|
|
isAdmin = _ref.isAdmin,
|
|
|
defaultSelectedKeys = _ref.defaultSelectedKeys,
|
|
|
onTabMenuClick = _ref.onTabMenuClick,
|
|
|
getDropdownMenu = _ref.getDropdownMenu,
|
|
|
showControlButton = _ref.showControlButton,
|
|
|
buttonText = _ref.buttonText,
|
|
|
_ref$buttonIcon = _ref.buttonIcon,
|
|
|
buttonIcon = _ref$buttonIcon === void 0 ? 'icon-tianjiadaohang' : _ref$buttonIcon,
|
|
|
extraNode = _ref.extraNode,
|
|
|
_ref$onButtonClick = _ref.onButtonClick,
|
|
|
onButtonClick = _ref$onButtonClick === void 0 ? function () {} : _ref$onButtonClick;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: TabMenumodules.tabMenuContainer,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(menu/* default */.Z, {
|
|
|
onSelect: function onSelect(v) {
|
|
|
return !isLoading ? onTabMenuClick(v) : {};
|
|
|
},
|
|
|
mode: "horizontal",
|
|
|
selectedKeys: defaultSelectedKeys,
|
|
|
children: tabDataSource.map(function (item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-666",
|
|
|
children: item.name
|
|
|
}), item.total !== undefined && isAdmin && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-999 ml20",
|
|
|
children: item.total || 0
|
|
|
})]
|
|
|
}, typeof item.index === 'number' ? item.index : item.id);
|
|
|
})
|
|
|
})
|
|
|
}), isAdmin && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: "mr20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: TabMenumodules.control,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: TabMenumodules.extra,
|
|
|
children: extraNode
|
|
|
}), showControlButton && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
onClick: onButtonClick,
|
|
|
style: {
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
className: TabMenumodules.selectBtn,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont ".concat(buttonIcon)
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: buttonText
|
|
|
})]
|
|
|
}), !!getDropdownMenu && /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
className: "ml10",
|
|
|
dropdownRender: getDropdownMenu,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: TabMenumodules.selectBtn,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-tianjiadaohang"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: addText ? addText : '创建试卷'
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_TabMenu = (TabMenu);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 12563:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/tag/index.js + 5 modules ***!
|
|
|
\*******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ tag; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
|
|
|
var CloseOutlined = __webpack_require__(99174);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/colors.js
|
|
|
var colors = __webpack_require__(36785);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useClosable.js
|
|
|
var useClosable = __webpack_require__(47729);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
|
var wave = __webpack_require__(14088);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
|
var style = __webpack_require__(17313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(37613);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/style/index.js
|
|
|
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
|
const genBaseStyle = token => {
|
|
|
const {
|
|
|
paddingXXS,
|
|
|
lineWidth,
|
|
|
tagPaddingHorizontal,
|
|
|
componentCls
|
|
|
} = token;
|
|
|
const paddingInline = tagPaddingHorizontal - lineWidth;
|
|
|
const iconMarginInline = paddingXXS - lineWidth;
|
|
|
return {
|
|
|
// Result
|
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
display: 'inline-block',
|
|
|
height: 'auto',
|
|
|
marginInlineEnd: token.marginXS,
|
|
|
paddingInline,
|
|
|
fontSize: token.tagFontSize,
|
|
|
lineHeight: token.tagLineHeight,
|
|
|
whiteSpace: 'nowrap',
|
|
|
background: token.defaultBg,
|
|
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
|
|
|
borderRadius: token.borderRadiusSM,
|
|
|
opacity: 1,
|
|
|
transition: `all ${token.motionDurationMid}`,
|
|
|
textAlign: 'start',
|
|
|
position: 'relative',
|
|
|
// RTL
|
|
|
[`&${componentCls}-rtl`]: {
|
|
|
direction: 'rtl'
|
|
|
},
|
|
|
'&, a, a:hover': {
|
|
|
color: token.defaultColor
|
|
|
},
|
|
|
[`${componentCls}-close-icon`]: {
|
|
|
marginInlineStart: iconMarginInline,
|
|
|
color: token.colorTextDescription,
|
|
|
fontSize: token.tagIconSize,
|
|
|
cursor: 'pointer',
|
|
|
transition: `all ${token.motionDurationMid}`,
|
|
|
'&:hover': {
|
|
|
color: token.colorTextHeading
|
|
|
}
|
|
|
},
|
|
|
[`&${componentCls}-has-color`]: {
|
|
|
borderColor: 'transparent',
|
|
|
[`&, a, a:hover, ${token.iconCls}-close, ${token.iconCls}-close:hover`]: {
|
|
|
color: token.colorTextLightSolid
|
|
|
}
|
|
|
},
|
|
|
[`&-checkable`]: {
|
|
|
backgroundColor: 'transparent',
|
|
|
borderColor: 'transparent',
|
|
|
cursor: 'pointer',
|
|
|
[`&:not(${componentCls}-checkable-checked):hover`]: {
|
|
|
color: token.colorPrimary,
|
|
|
backgroundColor: token.colorFillSecondary
|
|
|
},
|
|
|
'&:active, &-checked': {
|
|
|
color: token.colorTextLightSolid
|
|
|
},
|
|
|
'&-checked': {
|
|
|
backgroundColor: token.colorPrimary,
|
|
|
'&:hover': {
|
|
|
backgroundColor: token.colorPrimaryHover
|
|
|
}
|
|
|
},
|
|
|
'&:active': {
|
|
|
backgroundColor: token.colorPrimaryActive
|
|
|
}
|
|
|
},
|
|
|
[`&-hidden`]: {
|
|
|
display: 'none'
|
|
|
},
|
|
|
// To ensure that a space will be placed between character and `Icon`.
|
|
|
[`> ${token.iconCls} + span, > span + ${token.iconCls}`]: {
|
|
|
marginInlineStart: paddingInline
|
|
|
}
|
|
|
}),
|
|
|
[`${componentCls}-borderless`]: {
|
|
|
borderColor: 'transparent',
|
|
|
background: token.tagBorderlessBg
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
const prepareToken = token => {
|
|
|
const {
|
|
|
lineWidth,
|
|
|
fontSizeIcon
|
|
|
} = token;
|
|
|
const tagFontSize = token.fontSizeSM;
|
|
|
const tagLineHeight = `${token.lineHeightSM * tagFontSize}px`;
|
|
|
const tagToken = (0,statistic/* merge */.TS)(token, {
|
|
|
tagFontSize,
|
|
|
tagLineHeight,
|
|
|
tagIconSize: fontSizeIcon - 2 * lineWidth,
|
|
|
tagPaddingHorizontal: 8,
|
|
|
tagBorderlessBg: token.colorFillTertiary
|
|
|
});
|
|
|
return tagToken;
|
|
|
};
|
|
|
const prepareCommonToken = token => ({
|
|
|
defaultBg: token.colorFillQuaternary,
|
|
|
defaultColor: token.colorText
|
|
|
});
|
|
|
/* harmony default export */ var tag_style = ((0,genComponentStyleHook/* default */.Z)('Tag', token => {
|
|
|
const tagToken = prepareToken(token);
|
|
|
return genBaseStyle(tagToken);
|
|
|
}, prepareCommonToken));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/CheckableTag.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 CheckableTag = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
style,
|
|
|
className,
|
|
|
checked,
|
|
|
onChange,
|
|
|
onClick
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "style", "className", "checked", "onChange", "onClick"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
tag
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const handleClick = e => {
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
|
|
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
|
};
|
|
|
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = tag_style(prefixCls);
|
|
|
const cls = _classnames_2_3_2_classnames_default()(prefixCls, `${prefixCls}-checkable`, {
|
|
|
[`${prefixCls}-checkable-checked`]: checked
|
|
|
}, tag === null || tag === void 0 ? void 0 : tag.className, className, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, restProps, {
|
|
|
style: Object.assign(Object.assign({}, style), tag === null || tag === void 0 ? void 0 : tag.style),
|
|
|
className: cls,
|
|
|
onClick: handleClick
|
|
|
})));
|
|
|
};
|
|
|
/* harmony default export */ var tag_CheckableTag = (CheckableTag);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genPresetColor.js
|
|
|
var genPresetColor = __webpack_require__(45157);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/style/presetCmp.js
|
|
|
// Style as status component
|
|
|
|
|
|
|
|
|
// ============================== Preset ==============================
|
|
|
const genPresetStyle = token => (0,genPresetColor/* default */.Z)(token, (colorKey, _ref) => {
|
|
|
let {
|
|
|
textColor,
|
|
|
lightBorderColor,
|
|
|
lightColor,
|
|
|
darkColor
|
|
|
} = _ref;
|
|
|
return {
|
|
|
[`${token.componentCls}-${colorKey}`]: {
|
|
|
color: textColor,
|
|
|
background: lightColor,
|
|
|
borderColor: lightBorderColor,
|
|
|
// Inverse color
|
|
|
'&-inverse': {
|
|
|
color: token.colorTextLightSolid,
|
|
|
background: darkColor,
|
|
|
borderColor: darkColor
|
|
|
},
|
|
|
[`&${token.componentCls}-borderless`]: {
|
|
|
borderColor: 'transparent'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var presetCmp = ((0,genComponentStyleHook/* genSubStyleComponent */.b)(['Tag', 'preset'], token => {
|
|
|
const tagToken = prepareToken(token);
|
|
|
return genPresetStyle(tagToken);
|
|
|
}, prepareCommonToken));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/capitalize.js
|
|
|
function capitalize(str) {
|
|
|
if (typeof str !== 'string') {
|
|
|
return str;
|
|
|
}
|
|
|
const ret = str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
return ret;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/style/statusCmp.js
|
|
|
|
|
|
|
|
|
|
|
|
const genTagStatusStyle = (token, status, cssVariableType) => {
|
|
|
const capitalizedCssVariableType = capitalize(cssVariableType);
|
|
|
return {
|
|
|
[`${token.componentCls}-${status}`]: {
|
|
|
color: token[`color${cssVariableType}`],
|
|
|
background: token[`color${capitalizedCssVariableType}Bg`],
|
|
|
borderColor: token[`color${capitalizedCssVariableType}Border`],
|
|
|
[`&${token.componentCls}-borderless`]: {
|
|
|
borderColor: 'transparent'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var statusCmp = ((0,genComponentStyleHook/* genSubStyleComponent */.b)(['Tag', 'status'], token => {
|
|
|
const tagToken = prepareToken(token);
|
|
|
return [genTagStatusStyle(tagToken, 'success', 'Success'), genTagStatusStyle(tagToken, 'processing', 'Info'), genTagStatusStyle(tagToken, 'error', 'Error'), genTagStatusStyle(tagToken, 'warning', 'Warning')];
|
|
|
}, prepareCommonToken));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/index.js
|
|
|
"use client";
|
|
|
|
|
|
var tag_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 InternalTag = (tagProps, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
children,
|
|
|
icon,
|
|
|
color,
|
|
|
onClose,
|
|
|
closeIcon,
|
|
|
closable,
|
|
|
bordered = true
|
|
|
} = tagProps,
|
|
|
props = tag_rest(tagProps, ["prefixCls", "className", "rootClassName", "style", "children", "icon", "color", "onClose", "closeIcon", "closable", "bordered"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
tag
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const [visible, setVisible] = _react_17_0_2_react.useState(true);
|
|
|
// Warning for deprecated usage
|
|
|
if (false) {}
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('visible' in props) {
|
|
|
setVisible(props.visible);
|
|
|
}
|
|
|
}, [props.visible]);
|
|
|
const isPreset = (0,colors/* isPresetColor */.o2)(color);
|
|
|
const isStatus = (0,colors/* isPresetStatusColor */.yT)(color);
|
|
|
const isInternalColor = isPreset || isStatus;
|
|
|
const tagStyle = Object.assign(Object.assign({
|
|
|
backgroundColor: color && !isInternalColor ? color : undefined
|
|
|
}, tag === null || tag === void 0 ? void 0 : tag.style), style);
|
|
|
const prefixCls = getPrefixCls('tag', customizePrefixCls);
|
|
|
// Style
|
|
|
const [wrapSSR, hashId] = tag_style(prefixCls);
|
|
|
const tagClassName = _classnames_2_3_2_classnames_default()(prefixCls, tag === null || tag === void 0 ? void 0 : tag.className, {
|
|
|
[`${prefixCls}-${color}`]: isInternalColor,
|
|
|
[`${prefixCls}-has-color`]: color && !isInternalColor,
|
|
|
[`${prefixCls}-hidden`]: !visible,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-borderless`]: !bordered
|
|
|
}, className, rootClassName, hashId);
|
|
|
const handleCloseClick = e => {
|
|
|
e.stopPropagation();
|
|
|
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
|
if (e.defaultPrevented) {
|
|
|
return;
|
|
|
}
|
|
|
setVisible(false);
|
|
|
};
|
|
|
const [, mergedCloseIcon] = (0,useClosable/* default */.Z)(closable, closeIcon, iconNode => iconNode === null ? /*#__PURE__*/_react_17_0_2_react.createElement(CloseOutlined/* default */.Z, {
|
|
|
className: `${prefixCls}-close-icon`,
|
|
|
onClick: handleCloseClick
|
|
|
}) : /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-close-icon`,
|
|
|
onClick: handleCloseClick
|
|
|
}, iconNode), null, false);
|
|
|
const isNeedWave = typeof props.onClick === 'function' || children && children.type === 'a';
|
|
|
const iconNode = icon || null;
|
|
|
const kids = iconNode ? /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, iconNode, children && /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children)) : children;
|
|
|
const tagNode = /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, props, {
|
|
|
ref: ref,
|
|
|
className: tagClassName,
|
|
|
style: tagStyle
|
|
|
}), kids, mergedCloseIcon, isPreset && /*#__PURE__*/_react_17_0_2_react.createElement(presetCmp, {
|
|
|
key: "preset",
|
|
|
prefixCls: prefixCls
|
|
|
}), isStatus && /*#__PURE__*/_react_17_0_2_react.createElement(statusCmp, {
|
|
|
key: "status",
|
|
|
prefixCls: prefixCls
|
|
|
}));
|
|
|
return wrapSSR(isNeedWave ? /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
|
component: "Tag"
|
|
|
}, tagNode) : tagNode);
|
|
|
};
|
|
|
const Tag = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalTag);
|
|
|
if (false) {}
|
|
|
Tag.CheckableTag = tag_CheckableTag;
|
|
|
/* harmony default export */ var tag = (Tag);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |