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...

3509 lines
164 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.

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[16845,76678],{
/***/ 85376:
/*!******************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Settings/index.tsx + 11 modules ***!
\******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Detail_Settings; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(39647);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
var _umi_production_exports = __webpack_require__(58011);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
var tabs = __webpack_require__(99313);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
;// 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@7.23.6@@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(85573);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
var monaco_editor = __webpack_require__(34776);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 15 modules
var markdown_editor = __webpack_require__(64681);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
var ExclamationCircleOutlined = __webpack_require__(21040);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
var es_select = __webpack_require__(57809);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(62680);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
var es_checkbox = __webpack_require__(24905);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/popover/index.js
var popover = __webpack_require__(60324);
;// 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__(63176);
;// 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@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/UseCustomScriptModal/index.tsx
var _excluded = ["shixunsDetail", "globalSetting", "loading", "dispatch", "onFinish"];
var TextArea = input/* default */.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 */.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 */.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 */.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 */.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__(38461);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
var RenderHtml = __webpack_require__(78653);
// EXTERNAL MODULE: ./src/pages/Shixuns/New/components/DesModal/index.tsx + 1 modules
var DesModal = __webpack_require__(16830);
// EXTERNAL MODULE: ./src/pages/Shixuns/New/components/CreateEnvironment/index.tsx
var CreateEnvironment = __webpack_require__(32184);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(73400);
;// 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;
var BasicInfo = function BasicInfo(_ref) {
var _user$userInfo, _formValue$name, _shixunsDetail$settin3, _shixunsDetail$settin4, _shixunsDetail$settin5, _shixunsDetail$settin6, _shixunsDetail$settin7, _shixunsDetail$settin8, _shixunsDetail$settin9, _shixunsDetail$settin10, _shixunsDetail$settin11, _shixunsDetail$settin12, _shixunsDetail$settin13, _shixunsDetail$detail2, _shixunsDetail$settin14, _shixunsDetail$detail3, _shixunsDetail$settin15, _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_17_0_2_react.useRef)();
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,_react_17_0_2_react.useState)({}),
_useState2 = slicedToArray_default()(_useState, 2),
formValue = _useState2[0],
setFormValue = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
isPrivate = _useState4[0],
setIsPrivate = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
evaluateScript = _useState6[0],
setEvaluateScript = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
serviceConfigList = _useState8[0],
setServiceConfigList = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)({}),
_useState10 = slicedToArray_default()(_useState9, 2),
installPackage = _useState10[0],
setInstallPackage = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)([]),
_useState12 = slicedToArray_default()(_useState11, 2),
standardScriptList = _useState12[0],
setStandardScripts = _useState12[1];
var _useState13 = (0,_react_17_0_2_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 || (_user$userInfo = _user$userInfo.shixun) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.editable;
(0,_react_17_0_2_react.useEffect)(function () {
var _location$pathname;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 || (_location$pathname = _location$pathname.split('/')) === null || _location$pathname === void 0 ? void 0 : _location$pathname[2];
}, []);
(0,_react_17_0_2_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 */.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 */.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;
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 || (_shixunsDetail$settin = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin === void 0 || (_shixunsDetail$settin = _shixunsDetail$settin.small_type) === null || _shixunsDetail$settin === void 0 ? void 0 : _shixunsDetail$settin.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$settin2, _res$;
var hasMainType, res, id;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
hasMainType = (_shixunsDetail$settin2 = shixunsDetail.setting) === null || _shixunsDetail$settin2 === void 0 || (_shixunsDetail$settin2 = _shixunsDetail$settin2.shixun) === null || _shixunsDetail$settin2 === void 0 ? void 0 : _shixunsDetail$settin2.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 */.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 */.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 */.Z.Item, {
name: "description",
label: "\u7B80\u4ECB:",
children: editable ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
defaultValue: (_shixunsDetail$settin3 = shixunsDetail.setting) === null || _shixunsDetail$settin3 === void 0 || (_shixunsDetail$settin3 = _shixunsDetail$settin3.shixun) === null || _shixunsDetail$settin3 === void 0 ? void 0 : _shixunsDetail$settin3.description
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: (_shixunsDetail$settin4 = shixunsDetail.setting) === null || _shixunsDetail$settin4 === void 0 || (_shixunsDetail$settin4 = _shixunsDetail$settin4.shixun) === null || _shixunsDetail$settin4 === void 0 ? void 0 : _shixunsDetail$settin4.description
})
}), ((_shixunsDetail$settin5 = shixunsDetail.setting) === null || _shixunsDetail$settin5 === void 0 ? void 0 : _shixunsDetail$settin5.shixun.is_jupyter) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.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$settin6 = shixunsDetail.setting) === null || _shixunsDetail$settin6 === void 0 || (_shixunsDetail$settin6 = _shixunsDetail$settin6.shixun) === null || _shixunsDetail$settin6 === void 0 ? void 0 : _shixunsDetail$settin6.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: BasicInfomodules.width180,
name: "trainee",
label: "\u96BE\u6613\u5EA6:",
rules: [{
required: true,
message: '请选择难易度'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
placeholder: "\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6",
disabled: ((_shixunsDetail$settin7 = shixunsDetail.setting) === null || _shixunsDetail$settin7 === void 0 || (_shixunsDetail$settin7 = _shixunsDetail$settin7.shixun) === null || _shixunsDetail$settin7 === void 0 ? void 0 : _shixunsDetail$settin7.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$settin8 = shixunsDetail.setting) === null || _shixunsDetail$settin8 === void 0 || (_shixunsDetail$settin8 = _shixunsDetail$settin8.shixun) === null || _shixunsDetail$settin8 === void 0 ? void 0 : _shixunsDetail$settin8.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.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"], {
placeholder: "\u8BF7\u9009\u62E9\u4E3B\u7C7B\u522B",
disabled: ((_shixunsDetail$settin9 = shixunsDetail.setting) === null || _shixunsDetail$settin9 === void 0 || (_shixunsDetail$settin9 = _shixunsDetail$settin9.shixun) === null || _shixunsDetail$settin9 === void 0 ? void 0 : _shixunsDetail$settin9.status) === 2 ? true : !editable,
children: (_shixunsDetail$settin10 = shixunsDetail.setting) === null || _shixunsDetail$settin10 === void 0 || (_shixunsDetail$settin10 = _shixunsDetail$settin10.shixun) === null || _shixunsDetail$settin10 === void 0 || (_shixunsDetail$settin10 = _shixunsDetail$settin10.main_type) === null || _shixunsDetail$settin10 === void 0 ? void 0 : _shixunsDetail$settin10.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$settin11 = shixunsDetail.setting) === null || _shixunsDetail$settin11 === void 0 || (_shixunsDetail$settin11 = _shixunsDetail$settin11.shixun) === null || _shixunsDetail$settin11 === void 0 ? void 0 : _shixunsDetail$settin11.status) === 2 ? "当前实践项目已经发布,需撤销发布后才能修改该内容" : '',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "subType",
className: "".concat(BasicInfomodules.width280, " ml20"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
placeholder: "\u8BF7\u9009\u62E9\u5C0F\u7C7B\u522B",
mode: "multiple",
disabled: ((_shixunsDetail$settin12 = shixunsDetail.setting) === null || _shixunsDetail$settin12 === void 0 || (_shixunsDetail$settin12 = _shixunsDetail$settin12.shixun) === null || _shixunsDetail$settin12 === void 0 ? void 0 : _shixunsDetail$settin12.status) === 2 ? true : !editable,
children: (_shixunsDetail$settin13 = shixunsDetail.setting) === null || _shixunsDetail$settin13 === void 0 || (_shixunsDetail$settin13 = _shixunsDetail$settin13.shixun) === null || _shixunsDetail$settin13 === void 0 ? void 0 : _shixunsDetail$settin13.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 */.Z.Item, {
className: BasicInfomodules.width180,
name: "evaluationScript",
label: "\u8BC4\u6D4B\u811A\u672C:",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
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$settin14 = shixunsDetail.setting) === null || _shixunsDetail$settin14 === void 0 || (_shixunsDetail$settin14 = _shixunsDetail$settin14.shixun) === null || _shixunsDetail$settin14 === void 0 ? void 0 : _shixunsDetail$settin14.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$settin15 = shixunsDetail.setting) === null || _shixunsDetail$settin15 === void 0 || (_shixunsDetail$settin15 = _shixunsDetail$settin15.shixun) === null || _shixunsDetail$settin15 === void 0 ? void 0 : _shixunsDetail$settin15.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$settin16, _shixunsDetail$settin17, _shixunsDetail$settin18, _shixunsDetail$settin19, _shixunsDetail$settin20, _shixunsDetail$settin21, _shixunsDetail$settin22, _shixunsDetail$settin23;
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$settin16 = shixunsDetail.setting) === null || _shixunsDetail$settin16 === void 0 || (_shixunsDetail$settin16 = _shixunsDetail$settin16.shixun) === null || _shixunsDetail$settin16 === void 0 ? void 0 : _shixunsDetail$settin16.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$settin17 = shixunsDetail.setting) === null || _shixunsDetail$settin17 === void 0 || (_shixunsDetail$settin17 = _shixunsDetail$settin17.shixun) === null || _shixunsDetail$settin17 === void 0 ? void 0 : _shixunsDetail$settin17.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$settin18 = shixunsDetail.setting) === null || _shixunsDetail$settin18 === void 0 || (_shixunsDetail$settin18 = _shixunsDetail$settin18.shixun) === null || _shixunsDetail$settin18 === void 0 ? void 0 : _shixunsDetail$settin18.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$settin19 = shixunsDetail.setting) === null || _shixunsDetail$settin19 === void 0 || (_shixunsDetail$settin19 = _shixunsDetail$settin19.shixun) === null || _shixunsDetail$settin19 === void 0 ? void 0 : _shixunsDetail$settin19.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$settin20 = shixunsDetail.setting) === null || _shixunsDetail$settin20 === void 0 || (_shixunsDetail$settin20 = _shixunsDetail$settin20.shixun) === null || _shixunsDetail$settin20 === void 0 ? void 0 : _shixunsDetail$settin20.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$settin21 = shixunsDetail.setting) === null || _shixunsDetail$settin21 === void 0 || (_shixunsDetail$settin21 = _shixunsDetail$settin21.shixun) === null || _shixunsDetail$settin21 === void 0 ? void 0 : _shixunsDetail$settin21.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$settin22 = shixunsDetail.setting) === null || _shixunsDetail$settin22 === void 0 || (_shixunsDetail$settin22 = _shixunsDetail$settin22.shixun) === null || _shixunsDetail$settin22 === void 0 ? void 0 : _shixunsDetail$settin22.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$settin23 = shixunsDetail.setting) === null || _shixunsDetail$settin23 === void 0 || (_shixunsDetail$settin23 = _shixunsDetail$settin23.shixun) === null || _shixunsDetail$settin23 === void 0 ? void 0 : _shixunsDetail$settin23.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 */.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@7.23.6@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(37205);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(5112);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/auto-complete/index.js
var auto_complete = __webpack_require__(88522);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/badge/index.js + 5 modules
var badge = __webpack_require__(49127);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
var date_picker = __webpack_require__(92641);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/lib/date-picker/locale/zh_CN.js
var zh_CN = __webpack_require__(10527);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(9498);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
;// CONCATENATED MODULE: ./src/pages/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, _shixunsDetail$detail, _shixunsDetail$detail2, _shixunsDetail$settin6, _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_17_0_2_react.useRef)();
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
isCopy = _useState2[0],
setIsCopy = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
openValue = _useState4[0],
setOpenValue = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
selectDepartmentList = _useState6[0],
setSelectDepartmentList = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
departmentList = _useState8[0],
setDepartmentList = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(''),
_useState10 = slicedToArray_default()(_useState9, 2),
departmentValue = _useState10[0],
setDepartmentValue = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(),
_useState12 = slicedToArray_default()(_useState11, 2),
isOpenTime = _useState12[0],
setIsOpenTime = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(),
_useState14 = slicedToArray_default()(_useState13, 2),
openTime = _useState14[0],
setOpenTime = _useState14[1];
var editable = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 || (_user$userInfo = _user$userInfo.shixun) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.editable;
(0,_react_17_0_2_react.useEffect)(function () {
var _location$pathname;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 || (_location$pathname = _location$pathname.split('/')) === null || _location$pathname === void 0 ? void 0 : _location$pathname[2];
handleGetDepartments();
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
var _shixunsDetail$settin, _shixunsDetail$settin2, _shixunsDetail$settin3, _shixunsDetail$settin4, _shixunsDetail$settin5;
if (!shixunsDetail.setting) {
return;
}
setIsCopy((_shixunsDetail$settin = shixunsDetail.setting) === null || _shixunsDetail$settin === void 0 || (_shixunsDetail$settin = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin === void 0 ? void 0 : _shixunsDetail$settin.can_copy);
setOpenValue((_shixunsDetail$settin2 = shixunsDetail.setting) === null || _shixunsDetail$settin2 === void 0 || (_shixunsDetail$settin2 = _shixunsDetail$settin2.shixun) === null || _shixunsDetail$settin2 === void 0 ? void 0 : _shixunsDetail$settin2.use_scope);
setIsOpenTime(!!((_shixunsDetail$settin3 = shixunsDetail.setting) !== null && _shixunsDetail$settin3 !== void 0 && (_shixunsDetail$settin3 = _shixunsDetail$settin3.shixun) !== null && _shixunsDetail$settin3 !== void 0 && _shixunsDetail$settin3.opening_time));
setOpenTime((_shixunsDetail$settin4 = shixunsDetail.setting) === null || _shixunsDetail$settin4 === void 0 || (_shixunsDetail$settin4 = _shixunsDetail$settin4.shixun) === null || _shixunsDetail$settin4 === void 0 ? void 0 : _shixunsDetail$settin4.opening_time);
setSelectDepartmentList((_shixunsDetail$settin5 = shixunsDetail.setting) === null || _shixunsDetail$settin5 === void 0 || (_shixunsDetail$settin5 = _shixunsDetail$settin5.shixun) === null || _shixunsDetail$settin5 === void 0 ? void 0 : _shixunsDetail$settin5.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 */.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 */.ZP.info('请选择开启时间');
return _context2.abrupt("return");
case 3:
if (!(openValue === 1 && !selectDepartmentList.length)) {
_context2.next = 6;
break;
}
message/* default */.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 */.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$settin6 = shixunsDetail.setting) === null || _shixunsDetail$settin6 === void 0 || (_shixunsDetail$settin6 = _shixunsDetail$settin6.shixun) === null || _shixunsDetail$settin6 === void 0 ? void 0 : _shixunsDetail$settin6.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"], {
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: ./src/pages/Shixuns/Detail/Settings/components/TestCase/index.tsx + 1 modules
var TestCase = __webpack_require__(69104);
;// 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;
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_17_0_2_react.useRef)();
var _useState = (0,_react_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
vnc = _useState2[0],
setVNC = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
websshShow = _useState4[0],
setWebsshShow = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
sshRadioValue = _useState6[0],
setSshRadioValue = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(),
_useState8 = slicedToArray_default()(_useState7, 2),
multiWebssh = _useState8[0],
setMultiWebssh = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)(),
_useState10 = slicedToArray_default()(_useState9, 2),
hideCode = _useState10[0],
setHideCode = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(),
_useState12 = slicedToArray_default()(_useState11, 2),
codeEditPermission = _useState12[0],
setCodeEditPermission = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(),
_useState14 = slicedToArray_default()(_useState13, 2),
codeHidden = _useState14[0],
setCodeHidden = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
forbidCopy = _useState16[0],
setForbidCopy = _useState16[1];
var _useState17 = (0,_react_17_0_2_react.useState)(),
_useState18 = slicedToArray_default()(_useState17, 2),
taskPass = _useState18[0],
setTaskPass = _useState18[1];
var _useState19 = (0,_react_17_0_2_react.useState)(),
_useState20 = slicedToArray_default()(_useState19, 2),
testSetPermission = _useState20[0],
setTestSetPermission = _useState20[1];
var _useState21 = (0,_react_17_0_2_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 || (_user$userInfo = _user$userInfo.shixun) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.editable;
(0,_react_17_0_2_react.useEffect)(function () {
var _location$pathname;
shixunId.current = (_location$pathname = location.pathname) === null || _location$pathname === void 0 || (_location$pathname = _location$pathname.split('/')) === null || _location$pathname === void 0 ? void 0 : _location$pathname[2];
}, []);
(0,_react_17_0_2_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;
if (!shixunsDetail.setting) {
return;
}
setVNC((_shixunsDetail$settin = shixunsDetail.setting) === null || _shixunsDetail$settin === void 0 || (_shixunsDetail$settin = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin === void 0 ? void 0 : _shixunsDetail$settin.vnc);
setWebsshShow(!!((_shixunsDetail$settin2 = shixunsDetail.setting) !== null && _shixunsDetail$settin2 !== void 0 && (_shixunsDetail$settin2 = _shixunsDetail$settin2.shixun) !== null && _shixunsDetail$settin2 !== void 0 && _shixunsDetail$settin2.webssh));
setSshRadioValue((_shixunsDetail$settin3 = shixunsDetail.setting) === null || _shixunsDetail$settin3 === void 0 || (_shixunsDetail$settin3 = _shixunsDetail$settin3.shixun) === null || _shixunsDetail$settin3 === void 0 ? void 0 : _shixunsDetail$settin3.webssh);
setMultiWebssh((_shixunsDetail$settin4 = shixunsDetail.setting) === null || _shixunsDetail$settin4 === void 0 || (_shixunsDetail$settin4 = _shixunsDetail$settin4.shixun) === null || _shixunsDetail$settin4 === void 0 ? void 0 : _shixunsDetail$settin4.multi_webssh);
setHideCode((_shixunsDetail$settin5 = shixunsDetail.setting) === null || _shixunsDetail$settin5 === void 0 || (_shixunsDetail$settin5 = _shixunsDetail$settin5.shixun) === null || _shixunsDetail$settin5 === void 0 ? void 0 : _shixunsDetail$settin5.hide_code);
setCodeEditPermission((_shixunsDetail$settin6 = shixunsDetail.setting) === null || _shixunsDetail$settin6 === void 0 || (_shixunsDetail$settin6 = _shixunsDetail$settin6.shixun) === null || _shixunsDetail$settin6 === void 0 ? void 0 : _shixunsDetail$settin6.code_edit_permission);
setCodeHidden((_shixunsDetail$settin7 = shixunsDetail.setting) === null || _shixunsDetail$settin7 === void 0 || (_shixunsDetail$settin7 = _shixunsDetail$settin7.shixun) === null || _shixunsDetail$settin7 === void 0 ? void 0 : _shixunsDetail$settin7.code_hidden);
setForbidCopy((_shixunsDetail$settin8 = shixunsDetail.setting) === null || _shixunsDetail$settin8 === void 0 || (_shixunsDetail$settin8 = _shixunsDetail$settin8.shixun) === null || _shixunsDetail$settin8 === void 0 ? void 0 : _shixunsDetail$settin8.forbid_copy);
setTaskPass((_shixunsDetail$settin9 = shixunsDetail.setting) === null || _shixunsDetail$settin9 === void 0 || (_shixunsDetail$settin9 = _shixunsDetail$settin9.shixun) === null || _shixunsDetail$settin9 === void 0 ? void 0 : _shixunsDetail$settin9.task_pass);
setTestSetPermission((_shixunsDetail$settin10 = shixunsDetail.setting) === null || _shixunsDetail$settin10 === void 0 || (_shixunsDetail$settin10 = _shixunsDetail$settin10.shixun) === null || _shixunsDetail$settin10 === void 0 ? void 0 : _shixunsDetail$settin10.test_set_permission);
set_display_git_address((_shixunsDetail$settin11 = shixunsDetail.setting.shixun) === null || _shixunsDetail$settin11 === void 0 ? void 0 : _shixunsDetail$settin11.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 */.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__(57785);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
var skeleton = __webpack_require__(84578);
;// 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"});
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(56648);
;// 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, _user$userInfo;
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_17_0_2_react.useRef)((_location$pathname = location.pathname) === null || _location$pathname === void 0 || (_location$pathname = _location$pathname.split('/')) === null || _location$pathname === void 0 ? void 0 : _location$pathname[2]);
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
answer = _useState2[0],
setAnswer = _useState2[1];
var _useState3 = (0,_react_17_0_2_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 || (_user$userInfo = _user$userInfo.shixun) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.editable;
(0,_react_17_0_2_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 */.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 */.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 */.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 */.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 */.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 */.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, _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_17_0_2_react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
activeKey = _useState2[0],
setActiveKey = _useState2[1];
var shixunId = (0,_react_17_0_2_react.useRef)('');
var is_creator = (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 || (_user$userInfo = _user$userInfo.shixun) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.is_creator;
(0,_react_17_0_2_react.useEffect)(function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: false
});
return function () {
dispatch({
type: 'globalSetting/footerToggle',
payload: true
});
};
}, []);
(0,_react_17_0_2_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 */.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 */.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$courses, _quote$courses2;
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 */.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 || (_quote$subjects2 = _quote$subjects2.splice(0, 2)) === null || _quote$subjects2 === void 0 ? void 0 : _quote$subjects2.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 || (_quote$courses2 = _quote$courses2.splice(0, 2)) === null || _quote$courses2 === void 0 ? void 0 : _quote$courses2.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 */.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;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mr20",
children: [is_creator ? (shixunsDetail === null || shixunsDetail === 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 || (_shixunsDetail$settin = _shixunsDetail$settin.shixun) === null || _shixunsDetail$settin === void 0 ? void 0 : _shixunsDetail$settin.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)(TestCase/* default */.Z, {
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));
/***/ }),
/***/ 32184:
/*!**********************************************************************!*\
!*** ./src/pages/Shixuns/New/components/CreateEnvironment/index.tsx ***!
\**********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! umi */ 58011);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 43418);
/* 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 */ 37712);
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_SJ5m_develop_node_modules_babel_runtime_7_23_6_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 || (_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"] */ .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));
/***/ }),
/***/ 16830:
/*!*************************************************************************!*\
!*** ./src/pages/Shixuns/New/components/DesModal/index.tsx + 1 modules ***!
\*************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_DesModal; }
});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
var RenderHtml = __webpack_require__(78653);
;// 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@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// 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_17_0_2_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 || (_installPackage$small2 = installPackage.smallType) === null || _installPackage$small2 === void 0 ? void 0 : _installPackage$small2.map(function (e, i) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_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);
/***/ }),
/***/ 56762:
/*!************************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useForceUpdate.js ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ useForceUpdate; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
function useForceUpdate() {
const [, forceUpdate] = react__WEBPACK_IMPORTED_MODULE_0__.useReducer(x => x + 1, 0);
return forceUpdate;
}
/***/ }),
/***/ 24905:
/*!************************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ es_checkbox; }
});
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
var _classnames_2_5_1_classnames = __webpack_require__(92310);
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
// EXTERNAL MODULE: ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js
var es = __webpack_require__(5630);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
var config_provider_context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
var DisabledContext = __webpack_require__(1684);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/context.js
var context = __webpack_require__(32441);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/GroupContext.js
const GroupContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js
var checkbox_style = __webpack_require__(98447);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
var wave = __webpack_require__(14088);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/interface.js
var wave_interface = __webpack_require__(4572);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Checkbox.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const InternalCheckbox = (props, ref) => {
var _a;
const {
prefixCls: customizePrefixCls,
className,
rootClassName,
children,
indeterminate = false,
style,
onMouseEnter,
onMouseLeave,
skipGroup = false,
disabled
} = props,
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
const {
getPrefixCls,
direction,
checkbox
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
const checkboxGroup = _react_17_0_2_react.useContext(checkbox_GroupContext);
const {
isFormItemInput
} = _react_17_0_2_react.useContext(context/* FormItemInputContext */.aM);
const contextDisabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
const prevValue = _react_17_0_2_react.useRef(restProps.value);
_react_17_0_2_react.useEffect(() => {
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
false ? 0 : void 0;
}, []);
_react_17_0_2_react.useEffect(() => {
if (skipGroup) {
return;
}
if (restProps.value !== prevValue.current) {
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
prevValue.current = restProps.value;
}
return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
}, [restProps.value]);
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
const checkboxProps = Object.assign({}, restProps);
if (checkboxGroup && !skipGroup) {
checkboxProps.onChange = function () {
if (restProps.onChange) {
restProps.onChange.apply(restProps, arguments);
}
if (checkboxGroup.toggleOption) {
checkboxGroup.toggleOption({
label: children,
value: restProps.value
});
}
};
checkboxProps.name = checkboxGroup.name;
checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
}
const classString = _classnames_2_5_1_classnames_default()(`${prefixCls}-wrapper`, {
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, hashId);
const checkboxClass = _classnames_2_5_1_classnames_default()({
[`${prefixCls}-indeterminate`]: indeterminate
}, wave_interface/* TARGET_CLS */.A, hashId);
const ariaChecked = indeterminate ? 'mixed' : undefined;
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
component: "Checkbox",
disabled: mergedDisabled
}, /*#__PURE__*/_react_17_0_2_react.createElement("label", {
className: classString,
style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave
}, /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({
"aria-checked": ariaChecked
}, checkboxProps, {
prefixCls: prefixCls,
className: checkboxClass,
disabled: mergedDisabled,
ref: ref
})), children !== undefined && /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children))));
};
const Checkbox = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalCheckbox);
if (false) {}
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.24.1@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
var toConsumableArray = __webpack_require__(45112);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/omit.js
var omit = __webpack_require__(62805);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Group.js
"use client";
var Group_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const InternalGroup = (props, ref) => {
const {
defaultValue,
children,
options = [],
prefixCls: customizePrefixCls,
className,
rootClassName,
style,
onChange
} = props,
restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
const {
getPrefixCls,
direction
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
const [value, setValue] = _react_17_0_2_react.useState(restProps.value || defaultValue || []);
const [registeredValues, setRegisteredValues] = _react_17_0_2_react.useState([]);
_react_17_0_2_react.useEffect(() => {
if ('value' in restProps) {
setValue(restProps.value || []);
}
}, [restProps.value]);
const memoOptions = _react_17_0_2_react.useMemo(() => options.map(option => {
if (typeof option === 'string' || typeof option === 'number') {
return {
label: option,
value: option
};
}
return option;
}), [options]);
const cancelValue = val => {
setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
};
const registerValue = val => {
setRegisteredValues(prevValues => [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]));
};
const toggleOption = option => {
const optionIndex = value.indexOf(option.value);
const newValue = (0,toConsumableArray/* default */.Z)(value);
if (optionIndex === -1) {
newValue.push(option.value);
} else {
newValue.splice(optionIndex, 1);
}
if (!('value' in restProps)) {
setValue(newValue);
}
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
const indexA = memoOptions.findIndex(opt => opt.value === a);
const indexB = memoOptions.findIndex(opt => opt.value === b);
return indexA - indexB;
}));
};
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
const groupPrefixCls = `${prefixCls}-group`;
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
const domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
const childrenNode = options.length ? memoOptions.map(option => /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_Checkbox, {
prefixCls: prefixCls,
key: option.value.toString(),
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
value: option.value,
checked: value.includes(option.value),
onChange: option.onChange,
className: `${groupPrefixCls}-item`,
style: option.style,
title: option.title
}, option.label)) : children;
// eslint-disable-next-line react/jsx-no-constructed-context-values
const context = {
toggleOption,
value,
disabled: restProps.disabled,
name: restProps.name,
// https://github.com/ant-design/ant-design/issues/16376
registerValue,
cancelValue
};
const classString = _classnames_2_5_1_classnames_default()(groupPrefixCls, {
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
}, className, rootClassName, hashId);
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
className: classString,
style: style
}, domProps, {
ref: ref
}), /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_GroupContext.Provider, {
value: context
}, childrenNode)));
};
const CheckboxGroup = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalGroup);
/* harmony default export */ var Group = (/*#__PURE__*/_react_17_0_2_react.memo(CheckboxGroup));
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js
"use client";
const es_checkbox_Checkbox = checkbox_Checkbox;
es_checkbox_Checkbox.Group = Group;
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
if (false) {}
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
/***/ }),
/***/ 98447:
/*!******************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js ***!
\******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ C2: function() { return /* binding */ getStyle; }
/* harmony export */ });
/* unused harmony export genCheckboxStyle */
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ 87832);
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ 37613);
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 83116);
// ============================== Styles ==============================
const genCheckboxStyle = token => {
const {
checkboxCls
} = token;
const wrapperCls = `${checkboxCls}-wrapper`;
return [
// ===================== Basic =====================
{
// Group
[`${checkboxCls}-group`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
display: 'inline-flex',
flexWrap: 'wrap',
columnGap: token.marginXS,
// Group > Grid
[`> ${token.antCls}-row`]: {
flex: 1
}
}),
// Wrapper
[wrapperCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
display: 'inline-flex',
alignItems: 'baseline',
cursor: 'pointer',
// Fix checkbox & radio in flex align #30260
'&:after': {
display: 'inline-block',
width: 0,
overflow: 'hidden',
content: "'\\a0'"
},
// Checkbox near checkbox
[`& + ${wrapperCls}`]: {
marginInlineStart: 0
},
[`&${wrapperCls}-in-form-item`]: {
'input[type="checkbox"]': {
width: 14,
height: 14 // FIXME: magic
}
}
}),
// Wrapper > Checkbox
[checkboxCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
position: 'relative',
whiteSpace: 'nowrap',
lineHeight: 1,
cursor: 'pointer',
borderRadius: token.borderRadiusSM,
// To make alignment right when `controlHeight` is changed
// Ref: https://github.com/ant-design/ant-design/issues/41564
alignSelf: 'center',
// Wrapper > Checkbox > input
[`${checkboxCls}-input`]: {
position: 'absolute',
// Since baseline align will get additional space offset,
// we need to move input to top to make it align with text.
// Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
inset: 0,
zIndex: 1,
cursor: 'pointer',
opacity: 0,
margin: 0,
[`&:focus-visible + ${checkboxCls}-inner`]: Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .genFocusOutline */ .oN)(token))
},
// Wrapper > Checkbox > inner
[`${checkboxCls}-inner`]: {
boxSizing: 'border-box',
position: 'relative',
top: 0,
insetInlineStart: 0,
display: 'block',
width: token.checkboxSize,
height: token.checkboxSize,
direction: 'ltr',
backgroundColor: token.colorBgContainer,
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
borderRadius: token.borderRadiusSM,
borderCollapse: 'separate',
transition: `all ${token.motionDurationSlow}`,
'&:after': {
boxSizing: 'border-box',
position: 'absolute',
top: '50%',
insetInlineStart: '21.5%',
display: 'table',
width: token.checkboxSize / 14 * 5,
height: token.checkboxSize / 14 * 8,
border: `${token.lineWidthBold}px solid ${token.colorWhite}`,
borderTop: 0,
borderInlineStart: 0,
transform: 'rotate(45deg) scale(0) translate(-50%,-50%)',
opacity: 0,
content: '""',
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
}
},
// Wrapper > Checkbox + Text
'& + span': {
paddingInlineStart: token.paddingXS,
paddingInlineEnd: token.paddingXS
}
})
},
// ===================== Hover =====================
{
// Wrapper & Wrapper > Checkbox
[`
${wrapperCls}:not(${wrapperCls}-disabled),
${checkboxCls}:not(${checkboxCls}-disabled)
`]: {
[`&:hover ${checkboxCls}-inner`]: {
borderColor: token.colorPrimary
}
},
[`${wrapperCls}:not(${wrapperCls}-disabled)`]: {
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled) ${checkboxCls}-inner`]: {
backgroundColor: token.colorPrimaryHover,
borderColor: 'transparent'
},
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled):after`]: {
borderColor: token.colorPrimaryHover
}
}
},
// ==================== Checked ====================
{
// Wrapper > Checkbox
[`${checkboxCls}-checked`]: {
[`${checkboxCls}-inner`]: {
backgroundColor: token.colorPrimary,
borderColor: token.colorPrimary,
'&:after': {
opacity: 1,
transform: 'rotate(45deg) scale(1) translate(-50%,-50%)',
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
}
}
},
[`
${wrapperCls}-checked:not(${wrapperCls}-disabled),
${checkboxCls}-checked:not(${checkboxCls}-disabled)
`]: {
[`&:hover ${checkboxCls}-inner`]: {
backgroundColor: token.colorPrimaryHover,
borderColor: 'transparent'
}
}
},
// ================= Indeterminate =================
{
[checkboxCls]: {
'&-indeterminate': {
// Wrapper > Checkbox > inner
[`${checkboxCls}-inner`]: {
backgroundColor: token.colorBgContainer,
borderColor: token.colorBorder,
'&:after': {
top: '50%',
insetInlineStart: '50%',
width: token.fontSizeLG / 2,
height: token.fontSizeLG / 2,
backgroundColor: token.colorPrimary,
border: 0,
transform: 'translate(-50%, -50%) scale(1)',
opacity: 1,
content: '""'
}
}
}
}
},
// ==================== Disable ====================
{
// Wrapper
[`${wrapperCls}-disabled`]: {
cursor: 'not-allowed'
},
// Wrapper > Checkbox
[`${checkboxCls}-disabled`]: {
// Wrapper > Checkbox > input
[`&, ${checkboxCls}-input`]: {
cursor: 'not-allowed',
// Disabled for native input to enable Tooltip event handler
// ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
pointerEvents: 'none'
},
// Wrapper > Checkbox > inner
[`${checkboxCls}-inner`]: {
background: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
'&:after': {
borderColor: token.colorTextDisabled
}
},
'&:after': {
display: 'none'
},
'& + span': {
color: token.colorTextDisabled
},
[`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
background: token.colorTextDisabled
}
}
}];
};
// ============================== Export ==============================
function getStyle(prefixCls, token) {
const checkboxToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__/* .merge */ .TS)(token, {
checkboxCls: `.${prefixCls}`,
checkboxSize: token.controlInteractiveSize
});
return [genCheckboxStyle(checkboxToken)];
}
/* harmony default export */ __webpack_exports__.ZP = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)('Checkbox', (token, _ref) => {
let {
prefixCls
} = _ref;
return [getStyle(prefixCls, token)];
}));
/***/ }),
/***/ 38854:
/*!************************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ es_dropdown; }
});
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
var dropdown = __webpack_require__(91857);
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
var _classnames_2_5_1_classnames = __webpack_require__(92310);
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/EllipsisOutlined.js + 1 modules
var EllipsisOutlined = __webpack_require__(40090);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules
var space = __webpack_require__(81327);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
var Compact = __webpack_require__(33234);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/style/index.js + 1 modules
var style = __webpack_require__(47211);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown-button.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const DropdownButton = props => {
const {
getPopupContainer: getContextPopupContainer,
getPrefixCls,
direction
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const {
prefixCls: customizePrefixCls,
type = 'default',
danger,
disabled,
loading,
onClick,
htmlType,
children,
className,
menu,
arrow,
autoFocus,
overlay,
trigger,
align,
open,
onOpenChange,
placement,
getPopupContainer,
href,
icon = /*#__PURE__*/_react_17_0_2_react.createElement(EllipsisOutlined/* default */.Z, null),
title,
buttonsRender = buttons => buttons,
mouseEnterDelay,
mouseLeaveDelay,
overlayClassName,
overlayStyle,
destroyPopupOnHide,
dropdownRender
} = props,
restProps = __rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]);
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
const buttonPrefixCls = `${prefixCls}-button`;
const [wrapSSR, hashId] = (0,style/* default */.Z)(prefixCls);
const dropdownProps = {
menu,
arrow,
autoFocus,
align,
disabled,
trigger: disabled ? [] : trigger,
onOpenChange,
getPopupContainer: getPopupContainer || getContextPopupContainer,
mouseEnterDelay,
mouseLeaveDelay,
overlayClassName,
overlayStyle,
destroyPopupOnHide,
dropdownRender
};
const {
compactSize,
compactItemClassnames
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
const classes = _classnames_2_5_1_classnames_default()(buttonPrefixCls, compactItemClassnames, className, hashId);
if ('overlay' in props) {
dropdownProps.overlay = overlay;
}
if ('open' in props) {
dropdownProps.open = open;
}
if ('placement' in props) {
dropdownProps.placement = placement;
} else {
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
}
const leftButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
type: type,
danger: danger,
disabled: disabled,
loading: loading,
onClick: onClick,
htmlType: htmlType,
href: href,
title: title
}, children);
const rightButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
type: type,
danger: danger,
icon: icon
});
const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(space/* default */.Z.Compact, Object.assign({
className: classes,
size: compactSize,
block: true
}, restProps), leftButtonToRender, /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({}, dropdownProps), rightButtonToRender)));
};
DropdownButton.__ANT_BUTTON = true;
/* harmony default export */ var dropdown_button = (DropdownButton);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js
"use client";
const Dropdown = dropdown/* default */.Z;
Dropdown.Button = dropdown_button;
/* harmony default export */ var es_dropdown = (Dropdown);
/***/ }),
/***/ 57809:
/*!**********************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/select/index.js ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var rc_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-select */ 77861);
/* harmony import */ var rc_util_es_omit__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rc-util/es/omit */ 62805);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var _util_PurePanel__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../_util/PurePanel */ 53487);
/* harmony import */ var _util_motion__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../_util/motion */ 62892);
/* harmony import */ var _util_statusUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../_util/statusUtils */ 19080);
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config-provider */ 36355);
/* harmony import */ var _config_provider_DisabledContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../config-provider/DisabledContext */ 1684);
/* harmony import */ var _config_provider_defaultRenderEmpty__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../config-provider/defaultRenderEmpty */ 93891);
/* harmony import */ var _config_provider_hooks_useSize__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../config-provider/hooks/useSize */ 19716);
/* harmony import */ var _form_context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../form/context */ 32441);
/* harmony import */ var _space_Compact__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../space/Compact */ 33234);
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style */ 14154);
/* harmony import */ var _useBuiltinPlacements__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./useBuiltinPlacements */ 58582);
/* harmony import */ var _useShowArrow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./useShowArrow */ 84443);
/* harmony import */ var _utils_iconUtil__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/iconUtil */ 66339);
"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;
};
// TODO: 4.0 - codemod should help to change `filterOption` to support node props.
const SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
const InternalSelect = (_a, ref) => {
var _b;
var {
prefixCls: customizePrefixCls,
bordered = true,
className,
rootClassName,
getPopupContainer,
popupClassName,
dropdownClassName,
listHeight = 256,
placement,
listItemHeight = 24,
size: customizeSize,
disabled: customDisabled,
notFoundContent,
status: customStatus,
builtinPlacements,
dropdownMatchSelectWidth,
popupMatchSelectWidth,
direction: propDirection,
style,
allowClear
} = _a,
props = __rest(_a, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear"]);
const {
getPopupContainer: getContextPopupContainer,
getPrefixCls,
renderEmpty,
direction: contextDirection,
virtual,
popupMatchSelectWidth: contextPopupMatchSelectWidth,
popupOverflow,
select
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_3__/* .ConfigContext */ .E_);
const prefixCls = getPrefixCls('select', customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const direction = propDirection !== null && propDirection !== void 0 ? propDirection : contextDirection;
const {
compactSize,
compactItemClassnames
} = (0,_space_Compact__WEBPACK_IMPORTED_MODULE_4__/* .useCompactItemContext */ .ri)(prefixCls, direction);
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(prefixCls);
const mode = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => {
const {
mode: m
} = props;
if (m === 'combobox') {
return undefined;
}
if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {
return 'combobox';
}
return m;
}, [props.mode]);
const isMultiple = mode === 'multiple' || mode === 'tags';
const showSuffixIcon = (0,_useShowArrow__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)(props.suffixIcon, props.showArrow);
const mergedPopupMatchSelectWidth = (_b = popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth) !== null && _b !== void 0 ? _b : contextPopupMatchSelectWidth;
// ===================== Form Status =====================
const {
status: contextStatus,
hasFeedback,
isFormItemInput,
feedbackIcon
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_form_context__WEBPACK_IMPORTED_MODULE_7__/* .FormItemInputContext */ .aM);
const mergedStatus = (0,_util_statusUtils__WEBPACK_IMPORTED_MODULE_8__/* .getMergedStatus */ .F)(contextStatus, customStatus);
// ===================== Empty =====================
let mergedNotFound;
if (notFoundContent !== undefined) {
mergedNotFound = notFoundContent;
} else if (mode === 'combobox') {
mergedNotFound = null;
} else {
mergedNotFound = (renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Select')) || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(_config_provider_defaultRenderEmpty__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {
componentName: "Select"
});
}
// ===================== Icons =====================
const {
suffixIcon,
itemIcon,
removeIcon,
clearIcon
} = (0,_utils_iconUtil__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z)(Object.assign(Object.assign({}, props), {
multiple: isMultiple,
hasFeedback,
feedbackIcon,
showSuffixIcon,
prefixCls,
showArrow: props.showArrow,
componentName: 'Select'
}));
const mergedAllowClear = allowClear === true ? {
clearIcon
} : allowClear;
const selectProps = (0,rc_util_es_omit__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z)(props, ['suffixIcon', 'itemIcon']);
const rcSelectRtlDropdownClassName = classnames__WEBPACK_IMPORTED_MODULE_0___default()(popupClassName || dropdownClassName, {
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl'
}, rootClassName, hashId);
const mergedSize = (0,_config_provider_hooks_useSize__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)(ctx => {
var _a;
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
});
// ===================== Disabled =====================
const disabled = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider_DisabledContext__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z);
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
const mergedClassName = classnames__WEBPACK_IMPORTED_MODULE_0___default()({
[`${prefixCls}-lg`]: mergedSize === 'large',
[`${prefixCls}-sm`]: mergedSize === 'small',
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-borderless`]: !bordered,
[`${prefixCls}-in-form-item`]: isFormItemInput
}, (0,_util_statusUtils__WEBPACK_IMPORTED_MODULE_8__/* .getStatusClassNames */ .Z)(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, select === null || select === void 0 ? void 0 : select.className, className, rootClassName, hashId);
// ===================== Placement =====================
const memoPlacement = react__WEBPACK_IMPORTED_MODULE_2__.useMemo(() => {
if (placement !== undefined) {
return placement;
}
return direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
}, [placement, direction]);
const mergedBuiltinPlacements = (0,_useBuiltinPlacements__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .Z)(builtinPlacements, popupOverflow);
// ====================== Warning ======================
if (false) {}
// ====================== Render =======================
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(rc_select__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, Object.assign({
ref: ref,
virtual: virtual,
showSearch: select === null || select === void 0 ? void 0 : select.showSearch
}, selectProps, {
style: Object.assign(Object.assign({}, select === null || select === void 0 ? void 0 : select.style), style),
dropdownMatchSelectWidth: mergedPopupMatchSelectWidth,
builtinPlacements: mergedBuiltinPlacements,
transitionName: (0,_util_motion__WEBPACK_IMPORTED_MODULE_15__/* .getTransitionName */ .m)(rootPrefixCls, 'slide-up', props.transitionName),
listHeight: listHeight,
listItemHeight: listItemHeight,
mode: mode,
prefixCls: prefixCls,
placement: memoPlacement,
direction: direction,
suffixIcon: suffixIcon,
menuItemSelectedIcon: itemIcon,
removeIcon: removeIcon,
allowClear: mergedAllowClear,
notFoundContent: mergedNotFound,
className: mergedClassName,
getPopupContainer: getPopupContainer || getContextPopupContainer,
dropdownClassName: rcSelectRtlDropdownClassName,
disabled: mergedDisabled
})));
};
if (false) {}
const Select = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.forwardRef(InternalSelect);
// We don't care debug panel
/* istanbul ignore next */
const PurePanel = (0,_util_PurePanel__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z)(Select);
Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
Select.Option = rc_select__WEBPACK_IMPORTED_MODULE_1__/* .Option */ .Wx;
Select.OptGroup = rc_select__WEBPACK_IMPORTED_MODULE_1__/* .OptGroup */ .Xo;
Select._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
if (false) {}
/* harmony default export */ __webpack_exports__["default"] = (Select);
/***/ }),
/***/ 81327:
/*!*********************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules ***!
\*********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ space; }
});
// UNUSED EXPORTS: SpaceContext
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
var _classnames_2_5_1_classnames = __webpack_require__(92310);
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
// EXTERNAL MODULE: ./node_modules/_rc-util@5.39.1@rc-util/es/Children/toArray.js
var toArray = __webpack_require__(47783);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
var Compact = __webpack_require__(33234);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/context.js
const SpaceContext = /*#__PURE__*/_react_17_0_2_react.createContext({
latestIndex: 0
});
const SpaceContextProvider = SpaceContext.Provider;
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Item.js
"use client";
const Item = _ref => {
let {
className,
index,
children,
split,
style
} = _ref;
const {
latestIndex
} = _react_17_0_2_react.useContext(SpaceContext);
if (children === null || children === undefined) {
return null;
}
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
className: className,
style: style
}, children), index < latestIndex && split && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: `${className}-split`
}, split));
};
/* harmony default export */ var space_Item = (Item);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/style/index.js + 1 modules
var space_style = __webpack_require__(2856);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/utils.js
function isPresetSize(size) {
return ['small', 'middle', 'large'].includes(size);
}
function isValidGapNumber(size) {
if (!size) {
// The case of size = 0 is deliberately excluded here, because the default value of the gap attribute in CSS is 0, so if the user passes 0 in, we can directly ignore it.
return false;
}
return typeof size === 'number' && !Number.isNaN(size);
}
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const Space = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
var _a, _b;
const {
getPrefixCls,
space,
direction: directionConfig
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const {
size = (space === null || space === void 0 ? void 0 : space.size) || 'small',
align,
className,
rootClassName,
children,
direction = 'horizontal',
prefixCls: customizePrefixCls,
split,
style,
wrap = false,
classNames: customClassNames,
styles
} = props,
otherProps = __rest(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]);
const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
const isPresetVerticalSize = isPresetSize(verticalSize);
const isPresetHorizontalSize = isPresetSize(horizontalSize);
const isValidVerticalSize = isValidGapNumber(verticalSize);
const isValidHorizontalSize = isValidGapNumber(horizontalSize);
const childNodes = (0,toArray/* default */.Z)(children, {
keepEmpty: true
});
const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
const prefixCls = getPrefixCls('space', customizePrefixCls);
const [wrapSSR, hashId] = (0,space_style/* default */.Z)(prefixCls);
const cls = _classnames_2_5_1_classnames_default()(prefixCls, space === null || space === void 0 ? void 0 : space.className, hashId, `${prefixCls}-${direction}`, {
[`${prefixCls}-rtl`]: directionConfig === 'rtl',
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
[`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
[`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
}, className, rootClassName);
const itemClassName = _classnames_2_5_1_classnames_default()(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.classNames) === null || _b === void 0 ? void 0 : _b.item);
// Calculate latest one
let latestIndex = 0;
const nodes = childNodes.map((child, i) => {
var _a, _b;
if (child !== null && child !== undefined) {
latestIndex = i;
}
const key = child && child.key || `${itemClassName}-${i}`;
return /*#__PURE__*/_react_17_0_2_react.createElement(space_Item, {
className: itemClassName,
key: key,
index: i,
split: split,
style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.styles) === null || _b === void 0 ? void 0 : _b.item
}, child);
});
const spaceContext = _react_17_0_2_react.useMemo(() => ({
latestIndex
}), [latestIndex]);
// =========================== Render ===========================
if (childNodes.length === 0) {
return null;
}
const gapStyle = {};
if (wrap) {
gapStyle.flexWrap = 'wrap';
}
if (!isPresetHorizontalSize && isValidHorizontalSize) {
gapStyle.columnGap = horizontalSize;
}
if (!isPresetVerticalSize && isValidVerticalSize) {
gapStyle.rowGap = verticalSize;
}
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
ref: ref,
className: cls,
style: Object.assign(Object.assign(Object.assign({}, gapStyle), space === null || space === void 0 ? void 0 : space.style), style)
}, otherProps), /*#__PURE__*/_react_17_0_2_react.createElement(SpaceContextProvider, {
value: spaceContext
}, nodes)));
});
if (false) {}
const CompoundedSpace = Space;
CompoundedSpace.Compact = Compact/* default */.ZP;
/* harmony default export */ var space = (CompoundedSpace);
/***/ })
}]);