|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[66616],{
|
|
|
|
|
|
/***/ 7523:
|
|
|
/*!*************************************!*\
|
|
|
!*** ./src/pages/tasks/constant.js ***!
|
|
|
\*************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "$Y": function() { return /* binding */ SET_EDITOR_THEME; },
|
|
|
/* harmony export */ "A0": function() { return /* binding */ HIDE_EVALUATE_LOADING; },
|
|
|
/* harmony export */ "Bt": function() { return /* binding */ SET_SSH_TABS; },
|
|
|
/* harmony export */ "EP": function() { return /* binding */ HIDE_EVALUATE_RESULT; },
|
|
|
/* harmony export */ "F_": function() { return /* binding */ MOVE_X; },
|
|
|
/* harmony export */ "G9": function() { return /* binding */ UPDATE_TIMESTRAP; },
|
|
|
/* harmony export */ "GB": function() { return /* binding */ FETCH_REP_CONTENT; },
|
|
|
/* harmony export */ "GR": function() { return /* binding */ GET_DISCUSSES; },
|
|
|
/* harmony export */ "GW": function() { return /* binding */ SET_SHOW_DIR; },
|
|
|
/* harmony export */ "Hp": function() { return /* binding */ SHOW_TASK_LIST; },
|
|
|
/* harmony export */ "Ir": function() { return /* binding */ FETCH_TASK_FAILURE; },
|
|
|
/* harmony export */ "J$": function() { return /* binding */ SET_SSH_CONFIGDATAARR; },
|
|
|
/* harmony export */ "Kv": function() { return /* binding */ SHOW_PATH_LIST; },
|
|
|
/* harmony export */ "N$": function() { return /* binding */ EDIT_REP_CODE; },
|
|
|
/* harmony export */ "NZ": function() { return /* binding */ HIDE_TIP_MODAL; },
|
|
|
/* harmony export */ "Nv": function() { return /* binding */ HIDE_NOTICE; },
|
|
|
/* harmony export */ "OA": function() { return /* binding */ HIDE_PICTURE_VIEW; },
|
|
|
/* harmony export */ "OJ": function() { return /* binding */ SET_CHOOSE_ANSWERS; },
|
|
|
/* harmony export */ "QF": function() { return /* binding */ ON_AUTO_FORMAT; },
|
|
|
/* harmony export */ "RS": function() { return /* binding */ SHOW_REWARD_DIALOG; },
|
|
|
/* harmony export */ "RY": function() { return /* binding */ SET_VNC_LOADING; },
|
|
|
/* harmony export */ "Rj": function() { return /* binding */ SHOW_TIP_MODAL; },
|
|
|
/* harmony export */ "SX": function() { return /* binding */ ACTIVE_DISCUSS_INDEX; },
|
|
|
/* harmony export */ "Tp": function() { return /* binding */ SET_EDITOR_FONTSIZE; },
|
|
|
/* harmony export */ "Ui": function() { return /* binding */ SHOW_EVALUATE_LOADING; },
|
|
|
/* harmony export */ "V1": function() { return /* binding */ EVAL_CHOOSE_END; },
|
|
|
/* harmony export */ "Vn": function() { return /* binding */ SET_REWARD; },
|
|
|
/* harmony export */ "YI": function() { return /* binding */ SHOW_REP_LOADING; },
|
|
|
/* harmony export */ "_0": function() { return /* binding */ SET_TAB_INDEX; },
|
|
|
/* harmony export */ "_F": function() { return /* binding */ HIDE_PATH_LIST; },
|
|
|
/* harmony export */ "dL": function() { return /* binding */ SHOW_NOTICE; },
|
|
|
/* harmony export */ "fo": function() { return /* binding */ DISABLE_DISCUSS; },
|
|
|
/* harmony export */ "gK": function() { return /* binding */ TRIGGER_TAB_FIXED; },
|
|
|
/* harmony export */ "hK": function() { return /* binding */ HIDE_TASK_LIST; },
|
|
|
/* harmony export */ "i3": function() { return /* binding */ TRIGGER_RIGHT_PANEL_MASK; },
|
|
|
/* harmony export */ "ib": function() { return /* binding */ SET_TASK_STAR; },
|
|
|
/* harmony export */ "lS": function() { return /* binding */ TRIGGER_ENLARGE_UNITY3D; },
|
|
|
/* harmony export */ "m5": function() { return /* binding */ SHOW_EVALUATE_RESULT; },
|
|
|
/* harmony export */ "n4": function() { return /* binding */ FETCH_TASK_START; },
|
|
|
/* harmony export */ "n_": function() { return /* binding */ SET_ACTIVE_INDEX; },
|
|
|
/* harmony export */ "oP": function() { return /* binding */ SET_REPOS; },
|
|
|
/* harmony export */ "p2": function() { return /* binding */ SET_EVALUATE_MESSAGE; },
|
|
|
/* harmony export */ "pl": function() { return /* binding */ FETCH_ANSWER_INFO; },
|
|
|
/* harmony export */ "rM": function() { return /* binding */ PLUS_DISCUSS; },
|
|
|
/* harmony export */ "sM": function() { return /* binding */ GET_TASK_LIST; },
|
|
|
/* harmony export */ "t2": function() { return /* binding */ CANCEL_REWARD_DIALOG; },
|
|
|
/* harmony export */ "tD": function() { return /* binding */ SHOW_DISCUSSES_LOADING; },
|
|
|
/* harmony export */ "u8": function() { return /* binding */ TOP_OR_DOWN_DISCUSS; },
|
|
|
/* harmony export */ "um": function() { return /* binding */ ON_TAB_TO_SPACE; },
|
|
|
/* harmony export */ "vm": function() { return /* binding */ SHOW_PICTURE_VIEW; },
|
|
|
/* harmony export */ "wQ": function() { return /* binding */ MOVE_Y; },
|
|
|
/* harmony export */ "wj": function() { return /* binding */ EVAL_CHOOSE_START; },
|
|
|
/* harmony export */ "wt": function() { return /* binding */ SHOW_ANSWER_LOADING; },
|
|
|
/* harmony export */ "ww": function() { return /* binding */ SET_SSH_CONFIGDATA; },
|
|
|
/* harmony export */ "x9": function() { return /* binding */ SET_EDITOR_SETTING; },
|
|
|
/* harmony export */ "yS": function() { return /* binding */ SET_ACTION_TYPE; },
|
|
|
/* harmony export */ "yi": function() { return /* binding */ FETCH_TASK_SUCCESS; },
|
|
|
/* harmony export */ "ym": function() { return /* binding */ SELECT_UNLOCK_ANSWER; },
|
|
|
/* harmony export */ "z2": function() { return /* binding */ UPDATE_TASK_DATA; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony exports CREATE_DISCUSS, SET_REP_PATH */
|
|
|
var FETCH_TASK_START = 'FETCH_TASK_START';
|
|
|
var FETCH_TASK_FAILURE = 'FETCH_TASK_FAILURE';
|
|
|
var FETCH_TASK_SUCCESS = 'FETCH_TASK_SUCCESS';
|
|
|
var UPDATE_TASK_DATA = 'UPDATE_TASK_DATA';
|
|
|
var HIDE_EVALUATE_RESULT = 'HIDE_EVALUATE_RESULT';
|
|
|
var SHOW_EVALUATE_RESULT = 'SHOW_EVALUATE_RESULT';
|
|
|
var UPDATE_TIMESTRAP = 'UPDATE_TIMESTRAP';
|
|
|
var MOVE_X = 'MOVE_X';
|
|
|
var MOVE_Y = 'MOVE_Y';
|
|
|
var TRIGGER_RIGHT_PANEL_MASK = 'TRIGGER_RIGHT_PANEL_MASK ';
|
|
|
|
|
|
//left_panel_action
|
|
|
var SET_ACTIVE_INDEX = 'SET_ACTIVE_INDEX';
|
|
|
var GET_TASK_LIST = 'GET_TASK_LIST';
|
|
|
var SHOW_TASK_LIST = 'SHOW_TASK_LIST';
|
|
|
var HIDE_TASK_LIST = 'HIDE_TASK_LIST';
|
|
|
var SET_TASK_STAR = 'SET_TASK_STAR';
|
|
|
var TRIGGER_ENLARGE_UNITY3D = 'TRIGGER_ENLARGE_UNITY3D ';
|
|
|
var TRIGGER_TAB_FIXED = 'TRIGGER_TAB_FIXED ';
|
|
|
|
|
|
//discuss action
|
|
|
var GET_DISCUSSES = 'GET_DISCUSSES';
|
|
|
var SHOW_DISCUSSES_LOADING = 'SHOW_DISCUSSES_LOADING';
|
|
|
var TOP_OR_DOWN_DISCUSS = 'TOP_OR_DOWN_DISCUSS';
|
|
|
var PLUS_DISCUSS = 'PLUS_DISCUSS';
|
|
|
var SET_ACTION_TYPE = 'SET_ACTION_TYPE';
|
|
|
var SHOW_REWARD_DIALOG = 'SHOW_REWARD_DIALOG';
|
|
|
var CANCEL_REWARD_DIALOG = 'CANCEL_REWARD_DIALOG';
|
|
|
var SET_REWARD = 'SET_REWARD';
|
|
|
var ACTIVE_DISCUSS_INDEX = 'ACTIVE_DISCUSS_INDEX';
|
|
|
var CREATE_DISCUSS = 'CREATE_DISCUSS';
|
|
|
var DISABLE_DISCUSS = 'DISABLE_DISCUSS';
|
|
|
|
|
|
//answer_panel_action
|
|
|
var SHOW_ANSWER_LOADING = 'SHOW_ANSWER_LOADING';
|
|
|
var FETCH_ANSWER_INFO = 'FETCH_ANSWER_INFO';
|
|
|
var HIDE_TIP_MODAL = 'HIGH_TIP_MODAL';
|
|
|
var SHOW_TIP_MODAL = 'SHOW_TIP_MODAL';
|
|
|
var SELECT_UNLOCK_ANSWER = 'SELECT_UNLOCK_ANSWER';
|
|
|
|
|
|
//choose_repository_action
|
|
|
var SET_CHOOSE_ANSWERS = 'SET_CHOOSE_ANSWERS';
|
|
|
var EVAL_CHOOSE_START = 'EVAL_CHOOSE_START';
|
|
|
var EVAL_CHOOSE_END = 'EVAL_CHOOSE_END';
|
|
|
|
|
|
//code_repository_action
|
|
|
var SHOW_REP_LOADING = 'SHOW_REP_loading';
|
|
|
var FETCH_REP_CONTENT = 'FETCH_REP_CONTENT';
|
|
|
var EDIT_REP_CODE = 'EDIT_REP_CONTENT';
|
|
|
var SET_REP_PATH = 'SET_REP_PATH';
|
|
|
var SHOW_EVALUATE_LOADING = 'SHOW_EVALUATE_LOADING';
|
|
|
var HIDE_EVALUATE_LOADING = 'HIDE_EVALUATE_LOADING';
|
|
|
var SET_EVALUATE_MESSAGE = 'SET_EVALUATE_MESSAGE';
|
|
|
var SET_SHOW_DIR = 'SET_SHOW_DIR';
|
|
|
var SET_EDITOR_SETTING = 'SET_EDITOR_SETTING';
|
|
|
var SET_EDITOR_THEME = 'SET_EDITOR_THEME';
|
|
|
var SET_EDITOR_FONTSIZE = 'SET_EDITOR_FONTSIZE';
|
|
|
var SET_REPOS = 'SET_REPOS';
|
|
|
var SHOW_PATH_LIST = 'SHOW_PATH_LIST';
|
|
|
var HIDE_PATH_LIST = 'HIDE_PATH_LIST';
|
|
|
var HIDE_PICTURE_VIEW = 'HIDE_PICTURE_VIEW';
|
|
|
var SHOW_PICTURE_VIEW = 'SHOW_PICTURE_VIEW';
|
|
|
var SHOW_NOTICE = 'SHOW_NOTICE';
|
|
|
var HIDE_NOTICE = 'HIDE_NOTICE';
|
|
|
var SET_TAB_INDEX = 'SET_TAB_INDEX';
|
|
|
var SET_SSH_TABS = 'SET_SSH_TABS';
|
|
|
var SET_SSH_CONFIGDATA = 'SET_SSH_CONFIGDATA';
|
|
|
var SET_SSH_CONFIGDATAARR = 'SET_SSH_CONFIGDATAARR';
|
|
|
var SET_VNC_LOADING = 'SET_VNC_LOADING ';
|
|
|
var ON_TAB_TO_SPACE = 'ON_TAB_TO_SPACE ';
|
|
|
var ON_AUTO_FORMAT = 'ON_AUTO_FORMAT ';
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 48559:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./src/components/AsyncButton/index.tsx ***!
|
|
|
\**********************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "Z": function() { return /* binding */ AsyncButton; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/button/style */ 29913);
|
|
|
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd/es/button */ 71577);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js */ 70215);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["children"];
|
|
|
|
|
|
|
|
|
var AsyncButton = function AsyncButton(_ref) {
|
|
|
var children = _ref.children,
|
|
|
props = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5___default()(_ref, _excluded);
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_6__.useState)(false),
|
|
|
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4___default()(_useState, 2),
|
|
|
btnLoading = _useState2[0],
|
|
|
setBtnLoading = _useState2[1];
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(antd_es_button__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, props), {}, {
|
|
|
loading: btnLoading,
|
|
|
onClick: /*#__PURE__*/function () {
|
|
|
var _ref2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().mark(function _callee(e) {
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_2___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.prev = 0;
|
|
|
setBtnLoading(true);
|
|
|
_context.next = 4;
|
|
|
return props.onClick(e);
|
|
|
case 4:
|
|
|
setBtnLoading(false);
|
|
|
_context.next = 10;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context.prev = 7;
|
|
|
_context.t0 = _context["catch"](0);
|
|
|
setBtnLoading(false);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee, null, [[0, 7]]);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}(),
|
|
|
children: children
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 93899:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./src/components/CoverUpload/index.tsx + 1 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ components_CoverUpload; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/upload/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(13759);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/upload/index.js + 20 modules
|
|
|
var upload = __webpack_require__(7426);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
|
var message_style = __webpack_require__(14934);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
|
var message = __webpack_require__(12461);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
|
var button_style = __webpack_require__(29913);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/UploadOutlined.js + 1 modules
|
|
|
var UploadOutlined = __webpack_require__(88484);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js
|
|
|
var CloseCircleFilled = __webpack_require__(38900);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(59758);
|
|
|
;// CONCATENATED MODULE: ./src/components/CoverUpload/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var CoverUploadmodules = ({"img":"img___BgL9D"});
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/CoverUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CoverUpload = function CoverUpload(_ref) {
|
|
|
var value = _ref.value,
|
|
|
onChange = _ref.onChange,
|
|
|
getFileProgress = _ref.getFileProgress;
|
|
|
var _useState = (0,react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
imgLoading = _useState2[0],
|
|
|
setImgLoading = _useState2[1];
|
|
|
var uploadButton = /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
loading: imgLoading,
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(UploadOutlined/* default */.Z, {}),
|
|
|
children: "\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6"
|
|
|
});
|
|
|
var renderImg = function renderImg() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: CoverUploadmodules.img,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default.API_SERVER */.Z.API_SERVER + "/api/attachments/" + value,
|
|
|
alt: "avatar",
|
|
|
style: {
|
|
|
width: 288
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseCircleFilled/* default */.Z, {
|
|
|
onClick: function onClick() {
|
|
|
return onChange('');
|
|
|
},
|
|
|
style: {
|
|
|
fontSize: '16px',
|
|
|
color: 'red'
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var handleChange = function handleChange(info) {
|
|
|
if (getFileProgress) {
|
|
|
getFileProgress(info);
|
|
|
}
|
|
|
if (info.file.status === 'uploading') {
|
|
|
setImgLoading(true);
|
|
|
return;
|
|
|
}
|
|
|
if (info.file.status === 'done') {
|
|
|
var _info$file, _info$file$response, _info$file3, _info$file3$response;
|
|
|
setImgLoading(false);
|
|
|
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 ? void 0 : (_info$file$response = _info$file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.status) === -1) {
|
|
|
var _info$file2, _info$file2$response;
|
|
|
message/* default.error */.ZP.error((_info$file2 = info.file) === null || _info$file2 === void 0 ? void 0 : (_info$file2$response = _info$file2.response) === null || _info$file2$response === void 0 ? void 0 : _info$file2$response.message);
|
|
|
// onChange()
|
|
|
return;
|
|
|
}
|
|
|
onChange(info === null || info === void 0 ? void 0 : (_info$file3 = info.file) === null || _info$file3 === void 0 ? void 0 : (_info$file3$response = _info$file3.response) === null || _info$file3$response === void 0 ? void 0 : _info$file3$response.id);
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
|
|
|
children: value ? renderImg() : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(upload/* default */.Z, {
|
|
|
withCredentials: true,
|
|
|
name: "file",
|
|
|
showUploadList: false,
|
|
|
action: "".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments.json"),
|
|
|
onChange: handleChange,
|
|
|
accept: "image/*",
|
|
|
children: uploadButton
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20 c-light-black",
|
|
|
children: "\u8BF4\u660E\uFF1A\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528288*158\u50CF\u7D20\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-light-black",
|
|
|
children: "\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_CoverUpload = (CoverUpload);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 31590:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./src/components/MultiUpload/index.tsx + 1 modules ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"z": function() { return /* binding */ coverToFileList; },
|
|
|
"Z": function() { return /* binding */ MultiUpload; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(29913);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
|
var modal_style = __webpack_require__(35611);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
|
var modal = __webpack_require__(85402);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
|
var message_style = __webpack_require__(14934);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
|
var message = __webpack_require__(12461);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(861);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/upload/style/index.js + 1 modules
|
|
|
var upload_style = __webpack_require__(13759);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/upload/index.js + 20 modules
|
|
|
var upload = __webpack_require__(7426);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(59758);
|
|
|
// EXTERNAL MODULE: ./src/pages/MoopCases/FormPanel/service.ts
|
|
|
var service = __webpack_require__(39507);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/SingleUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var uploadNameSizeSeperator = ' ';
|
|
|
function bytesToSize(bytes) {
|
|
|
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
|
if (bytes == 0) return '0 Byte';
|
|
|
var i = parseInt('' + Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
|
|
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
|
|
|
}
|
|
|
/* harmony default export */ var SingleUpload = (function (_ref) {
|
|
|
var _ref$value = _ref.value,
|
|
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
|
action = _ref.action,
|
|
|
_onChange = _ref.onChange,
|
|
|
className = _ref.className,
|
|
|
_ref$maxSize = _ref.maxSize,
|
|
|
maxSize = _ref$maxSize === void 0 ? 150 : _ref$maxSize,
|
|
|
_ref$title = _ref.title,
|
|
|
title = _ref$title === void 0 ? '文件上传' : _ref$title,
|
|
|
_ref$accept = _ref.accept,
|
|
|
accept = _ref$accept === void 0 ? null : _ref$accept;
|
|
|
var uploadProps = {
|
|
|
multiple: false,
|
|
|
fileList: value,
|
|
|
accept: accept,
|
|
|
withCredentials: true,
|
|
|
beforeUpload: function beforeUpload(file) {
|
|
|
var fileSize = file.size / 1024 / 1024;
|
|
|
if (!(fileSize < maxSize)) {
|
|
|
_message.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"));
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
action: "".concat(ENV.API_SERVER, "/api/attachments.json"),
|
|
|
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
|
|
onChange: function onChange(info) {
|
|
|
var _info$file, _info$file$response;
|
|
|
var fileList = _toConsumableArray(info.fileList);
|
|
|
fileList = fileList.map(function (file) {
|
|
|
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
|
|
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
|
|
|
}
|
|
|
return _objectSpread({}, file);
|
|
|
});
|
|
|
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 ? void 0 : (_info$file$response = _info$file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.status) === -1) {
|
|
|
var _info$file2, _info$file2$response;
|
|
|
_message.error((_info$file2 = info.file) === null || _info$file2 === void 0 ? void 0 : (_info$file2$response = _info$file2.response) === null || _info$file2$response === void 0 ? void 0 : _info$file2$response.message);
|
|
|
_onChange([]);
|
|
|
return;
|
|
|
}
|
|
|
_onChange(fileList);
|
|
|
},
|
|
|
onRemove: function () {
|
|
|
var _onRemove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
|
var fileSize, id, rs;
|
|
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
fileSize = file.size / 1024 / 1024;
|
|
|
if (!(file.status === 'uploading')) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return", true);
|
|
|
case 3:
|
|
|
if (fileSize < maxSize) {
|
|
|
_context.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return", true);
|
|
|
case 7:
|
|
|
id = file.response ? file.response.id : file.uid;
|
|
|
if (!id) {
|
|
|
_context.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 11;
|
|
|
return removeAttachment(file.response ? file.response.id : file.id);
|
|
|
case 11:
|
|
|
rs = _context.sent;
|
|
|
return _context.abrupt("return", rs);
|
|
|
case 15:
|
|
|
return _context.abrupt("return", true);
|
|
|
case 16:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
function onRemove(_x) {
|
|
|
return _onRemove.apply(this, arguments);
|
|
|
}
|
|
|
return onRemove;
|
|
|
}()
|
|
|
};
|
|
|
function onCancel(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
return /*#__PURE__*/_jsx("div", {
|
|
|
className: "single-upload ".concat(className ? className : ''),
|
|
|
children: /*#__PURE__*/_jsxs(_Upload, _objectSpread(_objectSpread({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/_jsx(_Button, {
|
|
|
type: "primary",
|
|
|
title: value.length > 0 ? '每次只能上传一个资源, 删除下面资源可重新上传 ' : '',
|
|
|
disabled: value.length > 0,
|
|
|
ghost: true,
|
|
|
children: title
|
|
|
}), /*#__PURE__*/_jsxs("span", {
|
|
|
onClick: onCancel,
|
|
|
style: {
|
|
|
marginLeft: 10
|
|
|
},
|
|
|
children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "M)", ' ']
|
|
|
})]
|
|
|
}))
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
|
|
|
var InboxOutlined = __webpack_require__(64082);
|
|
|
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
|
|
|
var lodash = __webpack_require__(96486);
|
|
|
;// CONCATENATED MODULE: ./src/components/MultiUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Dragger = upload/* default.Dragger */.Z.Dragger;
|
|
|
function coverToFileList(data) {
|
|
|
var rs = [];
|
|
|
if (data && data.length > 0) {
|
|
|
rs = data.map(function (item) {
|
|
|
return {
|
|
|
uid: item.id,
|
|
|
id: item.id,
|
|
|
name: item.title + uploadNameSizeSeperator + item.filesize,
|
|
|
url: item.url,
|
|
|
filesize: item.filesize,
|
|
|
status: 'done',
|
|
|
response: {
|
|
|
id: item.id
|
|
|
}
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
return rs;
|
|
|
}
|
|
|
/* harmony default export */ var MultiUpload = (function (_ref) {
|
|
|
var value = _ref.value,
|
|
|
_onChange = _ref.onChange,
|
|
|
action = _ref.action,
|
|
|
className = _ref.className,
|
|
|
_ref$maxSize = _ref.maxSize,
|
|
|
maxSize = _ref$maxSize === void 0 ? 150 : _ref$maxSize,
|
|
|
_ref$title = _ref.title,
|
|
|
title = _ref$title === void 0 ? '上传附件' : _ref$title,
|
|
|
_ref$showRemoveModal = _ref.showRemoveModal,
|
|
|
showRemoveModal = _ref$showRemoveModal === void 0 ? false : _ref$showRemoveModal,
|
|
|
_ref$accept = _ref.accept,
|
|
|
accept = _ref$accept === void 0 ? '' : _ref$accept,
|
|
|
additionalText = _ref.additionalText,
|
|
|
isDragger = _ref.isDragger,
|
|
|
_ref$number = _ref.number,
|
|
|
number = _ref$number === void 0 ? 1000 : _ref$number,
|
|
|
_ref$aloneClear = _ref.aloneClear,
|
|
|
aloneClear = _ref$aloneClear === void 0 ? false : _ref$aloneClear;
|
|
|
var _useState = (0,react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
disabled = _useState2[0],
|
|
|
setDisabled = _useState2[1];
|
|
|
var _useState3 = (0,react.useState)(value || []),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
fileList = _useState4[0],
|
|
|
setFileList = _useState4[1];
|
|
|
var _useState5 = (0,react.useState)(1),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
nums = _useState6[0],
|
|
|
setnums = _useState6[1];
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (value) {
|
|
|
if (nums === 1) {
|
|
|
setFileList(toConsumableArray_default()(value));
|
|
|
}
|
|
|
setnums(2);
|
|
|
if (number === (value === null || value === void 0 ? void 0 : value.length)) {
|
|
|
setDisabled(true);
|
|
|
}
|
|
|
}
|
|
|
}, [value]);
|
|
|
var clearLastFile = function clearLastFile() {
|
|
|
setTimeout(function () {
|
|
|
fileList.pop();
|
|
|
setFileList(toConsumableArray_default()(fileList));
|
|
|
}, 500);
|
|
|
};
|
|
|
var uploadProps = {
|
|
|
multiple: true,
|
|
|
disabled: disabled,
|
|
|
accept: accept,
|
|
|
withCredentials: true,
|
|
|
fileList: fileList,
|
|
|
// fileList: fileList?.length ? fileList : value,
|
|
|
beforeUpload: function beforeUpload(file, fileArr) {
|
|
|
var fileSize = file.size / 1024 / 1024;
|
|
|
if (fileList.concat(fileArr).length > number) {
|
|
|
fileList.pop();
|
|
|
setFileList(toConsumableArray_default()(fileList));
|
|
|
message/* default.error */.ZP.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(number, "\u4E2A\u6587\u4EF6"));
|
|
|
if (aloneClear) {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
clearLastFile();
|
|
|
return false;
|
|
|
}
|
|
|
if (!(fileSize < maxSize)) {
|
|
|
message/* default.error */.ZP.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(maxSize, "MB)."));
|
|
|
if (aloneClear) {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
clearLastFile();
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
action: action || "".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments.json"),
|
|
|
// ?debug=student&randomcode=undefined&client_key=6d57f8c3dd186c5ada392546ace9620a
|
|
|
onChange: function onChange(info) {
|
|
|
var _info$file, _info$file$response;
|
|
|
if (info.file.status === "removed") {
|
|
|
fileList = info.fileList;
|
|
|
} else {
|
|
|
fileList = (0,lodash.uniqBy)([].concat(toConsumableArray_default()(info.fileList), toConsumableArray_default()(fileList)), 'uid');
|
|
|
}
|
|
|
if (info.file.status === 'done' && ((_info$file = info.file) === null || _info$file === void 0 ? void 0 : (_info$file$response = _info$file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.status) === -1) {
|
|
|
var _info$file2, _info$file2$response;
|
|
|
message/* default.error */.ZP.error((_info$file2 = info.file) === null || _info$file2 === void 0 ? void 0 : (_info$file2$response = _info$file2.response) === null || _info$file2$response === void 0 ? void 0 : _info$file2$response.message);
|
|
|
return;
|
|
|
}
|
|
|
if (fileList.length >= number) setDisabled(true);else setDisabled(false);
|
|
|
setFileList(toConsumableArray_default()(fileList));
|
|
|
fileList = fileList.map(function (file) {
|
|
|
var _file$response;
|
|
|
if (file !== null && file !== void 0 && (_file$response = file.response) !== null && _file$response !== void 0 && _file$response.id) {
|
|
|
var _file$response2;
|
|
|
file.url = "/api/attachments/".concat(file === null || file === void 0 ? void 0 : (_file$response2 = file.response) === null || _file$response2 === void 0 ? void 0 : _file$response2.id);
|
|
|
}
|
|
|
if (file.name.indexOf(uploadNameSizeSeperator) === -1) {
|
|
|
file.name = "".concat(file.name).concat(uploadNameSizeSeperator).concat(bytesToSize(file.size));
|
|
|
}
|
|
|
return objectSpread2_default()({}, file);
|
|
|
});
|
|
|
console.log('info:', info, fileList);
|
|
|
_onChange(fileList);
|
|
|
},
|
|
|
onRemove: function () {
|
|
|
var _onRemove = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(file) {
|
|
|
var remove;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
remove = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var id, rs;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
id = file.response ? file.response.id : file.id;
|
|
|
if (!id) {
|
|
|
_context.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 4;
|
|
|
return (0,service/* removeAttachment */.JZ)(file.response ? file.response.id : file.uid);
|
|
|
case 4:
|
|
|
rs = _context.sent;
|
|
|
return _context.abrupt("return", Promise.resolve(rs));
|
|
|
case 8:
|
|
|
return _context.abrupt("return", true);
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function remove() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
if (!showRemoveModal) {
|
|
|
_context3.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
|
modal/* default.confirm */.Z.confirm({
|
|
|
centered: true,
|
|
|
width: 530,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: "\u662F\u5426\u786E\u8BA4\u5220\u9664?"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return remove();
|
|
|
case 2:
|
|
|
res = _context2.sent;
|
|
|
message/* default.success */.ZP.success('删除成功');
|
|
|
resolve(true);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}(),
|
|
|
onCancel: function onCancel() {
|
|
|
return resolve(false);
|
|
|
}
|
|
|
});
|
|
|
}));
|
|
|
case 5:
|
|
|
_context3.next = 7;
|
|
|
return remove();
|
|
|
case 7:
|
|
|
return _context3.abrupt("return", _context3.sent);
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function onRemove(_x) {
|
|
|
return _onRemove.apply(this, arguments);
|
|
|
}
|
|
|
return onRemove;
|
|
|
}()
|
|
|
};
|
|
|
function onCancel(e) {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "multi-upload ".concat(className ? className : ''),
|
|
|
children: [isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(Dragger, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "ant-upload-drag-icon",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(InboxOutlined/* default */.Z, {})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "ant-upload-text",
|
|
|
children: ["\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A", maxSize, "MB)", ' ']
|
|
|
}), additionalText]
|
|
|
})), !isDragger && /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
disabled: disabled,
|
|
|
children: title
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
onClick: onCancel,
|
|
|
style: {
|
|
|
marginLeft: 10,
|
|
|
color: '#FA6400'
|
|
|
},
|
|
|
children: ["(\u5355\u4E2A\u6587\u4EF6\u6700\u5927", maxSize, "MB)", ' ']
|
|
|
})]
|
|
|
}))]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 82982:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/button/style */ 29913);
|
|
|
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/button */ 71577);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var noData = function noData(_ref) {
|
|
|
var _ref$buttonProps = _ref.buttonProps,
|
|
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
|
_ref$styles = _ref.styles,
|
|
|
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
|
|
customText = _ref.customText,
|
|
|
ButtonText = _ref.ButtonText,
|
|
|
ButtonClick = _ref.ButtonClick,
|
|
|
Buttonclass = _ref.Buttonclass,
|
|
|
ButtonTwo = _ref.ButtonTwo;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("section", {
|
|
|
className: "tc animated fadeIn",
|
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
|
color: '#999',
|
|
|
margin: '200px auto'
|
|
|
}), styles),
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
|
|
src: _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_3__
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
|
|
className: "mt20 font14",
|
|
|
children: customText || '暂时还没有相关数据哦!'
|
|
|
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd_es_button__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
|
className: Buttonclass,
|
|
|
onClick: ButtonClick
|
|
|
}, buttonProps), {}, {
|
|
|
children: ButtonText
|
|
|
})), ButtonTwo && ButtonTwo]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (noData);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 38054:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/Spinner/index.tsx + 1 modules ***!
|
|
|
\******************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ Spinner; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
|
;// CONCATENATED MODULE: ./src/components/Spinner/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Spinnermodules = ({"ldsRing":"ldsRing___mpBZC","idsRingWrapper":"idsRingWrapper___Of9_n","ldsring":"ldsring___o0w2t"});
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/Spinner/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var Spinner = (function (_ref) {
|
|
|
var message = _ref.message,
|
|
|
className = _ref.className,
|
|
|
children = _ref.children,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Spinnermodules.idsRingWrapper, " ").concat(className),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Spinnermodules.ldsRing,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {})]
|
|
|
}), message ? /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: style,
|
|
|
children: message
|
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {})]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 75490:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/components/image-preview/index.tsx + 1 modules ***!
|
|
|
\************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ image_preview; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(29913);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
|
var mediator = __webpack_require__(91562);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ReloadOutlined.js + 1 modules
|
|
|
var ReloadOutlined = __webpack_require__(33160);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/DownloadOutlined.js
|
|
|
var DownloadOutlined = __webpack_require__(69753);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js
|
|
|
var CloseOutlined = __webpack_require__(28508);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var image_preview = (function () {
|
|
|
var _useState = (0,react.useState)(''),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
url = _useState2[0],
|
|
|
setUrl = _useState2[1];
|
|
|
var _useState3 = (0,react.useState)(0),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
deg = _useState4[0],
|
|
|
setDeg = _useState4[1];
|
|
|
var saveUrl = (0,react.useRef)('');
|
|
|
(0,react.useEffect)(function () {
|
|
|
var unSub = mediator/* default.subscribe */.Z.subscribe('preview-image', function (value) {
|
|
|
setUrl(value);
|
|
|
// window.document.body
|
|
|
// document.body.style.height='100%'
|
|
|
document.body.style.overflow = 'hidden';
|
|
|
});
|
|
|
return unSub;
|
|
|
}, []);
|
|
|
(0,react.useEffect)(function () {
|
|
|
document.addEventListener('keydown', onViewEscClose);
|
|
|
return function () {
|
|
|
document.removeEventListener('keydown', onViewEscClose);
|
|
|
};
|
|
|
}, []);
|
|
|
(0,react.useEffect)(function () {
|
|
|
saveUrl.current = url;
|
|
|
}, [url]);
|
|
|
function onViewEscClose(e) {
|
|
|
if (e.keyCode == 27 && saveUrl.current) {
|
|
|
onClose();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// https://data.educoder.net/api/attachments/1571649
|
|
|
function onClose() {
|
|
|
// document.body.style.height='100%'
|
|
|
document.body.style.overflow = 'auto';
|
|
|
setUrl('');
|
|
|
}
|
|
|
function onRotate() {
|
|
|
setDeg(deg + 90);
|
|
|
}
|
|
|
var maskRef = (0,react.useRef)();
|
|
|
var previewWrapperRef = (0,react.useRef)();
|
|
|
var handleMaskClick = function handleMaskClick(e) {
|
|
|
if (e.nativeEvent.target === maskRef.current || e.nativeEvent.target === previewWrapperRef.current) {
|
|
|
onClose();
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
|
|
|
children: !url ? null : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "image-preview-container",
|
|
|
ref: maskRef,
|
|
|
onClick: handleMaskClick,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "button-group",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
|
onClick: onRotate,
|
|
|
children: ["\u65CB\u8F6C", /*#__PURE__*/(0,jsx_runtime.jsx)(ReloadOutlined/* default */.Z, {})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
|
href: url,
|
|
|
children: ["\u4E0B\u8F7D", /*#__PURE__*/(0,jsx_runtime.jsx)(DownloadOutlined/* default */.Z, {})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
|
onClick: onClose,
|
|
|
children: ["\u5173\u95ED", /*#__PURE__*/(0,jsx_runtime.jsx)(CloseOutlined/* default */.Z, {})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "preview-wrp-group",
|
|
|
ref: previewWrapperRef,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
className: "image-preview",
|
|
|
src: url,
|
|
|
alt: "\u9884\u89C8\u5927\u56FE",
|
|
|
style: {
|
|
|
transform: "rotate(".concat(deg, "deg)")
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 39507:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/pages/MoopCases/FormPanel/service.ts ***!
|
|
|
\**************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "$J": function() { return /* binding */ getMoopCase; },
|
|
|
/* harmony export */ "JZ": function() { return /* binding */ removeAttachment; },
|
|
|
/* harmony export */ "bN": function() { return /* binding */ updateMoopCase; },
|
|
|
/* harmony export */ "jP": function() { return /* binding */ addMoopCase; },
|
|
|
/* harmony export */ "rO": function() { return /* binding */ getLibraryTags; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/fetch */ 84519);
|
|
|
|
|
|
|
|
|
|
|
|
function getMoopCase(id) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)("libraries/".concat(id, ".json"));
|
|
|
}
|
|
|
function getLibraryTags() {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .get */ .U2)('library_tags.json');
|
|
|
}
|
|
|
function removeAttachment(_x) {
|
|
|
return _removeAttachment.apply(this, arguments);
|
|
|
}
|
|
|
function _removeAttachment() {
|
|
|
_removeAttachment = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(id) {
|
|
|
var response;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .del */ .IV)("attachments/".concat(id, ".json"));
|
|
|
case 2:
|
|
|
response = _context.sent;
|
|
|
return _context.abrupt("return", response.status === 0);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _removeAttachment.apply(this, arguments);
|
|
|
}
|
|
|
function addMoopCase(params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .post */ .v_)("libraries.json", params);
|
|
|
}
|
|
|
function updateMoopCase(id, params) {
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_2__/* .put */ .gz)("libraries/".concat(id, ".json"), params);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 82383:
|
|
|
/*!**********************************************************************!*\
|
|
|
!*** ./src/pages/Paths/Detail/components/Sort/index.tsx + 1 modules ***!
|
|
|
\**********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ Sort; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tree/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(62216);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tree/index.js + 9 modules
|
|
|
var tree = __webpack_require__(54205);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
|
|
|
var row_style = __webpack_require__(13062);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
|
var row = __webpack_require__(71230);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
|
var button_style = __webpack_require__(29913);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(71577);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/style/index.js
|
|
|
var col_style = __webpack_require__(89032);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/index.js
|
|
|
var col = __webpack_require__(15746);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
|
|
|
var tooltip_style = __webpack_require__(38390);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(84908);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
|
var message_style = __webpack_require__(14934);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
|
var message = __webpack_require__(12461);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
|
var modal_style = __webpack_require__(35611);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
|
var modal = __webpack_require__(85402);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(861);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(70215);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/style/index.js + 1 modules
|
|
|
var select_style = __webpack_require__(95985);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/select/index.js
|
|
|
var es_select = __webpack_require__(34041);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/FormOutlined.js + 1 modules
|
|
|
var FormOutlined = __webpack_require__(77123);
|
|
|
// EXTERNAL MODULE: ./src/service/paths.ts
|
|
|
var paths = __webpack_require__(29533);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(29427);
|
|
|
// EXTERNAL MODULE: ./src/service/video.ts
|
|
|
var video = __webpack_require__(43196);
|
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
|
var exercise = __webpack_require__(51412);
|
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
|
var shixuns = __webpack_require__(56088);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/Detail/components/Sort/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Sortmodules = ({"tree":"tree___SHCwq","learn":"learn___buOG9","name":"name___dwQwe","sign":"sign___aQzc5"});
|
|
|
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
|
|
|
var lodash = __webpack_require__(96486);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/DownOutlined.js
|
|
|
var DownOutlined = __webpack_require__(39300);
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/RightOutlined.js
|
|
|
var RightOutlined = __webpack_require__(43929);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(7);
|
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 3 modules
|
|
|
var verifyLogin = __webpack_require__(72551);
|
|
|
// EXTERNAL MODULE: ./src/utils/shixunExec.tsx
|
|
|
var shixunExec = __webpack_require__(76943);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(59758);
|
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
|
var AsyncButton = __webpack_require__(48559);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/Detail/components/Sort/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["pathsDetail", "globalSetting", "user", "loading", "visibleType", "updateSort", "isPaths", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Option = es_select/* default.Option */.Z.Option;
|
|
|
var SendToClassModal = function SendToClassModal(_ref) {
|
|
|
var pathsDetail = _ref.pathsDetail,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
user = _ref.user,
|
|
|
loading = _ref.loading,
|
|
|
visibleType = _ref.visibleType,
|
|
|
updateSort = _ref.updateSort,
|
|
|
isPaths = _ref.isPaths,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var _useState = (0,react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
openkeys = _useState2[0],
|
|
|
setOpenkeys = _useState2[1];
|
|
|
var _useState3 = (0,react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
openkeysAll = _useState4[0],
|
|
|
setOpenkeysAll = _useState4[1];
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _useState5 = (0,react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
gData = _useState6[0],
|
|
|
setGdata = _useState6[1];
|
|
|
var _useState7 = (0,react.useState)({}),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
currentCourse = _useState8[0],
|
|
|
setCurrentCourse = _useState8[1];
|
|
|
(0,react.useEffect)(function () {
|
|
|
if (props.data && !(0,lodash.isEqual)(props.data, gData)) {
|
|
|
openkeysAll = [];
|
|
|
var data = JSON.parse(JSON.stringify(props.data));
|
|
|
loopIndex(data, 0);
|
|
|
setGdata(toConsumableArray_default()(data));
|
|
|
if (visibleType != 'All') setOpenkeys(toConsumableArray_default()(openkeysAll));else setOpenkeys([]);
|
|
|
}
|
|
|
}, [JSON.stringify(props.data), visibleType]);
|
|
|
(0,react.useEffect)(function () {
|
|
|
var _pathsDetail$detail, _pathsDetail$detail5;
|
|
|
var currentNumber;
|
|
|
if ((_pathsDetail$detail = pathsDetail.detail) !== null && _pathsDetail$detail !== void 0 && _pathsDetail$detail.has_start) {
|
|
|
var _pathsDetail$detail2, _pathsDetail$detail2$;
|
|
|
var findIndex = (_pathsDetail$detail2 = pathsDetail.detail) === null || _pathsDetail$detail2 === void 0 ? void 0 : (_pathsDetail$detail2$ = _pathsDetail$detail2.courses) === null || _pathsDetail$detail2$ === void 0 ? void 0 : _pathsDetail$detail2$.findIndex(function (item) {
|
|
|
var _item$course_status;
|
|
|
return parseInt((_item$course_status = item.course_status) === null || _item$course_status === void 0 ? void 0 : _item$course_status.status) === 1;
|
|
|
});
|
|
|
currentNumber = findIndex > -1 ? findIndex : 0;
|
|
|
} else {
|
|
|
var _pathsDetail$detail3, _pathsDetail$detail3$, _pathsDetail$detail3$2, _pathsDetail$detail4, _pathsDetail$detail4$;
|
|
|
var _findIndex = (_pathsDetail$detail3 = pathsDetail.detail) === null || _pathsDetail$detail3 === void 0 ? void 0 : (_pathsDetail$detail3$ = _pathsDetail$detail3.courses) === null || _pathsDetail$detail3$ === void 0 ? void 0 : (_pathsDetail$detail3$2 = _pathsDetail$detail3$.map(function (item) {
|
|
|
var _item$course_status2;
|
|
|
return parseInt((_item$course_status2 = item.course_status) === null || _item$course_status2 === void 0 ? void 0 : _item$course_status2.status);
|
|
|
})) === null || _pathsDetail$detail3$2 === void 0 ? void 0 : _pathsDetail$detail3$2.lastIndexOf(2);
|
|
|
currentNumber = _findIndex > -1 ? _findIndex : 0;
|
|
|
_findIndex = (_pathsDetail$detail4 = pathsDetail.detail) === null || _pathsDetail$detail4 === void 0 ? void 0 : (_pathsDetail$detail4$ = _pathsDetail$detail4.courses) === null || _pathsDetail$detail4$ === void 0 ? void 0 : _pathsDetail$detail4$.findIndex(function (item) {
|
|
|
var _item$course_status3;
|
|
|
return parseInt((_item$course_status3 = item.course_status) === null || _item$course_status3 === void 0 ? void 0 : _item$course_status3.status) === 0;
|
|
|
});
|
|
|
currentNumber = _findIndex > -1 ? _findIndex : currentNumber;
|
|
|
}
|
|
|
if ((_pathsDetail$detail5 = pathsDetail.detail) !== null && _pathsDetail$detail5 !== void 0 && _pathsDetail$detail5.courses) {
|
|
|
var _pathsDetail$detail6;
|
|
|
setCurrentCourse(((_pathsDetail$detail6 = pathsDetail.detail) === null || _pathsDetail$detail6 === void 0 ? void 0 : _pathsDetail$detail6.courses[currentNumber]) || {});
|
|
|
// console.log('----1232132132--',moment(pathsDetail.detail?.courses[currentNumber]?.end_date).unix());
|
|
|
// 1612627200
|
|
|
// 1612504250
|
|
|
// console.log('-----12321321-',moment(moment().format('YYYY-MM-DD HH:mm:s')).unix());
|
|
|
}
|
|
|
}, [pathsDetail.detail]);
|
|
|
var handleDeleteShixun = function handleDeleteShixun(key, type) {
|
|
|
modal/* default.confirm */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
content: '确定删除该实训吗?',
|
|
|
onOk: function onOk() {
|
|
|
// data[editKey][type || 'shixuns_list'].splice(key, 1)
|
|
|
// message.success("删除成功")
|
|
|
// setData([...data])
|
|
|
// onFinish(form.getFieldsValue(), type);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handleDeleteStage = function handleDeleteStage(id) {
|
|
|
modal/* default.confirm */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
content: '确定删除该章节吗?',
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var toShixun = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(id, is_jupyter) {
|
|
|
var execRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: 'globalSetting/setGlobalLoading',
|
|
|
payload: {
|
|
|
show: true,
|
|
|
text: '正在进入实训,请稍后...'
|
|
|
}
|
|
|
});
|
|
|
if (!is_jupyter) {
|
|
|
_context2.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
_context2.next = 4;
|
|
|
return (0,shixuns/* execJupyter */.BK)({
|
|
|
id: id
|
|
|
});
|
|
|
case 4:
|
|
|
_context2.t0 = _context2.sent;
|
|
|
_context2.next = 10;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context2.next = 9;
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
id: id
|
|
|
});
|
|
|
case 9:
|
|
|
_context2.t0 = _context2.sent;
|
|
|
case 10:
|
|
|
execRes = _context2.t0;
|
|
|
dispatch({
|
|
|
type: 'globalSetting/setGlobalLoading',
|
|
|
payload: {
|
|
|
show: false,
|
|
|
text: ''
|
|
|
}
|
|
|
});
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier || execRes !== null && execRes !== void 0 && execRes.identifier)) {
|
|
|
_context2.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
(0,util/* openNewWindow */.xg)(is_jupyter ? "/tasks/".concat(execRes === null || execRes === void 0 ? void 0 : execRes.identifier, "/jupyter") : "/tasks/".concat(execRes.game_identifier, "?subject_id=").concat(params.pathId || ''));
|
|
|
return _context2.abrupt("return");
|
|
|
case 15:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === -3) {
|
|
|
(0,util/* bindPhone */.eF)();
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 16:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function toShixun(_x, _x2) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleResetGame = function handleResetGame(url) {
|
|
|
var _url;
|
|
|
url = (_url = url) !== null && _url !== void 0 && _url.includes('.json') ? url : "".concat(url, ".json");
|
|
|
modal/* default.confirm */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: "\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var res, execRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,exercise/* resetMyGame */.$Q)({
|
|
|
url: url
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if (res) {
|
|
|
_context3.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return");
|
|
|
case 5:
|
|
|
message/* default.success */.ZP.success('重置成功,正在进入实训!');
|
|
|
_context3.next = 8;
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
id: res.shixun_identifier
|
|
|
});
|
|
|
case 8:
|
|
|
execRes = _context3.sent;
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context3.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
(0,util/* openNewWindow */.xg)("/tasks/".concat(execRes.game_identifier));
|
|
|
return _context3.abrupt("return");
|
|
|
case 12:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var handleInBeta = function handleInBeta(message) {
|
|
|
modal/* default.confirm */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc font16",
|
|
|
children: ["\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01"]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var onDragEnter = function onDragEnter(info) {
|
|
|
console.log('onDragEnter:', info);
|
|
|
};
|
|
|
var onDrop = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(info) {
|
|
|
var dropKey, dragKey, dropPos, dropPosition, loop, data, dragObj, ar, i;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
console.log('onDrop:', info);
|
|
|
dropKey = info.node.props.eventKey;
|
|
|
dragKey = info.dragNode.props.eventKey;
|
|
|
dropPos = info.node.props.pos.split('-');
|
|
|
dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]);
|
|
|
if (!(dropPos.length > 2 && !info.node.dragOverGapBottom && !info.node.dragOverGapTop)) {
|
|
|
_context4.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
return _context4.abrupt("return", false);
|
|
|
case 7:
|
|
|
if (!(info.node.dragOver && info.dragNodesKeys.length > 1)) {
|
|
|
_context4.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
return _context4.abrupt("return", false);
|
|
|
case 9:
|
|
|
if (!(dropPos.length > 2 && info.dragNodesKeys.length > 1)) {
|
|
|
_context4.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
return _context4.abrupt("return", false);
|
|
|
case 11:
|
|
|
loop = function loop(data, key, callback) {
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
if (data[i].key === key) {
|
|
|
return callback(data[i], i, data);
|
|
|
}
|
|
|
if (data[i].children) {
|
|
|
loop(data[i].children, key, callback);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
data = toConsumableArray_default()(gData); // Find dragObject
|
|
|
loop(data, dragKey, function (item, index, arr) {
|
|
|
arr.splice(index, 1);
|
|
|
dragObj = item;
|
|
|
});
|
|
|
if (!info.dropToGap) {
|
|
|
// Drop on the content
|
|
|
loop(data, dropKey, function (item) {
|
|
|
item.children = item.children || [];
|
|
|
// where to insert 示例添加到头部,可以是随意位置
|
|
|
item.children.unshift(dragObj);
|
|
|
});
|
|
|
} else if ((info.node.props.children || []).length > 0 &&
|
|
|
// Has children
|
|
|
info.node.props.expanded &&
|
|
|
// Is expanded
|
|
|
dropPosition === 1 // On the bottom gap
|
|
|
) {
|
|
|
loop(data, dropKey, function (item) {
|
|
|
item.children = item.children || [];
|
|
|
// where to insert 示例添加到头部,可以是随意位置
|
|
|
item.children.unshift(dragObj);
|
|
|
// in previous version, we use item.children.push(dragObj) to insert the
|
|
|
// item to the tail of the children
|
|
|
});
|
|
|
} else {
|
|
|
loop(data, dropKey, function (item, index, arr) {
|
|
|
ar = arr;
|
|
|
i = index;
|
|
|
});
|
|
|
if (dropPosition === -1) {
|
|
|
ar.splice(i, 0, dragObj);
|
|
|
} else {
|
|
|
ar.splice(i + 1, 0, dragObj);
|
|
|
}
|
|
|
}
|
|
|
_context4.next = 17;
|
|
|
return updateSort({
|
|
|
stage_id: props.stage_id,
|
|
|
list: data
|
|
|
});
|
|
|
case 17:
|
|
|
loopIndex(data, 0, 0, true);
|
|
|
console.log('data:', data);
|
|
|
setGdata(toConsumableArray_default()(data));
|
|
|
setOpenkeys([].concat(toConsumableArray_default()(openkeys), [info.node.key]));
|
|
|
case 21:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function onDrop(_x3) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var loopIndex = function loopIndex(d, i, pk, sort) {
|
|
|
i = i || 0;
|
|
|
d.map(function (item, index) {
|
|
|
try {
|
|
|
var _item$children;
|
|
|
item.key2 = i + 1 + '-' + (index + 1);
|
|
|
item.key3 = props.index + 1 + '-' + (index + 1);
|
|
|
item.title = '';
|
|
|
if (!sort) item.key = i + 1 + '-' + (index + 1);
|
|
|
if (i) {
|
|
|
item.index = pk + '-' + (index + 1);
|
|
|
} else {
|
|
|
item.index = item.key3;
|
|
|
}
|
|
|
if (!!((_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length)) {
|
|
|
openkeysAll.push(item.key2);
|
|
|
loopIndex(item.children, item.key2, item.index, sort);
|
|
|
}
|
|
|
return item;
|
|
|
} catch (e) {}
|
|
|
});
|
|
|
};
|
|
|
var renderName = function renderName(param) {
|
|
|
var learning_status = param.learning_status,
|
|
|
name = param.name;
|
|
|
var bool = (learning_status === null || learning_status === void 0 ? void 0 : learning_status[0]) === 'can' && (learning_status === null || learning_status === void 0 ? void 0 : learning_status[1]) === 'try';
|
|
|
if (bool) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Sortmodules.learn,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Sortmodules.name,
|
|
|
children: name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Sortmodules.sign,
|
|
|
children: "\u514D\u8D39\u8BD5\u5B66"
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
return name;
|
|
|
};
|
|
|
var handleExpand = function handleExpand(key) {
|
|
|
if (visibleType !== 'All') return;
|
|
|
if (openkeys.includes(key)) {
|
|
|
setOpenkeys(openkeys.filter(function (item) {
|
|
|
return item != key;
|
|
|
}));
|
|
|
} else {
|
|
|
setOpenkeys(openkeys.concat(key));
|
|
|
}
|
|
|
};
|
|
|
var handleToShixun = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(item) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
if ((0,verifyLogin/* handleVerify */.tJ)(dispatch, true)) {
|
|
|
_context5.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context5.abrupt("return");
|
|
|
case 2:
|
|
|
if (!(item !== null && item !== void 0 && item.need_authorize)) {
|
|
|
_context5.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
(0,verifyLogin/* AuthorizeModel */.rX)(false);
|
|
|
return _context5.abrupt("return");
|
|
|
case 5:
|
|
|
if (!(currentCourse !== null && currentCourse !== void 0 && currentCourse.course_id)) {
|
|
|
_context5.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
_context5.next = 8;
|
|
|
return (0,paths/* immediatelyRegister */.JS)({
|
|
|
id: currentCourse === null || currentCourse === void 0 ? void 0 : currentCourse.course_id
|
|
|
});
|
|
|
case 8:
|
|
|
toShixun(item.identifier, item.is_jupyter || item.is_jupyter_lab);
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function handleToShixun(_x4) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var toStudentVideo = /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(item) {
|
|
|
var _user$userInfo, _user$userInfo2, _item$name, _item$name2;
|
|
|
var realUrl, type, _pathsDetail$detail7;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
if ((0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
_context6.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context6.abrupt("return");
|
|
|
case 2:
|
|
|
if (!(!((_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && _user$userInfo.admin) && !((_user$userInfo2 = user.userInfo) !== null && _user$userInfo2 !== void 0 && _user$userInfo2.business) && !item.can_view && item.item_type !== 'Attachment')) {
|
|
|
_context6.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
return _context6.abrupt("return", modal/* default.info */.Z.info({
|
|
|
centered: true,
|
|
|
width: 400,
|
|
|
okText: '知道啦',
|
|
|
icon: null,
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font14",
|
|
|
children: "\u5F53\u524D\u89C6\u9891\u4E3A\u521B\u5EFA\u8005\u6240\u5C5E\u5355\u4F4D\u5185\u90E8\u6559\u5B66\u8D44\u6599\uFF0C\u5916\u5355\u4F4D\u7528\u6237\u65E0\u89C2\u770B\u6743\u9650"
|
|
|
})
|
|
|
}));
|
|
|
case 4:
|
|
|
if (item.link) {
|
|
|
(0,video/* viewVideo */.DH)({
|
|
|
is_f: 1,
|
|
|
id: item.id,
|
|
|
point: 0,
|
|
|
total: 0
|
|
|
});
|
|
|
}
|
|
|
realUrl = props !== null && props !== void 0 && props.course_id ? "course_id=".concat(props === null || props === void 0 ? void 0 : props.course_id) : "subject_id=".concat(params.pathId || props.subject_id);
|
|
|
type = item === null || item === void 0 ? void 0 : (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.substr(item === null || item === void 0 ? void 0 : (_item$name2 = item.name) === null || _item$name2 === void 0 ? void 0 : _item$name2.lastIndexOf('.'));
|
|
|
if (!(type.toUpperCase() === ".ZIP")) {
|
|
|
_context6.next = 14;
|
|
|
break;
|
|
|
}
|
|
|
if ((_pathsDetail$detail7 = pathsDetail.detail) !== null && _pathsDetail$detail7 !== void 0 && _pathsDetail$detail7.allow_download) {
|
|
|
_context6.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
message/* default.info */.ZP.info('教学课件不支持下载');
|
|
|
return _context6.abrupt("return");
|
|
|
case 11:
|
|
|
(0,util/* downLoadFile */.FH)(item.name, env/* default.API_SERVER */.Z.API_SERVER + item.url);
|
|
|
// (item.url);
|
|
|
_context6.next = 15;
|
|
|
break;
|
|
|
case 14:
|
|
|
(0,util/* openNewWindow */.xg)(item.link || "/video/".concat(item.id, "?").concat(realUrl));
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function toStudentVideo(_x5) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var loadIcon = function loadIcon(nodeData) {
|
|
|
var icon;
|
|
|
if (nodeData.item_type === 'Shixun') {
|
|
|
if (nodeData.is_all_choice) {
|
|
|
icon = /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u9009\u62E9\u9898",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xuanzeti3 c-lake-blue font20"
|
|
|
})
|
|
|
});
|
|
|
} else {
|
|
|
icon = /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5B9E\u8BAD\u9898",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shixunti2 c-light-primary font20"
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
} else if (nodeData.item_type === 'VideoItem') {
|
|
|
icon = /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shipin2 c-purple-8C1 font20"
|
|
|
});
|
|
|
} else if (nodeData.item_type === 'StageCatalog') {
|
|
|
icon = /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-kongbai c-brilliant-blue font20"
|
|
|
});
|
|
|
} else {
|
|
|
icon = /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-kejian1 c-cyan-blue font20"
|
|
|
});
|
|
|
}
|
|
|
return icon;
|
|
|
{
|
|
|
nodeData.item_type === 'Shixun' ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shixunti2 c-light-primary font20"
|
|
|
}) :
|
|
|
// nodeData.item_type === 'VideoItem' ? <i className="iconfont icon-shipin2 c-purple-8C1 font20" /> :
|
|
|
nodeData.item_type === 'StageCatalog' ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-kongbai c-brilliant-blue font20"
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-kejian1 c-cyan-blue font20"
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tree/* default */.Z, {
|
|
|
// showLine
|
|
|
// switcherIcon={<DownOutlined />}
|
|
|
className: Sortmodules.tree,
|
|
|
disabled: props.disabled
|
|
|
// defaultExpandAll
|
|
|
// autoExpandParent={true}
|
|
|
,
|
|
|
expandedKeys: toConsumableArray_default()(openkeys),
|
|
|
draggable: true,
|
|
|
onDragEnter: onDragEnter,
|
|
|
onDrop: onDrop,
|
|
|
onExpand: handleExpand
|
|
|
// showIcon={false}
|
|
|
// switcherIcon={null}
|
|
|
,
|
|
|
blockNode: true,
|
|
|
titleRender: function titleRender(nodeData) {
|
|
|
var _nodeData$learning_st, _nodeData$schools, _nodeData$children;
|
|
|
var item = nodeData;
|
|
|
if (item.item_type !== visibleType && visibleType !== 'All') {
|
|
|
return null;
|
|
|
}
|
|
|
//普通课程付费和试学
|
|
|
var bool = nodeData.index.slice(0, 1) === '1';
|
|
|
var notCollectPay = (nodeData === null || nodeData === void 0 ? void 0 : (_nodeData$learning_st = nodeData.learning_status) === null || _nodeData$learning_st === void 0 ? void 0 : _nodeData$learning_st[0]) === 'can';
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
className: "font14",
|
|
|
onClick: function onClick() {
|
|
|
return handleExpand(item.key);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "30px",
|
|
|
children: loadIcon(nodeData)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
className: "c-grey-333",
|
|
|
children: [props.cust_seq && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr10"
|
|
|
// style={{flexShrink:0}}
|
|
|
,
|
|
|
children: nodeData.index
|
|
|
}), nodeData.item_type !== 'Attachment' && renderName(nodeData), nodeData.item_type === 'Attachment' && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
target: "_blank",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
if ((0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
_context7.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context7.abrupt("return");
|
|
|
case 2:
|
|
|
if (!(currentCourse !== null && currentCourse !== void 0 && currentCourse.course_id)) {
|
|
|
_context7.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
_context7.next = 5;
|
|
|
return (0,paths/* immediatelyRegister */.JS)({
|
|
|
id: currentCourse === null || currentCourse === void 0 ? void 0 : currentCourse.course_id
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context7.sent;
|
|
|
case 6:
|
|
|
_context7.t0 = nodeData.item_type;
|
|
|
_context7.next = _context7.t0 === 'Attachment' ? 9 : _context7.t0 === 'VideoItem' ? 11 : _context7.t0 === 'Shixun' ? 13 : 15;
|
|
|
break;
|
|
|
case 9:
|
|
|
// openNewWindow(nodeData.url);
|
|
|
toStudentVideo(item);
|
|
|
return _context7.abrupt("break", 15);
|
|
|
case 11:
|
|
|
toStudentVideo(nodeData);
|
|
|
return _context7.abrupt("break", 15);
|
|
|
case 13:
|
|
|
handleToShixun(nodeData);
|
|
|
return _context7.abrupt("break", 15);
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
})),
|
|
|
children: nodeData.name
|
|
|
}), nodeData.item_type === 'Shixun' && nodeData.is_unity_3d && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
background: '#a300d8',
|
|
|
color: '#fff',
|
|
|
borderRadius: '13px',
|
|
|
marginLeft: '5px',
|
|
|
width: '68px',
|
|
|
height: '20px',
|
|
|
display: 'inline-block',
|
|
|
textAlign: 'center',
|
|
|
fontSize: '12px'
|
|
|
},
|
|
|
children: "\u865A\u62DF\u4EFF\u771F"
|
|
|
}), nodeData.item_type === 'Shixun' && nodeData.is_jupyter_lab && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
background: '#ff6802',
|
|
|
color: '#fff',
|
|
|
borderRadius: '13px',
|
|
|
marginLeft: '5px',
|
|
|
width: '76px',
|
|
|
height: '20px',
|
|
|
display: 'inline-block',
|
|
|
textAlign: 'center',
|
|
|
fontSize: '12px'
|
|
|
},
|
|
|
children: "JupyterLab"
|
|
|
}), nodeData.item_type === 'Shixun' && nodeData.is_jupyter && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
background: '#ff6802',
|
|
|
color: '#fff',
|
|
|
borderRadius: '13px',
|
|
|
marginLeft: '5px',
|
|
|
width: '112px',
|
|
|
height: '20px',
|
|
|
display: 'inline-block',
|
|
|
textAlign: 'center',
|
|
|
fontSize: '12px'
|
|
|
},
|
|
|
children: "Jupyter Notebook"
|
|
|
}), !!((_nodeData$schools = nodeData.schools) !== null && _nodeData$schools !== void 0 && _nodeData$schools.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u8BE5\u5B9E\u8DF5\u9879\u76EE\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-zhidinggongkai1 ml10 c-orange",
|
|
|
style: {
|
|
|
transform: 'translateY(1px)',
|
|
|
display: 'inline-block'
|
|
|
} //1px对齐
|
|
|
})
|
|
|
}), nodeData.item_type === 'Shixun' && !!(nodeData !== null && nodeData !== void 0 && nodeData.finished_challenges_count) && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5B8C\u6210\u5EA6:".concat(Math.round((nodeData === null || nodeData === void 0 ? void 0 : nodeData.finished_challenges_count) / (nodeData === null || nodeData === void 0 ? void 0 : nodeData.challenges_count) * 100), "%"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-a-wanchengdu100 ml10 ".concat((nodeData === null || nodeData === void 0 ? void 0 : nodeData.finished_challenges_count) - (nodeData === null || nodeData === void 0 ? void 0 : nodeData.challenges_count) === 0 ? 'c-light-green' : 'c-grey-333'),
|
|
|
style: {
|
|
|
transform: 'translateY(1px)',
|
|
|
display: 'inline-block'
|
|
|
} //1px对齐
|
|
|
})
|
|
|
})]
|
|
|
}), !props.disabled && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
style: {
|
|
|
color: '#0152d9',
|
|
|
fontSize: '14px',
|
|
|
marginRight: '20px'
|
|
|
},
|
|
|
children: "\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u9879\u76EE\u663E\u793A\u987A\u5E8F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: "tr",
|
|
|
children: [(item.item_type === 'VideoItem' || (item === null || item === void 0 ? void 0 : item.item_type) === "Attachment" || (item === null || item === void 0 ? void 0 : item.item_type) === 'StageCatalog') && !props.disabled && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u7F16\u8F91",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
props.editVidoItem(objectSpread2_default()({
|
|
|
stage_id: props.stage_id
|
|
|
}, item));
|
|
|
},
|
|
|
style: {
|
|
|
color: '#ccc',
|
|
|
marginRight: '10px'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(FormOutlined/* default */.Z, {})
|
|
|
})
|
|
|
}), !props.disabled && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
props.deleteStages({
|
|
|
id: item.stage_item_id,
|
|
|
stage_id: props.stage_id
|
|
|
});
|
|
|
},
|
|
|
className: "iconfont icon-shanchu c-grey-c"
|
|
|
})
|
|
|
})
|
|
|
}), props.showVideoPlay && props.disabled &&
|
|
|
// ((moment(currentCourse?.end_date).unix()>moment(moment().format('YYYY-MM-DD HH:mm:s')).unix()&&moment(currentCourse?.start_date).unix()<moment(moment().format('YYYY-MM-DD HH:mm:s')).unix())||user.userInfo?.admin ||user.userInfo?.business || item.can_view)&&
|
|
|
item.item_type === 'VideoItem' && notCollectPay && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
children: [!(0,authority/* isCommonStudent */.JA)() && isPaths && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
className: "mr10",
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
if ((0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
_context8.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context8.abrupt("return");
|
|
|
case 2:
|
|
|
dispatch({
|
|
|
type: 'shixunsDetail/setActionTabs',
|
|
|
payload: {
|
|
|
key: 'Stage-SendModal',
|
|
|
params: {
|
|
|
id: item.stage_item_id,
|
|
|
title: '视频'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee8);
|
|
|
})),
|
|
|
children: "\u53D1\u9001"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
case 0:
|
|
|
// if (pathsDetail.detail?.excellent) {
|
|
|
// if(!pathsDetail.detail?.has_start&¤tCourse?.course_status?.status===2){
|
|
|
// message.info(`本课程第${pathsDetail.detail?.courses?.length}期课程已经结束,请等待下期开课`)
|
|
|
// return
|
|
|
// }
|
|
|
// if(!pathsDetail.detail?.has_start){
|
|
|
// if(currentCourse?.start_date){
|
|
|
// message.info(`本开放课程将于${currentCourse?.start_date}开课,敬请期待`)
|
|
|
// }else{
|
|
|
// message.info('本开放课程暂未开课,敬请期待')
|
|
|
// }
|
|
|
// return
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
toStudentVideo(item);
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context9.stop();
|
|
|
}
|
|
|
}, _callee9);
|
|
|
})),
|
|
|
children: item.last_point > 0 ? '继续学习' : '开始学习'
|
|
|
})]
|
|
|
}), (item.allow_visit || item.to_be_built || !item.shixun_status) && props.disabled && item.item_type === 'Shixun' && notCollectPay &&
|
|
|
/*#__PURE__*/
|
|
|
// ((moment(currentCourse?.end_date).unix()>moment(moment().format('YYYY-MM-DD HH:mm:s')).unix()&&moment(currentCourse?.start_date).unix()<moment(moment().format('YYYY-MM-DD HH:mm:s')).unix())||user.userInfo?.admin ||user.userInfo?.business || item.can_view)&&
|
|
|
(0,jsx_runtime.jsxs)("aside", {
|
|
|
children: [!(0,authority/* isCommonStudent */.JA)() && isPaths && !item.shixun_status && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
className: "ml10",
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
case 0:
|
|
|
if ((0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
_context10.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context10.abrupt("return");
|
|
|
case 2:
|
|
|
dispatch({
|
|
|
type: 'shixunsDetail/setActionTabs',
|
|
|
payload: {
|
|
|
key: 'Stage-SendModal',
|
|
|
params: {
|
|
|
id: item.stage_item_id,
|
|
|
title: '实训',
|
|
|
is_jupyter: item === null || item === void 0 ? void 0 : item.is_jupyter,
|
|
|
identifier: item === null || item === void 0 ? void 0 : item.identifier
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context10.stop();
|
|
|
}
|
|
|
}, _callee10);
|
|
|
})),
|
|
|
children: "\u53D1\u9001"
|
|
|
}), !(0,authority/* isCommonStudent */.JA)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
|
className: "ml10",
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
|
|
|
while (1) switch (_context11.prev = _context11.next) {
|
|
|
case 0:
|
|
|
if ((0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
_context11.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context11.abrupt("return");
|
|
|
case 2:
|
|
|
if (!(currentCourse !== null && currentCourse !== void 0 && currentCourse.course_id)) {
|
|
|
_context11.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
_context11.next = 5;
|
|
|
return (0,paths/* immediatelyRegister */.JS)({
|
|
|
id: currentCourse === null || currentCourse === void 0 ? void 0 : currentCourse.course_id
|
|
|
});
|
|
|
case 5:
|
|
|
window.open("/shixuns/".concat(item.identifier, "/challenges"));
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context11.stop();
|
|
|
}
|
|
|
}, _callee11);
|
|
|
})),
|
|
|
children: "\u67E5\u770B\u8BE6\u60C5"
|
|
|
}), !item.shixun_status && /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
|
|
|
className: "ml10",
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
|
|
|
var hasShixun;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
|
|
|
while (1) switch (_context12.prev = _context12.next) {
|
|
|
case 0:
|
|
|
_context12.next = 2;
|
|
|
return (0,shixunExec/* checkShixunInClassroom */._)(item.id, {
|
|
|
is_jupyter: item.is_jupyter,
|
|
|
is_jupyter_lab: item.is_jupyter_lab
|
|
|
});
|
|
|
case 2:
|
|
|
hasShixun = _context12.sent;
|
|
|
if (!hasShixun) {
|
|
|
handleToShixun(item);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context12.stop();
|
|
|
}
|
|
|
}, _callee12);
|
|
|
})),
|
|
|
children: item !== null && item !== void 0 && item.need_authorize ? '需授权' : !(nodeData !== null && nodeData !== void 0 && nodeData.finished_challenges_count) ? '开始实战' : (nodeData === null || nodeData === void 0 ? void 0 : nodeData.finished_challenges_count) - (nodeData === null || nodeData === void 0 ? void 0 : nodeData.challenges_count) === 0 ? '再次实战' : '继续实战'
|
|
|
})]
|
|
|
}),
|
|
|
// editKey === -1 &&
|
|
|
props.disabled &&
|
|
|
// !item.allow_visit &&
|
|
|
// !item.to_be_built &&
|
|
|
item.shixun_status === '暂未公开' && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Sortmodules.color204, " ml5"),
|
|
|
children: "\u6682\u672A\u53D1\u5E03"
|
|
|
}),
|
|
|
// editKey === -1 &&
|
|
|
// !item.allow_visit &&
|
|
|
// !item.to_be_built &&
|
|
|
item.shixun_status === '已删除' && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Sortmodules.color204, " ml5"),
|
|
|
children: "\u5DF2\u5220\u9664"
|
|
|
}), props.disabled && item.item_type === 'Shixun' && !!item.challenges_count && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "exper\u02C6iment-number ml5 c-grey-999",
|
|
|
children: ["\u5B9E\u9A8C\u6570 ", item.challenges_count]
|
|
|
}), visibleType === 'All' && !!((_nodeData$children = nodeData.children) !== null && _nodeData$children !== void 0 && _nodeData$children.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml10",
|
|
|
children: openkeys.includes(nodeData.key) ? /*#__PURE__*/(0,jsx_runtime.jsx)(DownOutlined/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RightOutlined/* default */.Z, {})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
// onSelect={handleExpand}
|
|
|
,
|
|
|
treeData: gData
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Sort = ((0,_umi_production_exports.connect)(function (_ref12) {
|
|
|
var pathsDetail = _ref12.pathsDetail,
|
|
|
loading = _ref12.loading,
|
|
|
user = _ref12.user,
|
|
|
globalSetting = _ref12.globalSetting;
|
|
|
return {
|
|
|
pathsDetail: pathsDetail,
|
|
|
globalSetting: globalSetting,
|
|
|
user: user,
|
|
|
loading: loading.effects
|
|
|
};
|
|
|
})(SendToClassModal));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 53619:
|
|
|
/*!*******************************************************************************!*\
|
|
|
!*** ./src/pages/Video/Detail/components/AddVideoModal/index.tsx + 1 modules ***!
|
|
|
\*******************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"Z": function() { return /* binding */ components_AddVideoModal; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tag/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(71114);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tag/index.js + 1 modules
|
|
|
var tag = __webpack_require__(20550);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/progress/style/index.js + 1 modules
|
|
|
var progress_style = __webpack_require__(57273);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/progress/index.js + 10 modules
|
|
|
var progress = __webpack_require__(97910);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
|
var modal_style = __webpack_require__(35611);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
|
var modal = __webpack_require__(85402);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
|
var message_style = __webpack_require__(14934);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
|
var message = __webpack_require__(12461);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js + 1 modules
|
|
|
var form_style = __webpack_require__(75627);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
|
var es_form = __webpack_require__(51018);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(27424);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(861);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
|
|
|
var input_style = __webpack_require__(69463);
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(75008);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
|
var react = __webpack_require__(67294);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Video/Detail/components/AddVideoModal/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var AddVideoModalmodules = ({"modal":"modal___EKlPQ","uploadWrap":"uploadWrap___YGxav","upload":"upload___ouqG9","uploadLink":"uploadLink___nuif6","fileProgress":"fileProgress___tf4qy","fileCancel":"fileCancel___Bh3Wh","videoName":"videoName___Ra0NM","contentItem":"contentItem___zMdIq","tagsList-content":"tagsList-content___sDVph"});
|
|
|
// EXTERNAL MODULE: ./src/utils/aliyunUpload.ts
|
|
|
var aliyunUpload = __webpack_require__(77320);
|
|
|
// EXTERNAL MODULE: ./src/components/CoverUpload/index.tsx + 1 modules
|
|
|
var CoverUpload = __webpack_require__(93899);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(7);
|
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Video/Detail/components/AddVideoModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TextArea = input/* default.TextArea */.Z.TextArea;
|
|
|
var MAX_FILE_SIZE = 1024;
|
|
|
var videoReducer = function videoReducer(state, action) {
|
|
|
var _state$videoList;
|
|
|
var _ref = action.payload || {},
|
|
|
_ref$uploadInfo = _ref.uploadInfo,
|
|
|
uploadInfo = _ref$uploadInfo === void 0 ? {} : _ref$uploadInfo;
|
|
|
switch (action.type) {
|
|
|
case 'addVideo':
|
|
|
return {
|
|
|
videoList: [].concat(toConsumableArray_default()(state.videoList), [{
|
|
|
name: uploadInfo.file.name,
|
|
|
size: uploadInfo.file.size,
|
|
|
type: uploadInfo.file.type,
|
|
|
fileHash: uploadInfo.fileHash,
|
|
|
state: uploadInfo.state,
|
|
|
videoId: uploadInfo.videoId,
|
|
|
loaded: uploadInfo.loaded || 0,
|
|
|
title: ''
|
|
|
}])
|
|
|
};
|
|
|
case 'removeVideo':
|
|
|
return {
|
|
|
videoList: state.videoList.filter(function (item) {
|
|
|
return item.name !== action.payload.name;
|
|
|
})
|
|
|
};
|
|
|
case 'removeAll':
|
|
|
return {
|
|
|
videoList: []
|
|
|
};
|
|
|
case 'updateProgress':
|
|
|
return {
|
|
|
videoList: state.videoList.map(function (item) {
|
|
|
if (item.name === action.payload.uploadInfo.file.name) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, item), {
|
|
|
loaded: action.payload.progressPercent,
|
|
|
videoId: uploadInfo.videoId,
|
|
|
fileHash: uploadInfo.fileHash
|
|
|
});
|
|
|
}
|
|
|
return item;
|
|
|
})
|
|
|
};
|
|
|
case 'updateTitle':
|
|
|
return {
|
|
|
videoList: (_state$videoList = state.videoList) === null || _state$videoList === void 0 ? void 0 : _state$videoList.map(function (video) {
|
|
|
if (video.name === action.payload.item.name) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, video), {
|
|
|
title: action.payload.title
|
|
|
});
|
|
|
}
|
|
|
return video;
|
|
|
})
|
|
|
};
|
|
|
default:
|
|
|
return {
|
|
|
videoList: []
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
var AddVideoModal = function AddVideoModal(_ref2) {
|
|
|
var _user$userInfo2;
|
|
|
var user = _ref2.user,
|
|
|
globalSetting = _ref2.globalSetting,
|
|
|
loading = _ref2.loading,
|
|
|
dispatch = _ref2.dispatch,
|
|
|
visible = _ref2.visible,
|
|
|
editData = _ref2.editData,
|
|
|
_ref2$onCancel = _ref2.onCancel,
|
|
|
onCancel = _ref2$onCancel === void 0 ? function () {} : _ref2$onCancel,
|
|
|
_ref2$onOk = _ref2.onOk,
|
|
|
onOk = _ref2$onOk === void 0 ? function () {} : _ref2$onOk,
|
|
|
_ref2$queryParams = _ref2.queryParams,
|
|
|
queryParams = _ref2$queryParams === void 0 ? {} : _ref2$queryParams;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useReducer = (0,react.useReducer)(videoReducer, {
|
|
|
videoList: []
|
|
|
}),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
stateDispatch = _useReducer2[1];
|
|
|
var _useState = (0,react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isLoading = _useState2[0],
|
|
|
setIsLoading = _useState2[1];
|
|
|
var uploader = (0,react.useRef)();
|
|
|
var _useState3 = (0,react.useState)(),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
link = _useState4[0],
|
|
|
setLink = _useState4[1];
|
|
|
var _useState5 = (0,react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
showLink = _useState6[0],
|
|
|
setShowLink = _useState6[1];
|
|
|
var _useState7 = (0,react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
isRequestLoading = _useState8[0],
|
|
|
setIsRequestLoading = _useState8[1];
|
|
|
var sizeNum = (0,authority/* isSuperAdmins */.Ny)() ? 3 : 1;
|
|
|
(0,react.useEffect)(function () {
|
|
|
var _editData$tags, _editData$video;
|
|
|
if (!visible) {
|
|
|
return;
|
|
|
}
|
|
|
if (!editData) {
|
|
|
return;
|
|
|
}
|
|
|
setShowLink(editData.is_link);
|
|
|
setLink(editData.link);
|
|
|
!editData.is_link && stateDispatch({
|
|
|
type: 'addVideo',
|
|
|
payload: {
|
|
|
uploadInfo: {
|
|
|
file: {
|
|
|
name: editData.filename || ''
|
|
|
},
|
|
|
videoId: editData.video_id,
|
|
|
loaded: 100
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
setTagslist((editData === null || editData === void 0 ? void 0 : (_editData$tags = editData.tags) === null || _editData$tags === void 0 ? void 0 : _editData$tags.map(function (item) {
|
|
|
return item === null || item === void 0 ? void 0 : item.name;
|
|
|
})) || []);
|
|
|
form.setFieldsValue({
|
|
|
name: editData.name,
|
|
|
description: editData.description,
|
|
|
attachment_id: editData === null || editData === void 0 ? void 0 : (_editData$video = editData.video) === null || _editData$video === void 0 ? void 0 : _editData$video.attachment_id
|
|
|
});
|
|
|
}, [editData, visible]);
|
|
|
var clearInput = function clearInput() {
|
|
|
var input = document.getElementById('fileUpload');
|
|
|
input.value = '';
|
|
|
};
|
|
|
var handleChangeUpload = function handleChangeUpload(e) {
|
|
|
var _state$videoList2;
|
|
|
setShowLink(false);
|
|
|
var file = e.target.files[0];
|
|
|
if (!file) {
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
var fileName = file.name.toLowerCase();
|
|
|
if (fileName && fileName.indexOf('.avi') == -1 && fileName.indexOf('.flv') == -1 && fileName.indexOf('.f4v') == -1 && fileName.indexOf('.m4v') == -1 && fileName.indexOf('.mov') == -1 && fileName.indexOf('.mp4') == -1 && fileName.indexOf('.rmvb') == -1 && fileName.indexOf('.swf') == -1 && fileName.indexOf('.webm') == -1 && fileName.indexOf('.wmv') == -1) {
|
|
|
message/* default.info */.ZP.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F");
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
if (file.size > MAX_FILE_SIZE * sizeNum * 1024 * 1024) {
|
|
|
message/* default.info */.ZP.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7".concat(sizeNum, "G"));
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
if ((_state$videoList2 = state.videoList) !== null && _state$videoList2 !== void 0 && _state$videoList2.find(function (item) {
|
|
|
return item.name === file.name;
|
|
|
})) {
|
|
|
message/* default.info */.ZP.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002");
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
handleUpload(file);
|
|
|
};
|
|
|
var handleRemove = function handleRemove(name, isSuccess) {
|
|
|
modal/* default.confirm */.Z.confirm({
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
children: ["\u60A8\u786E\u8BA4\u8981", isSuccess ? '删除' : '取消上传', "\u8BE5\u89C6\u9891\u5417\uFF1F"]
|
|
|
}),
|
|
|
onOk: function onOk() {
|
|
|
clearInput();
|
|
|
stateDispatch({
|
|
|
type: 'removeVideo',
|
|
|
payload: {
|
|
|
name: name
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handleUpload = function handleUpload(file) {
|
|
|
var _user$userInfo;
|
|
|
var userData = '{"Vod":{}}';
|
|
|
setIsLoading(true);
|
|
|
if (uploader.current) {
|
|
|
uploader.current.addFile(file, null, null, null, userData);
|
|
|
return;
|
|
|
}
|
|
|
(0,aliyunUpload/* getUploader */.o)((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, '', {
|
|
|
create: !uploader,
|
|
|
addFileSuccess: function addFileSuccess(uploadInfo) {
|
|
|
stateDispatch({
|
|
|
type: 'addVideo',
|
|
|
payload: {
|
|
|
uploadInfo: uploadInfo
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
onUploadProgress: function onUploadProgress(uploadInfo, totalSize, progress) {
|
|
|
var progressPercent = Math.ceil(progress * 100);
|
|
|
stateDispatch({
|
|
|
type: 'updateProgress',
|
|
|
payload: {
|
|
|
uploadInfo: uploadInfo,
|
|
|
progressPercent: progressPercent
|
|
|
}
|
|
|
});
|
|
|
clearInput();
|
|
|
},
|
|
|
onUploadFailed: function onUploadFailed(uploadInfo) {
|
|
|
message/* default.info */.ZP.info('视频云服务出现异常,请重新上传。');
|
|
|
},
|
|
|
onUploadEnd: function onUploadEnd(uploadInfo) {
|
|
|
setIsLoading(false);
|
|
|
},
|
|
|
onUploadSucceed: function onUploadSucceed(uploadInfo) {
|
|
|
setIsLoading(false);
|
|
|
},
|
|
|
onUploadError: function onUploadError(uploadInfo) {
|
|
|
setIsLoading(false);
|
|
|
},
|
|
|
gotUploader: function gotUploader(_uploader) {
|
|
|
_uploader.addFile(file, null, null, null, userData);
|
|
|
uploader.current = _uploader;
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handleOk = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _state$videoList3, _state$videoList4;
|
|
|
var video, 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:
|
|
|
if (!(!showLink && !((_state$videoList3 = state.videoList) !== null && _state$videoList3 !== void 0 && _state$videoList3.length) || showLink && !link)) {
|
|
|
_context.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default.info */.ZP.info('请先上传视频或者添加外链');
|
|
|
return _context.abrupt("return");
|
|
|
case 5:
|
|
|
setIsRequestLoading(true);
|
|
|
video = showLink ? {
|
|
|
link: link
|
|
|
} : {
|
|
|
video_id: (_state$videoList4 = state.videoList) === null || _state$videoList4 === void 0 ? void 0 : _state$videoList4[0].videoId
|
|
|
};
|
|
|
_context.next = 9;
|
|
|
return onOk(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, video), queryParams), {
|
|
|
name: form.getFieldValue('name'),
|
|
|
attachment_id: form.getFieldValue('attachment_id'),
|
|
|
description: form.getFieldValue('description'),
|
|
|
tags: tagsList
|
|
|
}));
|
|
|
case 9:
|
|
|
res = _context.sent;
|
|
|
setIsRequestLoading(false);
|
|
|
if (res.id) {
|
|
|
handleClear();
|
|
|
}
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleOk() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleClear = function handleClear() {
|
|
|
form.resetFields();
|
|
|
stateDispatch({
|
|
|
type: 'removeAll'
|
|
|
});
|
|
|
setLink(null);
|
|
|
setTagslist([]);
|
|
|
setShowLink(null);
|
|
|
};
|
|
|
var handleCancel = function handleCancel() {
|
|
|
onCancel();
|
|
|
handleClear();
|
|
|
};
|
|
|
var renderContent = function renderContent() {
|
|
|
var _state$videoList5, _state$videoList6, _state$videoList6$, _state$videoList7, _state$videoList7$, _state$videoList8, _state$videoList8$, _state$videoList9, _state$videoList9$, _state$videoList12, _state$videoList12$, _state$videoList13;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [!showLink && !!((_state$videoList5 = state.videoList) !== null && _state$videoList5 !== void 0 && _state$videoList5.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: AddVideoModalmodules.fileProgress,
|
|
|
children: [((_state$videoList6 = state.videoList) === null || _state$videoList6 === void 0 ? void 0 : (_state$videoList6$ = _state$videoList6[0]) === null || _state$videoList6$ === void 0 ? void 0 : _state$videoList6$.loaded) == 100 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(AddVideoModalmodules.videoName, " font14"),
|
|
|
children: (_state$videoList7 = state.videoList) === null || _state$videoList7 === void 0 ? void 0 : (_state$videoList7$ = _state$videoList7[0]) === null || _state$videoList7$ === void 0 ? void 0 : _state$videoList7$.name
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
|
|
|
style: {
|
|
|
width: '80%'
|
|
|
},
|
|
|
percent: (_state$videoList8 = state.videoList) === null || _state$videoList8 === void 0 ? void 0 : (_state$videoList8$ = _state$videoList8[0]) === null || _state$videoList8$ === void 0 ? void 0 : _state$videoList8$.loaded,
|
|
|
status: ((_state$videoList9 = state.videoList) === null || _state$videoList9 === void 0 ? void 0 : (_state$videoList9$ = _state$videoList9[0]) === null || _state$videoList9$ === void 0 ? void 0 : _state$videoList9$.loaded) == 100 ? "normal" : 'active'
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddVideoModalmodules.fileCancel,
|
|
|
onClick: function onClick() {
|
|
|
var _state$videoList10, _state$videoList10$, _state$videoList11, _state$videoList11$;
|
|
|
return handleRemove((_state$videoList10 = state.videoList) === null || _state$videoList10 === void 0 ? void 0 : (_state$videoList10$ = _state$videoList10[0]) === null || _state$videoList10$ === void 0 ? void 0 : _state$videoList10$.name, ((_state$videoList11 = state.videoList) === null || _state$videoList11 === void 0 ? void 0 : (_state$videoList11$ = _state$videoList11[0]) === null || _state$videoList11$ === void 0 ? void 0 : _state$videoList11$.loaded) == 100);
|
|
|
},
|
|
|
children: ((_state$videoList12 = state.videoList) === null || _state$videoList12 === void 0 ? void 0 : (_state$videoList12$ = _state$videoList12[0]) === null || _state$videoList12$ === void 0 ? void 0 : _state$videoList12$.loaded) === 100 ? '删除' : '取消上传'
|
|
|
})]
|
|
|
}), !((_state$videoList13 = state.videoList) !== null && _state$videoList13 !== void 0 && _state$videoList13.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: AddVideoModalmodules.uploadWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
|
|
|
htmlFor: "fileUpload",
|
|
|
className: AddVideoModalmodules.upload,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shangchuanshipin1 mr5"
|
|
|
}), "\u4E0A\u4F20\u89C6\u9891"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("label", {
|
|
|
className: "".concat(AddVideoModalmodules.upload, " ").concat(AddVideoModalmodules.uploadLink),
|
|
|
onClick: function onClick() {
|
|
|
return setShowLink(true);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-lianjie1 mr5"
|
|
|
}), "\u6DFB\u52A0\u5916\u94FE"]
|
|
|
})]
|
|
|
}), showLink && /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
className: "mt5",
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u89C6\u9891\u94FE\u63A5",
|
|
|
value: link,
|
|
|
onChange: function onChange(e) {
|
|
|
return setLink(e.target.value);
|
|
|
}
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var _useState9 = (0,react.useState)([]),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
tagsList = _useState10[0],
|
|
|
setTagslist = _useState10[1];
|
|
|
var addTag = function addTag(e) {
|
|
|
if (e.key == 'Enter') {
|
|
|
var tag = form.getFieldValue('tag');
|
|
|
form.setFieldsValue({
|
|
|
tag: ''
|
|
|
});
|
|
|
if (!tag) {
|
|
|
message/* default.info */.ZP.info('标签不能为空');
|
|
|
return;
|
|
|
}
|
|
|
if (tagsList.filter(function (item) {
|
|
|
return item === tag;
|
|
|
}).length > 0) {
|
|
|
message/* default.info */.ZP.info('已有相同名称标签');
|
|
|
return;
|
|
|
}
|
|
|
tagsList.push(tag);
|
|
|
setTagslist(toConsumableArray_default()(tagsList));
|
|
|
}
|
|
|
};
|
|
|
var tagCloseFn = function tagCloseFn(e, str) {
|
|
|
e.preventDefault();
|
|
|
// const index = tagsList.findIndex((key:string)=>str===str);
|
|
|
// tagsList.splice(index,1)
|
|
|
setTagslist(toConsumableArray_default()(tagsList.filter(function (item) {
|
|
|
return item != str;
|
|
|
})));
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
maskClosable: false,
|
|
|
title: editData ? '编辑视频项目' : '新建视频项目',
|
|
|
width: 740,
|
|
|
className: AddVideoModalmodules.modal,
|
|
|
open: visible,
|
|
|
confirmLoading: isRequestLoading,
|
|
|
onOk: handleOk,
|
|
|
onCancel: handleCancel,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("input", {
|
|
|
type: "file",
|
|
|
id: "fileUpload",
|
|
|
style: {
|
|
|
display: 'none'
|
|
|
},
|
|
|
onChange: handleChangeUpload,
|
|
|
accept: ".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u9879\u76EE\u540D\u79F0",
|
|
|
name: "name",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入项目名称"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
maxLength: 40,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC740\u5B57\u7684\u9879\u76EE\u540D\u79F0"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u9879\u76EE\u5185\u5BB9",
|
|
|
name: "content",
|
|
|
className: AddVideoModalmodules.contentItem,
|
|
|
children: renderContent()
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
name: "attachment_id",
|
|
|
label: "\u4E0A\u4F20\u5C01\u9762\u56FE:",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CoverUpload/* default */.Z, {
|
|
|
getFileProgress: function getFileProgress(info) {
|
|
|
if (info.file.status === 'uploading') {
|
|
|
setIsRequestLoading(true);
|
|
|
return;
|
|
|
}
|
|
|
if (info.file.status === 'done') {
|
|
|
setIsRequestLoading(false);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u9879\u76EE\u7B80\u4ECB",
|
|
|
name: "description",
|
|
|
className: "ml8",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
|
|
|
rows: 5,
|
|
|
maxLength: 800,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u672C\u89C6\u9891\u7B80\u4ECB\uFF0C\u6700\u591A\u4E0D\u8D85\u8FC7800\u5B57"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
|
label: "\u77E5\u8BC6\u6807\u7B7E",
|
|
|
name: "tag",
|
|
|
className: "ml8",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
onKeyUp: addTag
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: AddVideoModalmodules["tagsList-content"],
|
|
|
children: tagsList.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tag/* default */.Z, {
|
|
|
closable: true,
|
|
|
onClose: function onClose(e) {
|
|
|
tagCloseFn(e, item);
|
|
|
},
|
|
|
children: item
|
|
|
}, index + item);
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "c-grey-999",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "\u6CE8\u610F\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/users/".concat((_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login, "/videos/protocol"),
|
|
|
target: "_blank",
|
|
|
className: AddVideoModalmodules.colorBlue,
|
|
|
children: "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"
|
|
|
}), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7", sizeNum, "G\uFF1B"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "4\u3001\u5982\u679C\u89C6\u9891\u6765\u81EA\u4E8E\u5916\u90E8\u94FE\u63A5\uFF0C\u672C\u7F51\u7AD9\u4E0D\u63D0\u4F9B\u64AD\u653E\u9875\u9762\uFF0C\u65E0\u6CD5\u63D0\u4F9B\u7EDF\u8BA1\u6570\u636E\u3002"
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_AddVideoModal = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var user = _ref4.user,
|
|
|
loading = _ref4.loading,
|
|
|
globalSetting = _ref4.globalSetting;
|
|
|
return {
|
|
|
user: user,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(AddVideoModal));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 77320:
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/utils/aliyunUpload.ts ***!
|
|
|
\***********************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "o": function() { return /* binding */ getUploader; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 84519);
|
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! aliyun-vod-upload-ll */ 69548);
|
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
|
|
|
var login = '';
|
|
|
var uploader;
|
|
|
var virtual_classroom_id = '';
|
|
|
function createUploader(options) {
|
|
|
doCreateUploader(options);
|
|
|
}
|
|
|
function doCreateUploader(options) {
|
|
|
uploader = new (aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default().Vod)({
|
|
|
timeout: 60000,
|
|
|
partSize: 1048576,
|
|
|
parallel: 5,
|
|
|
retryCount: 3,
|
|
|
retryDuration: 2,
|
|
|
region: 'ap-southeast-1',
|
|
|
userId: 1829848226361863,
|
|
|
enableUploadProgress: false,
|
|
|
addFileSuccess: function addFileSuccess(uploadInfo) {
|
|
|
console.log("addFileSuccess: " + uploadInfo.file.name);
|
|
|
options.addFileSuccess && options.addFileSuccess(uploadInfo);
|
|
|
uploader.startUpload();
|
|
|
},
|
|
|
// 开始上传
|
|
|
onUploadstarted: function onUploadstarted(uploadInfo) {
|
|
|
var fileName = uploadInfo.file.name;
|
|
|
if (!uploadInfo.videoId) {
|
|
|
var createUrl = "/api/users/".concat(login, "/video_auths.json");
|
|
|
var _random = ''; // Math.random().toString().substring(3, 6)+'-'
|
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(createUrl, {
|
|
|
method: 'Post',
|
|
|
body: {
|
|
|
title: _random + fileName,
|
|
|
file_name: _random + fileName,
|
|
|
virtual_classroom_id: virtual_classroom_id
|
|
|
}
|
|
|
}).then(function (response) {
|
|
|
if (response) {
|
|
|
var data = response.data;
|
|
|
var uploadAuth = data.UploadAuth;
|
|
|
var uploadAddress = data.UploadAddress;
|
|
|
var videoId = data.VideoId;
|
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId);
|
|
|
}
|
|
|
})["catch"](function (error) {
|
|
|
uploader.deleteFile(uploader._curIndex);
|
|
|
uploader.nextUpload();
|
|
|
console.log(error);
|
|
|
});
|
|
|
console.log('文件开始上传...');
|
|
|
} else {
|
|
|
// 如果videoId有值,根据videoId刷新上传凭证
|
|
|
var refreshUrl = "/api/users/".concat(login, "/video_auths.json");
|
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(refreshUrl, {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
video_id: uploadInfo.videoId,
|
|
|
title: fileName,
|
|
|
file_name: fileName,
|
|
|
virtual_classroom_id: virtual_classroom_id
|
|
|
}
|
|
|
}).then(function (response) {
|
|
|
if (response.status == -1) {
|
|
|
options.onUploadError && options.onUploadError(uploadInfo);
|
|
|
return;
|
|
|
}
|
|
|
var data = response.data;
|
|
|
var uploadAuth = data.UploadAuth;
|
|
|
var uploadAddress = data.UploadAddress;
|
|
|
var videoId = data.VideoId;
|
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress);
|
|
|
})["catch"](function (error) {
|
|
|
uploader.deleteFile(uploader._curIndex);
|
|
|
uploader.nextUpload();
|
|
|
console.log(error);
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
// 文件上传成功
|
|
|
onUploadSucceed: function onUploadSucceed(uploadInfo) {
|
|
|
options.onUploadSucceed && options.onUploadSucceed(uploadInfo);
|
|
|
console.log('文件上传成功!');
|
|
|
},
|
|
|
// 文件上传失败
|
|
|
onUploadFailed: function onUploadFailed(uploadInfo, code, message) {
|
|
|
options.onUploadFailed && options.onUploadFailed(uploadInfo);
|
|
|
console.log('文件上传失败!');
|
|
|
},
|
|
|
// 取消文件上传
|
|
|
onUploadCanceled: function onUploadCanceled(uploadInfo, code, message) {
|
|
|
console.log('文件上传已暂停!');
|
|
|
},
|
|
|
// 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
|
|
|
onUploadProgress: function onUploadProgress(uploadInfo, totalSize, progress) {
|
|
|
options.onUploadProgress && options.onUploadProgress(uploadInfo, totalSize, progress);
|
|
|
var progressPercent = Math.ceil(progress * 100);
|
|
|
console.log('文件上传中...');
|
|
|
},
|
|
|
// 上传凭证超时
|
|
|
onUploadTokenExpired: function onUploadTokenExpired(uploadInfo) {
|
|
|
console.log('文件上传超时!');
|
|
|
var refreshUrl = "/api/users/".concat(login, "/video_auths.json");
|
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(refreshUrl, {
|
|
|
method: 'put',
|
|
|
body: {
|
|
|
video_id: uploadInfo.videoId
|
|
|
}
|
|
|
}).then(function (response) {
|
|
|
var data = response.data;
|
|
|
var uploadAuth = data.UploadAuth;
|
|
|
uploader.resumeUploadWithAuth(uploadAuth);
|
|
|
})["catch"](function (error) {
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
// 全部文件上传结束
|
|
|
onUploadEnd: function onUploadEnd(uploadInfo) {
|
|
|
options.onUploadEnd && options.onUploadEnd(uploadInfo);
|
|
|
console.log("onUploadEnd: uploaded all the files");
|
|
|
}
|
|
|
});
|
|
|
if (options.gotUploader) {
|
|
|
options.gotUploader(uploader);
|
|
|
}
|
|
|
}
|
|
|
function getUploader(_login, _virtual_classroom_id, options) {
|
|
|
_login && (login = _login);
|
|
|
_virtual_classroom_id && (virtual_classroom_id = _virtual_classroom_id);
|
|
|
// if (!uploader || options.create == true) {
|
|
|
createUploader(options);
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 76943:
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/utils/shixunExec.tsx ***!
|
|
|
\**********************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ "_": function() { return /* binding */ checkShixunInClassroom; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var antd_es_table_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/table/style */ 71854);
|
|
|
/* harmony import */ var antd_es_table__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd/es/table */ 67250);
|
|
|
/* harmony import */ var antd_es_message_style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/es/message/style */ 14934);
|
|
|
/* harmony import */ var antd_es_message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd/es/message */ 12461);
|
|
|
/* harmony import */ var antd_es_modal_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd/es/modal/style */ 35611);
|
|
|
/* harmony import */ var antd_es_modal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd/es/modal */ 85402);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var _service_shixuns__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/service/shixuns */ 56088);
|
|
|
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/util */ 29427);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ 67294);
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var handleStartGame = /*#__PURE__*/function () {
|
|
|
var _ref2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee(_ref) {
|
|
|
var is_jupyter, is_jupyter_lab, shixunId, homework_common_id, courseId, res, execRes;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
is_jupyter = _ref.is_jupyter, is_jupyter_lab = _ref.is_jupyter_lab, shixunId = _ref.shixunId, homework_common_id = _ref.homework_common_id, courseId = _ref.courseId;
|
|
|
if (!(is_jupyter || is_jupyter_lab)) {
|
|
|
_context.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 4;
|
|
|
return (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_5__/* .execJupyter */ .BK)({
|
|
|
id: shixunId
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context.sent;
|
|
|
if (res !== null && res !== void 0 && res.identifier) {
|
|
|
(0,_utils_util__WEBPACK_IMPORTED_MODULE_6__/* .openNewWindow */ .xg)("/tasks/jupyter/".concat(courseId, "/").concat(homework_common_id, "/").concat(res.identifier));
|
|
|
}
|
|
|
return _context.abrupt("return");
|
|
|
case 7:
|
|
|
_context.next = 9;
|
|
|
return (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_5__/* .execShixun */ .Ir)({
|
|
|
id: shixunId,
|
|
|
homework_common_id: homework_common_id
|
|
|
});
|
|
|
case 9:
|
|
|
execRes = _context.sent;
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
(0,_utils_util__WEBPACK_IMPORTED_MODULE_6__/* .openNewWindow */ .xg)("/tasks/".concat(courseId, "/").concat(homework_common_id, "/").concat(execRes.game_identifier));
|
|
|
return _context.abrupt("return");
|
|
|
case 13:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message, homework_common_id, courseId);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) == -3) {
|
|
|
(0,_utils_util__WEBPACK_IMPORTED_MODULE_6__/* .bindPhone */ .eF)();
|
|
|
}
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleStartGame(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleResetGame = function handleResetGame(url, homework_common_id, courseId) {
|
|
|
var _url;
|
|
|
url = (_url = url) !== null && _url !== void 0 && _url.includes('.json') ? url : "".concat(url, ".json");
|
|
|
antd_es_modal__WEBPACK_IMPORTED_MODULE_9__/* ["default"].confirm */ .Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: " \u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee2() {
|
|
|
var res, execRes;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_5__/* .resetMyGame */ .$Q)({
|
|
|
url: url
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context2.sent;
|
|
|
if (res) {
|
|
|
_context2.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context2.abrupt("return");
|
|
|
case 5:
|
|
|
antd_es_message__WEBPACK_IMPORTED_MODULE_10__/* ["default"].success */ .ZP.success("重置成功,正在进入实训!");
|
|
|
_context2.next = 8;
|
|
|
return (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_5__/* .execShixun */ .Ir)({
|
|
|
id: res.shixun_identifier,
|
|
|
homework_common_id: homework_common_id
|
|
|
});
|
|
|
case 8:
|
|
|
execRes = _context2.sent;
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context2.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
(0,_utils_util__WEBPACK_IMPORTED_MODULE_6__/* .openNewWindow */ .xg)("/tasks/".concat(courseId, "/").concat(homework_common_id, "/").concat(execRes.game_identifier));
|
|
|
return _context2.abrupt("return");
|
|
|
case 12:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message, homework_common_id, courseId);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var handleInBeta = function handleInBeta(message) {
|
|
|
antd_es_modal__WEBPACK_IMPORTED_MODULE_9__/* ["default"].confirm */ .Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
|
|
|
className: "tc font16",
|
|
|
children: [" \u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01"]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var checkShixunInClassroom = /*#__PURE__*/function () {
|
|
|
var _ref4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee3(shixunId, _ref3) {
|
|
|
var is_jupyter, is_jupyter_lab, res, _res$, shixun_identifier, id, course_identifier;
|
|
|
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
is_jupyter = _ref3.is_jupyter, is_jupyter_lab = _ref3.is_jupyter_lab;
|
|
|
_context3.next = 3;
|
|
|
return (0,_service_shixuns__WEBPACK_IMPORTED_MODULE_5__/* .getProgressHomeworks */ .WT)(shixunId);
|
|
|
case 3:
|
|
|
res = _context3.sent;
|
|
|
if (!(res.length > 1)) {
|
|
|
_context3.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
antd_es_modal__WEBPACK_IMPORTED_MODULE_9__/* ["default"].info */ .Z.info({
|
|
|
icon: null,
|
|
|
closable: true,
|
|
|
maskClosable: true,
|
|
|
centered: true,
|
|
|
width: 820,
|
|
|
okButtonProps: {
|
|
|
style: {
|
|
|
display: 'none'
|
|
|
}
|
|
|
},
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
|
|
|
children: ["\u4F60\u5F53\u524D\u6709", res.length, "\u4E2A\u8FDB\u884C\u4E2D\u7684\u5B9E\u8BAD\u4F5C\u4E1A\u4F7F\u7528\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u5728\u4E0B\u65B9\u70B9\u51FB\u5B9E\u8BAD\u4F5C\u4E1A\u540D\u79F0\u8FDB\u5165\u5B9E\u8BAD\u6311\u6218\u9875\u9762\uFF1A"]
|
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(antd_es_table__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
|
|
|
pagination: false,
|
|
|
columns: [{
|
|
|
title: '课堂名称',
|
|
|
dataIndex: 'course_name',
|
|
|
ellipsis: true,
|
|
|
width: 180,
|
|
|
align: 'center'
|
|
|
}, {
|
|
|
title: '作业名称',
|
|
|
dataIndex: 'name',
|
|
|
ellipsis: true,
|
|
|
width: 240,
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
var _ref5 = record || {},
|
|
|
course_identifier = _ref5.course_identifier,
|
|
|
id = _ref5.id;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("a", {
|
|
|
target: "_blank",
|
|
|
href: "/classrooms/".concat(course_identifier, "/shixun_homework/").concat(id, "/detail"),
|
|
|
children: text
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '作业截止时间',
|
|
|
dataIndex: 'end_time',
|
|
|
align: 'center'
|
|
|
}, {
|
|
|
title: '操作',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
var course_identifier = record.course_identifier,
|
|
|
id = record.id,
|
|
|
shixun_identifier = record.shixun_identifier;
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
|
|
|
style: {
|
|
|
cursor: 'pointer',
|
|
|
color: '#165dff'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
handleStartGame({
|
|
|
is_jupyter: is_jupyter,
|
|
|
is_jupyter_lab: is_jupyter_lab,
|
|
|
shixunId: shixun_identifier,
|
|
|
homework_common_id: id,
|
|
|
courseId: course_identifier
|
|
|
});
|
|
|
},
|
|
|
children: "\u524D\u5F80\u6311\u6218"
|
|
|
});
|
|
|
}
|
|
|
}],
|
|
|
dataSource: res,
|
|
|
rowKey: "id"
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
return _context3.abrupt("return", true);
|
|
|
case 7:
|
|
|
if (!(res.length === 1)) {
|
|
|
_context3.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
_res$ = res[0], shixun_identifier = _res$.shixun_identifier, id = _res$.id, course_identifier = _res$.course_identifier;
|
|
|
handleStartGame({
|
|
|
is_jupyter: is_jupyter,
|
|
|
is_jupyter_lab: is_jupyter_lab,
|
|
|
shixunId: shixun_identifier,
|
|
|
homework_common_id: id,
|
|
|
courseId: course_identifier
|
|
|
});
|
|
|
return _context3.abrupt("return", true);
|
|
|
case 11:
|
|
|
return _context3.abrupt("return", false);
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function checkShixunInClassroom(_x2, _x3) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
/* harmony default export */ __webpack_exports__["Z"] = (handleStartGame);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |