You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Detail__Setting...

4157 lines
195 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self["webpackChunk"] = self["webpackChunk"] || []).push([[16845],{
/***/ 11475:
/*!******************************************************************************************!*\
!*** ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
\******************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ icons_ExclamationCircleOutlined; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(87462);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
// This icon file is generated automatically.
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
var AntdIcon = __webpack_require__(74643);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_ExclamationCircleOutlined
}));
};
if (false) {}
/* harmony default export */ var icons_ExclamationCircleOutlined = (/*#__PURE__*/react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined));
/***/ }),
/***/ 18073:
/*!******************************************************************************!*\
!*** ./node_modules/@ant-design/icons/es/icons/RightOutlined.js + 1 modules ***!
\******************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ icons_RightOutlined; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(87462);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/RightOutlined.js
// This icon file is generated automatically.
var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
/* harmony default export */ var asn_RightOutlined = (RightOutlined);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
var AntdIcon = __webpack_require__(74643);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/RightOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var RightOutlined_RightOutlined = function RightOutlined(props, ref) {
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_RightOutlined
}));
};
if (false) {}
/* harmony default export */ var icons_RightOutlined = (/*#__PURE__*/react.forwardRef(RightOutlined_RightOutlined));
/***/ }),
/***/ 36845:
/*!**********************************************************!*\
!*** ./src/components/FixedButton/index.tsx + 1 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"t": function() { return /* binding */ FixedButton; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(42122);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
var es_button = __webpack_require__(71577);
;// CONCATENATED MODULE: ./src/components/FixedButton/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var FixedButtonmodules = ({"buttonFixed":"buttonFixed___vyq30","button":"button___hxmYv","buttonWrap":"buttonWrap___uK8dl"});
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(94184);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/components/FixedButton/index.tsx
var FixedButton = function FixedButton(_ref) {
var _ref$cancelText = _ref.cancelText,
cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
_ref$okText = _ref.okText,
okText = _ref$okText === void 0 ? '确定' : _ref$okText,
_ref$loading = _ref.loading,
loading = _ref$loading === void 0 ? false : _ref$loading,
_ref$hasOkBtn = _ref.hasOkBtn,
hasOkBtn = _ref$hasOkBtn === void 0 ? true : _ref$hasOkBtn,
_ref$hasCancelBtn = _ref.hasCancelBtn,
hasCancelBtn = _ref$hasCancelBtn === void 0 ? true : _ref$hasCancelBtn,
_ref$okButtonProps = _ref.okButtonProps,
okButtonProps = _ref$okButtonProps === void 0 ? {} : _ref$okButtonProps,
_ref$onCancel = _ref.onCancel,
onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel,
_ref$onOk = _ref.onOk,
onOk = _ref$onOk === void 0 ? function () {} : _ref$onOk,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className;
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: classnames_default()(FixedButtonmodules.buttonFixed, className),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FixedButtonmodules.buttonWrap,
children: [hasCancelBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
size: "middle",
className: "".concat(FixedButtonmodules.button, " mr20")
// 点击取消的返回
,
onClick: onCancel,
children: cancelText
}), hasOkBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, objectSpread2_default()(objectSpread2_default()({
size: 'middle',
type: "primary",
className: "".concat(FixedButtonmodules.button, " mr20"),
loading: loading,
onClick: onOk
}, okButtonProps), {}, {
children: okText
}))]
})
});
};
/***/ }),
/***/ 90418:
/*!******************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Settings/index.tsx + 13 modules ***!
\******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Detail_Settings; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(17061);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(17156);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(27424);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(70215);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(88275);
// EXTERNAL MODULE: ./node_modules/antd/es/tabs/index.js + 28 modules
var tabs = __webpack_require__(34755);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 39 modules
var modal = __webpack_require__(72423);
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 4 modules
var message = __webpack_require__(2453);
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
var es_button = __webpack_require__(71577);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Settingsmodules = ({"bg":"bg___NaJC8","modal":"modal___EBf9Q","colorOrange":"colorOrange___aQkdN","colorYellow":"colorYellow___o2XYr"});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(38416);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(42122);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
var monaco_editor = __webpack_require__(8691);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
var markdown_editor = __webpack_require__(55373);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
var ExclamationCircleOutlined = __webpack_require__(11475);
// EXTERNAL MODULE: ./node_modules/antd/es/select/index.js + 42 modules
var es_select = __webpack_require__(79035);
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
var es_form = __webpack_require__(25159);
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
var input = __webpack_require__(79531);
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 3 modules
var es_checkbox = __webpack_require__(84567);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(83062);
// EXTERNAL MODULE: ./node_modules/antd/es/popover/index.js
var popover = __webpack_require__(55241);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/BasicInfo/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var BasicInfomodules = ({"flexRow":"flexRow___XAy1P","flexJustifyCenter":"flexJustifyCenter___tAIMl","flexAlignEnd":"flexAlignEnd___MwOtC","flexAlignCenter":"flexAlignCenter___apJWj","flexColumn":"flexColumn___dMOlW","formWrap":"formWrap___uztcf","titleWrap":"titleWrap___IROk8","fieldWrap":"fieldWrap___gnBO5","button":"button___CNhb1","buttonFixed":"buttonFixed___cTnv0","buttonWrap":"buttonWrap___FmswV","width180":"width180___7EIyX","width100":"width100___O9U5Z","width280":"width280___AilXa","difficultyHint":"difficultyHint___pTB_4","color888":"color888____r280","color0152d9":"color0152d9___r6Hxx","serviceSettingWrap":"serviceSettingWrap___bPOCq","serviceSettingName":"serviceSettingName___bVegk","serviceSetLeft":"serviceSetLeft___AljUO","serviceSetInput":"serviceSetInput___LqfwO","serviceSetMemoryInput":"serviceSetMemoryInput___O_kjF","serviceSetTip":"serviceSetTip___rIsFz","installPackage":"installPackage___vpdVI","popover":"popover___LAz3_"});
// EXTERNAL MODULE: ./src/pages/Shixuns/New/components/ApplyModal/index.tsx + 1 modules
var ApplyModal = __webpack_require__(57944);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/UseCustomScriptModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var UseCustomScriptModalmodules = ({"footerWrap":"footerWrap___cjdMK"});
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/UseCustomScriptModal/index.tsx
var _excluded = ["shixunsDetail", "globalSetting", "loading", "dispatch", "onFinish"];
var TextArea = input/* default.TextArea */.Z.TextArea;
var UseCustomScriptModal = function UseCustomScriptModal(_ref) {
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
_ref$onFinish = _ref.onFinish,
onFinish = _ref$onFinish === void 0 ? function () {} : _ref$onFinish,
props = objectWithoutProperties_default()(_ref, _excluded);
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var handleFinish = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
var _shixunsDetail$action;
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunsDetail/getCustomScript',
payload: {
id: (_shixunsDetail$action = shixunsDetail.actionTabs.params) === null || _shixunsDetail$action === void 0 ? void 0 : _shixunsDetail$action.id,
compile: values.execute,
excutive: values.compile
}
});
case 2:
res = _context.sent;
handleCancel();
if (res) {
onFinish(res === null || res === void 0 ? void 0 : res.shixun_script);
}
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleFinish(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleCancel = function handleCancel() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {}
});
};
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
title: "\u81EA\u5B9A\u4E49\u6A21\u677F",
open: shixunsDetail.actionTabs.key === 'Settings-UseCustomScript',
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
footer: null,
onCancel: handleCancel,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
scrollToFirstError: true,
layout: "vertical",
onFinish: handleFinish,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "execute",
label: "\u6267\u884C\u547D\u4EE4\uFF1A",
rules: [{
required: true,
message: '执行命令不能为空'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "compile",
label: "\u7F16\u8BD1\u547D\u4EE4\uFF1A",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: UseCustomScriptModalmodules.footerWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default.Item */.Z.Item, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "mr5",
size: 'middle',
onClick: handleCancel,
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
size: 'middle',
type: "primary",
htmlType: "submit",
loading: loading.effects['shixunsDetail/getCustomScript'],
children: "\u4FDD\u5B58"
})]
})
})]
})
});
};
/* harmony default export */ var components_UseCustomScriptModal = ((0,_umi_production_exports.connect)(function (_ref3) {
var shixunsDetail = _ref3.shixunsDetail,
loading = _ref3.loading,
globalSetting = _ref3.globalSetting;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
loading: loading
};
})(UseCustomScriptModal));
// EXTERNAL MODULE: ./src/components/FixedButton/index.tsx + 1 modules
var FixedButton = __webpack_require__(36845);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(12768);
// EXTERNAL MODULE: ./src/pages/Shixuns/New/components/DesModal/index.tsx + 1 modules
var DesModal = __webpack_require__(6220);
// EXTERNAL MODULE: ./src/pages/Shixuns/New/components/CreateEnvironment/index.tsx
var CreateEnvironment = __webpack_require__(88654);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(29427);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/BasicInfo/index.tsx
var BasicInfo_excluded = ["shixunsDetail", "globalSetting", "loading", "user", "dispatch"];
var Option = es_select/* default.Option */.Z.Option;
var BasicInfo = function BasicInfo(_ref) {
var _user$userInfo, _user$userInfo$shixun, _formValue$name, _shixunsDetail$settin6, _shixunsDetail$settin7, _shixunsDetail$settin8, _shixunsDetail$settin9, _shixunsDetail$settin10, _shixunsDetail$settin11, _shixunsDetail$settin12, _shixunsDetail$settin13, _shixunsDetail$settin14, _shixunsDetail$settin15, _shixunsDetail$settin16, _shixunsDetail$settin17, _shixunsDetail$settin18, _shixunsDetail$settin19, _shixunsDetail$settin20, _shixunsDetail$settin21, _shixunsDetail$settin22, _shixunsDetail$settin23, _shixunsDetail$settin24, _shixunsDetail$settin25, _shixunsDetail$settin26, _shixunsDetail$settin27, _shixunsDetail$detail2, _shixunsDetail$settin28, _shixunsDetail$settin29, _shixunsDetail$detail3, _shixunsDetail$settin30, _shixunsDetail$settin31, _shixunsDetail$detail4;
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, BasicInfo_excluded);
var location = (0,_umi_production_exports.useLocation)();
var shixunId = (0,react.useRef)();
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react.useState)({}),
_useState2 = slicedToArray_default()(_useState, 2),
formValue = _useState2[0],
setFormValue = _useState2[1];
var _useState3 = (0,react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
isPrivate = _useState4[0],
setIsPrivate = _useState4[1];
var _useState5 = (0,react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
evaluateScript = _useState6[0],
setEvaluateScript = _useState6[1];
var _useState7 = (0,react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
serviceConfigList = _useState8[0],
setServiceConfigList = _useState8[1];
var _useState9 = (0,react.useState)({}),
_useState10 = slicedToArray_default()(_useState9, 2),
installPackage = _useState10[0],
setInstallPackage = _useState10[1];
var _useState11 = (0,react.useState)([]),
_useState12 = slicedToArray_default()(_useState11, 2),
standardScriptList = _useState12[0],
setStandardScripts = _useState12[1];
var _useState13 = (0,react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
visible = _useState14[0],
setVisible = _useState14[1];
var editable = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : (_user$userInfo$shixun = _user$userInfo.shixun) === null || _user$userInfo$shixun === void 0 ? void 0 : _user$userInfo$shixun.editable;
(0,react.useEffect)(function () {
var _location$pathname, _location$pathname$sp;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2];
}, []);
(0,react.useEffect)(function () {
if (!shixunsDetail.setting) {
return;
}
var _ref2 = shixunsDetail.setting.shixun || {},
name = _ref2.name,
description = _ref2.description,
trainee = _ref2.trainee,
choice_main_type = _ref2.choice_main_type,
choice_small_type = _ref2.choice_small_type,
choice_standard_scripts = _ref2.choice_standard_scripts,
jupyter_show_description = _ref2.jupyter_show_description;
var value = {
name: name,
description: description,
trainee: trainee,
mainType: choice_main_type,
subType: choice_small_type,
evaluationScript: choice_standard_scripts,
jupyter_show_description: jupyter_show_description
};
handleInitState();
setFormValue(value);
form.setFieldsValue(value);
}, [shixunsDetail.setting]);
var handleInitState = function handleInitState() {
var _ref3 = shixunsDetail.setting.shixun || {},
choice_main_type = _ref3.choice_main_type,
main_type = _ref3.main_type,
small_type = _ref3.small_type,
choice_small_type = _ref3.choice_small_type,
is_secret_repository = _ref3.is_secret_repository,
standard_scripts = _ref3.standard_scripts,
evaluate_script = _ref3.evaluate_script,
shixun_service_configs = _ref3.shixun_service_configs;
setIsPrivate(is_secret_repository);
setEvaluateScript(evaluate_script);
setServiceConfigList(shixun_service_configs);
setStandardScripts(standard_scripts || []);
handleChangeInstallPackage(choice_main_type, choice_small_type);
};
var handleChangeInstallPackage = function handleChangeInstallPackage(mianType) {
var subType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var _ref4 = shixunsDetail.setting.shixun || {},
main_type = _ref4.main_type,
small_type = _ref4.small_type;
var mainInstall = main_type === null || main_type === void 0 ? void 0 : main_type.find(function (item) {
return item.id === mianType;
});
var params = {
mainTypeName: mainInstall === null || mainInstall === void 0 ? void 0 : mainInstall.type_name,
mainTypeDescription: mainInstall === null || mainInstall === void 0 ? void 0 : mainInstall.description,
smallType: []
};
subType.map(function (sub) {
small_type.map(function (item) {
if (sub === item.id && !!item.description) {
params.smallType.push({
name: item.type_name,
des: item.description
});
}
});
});
setInstallPackage(params);
};
var handleApply = function handleApply() {
(0,util/* trackEvent */.L9)(['实践项目', '新建实践项目', '申请新建']);
dispatch({
type: 'newShixuns/setActionTabs',
payload: {
key: 'NewShixuns-Apply'
}
});
};
var handleChangeSeviceConfig = function handleChangeSeviceConfig(value, stateName, key) {
var configList = serviceConfigList.map(function (item, index) {
if (index === key) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, defineProperty_default()({}, stateName, value));
}
return item;
});
setServiceConfigList(configList);
};
var handleValuesChange = function handleValuesChange(changeValues, values) {
setFormValue(objectSpread2_default()({}, values));
if ('mainType' in changeValues) {
handleChangeMainType(changeValues.mainType, values);
handleChangeInstallPackage(values.mainType, values.subType);
}
if ('subType' in changeValues) {
handleChangeSubType(changeValues.subType, values);
handleChangeInstallPackage(values.mainType, values.subType);
}
if ('evaluationScript' in changeValues) {
handleChangeEvaluationScript(changeValues.evaluationScript);
}
};
var handleChangeEvaluationScript = function handleChangeEvaluationScript(evaluationScript) {
modal/* default.confirm */.Z.confirm({
centered: true,
title: '提示',
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font16",
children: ["\u539F\u6709\u811A\u672C\u5C06\u88AB\u65B0\u7684\u811A\u672C\u8986\u76D6\uFF0C\u65E0\u6CD5\u64A4\u9500", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u6267\u884C\u8986\u76D6\u64CD\u4F5C"]
}),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return handleGetScriptContent(evaluationScript);
case 2:
modal/* default.info */.Z.info({
centered: true,
title: '提示',
okText: '知道啦',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc font16",
children: "\u8BC4\u6D4B\u811A\u672C\u751F\u6210\u6210\u529F\uFF01"
})
});
case 3:
case "end":
return _context.stop();
}
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
};
var handleChangeSubType = function handleChangeSubType() {
var subType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var values = arguments.length > 1 ? arguments[1] : undefined;
var configList = [];
// 保留主实验项目
configList.push(serviceConfigList[0]);
subType.map(function (id) {
var _shixunsDetail$settin, _shixunsDetail$settin2, _shixunsDetail$settin3;
var hasConfig = serviceConfigList.find(function (item) {
return item.mirror_repository_id === id;
});
if (hasConfig) {
configList.push(hasConfig);
}
var hasType = (_shixunsDetail$settin = shixunsDetail.setting) === null || _shixunsDetail$settin === void 0 ? void 0 : (_shixunsDetail$settin2 = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin2 === void 0 ? void 0 : (_shixunsDetail$settin3 = _shixunsDetail$settin2.small_type) === null || _shixunsDetail$settin3 === void 0 ? void 0 : _shixunsDetail$settin3.find(function (item) {
return item.id === id;
});
if (!hasConfig && hasType) {
configList.push({
mirror_repository_id: id,
name: hasType.type_name,
cpu_limit: 1,
lower_cpu_limit: 0.1,
memory_limit: 1024,
request_limit: 10
});
}
});
setServiceConfigList(configList);
};
var handleChangeMainType = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(mainType, values) {
var _shixunsDetail$settin4, _shixunsDetail$settin5, _res$;
var hasMainType, res, id;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
hasMainType = (_shixunsDetail$settin4 = shixunsDetail.setting) === null || _shixunsDetail$settin4 === void 0 ? void 0 : (_shixunsDetail$settin5 = _shixunsDetail$settin4.shixun) === null || _shixunsDetail$settin5 === void 0 ? void 0 : _shixunsDetail$settin5.main_type.find(function (item) {
return item.id === mainType;
});
if (hasMainType) {
serviceConfigList[0] = {
mirror_repository_id: mainType,
name: hasMainType.type_name,
cpu_limit: 1,
lower_cpu_limit: 0.1,
memory_limit: 1024,
request_limit: 10
};
setServiceConfigList(serviceConfigList);
}
_context2.next = 4;
return dispatch({
type: 'shixunsDetail/getMirrorScript',
payload: {
mirror_id: mainType
}
});
case 4:
res = _context2.sent;
setStandardScripts(res || []);
id = (_res$ = res[0]) === null || _res$ === void 0 ? void 0 : _res$.id;
form.setFieldsValue({
evaluationScript: id
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, values), {
evaluationScript: id
}));
handleGetScriptContent(id);
case 10:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleChangeMainType(_x, _x2) {
return _ref5.apply(this, arguments);
};
}();
var handleGetScriptContent = /*#__PURE__*/function () {
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(id) {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return dispatch({
type: 'shixunsDetail/getScriptContent',
payload: {
id: shixunId.current,
script_id: id || form.getFieldValue('evaluationScript')
}
});
case 2:
res = _context3.sent;
if (res) {
setEvaluateScript(res.content);
}
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function handleGetScriptContent(_x3) {
return _ref6.apply(this, arguments);
};
}();
var handleUseCustomScript = function handleUseCustomScript() {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {
key: 'Settings-UseCustomScript',
params: {
id: shixunId.current
}
}
});
};
var handleFinish = /*#__PURE__*/function () {
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(values) {
var _shixunsDetail$detail;
var _ref8, main_type, sub_type, name, trainee, description, evaluationScript, _ref8$jupyter_show_de, jupyter_show_description, is_jupyter, postData, res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_ref8 = values || {}, main_type = _ref8.mainType, sub_type = _ref8.subType, name = _ref8.name, trainee = _ref8.trainee, description = _ref8.description, evaluationScript = _ref8.evaluationScript, _ref8$jupyter_show_de = _ref8.jupyter_show_description, jupyter_show_description = _ref8$jupyter_show_de === void 0 ? false : _ref8$jupyter_show_de;
is_jupyter = (_shixunsDetail$detail = shixunsDetail.detail) === null || _shixunsDetail$detail === void 0 ? void 0 : _shixunsDetail$detail.is_jupyter;
postData = {
id: shixunId.current,
main_type: main_type,
sub_type: sub_type,
is_secret_repository: isPrivate,
shixun: {
name: name,
trainee: trainee,
is_jupyter: is_jupyter,
mirror_script_id: is_jupyter ? null : evaluationScript
},
shixun_info: {
description: description,
evaluate_script: is_jupyter ? null : evaluateScript
},
shixun_service_configs: serviceConfigList.map(function (item) {
return {
mirror_repository_id: item.mirror_repository_id,
cpu_limit: item.cpu_limit,
lower_cpu_limit: item.lower_cpu_limit,
memory_limit: item.memory_limit,
request_limit: item.request_limit,
resource_limit: item.resource_limit
};
})
};
if (is_jupyter) {
postData = objectSpread2_default()(objectSpread2_default()({}, postData), {}, {
shixun: objectSpread2_default()(objectSpread2_default()({}, postData.shixun), {}, {
jupyter_show_description: jupyter_show_description
})
});
}
_context4.next = 6;
return dispatch({
type: 'shixunsDetail/updateSettingBasicInfo',
payload: postData
});
case 6:
res = _context4.sent;
if (res) {
dispatch({
type: 'shixunsDetail/getSettingsData',
payload: {
id: shixunId.current
}
});
dispatch({
type: 'shixunsDetail/getShixunsDetail',
payload: {
id: shixunId.current
}
});
res.shixun_identifier && message/* default.info */.ZP.info('保存成功');
}
case 8:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function handleFinish(_x4) {
return _ref7.apply(this, arguments);
};
}();
var CreateImg = function CreateImg() {
(0,util/* trackEvent */.L9)(['实践项目', '新建实践项目', '在线创建']);
dispatch({
type: 'newShixuns/setActionTabs',
payload: {
key: 'Create-Environment'
}
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: BasicInfomodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
className: BasicInfomodules.formWrap,
scrollToFirstError: true,
layout: "vertical",
onValuesChange: handleValuesChange,
onFinish: handleFinish,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: BasicInfomodules.fieldWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "name",
label: "\u540D\u79F0:",
rules: [{
required: true,
message: '请输入名称'
}, {
max: 60,
message: '请输入名称最大限制60个字符'
}, {
whitespace: true,
message: '请勿输入空格'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",
disabled: !editable,
addonAfter: "".concat(((_formValue$name = formValue.name) === null || _formValue$name === void 0 ? void 0 : _formValue$name.length) || 0, "/60")
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "description",
label: "\u7B80\u4ECB:",
children: editable ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
defaultValue: (_shixunsDetail$settin6 = shixunsDetail.setting) === null || _shixunsDetail$settin6 === void 0 ? void 0 : (_shixunsDetail$settin7 = _shixunsDetail$settin6.shixun) === null || _shixunsDetail$settin7 === void 0 ? void 0 : _shixunsDetail$settin7.description
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: (_shixunsDetail$settin8 = shixunsDetail.setting) === null || _shixunsDetail$settin8 === void 0 ? void 0 : (_shixunsDetail$settin9 = _shixunsDetail$settin8.shixun) === null || _shixunsDetail$settin9 === void 0 ? void 0 : _shixunsDetail$settin9.description
})
}), ((_shixunsDetail$settin10 = shixunsDetail.setting) === null || _shixunsDetail$settin10 === void 0 ? void 0 : _shixunsDetail$settin10.shixun.is_jupyter) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "jupyter_show_description",
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
children: "\u663E\u793A\u4EFB\u52A1\u8981\u6C42\uFF08\u52FE\u9009\u540E\uFF0C\u5C06\u7B80\u4ECB\u4F5C\u4E3A\u4EFB\u52A1\u8981\u6C42\u663E\u793A\u5728\u5B9E\u8DF5\u9879\u76EE\u6311\u6218\u9875\u9762\uFF09"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(BasicInfomodules.flexRow, " ").concat(BasicInfomodules.flexAlignCenter),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: ((_shixunsDetail$settin11 = shixunsDetail.setting) === null || _shixunsDetail$settin11 === void 0 ? void 0 : (_shixunsDetail$settin12 = _shixunsDetail$settin11.shixun) === null || _shixunsDetail$settin12 === void 0 ? void 0 : _shixunsDetail$settin12.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
className: BasicInfomodules.width180,
name: "trainee",
label: "\u96BE\u6613\u5EA6:",
rules: [{
required: true,
message: '请选择难易度'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select/* default */.Z, {
placeholder: "\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6",
disabled: ((_shixunsDetail$settin13 = shixunsDetail.setting) === null || _shixunsDetail$settin13 === void 0 ? void 0 : (_shixunsDetail$settin14 = _shixunsDetail$settin13.shixun) === null || _shixunsDetail$settin14 === void 0 ? void 0 : _shixunsDetail$settin14.status) === 2 ? true : !editable,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 1,
children: "\u521D\u7EA7"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 2,
children: "\u4E2D\u7EA7"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 3,
children: "\u4E2D\u9AD8\u7EA7"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 4,
children: "\u9AD8\u7EA7"
})]
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(BasicInfomodules.flexRow, " ").concat(BasicInfomodules.flexAlignEnd),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: ((_shixunsDetail$settin15 = shixunsDetail.setting) === null || _shixunsDetail$settin15 === void 0 ? void 0 : (_shixunsDetail$settin16 = _shixunsDetail$settin15.shixun) === null || _shixunsDetail$settin16 === void 0 ? void 0 : _shixunsDetail$settin16.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
className: BasicInfomodules.width280,
name: "mainType",
label: "\u5B9E\u9A8C\u73AF\u5883:",
rules: [{
required: true,
message: '请选择主类别'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
placeholder: "\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B",
disabled: ((_shixunsDetail$settin17 = shixunsDetail.setting) === null || _shixunsDetail$settin17 === void 0 ? void 0 : (_shixunsDetail$settin18 = _shixunsDetail$settin17.shixun) === null || _shixunsDetail$settin18 === void 0 ? void 0 : _shixunsDetail$settin18.status) === 2 ? true : !editable,
children: (_shixunsDetail$settin19 = shixunsDetail.setting) === null || _shixunsDetail$settin19 === void 0 ? void 0 : (_shixunsDetail$settin20 = _shixunsDetail$settin19.shixun) === null || _shixunsDetail$settin20 === void 0 ? void 0 : (_shixunsDetail$settin21 = _shixunsDetail$settin20.main_type) === null || _shixunsDetail$settin21 === void 0 ? void 0 : _shixunsDetail$settin21.map(function (item) {
var hasJupyter = item.type_name.toLowerCase().includes('jupyter');
if (formValue.isJupyter === '1' && hasJupyter) {
return null;
}
if (formValue.isJupyter === '2' && !hasJupyter) {
return null;
}
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: item.id,
name: item.description,
children: item.type_name
}, item.id);
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: ((_shixunsDetail$settin22 = shixunsDetail.setting) === null || _shixunsDetail$settin22 === void 0 ? void 0 : (_shixunsDetail$settin23 = _shixunsDetail$settin22.shixun) === null || _shixunsDetail$settin23 === void 0 ? void 0 : _shixunsDetail$settin23.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "subType",
className: "".concat(BasicInfomodules.width280, " ml20"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
placeholder: "\u8BF7\u9009\u62E9\u5C0F\u7C7B\u522B",
mode: "multiple",
disabled: ((_shixunsDetail$settin24 = shixunsDetail.setting) === null || _shixunsDetail$settin24 === void 0 ? void 0 : (_shixunsDetail$settin25 = _shixunsDetail$settin24.shixun) === null || _shixunsDetail$settin25 === void 0 ? void 0 : _shixunsDetail$settin25.status) === 2 ? true : !editable,
children: (_shixunsDetail$settin26 = shixunsDetail.setting) === null || _shixunsDetail$settin26 === void 0 ? void 0 : (_shixunsDetail$settin27 = _shixunsDetail$settin26.shixun) === null || _shixunsDetail$settin27 === void 0 ? void 0 : _shixunsDetail$settin27.small_type.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: item.id,
name: item.description,
children: item.type_name
}, item.id);
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: BasicInfomodules.installPackage,
onClick: function onClick() {
return setVisible(true);
},
children: "\u73AF\u5883\u4ECB\u7ECD"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(BasicInfomodules.color888, " font14 pb10"),
children: ["\u6CA1\u6709\u5B9E\u9A8C\u73AF\u5883\uFF1F", /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
className: "".concat(BasicInfomodules.color0152d9, " current"),
onClick: handleApply,
children: [' ', "\u7533\u8BF7\u65B0\u5EFA"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
className: "".concat(BasicInfomodules.color0152d9, " current"),
onClick: CreateImg,
children: [' ', "\u5728\u7EBF\u521B\u5EFA"]
})]
}), !((_shixunsDetail$detail2 = shixunsDetail.detail) !== null && _shixunsDetail$detail2 !== void 0 && _shixunsDetail$detail2.is_jupyter) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(BasicInfomodules.flexRow, " ").concat(BasicInfomodules.flexAlignCenter),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
className: BasicInfomodules.width180,
name: "evaluationScript",
label: "\u8BC4\u6D4B\u811A\u672C:",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
placeholder: "\u8BF7\u9009\u62E9\u8BC4\u6D4B\u811A\u672C",
children: (standardScriptList || []).map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: parseInt(item.id),
name: item.scptname,
children: item.scptname
}, index);
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(BasicInfomodules.color0152d9, " font14 current mt10 ml10"),
onClick: handleUseCustomScript,
children: "\u4F7F\u7528\u81EA\u5B9A\u4E49\u811A\u672C"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(popover/* default */.Z, {
overlayClassName: BasicInfomodules.popover,
placement: "bottomLeft",
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "font12",
children: ["\u4F7F\u7528\u81EA\u5B9A\u4E49\u6A21\u677F\uFF0C\u5E73\u53F0\u65E0\u6CD5\u81EA\u52A8\u66F4\u65B0\u811A\u672C\uFF0C\u8BF7\u5728\u5173\u5361\u521B\u5EFA\u5B8C\u540E\u624B\u52A8\u66F4\u65B0\u811A\u672C\u4E2D\u7684\u5FC5\u586B\u53C2", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u6570\u548C\u4EE5\u4E0B2\u4E2A\u6570\u7EC4\u5143\u7D20\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "challengeProgramNames", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "sourceClassNames", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u793A\u4F8B\uFF1A\u67092\u4E2A\u5173\u5361\u7684\u5B9E\u8BAD", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5404\u5173\u5361\u7684\u5F85\u7F16\u8BD1\u6587\u4EF6\u4E3A\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "src/step1/HelloWorld.java", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "src/step2/Other.java", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5404\u5173\u5361\u7684\u7F16\u8BD1\u540E\u751F\u6210\u7684\u6267\u884C\u6587\u4EF6\u4E3A\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "step1.HelloWorld", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "step2.Other", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5219\u6570\u7EC4\u5143\u7D20\u66F4\u65B0\u5982\u4E0B\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "ff challengeProgramNames=(\"src/step1/", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "HelloWorld.java\" \"src/step2/Other.java\")", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "sourceClassNames=(\"step1.HelloWorld", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\" \"step2.Other\")", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5176\u5B83\u53C2\u6570\u53EF\u6309\u5B9E\u9645\u9700\u6C42\u5B9A\u5236"]
}),
trigger: "click",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "mt10 ml10 current font14",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
width: 1150,
height: 450,
style: {
border: '1px solid #ccc',
background: '#f5f5f5'
},
language: "shell",
theme: "vs-light",
value: evaluateScript,
options: {
readOnly: ((_shixunsDetail$settin28 = shixunsDetail.setting) === null || _shixunsDetail$settin28 === void 0 ? void 0 : (_shixunsDetail$settin29 = _shixunsDetail$settin28.shixun) === null || _shixunsDetail$settin29 === void 0 ? void 0 : _shixunsDetail$settin29.status) === 2 ? true : !editable
},
onChange: function onChange(value) {
return setEvaluateScript(value);
}
})]
}), !((_shixunsDetail$detail3 = shixunsDetail.detail) !== null && _shixunsDetail$detail3 !== void 0 && _shixunsDetail$detail3.is_jupyter) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "font14 mt20",
children: ["\u79C1\u5BC6\u7248\u672C\u5E93\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isPrivate,
onChange: function onChange(e) {
return setIsPrivate(e.target.checked);
},
disabled: ((_shixunsDetail$settin30 = shixunsDetail.setting) === null || _shixunsDetail$settin30 === void 0 ? void 0 : (_shixunsDetail$settin31 = _shixunsDetail$settin30.shixun) === null || _shixunsDetail$settin31 === void 0 ? void 0 : _shixunsDetail$settin31.status) === 2 ? true : !editable,
children: isPrivate ? '已创建的私密版本库及其内容,将在“保存”时被删除' : '(若需要对学员隐藏部分版本库内容时,请选中;选中保存后表示启用私密版本库,请将需要对学员隐藏的文件存储在私密版本库)'
})]
}), ((_shixunsDetail$detail4 = shixunsDetail.detail) === null || _shixunsDetail$detail4 === void 0 ? void 0 : _shixunsDetail$detail4.identity) < 3 && editable && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: BasicInfomodules.serviceSettingWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: BasicInfomodules.serviceSettingName,
children: "\u670D\u52A1\u914D\u7F6E"
}), serviceConfigList.map(function (item, index) {
var _shixunsDetail$settin32, _shixunsDetail$settin33, _shixunsDetail$settin34, _shixunsDetail$settin35, _shixunsDetail$settin36, _shixunsDetail$settin37, _shixunsDetail$settin38, _shixunsDetail$settin39, _shixunsDetail$settin40, _shixunsDetail$settin41, _shixunsDetail$settin42, _shixunsDetail$settin43, _shixunsDetail$settin44, _shixunsDetail$settin45, _shixunsDetail$settin46, _shixunsDetail$settin47;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16",
children: item.name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: ((_shixunsDetail$settin32 = shixunsDetail.setting) === null || _shixunsDetail$settin32 === void 0 ? void 0 : (_shixunsDetail$settin33 = _shixunsDetail$settin32.shixun) === null || _shixunsDetail$settin33 === void 0 ? void 0 : _shixunsDetail$settin33.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb5",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: BasicInfomodules.serviceSetLeft,
children: "CPU(\u6838)\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
className: BasicInfomodules.serviceSetInput,
value: item.cpu_limit,
disabled: ((_shixunsDetail$settin34 = shixunsDetail.setting) === null || _shixunsDetail$settin34 === void 0 ? void 0 : (_shixunsDetail$settin35 = _shixunsDetail$settin34.shixun) === null || _shixunsDetail$settin35 === void 0 ? void 0 : _shixunsDetail$settin35.status) === 2 ? true : !editable,
onChange: function onChange(e) {
return handleChangeSeviceConfig(e.target.value, 'cpu_limit', index);
}
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: ((_shixunsDetail$settin36 = shixunsDetail.setting) === null || _shixunsDetail$settin36 === void 0 ? void 0 : (_shixunsDetail$settin37 = _shixunsDetail$settin36.shixun) === null || _shixunsDetail$settin37 === void 0 ? void 0 : _shixunsDetail$settin37.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb5",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: BasicInfomodules.serviceSetLeft,
children: "\u6700\u4F4ECPU(\u6838)\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
className: BasicInfomodules.serviceSetInput,
value: item.lower_cpu_limit,
disabled: ((_shixunsDetail$settin38 = shixunsDetail.setting) === null || _shixunsDetail$settin38 === void 0 ? void 0 : (_shixunsDetail$settin39 = _shixunsDetail$settin38.shixun) === null || _shixunsDetail$settin39 === void 0 ? void 0 : _shixunsDetail$settin39.status) === 2 ? true : !editable,
onChange: function onChange(e) {
return handleChangeSeviceConfig(e.target.value, 'lower_cpu_limit', index);
}
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: ((_shixunsDetail$settin40 = shixunsDetail.setting) === null || _shixunsDetail$settin40 === void 0 ? void 0 : (_shixunsDetail$settin41 = _shixunsDetail$settin40.shixun) === null || _shixunsDetail$settin41 === void 0 ? void 0 : _shixunsDetail$settin41.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb5",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: BasicInfomodules.serviceSetLeft,
children: "\u5185\u5B58\u9650\u5236(M)\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
className: BasicInfomodules.serviceSetInput,
value: item.memory_limit,
disabled: ((_shixunsDetail$settin42 = shixunsDetail.setting) === null || _shixunsDetail$settin42 === void 0 ? void 0 : (_shixunsDetail$settin43 = _shixunsDetail$settin42.shixun) === null || _shixunsDetail$settin43 === void 0 ? void 0 : _shixunsDetail$settin43.status) === 2 ? true : !editable,
onChange: function onChange(e) {
return handleChangeSeviceConfig(e.target.value, 'memory_limit', index);
}
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: ((_shixunsDetail$settin44 = shixunsDetail.setting) === null || _shixunsDetail$settin44 === void 0 ? void 0 : (_shixunsDetail$settin45 = _shixunsDetail$settin44.shixun) === null || _shixunsDetail$settin45 === void 0 ? void 0 : _shixunsDetail$settin45.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb5",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: BasicInfomodules.serviceSetLeft,
children: "\u5185\u5B58\u8981\u6C42(M)\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
className: BasicInfomodules.serviceSetMemoryInput,
value: item.request_limit,
disabled: ((_shixunsDetail$settin46 = shixunsDetail.setting) === null || _shixunsDetail$settin46 === void 0 ? void 0 : (_shixunsDetail$settin47 = _shixunsDetail$settin46.shixun) === null || _shixunsDetail$settin47 === void 0 ? void 0 : _shixunsDetail$settin47.status) === 2 ? true : !editable,
onChange: function onChange(e) {
return handleChangeSeviceConfig(e.target.value, 'request_limit', index);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: "".concat(BasicInfomodules.serviceSetTip, " ml5"),
children: "\u6E29\u99A8\u63D0\u793A\uFF1A\u7EAF\u7F16\u7A0B\u7C7B\u578B\u5B9E\u8BAD\u5EFA\u8BAE\u4F7F\u7528\u9ED8\u8BA4\u503C\uFF0C\u5BF9\u4E8E\u5927\u6570\u636E\u7B49\u5EFA\u8BAE\u4F7F\u7528\u6700\u5927\u5185\u5B58\u768430%"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: BasicInfomodules.serviceBox,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: BasicInfomodules.serviceSetLeft,
children: "\u78C1\u76D8\u9650\u5236(K)\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
className: BasicInfomodules.serviceSetInput,
value: item.resource_limit,
style: {
width: 300
},
maxLength: 8,
onChange: function onChange(e) {
var value = e.target.value;
var reg = /^\d*(\.\d*)?$/;
if (value.match(reg)) {
handleChangeSeviceConfig(e.target.value, 'resource_limit', index);
}
}
})]
})]
}, index);
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
okText: "\u4FDD\u5B58",
hasOkBtn: editable,
loading: loading.effects['shixunsDetail/updateSettingBasicInfo'],
onCancel: function onCancel() {
return _umi_production_exports.history.push("/shixuns/".concat(shixunId.current, "/challenges"));
},
okButtonProps: {
htmlType: 'submit'
}
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ApplyModal/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(DesModal/* default */.Z, {
installPackage: installPackage,
visible: visible,
setVisible: setVisible
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_UseCustomScriptModal, {
onFinish: function onFinish(value) {
return setEvaluateScript(value);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CreateEnvironment/* default */.Z, {})]
});
};
/* harmony default export */ var components_BasicInfo = ((0,_umi_production_exports.connect)(function (_ref9) {
var shixunsDetail = _ref9.shixunsDetail,
loading = _ref9.loading,
globalSetting = _ref9.globalSetting,
user = _ref9.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user,
loading: loading
};
})(BasicInfo));
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(861);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(78045);
// EXTERNAL MODULE: ./node_modules/antd/es/auto-complete/index.js
var auto_complete = __webpack_require__(49288);
// EXTERNAL MODULE: ./node_modules/antd/es/badge/index.js + 4 modules
var badge = __webpack_require__(53575);
// EXTERNAL MODULE: ./node_modules/antd/es/date-picker/index.js + 79 modules
var date_picker = __webpack_require__(71628);
// EXTERNAL MODULE: ./node_modules/antd/lib/date-picker/locale/zh_CN.js
var zh_CN = __webpack_require__(5584);
// EXTERNAL MODULE: ./node_modules/@umijs/plugins/node_modules/dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(94699);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/Permission/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Permissionmodules = ({"wrap":"wrap___gE9H7","labelWrap":"labelWrap___NjGrw","label":"label___NnvKx","labelContent":"labelContent___jIOR4","flexRow":"flexRow___aKUuO","color999":"color999___yY6G2","radio":"radio___dA7aF","selectSchool":"selectSchool___WxyG6","dataPicker":"dataPicker___Ocpox"});
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/Permission/index.tsx
var Permission_excluded = ["shixunsDetail", "globalSetting", "loading", "user", "dispatch"];
var handleDateString = function handleDateString(dateString) {
if (!dateString) return dateString;
var ar = dateString.split(':');
if (ar[1] == '00' || ar[1] == '30') {
return dateString;
}
var miniute = parseInt(ar[1]);
if (miniute < 30 || miniute == 60) {
return [ar[0], '30'].join(':');
}
if (miniute < 60) {
// 加一个小时
var tempStr = [ar[0], '00'].join(':');
var format = "YYYY-MM-DD HH:mm";
var _moment = dayjs_min_default()(tempStr, format);
_moment.add(1, 'hours');
return _moment.format(format);
}
return dateString;
};
var timeFormat = "YYYY-MM-DD HH:mm";
var Permission = function Permission(_ref) {
var _user$userInfo, _user$userInfo$shixun, _shixunsDetail$detail, _shixunsDetail$detail2, _shixunsDetail$settin11, _shixunsDetail$settin12, _shixunsDetail$detail3;
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, Permission_excluded);
var shixunId = (0,react.useRef)();
var _useState = (0,react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
isCopy = _useState2[0],
setIsCopy = _useState2[1];
var _useState3 = (0,react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
openValue = _useState4[0],
setOpenValue = _useState4[1];
var _useState5 = (0,react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
selectDepartmentList = _useState6[0],
setSelectDepartmentList = _useState6[1];
var _useState7 = (0,react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
departmentList = _useState8[0],
setDepartmentList = _useState8[1];
var _useState9 = (0,react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
departmentValue = _useState10[0],
setDepartmentValue = _useState10[1];
var _useState11 = (0,react.useState)(),
_useState12 = slicedToArray_default()(_useState11, 2),
isOpenTime = _useState12[0],
setIsOpenTime = _useState12[1];
var _useState13 = (0,react.useState)(),
_useState14 = slicedToArray_default()(_useState13, 2),
openTime = _useState14[0],
setOpenTime = _useState14[1];
var editable = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : (_user$userInfo$shixun = _user$userInfo.shixun) === null || _user$userInfo$shixun === void 0 ? void 0 : _user$userInfo$shixun.editable;
(0,react.useEffect)(function () {
var _location$pathname, _location$pathname$sp;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2];
handleGetDepartments();
}, []);
(0,react.useEffect)(function () {
var _shixunsDetail$settin, _shixunsDetail$settin2, _shixunsDetail$settin3, _shixunsDetail$settin4, _shixunsDetail$settin5, _shixunsDetail$settin6, _shixunsDetail$settin7, _shixunsDetail$settin8, _shixunsDetail$settin9, _shixunsDetail$settin10;
if (!shixunsDetail.setting) {
return;
}
setIsCopy((_shixunsDetail$settin = shixunsDetail.setting) === null || _shixunsDetail$settin === void 0 ? void 0 : (_shixunsDetail$settin2 = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin2 === void 0 ? void 0 : _shixunsDetail$settin2.can_copy);
setOpenValue((_shixunsDetail$settin3 = shixunsDetail.setting) === null || _shixunsDetail$settin3 === void 0 ? void 0 : (_shixunsDetail$settin4 = _shixunsDetail$settin3.shixun) === null || _shixunsDetail$settin4 === void 0 ? void 0 : _shixunsDetail$settin4.use_scope);
setIsOpenTime(!!((_shixunsDetail$settin5 = shixunsDetail.setting) !== null && _shixunsDetail$settin5 !== void 0 && (_shixunsDetail$settin6 = _shixunsDetail$settin5.shixun) !== null && _shixunsDetail$settin6 !== void 0 && _shixunsDetail$settin6.opening_time));
setOpenTime((_shixunsDetail$settin7 = shixunsDetail.setting) === null || _shixunsDetail$settin7 === void 0 ? void 0 : (_shixunsDetail$settin8 = _shixunsDetail$settin7.shixun) === null || _shixunsDetail$settin8 === void 0 ? void 0 : _shixunsDetail$settin8.opening_time);
setSelectDepartmentList((_shixunsDetail$settin9 = shixunsDetail.setting) === null || _shixunsDetail$settin9 === void 0 ? void 0 : (_shixunsDetail$settin10 = _shixunsDetail$settin9.shixun) === null || _shixunsDetail$settin10 === void 0 ? void 0 : _shixunsDetail$settin10.scope_partment);
}, [shixunsDetail.setting]);
var handleGetDepartments = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(value) {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunsDetail/getDepartments',
payload: {
q: value
}
});
case 2:
res = _context.sent;
if (res) {
setDepartmentList(res.shools_name || []);
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleGetDepartments(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleSelectDepartment = function handleSelectDepartment(value) {
if (selectDepartmentList.includes(value)) {
message/* default.info */.ZP.info("请勿指定相同的单位");
return;
}
setDepartmentValue(null);
setSelectDepartmentList([].concat(toConsumableArray_default()(selectDepartmentList), [value]));
};
var handleOk = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!(isOpenTime && !openTime)) {
_context2.next = 3;
break;
}
message/* default.info */.ZP.info('请选择开启时间');
return _context2.abrupt("return");
case 3:
if (!(openValue === 1 && !selectDepartmentList.length)) {
_context2.next = 6;
break;
}
message/* default.info */.ZP.info('请选择指定单位公开');
return _context2.abrupt("return");
case 6:
_context2.next = 8;
return dispatch({
type: 'shixunsDetail/updatePermissionSetting',
payload: {
id: shixunId.current,
scope_partment: openValue === 0 ? null : selectDepartmentList,
shixun: {
can_copy: isCopy,
use_scope: openValue,
opening_time: openTime
}
}
});
case 8:
res = _context2.sent;
if (res.status !== -1) {
message/* default.info */.ZP.info('权限配置保存成功!');
dispatch({
type: 'shixunsDetail/getSettingsData',
payload: {
id: shixunId.current
}
});
dispatch({
type: "shixunsDetail/getShixunsDetail",
payload: {
id: shixunId.current
}
});
}
case 10:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleOk() {
return _ref3.apply(this, arguments);
};
}();
//https://forgeplus.trustie.net/projects/daiao/XWezybAZd/issues/38574/detail 恢复jupyter的复制实训开关
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: Permissionmodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Permissionmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Permissionmodules.label,
children: "\u590D\u5236:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Permissionmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isCopy,
onChange: function onChange(e) {
return setIsCopy(e.target.checked);
},
disabled: !editable
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Permissionmodules.color999),
children: "\uFF08\u9009\u4E2D\u5219\u5141\u8BB8\u5DF2\u804C\u4E1A\u8BA4\u8BC1\u7684\u6559\u5E08\u590D\u5236\u8BE5\u5B9E\u8BAD\uFF09"
})]
})
})]
}), !((((_shixunsDetail$detail = shixunsDetail.detail) === null || _shixunsDetail$detail === void 0 ? void 0 : _shixunsDetail$detail.shixun_status) > 1 || ((_shixunsDetail$detail2 = shixunsDetail.detail) === null || _shixunsDetail$detail2 === void 0 ? void 0 : _shixunsDetail$detail2["public"]) === 2) && ((_shixunsDetail$settin11 = shixunsDetail.setting) === null || _shixunsDetail$settin11 === void 0 ? void 0 : (_shixunsDetail$settin12 = _shixunsDetail$settin11.shixun) === null || _shixunsDetail$settin12 === void 0 ? void 0 : _shixunsDetail$settin12.use_scope) === 0 && ((_shixunsDetail$detail3 = shixunsDetail.detail) === null || _shixunsDetail$detail3 === void 0 ? void 0 : _shixunsDetail$detail3.identity) > 2) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Permissionmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Permissionmodules.label,
children: "\u516C\u5F00\u7A0B\u5EA6:"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Permissionmodules.labelContent,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
value: openValue,
onChange: function onChange(e) {
return setOpenValue(e.target.value);
},
disabled: !editable,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
className: Permissionmodules.radio,
value: 0,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u5BF9\u6240\u6709\u5355\u4F4D\u516C\u5F00"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Permissionmodules.color999,
children: "\uFF08\u5B9E\u8BAD\u53D1\u5E03\u540E\uFF0C\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
className: Permissionmodules.radio,
value: 1,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u5BF9\u6307\u5B9A\u5355\u4F4D\u516C\u5F00"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Permissionmodules.color999,
children: "\uFF08\u5B9E\u8BAD\u53D1\u5E03\u540E\uFF0C\u4EC5\u5BF9\u4E0B\u65B9\u6307\u5B9A\u5355\u4F4D\u7684\u7528\u6237\u53EF\u89C1\uFF09"
})]
})]
}), openValue === 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt10",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(auto_complete/* default */.Z, {
showSearch: true,
className: Permissionmodules.selectSchool,
placeholder: "\u8BF7\u8F93\u5165\u5E76\u9009\u62E9\u5355\u4F4D\u540D\u79F0",
value: departmentValue,
onChange: function onChange(value) {
setDepartmentValue(value);
handleGetDepartments(value);
},
disabled: !editable,
onSelect: handleSelectDepartment,
options: departmentList === null || departmentList === void 0 ? void 0 : departmentList.map(function (item) {
return {
value: item
};
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Permissionmodules.color999,
children: "\uFF08\u5B9E\u8BAD\u53D1\u5E03\u540E\uFF0C\u4EC5\u5BF9\u4E0B\u65B9\u6307\u5B9A\u5355\u4F4D\u7684\u7528\u6237\u53EF\u89C1\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt10",
children: selectDepartmentList === null || selectDepartmentList === void 0 ? void 0 : selectDepartmentList.map(function (item) {
if (editable) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(badge/* default */.Z, {
count: "x",
className: "mr20 current",
onClick: function onClick() {
return setSelectDepartmentList(selectDepartmentList.filter(function (val) {
return val !== item;
}));
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
ghost: true,
children: item
})
});
}
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
ghost: true,
className: "mr20",
children: item
});
})
})]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Permissionmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Permissionmodules.label,
children: "\u5F00\u542F\u65F6\u95F4:"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Permissionmodules.labelContent,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isOpenTime,
onChange: function onChange(e) {
return setIsOpenTime(e.target.checked);
},
disabled: !editable
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Permissionmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u5B66\u5458\u5728\u6307\u5B9A\u7684\u5F00\u542F\u65F6\u95F4\u540E\uFF0C\u624D\u80FD\u5F00\u542F\u5B66\u4E60\uFF1B\u4E0D\u9009\u4E2D\u5219\u5B66\u5458\u5728\u5B9E\u8BAD\u53D1\u5E03\u540E\uFF0C\u80FD\u7ACB\u5373\u5F00\u542F\u5B66\u4E60\uFF09"
})]
}), isOpenTime && /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker/* default */.Z, {
className: "".concat(Permissionmodules.dataPicker, " mt10"),
format: timeFormat,
locale: zh_CN/* default */.Z,
disabled: !editable,
placeholder: "\u8BF7\u8F93\u5165\u5F00\u542F\u65F6\u95F4",
showToday: false,
disabledDate: function disabledDate(current) {
return current && current < dayjs_min_default()().endOf('day').subtract(1, 'days');
},
showTime: {
minuteStep: 30
},
value: openTime && dayjs_min_default()(openTime, timeFormat),
onChange: function onChange(value, dateString) {
return setOpenTime(handleDateString(dateString));
}
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
okText: "\u4FDD\u5B58",
hasOkBtn: editable,
loading: loading.effects['shixunsDetail/updatePermissionSetting'],
onCancel: function onCancel() {
return _umi_production_exports.history.push("/shixuns/".concat(shixunId.current, "/challenges"));
},
onOk: handleOk
})]
});
};
/* harmony default export */ var components_Permission = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting,
user = _ref4.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user,
loading: loading
};
})(Permission));
// EXTERNAL MODULE: ./node_modules/antd/es/collapse/index.js + 8 modules
var collapse = __webpack_require__(47221);
// EXTERNAL MODULE: ./node_modules/antd/es/input-number/index.js + 21 modules
var input_number = __webpack_require__(31795);
// EXTERNAL MODULE: ./node_modules/antd/es/space/index.js + 2 modules
var space = __webpack_require__(42075);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/TestCase/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var TestCasemodules = ({"wrap":"wrap___BgpUe","test-case-name":"test-case-name___eWmIe","btn-remove-case":"btn-remove-case___ZUMi5","in":"in___VHIfB","se":"se____92Z1","fourPart":"fourPart___w5rMq","groupWrap":"groupWrap___zAZJm","customInput":"customInput___hSt9Q"});
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(84519);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/TestCase/index.tsx
var TestCase_excluded = ["shixunsDetail", "globalSetting", "loading", "user", "dispatch", "active"];
var Panel = collapse/* default.Panel */.Z.Panel;
var TestCase_TextArea = input/* default.TextArea */.Z.TextArea;
var TestCase = function TestCase(_ref) {
var _user$userInfo, _user$userInfo$shixun;
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
active = _ref.active,
props = objectWithoutProperties_default()(_ref, TestCase_excluded);
var shixunId = (0,react.useRef)();
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react.useState)({}),
_useState2 = slicedToArray_default()(_useState, 2),
formValue = _useState2[0],
setFormValue = _useState2[1];
var _useState3 = (0,react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
btnLoading = _useState4[0],
setBtnLoading = _useState4[1];
var _useState5 = (0,react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
testSetList = _useState6[0],
setTestSetList = _useState6[1];
var _useState7 = (0,react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
list = _useState8[0],
setList = _useState8[1]; //评测脚本下拉
var editable = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : (_user$userInfo$shixun = _user$userInfo.shixun) === null || _user$userInfo$shixun === void 0 ? void 0 : _user$userInfo$shixun.editable;
(0,react.useEffect)(function () {
var _location$pathname, _location$pathname$sp;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2];
}, []);
(0,react.useEffect)(function () {
if (active === 'testCase') {
getData();
}
}, [active]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var testSetData, res, _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6, _res$data7, _res$data8, _res$data9, _res$data10, _res$data11, _res$data11$test_sets, _res$data12, initData;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
testSetData = [{
hidden: 0,
input: "",
output: "",
score: 100
}];
_context.next = 3;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(shixunId.current, "/jupyter_evalute_setting.json"), {
method: 'get'
});
case 3:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setList(res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.standard_scripts);
initData = {
open_evaluate: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.open_evaluate,
exec_time: (res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.exec_time) || 3,
test_set_score: (res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.test_set_score) === null ? false : res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.test_set_score,
test_set_average: (res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.test_set_average) === null ? true : res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.test_set_average,
choice_standard_scripts: (res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.choice_standard_scripts) || null,
evaluate_script: (res === null || res === void 0 ? void 0 : (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.evaluate_script) || '',
evaluate_method: res === null || res === void 0 ? void 0 : (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.evaluate_method
};
form.setFieldsValue(initData);
setFormValue(initData);
setTestSetList(res !== null && res !== void 0 && (_res$data11 = res.data) !== null && _res$data11 !== void 0 && (_res$data11$test_sets = _res$data11.test_sets) !== null && _res$data11$test_sets !== void 0 && _res$data11$test_sets.length ? res === null || res === void 0 ? void 0 : (_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : _res$data12.test_sets : testSetData);
}
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var handleOk = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
var scoreList, sumScore, res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
scoreList = testSetList.map(function (item) {
return item.score;
});
sumScore = scoreList.reduce(function (current, next) {
return current + next;
}, 0);
if (!(values.test_set_score && sumScore !== 100 && testSetList !== null && testSetList !== void 0 && testSetList.length)) {
_context2.next = 5;
break;
}
message/* default.warning */.ZP.warning('测试用例的评分占比之和必须等于100');
return _context2.abrupt("return");
case 5:
setBtnLoading(true);
_context2.next = 8;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(shixunId.current, "/update_jupyter_evaluate_setting.json"), {
method: 'post',
body: objectSpread2_default()(objectSpread2_default()({}, values), {}, {
mirror_script_id: values === null || values === void 0 ? void 0 : values.choice_standard_scripts,
open_evaluate: values !== null && values !== void 0 && values.open_evaluate ? 1 : 0,
test_set: testSetList.map(function (e) {
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
is_file: false
});
})
})
});
case 8:
res = _context2.sent;
if (res.status === 0) {
message/* default.success */.ZP.success('保存成功');
}
setBtnLoading(false);
case 11:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleOk(_x) {
return _ref3.apply(this, arguments);
};
}();
var handleValuesChange = function handleValuesChange(changedValues) {
setFormValue(objectSpread2_default()({}, form.getFieldsValue()));
if ('test_set_average' in changedValues && changedValues !== null && changedValues !== void 0 && changedValues.test_set_average) {
handleShareRatio(testSetList);
}
if ('test_set_score' in changedValues && changedValues !== null && changedValues !== void 0 && changedValues.test_set_score) {
form.setFieldsValue({
test_set_average: true
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, form.getFieldsValue()), {}, {
test_set_average: true
}));
handleShareRatio(testSetList);
}
if ('choice_standard_scripts' in changedValues) {
modal/* default.confirm */.Z.confirm({
centered: true,
title: '提示',
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font16",
children: ["\u539F\u6709\u811A\u672C\u5C06\u88AB\u65B0\u7684\u811A\u672C\u8986\u76D6\uFF0C\u65E0\u6CD5\u64A4\u9500", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u6267\u884C\u8986\u76D6\u64CD\u4F5C"]
}),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(shixunId.current, "/get_script_contents.json"), {
method: 'get',
params: {
id: shixunId.current,
script_id: changedValues === null || changedValues === void 0 ? void 0 : changedValues.choice_standard_scripts
}
});
case 2:
res = _context3.sent;
if (res !== null && res !== void 0 && res.content) {
modal/* default.info */.Z.info({
centered: true,
title: '提示',
okText: '知道啦',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc font16",
children: "\u8BC4\u6D4B\u811A\u672C\u751F\u6210\u6210\u529F\uFF01"
})
});
form.setFieldsValue({
evaluate_script: res === null || res === void 0 ? void 0 : res.content
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, form.getFieldsValue()), {}, {
evaluate_script: res === null || res === void 0 ? void 0 : res.content
}));
}
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
}
};
var handleShareRatio = function handleShareRatio(testSetData) {
var code_compile_score = 0;
var score = Math.floor((100 - code_compile_score) / testSetData.length);
var lastScore = score + (100 - code_compile_score) % testSetData.length;
testSetData = testSetData.map(function (item, index) {
if (index === testSetData.length - 1) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
score: lastScore
});
}
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
score: score
});
});
setTestSetList(testSetData);
};
var handleAddTestSet = function handleAddTestSet() {
var testSetData = [].concat(toConsumableArray_default()(testSetList), [{
hidden: 0,
input: "",
output: "",
score: 0
}]);
if (form.getFieldValue('test_set_average')) {
handleShareRatio(testSetData);
} else {
setTestSetList(testSetData);
}
};
var test_set_score = formValue.test_set_score,
test_set_average = formValue.test_set_average,
choice_standard_scripts = formValue.choice_standard_scripts,
open_evaluate = formValue.open_evaluate;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: TestCasemodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
disabled: !open_evaluate,
layout: "vertical",
onValuesChange: handleValuesChange,
onFinish: handleOk,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "open_evaluate",
style: {
marginTop: 10
},
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
disabled: false,
children: "\u542F\u7528Jupyter\u8BC4\u6D4B\u529F\u80FD"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h4", {
className: "font14",
children: "\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
label: '评测时长(秒):',
name: "exec_time",
style: {
flexDirection: 'row',
marginTop: 15
},
rules: [{
required: true,
message: '请输入评测时长限制'
}, {
type: 'number',
min: 3,
message: '最小限制时间是3秒'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
className: TestCasemodules["in"],
min: 3
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h4", {
className: "font14 mb10",
children: "\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "test_set_score",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
direction: "vertical",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: false,
children: ["\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u4EC5\u5F53\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u83B7\u5F97\u4E00\u6B21\u6027\u5956\u52B1\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: true,
children: ["\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u901A\u8FC7\u6D4B\u8BD5\u96C6\u5373\u53EF\u83B7\u5F97\u5BF9\u5E94\u5956\u52B1\uFF09"
})]
})]
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("h4", {
className: "flex-container font14 mb10",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "mr30",
children: "\u6D4B\u8BD5\u7528\u4F8B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
style: {
height: 28,
borderRadius: 4
},
type: "primary",
onClick: handleAddTestSet,
ghost: true,
children: "\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B"
})
})]
}), test_set_score && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "test_set_average",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: true,
children: "\u5747\u5206\u6BD4\u4F8B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: false,
style: {
marginLeft: 50
},
children: "\u81EA\u5B9A\u4E49\u6BD4\u4F8B"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: TestCasemodules.fourPart,
children: testSetList.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: TestCasemodules.groupWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "font16",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "mr10",
children: ["\u7EC4", key + 1, " : "]
}), formValue.test_set_score && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginRight: 100
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: {
width: 85
}
// bordered={false}
// className={styles.customInput}
,
value: item.score,
type: "number",
disabled: test_set_average,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
score: e.target.value ? Number(e.target.value) : 0
});
}
return test;
});
var data = {
test_set_average: false
};
setFormValue(objectSpread2_default()(objectSpread2_default()({}, formValue), data));
form.setFieldsValue(data);
setTestSetList(testData);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 mr10",
children: "%"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
className: "font14 ml5",
checked: item.hidden === 1,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
hidden: e.target.checked ? 1 : 0
});
}
return test;
});
setTestSetList(testData);
},
children: ["\u9690\u85CF", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7\"print\"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tr flex1",
style: {
"float": 'right'
},
children: key !== 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottom",
title: "删除",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-red current",
onClick: function onClick() {
var testData = testSetList.filter(function (_, testIndex) {
return testIndex !== key;
});
handleShareRatio(testData);
},
children: "\u5220\xA0\u9664"
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(TestCase_TextArea, {
bordered: false,
className: "mt10",
rows: 5,
placeholder: "\u8F93\u5165",
value: item.input,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
input: e.target.value
});
}
return test;
});
setTestSetList(testData);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(TestCase_TextArea, {
bordered: false,
className: "mt10",
rows: 5,
placeholder: "\u9884\u671F\u8F93\u51FA",
value: item.output,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
output: e.target.value
});
}
return test;
});
setTestSetList(testData);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt10",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 mr20",
children: "\u9884\u671F\u8F93\u51FA:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.is_invisible,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
is_invisible: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font14",
children: ["\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u52FE\u9009\u540E\uFF0C\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1\uFF09"
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 mr20",
children: "\u7279\u6B8A\u5224\u5B9A:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.last_match_rule,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
last_match_rule: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font14",
children: ["\u672B\u5C3E\u5339\u914D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u6700\u540E\u4E00\u884C\u76F8\u540C\u5373\u53EF\u901A\u5173\uFF09"
})]
})
})]
})]
}, key);
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
label: "\u8BC4\u6D4B\u65B9\u5F0F",
name: "evaluate_method",
style: {
flexDirection: 'row',
marginTop: 15
},
rules: [{
required: true,
message: '请选择评测方式'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
direction: "vertical",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: 1,
children: ["\u6240\u6709\u4EE3\u7801\u5757\u8BC4\u6D4B", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5BF9\u5B66\u5458\u4EFB\u52A1\u6587\u4EF6\u7684\u6240\u6709\u975E\u7A7A\u4EE3\u7801\u5757\u8FDB\u884C\u8BC4\u6D4B\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: 2,
children: ["\u672B\u5C3E\u4EE3\u7801\u5757\u8BC4\u6D4B", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5BF9\u5B66\u5458\u4EFB\u52A1\u6587\u4EF6\u7684\u6700\u540E\u4E00\u4E2A\u975E\u7A7A\u4EE3\u7801\u5757\u8FDB\u884C\u8BC4\u6D4B\uFF09"
})]
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h4", {
className: "font14 mt20 mb10",
children: "\u8BC4\u6D4B\u811A\u672C"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "choice_standard_scripts",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default */.Z, {
className: TestCasemodules.se,
getPopupContainer: function getPopupContainer(trigger) {
return trigger.parentNode;
},
placeholder: "\u8BF7\u9009\u62E9\u8BC4\u6D4B\u811A\u672C",
children: list.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select/* default.Option */.Z.Option, {
value: item.id,
children: item.scptname
}, index);
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "evaluate_script",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
height: 450,
style: {
border: '1px solid #ccc'
},
language: "shell",
theme: "vs-light",
options: {
readOnly: !open_evaluate
}
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
okText: "\u4FDD\u5B58",
hasOkBtn: editable,
loading: btnLoading,
onCancel: function onCancel() {
return _umi_production_exports.history.push("/shixuns/".concat(shixunId.current, "/challenges"));
},
onOk: function onOk() {
return form.submit();
}
})]
});
};
/* harmony default export */ var components_TestCase = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting,
user = _ref4.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user,
loading: loading
};
})(TestCase));
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/Learning/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Learningmodules = ({"wrap":"wrap___J9uHL","labelWrap":"labelWrap___kdl0e","label":"label___RZlBA","labelContent":"labelContent___LJE2G","flexRow":"flexRow___hNb4e","color999":"color999___r9hUn","radio":"radio___z_jH6"});
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/Learning/index.tsx
var Learning_excluded = ["shixunsDetail", "globalSetting", "loading", "user", "dispatch"];
var Learning = function Learning(_ref) {
var _user$userInfo, _user$userInfo$shixun;
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, Learning_excluded);
var shixunId = (0,react.useRef)();
var _useState = (0,react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
vnc = _useState2[0],
setVNC = _useState2[1];
var _useState3 = (0,react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
websshShow = _useState4[0],
setWebsshShow = _useState4[1];
var _useState5 = (0,react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
sshRadioValue = _useState6[0],
setSshRadioValue = _useState6[1];
var _useState7 = (0,react.useState)(),
_useState8 = slicedToArray_default()(_useState7, 2),
multiWebssh = _useState8[0],
setMultiWebssh = _useState8[1];
var _useState9 = (0,react.useState)(),
_useState10 = slicedToArray_default()(_useState9, 2),
hideCode = _useState10[0],
setHideCode = _useState10[1];
var _useState11 = (0,react.useState)(),
_useState12 = slicedToArray_default()(_useState11, 2),
codeEditPermission = _useState12[0],
setCodeEditPermission = _useState12[1];
var _useState13 = (0,react.useState)(),
_useState14 = slicedToArray_default()(_useState13, 2),
codeHidden = _useState14[0],
setCodeHidden = _useState14[1];
var _useState15 = (0,react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
forbidCopy = _useState16[0],
setForbidCopy = _useState16[1];
var _useState17 = (0,react.useState)(),
_useState18 = slicedToArray_default()(_useState17, 2),
taskPass = _useState18[0],
setTaskPass = _useState18[1];
var _useState19 = (0,react.useState)(),
_useState20 = slicedToArray_default()(_useState19, 2),
testSetPermission = _useState20[0],
setTestSetPermission = _useState20[1];
var _useState21 = (0,react.useState)(),
_useState22 = slicedToArray_default()(_useState21, 2),
display_git_address = _useState22[0],
set_display_git_address = _useState22[1];
var editable = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : (_user$userInfo$shixun = _user$userInfo.shixun) === null || _user$userInfo$shixun === void 0 ? void 0 : _user$userInfo$shixun.editable;
(0,react.useEffect)(function () {
var _location$pathname, _location$pathname$sp;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2];
}, []);
(0,react.useEffect)(function () {
var _shixunsDetail$settin, _shixunsDetail$settin2, _shixunsDetail$settin3, _shixunsDetail$settin4, _shixunsDetail$settin5, _shixunsDetail$settin6, _shixunsDetail$settin7, _shixunsDetail$settin8, _shixunsDetail$settin9, _shixunsDetail$settin10, _shixunsDetail$settin11, _shixunsDetail$settin12, _shixunsDetail$settin13, _shixunsDetail$settin14, _shixunsDetail$settin15, _shixunsDetail$settin16, _shixunsDetail$settin17, _shixunsDetail$settin18, _shixunsDetail$settin19, _shixunsDetail$settin20, _shixunsDetail$settin21;
if (!shixunsDetail.setting) {
return;
}
setVNC((_shixunsDetail$settin = shixunsDetail.setting) === null || _shixunsDetail$settin === void 0 ? void 0 : (_shixunsDetail$settin2 = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin2 === void 0 ? void 0 : _shixunsDetail$settin2.vnc);
setWebsshShow(!!((_shixunsDetail$settin3 = shixunsDetail.setting) !== null && _shixunsDetail$settin3 !== void 0 && (_shixunsDetail$settin4 = _shixunsDetail$settin3.shixun) !== null && _shixunsDetail$settin4 !== void 0 && _shixunsDetail$settin4.webssh));
setSshRadioValue((_shixunsDetail$settin5 = shixunsDetail.setting) === null || _shixunsDetail$settin5 === void 0 ? void 0 : (_shixunsDetail$settin6 = _shixunsDetail$settin5.shixun) === null || _shixunsDetail$settin6 === void 0 ? void 0 : _shixunsDetail$settin6.webssh);
setMultiWebssh((_shixunsDetail$settin7 = shixunsDetail.setting) === null || _shixunsDetail$settin7 === void 0 ? void 0 : (_shixunsDetail$settin8 = _shixunsDetail$settin7.shixun) === null || _shixunsDetail$settin8 === void 0 ? void 0 : _shixunsDetail$settin8.multi_webssh);
setHideCode((_shixunsDetail$settin9 = shixunsDetail.setting) === null || _shixunsDetail$settin9 === void 0 ? void 0 : (_shixunsDetail$settin10 = _shixunsDetail$settin9.shixun) === null || _shixunsDetail$settin10 === void 0 ? void 0 : _shixunsDetail$settin10.hide_code);
setCodeEditPermission((_shixunsDetail$settin11 = shixunsDetail.setting) === null || _shixunsDetail$settin11 === void 0 ? void 0 : (_shixunsDetail$settin12 = _shixunsDetail$settin11.shixun) === null || _shixunsDetail$settin12 === void 0 ? void 0 : _shixunsDetail$settin12.code_edit_permission);
setCodeHidden((_shixunsDetail$settin13 = shixunsDetail.setting) === null || _shixunsDetail$settin13 === void 0 ? void 0 : (_shixunsDetail$settin14 = _shixunsDetail$settin13.shixun) === null || _shixunsDetail$settin14 === void 0 ? void 0 : _shixunsDetail$settin14.code_hidden);
setForbidCopy((_shixunsDetail$settin15 = shixunsDetail.setting) === null || _shixunsDetail$settin15 === void 0 ? void 0 : (_shixunsDetail$settin16 = _shixunsDetail$settin15.shixun) === null || _shixunsDetail$settin16 === void 0 ? void 0 : _shixunsDetail$settin16.forbid_copy);
setTaskPass((_shixunsDetail$settin17 = shixunsDetail.setting) === null || _shixunsDetail$settin17 === void 0 ? void 0 : (_shixunsDetail$settin18 = _shixunsDetail$settin17.shixun) === null || _shixunsDetail$settin18 === void 0 ? void 0 : _shixunsDetail$settin18.task_pass);
setTestSetPermission((_shixunsDetail$settin19 = shixunsDetail.setting) === null || _shixunsDetail$settin19 === void 0 ? void 0 : (_shixunsDetail$settin20 = _shixunsDetail$settin19.shixun) === null || _shixunsDetail$settin20 === void 0 ? void 0 : _shixunsDetail$settin20.test_set_permission);
set_display_git_address((_shixunsDetail$settin21 = shixunsDetail.setting.shixun) === null || _shixunsDetail$settin21 === void 0 ? void 0 : _shixunsDetail$settin21.display_git_address);
}, [shixunsDetail.setting]);
var handleOk = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunsDetail/updateLearnSetting',
payload: {
id: shixunId.current,
shixun: {
code_hidden: codeHidden,
forbid_copy: forbidCopy,
hide_code: hideCode,
multi_webssh: multiWebssh,
task_pass: taskPass,
test_set_permission: testSetPermission,
display_git_address: display_git_address,
vnc: vnc,
webssh: websshShow ? sshRadioValue : 0,
code_edit_permission: codeEditPermission
}
}
});
case 2:
res = _context.sent;
if (res.status !== -1) {
message/* default.info */.ZP.info('学习页面设置保存成功!');
dispatch({
type: 'shixunsDetail/getSettingsData',
payload: {
id: shixunId.current
}
});
dispatch({
type: "shixunsDetail/getShixunsDetail",
payload: {
id: shixunId.current
}
});
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleOk() {
return _ref2.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: Learningmodules.wrap,
children: [(vnc || !websshShow) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u5F00\u542F\u56FE\u5F62\u5316\u754C\u9762\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: vnc,
disabled: !editable,
onChange: function onChange(e) {
var value = e.target.checked;
setVNC(value);
if (value) {
setHideCode(false);
setCodeEditPermission(false);
setCodeHidden(false);
setForbidCopy(false);
setMultiWebssh(false);
setWebsshShow(false);
}
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u7ED9\u5B66\u5458\u7684\u5B9E\u8DF5\u4EFB\u52A1\u542F\u52A8Ubuntu\u7CFB\u7EDF\u7684\u56FE\u5F62\u5316\u754C\u9762\uFF09"
})]
})
})]
}), !vnc && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u547D\u4EE4\u884C\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelContent,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: websshShow,
disabled: !editable,
onChange: function onChange(e) {
var value = e.target.checked;
setWebsshShow(value);
if (value) {
setVNC(false);
setSshRadioValue(1);
} else {
setMultiWebssh(false);
setSshRadioValue(null);
setHideCode(false);
}
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u7ED9\u5B66\u5458\u7684\u5B9E\u8DF5\u4EFB\u52A1\u63D0\u4F9B\u547D\u4EE4\u884C\u7A97\u53E3\uFF09"
})]
}), websshShow && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "ml40",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
value: sshRadioValue,
disabled: !editable,
onChange: function onChange(e) {
var value = e.target.value;
setSshRadioValue(value);
if (value !== 1) {
setMultiWebssh(false);
}
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
className: Learningmodules.radio,
value: 1,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u547D\u4EE4\u884C\u7EC3\u4E60\u7A97\u53E3"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Learningmodules.color999,
children: "\uFF08\u9009\u4E2D\u5219\u7ED9\u5B66\u5458\u63D0\u4F9B\u7528\u4E8E\u7EC3\u4E60\u64CD\u4F5C\u7684\u547D\u4EE4\u884C\uFF0C\u547D\u4EE4\u884C\u7684\u64CD\u4F5C\u4E0D\u4F1A\u5BF9\u5B66\u751F\u7684\u5B9E\u9A8C\u73AF\u5883\u9020\u6210\u5F71\u54CD\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
className: Learningmodules.radio,
value: 2,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u547D\u4EE4\u884C\u8BC4\u6D4B\u7A97\u53E3"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Learningmodules.color999,
children: "\uFF08\u9009\u4E2D\u5219\u7ED9\u5B66\u5458\u63D0\u4F9B\u7528\u4E8E\u8BC4\u6D4B\u64CD\u4F5C\u7684\u547D\u4EE4\u884C\uFF0C\u547D\u4EE4\u884C\u7684\u64CD\u4F5C\u53EF\u4EE5\u5BF9\u5B66\u751F\u7684\u5B9E\u9A8C\u73AF\u5883\u4EA7\u751F\u5F71\u54CD\uFF09"
})]
})]
})
}), sshRadioValue === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "ml60",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: multiWebssh,
disabled: !editable,
onChange: function onChange(e) {
return setMultiWebssh(e.target.checked);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: " ml10",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u591A\u4E2A\u547D\u4EE4\u884C\u7A97\u53E3\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Learningmodules.color999,
children: "\uFF08\u9009\u4E2D\u5219\u5141\u8BB8\u5B66\u5458\u540C\u65F6\u5F00\u542F\u591A\u4E2A\u547D\u4EE4\u884C\u7A97\u53E3\uFF09"
})]
})]
})]
})]
}), !vnc && websshShow && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u9690\u85CF\u4EE3\u7801\u7A97\u53E3\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: hideCode,
disabled: !editable,
onChange: function onChange(e) {
var value = e.target.checked;
setHideCode(value);
if (value) {
setCodeEditPermission(false);
}
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u5B66\u5458\u9875\u9762\u4E0D\u663E\u793A\u4EE3\u7801\u7A97\u53E3\uFF09"
})]
})
})]
}), !vnc && !hideCode && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u516C\u5F00\u7248\u672C\u5E93\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: codeEditPermission,
disabled: !editable,
onChange: function onChange(e) {
return setCodeEditPermission(e.target.checked);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u5141\u8BB8\u5B66\u5458\u67E5\u770B\u7248\u672C\u5E93\u4E2D\u7684\u5168\u90E8\u6587\u4EF6\uFF09"
})]
})
})]
}), !hideCode && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u663E\u793A\u7248\u672C\u5E93\u5730\u5740\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: display_git_address,
disabled: !editable,
onChange: function onChange(e) {
return set_display_git_address(e.target.checked);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: " \uFF08\u9009\u4E2D\u5219\u5BF9\u5B66\u5458\u516C\u5F00\u7248\u672C\u5E93\u5730\u5740\uFF0C\u5B66\u5458\u53EF\u4EE5\u5C06\u6240\u6709\u4EE3\u7801\u4E0B\u8F7D\u5230\u672C\u5730\uFF09"
})]
})
})]
}), !vnc && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u9690\u85CF\u4EE3\u7801\u76EE\u5F55\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: codeHidden,
disabled: !editable,
onChange: function onChange(e) {
return setCodeHidden(e.target.checked);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u5B66\u5458\u9875\u9762\u4E0D\u663E\u793A\u7248\u672C\u5E93\u76EE\u5F55\uFF09"
})]
})
})]
}), !vnc && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u7981\u7528\u7C98\u8D34\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: forbidCopy,
disabled: !editable,
onChange: function onChange(e) {
return setForbidCopy(e.target.checked);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u5B66\u5458\u9875\u9762\u4E0D\u5141\u8BB8\u4F7F\u7528\u7C98\u8D34\u529F\u80FD\uFF09"
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u8DF3\u5173\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: taskPass,
disabled: !editable,
onChange: function onChange(e) {
return setTaskPass(e.target.checked);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u5141\u8BB8\u5B66\u5458\u8DF3\u5173\u5B66\u4E60\u5B9E\u8BAD\u5173\u5361\u4EFB\u52A1\uFF09"
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Learningmodules.labelWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: Learningmodules.label,
children: "\u6D4B\u8BD5\u96C6\u89E3\u9501\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Learningmodules.labelContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: testSetPermission,
disabled: !editable,
onChange: function onChange(e) {
return setTestSetPermission(e.target.checked);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Learningmodules.color999, " ml10"),
children: "\uFF08\u9009\u4E2D\u5219\u5141\u8BB8\u5B66\u5458\u901A\u8FC7\u91D1\u5E01\u89E3\u9501\u67E5\u770B\u9690\u85CF\u6D4B\u8BD5\u96C6\u7684\u5185\u5BB9\uFF09"
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
okText: "\u4FDD\u5B58",
hasOkBtn: editable,
loading: loading.effects['shixunsDetail/updateLearnSetting'],
onCancel: function onCancel() {
return _umi_production_exports.history.push("/shixuns/".concat(shixunId.current, "/challenges"));
},
onOk: handleOk
})]
});
};
/* harmony default export */ var components_Learning = ((0,_umi_production_exports.connect)(function (_ref3) {
var shixunsDetail = _ref3.shixunsDetail,
loading = _ref3.loading,
globalSetting = _ref3.globalSetting,
user = _ref3.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user,
loading: loading
};
})(Learning));
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 2 modules
var verifyLogin = __webpack_require__(7303);
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/index.js + 12 modules
var skeleton = __webpack_require__(21687);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/SuggestedAnswer/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var SuggestedAnswermodules = ({"flexRow":"flexRow___iOXK1","flexJustifyCenter":"flexJustifyCenter___EzhBH","flexAlignEnd":"flexAlignEnd___yYnjN","flexAlignCenter":"flexAlignCenter___DSXuy","flexColumn":"flexColumn___eAlHb","formWrap":"formWrap___BgCFo","titleWrap":"titleWrap___Y1yNk","fieldWrap":"fieldWrap___dhQNb","button":"button___KOcw8","buttonFixed":"buttonFixed___fErH4","buttonWrap":"buttonWrap___rULI5","width180":"width180___fc_Sl","width100":"width100___HFRB1","width280":"width280___QUy3U","difficultyHint":"difficultyHint___G2WQw","color888":"color888___d6xbW","color0152d9":"color0152d9___zc4Ea","serviceSettingWrap":"serviceSettingWrap___wQRSY","serviceSettingName":"serviceSettingName___v9VHz","serviceSetLeft":"serviceSetLeft___ndFSo","serviceSetInput":"serviceSetInput___I8YpY","serviceSetMemoryInput":"serviceSetMemoryInput___p1DpA","serviceSetTip":"serviceSetTip___Ra3zX","installPackage":"installPackage___JZfJB","popover":"popover___r6mRN","wrap":"wrap___hoiWC"});
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/SuggestedAnswer/index.tsx
var SuggestedAnswer_excluded = ["shixunsDetail", "globalSetting", "user", "dispatch"];
var SuggestedAnswer_BasicInfo = function BasicInfo(_ref) {
var _location$pathname, _location$pathname$sp, _user$userInfo, _user$userInfo$shixun;
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, SuggestedAnswer_excluded);
var location = (0,_umi_production_exports.useLocation)();
var shixunId = (0,react.useRef)((_location$pathname = location.pathname) === null || _location$pathname === void 0 ? void 0 : (_location$pathname$sp = _location$pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2]);
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
answer = _useState2[0],
setAnswer = _useState2[1];
var _useState3 = (0,react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
loading = _useState4[0],
setLoading = _useState4[1];
var editable = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : (_user$userInfo$shixun = _user$userInfo.shixun) === null || _user$userInfo$shixun === void 0 ? void 0 : _user$userInfo$shixun.editable;
(0,react.useEffect)(function () {
if (shixunId.current) {
getData();
}
}, [shixunId.current]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setLoading(true);
_context.next = 3;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(shixunId.current, "/get_standard_answer.json"), {
method: 'get',
params: {
from: 'edit'
}
});
case 3:
res = _context.sent;
if (res.status === 0) {
setAnswer((res === null || res === void 0 ? void 0 : res.standard_answer) || '');
form.setFieldsValue({
hide_answer: res === null || res === void 0 ? void 0 : res.hide_answer,
disable_copy: res === null || res === void 0 ? void 0 : res.disable_copy
});
setLoading(false);
}
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var handleFinish = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(shixunId.current, "/set_standard_answer.json"), {
method: 'post',
body: objectSpread2_default()({}, values)
});
case 2:
res = _context2.sent;
if (res.status === 0) {
message/* default.success */.ZP.success('保存成功');
}
case 4:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleFinish(_x) {
return _ref3.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: SuggestedAnswermodules.wrap,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
loading: loading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
className: SuggestedAnswermodules.formWrap,
scrollToFirstError: true,
layout: "vertical",
onFinish: handleFinish,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: SuggestedAnswermodules.fieldWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "hide_answer",
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
children: "\u9690\u85CF\u53C2\u8003\u7B54\u6848\u6A21\u5757"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "disable_copy",
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
children: "\u7981\u6B62\u590D\u5236\u53C2\u8003\u7B54\u6848"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
name: "standard_answer",
label: "\u53C2\u8003\u7B54\u6848:",
rules: [{
required: true,
message: '请输入参考答案'
}],
children: editable ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
defaultValue: answer
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: answer
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
okText: "\u4FDD\u5B58",
hasOkBtn: editable,
loading: false,
onCancel: function onCancel() {
return _umi_production_exports.history.push("/shixuns/".concat(shixunId.current, "/challenges"));
},
okButtonProps: {
htmlType: 'submit'
}
})
})]
})
})
});
};
/* harmony default export */ var SuggestedAnswer = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
globalSetting = _ref4.globalSetting,
user = _ref4.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user
};
})(SuggestedAnswer_BasicInfo));
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/index.tsx
var Settings_excluded = ["shixunsDetail", "globalSetting", "loading", "user", "dispatch"];
var TabPane = tabs/* default.TabPane */.Z.TabPane;
var ActiveKeyType = /*#__PURE__*/function (ActiveKeyType) {
ActiveKeyType["BasicInfo"] = "basicInfo";
ActiveKeyType["Permission"] = "permission";
ActiveKeyType["Learning"] = "learning";
ActiveKeyType["TestCase"] = "testCase";
ActiveKeyType["SuggestedAnswer"] = "suggestedAnswer";
return ActiveKeyType;
}(ActiveKeyType || {});
var Settings = function Settings(_ref) {
var _user$userInfo, _user$userInfo$shixun, _shixunsDetail$detail3;
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, Settings_excluded);
var _useState = (0,react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
activeKey = _useState2[0],
setActiveKey = _useState2[1];
var shixunId = (0,react.useRef)('');
var is_creator = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : (_user$userInfo$shixun = _user$userInfo.shixun) === null || _user$userInfo$shixun === void 0 ? void 0 : _user$userInfo$shixun.is_creator;
(0,react.useEffect)(function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: false
});
return function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: true
});
};
}, []);
(0,react.useEffect)(function () {
var _location$pathname$sp;
shixunId.current = (_location$pathname$sp = location.pathname.split('/')) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[2];
dispatch({
type: 'shixunsDetail/getSettingsData',
payload: {
id: shixunId.current
}
});
}, []);
var handlePermanentClose = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
modal/* default.confirm */.Z.confirm({
centered: true,
title: '提示',
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font14",
children: ["\u5173\u95ED\u540E,", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u7528\u6237\u4E0D\u80FD\u518D\u5F00\u59CB\u6311\u6218\u4E86\u662F\u5426\u786E\u8BA4\u5173\u95ED \uFF1F"]
}),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunsDetail/permanentClose',
payload: {
id: shixunId.current
}
});
case 2:
res = _context.sent;
if (res.status === 1) {
message/* default.info */.ZP.info('操作成功');
_umi_production_exports.history.push("/shixuns/".concat(shixunId.current, "/challenges"));
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
case 1:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handlePermanentClose() {
return _ref2.apply(this, arguments);
};
}();
var handleDeleteShixun = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
var _quote$subjects, _quote$subjects2, _quote$subjects2$spli, _quote$courses, _quote$courses2, _quote$courses2$splic;
var quote;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return dispatch({
type: 'shixunsDetail/getShixunQuote',
payload: {
id: shixunId.current
}
});
case 2:
_context4.t0 = _context4.sent;
if (_context4.t0) {
_context4.next = 5;
break;
}
_context4.t0 = {};
case 5:
quote = _context4.t0;
modal/* default.confirm */.Z.confirm({
centered: true,
title: '提示',
okText: '确定',
cancelText: '取消',
width: 520,
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font14 ".concat(Settingsmodules.modal),
children: [!!((_quote$subjects = quote.subjects) !== null && _quote$subjects !== void 0 && _quote$subjects.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u88AB\u5E94\u7528\u5230 ", (_quote$subjects2 = quote.subjects) === null || _quote$subjects2 === void 0 ? void 0 : (_quote$subjects2$spli = _quote$subjects2.splice(0, 2)) === null || _quote$subjects2$spli === void 0 ? void 0 : _quote$subjects2$spli.map(function (item) {
return "\u300A".concat(item, "\u300B");
}), "\u7B49", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Settingsmodules.colorOrange,
children: quote === null || quote === void 0 ? void 0 : quote.subjects_count
}), "\u4E2A\u5B9E\u8BAD\u8BFE\u7A0B"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
}), !!((_quote$courses = quote.courses) !== null && _quote$courses !== void 0 && _quote$courses.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u88AB\u5E94\u7528\u5230", (_quote$courses2 = quote.courses) === null || _quote$courses2 === void 0 ? void 0 : (_quote$courses2$splic = _quote$courses2.splice(0, 2)) === null || _quote$courses2$splic === void 0 ? void 0 : _quote$courses2$splic.map(function (item) {
return "\u300A".concat(item, "\u300B");
}), "\u7B49", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Settingsmodules.colorOrange,
children: quote === null || quote === void 0 ? void 0 : quote.courses_count
}), "\u4E2A\u6559\u5B66\u8BFE\u5802"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(Settingsmodules.colorYellow, " mt30"),
children: "\u5220\u9664\u5B9E\u8DF5\u9879\u76EE\u5C06\u5F71\u54CD\u8BFE\u7A0B\u53CA\u8BFE\u5802\u5BF9\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u4F7F\u7528\uFF01\u8BF7\u8C28\u614E\u64CD\u4F5C\uFF01"
})]
}),
onOk: function () {
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return dispatch({
type: 'shixunsDetail/deleteShixun',
payload: {
id: shixunId.current
}
});
case 2:
res = _context3.sent;
if (res.status === 1) {
message/* default.success */.ZP.success('操作成功');
_umi_production_exports.history.push('/shixuns');
}
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function onOk() {
return _onOk2.apply(this, arguments);
}
return onOk;
}()
});
case 7:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function handleDeleteShixun() {
return _ref3.apply(this, arguments);
};
}();
var handleDeleteElseShixun = function handleDeleteElseShixun() {
if ((0,verifyLogin/* ShixunStatusModel */.gy)(dispatch, '不能进行删除')) return;
};
var renderTabBarExtra = function renderTabBarExtra() {
var _shixunsDetail$detail, _shixunsDetail$detail2, _shixunsDetail$settin, _shixunsDetail$settin2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mr20",
children: [is_creator ? (shixunsDetail === null || shixunsDetail === void 0 ? void 0 : (_shixunsDetail$detail = shixunsDetail.detail) === null || _shixunsDetail$detail === void 0 ? void 0 : _shixunsDetail$detail.shixun_status) !== 2 ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
className: "mr20",
ghost: true,
onClick: handleDeleteShixun,
children: "\u5220\u9664\u5B9E\u8DF5\u9879\u76EE"
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
className: "mr20",
ghost: true,
onClick: handleDeleteElseShixun,
children: "\u5220\u9664\u5B9E\u8DF5\u9879\u76EE"
}) : null, ((_shixunsDetail$detail2 = shixunsDetail.detail) === null || _shixunsDetail$detail2 === void 0 ? void 0 : _shixunsDetail$detail2.identity) === 1 && ((_shixunsDetail$settin = shixunsDetail.setting) === null || _shixunsDetail$settin === void 0 ? void 0 : (_shixunsDetail$settin2 = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin2 === void 0 ? void 0 : _shixunsDetail$settin2.status) === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
ghost: true,
onClick: handlePermanentClose,
children: "\u6C38\u4E45\u5173\u95ED"
})]
});
};
return /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: Settingsmodules.bg,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
animated: false,
activeKey: activeKey,
onChange: function onChange(value) {
return setActiveKey(value);
},
tabBarExtraContent: renderTabBarExtra(),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: "\u57FA\u672C\u4FE1\u606F",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(components_BasicInfo, {})
}, ActiveKeyType.BasicInfo), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: "\u6743\u9650\u914D\u7F6E",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(components_Permission, {})
}, ActiveKeyType.Permission), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: "\u8BC4\u6D4B\u8BBE\u7F6E",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(components_TestCase, {
active: activeKey
})
}, ActiveKeyType.TestCase), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: "\u53C2\u8003\u7B54\u6848",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(SuggestedAnswer, {})
}, ActiveKeyType.SuggestedAnswer), !((_shixunsDetail$detail3 = shixunsDetail.detail) !== null && _shixunsDetail$detail3 !== void 0 && _shixunsDetail$detail3.is_jupyter) && /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: "\u5B66\u4E60\u9875\u9762\u8BBE\u7F6E",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(components_Learning, {})
}, ActiveKeyType.Learning)]
})
});
};
/* harmony default export */ var Detail_Settings = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting,
user = _ref4.user;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting,
user: user,
loading: loading.models.index
};
})(Settings));
/***/ }),
/***/ 57944:
/*!***************************************************************************!*\
!*** ./src/pages/Shixuns/New/components/ApplyModal/index.tsx + 1 modules ***!
\***************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ components_ApplyModal; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(17061);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(17156);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(27424);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(70215);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(88275);
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
var input = __webpack_require__(79531);
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
var es_form = __webpack_require__(25159);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 39 modules
var modal = __webpack_require__(72423);
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 4 modules
var message = __webpack_require__(2453);
// EXTERNAL MODULE: ./node_modules/antd/es/upload/index.js + 24 modules
var upload = __webpack_require__(31365);
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
var es_button = __webpack_require__(71577);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(59758);
// EXTERNAL MODULE: ./src/assets/images/qrCode.png
var qrCode = __webpack_require__(55351);
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/ApplyModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ApplyModalmodules = ({"flexRow":"flexRow___JBN3B","flexColumn":"flexColumn___zXgFj","formWrap":"formWrap___aNgan","upload":"upload___yGdLQ","color0152d9":"color0152d9___zzEpS","colorCCC":"colorCCC___k4Dxq","footerWrap":"footerWrap___WrUZd","qrCode":"qrCode___GPwSg","a1":"a1___R6etl","code":"code___fCL_L","group":"group___n7tgy","groupNumber":"groupNumber___tw7hA","a2":"a2___GGjDE"});
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/ApplyModal/index.tsx
var _excluded = ["newShixuns", "globalSetting", "loading", "dispatch"];
var TextArea = input/* default.TextArea */.Z.TextArea;
var ApplyModal = function ApplyModal(_ref) {
var newShixuns = _ref.newShixuns,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, _excluded);
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
fileList = _useState2[0],
setFileList = _useState2[1];
var handleFileChange = function handleFileChange(info) {
var statusList = ["uploading", "done", "removed"];
if (statusList.includes(info.file.status)) {
setFileList(info.fileList);
}
};
var handleFileRemove = function handleFileRemove(file) {
if (!file.percent || file.percent == 100) {
var _file$response;
var id = (_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.id;
modal/* default.confirm */.Z.confirm({
centered: true,
title: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'newShixuns/deleteAttachment',
payload: {
id: id
}
});
case 2:
res = _context.sent;
res && setFileList(fileList.filter(function (item) {
var _item$response;
return ((_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id) !== id;
}));
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
return false;
}
};
var handleFileBeforeUpload = function handleFileBeforeUpload(file) {
if (fileList.length) {
return false;
}
var is150M = file.size / 1024 / 1024 > 50;
if (is150M) {
message/* default.info */.ZP.info('文件大小必须小于50MB');
return false;
}
return true;
};
var handleFinish = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
var _fileList$, _fileList$$response;
var _ref3, language, runtime, run_method, code, res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_ref3 = values || {}, language = _ref3.language, runtime = _ref3.env, run_method = _ref3.mode, code = _ref3.code;
_context2.next = 3;
return dispatch({
type: 'newShixuns/applyShixunMirror',
payload: {
language: language,
runtime: runtime,
run_method: run_method,
attachment_id: fileList === null || fileList === void 0 ? void 0 : (_fileList$ = fileList[0]) === null || _fileList$ === void 0 ? void 0 : (_fileList$$response = _fileList$.response) === null || _fileList$$response === void 0 ? void 0 : _fileList$$response.id
}
});
case 3:
res = _context2.sent;
dispatch({
type: 'newShixuns/setActionTabs',
payload: {}
});
if (res) {
message/* default.success */.ZP.success("新建申请已提交,请等待管理员审核。");
}
case 6:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleFinish(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleAfterClose = function handleAfterClose() {
form.resetFields();
setFileList([]);
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
centered: true,
keyboard: false,
closable: false,
destroyOnClose: true,
open: newShixuns.actionTabs.key === 'NewShixuns-Apply',
title: "\u7533\u8BF7\u65B0\u5EFA",
width: "1000px",
footer: null,
afterClose: handleAfterClose,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: ApplyModalmodules.qrCode,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: ApplyModalmodules.a1,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.code,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
width: 120,
height: 120,
src: qrCode,
alt: "\u4E8C\u7EF4\u7801"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.group,
children: "\u5B9E\u9A8C\u73AF\u5883\u7533\u8BF7QQ\u7FA4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.groupNumber,
children: "\u7FA4\u53F7\uFF1A740157011"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: ApplyModalmodules.a2,
children: ["\u5C0A\u656C\u7684\u8001\u5E08/\u540C\u5B66\u60A8\u597D\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5982\u679C\u60A8\u60F3\u65B0\u5EFA\u5B9E\u9A8C\u73AF\u5883\uFF0C\u53EF\u4EE5\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801\u8FDB\u7FA4\uFF0C\u76F4\u63A5\u5411\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u7533\u8BF7\u54E6~ \u4E5F\u53EF\u4EE5\u63D0\u4EA4\u4E0B\u9762\u7684\u8868\u5355\u7533\u8BF7\uFF0C\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u6536\u5230\u7533\u8BF7\u4FE1\u606F\u5C06\u4F1A\u7B2C\u4E00\u65F6\u95F4\u8054\u7CFB\u60A8\uFF01"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
className: ApplyModalmodules.formWrap,
form: form,
labelCol: {
span: 4
},
wrapperCol: {
span: 20
},
onFinish: handleFinish,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
label: "\u8BED\u8A00\uFF1A",
name: "language",
rules: [{
required: true,
message: '请填写该镜像语言'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48\u8BED\u8A00\uFF1A\u793A\u4F8B\uFF1APython",
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
label: "\u7CFB\u7EDF\u73AF\u5883\uFF1A",
name: "env",
rules: [{
required: true,
message: '请填写该镜像语言系统环境'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48linux\u7CFB\u7EDF\u73AF\u5883,\u4EE3\u7801\u8FD0\u884C\u73AF\u5883",
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
label: "\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F\uFF1A",
name: "mode",
rules: [{
required: true,
message: '请填写该镜像测试代码运行方式'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u4E2D\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F",
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default.Item */.Z.Item, {
label: "\u6D4B\u8BD5\u4EE3\u7801\uFF1A",
name: "code",
rules: [{
required: true,
message: '请上传附件'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.upload,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, {
fileList: fileList,
action: "".concat(env/* default.API_SERVER */.Z.API_SERVER, "/api/attachments.json?client_key=6d57f8c3dd186c5ada392546ace9620a"),
onChange: handleFileChange,
onRemove: handleFileRemove,
beforeUpload: handleFileBeforeUpload,
withCredentials: true,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(ApplyModalmodules.color0152d9, " current"),
children: "\u4E0A\u4F20\u9644\u4EF6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(ApplyModalmodules.colorCCC, " ml10"),
children: "(\u5355\u4E2A\u6587\u4EF650M\u4EE5\u5185)"
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.footerWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default.Item */.Z.Item, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "mr5",
size: 'middle',
onClick: function onClick() {
dispatch({
type: 'newShixuns/setActionTabs',
payload: {}
});
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
size: 'middle',
type: "primary",
htmlType: "submit",
loading: loading['newShixuns/applyShixunMirror'],
children: "\u4FDD\u5B58"
})]
})
})]
})]
});
};
/* harmony default export */ var components_ApplyModal = ((0,_umi_production_exports.connect)(function (_ref4) {
var newShixuns = _ref4.newShixuns,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting;
return {
newShixuns: newShixuns,
globalSetting: globalSetting,
loading: loading.effects
};
})(ApplyModal));
/***/ }),
/***/ 88654:
/*!**********************************************************************!*\
!*** ./src/pages/Shixuns/New/components/CreateEnvironment/index.tsx ***!
\**********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! umi */ 88275);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 72423);
/* harmony import */ var _assets_images_qrCode_png__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/assets/images/qrCode.png */ 55351);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
var CreateEnvironment = function CreateEnvironment(_ref) {
var _newShixuns$actionTab;
var newShixuns = _ref.newShixuns,
dispatch = _ref.dispatch,
user = _ref.user;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),
isCreateModel = _useState2[0],
setIsCreateModel = _useState2[1];
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
if (newShixuns.actionTabs.key === 'Create-Environment') {
createImg();
}
}, [newShixuns === null || newShixuns === void 0 ? void 0 : (_newShixuns$actionTab = newShixuns.actionTabs) === null || _newShixuns$actionTab === void 0 ? void 0 : _newShixuns$actionTab.key]);
var cancelImg = function cancelImg() {
dispatch({
type: 'newShixuns/setActionTabs',
payload: {}
});
};
var createImg = function createImg() {
var _user$userInfo, _user$userInfo2, _user$userInfo4;
//判断 #0不能1能2每日上限
cancelImg(); //取消Key值
if (((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.mirror_marker_status) === 0) {
setIsCreateModel(true);
} else if (((_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.mirror_marker_status) === 1) {
var _user$userInfo3;
umi__WEBPACK_IMPORTED_MODULE_2__.history.push("/users/".concat((_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login, "/experiment-img/add"));
} else if (((_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.mirror_marker_status) === 2) {
antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"].confirm */ .Z.confirm({
title: '您今日已达到申请上限,是否跳转至云主机列表?',
content: '提示:每天最多允许申请一台云主机',
okText: '跳转',
cancelText: "取消",
onOk: function onOk() {
var _user$userInfo5;
umi__WEBPACK_IMPORTED_MODULE_2__.history.push("/users/".concat((_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.login, "/experiment-img"));
}
});
}
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
title: "\u52A0\u5165qq\u7FA4\u63D0\u793A",
open: isCreateModel,
footer: null,
onCancel: function onCancel() {
setIsCreateModel(false);
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
style: {
textAlign: 'center'
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
width: 120,
height: 120,
style: {
marginTop: '20px'
},
src: _assets_images_qrCode_png__WEBPACK_IMPORTED_MODULE_3__,
alt: "\u4E8C\u7EF4\u7801"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {})]
});
};
/* harmony default export */ __webpack_exports__["Z"] = ((0,umi__WEBPACK_IMPORTED_MODULE_2__.connect)(function (_ref2) {
var newShixuns = _ref2.newShixuns,
user = _ref2.user,
globalSetting = _ref2.globalSetting;
return {
newShixuns: newShixuns,
globalSetting: globalSetting,
user: user
};
})(CreateEnvironment));
/***/ }),
/***/ 6220:
/*!*************************************************************************!*\
!*** ./src/pages/Shixuns/New/components/DesModal/index.tsx + 1 modules ***!
\*************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ components_DesModal; }
});
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 39 modules
var modal = __webpack_require__(72423);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(12768);
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/DesModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var DesModalmodules = ({"wrapInstallPackageStyle":"wrapInstallPackageStyle___AU1GI","installPackageStyle":"installPackageStyle___k2iyn","title":"title___oN9OA","line":"line___PxUeH","bodyHeight":"bodyHeight___QO5he"});
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/DesModal/index.tsx
var DesModal = function DesModal(_ref) {
var _installPackage$small, _installPackage$small2;
var installPackage = _ref.installPackage,
visible = _ref.visible,
setVisible = _ref.setVisible;
(0,react.useEffect)(function () {
if (visible) {
document.body.setAttribute('class', DesModalmodules.bodyHeight);
} else {
document.body.removeAttribute('class');
}
return function () {
document.body.removeAttribute('class');
};
}, [visible]);
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
keyboard: false,
destroyOnClose: true,
open: visible,
title: "\u73AF\u5883\u4ECB\u7ECD",
width: "1000px",
wrapClassName: DesModalmodules.wrapInstallPackageStyle,
footer: null,
onCancel: function onCancel() {
return setVisible(false);
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: DesModalmodules.installPackageStyle,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mb30",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: DesModalmodules.title,
children: installPackage.mainTypeName
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: installPackage.mainTypeDescription
})
})]
}), !!(installPackage !== null && installPackage !== void 0 && (_installPackage$small = installPackage.smallType) !== null && _installPackage$small !== void 0 && _installPackage$small.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: DesModalmodules.line
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: installPackage === null || installPackage === void 0 ? void 0 : (_installPackage$small2 = installPackage.smallType) === null || _installPackage$small2 === void 0 ? void 0 : _installPackage$small2.map(function (e, i) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: DesModalmodules.title,
style: {
marginBottom: 14
},
children: e.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mb30",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: e.des
})
})]
}, i);
})
})]
})
});
};
/* harmony default export */ var components_DesModal = (DesModal);
/***/ }),
/***/ 81643:
/*!**********************************************************!*\
!*** ./node_modules/antd/es/_util/getRenderPropValue.js ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": function() { return /* binding */ getRenderPropValue; }
/* harmony export */ });
const getRenderPropValue = propValue => {
if (!propValue) {
return null;
}
if (typeof propValue === 'function') {
return propValue();
}
return propValue;
};
/***/ }),
/***/ 49288:
/*!*****************************************************!*\
!*** ./node_modules/antd/es/auto-complete/index.js ***!
\*****************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 94184);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/Children/toArray */ 37419);
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rc-util/es/omit */ 10366);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var _util_PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../_util/PurePanel */ 8745);
/* harmony import */ var _util_reactNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../_util/reactNode */ 96159);
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config-provider */ 53124);
/* harmony import */ var _select__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../select */ 79035);
'use client';
const {
Option
} = _select__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z;
function isSelectOptionOrSelectOptGroup(child) {
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
}
const AutoComplete = (props, ref) => {
const {
prefixCls: customizePrefixCls,
className,
popupClassName,
dropdownClassName,
children,
dataSource
} = props;
const childNodes = (0,rc_util_es_Children_toArray__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(children);
// ============================= Input =============================
let customizeInput;
if (childNodes.length === 1 && (0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {
[customizeInput] = childNodes;
}
const getInputElement = customizeInput ? () => customizeInput : undefined;
// ============================ Options ============================
let optionChildren;
// [Legacy] convert `children` or `dataSource` into option children
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {
optionChildren = children;
} else {
optionChildren = dataSource ? dataSource.map(item => {
if ((0,_util_reactNode__WEBPACK_IMPORTED_MODULE_4__/* .isValidElement */ .l$)(item)) {
return item;
}
switch (typeof item) {
case 'string':
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
key: item,
value: item
}, item);
case 'object':
{
const {
value: optionValue
} = item;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(Option, {
key: optionValue,
value: optionValue
}, item.text);
}
default:
false ? 0 : void 0;
return undefined;
}
}) : [];
}
if (false) {}
const {
getPrefixCls
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_5__/* .ConfigContext */ .E_);
const prefixCls = getPrefixCls('select', customizePrefixCls);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(_select__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, Object.assign({
ref: ref,
showArrow: false
}, (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(props, ['dataSource', 'dropdownClassName']), {
prefixCls: prefixCls,
popupClassName: popupClassName || dropdownClassName,
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(`${prefixCls}-auto-complete`, className),
mode: _select__WEBPACK_IMPORTED_MODULE_3__/* ["default"].SECRET_COMBOBOX_MODE_DO_NOT_USE */ .Z.SECRET_COMBOBOX_MODE_DO_NOT_USE,
// Internal api
getInputElement
}), optionChildren);
};
const RefAutoComplete = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(AutoComplete);
// We don't care debug panel
/* istanbul ignore next */
const PurePanel = (0,_util_PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)(RefAutoComplete);
RefAutoComplete.Option = Option;
RefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
if (false) {}
/* harmony default export */ __webpack_exports__["Z"] = (RefAutoComplete);
/***/ }),
/***/ 66330:
/*!***************************************************!*\
!*** ./node_modules/antd/es/popover/PurePanel.js ***!
\***************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony exports getOverlay, RawPurePanel */
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 94184);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var rc_tooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-tooltip */ 92419);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config-provider */ 53124);
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 81643);
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style */ 20136);
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 getOverlay = (prefixCls, title, content) => {
if (!title && !content) return undefined;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(react__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
className: `${prefixCls}-title`
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
className: `${prefixCls}-inner-content`
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(content)));
};
const RawPurePanel = props => {
const {
hashId,
prefixCls,
className,
style,
placement = 'top',
title,
content,
children
} = props;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(hashId, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className),
style: style
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
className: `${prefixCls}-arrow`
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(rc_tooltip__WEBPACK_IMPORTED_MODULE_1__/* .Popup */ .G, Object.assign({}, props, {
className: hashId,
prefixCls: prefixCls
}), children || getOverlay(prefixCls, title, content)));
};
const PurePanel = props => {
const {
prefixCls: customizePrefixCls
} = props,
restProps = __rest(props, ["prefixCls"]);
const {
getPrefixCls
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_4__/* .ConfigContext */ .E_);
const prefixCls = getPrefixCls('popover', customizePrefixCls);
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(prefixCls);
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(RawPurePanel, Object.assign({}, restProps, {
prefixCls: prefixCls,
hashId: hashId
})));
};
/* harmony default export */ __webpack_exports__["ZP"] = (PurePanel);
/***/ }),
/***/ 55241:
/*!***********************************************!*\
!*** ./node_modules/antd/es/popover/index.js ***!
\***********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 94184);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 81643);
/* harmony import */ var _util_motion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../_util/motion */ 33603);
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config-provider */ 53124);
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tooltip */ 83062);
/* harmony import */ var _PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PurePanel */ 66330);
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style */ 20136);
'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;
};
// CSSINJS
const Overlay = _ref => {
let {
title,
content,
prefixCls
} = _ref;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
className: `${prefixCls}-title`
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
className: `${prefixCls}-inner-content`
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(content)));
};
const Popover = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((props, ref) => {
const {
prefixCls: customizePrefixCls,
title,
content,
overlayClassName,
placement = 'top',
trigger = 'hover',
mouseEnterDelay = 0.1,
mouseLeaveDelay = 0.1,
overlayStyle = {}
} = props,
otherProps = __rest(props, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle"]);
const {
getPrefixCls
} = react__WEBPACK_IMPORTED_MODULE_1__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_3__/* .ConfigContext */ .E_);
const prefixCls = getPrefixCls('popover', customizePrefixCls);
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(prefixCls);
const rootPrefixCls = getPrefixCls();
const overlayCls = classnames__WEBPACK_IMPORTED_MODULE_0___default()(overlayClassName, hashId);
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(_tooltip__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, Object.assign({
placement: placement,
trigger: trigger,
mouseEnterDelay: mouseEnterDelay,
mouseLeaveDelay: mouseLeaveDelay,
overlayStyle: overlayStyle
}, otherProps, {
prefixCls: prefixCls,
overlayClassName: overlayCls,
ref: ref,
overlay: title || content ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(Overlay, {
prefixCls: prefixCls,
title: title,
content: content
}) : null,
transitionName: (0,_util_motion__WEBPACK_IMPORTED_MODULE_6__/* .getTransitionName */ .mL)(rootPrefixCls, 'zoom-big', otherProps.transitionName),
"data-popover-inject": true
})));
});
if (false) {}
Popover._InternalPanelDoNotUseOrYouWillBeFired = _PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP;
/* harmony default export */ __webpack_exports__["Z"] = (Popover);
/***/ }),
/***/ 20136:
/*!*****************************************************!*\
!*** ./node_modules/antd/es/popover/style/index.js ***!
\*****************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ 14747);
/* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../style/motion */ 50438);
/* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/placementArrow */ 97414);
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 8796);
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ 67968);
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ 45503);
const genBaseStyle = token => {
const {
componentCls,
popoverColor,
minWidth,
fontWeightStrong,
popoverPadding,
boxShadowSecondary,
colorTextHeading,
borderRadiusLG: borderRadius,
zIndexPopup,
marginXS,
colorBgElevated,
popoverBg
} = token;
return [{
[componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
position: 'absolute',
top: 0,
// use `left` to fix https://github.com/ant-design/ant-design/issues/39195
left: {
_skip_check_: true,
value: 0
},
zIndex: zIndexPopup,
fontWeight: 'normal',
whiteSpace: 'normal',
textAlign: 'start',
cursor: 'auto',
userSelect: 'text',
transformOrigin: `var(--arrow-x, 50%) var(--arrow-y, 50%)`,
'--antd-arrow-background-color': colorBgElevated,
'&-rtl': {
direction: 'rtl'
},
'&-hidden': {
display: 'none'
},
[`${componentCls}-content`]: {
position: 'relative'
},
[`${componentCls}-inner`]: {
backgroundColor: popoverBg,
backgroundClip: 'padding-box',
borderRadius,
boxShadow: boxShadowSecondary,
padding: popoverPadding
},
[`${componentCls}-title`]: {
minWidth,
marginBottom: marginXS,
color: colorTextHeading,
fontWeight: fontWeightStrong
},
[`${componentCls}-inner-content`]: {
color: popoverColor
}
})
},
// Arrow Style
(0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(token, {
colorBg: 'var(--antd-arrow-background-color)'
}),
// Pure Render
{
[`${componentCls}-pure`]: {
position: 'relative',
maxWidth: 'none',
margin: token.sizePopupArrow,
display: 'inline-block',
[`${componentCls}-content`]: {
display: 'inline-block'
}
}
}];
};
const genColorStyle = token => {
const {
componentCls
} = token;
return {
[componentCls]: _theme_internal__WEBPACK_IMPORTED_MODULE_2__/* .PresetColors.map */ .i.map(colorKey => {
const lightColor = token[`${colorKey}6`];
return {
[`&${componentCls}-${colorKey}`]: {
'--antd-arrow-background-color': lightColor,
[`${componentCls}-inner`]: {
backgroundColor: lightColor
},
[`${componentCls}-arrow`]: {
background: 'transparent'
}
}
};
})
};
};
const genWireframeStyle = token => {
const {
componentCls,
lineWidth,
lineType,
colorSplit,
paddingSM,
controlHeight,
fontSize,
lineHeight,
padding
} = token;
const titlePaddingBlockDist = controlHeight - Math.round(fontSize * lineHeight);
const popoverTitlePaddingBlockTop = titlePaddingBlockDist / 2;
const popoverTitlePaddingBlockBottom = titlePaddingBlockDist / 2 - lineWidth;
const popoverPaddingHorizontal = padding;
return {
[componentCls]: {
[`${componentCls}-inner`]: {
padding: 0
},
[`${componentCls}-title`]: {
margin: 0,
padding: `${popoverTitlePaddingBlockTop}px ${popoverPaddingHorizontal}px ${popoverTitlePaddingBlockBottom}px`,
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`
},
[`${componentCls}-inner-content`]: {
padding: `${paddingSM}px ${popoverPaddingHorizontal}px`
}
}
};
};
/* harmony default export */ __webpack_exports__["Z"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)('Popover', token => {
const {
colorBgElevated,
colorText,
wireframe
} = token;
const popoverToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__/* .merge */ .TS)(token, {
popoverPadding: 12,
popoverBg: colorBgElevated,
popoverColor: colorText
});
return [genBaseStyle(popoverToken), genColorStyle(popoverToken), wireframe && genWireframeStyle(popoverToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_5__/* .initZoomMotion */ ._y)(popoverToken, 'zoom-big')];
}, token => ({
width: 177,
minWidth: 177,
zIndexPopup: token.zIndexPopupBase + 30
}), {
deprecatedTokens: [['width', 'minWidth']]
}));
/***/ }),
/***/ 33507:
/*!*******************************************************!*\
!*** ./node_modules/antd/es/style/motion/collapse.js ***!
\*******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__) {
"use strict";
const genCollapseMotion = token => ({
[token.componentCls]: {
// For common/openAnimation
[`${token.antCls}-motion-collapse-legacy`]: {
overflow: 'hidden',
'&-active': {
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
}
},
[`${token.antCls}-motion-collapse`]: {
overflow: 'hidden',
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
}
}
});
/* harmony default export */ __webpack_exports__["Z"] = (genCollapseMotion);
/***/ }),
/***/ 5584:
/*!***********************************************************!*\
!*** ./node_modules/antd/lib/date-picker/locale/zh_CN.js ***!
\***********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __webpack_unused_export__;
var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 64836)["default"]);
__webpack_unused_export__ = ({
value: true
});
exports.Z = void 0;
var _zh_CN = _interopRequireDefault(__webpack_require__(/*! rc-picker/lib/locale/zh_CN */ 85369));
var _zh_CN2 = _interopRequireDefault(__webpack_require__(/*! ../../time-picker/locale/zh_CN */ 15704));
// 统一合并为完整的 Locale
const locale = {
lang: Object.assign({
placeholder: '请选择日期',
yearPlaceholder: '请选择年份',
quarterPlaceholder: '请选择季度',
monthPlaceholder: '请选择月份',
weekPlaceholder: '请选择周',
rangePlaceholder: ['开始日期', '结束日期'],
rangeYearPlaceholder: ['开始年份', '结束年份'],
rangeMonthPlaceholder: ['开始月份', '结束月份'],
rangeQuarterPlaceholder: ['开始季度', '结束季度'],
rangeWeekPlaceholder: ['开始周', '结束周']
}, _zh_CN.default),
timePickerLocale: Object.assign({}, _zh_CN2.default)
};
// should add whitespace between char in Button
locale.lang.ok = '确定';
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
var _default = locale;
exports.Z = _default;
/***/ }),
/***/ 15704:
/*!***********************************************************!*\
!*** ./node_modules/antd/lib/time-picker/locale/zh_CN.js ***!
\***********************************************************/
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
const locale = {
placeholder: '请选择时间',
rangePlaceholder: ['开始时间', '结束时间']
};
var _default = locale;
exports["default"] = _default;
/***/ }),
/***/ 85369:
/*!****************************************************!*\
!*** ./node_modules/rc-picker/lib/locale/zh_CN.js ***!
\****************************************************/
/***/ (function(__unused_webpack_module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var locale = {
locale: 'zh_CN',
today: '今天',
now: '此刻',
backToToday: '返回今天',
ok: '确定',
timeSelect: '选择时间',
dateSelect: '选择日期',
weekSelect: '选择周',
clear: '清除',
month: '月',
year: '年',
previousMonth: '上个月 (翻页上键)',
nextMonth: '下个月 (翻页下键)',
monthSelect: '选择月份',
yearSelect: '选择年份',
decadeSelect: '选择年代',
yearFormat: 'YYYY年',
dayFormat: 'D日',
dateFormat: 'YYYY年M月D日',
dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
previousYear: '上一年 (Control键加左方向键)',
nextYear: '下一年 (Control键加右方向键)',
previousDecade: '上一年代',
nextDecade: '下一年代',
previousCentury: '上一世纪',
nextCentury: '下一世纪'
};
var _default = locale;
exports["default"] = _default;
/***/ }),
/***/ 64836:
/*!**********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
\**********************************************************************/
/***/ (function(module) {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ })
}]);