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

2261 lines
122 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[34994],{
/***/ 2377:
/*!*************************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/icons/CloseCircleOutlined.js + 1 modules ***!
\*************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_CloseCircleOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(5891);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/CloseCircleOutlined.js
// This icon file is generated automatically.
var CloseCircleOutlined = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" } }] }, "name": "close-circle", "theme": "outlined" };
/* harmony default export */ var asn_CloseCircleOutlined = (CloseCircleOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(88853);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/icons/CloseCircleOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var CloseCircleOutlined_CloseCircleOutlined = function CloseCircleOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_CloseCircleOutlined
}));
};
/**![close-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdmlld0JveD0iNjQgNjQgODk2IDg5NiIgZm9jdXNhYmxlPSJmYWxzZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNTEyIDY0YzI0Ny40IDAgNDQ4IDIwMC42IDQ0OCA0NDhTNzU5LjQgOTYwIDUxMiA5NjAgNjQgNzU5LjQgNjQgNTEyIDI2NC42IDY0IDUxMiA2NHptMCA3NmMtMjA1LjQgMC0zNzIgMTY2LjYtMzcyIDM3MnMxNjYuNiAzNzIgMzcyIDM3MiAzNzItMTY2LjYgMzcyLTM3Mi0xNjYuNi0zNzItMzcyLTM3MnptMTI4LjAxIDE5OC44M2MuMDMgMCAuMDUuMDEuMDkuMDZsNDUuMDIgNDUuMDFhLjIuMiAwIDAxLjA1LjA5LjEyLjEyIDAgMDEwIC4wN2MwIC4wMi0uMDEuMDQtLjA1LjA4TDU1Ny4yNSA1MTJsMTI3Ljg3IDEyNy44NmEuMjcuMjcgMCAwMS4wNS4wNnYuMDJhLjEyLjEyIDAgMDEwIC4wN2MwIC4wMy0uMDEuMDUtLjA1LjA5bC00NS4wMiA0NS4wMmEuMi4yIDAgMDEtLjA5LjA1LjEyLjEyIDAgMDEtLjA3IDBjLS4wMiAwLS4wNC0uMDEtLjA4LS4wNUw1MTIgNTU3LjI1IDM4NC4xNCA2ODUuMTJjLS4wNC4wNC0uMDYuMDUtLjA4LjA1YS4xMi4xMiAwIDAxLS4wNyAwYy0uMDMgMC0uMDUtLjAxLS4wOS0uMDVsLTQ1LjAyLTQ1LjAyYS4yLjIgMCAwMS0uMDUtLjA5LjEyLjEyIDAgMDEwLS4wN2MwLS4wMi4wMS0uMDQuMDYtLjA4TDQ2Ni43NSA1MTIgMzM4Ljg4IDM4NC4xNGEuMjcuMjcgMCAwMS0uMDUtLjA2bC0uMDEtLjAyYS4xMi4xMiAwIDAxMC0uMDdjMC0uMDMuMDEtLjA1LjA1LS4wOWw0NS4wMi00NS4wMmEuMi4yIDAgMDEuMDktLjA1LjEyLjEyIDAgMDEuMDcgMGMuMDIgMCAuMDQuMDEuMDguMDZMNTEyIDQ2Ni43NWwxMjcuODYtMTI3Ljg2Yy4wNC0uMDUuMDYtLjA2LjA4LS4wNmEuMTIuMTIgMCAwMS4wNyAweiIgLz48L3N2Zz4=) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(CloseCircleOutlined_CloseCircleOutlined);
if (false) {}
/* harmony default export */ var icons_CloseCircleOutlined = (RefIcon);
/***/ }),
/***/ 15962:
/*!**********************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/icons/PoweroffOutlined.js + 1 modules ***!
\**********************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_PoweroffOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(5891);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/PoweroffOutlined.js
// This icon file is generated automatically.
var PoweroffOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z" } }] }, "name": "poweroff", "theme": "outlined" };
/* harmony default export */ var asn_PoweroffOutlined = (PoweroffOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(88853);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.5.2@@ant-design/icons/es/icons/PoweroffOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var PoweroffOutlined_PoweroffOutlined = function PoweroffOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_PoweroffOutlined
}));
};
/**![poweroff](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcwNS42IDEyNC45YTggOCAwIDAwLTExLjYgNy4ydjY0LjJjMCA1LjUgMi45IDEwLjYgNy41IDEzLjZhMzUyLjIgMzUyLjIgMCAwMTYyLjIgNDkuOGMzMi43IDMyLjggNTguNCA3MC45IDc2LjMgMTEzLjNhMzU1IDM1NSAwIDAxMjcuOSAxMzguN2MwIDQ4LjEtOS40IDk0LjgtMjcuOSAxMzguN2EzNTUuOTIgMzU1LjkyIDAgMDEtNzYuMyAxMTMuMyAzNTMuMDYgMzUzLjA2IDAgMDEtMTEzLjIgNzYuNGMtNDMuOCAxOC42LTkwLjUgMjgtMTM4LjUgMjhzLTk0LjctOS40LTEzOC41LTI4YTM1My4wNiAzNTMuMDYgMCAwMS0xMTMuMi03Ni40QTM1NS45MiAzNTUuOTIgMCAwMTE4NCA2NTAuNGEzNTUgMzU1IDAgMDEtMjcuOS0xMzguN2MwLTQ4LjEgOS40LTk0LjggMjcuOS0xMzguNyAxNy45LTQyLjQgNDMuNi04MC41IDc2LjMtMTEzLjMgMTktMTkgMzkuOC0zNS42IDYyLjItNDkuOCA0LjctMi45IDcuNS04LjEgNy41LTEzLjZWMTMyYzAtNi02LjMtOS44LTExLjYtNy4yQzE3OC41IDE5NS4yIDgyIDMzOS4zIDgwIDUwNi4zIDc3LjIgNzQ1LjEgMjcyLjUgOTQzLjUgNTExLjIgOTQ0YzIzOSAuNSA0MzIuOC0xOTMuMyA0MzIuOC00MzIuNCAwLTE2OS4yLTk3LTMxNS43LTIzOC40LTM4Ni43ek00ODAgNTYwaDY0YzQuNCAwIDgtMy42IDgtOFY4OGMwLTQuNC0zLjYtOC04LThoLTY0Yy00LjQgMC04IDMuNi04IDh2NDY0YzAgNC40IDMuNiA4IDggOHoiIC8+PC9zdmc+) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(PoweroffOutlined_PoweroffOutlined);
if (false) {}
/* harmony default export */ var icons_PoweroffOutlined = (RefIcon);
/***/ }),
/***/ 57200:
/*!*********************************************************!*\
!*** ./src/components/CustomTree/index.tsx + 1 modules ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ components_CustomTree; }
});
// 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/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(39647);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tree/index.js + 8 modules
var tree = __webpack_require__(46819);
// EXTERNAL MODULE: ./src/service/problemset.ts
var problemset = __webpack_require__(91935);
;// CONCATENATED MODULE: ./src/components/CustomTree/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var CustomTreemodules = ({"flex_box_center":"flex_box_center___SFmJH","flex_space_between":"flex_space_between___f2H1D","flex_box_vertical_center":"flex_box_vertical_center___hW_hp","flex_box_center_end":"flex_box_center_end___yklmJ","flex_box_column":"flex_box_column___m0oUw","customTree":"customTree___ZhEHU","name":"name___RIkn2"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/CustomTree/index.tsx
var _excluded = ["value", "onChange", "defaultValue", "disabled"];
var CustomTree = function CustomTree(_ref) {
var value = _ref.value,
onChange = _ref.onChange,
defaultValue = _ref.defaultValue,
disabled = _ref.disabled,
props = objectWithoutProperties_default()(_ref, _excluded);
var _useState = (0,_react_17_0_2_react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
treeData = _useState2[0],
setTreeData = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)('1'),
_useState4 = slicedToArray_default()(_useState3, 2),
keyIndex = _useState4[0],
setKeyIndex = _useState4[1];
// const sign = useRef(true)
(0,_react_17_0_2_react.useEffect)(function () {
getData();
}, []);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res, item;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,problemset/* getPaperList */.NZ)({});
case 2:
res = _context.sent;
// setFolderLoading(false)
if (res !== null && res !== void 0 && res.data) {
item = [{
title: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
title: '根目录',
className: CustomTreemodules.name,
children: "\u6839\u76EE\u5F55"
}),
value: 0,
key: 0,
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-wenjianjia2 c-light-primary mr10",
style: {
lineHeight: '19px'
}
}),
children: transformTreeKey(res.data || [])
}];
setTreeData(item);
setKeyIndex('2');
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var transformTreeKey = function transformTreeKey(items) {
function mapTree(org) {
var realChildren = org.children;
var haveChildren = Array.isArray(realChildren) && realChildren.length > 0;
var key = org === null || org === void 0 ? void 0 : org.group_id;
return {
//分别将我们查询出来的值做出改变他的key
title: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
title: org === null || org === void 0 ? void 0 : org.name,
className: CustomTreemodules.name,
children: org === null || org === void 0 ? void 0 : org.name
}),
value: key,
key: key,
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-wenjianjia2 c-light-primary mr10",
style: {
lineHeight: '19px'
}
}),
//判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? realChildren === null || realChildren === void 0 ? void 0 : realChildren.map(function (e) {
return mapTree(e);
}) : []
};
}
return items === null || items === void 0 ? void 0 : items.map(function (org) {
return mapTree(org);
});
};
var param = defaultValue ? {
defaultExpandedKeys: [0],
defaultSelectedKeys: [0]
} : {
selectedKeys: value,
defaultExpandedKeys: value
};
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: CustomTreemodules.customTree,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tree/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, param), {}, {
showIcon: true,
treeData: treeData,
onSelect: onChange,
disabled: disabled
}, props), keyIndex)
});
};
/* harmony default export */ var components_CustomTree = (CustomTree);
/***/ }),
/***/ 93083:
/*!*************************************************************!*\
!*** ./src/components/SplitContainer/index.tsx + 1 modules ***!
\*************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ SplitContainer; }
});
// 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/SplitContainer/index.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/components/SplitContainer/index.tsx
/* harmony default export */ var SplitContainer = (function (_ref) {
var _ref$defaultX = _ref.defaultX,
defaultX = _ref$defaultX === void 0 ? '40%' : _ref$defaultX,
leftChild = _ref.leftChild,
rightChild = _ref.rightChild,
className = _ref.className,
_ref$hideResize = _ref.hideResize,
hideResize = _ref$hideResize === void 0 ? false : _ref$hideResize;
var _useState = (0,_react_17_0_2_react.useState)(defaultX),
_useState2 = slicedToArray_default()(_useState, 2),
moveX = _useState2[0],
setMoveX = _useState2[1];
var resizeXFlag = (0,_react_17_0_2_react.useRef)();
function onResizeStart() {
resizeXFlag.current = true;
}
(0,_react_17_0_2_react.useEffect)(function () {
function onMove(e) {
if (resizeXFlag.current) {
setMoveX(e.pageX);
}
}
function onMouseUp() {
resizeXFlag.current = false;
}
window.addEventListener('mousemove', onMove);
window.addEventListener('mouseup', onMouseUp);
return function () {
window.removeEventListener('mousemove', onMove);
window.removeEventListener('mouseup', onMouseUp);
};
}, []);
var leftPanelWidth = typeof moveX === 'number' && moveX !== 0.01 ? "".concat(moveX, "px") : defaultX;
var rightPanelWidth = "calc(100% - ".concat(hideResize ? "0px" : "4px", " - ").concat(leftPanelWidth, ")");
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "split-panel-container ".concat(className),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
style: {
width: leftPanelWidth,
display: moveX === 0.01 ? 'none' : ''
},
children: leftChild
}), /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: "resize-x-bar",
onMouseDown: onResizeStart,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
className: "btn-resize",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
width: "16",
height: "13",
viewBox: "0 0 16 13",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
d: "M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"
})
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
style: {
width: rightPanelWidth
},
children: rightChild
})]
});
});
/***/ }),
/***/ 69005:
/*!*********************************************!*\
!*** ./src/pages/Problems/OjForm/index.tsx ***!
\*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Types: function() { return /* binding */ Types; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectDestructuringEmpty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectDestructuringEmpty.js */ 70236);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectDestructuringEmpty_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectDestructuringEmpty_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createForOfIteratorHelper.js */ 91232);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js */ 7557);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js */ 41498);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./index.less?modules */ 61550);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! antd */ 36920);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! antd */ 36381);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! antd */ 8591);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! antd */ 71418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! antd */ 57809);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! antd */ 19842);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! antd */ 400);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! antd */ 24905);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! antd */ 5112);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! antd */ 81327);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! antd */ 14478);
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util */ 75865);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! umi */ 42289);
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! js-base64 */ 24334);
/* harmony import */ var js_base64__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(js_base64__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @ant-design/icons */ 15962);
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! @ant-design/icons */ 2377);
/* harmony import */ var _components_markdown_editor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/components/markdown-editor */ 9424);
/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./service */ 37706);
/* harmony import */ var _service_exercise__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/service/exercise */ 15697);
/* harmony import */ var _components_SplitContainer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/SplitContainer */ 93083);
/* harmony import */ var _CodePanel__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./CodePanel */ 63941);
/* harmony import */ var _CodeProgramPanel__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./CodeProgramPanel */ 12269);
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/utils/fetch */ 5219);
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/utils/util */ 69824);
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/utils/env */ 22805);
/* harmony import */ var _components_Knowledge__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/components/Knowledge */ 45730);
/* harmony import */ var _components_CustomTree__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/components/CustomTree */ 57200);
/* harmony import */ var _pages_Shixuns_Edit_body_Level_Challenges_components_UploadFile__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/pages/Shixuns/Edit/body/Level/Challenges/components/UploadFile */ 41447);
/* harmony import */ var _service_paperlibrary__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/service/paperlibrary */ 63271);
/* harmony import */ var _utils_enum__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @/utils/enum */ 89452);
/* harmony import */ var _components_QuestionEditor_MdEditorInForm__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @/components/QuestionEditor/MdEditorInForm */ 17285);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
//@ts-ignore
var TextArea = antd__WEBPACK_IMPORTED_MODULE_28__/* ["default"] */ .Z.TextArea;
var confirm = antd__WEBPACK_IMPORTED_MODULE_29__/* ["default"] */ .Z.confirm;
var Panel = antd__WEBPACK_IMPORTED_MODULE_30__/* ["default"] */ .Z.Panel;
function getTimeStamp() {
return new Date().getTime();
}
var initialState = {
loading: true,
user: null,
disciplines: [],
dicts: null,
status: 0,
data: undefined,
lastedUpdateTime: 0
};
var Types = /*#__PURE__*/function (Types) {
Types[Types["SET_INITAL_DATA"] = 0] = "SET_INITAL_DATA";
Types[Types["SET_LOADING"] = 1] = "SET_LOADING";
Types[Types["SET_STATUS"] = 2] = "SET_STATUS";
return Types;
}({});
function reducer(state, action) {
switch (action.type) {
case Types.SET_INITAL_DATA:
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, state), action.payload);
case Types.SET_LOADING:
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, state), {}, {
loading: action.payload
});
case Types.SET_STATUS:
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, state), {}, {
status: action.payload
});
default:
throw new Error();
}
}
//problems/new?difficult=3&sub_discipline_id=95&tag_discipline_id=105&newoj=1&pages=1
///problems/p2mblri6/edit
//* 从课堂试卷编辑入口进来 http://localhost:8000/problems/i4b5wuhn/edit?type=exercises&express_id=2510&callback_url=/classrooms/1309/exercise/2510/edit
/* harmony default export */ __webpack_exports__["default"] = (function () {
var _data$hack, _data$hack4;
var _useSearchParams = (0,umi__WEBPACK_IMPORTED_MODULE_10__.useSearchParams)(),
_useSearchParams2 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
var location = (0,umi__WEBPACK_IMPORTED_MODULE_10__.useLocation)();
var _useParams = (0,umi__WEBPACK_IMPORTED_MODULE_10__.useParams)(),
id = _useParams.id;
var _Form$useForm = antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.useForm(),
_Form$useForm2 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(),
_useState2 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState, 2),
formValue = _useState2[0],
setFormValue = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)([]),
_useState4 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState3, 2),
knowledgeOptions = _useState4[0],
setKnowledgeOptions = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)([]),
_useState6 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState5, 2),
uploadData = _useState6[0],
setUploadData = _useState6[1];
var _useReducer = (0,react__WEBPACK_IMPORTED_MODULE_7__.useReducer)(reducer, initialState),
_useReducer2 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useReducer, 2),
state = _useReducer2[0],
dispatch = _useReducer2[1];
var loading = state.loading,
data = state.data,
user = state.user,
disciplines = state.disciplines,
dicts = state.dicts,
status = state.status;
var hack_sets = data === null || data === void 0 ? void 0 : data.hack_sets;
var test_set_average = data === null || data === void 0 || (_data$hack = data.hack) === null || _data$hack === void 0 ? void 0 : _data$hack.test_set_average;
var _getJsonFromUrl = (0,_utils_util__WEBPACK_IMPORTED_MODULE_19__/* .getJsonFromUrl */ .oP)(),
callback_url = _getJsonFromUrl.callback_url,
express_id = _getJsonFromUrl.express_id,
score = _getJsonFromUrl.score,
question_id = _getJsonFromUrl.question_id,
type = _getJsonFromUrl.type;
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)([]),
_useState8 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState7, 2),
MyGroup = _useState8[0],
setMyGroup = _useState8[1];
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false),
_useState10 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState9, 2),
ischecked = _useState10[0],
setischecked = _useState10[1];
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false),
_useState12 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState11, 2),
isshows = _useState12[0],
setisshows = _useState12[1];
var isProgram = type === '1';
var categorys = (0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(function () {
var rs = [];
if (disciplines) {
(0,_util__WEBPACK_IMPORTED_MODULE_9__/* .getDisciplineOptions */ .D0)(disciplines, rs);
}
return rs;
}, [disciplines]);
var initData = (0,react__WEBPACK_IMPORTED_MODULE_7__.useCallback)( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee() {
var timeStamp,
discips,
response,
rs,
res,
category,
_user,
code,
language,
_hack_sets,
description,
difficult,
name,
open_or_not,
sub_discipline_id,
tag_discipline_id,
analysis,
time_limit,
_test_set_average,
test_set_score,
_status,
tag_discipline_ids,
item_banks_group_id,
_res$is_file,
is_file,
hide_actual_output,
code_compile_score,
languages,
is_my,
codes,
_getDisciplineIds,
_getDisciplineIds2,
ids,
dictData,
new_hack_sets,
_getJsonFromUrl2,
lastedUpdateTime,
newCodes,
_tagIds$split,
_tagIds$split2,
_yield$getUser,
_user2,
_getJsonFromUrl3,
_difficult,
_sub_discipline_id,
_tag_discipline_id,
tagIds,
banksIds,
_getDisciplineIds3,
_getDisciplineIds4,
_ids,
_dictData,
bankstime,
_args = arguments;
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
timeStamp = _args.length > 0 && _args[0] !== undefined ? _args[0] : 0;
discips = disciplines;
if (!(discips.length === 0)) {
_context.next = 7;
break;
}
_context.next = 5;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .getDisciplines */ .d1)('new_question');
case 5:
response = _context.sent;
discips = response.disciplines;
case 7:
if (!id) {
_context.next = 15;
break;
}
rs = {
disciplines: discips
};
_context.next = 11;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .getProgrammingTopic */ .fu)(id);
case 11:
res = _context.sent;
if (res.message) {
if (res.status === '401') {
// history.push('/user/login')
document.location.href = '/user/login';
}
} else {
// console.log(res.hack_sets, 'response1')
category = res.category, _user = res.user, code = res.code, language = res.language, _hack_sets = res.hack_sets, description = res.description, difficult = res.difficult, name = res.name, open_or_not = res.open_or_not, sub_discipline_id = res.sub_discipline_id, tag_discipline_id = res.tag_discipline_id, analysis = res.analysis, time_limit = res.time_limit, _test_set_average = res.test_set_average, test_set_score = res.test_set_score, _status = res.status, tag_discipline_ids = res.tag_discipline_ids, item_banks_group_id = res.item_banks_group_id, _res$is_file = res.is_file, is_file = _res$is_file === void 0 ? false : _res$is_file, hide_actual_output = res.hide_actual_output, code_compile_score = res.code_compile_score, languages = res.languages, is_my = res.is_my, codes = res.codes; //
_getDisciplineIds = (0,_util__WEBPACK_IMPORTED_MODULE_9__/* .getDisciplineIds */ .y3)(discips, sub_discipline_id), _getDisciplineIds2 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_getDisciplineIds, 2), ids = _getDisciplineIds2[0], dictData = _getDisciplineIds2[1];
setischecked(hide_actual_output);
// console.log('----',hack_sets);
new_hack_sets = is_file ? [{
input: '',
output: '',
score: 100,
position: 1
}] : _hack_sets;
if (is_file) {
setUploadData(_hack_sets);
form.setFieldsValue({
'hack_sets': new_hack_sets
});
} else {
setUploadData([]);
}
//@ts-ignore
_getJsonFromUrl2 = (0,_utils_util__WEBPACK_IMPORTED_MODULE_19__/* .getJsonFromUrl */ .oP)(), lastedUpdateTime = _getJsonFromUrl2.lastedUpdateTime;
newCodes = codes === null || codes === void 0 ? void 0 : codes.map(function (e) {
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, e), {}, {
code: js_base64__WEBPACK_IMPORTED_MODULE_11__.Base64.decode(e === null || e === void 0 ? void 0 : e.code)
});
});
rs = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, rs), {}, {
loading: false,
user: _user,
dicts: dictData,
status: _status,
lastedUpdateTime: timeStamp ? timeStamp : lastedUpdateTime ? lastedUpdateTime : 0,
data: {
hack_codes: {
language: language,
code: js_base64__WEBPACK_IMPORTED_MODULE_11__.Base64.decode(code)
},
hack: {
category: category,
difficult: difficult,
name: name,
description: description,
open_or_not: open_or_not,
time_limit: time_limit,
test_set_average: _test_set_average,
test_set_score: test_set_score,
sub_discipline_id: ids,
tag_discipline_ids: tag_discipline_ids,
languages: languages,
score: score || 1,
item_banks_group_ids: item_banks_group_id,
is_file: is_file,
is_my: is_my,
code_compile_score: code_compile_score,
analysis: analysis
},
hack_sets: new_hack_sets,
tags: tag_discipline_ids,
codes: newCodes
}
});
if (parseInt(code_compile_score) > 0) {
setisshows(true);
}
dispatch({
type: Types.SET_INITAL_DATA,
payload: rs
});
setFormValue({
hack: {
category: category,
difficult: difficult,
name: name,
description: description,
open_or_not: open_or_not,
time_limit: time_limit,
test_set_average: _test_set_average,
test_set_score: test_set_score,
sub_discipline_id: ids,
tag_discipline_ids: tag_discipline_ids,
score: score || 1,
item_banks_group_ids: item_banks_group_id,
is_file: is_file,
analysis: analysis
},
codes: newCodes
});
handleSetKnowledge(ids === null || ids === void 0 ? void 0 : ids[0], ids === null || ids === void 0 ? void 0 : ids[1], discips);
}
_context.next = 25;
break;
case 15:
_context.next = 17;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .getUser */ .PR)();
case 17:
_yield$getUser = _context.sent;
_user2 = _yield$getUser.user;
//@ts-ignore
_getJsonFromUrl3 = (0,_utils_util__WEBPACK_IMPORTED_MODULE_19__/* .getJsonFromUrl */ .oP)(), _difficult = _getJsonFromUrl3.difficult, _sub_discipline_id = _getJsonFromUrl3.sub_discipline_id, _tag_discipline_id = _getJsonFromUrl3.tag_discipline_id, tagIds = _getJsonFromUrl3.tagIds, banksIds = _getJsonFromUrl3.banksIds;
_getDisciplineIds3 = (0,_util__WEBPACK_IMPORTED_MODULE_9__/* .getDisciplineIds */ .y3)(discips, parseInt(_sub_discipline_id, 10)), _getDisciplineIds4 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_getDisciplineIds3, 2), _ids = _getDisciplineIds4[0], _dictData = _getDisciplineIds4[1];
bankstime = [Number(banksIds)];
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
loading: false,
user: _user2,
disciplines: discips,
status: 0,
dicts: _dictData,
data: {
hack_codes: {
language: 'C',
code: ''
},
hack: {
category: null,
difficult: parseInt(_difficult, 10),
time_limit: 3,
description: '',
test_set_score: true,
test_set_average: true,
open_or_not: true,
sub_discipline_id: _ids,
tag_discipline_id: tagIds && (tagIds === null || tagIds === void 0 || (_tagIds$split = tagIds.split(',')) === null || _tagIds$split === void 0 ? void 0 : _tagIds$split.map(function (x) {
return Number(x);
})),
name: '',
item_banks_group_ids: bankstime,
is_file: false
},
tags: _tag_discipline_id ? _tag_discipline_id === null || _tag_discipline_id === void 0 ? void 0 : _tag_discipline_id.split(',').map(function (t) {
return parseInt(t, 10);
}) : [],
hack_sets: [{
input: '',
output: '',
score: 100,
position: 1
}]
}
}
});
setFormValue({
hack: {
category: null,
difficult: parseInt(_difficult, 10),
time_limit: 3,
description: '',
test_set_average: true,
open_or_not: true,
sub_discipline_id: _ids,
tag_discipline_id: tagIds && (tagIds === null || tagIds === void 0 || (_tagIds$split2 = tagIds.split(',')) === null || _tagIds$split2 === void 0 ? void 0 : _tagIds$split2.map(function (x) {
return Number(x);
})),
name: '',
item_banks_group_id: bankstime,
is_file: false
}
});
handleSetKnowledge(_ids === null || _ids === void 0 ? void 0 : _ids[0], _ids === null || _ids === void 0 ? void 0 : _ids[1], discips);
case 25:
case "end":
return _context.stop();
}
}, _callee);
})), [id, disciplines]);
(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(function () {
try {
initData();
} catch (error) {
console.log(error, '----');
// history.replace('/user/login', { from: location.pathname })
}
}, []);
(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(function () {
//获取我的分组信息
function init() {
return _init.apply(this, arguments);
}
function _init() {
_init = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee2() {
var data;
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_18__/* .get */ .U2)('item_banks_groups/mine.json');
case 2:
data = _context2.sent;
setMyGroup(data);
case 4:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return _init.apply(this, arguments);
}
init();
}, []);
var handleSetKnowledge = function handleSetKnowledge(id, subId, discips) {
var _discips$find;
var options = discips === null || discips === void 0 || (_discips$find = discips.find(function (item) {
return item.id === id;
})) === null || _discips$find === void 0 || (_discips$find = _discips$find.sub_disciplines) === null || _discips$find === void 0 || (_discips$find = _discips$find.find(function (subItem) {
return subItem.id === subId;
})) === null || _discips$find === void 0 ? void 0 : _discips$find.tag_disciplines;
// setKnowledgeOptions(options || []);
};
function onSubmit(_x, _x2, _x3) {
return _onSubmit.apply(this, arguments);
}
function _onSubmit() {
_onSubmit = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee5(values, type, is_cover) {
var _values, hack_sets, hack_codes, hack, tags, codes, update_hack_sets, new_hack_sets, sumScore, new_list, _iterator, _step, item, newCodes, res, _yield$updateExercise, _status2, _yield$addProgramming, identifier, exam_identifier, _res, _yield$addExerciseQue, _status3;
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
_values = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, values), hack_sets = _values.hack_sets, hack_codes = _values.hack_codes, hack = _values.hack, tags = _values.tags, codes = _values.codes;
hack.hide_actual_output = ischecked;
update_hack_sets = [];
new_hack_sets = [];
sumScore = 0;
new_list = hack !== null && hack !== void 0 && hack.is_file ? uploadData.map(function (e, i) {
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, e), {}, {
position: i + 1
});
}) : hack_sets.map(function (e) {
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, e), {}, {
is_file: false
});
});
_iterator = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1___default()(new_list);
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
item = _step.value;
sumScore += item.score;
if (item.id && item.id >= 0) {
update_hack_sets.push(item);
} else {
new_hack_sets.push(item);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
if (new_list !== null && new_list !== void 0 && new_list.length) {
_context5.next = 11;
break;
}
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.error('测试集不能为空');
return _context5.abrupt("return");
case 11:
sumScore += parseInt(hack.code_compile_score || 0);
if (!(sumScore !== 100 && !hack.test_set_score)) {
_context5.next = 15;
break;
}
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.error('测试集的评分占比之和必须等于100');
return _context5.abrupt("return");
case 15:
if (!(new_list !== null && new_list !== void 0 && new_list.some(function (e) {
return !e.output;
}))) {
_context5.next = 18;
break;
}
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.error('测试集输出不能为空');
return _context5.abrupt("return");
case 18:
newCodes = {};
if (isProgram) {
codes === null || codes === void 0 || codes.forEach(function (e) {
newCodes[e.language] = e !== null && e !== void 0 && e.code ? js_base64__WEBPACK_IMPORTED_MODULE_11__.Base64.encode(e === null || e === void 0 ? void 0 : e.code) : '';
});
} else {
hack_codes.code = js_base64__WEBPACK_IMPORTED_MODULE_11__.Base64.encode(hack_codes === null || hack_codes === void 0 ? void 0 : hack_codes.code);
}
hack.sub_discipline_id = hack.sub_discipline_id[1];
dispatch({
type: Types.SET_LOADING,
payload: true
});
if (!callback_url) {
hack.score = hack.difficult * 100;
}
//编辑
if (!id) {
_context5.next = 50;
break;
}
_context5.next = 26;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .updateProgrammingTopic */ .l_)(id, {
hack: hack,
hack_codes: hack_codes,
hack_sets: new_hack_sets,
update_hack_sets: update_hack_sets,
tags: tags,
is_cover: is_cover,
languages: hack.languages,
codes: newCodes
});
case 26:
if (!callback_url) {
_context5.next = 45;
break;
}
_context5.next = 29;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .publishProgrammingTopic */ .j2)(id);
case 29:
if (!callback_url.includes('paperlibrary')) {
_context5.next = 35;
break;
}
_context5.next = 32;
return (0,_service_paperlibrary__WEBPACK_IMPORTED_MODULE_24__/* .createOrModifyQuestion */ .oF)({
id: express_id,
question_id: question_id,
item_type: _utils_enum__WEBPACK_IMPORTED_MODULE_25__/* .QuestionType */ .c.Program,
name: hack.name,
question_score: hack.score,
difficulty: hack.difficult,
sub_discipline_id: hack.sub_discipline_id,
tag_discipline_ids: hack.tag_discipline_ids,
item_banks_group_ids: hack.item_banks_group_ids,
analysis: hack.analysis
// identifier: id
});
case 32:
res = _context5.sent;
if (res.status === 0) {
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace(callback_url);
}
return _context5.abrupt("return");
case 35:
_context5.next = 37;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .updateExerciseQuestion */ .GM)(question_id, {
question_type: 6,
question_score: hack.score,
question_title: hack.name,
description: hack.description,
sub_discipline_id: hack.sub_discipline_id,
tag_discipline_ids: hack.tag_discipline_ids,
item_banks_group_ids: hack.item_banks_group_ids,
identifier: id,
analysis: hack.analysis
});
case 37:
_yield$updateExercise = _context5.sent;
_status2 = _yield$updateExercise.status;
if (!(_status2 === 0)) {
_context5.next = 43;
break;
}
if (!(type === 'start')) {
_context5.next = 42;
break;
}
return _context5.abrupt("return");
case 42:
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace(callback_url);
case 43:
_context5.next = 47;
break;
case 45:
// window.location.reload()
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.success('保存成功');
initData(getTimeStamp());
case 47:
dispatch({
type: Types.SET_LOADING,
payload: false
});
_context5.next = 80;
break;
case 50:
_context5.next = 52;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .addProgrammingTopic */ .zQ)({
hack: hack,
hack_codes: hack_codes,
hack_sets: new_list,
tags: tags,
examination_bank_id: express_id || null
});
case 52:
_yield$addProgramming = _context5.sent;
identifier = _yield$addProgramming.identifier;
exam_identifier = _yield$addProgramming.exam_identifier;
dispatch({
type: Types.SET_LOADING,
payload: false
});
if (!(type === 'start')) {
_context5.next = 58;
break;
}
return _context5.abrupt("return");
case 58:
if (!identifier) {
_context5.next = 80;
break;
}
if (callback_url) {
_context5.next = 63;
break;
}
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace("/problems/".concat(identifier, "/edit?lastedUpdateTime=").concat(getTimeStamp()));
_context5.next = 80;
break;
case 63:
_context5.next = 65;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .publishProgrammingTopic */ .j2)(identifier);
case 65:
if (id) {
_context5.next = 79;
break;
}
if (!callback_url.includes('paperlibrary')) {
_context5.next = 72;
break;
}
_context5.next = 69;
return (0,_service_paperlibrary__WEBPACK_IMPORTED_MODULE_24__/* .createOrModifyQuestion */ .oF)({
id: express_id,
item_type: _utils_enum__WEBPACK_IMPORTED_MODULE_25__/* .QuestionType */ .c.Program,
name: hack.name,
question_score: hack.score,
difficulty: hack.difficult,
sub_discipline_id: hack.sub_discipline_id,
tag_discipline_ids: hack.tag_discipline_ids,
identifier: exam_identifier,
analysis: hack.analysis
});
case 69:
_res = _context5.sent;
if (_res.status === 0) {
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace(callback_url);
}
return _context5.abrupt("return");
case 72:
_context5.next = 74;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .addExerciseQuestion */ .MK)(parseInt(express_id, 10), {
question_type: 6,
question_score: hack.score,
question_title: hack.name,
identifier: identifier,
tag_discipline_ids: hack.tag_discipline_ids,
analysis: hack.analysis
});
case 74:
_yield$addExerciseQue = _context5.sent;
_status3 = _yield$addExerciseQue.status;
if (_status3 === 0) {
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace(callback_url);
}
_context5.next = 80;
break;
case 79:
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace(callback_url);
case 80:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return _onSubmit.apply(this, arguments);
}
function onPublish() {
form.submit();
setTimeout( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee3() {
var response;
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .publishProgrammingTopic */ .j2)(id);
case 2:
response = _context3.sent;
if (response.status === 0) {
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.success('发布成功');
dispatch({
type: Types.SET_STATUS,
payload: 1
});
} else {
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.info(response.message);
}
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
})), 400);
}
function onCancelPublish() {
return _onCancelPublish.apply(this, arguments);
}
function _onCancelPublish() {
_onCancelPublish = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee6() {
var response;
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .cancelPublishProgrammingTopic */ .ZS)(id);
case 2:
response = _context6.sent;
if (response.status === 0) {
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.success('撤销发布成功');
dispatch({
type: Types.SET_STATUS,
payload: 0
});
} else {
antd__WEBPACK_IMPORTED_MODULE_32__/* ["default"] */ .ZP.info(response.message);
}
case 4:
case "end":
return _context6.stop();
}
}, _callee6);
}));
return _onCancelPublish.apply(this, arguments);
}
function onTriggerPublish() {
//立即发布
if (status === 0) {
confirm({
title: '提示',
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(react__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("div", {
children: "\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"
}), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("div", {
children: " \u662F\u5426\u786E\u8BA4\u53D1\u5E03?"
}), " "]
}),
okText: '确定',
cancelText: '取消',
onOk: function onOk() {
onPublish();
}
});
} else {
confirm({
title: '提示',
content: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("p", {
children: "\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"
}),
okText: '确定',
cancelText: '取消',
onOk: function onOk() {
onCancelPublish();
}
});
}
}
function onChallenge() {
return _onChallenge.apply(this, arguments);
}
function _onChallenge() {
_onChallenge = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee8() {
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
_context8.t0 = onSubmit;
_context8.next = 3;
return form.getFieldValue();
case 3:
_context8.t1 = _context8.sent;
(0, _context8.t0)(_context8.t1, 'start');
setTimeout( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee7() {
var _yield$startChallenge, identifier;
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
_context7.next = 2;
return (0,_service__WEBPACK_IMPORTED_MODULE_13__/* .startChallenge */ .uE)(id);
case 2:
_yield$startChallenge = _context7.sent;
identifier = _yield$startChallenge.identifier;
if (isProgram) {
window.location.href = "/myproblems/".concat(identifier, "?type=1");
} else {
window.location.href = "/myproblems/".concat(identifier);
}
case 5:
case "end":
return _context7.stop();
}
}, _callee7);
})), 400);
case 6:
case "end":
return _context8.stop();
}
}, _callee8);
}));
return _onChallenge.apply(this, arguments);
}
function onBack() {
if (callback_url) {
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace(callback_url);
} else {
if (isProgram) {
var _localStorage$getItem;
var item = (_localStorage$getItem = localStorage.getItem('program_homework')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.split(',');
umi__WEBPACK_IMPORTED_MODULE_10__.history.push("/classrooms/".concat(item === null || item === void 0 ? void 0 : item[0], "/program_homework/").concat(item === null || item === void 0 ? void 0 : item[1], "/detail"));
} else {
umi__WEBPACK_IMPORTED_MODULE_10__.history.replace("/problemset");
}
}
}
var handleUploadRatio = function handleUploadRatio(testSetData) {
var code_compile_score = parseInt(form.getFieldValue('hack').code_compile_score) || 0;
var score = Math.floor((100 - code_compile_score) / testSetData.length);
var lastScore = score + (100 - code_compile_score) % testSetData.length;
// const score = Math.floor(100 / testSetData.length)
// const lastScore = score + 100 % testSetData.length
testSetData = testSetData.map(function (item, index) {
if (index === testSetData.length - 1) {
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, item), {}, {
score: lastScore
});
}
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, item), {}, {
score: score
});
});
setUploadData(testSetData);
};
function onChangeScore(e) {
if (!e.target.value) {
handleUploadRatio(uploadData);
}
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data.hack), {}, {
test_set_score: e.target.value
})
})
}
});
}
function onChangeFile(e) {
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data.hack), {}, {
is_file: e.target.value
})
})
}
});
}
function onChangehide(e) {
setischecked(e.target.checked);
}
function onChangeAverage(e) {
var value = e.target.value;
if (value) {
handleUploadRatio(uploadData);
}
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data.hack), {}, {
test_set_average: value
})
})
}
});
}
function onAddTestCase() {
var rs = form.getFieldValue('hack_sets');
var by = parseInt(form.getFieldValue('hack').code_compile_score) || 0;
var len = rs.length + 1;
var averageMark = Math.floor((100 - by) / len);
var remainder = (100 - by) % len;
rs.map(function (item, index) {
if (test_set_average) {
item.score = averageMark;
}
item.position = index + 1;
return item;
});
rs.push({
input: '',
output: '',
position: len,
score: test_set_average ? averageMark + remainder : 0
});
form.setFieldsValue({
'hack_sets': rs
});
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack_sets: rs
})
}
});
}
function onAddTestCases() {
var rs = form.getFieldValue('hack_sets');
var by = parseInt(form.getFieldValue('hack').code_compile_score) || 0;
var len = rs.length;
var averageMark = Math.floor((100 - by) / len);
var remainder = (100 - by) % len;
rs.map(function (item, index) {
if (test_set_average) {
item.score = averageMark;
if (index === rs.length - 1) {
item.score = averageMark + remainder;
}
}
item.position = index + 1;
return item;
});
form.setFieldsValue({
'hack_sets': rs
});
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack_sets: rs
})
}
});
}
(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(function () {
if (test_set_average) {
var by = parseInt(form.getFieldValue('hack').code_compile_score) || 0;
var len = hack_sets === null || hack_sets === void 0 ? void 0 : hack_sets.length;
var averageMark = Math.floor((100 - by) / len);
var remainder = (100 - by) % len;
hack_sets === null || hack_sets === void 0 || hack_sets.map(function (item, index) {
item.score = averageMark;
item.position = index + 1;
if (index === len - 1) {
item.score = averageMark + remainder;
}
return item;
});
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack_sets: hack_sets
})
}
});
form.setFieldsValue({
'hack_sets': hack_sets
});
}
}, [test_set_average]);
function onRemoveTestCase(index) {
var sets = form.getFieldValue('hack_sets');
var by = parseInt(form.getFieldValue('hack').code_compile_score) || 0;
var len = (sets === null || sets === void 0 ? void 0 : sets.length) - 1;
var averageMark = Math.floor((100 - by) / len);
var remainder = (100 - by) % len;
sets.splice(index, 1);
sets === null || sets === void 0 || sets.map(function (item, index) {
if (test_set_average) {
item.score = averageMark;
if (index === len - 1) {
item.score = averageMark + remainder;
}
}
item.position = index + 1;
return item;
});
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack_sets: sets
})
}
});
form.setFieldsValue({
'hack_sets': sets
});
}
function onChangeLanguage(language) {
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack_codes: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data.hack_codes), {}, {
language: language
})
})
}
});
}
var handleValuesChange = function handleValuesChange(changedValues) {
var _changedValues$hack;
if (changedValues !== null && changedValues !== void 0 && (_changedValues$hack = changedValues.hack) !== null && _changedValues$hack !== void 0 && _changedValues$hack.sub_discipline_id) {
var _changedValues$hack2, _disciplines$find, _form$getFieldsValue;
var _changedValues$hack$s = changedValues === null || changedValues === void 0 || (_changedValues$hack2 = changedValues.hack) === null || _changedValues$hack2 === void 0 ? void 0 : _changedValues$hack2.sub_discipline_id,
_changedValues$hack$s2 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_changedValues$hack$s, 2),
_id = _changedValues$hack$s2[0],
subId = _changedValues$hack$s2[1];
var options = disciplines === null || disciplines === void 0 || (_disciplines$find = disciplines.find(function (item) {
return item.id === _id;
})) === null || _disciplines$find === void 0 || (_disciplines$find = _disciplines$find.sub_disciplines) === null || _disciplines$find === void 0 || (_disciplines$find = _disciplines$find.find(function (subItem) {
return subItem.id === subId;
})) === null || _disciplines$find === void 0 ? void 0 : _disciplines$find.tag_disciplines;
// setKnowledgeOptions(options);
var fieldData = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, form.getFieldsValue()), {}, {
hack: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, (_form$getFieldsValue = form.getFieldsValue()) === null || _form$getFieldsValue === void 0 ? void 0 : _form$getFieldsValue.hack), {}, {
tag_discipline_ids: []
})
});
form.setFieldsValue(fieldData);
setFormValue(fieldData);
} else {
setFormValue(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, form.getFieldsValue()));
}
};
var handleAddKnowledgeFinish = function handleAddKnowledgeFinish(item) {
setKnowledgeOptions([].concat(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_2___default()(knowledgeOptions), [_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, item)]));
};
(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(function () {
var _data$hack2;
if (data !== null && data !== void 0 && (_data$hack2 = data.hack) !== null && _data$hack2 !== void 0 && (_data$hack2 = _data$hack2.sub_discipline_id) !== null && _data$hack2 !== void 0 && _data$hack2[1]) {
var _data$hack3;
getTagData(data === null || data === void 0 || (_data$hack3 = data.hack) === null || _data$hack3 === void 0 || (_data$hack3 = _data$hack3.sub_discipline_id) === null || _data$hack3 === void 0 ? void 0 : _data$hack3[1]);
}
}, [data === null || data === void 0 || (_data$hack4 = data.hack) === null || _data$hack4 === void 0 ? void 0 : _data$hack4.sub_discipline_id]);
//进来的时候 取一次值
var getTagData = /*#__PURE__*/function () {
var _ref3 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().mark(function _callee4(id) {
var res;
return _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_3___default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
_context4.next = 2;
return (0,_service_exercise__WEBPACK_IMPORTED_MODULE_14__/* .getTagDiscipline */ .YY)({
sub_discipline_id: id
});
case 2:
res = _context4.sent;
setKnowledgeOptions(res.tag_disciplines);
case 4:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function getTagData(_x4) {
return _ref3.apply(this, arguments);
};
}();
//调用接口 获取knowledgeOptions
function onChangeSubDiscipline(values) {
// getTagData(values?.[1])
var subId = values[1];
var _getDisciplineIds5 = (0,_util__WEBPACK_IMPORTED_MODULE_9__/* .getDisciplineIds */ .y3)(disciplines, subId),
_getDisciplineIds6 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_getDisciplineIds5, 2),
dictData = _getDisciplineIds6[1];
form.setFieldsValue({
tags: []
});
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
dicts: dictData,
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data.hack), {}, {
sub_discipline_id: values
}),
tags: []
})
}
});
}
var addUploadFnc = function addUploadFnc(files) {
var _form$getFieldValue;
var isFuc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (isFuc) {
return function () {
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data.hack), {}, {
is_file: true
})
})
}
});
form.setFieldsValue({
hack: {
is_file: true
}
});
};
}
var newFiles = files === null || files === void 0 ? void 0 : files.map(function (e) {
return {
input: e.input,
output: e.output,
score: 0,
position: 1
};
});
var sets = (_form$getFieldValue = form.getFieldValue('hack_sets')) === null || _form$getFieldValue === void 0 || (_form$getFieldValue = _form$getFieldValue.filter(function (e) {
return e.input || e.output;
})) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.concat(newFiles);
var by = parseInt(form.getFieldValue('hack').code_compile_score) || 0;
var len = sets === null || sets === void 0 ? void 0 : sets.length;
var averageMark = Math.floor((100 - by) / len);
var remainder = (100 - by) % len;
sets === null || sets === void 0 || sets.map(function (item, index) {
if (test_set_average) {
item.score = averageMark;
if (index === len - 1) {
item.score = averageMark + remainder;
}
}
item.position = index + 1;
return item;
});
dispatch({
type: Types.SET_INITAL_DATA,
payload: {
data: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data), {}, {
hack_sets: sets,
hack: _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, data.hack), {}, {
is_file: false
})
})
}
});
form.setFieldsValue({
'hack_sets': sets,
hack: {
is_file: false
}
});
};
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_33__/* ["default"] */ .Z, {
spinning: loading,
delay: 500,
children: !data ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(react__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("header", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.header,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("img", {
src: "".concat(_utils_env__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .Z.IMG_SERVER, "/images/").concat(user === null || user === void 0 ? void 0 : user.image_url),
alt: "user",
width: 30
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
children: user === null || user === void 0 ? void 0 : user.name
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("h2", {
children: [" ", data === null || data === void 0 ? void 0 : data.hack.name, " "]
}), id ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("a", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.btn_back,
onClick: onBack,
children: [" ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_34__/* ["default"] */ .Z, {}), "\u9000\u51FA"]
}) : null]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z, {
form: form,
initialValues: data,
layout: "vertical",
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z["oj-form-container"],
onValuesChange: handleValuesChange,
onFinish: function onFinish(v, s) {
if (searchParams.get("exercise") && !callback_url.includes('paperlibrary')) {
antd__WEBPACK_IMPORTED_MODULE_29__/* ["default"] */ .Z.confirm({
title: '保存提示',
content: '此题目已存在试题库中,是否将修改后的试题覆盖试题库的原题?',
okText: '覆盖原题',
cancelText: '不覆盖',
onOk: function onOk() {
return onSubmit(v, s, 1);
},
onCancel: function onCancel() {
return onSubmit(v, s, 0);
}
});
return;
}
// if (data?.hack?.is_my) {
// Modal.confirm({
// title: '保存提示',
// content: '此题目已存在试题库中,是否将修改后的试题覆盖试题库的原题?',
// okText: '确认',
// cancelText: '取消',
// onOk: () => onSubmit(v, s,1),
// onCancel:()=>onSubmit(v, s,0),
// })
// return
// }
onSubmit(v, s);
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_components_SplitContainer__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z, {
leftChild: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(LeftPanel, {
onAddTestCases: onAddTestCases,
form: form,
handleAddKnowledgeFinish: handleAddKnowledgeFinish,
MyGroup: MyGroup,
formValue: formValue,
knowledgeOptions: knowledgeOptions,
onChangeLanguage: onChangeLanguage,
onChangeSubDiscipline: onChangeSubDiscipline,
onRemoveTestCase: onRemoveTestCase,
onAddTestCase: onAddTestCase,
dicts: dicts,
categorys: categorys,
callback_url: callback_url,
hack: data.hack,
onChangeScore: onChangeScore,
onChangehide: onChangehide,
onChangeAverage: onChangeAverage,
onChangeFile: onChangeFile,
uploadData: uploadData,
setUploadData: setUploadData,
handleUploadRatio: handleUploadRatio,
ischecked: ischecked,
isshows: isshows,
isProgram: isProgram,
addUploadFnc: addUploadFnc
}),
rightChild: isProgram ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
name: "codes",
style: {
marginBottom: 0
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_CodeProgramPanel__WEBPACK_IMPORTED_MODULE_17__/* ["default"] */ .Z, {})
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
name: ['hack_codes', 'code'],
style: {
marginBottom: 0
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_CodePanel__WEBPACK_IMPORTED_MODULE_16__/* ["default"] */ .Z, {
language: data.hack_codes.language
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z["footer"],
children: !id ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(react__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
onClick: onBack,
children: "\u53D6\u6D88"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
loading: loading,
type: "primary",
htmlType: "submit",
children: "\u4FDD\u5B58"
})]
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(react__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
children: [isProgram && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
onClick: onBack,
type: "primary",
ghost: true,
children: "\u9000\u51FA\u7F16\u8F91"
}), callback_url ? null : isProgram ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
type: status ? 'default' : 'primary',
onClick: onTriggerPublish,
children: status ? '撤销发布' : '立即发布'
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
loading: loading,
type: "primary",
htmlType: "submit",
children: "\u4FDD\u5B58"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
type: "primary",
onClick: onChallenge,
children: status ? '开始挑战' : '模拟挑战'
})]
})
})]
})]
})
});
});
function LeftPanel(_ref5) {
var _location, _formValue$hack;
var form = _ref5.form,
onAddTestCases = _ref5.onAddTestCases,
handleAddKnowledgeFinish = _ref5.handleAddKnowledgeFinish,
ischecked = _ref5.ischecked,
MyGroup = _ref5.MyGroup,
formValue = _ref5.formValue,
knowledgeOptions = _ref5.knowledgeOptions,
categorys = _ref5.categorys,
hack = _ref5.hack,
callback_url = _ref5.callback_url,
onChangeAverage = _ref5.onChangeAverage,
onChangeScore = _ref5.onChangeScore,
onChangehide = _ref5.onChangehide,
onChangeFile = _ref5.onChangeFile,
onAddTestCase = _ref5.onAddTestCase,
onRemoveTestCase = _ref5.onRemoveTestCase,
onChangeSubDiscipline = _ref5.onChangeSubDiscipline,
onChangeLanguage = _ref5.onChangeLanguage,
uploadData = _ref5.uploadData,
setUploadData = _ref5.setUploadData,
handleUploadRatio = _ref5.handleUploadRatio,
isshows = _ref5.isshows,
isProgram = _ref5.isProgram,
addUploadFnc = _ref5.addUploadFnc;
var is_random = ((_location = location) === null || _location === void 0 || (_location = _location.search) === null || _location === void 0 ? void 0 : _location.includes('select')) || false;
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(isshows),
_useState14 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState13, 2),
isshow = _useState14[0],
setisshow = _useState14[1];
var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false),
_useState16 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState15, 2),
editAnalysis = _useState16[0],
setEditAnalysis = _useState16[1];
var test_set_average = hack.test_set_average,
test_set_score = hack.test_set_score;
var _useState17 = (0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false),
_useState18 = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5___default()(_useState17, 2),
showUploadFile = _useState18[0],
setShowUploadFile = _useState18[1];
var handleRemove = function handleRemove(item, key) {
var newList = _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_2___default()(uploadData);
newList.splice(key, 1);
if (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 _root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()(_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6___default()({}, test), {}, {
score: e.target.value ? Number(e.target.value) : 0
});
}
return test;
});
setUploadData(testData);
};
var addUploadData = function addUploadData(files) {
if (!(files !== null && files !== void 0 && files.length)) return;
//文件
if (files !== null && files !== void 0 && files[0].is_file) {
addUploadFnc(files, true)();
var newList = uploadData.concat(files);
if (hack.test_set_average) {
handleUploadRatio(newList);
} else {
setUploadData(newList);
}
}
//文本
if (!(files !== null && files !== void 0 && files[0].is_file)) {
addUploadFnc(files);
}
};
function onStopPropagation(e) {
e.stopPropagation();
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z["oj-left-panel"],
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z["oj-form-info"],
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.field,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u96BE\u6613\u5EA6",
name: ['hack', 'difficult'],
rules: [{
required: true,
message: '请选择难易度'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_36__["default"], {
disabled: is_random,
children: (0,_util__WEBPACK_IMPORTED_MODULE_9__/* .getSelectOptions */ .jw)(_util__WEBPACK_IMPORTED_MODULE_9__/* .Keys */ .R8.difficult)
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u8BFE\u7A0B(\u5408\u7406\u7684\u8BFE\u7A0B\u5206\u7C7B\u6709\u5229\u4E8E\u5FEB\u901F\u68C0\u7D22)",
name: ['hack', 'sub_discipline_id'],
rules: [{
required: true,
message: '请选择课程'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_37__/* ["default"] */ .Z, {
disabled: is_random,
allowClear: false,
options: categorys,
placeholder: "\u8BF7\u9009\u62E9",
onChange: onChangeSubDiscipline
})
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.field,
children: [callback_url && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u5206\u6570",
name: ['hack', 'score'],
rules: [{
required: true,
message: '请输入分数'
}],
extra: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
style: {
position: "absolute",
left: 100,
top: 5
},
children: "\u5206"
}),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_38__/* ["default"] */ .Z, {
disabled: is_random,
min: 1,
max: 100
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("div", {
children: "\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236 "
}),
name: ['hack', 'time_limit'],
rules: [{
required: true,
message: '请输入单个测试集评测时长限制'
}, {
type: 'number',
min: 3,
message: '最小限制时间是3秒'
}],
extra: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
style: {
position: "absolute",
left: 100,
top: 5
},
children: "\u79D2"
}),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_38__/* ["default"] */ .Z, {
min: 3
})
}), isProgram ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u7F16\u7A0B\u8BED\u8A00",
style: {
paddingBottom: 16
},
name: ['hack', 'languages'],
rules: [{
required: true,
message: '请选择编程语言'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z.Group, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z, {
value: 'C',
children: "C"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z, {
value: 'C++',
children: "C++"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z, {
value: 'Java',
children: "Java"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z, {
value: 'Python',
children: "Python"
})]
})
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u7F16\u7A0B\u8BED\u8A00",
name: ['hack_codes', 'language'],
style: {
paddingBottom: 16
},
rules: [{
required: true,
message: '请选择编程语言'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_36__["default"], {
onChange: onChangeLanguage,
children: (0,_util__WEBPACK_IMPORTED_MODULE_9__/* .getSelectOptions */ .jw)(_util__WEBPACK_IMPORTED_MODULE_9__/* .Keys */ .R8.language)
})
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("span", {
children: ["\u77E5\u8BC6\u70B9\uFF1A", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
className: "c-grey-999",
children: "\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09"
})]
}),
name: ['hack', 'tag_discipline_ids']
// rules={[{ message: '请选择知识点' }]}
,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_components_Knowledge__WEBPACK_IMPORTED_MODULE_21__/* .Knowledge */ .N, {
selectvalues: (hack === null || hack === void 0 ? void 0 : hack.tag_discipline_id) || (hack === null || hack === void 0 ? void 0 : hack.tag_discipline_ids)
// value={[]}
,
disabled: is_random,
subId: formValue === null || formValue === void 0 || (_formValue$hack = formValue.hack) === null || _formValue$hack === void 0 || (_formValue$hack = _formValue$hack.sub_discipline_id) === null || _formValue$hack === void 0 ? void 0 : _formValue$hack[1],
knowledgeOptions: knowledgeOptions,
onAddKnowledgeFinish: handleAddKnowledgeFinish
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: '加入文件夹目录',
name: ['hack', 'item_banks_group_ids'],
labelCol: {
span: 24
},
wrapperCol: {
span: 24
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_components_CustomTree__WEBPACK_IMPORTED_MODULE_22__/* ["default"] */ .Z, {
disabled: is_random
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u4EFB\u52A1\u540D\u79F0",
name: ['hack', 'name'],
rules: [{
required: true,
message: '请输入任务名称'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_28__/* ["default"] */ .Z, {
maxLength: 60,
placeholder: "\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",
suffix: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
children: 60 - hack.name.length
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
name: ['hack', "description"],
valuePropName: "defaultValue",
rules: [{
required: true,
message: '请输入描述内容'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_components_markdown_editor__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, {
miniToolbar: true,
id: "moop_cases_content",
noStorage: true,
height: 200
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("div", {
onClick: function onClick() {
return setEditAnalysis(true);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u9898\u76EE\u89E3\u6790",
name: ["hack", 'analysis'],
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.baseLineHeight),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_components_QuestionEditor_MdEditorInForm__WEBPACK_IMPORTED_MODULE_26__/* .RegularInput */ .x, {
placeholder: "\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",
isEdit: editAnalysis
})
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
className: "tst-case-info",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("h3", {
className: "flex-container",
style: {
justifyContent: 'space-between'
},
children: [" \u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219", !hack.is_file && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
type: "primary",
ghost: true,
onClick: onAddTestCase,
children: "\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
name: ['hack', 'test_set_score'],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"].Group */ .ZP.Group, {
onChange: onChangeScore,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .ZP, {
value: true,
children: ["\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
className: "tip",
children: " \uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u4EC5\u5F53\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u83B7\u5F97\u4E00\u6B21\u6027\u5956\u52B1\uFF09"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .ZP, {
value: false,
children: ["\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
className: "tip",
children: " \uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u901A\u8FC7\u6D4B\u8BD5\u96C6\u5373\u53EF\u83B7\u5F97\u5BF9\u5E94\u5956\u52B1\uFF09"
})]
})]
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z, {
style: {
marginBottom: '5px'
},
checked: ischecked,
onChange: onChangehide,
children: "\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u770B\u5230\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\uFF0C\u4EC5\u5C55\u793A\u662F\u5426\u8BC4\u6D4B\u662F\u5426\u901A\u8FC7\uFF09"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.testJi,
name: ['hack', 'is_file'],
label: "\u7528\u4F8B\u7C7B\u578B:",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"].Group */ .ZP.Group, {
onChange: onChangeFile,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_41__/* ["default"] */ .Z, {
direction: "horizontal",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .ZP, {
value: false,
children: "\u6587\u672C"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .ZP, {
value: true,
children: "\u6587\u4EF6"
})]
})
})
}), !hack.test_set_score && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
name: ['hack', 'test_set_average'],
label: "\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"].Group */ .ZP.Group, {
onChange: onChangeAverage,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .ZP, {
value: true,
children: "\u5747\u5206\u6BD4\u4F8B"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_40__/* ["default"] */ .ZP, {
value: false,
children: "\u81EA\u5B9A\u4E49\u6BD4\u4F8B"
})]
})
}), !hack.test_set_score && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
style: {
marginBottom: '20px',
marginTop: '-10px'
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
style: {
display: 'flex',
height: '30px',
marginBottom: '10px'
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .Z, {
checked: isshow,
style: {
display: 'flex',
alignItems: 'center'
},
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.checkboxs,
onChange: function onChange(e) {
setisshow(e.target.checked);
form.setFieldsValue({
hack: {
code_compile_score: 0
}
});
if (hack.test_set_average) {
if (hack.is_file) {
handleUploadRatio(uploadData);
} else {
onAddTestCases();
// handleShareRatio(testSetList)
}
}
},
children: "\u542F\u7528\u7F16\u8BD1\u901A\u8FC7\u5373\u53EF\u5F97\u5206"
}), isshow && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("span", {
style: {
display: 'flex'
},
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
rules: [{
required: true,
message: '请输入编译得分'
}],
name: ['hack', 'code_compile_score'],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_38__/* ["default"] */ .Z, {
onChange: function onChange() {
if (hack.test_set_average) {
if (hack.is_file) {
handleUploadRatio(uploadData);
} else {
onAddTestCases();
}
}
},
parser: function parser(e) {
return isNaN(parseInt(e)) ? '' : parseInt(e);
},
min: 0,
max: 100,
style: {
width: '90px',
margin: '5px 0px'
}
})
}), " ", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
style: {
display: 'flex',
alignItems: 'center',
marginLeft: '5px'
},
children: "%"
})]
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
style: {
color: '#999',
fontSize: '12px',
marginLeft: '-8px'
},
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,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("div", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.upBtn,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_35__/* ["default"] */ .ZP, {
ghost: true,
type: "primary",
className: "mb20",
onClick: function onClick() {
return setShowUploadFile(true);
},
children: "\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"
}), (hack === null || hack === void 0 ? void 0 : hack.is_file) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_pages_Shixuns_Edit_body_Level_Challenges_components_UploadFile__WEBPACK_IMPORTED_MODULE_23__/* .UploadTable */ .Y2, {
disabled: hack === null || hack === void 0 ? void 0 : hack.test_set_average,
inputChange: handleInputChange,
showScore: !hack.test_set_score,
data: uploadData,
onRemove: handleRemove
})]
}), !hack.is_file && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.List, {
name: "hack_sets",
children: function children(fields, _ref6) {
_root_workspace_ppte5yg23_local_v9_test6_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectDestructuringEmpty_js__WEBPACK_IMPORTED_MODULE_0___default()(_ref6);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_30__/* ["default"] */ .Z, {
accordion: true,
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z.collapse,
children: fields.map(function (field, index) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(Panel, {
header: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("a", {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z["test-case-name"],
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("span", {
children: ["\u6D4B\u8BD5\u7528\u4F8B", index + 1]
}), !test_set_score ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
name: [field.name, 'score'],
fieldKey: [field.fieldKey, 'score'],
rules: [{
required: true,
message: "\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6".concat(index + 1, "\u8BC4\u5206")
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_38__/* ["default"] */ .Z, {
onClick: onStopPropagation,
min: 0,
max: 100,
disabled: test_set_average
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("span", {
children: "%"
})]
}) : null]
}),
extra: index > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("div", {
onClick: onStopPropagation,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_42__/* ["default"] */ .Z, {
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
title: '确定删除测试集' + (index + 1),
onConfirm: function onConfirm() {
onRemoveTestCase(index);
},
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_ant_design_icons__WEBPACK_IMPORTED_MODULE_43__/* ["default"] */ .Z, {
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z['btn-remove-case']
})
})
}) : null,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u8F93\u5165",
name: [field.name, 'input'],
fieldKey: [field.fieldKey, 'input'],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(TextArea, {})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(antd__WEBPACK_IMPORTED_MODULE_31__/* ["default"] */ .Z.Item, {
label: "\u8F93\u51FA",
name: [field.name, 'output'],
fieldKey: [field.fieldKey, 'output'],
rules: [{
required: true,
message: '请输入输出内容'
}],
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(TextArea, {})
})]
}, "".concat(field.key, "--").concat(index));
})
});
}
})]
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_pages_Shixuns_Edit_body_Level_Challenges_components_UploadFile__WEBPACK_IMPORTED_MODULE_23__/* ["default"] */ .ZP, {
rootIdentifier: null,
visible: showUploadFile,
onClose: function onClose() {
return setShowUploadFile(false);
},
onOK: addUploadData,
multiple: true,
defaultMultipleValue: hack === null || hack === void 0 ? void 0 : hack.is_file
})]
});
}
/***/ }),
/***/ 61550:
/*!******************************************************!*\
!*** ./src/pages/Problems/OjForm/index.less?modules ***!
\******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__) {
// extracted by mini-css-extract-plugin
/* harmony default export */ __webpack_exports__.Z = ({"header":"header___HqHSe","checkboxs":"checkboxs___ObBnD","field":"field___w_sM6","oj-form-container":"oj-form-container____odYP","oj-left-panel":"oj-left-panel___emEB2","oj-form-info":"oj-form-info___m00Ag","footer":"footer___O4iSJ","collapse":"collapse___Ltfkj","test-case-name":"test-case-name___miZcb","btn-remove-case":"btn-remove-case___cHap2","icon-tag":"icon-tag___gmyTb","btn_back":"btn_back___tNmX3","testJi":"testJi___L3fHb","upBtn":"upBtn___RGH6X"});
/***/ })
}]);