|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[68827],{
|
|
|
|
|
|
/***/ 6222:
|
|
|
/*!************************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/FolderOpenOutlined.js + 1 modules ***!
|
|
|
\************************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_FolderOpenOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.0@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(36384);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/FolderOpenOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var FolderOpenOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z" } }] }, "name": "folder-open", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_FolderOpenOutlined = (FolderOpenOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(15436);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/FolderOpenOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FolderOpenOutlined_FolderOpenOutlined = function FolderOpenOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_FolderOpenOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_FolderOpenOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(FolderOpenOutlined_FolderOpenOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 84056:
|
|
|
/*!**************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/OnlineLearning/index.tsx + 13 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 */ OnlineLearning; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createForOfIteratorHelper.js
|
|
|
var createForOfIteratorHelper = __webpack_require__(91232);
|
|
|
var createForOfIteratorHelper_default = /*#__PURE__*/__webpack_require__.n(createForOfIteratorHelper);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(39647);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// 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__(8931);
|
|
|
// 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/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/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// 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/divider/index.js + 1 modules
|
|
|
var divider = __webpack_require__(28103);
|
|
|
// 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/skeleton/index.js + 12 modules
|
|
|
var skeleton = __webpack_require__(2518);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
|
var es_radio = __webpack_require__(5112);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-beautiful-dnd@13.0.0@react-beautiful-dnd/dist/react-beautiful-dnd.esm.js + 27 modules
|
|
|
var react_beautiful_dnd_esm = __webpack_require__(15445);
|
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
|
var shixuns = __webpack_require__(60118);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(63834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
|
var dayjs_min = __webpack_require__(9498);
|
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var OnlineLearningmodules = ({"flex_box_center":"flex_box_center___Eli3_","flex_space_between":"flex_space_between___b9mMZ","flex_box_vertical_center":"flex_box_vertical_center___HDlqC","flex_box_center_end":"flex_box_center_end___wxSjo","flex_box_column":"flex_box_column___riQIC","icons":"icons___fU5ZJ","shixuns":"shixuns___HhH4T","buttons":"buttons___Xd62N","addStage":"addStage___Ap4gr","color4CA":"color4CA___dMAG4","color204":"color204___ySVKY","completed":"completed___pNt1x","actionTabs":"actionTabs___x3cPl","tab":"tab___BFnIn","s1":"s1___O6K2P","tabActive":"tabActive___v3_qF","total":"total___oZdqK","introContent":"introContent___dSvDD","introContentMaxHeight":"introContentMaxHeight___NxSzO"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/drawer/index.js + 9 modules
|
|
|
var drawer = __webpack_require__(43428);
|
|
|
// 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/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(36697);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(14735);
|
|
|
// EXTERNAL MODULE: ./src/service/onlineLearning.ts
|
|
|
var onlineLearning = __webpack_require__(37166);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(71912);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/SelectShixuns/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var SelectShixunsmodules = ({"flex_box_center":"flex_box_center___bI3gK","flex_space_between":"flex_space_between___ZyemH","flex_box_vertical_center":"flex_box_vertical_center___vOG6y","flex_box_center_end":"flex_box_center_end___g0YQU","flex_box_column":"flex_box_column___a7oLH","wrp":"wrp___wYwtQ","drawer":"drawer___UVA9h","menu":"menu___s5Hi1","actived":"actived___GavBb","actived2":"actived2___XNyxe","listItem":"listItem___OyHb7","info":"info___UU9rA","title":"title___CmRLc","titleLeft":"titleLeft___xWCXz","titleRight":"titleRight___PeYdC","search":"search___CzPOL","description":"description___TEI_C","menuCourse":"menuCourse___Z8Z9h"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/SelectShixuns/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Search = input/* default */.Z.Search;
|
|
|
var shixunFilter = [{
|
|
|
id: "type",
|
|
|
name: "筛选",
|
|
|
children: [{
|
|
|
name: "全部实训",
|
|
|
id: "all",
|
|
|
type: "type"
|
|
|
}, {
|
|
|
name: "我的实训",
|
|
|
id: "mine",
|
|
|
type: "type"
|
|
|
}]
|
|
|
}, {
|
|
|
id: "diff",
|
|
|
name: "难度",
|
|
|
children: [{
|
|
|
name: "全部",
|
|
|
id: "",
|
|
|
type: "diff"
|
|
|
}, {
|
|
|
name: "初级",
|
|
|
id: 1,
|
|
|
type: "diff"
|
|
|
}, {
|
|
|
name: "中级",
|
|
|
id: 2,
|
|
|
type: "diff"
|
|
|
}, {
|
|
|
name: "中高级",
|
|
|
id: 3,
|
|
|
type: "diff"
|
|
|
}, {
|
|
|
name: "高级",
|
|
|
id: 4,
|
|
|
type: "diff"
|
|
|
}]
|
|
|
}];
|
|
|
var PublishShixun = function PublishShixun(_ref) {
|
|
|
var _shixunLists$shixun_l2;
|
|
|
var classroomList = _ref.classroomList,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch,
|
|
|
cb = _ref.cb,
|
|
|
_ref$shixunIds = _ref.shixunIds,
|
|
|
shixunIds = _ref$shixunIds === void 0 ? [] : _ref$shixunIds;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var actionTabs = classroomList.actionTabs;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var shixunLists = classroomList.shixunLists;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
groupsData = _useState2[0],
|
|
|
setGroupsData = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
selectArrs = _useState4[0],
|
|
|
setSelectArrs = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({
|
|
|
page: 1,
|
|
|
type: "all",
|
|
|
diff: 0,
|
|
|
status: "all",
|
|
|
order: "desc",
|
|
|
limit: 20,
|
|
|
sort: "myshixuns_count",
|
|
|
group_id: null
|
|
|
}),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
query = _useState6[0],
|
|
|
setQuery = _useState6[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (classroomList.actionTabs.key === '选用实践项目') {
|
|
|
query.page = 1;
|
|
|
dispatch({
|
|
|
type: 'classroomList/getShixunLists',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
}
|
|
|
}, [classroomList.actionTabs.key]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData();
|
|
|
}, [params]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var result;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/user_setting_groups.json", {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
type: 'Shixun'
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
result = _context.sent;
|
|
|
setGroupsData([{
|
|
|
id: null,
|
|
|
name: "全部"
|
|
|
}, {
|
|
|
id: -1,
|
|
|
name: "未加入目录"
|
|
|
}].concat(toConsumableArray_default()((result === null || result === void 0 ? void 0 : result.groups) || [])));
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleCancel = function handleCancel() {
|
|
|
dispatch({
|
|
|
type: 'classroomList/setActionTabs',
|
|
|
payload: {}
|
|
|
});
|
|
|
setQuery({
|
|
|
page: 1,
|
|
|
type: "all",
|
|
|
diff: 0,
|
|
|
status: "all",
|
|
|
order: "desc",
|
|
|
limit: 20,
|
|
|
sort: "myshixuns_count",
|
|
|
group_id: null
|
|
|
});
|
|
|
};
|
|
|
if (classroomList.actionTabs.key !== '选用实践项目') return null;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(drawer/* default */.Z, {
|
|
|
placement: "bottom",
|
|
|
height: "100%",
|
|
|
closable: false
|
|
|
// onClose={this.onClose}
|
|
|
,
|
|
|
open: classroomList.actionTabs.key === '选用实践项目' ? true : false,
|
|
|
rootClassName: SelectShixunsmodules.drawer,
|
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
handleCancel();
|
|
|
setSelectArrs([]);
|
|
|
cb('取消');
|
|
|
},
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var _loop, _ret, i, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_loop = /*#__PURE__*/regeneratorRuntime_default()().mark(function _loop() {
|
|
|
var selectItem, _shixunLists$shixun_l;
|
|
|
return regeneratorRuntime_default()().wrap(function _loop$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
selectItem = selectArrs[i];
|
|
|
if (!shixunIds.includes(selectItem)) {
|
|
|
_context2.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(shixunLists === null || shixunLists === void 0 || (_shixunLists$shixun_l = shixunLists.shixun_list) === null || _shixunLists$shixun_l === void 0 || (_shixunLists$shixun_l = _shixunLists$shixun_l.find(function (item) {
|
|
|
return item.id === selectItem;
|
|
|
})) === null || _shixunLists$shixun_l === void 0 ? void 0 : _shixunLists$shixun_l.title));
|
|
|
return _context2.abrupt("return", {
|
|
|
v: void 0
|
|
|
});
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _loop);
|
|
|
});
|
|
|
i = 0;
|
|
|
case 2:
|
|
|
if (!(i < (selectArrs === null || selectArrs === void 0 ? void 0 : selectArrs.length))) {
|
|
|
_context3.next = 10;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.delegateYield(_loop(), "t0", 4);
|
|
|
case 4:
|
|
|
_ret = _context3.t0;
|
|
|
if (!_ret) {
|
|
|
_context3.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return", _ret.v);
|
|
|
case 7:
|
|
|
i++;
|
|
|
_context3.next = 2;
|
|
|
break;
|
|
|
case 10:
|
|
|
_context3.next = 12;
|
|
|
return (0,onlineLearning/* selectShixunToStage */.Ep)({
|
|
|
id: classroomList.actionTabs.id,
|
|
|
course_id: classroomList.actionTabs.course_id,
|
|
|
shixun_ids: toConsumableArray_default()(selectArrs)
|
|
|
});
|
|
|
case 12:
|
|
|
res = _context3.sent;
|
|
|
setSelectArrs([]);
|
|
|
if (res !== null && res !== void 0 && res.shixuns_list) {
|
|
|
handleCancel();
|
|
|
cb(res.shixuns_list);
|
|
|
}
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
})),
|
|
|
type: "primary",
|
|
|
children: "\u786E\u5B9A"
|
|
|
})]
|
|
|
}),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
className: "tc",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Search, {
|
|
|
placeholder: "\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",
|
|
|
enterButton: "\u641C\u7D22",
|
|
|
size: 'middle',
|
|
|
className: SelectShixunsmodules.search,
|
|
|
onSearch: function onSearch(value) {
|
|
|
query.keyword = value;
|
|
|
query.page = 1;
|
|
|
dispatch({
|
|
|
type: 'classroomList/getShixunLists',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "edu-container",
|
|
|
children: [shixunFilter.map(function (v, k) {
|
|
|
var _v$children;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: SelectShixunsmodules.menu,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: v.name
|
|
|
}), v === null || v === void 0 || (_v$children = v.children) === null || _v$children === void 0 ? void 0 : _v$children.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: query[v.id] == val.id ? SelectShixunsmodules.actived : '',
|
|
|
onClick: function onClick() {
|
|
|
query[v.id] = val.id;
|
|
|
query.page = 1;
|
|
|
setQuery(objectSpread2_default()({}, query));
|
|
|
dispatch({
|
|
|
type: 'classroomList/getShixunLists',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: val.name
|
|
|
})
|
|
|
});
|
|
|
})]
|
|
|
}, k);
|
|
|
}), query.type === 'mine' && /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: SelectShixunsmodules.menu,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: "\u76EE\u5F55"
|
|
|
}), groupsData === null || groupsData === void 0 ? void 0 : groupsData.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: query['group_id'] == val.id ? SelectShixunsmodules.actived : '',
|
|
|
onClick: function onClick() {
|
|
|
query['group_id'] = val.id;
|
|
|
query.page = 1;
|
|
|
setQuery(objectSpread2_default()({}, query));
|
|
|
dispatch({
|
|
|
type: 'classroomList/getShixunLists',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
children: val.name
|
|
|
})
|
|
|
}, val.name);
|
|
|
})]
|
|
|
}), shixunLists === null || shixunLists === void 0 || (_shixunLists$shixun_l2 = shixunLists.shixun_list) === null || _shixunLists$shixun_l2 === void 0 ? void 0 : _shixunLists$shixun_l2.map(function (v, k) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: SelectShixunsmodules.listItem,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
checked: selectArrs.includes(v.id),
|
|
|
value: v.id,
|
|
|
onChange: function onChange(e) {
|
|
|
var key = selectArrs.indexOf(v.id);
|
|
|
if (selectArrs.indexOf(v.id) > -1) {
|
|
|
setSelectArrs(selectArrs.filter(function (val) {
|
|
|
return val !== v.id;
|
|
|
}));
|
|
|
} else {
|
|
|
setSelectArrs(selectArrs.concat(v.id));
|
|
|
}
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: SelectShixunsmodules.info,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: SelectShixunsmodules.title,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: SelectShixunsmodules.titleLeft,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: "c-black",
|
|
|
href: "/shixuns/".concat(v === null || v === void 0 ? void 0 : v.identifier, "/challenges"),
|
|
|
target: "_blank",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
|
className: "font16",
|
|
|
dangerouslySetInnerHTML: {
|
|
|
__html: v.title
|
|
|
}
|
|
|
})
|
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && (v === null || v === void 0 ? void 0 : v.mark_status) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: v === null || v === void 0 ? void 0 : v.mark_content,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginRight: 'auto',
|
|
|
background: '#2FA34F'
|
|
|
},
|
|
|
className: "tag-style current ml10",
|
|
|
children: "\u6B63\u5E38"
|
|
|
})
|
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && (v === null || v === void 0 ? void 0 : v.mark_status) === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: v === null || v === void 0 ? void 0 : v.mark_content,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginRight: 'auto',
|
|
|
background: '#FF8C29'
|
|
|
},
|
|
|
className: "tag-style current ml10",
|
|
|
children: "\u9700\u5B8C\u5584"
|
|
|
})
|
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && (v === null || v === void 0 ? void 0 : v.mark_status) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: v === null || v === void 0 ? void 0 : v.mark_content,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginRight: 'auto',
|
|
|
background: '#E53333'
|
|
|
},
|
|
|
className: "tag-style current ml10",
|
|
|
children: "\u65E0\u6CD5\u4F7F\u7528"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "flex-wrp mt10 font14 c-light-black",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: SelectShixunsmodules.description,
|
|
|
dangerouslySetInnerHTML: {
|
|
|
__html: v.description
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "flex-wrp mt15",
|
|
|
children: v.challenge_names.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "mr30 font12",
|
|
|
children: ["\u7B2C", key + 1, "\u5173 ", val, " "]
|
|
|
}, key);
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
|
|
|
dashed: true
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "c-light-black mt20 font12",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: v.author_name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml15 mr15",
|
|
|
children: "|"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: v.author_school_name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml15 mr15",
|
|
|
children: "|"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u96BE\u5EA6\u7CFB\u6570:", v.level]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml15 mr15",
|
|
|
children: "|"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5B66\u4E60\u4EBA\u6570:"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: v.study_count
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}, k);
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
current: query.page || 1,
|
|
|
hideOnSinglePage: true,
|
|
|
showSizeChanger: false,
|
|
|
defaultPageSize: 20,
|
|
|
showQuickJumper: true,
|
|
|
total: shixunLists === null || shixunLists === void 0 ? void 0 : shixunLists.shixuns_count,
|
|
|
onChange: function onChange(page) {
|
|
|
query.page = page;
|
|
|
dispatch({
|
|
|
type: 'classroomList/getShixunLists',
|
|
|
payload: objectSpread2_default()({}, query)
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
}, "bottom");
|
|
|
};
|
|
|
/* harmony default export */ var SelectShixuns = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var classroomList = _ref4.classroomList,
|
|
|
loading = _ref4.loading;
|
|
|
return {
|
|
|
classroomList: classroomList,
|
|
|
loading: loading
|
|
|
};
|
|
|
})(PublishShixun));
|
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 2 modules
|
|
|
var verifyLogin = __webpack_require__(78794);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
|
|
|
var progress = __webpack_require__(93948);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Head/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Headmodules = ({"wrap":"wrap___UWG0f","name":"name___LIQSC","button":"button___CSggN","progress":"progress___AQo_Y","havaLearn":"havaLearn___fq9Cb"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Head/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Head = function Head(_ref) {
|
|
|
var _ref$data = _ref.data,
|
|
|
data = _ref$data === void 0 ? {} : _ref$data,
|
|
|
_ref$dispatch = _ref.dispatch,
|
|
|
dispatch = _ref$dispatch === void 0 ? function () {} : _ref$dispatch,
|
|
|
_ref$onReloadData = _ref.onReloadData,
|
|
|
onReloadData = _ref$onReloadData === void 0 ? function () {} : _ref$onReloadData;
|
|
|
var handleStartLearn = function handleStartLearn() {
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
if ((0,authority/* isNotMember */.Jd)()) {
|
|
|
return;
|
|
|
}
|
|
|
var id;
|
|
|
for (var i = 0; i < (data === null || data === void 0 || (_data$stages = data.stages) === null || _data$stages === void 0 ? void 0 : _data$stages.length); i++) {
|
|
|
var _data$stages, _data$stages2, _item$shixuns_list;
|
|
|
var item = data === null || data === void 0 || (_data$stages2 = data.stages) === null || _data$stages2 === void 0 ? void 0 : _data$stages2[i];
|
|
|
var find = item === null || item === void 0 || (_item$shixuns_list = item.shixuns_list) === null || _item$shixuns_list === void 0 ? void 0 : _item$shixuns_list.find(function (shixun) {
|
|
|
return (shixun === null || shixun === void 0 ? void 0 : shixun.shixun_status) !== "暂未公开";
|
|
|
});
|
|
|
if (find) {
|
|
|
id = find.identifier;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
id ? handleStartShixun(id) : message/* default */.ZP.info("实训暂未公开!");
|
|
|
};
|
|
|
var handleResetGame = function handleResetGame(url) {
|
|
|
var _url;
|
|
|
url = (_url = url) !== null && _url !== void 0 && _url.includes('.json') ? url : "".concat(url, ".json");
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: "\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res, execRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,shixuns/* resetMyGame */.$Q)({
|
|
|
url: url
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res) {
|
|
|
_context.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return");
|
|
|
case 5:
|
|
|
message/* default */.ZP.success("重置成功,正在进入实践项目!");
|
|
|
_context.next = 8;
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
id: res.shixun_identifier
|
|
|
});
|
|
|
case 8:
|
|
|
execRes = _context.sent;
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
(0,util/* openNewWindow */.xg)("/tasks/".concat(execRes.game_identifier));
|
|
|
onReloadData();
|
|
|
return _context.abrupt("return");
|
|
|
case 13:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var handleInBeta = function handleInBeta(message) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc font16",
|
|
|
children: ["\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01"]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var handleStartShixun = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(id) {
|
|
|
var execRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
id: id
|
|
|
});
|
|
|
case 2:
|
|
|
execRes = _context2.sent;
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context2.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
(0,util/* openNewWindow */.xg)("/tasks/".concat(execRes.game_identifier));
|
|
|
onReloadData();
|
|
|
return _context2.abrupt("return");
|
|
|
case 7:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleStartShixun(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
children: !(0,authority/* isAdmin */.GJ)() && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
|
children: data !== null && data !== void 0 && data.start_learning ? /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: Headmodules.wrap,
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt5 ".concat(Headmodules.havaLearn),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u5DF2\u5B66", data === null || data === void 0 ? void 0 : data.learned, "%"]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt5 ".concat(Headmodules.progress),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(progress/* default */.Z, {
|
|
|
percent: data === null || data === void 0 ? void 0 : data.learned,
|
|
|
showInfo: false
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt5",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "font16",
|
|
|
children: "\u4E0A\u6B21\u5B66\u4E60\u5185\u5BB9"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml20 c-blue-4ca",
|
|
|
children: data === null || data === void 0 ? void 0 : data.last_shixun
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Headmodules.button,
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
return handleStartShixun(data === null || data === void 0 ? void 0 : data.last_shixun_identifier);
|
|
|
},
|
|
|
children: "\u5F00\u59CB\u5B66\u4E60"
|
|
|
})
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: Headmodules.wrap,
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Headmodules.name,
|
|
|
children: "\u8FD8\u672A\u5F00\u59CB\u5B66\u4E60"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Headmodules.button,
|
|
|
type: "primary",
|
|
|
onClick: handleStartLearn,
|
|
|
children: "\u5F00\u59CB\u5B66\u4E60"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_Head = (Head);
|
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
|
var exercise = __webpack_require__(39935);
|
|
|
// EXTERNAL MODULE: ./src/pages/Video/Detail/components/AddVideoModal/index.tsx + 1 modules
|
|
|
var AddVideoModal = __webpack_require__(69496);
|
|
|
// EXTERNAL MODULE: ./src/components/MultiUpload/index.tsx + 3 modules
|
|
|
var MultiUpload = __webpack_require__(65595);
|
|
|
// EXTERNAL MODULE: ./src/pages/Paths/Detail/components/Sort/index.tsx + 1 modules
|
|
|
var Sort = __webpack_require__(2697);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(33259);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/Spinner/index.tsx + 1 modules
|
|
|
var Spinner = __webpack_require__(92997);
|
|
|
// EXTERNAL MODULE: ./src/components/modal.tsx
|
|
|
var components_modal = __webpack_require__(613);
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(77068);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
|
|
|
var input_number = __webpack_require__(96971);
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 15 modules
|
|
|
var markdown_editor = __webpack_require__(93521);
|
|
|
// EXTERNAL MODULE: ./src/service/paths.ts
|
|
|
var paths = __webpack_require__(75452);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/discuss-editor/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/discuss-editor/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var AuthModal = function AuthModal(_ref) {
|
|
|
var user = _ref.user,
|
|
|
onReplyDiscuss = _ref.onReplyDiscuss,
|
|
|
dispatch = _ref.dispatch,
|
|
|
id = _ref.id,
|
|
|
activeDiscussIndex = _ref.activeDiscussIndex,
|
|
|
params = _ref.params;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
value = _useState2[0],
|
|
|
setValue = _useState2[1];
|
|
|
function onChange(v) {
|
|
|
setValue(v);
|
|
|
}
|
|
|
console.log(params, 'params33');
|
|
|
// const params = useParams<any>()
|
|
|
|
|
|
function onCommit() {
|
|
|
if (!value) {
|
|
|
message/* default */.ZP.info('回复内容不能为空!');
|
|
|
return;
|
|
|
}
|
|
|
onReplyDiscuss(id, value);
|
|
|
// dispatch({
|
|
|
// type: "pathsDetail/getPathsDetail",
|
|
|
// payload: { id: params.pathId },
|
|
|
// })
|
|
|
setValue('');
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-item-editor",
|
|
|
style: {
|
|
|
display: activeDiscussIndex === id ? 'block' : 'none',
|
|
|
width: '100%'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
miniToolbar: true,
|
|
|
startInit: activeDiscussIndex === id,
|
|
|
defaultValue: value,
|
|
|
id: id,
|
|
|
noStorage: true,
|
|
|
watch: false,
|
|
|
height: 155,
|
|
|
placeholder: "\u6211\u8981\u56DE\u590D",
|
|
|
showResizeBar: true,
|
|
|
onChange: onChange
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onCommit,
|
|
|
className: "btn-send",
|
|
|
children: "\u53D1\u9001"
|
|
|
})]
|
|
|
}, id);
|
|
|
};
|
|
|
/* harmony default export */ var discuss_editor = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
|
var shixunsDetail = _ref2.shixunsDetail,
|
|
|
loading = _ref2.loading,
|
|
|
globalSetting = _ref2.globalSetting;
|
|
|
return {
|
|
|
shixunsDetail: shixunsDetail,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(AuthModal));
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/apply/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var apply_AuthModal = function AuthModal(_ref) {
|
|
|
var user = _ref.user,
|
|
|
upDataList = _ref.upDataList,
|
|
|
params = _ref.params,
|
|
|
page = _ref.page,
|
|
|
getTypeNumber = _ref.getTypeNumber,
|
|
|
dispatch = _ref.dispatch,
|
|
|
keywords = _ref.keywords;
|
|
|
// const params = useParams<any>()
|
|
|
|
|
|
var onReplyDiscuss = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(id, value) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,paths/* excellentDiscuss */.ke)({
|
|
|
id: id,
|
|
|
content: value
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
upDataList(1, keywords);
|
|
|
// getTypeNumber();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onReplyDiscuss(_x, _x2) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-item-container bg-white",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/users/".concat(user.login),
|
|
|
target: "_blank",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
alt: "\u7528\u6237\u5934\u50CF",
|
|
|
height: "50",
|
|
|
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(user.image_url),
|
|
|
width: "50"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_editor, {
|
|
|
id: params.pathId,
|
|
|
params: params,
|
|
|
activeDiscussIndex: params.pathId,
|
|
|
onReplyDiscuss: onReplyDiscuss
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var apply = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var shixunsDetail = _ref3.shixunsDetail,
|
|
|
loading = _ref3.loading,
|
|
|
globalSetting = _ref3.globalSetting;
|
|
|
return {
|
|
|
shixunsDetail: shixunsDetail,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(apply_AuthModal));
|
|
|
// EXTERNAL MODULE: ./src/pages/tasks/constant.js
|
|
|
var constant = __webpack_require__(49199);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/service.js
|
|
|
|
|
|
|
|
|
function fetchDiscusses(shixunIdentifier) {
|
|
|
var page = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
|
return get("/discusses.json", {
|
|
|
page: page - 1,
|
|
|
container_identifier: shixunIdentifier,
|
|
|
container_type: "Shixun"
|
|
|
});
|
|
|
}
|
|
|
function topOrDownDiscuss(id, top) {
|
|
|
return (0,fetch/* post */.v_)("/discusses/".concat(id, "/top_or_down_discuss.json"), {
|
|
|
top: top
|
|
|
});
|
|
|
}
|
|
|
function plusDiscuss(id, user_praise) {
|
|
|
return (0,fetch/* post */.v_)("/discusses/".concat(id, "/plus.json"), {
|
|
|
container_type: 'Discuss',
|
|
|
type: user_praise ? 1 : 0
|
|
|
});
|
|
|
}
|
|
|
function hiddenDiscuss(id, params) {
|
|
|
return (0,fetch/* post */.v_)("/discusses/".concat(id, "/hidden.json"), params);
|
|
|
}
|
|
|
function rewardDiscuss(id, params) {
|
|
|
return (0,fetch/* post */.v_)("/discusses/".concat(id, "/reward_code.json"), params);
|
|
|
}
|
|
|
function deleteDiscuss(id) {
|
|
|
return (0,fetch/* default */.ZP)("/api/discusses/".concat(id, ".json"), {
|
|
|
method: 'delete'
|
|
|
});
|
|
|
}
|
|
|
function replyDiscuss(id, content) {
|
|
|
return (0,fetch/* post */.v_)("/discusses/".concat(id, "/reply.json"), {
|
|
|
container_type: 'Shixun',
|
|
|
content: content
|
|
|
});
|
|
|
}
|
|
|
function createDiscuss(params) {
|
|
|
return post("/discusses.json", params);
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
|
var RenderHtml = __webpack_require__(52961);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/discuss-item/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules
|
|
|
var image_preview = __webpack_require__(30352);
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
|
var mediator = __webpack_require__(34834);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/discuss-item/index.jsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SecondLevelDiscuss(_ref) {
|
|
|
var data = _ref.data,
|
|
|
index = _ref.index,
|
|
|
adminOrOperator = _ref.adminOrOperator,
|
|
|
parentDiscussIndex = _ref.parentDiscussIndex,
|
|
|
shixunIdentifier = _ref.shixunIdentifier,
|
|
|
isDelete = _ref.isDelete,
|
|
|
user = _ref.user,
|
|
|
onSetRewardData = _ref.onSetRewardData,
|
|
|
onSetActionType = _ref.onSetActionType,
|
|
|
params = _ref.params,
|
|
|
deleteCommentAlert = _ref.deleteCommentAlert,
|
|
|
shixunName = _ref.shixunName,
|
|
|
keywords = _ref.keywords;
|
|
|
var author = data.author,
|
|
|
can_delete = data.can_delete,
|
|
|
manage = data.manage,
|
|
|
content = data.content,
|
|
|
hidden = data.hidden,
|
|
|
id = data.id,
|
|
|
reward = data.reward,
|
|
|
time = data.time;
|
|
|
function onRewardDialog() {
|
|
|
onSetRewardData({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
user_id: author.user_id,
|
|
|
parentDiscussIndex: parentDiscussIndex
|
|
|
});
|
|
|
}
|
|
|
function onHiddenDiscuss() {
|
|
|
onSetActionType({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
params: {
|
|
|
hidden: !hidden ? '1' : '0',
|
|
|
container_identifier: shixunIdentifier
|
|
|
},
|
|
|
type: 'hidden-discuss',
|
|
|
parentDiscussIndex: parentDiscussIndex,
|
|
|
message: !hidden ? '确定要隐藏该条回复吗' : '确定要取消隐藏该条回复吗'
|
|
|
});
|
|
|
}
|
|
|
function onDeleteDiscuss() {
|
|
|
if (deleteCommentAlert) {
|
|
|
modal/* default */.Z.info({
|
|
|
// centered: true,
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
children: [' ', "\u8BE5\u6761\u8BC4\u8BBA\u6765\u81EA\u300A", shixunName, "\u300B\u5B9E\u8DF5\u9879\u76EE\uFF0C\u60A8\u4E0D\u662F\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u7BA1\u7406\u8005\uFF0C\u4E0D\u80FD\u5220\u9664\u8BC4\u8BBA\uFF01"]
|
|
|
}),
|
|
|
onOk: function onOk() {}
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
onSetActionType({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
type: 'delete-discuss',
|
|
|
parentDiscussIndex: parentDiscussIndex,
|
|
|
message: '确定要删除该条回复吗'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// const canDelete =
|
|
|
// adminOrOperator ||
|
|
|
// can_delete ||
|
|
|
// author.user_id === user.user_id ||
|
|
|
// author.login === user.login;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "second-level-discuss",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-info-body",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-info",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/users/".concat(author.login),
|
|
|
target: "_blank",
|
|
|
children: author.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "grey",
|
|
|
children: time
|
|
|
}), reward ? /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
className: "c-orange gift",
|
|
|
title: "\u5DF2\u5956\u52B1\u91D1\u5E01".concat(reward),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-gift c-orange "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: reward
|
|
|
})]
|
|
|
}) : null]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: keywords ? 'hidden' : "btn-group",
|
|
|
children: [adminOrOperator ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onRewardDialog,
|
|
|
title: '给TA奖励金币',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-jiangli"
|
|
|
})
|
|
|
}) : null, adminOrOperator ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onHiddenDiscuss,
|
|
|
title: hidden ? '取消隐藏' : '隐藏评论',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: hidden ? 'iconfont icon-yincangbiyan' : 'fa fa-eye'
|
|
|
})
|
|
|
}) : null, manage ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onDeleteDiscuss,
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shanchu"
|
|
|
})
|
|
|
}) : null]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: "discuss-content",
|
|
|
value: content,
|
|
|
highlightKeywords: keywords
|
|
|
// onClick={handleClick}
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
// console.log('------',isDelete);
|
|
|
|
|
|
/* harmony default export */ var discuss_item = (function (_ref2) {
|
|
|
var data = _ref2.data,
|
|
|
index = _ref2.index,
|
|
|
shixunIdentifier = _ref2.shixunIdentifier,
|
|
|
adminOrOperator = _ref2.adminOrOperator,
|
|
|
identity = _ref2.identity,
|
|
|
onTopOrDownDiscuss = _ref2.onTopOrDownDiscuss,
|
|
|
onPlusDiscuss = _ref2.onPlusDiscuss,
|
|
|
onSetActionType = _ref2.onSetActionType,
|
|
|
onSetRewardData = _ref2.onSetRewardData,
|
|
|
user = _ref2.user,
|
|
|
isDelete = _ref2.isDelete,
|
|
|
activeDiscussIndex = _ref2.activeDiscussIndex,
|
|
|
onReplyDiscuss = _ref2.onReplyDiscuss,
|
|
|
onSetActiveDiscussIndex = _ref2.onSetActiveDiscussIndex,
|
|
|
params = _ref2.params,
|
|
|
keywords = _ref2.keywords;
|
|
|
var content = data.content,
|
|
|
children = data.children,
|
|
|
game_url = data.game_url,
|
|
|
hidden = data.hidden,
|
|
|
id = data.id,
|
|
|
position = data.position,
|
|
|
praise_count = data.praise_count,
|
|
|
reward = data.reward,
|
|
|
sticky = data.sticky,
|
|
|
time = data.time,
|
|
|
user_praise = data.user_praise,
|
|
|
game_passed = data.game_passed,
|
|
|
delete_comment_alert = data.delete_comment_alert,
|
|
|
author = data.author,
|
|
|
shixun_name = data.shixun_name,
|
|
|
manage = data.manage;
|
|
|
function onActiveDiscussIndex() {
|
|
|
onSetActiveDiscussIndex(id);
|
|
|
}
|
|
|
function onTopOrDown() {
|
|
|
onTopOrDownDiscuss(id, !sticky, index);
|
|
|
}
|
|
|
function onPlus() {
|
|
|
onPlusDiscuss(id, !user_praise, index);
|
|
|
}
|
|
|
function onRewardDialog() {
|
|
|
onSetRewardData({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
user_id: author.user_id
|
|
|
});
|
|
|
}
|
|
|
function onDeleteDiscuss() {
|
|
|
if (delete_comment_alert) {
|
|
|
modal/* default */.Z.info({
|
|
|
// centered: true,
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
children: [' ', "\u8BE5\u6761\u8BC4\u8BBA\u6765\u81EA\u300A", shixun_name, "\u300B\u5B9E\u8DF5\u9879\u76EE\uFF0C\u60A8\u4E0D\u662F\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u7BA1\u7406\u8005\uFF0C\u4E0D\u80FD\u5220\u9664\u8BC4\u8BBA\uFF01"]
|
|
|
}),
|
|
|
onOk: function onOk() {}
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
onSetActionType({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
type: 'delete-discuss',
|
|
|
message: '确定要删除该条回复吗'
|
|
|
});
|
|
|
}
|
|
|
function onHiddenDiscuss() {
|
|
|
onSetActionType({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
params: {
|
|
|
hidden: !hidden ? '1' : '0',
|
|
|
container_identifier: shixunIdentifier
|
|
|
},
|
|
|
type: 'hidden-discuss',
|
|
|
message: !hidden ? '确定要隐藏该条回复吗' : '确定要取消隐藏该条回复吗'
|
|
|
});
|
|
|
}
|
|
|
var handleClick = function handleClick(e) {
|
|
|
var _e$target = e.target,
|
|
|
nodeName = _e$target.nodeName,
|
|
|
src = _e$target.src;
|
|
|
if (nodeName === 'IMG') {
|
|
|
mediator/* default */.Z.publish('preview-image', src);
|
|
|
console.log('src:', src);
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-item-container",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/users/".concat(author.login),
|
|
|
target: "_blank",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
alt: "\u7528\u6237\u5934\u50CF",
|
|
|
height: "50",
|
|
|
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(author.image_url),
|
|
|
width: "50"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-info",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/users/".concat(author.login),
|
|
|
target: "_blank",
|
|
|
children: author.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "grey",
|
|
|
children: time
|
|
|
}), position ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-green",
|
|
|
children: [" [\u7B2C", position, "\u5173] "]
|
|
|
}) : null, game_url ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: game_url,
|
|
|
target: "_blank",
|
|
|
className: "view-code",
|
|
|
title: "\u70B9\u51FB\u67E5\u770BTA\u7684\u4EE3\u7801\u9875\u9762",
|
|
|
children: "\u67E5\u770B"
|
|
|
}) : null, reward ? /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
className: "c-orange gift",
|
|
|
title: "\u5DF2\u5956\u52B1\u91D1\u5E01".concat(reward),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-gift c-orange "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: reward
|
|
|
})]
|
|
|
}) : null, identity <= 5 ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1',
|
|
|
textAlign: 'right',
|
|
|
color: game_passed === 1 ? '#29bd8b' : ''
|
|
|
},
|
|
|
children: game_passed || game_passed === 0 ? game_passed === 1 ? '已通关' : '未通关' : ''
|
|
|
}) : null]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
onClick: handleClick,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: "discuss-content",
|
|
|
value: content,
|
|
|
highlightKeywords: keywords
|
|
|
})
|
|
|
}), children && children.length > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "reply-discuss-container",
|
|
|
onClick: handleClick,
|
|
|
children: children.map(function (item, i) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(SecondLevelDiscuss, {
|
|
|
data: item,
|
|
|
index: i,
|
|
|
deleteCommentAlert: delete_comment_alert,
|
|
|
shixunName: shixun_name,
|
|
|
shixunIdentifier: shixunIdentifier,
|
|
|
adminOrOperator: adminOrOperator,
|
|
|
user: user,
|
|
|
isDelete: isDelete,
|
|
|
onSetRewardData: onSetRewardData,
|
|
|
onSetActionType: onSetActionType,
|
|
|
parentDiscussIndex: index,
|
|
|
keywords: keywords
|
|
|
}, item.id);
|
|
|
})
|
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: keywords ? 'hidden' : "btn-group",
|
|
|
children: [adminOrOperator ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onRewardDialog,
|
|
|
title: '给TA奖励金币',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-jiangli"
|
|
|
})
|
|
|
}) : null, adminOrOperator ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onHiddenDiscuss,
|
|
|
title: hidden ? '取消隐藏' : '隐藏评论',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: hidden ? 'iconfont icon-yincangbiyan' : 'fa fa-eye'
|
|
|
})
|
|
|
}) : null, manage && (!children || children.length == 0) && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onDeleteDiscuss,
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shanchu"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onActiveDiscussIndex,
|
|
|
title: "\u56DE\u590D",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-huifu1"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
onClick: onPlus,
|
|
|
className: user_praise ? 'c-orange' : '',
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: user_praise ? 'iconfont icon-dianzan mr3' : 'iconfont icon-dianzan-xian mr3 '
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: praise_count ? praise_count : ''
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_editor, {
|
|
|
id: id,
|
|
|
params: params,
|
|
|
activeDiscussIndex: activeDiscussIndex,
|
|
|
onReplyDiscuss: onReplyDiscuss
|
|
|
})]
|
|
|
})]
|
|
|
}, id);
|
|
|
});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/components/Discuss/index.jsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var initialState = {
|
|
|
showRewardDialog: false,
|
|
|
data: null,
|
|
|
page: 1,
|
|
|
loading: false,
|
|
|
actionType: null,
|
|
|
activeDiscussIndex: null
|
|
|
};
|
|
|
function reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case constant/* SHOW_DISCUSSES_LOADING */.tD:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
loading: true
|
|
|
});
|
|
|
case constant/* SHOW_REWARD_DIALOG */.RS:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
showRewardDialog: true
|
|
|
});
|
|
|
case constant/* CANCEL_REWARD_DIALOG */.t2:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
showRewardDialog: false
|
|
|
});
|
|
|
case constant/* GET_DISCUSSES */.GR:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case constant/* TOP_OR_DOWN_DISCUSS */.u8:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case constant/* PLUS_DISCUSS */.rM:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case constant/* SET_ACTION_TYPE */.yS:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case constant/* SET_REWARD */.Vn:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case constant/* ACTIVE_DISCUSS_INDEX */.SX:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
/* harmony default export */ var Discuss = (function (_ref) {
|
|
|
var shixunIdentifier = _ref.shixunIdentifier,
|
|
|
identity = _ref.identity,
|
|
|
activeIndex = _ref.activeIndex,
|
|
|
user = _ref.user,
|
|
|
_ref$isShixunDetail = _ref.isShixunDetail,
|
|
|
isShixunDetail = _ref$isShixunDetail === void 0 ? false : _ref$isShixunDetail,
|
|
|
isDelete = _ref.isDelete,
|
|
|
getTypeNumber = _ref.getTypeNumber,
|
|
|
params = _ref.params,
|
|
|
getData = _ref.getData,
|
|
|
isNotDiscuss = _ref.isNotDiscuss,
|
|
|
keywords = _ref.keywords,
|
|
|
setTypeCount = _ref.setTypeCount;
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(reducer, initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var page = state.page,
|
|
|
loading = state.loading,
|
|
|
data = state.data,
|
|
|
actionType = state.actionType,
|
|
|
showRewardDialog = state.showRewardDialog,
|
|
|
activeDiscussIndex = state.activeDiscussIndex;
|
|
|
var rewardData = (0,_react_17_0_2_react.useRef)();
|
|
|
var discussEl = (0,_react_17_0_2_react.useRef)();
|
|
|
// const params = useParams();
|
|
|
function getCourseDiscusses(_x) {
|
|
|
return _getCourseDiscusses.apply(this, arguments);
|
|
|
}
|
|
|
function _getCourseDiscusses() {
|
|
|
_getCourseDiscusses = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(value) {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (!loading) {
|
|
|
_context2.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context2.abrupt("return");
|
|
|
case 2:
|
|
|
_context2.prev = 2;
|
|
|
dispatch({
|
|
|
type: constant/* SHOW_DISCUSSES_LOADING */.tD
|
|
|
});
|
|
|
_context2.next = 6;
|
|
|
return (0,paths/* getCourseDiscusses */.Mu)({
|
|
|
coursesId: params === null || params === void 0 ? void 0 : params.pathId,
|
|
|
page: value,
|
|
|
keywords: keywords
|
|
|
});
|
|
|
case 6:
|
|
|
response = _context2.sent;
|
|
|
setTypeCount(response === null || response === void 0 ? void 0 : response.disscuss_count);
|
|
|
dispatch({
|
|
|
type: constant/* GET_DISCUSSES */.GR,
|
|
|
payload: {
|
|
|
activeDiscussIndex: null,
|
|
|
page: value,
|
|
|
data: response,
|
|
|
loading: false
|
|
|
}
|
|
|
});
|
|
|
_context2.next = 14;
|
|
|
break;
|
|
|
case 11:
|
|
|
_context2.prev = 11;
|
|
|
_context2.t0 = _context2["catch"](2);
|
|
|
console.log(_context2.t0);
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2, null, [[2, 11]]);
|
|
|
}));
|
|
|
return _getCourseDiscusses.apply(this, arguments);
|
|
|
}
|
|
|
function onPaginationChange(value) {
|
|
|
document.body.scrollIntoView();
|
|
|
getCourseDiscusses(value);
|
|
|
}
|
|
|
function onPlusDiscuss(_x2, _x3, _x4) {
|
|
|
return _onPlusDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function _onPlusDiscuss() {
|
|
|
_onPlusDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(id, user_praise, index) {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.prev = 0;
|
|
|
_context3.next = 3;
|
|
|
return plusDiscuss(id, user_praise);
|
|
|
case 3:
|
|
|
response = _context3.sent;
|
|
|
comments[index].user_praise = user_praise;
|
|
|
comments[index].praise_count = response.praise_count;
|
|
|
dispatch({
|
|
|
type: constant/* PLUS_DISCUSS */.rM,
|
|
|
payload: {
|
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
comments: comments
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
_context3.next = 12;
|
|
|
break;
|
|
|
case 9:
|
|
|
_context3.prev = 9;
|
|
|
_context3.t0 = _context3["catch"](0);
|
|
|
console.log(_context3.t0);
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3, null, [[0, 9]]);
|
|
|
}));
|
|
|
return _onPlusDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function onTopOrDownDiscuss(_x5, _x6, _x7) {
|
|
|
return _onTopOrDownDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function _onTopOrDownDiscuss() {
|
|
|
_onTopOrDownDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(id, sticky, index) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.prev = 0;
|
|
|
_context4.next = 3;
|
|
|
return topOrDownDiscuss(id, sticky);
|
|
|
case 3:
|
|
|
comments[index].sticky = sticky;
|
|
|
dispatch({
|
|
|
type: constant/* TOP_OR_DOWN_DISCUSS */.u8,
|
|
|
payload: {
|
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
comments: comments
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
_context4.next = 10;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context4.prev = 7;
|
|
|
_context4.t0 = _context4["catch"](0);
|
|
|
console.log(_context4.t0);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4, null, [[0, 7]]);
|
|
|
}));
|
|
|
return _onTopOrDownDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function onCancelAction() {
|
|
|
dispatch({
|
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
|
payload: {
|
|
|
actionType: null
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function onProcessAction() {
|
|
|
return _onProcessAction.apply(this, arguments);
|
|
|
}
|
|
|
function _onProcessAction() {
|
|
|
_onProcessAction = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var id, params, type, index, parentDiscussIndex, secondDicusses, i, _i;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
id = actionType.id, params = actionType.params, type = actionType.type, index = actionType.index, parentDiscussIndex = actionType.parentDiscussIndex;
|
|
|
if (!(type === 'hidden-discuss')) {
|
|
|
_context5.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
_context5.next = 4;
|
|
|
return hiddenDiscuss(id, params);
|
|
|
case 4:
|
|
|
if (!parentDiscussIndex) {
|
|
|
comments[index].hidden = params.hidden == 1 ? true : false;
|
|
|
} else {
|
|
|
comments[parentDiscussIndex].children[index].hidden = params.hidden == 1 ? true : false;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
|
payload: {
|
|
|
actionType: null,
|
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
comments: comments
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
case 6:
|
|
|
if (!(type === 'delete-discuss')) {
|
|
|
_context5.next = 31;
|
|
|
break;
|
|
|
}
|
|
|
_context5.next = 9;
|
|
|
return deleteDiscuss(id);
|
|
|
case 9:
|
|
|
if (!(parentDiscussIndex || parentDiscussIndex === 0)) {
|
|
|
_context5.next = 22;
|
|
|
break;
|
|
|
}
|
|
|
secondDicusses = comments[parentDiscussIndex].children;
|
|
|
i = secondDicusses.length - 1;
|
|
|
case 12:
|
|
|
if (!(i >= 0)) {
|
|
|
_context5.next = 19;
|
|
|
break;
|
|
|
}
|
|
|
if (!(secondDicusses[i].id === id)) {
|
|
|
_context5.next = 16;
|
|
|
break;
|
|
|
}
|
|
|
secondDicusses.splice(i, 1);
|
|
|
return _context5.abrupt("break", 19);
|
|
|
case 16:
|
|
|
i--;
|
|
|
_context5.next = 12;
|
|
|
break;
|
|
|
case 19:
|
|
|
comments[parentDiscussIndex].children = secondDicusses;
|
|
|
_context5.next = 30;
|
|
|
break;
|
|
|
case 22:
|
|
|
_i = comments.length - 1;
|
|
|
case 23:
|
|
|
if (!(_i >= 0)) {
|
|
|
_context5.next = 30;
|
|
|
break;
|
|
|
}
|
|
|
if (!(comments[_i].id === id)) {
|
|
|
_context5.next = 27;
|
|
|
break;
|
|
|
}
|
|
|
comments.splice(_i, 1);
|
|
|
return _context5.abrupt("break", 30);
|
|
|
case 27:
|
|
|
_i--;
|
|
|
_context5.next = 23;
|
|
|
break;
|
|
|
case 30:
|
|
|
dispatch({
|
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
|
payload: {
|
|
|
actionType: null,
|
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
comments: comments
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
case 31:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return _onProcessAction.apply(this, arguments);
|
|
|
}
|
|
|
function onSetActionType(value) {
|
|
|
dispatch({
|
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
|
payload: {
|
|
|
actionType: value
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function onCancelRewardDialog() {
|
|
|
dispatch({
|
|
|
type: constant/* CANCEL_REWARD_DIALOG */.t2
|
|
|
});
|
|
|
}
|
|
|
function onRewardDiscuss() {
|
|
|
return _onRewardDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function _onRewardDiscuss() {
|
|
|
_onRewardDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
var _rewardData$current, id, index, score, user_id, parentDiscussIndex, response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
_rewardData$current = rewardData.current, id = _rewardData$current.id, index = _rewardData$current.index, score = _rewardData$current.score, user_id = _rewardData$current.user_id, parentDiscussIndex = _rewardData$current.parentDiscussIndex;
|
|
|
_context6.next = 3;
|
|
|
return rewardDiscuss(id, {
|
|
|
container_type: 'Discusses',
|
|
|
score: score,
|
|
|
user_id: user_id
|
|
|
});
|
|
|
case 3:
|
|
|
response = _context6.sent;
|
|
|
if (!parentDiscussIndex) {
|
|
|
comments[index].reward = response.code;
|
|
|
} else {
|
|
|
comments[parentDiscussIndex].children[index].reward = response.code;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: constant/* SET_REWARD */.Vn,
|
|
|
payload: {
|
|
|
showRewardDialog: false,
|
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
comments: comments
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
rewardData.current = null;
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return _onRewardDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function onSetRewardData(value) {
|
|
|
rewardData.current = value;
|
|
|
dispatch({
|
|
|
type: constant/* SHOW_REWARD_DIALOG */.RS
|
|
|
});
|
|
|
}
|
|
|
function onSetDiscussScore(value) {
|
|
|
rewardData.current.score = value;
|
|
|
}
|
|
|
function onReplyDiscuss(_x8, _x9) {
|
|
|
return _onReplyDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function _onReplyDiscuss() {
|
|
|
_onReplyDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(id, value) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
_context7.prev = 0;
|
|
|
_context7.next = 3;
|
|
|
return replyDiscuss(id, value);
|
|
|
case 3:
|
|
|
getCourseDiscusses(page);
|
|
|
getData();
|
|
|
_context7.next = 10;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context7.prev = 7;
|
|
|
_context7.t0 = _context7["catch"](0);
|
|
|
console.log(_context7.t0);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7, null, [[0, 7]]);
|
|
|
}));
|
|
|
return _onReplyDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function onSetActiveDiscussIndex(value) {
|
|
|
if (activeDiscussIndex === value) {
|
|
|
dispatch({
|
|
|
type: constant/* ACTIVE_DISCUSS_INDEX */.SX,
|
|
|
payload: {
|
|
|
activeDiscussIndex: null
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
dispatch({
|
|
|
type: constant/* ACTIVE_DISCUSS_INDEX */.SX,
|
|
|
payload: {
|
|
|
activeDiscussIndex: value
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
function init() {
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
function _init() {
|
|
|
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!(activeIndex === 3 && !data && shixunIdentifier)) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
_context.next = 3;
|
|
|
return getCourseDiscusses(page);
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
init();
|
|
|
}, [params.pathId, keywords]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getCourseDiscusses();
|
|
|
}, [keywords]);
|
|
|
|
|
|
// useEffect(() => {
|
|
|
// const unSub = mediator.subscribe('create-discuss', () => {
|
|
|
// getCourseDiscusses(page);
|
|
|
// });
|
|
|
// return unSub;
|
|
|
// }, [shixunIdentifier]);
|
|
|
|
|
|
if (!data) {
|
|
|
return !isShixunDetail && /*#__PURE__*/(0,jsx_runtime.jsx)(Spinner/* default */.Z, {});
|
|
|
}
|
|
|
var disscuss_count = data.disscuss_count,
|
|
|
comments = data.comments,
|
|
|
all = data.all,
|
|
|
can_hidden = data.can_hidden;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-container discuss-warp-container",
|
|
|
ref: discussEl,
|
|
|
children: [!isShixunDetail && loading ? /*#__PURE__*/(0,jsx_runtime.jsx)(Spinner/* default */.Z, {}) : null, disscuss_count === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {})
|
|
|
}) : null, (0,authority/* isLogin */.bg)() && !isNotDiscuss && !keywords && /*#__PURE__*/(0,jsx_runtime.jsx)(apply, {
|
|
|
getTypeNumber: getTypeNumber,
|
|
|
upDataList: getCourseDiscusses,
|
|
|
page: page,
|
|
|
user: user,
|
|
|
params: params,
|
|
|
keywords: keywords
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "bg-white",
|
|
|
children: comments === null || comments === void 0 ? void 0 : comments.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_item, {
|
|
|
user: user,
|
|
|
data: item,
|
|
|
index: index,
|
|
|
identity: identity,
|
|
|
onPaginationChange: onPaginationChange,
|
|
|
shixunIdentifier: shixunIdentifier,
|
|
|
isDelete: isDelete,
|
|
|
onSetActionType: onSetActionType,
|
|
|
onTopOrDownDiscuss: onTopOrDownDiscuss,
|
|
|
adminOrOperator: can_hidden,
|
|
|
onPlusDiscuss: onPlusDiscuss,
|
|
|
onSetRewardData: onSetRewardData,
|
|
|
activeDiscussIndex: activeDiscussIndex,
|
|
|
onSetActiveDiscussIndex: onSetActiveDiscussIndex,
|
|
|
onReplyDiscuss: onReplyDiscuss,
|
|
|
keywords: keywords
|
|
|
}, item.id);
|
|
|
})
|
|
|
}), disscuss_count > 10 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "pagination-container tc",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
showQuickJumper: true,
|
|
|
showSizeChanger: false,
|
|
|
onChange: onPaginationChange,
|
|
|
current: page,
|
|
|
total: disscuss_count
|
|
|
})
|
|
|
}) : null]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(components_modal/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: !!actionType,
|
|
|
onOk: onProcessAction,
|
|
|
onCancel: onCancelAction,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: actionType ? actionType.message : ''
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
width: 400,
|
|
|
title: "\u5956\u52B1\u8BBE\u7F6E",
|
|
|
open: showRewardDialog,
|
|
|
onCancel: onCancelRewardDialog,
|
|
|
onOk: onRewardDiscuss,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u5956\u52B1\u7684\u91D1\u5E01\u6570\u91CF",
|
|
|
min: 1,
|
|
|
onChange: onSetDiscussScore,
|
|
|
style: {
|
|
|
width: '228px'
|
|
|
}
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 34 modules
|
|
|
var ui_customization = __webpack_require__(45277);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/OnlineLearning/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["classroomList", "user", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Stage = function Stage(_ref) {
|
|
|
var _user$userInfo3;
|
|
|
var classroomList = _ref.classroomList,
|
|
|
user = _ref.user,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var detailTopBanner = classroomList.detailTopBanner;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
originData = _useState4[0],
|
|
|
setOriginData = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(-1),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
editKey = _useState6[0],
|
|
|
setEditKey = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
showAddShixun = _useState8[0],
|
|
|
setShowAddShixun = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)({
|
|
|
name: "",
|
|
|
is_jupyter: false
|
|
|
}),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
addValue = _useState10[0],
|
|
|
setAddValue = _useState10[1];
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _Form$useForm3 = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm4 = slicedToArray_default()(_Form$useForm3, 1),
|
|
|
addForm = _Form$useForm4[0];
|
|
|
var _Form$useForm5 = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm6 = slicedToArray_default()(_Form$useForm5, 1),
|
|
|
addCoursewareForm = _Form$useForm6[0];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
showAddCourseware = _useState12[0],
|
|
|
setShowAddCourseware = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
isAdd = _useState14[0],
|
|
|
setIsAdd = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
shixunIds = _useState16[0],
|
|
|
setShixunIds = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
visibleVideoModal = _useState18[0],
|
|
|
setVisibleVideoModal = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)("All"),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
visibleType = _useState20[0],
|
|
|
setVisibleType = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
treeLoading = _useState22[0],
|
|
|
setTreeLoading = _useState22[1];
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
scrollTop = _useState24[0],
|
|
|
setScrollTop = _useState24[1];
|
|
|
var _useState25 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
|
keywords = _useState26[0],
|
|
|
setKeyWords = _useState26[1];
|
|
|
var _useState27 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
|
typeCount = _useState28[0],
|
|
|
setTypeCount = _useState28[1];
|
|
|
var _useState29 = (0,_react_17_0_2_react.useState)([{
|
|
|
name: "全部",
|
|
|
totalName: '课程学习',
|
|
|
type: "All",
|
|
|
number: 0
|
|
|
}, {
|
|
|
name: "实践项目",
|
|
|
totalName: "实践项目",
|
|
|
type: "Shixun",
|
|
|
number: 0
|
|
|
}, {
|
|
|
name: "视频项目",
|
|
|
totalName: "视频项目",
|
|
|
type: "VideoItem",
|
|
|
number: 0
|
|
|
}, {
|
|
|
name: "教学课件",
|
|
|
totalName: "教学课件",
|
|
|
type: "Attachment",
|
|
|
number: 0
|
|
|
}, {
|
|
|
name: "讨论",
|
|
|
totalName: "讨论",
|
|
|
type: "Discusses",
|
|
|
number: 0
|
|
|
}]),
|
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
|
typeData = _useState30[0],
|
|
|
setTypeData = _useState30[1];
|
|
|
var content = (0,_react_17_0_2_react.useRef)();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData();
|
|
|
}, [params === null || params === void 0 ? void 0 : params.coursesId]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (classroomList.actionTabs.key === '目录重命名成功') {
|
|
|
getData();
|
|
|
}
|
|
|
}, [classroomList.actionTabs.key]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getTypeNumber();
|
|
|
}, [originData]);
|
|
|
|
|
|
//计算输入关键词搜索后对应的tab下的内容的数量
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var items = data.map(function (i) {
|
|
|
return i.items;
|
|
|
});
|
|
|
var count = 0;
|
|
|
items.map(function (val) {
|
|
|
val.map(function (i) {
|
|
|
var reg = new RegExp(keywords, "ig");
|
|
|
if (reg.test(i.name) && (i.item_type === visibleType || visibleType === 'All')) {
|
|
|
count++;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
if (count > typeData.find(function (e) {
|
|
|
return e.type === visibleType;
|
|
|
}).number) {
|
|
|
count = typeData.find(function (e) {
|
|
|
return e.type === visibleType;
|
|
|
}).number;
|
|
|
}
|
|
|
setTypeCount(count);
|
|
|
}, [data, visibleType, keywords]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (!content.current) {
|
|
|
return;
|
|
|
}
|
|
|
function onLayout() {
|
|
|
var _content$current;
|
|
|
var ro = new ResizeObserver(function (entries) {
|
|
|
var _iterator = createForOfIteratorHelper_default()(entries),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var entry = _step.value;
|
|
|
} // setShowExpansion(entry.target.offsetHeight >= 110);
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
});
|
|
|
ro.observe((_content$current = content.current) === null || _content$current === void 0 ? void 0 : _content$current.firstElementChild);
|
|
|
return ro;
|
|
|
}
|
|
|
var ro = onLayout();
|
|
|
return function () {
|
|
|
var _content$current2, _content$current3;
|
|
|
((_content$current2 = content.current) === null || _content$current2 === void 0 ? void 0 : _content$current2.firstElementChild) && ro.unobserve((_content$current3 = content.current) === null || _content$current3 === void 0 ? void 0 : _content$current3.firstElementChild);
|
|
|
};
|
|
|
}, [content.current, data]);
|
|
|
var updateSort = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(d) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,onlineLearning/* stagesMovePosition */.Ex)(objectSpread2_default()({}, d));
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
// getData();
|
|
|
data[editKey]['items'] = d.list;
|
|
|
// setData([...data])
|
|
|
return _context.abrupt("return", res);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function updateSort(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
|
|
|
//获取类型个数
|
|
|
var getTypeNumber = function getTypeNumber() {
|
|
|
var _originData$shixuns_c = originData.shixuns_count,
|
|
|
shixuns_count = _originData$shixuns_c === void 0 ? 0 : _originData$shixuns_c,
|
|
|
_originData$videos_co = originData.videos_count,
|
|
|
videos_count = _originData$videos_co === void 0 ? 0 : _originData$videos_co,
|
|
|
_originData$pdf_attac = originData.pdf_attachments_count,
|
|
|
pdf_attachments_count = _originData$pdf_attac === void 0 ? 0 : _originData$pdf_attac,
|
|
|
_originData$disscuss_ = originData.disscuss_count,
|
|
|
disscuss_count = _originData$disscuss_ === void 0 ? 0 : _originData$disscuss_;
|
|
|
var typeParam = {
|
|
|
All: shixuns_count + videos_count + pdf_attachments_count,
|
|
|
Shixun: shixuns_count,
|
|
|
VideoItem: videos_count,
|
|
|
Attachment: pdf_attachments_count,
|
|
|
Discusses: disscuss_count
|
|
|
};
|
|
|
var cloneTypeData = typeData.map(function (e) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
|
number: typeParam[e.type]
|
|
|
});
|
|
|
});
|
|
|
setTypeData(cloneTypeData);
|
|
|
};
|
|
|
var handleSearch = function handleSearch(v) {
|
|
|
if (editKey === -1) {
|
|
|
var _decodeURIComponent;
|
|
|
setKeyWords((_decodeURIComponent = decodeURIComponent(v)) === null || _decodeURIComponent === void 0 ? void 0 : _decodeURIComponent.trim());
|
|
|
setEditKey(-1);
|
|
|
} else {
|
|
|
message/* default */.ZP.warning("请先取消编辑状态");
|
|
|
}
|
|
|
// getData();
|
|
|
};
|
|
|
var toShixun = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(id) {
|
|
|
var execRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: "globalSetting/setGlobalLoading",
|
|
|
payload: {
|
|
|
show: true,
|
|
|
text: "正在进入实践项目,请稍后..."
|
|
|
}
|
|
|
});
|
|
|
_context2.next = 3;
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
id: id
|
|
|
});
|
|
|
case 3:
|
|
|
execRes = _context2.sent;
|
|
|
dispatch({
|
|
|
type: "globalSetting/setGlobalLoading",
|
|
|
payload: {
|
|
|
show: false,
|
|
|
text: ""
|
|
|
}
|
|
|
});
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context2.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
(0,util/* openNewWindow */.xg)("/tasks/".concat(execRes.game_identifier));
|
|
|
return _context2.abrupt("return");
|
|
|
case 8:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function toShixun(_x2) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleResetGame = function handleResetGame(url) {
|
|
|
var _url;
|
|
|
url = (_url = url) !== null && _url !== void 0 && _url.includes('.json') ? url : "".concat(url, ".json");
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: "\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var res, execRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,exercise/* resetMyGame */.$Q)({
|
|
|
url: url
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if (res) {
|
|
|
_context3.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context3.abrupt("return");
|
|
|
case 5:
|
|
|
message/* default */.ZP.success("重置成功,正在进入实践项目!");
|
|
|
_context3.next = 8;
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
id: res.shixun_identifier
|
|
|
});
|
|
|
case 8:
|
|
|
execRes = _context3.sent;
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context3.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
(0,util/* openNewWindow */.xg)("/tasks/".concat(execRes.game_identifier));
|
|
|
return _context3.abrupt("return");
|
|
|
case 12:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var handleInBeta = function handleInBeta(message) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc font16",
|
|
|
children: ["\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01"]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var handleAddStage = function handleAddStage() {
|
|
|
var addData = {
|
|
|
shixuns_list: [],
|
|
|
items: []
|
|
|
};
|
|
|
handleEdit(data.length, addData);
|
|
|
setData([].concat(toConsumableArray_default()(data), [addData]));
|
|
|
setIsAdd(true);
|
|
|
};
|
|
|
var handleCancel = function handleCancel() {
|
|
|
if (editKey === data.length - 1 && isAdd) {
|
|
|
clearAddStatus();
|
|
|
setData(data.filter(function (_, index) {
|
|
|
return index !== data.length - 1;
|
|
|
}));
|
|
|
}
|
|
|
getData();
|
|
|
setEditKey(-1);
|
|
|
};
|
|
|
var handleEdit = function handleEdit(key, val) {
|
|
|
if (!handleEditPrompt()) {
|
|
|
return;
|
|
|
}
|
|
|
setEditKey(key);
|
|
|
form.setFieldsValue({
|
|
|
name: val.stage_name,
|
|
|
description: val.stage_description
|
|
|
});
|
|
|
};
|
|
|
var handleShixuns = function handleShixuns(items) {
|
|
|
var _data$editKey$items;
|
|
|
setTimeout(function () {
|
|
|
document.documentElement.scrollTop = scrollTop;
|
|
|
}, 300);
|
|
|
if (items === '取消') return;
|
|
|
data[editKey]['items'] = (_data$editKey$items = data[editKey]['items']) === null || _data$editKey$items === void 0 ? void 0 : _data$editKey$items.concat(items);
|
|
|
setData(toConsumableArray_default()(data));
|
|
|
};
|
|
|
var handleCoursewareShixuns = function handleCoursewareShixuns(items) {
|
|
|
var _data$editKey$items2;
|
|
|
items.map(function (v) {
|
|
|
v.type = 'Attachment';
|
|
|
v.id = v.id || v.response.id;
|
|
|
v.url = "/api/attachments/".concat(v.id || v.response.id);
|
|
|
return v;
|
|
|
});
|
|
|
data[editKey]['items'] = (_data$editKey$items2 = data[editKey]['items']) === null || _data$editKey$items2 === void 0 ? void 0 : _data$editKey$items2.concat(items);
|
|
|
setData(toConsumableArray_default()(data));
|
|
|
};
|
|
|
var handleAddVideoOk = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(query) {
|
|
|
var res, videoData;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.next = 2;
|
|
|
return (0,onlineLearning/* addVideoToStage */.A2)(objectSpread2_default()({
|
|
|
id: data[editKey]['stage_id'],
|
|
|
course_id: params.coursesId
|
|
|
}, query));
|
|
|
case 2:
|
|
|
res = _context4.sent;
|
|
|
if (res.id) {
|
|
|
setVisibleVideoModal(false);
|
|
|
videoData = [objectSpread2_default()({}, res)];
|
|
|
data[editKey]['items'] = data[editKey]['items'].concat(videoData);
|
|
|
setData(toConsumableArray_default()(data));
|
|
|
}
|
|
|
return _context4.abrupt("return", res);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function handleAddVideoOk(_x3) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
setTreeLoading(true);
|
|
|
_context5.next = 3;
|
|
|
return (0,onlineLearning/* getOnlineLearning */.R7)({
|
|
|
coursesId: params === null || params === void 0 ? void 0 : params.coursesId
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context5.sent;
|
|
|
(res === null || res === void 0 ? void 0 : res.stages) && setData(res !== null && res !== void 0 && res.stages ? toConsumableArray_default()(res === null || res === void 0 ? void 0 : res.stages) : []);
|
|
|
setOriginData(res ? objectSpread2_default()({}, res) : {});
|
|
|
setTreeLoading(false);
|
|
|
clearAddStatus();
|
|
|
setEditKey(-1);
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var onFinish = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(value, type) {
|
|
|
var _data$editKey;
|
|
|
var list, res, _res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
if (value !== null && value !== void 0 && value.name) {
|
|
|
_context6.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context6.abrupt("return", message/* default */.ZP.info('请先输入章节名称!'));
|
|
|
case 2:
|
|
|
clearAddStatus();
|
|
|
list = [];
|
|
|
(_data$editKey = data[editKey][type || 'shixuns_list']) === null || _data$editKey === void 0 || _data$editKey.map(function (item) {
|
|
|
// item.item_type === 'Shixun' ?
|
|
|
list.push({
|
|
|
type: item.item_type,
|
|
|
id: item.id
|
|
|
});
|
|
|
// list.push({ type: 'VideoItem', id: item.id })
|
|
|
});
|
|
|
if (!isAdd) {
|
|
|
_context6.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
_context6.next = 8;
|
|
|
return (0,onlineLearning/* addStage */.CI)(objectSpread2_default()(objectSpread2_default()({}, value), {}, {
|
|
|
coursesId: params.coursesId,
|
|
|
list: list
|
|
|
}));
|
|
|
case 8:
|
|
|
res = _context6.sent;
|
|
|
if (res) {
|
|
|
data[editKey] = objectSpread2_default()(objectSpread2_default()({}, data[editKey]), res);
|
|
|
}
|
|
|
_context6.next = 16;
|
|
|
break;
|
|
|
case 12:
|
|
|
_context6.next = 14;
|
|
|
return (0,onlineLearning/* updateStage */.xn)(objectSpread2_default()(objectSpread2_default()({}, value), {}, {
|
|
|
id: data[editKey]['stage_id'],
|
|
|
type: Array.from(new Set(list.map(function (item) {
|
|
|
return item.type;
|
|
|
}))),
|
|
|
list: list
|
|
|
}));
|
|
|
case 14:
|
|
|
_res = _context6.sent;
|
|
|
if (_res) {
|
|
|
data[editKey] = objectSpread2_default()(objectSpread2_default()({}, data[editKey]), _res);
|
|
|
}
|
|
|
case 16:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function onFinish(_x4, _x5) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var reorder = function reorder(list, startIndex, endIndex) {
|
|
|
var result = Array.from(list);
|
|
|
var _result$splice = result.splice(startIndex, 1),
|
|
|
_result$splice2 = slicedToArray_default()(_result$splice, 1),
|
|
|
removed = _result$splice2[0];
|
|
|
result.splice(endIndex, 0, removed);
|
|
|
return result;
|
|
|
};
|
|
|
var handleDeleteShixun = function handleDeleteShixun(key, type) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: "提示",
|
|
|
content: "确定删除该实训吗?",
|
|
|
onOk: function onOk() {
|
|
|
data[editKey][type || 'shixuns_list'].splice(key, 1);
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
setData(toConsumableArray_default()(data));
|
|
|
onFinish(form.getFieldsValue(), type);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handleDeleteStage = function handleDeleteStage(id) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: "提示",
|
|
|
content: "确定删除该章节吗?",
|
|
|
onOk: function () {
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
_context7.next = 2;
|
|
|
return (0,onlineLearning/* deleteStage */._V)({
|
|
|
id: id
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context7.sent;
|
|
|
if (res.status === 0) {
|
|
|
setEditKey(-1);
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
getData();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var handleDeleteStages = function handleDeleteStages(id) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: "提示",
|
|
|
content: "确定删除该章节吗?",
|
|
|
onOk: function () {
|
|
|
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
_context8.next = 2;
|
|
|
return (0,onlineLearning/* deleteStages */.WW)(objectSpread2_default()({}, id));
|
|
|
case 2:
|
|
|
res = _context8.sent;
|
|
|
if (res.status === 0) {
|
|
|
setEditKey(-1);
|
|
|
message/* default */.ZP.success("删除成功");
|
|
|
getData();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee8);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk3.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var handleAddShixunCancel = function handleAddShixunCancel() {
|
|
|
setAddValue({
|
|
|
name: "",
|
|
|
is_jupyter: false
|
|
|
});
|
|
|
addForm.setFieldsValue({
|
|
|
name: "",
|
|
|
is_jupyter: false
|
|
|
});
|
|
|
setShowAddShixun(false);
|
|
|
};
|
|
|
var _onDragEnd = function onDragEnd(result, type) {
|
|
|
if (!result.destination) {
|
|
|
return;
|
|
|
}
|
|
|
var items = reorder(data[editKey][type || 'shixuns_list'], result.source.index, result.destination.index);
|
|
|
data[editKey][type || 'shixuns_list'] = items;
|
|
|
setData(toConsumableArray_default()(data));
|
|
|
onFinish(form.getFieldsValue(), type);
|
|
|
};
|
|
|
var handleUp = /*#__PURE__*/function () {
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(id) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
case 0:
|
|
|
if (handleEditPrompt()) {
|
|
|
_context9.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context9.abrupt("return");
|
|
|
case 2:
|
|
|
_context9.next = 4;
|
|
|
return (0,onlineLearning/* upPosition */.ms)({
|
|
|
id: id
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context9.sent;
|
|
|
if (res.status === 0) getData();
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context9.stop();
|
|
|
}
|
|
|
}, _callee9);
|
|
|
}));
|
|
|
return function handleUp(_x6) {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleDown = /*#__PURE__*/function () {
|
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10(id) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
case 0:
|
|
|
if (handleEditPrompt()) {
|
|
|
_context10.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context10.abrupt("return");
|
|
|
case 2:
|
|
|
_context10.next = 4;
|
|
|
return (0,onlineLearning/* downPosition */.yy)({
|
|
|
id: id
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context10.sent;
|
|
|
if (res.status === 0) getData();
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context10.stop();
|
|
|
}
|
|
|
}, _callee10);
|
|
|
}));
|
|
|
return function handleDown(_x7) {
|
|
|
return _ref8.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleEditPrompt = function handleEditPrompt() {
|
|
|
if (editKey !== -1) {
|
|
|
modal/* default */.Z.info({
|
|
|
centered: true,
|
|
|
width: 400,
|
|
|
okText: '知道啦',
|
|
|
icon: null,
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font14",
|
|
|
children: "\u5F53\u524D\u5355\u5143\u6709\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\u8BB0\u5F55\uFF0C\u8BF7\u5148\u4FDD\u5B58\uFF01"
|
|
|
}),
|
|
|
onOk: function onOk() {
|
|
|
// 跳转
|
|
|
var anchorName = "Edit_".concat(editKey);
|
|
|
var anchorElement = document.getElementById(anchorName);
|
|
|
if (anchorElement) {
|
|
|
setTimeout(function () {
|
|
|
return anchorElement.scrollIntoView({
|
|
|
block: "start",
|
|
|
behavior: "smooth"
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
};
|
|
|
var handleBlur = function handleBlur() {
|
|
|
onFinish(form.getFieldsValue());
|
|
|
};
|
|
|
var clearAddStatus = function clearAddStatus() {
|
|
|
setIsAdd(false);
|
|
|
};
|
|
|
var renderShixun = function renderShixun(item, index, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "list-item-row",
|
|
|
align: "middle",
|
|
|
gutter: [5, 10],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: item.item_type === 'Shixun' ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont c-green-shixun c-light-primary font20"
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shipin2 c-purple-8C1 font20"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: 1,
|
|
|
className: !item.allow_visit && !item.to_be_built && (item.shixun_status === "暂未公开" || item.shixun_status === "已删除") ? OnlineLearningmodules.color204 : '',
|
|
|
children: [key + 1, "-", index + 1, "\xA0\xA0", item.name, editKey === -1 && item.complete_status === 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: OnlineLearningmodules.completed,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-duigou1 mr5 font12"
|
|
|
}), "\u5DF2\u5B8C\u6210"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
children: [editKey === key && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
handleDeleteShixun(index, 'shixuns_list');
|
|
|
},
|
|
|
className: "iconfont icon-shanchu c-grey-c"
|
|
|
})
|
|
|
})
|
|
|
}), editKey !== key && item.item_type === 'VideoItem' && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
href: item.link || "/video/".concat(item.id, "?course_id=").concat(params === null || params === void 0 ? void 0 : params.coursesId),
|
|
|
target: "_blank",
|
|
|
children: item.last_point > 0 ? '继续学习' : '开始学习'
|
|
|
})
|
|
|
}), (item.allow_visit || item.to_be_built || item.shixun_status !== "暂未公开" && item.shixun_status !== "已删除") && editKey !== key && item.item_type === 'Shixun' && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/shixuns/".concat(item.identifier, "/challenges"),
|
|
|
target: "_blank",
|
|
|
children: "\u67E5\u770B\u8BE6\u60C5"
|
|
|
}), item.shixun_status !== "暂未公开" && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "ml20",
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
toShixun(item.identifier);
|
|
|
},
|
|
|
children: "\u5F00\u59CB\u5B9E\u6218"
|
|
|
})]
|
|
|
}), editKey === -1 && !item.allow_visit && item.shixun_status === "暂未公开" && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: OnlineLearningmodules.color204,
|
|
|
children: "\u6682\u672A\u516C\u5F00"
|
|
|
}), editKey === -1 && !item.allow_visit && item.shixun_status === "已删除" && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: OnlineLearningmodules.color204,
|
|
|
children: "\u5DF2\u5220\u9664"
|
|
|
}), editKey === -1 && item.allow_visit && item.item_type === 'Shixun' && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "".concat(OnlineLearningmodules.color204, " ml5 experiment-number"),
|
|
|
children: ["\u5B9E\u9A8C\u6570 ", item.challenges_count]
|
|
|
})]
|
|
|
})]
|
|
|
}, index);
|
|
|
};
|
|
|
var renderDom = function renderDom(val, key) {
|
|
|
var _val$stage_tag, _globalSetting$settin, _val$attachments_list, _val$attachments_list3;
|
|
|
// debugger
|
|
|
if (visibleType !== 'All' && !((_val$stage_tag = val.stage_tag) !== null && _val$stage_tag !== void 0 && _val$stage_tag.includes(visibleType))) {
|
|
|
return null;
|
|
|
}
|
|
|
var kdata = val.items.filter(function (item) {
|
|
|
var _item$children;
|
|
|
var reg = new RegExp(keywords, "ig");
|
|
|
return reg.test(item.name) && (item.item_type === visibleType || visibleType === 'All' || (item === null || item === void 0 || (_item$children = item.children) === null || _item$children === void 0 || (_item$children = _item$children.filter(function (item) {
|
|
|
var _item$children2;
|
|
|
return item.item_type === visibleType || visibleType === 'All' || (item === null || item === void 0 || (_item$children2 = item.children) === null || _item$children2 === void 0 || (_item$children2 = _item$children2.filter(function (item) {
|
|
|
return item.item_type === visibleType || visibleType === 'All';
|
|
|
})) === null || _item$children2 === void 0 ? void 0 : _item$children2.length) > 0;
|
|
|
})) === null || _item$children === void 0 ? void 0 : _item$children.length) > 0);
|
|
|
});
|
|
|
return keywords && !!(kdata !== null && kdata !== void 0 && kdata.length) || !keywords ? /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "bg-white pt30 mb20 pb20 pl10 pr10",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "pl20 pr20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
gutter: [5, 20],
|
|
|
align: "middle",
|
|
|
style: {
|
|
|
lineHeight: '16px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "22px",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: OnlineLearningmodules.icons,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-zhangjie2 font18"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: 1,
|
|
|
className: "tl font18 bold c-grey-333",
|
|
|
children: val.stage_name || "\u7B2C".concat(data === null || data === void 0 ? void 0 : data.length, "\u90E8\u5206")
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
children: [(0,authority/* isAdmin */.GJ)() && editKey === key && !isAdd && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
handleDeleteStage(val.stage_id);
|
|
|
},
|
|
|
className: "iconfont icon-shanchu c-grey-c"
|
|
|
})
|
|
|
}), (0,authority/* isAdmin */.GJ)() && editKey !== key && visibleType === 'All' && !keywords && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [key > 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5411\u4E0A\u79FB\u52A8",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return handleUp(val.stage_id);
|
|
|
},
|
|
|
className: "iconfont icon-xiangshangyi c-light-green font18 current"
|
|
|
})
|
|
|
}), key < data.length - 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5411\u4E0B\u79FB\u52A8",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return handleDown(val.stage_id);
|
|
|
},
|
|
|
className: "iconfont icon-xiangxiayi c-light-green font18 current ml5"
|
|
|
})
|
|
|
}), !isAdd && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u7F16\u8F91",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return handleEdit(key, val);
|
|
|
},
|
|
|
className: "iconfont icon-bianjidaibeijing c-light-green font20 current ml5"
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), !!val.stage_description && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 12
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
ref: content,
|
|
|
className: "".concat(OnlineLearningmodules.introContent, " ").concat(!(val !== null && val !== void 0 && val.showReadFull) ? OnlineLearningmodules.introContentMaxHeight : ''),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: val === null || val === void 0 ? void 0 : val.stage_description
|
|
|
})
|
|
|
}), (val === null || val === void 0 ? void 0 : val.showExpansion) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
onClick: function onClick(e) {
|
|
|
data[key].showReadFull = !(val !== null && val !== void 0 && val.showReadFull);
|
|
|
setData(toConsumableArray_default()(data));
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {
|
|
|
dashed: false,
|
|
|
className: "",
|
|
|
style: {
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
className: "font14 ".concat(OnlineLearningmodules.color999),
|
|
|
children: [!(val !== null && val !== void 0 && val.showReadFull) ? '阅读全文 ' : '收起全文 ', /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont font14 ".concat(!(val !== null && val !== void 0 && val.showReadFull) ? 'icon-jiantou9' : 'icon-changyongtubiao-xianxingdaochu-zhuanqu-')
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}), editKey === key && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "pl20 pr20 pt20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "name",
|
|
|
label: "名称",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "名称不能为空"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
size: 'middle',
|
|
|
maxLength: 60,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u7B2C".concat(data === null || data === void 0 ? void 0 : data.length, "\u9636\u6BB5\u540D\u79F0,\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"),
|
|
|
onBlur: handleBlur
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "description",
|
|
|
label: "描述",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "描述不能为空"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
|
rows: 5,
|
|
|
maxLength: 300,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u7B2C".concat(data === null || data === void 0 ? void 0 : data.length, "\u9636\u6BB5\u63CF\u8FF0"),
|
|
|
onBlur: handleBlur
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-evenly'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
className: "mt10",
|
|
|
onClick: function onClick() {
|
|
|
if (!data[editKey]['stage_id']) {
|
|
|
return message/* default */.ZP.info('请先输入章节名称!');
|
|
|
}
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
if (!(0,verifyLogin/* handleCanShixunAddModal */.xY)()) {
|
|
|
return;
|
|
|
}
|
|
|
setShowAddShixun(true);
|
|
|
addForm.setFieldsValue({
|
|
|
name: "",
|
|
|
is_jupyter: false
|
|
|
});
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "iconfont icon-tianjiafangda mr5 "
|
|
|
}), "\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
className: "mt10",
|
|
|
onClick: function onClick() {
|
|
|
var _val$shixuns_list;
|
|
|
if (!data[editKey]['stage_id']) {
|
|
|
return message/* default */.ZP.info('请先输入章节名称!');
|
|
|
}
|
|
|
setScrollTop(document.documentElement.scrollTop);
|
|
|
dispatch({
|
|
|
type: "classroomList/setActionTabs",
|
|
|
payload: {
|
|
|
key: "选用实践项目",
|
|
|
id: data[editKey]['stage_id'],
|
|
|
course_id: params.coursesId
|
|
|
}
|
|
|
});
|
|
|
setShixunIds(val === null || val === void 0 || (_val$shixuns_list = val.shixuns_list) === null || _val$shixuns_list === void 0 ? void 0 : _val$shixuns_list.map(function (item) {
|
|
|
return item.id;
|
|
|
}));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "iconfont icon-tianjiafangda mr5"
|
|
|
}), "\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.is_local) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
className: "mt10",
|
|
|
onClick: function onClick() {
|
|
|
var _user$userInfo, _user$userInfo2;
|
|
|
if (!data[editKey]['stage_id']) {
|
|
|
return message/* default */.ZP.info('请先输入章节名称!');
|
|
|
}
|
|
|
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)()) {
|
|
|
setVisibleVideoModal(true);
|
|
|
}
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "iconfont icon-tianjiafangda mr5 "
|
|
|
}), "\u65B0\u5EFA\u89C6\u9891\u9879\u76EE"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
className: "mt10",
|
|
|
onClick: function onClick() {
|
|
|
if (!data[editKey]['stage_id']) {
|
|
|
return message/* default */.ZP.info('请先输入章节名称!');
|
|
|
}
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
if (!(0,verifyLogin/* handleCanShixunAddModal */.xY)()) {
|
|
|
return;
|
|
|
}
|
|
|
setShowAddCourseware(true);
|
|
|
addCoursewareForm.resetFields();
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "iconfont icon-tianjiafangda mr5 "
|
|
|
}), "\u65B0\u5EFA\u6559\u5B66\u8BFE\u4EF6"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: "c-light-black mt10 pb20",
|
|
|
id: "Edit_".concat(key),
|
|
|
children: "\u4E0B\u9762\u5B9E\u8BAD\u53EF\u4EE5\u901A\u8FC7\u62D6\u62FD\u8FDB\u884C\u6392\u5E8F\u8C03\u6574"
|
|
|
})]
|
|
|
}), !!((_val$attachments_list = val.attachments_list) !== null && _val$attachments_list !== void 0 && _val$attachments_list.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: OnlineLearningmodules.shixuns,
|
|
|
children: editKey === key ? /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* DragDropContext */.Z5, {
|
|
|
onDragEnd: function onDragEnd(e) {
|
|
|
return _onDragEnd(e, 'attachments_list');
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Droppable */.bK, {
|
|
|
droppableId: 'droppable-id2',
|
|
|
children: function children(provided, snapshot) {
|
|
|
var _val$attachments_list2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({
|
|
|
className: "mt20",
|
|
|
ref: provided.innerRef
|
|
|
}, provided.droppableProps), {}, {
|
|
|
onScroll: function onScroll() {},
|
|
|
children: (_val$attachments_list2 = val.attachments_list) === null || _val$attachments_list2 === void 0 ? void 0 : _val$attachments_list2.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react_beautiful_dnd_esm/* Draggable */._l, {
|
|
|
draggableId: "".concat(item.id.toString(), "-").concat(key, "-").concat(index),
|
|
|
index: index,
|
|
|
children: function children(provided, snapshot) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
|
|
|
ref: provided.innerRef
|
|
|
}, provided.draggableProps), provided.dragHandleProps), {}, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "list-item-row",
|
|
|
align: "middle",
|
|
|
gutter: [5, 10],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-kejian1 c-cyan-blue font20"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: "c-grey-333",
|
|
|
href: env/* default */.Z.IMG_SERVER + item.url,
|
|
|
target: "_blank",
|
|
|
children: item.name
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: editKey === key && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
handleDeleteShixun(index, 'attachments_list');
|
|
|
},
|
|
|
className: "iconfont icon-shanchu c-grey-c"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}, index)
|
|
|
}));
|
|
|
}
|
|
|
}, item.id);
|
|
|
})
|
|
|
}));
|
|
|
}
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: (_val$attachments_list3 = val.attachments_list) === null || _val$attachments_list3 === void 0 ? void 0 : _val$attachments_list3.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "list-item-row",
|
|
|
align: "middle",
|
|
|
gutter: [5, 10],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-kejian1 c-cyan-blue font20"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: "c-grey-333",
|
|
|
href: env/* default */.Z.IMG_SERVER + item.url,
|
|
|
target: "_blank",
|
|
|
children: item.name
|
|
|
})
|
|
|
})]
|
|
|
}, index)
|
|
|
});
|
|
|
})
|
|
|
})
|
|
|
}), !!(kdata !== null && kdata !== void 0 && kdata.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(Sort/* default */.Z, {
|
|
|
visibleType: visibleType
|
|
|
// data={[...val.items]}
|
|
|
,
|
|
|
data: toConsumableArray_default()(kdata),
|
|
|
stage_id: val.stage_id,
|
|
|
disabled: editKey === key ? false : true,
|
|
|
deleteStages: handleDeleteStages,
|
|
|
updateSort: updateSort,
|
|
|
subject_id: originData === null || originData === void 0 ? void 0 : originData.subject_id,
|
|
|
course_id: params === null || params === void 0 ? void 0 : params.coursesId,
|
|
|
index: key,
|
|
|
cust_seq: true,
|
|
|
hiddenEditBtn: true,
|
|
|
keywords: keywords,
|
|
|
isShowSchedule: originData === null || originData === void 0 ? void 0 : originData.is_show_schedule,
|
|
|
getData: getData,
|
|
|
showVideoPlay: true
|
|
|
// user.userInfo?.admin ||
|
|
|
// user.userInfo?.business ||
|
|
|
// !(
|
|
|
// !pathsDetail.detail?.allow_statistics &&
|
|
|
// user.userInfo?.user_identity === '学生' &&
|
|
|
// pathsDetail.detail?.allow_visit &&
|
|
|
// pathsDetail.detail?.courses
|
|
|
// )
|
|
|
}), editKey === key && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: OnlineLearningmodules.buttons,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: handleCancel,
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
ghost: true,
|
|
|
children: "\u53D6\u6D88"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: handleCancel,
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
children: "\u4FDD\u5B58"
|
|
|
})]
|
|
|
})]
|
|
|
}, key) : null;
|
|
|
};
|
|
|
var getTextCount = function getTextCount(data) {
|
|
|
if (data) {
|
|
|
var len = 0;
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
if (data.charCodeAt(i) > 127 || data.charCodeAt(i) == 94) {
|
|
|
len += 2;
|
|
|
} else {
|
|
|
len++;
|
|
|
}
|
|
|
}
|
|
|
return len;
|
|
|
} else {
|
|
|
return 0;
|
|
|
}
|
|
|
};
|
|
|
var domList = function domList() {
|
|
|
for (var i in data) {
|
|
|
var _data$i;
|
|
|
if (getTextCount((_data$i = data[i]) === null || _data$i === void 0 ? void 0 : _data$i.stage_description) > 424) {
|
|
|
data[i].showExpansion = true;
|
|
|
} else {
|
|
|
data[i].showExpansion = false;
|
|
|
}
|
|
|
}
|
|
|
return data === null || data === void 0 ? void 0 : data.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: renderDom(val, key)
|
|
|
}, key);
|
|
|
});
|
|
|
};
|
|
|
var start_date = detailTopBanner.start_date,
|
|
|
course_end = detailTopBanner.course_end;
|
|
|
var isNotDiscuss = course_end || dayjs_min_default()(dayjs_min_default()().format('L')).valueOf() < dayjs_min_default()(start_date).valueOf();
|
|
|
var addTags = function addTags() {};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "mb50",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(components_Head, {
|
|
|
data: originData,
|
|
|
dispatch: dispatch,
|
|
|
onReloadData: getData
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
style: {
|
|
|
justifyContent: 'space-between',
|
|
|
display: 'flex',
|
|
|
background: '#fff',
|
|
|
alignItems: 'center',
|
|
|
paddingRight: '20px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: OnlineLearningmodules.actionTabs,
|
|
|
children: typeData.map(function (item, key) {
|
|
|
if (data !== null && data !== void 0 && data.some(function (val) {
|
|
|
var _val$stage_tag2;
|
|
|
return (_val$stage_tag2 = val.stage_tag) === null || _val$stage_tag2 === void 0 ? void 0 : _val$stage_tag2.includes(item.type);
|
|
|
}) || item.type == 'All' || item.type === 'Discusses') {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: item.type === visibleType ? OnlineLearningmodules.tabActive : OnlineLearningmodules.tab,
|
|
|
onClick: function onClick() {
|
|
|
if (editKey === -1) {
|
|
|
setVisibleType(item.type);
|
|
|
setEditKey(-1);
|
|
|
} else {
|
|
|
message/* default */.ZP.warning("请先取消编辑状态");
|
|
|
}
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: OnlineLearningmodules.s1,
|
|
|
children: item.name
|
|
|
})
|
|
|
}, key);
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: "flex",
|
|
|
justifyContent: "center"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
|
|
|
style: {
|
|
|
width: 222,
|
|
|
marginTop: "-3px"
|
|
|
},
|
|
|
className: (0,authority/* isAdminOrTeacher */.G5)() ? 'mr20' : '',
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
|
onChange: handleSearch
|
|
|
}), (0,authority/* isAdminOrTeacher */.G5)() && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
|
|
|
while (1) switch (_context12.prev = _context12.next) {
|
|
|
case 0:
|
|
|
modal/* default */.Z.confirm({
|
|
|
title: '提示',
|
|
|
content: '同步开放课程资源后,会造成在线学习内所有资源强制同步为最新开放课程内容,是否继续同步?',
|
|
|
okText: '同步',
|
|
|
cancelText: '取消',
|
|
|
onOk: function () {
|
|
|
var _onOk4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
|
|
|
while (1) switch (_context11.prev = _context11.next) {
|
|
|
case 0:
|
|
|
_context11.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/courses/sync_stages.json", {
|
|
|
method: 'post',
|
|
|
body: {
|
|
|
classroom_identifier: params === null || params === void 0 ? void 0 : params.coursesId
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context11.sent;
|
|
|
if (res.status === 0) {
|
|
|
getData();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context11.stop();
|
|
|
}
|
|
|
}, _callee11);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk4.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context12.stop();
|
|
|
}
|
|
|
}, _callee12);
|
|
|
})),
|
|
|
children: "\u66F4\u65B0"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: OnlineLearningmodules.total,
|
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: keywords ? typeCount : typeData.find(function (e) {
|
|
|
return e.type === visibleType;
|
|
|
}).number
|
|
|
}), "\u4E2A", typeData.find(function (e) {
|
|
|
return e.type === visibleType;
|
|
|
}).totalName]
|
|
|
}), keywords && typeCount === 0 && visibleType !== 'Discusses' && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
styles: {
|
|
|
margin: "0 auto",
|
|
|
padding: "100px 0",
|
|
|
backgroundColor: "#fff"
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
|
|
|
loading: treeLoading,
|
|
|
active: true,
|
|
|
avatar: {
|
|
|
size: 40
|
|
|
},
|
|
|
paragraph: {
|
|
|
rows: 5
|
|
|
},
|
|
|
className: "mt30",
|
|
|
children: visibleType !== 'Discusses' && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
onFinish: onFinish,
|
|
|
children: domList
|
|
|
}), (0,authority/* isAdmin */.GJ)() && !isAdd && visibleType === 'All' && editKey === -1 && !keywords && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: OnlineLearningmodules.addStage,
|
|
|
onClick: handleAddStage,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: OnlineLearningmodules.color4CA,
|
|
|
children: "+\u70B9\u51FB\u65B0\u5EFA\u9636\u6BB5"
|
|
|
}), "\uFF08\u6DFB\u52A0\u4E00\u4E2A\u6216\u591A\u4E2A\u5B9E\u8BAD/\u89C6\u9891\u9879\u76EE\uFF0C\u7EC4\u6210\u4E00\u4E2A\u9636\u6BB5\uFF09"]
|
|
|
})]
|
|
|
})
|
|
|
}), visibleType === 'Discusses' && /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
style: {
|
|
|
paddingTop: 25,
|
|
|
background: '#fff'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Discuss, {
|
|
|
activeIndex: 3,
|
|
|
isNotDiscuss: isNotDiscuss
|
|
|
// isDelete
|
|
|
// isDelete={pathsDetail.detail?.allow_add_member}
|
|
|
,
|
|
|
getData: getData,
|
|
|
shixunIdentifier: 11,
|
|
|
coursesId: params === null || params === void 0 ? void 0 : params.coursesId,
|
|
|
params: {
|
|
|
pathId: params === null || params === void 0 ? void 0 : params.coursesId
|
|
|
} //与课程讨论传参保持一致
|
|
|
,
|
|
|
identity: (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.role,
|
|
|
getTypeNumber: getTypeNumber,
|
|
|
user: user.userInfo,
|
|
|
isShixunDetail: true,
|
|
|
keywords: keywords,
|
|
|
setTypeCount: setTypeCount
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u65B0\u5EFA\u5B9E\u8DF5\u9879\u76EE",
|
|
|
open: showAddShixun,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
|
|
|
while (1) switch (_context13.prev = _context13.next) {
|
|
|
case 0:
|
|
|
_context13.next = 2;
|
|
|
return addForm.validateFields();
|
|
|
case 2:
|
|
|
_context13.next = 4;
|
|
|
return (0,onlineLearning/* satgeAddShixunToStage */.vf)(objectSpread2_default()({
|
|
|
id: data[editKey]['stage_id'],
|
|
|
course_id: params.coursesId
|
|
|
}, addValue));
|
|
|
case 4:
|
|
|
res = _context13.sent;
|
|
|
handleAddShixunCancel();
|
|
|
if (res.id) {
|
|
|
message/* default */.ZP.success("添加成功");
|
|
|
handleShixuns([res]);
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context13.stop();
|
|
|
}
|
|
|
}, _callee13);
|
|
|
})),
|
|
|
onCancel: handleAddShixunCancel,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: addForm,
|
|
|
onValuesChange: function onValuesChange(value) {
|
|
|
setAddValue(objectSpread2_default()(objectSpread2_default()({}, addValue), value));
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u5B9E\u8BAD\u7C7B\u578B",
|
|
|
name: "is_jupyter",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请选择实训类型"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
defaultChecked: true,
|
|
|
value: false,
|
|
|
children: "\u666E\u901A\u5B9E\u8BAD"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
value: true,
|
|
|
children: "jupyter\u5B9E\u8BAD"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u5B9E\u8BAD\u540D\u79F0",
|
|
|
name: "name",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请输入实训名称"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
maxLength: 60,
|
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [addValue.name.length, "/60"]
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u65B0\u5EFA\u6559\u5B66\u8BFE\u4EF6",
|
|
|
open: showAddCourseware,
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
|
|
|
var value, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
|
|
|
while (1) switch (_context14.prev = _context14.next) {
|
|
|
case 0:
|
|
|
_context14.next = 2;
|
|
|
return addCoursewareForm.validateFields();
|
|
|
case 2:
|
|
|
_context14.next = 4;
|
|
|
return addCoursewareForm.getFieldsValue();
|
|
|
case 4:
|
|
|
value = _context14.sent;
|
|
|
_context14.next = 7;
|
|
|
return (0,onlineLearning/* addCoursewareToStage */.s0)({
|
|
|
id: data[editKey]['stage_id'],
|
|
|
// subject_id: params.pathId,
|
|
|
course_id: params.coursesId,
|
|
|
attachment_ids: value.files.map(function (item) {
|
|
|
return item.response.id;
|
|
|
})
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context14.sent;
|
|
|
// handleAddShixunCancel();
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.success("添加成功");
|
|
|
setShowAddCourseware(false);
|
|
|
handleCoursewareShixuns(toConsumableArray_default()(value.files));
|
|
|
}
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context14.stop();
|
|
|
}
|
|
|
}, _callee14);
|
|
|
})),
|
|
|
onCancel: function onCancel() {
|
|
|
return setShowAddCourseware(false);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: addCoursewareForm,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u8BFE\u4EF6\u5185\u5BB9",
|
|
|
name: "files",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "请上传课件内容"
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MultiUpload/* default */.Z, {
|
|
|
maxSize: 100,
|
|
|
accept: "application/pdf",
|
|
|
number: 10
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u77E5\u8BC6\u6807\u7B7E",
|
|
|
name: "test_lyl",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
onClick: function onClick() {
|
|
|
return addTags;
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: "\u6CE8\u610F\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "1\u3001\u4E0A\u4F20\u8BFE\u4EF6\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
target: "_blank",
|
|
|
to: "/users/mmipb3zhj/videos/protocol",
|
|
|
children: "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"
|
|
|
}), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7100M\uFF1B", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "3\u3001\u5F53\u524D\u4EC5\u9650\u652F\u6301pdf\u6587\u4EF6\uFF1B", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "4\u3001\u6587\u4EF6\u540D\u5C06\u88AB\u81EA\u52A8\u8BFB\u53D6\u4E3A\u7CFB\u7EDF\u5185\u8BE5\u8BFE\u4EF6\u7684\u540D\u79F0\uFF0C\u4E0A\u4F20\u524D\u8BF7\u6CE8\u610F\u8FD9\u4E00\u70B9\uFF1B", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "5\u3001\u4E00\u6B21\u6700\u591A\u4E0A\u4F2010\u4E2A\u6587\u4EF6\u3002"]
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SelectShixuns, {
|
|
|
shixunIds: shixunIds,
|
|
|
cb: handleShixuns
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(AddVideoModal/* default */.Z, {
|
|
|
visible: visibleVideoModal,
|
|
|
onCancel: function onCancel() {
|
|
|
return setVisibleVideoModal(false);
|
|
|
},
|
|
|
onOk: handleAddVideoOk
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var OnlineLearning = ((0,_umi_production_exports.connect)(function (_ref12) {
|
|
|
var classroomList = _ref12.classroomList,
|
|
|
user = _ref12.user,
|
|
|
loading = _ref12.loading,
|
|
|
globalSetting = _ref12.globalSetting;
|
|
|
return {
|
|
|
classroomList: classroomList,
|
|
|
user: user,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(Stage));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 24905:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_checkbox; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js
|
|
|
var es = __webpack_require__(5630);
|
|
|
// 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/config-provider/context.js
|
|
|
var config_provider_context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
|
|
|
var DisabledContext = __webpack_require__(1684);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/context.js
|
|
|
var context = __webpack_require__(32441);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/GroupContext.js
|
|
|
|
|
|
const GroupContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
|
|
|
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js
|
|
|
var checkbox_style = __webpack_require__(98447);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
|
var wave = __webpack_require__(14088);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/interface.js
|
|
|
var wave_interface = __webpack_require__(4572);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Checkbox.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalCheckbox = (props, ref) => {
|
|
|
var _a;
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
indeterminate = false,
|
|
|
style,
|
|
|
onMouseEnter,
|
|
|
onMouseLeave,
|
|
|
skipGroup = false,
|
|
|
disabled
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
checkbox
|
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const checkboxGroup = _react_17_0_2_react.useContext(checkbox_GroupContext);
|
|
|
const {
|
|
|
isFormItemInput
|
|
|
} = _react_17_0_2_react.useContext(context/* FormItemInputContext */.aM);
|
|
|
const contextDisabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
|
const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
|
|
|
const prevValue = _react_17_0_2_react.useRef(restProps.value);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
|
false ? 0 : void 0;
|
|
|
}, []);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (skipGroup) {
|
|
|
return;
|
|
|
}
|
|
|
if (restProps.value !== prevValue.current) {
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
|
prevValue.current = restProps.value;
|
|
|
}
|
|
|
return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
|
|
|
}, [restProps.value]);
|
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
|
const checkboxProps = Object.assign({}, restProps);
|
|
|
if (checkboxGroup && !skipGroup) {
|
|
|
checkboxProps.onChange = function () {
|
|
|
if (restProps.onChange) {
|
|
|
restProps.onChange.apply(restProps, arguments);
|
|
|
}
|
|
|
if (checkboxGroup.toggleOption) {
|
|
|
checkboxGroup.toggleOption({
|
|
|
label: children,
|
|
|
value: restProps.value
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
checkboxProps.name = checkboxGroup.name;
|
|
|
checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
|
|
|
}
|
|
|
const classString = _classnames_2_5_1_classnames_default()(`${prefixCls}-wrapper`, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
|
|
|
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
|
|
|
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
|
|
|
}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, hashId);
|
|
|
const checkboxClass = _classnames_2_5_1_classnames_default()({
|
|
|
[`${prefixCls}-indeterminate`]: indeterminate
|
|
|
}, wave_interface/* TARGET_CLS */.A, hashId);
|
|
|
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
|
component: "Checkbox",
|
|
|
disabled: mergedDisabled
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("label", {
|
|
|
className: classString,
|
|
|
style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({
|
|
|
"aria-checked": ariaChecked
|
|
|
}, checkboxProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
className: checkboxClass,
|
|
|
disabled: mergedDisabled,
|
|
|
ref: ref
|
|
|
})), children !== undefined && /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children))));
|
|
|
};
|
|
|
const Checkbox = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalCheckbox);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.0@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(41411);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.2@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(41123);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Group.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
var Group_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalGroup = (props, ref) => {
|
|
|
const {
|
|
|
defaultValue,
|
|
|
children,
|
|
|
options = [],
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
onChange
|
|
|
} = props,
|
|
|
restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const [value, setValue] = _react_17_0_2_react.useState(restProps.value || defaultValue || []);
|
|
|
const [registeredValues, setRegisteredValues] = _react_17_0_2_react.useState([]);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('value' in restProps) {
|
|
|
setValue(restProps.value || []);
|
|
|
}
|
|
|
}, [restProps.value]);
|
|
|
const memoOptions = _react_17_0_2_react.useMemo(() => options.map(option => {
|
|
|
if (typeof option === 'string' || typeof option === 'number') {
|
|
|
return {
|
|
|
label: option,
|
|
|
value: option
|
|
|
};
|
|
|
}
|
|
|
return option;
|
|
|
}), [options]);
|
|
|
const cancelValue = val => {
|
|
|
setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
|
|
|
};
|
|
|
const registerValue = val => {
|
|
|
setRegisteredValues(prevValues => [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]));
|
|
|
};
|
|
|
const toggleOption = option => {
|
|
|
const optionIndex = value.indexOf(option.value);
|
|
|
const newValue = (0,toConsumableArray/* default */.Z)(value);
|
|
|
if (optionIndex === -1) {
|
|
|
newValue.push(option.value);
|
|
|
} else {
|
|
|
newValue.splice(optionIndex, 1);
|
|
|
}
|
|
|
if (!('value' in restProps)) {
|
|
|
setValue(newValue);
|
|
|
}
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
|
|
|
const indexA = memoOptions.findIndex(opt => opt.value === a);
|
|
|
const indexB = memoOptions.findIndex(opt => opt.value === b);
|
|
|
return indexA - indexB;
|
|
|
}));
|
|
|
};
|
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
|
const domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
|
|
|
const childrenNode = options.length ? memoOptions.map(option => /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_Checkbox, {
|
|
|
prefixCls: prefixCls,
|
|
|
key: option.value.toString(),
|
|
|
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
|
|
|
value: option.value,
|
|
|
checked: value.includes(option.value),
|
|
|
onChange: option.onChange,
|
|
|
className: `${groupPrefixCls}-item`,
|
|
|
style: option.style,
|
|
|
title: option.title
|
|
|
}, option.label)) : children;
|
|
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
|
const context = {
|
|
|
toggleOption,
|
|
|
value,
|
|
|
disabled: restProps.disabled,
|
|
|
name: restProps.name,
|
|
|
// https://github.com/ant-design/ant-design/issues/16376
|
|
|
registerValue,
|
|
|
cancelValue
|
|
|
};
|
|
|
const classString = _classnames_2_5_1_classnames_default()(groupPrefixCls, {
|
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, className, rootClassName, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
|
className: classString,
|
|
|
style: style
|
|
|
}, domProps, {
|
|
|
ref: ref
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_GroupContext.Provider, {
|
|
|
value: context
|
|
|
}, childrenNode)));
|
|
|
};
|
|
|
|
|
|
const CheckboxGroup = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalGroup);
|
|
|
/* harmony default export */ var Group = (/*#__PURE__*/_react_17_0_2_react.memo(CheckboxGroup));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const es_checkbox_Checkbox = checkbox_Checkbox;
|
|
|
es_checkbox_Checkbox.Group = Group;
|
|
|
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 28103:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules ***!
|
|
|
\***********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ divider; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// 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/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
|
var style = __webpack_require__(17313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(37613);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/style/index.js
|
|
|
|
|
|
|
|
|
// ============================== Shared ==============================
|
|
|
const genSharedDividerStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
sizePaddingEdgeHorizontal,
|
|
|
colorSplit,
|
|
|
lineWidth,
|
|
|
textPaddingInline,
|
|
|
orientationMargin,
|
|
|
verticalMarginInline
|
|
|
} = token;
|
|
|
return {
|
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
borderBlockStart: `${lineWidth}px solid ${colorSplit}`,
|
|
|
// vertical
|
|
|
'&-vertical': {
|
|
|
position: 'relative',
|
|
|
top: '-0.06em',
|
|
|
display: 'inline-block',
|
|
|
height: '0.9em',
|
|
|
marginInline: verticalMarginInline,
|
|
|
marginBlock: 0,
|
|
|
verticalAlign: 'middle',
|
|
|
borderTop: 0,
|
|
|
borderInlineStart: `${lineWidth}px solid ${colorSplit}`
|
|
|
},
|
|
|
'&-horizontal': {
|
|
|
display: 'flex',
|
|
|
clear: 'both',
|
|
|
width: '100%',
|
|
|
minWidth: '100%',
|
|
|
margin: `${token.dividerHorizontalGutterMargin}px 0`
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text`]: {
|
|
|
display: 'flex',
|
|
|
alignItems: 'center',
|
|
|
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
|
|
|
color: token.colorTextHeading,
|
|
|
fontWeight: 500,
|
|
|
fontSize: token.fontSizeLG,
|
|
|
whiteSpace: 'nowrap',
|
|
|
textAlign: 'center',
|
|
|
borderBlockStart: `0 ${colorSplit}`,
|
|
|
'&::before, &::after': {
|
|
|
position: 'relative',
|
|
|
width: '50%',
|
|
|
borderBlockStart: `${lineWidth}px solid transparent`,
|
|
|
// Chrome not accept `inherit` in `border-top`
|
|
|
borderBlockStartColor: 'inherit',
|
|
|
borderBlockEnd: 0,
|
|
|
transform: 'translateY(50%)',
|
|
|
content: "''"
|
|
|
}
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-left`]: {
|
|
|
'&::before': {
|
|
|
width: `${orientationMargin * 100}%`
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: `${100 - orientationMargin * 100}%`
|
|
|
}
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-right`]: {
|
|
|
'&::before': {
|
|
|
width: `${100 - orientationMargin * 100}%`
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: `${orientationMargin * 100}%`
|
|
|
}
|
|
|
},
|
|
|
[`${componentCls}-inner-text`]: {
|
|
|
display: 'inline-block',
|
|
|
paddingBlock: 0,
|
|
|
paddingInline: textPaddingInline
|
|
|
},
|
|
|
'&-dashed': {
|
|
|
background: 'none',
|
|
|
borderColor: colorSplit,
|
|
|
borderStyle: 'dashed',
|
|
|
borderWidth: `${lineWidth}px 0 0`
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
|
|
|
'&::before, &::after': {
|
|
|
borderStyle: 'dashed none none'
|
|
|
}
|
|
|
},
|
|
|
[`&-vertical${componentCls}-dashed`]: {
|
|
|
borderInlineStartWidth: lineWidth,
|
|
|
borderInlineEnd: 0,
|
|
|
borderBlockStart: 0,
|
|
|
borderBlockEnd: 0
|
|
|
},
|
|
|
[`&-plain${componentCls}-with-text`]: {
|
|
|
color: token.colorText,
|
|
|
fontWeight: 'normal',
|
|
|
fontSize: token.fontSize
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-left${componentCls}-no-default-orientation-margin-left`]: {
|
|
|
'&::before': {
|
|
|
width: 0
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: '100%'
|
|
|
},
|
|
|
[`${componentCls}-inner-text`]: {
|
|
|
paddingInlineStart: sizePaddingEdgeHorizontal
|
|
|
}
|
|
|
},
|
|
|
[`&-horizontal${componentCls}-with-text-right${componentCls}-no-default-orientation-margin-right`]: {
|
|
|
'&::before': {
|
|
|
width: '100%'
|
|
|
},
|
|
|
'&::after': {
|
|
|
width: 0
|
|
|
},
|
|
|
[`${componentCls}-inner-text`]: {
|
|
|
paddingInlineEnd: sizePaddingEdgeHorizontal
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var divider_style = ((0,genComponentStyleHook/* default */.Z)('Divider', token => {
|
|
|
const dividerToken = (0,statistic/* merge */.TS)(token, {
|
|
|
dividerHorizontalWithTextGutterMargin: token.margin,
|
|
|
dividerHorizontalGutterMargin: token.marginLG,
|
|
|
sizePaddingEdgeHorizontal: 0
|
|
|
});
|
|
|
return [genSharedDividerStyle(dividerToken)];
|
|
|
}, token => ({
|
|
|
textPaddingInline: '1em',
|
|
|
orientationMargin: 0.05,
|
|
|
verticalMarginInline: token.marginXS
|
|
|
})));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Divider = props => {
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
divider
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
type = 'horizontal',
|
|
|
orientation = 'center',
|
|
|
orientationMargin,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
dashed,
|
|
|
plain,
|
|
|
style
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]);
|
|
|
const prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = divider_style(prefixCls);
|
|
|
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
|
|
|
const hasChildren = !!children;
|
|
|
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
|
|
|
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
|
|
|
const classString = _classnames_2_5_1_classnames_default()(prefixCls, divider === null || divider === void 0 ? void 0 : divider.className, hashId, `${prefixCls}-${type}`, {
|
|
|
[`${prefixCls}-with-text`]: hasChildren,
|
|
|
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
|
|
|
[`${prefixCls}-dashed`]: !!dashed,
|
|
|
[`${prefixCls}-plain`]: !!plain,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft,
|
|
|
[`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight
|
|
|
}, className, rootClassName);
|
|
|
const memoizedOrientationMargin = _react_17_0_2_react.useMemo(() => {
|
|
|
if (typeof orientationMargin === 'number') {
|
|
|
return orientationMargin;
|
|
|
}
|
|
|
if (/^\d+$/.test(orientationMargin)) {
|
|
|
return Number(orientationMargin);
|
|
|
}
|
|
|
return orientationMargin;
|
|
|
}, [orientationMargin]);
|
|
|
const innerStyle = Object.assign(Object.assign({}, hasCustomMarginLeft && {
|
|
|
marginLeft: memoizedOrientationMargin
|
|
|
}), hasCustomMarginRight && {
|
|
|
marginRight: memoizedOrientationMargin
|
|
|
});
|
|
|
// Warning children not work in vertical mode
|
|
|
if (false) {}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
|
className: classString,
|
|
|
style: Object.assign(Object.assign({}, divider === null || divider === void 0 ? void 0 : divider.style), style)
|
|
|
}, restProps, {
|
|
|
role: "separator"
|
|
|
}), children && type !== 'vertical' && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-inner-text`,
|
|
|
style: innerStyle
|
|
|
}, children)));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var divider = (Divider);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 38854:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_dropdown; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
|
|
|
var dropdown = __webpack_require__(91857);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/EllipsisOutlined.js + 1 modules
|
|
|
var EllipsisOutlined = __webpack_require__(37586);
|
|
|
// 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/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules
|
|
|
var space = __webpack_require__(81327);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(47211);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown-button.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DropdownButton = props => {
|
|
|
const {
|
|
|
getPopupContainer: getContextPopupContainer,
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
type = 'default',
|
|
|
danger,
|
|
|
disabled,
|
|
|
loading,
|
|
|
onClick,
|
|
|
htmlType,
|
|
|
children,
|
|
|
className,
|
|
|
menu,
|
|
|
arrow,
|
|
|
autoFocus,
|
|
|
overlay,
|
|
|
trigger,
|
|
|
align,
|
|
|
open,
|
|
|
onOpenChange,
|
|
|
placement,
|
|
|
getPopupContainer,
|
|
|
href,
|
|
|
icon = /*#__PURE__*/_react_17_0_2_react.createElement(EllipsisOutlined/* default */.Z, null),
|
|
|
title,
|
|
|
buttonsRender = buttons => buttons,
|
|
|
mouseEnterDelay,
|
|
|
mouseLeaveDelay,
|
|
|
overlayClassName,
|
|
|
overlayStyle,
|
|
|
destroyPopupOnHide,
|
|
|
dropdownRender
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]);
|
|
|
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
|
|
const buttonPrefixCls = `${prefixCls}-button`;
|
|
|
const [wrapSSR, hashId] = (0,style/* default */.Z)(prefixCls);
|
|
|
const dropdownProps = {
|
|
|
menu,
|
|
|
arrow,
|
|
|
autoFocus,
|
|
|
align,
|
|
|
disabled,
|
|
|
trigger: disabled ? [] : trigger,
|
|
|
onOpenChange,
|
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
|
mouseEnterDelay,
|
|
|
mouseLeaveDelay,
|
|
|
overlayClassName,
|
|
|
overlayStyle,
|
|
|
destroyPopupOnHide,
|
|
|
dropdownRender
|
|
|
};
|
|
|
const {
|
|
|
compactSize,
|
|
|
compactItemClassnames
|
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
|
const classes = _classnames_2_5_1_classnames_default()(buttonPrefixCls, compactItemClassnames, className, hashId);
|
|
|
if ('overlay' in props) {
|
|
|
dropdownProps.overlay = overlay;
|
|
|
}
|
|
|
if ('open' in props) {
|
|
|
dropdownProps.open = open;
|
|
|
}
|
|
|
if ('placement' in props) {
|
|
|
dropdownProps.placement = placement;
|
|
|
} else {
|
|
|
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
|
|
|
}
|
|
|
const leftButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: type,
|
|
|
danger: danger,
|
|
|
disabled: disabled,
|
|
|
loading: loading,
|
|
|
onClick: onClick,
|
|
|
htmlType: htmlType,
|
|
|
href: href,
|
|
|
title: title
|
|
|
}, children);
|
|
|
const rightButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: type,
|
|
|
danger: danger,
|
|
|
icon: icon
|
|
|
});
|
|
|
const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(space/* default */.Z.Compact, Object.assign({
|
|
|
className: classes,
|
|
|
size: compactSize,
|
|
|
block: true
|
|
|
}, restProps), leftButtonToRender, /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({}, dropdownProps), rightButtonToRender)));
|
|
|
};
|
|
|
DropdownButton.__ANT_BUTTON = true;
|
|
|
/* harmony default export */ var dropdown_button = (DropdownButton);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Dropdown = dropdown/* default */.Z;
|
|
|
Dropdown.Button = dropdown_button;
|
|
|
/* harmony default export */ var es_dropdown = (Dropdown);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 81327:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules ***!
|
|
|
\*********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ space; }
|
|
|
});
|
|
|
|
|
|
// UNUSED EXPORTS: SpaceContext
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.2@rc-util/es/Children/toArray.js
|
|
|
var toArray = __webpack_require__(6415);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/context.js
|
|
|
|
|
|
const SpaceContext = /*#__PURE__*/_react_17_0_2_react.createContext({
|
|
|
latestIndex: 0
|
|
|
});
|
|
|
const SpaceContextProvider = SpaceContext.Provider;
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Item.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Item = _ref => {
|
|
|
let {
|
|
|
className,
|
|
|
index,
|
|
|
children,
|
|
|
split,
|
|
|
style
|
|
|
} = _ref;
|
|
|
const {
|
|
|
latestIndex
|
|
|
} = _react_17_0_2_react.useContext(SpaceContext);
|
|
|
if (children === null || children === undefined) {
|
|
|
return null;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: className,
|
|
|
style: style
|
|
|
}, children), index < latestIndex && split && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${className}-split`
|
|
|
}, split));
|
|
|
};
|
|
|
/* harmony default export */ var space_Item = (Item);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/style/index.js + 1 modules
|
|
|
var space_style = __webpack_require__(2856);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/utils.js
|
|
|
function isPresetSize(size) {
|
|
|
return ['small', 'middle', 'large'].includes(size);
|
|
|
}
|
|
|
function isValidGapNumber(size) {
|
|
|
if (!size) {
|
|
|
// The case of size = 0 is deliberately excluded here, because the default value of the gap attribute in CSS is 0, so if the user passes 0 in, we can directly ignore it.
|
|
|
return false;
|
|
|
}
|
|
|
return typeof size === 'number' && !Number.isNaN(size);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Space = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
var _a, _b;
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
space,
|
|
|
direction: directionConfig
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
size = (space === null || space === void 0 ? void 0 : space.size) || 'small',
|
|
|
align,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
direction = 'horizontal',
|
|
|
prefixCls: customizePrefixCls,
|
|
|
split,
|
|
|
style,
|
|
|
wrap = false,
|
|
|
classNames: customClassNames,
|
|
|
styles
|
|
|
} = props,
|
|
|
otherProps = __rest(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]);
|
|
|
const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
|
|
|
const isPresetVerticalSize = isPresetSize(verticalSize);
|
|
|
const isPresetHorizontalSize = isPresetSize(horizontalSize);
|
|
|
const isValidVerticalSize = isValidGapNumber(verticalSize);
|
|
|
const isValidHorizontalSize = isValidGapNumber(horizontalSize);
|
|
|
const childNodes = (0,toArray/* default */.Z)(children, {
|
|
|
keepEmpty: true
|
|
|
});
|
|
|
const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
|
|
|
const prefixCls = getPrefixCls('space', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,space_style/* default */.Z)(prefixCls);
|
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, space === null || space === void 0 ? void 0 : space.className, hashId, `${prefixCls}-${direction}`, {
|
|
|
[`${prefixCls}-rtl`]: directionConfig === 'rtl',
|
|
|
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
|
|
|
[`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
|
|
|
[`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
|
|
|
}, className, rootClassName);
|
|
|
const itemClassName = _classnames_2_5_1_classnames_default()(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.classNames) === null || _b === void 0 ? void 0 : _b.item);
|
|
|
// Calculate latest one
|
|
|
let latestIndex = 0;
|
|
|
const nodes = childNodes.map((child, i) => {
|
|
|
var _a, _b;
|
|
|
if (child !== null && child !== undefined) {
|
|
|
latestIndex = i;
|
|
|
}
|
|
|
const key = child && child.key || `${itemClassName}-${i}`;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(space_Item, {
|
|
|
className: itemClassName,
|
|
|
key: key,
|
|
|
index: i,
|
|
|
split: split,
|
|
|
style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.styles) === null || _b === void 0 ? void 0 : _b.item
|
|
|
}, child);
|
|
|
});
|
|
|
const spaceContext = _react_17_0_2_react.useMemo(() => ({
|
|
|
latestIndex
|
|
|
}), [latestIndex]);
|
|
|
// =========================== Render ===========================
|
|
|
if (childNodes.length === 0) {
|
|
|
return null;
|
|
|
}
|
|
|
const gapStyle = {};
|
|
|
if (wrap) {
|
|
|
gapStyle.flexWrap = 'wrap';
|
|
|
}
|
|
|
if (!isPresetHorizontalSize && isValidHorizontalSize) {
|
|
|
gapStyle.columnGap = horizontalSize;
|
|
|
}
|
|
|
if (!isPresetVerticalSize && isValidVerticalSize) {
|
|
|
gapStyle.rowGap = verticalSize;
|
|
|
}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
|
ref: ref,
|
|
|
className: cls,
|
|
|
style: Object.assign(Object.assign(Object.assign({}, gapStyle), space === null || space === void 0 ? void 0 : space.style), style)
|
|
|
}, otherProps), /*#__PURE__*/_react_17_0_2_react.createElement(SpaceContextProvider, {
|
|
|
value: spaceContext
|
|
|
}, nodes)));
|
|
|
});
|
|
|
if (false) {}
|
|
|
const CompoundedSpace = Space;
|
|
|
CompoundedSpace.Compact = Compact/* default */.ZP;
|
|
|
/* harmony default export */ var space = (CompoundedSpace);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 22631:
|
|
|
/*!********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/tree/index.js + 8 modules ***!
|
|
|
\********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ tree; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/index.js + 7 modules
|
|
|
var es = __webpack_require__(13339);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.0@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(41411);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/FileOutlined.js + 1 modules
|
|
|
var FileOutlined = __webpack_require__(93561);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/FolderOpenOutlined.js + 1 modules
|
|
|
var FolderOpenOutlined = __webpack_require__(6222);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.0@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(36384);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/FolderOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var FolderOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z" } }] }, "name": "folder", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_FolderOutlined = (FolderOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(15436);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/FolderOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FolderOutlined_FolderOutlined = function FolderOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_FolderOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_FolderOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(FolderOutlined_FolderOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/util.js
|
|
|
var util = __webpack_require__(35654);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-tree@5.7.12@rc-tree/es/utils/treeUtil.js
|
|
|
var treeUtil = __webpack_require__(71430);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/HolderOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var HolderOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z" } }] }, "name": "holder", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_HolderOutlined = (HolderOutlined);
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/HolderOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var HolderOutlined_HolderOutlined = function HolderOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_HolderOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_HolderOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(HolderOutlined_HolderOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/motion.js
|
|
|
var _util_motion = __webpack_require__(62892);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/style/index.js
|
|
|
var tree_style = __webpack_require__(20648);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/utils/dropIndicator.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
const offset = 4;
|
|
|
function dropIndicatorRender(props) {
|
|
|
const {
|
|
|
dropPosition,
|
|
|
dropLevelOffset,
|
|
|
prefixCls,
|
|
|
indent,
|
|
|
direction = 'ltr'
|
|
|
} = props;
|
|
|
const startPosition = direction === 'ltr' ? 'left' : 'right';
|
|
|
const endPosition = direction === 'ltr' ? 'right' : 'left';
|
|
|
const style = {
|
|
|
[startPosition]: -dropLevelOffset * indent + offset,
|
|
|
[endPosition]: 0
|
|
|
};
|
|
|
switch (dropPosition) {
|
|
|
case -1:
|
|
|
style.top = -3;
|
|
|
break;
|
|
|
case 1:
|
|
|
style.bottom = -3;
|
|
|
break;
|
|
|
default:
|
|
|
// dropPosition === 0
|
|
|
style.bottom = -3;
|
|
|
style[startPosition] = indent + offset;
|
|
|
break;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: style,
|
|
|
className: `${prefixCls}-drop-indicator`
|
|
|
});
|
|
|
}
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/utils/iconUtil.js + 2 modules
|
|
|
var iconUtil = __webpack_require__(80865);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/Tree.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Tree = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
virtual,
|
|
|
tree
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
showIcon = false,
|
|
|
showLine,
|
|
|
switcherIcon,
|
|
|
blockNode = false,
|
|
|
children,
|
|
|
checkable = false,
|
|
|
selectable = true,
|
|
|
draggable,
|
|
|
motion: customMotion,
|
|
|
style
|
|
|
} = props;
|
|
|
const prefixCls = getPrefixCls('tree', customizePrefixCls);
|
|
|
const rootPrefixCls = getPrefixCls();
|
|
|
const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, (0,_util_motion/* default */.Z)(rootPrefixCls)), {
|
|
|
motionAppear: false
|
|
|
});
|
|
|
const newProps = Object.assign(Object.assign({}, props), {
|
|
|
checkable,
|
|
|
selectable,
|
|
|
showIcon,
|
|
|
motion,
|
|
|
blockNode,
|
|
|
showLine: Boolean(showLine),
|
|
|
dropIndicatorRender: dropIndicatorRender
|
|
|
});
|
|
|
const [wrapSSR, hashId] = (0,tree_style/* default */.ZP)(prefixCls);
|
|
|
const draggableConfig = _react_17_0_2_react.useMemo(() => {
|
|
|
if (!draggable) {
|
|
|
return false;
|
|
|
}
|
|
|
let mergedDraggable = {};
|
|
|
switch (typeof draggable) {
|
|
|
case 'function':
|
|
|
mergedDraggable.nodeDraggable = draggable;
|
|
|
break;
|
|
|
case 'object':
|
|
|
mergedDraggable = Object.assign({}, draggable);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
// Do nothing
|
|
|
}
|
|
|
|
|
|
if (mergedDraggable.icon !== false) {
|
|
|
mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/_react_17_0_2_react.createElement(icons_HolderOutlined, null);
|
|
|
}
|
|
|
return mergedDraggable;
|
|
|
}, [draggable]);
|
|
|
const renderSwitcherIcon = nodeProps => /*#__PURE__*/_react_17_0_2_react.createElement(iconUtil/* default */.Z, {
|
|
|
prefixCls: prefixCls,
|
|
|
switcherIcon: switcherIcon,
|
|
|
treeNodeProps: nodeProps,
|
|
|
showLine: showLine
|
|
|
});
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({
|
|
|
itemHeight: 20,
|
|
|
ref: ref,
|
|
|
virtual: virtual
|
|
|
}, newProps, {
|
|
|
// newProps may contain style so declare style below it
|
|
|
style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),
|
|
|
prefixCls: prefixCls,
|
|
|
className: _classnames_2_5_1_classnames_default()({
|
|
|
[`${prefixCls}-icon-hide`]: !showIcon,
|
|
|
[`${prefixCls}-block-node`]: blockNode,
|
|
|
[`${prefixCls}-unselectable`]: !selectable,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId),
|
|
|
direction: direction,
|
|
|
checkable: checkable ? /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-checkbox-inner`
|
|
|
}) : checkable,
|
|
|
selectable: selectable,
|
|
|
switcherIcon: renderSwitcherIcon,
|
|
|
draggable: draggableConfig
|
|
|
}), children));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var tree_Tree = (Tree);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/utils/dictUtil.js
|
|
|
|
|
|
var Record;
|
|
|
(function (Record) {
|
|
|
Record[Record["None"] = 0] = "None";
|
|
|
Record[Record["Start"] = 1] = "Start";
|
|
|
Record[Record["End"] = 2] = "End";
|
|
|
})(Record || (Record = {}));
|
|
|
function traverseNodesKey(treeData, callback) {
|
|
|
function processNode(dataNode) {
|
|
|
const {
|
|
|
key,
|
|
|
children
|
|
|
} = dataNode;
|
|
|
if (callback(key, dataNode) !== false) {
|
|
|
traverseNodesKey(children || [], callback);
|
|
|
}
|
|
|
}
|
|
|
treeData.forEach(processNode);
|
|
|
}
|
|
|
/** 计算选中范围,只考虑expanded情况以优化性能 */
|
|
|
function calcRangeKeys(_ref) {
|
|
|
let {
|
|
|
treeData,
|
|
|
expandedKeys,
|
|
|
startKey,
|
|
|
endKey
|
|
|
} = _ref;
|
|
|
const keys = [];
|
|
|
let record = Record.None;
|
|
|
if (startKey && startKey === endKey) {
|
|
|
return [startKey];
|
|
|
}
|
|
|
if (!startKey || !endKey) {
|
|
|
return [];
|
|
|
}
|
|
|
function matchKey(key) {
|
|
|
return key === startKey || key === endKey;
|
|
|
}
|
|
|
traverseNodesKey(treeData, key => {
|
|
|
if (record === Record.End) {
|
|
|
return false;
|
|
|
}
|
|
|
if (matchKey(key)) {
|
|
|
// Match test
|
|
|
keys.push(key);
|
|
|
if (record === Record.None) {
|
|
|
record = Record.Start;
|
|
|
} else if (record === Record.Start) {
|
|
|
record = Record.End;
|
|
|
return false;
|
|
|
}
|
|
|
} else if (record === Record.Start) {
|
|
|
// Append selection
|
|
|
keys.push(key);
|
|
|
}
|
|
|
return expandedKeys.includes(key);
|
|
|
});
|
|
|
return keys;
|
|
|
}
|
|
|
function convertDirectoryKeysToNodes(treeData, keys) {
|
|
|
const restKeys = (0,toConsumableArray/* default */.Z)(keys);
|
|
|
const nodes = [];
|
|
|
traverseNodesKey(treeData, (key, node) => {
|
|
|
const index = restKeys.indexOf(key);
|
|
|
if (index !== -1) {
|
|
|
nodes.push(node);
|
|
|
restKeys.splice(index, 1);
|
|
|
}
|
|
|
return !!restKeys.length;
|
|
|
});
|
|
|
return nodes;
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/DirectoryTree.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getIcon(props) {
|
|
|
const {
|
|
|
isLeaf,
|
|
|
expanded
|
|
|
} = props;
|
|
|
if (isLeaf) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(FileOutlined/* default */.Z, null);
|
|
|
}
|
|
|
return expanded ? /*#__PURE__*/_react_17_0_2_react.createElement(FolderOpenOutlined/* default */.Z, null) : /*#__PURE__*/_react_17_0_2_react.createElement(icons_FolderOutlined, null);
|
|
|
}
|
|
|
function getTreeData(_ref) {
|
|
|
let {
|
|
|
treeData,
|
|
|
children
|
|
|
} = _ref;
|
|
|
return treeData || (0,treeUtil/* convertTreeToData */.zn)(children);
|
|
|
}
|
|
|
const DirectoryTree = (_a, ref) => {
|
|
|
var {
|
|
|
defaultExpandAll,
|
|
|
defaultExpandParent,
|
|
|
defaultExpandedKeys
|
|
|
} = _a,
|
|
|
props = __rest(_a, ["defaultExpandAll", "defaultExpandParent", "defaultExpandedKeys"]);
|
|
|
// Shift click usage
|
|
|
const lastSelectedKey = _react_17_0_2_react.useRef();
|
|
|
const cachedSelectedKeys = _react_17_0_2_react.useRef();
|
|
|
const getInitExpandedKeys = () => {
|
|
|
const {
|
|
|
keyEntities
|
|
|
} = (0,treeUtil/* convertDataToEntities */.I8)(getTreeData(props));
|
|
|
let initExpandedKeys;
|
|
|
// Expanded keys
|
|
|
if (defaultExpandAll) {
|
|
|
initExpandedKeys = Object.keys(keyEntities);
|
|
|
} else if (defaultExpandParent) {
|
|
|
initExpandedKeys = (0,util/* conductExpandParent */.r7)(props.expandedKeys || defaultExpandedKeys || [], keyEntities);
|
|
|
} else {
|
|
|
initExpandedKeys = props.expandedKeys || defaultExpandedKeys;
|
|
|
}
|
|
|
return initExpandedKeys;
|
|
|
};
|
|
|
const [selectedKeys, setSelectedKeys] = _react_17_0_2_react.useState(props.selectedKeys || props.defaultSelectedKeys || []);
|
|
|
const [expandedKeys, setExpandedKeys] = _react_17_0_2_react.useState(() => getInitExpandedKeys());
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('selectedKeys' in props) {
|
|
|
setSelectedKeys(props.selectedKeys);
|
|
|
}
|
|
|
}, [props.selectedKeys]);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('expandedKeys' in props) {
|
|
|
setExpandedKeys(props.expandedKeys);
|
|
|
}
|
|
|
}, [props.expandedKeys]);
|
|
|
const onExpand = (keys, info) => {
|
|
|
var _a;
|
|
|
if (!('expandedKeys' in props)) {
|
|
|
setExpandedKeys(keys);
|
|
|
}
|
|
|
// Call origin function
|
|
|
return (_a = props.onExpand) === null || _a === void 0 ? void 0 : _a.call(props, keys, info);
|
|
|
};
|
|
|
const onSelect = (keys, event) => {
|
|
|
var _a;
|
|
|
const {
|
|
|
multiple
|
|
|
} = props;
|
|
|
const {
|
|
|
node,
|
|
|
nativeEvent
|
|
|
} = event;
|
|
|
const {
|
|
|
key = ''
|
|
|
} = node;
|
|
|
const treeData = getTreeData(props);
|
|
|
// const newState: DirectoryTreeState = {};
|
|
|
// We need wrap this event since some value is not same
|
|
|
const newEvent = Object.assign(Object.assign({}, event), {
|
|
|
selected: true
|
|
|
});
|
|
|
// Windows / Mac single pick
|
|
|
const ctrlPick = (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.ctrlKey) || (nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.metaKey);
|
|
|
const shiftPick = nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.shiftKey;
|
|
|
// Generate new selected keys
|
|
|
let newSelectedKeys;
|
|
|
if (multiple && ctrlPick) {
|
|
|
// Control click
|
|
|
newSelectedKeys = keys;
|
|
|
lastSelectedKey.current = key;
|
|
|
cachedSelectedKeys.current = newSelectedKeys;
|
|
|
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
|
|
|
} else if (multiple && shiftPick) {
|
|
|
// Shift click
|
|
|
newSelectedKeys = Array.from(new Set([].concat((0,toConsumableArray/* default */.Z)(cachedSelectedKeys.current || []), (0,toConsumableArray/* default */.Z)(calcRangeKeys({
|
|
|
treeData,
|
|
|
expandedKeys,
|
|
|
startKey: key,
|
|
|
endKey: lastSelectedKey.current
|
|
|
})))));
|
|
|
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
|
|
|
} else {
|
|
|
// Single click
|
|
|
newSelectedKeys = [key];
|
|
|
lastSelectedKey.current = key;
|
|
|
cachedSelectedKeys.current = newSelectedKeys;
|
|
|
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys);
|
|
|
}
|
|
|
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, newSelectedKeys, newEvent);
|
|
|
if (!('selectedKeys' in props)) {
|
|
|
setSelectedKeys(newSelectedKeys);
|
|
|
}
|
|
|
};
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
showIcon = true,
|
|
|
expandAction = 'click'
|
|
|
} = props,
|
|
|
otherProps = __rest(props, ["prefixCls", "className", "showIcon", "expandAction"]);
|
|
|
const prefixCls = getPrefixCls('tree', customizePrefixCls);
|
|
|
const connectClassName = _classnames_2_5_1_classnames_default()(`${prefixCls}-directory`, {
|
|
|
[`${prefixCls}-directory-rtl`]: direction === 'rtl'
|
|
|
}, className);
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(tree_Tree, Object.assign({
|
|
|
icon: getIcon,
|
|
|
ref: ref,
|
|
|
blockNode: true
|
|
|
}, otherProps, {
|
|
|
showIcon: showIcon,
|
|
|
expandAction: expandAction,
|
|
|
prefixCls: prefixCls,
|
|
|
className: connectClassName,
|
|
|
expandedKeys: expandedKeys,
|
|
|
selectedKeys: selectedKeys,
|
|
|
onSelect: onSelect,
|
|
|
onExpand: onExpand
|
|
|
}));
|
|
|
};
|
|
|
const ForwardDirectoryTree = /*#__PURE__*/_react_17_0_2_react.forwardRef(DirectoryTree);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var tree_DirectoryTree = (ForwardDirectoryTree);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const es_tree_Tree = tree_Tree;
|
|
|
es_tree_Tree.DirectoryTree = tree_DirectoryTree;
|
|
|
es_tree_Tree.TreeNode = es/* TreeNode */.O;
|
|
|
/* harmony default export */ var tree = (es_tree_Tree);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 65245:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./node_modules/_rc-util@5.38.2@rc-util/es/Dom/addEventListener.js ***!
|
|
|
\*************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ Z: function() { return /* binding */ addEventListenerWrap; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-dom */ 4676);
|
|
|
|
|
|
function addEventListenerWrap(target, eventType, cb, option) {
|
|
|
/* eslint camelcase: 2 */
|
|
|
var callback = react_dom__WEBPACK_IMPORTED_MODULE_0__.unstable_batchedUpdates ? function run(e) {
|
|
|
react_dom__WEBPACK_IMPORTED_MODULE_0__.unstable_batchedUpdates(cb, e);
|
|
|
} : cb;
|
|
|
if (target !== null && target !== void 0 && target.addEventListener) {
|
|
|
target.addEventListener(eventType, callback, option);
|
|
|
}
|
|
|
return {
|
|
|
remove: function remove() {
|
|
|
if (target !== null && target !== void 0 && target.removeEventListener) {
|
|
|
target.removeEventListener(eventType, callback, option);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 45779:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/_rc-util@5.38.2@rc-util/es/Dom/css.js ***!
|
|
|
\************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ g1: function() { return /* binding */ getClientSize; },
|
|
|
/* harmony export */ os: function() { return /* binding */ getOffset; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony exports get, set, getOuterWidth, getOuterHeight, getDocSize, getScroll */
|
|
|
/* eslint-disable no-nested-ternary */
|
|
|
var PIXEL_PATTERN = /margin|padding|width|height|max|min|offset/;
|
|
|
var removePixel = {
|
|
|
left: true,
|
|
|
top: true
|
|
|
};
|
|
|
var floatMap = {
|
|
|
cssFloat: 1,
|
|
|
styleFloat: 1,
|
|
|
float: 1
|
|
|
};
|
|
|
function getComputedStyle(node) {
|
|
|
return node.nodeType === 1 ? node.ownerDocument.defaultView.getComputedStyle(node, null) : {};
|
|
|
}
|
|
|
function getStyleValue(node, type, value) {
|
|
|
type = type.toLowerCase();
|
|
|
if (value === 'auto') {
|
|
|
if (type === 'height') {
|
|
|
return node.offsetHeight;
|
|
|
}
|
|
|
if (type === 'width') {
|
|
|
return node.offsetWidth;
|
|
|
}
|
|
|
}
|
|
|
if (!(type in removePixel)) {
|
|
|
removePixel[type] = PIXEL_PATTERN.test(type);
|
|
|
}
|
|
|
return removePixel[type] ? parseFloat(value) || 0 : value;
|
|
|
}
|
|
|
function get(node, name) {
|
|
|
var length = arguments.length;
|
|
|
var style = getComputedStyle(node);
|
|
|
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
|
|
|
return length === 1 ? style : getStyleValue(node, name, style[name] || node.style[name]);
|
|
|
}
|
|
|
function set(node, name, value) {
|
|
|
var length = arguments.length;
|
|
|
name = floatMap[name] ? 'cssFloat' in node.style ? 'cssFloat' : 'styleFloat' : name;
|
|
|
if (length === 3) {
|
|
|
if (typeof value === 'number' && PIXEL_PATTERN.test(name)) {
|
|
|
value = "".concat(value, "px");
|
|
|
}
|
|
|
node.style[name] = value; // Number
|
|
|
return value;
|
|
|
}
|
|
|
for (var x in name) {
|
|
|
if (name.hasOwnProperty(x)) {
|
|
|
set(node, x, name[x]);
|
|
|
}
|
|
|
}
|
|
|
return getComputedStyle(node);
|
|
|
}
|
|
|
function getOuterWidth(el) {
|
|
|
if (el === document.body) {
|
|
|
return document.documentElement.clientWidth;
|
|
|
}
|
|
|
return el.offsetWidth;
|
|
|
}
|
|
|
function getOuterHeight(el) {
|
|
|
if (el === document.body) {
|
|
|
return window.innerHeight || document.documentElement.clientHeight;
|
|
|
}
|
|
|
return el.offsetHeight;
|
|
|
}
|
|
|
function getDocSize() {
|
|
|
var width = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
|
|
|
var height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
|
|
|
return {
|
|
|
width: width,
|
|
|
height: height
|
|
|
};
|
|
|
}
|
|
|
function getClientSize() {
|
|
|
var width = document.documentElement.clientWidth;
|
|
|
var height = window.innerHeight || document.documentElement.clientHeight;
|
|
|
return {
|
|
|
width: width,
|
|
|
height: height
|
|
|
};
|
|
|
}
|
|
|
function getScroll() {
|
|
|
return {
|
|
|
scrollLeft: Math.max(document.documentElement.scrollLeft, document.body.scrollLeft),
|
|
|
scrollTop: Math.max(document.documentElement.scrollTop, document.body.scrollTop)
|
|
|
};
|
|
|
}
|
|
|
function getOffset(node) {
|
|
|
var box = node.getBoundingClientRect();
|
|
|
var docElem = document.documentElement;
|
|
|
|
|
|
// < ie8 不支持 win.pageXOffset, 则使用 docElem.scrollLeft
|
|
|
return {
|
|
|
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
|
|
|
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
|
|
|
};
|
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |