|
|
|
|
@ -1023,8 +1023,6 @@ var rate = __webpack_require__(19479);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Experiment/components/ShixunItem/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var ShixunItemmodules = ({"itemWrapper":"itemWrapper___FDtjf","imgWrapper":"imgWrapper___kuAby","infoWrapper":"infoWrapper___kPiaa","name":"name___s6_8x","info":"info___f4ohA","smallText":"smallText___NUbDW","rate":"rate___uCfIz","btnWrapper":"btnWrapper___oEyAe","removeBtn":"removeBtn____Ucrs","textEllipsis":"textEllipsis___dla3G","mr6":"mr6___BYwoU","modalWrapper":"modalWrapper___Xvqvn","okBtn":"okBtn___XoB2t","cancelBtn":"cancelBtn___QjfJN"});
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
|
|
var util = __webpack_require__(85578);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Experiment/components/ShixunItem/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1038,11 +1036,16 @@ var util = __webpack_require__(85578);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ShixunItem = function ShixunItem(_ref) {
|
|
|
|
|
var _shixunsDetail$detail;
|
|
|
|
|
var data = _ref.data,
|
|
|
|
|
refreshData = _ref.refreshData,
|
|
|
|
|
virtualClassroomId = _ref.virtualClassroomId,
|
|
|
|
|
shixunsDetail = _ref.shixunsDetail,
|
|
|
|
|
user = _ref.user,
|
|
|
|
|
dispatch = _ref.dispatch,
|
|
|
|
|
isCreator = _ref.isCreator;
|
|
|
|
|
var _ref2 = data || {},
|
|
|
|
|
name = _ref2.name,
|
|
|
|
|
@ -1057,6 +1060,10 @@ var ShixunItem = function ShixunItem(_ref) {
|
|
|
|
|
id = _ref2.id,
|
|
|
|
|
is_self = _ref2.is_self,
|
|
|
|
|
virtual_classroom_shixun_id = _ref2.virtual_classroom_shixun_id;
|
|
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
flag = _useState2[0],
|
|
|
|
|
setFlag = _useState2[1];
|
|
|
|
|
var handleDelete = /*#__PURE__*/function () {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
@ -1117,8 +1124,161 @@ var ShixunItem = function ShixunItem(_ref) {
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleStart = function handleStart() {
|
|
|
|
|
(0,util/* openNewWindow */.xg)("/shixuns/".concat(identifier, "/challenges"));
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (flag) {
|
|
|
|
|
setFlag(false);
|
|
|
|
|
handleStartGame();
|
|
|
|
|
}
|
|
|
|
|
}, [shixunsDetail === null || shixunsDetail === void 0 || (_shixunsDetail$detail = shixunsDetail.detail) === null || _shixunsDetail$detail === void 0 ? void 0 : _shixunsDetail$detail.id, flag]);
|
|
|
|
|
var handleStart = /*#__PURE__*/function () {
|
|
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
setFlag(true);
|
|
|
|
|
_context3.next = 3;
|
|
|
|
|
return dispatch({
|
|
|
|
|
type: "shixunsDetail/getShixunsDetail",
|
|
|
|
|
payload: {
|
|
|
|
|
id: identifier
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 3:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee3);
|
|
|
|
|
}));
|
|
|
|
|
return function handleStart() {
|
|
|
|
|
return _ref4.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleStartGame = function handleStartGame() {
|
|
|
|
|
var _shixunsDetail$detail2, _shixunsDetail$detail3;
|
|
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch, true)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ((_shixunsDetail$detail2 = shixunsDetail.detail) !== null && _shixunsDetail$detail2 !== void 0 && _shixunsDetail$detail2.is_jupyter || (_shixunsDetail$detail3 = shixunsDetail.detail) !== null && _shixunsDetail$detail3 !== void 0 && _shixunsDetail$detail3.is_jupyter_lab) {
|
|
|
|
|
dispatch({
|
|
|
|
|
type: 'shixunsDetail/execJupyter',
|
|
|
|
|
payload: {
|
|
|
|
|
id: identifier
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response) {
|
|
|
|
|
if (response !== null && response !== void 0 && response.identifier) {
|
|
|
|
|
// window.location.href = `/tasks/${response.identifier}/jupyter`;
|
|
|
|
|
window.open("/tasks/".concat(response.identifier, "/jupyter"));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
dispatch({
|
|
|
|
|
type: 'shixunsDetail/execShixun',
|
|
|
|
|
payload: {
|
|
|
|
|
id: identifier
|
|
|
|
|
}
|
|
|
|
|
}).then( /*#__PURE__*/function () {
|
|
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(execRes) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
|
|
_context4.next = 3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// window.location.href = `/tasks/${execRes.game_identifier}`;
|
|
|
|
|
window.open("/tasks/".concat(execRes.game_identifier));
|
|
|
|
|
return _context4.abrupt("return");
|
|
|
|
|
case 3:
|
|
|
|
|
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 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context4.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee4);
|
|
|
|
|
}));
|
|
|
|
|
return function (_x) {
|
|
|
|
|
return _ref5.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 _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
|
|
var res, execRes;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context5.next = 2;
|
|
|
|
|
return (0,shixuns/* resetMyGame */.$Q)({
|
|
|
|
|
url: url
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context5.sent;
|
|
|
|
|
if (res) {
|
|
|
|
|
_context5.next = 5;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context5.abrupt("return");
|
|
|
|
|
case 5:
|
|
|
|
|
message/* default */.ZP.success('重置成功,正在进入实践项目!');
|
|
|
|
|
_context5.next = 8;
|
|
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
|
|
id: res.shixun_identifier
|
|
|
|
|
});
|
|
|
|
|
case 8:
|
|
|
|
|
execRes = _context5.sent;
|
|
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
|
|
_context5.next = 12;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_umi_production_exports.history === null || _umi_production_exports.history === void 0 || _umi_production_exports.history.push("/tasks/".concat(execRes.game_identifier));
|
|
|
|
|
return _context5.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 _context5.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee5);
|
|
|
|
|
}));
|
|
|
|
|
function onOk() {
|
|
|
|
|
return _onOk2.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"]
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
|
|
className: "".concat(ShixunItemmodules.itemWrapper, " mb20"),
|
|
|
|
|
@ -1229,15 +1389,21 @@ var ShixunItem = function ShixunItem(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var components_ShixunItem = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
|
|
var user = _ref4.user;
|
|
|
|
|
/* harmony default export */ var components_ShixunItem = ((0,_umi_production_exports.connect)(function (_ref6) {
|
|
|
|
|
var user = _ref6.user,
|
|
|
|
|
shixunsDetail = _ref6.shixunsDetail,
|
|
|
|
|
dispatch = _ref6.dispatch;
|
|
|
|
|
return {
|
|
|
|
|
user: user
|
|
|
|
|
user: user,
|
|
|
|
|
shixunsDetail: shixunsDetail,
|
|
|
|
|
dispatch: dispatch
|
|
|
|
|
};
|
|
|
|
|
})(ShixunItem));
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Experiment/components/SubjectItem/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var SubjectItemmodules = ({"itemWrapper":"itemWrapper___ngbXA","imgWrapper":"imgWrapper___AT5j9","infoWrapper":"infoWrapper___xhMza","name":"name___C2Snj","info":"info___roajb","smallText":"smallText___oUD1O","rate":"rate___FSIj9","btnWrapper":"btnWrapper___d_crD","removeBtn":"removeBtn___ur6lt","textEllipsis":"textEllipsis___BHIv1","mr6":"mr6___yqxpX","modalWrapper":"modalWrapper___kXUHq","okBtn":"okBtn___FmLSD","cancelBtn":"cancelBtn___MZ1Al"});
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
|
|
var util = __webpack_require__(85578);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/virtualSpaces/Lists/Experiment/components/SubjectItem/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|