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

2821 lines
136 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([[49205],{
/***/ 38461:
/*!**********************************************************!*\
!*** ./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
}))]
})
});
};
/***/ }),
/***/ 56971:
/*!*****************************************!*\
!*** ./src/components/NoData/index.tsx ***!
\*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 93314);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var noData = function noData(_ref) {
var img = _ref.img,
_ref$buttonProps = _ref.buttonProps,
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
_ref$styles = _ref.styles,
styles = _ref$styles === void 0 ? {} : _ref$styles,
customText = _ref.customText,
ButtonText = _ref.ButtonText,
ButtonClick = _ref.ButtonClick,
Buttonclass = _ref.Buttonclass,
ButtonTwo = _ref.ButtonTwo,
imgStyles = _ref.imgStyles,
_ref$loading = _ref.loading,
loading = _ref$loading === void 0 ? false : _ref$loading;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("section", {
className: "tc animated fadeIn",
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, {
color: '#999',
margin: '100px auto',
visibility: loading ? 'hidden' : 'visible'
}), styles),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__,
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, imgStyles), {}, {
pointerEvents: "none",
userSelect: "none"
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
className: "mt20 font14",
children: customText || '暂时还没有相关数据哦!'
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
className: Buttonclass,
onClick: ButtonClick
}, buttonProps), {}, {
children: ButtonText
})), ButtonTwo && ButtonTwo]
});
};
/* harmony default export */ __webpack_exports__.Z = (noData);
/***/ }),
/***/ 32272:
/*!*********************************************************!*\
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ PreviewAll; }
});
// 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);
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
var ArrowDownOutlined = __webpack_require__(52702);
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
var monaco_editor = __webpack_require__(34776);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(73400);
// EXTERNAL MODULE: ./src/service/exercise.ts
var exercise = __webpack_require__(86886);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(56971);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(2367);
// EXTERNAL MODULE: ./src/service/attachment.ts
var attachment = __webpack_require__(84710);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
/* harmony default export */ var PreviewAll = (function (_ref) {
var _data, _data2, _data3, _data4, _data5, _data6;
var _ref$editOffice = _ref.editOffice,
editOffice = _ref$editOffice === void 0 ? 'view' : _ref$editOffice,
data = _ref.data,
theme = _ref.theme,
type = _ref.type,
filename = _ref.filename,
monacoEditor = _ref.monacoEditor,
className = _ref.className,
style = _ref.style,
close = _ref.close,
onClose = _ref.onClose,
hasMask = _ref.hasMask,
disabledDownload = _ref.disabledDownload,
onImgDimensions = _ref.onImgDimensions,
showNodata = _ref.showNodata,
recordInfo = _ref.recordInfo;
var _useState = (0,_react_17_0_2_react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
_useState2 = slicedToArray_default()(_useState, 2),
src = _useState2[0],
setSrc = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(""),
_useState4 = slicedToArray_default()(_useState3, 2),
token = _useState4[0],
setToken = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
officeData = _useState6[0],
setOfficeData = _useState6[1];
var officePath = window.ENV === "build" ? "/react/build" : "";
var apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
// let size;
var unit = 1024 * 1024;
var maxSize = 10 * unit;
var closeRef = (0,_react_17_0_2_react.useRef)();
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
data = env/* default */.Z.API_SERVER + data;
}
var getFileExtension = function getFileExtension(url) {
var filename = url.substring(url.lastIndexOf('/') + 1);
var extension = filename.split('.').pop();
return extension;
};
if (filename) monacoEditor.filename = filename;
(0,_react_17_0_2_react.useEffect)(function () {
var _document$cookie;
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 || (_document$cookie = _document$cookie.replace(/\s/g, "")) === null || _document$cookie === void 0 ? void 0 : _document$cookie.split(";");
cookies === null || cookies === void 0 || cookies.map(function (item) {
var i = item.split("=");
if (i[0] === '_educoder_session') {
setToken(i[1]);
}
});
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
if (type === "office") {
if (data.indexOf("bigfilescdn.") > -1 || data.indexOf("bigfiles1") > -1) {
setOfficeData({
url: data,
fileType: getFileExtension(data),
model: data.indexOf("model=edit") ? "edit" : "view"
});
} else {
getData();
}
}
}, [type, data]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _url, _id, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
console.log("data:", data);
_url = data;
if (!data.startsWith("http")) {
_url = location.origin + _url;
}
_id = new URL(_url).pathname.split("/").pop();
_context.next = 6;
return (0,exercise/* setEcsAttachment */.gJ)({
attachment_id: _id
});
case 6:
res = _context.sent;
res.url = apiServer + res.url;
setOfficeData(res);
case 9:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var handleClick = function handleClick() {
if (data.startsWith("http") || data.startsWith('blob:')) {
handleDown();
return;
}
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
};
var handleDown = function handleDown() {
if (recordInfo) {
// 教学资料--点击下载资料时记录下载信息
(0,attachment/* add_file_quantity */.fc)({
id: recordInfo === null || recordInfo === void 0 ? void 0 : recordInfo.id,
watch_type: 1,
course_id: recordInfo === null || recordInfo === void 0 ? void 0 : recordInfo.course_id
});
}
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: objectSpread2_default()({}, style || {}),
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: PreviewAllmodules.close,
ref: closeRef,
children: [!!onImgDimensions && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
onClose();
onImgDimensions();
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-yulanpizhu"
})
})
}), !disabledDownload && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: handleDown,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-quxiaozhiding"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5173\u95ED",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "",
onClick: onClose,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-guanbi1"
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
})
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
src: "".concat(((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.indexOf("http://")) > -1 || ((_data3 = data) === null || _data3 === void 0 ? void 0 : _data3.indexOf("https://")) > -1 ? "" : "data:audio/mp3;base64,").concat(data),
autoPlay: true
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.indexOf("http")) > -1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
controls: true,
src: "".concat(data),
autoPlay: true
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
controls: true,
src: "data:video/mp4;base64,".concat(data),
autoPlay: true
})
}), type === 'office' && officeData && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: "".concat(officePath, "/office.html?key=").concat(officeData.key, "&url=").concat(btoa(officeData.url), "&callbackUrl=").concat(apiServer + officeData.callbackUrl, "&fileType=").concat(officeData.fileType, "&title=").concat(officeData.title, "&model=").concat(editOffice, "&officeServer=").concat(env/* default */.Z.ONLYOFFICE, "&disabledDownload=").concat(!!disabledDownload)
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: data + '&disposition=inline'
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: "".concat(officePath, "/js/pdfview/index.html?url=").concat(data, "&disabledDownload=").concat(!!disabledDownload)
}) //<embed className={styles.embed + "#toolbar=0"} src={data} />
, type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: "".concat(((_data5 = data) === null || _data5 === void 0 ? void 0 : _data5.indexOf("http://")) > -1 || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.indexOf("https://")) > -1 ? "" : "data:image/png;base64,").concat(data)
}), (type === "other" || type === "download") && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: showNodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",
ButtonTwo: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-xiazai4 font14"
}),
type: "primary",
size: 'middle',
onClick: handleClick,
children: "\u4E0B\u8F7D"
})
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
type: "primary",
size: 'middle',
onClick: handleClick,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
})
})]
});
});
/***/ }),
/***/ 12965:
/*!************************************************************************************************!*\
!*** ./src/pages/Shixuns/Edit/body/Level/Challenges/EditPracticeSetting/index.tsx + 3 modules ***!
\************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
PracticeFileType: function() { return /* binding */ PracticeFileType; },
"default": function() { return /* binding */ Challenges_EditPracticeSetting; }
});
// 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/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/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/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 + 15 modules
var _umi_production_exports = __webpack_require__(58011);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/QuestionCircleOutlined.js + 1 modules
var QuestionCircleOutlined = __webpack_require__(34033);
// 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/input/index.js + 5 modules
var input = __webpack_require__(62680);
// 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/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/checkbox/index.js + 3 modules
var es_checkbox = __webpack_require__(24905);
// 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/popover/index.js
var popover = __webpack_require__(60324);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input-number/index.js + 14 modules
var input_number = __webpack_require__(97913);
// 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/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./src/service/shixuns.ts
var shixuns = __webpack_require__(17782);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditPracticeSetting/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var EditPracticeSettingmodules = ({"flex_box_center":"flex_box_center___MjMLk","flex_space_between":"flex_space_between___PcWTa","flex_box_vertical_center":"flex_box_vertical_center___Cq7f3","flex_box_center_end":"flex_box_center_end___sMsFo","flex_box_column":"flex_box_column___n6Hxq","bg":"bg____Ic4Q","radioStyle":"radioStyle___kewjX","formWrap":"formWrap___jcehV","onePart":"onePart___ECsrp","twoPart":"twoPart___WVIpx","title":"title___RpX2E","threePart":"threePart___Tzme_","flexRowCenter":"flexRowCenter___M7zUK","fourPart":"fourPart___HgBFj","testJi":"testJi___s6Skh","upBtn":"upBtn___eKx0D","checkboxs":"checkboxs___B4uNe","averageWarp":"averageWarp___yXrlD","averageCustom":"averageCustom___t5o4x","groupWrap":"groupWrap___eT0sR","customInput":"customInput___pywUD"});
// EXTERNAL MODULE: ./src/components/FixedButton/index.tsx + 1 modules
var FixedButton = __webpack_require__(38461);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/empty/index.js + 3 modules
var empty = __webpack_require__(64165);
// 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/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditPracticeSetting/components/SelectFilePathModal/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var SelectFilePathModalmodules = ({"flex_box_center":"flex_box_center___vvciu","flex_space_between":"flex_space_between___WPxvw","flex_box_vertical_center":"flex_box_vertical_center___YY9Br","flex_box_center_end":"flex_box_center_end___FiVhK","flex_box_column":"flex_box_column___FWnfq","wrap":"wrap___AEhcV","content":"content___NDdD8","mainPathWrap":"mainPathWrap___BNeQ2","colorBlue":"colorBlue___UwyKz","empty":"empty___aaM_9"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditPracticeSetting/components/SelectFilePathModal/index.tsx
// 排除 ”根目录“,将选中的路径连接,去掉第一个字符串 “/”,获取绝对路径
var formatPath = function formatPath(data) {
return data !== null && data !== void 0 && data.length ? data.filter(function (_, key) {
return key !== 0;
}).map(function (item) {
return item.val;
}).join('').substr(1) : '';
};
var SelectFilePathModal = function SelectFilePathModal(_ref) {
var shixunsDetail = _ref.shixunsDetail,
globalSetting = _ref.globalSetting,
dispatch = _ref.dispatch,
fileType = _ref.fileType,
propsPath = _ref.path,
_ref$onFinish = _ref.onFinish,
onFinish = _ref$onFinish === void 0 ? function () {} : _ref$onFinish;
var params = (0,_umi_production_exports.useParams)();
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
selectPath = _useState2[0],
setSelectPath = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)('1'),
_useState4 = slicedToArray_default()(_useState3, 2),
activeKey = _useState4[0],
setActiveKey = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)([]),
_useState6 = slicedToArray_default()(_useState5, 2),
mainPathList = _useState6[0],
setMainPathList = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(false),
_useState8 = slicedToArray_default()(_useState7, 2),
loading = _useState8[0],
setLoading = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)([]),
_useState10 = slicedToArray_default()(_useState9, 2),
treeList = _useState10[0],
setTreeList = _useState10[1];
var selectPathTypes = [PracticeFileType.OriginalPicturePath, PracticeFileType.ExpectPicturePath, PracticeFileType.PicturePath];
var isSelectPathType = selectPathTypes.includes(fileType);
(0,_react_17_0_2_react.useEffect)(function () {
if (shixunsDetail.actionTabs.key !== 'EditPracticeSetting-SelectFilePath') {
return;
}
setSelectPath(propsPath || '');
handleGetPathData();
}, [shixunsDetail.actionTabs.key, propsPath, activeKey]);
var handleGetPathData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var path,
res,
trees,
_args = arguments;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
path = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
setLoading(true);
_context.next = 4;
return dispatch({
type: "shixunsDetail/".concat(activeKey === '1' ? 'getRepository' : 'getSecretRepository'),
payload: {
id: params.id,
path: path
}
});
case 4:
res = _context.sent;
if (res !== null && res !== void 0 && res.trees) {
trees = res.trees.map(function (item) {
return objectSpread2_default()(objectSpread2_default()({}, item), {
name: item.name,
val: item.name
});
});
setTreeList(trees || []);
} else {
setTreeList([]);
}
setLoading(false);
case 7:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleGetPathData() {
return _ref2.apply(this, arguments);
};
}();
var handleClickFile = function handleClickFile(name) {
var currentPath = formatPath(mainPathList);
var selectName = "".concat(currentPath ? "".concat(currentPath, "/") : currentPath).concat(name);
if (activeKey === '2') {
selectName = "secret/".concat(selectName);
}
if (fileType === PracticeFileType.Path) {
!(selectPath !== null && selectPath !== void 0 && selectPath.includes("".concat(selectName, "\uFF1B"))) && setSelectPath("".concat(selectPath).concat(selectName, "\uFF1B"));
} else if (fileType === PracticeFileType.ExecPath) {
setSelectPath(selectName);
}
};
var handleClickTree = function handleClickTree(item) {
if (item.type === "tree") {
mainPathList.length ? mainPathList.push({
val: "/".concat(item.val),
path: item.val
}) : mainPathList.push({
val: "根目录",
path: ""
}, {
val: "/".concat(item.val),
path: item.val
});
setMainPathList(mainPathList);
var _currentPath = formatPath(mainPathList);
isSelectPathType && setSelectPath(_currentPath);
handleGetPathData(_currentPath);
}
};
var handleClickMainPath = function handleClickMainPath(item, index) {
var currentPathList = mainPathList.filter(function (_, key) {
return key <= index;
});
setMainPathList(currentPathList);
var currentPath = formatPath(currentPathList);
isSelectPathType && setSelectPath(currentPath);
handleGetPathData(currentPath);
};
var handleOk = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
onFinish(selectPath);
handleCancel();
case 2:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleOk() {
return _ref3.apply(this, arguments);
};
}();
var handleCancel = function handleCancel() {
setSelectPath('');
setMainPathList([]);
setTreeList([]);
setActiveKey('1');
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {}
});
};
var renderEmpty = function renderEmpty() {
return /*#__PURE__*/(0,jsx_runtime.jsx)(empty/* default */.Z, {
style: {
margin: '0 0'
},
image: empty/* default */.Z.PRESENTED_IMAGE_SIMPLE,
imageStyle: {
height: 60
},
description: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
color: '#888',
marginBottom: 0
},
children: "\u79C1\u5BC6\u4EE3\u7801\u4ED3\u5E93\u6682\u65E0\u6587\u4EF6\u3002\u8BF7\u5148\u5F00\u542F\u5E76\u4E0A\u4F20\u4EE3\u7801\u6587"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#888'
},
children: "\u4EF6\u3001\u6807\u51C6\u56FE\u7247\u7B49\u6587\u4EF6\u5230\u79C1\u5BC6\u4EE3\u7801\u4ED3\u5E93"
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
onClick: function onClick() {
handleCancel();
dispatch({
type: 'practiceSetting/setSideBarTabs',
payload: {
tabsActive: 'warehouse'
}
});
_umi_production_exports.history.push("/shixuns/".concat(params.id, "/edit?tabId=warehouse"));
},
children: "\u53BB\u4E0A\u4F20"
})
});
};
var currentPath = formatPath(mainPathList);
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
title: "\u6587\u4EF6\u8DEF\u5F84",
closable: false,
keyboard: false,
open: shixunsDetail.actionTabs.key === 'EditPracticeSetting-SelectFilePath',
onOk: handleOk,
onCancel: handleCancel,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: SelectFilePathModalmodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
activeKey: activeKey,
onChange: function onChange(e) {
setMainPathList([]);
setActiveKey(e);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z.TabPane, {
tab: "\u4EE3\u7801\u4ED3\u5E93"
}, "1"), fileType === 'exec_path' && /*#__PURE__*/(0,jsx_runtime.jsx)(tabs/* default */.Z.TabPane, {
tab: "\u79C1\u5BC6\u4EE3\u7801\u4ED3\u5E93"
}, "2")]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
style: {
backgroundColor: '#f5f5f5',
height: 200
},
spinning: loading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: SelectFilePathModalmodules.content,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: !!(mainPathList !== null && mainPathList !== void 0 && mainPathList.length) && mainPathList.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
style: {
whiteSpace: index === 0 ? 'nowrap' : ''
},
onClick: function onClick() {
return handleClickMainPath(item, index);
},
children: item.val
}, index);
})
}), !!(treeList !== null && treeList !== void 0 && treeList.length) ? treeList.map(function (item, index) {
return item.type === "tree" ? /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
onClick: function onClick() {
return handleClickTree(item);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-wenjianjia ".concat(SelectFilePathModalmodules.colorBlue)
}), currentPath ? "".concat(currentPath, "/") : currentPath, item.name]
}, index) : /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
onClick: function onClick() {
return handleClickFile("".concat(item.name));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-zuoye ".concat(SelectFilePathModalmodules.colorBlue)
}), currentPath ? "".concat(currentPath, "/") : currentPath, item.name]
}, index);
}) : renderEmpty()]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
className: "mt5",
children: "\u5DF2\u9009\u4E2D\u7684\u6587\u4EF6:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
placeholder: "\u8BF7\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u5B50\u6587\u4EF6\u5939\u540D\u3002\uFF08\u5982\uFF1Asrc/step1\uFF09",
value: selectPath,
onChange: function onChange(e) {
return setSelectPath(e.target.value);
}
})]
})
});
};
/* harmony default export */ var components_SelectFilePathModal = ((0,_umi_production_exports.connect)(function (_ref4) {
var shixunsDetail = _ref4.shixunsDetail,
globalSetting = _ref4.globalSetting;
return {
shixunsDetail: shixunsDetail,
globalSetting: globalSetting
};
})(SelectFilePathModal));
// EXTERNAL MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/components/UploadFile/index.tsx + 2 modules
var UploadFile = __webpack_require__(97352);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
var lodash = __webpack_require__(89392);
// EXTERNAL MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.tsx + 1 modules
var Loading = __webpack_require__(47973);
// EXTERNAL MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/RankingSetting/challenge-nav.tsx + 1 modules
var challenge_nav = __webpack_require__(44810);
// EXTERNAL MODULE: ./src/pages/Shixuns/Edit/utils/index.tsx
var utils = __webpack_require__(9319);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditPracticeSetting/index.tsx
var Option = es_select["default"].Option;
var TextArea = input/* default */.Z.TextArea;
var Panel = collapse/* default */.Z.Panel;
var PracticeFileType = /*#__PURE__*/function (PracticeFileType) {
PracticeFileType["Path"] = "path";
PracticeFileType["ExecPath"] = "exec_path";
PracticeFileType["OriginalPicturePath"] = "original_picture_path";
PracticeFileType["ExpectPicturePath"] = "expect_picture_path";
PracticeFileType["PicturePath"] = "picture_path";
return PracticeFileType;
}({});
var EditPracticeSetting = function EditPracticeSetting(_ref) {
var _shixunsDetail$detail4, _shixunsDetail$detail5, _shixunsDetail$detail6, _shixunsDetail$detail7, _shixunsDetail$detail8, _shixunsDetail$detail9;
var shixunsDetail = _ref.shixunsDetail,
dispatch = _ref.dispatch,
practiceSetting = _ref.practiceSetting;
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),
uploadData = _useState4[0],
setUploadData = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)({}),
_useState6 = slicedToArray_default()(_useState5, 2),
settingData = _useState6[0],
setSettingData = _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)({
hidden: 0,
input_visible: false,
is_invisible: false,
actual_output_visible: false,
last_match_rule: false
}),
_useState10 = slicedToArray_default()(_useState9, 2),
batchset = _useState10[0],
setbatchset = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)([false]),
_useState12 = slicedToArray_default()(_useState11, 2),
isChecked = _useState12[0],
setIsChecked = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
checkAll = _useState14[0],
setcheckAll = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
selectFilePathType = _useState16[0],
setSelectFilePathType = _useState16[1];
var changeData = (0,_react_17_0_2_react.useRef)({
formValue: {},
testSetList: [],
uploadData: []
});
var _useState17 = (0,_react_17_0_2_react.useState)(true),
_useState18 = slicedToArray_default()(_useState17, 2),
loading = _useState18[0],
setLoading = _useState18[1];
var _useState19 = (0,_react_17_0_2_react.useState)(true),
_useState20 = slicedToArray_default()(_useState19, 2),
isTreeNull = _useState20[0],
setIsTreeNull = _useState20[1];
var timer = (0,_react_17_0_2_react.useRef)(null);
var _useState21 = (0,_react_17_0_2_react.useState)(false),
_useState22 = slicedToArray_default()(_useState21, 2),
showUploadFile = _useState22[0],
setShowUploadFile = _useState22[1];
var _useState23 = (0,_react_17_0_2_react.useState)(false),
_useState24 = slicedToArray_default()(_useState23, 2),
showbatch = _useState24[0],
setshowbatch = _useState24[1];
var _useState25 = (0,_react_17_0_2_react.useState)(false),
_useState26 = slicedToArray_default()(_useState25, 2),
isshows = _useState26[0],
setisshows = _useState26[1];
var params = (0,_umi_production_exports.useParams)();
var _useState27 = (0,_react_17_0_2_react.useState)(false),
_useState28 = slicedToArray_default()(_useState27, 2),
checkAll1 = _useState28[0],
setcheckAll1 = _useState28[1];
var _useState29 = (0,_react_17_0_2_react.useState)(false),
_useState30 = slicedToArray_default()(_useState29, 2),
checkAll2 = _useState30[0],
setcheckAll2 = _useState30[1];
var _useState31 = (0,_react_17_0_2_react.useState)(false),
_useState32 = slicedToArray_default()(_useState31, 2),
checkAll3 = _useState32[0],
setcheckAll3 = _useState32[1];
var _useState33 = (0,_react_17_0_2_react.useState)(false),
_useState34 = slicedToArray_default()(_useState33, 2),
checkAll4 = _useState34[0],
setcheckAll4 = _useState34[1];
var _useState35 = (0,_react_17_0_2_react.useState)(false),
_useState36 = slicedToArray_default()(_useState35, 2),
checkAll5 = _useState36[0],
setcheckAll5 = _useState36[1];
var changeKeys = ["test_set_rules", "go_back_url", "next_challenge", "position", "name", "chooses", "st", "id", "path", "exec_path", "show_type", "original_picture_path", "expect_picture_path", "picture_path", "test_set_rules_expression", "web_route", "test_set_score", "test_set_average", "exec_time", "ignore_space", "with_code_file", "unity_3d", "unity_3d_routes", "unity_3d_result", "has_web_route", "test_sets", 'is_file', 'proxy_port'];
var newTestSetList = [];
(0,_react_17_0_2_react.useEffect)(function () {
getPracticeData();
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
console.log(uploadData);
var selectall1 = uploadData.every(function (item) {
return item.hidden === 1;
});
setcheckAll1(selectall1);
var selectall2 = uploadData.every(function (item) {
return item.is_invisible;
});
setcheckAll2(selectall2);
var selectall3 = uploadData.every(function (item) {
return item.last_match_rule;
});
setcheckAll3(selectall3);
var selectall4 = uploadData.every(function (item) {
return item.input_visible;
});
setcheckAll4(selectall4);
var selectall5 = uploadData.every(function (item) {
return item.actual_output_visible;
});
setcheckAll5(selectall5);
}, [uploadData]);
(0,_react_17_0_2_react.useEffect)(function () {
if (JSON.stringify(changeData.current.formValue) !== '{}' && changeData.current.testSetList.length) {
setConfirmValue();
}
return function () {
clearTimeout(timer.current);
};
}, [formValue, testSetList]);
var getPracticeData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var treeData, res, _res$test_sets, is_file, new_res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
setLoading(true);
_context.next = 3;
return dispatch({
type: 'shixunsDetail/getRepository',
payload: {
id: params.id,
path: ''
}
});
case 3:
treeData = _context.sent;
setIsTreeNull((treeData === null || treeData === void 0 ? void 0 : treeData.trees) === null);
_context.next = 7;
return (0,shixuns/* getChallengePractice */.ii)({
id: params.id,
challengeId: params.challengesId,
tab: 1
});
case 7:
res = _context.sent;
if (res) {
setLoading(false);
is_file = ((_res$test_sets = res.test_sets) === null || _res$test_sets === void 0 || (_res$test_sets = _res$test_sets[0]) === null || _res$test_sets === void 0 ? void 0 : _res$test_sets.is_file) || false;
new_res = objectSpread2_default()(objectSpread2_default()({}, res), {}, {
is_file: is_file
});
setSettingData(new_res);
if (parseInt(res === null || res === void 0 ? void 0 : res.code_compile_score) > 0) {
setisshows(true);
}
initData(new_res);
}
case 9:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getPracticeData() {
return _ref2.apply(this, arguments);
};
}();
var setConfirmValue = function setConfirmValue() {
clearTimeout(timer.current);
timer.current = setTimeout(updateValue, 500);
};
var updateValue = function updateValue() {
var formBool = changeKeys.some(function (key) {
var a = (0,lodash.isNumber)(formValue[key]) ? String(formValue[key]) : formValue[key];
var b = (0,lodash.isNumber)(changeData.current.formValue[key]) ? String(changeData.current.formValue[key]) : changeData.current.formValue[key];
// console.log(a, '=====', b, a === b ? '相等' : '不相等', key)
return !(0,lodash.isEqual)(a, b);
});
if (formBool || !(0,lodash.isEqual)(changeData.current.testSetList, testSetList) || !(0,lodash.isEqual)(changeData.current.uploadData, uploadData)) {
dispatch({
type: 'practiceSetting/setSideBarTabs',
payload: {
confirmLeave: true
}
});
} else {
dispatch({
type: 'practiceSetting/setSideBarTabs',
payload: {
confirmLeave: false
}
});
}
};
var initData = function initData(originData) {
// 端口号无值时设置为8080
originData.proxy_port = (originData === null || originData === void 0 ? void 0 : originData.proxy_port) || 8080;
form.setFieldsValue(objectSpread2_default()({}, originData));
setFormValue(objectSpread2_default()({}, originData));
if (originData !== null && originData !== void 0 && originData.is_file) {
var upData = originData.test_sets || [];
setUploadData(upData);
var testSetData = [{
hidden: 0,
input: "",
output: "",
score: 100
}];
changeData.current = {
formValue: objectSpread2_default()({}, originData),
testSetList: testSetData,
uploadData: upData
};
setTestSetList(testSetData);
setIsChecked(Array(testSetData.length).fill(false));
} else {
var _originData$test_sets;
var _testSetData = (_originData$test_sets = originData.test_sets) !== null && _originData$test_sets !== void 0 && _originData$test_sets.length ? originData.test_sets : [{
hidden: 0,
input: "",
output: "",
score: 100
}];
changeData.current = {
formValue: objectSpread2_default()({}, originData),
testSetList: _testSetData,
uploadData: []
};
setIsChecked(Array(_testSetData.length).fill(false));
setTestSetList(_testSetData);
}
};
var handleChangeFilePathModal = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(type) {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!isTreeNull) {
_context2.next = 3;
break;
}
modal/* default */.Z.confirm({
centered: true,
title: '提示',
content: '请先上传本关任务的所有代码文件、标准图片等所有必要的文件到代码仓库',
okText: '去上传',
onOk: function onOk() {
dispatch({
type: 'practiceSetting/setSideBarTabs',
payload: {
tabsActive: 'warehouse'
}
});
_umi_production_exports.history.push("/shixuns/".concat(params.id, "/edit?tabId=warehouse"));
},
cancelText: '取消'
});
return _context2.abrupt("return");
case 3:
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {
key: 'EditPracticeSetting-SelectFilePath'
}
});
setSelectFilePathType(type);
case 5:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function handleChangeFilePathModal(_x) {
return _ref3.apply(this, arguments);
};
}();
var handleFinishSelectFilePath = function handleFinishSelectFilePath(value) {
var s = defineProperty_default()({}, selectFilePathType, value);
form.setFieldsValue(s);
setFormValue(objectSpread2_default()(objectSpread2_default()({}, formValue), s));
};
var handleValuesChange = function handleValuesChange(changedValues) {
var values = form.getFieldValue();
setFormValue(objectSpread2_default()({}, values));
if ('test_set_score' in changedValues) {
if (changedValues.test_set_score) {
form.setFieldsValue({
test_set_average: true
});
if (formValue.is_file) {
handleUploadRatio(uploadData);
} else {
handleShareRatio(testSetList);
}
}
}
if ('test_set_average' in changedValues) {
if (changedValues.test_set_average) {
if (formValue.is_file) {
handleUploadRatio(uploadData);
} else {
handleShareRatio(testSetList);
}
}
}
if ('unity_3d' in changedValues) {
if (!changedValues.unity_3d) {
form.setFieldsValue({
with_code_file: true
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, values), {}, {
with_code_file: true
}));
}
}
};
var handleShareRatio = function handleShareRatio(testSetData) {
// console.log('----',form.getFieldValue('code_compile_score'));
var code_compile_score = parseInt(form.getFieldValue('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
});
});
changeData.current.testSetList = (0,lodash.clone)(testSetData);
setTestSetList(testSetData);
};
var handleUploadRatio = function handleUploadRatio(testSetData) {
// const score = Math.floor(100 / testSetData.length)
// const lastScore = score + 100 % testSetData.length
var code_compile_score = parseInt(form.getFieldValue('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
});
});
changeData.current.uploadData = (0,lodash.clone)(testSetData);
setUploadData(testSetData);
};
var handleAddTestSet = function handleAddTestSet() {
var testSetData = [].concat(toConsumableArray_default()(testSetList), [{
hidden: 0,
input: "",
output: "",
score: 0
}]);
setIsChecked([].concat(toConsumableArray_default()(isChecked), [false]));
setcheckAll(false);
if (form.getFieldValue('test_set_average')) {
handleShareRatio(testSetData);
} else {
setTestSetList(testSetData);
}
};
var handleFinish = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
var flag,
type,
res,
_shixunsDetail$detail,
_args3 = arguments;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
flag = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : false;
type = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : 1;
if (values.path && !values.path.endsWith('')) {
values.path = values.path + '';
}
_context3.next = 5;
return (0,shixuns/* updateChallengesNew */.Rs)(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
tab: 1,
challenge: objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, values), {
test_set_rules_expression: values.test_set_rules === 0 ? null : values.test_set_rules_expression
}), {}, {
shixunfileexpectpicturepath: values.original_picture_path,
shixunfilestandardpicturepath: values.expect_picture_path
}),
test_set: newTestSetList,
sync_origin_shixun: flag
}));
case 5:
res = _context3.sent;
if (res.status >= 0) {
if (shixunsDetail !== null && shixunsDetail !== void 0 && (_shixunsDetail$detail = shixunsDetail.detail) !== null && _shixunsDetail$detail !== void 0 && _shixunsDetail$detail.copy_for_exercise) {
(0,utils/* handleSaveCopyForExercise */.m)(dispatch, shixunsDetail, params.id, type);
}
_umi_production_exports.history.replace("/shixuns/".concat(params.id, "/edit/").concat(params.challengesId, "/tab=3"));
}
case 7:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return function handleFinish(_x2) {
return _ref4.apply(this, arguments);
};
}();
var handleRemove = function handleRemove(item, key) {
var newList = toConsumableArray_default()(uploadData);
newList.splice(key, 1);
if (formValue.test_set_average) {
handleUploadRatio(newList);
} else {
setUploadData(newList);
}
};
var handleInputChange = function handleInputChange(e, key) {
console.log(e, key);
var testData = uploadData.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
score: e.target.value ? Number(e.target.value) : 0
});
}
return test;
});
setUploadData(testData);
};
var handleEvaluatingChange = function handleEvaluatingChange(e, key, type) {
if (type === 'hidden') {
e = e ? 1 : 0;
}
console.log(e, key);
var testData = uploadData.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, defineProperty_default()({}, type, e));
}
return test;
});
setUploadData(testData);
console.log(testData);
var selectAll = testData.every(function (test) {
return test[type] === e;
});
if (type === 'hidden') {
setcheckAll1(selectAll && e);
} else if (type === 'is_invisible') {
setcheckAll2(selectAll && e);
} else if (type === 'input_visible') {
setcheckAll4(selectAll && e);
} else if (type === 'actual_output_visible') {
setcheckAll5(selectAll && e);
} else {
setcheckAll3(selectAll && e);
}
};
var handleSelectAll = function handleSelectAll(e, type) {
if (type === 'hidden') {
e = e ? 1 : 0;
}
console.log(e);
var testData = uploadData.map(function (test, testIndex) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, defineProperty_default()({}, type, e));
});
setUploadData(testData);
if (type === 'hidden') {
setcheckAll1(e);
} else if (type === 'is_invisible') {
setcheckAll2(e);
} else if (type === 'input_visible') {
setcheckAll4(e);
} else if (type === 'actual_output_visible') {
setcheckAll5(e);
} else {
setcheckAll3(e);
}
};
var addUploadData = function addUploadData(files) {
if (!(files !== null && files !== void 0 && files.length)) return;
form.setFieldsValue({
is_file: files === null || files === void 0 ? void 0 : files[0].is_file
});
setFormValue(objectSpread2_default()(objectSpread2_default()({}, formValue), {}, {
is_file: files === null || files === void 0 ? void 0 : files[0].is_file
}));
//文件
if (files !== null && files !== void 0 && files[0].is_file) {
var newList = uploadData.concat(files.map(function (e) {
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
hidden: 0,
is_invisible: false,
last_match_rule: false
});
}));
if (formValue.test_set_average) {
handleUploadRatio(newList);
} else {
setUploadData(newList);
}
}
//文本
if (!(files !== null && files !== void 0 && files[0].is_file)) {
var _newList = testSetList === null || testSetList === void 0 ? void 0 : testSetList.filter(function (e) {
return e.input || e.output;
}).concat(files);
setIsChecked(Array(_newList.length).fill(false));
if (formValue.test_set_average) {
handleShareRatio(_newList);
} else {
setTestSetList(_newList);
}
}
};
var handleDeleteTestSet = function handleDeleteTestSet() {
modal/* default */.Z.confirm({
title: "删除测试用例提示",
content: "请确认是否将本关卡中的测试用例全部删除?",
okText: "确认",
cancelText: "取消",
onOk: function onOk() {
toDelete();
}
});
var toDelete = function toDelete() {
if (formValue.is_file) {
handleUploadRatio([]);
} else {
handleShareRatio([{
hidden: 0,
input: "",
output: "",
score: 0
}]);
setIsChecked([false]);
}
};
};
var toExit = function toExit() {
var _practiceSetting$side;
var toNext = function toNext() {
_umi_production_exports.history.push("/shixuns/".concat(params.id, "/challenges"));
dispatch({
type: 'practiceSetting/setSideBarTabs',
payload: {
confirmLeave: false
}
});
};
if (practiceSetting !== null && practiceSetting !== void 0 && (_practiceSetting$side = practiceSetting.sideBar) !== null && _practiceSetting$side !== void 0 && _practiceSetting$side.confirmLeave) {
modal/* default */.Z.confirm({
title: "离开此页提示",
content: "系统可能不会保存您所做的更改。",
okText: "离开",
cancelText: "取消",
onOk: function onOk() {
toNext();
}
});
} else {
toNext();
}
};
console.log(uploadData, 444);
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: EditPracticeSettingmodules.bg,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
className: EditPracticeSettingmodules.formWrap,
scrollToFirstError: true,
layout: "vertical",
onValuesChange: handleValuesChange,
onFinish: function onFinish(values) {
var _shixunsDetail$detail2, _shixunsDetail$detail3;
var code_compile_score = parseInt(form.getFieldValue('code_compile_score') || 0);
if (values.is_file) {
if (!(uploadData !== null && uploadData !== void 0 && uploadData.length)) {
message/* default */.ZP.error('测试集不能为空');
return;
}
var scoreList = uploadData.map(function (item) {
return item.score;
});
var sumScore = scoreList.reduce(function (current, next) {
return current + next;
}, 0) + code_compile_score;
if (values.test_set_score && sumScore !== 100 && testSetList !== null && testSetList !== void 0 && testSetList.length) {
message/* default */.ZP.error('测试集的评分占比之和必须等于100');
return;
}
newTestSetList = uploadData;
}
if (!values.is_file) {
var _scoreList = testSetList.map(function (item) {
return item.score;
});
var _sumScore = _scoreList.reduce(function (current, next) {
return current + next;
}, 0) + code_compile_score;
if (values.test_set_score && _sumScore !== 100 && testSetList !== null && testSetList !== void 0 && testSetList.length) {
message/* default */.ZP.error('测试集的评分占比之和必须等于100');
return;
}
newTestSetList = testSetList.map(function (e) {
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
is_file: false
});
});
}
if (!values.test_set_score) {
// console.log(testSetList.map((e: any) => ({ ...e, is_target:false, target_name:'',hidden:1})));
newTestSetList = newTestSetList.map(function (e) {
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
is_target: false,
target_name: ''
});
});
}
if (shixunsDetail !== null && shixunsDetail !== void 0 && (_shixunsDetail$detail2 = shixunsDetail.detail) !== null && _shixunsDetail$detail2 !== void 0 && _shixunsDetail$detail2.is_fork_from_creator && shixunsDetail !== null && shixunsDetail !== void 0 && (_shixunsDetail$detail3 = shixunsDetail.detail) !== null && _shixunsDetail$detail3 !== void 0 && _shixunsDetail$detail3.copy_for_exercise && settingData !== null && settingData !== void 0 && settingData.has_relation) {
dispatch({
type: "classroomList/setActionTabs",
payload: {
key: "同步修改",
value: values,
type: 'taskLevel',
fn: function fn(e, flag, type) {
handleFinish(e, flag, type);
}
}
});
} else {
handleFinish(values);
}
},
initialValues: {
test_set_rules: 0
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(challenge_nav/* default */.Z, {
activeIndex: 1
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPracticeSettingmodules.onePart,
children: [((_shixunsDetail$detail4 = shixunsDetail.detail) === null || _shixunsDetail$detail4 === void 0 ? void 0 : _shixunsDetail$detail4.identity) < 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
label: "\u5D4C\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0:",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "unity_3d",
noStyle: true,
valuePropName: "checked",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
disabled: ((_shixunsDetail$detail5 = shixunsDetail.detail) === null || _shixunsDetail$detail5 === void 0 ? void 0 : _shixunsDetail$detail5.shixun_status) === 2
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 c-light-black",
children: "\uFF08\u53EF\u4EE5\u5728\u5B66\u5458\u9875\u9762\u76F4\u63A5\u5D4C\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0\uFF09"
})]
}), formValue.unity_3d && ((_shixunsDetail$detail6 = shixunsDetail.detail) === null || _shixunsDetail$detail6 === void 0 ? void 0 : _shixunsDetail$detail6.identity) < 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "unity_3d_routes",
label: "\u8DEF\u5F84:",
rules: [{
required: true,
message: "必填项:不能为空"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
disabled: ((_shixunsDetail$detail7 = shixunsDetail.detail) === null || _shixunsDetail$detail7 === void 0 ? void 0 : _shixunsDetail$detail7.shixun_status) === 2,
placeholder: "\u8BF7\u9009\u62E9\u7248\u672C\u5E93\u4E2D\u7684\u4EE3\u7801\u6587\u4EF6\u3002\u4F8B\uFF1A src/step1/HelloWorld.java"
})
})]
}), formValue.unity_3d && ((_shixunsDetail$detail8 = shixunsDetail.detail) === null || _shixunsDetail$detail8 === void 0 ? void 0 : _shixunsDetail$detail8.identity) < 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "with_code_file",
label: "\u662F\u5426\u9700\u8981\u4EE3\u7801\u8BC4\u6D4B:",
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: "\u662F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: false,
children: "\u5426"
})]
})
}), formValue.with_code_file ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "unity_3d_result",
label: "\u8BC4\u6D4B\u7ED3\u679C\u662F\u5426\u7531 Unity3D \u51B3\u5B9A:",
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: "\u662F"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: false,
children: "\u5426"
})]
})
}) : null]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPracticeSettingmodules.twoPart,
children: formValue.with_code_file && /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPracticeSettingmodules.title,
children: "\u8BC4\u6D4B\u6587\u4EF6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "exec_time",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u8BC4\u6D4B\u65F6\u957F\u9650\u5236 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u7A0B\u5E8F\u7F16\u8BD1\u3001\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F\uFF0C\u5355\u4F4D\uFF1A\u79D2\uFF09"
})]
}),
rules: [{
required: true,
message: "必填项:不能为空"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u8BF7\u8F93\u5165\u8BC4\u6D4B\u65F6\u957F",
className: EditPracticeSettingmodules.width300
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u8BC4\u6D4B\u7ED3\u679C\u5C55\u793A\u65B9\u5F0F ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u5B66\u5458\u8BC4\u6D4B\u672C\u5173\u4EFB\u52A1\u65F6\uFF0C\u67E5\u770B\u6548\u679C\u9875\u4E0A\u9700\u8981\u5C55\u73B0\u7684\u6587\u4EF6\u7C7B\u578B\uFF09"
})]
}),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "show_type",
noStyle: true,
rules: [{
required: true,
message: "必填项:不能为空"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
bordered: false,
size: "large",
style: {
width: 600
},
getPopupContainer: function getPopupContainer(trigger) {
return trigger.parentNode;
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: -1,
children: "\u6D4B\u8BD5\u96C6\u5BF9\u6BD4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 1,
children: "\u56FE\u7247"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 2,
children: "apk/exe"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 3,
children: "txt"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 4,
children: "html"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 5,
children: "mp3"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 6,
children: "mp4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 7,
children: "LaTeX"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 8,
children: "office"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Option, {
value: 9,
children: "Verilog"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(popover/* default */.Z, {
overlayClassName: EditPracticeSettingmodules.popover,
placement: "bottomLeft",
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "font12",
children: ["\u56FE\u7247\uFF1A\u5904\u7406\u6216\u8F93\u51FA\u56FE\u7247\u7C7B\u578B\u7684\u4EFB\u52A1\uFF0C\u8BF7\u9009\u586B\u6B64\u9879", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u53EF\u4EE5\u901A\u8FC7\u8BBE\u7F6E\u56FE\u7247\u8DEF\u5F84\u548C\u5B66\u5458\u7B54\u6848\u6587\u4EF6\u8DEF\u5F84\uFF0C\u5C55\u793A\u4EE3\u7801\u5BF9\u5E94\u7684\u56FE\u7247\u6548\u679C", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "apk/exe\uFF1A\u5199\u53EF\u6267\u884C\u6587\u4EF6\u7684\u4EFB\u52A1\uFF0C\u8BF7\u9009\u586B\u6B64\u9879", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u53EF\u4EE5\u901A\u8FC7\u8BBE\u7F6E\u5B66\u5458\u7B54\u6848\u6587\u4EF6\u8DEF\u5F84\uFF0C\u5C55\u793A\u4E8C\u7EF4\u7801\u4EE5\u4F9B\u626B\u7801\u4E0B\u8F7D", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "txt\uFF1A\u8F93\u51FAtxt\u6587\u6863\u7C7B\u578B\u7684\u4EFB\u52A1\uFF0C\u8BF7\u9009\u586B\u6B64\u9879", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u53EF\u4EE5\u901A\u8FC7\u5B66\u5458\u7B54\u6848\u6587\u4EF6\u8DEF\u5F84\u8BBE\u7F6E\uFF0C\u5C55\u793Atxt\u6587\u4EF6\u5185\u5BB9", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "html\uFF1Aweb\u7C7B\u578B\u7684\u4EFB\u52A1\uFF0C\u8BF7\u9009\u586B\u6B64\u9879", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u53EF\u4EE5\u901A\u8FC7Web\u8DEF\u7531\u8BBE\u7F6E\uFF0C\u5C55\u793Ahtml\u6548\u679C\u9884\u89C8\u9875", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "mp3/mp4\uFF1Amp3/mp4\u6587\u4EF6\u7C7B\u578B\u7684\u4EFB\u52A1\uFF0C\u8BF7\u9009\u586B\u6B64\u9879", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u53EF\u4EE5\u901A\u8FC7\u5B66\u5458\u7B54\u6848\u6587\u4EF6\u8DEF\u5F84\u8BBE\u7F6E\uFF0C\u5C55\u793Amp3/mp4\u6587\u4EF6\u5185\u5BB9", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "LaTeX\uFF1ALaTeX\u5B9E\u9A8C\u62A5\u544A\u7684\u4EFB\u52A1\uFF0C\u8BF7\u9009\u62E9\u6B64\u9879", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5B66\u5458\u53EF\u4EE5\u4F7F\u7528LaTeX\u7CFB\u7EDF\u64B0\u5199\u5B9E\u9A8C\u62A5\u544A\uFF0C\u6700\u7EC8\u4EE5PDF\u683C\u5F0F\u5C55\u793A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-red",
children: "\u6CE8\u610F\uFF1A\u9009\u62E9\u4E86LaTeX\u7684\u5173\u5361\uFF0C\u9700\u8981\u6559\u5E08\u624B\u52A8\u5BF9\u8BE5\u5173\u5361\u8FDB\u884C\u5224\u5206"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "Office\uFF1AMicrosoftOffice\u76F8\u5173\u6587\u4EF6\u7684\u4EFB\u52A1\uFF0C\u8BF7\u9009\u586B\u6B64\u9879", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u6CE8\u610F\uFF1A\u5B66\u751F\u4E0A\u4F20\u7684office\u6587\u4EF6\u76EE\u5F55\u662F\u5728/data/bigfiles\u76EE\u5F55\u4E0B\uFF0C\u5982\u679C\u8981\u505A\u8BC4\u6D4B\uFF0C\u8BF7\u8BFB\u53D6\u6B64\u76EE\u5F55\u7684\u6587\u4EF6", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
}),
trigger: "click",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {
className: "ml5 font24 c-light-black"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "path",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5B66\u5458\u4EFB\u52A1\u6587\u4EF6 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u8BE5\u6587\u4EF6\u5C06\u76F4\u63A5\u663E\u793A\u7ED9\u5B66\u751F\uFF0C\u9700\u8981\u5B66\u751F\u5728\u5176\u4E2D\u586B\u5199\u4EE3\u7801\uFF09"
})]
}),
rules: [{
required: true,
message: "必填项:不能为空"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u70B9\u51FB\u9009\u62E9\u4EE3\u7801\u6587\u4EF6\uFF0C\u53EF\u540C\u65F6\u9009\u62E9\u591A\u4E2A\u6587\u4EF6",
onClick: function onClick() {
return handleChangeFilePathModal(PracticeFileType.Path);
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "exec_path",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u8BC4\u6D4B\u6267\u884C\u6587\u4EF6 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u70B9\u51FB\u8BC4\u6D4B\u6309\u94AE\u65F6\u8C03\u7528\u7684\u6587\u4EF6\uFF0C\u7528\u4E8E\u68C0\u6D4B\u5B66\u5458\u7ED3\u679C\u662F\u5426\u6B63\u786E\uFF0C\u53EF\u4EE5\u4E0E\u201C\u5B66\u5458\u4EFB\u52A1\u6587\u4EF6\u201D\u4E00\u81F4\uFF09"
})]
}),
rules: [{
required: true,
message: "必填项:不能为空"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u70B9\u51FB\u9009\u62E9\u4EE3\u7801\u6587\u4EF6",
onClick: function onClick() {
return handleChangeFilePathModal(PracticeFileType.ExecPath);
}
})
}), formValue.show_type === 4 && (formValue.web_route || (settingData === null || settingData === void 0 ? void 0 : settingData.has_web_route)) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "proxy_port",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u7AEF\u53E3\u53F7 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u8BF7\u6CE8\u610F\u5C06\u670D\u52A1\u5668\u7A0B\u5E8F\u7684\u7AEF\u53E3\u53F7\u6620\u5C04\u5230\u4EE5\u4E0B\u7AEF\u53E3\uFF0C\u9ED8\u8BA48080\uFF09"
})]
}),
rules: [{
required: true,
message: "请输入端口号"
}, {
validator: function validator(_, value) {
return /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/.test(value) || !value ? Promise.resolve() : Promise.reject(new Error('端口输入范围(0-65535)'));
}
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u8BF7\u8F93\u51650-65535\u7684\u503C"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "web_route",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["Web\u8DEF\u7531 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: " \uFF08\u7F51\u7AD9\u7C7B\u578B\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C\u8BF7\u586B\u5199Web\u8DEF\u7531\u5730\u5740\uFF09"
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u7F51\u7AD9\u7C7B\u578B\u5B9E\u8BAD\uFF0C\u8BF7\u586B\u5199Web\u8DEF\u7531\u5730\u5740\u3002\u4F8B\uFF1Ajava/mypage"
})
})]
}), (formValue.show_type === 1 || formValue.show_type === 5 || formValue.show_type === 6) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "original_picture_path",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6E90\u6587\u4EF6\u76EE\u5F55 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u8BE5\u76EE\u5F55\u7528\u4E8E\u5B58\u653E\u9700\u8981\u5904\u7406\u7684\u56FE\u7247/MP3/MP4\u7B49\u6587\u4EF6\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u5355\u72EC\u7684\u6587\u4EF6\u5939\uFF09"
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u70B9\u51FB\u9009\u62E9\u6587\u4EF6\u76EE\u5F55\uFF0C\u4F8B\uFF1Asrc/step1/sourcefiles",
onClick: function onClick() {
return handleChangeFilePathModal(PracticeFileType.OriginalPicturePath);
}
})
}), formValue.show_type !== -1 && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "picture_path",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u5B66\u5458\u7B54\u6848\u6587\u4EF6\u76EE\u5F55 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u8BE5\u76EE\u5F55\u7528\u4E8E\u5B58\u653E\u5B66\u5458\u4EE3\u7801\u6267\u884C\u540E\u751F\u6210\u7684\u6587\u4EF6\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u5355\u72EC\u7684\u6587\u4EF6\u5939\uFF09"
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u70B9\u51FB\u9009\u62E9\u6587\u4EF6\u76EE\u5F55\uFF0C\u4F8B\uFF1Asrc/step1/outputfiles",
onClick: function onClick() {
return handleChangeFilePathModal(PracticeFileType.PicturePath);
}
})
}), (formValue.show_type === 1 || formValue.show_type === 5 || formValue.show_type === 6) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "expect_picture_path",
label: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6807\u51C6\u7B54\u6848\u6587\u4EF6\u76EE\u5F55 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u8BE5\u76EE\u5F55\u7528\u4E8E\u5B58\u653E\u6700\u7EC8\u4F5C\u4E3A\u53C2\u8003\u7684\u6587\u4EF6\uFF0C\u5728\u8BC4\u6D4B\u901A\u8FC7\u540E\u4F1A\u5C55\u793A\u7ED9\u5B66\u5458\u67E5\u770B\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u5355\u72EC\u7684\u6587\u4EF6\u5939\uFF09"
})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
bordered: false,
placeholder: "\u70B9\u51FB\u9009\u62E9\u6587\u4EF6\u76EE\u5F55\uFF0C\u4F8B\uFF1Asrc/step1/expectedfiles",
onClick: function onClick() {
return handleChangeFilePathModal(PracticeFileType.ExpectPicturePath);
}
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPracticeSettingmodules.threePart,
children: formValue.with_code_file && /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPracticeSettingmodules.title,
children: "\u8BC4\u6D4B\u89C4\u5219"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPracticeSettingmodules.flexRowCenter,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPracticeSettingmodules.formCustom,
name: "test_set_rules",
label: "\u901A\u5173\u5224\u5B9A:",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
className: "ml25",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
className: EditPracticeSettingmodules.radioStyle,
value: 0,
children: "\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u5BF9\u6BD4"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
className: EditPracticeSettingmodules.radioStyle,
value: 1,
children: "\u5B9E\u9645\u8F93\u51FA\u6EE1\u8DB3\u89C4\u5219"
})]
})
}), formValue.test_set_rules === 1 && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "test_set_rules_expression",
style: {
marginTop: 50,
position: "relative",
top: 40
},
rules: [{
required: true,
message: "必填项:不能为空"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: {
width: 400,
marginLeft: -40
},
bordered: false,
placeholder: "\u9002\u7528\u4E8E\u8F93\u51FA\u7ED3\u679C\u52A8\u6001\u53D8\u5316\u7684\u7A0B\u5E8F"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(popover/* default */.Z, {
overlayClassName: EditPracticeSettingmodules.popover,
placement: "bottomLeft",
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "font12",
children: ["\u4F7F\u7528\u793A\u4F8B1\uFF1A\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u7684\u76F8\u5BF9\u8BEF\u5DEE\u57280.01\u4EE5\u5185\uFF0C\u53EF\u4F7F\u7528\u4EE5\u4E0B\u8868\u8FBE\u5F0F\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "(actual-expect)/expect <= 0.01", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u4F7F\u7528\u793A\u4F8B2\uFF1A\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\u5305\u542B\u67D0\u6BB5\u5B57\u7B26\u4E32hello\uFF0C\u53EF\u4F7F\u7528\u4EE5\u4E0B\u8868\u8FBE\u5F0F\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "string.contains(actual, \"hello\")", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u82E5\u9700\u8981\u5BF9\u8F93\u51FA\u7ED3\u679C\u4E2D\u6BCF\u4E2A\u5143\u7D20\u8FDB\u884C\u64CD\u4F5C\uFF0C\u53EF\u4F7F\u7528list\u96C6\u5408", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u793A\u4F8B\u53C2\u8003\uFF1A\u5047\u8BBE\u7A0B\u5E8F\u5B9E\u9645\u8F93\u51FA\u4E3A\uFF1A100 1000 10000\uFF1B\u9884\u671F\u8F93\u51FA\u4E3A\uFF1A100.01 1000.02 10000.05", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BC4\u6D4B\u8981\u6C42\uFF1A\u5B9E\u9645\u8F93\u51FA\u5217\u8868\u4E2D\u5143\u7D20\u4E0E\u9884\u671F\u8F93\u51FA\u5217\u8868\u4E2D\u5BF9\u5E94\u5143\u7D20\u76F8\u5BF9\u8BEF\u5DEE\u57280.01 \u4E4B\u5185\uFF0C\u53EF\u4F7F\u4EE5\u4E0B\u8868\u8FBE\u5F0F\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "list.forEach( 'math.abs( (actualElem-expectElem)/expectElem ) <= 0.01 ' )", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
href: "https://www.educoder.net/forums/4346",
target: "_blank",
style: {
background: '#0152d9',
color: '#fff'
},
children: "\u70B9\u51FB\u67E5\u770B\u8BE6\u60C5\u8BF4\u660E"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
}),
trigger: "click",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {
style: {
padding: '114px 0 0 9px'
},
className: "font24 c-light-black"
})
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPracticeSettingmodules.formCustom,
name: "ignore_space",
label: "\u7A7A\u683C\u5904\u7406:",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
className: "ml25",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
className: EditPracticeSettingmodules.radioStyle,
value: 0,
children: "\u4E0D\u5FFD\u7565\u7A7A\u683C"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
className: EditPracticeSettingmodules.radioStyle,
value: 1,
children: "\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
className: EditPracticeSettingmodules.radioStyle,
value: 2,
children: ["\u5FFD\u7565\u6240\u6709\u7A7A\u683C", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "(\u8BC4\u6D4B\u8FC7\u7A0B\u4E2D\u81EA\u52A8\u53BB\u6389\u6240\u6709\u7A7A\u683C\u8FDB\u884C\u5BF9\u6BD4)"
})]
})]
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPracticeSettingmodules.fourPart,
children: formValue.with_code_file && /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPracticeSettingmodules.title,
children: "\u6D4B\u8BD5\u96C6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPracticeSettingmodules.testJi,
name: "test_set_score",
label: "\u5F97\u5206\u89C4\u8303:",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
className: "ml25",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: false,
className: EditPracticeSettingmodules.radioStyle,
children: ["\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u80FD\u83B7\u5F97\u91D1\u5E01\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
value: true,
className: EditPracticeSettingmodules.radioStyle,
children: ["\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u90E8\u5206\u6D4B\u8BD5\u96C6\u6B63\u786E\u65F6\uFF0C\u6309\u914D\u7F6E\u7684\u6BD4\u4F8B\u83B7\u5F97\u91D1\u5E01\uFF09"
})]
})]
})
}), formValue.test_set_score && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: EditPracticeSettingmodules.averageWarp,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPracticeSettingmodules.averageCustom,
name: "test_set_average",
label: "",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default.Group */.ZP.Group, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
style: {
margin: '0 40px 0 20px'
},
value: true,
children: "\u5747\u5206\u6BD4\u4F8B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: false,
children: "\u81EA\u5B9A\u4E49\u6BD4\u4F8B"
})]
})
})
}), formValue.test_set_score && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
height: '30px',
marginBottom: '10px',
paddingLeft: '93px'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isshows,
style: {
display: 'flex',
alignItems: 'center'
},
className: EditPracticeSettingmodules.checkboxs,
onChange: function onChange(e) {
setisshows(e.target.checked);
form.setFieldsValue({
code_compile_score: 0
});
if (formValue.test_set_average) {
if (formValue.is_file) {
handleUploadRatio(uploadData);
} else {
handleShareRatio(testSetList);
}
}
// onAddTestCases();
},
children: "\u542F\u7528\u7F16\u8BD1\u901A\u8FC7\u5373\u53EF\u5F97\u5206"
}), isshows && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
rules: [{
required: true,
message: '请输入编译得分'
}],
name: 'code_compile_score',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
onChange: function onChange() {
// onAddTestCases();
if (formValue.test_set_average) {
if (formValue.is_file) {
handleUploadRatio(uploadData);
} else {
handleShareRatio(testSetList);
}
}
},
parser: function parser(e) {
return isNaN(parseInt(e)) ? '' : parseInt(e);
},
min: 0,
max: 100,
style: {
width: '85px',
margin: '5px 0px',
fontSize: "14px"
}
})
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
display: 'flex',
alignItems: 'center',
marginLeft: '5px'
},
children: "%"
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
paddingLeft: '85px',
color: '#999',
fontSize: '12px',
marginBottom: '20px'
},
children: "\uFF08\u8BF7\u6CE8\u610F\u8BE5\u5B9E\u8BAD\u9898\u662F\u5426\u6709\u7F16\u8BD1\u8FC7\u7A0B\uFF0C\u82E5\u6CA1\u6709\u5219\u65E0\u6CD5\u83B7\u5F97\u7F16\u8BD1\u5F97\u5206\uFF09"
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
className: EditPracticeSettingmodules.testJi,
name: "is_file",
label: "\u7528\u4F8B\u7C7B\u578B:",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
className: "ml25",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
direction: "horizontal",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: false,
className: EditPracticeSettingmodules.radioStyle,
children: "\u6587\u672C"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
value: true,
className: EditPracticeSettingmodules.radioStyle,
children: "\u6587\u4EF6"
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: '20px'
},
className: EditPracticeSettingmodules.upBtn,
children: [!formValue.is_file && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
ghost: true,
disabled: isChecked.every(function (item) {
return !item;
}),
type: "primary",
className: "mb20",
style: {
right: "345px"
},
onClick: function onClick() {
return setshowbatch(true);
},
children: "\u6279\u91CF\u8BBE\u7F6E"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
ghost: true,
type: "primary",
className: "mb20",
style: {
right: "174px"
},
onClick: function onClick() {
return handleDeleteTestSet();
},
children: "\u4E00\u952E\u5220\u9664\u6D4B\u8BD5\u7528\u4F8B"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
ghost: true,
type: "primary",
className: "mb20",
style: {
right: "4px"
},
onClick: function onClick() {
return setShowUploadFile(true);
},
children: "\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"
}), formValue.is_file && /*#__PURE__*/(0,jsx_runtime.jsx)(UploadFile/* UploadTable */.Y2, {
showEvaluatingSetting: true,
onEvaluatingChange: handleEvaluatingChange,
checkAll1: checkAll1,
checkAll2: checkAll2,
checkAll3: checkAll3,
checkAll4: checkAll4,
checkAll5: checkAll5,
onSelectAll: handleSelectAll,
disabled: formValue === null || formValue === void 0 ? void 0 : formValue.test_set_average,
inputChange: handleInputChange,
showScore: formValue === null || formValue === void 0 ? void 0 : formValue.test_set_score,
data: uploadData,
onRemove: handleRemove
})]
}), !formValue.is_file && /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isChecked.every(function (item) {
return !!item;
}),
onChange: function onChange(e) {
var newIsChecked = isChecked.map(function () {
return e.target.checked;
});
setIsChecked(newIsChecked);
setcheckAll(e.target.checked);
},
children: "\u5168\u9009"
}), !formValue.is_file && testSetList.map(function (item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: EditPracticeSettingmodules.groupWrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "font16",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: isChecked[key],
onChange: function onChange(e) {
console.log(isChecked);
var newIsChecked = toConsumableArray_default()(isChecked);
newIsChecked[key] = e.target.checked;
var selectAll = newIsChecked.every(function (item) {
return item;
});
setIsChecked(newIsChecked);
setcheckAll(selectAll);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "mr10 ml5",
children: ["\u7EC4", key + 1, " : "]
}), formValue.test_set_score && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginRight: 100
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
style: {
width: 85
}
// bordered={false}
// className={styles.customInput}
,
value: item.score,
type: "number",
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: "%"
})]
}), formValue.test_set_score && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
className: "font14 ml5",
checked: item.is_target,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
is_target: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: ["\u6307\u6807\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: '如需要输出指标,可以勾选指标测测试集,并对指标进行命名。教师可在实训作业的实训报告页面查看学生的指标是否合格。指标得分计入最终成绩',
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {
className: "ml5 font12 c-light-black"
})
}), " "]
}), item.is_target && formValue.test_set_score && /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
value: item.target_name,
maxLength: 30,
style: {
width: '50%'
},
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
target_name: e.target.value
});
}
return test;
});
setTestSetList(testData);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "tr flex1",
style: {
"float": 'right'
},
children: key !== 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "bottom",
title: "删除",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 c-red current",
onClick: function onClick() {
var testData = testSetList.filter(function (_, testIndex) {
return testIndex !== key;
});
var newIsChecked = isChecked.filter(function (_, index) {
return index !== key;
});
setIsChecked(newIsChecked);
handleShareRatio(testData);
},
children: "\u5220\xA0\u9664"
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
bordered: false,
className: "mt10",
rows: 5,
placeholder: "\u8F93\u5165",
value: item.input,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
input: e.target.value
});
}
return test;
});
setTestSetList(testData);
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
bordered: false,
className: "mt10",
rows: 5,
placeholder: "\u9884\u671F\u8F93\u51FA",
value: item.output,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
output: e.target.value
});
}
return test;
});
setTestSetList(testData);
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt10",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font14 mr15",
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)("span", {
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)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9690\u85CF\u8F93\u5165\uFF1A\u52FE\u9009\u540E\u6D4B\u8BD5\u8F93\u5165\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
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)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9690\u85CF\u5B9E\u9645\u8F93\u51FA\uFF1A\u52FE\u9009\u540E\u5B9E\u9645\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {
className: "ml5 font12 c-light-black"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.hidden === 1,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
hidden: e.target.checked ? 1 : 0,
input_visible: e.target.checked,
is_invisible: e.target.checked,
actual_output_visible: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14",
children: "\u5168\u90E8\u9690\u85CF"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.hidden === 1 ? true : item.input_visible,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
var allhidden = e.target.checked ? item.is_invisible && item.actual_output_visible ? 1 : 0 : 0;
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
input_visible: e.target.checked,
hidden: allhidden
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14",
children: "\u9690\u85CF\u8F93\u5165"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.hidden === 1 ? true : item.is_invisible,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
var allhidden = e.target.checked ? item.actual_output_visible && item.input_visible ? 1 : 0 : 0;
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
is_invisible: e.target.checked,
hidden: allhidden
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14",
children: "\u9690\u85CF\u9884\u671F\u8F93\u51FA"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.hidden === 1 ? true : item.actual_output_visible,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
var allhidden = e.target.checked ? item.is_invisible && item.input_visible ? 1 : 0 : 0;
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
actual_output_visible: e.target.checked,
hidden: allhidden
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14",
children: "\u9690\u85CF\u5B9E\u9645\u8F93\u51FA"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 mr20",
children: "\u7279\u6B8A\u5224\u5B9A:"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: item.last_match_rule,
onChange: function onChange(e) {
var testData = testSetList.map(function (test, testIndex) {
if (testIndex === key) {
return objectSpread2_default()(objectSpread2_default()({}, test), {}, {
last_match_rule: e.target.checked
});
}
return test;
});
setTestSetList(testData);
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font14",
children: ["\u672B\u5C3E\u5339\u914D", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 c-light-black",
children: "\uFF08\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u6700\u540E\u4E00\u884C\u76F8\u540C\u5373\u53EF\u901A\u5173\uFF09"
})]
})
})]
})]
}, key);
}), !formValue.is_file && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
type: "primary",
ghost: true,
className: "mt10",
onClick: handleAddTestSet,
children: "\u65B0\u589E\u6D4B\u8BD5\u96C6"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: " ml20 mt10 font12 c-light-black",
children: "\u6E29\u99A8\u63D0\u793A\uFF1A\u516C\u5F00\u6D4B\u8BD5\u96C6\u548C\u9690\u85CF\u6D4B\u8BD5\u96C6\u7ED3\u5408\u4F7F\u7528\uFF0C\u53EF\u4EE5\u964D\u4F4E\u4F5C\u5F0A\u7684\u673A\u7387\uFF1B\u9690\u85CF\u6D4B\u8BD5\u96C6\uFF0C\u5728\u201C\u63D0\u4EA4\u8BC4\u6D4B\u201D\u65F6\u4E5F\u5C06\u88AB\u7CFB\u7EDF\u81EA\u52A8\u68C0\u6D4B"
})]
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_SelectFilePathModal, {
fileType: selectFilePathType,
path: formValue === null || formValue === void 0 ? void 0 : formValue[selectFilePathType],
onFinish: function onFinish(path) {
return handleFinishSelectFilePath(path);
}
})]
}, 1), /*#__PURE__*/(0,jsx_runtime.jsx)(FixedButton/* FixedButton */.t, {
onOk: function onOk() {
return form.submit();
},
className: "customFixedButton",
onCancel: toExit
// onCancel={() => getPracticeData()}
}, 2), /*#__PURE__*/(0,jsx_runtime.jsx)(Loading/* default */.Z, {
loading: loading
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UploadFile/* default */.ZP, {
rootIdentifier: shixunsDetail === null || shixunsDetail === void 0 || (_shixunsDetail$detail9 = shixunsDetail.detail) === null || _shixunsDetail$detail9 === void 0 ? void 0 : _shixunsDetail$detail9.root_identifier,
visible: showUploadFile,
onClose: function onClose() {
return setShowUploadFile(false);
},
onOK: addUploadData,
multiple: true,
defaultMultipleValue: formValue === null || formValue === void 0 ? void 0 : formValue.is_file
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
open: showbatch,
onOk: function onOk() {
var testData = testSetList.map(function (item, index) {
if (isChecked[index]) {
console.log(objectSpread2_default()({}, item));
console.log(objectSpread2_default()({}, batchset));
console.log(objectSpread2_default()(objectSpread2_default()({}, item), batchset));
return objectSpread2_default()(objectSpread2_default()({}, item), batchset);
}
return item;
});
setTestSetList(testData);
setbatchset({
hidden: 0,
input_visible: false,
is_invisible: false,
actual_output_visible: false,
last_match_rule: false
});
setshowbatch(false);
},
centered: true,
okText: '确认',
cancelText: "\u53D6\u6D88",
onCancel: function onCancel() {
setbatchset({
hidden: 0,
input_visible: false,
is_invisible: false,
actual_output_visible: false,
last_match_rule: false
});
setshowbatch(false);
},
width: 586,
title: "\u6279\u91CF\u8BBE\u7F6E",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font14 mr15",
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)("span", {
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)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9690\u85CF\u8F93\u5165\uFF1A\u52FE\u9009\u540E\u6D4B\u8BD5\u8F93\u5165\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
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)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u9690\u85CF\u5B9E\u9645\u8F93\u51FA\uFF1A\u52FE\u9009\u540E\u5B9E\u9645\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {})]
}),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(QuestionCircleOutlined/* default */.Z, {
className: "ml5 font12 c-light-black"
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: batchset.hidden === 1,
onChange: function onChange(e) {
// const testData = testSetList.map((test, testIndex) => {
// if (testIndex === key) {
// return {
// ...test, hidden: e.target.checked ? 1 : 0, input_visible: e.target.checked,
// is_invisible: e.target.checked, actual_output_visible: e.target.checked
// }
// }
// return test
// })
// setTestSetList(testData)
setbatchset(objectSpread2_default()(objectSpread2_default()({}, batchset), {}, {
hidden: e.target.checked ? 1 : 0,
input_visible: e.target.checked,
is_invisible: e.target.checked,
actual_output_visible: e.target.checked
}));
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 mr10",
children: "\u5168\u90E8\u9690\u85CF"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: batchset.input_visible,
onChange: function onChange(e) {
// const testData = testSetList.map((test, testIndex) => {
// if (testIndex === key) {
// const allhidden = e.target.checked ? (item.is_invisible && item.actual_output_visible) ? 1 : 0 : 0
// return { ...test, input_visible: e.target.checked, hidden: allhidden }
// }
// return test
// })
// setTestSetList(testData)
var allhidden = e.target.checked ? batchset.is_invisible && batchset.actual_output_visible ? 1 : 0 : 0;
setbatchset(objectSpread2_default()(objectSpread2_default()({}, batchset), {}, {
hidden: allhidden,
input_visible: e.target.checked
}));
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 mr10",
children: "\u9690\u85CF\u8F93\u5165"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: batchset.is_invisible,
onChange: function onChange(e) {
// const testData = testSetList.map((test, testIndex) => {
// if (testIndex === key) {
// const allhidden = e.target.checked ? (item.actual_output_visible && item.input_visible) ? 1 : 0 : 0
// return { ...test, is_invisible: e.target.checked, hidden: allhidden }
// }
// return test
// })
// setTestSetList(testData)
var allhidden = e.target.checked ? batchset.input_visible && batchset.actual_output_visible ? 1 : 0 : 0;
setbatchset(objectSpread2_default()(objectSpread2_default()({}, batchset), {}, {
hidden: allhidden,
is_invisible: e.target.checked
}));
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14 mr10",
children: "\u9690\u85CF\u9884\u671F\u8F93\u51FA"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: batchset.actual_output_visible,
onChange: function onChange(e) {
// const testData = testSetList.map((test, testIndex) => {
// if (testIndex === key) {
// const allhidden = e.target.checked ? (item.is_invisible && item.input_visible) ? 1 : 0 : 0
// return { ...test, actual_output_visible: e.target.checked, hidden: allhidden }
// }
// return test
// })
// setTestSetList(testData)
var allhidden = e.target.checked ? batchset.input_visible && batchset.is_invisible ? 1 : 0 : 0;
setbatchset(objectSpread2_default()(objectSpread2_default()({}, batchset), {}, {
hidden: allhidden,
actual_output_visible: e.target.checked
}));
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font14",
children: "\u9690\u85CF\u5B9E\u9645\u8F93\u51FA"
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt10",
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: batchset.last_match_rule,
onChange: function onChange(e) {
setbatchset(objectSpread2_default()(objectSpread2_default()({}, batchset), {}, {
last_match_rule: e.target.checked
}));
},
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"
})]
})
})]
})]
})
})]
});
};
/* harmony default export */ var Challenges_EditPracticeSetting = ((0,_umi_production_exports.connect)(function (_ref5) {
var shixunsDetail = _ref5.shixunsDetail,
newCourse = _ref5.newCourse,
globalSetting = _ref5.globalSetting,
practiceSetting = _ref5.practiceSetting;
return {
shixunsDetail: shixunsDetail,
newCourse: newCourse,
globalSetting: globalSetting,
practiceSetting: practiceSetting
};
})(EditPracticeSetting));
/***/ }),
/***/ 44810:
/*!***************************************************************************************************!*\
!*** ./src/pages/Shixuns/Edit/body/Level/Challenges/RankingSetting/challenge-nav.tsx + 1 modules ***!
\***************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ challenge_nav; }
});
// 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/.umi-production/exports.ts + 15 modules
var _umi_production_exports = __webpack_require__(58011);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/RankingSetting/challenge-nav.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/RankingSetting/challenge-nav.tsx
var ChallengeNav = function ChallengeNav(_ref) {
var activeIndex = _ref.activeIndex,
_ref$isEdit = _ref.isEdit,
isEdit = _ref$isEdit === void 0 ? true : _ref$isEdit,
dispatch = _ref.dispatch,
practiceSetting = _ref.practiceSetting;
var params = (0,_umi_production_exports.useParams)();
var id = params.id,
challengesId = params.challengesId;
var navs = (0,_react_17_0_2_react.useMemo)(function () {
return [{
name: '本关任务',
url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/editcheckpoint")
}, {
name: '评测设置',
url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/tab=2")
}, {
name: '参考答案',
url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/tab=3")
}, {
name: '关卡排行榜',
url: "/shixuns/".concat(id, "/edit/").concat(challengesId, "/tab=4")
}];
}, [id, challengesId]);
var handleClick = function handleClick(url) {
var _practiceSetting$side;
var toNext = function toNext() {
_umi_production_exports.history.push(url);
dispatch({
type: 'practiceSetting/setSideBarTabs',
payload: {
confirmLeave: false
}
});
};
if (practiceSetting !== null && practiceSetting !== void 0 && (_practiceSetting$side = practiceSetting.sideBar) !== null && _practiceSetting$side !== void 0 && _practiceSetting$side.confirmLeave) {
modal/* default */.Z.confirm({
title: "离开此页提示",
content: "系统可能不会保存您所做的更改。",
okText: "离开",
cancelText: "取消",
onOk: function onOk() {
toNext();
}
});
} else {
toNext();
}
};
return /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
className: "challenge-nav",
children: isEdit ? navs.map(function (item, index) {
if (activeIndex === index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: "active",
children: item.name
}), " "]
}, item.url);
} else {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
onClick: function onClick() {
return handleClick(item.url);
},
children: item.name
}), " "]
}, item.url);
}
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: "active",
children: navs[0].name
}), " "]
}, navs[0].url)
});
};
/* harmony default export */ var challenge_nav = ((0,_umi_production_exports.connect)(function (_ref2) {
var globalSetting = _ref2.globalSetting,
practiceSetting = _ref2.practiceSetting;
return {
globalSetting: globalSetting,
practiceSetting: practiceSetting
};
})(ChallengeNav));
/***/ }),
/***/ 47973:
/*!***********************************************************************************************!*\
!*** ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.tsx + 1 modules ***!
\***********************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_Loading; }
});
// 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/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Loadingmodules = ({"loading":"loading___lueiN"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.tsx
var Loading = function Loading(_ref) {
var loading = _ref.loading;
return loading ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Loadingmodules.loading,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {});
};
/* harmony default export */ var components_Loading = (Loading);
/***/ }),
/***/ 9319:
/*!************************************************!*\
!*** ./src/pages/Shixuns/Edit/utils/index.tsx ***!
\************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ S: function() { return /* binding */ formatCodemirrorValue; },
/* harmony export */ m: function() { return /* binding */ handleSaveCopyForExercise; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/util */ 73400);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 8591);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var formatCodemirrorValue = function formatCodemirrorValue(value) {
var dom = document.createElement("textarea");
dom.value = value;
return dom.value;
};
var handleSaveCopyForExercise = /*#__PURE__*/function () {
var _ref = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().mark(function _callee(dispatch, shixunsDetail, id, type, active) {
var result, _result$data, _result$data2;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_0___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'shixunsDetail/saveCopyForExercise',
payload: {
id: id,
save_type: type
}
});
case 2:
result = _context.sent;
if (type === 1) {
if ((result === null || result === void 0 ? void 0 : result.status) == 0) {
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.success('保存成功');
}
if (result !== null && result !== void 0 && (_result$data = result.data) !== null && _result$data !== void 0 && _result$data.exists_same_shixun_name) {
dispatch({
type: 'classroomList/setActionTabs',
payload: {
key: '重名修改',
name: result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.shixun_name
}
});
} else {
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
}
} else {
dispatch({
type: 'classroomList/setActionTabs',
payload: {}
});
if ((result === null || result === void 0 ? void 0 : result.status) === 0) {
antd__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z.info({
title: '提示',
width: 460,
icon: null,
centered: true,
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
children: "\u5B9E\u8BAD\u540C\u6B65\u4FEE\u6539\u5B8C\u6210\uFF0C\u8BF7\u9A8C\u8BC1\u5B9E\u8BAD\u662F\u5426\u53EF\u4EE5\u6B63\u5E38\u4F7F\u7528\u3002"
})
}),
okText: '前往原实训',
onOk: function onOk() {
var _shixunsDetail$detail;
// setCaptureVideoVisible(true)
(0,_utils_util__WEBPACK_IMPORTED_MODULE_2__/* .openNewWindow */ .xg)("/shixuns/".concat(shixunsDetail === null || shixunsDetail === void 0 || (_shixunsDetail$detail = shixunsDetail.detail) === null || _shixunsDetail$detail === void 0 || (_shixunsDetail$detail = _shixunsDetail$detail.fork_from) === null || _shixunsDetail$detail === void 0 ? void 0 : _shixunsDetail$detail.fork_identifier, "/challenges"));
}
});
}
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function handleSaveCopyForExercise(_x, _x2, _x3, _x4, _x5) {
return _ref.apply(this, arguments);
};
}();
/***/ })
}]);