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

3684 lines
179 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],{
/***/ 7333:
/*!**********************************************************!*\
!*** ./src/components/FixedButton/index.tsx + 1 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
t: function() { return /* binding */ FixedButton; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_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/button/index.js
var es_button = __webpack_require__(3113);
;// CONCATENATED MODULE: ./src/components/FixedButton/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var FixedButtonmodules = ({"buttonFixed":"buttonFixed___vyq30","button":"button___hxmYv","buttonWrap":"buttonWrap___uK8dl"});
// EXTERNAL MODULE: ./node_modules/_classnames@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/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/FixedButton/index.tsx
var FixedButton = function FixedButton(_ref) {
var _ref$cancelText = _ref.cancelText,
cancelText = _ref$cancelText === void 0 ? '取消' : _ref$cancelText,
_ref$okText = _ref.okText,
okText = _ref$okText === void 0 ? '确定' : _ref$okText,
_ref$loading = _ref.loading,
loading = _ref$loading === void 0 ? false : _ref$loading,
_ref$hasOkBtn = _ref.hasOkBtn,
hasOkBtn = _ref$hasOkBtn === void 0 ? true : _ref$hasOkBtn,
_ref$hasCancelBtn = _ref.hasCancelBtn,
hasCancelBtn = _ref$hasCancelBtn === void 0 ? true : _ref$hasCancelBtn,
_ref$okButtonProps = _ref.okButtonProps,
okButtonProps = _ref$okButtonProps === void 0 ? {} : _ref$okButtonProps,
_ref$onCancel = _ref.onCancel,
onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel,
_ref$onOk = _ref.onOk,
onOk = _ref$onOk === void 0 ? function () {} : _ref$onOk,
_ref$className = _ref.className,
className = _ref$className === void 0 ? '' : _ref$className;
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: _classnames_2_5_1_classnames_default()(FixedButtonmodules.buttonFixed, className),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: FixedButtonmodules.buttonWrap,
children: [hasCancelBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
size: "middle",
className: "".concat(FixedButtonmodules.button, " mr20")
// 点击取消的返回
,
onClick: onCancel,
children: cancelText
}), hasOkBtn && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, objectSpread2_default()(objectSpread2_default()({
size: 'middle',
type: "primary",
className: "".concat(FixedButtonmodules.button, " mr20"),
loading: loading,
onClick: onOk
}, okButtonProps), {}, {
children: okText
}))]
})
});
};
/***/ }),
/***/ 61251:
/*!*************************************************************************************!*\
!*** ./src/pages/Shixuns/Detail/Settings/components/TestCase/index.tsx + 1 modules ***!
\*************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_TestCase; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(37205);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/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/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(63350);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/collapse/index.js + 8 modules
var collapse = __webpack_require__(36381);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(24650);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/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/input-number/index.js + 14 modules
var input_number = __webpack_require__(94001);
// 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/space/index.js + 3 modules
var space = __webpack_require__(81327);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
var es_select = __webpack_require__(57809);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/switch/index.js + 2 modules
var es_switch = __webpack_require__(78673);
// EXTERNAL MODULE: ./src/components/FixedButton/index.tsx + 1 modules
var FixedButton = __webpack_require__(7333);
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 32 modules
var ui_customization = __webpack_require__(55121);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Detail/Settings/components/TestCase/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var TestCasemodules = ({"wrap":"wrap___BgpUe","row":"row___UWxAG","textarea":"textarea___gaLin","btn":"btn___ZpuhS","sub":"sub___Jd_ZS"});
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
var monaco_editor = __webpack_require__(35406);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(57964);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(66332);
// 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/TestCase/index.tsx
var Panel = collapse/* default */.Z.Panel;
var TextArea = input/* default */.Z.TextArea;
var TestCase = function TestCase(_ref) {
var _userInfo;
var active = _ref.active,
_ref$type = _ref.type,
type = _ref$type === void 0 ? 'jupyter' : _ref$type;
var params = (0,_umi_production_exports.useParams)();
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)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
btnLoading = _useState4[0],
setBtnLoading = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(0),
_useState6 = slicedToArray_default()(_useState5, 2),
activeKey = _useState6[0],
setActiveKey = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
testSetList = _useState8[0],
setTestSetList = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)([]),
_useState10 = slicedToArray_default()(_useState9, 2),
tagsList = _useState10[0],
setTagsList = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)([]),
_useState12 = slicedToArray_default()(_useState11, 2),
list = _useState12[0],
setList = _useState12[1]; //评测脚本下拉
var editable = (_userInfo = (0,authority/* userInfo */.eY)()) === null || _userInfo === void 0 || (_userInfo = _userInfo.shixun) === null || _userInfo === void 0 ? void 0 : _userInfo.editable;
(0,_react_17_0_2_react.useEffect)(function () {
if (active === 'testCase') {
getData();
}
}, [active]);
(0,_react_17_0_2_react.useEffect)(function () {
getTags();
}, []);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var testSetData, res, _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6, _res$data7, _res$data8, _res$data9, _res$data10, _res$data11, _res$data12, _res$data13, initData;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
testSetData = [{
hidden: 0,
input: "",
output: "",
score: 100
}];
_context.next = 3;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(params === null || params === void 0 ? void 0 : params.id, "/jupyter_evalute_setting.json"), {
method: 'get'
});
case 3:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setList(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.standard_scripts);
initData = {
open_evaluate: res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.open_evaluate,
exec_time: (res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.exec_time) || 3,
test_set_score: (res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.test_set_score) === null ? false : res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.test_set_score,
test_set_average: (res === null || res === void 0 || (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.test_set_average) === null ? true : res === null || res === void 0 || (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.test_set_average,
choice_standard_scripts: (res === null || res === void 0 || (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.choice_standard_scripts) || null,
evaluate_script: (res === null || res === void 0 || (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.evaluate_script) || '',
evaluate_method: res === null || res === void 0 || (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.evaluate_method,
use_jupyter_result: res === null || res === void 0 || (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.use_jupyter_result
};
form.setFieldsValue(initData);
setFormValue(initData);
setTestSetList(res !== null && res !== void 0 && (_res$data12 = res.data) !== null && _res$data12 !== void 0 && (_res$data12 = _res$data12.test_sets) !== null && _res$data12 !== void 0 && _res$data12.length ? res === null || res === void 0 || (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : _res$data13.test_sets : testSetData);
}
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var getTags = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res, _res$data14;
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(params === null || params === void 0 ? void 0 : params.id, "/get_jupyter_tags.json"), {
method: 'get'
});
case 2:
res = _context2.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setTagsList((res === null || res === void 0 || (_res$data14 = res.data) === null || _res$data14 === void 0 ? void 0 : _res$data14.list) || []);
}
case 4:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getTags() {
return _ref3.apply(this, arguments);
};
}();
var handleOk = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
var scoreList, sumScore, res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
scoreList = testSetList.map(function (item) {
return item.score;
});
sumScore = scoreList.reduce(function (current, next) {
return current + next;
}, 0);
if (!(values.test_set_score && sumScore !== 100)) {
_context3.next = 5;
break;
}
message/* default */.ZP.warning('测试用例的评分占比之和必须等于100');
return _context3.abrupt("return");
case 5:
if (!(values.evaluate_method === 3 && testSetList !== null && testSetList !== void 0 && testSetList.some(function (e) {
return !e.tags;
}))) {
_context3.next = 8;
break;
}
message/* default */.ZP.warning('请选择指定代码块');
return _context3.abrupt("return");
case 8:
setBtnLoading(true);
_context3.next = 11;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(params === null || params === void 0 ? void 0 : params.id, "/update_jupyter_evaluate_setting.json"), {
method: 'post',
body: objectSpread2_default()(objectSpread2_default()({}, values), {}, {
mirror_script_id: values === null || values === void 0 ? void 0 : values.choice_standard_scripts,
open_evaluate: values !== null && values !== void 0 && values.open_evaluate ? 1 : 0,
test_set: testSetList.map(function (e) {
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
is_file: false
});
})
})
});
case 11:
res = _context3.sent;
if (res.status === 0) {
message/* default */.ZP.success('保存成功');
}
setBtnLoading(false);
case 14:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function handleOk(_x) {
return _ref4.apply(this, arguments);
};
}();
var handleValuesChange = function handleValuesChange(changedValues) {
setFormValue(objectSpread2_default()({}, form.getFieldsValue()));
if ('test_set_average' in changedValues && changedValues !== null && changedValues !== void 0 && changedValues.test_set_average) {
handleShareRatio(testSetList);
}
if ('test_set_score' in changedValues && changedValues !== null && changedValues !== void 0 && changedValues.test_set_score) {
form.setFieldsValue({
test_set_average: true
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, form.getFieldsValue()), {}, {
test_set_average: true
}));
handleShareRatio(testSetList);
}
if ('choice_standard_scripts' in changedValues) {
modal/* default */.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 _callee4() {
var res;
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0,fetch/* default */.ZP)("/api/shixuns/".concat(params === null || params === void 0 ? void 0 : params.id, "/get_script_contents.json"), {
method: 'get',
params: {
id: params === null || params === void 0 ? void 0 : params.id,
script_id: changedValues === null || changedValues === void 0 ? void 0 : changedValues.choice_standard_scripts
}
});
case 2:
res = _context4.sent;
if (res !== null && res !== void 0 && res.content) {
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"
})
});
form.setFieldsValue({
evaluate_script: res === null || res === void 0 ? void 0 : res.content
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, form.getFieldsValue()), {}, {
evaluate_script: res === null || res === void 0 ? void 0 : res.content
}));
}
case 4:
case "end":
return _context4.stop();
}
}, _callee4);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
}
};
var handleShareRatio = function handleShareRatio(testSetData) {
var code_compile_score = 0;
var score = Math.floor((100 - code_compile_score) / testSetData.length);
var lastScore = score + (100 - code_compile_score) % testSetData.length;
testSetData = testSetData.map(function (item, index) {
if (index === testSetData.length - 1) {
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
score: lastScore
});
}
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
score: score
});
});
setTestSetList(testSetData);
};
var handleAddTestSet = function handleAddTestSet() {
var testSetData = [].concat(toConsumableArray_default()(testSetList), [{
hidden: 0,
input: "",
output: "",
score: 0
}]);
if (form.getFieldValue('test_set_average')) {
handleShareRatio(testSetData);
} else {
setTestSetList(testSetData);
}
};
var test_set_score = formValue.test_set_score,
test_set_average = formValue.test_set_average,
choice_standard_scripts = formValue.choice_standard_scripts,
open_evaluate = formValue.open_evaluate;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: TestCasemodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
disabled: !open_evaluate,
layout: "vertical",
onValuesChange: handleValuesChange,
onFinish: handleOk,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "open_evaluate",
style: {
marginTop: 10
},
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
disabled: false,
children: "\u542F\u7528Jupyter\u8BC4\u6D4B\u529F\u80FD"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h4", {
className: "font14",
children: "\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: '评测时长(秒):',
name: "exec_time",
className: TestCasemodules.row,
rules: [{
required: true,
message: '请输入评测时长限制'
}, {
type: 'number',
min: 3,
message: '最小限制时间是3秒'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
size: "large",
style: {
width: 400
},
min: 3
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("h4", {
className: "font14 mb10",
children: "\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "test_set_score",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
direction: "vertical",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: false,
children: ["\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u4EC5\u5F53\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u83B7\u5F97\u4E00\u6B21\u6027\u5956\u52B1\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: true,
children: ["\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u901A\u8FC7\u6D4B\u8BD5\u96C6\u5373\u53EF\u83B7\u5F97\u5BF9\u5E94\u5956\u52B1\uFF09"
})]
})]
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontWeight: 500
},
className: "c-black",
children: "\u8BC4\u6D4B\u8BBE\u7F6E"
}),
name: "evaluate_method",
style: {
flexDirection: 'row',
marginTop: 15
},
rules: [{
required: true,
message: '请选择评测设置'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
direction: "vertical",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: 1,
children: ["\u901A\u8FC7\u6240\u6709\u4EE3\u7801\u5757\u8BC4\u6D4B", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5BF9\u5B66\u5458\u4EFB\u52A1\u6587\u4EF6\u7684\u6240\u6709\u975E\u7A7A\u4EE3\u7801\u5757\u8FDB\u884C\u8BC4\u6D4B\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: 3,
children: ["\u901A\u8FC7\u6307\u5B9A\u4EE3\u7801\u5757\u8BC4\u6D4B", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: " \uFF08\u5BF9\u5B66\u5458\u4EFB\u52A1\u6587\u4EF6\u7684\u6307\u5B9A\u975E\u7A7A\u4EE3\u7801\u5757\u8FDB\u884C\u8BC4\u6D4B\uFF09"
})]
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
justify: "space-between",
className: "font14",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
fontWeight: 500
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: TestCasemodules.sub,
children: "*"
}), "\u6D4B\u8BD5\u7528\u4F8B"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomButton */.op, {
style: {
borderRadius: 2
},
onClick: handleAddTestSet,
children: "\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B"
})
})]
}), test_set_score && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "test_set_average",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: true,
children: "\u5747\u5206\u6BD4\u4F8B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: false,
style: {
marginLeft: 50
},
children: "\u81EA\u5B9A\u4E49\u6BD4\u4F8B"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: testSetList.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(collapse/* default */.Z
// collapsible='icon'
, {
activeKey: activeKey,
onChange: function onChange() {
setActiveKey(function (p) {
return p === key ? null : key;
});
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Panel, {
header: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "font16",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "mr10",
children: ["\u6D4B\u8BD5\u7528\u4F8B", key + 1]
}), formValue.test_set_score && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginLeft: 40
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: {
width: 120
},
value: item.score,
onClick: function onClick(e) {
return e.stopPropagation();
},
type: "number",
disabled: test_set_average,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
score: e.target.value ? Number(e.target.value) : 0
});
}
return test;
});
var data = {
test_set_average: false
};
setFormValue(objectSpread2_default()(objectSpread2_default()({}, formValue), data));
form.setFieldsValue(data);
setTestSetList(testData);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 mr10",
children: "%"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tr flex1",
style: {
"float": 'right'
},
children: key !== 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottom",
title: "删除",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#c5c5c5'
},
className: "current iconfont icon-shanchu4",
onClick: function onClick(e) {
e.stopPropagation();
modal/* default */.Z.confirm({
centered: true,
icon: null,
okText: '确定',
cancelText: '取消',
title: '提示',
content: '确认要删除这个测试用例吗?',
onOk: function onOk() {
var testData = testSetList.filter(function (_, testIndex) {
return testIndex !== key;
});
handleShareRatio(testData);
}
});
}
})
})
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [formValue.evaluate_method === 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "mb20",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: TestCasemodules.sub,
children: "*"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u6307\u5B9A\u4EE3\u7801\u5757"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u8BF7\u5148\u5728Jupyter\u4E2D\u5BF9\u60A8\u9700\u8981\u8BC4\u6D4B\u7684\u6307\u5B9A\u4EE3\u7801\u5757\u5B8C\u6210\u6807\u7B7E\u8BBE\u7F6E\u3002",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
style: {
marginLeft: 6,
marginRight: 20,
color: '#145DFF'
},
className: "iconfont icon-xiaowenhao2 font14"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
value: item.tags,
size: "large",
style: {
width: 450
},
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
tags: e
});
}
return test;
});
setTestSetList(testData);
},
children: tagsList === null || tagsList === void 0 ? void 0 : tagsList.map(function (e) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: e === null || e === void 0 ? void 0 : e.tags,
children: e === null || e === void 0 ? void 0 : e.tags
}, e === null || e === void 0 ? void 0 : e.tags);
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9884\u671F\u8F93\u51FA"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
bordered: false,
className: TestCasemodules.textarea,
rows: 5,
placeholder: "\u9884\u671F\u8F93\u51FA",
value: item.output,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
output: e.target.value
});
}
return test;
});
setTestSetList(testData);
}
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: "mt20",
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u53EF\u89C1\u6027"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "\u5168\u90E8\u9690\u85CF\uFF1A\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7\"print\"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "\u9690\u85CF\u9884\u671F\u8F93\u51FA\uFF1A\u52FE\u9009\u540E\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "\u9690\u85CF\u5B9E\u9645\u8F93\u51FA\uFF1A\u52FE\u9009\u540E\u5B9E\u9645\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
style: {
marginLeft: 6,
marginRight: 13,
color: '#145DFF'
},
className: "iconfont icon-xiaowenhao2 font14"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
className: "font14 ml5",
checked: item.hidden === 1,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
var param = {
is_invisible: false,
actual_output_visible: false
};
if (e.target.checked) {
param = {
is_invisible: true,
actual_output_visible: true
};
}
return objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, test), param), {}, {
hidden: e.target.checked ? 1 : 0
});
}
return test;
});
setTestSetList(testData);
},
children: "\u5168\u90E8\u9690\u85CF"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.is_invisible,
style: {
margin: '0 60px'
},
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
var hidden = 0;
if (e.target.checked && test.actual_output_visible) {
hidden = 1;
}
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
hidden: hidden,
is_invisible: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: "\u9690\u85CF\u9884\u671F\u8F93\u51FA"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.actual_output_visible,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
var hidden = 0;
if (e.target.checked && test.is_invisible) {
hidden = 1;
}
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
hidden: hidden,
actual_output_visible: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: "\u9690\u85CF\u5B9E\u9645\u8F93\u51FA"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt20",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 mr20",
children: "\u7279\u6B8A\u5224\u5B9A:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.last_match_rule,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
last_match_rule: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font14",
children: ["\u672B\u5C3E\u5339\u914D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u6700\u540E\u4E00\u884C\u76F8\u540C\u5373\u53EF\u901A\u5173\uFF09"
})]
})
})]
})]
})
}, key)
}, key);
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("h4", {
className: "font14 mt20 mb10",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: TestCasemodules.sub,
children: "*"
}), "\u8BC4\u6D4B\u811A\u672C"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "choice_standard_scripts",
rules: [{
required: true,
message: '请选择评测脚本'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
getPopupContainer: function getPopupContainer(trigger) {
return trigger.parentNode;
},
size: "large",
style: {
width: 400
},
placeholder: "\u8BF7\u9009\u62E9\u8BC4\u6D4B\u811A\u672C",
children: list.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
value: item.id,
children: item.scptname
}, index);
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: !open_evaluate && "请启用Jupyter评测功能后进行编辑",
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "evaluate_script",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
height: 450,
style: {
border: '1px solid #ccc'
},
language: "shell",
theme: "vs-light",
options: {
readOnly: !open_evaluate
}
})
})
}), (0,authority/* isSuperAdmins */.Ny)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: "mb20",
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "use_jupyter_result",
className: "mt10",
valuePropName: "checked",
noStyle: true,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_switch/* default */.Z, {})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "ml10",
children: "\u662F\u5426\u6CBF\u7528Jupyter\u8FD0\u884C\u7ED3\u679C"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
okText: "\u4FDD\u5B58",
hasOkBtn: editable,
loading: btnLoading,
onCancel: function onCancel() {
return _umi_production_exports.history.push("/shixuns/".concat(params === null || params === void 0 ? void 0 : params.id, "/challenges"));
},
onOk: function onOk() {
return form.submit();
},
className: type === 'jupyterLab' ? TestCasemodules.btn : ''
})]
});
};
/* harmony default export */ var components_TestCase = (TestCase);
/***/ }),
/***/ 28611:
/*!******************************************************************!*\
!*** ./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
var _umi_production_exports = __webpack_require__(63350);
// 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 + 3 modules
var monaco_editor = __webpack_require__(35406);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
var markdown_editor = __webpack_require__(25598);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
var ExclamationCircleOutlined = __webpack_require__(3148);
// 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__(24650);
// 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__(21752);
;// 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__(7333);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 2 modules
var RenderHtml = __webpack_require__(25720);
// EXTERNAL MODULE: ./src/pages/Shixuns/New/components/DesModal/index.tsx + 1 modules
var DesModal = __webpack_require__(73375);
// EXTERNAL MODULE: ./src/pages/Shixuns/New/components/CreateEnvironment/index.tsx
var CreateEnvironment = __webpack_require__(15883);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(80348);
;// 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__(30518);
// 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.13@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(61186);
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__(61251);
;// 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__(91972);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
var skeleton = __webpack_require__(66999);
;// 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__(57964);
;// 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));
/***/ }),
/***/ 21752:
/*!***************************************************************************!*\
!*** ./src/pages/Shixuns/New/components/ApplyModal/index.tsx + 1 modules ***!
\***************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_ApplyModal; }
});
// 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
var _umi_production_exports = __webpack_require__(63350);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(24650);
// 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/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/upload/index.js
var upload = __webpack_require__(60028);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(88499);
// EXTERNAL MODULE: ./src/assets/images/qrCode.png
var qrCode = __webpack_require__(55351);
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/ApplyModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ApplyModalmodules = ({"flexRow":"flexRow___JBN3B","flexColumn":"flexColumn___zXgFj","formWrap":"formWrap___aNgan","upload":"upload___yGdLQ","color0152d9":"color0152d9___zzEpS","colorCCC":"colorCCC___k4Dxq","footerWrap":"footerWrap___WrUZd","qrCode":"qrCode___GPwSg","a1":"a1___R6etl","code":"code___fCL_L","group":"group___n7tgy","groupNumber":"groupNumber___tw7hA","a2":"a2___GGjDE"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Shixuns/New/components/ApplyModal/index.tsx
var _excluded = ["newShixuns", "globalSetting", "loading", "dispatch"];
var TextArea = input/* default */.Z.TextArea;
var ApplyModal = function ApplyModal(_ref) {
var newShixuns = _ref.newShixuns,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, _excluded);
var _Form$useForm = es_form/* default */.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),
fileList = _useState2[0],
setFileList = _useState2[1];
var handleFileChange = function handleFileChange(info) {
var statusList = ["uploading", "done", "removed"];
if (statusList.includes(info.file.status)) {
setFileList(info.fileList);
}
};
var handleFileRemove = function handleFileRemove(file) {
if (!file.percent || file.percent == 100) {
var _file$response;
var id = (_file$response = file.response) === null || _file$response === void 0 ? void 0 : _file$response.id;
modal/* default */.Z.confirm({
centered: true,
title: '确定要删除这个附件吗?',
okText: '确定',
cancelText: '取消',
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'newShixuns/deleteAttachment',
payload: {
id: id
}
});
case 2:
res = _context.sent;
res && setFileList(fileList.filter(function (item) {
var _item$response;
return ((_item$response = item.response) === null || _item$response === void 0 ? void 0 : _item$response.id) !== id;
}));
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
return false;
}
};
var handleFileBeforeUpload = function handleFileBeforeUpload(file) {
if (fileList.length) {
return false;
}
var is150M = file.size / 1024 / 1024 > 50;
if (is150M) {
message/* default */.ZP.info('文件大小必须小于50MB');
return false;
}
return true;
};
var handleFinish = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
var _fileList$;
var _ref3, language, runtime, run_method, code, res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_ref3 = values || {}, language = _ref3.language, runtime = _ref3.env, run_method = _ref3.mode, code = _ref3.code;
_context2.next = 3;
return dispatch({
type: 'newShixuns/applyShixunMirror',
payload: {
language: language,
runtime: runtime,
run_method: run_method,
attachment_id: fileList === null || fileList === void 0 || (_fileList$ = fileList[0]) === null || _fileList$ === void 0 || (_fileList$ = _fileList$.response) === null || _fileList$ === void 0 ? void 0 : _fileList$.id
}
});
case 3:
res = _context2.sent;
dispatch({
type: 'newShixuns/setActionTabs',
payload: {}
});
if (res) {
message/* default */.ZP.success("新建申请已提交,请等待管理员审核。");
}
case 6:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleFinish(_x) {
return _ref2.apply(this, arguments);
};
}();
var handleAfterClose = function handleAfterClose() {
form.resetFields();
setFileList([]);
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
centered: true,
keyboard: false,
closable: false,
destroyOnClose: true,
open: newShixuns.actionTabs.key === 'NewShixuns-Apply',
title: "\u7533\u8BF7\u65B0\u5EFA",
width: "1000px",
footer: null,
afterClose: handleAfterClose,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: ApplyModalmodules.qrCode,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: ApplyModalmodules.a1,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.code,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
width: 120,
height: 120,
src: qrCode,
alt: "\u4E8C\u7EF4\u7801"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.group,
children: "\u5B9E\u9A8C\u73AF\u5883\u7533\u8BF7QQ\u7FA4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.groupNumber,
children: "\u7FA4\u53F7\uFF1A740157011"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: ApplyModalmodules.a2,
children: ["\u5C0A\u656C\u7684\u8001\u5E08/\u540C\u5B66\u60A8\u597D\uFF0C", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5982\u679C\u60A8\u60F3\u65B0\u5EFA\u5B9E\u9A8C\u73AF\u5883\uFF0C\u53EF\u4EE5\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801\u8FDB\u7FA4\uFF0C\u76F4\u63A5\u5411\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u7533\u8BF7\u54E6~ \u4E5F\u53EF\u4EE5\u63D0\u4EA4\u4E0B\u9762\u7684\u8868\u5355\u7533\u8BF7\uFF0C\u6211\u4EEC\u7684\u5DE5\u4F5C\u4EBA\u5458\u6536\u5230\u7533\u8BF7\u4FE1\u606F\u5C06\u4F1A\u7B2C\u4E00\u65F6\u95F4\u8054\u7CFB\u60A8\uFF01"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
className: ApplyModalmodules.formWrap,
form: form,
labelCol: {
span: 4
},
wrapperCol: {
span: 20
},
onFinish: handleFinish,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u8BED\u8A00\uFF1A",
name: "language",
rules: [{
required: true,
message: '请填写该镜像语言'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48\u8BED\u8A00\uFF1A\u793A\u4F8B\uFF1APython",
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u7CFB\u7EDF\u73AF\u5883\uFF1A",
name: "env",
rules: [{
required: true,
message: '请填写该镜像语言系统环境'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u662F\u57FA\u4E8E\u4EC0\u4E48linux\u7CFB\u7EDF\u73AF\u5883,\u4EE3\u7801\u8FD0\u884C\u73AF\u5883",
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F\uFF1A",
name: "mode",
rules: [{
required: true,
message: '请填写该镜像测试代码运行方式'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
placeholder: "\u8BF7\u586B\u5199\u8BE5\u955C\u50CF\u4E2D\u6D4B\u8BD5\u4EE3\u7801\u8FD0\u884C\u65B9\u5F0F",
rows: 4
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
label: "\u6D4B\u8BD5\u4EE3\u7801\uFF1A",
name: "code",
rules: [{
required: true,
message: '请上传附件'
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.upload,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(upload/* default */.Z, {
fileList: fileList,
action: "".concat(env/* default */.Z.API_SERVER, "/api/attachments.json?client_key=6d57f8c3dd186c5ada392546ace9620a"),
onChange: handleFileChange,
onRemove: handleFileRemove,
beforeUpload: handleFileBeforeUpload,
withCredentials: true,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(ApplyModalmodules.color0152d9, " current"),
children: "\u4E0A\u4F20\u9644\u4EF6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(ApplyModalmodules.colorCCC, " ml10"),
children: "(\u5355\u4E2A\u6587\u4EF650M\u4EE5\u5185)"
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ApplyModalmodules.footerWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "mr5",
size: 'middle',
onClick: function onClick() {
dispatch({
type: 'newShixuns/setActionTabs',
payload: {}
});
},
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
size: 'middle',
type: "primary",
htmlType: "submit",
loading: loading['newShixuns/applyShixunMirror'],
children: "\u4FDD\u5B58"
})]
})
})]
})]
});
};
/* harmony default export */ var components_ApplyModal = ((0,_umi_production_exports.connect)(function (_ref4) {
var newShixuns = _ref4.newShixuns,
loading = _ref4.loading,
globalSetting = _ref4.globalSetting;
return {
newShixuns: newShixuns,
globalSetting: globalSetting,
loading: loading.effects
};
})(ApplyModal));
/***/ }),
/***/ 15883:
/*!**********************************************************************!*\
!*** ./src/pages/Shixuns/New/components/CreateEnvironment/index.tsx ***!
\**********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test5_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_local_v9_test5_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test5_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 */ 63350);
/* 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_local_v9_test5_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));
/***/ }),
/***/ 73375:
/*!*************************************************************************!*\
!*** ./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 + 2 modules
var RenderHtml = __webpack_require__(25720);
;// 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);
/***/ })
}]);