You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1868 lines
87 KiB
1868 lines
87 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[9761],{
|
|
|
|
/***/ 34829:
|
|
/*!*************************************!*\
|
|
!*** ./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 */ 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 */ 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 */ 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 */ 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, SHOW_REP_LOADING, SET_REP_PATH, SET_EDITOR_SETTING, SHOW_PATH_LIST, HIDE_PATH_LIST, SET_TAB_INDEX, SET_SSH_TABS, SET_SSH_CONFIGDATA, SET_SSH_CONFIGDATAARR */
|
|
const FETCH_TASK_START = "FETCH_TASK_START";
|
|
const FETCH_TASK_FAILURE = "FETCH_TASK_FAILURE";
|
|
const FETCH_TASK_SUCCESS = "FETCH_TASK_SUCCESS";
|
|
const UPDATE_TASK_DATA = "UPDATE_TASK_DATA";
|
|
const HIDE_EVALUATE_RESULT = "HIDE_EVALUATE_RESULT";
|
|
const SHOW_EVALUATE_RESULT = "SHOW_EVALUATE_RESULT";
|
|
const UPDATE_TIMESTRAP = "UPDATE_TIMESTRAP";
|
|
const MOVE_X = "MOVE_X";
|
|
const MOVE_Y = "MOVE_Y";
|
|
const TRIGGER_RIGHT_PANEL_MASK = "TRIGGER_RIGHT_PANEL_MASK ";
|
|
const SET_ACTIVE_INDEX = "SET_ACTIVE_INDEX";
|
|
const GET_TASK_LIST = "GET_TASK_LIST";
|
|
const SHOW_TASK_LIST = "SHOW_TASK_LIST";
|
|
const HIDE_TASK_LIST = "HIDE_TASK_LIST";
|
|
const SET_TASK_STAR = "SET_TASK_STAR";
|
|
const TRIGGER_ENLARGE_UNITY3D = "TRIGGER_ENLARGE_UNITY3D ";
|
|
const TRIGGER_TAB_FIXED = "TRIGGER_TAB_FIXED ";
|
|
const GET_DISCUSSES = "GET_DISCUSSES";
|
|
const SHOW_DISCUSSES_LOADING = "SHOW_DISCUSSES_LOADING";
|
|
const TOP_OR_DOWN_DISCUSS = "TOP_OR_DOWN_DISCUSS";
|
|
const PLUS_DISCUSS = "PLUS_DISCUSS";
|
|
const SET_ACTION_TYPE = "SET_ACTION_TYPE";
|
|
const SHOW_REWARD_DIALOG = "SHOW_REWARD_DIALOG";
|
|
const CANCEL_REWARD_DIALOG = "CANCEL_REWARD_DIALOG";
|
|
const SET_REWARD = "SET_REWARD";
|
|
const ACTIVE_DISCUSS_INDEX = "ACTIVE_DISCUSS_INDEX";
|
|
const CREATE_DISCUSS = "CREATE_DISCUSS";
|
|
const DISABLE_DISCUSS = "DISABLE_DISCUSS";
|
|
const SHOW_ANSWER_LOADING = "SHOW_ANSWER_LOADING";
|
|
const FETCH_ANSWER_INFO = "FETCH_ANSWER_INFO";
|
|
const HIDE_TIP_MODAL = "HIGH_TIP_MODAL";
|
|
const SHOW_TIP_MODAL = "SHOW_TIP_MODAL";
|
|
const SELECT_UNLOCK_ANSWER = "SELECT_UNLOCK_ANSWER";
|
|
const SET_CHOOSE_ANSWERS = "SET_CHOOSE_ANSWERS";
|
|
const EVAL_CHOOSE_START = "EVAL_CHOOSE_START";
|
|
const EVAL_CHOOSE_END = "EVAL_CHOOSE_END";
|
|
const SHOW_REP_LOADING = "SHOW_REP_loading";
|
|
const FETCH_REP_CONTENT = "FETCH_REP_CONTENT";
|
|
const EDIT_REP_CODE = "EDIT_REP_CONTENT";
|
|
const SET_REP_PATH = "SET_REP_PATH";
|
|
const SHOW_EVALUATE_LOADING = "SHOW_EVALUATE_LOADING";
|
|
const HIDE_EVALUATE_LOADING = "HIDE_EVALUATE_LOADING";
|
|
const SET_EVALUATE_MESSAGE = "SET_EVALUATE_MESSAGE";
|
|
const SET_SHOW_DIR = "SET_SHOW_DIR";
|
|
const SET_EDITOR_SETTING = "SET_EDITOR_SETTING";
|
|
const SET_EDITOR_THEME = "SET_EDITOR_THEME";
|
|
const SET_EDITOR_FONTSIZE = "SET_EDITOR_FONTSIZE";
|
|
const SET_REPOS = "SET_REPOS";
|
|
const SHOW_PATH_LIST = "SHOW_PATH_LIST";
|
|
const HIDE_PATH_LIST = "HIDE_PATH_LIST";
|
|
const HIDE_PICTURE_VIEW = "HIDE_PICTURE_VIEW";
|
|
const SHOW_PICTURE_VIEW = "SHOW_PICTURE_VIEW";
|
|
const SHOW_NOTICE = "SHOW_NOTICE";
|
|
const HIDE_NOTICE = "HIDE_NOTICE";
|
|
const SET_TAB_INDEX = "SET_TAB_INDEX";
|
|
const SET_SSH_TABS = "SET_SSH_TABS";
|
|
const SET_SSH_CONFIGDATA = "SET_SSH_CONFIGDATA";
|
|
const SET_SSH_CONFIGDATAARR = "SET_SSH_CONFIGDATAARR";
|
|
const SET_VNC_LOADING = "SET_VNC_LOADING ";
|
|
const ON_TAB_TO_SPACE = "ON_TAB_TO_SPACE ";
|
|
const ON_AUTO_FORMAT = "ON_AUTO_FORMAT ";
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 61137:
|
|
/*!**********************************************!*\
|
|
!*** ./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 antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 3113);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
const AsyncButton = (_a) => {
|
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
const [btnLoading, setBtnLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, __spreadProps(__spreadValues({}, props), { loading: btnLoading, onClick: (e) => __async(void 0, null, function* () {
|
|
try {
|
|
setBtnLoading(true);
|
|
yield props.onClick(e);
|
|
setBtnLoading(false);
|
|
} catch (error) {
|
|
console.error(error);
|
|
setBtnLoading(false);
|
|
}
|
|
}) }), children);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 56437:
|
|
/*!**********************************************************!*\
|
|
!*** ./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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
var upload = __webpack_require__(73598);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/UploadOutlined.js + 1 modules
|
|
var UploadOutlined = __webpack_require__(18821);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/CloseCircleFilled.js + 1 modules
|
|
var CloseCircleFilled = __webpack_require__(23411);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(19351);
|
|
;// CONCATENATED MODULE: ./src/components/CoverUpload/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var CoverUploadmodules = ({"img":"img___BgL9D"});
|
|
;// CONCATENATED MODULE: ./src/components/CoverUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
const CoverUpload = ({
|
|
value,
|
|
onChange,
|
|
getFileProgress
|
|
}) => {
|
|
const [imgLoading, setImgLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const uploadButton = /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { loading: imgLoading, icon: /* @__PURE__ */ _react_17_0_2_react.createElement(UploadOutlined/* default */.Z, null) }, "\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6");
|
|
const renderImg = () => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CoverUploadmodules.img }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.API_SERVER + "/api/attachments/" + value, alt: "avatar", style: { width: 288 } }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(CloseCircleFilled/* default */.Z, { onClick: () => onChange(""), style: { fontSize: "16px", color: "red" } })));
|
|
};
|
|
const handleChange = (info) => {
|
|
var _a, _b, _c, _d, _e, _f;
|
|
if (getFileProgress) {
|
|
getFileProgress(info);
|
|
}
|
|
if (info.file.status === "uploading") {
|
|
setImgLoading(true);
|
|
return;
|
|
}
|
|
if (info.file.status === "done") {
|
|
setImgLoading(false);
|
|
if (info.file.status === "done" && ((_b = (_a = info.file) == null ? void 0 : _a.response) == null ? void 0 : _b.status) === -1) {
|
|
message/* default */.ZP.error((_d = (_c = info.file) == null ? void 0 : _c.response) == null ? void 0 : _d.message);
|
|
return;
|
|
}
|
|
onChange((_f = (_e = info == null ? void 0 : info.file) == null ? void 0 : _e.response) == null ? void 0 : _f.id);
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, value ? renderImg() : /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
upload["default"],
|
|
{
|
|
withCredentials: true,
|
|
name: "file",
|
|
showUploadList: false,
|
|
action: `${env/* default */.Z.API_SERVER}/api/attachments.json`,
|
|
onChange: handleChange,
|
|
accept: "image/*"
|
|
},
|
|
uploadButton
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt20 c-light-black" }, "\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__ */ _react_17_0_2_react.createElement("div", { className: "c-light-black" }, "\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002")));
|
|
};
|
|
/* harmony default export */ var components_CoverUpload = (CoverUpload);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 18343:
|
|
/*!******************************************************!*\
|
|
!*** ./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@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(23852);
|
|
;// 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"});
|
|
;// CONCATENATED MODULE: ./src/components/Spinner/index.tsx
|
|
|
|
|
|
|
|
/* harmony default export */ var Spinner = (({ message, className, children, style = {} }) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Spinnermodules.idsRingWrapper} ${className}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Spinnermodules.ldsRing }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null)), message ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style }, message) : null, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Outlet, null));
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 35894:
|
|
/*!************************************************************!*\
|
|
!*** ./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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
var mediator = __webpack_require__(50993);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/image/index.js + 26 modules
|
|
var es_image = __webpack_require__(10211);
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.tsx
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var image_preview = (() => {
|
|
const [url, setUrl] = (0,_react_17_0_2_react.useState)("");
|
|
const [deg, setDeg] = (0,_react_17_0_2_react.useState)(0);
|
|
let [width, setwidth] = (0,_react_17_0_2_react.useState)();
|
|
let [height, setheight] = (0,_react_17_0_2_react.useState)();
|
|
const [down, setdown] = (0,_react_17_0_2_react.useState)(false);
|
|
const saveUrl = (0,_react_17_0_2_react.useRef)("");
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
const unSub = mediator/* default */.Z.subscribe("preview-image", (value) => {
|
|
setUrl(value);
|
|
console.log(imgref.current);
|
|
document.body.style.overflow = "hidden";
|
|
});
|
|
return unSub;
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
document.addEventListener("keydown", onViewEscClose);
|
|
return () => {
|
|
document.removeEventListener("keydown", onViewEscClose);
|
|
};
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
saveUrl.current = url;
|
|
}, [url]);
|
|
function onViewEscClose(e) {
|
|
if (e.keyCode == 27 && saveUrl.current) {
|
|
onClose();
|
|
}
|
|
}
|
|
function onClose() {
|
|
document.body.style.overflow = "auto";
|
|
setwidth(void 0);
|
|
setheight(void 0);
|
|
setDeg(0);
|
|
setUrl("");
|
|
}
|
|
function onRotate() {
|
|
setDeg(deg + 90);
|
|
}
|
|
function big() {
|
|
width = imgref.current.width * 1.1;
|
|
height = imgref.current.height * 1.1;
|
|
setheight(height);
|
|
setwidth(width);
|
|
}
|
|
function small() {
|
|
width = imgref.current.width / 1.1;
|
|
height = imgref.current.height / 1.1;
|
|
setheight(height);
|
|
setwidth(width);
|
|
}
|
|
const maskRef = (0,_react_17_0_2_react.useRef)();
|
|
const previewWrapperRef = (0,_react_17_0_2_react.useRef)();
|
|
const imgref = (0,_react_17_0_2_react.useRef)();
|
|
const handleMaskClick = (e) => {
|
|
if (e.nativeEvent.target === maskRef.current || e.nativeEvent.target === previewWrapperRef.current) {
|
|
onClose();
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, !url ? null : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
null,
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "preview-wrp-group", ref: previewWrapperRef }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_image/* default */.Z,
|
|
{
|
|
className: "image-preview",
|
|
src: url,
|
|
style: { display: "none" },
|
|
preview: {
|
|
visible: true,
|
|
src: url,
|
|
movable: false,
|
|
onVisibleChange: (value) => {
|
|
setUrl("");
|
|
}
|
|
},
|
|
alt: "\u9884\u89C8\u5927\u56FE"
|
|
}
|
|
))
|
|
));
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 36218:
|
|
/*!**********************************************************************!*\
|
|
!*** ./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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(23852);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/index.js + 8 modules
|
|
var tree = __webpack_require__(22631);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/FormOutlined.js + 1 modules
|
|
var FormOutlined = __webpack_require__(23333);
|
|
// EXTERNAL MODULE: ./src/service/paths.ts
|
|
var paths = __webpack_require__(2850);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(75798);
|
|
// EXTERNAL MODULE: ./src/service/video.ts
|
|
var video = __webpack_require__(41193);
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
var exercise = __webpack_require__(53669);
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
var shixuns = __webpack_require__(58215);
|
|
;// 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","pdf_name":"pdf_name___m1wEX","name_style":"name_style___CnJ7d","color333":"color333___TbHdH"});
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
var DownOutlined = __webpack_require__(77800);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/RightOutlined.js + 1 modules
|
|
var RightOutlined = __webpack_require__(81534);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(77883);
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 2 modules
|
|
var verifyLogin = __webpack_require__(53140);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(19351);
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
var AsyncButton = __webpack_require__(61137);
|
|
;// CONCATENATED MODULE: ./src/pages/Paths/Detail/components/Sort/index.tsx
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { Option } = es_select["default"];
|
|
const SendToClassModal = (_a) => {
|
|
var _b = _a, {
|
|
pathsDetail,
|
|
globalSetting,
|
|
user,
|
|
loading,
|
|
visibleType,
|
|
subjectHomeworkType,
|
|
updateSort,
|
|
isPaths,
|
|
dispatch,
|
|
keywords,
|
|
isShowSchedule,
|
|
getData
|
|
} = _b, props = __objRest(_b, [
|
|
"pathsDetail",
|
|
"globalSetting",
|
|
"user",
|
|
"loading",
|
|
"visibleType",
|
|
"subjectHomeworkType",
|
|
"updateSort",
|
|
"isPaths",
|
|
"dispatch",
|
|
"keywords",
|
|
"isShowSchedule",
|
|
"getData"
|
|
]);
|
|
let [openkeys, setOpenkeys] = (0,_react_17_0_2_react.useState)([]);
|
|
let [openkeysAll, setOpenkeysAll] = (0,_react_17_0_2_react.useState)([]);
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const [gData, setGdata] = (0,_react_17_0_2_react.useState)([]);
|
|
const [currentCourse, setCurrentCourse] = (0,_react_17_0_2_react.useState)(
|
|
{}
|
|
);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (props.data && !(0,lodash.isEqual)(props.data, gData)) {
|
|
openkeysAll = [];
|
|
const data = JSON.parse(JSON.stringify(props.data));
|
|
loopIndex(data, 0);
|
|
setGdata([...data]);
|
|
if ((props == null ? void 0 : props.expandAll) || visibleType != "All")
|
|
setOpenkeys([...openkeysAll]);
|
|
else
|
|
setOpenkeys([]);
|
|
}
|
|
}, [props.data, visibleType, props == null ? void 0 : props.expandAll]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
let currentNumber;
|
|
if ((_a2 = pathsDetail.detail) == null ? void 0 : _a2.has_start) {
|
|
const findIndex = (_c = (_b2 = pathsDetail.detail) == null ? void 0 : _b2.courses) == null ? void 0 : _c.findIndex(
|
|
(item) => {
|
|
var _a3;
|
|
return parseInt((_a3 = item.course_status) == null ? void 0 : _a3.status) === 1;
|
|
}
|
|
);
|
|
currentNumber = findIndex > -1 ? findIndex : 0;
|
|
} else {
|
|
let findIndex = (_f = (_e = (_d = pathsDetail.detail) == null ? void 0 : _d.courses) == null ? void 0 : _e.map((item) => {
|
|
var _a3;
|
|
return parseInt((_a3 = item.course_status) == null ? void 0 : _a3.status);
|
|
})) == null ? void 0 : _f.lastIndexOf(2);
|
|
currentNumber = findIndex > -1 ? findIndex : 0;
|
|
findIndex = (_h = (_g = pathsDetail.detail) == null ? void 0 : _g.courses) == null ? void 0 : _h.findIndex(
|
|
(item) => {
|
|
var _a3;
|
|
return parseInt((_a3 = item.course_status) == null ? void 0 : _a3.status) === 0;
|
|
}
|
|
);
|
|
currentNumber = findIndex > -1 ? findIndex : currentNumber;
|
|
}
|
|
if ((_i = pathsDetail.detail) == null ? void 0 : _i.courses) {
|
|
setCurrentCourse(
|
|
((_j = pathsDetail.detail) == null ? void 0 : _j.courses[currentNumber]) || {}
|
|
);
|
|
}
|
|
}, [pathsDetail.detail]);
|
|
const handleDeleteShixun = (key, type) => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: "\u786E\u5B9A\u5220\u9664\u8BE5\u5B9E\u8BAD\u5417\uFF1F",
|
|
onOk: () => {
|
|
}
|
|
});
|
|
};
|
|
const handleDeleteStage = (id) => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: "\u786E\u5B9A\u5220\u9664\u8BE5\u7AE0\u8282\u5417\uFF1F",
|
|
onOk: () => __async(void 0, null, function* () {
|
|
})
|
|
});
|
|
};
|
|
const toShixun = (id, is_jupyter) => __async(void 0, null, function* () {
|
|
const execRes = is_jupyter ? yield (0,shixuns/* execJupyter */.BK)({ id }) : yield (0,shixuns/* execShixun */.Ir)({ id });
|
|
if ((execRes == null ? void 0 : execRes.game_identifier) || (execRes == null ? void 0 : execRes.identifier)) {
|
|
(0,util/* openNewWindow */.xg)(
|
|
is_jupyter ? `/tasks/${execRes == null ? void 0 : execRes.identifier}/jupyter` : `/tasks/${execRes.game_identifier}?subject_id=${params.pathId || ""}`
|
|
);
|
|
return;
|
|
}
|
|
if ((execRes == null ? void 0 : execRes.status) === -3) {
|
|
(0,util/* bindPhone */.eF)();
|
|
} else if ((execRes == null ? void 0 : execRes.status) === 2) {
|
|
handleResetGame(execRes == null ? void 0 : execRes.message);
|
|
} else if ((execRes == null ? void 0 : execRes.status) === 3) {
|
|
handleInBeta(execRes == null ? void 0 : execRes.message);
|
|
}
|
|
});
|
|
const handleResetGame = (url) => {
|
|
url = (url == null ? void 0 : url.includes(".json")) ? url : `${url}.json`;
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
title: "\u63D0\u793A",
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc font16" }, "\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),
|
|
onOk: () => __async(void 0, null, function* () {
|
|
const res = yield (0,exercise/* resetMyGame */.$Q)({ url });
|
|
if (!res) {
|
|
return;
|
|
}
|
|
message/* default */.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");
|
|
const execRes = yield (0,shixuns/* execShixun */.Ir)({ id: res.shixun_identifier });
|
|
if (execRes == null ? void 0 : execRes.game_identifier) {
|
|
(0,util/* openNewWindow */.xg)(`/tasks/${execRes.game_identifier}`);
|
|
return;
|
|
}
|
|
if ((execRes == null ? void 0 : execRes.status) === 2) {
|
|
handleResetGame(execRes == null ? void 0 : execRes.message);
|
|
} else if ((execRes == null ? void 0 : execRes.status) === 3) {
|
|
handleInBeta(execRes == null ? void 0 : execRes.message);
|
|
}
|
|
})
|
|
});
|
|
};
|
|
const handleInBeta = (message2) => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
title: "\u63D0\u793A",
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc font16" }, "\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message2, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")
|
|
});
|
|
};
|
|
const onDragEnter = (info) => {
|
|
console.log("onDragEnter:", info);
|
|
};
|
|
const onDrop = (info) => __async(void 0, null, function* () {
|
|
var _a2, _b2, _c, _d;
|
|
console.log("onDrop:", info);
|
|
const dropKey = info.node.props.eventKey;
|
|
const dragKey = info.dragNode.props.eventKey;
|
|
const dropPos = info.node.props.pos.split("-");
|
|
const dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]);
|
|
if (dropPos.length > 2 && !info.node.dragOverGapBottom && !info.node.dragOverGapTop) {
|
|
return false;
|
|
}
|
|
if (info.node.dragOver && info.dragNodesKeys.length > 1) {
|
|
return false;
|
|
}
|
|
if (dropPos.length > 2 && info.dragNodesKeys.length > 1) {
|
|
return false;
|
|
}
|
|
let datas = ["Attachment", "Hack", "Shixun", "SubjectHomework", "Videoltem"];
|
|
if (datas.includes((_a2 = info.dragNode) == null ? void 0 : _a2.item_type) && ((_b2 = info.node) == null ? void 0 : _b2.item_type) != "StageCatalog" && dropPosition === 0) {
|
|
return false;
|
|
}
|
|
if (((_c = info.dragNode) == null ? void 0 : _c.item_type) === "StageCatalog" && datas.includes((_d = info.node) == null ? void 0 : _d.item_type) && dropPosition === 0) {
|
|
return false;
|
|
}
|
|
const loop = (data2, key, callback) => {
|
|
for (let i = 0; i < data2.length; i++) {
|
|
if (data2[i].key === key) {
|
|
return callback(data2[i], i, data2);
|
|
}
|
|
if (data2[i].children) {
|
|
loop(data2[i].children, key, callback);
|
|
}
|
|
}
|
|
};
|
|
const data = [...gData];
|
|
let dragObj;
|
|
loop(data, dragKey, (item, index, arr) => {
|
|
arr.splice(index, 1);
|
|
dragObj = item;
|
|
});
|
|
if (!info.dropToGap) {
|
|
loop(data, dropKey, (item) => {
|
|
item.children = item.children || [];
|
|
item.children.unshift(dragObj);
|
|
});
|
|
} else if ((info.node.props.children || []).length > 0 && // Has children
|
|
info.node.props.expanded && // Is expanded
|
|
dropPosition === 1) {
|
|
loop(data, dropKey, (item) => {
|
|
item.children = item.children || [];
|
|
item.children.unshift(dragObj);
|
|
});
|
|
} else {
|
|
let ar;
|
|
let i;
|
|
loop(data, dropKey, (item, index, arr) => {
|
|
ar = arr;
|
|
i = index;
|
|
});
|
|
if (dropPosition === -1) {
|
|
ar.splice(i, 0, dragObj);
|
|
} else {
|
|
ar.splice(i + 1, 0, dragObj);
|
|
}
|
|
}
|
|
yield updateSort({
|
|
stage_id: props.stage_id,
|
|
list: data
|
|
});
|
|
loopIndex(data, 0, 0, true);
|
|
console.log("data:", data);
|
|
setGdata([...data]);
|
|
setOpenkeys([...openkeys, info.node.key]);
|
|
});
|
|
const loopIndex = (d, i, pk, sort) => {
|
|
i = i || 0;
|
|
d.map((item, index) => {
|
|
var _a2;
|
|
try {
|
|
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 (!!((_a2 = item.children) == null ? void 0 : _a2.length)) {
|
|
openkeysAll.push(item.key2);
|
|
loopIndex(item.children, item.key2, item.index, sort);
|
|
}
|
|
return item;
|
|
} catch (e) {
|
|
}
|
|
});
|
|
};
|
|
const heightLight = (source) => {
|
|
source = source || "";
|
|
let reg = new RegExp(keywords, "ig");
|
|
const str = source.replace(reg, `<span style="color:#3061D0">$&</span>`);
|
|
if (keywords)
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { dangerouslySetInnerHTML: { __html: str } });
|
|
else
|
|
return source;
|
|
};
|
|
const renderName = (param, isIntooltip) => {
|
|
const { learning_status, name } = param;
|
|
const bool = (learning_status == null ? void 0 : learning_status[0]) === "can" && (learning_status == null ? void 0 : learning_status[1]) === "try";
|
|
if (bool) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Sortmodules.learn }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Sortmodules.name }, isIntooltip ? name : heightLight(name)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Sortmodules.sign }, "\u514D\u8D39\u8BD5\u5B66"));
|
|
}
|
|
return isIntooltip ? name : heightLight(name);
|
|
};
|
|
const handleExpand = (key) => {
|
|
if (visibleType !== "All")
|
|
return;
|
|
if (openkeys.includes(key)) {
|
|
setOpenkeys(openkeys.filter((item) => item != key));
|
|
} else {
|
|
setOpenkeys(openkeys.concat(key));
|
|
}
|
|
};
|
|
const handleToShixun = (item) => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch, true)) {
|
|
return;
|
|
}
|
|
if (item == null ? void 0 : item.need_authorize) {
|
|
(0,verifyLogin/* AuthorizeModel */.rX)(false);
|
|
return;
|
|
}
|
|
toShixun(item.identifier, item.is_jupyter || item.is_jupyter_lab);
|
|
if (currentCourse == null ? void 0 : currentCourse.course_id) {
|
|
(0,paths/* immediatelyRegister */.JS)({ id: currentCourse == null ? void 0 : currentCourse.course_id });
|
|
}
|
|
});
|
|
const toStudentVideo = (item) => __async(void 0, null, function* () {
|
|
var _a2, _b2, _c, _d, _e;
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
if (!((_a2 = user.userInfo) == null ? void 0 : _a2.admin) && !((_b2 = user.userInfo) == null ? void 0 : _b2.business) && !item.can_view && item.item_type !== "Attachment") {
|
|
return modal["default"].info({
|
|
centered: true,
|
|
width: 400,
|
|
okText: "\u77E5\u9053\u5566",
|
|
icon: null,
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc font14" }, "\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")
|
|
});
|
|
}
|
|
if (item.link) {
|
|
(0,video/* viewVideo */.DH)({
|
|
is_f: 1,
|
|
id: item.id,
|
|
point: 0,
|
|
total: 0
|
|
});
|
|
}
|
|
const realUrl = (props == null ? void 0 : props.course_id) ? `course_id=${props == null ? void 0 : props.course_id}` : `subject_id=${params.pathId || props.subject_id}`;
|
|
let type = (_d = item == null ? void 0 : item.name) == null ? void 0 : _d.substr((_c = item == null ? void 0 : item.name) == null ? void 0 : _c.lastIndexOf("."));
|
|
if (type.toUpperCase() === ".ZIP") {
|
|
if (!((_e = pathsDetail.detail) == null ? void 0 : _e.allow_download)) {
|
|
message/* default */.ZP.info("\u6559\u5B66\u8BFE\u4EF6\u4E0D\u652F\u6301\u4E0B\u8F7D");
|
|
return;
|
|
}
|
|
(0,util/* downLoadFile */.FH)(item.name, env/* default */.Z.API_SERVER + item.url);
|
|
} else {
|
|
(0,util/* openNewWindow */.xg)(item.link || `/video/${item.id}?${realUrl}`);
|
|
}
|
|
if (item.item_type === "Attachment" && item.complete_status != 2) {
|
|
const res = yield (0,paths/* watchAttachmentHistories */.rS)({
|
|
attachment_id: item.id,
|
|
status: 2
|
|
});
|
|
}
|
|
if (item.item_type === "Attachment" || item.item_type === "VideoItem") {
|
|
getData();
|
|
}
|
|
});
|
|
const loadIcon = (nodeData) => {
|
|
let icon;
|
|
if (nodeData.item_type === "Shixun") {
|
|
if (nodeData.is_all_choice) {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u9009\u62E9\u9898" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xuanzeti3 c-lake-blue font20" }));
|
|
} else {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5B9E\u8BAD\u9898" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shixunti2 c-light-primary font20" }));
|
|
}
|
|
} else if (nodeData.item_type === "VideoItem") {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shipin2 c-purple-8C1 font20" });
|
|
} else if (nodeData.item_type === "StageCatalog") {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-kongbai c-brilliant-blue font20" });
|
|
} else if (nodeData.item_type === "ExaminationBank") {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-zhangjieceshibeifen c-brilliant-blue font20" });
|
|
} else if (nodeData.item_type === "SubjectHomework" && nodeData.homework_type === "group") {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-fenzuzuoye3 font20", style: { color: "#acc218" } });
|
|
} else if (nodeData.item_type === "SubjectHomework" && nodeData.homework_type === "normal") {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-tuwenzuoye font20", style: { color: "#1db37f" } });
|
|
} else {
|
|
icon = /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-kejian1 c-cyan-blue font20" });
|
|
}
|
|
return icon;
|
|
};
|
|
const itemsIcon = {};
|
|
const [isHovered, setIsHovered] = (0,_react_17_0_2_react.useState)(false);
|
|
const handleMouseEnter = (key) => {
|
|
if (!isHovered)
|
|
setIsHovered(true);
|
|
};
|
|
const handleMouseLeave = () => {
|
|
setIsHovered(false);
|
|
};
|
|
const doms = (0,_react_17_0_2_react.useMemo)(() => {
|
|
console.log("doms:");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
tree["default"],
|
|
{
|
|
className: Sortmodules.tree,
|
|
disabled: props.disabled,
|
|
expandedKeys: [...openkeys],
|
|
draggable: true,
|
|
onDragEnter,
|
|
onDrop,
|
|
onExpand: handleExpand,
|
|
blockNode: true,
|
|
titleRender: (nodeData) => {
|
|
var _a2, _b2, _c, _d, _e, _f;
|
|
let item = nodeData;
|
|
if (visibleType == "SubjectHomework") {
|
|
if (subjectHomeworkType == "group_count" && (item == null ? void 0 : item.homework_type) != "group") {
|
|
return null;
|
|
}
|
|
if (subjectHomeworkType == "normal_count" && (item == null ? void 0 : item.homework_type) != "normal") {
|
|
return null;
|
|
}
|
|
} else {
|
|
if (item.item_type !== visibleType && visibleType !== "All") {
|
|
return null;
|
|
}
|
|
}
|
|
const notCollectPay = ((_a2 = nodeData == null ? void 0 : nodeData.learning_status) == null ? void 0 : _a2[0]) === "can";
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
row/* default */.Z,
|
|
{
|
|
align: "middle",
|
|
className: "font14",
|
|
onClick: () => handleExpand(item.key),
|
|
style: { flexWrap: "nowrap", whiteSpace: "nowrap" },
|
|
onMouseOver: () => handleMouseEnter(item.key)
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "30px", style: { display: "flex", alignItems: "center" } }, nodeData.item_type === "VideoItem" ? /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shipin2 c-purple-8C1 font20" }) : nodeData.item_type === "StageCatalog" ? /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-kongbai c-brilliant-blue font20" }) : nodeData.item_type === "SubjectHomework" && nodeData.homework_type === "group" ? /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-fenzuzuoye3 font20", style: { color: "#acc218" } }) : nodeData.item_type === "SubjectHomework" && nodeData.homework_type === "normal" ? /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-tuwenzuoye font20", style: { color: "#1db37f" } }) : nodeData.item_type === "ExaminationBank" ? /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-zhangjieceshibeifen font20", style: { color: "#e9a318" } }) : nodeData.item_type === "Shixun" && nodeData.is_all_choice ? /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u9009\u62E9\u9898" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xuanzeti3 c-lake-blue font20" })) : nodeData.item_type === "Shixun" && !nodeData.is_all_choice ? /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5B9E\u8BAD\u9898" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shixunti2 c-light-primary font20" })) : /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-kejian1 c-cyan-blue font20" })),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1", className: Sortmodules.color333, style: { display: "flex", alignItems: "center", width: 300 } }, props.cust_seq && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
className: `${Sortmodules.color333} mr10`
|
|
},
|
|
nodeData.index
|
|
), nodeData.item_type !== "Attachment" && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Sortmodules.name_style }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: nodeData.name }, renderName(nodeData, false))), nodeData.item_type === "Attachment" && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"a",
|
|
{
|
|
target: "_blank",
|
|
className: Sortmodules.pdf_name,
|
|
title: nodeData.name,
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
if (currentCourse == null ? void 0 : currentCourse.course_id) {
|
|
const res = yield (0,paths/* immediatelyRegister */.JS)({
|
|
id: currentCourse == null ? void 0 : currentCourse.course_id
|
|
});
|
|
}
|
|
switch (nodeData.item_type) {
|
|
case "Attachment":
|
|
toStudentVideo(item);
|
|
break;
|
|
case "VideoItem":
|
|
toStudentVideo(nodeData);
|
|
break;
|
|
case "ExaminationBank":
|
|
toStudentVideo(nodeData);
|
|
break;
|
|
case "SubjectHomework":
|
|
if (nodeData.homework_type == "group") {
|
|
toStudentVideo(nodeData);
|
|
} else if (nodeData.homework_type == "normal") {
|
|
toStudentVideo(nodeData);
|
|
}
|
|
break;
|
|
case "Shixun":
|
|
handleToShixun(nodeData);
|
|
break;
|
|
}
|
|
})
|
|
},
|
|
nodeData.name
|
|
), nodeData.item_type === "Shixun" && nodeData.is_unity_3d && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
style: {
|
|
background: "#a300d8",
|
|
color: "#fff",
|
|
borderRadius: "13px",
|
|
marginLeft: "5px",
|
|
width: "68px",
|
|
height: "20px",
|
|
display: "inline-flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
fontSize: "12px"
|
|
}
|
|
},
|
|
"\u865A\u62DF\u4EFF\u771F"
|
|
), nodeData.item_type === "Shixun" && nodeData.is_jupyter_lab && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
style: {
|
|
background: "#ff6802",
|
|
color: "#fff",
|
|
borderRadius: "13px",
|
|
marginLeft: "5px",
|
|
width: "76px",
|
|
height: "20px",
|
|
display: "inline-flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
fontSize: "12px"
|
|
}
|
|
},
|
|
"JupyterLab"
|
|
), nodeData.item_type === "Shixun" && nodeData.is_jupyter && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
style: {
|
|
background: "#ff6802",
|
|
color: "#fff",
|
|
borderRadius: "13px",
|
|
marginLeft: "5px",
|
|
width: "112px",
|
|
height: "20px",
|
|
display: "inline-flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
fontSize: "12px"
|
|
}
|
|
},
|
|
"Jupyter Notebook"
|
|
), nodeData.item_type === "Shixun" && ((_b2 = nodeData == null ? void 0 : nodeData.shixun_marks) == null ? void 0 : _b2.length) > 0 && (((_c = user == null ? void 0 : user.userInfo) == null ? void 0 : _c.role) == 1 || ((_d = user == null ? void 0 : user.userInfo) == null ? void 0 : _d.role) == 2) && (nodeData == null ? void 0 : nodeData.shixun_marks.map((v, k) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: `${v}`, key: k }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
style: {
|
|
background: "#43a2ff",
|
|
color: "#fff",
|
|
borderRadius: "13px",
|
|
marginLeft: "5px",
|
|
height: "20px",
|
|
textAlign: "center",
|
|
fontSize: "12px",
|
|
maxWidth: "70px",
|
|
padding: "0px 13px",
|
|
overflow: "hidden",
|
|
whiteSpace: "nowrap",
|
|
display: "inline-flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
textOverflow: "ellipsis"
|
|
}
|
|
},
|
|
v
|
|
));
|
|
})), !!((_e = nodeData.schools) == null ? void 0 : _e.length) && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u8BE5\u5B9E\u8DF5\u9879\u76EE\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: "iconfont icon-zhidinggongkai1 ml10 c-orange",
|
|
style: {
|
|
transform: "translateY(1px)",
|
|
display: "inline-block"
|
|
}
|
|
}
|
|
)), nodeData.item_type === "Shixun" && !!(nodeData == null ? void 0 : nodeData.finished_challenges_count) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
tooltip/* default */.Z,
|
|
{
|
|
title: `\u5B8C\u6210\u5EA6:${Math.round(
|
|
(nodeData == null ? void 0 : nodeData.finished_challenges_count) / (nodeData == null ? void 0 : nodeData.challenges_count) * 100
|
|
)}%`
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: `iconfont icon-a-wanchengdu100 ml10 ${(nodeData == null ? void 0 : nodeData.finished_challenges_count) - (nodeData == null ? void 0 : nodeData.challenges_count) === 0 ? "c-light-green" : "c-grey-333"}`,
|
|
style: {
|
|
transform: "translateY(1px)",
|
|
display: "inline-block"
|
|
}
|
|
}
|
|
)
|
|
)),
|
|
!props.disabled && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"aside",
|
|
{
|
|
style: {
|
|
color: "#0152d9",
|
|
fontSize: "14px",
|
|
marginRight: "20px"
|
|
}
|
|
},
|
|
"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u9879\u76EE\u663E\u793A\u987A\u5E8F"
|
|
),
|
|
isHovered && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "tr" }, (item.item_type === "VideoItem" || (item == null ? void 0 : item.item_type) === "Attachment" || (item == null ? void 0 : item.item_type) === "StageCatalog" || (item == null ? void 0 : item.item_type) === "SubjectHomework" || (item == null ? void 0 : item.item_type) === "ExaminationBank") && !props.disabled && !props.hiddenEditBtn && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u7F16\u8F91" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
onClick: () => {
|
|
props.editVidoItem(__spreadValues({ stage_id: props.stage_id }, item));
|
|
},
|
|
style: {
|
|
color: "#ccc",
|
|
marginRight: "10px"
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(FormOutlined/* default */.Z, null)
|
|
)), !props.disabled && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
onClick: () => {
|
|
props.deleteStages({
|
|
id: item.stage_item_id,
|
|
stage_id: props.stage_id
|
|
});
|
|
},
|
|
className: "iconfont icon-shanchu c-grey-c"
|
|
}
|
|
))), props.showVideoPlay && props.disabled && item.item_type === "SubjectHomework" && notCollectPay && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, !(0,authority/* isCommonStudent */.JA)() && isPaths && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: "mr10",
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: "shixunsDetail/setActionTabs",
|
|
payload: {
|
|
key: "Stage-SendModal",
|
|
params: { id: item.stage_item_id, title: (item == null ? void 0 : item.homework_type) == "group" ? "\u5206\u7EC4\u4F5C\u4E1A" : "\u56FE\u6587\u4F5C\u4E1A" }
|
|
}
|
|
});
|
|
})
|
|
},
|
|
"\u53D1\u9001"
|
|
), !(0,authority/* isCommonStudent */.JA)() && isPaths && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
props.showInfoModal(__spreadValues({ stage_id: props.stage_id }, item));
|
|
})
|
|
},
|
|
"\u67E5\u770B\u8BE6\u60C5"
|
|
)), props.showVideoPlay && props.disabled && item.item_type === "ExaminationBank" && notCollectPay && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, !(0,authority/* isCommonStudent */.JA)() && isPaths && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: "mr10",
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: "shixunsDetail/setActionTabs",
|
|
payload: {
|
|
key: "Stage-SendModal",
|
|
params: { id: item.stage_item_id, title: "\u6D4B\u9A8C", examinationid: item.id }
|
|
}
|
|
});
|
|
})
|
|
},
|
|
"\u53D1\u9001"
|
|
), !(0,authority/* isCommonStudent */.JA)() && isPaths && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
window.open(`/paperlibrary/see/${item.id}?defaultActiveKey=1`);
|
|
})
|
|
},
|
|
"\u67E5\u770B\u8BE6\u60C5"
|
|
)), props.showVideoPlay && props.disabled && item.item_type === "VideoItem" && notCollectPay && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, !(0,authority/* isCommonStudent */.JA)() && isPaths && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: "mr10",
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: "shixunsDetail/setActionTabs",
|
|
payload: {
|
|
key: "Stage-SendModal",
|
|
params: { id: item.stage_item_id, title: "\u89C6\u9891" }
|
|
}
|
|
});
|
|
})
|
|
},
|
|
"\u53D1\u9001"
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
className: "mr10",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
toStudentVideo(item);
|
|
})
|
|
},
|
|
item.last_point > 0 ? "\u7EE7\u7EED\u5B66\u4E60" : "\u5F00\u59CB\u5B66\u4E60"
|
|
)), (item.allow_visit || item.to_be_built || !item.shixun_status) && props.disabled && item.item_type === "Shixun" && notCollectPay && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, !(0,authority/* isCommonStudent */.JA)() && isPaths && !item.shixun_status && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: "ml10",
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: "shixunsDetail/setActionTabs",
|
|
payload: {
|
|
key: "Stage-SendModal",
|
|
params: { id: item.stage_item_id, title: "\u5B9E\u8BAD", is_jupyter: item == null ? void 0 : item.is_jupyter, identifier: item == null ? void 0 : item.identifier }
|
|
}
|
|
});
|
|
})
|
|
},
|
|
"\u53D1\u9001"
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: "ml10",
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
return;
|
|
}
|
|
if (currentCourse == null ? void 0 : currentCourse.course_id) {
|
|
yield (0,paths/* immediatelyRegister */.JS)({
|
|
id: currentCourse == null ? void 0 : currentCourse.course_id
|
|
});
|
|
}
|
|
window.open(`/shixuns/${item.identifier}/challenges`);
|
|
})
|
|
},
|
|
"\u67E5\u770B\u8BE6\u60C5"
|
|
), !item.shixun_status && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
AsyncButton/* AsyncButton */.Z,
|
|
{
|
|
className: "ml10",
|
|
type: "primary",
|
|
onClick: () => __async(void 0, null, function* () {
|
|
return new Promise((resolve) => __async(void 0, null, function* () {
|
|
handleToShixun(item);
|
|
setTimeout(() => {
|
|
resolve();
|
|
}, 2e3);
|
|
}));
|
|
})
|
|
},
|
|
(item == null ? void 0 : item.need_authorize) ? "\u9700\u6388\u6743" : !(nodeData == null ? void 0 : nodeData.finished_challenges_count) ? "\u5F00\u59CB\u5B9E\u6218" : (nodeData == null ? void 0 : nodeData.finished_challenges_count) - (nodeData == null ? void 0 : nodeData.challenges_count) === 0 ? "\u518D\u6B21\u5B9E\u6218" : "\u7EE7\u7EED\u5B9E\u6218"
|
|
))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
col/* default */.Z,
|
|
null,
|
|
// editKey === -1 &&
|
|
props.disabled && item.shixun_status === "\u6682\u672A\u516C\u5F00" && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${Sortmodules.color204} ml5` }, "\u6682\u672A\u53D1\u5E03"),
|
|
// editKey === -1 &&
|
|
item.shixun_status === "\u5DF2\u5220\u9664" && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${Sortmodules.color204} ml5` }, "\u5DF2\u5220\u9664"),
|
|
props.disabled && !isShowSchedule && item.item_type === "Shixun" && !!item.challenges_count && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "exper\u02C6iment-number ml5 c-grey-999" }, "\u5B9E\u9A8C\u6570 ", item.challenges_count),
|
|
props.disabled && isShowSchedule && item.item_type === "Shixun" && !!item.challenges_count && item.shixun_status !== "\u6682\u672A\u516C\u5F00" && item.shixun_status !== "\u5DF2\u5220\u9664" && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-wanchenggouxuan font14", style: { marginLeft: "5px", color: item.finished_challenges_count === item.challenges_count ? "#50DAAE" : "#DEDEDE" } }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: "4px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF", fontSize: "14px" } }, item.finished_challenges_count), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#DEDEDE", fontSize: "14px" } }, "/", item.challenges_count))),
|
|
props.disabled && isShowSchedule && (item.item_type === "VideoItem" || item.item_type === "Attachment") && (item.complete_status == 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-weidianjixuexi font14", style: { color: "#DEDEDE" } }) : item.complete_status == 1 ? /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-yidianjixuexiweiwancheng font14", style: { color: "#50DAAE" } }) : /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xuexiwancheng font14", style: { color: "#50DAAE" } })),
|
|
visibleType === "All" && !!((_f = nodeData.children) == null ? void 0 : _f.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10" }, openkeys.includes(nodeData.key) ? /* @__PURE__ */ _react_17_0_2_react.createElement(DownOutlined/* default */.Z, null) : /* @__PURE__ */ _react_17_0_2_react.createElement(RightOutlined/* default */.Z, null))
|
|
)
|
|
);
|
|
},
|
|
treeData: gData
|
|
}
|
|
);
|
|
}, [gData, openkeysAll, openkeys, visibleType, isHovered]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, doms);
|
|
};
|
|
/* harmony default export */ var Sort = ((0,_umi_production_exports.connect)(
|
|
({
|
|
pathsDetail,
|
|
loading,
|
|
user,
|
|
globalSetting
|
|
}) => ({
|
|
pathsDetail,
|
|
globalSetting,
|
|
user,
|
|
loading: loading.effects
|
|
})
|
|
)(SendToClassModal));
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7979:
|
|
/*!*******************************************************************************!*\
|
|
!*** ./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/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(23852);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(20008);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
|
|
var progress = __webpack_require__(93948);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/index.js + 5 modules
|
|
var tag = __webpack_require__(12563);
|
|
;// 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__(8251);
|
|
// EXTERNAL MODULE: ./src/components/CoverUpload/index.tsx + 1 modules
|
|
var CoverUpload = __webpack_require__(56437);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(77883);
|
|
;// CONCATENATED MODULE: ./src/pages/Video/Detail/components/AddVideoModal/index.tsx
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { TextArea } = input["default"];
|
|
const MAX_FILE_SIZE = 1024;
|
|
const videoReducer = (state, action) => {
|
|
var _a;
|
|
const { uploadInfo = {} } = action.payload || {};
|
|
switch (action.type) {
|
|
case "addVideo":
|
|
return {
|
|
videoList: [...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((item) => item.name !== action.payload.name)
|
|
};
|
|
case "removeAll":
|
|
return {
|
|
videoList: []
|
|
};
|
|
case "updateProgress":
|
|
return {
|
|
videoList: state.videoList.map((item) => {
|
|
if (item.name === action.payload.uploadInfo.file.name) {
|
|
return __spreadValues(__spreadValues({}, item), { loaded: action.payload.progressPercent, videoId: uploadInfo.videoId, fileHash: uploadInfo.fileHash });
|
|
}
|
|
return item;
|
|
})
|
|
};
|
|
case "updateTitle":
|
|
return {
|
|
videoList: (_a = state.videoList) == null ? void 0 : _a.map((video) => {
|
|
if (video.name === action.payload.item.name) {
|
|
return __spreadValues(__spreadValues({}, video), { title: action.payload.title });
|
|
}
|
|
return video;
|
|
})
|
|
};
|
|
default:
|
|
return {
|
|
videoList: []
|
|
};
|
|
}
|
|
};
|
|
const AddVideoModal = ({
|
|
user,
|
|
globalSetting,
|
|
loading,
|
|
dispatch,
|
|
visible,
|
|
editData,
|
|
onCancel = () => {
|
|
},
|
|
onOk = () => {
|
|
},
|
|
queryParams = {}
|
|
}) => {
|
|
var _a;
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const [form] = es_form["default"].useForm();
|
|
const [state, stateDispatch] = (0,_react_17_0_2_react.useReducer)(videoReducer, { videoList: [] });
|
|
const [isLoading, setIsLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const uploader = (0,_react_17_0_2_react.useRef)();
|
|
const [link, setLink] = (0,_react_17_0_2_react.useState)();
|
|
const [showLink, setShowLink] = (0,_react_17_0_2_react.useState)(false);
|
|
const [isRequestLoading, setIsRequestLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const sizeNum = (0,authority/* isSuperAdmins */.Ny)() ? 3 : 1;
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2, _b, _c;
|
|
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(((_a2 = editData == null ? void 0 : editData.tags) == null ? void 0 : _a2.map((item) => item == null ? void 0 : item.name)) || []);
|
|
form.setFieldsValue({ name: editData.name, description: editData.description, attachment_id: (_b = editData == null ? void 0 : editData.video) == null ? void 0 : _b.attachment_id, allow_skip: (_c = editData == null ? void 0 : editData.video_item) == null ? void 0 : _c.allow_skip });
|
|
}, [editData, visible]);
|
|
const clearInput = () => {
|
|
const input = document.getElementById("fileUpload");
|
|
input.value = "";
|
|
};
|
|
const handleChangeUpload = (e) => {
|
|
var _a2;
|
|
setShowLink(false);
|
|
const file = e.target.files[0];
|
|
if (!file) {
|
|
clearInput();
|
|
return;
|
|
}
|
|
const 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 */.ZP.info(`\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F`);
|
|
clearInput();
|
|
return;
|
|
}
|
|
if (file.size > MAX_FILE_SIZE * sizeNum * 1024 * 1024) {
|
|
message/* default */.ZP.info(`\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7${sizeNum}G`);
|
|
clearInput();
|
|
return;
|
|
}
|
|
if ((_a2 = state.videoList) == null ? void 0 : _a2.find((item) => item.name === file.name)) {
|
|
message/* default */.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);
|
|
};
|
|
const handleRemove = (name, isSuccess) => {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc" }, "\u60A8\u786E\u8BA4\u8981", isSuccess ? "\u5220\u9664" : "\u53D6\u6D88\u4E0A\u4F20", "\u8BE5\u89C6\u9891\u5417\uFF1F"),
|
|
onOk: () => {
|
|
clearInput();
|
|
stateDispatch({
|
|
type: "removeVideo",
|
|
payload: {
|
|
name
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
const handleUpload = (file) => {
|
|
var _a2;
|
|
var userData = '{"Vod":{}}';
|
|
setIsLoading(true);
|
|
if (uploader.current) {
|
|
uploader.current.addFile(file, null, null, null, userData);
|
|
return;
|
|
}
|
|
(0,aliyunUpload/* getUploader */.o)(
|
|
(_a2 = user.userInfo) == null ? void 0 : _a2.login,
|
|
"",
|
|
{
|
|
create: !uploader,
|
|
addFileSuccess: (uploadInfo) => {
|
|
stateDispatch({
|
|
type: "addVideo",
|
|
payload: {
|
|
uploadInfo
|
|
}
|
|
});
|
|
},
|
|
onUploadProgress: (uploadInfo, totalSize, progress) => {
|
|
const progressPercent = Math.ceil(progress * 100);
|
|
stateDispatch({
|
|
type: "updateProgress",
|
|
payload: {
|
|
uploadInfo,
|
|
progressPercent
|
|
}
|
|
});
|
|
clearInput();
|
|
},
|
|
onUploadFailed: (uploadInfo) => {
|
|
message/* default */.ZP.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002");
|
|
},
|
|
onUploadEnd: (uploadInfo) => {
|
|
setIsLoading(false);
|
|
},
|
|
onUploadSucceed: (uploadInfo) => {
|
|
setIsLoading(false);
|
|
},
|
|
onUploadError: (uploadInfo) => {
|
|
setIsLoading(false);
|
|
},
|
|
gotUploader: (_uploader) => {
|
|
_uploader.addFile(file, null, null, null, userData);
|
|
uploader.current = _uploader;
|
|
}
|
|
}
|
|
);
|
|
};
|
|
const handleOk = () => __async(void 0, null, function* () {
|
|
var _a2, _b;
|
|
yield form.validateFields();
|
|
if (!showLink && !((_a2 = state.videoList) == null ? void 0 : _a2.length) || showLink && !link) {
|
|
message/* default */.ZP.info("\u8BF7\u5148\u4E0A\u4F20\u89C6\u9891\u6216\u8005\u6DFB\u52A0\u5916\u94FE");
|
|
return;
|
|
}
|
|
setIsRequestLoading(true);
|
|
const video = showLink ? { link } : { video_id: (_b = state.videoList) == null ? void 0 : _b[0].videoId };
|
|
const res = yield onOk(__spreadValues(__spreadValues(__spreadValues({}, video), queryParams), {
|
|
name: form.getFieldValue("name"),
|
|
attachment_id: form.getFieldValue("attachment_id"),
|
|
description: form.getFieldValue("description"),
|
|
tags: form.getFieldValue("tag"),
|
|
allow_skip: form.getFieldValue("allow_skip")
|
|
// tags: tagsList,
|
|
}));
|
|
setIsRequestLoading(false);
|
|
if (res.id) {
|
|
handleClear();
|
|
}
|
|
});
|
|
const handleClear = () => {
|
|
form.resetFields();
|
|
stateDispatch({ type: "removeAll" });
|
|
setLink(null);
|
|
setTagslist([]);
|
|
setShowLink(null);
|
|
};
|
|
const handleCancel = () => {
|
|
onCancel();
|
|
handleClear();
|
|
};
|
|
const renderContent = () => {
|
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, !showLink && !!((_a2 = state.videoList) == null ? void 0 : _a2.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddVideoModalmodules.fileProgress }, ((_c = (_b = state.videoList) == null ? void 0 : _b[0]) == null ? void 0 : _c.loaded) == 100 ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${AddVideoModalmodules.videoName} font14` }, (_e = (_d = state.videoList) == null ? void 0 : _d[0]) == null ? void 0 : _e.name) : /* @__PURE__ */ _react_17_0_2_react.createElement(progress/* default */.Z, { style: { width: "80%" }, percent: (_g = (_f = state.videoList) == null ? void 0 : _f[0]) == null ? void 0 : _g.loaded, status: ((_i = (_h = state.videoList) == null ? void 0 : _h[0]) == null ? void 0 : _i.loaded) == 100 ? "normal" : "active" }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddVideoModalmodules.fileCancel, onClick: () => {
|
|
var _a3, _b2, _c2, _d2;
|
|
return handleRemove((_b2 = (_a3 = state.videoList) == null ? void 0 : _a3[0]) == null ? void 0 : _b2.name, ((_d2 = (_c2 = state.videoList) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.loaded) == 100);
|
|
} }, ((_k = (_j = state.videoList) == null ? void 0 : _j[0]) == null ? void 0 : _k.loaded) === 100 ? "\u5220\u9664" : "\u53D6\u6D88\u4E0A\u4F20")), !((_l = state.videoList) == null ? void 0 : _l.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddVideoModalmodules.uploadWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("label", { htmlFor: "fileUpload", className: AddVideoModalmodules.upload }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shangchuanshipin1 mr5" }), "\u4E0A\u4F20\u89C6\u9891"), /* @__PURE__ */ _react_17_0_2_react.createElement("label", { className: `${AddVideoModalmodules.upload} ${AddVideoModalmodules.uploadLink}`, onClick: () => setShowLink(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-lianjie1 mr5" }), "\u6DFB\u52A0\u5916\u94FE")), showLink && /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { className: "mt5", placeholder: "\u8BF7\u8F93\u5165\u89C6\u9891\u94FE\u63A5", value: link, onChange: (e) => setLink(e.target.value) }));
|
|
};
|
|
const [tagsList, setTagslist] = (0,_react_17_0_2_react.useState)([]);
|
|
const addTag = (e) => {
|
|
if (e.key == "Enter") {
|
|
const tag = form.getFieldValue("tag");
|
|
form.setFieldsValue({ tag: "" });
|
|
if (!tag) {
|
|
message/* default */.ZP.info("\u6807\u7B7E\u4E0D\u80FD\u4E3A\u7A7A");
|
|
return;
|
|
}
|
|
if (tagsList.filter((item) => item === tag).length > 0) {
|
|
message/* default */.ZP.info("\u5DF2\u6709\u76F8\u540C\u540D\u79F0\u6807\u7B7E");
|
|
return;
|
|
}
|
|
tagsList.push(tag);
|
|
setTagslist([...tagsList]);
|
|
}
|
|
};
|
|
const tagCloseFn = (e, str) => {
|
|
e.preventDefault();
|
|
setTagslist([...tagsList.filter((item) => item != str)]);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
maskClosable: false,
|
|
destroyOnClose: true,
|
|
title: editData ? "\u7F16\u8F91\u89C6\u9891\u9879\u76EE" : "\u65B0\u5EFA\u89C6\u9891\u9879\u76EE",
|
|
width: 740,
|
|
className: AddVideoModalmodules.modal,
|
|
open: visible,
|
|
confirmLoading: isRequestLoading,
|
|
onOk: handleOk,
|
|
onCancel: handleCancel
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { form }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"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__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9879\u76EE\u540D\u79F0", name: "name", rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { maxLength: 40, placeholder: "\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC740\u5B57\u7684\u9879\u76EE\u540D\u79F0" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9879\u76EE\u5185\u5BB9", name: "content", className: AddVideoModalmodules.contentItem }, renderContent()), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "attachment_id",
|
|
label: "\u4E0A\u4F20\u5C01\u9762\u56FE:"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(CoverUpload/* default */.Z, { getFileProgress: (info) => {
|
|
if (info.file.status === "uploading") {
|
|
setIsRequestLoading(true);
|
|
return;
|
|
}
|
|
if (info.file.status === "done") {
|
|
setIsRequestLoading(false);
|
|
}
|
|
} })
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u9879\u76EE\u7B80\u4ECB", name: "description", className: "ml8" }, /* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { rows: 5, maxLength: 800, placeholder: "\u8BF7\u8F93\u5165\u672C\u89C6\u9891\u7B80\u4ECB\uFF0C\u6700\u591A\u4E0D\u8D85\u8FC7800\u5B57" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u77E5\u8BC6\u6807\u7B7E", name: "tag", className: "ml8" }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { onKeyUp: addTag })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u64AD\u653E\u8BBE\u7F6E", name: "allow_skip", valuePropName: "checked", className: "ml8", initialValue: true }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], null, "\u5141\u8BB8\u5FEB\u8FDB\u64AD\u653E")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddVideoModalmodules["tagsList-content"] }, tagsList.map((item, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(tag["default"], { key: index + item, closable: true, onClose: (e) => {
|
|
tagCloseFn(e, item);
|
|
} }, item);
|
|
})), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-999" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6CE8\u610F\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/users/${(_a = user.userInfo) == null ? void 0 : _a.login}/videos/protocol`, target: "_blank", className: AddVideoModalmodules.colorBlue }, "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7", sizeNum, "G\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "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)(({ user, loading, globalSetting }) => ({
|
|
user,
|
|
globalSetting,
|
|
loading
|
|
}))(AddVideoModal));
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8251:
|
|
/*!***********************************!*\
|
|
!*** ./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 */ 64841);
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! aliyun-vod-upload-ll */ 93125);
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
let login = "";
|
|
let uploader;
|
|
let virtual_classroom_id = "";
|
|
function createUploader(options) {
|
|
doCreateUploader(options);
|
|
}
|
|
function doCreateUploader(options) {
|
|
uploader = new (aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default().Vod)({
|
|
timeout: 6e4,
|
|
partSize: 1048576,
|
|
parallel: 5,
|
|
retryCount: 3,
|
|
retryDuration: 2,
|
|
region: "ap-southeast-1",
|
|
userId: 1829848226361863,
|
|
enableUploadProgress: false,
|
|
addFileSuccess: function(uploadInfo) {
|
|
console.log("addFileSuccess: " + uploadInfo.file.name);
|
|
options.addFileSuccess && options.addFileSuccess(uploadInfo);
|
|
uploader.startUpload();
|
|
},
|
|
// 开始上传
|
|
onUploadstarted: function(uploadInfo) {
|
|
const fileName = uploadInfo.file.name;
|
|
if (!uploadInfo.videoId) {
|
|
var createUrl = `/api/users/${login}/video_auths.json`;
|
|
const _random = "";
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(createUrl, {
|
|
method: "Post",
|
|
body: {
|
|
title: _random + fileName,
|
|
file_name: _random + fileName,
|
|
virtual_classroom_id
|
|
}
|
|
}).then((response) => {
|
|
if (response) {
|
|
const data = response.data;
|
|
var uploadAuth = data.UploadAuth;
|
|
var uploadAddress = data.UploadAddress;
|
|
var videoId = data.VideoId;
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId);
|
|
}
|
|
}).catch((error) => {
|
|
uploader.deleteFile(uploader._curIndex);
|
|
uploader.nextUpload();
|
|
console.log(error);
|
|
});
|
|
console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...");
|
|
} else {
|
|
var refreshUrl = `/api/users/${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
|
|
}
|
|
}).then((response) => {
|
|
if (response.status == -1) {
|
|
options.onUploadError && options.onUploadError(uploadInfo);
|
|
return;
|
|
}
|
|
const data = response.data;
|
|
var uploadAuth = data.UploadAuth;
|
|
var uploadAddress = data.UploadAddress;
|
|
var videoId = data.VideoId;
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress);
|
|
}).catch((error) => {
|
|
uploader.deleteFile(uploader._curIndex);
|
|
uploader.nextUpload();
|
|
console.log(error);
|
|
});
|
|
}
|
|
},
|
|
// 文件上传成功
|
|
onUploadSucceed: function(uploadInfo) {
|
|
options.onUploadSucceed && options.onUploadSucceed(uploadInfo);
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!");
|
|
},
|
|
// 文件上传失败
|
|
onUploadFailed: function(uploadInfo, code, message) {
|
|
options.onUploadFailed && options.onUploadFailed(uploadInfo);
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!");
|
|
},
|
|
// 取消文件上传
|
|
onUploadCanceled: function(uploadInfo, code, message) {
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!");
|
|
},
|
|
// 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
|
|
onUploadProgress: function(uploadInfo, totalSize, progress) {
|
|
options.onUploadProgress && options.onUploadProgress(uploadInfo, totalSize, progress);
|
|
var progressPercent = Math.ceil(progress * 100);
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...");
|
|
},
|
|
// 上传凭证超时
|
|
onUploadTokenExpired: function(uploadInfo) {
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");
|
|
var refreshUrl = `/api/users/${login}/video_auths.json`;
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(refreshUrl, {
|
|
method: "put",
|
|
body: {
|
|
video_id: uploadInfo.videoId
|
|
}
|
|
}).then((response) => {
|
|
const data = response.data;
|
|
var uploadAuth = data.UploadAuth;
|
|
uploader.resumeUploadWithAuth(uploadAuth);
|
|
}).catch((error) => {
|
|
console.log(error);
|
|
});
|
|
},
|
|
// 全部文件上传结束
|
|
onUploadEnd: function(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);
|
|
createUploader(options);
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |