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.
1357 lines
55 KiB
1357 lines
55 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[12412],{
|
|
|
|
/***/ 87588:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _ant_design_icons_svg_es_asn_ExclamationCircleOutlined__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ant-design/icons-svg/es/asn/ExclamationCircleOutlined */ 61144);
|
|
/* harmony import */ var _components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AntdIcon */ 7918);
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
var ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({}, props), {}, {
|
|
ref: ref,
|
|
icon: _ant_design_icons_svg_es_asn_ExclamationCircleOutlined__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
|
|
}));
|
|
};
|
|
ExclamationCircleOutlined.displayName = 'ExclamationCircleOutlined';
|
|
/* harmony default export */ __webpack_exports__["Z"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(ExclamationCircleOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 41262:
|
|
/*!**********************************************************!*\
|
|
!*** ./src/components/Video/Modal/index.tsx + 1 modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"K": function() { return /* binding */ VideoModal; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var style = __webpack_require__(35611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
var modal = __webpack_require__(85402);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./src/components/Video/Play/index.jsx + 1 modules
|
|
var Play = __webpack_require__(8423);
|
|
;// CONCATENATED MODULE: ./src/components/Video/Modal/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Modalmodules = ({"modal":"modal___LGwws","closeIcon":"closeIcon___vsUXI","wrap":"wrap___tDzbl","input":"input___aikQk"});
|
|
// EXTERNAL MODULE: ./node_modules/js-base64/base64.js
|
|
var base64 = __webpack_require__(19575);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/components/Video/Modal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var VideoModal = function VideoModal(_ref) {
|
|
var visible = _ref.visible,
|
|
width = _ref.width,
|
|
videoId = _ref.videoId,
|
|
file_url = _ref.file_url,
|
|
course_id = _ref.course_id,
|
|
copyUrl = _ref.copyUrl,
|
|
_ref$toLog = _ref.toLog,
|
|
toLog = _ref$toLog === void 0 ? true : _ref$toLog,
|
|
_ref$logWatchHistory = _ref.logWatchHistory,
|
|
logWatchHistory = _ref$logWatchHistory === void 0 ? function () {} : _ref$logWatchHistory,
|
|
_ref$onClose = _ref.onClose,
|
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
centered: true,
|
|
keyboard: false,
|
|
closable: false,
|
|
destroyOnClose: true,
|
|
open: visible,
|
|
title: null,
|
|
footer: null,
|
|
width: width,
|
|
className: Modalmodules.modal,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "".concat(Modalmodules.closeIcon, " iconfont icon-guanbi10"),
|
|
onClick: onClose
|
|
}), visible && /*#__PURE__*/(0,jsx_runtime.jsx)(Play/* default */.Z, {
|
|
courseId: course_id,
|
|
src: file_url !== null && file_url !== void 0 && file_url.startsWith("http") ? file_url : base64.Base64.decode(file_url),
|
|
videoId: videoId,
|
|
toLog: toLog,
|
|
logWatchHistory: logWatchHistory
|
|
})]
|
|
});
|
|
};
|
|
|
|
/***/ }),
|
|
|
|
/***/ 61627:
|
|
/*!**********************************************************************************!*\
|
|
!*** ./src/pages/User/Detail/Topics/components/SendToClassModal.tsx + 1 modules ***!
|
|
\**********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ components_SendToClassModal; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var 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/skeleton/style/index.js + 1 modules
|
|
var skeleton_style = __webpack_require__(61099);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/index.js + 11 modules
|
|
var skeleton = __webpack_require__(73481);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/style/index.js + 1 modules
|
|
var radio_style = __webpack_require__(83822);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 4 modules
|
|
var es_radio = __webpack_require__(29924);
|
|
// 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/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/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/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/User/Detail/Topics/components/SendToClassModal.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var SendToClassModalmodules = ({"title":"title___XAxiE","radioWrap":"radioWrap___k0pOB","radio":"radio___x9kMt","colorFF0000":"colorFF0000___IMgd0","pagination":"pagination___ou2ht"});
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(29427);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 33 modules
|
|
var ui_customization = __webpack_require__(85343);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/reset.less?modules
|
|
var resetmodules = __webpack_require__(39132);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Topics/components/SendToClassModal.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["userDetail", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Search = input/* default.Search */.Z.Search;
|
|
var SendToClassModal = function SendToClassModal(_ref) {
|
|
var _userDetail$actionTab4, _userDetail$actionTab5;
|
|
var userDetail = _ref.userDetail,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
var _useState = (0,react.useState)(''),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
searchValue = _useState2[0],
|
|
setSearchValue = _useState2[1];
|
|
var _useState3 = (0,react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
courseList = _useState4[0],
|
|
setCourseList = _useState4[1];
|
|
var _useState5 = (0,react.useState)(),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
radioValue = _useState6[0],
|
|
setRadioValue = _useState6[1];
|
|
var _useState7 = (0,react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
listLoading = _useState8[0],
|
|
setListLoading = _useState8[1];
|
|
var _useState9 = (0,react.useState)(false),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
hasError = _useState10[0],
|
|
setHasError = _useState10[1];
|
|
(0,react.useEffect)(function () {
|
|
if (userDetail.actionTabs.key === 'UserDetail-SendToClass') {
|
|
getCourseList(searchValue);
|
|
}
|
|
}, [userDetail.actionTabs.key]);
|
|
var getCourseList = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(value) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setListLoading(true);
|
|
_context.next = 3;
|
|
return dispatch({
|
|
type: 'userDetail/topicGetCourseList',
|
|
payload: {
|
|
search: value
|
|
}
|
|
});
|
|
case 3:
|
|
res = _context.sent;
|
|
if (res) {
|
|
setCourseList((res === null || res === void 0 ? void 0 : res.courses) || []);
|
|
}
|
|
setListLoading(false);
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getCourseList(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleOk = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
var _userDetail$actionTab;
|
|
var res, _userDetail$actionTab2, _userDetail$actionTab3, urlMapping;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
if (radioValue) {
|
|
_context2.next = 4;
|
|
break;
|
|
}
|
|
message/* default.info */.ZP.info("\u60A8\u9700\u8981\u521B\u5EFA\u8BFE\u5802\uFF0C\u624D\u80FD\u53D1\u9001");
|
|
setHasError(true);
|
|
return _context2.abrupt("return");
|
|
case 4:
|
|
_context2.next = 6;
|
|
return dispatch({
|
|
type: 'userDetail/topicSendToClass',
|
|
payload: objectSpread2_default()({
|
|
course_id: radioValue
|
|
}, (_userDetail$actionTab = userDetail.actionTabs) === null || _userDetail$actionTab === void 0 ? void 0 : _userDetail$actionTab.params)
|
|
});
|
|
case 6:
|
|
res = _context2.sent;
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {}
|
|
});
|
|
if (res && res.status === 0) {
|
|
urlMapping = {
|
|
'normal': 'common_homework',
|
|
'group': 'group_homework',
|
|
'exercise': 'exercise',
|
|
'poll': 'poll',
|
|
'videos': 'video'
|
|
};
|
|
(0,util/* openNewWindow */.xg)("/classrooms/".concat(radioValue, "/").concat(urlMapping[(_userDetail$actionTab2 = userDetail.actionTabs) === null || _userDetail$actionTab2 === void 0 ? void 0 : (_userDetail$actionTab3 = _userDetail$actionTab2.params) === null || _userDetail$actionTab3 === void 0 ? void 0 : _userDetail$actionTab3.object_type]));
|
|
}
|
|
case 9:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function handleOk() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
centered: true,
|
|
keyboard: false,
|
|
closable: false,
|
|
destroyOnClose: true,
|
|
open: userDetail.actionTabs.key === 'UserDetail-SendToClass',
|
|
title: "\u53D1\u9001\u81F3\u8BFE\u5802",
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
confirmLoading: loading['userDetail/sendToClass'],
|
|
width: 600,
|
|
afterClose: function afterClose() {
|
|
setHasError(false);
|
|
setCourseList([]);
|
|
setSearchValue('');
|
|
},
|
|
onOk: handleOk,
|
|
wrapClassName: resetmodules/* default.CustomCss */.Z.CustomCss,
|
|
onCancel: function onCancel() {
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {}
|
|
});
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: SendToClassModalmodules.wrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "mb10",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",
|
|
value: searchValue,
|
|
style: {
|
|
width: 500
|
|
},
|
|
onChange: function onChange(value) {
|
|
setSearchValue(value);
|
|
getCourseList(value);
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
|
|
active: true,
|
|
loading: listLoading,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SendToClassModalmodules.radioWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
value: radioValue,
|
|
onChange: function onChange(e) {
|
|
setRadioValue(e.target.value);
|
|
setHasError(false);
|
|
},
|
|
children: courseList.map(function (item, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
className: SendToClassModalmodules.radio,
|
|
value: item.course_id,
|
|
children: item.course_name
|
|
}, item.course_id);
|
|
})
|
|
})
|
|
})
|
|
}), ((_userDetail$actionTab4 = userDetail.actionTabs) === null || _userDetail$actionTab4 === void 0 ? void 0 : (_userDetail$actionTab5 = _userDetail$actionTab4.params) === null || _userDetail$actionTab5 === void 0 ? void 0 : _userDetail$actionTab5.object_type) !== 'videos' && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SendToClassModalmodules.title,
|
|
children: "\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"
|
|
}), hasError && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: SendToClassModalmodules.colorFF0000,
|
|
children: "\u8BF7\u5148\u9009\u62E9\u8BFE\u5802"
|
|
})]
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var components_SendToClassModal = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var userDetail = _ref4.userDetail,
|
|
loading = _ref4.loading,
|
|
globalSetting = _ref4.globalSetting;
|
|
return {
|
|
userDetail: userDetail,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects
|
|
};
|
|
})(SendToClassModal));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 85077:
|
|
/*!************************************************************!*\
|
|
!*** ./src/pages/User/Detail/Videos/index.tsx + 4 modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ Videos; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/style/index.js + 1 modules
|
|
var style = __webpack_require__(61099);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/index.js + 11 modules
|
|
var skeleton = __webpack_require__(73481);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/style/index.js + 1 modules
|
|
var pagination_style = __webpack_require__(14182);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(260);
|
|
// 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/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/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/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: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(82982);
|
|
// 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/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/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/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/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: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(84519);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(59758);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js
|
|
var CloseCircleFilled = __webpack_require__(38900);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Videos/components/VideoEdit.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EditAttendance = function EditAttendance(_ref) {
|
|
var userDetail = _ref.userDetail,
|
|
user = _ref.user,
|
|
cb = _ref.cb,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch;
|
|
var actionTabs = userDetail.actionTabs;
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
imgLoading = _useState2[0],
|
|
setImgLoading = _useState2[1];
|
|
var _useState3 = (0,react.useState)(undefined),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
attachId = _useState4[0],
|
|
setattachId = _useState4[1];
|
|
(0,react.useEffect)(function () {
|
|
if (userDetail.actionTabs.key === '编辑视频') {
|
|
var _actionTabs$data, _actionTabs$data2;
|
|
form.setFieldsValue({
|
|
title: actionTabs.data.title,
|
|
attachment_id: actionTabs === null || actionTabs === void 0 ? void 0 : (_actionTabs$data = actionTabs.data) === null || _actionTabs$data === void 0 ? void 0 : _actionTabs$data.attachment_id
|
|
});
|
|
setattachId(actionTabs === null || actionTabs === void 0 ? void 0 : (_actionTabs$data2 = actionTabs.data) === null || _actionTabs$data2 === void 0 ? void 0 : _actionTabs$data2.attachment_id);
|
|
}
|
|
}, [userDetail.actionTabs.key]);
|
|
var renderImg = function renderImg() {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
position: 'relative',
|
|
backgroundColor: '#f4f3f4',
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: env/* default.API_SERVER */.Z.API_SERVER + "/api/attachments/" + attachId,
|
|
alt: "avatar",
|
|
style: {
|
|
width: 288
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
position: 'absolute',
|
|
right: '-6px',
|
|
top: '-6px',
|
|
cursor: 'pointer',
|
|
backgroundColor: '#fff',
|
|
width: '16px',
|
|
height: '16px',
|
|
borderRadius: '50%'
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseCircleFilled/* default */.Z, {
|
|
onClick: function onClick() {
|
|
return setattachId(undefined);
|
|
},
|
|
style: {
|
|
fontSize: '16px',
|
|
color: 'red'
|
|
}
|
|
})
|
|
})]
|
|
});
|
|
};
|
|
var handleChange = function handleChange(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);
|
|
return;
|
|
}
|
|
setattachId(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.jsxs)(modal/* default */.Z, {
|
|
bodyStyle: {
|
|
padding: "30px 40px"
|
|
},
|
|
centered: true,
|
|
open: userDetail.actionTabs.key === '编辑视频' ? true : false,
|
|
footer: null,
|
|
width: 643,
|
|
destroyOnClose: true,
|
|
closable: false,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: "flex",
|
|
justifyContent: "space-between",
|
|
marginBottom: "42px"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
fontSize: "16px",
|
|
fontWeight: "500",
|
|
color: "#000",
|
|
lineHeight: "16px"
|
|
},
|
|
children: "\u89C6\u9891\u6807\u9898\u7F16\u8F91"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon-danchuangguanbi iconfont",
|
|
style: {
|
|
fontSize: "15px",
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {}
|
|
});
|
|
}
|
|
})]
|
|
}), actionTabs.data && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
form: form,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
label: "\u89C6\u9891\u6807\u9898",
|
|
name: "title",
|
|
rules: [{
|
|
required: true,
|
|
message: '请输入!'
|
|
}],
|
|
style: {
|
|
marginBottom: "34px"
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
maxLength: 60
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
|
|
name: "attachment_id",
|
|
label: "\u4E0A\u4F20\u5C01\u9762\u56FE:",
|
|
style: {
|
|
marginBottom: "34px"
|
|
},
|
|
children: attachId ? renderImg() : /*#__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: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
loading: imgLoading,
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shangchuantupian2"
|
|
}),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
marginLeft: "3px"
|
|
},
|
|
children: "\u4E0A\u4F20\u56FE\u7247"
|
|
})
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
children: "\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528278*225\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default.Item */.Z.Item, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
style: {
|
|
"float": "right",
|
|
marginLeft: "20px"
|
|
},
|
|
loading: imgLoading,
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var _actionTabs$data3, _actionTabs$data4, _user$userInfo;
|
|
var formValue, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
form.setFieldsValue({
|
|
attachment_id: attachId ? attachId : actionTabs !== null && actionTabs !== void 0 && (_actionTabs$data3 = actionTabs.data) !== null && _actionTabs$data3 !== void 0 && _actionTabs$data3.attachment_id ? actionTabs === null || actionTabs === void 0 ? void 0 : (_actionTabs$data4 = actionTabs.data) === null || _actionTabs$data4 === void 0 ? void 0 : _actionTabs$data4.attachment_id : undefined
|
|
});
|
|
_context.t0 = (objectSpread2_default());
|
|
_context.t1 = {};
|
|
_context.next = 5;
|
|
return form.validateFields();
|
|
case 5:
|
|
_context.t2 = _context.sent;
|
|
formValue = (0, _context.t0)(_context.t1, _context.t2);
|
|
_context.next = 9;
|
|
return (0,fetch/* default */.ZP)("/api/users/".concat(user === null || user === void 0 ? void 0 : (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, "/videos/").concat(actionTabs.data.id, "/change_cover.json"), {
|
|
method: 'put',
|
|
body: objectSpread2_default()({}, formValue)
|
|
});
|
|
case 9:
|
|
res = _context.sent;
|
|
if (res) {
|
|
message/* default.success */.ZP.success('修改成功');
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {}
|
|
});
|
|
cb();
|
|
}
|
|
case 11:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
})),
|
|
children: "\u786E\u5B9A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
style: {
|
|
"float": "right"
|
|
},
|
|
onClick: function onClick() {
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {}
|
|
});
|
|
},
|
|
children: "\u53D6\u6D88"
|
|
})]
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var VideoEdit = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var userDetail = _ref3.userDetail,
|
|
loading = _ref3.loading,
|
|
user = _ref3.user;
|
|
return {
|
|
userDetail: userDetail,
|
|
loading: loading,
|
|
user: user
|
|
};
|
|
})(EditAttendance));
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/card/style/index.js + 1 modules
|
|
var card_style = __webpack_require__(78548);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/card/index.js + 3 modules
|
|
var card = __webpack_require__(59652);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/style/index.js + 1 modules
|
|
var spin_style = __webpack_require__(22536);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js
|
|
var spin = __webpack_require__(11382);
|
|
// 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: ./src/assets/images/video/play.png
|
|
var play = __webpack_require__(36193);
|
|
// EXTERNAL MODULE: ./node_modules/react-copy-to-clipboard/lib/index.js
|
|
var lib = __webpack_require__(74855);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Videos/components/Items/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Itemsmodules = ({"flex_box_center":"flex_box_center___XLvPY","flex_space_between":"flex_space_between___olqDv","flex_box_vertical_center":"flex_box_vertical_center___7Ehj3","flex_box_center_end":"flex_box_center_end___eAyvU","flex_box_column":"flex_box_column___h6EKr","wrap":"wrap___jMjpV","bottomActionWrap":"bottomActionWrap___MLvvL","playIconWrap2":"playIconWrap2___tjBpv","playIcon":"playIcon___Zxs9h","playIconWrap":"playIconWrap___yexC0","linkWrap":"linkWrap___mfd8s","link":"link___XFVyj","imgWrap":"imgWrap___VBvxW","cardBottom":"cardBottom___afGBc","bottomTitle":"bottomTitle___ZuGLa","actionIcon":"actionIcon___yvtTa","timeWrap":"timeWrap___j2lof","time":"time___IA2yw","peopleWrap":"peopleWrap___O2Jrn","playTime":"playTime___apDZs","bottomTitleTip":"bottomTitleTip___nLAHv"});
|
|
// EXTERNAL MODULE: ./src/components/Video/Modal/index.tsx + 1 modules
|
|
var Modal = __webpack_require__(41262);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Videos/components/Items/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DEFAULT_VIDEO_WIDTH_IN_MD = "90%"; // 400
|
|
var DEFAULT_VIDEO_HEIGHT_IN_MD = "55%"; // 400
|
|
|
|
var Items = function Items(_ref) {
|
|
var data = _ref.data,
|
|
isReview = _ref.isReview,
|
|
dispatch = _ref.dispatch,
|
|
_ref$onDelete = _ref.onDelete,
|
|
onDelete = _ref$onDelete === void 0 ? function () {} : _ref$onDelete,
|
|
_ref$logWatchHistory = _ref.logWatchHistory,
|
|
logWatchHistory = _ref$logWatchHistory === void 0 ? function () {} : _ref$logWatchHistory,
|
|
_ref$onSend = _ref.onSend,
|
|
onSend = _ref$onSend === void 0 ? function () {} : _ref$onSend;
|
|
var _useState = (0,react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
visible = _useState2[0],
|
|
setVisible = _useState2[1];
|
|
var _useState3 = (0,react.useState)({}),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
currentVideo = _useState4[0],
|
|
setCurrentVideo = _useState4[1];
|
|
var formatTime = function formatTime(timeInSeconds) {
|
|
if (isNaN(timeInSeconds)) {
|
|
return {
|
|
minutes: '00',
|
|
seconds: '00'
|
|
};
|
|
}
|
|
var result = new Date(timeInSeconds * 1000).toISOString().substr(11, 8);
|
|
return {
|
|
hour: result.substr(0, 2),
|
|
minutes: result.substr(3, 2),
|
|
seconds: result.substr(6, 2)
|
|
};
|
|
};
|
|
var handleVideoClick = function handleVideoClick(item) {
|
|
if (item.link) {
|
|
return;
|
|
}
|
|
setVisible(true);
|
|
setCurrentVideo({
|
|
videoId: item.id,
|
|
file_url: item.play_url || item.file_url,
|
|
copyUrl: getCopyText(item.play_url || item.file_url, item.cover_url),
|
|
logWatchHistory: logWatchHistory
|
|
});
|
|
};
|
|
var getCopyText = function getCopyText(file_url, cover_url) {
|
|
if (file_url) {
|
|
return "<video src=\"".concat(atob(file_url), "\" controls=\"true\" controlslist=\"nodownload\" width=\"").concat(DEFAULT_VIDEO_WIDTH_IN_MD, "\" height=\"").concat(DEFAULT_VIDEO_HEIGHT_IN_MD, "\" poster=\"").concat(cover_url, "\">\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 video \u6807\u7B7E\u3002</video>");
|
|
}
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
children: [data && data.map(function (item, key) {
|
|
var _item$cover_url;
|
|
var time = formatTime(item.play_duration || 0);
|
|
var imgUrl = item !== null && item !== void 0 && (_item$cover_url = item.cover_url) !== null && _item$cover_url !== void 0 && _item$cover_url.includes('https') ? item.cover_url : env/* default.API_SERVER */.Z.API_SERVER + item.cover_url;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
className: Itemsmodules.wrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(card/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u89C6\u9891\u65F6\u957F",
|
|
placement: "bottom",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemsmodules.playTime,
|
|
children: [time.hour === "00" ? '' : time.hour + ':', time.minutes + ':', time.seconds]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
tip: "\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",
|
|
spinning: !item.transcoded && !item.link,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemsmodules.imgWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: imgUrl
|
|
}), item.link && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
className: Itemsmodules.linkWrap,
|
|
href: item.link,
|
|
target: "_blank",
|
|
title: item.title,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Itemsmodules.link,
|
|
children: "\u5916\u94FE"
|
|
})
|
|
}), !isReview ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Itemsmodules.playIconWrap,
|
|
onClick: function onClick() {
|
|
!isReview && handleVideoClick(item);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
className: Itemsmodules.playIcon,
|
|
src: play
|
|
})
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Itemsmodules.playIconWrap2,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
className: Itemsmodules.playIcon,
|
|
src: play
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemsmodules.bottomActionWrap,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: Itemsmodules.peopleWrap,
|
|
children: !!item.people_num && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u89C2\u770B\u4EBA\u6570",
|
|
placement: "bottom",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon-dianjiliang iconfont font12",
|
|
children: item.people_num
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u7F16\u8F91",
|
|
placement: "top",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "".concat(Itemsmodules.actionIcon, " icon-bianji10 iconfont"),
|
|
onClick: function onClick() {
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {
|
|
key: '编辑视频',
|
|
data: item //data有无数据判断是增加还是编辑外链视频
|
|
}
|
|
});
|
|
},
|
|
|
|
style: {
|
|
marginTop: '1px',
|
|
display: 'inline-block'
|
|
}
|
|
})
|
|
}), !isReview && /*#__PURE__*/(0,jsx_runtime.jsx)(lib.CopyToClipboard, {
|
|
text: getCopyText(item.play_url || item.file_url, item.cover_url),
|
|
onCopy: function onCopy() {
|
|
return message/* default.success */.ZP.success('复制成功');
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u590D\u5236\u94FE\u63A5",
|
|
placement: "top",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "".concat(Itemsmodules.actionIcon, " icon-lianjie2 iconfont")
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u5220\u9664",
|
|
placement: "top",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "".concat(Itemsmodules.actionIcon, " icon-shanchu12 iconfont"),
|
|
onClick: function onClick() {
|
|
return onDelete(item.id);
|
|
}
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u53D1\u9001\u81F3\u8BFE\u5802",
|
|
placement: "top",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "".concat(Itemsmodules.actionIcon, " icon-fasongzhiketang"),
|
|
onClick: function onClick() {
|
|
return onSend(item.id);
|
|
}
|
|
})
|
|
})]
|
|
})]
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Itemsmodules.cardBottom,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
overlayClassName: Itemsmodules.bottomTitleTip,
|
|
getPopupContainer: function getPopupContainer(e) {
|
|
return e.parentNode;
|
|
},
|
|
title: item === null || item === void 0 ? void 0 : item.title,
|
|
placement: "bottom",
|
|
autoAdjustOverflow: false,
|
|
arrowPointAtCenter: true,
|
|
mouseEnterDelay: 0,
|
|
mouseLeaveDelay: 0,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Itemsmodules.bottomTitle,
|
|
children: item.title
|
|
})
|
|
}), item.total_time && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Itemsmodules.timeWrap,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Itemsmodules.time,
|
|
children: item.total_time && "\u7D2F\u8BA1\u5B66\u4E60\u65F6\u957F\uFF1A".concat(item.total_time)
|
|
})
|
|
})]
|
|
})]
|
|
})
|
|
}, item.id);
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Modal/* VideoModal */.K, objectSpread2_default()(objectSpread2_default()({}, currentVideo), {}, {
|
|
visible: visible,
|
|
width: 800,
|
|
onClose: function onClose() {
|
|
setVisible(false);
|
|
setCurrentVideo({});
|
|
}
|
|
}))]
|
|
});
|
|
};
|
|
/* harmony default export */ var components_Items = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
var userDetail = _ref2.userDetail;
|
|
return {
|
|
userDetail: userDetail
|
|
};
|
|
})(Items));
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Videos/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Videosmodules = ({"flex_box_center":"flex_box_center___IcqlF","flex_space_between":"flex_space_between___wI3bO","flex_box_vertical_center":"flex_box_vertical_center___wd4F6","flex_box_center_end":"flex_box_center_end___sX6yw","flex_box_column":"flex_box_column___oOUfO","body":"body___qkQFy","status":"status___lJSfh","datalist":"datalist___u3xx3","pager":"pager___inNi6","wrap":"wrap___u5nsU","midWrap":"midWrap___AEcVw","color999":"color999___UbIGq","orderWrap":"orderWrap___NBpTb","orderIconWrap":"orderIconWrap___BWV6J","orderAsc":"orderAsc___d0bIf","orderDesc":"orderDesc___XbnhV","color0152d9":"color0152d9___QUmiG","h10":"h10___aHhYp","cursorPointer":"cursorPointer___tv0ub","orderTextWrap":"orderTextWrap___xIS1a","cardWrap":"cardWrap___YxQcT","countWrap":"countWrap___nr9pc","colorRed":"colorRed___zZSQ2","modal":"modal___AyGQi"});
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 3 modules
|
|
var verifyLogin = __webpack_require__(72551);
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
var mediator = __webpack_require__(91562);
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 33 modules
|
|
var ui_customization = __webpack_require__(85343);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(29427);
|
|
// EXTERNAL MODULE: ./src/pages/User/Detail/Topics/components/SendToClassModal.tsx + 1 modules
|
|
var SendToClassModal = __webpack_require__(61627);
|
|
;// CONCATENATED MODULE: ./src/pages/User/Detail/Videos/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["user", "userDetail", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Upload = function Upload(_ref) {
|
|
var _location$pathname$sp2;
|
|
var user = _ref.user,
|
|
userDetail = _ref.userDetail,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
dispatch = _ref.dispatch,
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
searchParams = _useSearchParams2[0];
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
var username = (0,react.useRef)();
|
|
var _useState = (0,react.useState)(0),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
count = _useState2[0],
|
|
setCount = _useState2[1];
|
|
var _useState3 = (0,react.useState)([]),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
data = _useState4[0],
|
|
setData = _useState4[1];
|
|
var _useState5 = (0,react.useState)({
|
|
category: searchParams.get("category") || 'all',
|
|
page: 1,
|
|
per_page: 15,
|
|
sort_by: 'published_at',
|
|
sort_direction: 'desc',
|
|
username: null,
|
|
search: null
|
|
}),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
params = _useState6[0],
|
|
setParams = _useState6[1];
|
|
var _useState7 = (0,react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
showSearchText = _useState8[0],
|
|
setShowSearchText = _useState8[1];
|
|
(0,react.useEffect)(function () {
|
|
var _location$pathname$sp;
|
|
username.current = (_location$pathname$sp = location.pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2];
|
|
params.username = username.current;
|
|
setParams(params);
|
|
getVideos(params);
|
|
}, [location.pathname]);
|
|
var currentTabName = ((_location$pathname$sp2 = location.pathname.split('/')) === null || _location$pathname$sp2 === void 0 ? void 0 : _location$pathname$sp2[3]) || 'classrooms';
|
|
(0,react.useEffect)(function () {
|
|
var unSub = mediator/* default.subscribe */.Z.subscribe('user-detail-search', /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(data) {
|
|
var query;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
if (!(currentTabName === data.currentTabName)) {
|
|
_context.next = 7;
|
|
break;
|
|
}
|
|
query = {
|
|
category: 'all',
|
|
page: 1,
|
|
per_page: 15,
|
|
sort_by: 'published_at',
|
|
sort_direction: 'desc',
|
|
username: username.current,
|
|
search: data.value
|
|
};
|
|
setParams(query);
|
|
setShowSearchText(false);
|
|
_context.next = 6;
|
|
return getVideos(query);
|
|
case 6:
|
|
setShowSearchText(true);
|
|
case 7:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function (_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}());
|
|
return unSub;
|
|
}, []);
|
|
var getVideos = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(query) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
if (!(query.category === 'all')) {
|
|
_context2.next = 6;
|
|
break;
|
|
}
|
|
_context2.next = 3;
|
|
return dispatch({
|
|
type: 'userDetail/getVideos',
|
|
payload: query
|
|
});
|
|
case 3:
|
|
res = _context2.sent;
|
|
_context2.next = 9;
|
|
break;
|
|
case 6:
|
|
_context2.next = 8;
|
|
return dispatch({
|
|
type: 'userDetail/getReviewVideos',
|
|
payload: query
|
|
});
|
|
case 8:
|
|
res = _context2.sent;
|
|
case 9:
|
|
if (res) {
|
|
setCount(res.count || 0);
|
|
setData(res.videos || []);
|
|
}
|
|
case 10:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function getVideos(_x2) {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleSearch = function handleSearch(value) {
|
|
params.search = value;
|
|
params.page = 1;
|
|
setParams(params);
|
|
getVideos(params);
|
|
};
|
|
var handleChangeCategory = function handleChangeCategory(category) {
|
|
var _window$location$href;
|
|
params.category = category;
|
|
params.page = 1;
|
|
if ((_window$location$href = window.location.href.toString()) !== null && _window$location$href !== void 0 && _window$location$href.includes('category')) {
|
|
(0,util/* replaceParamVal */.jz)('category', category);
|
|
} else {
|
|
window.history.replaceState(null, '', window.location.href.indexOf('?') > -1 ? window.location.href + "&category=".concat(category) : "?category=".concat(category));
|
|
}
|
|
setParams(params);
|
|
getVideos(params);
|
|
};
|
|
var handleChangeOrder = function handleChangeOrder() {
|
|
params.sort_direction = params.sort_direction === 'desc' ? 'asc' : 'desc';
|
|
setParams(params);
|
|
getVideos(params);
|
|
};
|
|
var handleChangePage = function handleChangePage(page) {
|
|
params.page = page;
|
|
setParams(params);
|
|
getVideos(params);
|
|
};
|
|
var handleUpload = function handleUpload() {
|
|
var _user$userInfo, _user$userInfo2;
|
|
if ((_user$userInfo = user.userInfo) !== null && _user$userInfo !== void 0 && _user$userInfo.admin || (_user$userInfo2 = user.userInfo) !== null && _user$userInfo2 !== void 0 && _user$userInfo2.is_teacher && (0,verifyLogin/* handleProfessionalCertificationModal */.O5)()) {
|
|
_umi_production_exports.history.push("/users/".concat(username.current, "/videos/upload"));
|
|
}
|
|
};
|
|
var handleDelete = function handleDelete(id) {
|
|
var info = modal/* default.confirm */.Z.confirm({
|
|
icon: null,
|
|
centered: true,
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
margin: "0px 20px"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
display: "flex",
|
|
justifyContent: "space-between",
|
|
marginBottom: "42px"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
fontWeight: '500',
|
|
color: '#000000',
|
|
lineHeight: '16px'
|
|
},
|
|
children: "\u63D0\u793A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon-danchuangguanbi iconfont",
|
|
style: {
|
|
cursor: "pointer"
|
|
},
|
|
onClick: function onClick() {
|
|
info.destroy();
|
|
}
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Videosmodules.modal,
|
|
children: "\u8BE5\u89C6\u9891\u5C06\u88AB\u5220\u9664\uFF0C\u4E0D\u53EF\u6062\u590D\uFF0C\u662F\u5426\u786E\u8BA4\u5220\u9664?"
|
|
})]
|
|
}),
|
|
okType: "default",
|
|
onOk: function () {
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.next = 2;
|
|
return dispatch({
|
|
type: 'userDetail/deleteVideo',
|
|
payload: {
|
|
id: id,
|
|
username: username.current
|
|
}
|
|
});
|
|
case 2:
|
|
res = _context3.sent;
|
|
if (res) {
|
|
message/* default.info */.ZP.info('视频删除成功!');
|
|
getVideos(params);
|
|
}
|
|
case 4:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3);
|
|
}));
|
|
function onOk() {
|
|
return _onOk.apply(this, arguments);
|
|
}
|
|
return onOk;
|
|
}()
|
|
});
|
|
};
|
|
var handleSend = function handleSend(id) {
|
|
dispatch({
|
|
type: 'userDetail/setActionTabs',
|
|
payload: {
|
|
key: 'UserDetail-SendToClass',
|
|
params: {
|
|
object_id: id,
|
|
username: username.current,
|
|
object_type: 'videos'
|
|
}
|
|
}
|
|
});
|
|
};
|
|
var handleLogWatchHistory = function handleLogWatchHistory(query) {
|
|
return dispatch({
|
|
type: 'userDetail/logWatchHistory',
|
|
payload: query
|
|
});
|
|
};
|
|
var dataSource = [{
|
|
id: 'all',
|
|
name: '全部视频'
|
|
}, {
|
|
id: 'pending',
|
|
name: '待审核视频'
|
|
}];
|
|
var sort = [{
|
|
id: 'published_at',
|
|
name: '最新上传'
|
|
}];
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Videosmodules.body,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomTabs */.YG, {
|
|
onChange: handleChangeCategory,
|
|
value: params.category,
|
|
tabBarExtraContent: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
|
|
style: {
|
|
width: 303
|
|
},
|
|
placeholder: "\u641C\u7D22\u89C6\u9891",
|
|
value: params.search,
|
|
onChange: handleSearch
|
|
}),
|
|
className: "mb25",
|
|
dataSource: dataSource
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Videosmodules.status,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* SuperiorSort */.cq, {
|
|
dataSource: sort,
|
|
sortValue: params.sort_direction,
|
|
dropValue: params.sort_by,
|
|
onSort: handleChangeOrder,
|
|
onDrop: function onDrop() {
|
|
console.log(123123);
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, {
|
|
style: {
|
|
marginLeft: 'auto'
|
|
},
|
|
onClick: handleUpload,
|
|
children: "\u4E0A\u4F20\u89C6\u9891"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
loading: !!(loading['userDetail/getVideos'] || loading['userDetail/getReviewVideos']),
|
|
active: true,
|
|
paragraph: {
|
|
rows: 5
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Videosmodules.datalist,
|
|
children: data.length == 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(components_Items, {
|
|
data: data,
|
|
isReview: params.category === 'pending',
|
|
onDelete: handleDelete,
|
|
onSend: handleSend,
|
|
logWatchHistory: handleLogWatchHistory
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: Videosmodules.pager,
|
|
children: count > params.per_page && /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
showQuickJumper: true,
|
|
showSizeChanger: false,
|
|
total: count,
|
|
onChange: function onChange(page) {
|
|
return handleChangePage(page);
|
|
},
|
|
pageSize: 16,
|
|
current: params.page
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SendToClassModal/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(VideoEdit, {
|
|
cb: function cb() {
|
|
return getVideos(params);
|
|
}
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var Videos = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var user = _ref4.user,
|
|
userDetail = _ref4.userDetail,
|
|
loading = _ref4.loading,
|
|
globalSetting = _ref4.globalSetting;
|
|
return {
|
|
user: user,
|
|
userDetail: userDetail,
|
|
globalSetting: globalSetting,
|
|
loading: loading.effects
|
|
};
|
|
})(Upload));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 39132:
|
|
/*!************************************************************!*\
|
|
!*** ./src/components/ui-customization/reset.less?modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ __webpack_exports__["Z"] = ({"flex_box_center":"flex_box_center___vG4eV","flex_space_between":"flex_space_between___qVVxe","flex_box_vertical_center":"flex_box_vertical_center___P8Z8s","flex_box_center_end":"flex_box_center_end___VMme3","flex_box_column":"flex_box_column___VMHwm","CustomCss":"CustomCss___fWNtn","CustomTipsModalCss":"CustomTipsModalCss___MmFkT","dropdownmenus":"dropdownmenus___oVzoj","popupClassNames":"popupClassNames___OcZq7","selectdown":"selectdown___mmcA8"});
|
|
|
|
/***/ })
|
|
|
|
}]); |