|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[77460],{
|
|
|
|
|
|
/***/ 15473:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/components/ChunkedUpload/index.tsx + 1 modules ***!
|
|
|
\************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_ChunkedUpload; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(55794);
|
|
|
// EXTERNAL MODULE: ./node_modules/_uuid@8.3.0@uuid/dist/esm-browser/v4.js + 4 modules
|
|
|
var v4 = __webpack_require__(1012);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
;// CONCATENATED MODULE: ./src/components/ChunkedUpload/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var ChunkedUploadmodules = ({"upload":"upload___jpwPD"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/ChunkedUpload/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ChunkedUpload = function ChunkedUpload(_ref, ref) {
|
|
|
var _ref$chunkSize = _ref.chunkSize,
|
|
|
chunkSize = _ref$chunkSize === void 0 ? 1024 * 1024 * 2 : _ref$chunkSize,
|
|
|
_ref$options = _ref.options,
|
|
|
options = _ref$options === void 0 ? {} : _ref$options,
|
|
|
onCancel = _ref.onCancel,
|
|
|
onComplete = _ref.onComplete,
|
|
|
onError = _ref.onError,
|
|
|
onProgress = _ref.onProgress,
|
|
|
onBefore = _ref.onBefore,
|
|
|
onBeginInitFile = _ref.onBeginInitFile,
|
|
|
children = _ref.children,
|
|
|
accept = _ref.accept,
|
|
|
className = _ref.className,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$concurrency = _ref.concurrency,
|
|
|
concurrency = _ref$concurrency === void 0 ? 4 : _ref$concurrency;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)('ready'),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
uploadStatus = _useState2[0],
|
|
|
setUploadStatus = _useState2[1];
|
|
|
|
|
|
//组件内调试
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
progress = _useState4[0],
|
|
|
setProgress = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
uploadStatusMessage = _useState6[0],
|
|
|
setUploadStatusMessage = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
file = _useState8[0],
|
|
|
setFile = _useState8[1];
|
|
|
var abortControllerRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var domId = (0,_react_17_0_2_react.useRef)((0,v4/* default */.Z)());
|
|
|
var cancelStatus = (0,_react_17_0_2_react.useRef)(false);
|
|
|
(0,_react_17_0_2_react.useImperativeHandle)(ref, function () {
|
|
|
return {
|
|
|
cancel: cancel,
|
|
|
file: file,
|
|
|
uploadStatus: uploadStatus
|
|
|
};
|
|
|
});
|
|
|
var clearInput = function clearInput() {
|
|
|
var input = document.getElementById(domId.current);
|
|
|
if (input) {
|
|
|
input.value = '';
|
|
|
}
|
|
|
};
|
|
|
var handleUpload = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(file) {
|
|
|
var fileSize, totalChunks, res, uploadId, promises, percent, _loop, i, completed, step, _promises$slice, subTasks, p, uploadRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (!(uploadStatus === 'uploading')) {
|
|
|
_context2.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context2.abrupt("return");
|
|
|
case 2:
|
|
|
if (onBeginInitFile) {
|
|
|
onBeginInitFile(file);
|
|
|
}
|
|
|
fileSize = file.size;
|
|
|
totalChunks = Math.ceil(fileSize / chunkSize);
|
|
|
cancelStatus.current = false;
|
|
|
setUploadStatus('uploading');
|
|
|
setProgress(0);
|
|
|
setUploadStatusMessage('');
|
|
|
_context2.prev = 9;
|
|
|
_context2.next = 12;
|
|
|
return (0,fetch/* default */.ZP)("/api/attachments/multipart_upload_start", {
|
|
|
method: 'POST',
|
|
|
body: objectSpread2_default()({
|
|
|
fileName: file.name,
|
|
|
chunkCount: totalChunks
|
|
|
}, options)
|
|
|
});
|
|
|
case 12:
|
|
|
res = _context2.sent;
|
|
|
if (!(cancelStatus.current || (res === null || res === void 0 ? void 0 : res.status) !== 0)) {
|
|
|
_context2.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
throw new Error();
|
|
|
case 15:
|
|
|
uploadId = res.upload_id;
|
|
|
abortControllerRef.current = new AbortController();
|
|
|
promises = [];
|
|
|
percent = 0;
|
|
|
_loop = /*#__PURE__*/regeneratorRuntime_default()().mark(function _loop() {
|
|
|
var start, end, chunk, formData, key;
|
|
|
return regeneratorRuntime_default()().wrap(function _loop$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
start = i * chunkSize;
|
|
|
end = Math.min(start + chunkSize, fileSize);
|
|
|
chunk = file.slice(start, end);
|
|
|
formData = new FormData();
|
|
|
formData.append('chunk', chunk);
|
|
|
formData.append('fileName', file.name);
|
|
|
formData.append('chunkIndex', (i + 1).toString());
|
|
|
formData.append('uploadId', uploadId);
|
|
|
for (key in options) {
|
|
|
if (Object.prototype.hasOwnProperty.call(options, key)) {
|
|
|
formData.append(key, options[key]);
|
|
|
}
|
|
|
}
|
|
|
promises.push(function () {
|
|
|
return (0,fetch/* default */.ZP)("/api/attachments/multipart_upload", {
|
|
|
method: 'POST',
|
|
|
body: formData,
|
|
|
signal: abortControllerRef.current.signal
|
|
|
}, true).then(function (res) {
|
|
|
console.log(res, 444);
|
|
|
percent++;
|
|
|
var currentProgress = Math.round(percent / totalChunks * 100);
|
|
|
setProgress(currentProgress);
|
|
|
if (onProgress) {
|
|
|
onProgress(objectSpread2_default()(objectSpread2_default()({}, res), {}, {
|
|
|
file: file,
|
|
|
percent: currentProgress
|
|
|
}));
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _loop);
|
|
|
});
|
|
|
i = 0;
|
|
|
case 21:
|
|
|
if (!(i < totalChunks)) {
|
|
|
_context2.next = 26;
|
|
|
break;
|
|
|
}
|
|
|
return _context2.delegateYield(_loop(), "t0", 23);
|
|
|
case 23:
|
|
|
i++;
|
|
|
_context2.next = 21;
|
|
|
break;
|
|
|
case 26:
|
|
|
completed = 0;
|
|
|
step = concurrency;
|
|
|
console.log(promises, 'promises');
|
|
|
case 29:
|
|
|
if (!(completed < promises.length)) {
|
|
|
_context2.next = 38;
|
|
|
break;
|
|
|
}
|
|
|
subTasks = (_promises$slice = promises.slice(completed, completed + step)) === null || _promises$slice === void 0 ? void 0 : _promises$slice.map(function (t) {
|
|
|
return t();
|
|
|
});
|
|
|
if (!(subTasks.length > 0)) {
|
|
|
_context2.next = 36;
|
|
|
break;
|
|
|
}
|
|
|
_context2.next = 34;
|
|
|
return Promise.all(subTasks);
|
|
|
case 34:
|
|
|
p = _context2.sent;
|
|
|
completed += step;
|
|
|
case 36:
|
|
|
_context2.next = 29;
|
|
|
break;
|
|
|
case 38:
|
|
|
_context2.next = 40;
|
|
|
return (0,fetch/* default */.ZP)("/api/attachments/multipart_upload_end", {
|
|
|
method: 'POST',
|
|
|
body: objectSpread2_default()({
|
|
|
fileName: file.name,
|
|
|
chunkCount: totalChunks,
|
|
|
uploadId: uploadId
|
|
|
}, options)
|
|
|
});
|
|
|
case 40:
|
|
|
uploadRes = _context2.sent;
|
|
|
if (!!uploadRes.object) {
|
|
|
setUploadStatus('success');
|
|
|
clearInput();
|
|
|
if (onComplete) {
|
|
|
onComplete(objectSpread2_default()(objectSpread2_default()({}, uploadRes), {}, {
|
|
|
file: file,
|
|
|
percent: 100
|
|
|
}));
|
|
|
}
|
|
|
} else {
|
|
|
setUploadStatus('error');
|
|
|
setUploadStatusMessage('上传失败,请稍后重试');
|
|
|
clearInput();
|
|
|
if (onError) {
|
|
|
onError(file.name);
|
|
|
}
|
|
|
}
|
|
|
_context2.next = 50;
|
|
|
break;
|
|
|
case 44:
|
|
|
_context2.prev = 44;
|
|
|
_context2.t1 = _context2["catch"](9);
|
|
|
setUploadStatus('error');
|
|
|
setUploadStatusMessage('上传失败,请稍后重试');
|
|
|
clearInput();
|
|
|
if (onError) {
|
|
|
onError(file.name);
|
|
|
}
|
|
|
case 50:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee, null, [[9, 44]]);
|
|
|
}));
|
|
|
return function handleUpload(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var cancel = (0,_react_17_0_2_react.useCallback)(function () {
|
|
|
cancelStatus.current = true;
|
|
|
if (abortControllerRef.current) {
|
|
|
abortControllerRef.current.abort();
|
|
|
if (onCancel) {
|
|
|
onCancel();
|
|
|
}
|
|
|
}
|
|
|
}, [onCancel]);
|
|
|
var handleChangeUpload = function handleChangeUpload(e) {
|
|
|
var _e$target;
|
|
|
var file = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || (_e$target = _e$target.files) === null || _e$target === void 0 ? void 0 : _e$target[0];
|
|
|
setFile(file);
|
|
|
uploadStatus = 'ready';
|
|
|
if (!file) {
|
|
|
return;
|
|
|
}
|
|
|
if (onBefore) {
|
|
|
var bool = onBefore(file);
|
|
|
if (!bool) {
|
|
|
handleUpload(file);
|
|
|
}
|
|
|
clearInput();
|
|
|
return;
|
|
|
}
|
|
|
handleUpload(file);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("input", {
|
|
|
type: "file",
|
|
|
id: domId.current,
|
|
|
style: {
|
|
|
display: 'none'
|
|
|
},
|
|
|
onChange: handleChangeUpload,
|
|
|
accept: accept
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
|
className: _classnames_2_5_1_classnames_default()(ChunkedUploadmodules.upload, className),
|
|
|
htmlFor: domId.current,
|
|
|
style: style,
|
|
|
children: children
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_ChunkedUpload = (/*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(ChunkedUpload));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 98264:
|
|
|
/*!*************************************************************!*\
|
|
|
!*** ./src/pages/Question/OjProblem/index.tsx + 42 modules ***!
|
|
|
\*************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
// ESM COMPAT FLAG
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"default": function() { return /* binding */ OjProblem; }
|
|
|
});
|
|
|
|
|
|
// 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/_@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/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/FormOutlined.js + 1 modules
|
|
|
var FormOutlined = __webpack_require__(10906);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/PoweroffOutlined.js + 1 modules
|
|
|
var PoweroffOutlined = __webpack_require__(76618);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(25789);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/index.js + 5 modules
|
|
|
var statistic = __webpack_require__(31797);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
|
var spin = __webpack_require__(71418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
|
var es_select = __webpack_require__(57809);
|
|
|
// EXTERNAL MODULE: ./src/pages/Question/OjProblem/service.ts
|
|
|
var service = __webpack_require__(27531);
|
|
|
// EXTERNAL MODULE: ./src/components/SplitContainer/index.tsx + 1 modules
|
|
|
var SplitContainer = __webpack_require__(48226);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(14160);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
|
var ExclamationCircleOutlined = __webpack_require__(87169);
|
|
|
// EXTERNAL MODULE: ./src/pages/Problems/OjForm/CodePanel/index.tsx + 1 modules
|
|
|
var CodePanel = __webpack_require__(91914);
|
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
|
var base64 = __webpack_require__(24334);
|
|
|
// EXTERNAL MODULE: ./src/pages/Problems/OjForm/index.less?modules
|
|
|
var OjFormmodules = __webpack_require__(51591);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/Question/OjProblem/TestCasePanel/index.tsx + 1 modules
|
|
|
var TestCasePanel = __webpack_require__(44676);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
|
|
|
var input = __webpack_require__(92832);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/NotesForm/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TextArea = input/* default */.Z.TextArea;
|
|
|
var MaxNotCount = 5000;
|
|
|
/* harmony default export */ var NotesForm = (function (_ref) {
|
|
|
var callback = _ref.callback,
|
|
|
onCancel = _ref.onCancel,
|
|
|
notes = _ref.notes;
|
|
|
function onSubmit(values) {
|
|
|
callback(values);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
className: "note-form-panel",
|
|
|
onFinish: onSubmit,
|
|
|
initialValues: {
|
|
|
notes: notes
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "notes",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入笔记内容'
|
|
|
}, {
|
|
|
max: MaxNotCount,
|
|
|
message: "\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(MaxNotCount)
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",
|
|
|
rows: 5
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
|
style: {
|
|
|
textAlign: 'right'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "ghost",
|
|
|
onClick: onCancel,
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: " \u53D6\u6D88 "
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: " \u63D0\u4EA4 "
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var LeftPanelmodules = ({"left-panel":"left-panel___fP6Y3","tab-panel-body":"tab-panel-body___aLOJQ","b1":"b1___ELpwD","oj-mr":"oj-mr___SIQSw","oj-width-input":"oj-width-input___tR_Si","s-navs":"s-navs___iVrSH","bg-white":"bg-white___S0kiU","active":"active___D332c"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/SubmitList/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var SubmitListmodules = ({"pagination":"pagination___npPu7","info":"info___aRH6C"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(1710);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(58421);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
|
|
|
var LoadingOutlined = __webpack_require__(58617);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CopyOutlined.js + 1 modules
|
|
|
var CopyOutlined = __webpack_require__(81953);
|
|
|
// EXTERNAL MODULE: ./src/pages/Question/OjProblem/interface.ts
|
|
|
var OjProblem_interface = __webpack_require__(44266);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(20681);
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.19@dayjs/dayjs.min.js
|
|
|
var dayjs_min = __webpack_require__(66649);
|
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/SubmitList/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Column = table/* default */.Z.Column;
|
|
|
/* harmony default export */ var SubmitList = (function (_ref) {
|
|
|
var submitResult = _ref.submitResult,
|
|
|
submitting = _ref.submitting,
|
|
|
submitRecords = _ref.submitRecords,
|
|
|
page = _ref.page,
|
|
|
onPageChange = _ref.onPageChange,
|
|
|
topicId = _ref.topicId;
|
|
|
var _ref2 = submitResult || {},
|
|
|
status = _ref2.status,
|
|
|
id = _ref2.id,
|
|
|
input = _ref2.input,
|
|
|
output = _ref2.output,
|
|
|
expected_output = _ref2.expected_output,
|
|
|
is_file = _ref2.is_file,
|
|
|
input_file_url = _ref2.input_file_url,
|
|
|
output_file_url = _ref2.output_file_url,
|
|
|
expected_output_file_url = _ref2.expected_output_file_url,
|
|
|
error_msg = _ref2.error_msg;
|
|
|
var _ref3 = submitRecords || {},
|
|
|
records = _ref3.records,
|
|
|
records_count = _ref3.records_count;
|
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
|
function onCopy() {
|
|
|
if (!is_file) {
|
|
|
navigator.clipboard.writeText(base64.Base64.decode(output)).then(function () {
|
|
|
message/* default */.ZP.success('复制错误信息成功');
|
|
|
});
|
|
|
} else {
|
|
|
navigator.clipboard.writeText(base64.Base64.decode(error_msg)).then(function () {
|
|
|
message/* default */.ZP.success('复制错误信息成功');
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
spinning: submitting,
|
|
|
tip: "\u8BC4\u6D4B\u4E2D...",
|
|
|
indicator: /*#__PURE__*/(0,jsx_runtime.jsx)(LoadingOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
fontSize: 24
|
|
|
},
|
|
|
spin: true
|
|
|
}),
|
|
|
children: [id ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: SubmitListmodules.info,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: ["\u6267\u884C\u7ED3\u679C\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: status === OjProblem_interface/* ExecuteStatus */.h.OK ? 'c-green' : 'c-red',
|
|
|
children: TestCasePanel/* ExecuteDict */.Im[status]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: SubmitListmodules.error,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
onClick: onCopy,
|
|
|
children: ["\u590D\u5236\u9519\u8BEF\u4FE1\u606F ", /*#__PURE__*/(0,jsx_runtime.jsx)(CopyOutlined/* default */.Z, {}), " "]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/problems/".concat(topicId, "/record-detail/").concat(id, "?backId=").concat(urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier),
|
|
|
children: "\u663E\u793A\u8BE6\u60C5 > "
|
|
|
})
|
|
|
})]
|
|
|
}), status !== OjProblem_interface/* ExecuteStatus */.h.OK ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "c-red",
|
|
|
children: "\u5B9E\u9645\u8F93\u5165\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("pre", {
|
|
|
children: [!is_file && input, is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
// href={input_file_url}
|
|
|
style: {
|
|
|
fontSize: '16px'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
return (0,util/* download */.LR)(input_file_url, input);
|
|
|
}
|
|
|
// download={expected_output}
|
|
|
// target="_blank"
|
|
|
,
|
|
|
children: input
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "c-red",
|
|
|
children: "\u5B9E\u9645\u8F93\u51FA\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("pre", {
|
|
|
children: [(status === 4 || status === 5) && base64.Base64.decode(error_msg), status != 4 && status != 5 && (is_file ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
// href={output_file_url}
|
|
|
style: {
|
|
|
fontSize: '16px'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
return (0,util/* download */.LR)(output_file_url, output);
|
|
|
}
|
|
|
// download={expected_output} target="_blank"
|
|
|
,
|
|
|
children: output
|
|
|
}) : base64.Base64.decode(output))]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "c-red",
|
|
|
children: "\u9884\u671F\u8F93\u51FA\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("pre", {
|
|
|
children: [!is_file && base64.Base64.decode(expected_output), is_file && /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
// href={expected_output_file_url}
|
|
|
style: {
|
|
|
fontSize: '16px'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
return (0,util/* download */.LR)(expected_output_file_url, expected_output);
|
|
|
}
|
|
|
// download={expected_output} target="_blank"
|
|
|
,
|
|
|
children: expected_output
|
|
|
})]
|
|
|
})]
|
|
|
}) : null]
|
|
|
}) : null, (records === null || records === void 0 ? void 0 : records.length) > 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)(table/* default */.Z, {
|
|
|
dataSource: records,
|
|
|
rowKey: "id",
|
|
|
pagination: false,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Column, {
|
|
|
title: "\u63D0\u4EA4\u65F6\u95F4",
|
|
|
dataIndex: "created_at",
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [" ", dayjs_min_default()(text).format('YYYY-MM-DD HH:mm:ss')]
|
|
|
});
|
|
|
}
|
|
|
}, "created_at"), /*#__PURE__*/(0,jsx_runtime.jsx)(Column, {
|
|
|
title: "\u63D0\u4EA4\u7ED3\u679C",
|
|
|
dataIndex: "status",
|
|
|
render: function render(text, record) {
|
|
|
var _ExecuteDict$text;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
className: text === 0 ? 'c-green' : 'c-red',
|
|
|
to: "/problems/".concat(topicId, "/record-detail/").concat(record.id, "?backId=").concat(urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier),
|
|
|
children: (_ExecuteDict$text = TestCasePanel/* ExecuteDict */.Im[text]) === null || _ExecuteDict$text === void 0 ? void 0 : _ExecuteDict$text.replace('调试', '评测')
|
|
|
});
|
|
|
}
|
|
|
}, "status"), /*#__PURE__*/(0,jsx_runtime.jsx)(Column, {
|
|
|
title: "\u6267\u884C\u7528\u65F6 (S)",
|
|
|
dataIndex: "execute_time"
|
|
|
}, "execute_time"), /*#__PURE__*/(0,jsx_runtime.jsx)(Column, {
|
|
|
title: "\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09",
|
|
|
dataIndex: "execute_memory"
|
|
|
}, "execute_memory"), /*#__PURE__*/(0,jsx_runtime.jsx)(Column, {
|
|
|
title: "\u8BED\u8A00",
|
|
|
dataIndex: "language"
|
|
|
}, "language")]
|
|
|
}) : null, records_count > 15 ? /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
className: SubmitListmodules.pagination,
|
|
|
current: page,
|
|
|
pageSize: 15,
|
|
|
total: records_count,
|
|
|
onChange: onPageChange
|
|
|
}) : null]
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(61983);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/index.js + 5 modules
|
|
|
var tag = __webpack_require__(12563);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules
|
|
|
var space = __webpack_require__(81327);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Description/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Descriptionmodules = ({"desc":"desc___X8_hx","info":"info___C1DPv","commit-info":"commit-info____9yQm"});
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 2 modules
|
|
|
var RenderHtml = __webpack_require__(11209);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Description/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DifficultDesc = {
|
|
|
1: {
|
|
|
name: '简单',
|
|
|
color: '#52c41a'
|
|
|
},
|
|
|
2: {
|
|
|
name: '适中',
|
|
|
color: '#faad14'
|
|
|
},
|
|
|
3: {
|
|
|
name: '困难',
|
|
|
color: '#f5222d'
|
|
|
}
|
|
|
};
|
|
|
/* harmony default export */ var Description = (function (_ref) {
|
|
|
var hack = _ref.hack,
|
|
|
onTriggerPraise = _ref.onTriggerPraise,
|
|
|
toDiscuss = _ref.toDiscuss;
|
|
|
var language = hack.language,
|
|
|
difficulty = hack.difficulty,
|
|
|
time_limit = hack.time_limit,
|
|
|
username = hack.username,
|
|
|
user_path = hack.user_path,
|
|
|
user_praise = hack.user_praise,
|
|
|
comments_count = hack.comments_count,
|
|
|
praises_count = hack.praises_count,
|
|
|
description = hack.description,
|
|
|
pass_count = hack.pass_count,
|
|
|
submit_count = hack.submit_count;
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
console.log(hack.language, 'language');
|
|
|
var diffItem = DifficultDesc[difficulty];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: Descriptionmodules.info,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: ["\u96BE\u5EA6\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(tag/* default */.Z, {
|
|
|
color: diffItem.color,
|
|
|
children: diffItem.name
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: ["\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsxs)("b", {
|
|
|
children: [time_limit, "\u79D2"]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: description,
|
|
|
className: Descriptionmodules.desc
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: Descriptionmodules['commit-info'],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
|
|
|
size: 4,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u901A\u8FC7\u6B21\u6570"
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
children: pass_count
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
|
|
|
size: 4,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u63D0\u4EA4\u6B21\u6570"
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
children: submit_count
|
|
|
})]
|
|
|
}), " "]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
style: {
|
|
|
flex: '1 0 0'
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(space/* default */.Z, {
|
|
|
size: 4,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-huifu1",
|
|
|
onClick: toDiscuss
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
children: comments_count
|
|
|
})]
|
|
|
}), " "]
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
|
var mediator = __webpack_require__(24750);
|
|
|
;// CONCATENATED MODULE: ./src/assets/images/question/show.svg
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var __defProp = Object.defineProperty;
|
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? __defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var __spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
if (__getOwnPropSymbols) {
|
|
|
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgShow = function SvgShow(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
|
width: 40,
|
|
|
height: 40,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u5C55\u5F00\u9898\u76EE"), /* @__PURE__ */React.createElement("defs", null, /* @__PURE__ */React.createElement("linearGradient", {
|
|
|
x1: "0%",
|
|
|
y1: "0%",
|
|
|
x2: "100%",
|
|
|
y2: "100%",
|
|
|
id: "show_svg__a"
|
|
|
}, /* @__PURE__ */React.createElement("stop", {
|
|
|
stopColor: "#EEF7FF",
|
|
|
offset: "0%"
|
|
|
}), /* @__PURE__ */React.createElement("stop", {
|
|
|
stopColor: "#C1E2FF",
|
|
|
offset: "100%"
|
|
|
}))), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "none",
|
|
|
fillRule: "evenodd"
|
|
|
}, /* @__PURE__ */React.createElement("rect", {
|
|
|
fill: "url(#show_svg__a)",
|
|
|
width: 40,
|
|
|
height: 40,
|
|
|
rx: 8
|
|
|
}), /* @__PURE__ */React.createElement("g", {
|
|
|
fillRule: "nonzero"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M16.057 20.784H8.238A1.22 1.22 0 0 0 7 21.974v6.811a1.22 1.22 0 0 0 1.238 1.19h7.819a1.213 1.213 0 0 0 1.238-1.19v-6.811a1.213 1.213 0 0 0-.376-.847 1.203 1.203 0 0 0-.862-.332v-.01Zm-1.25 6.769H9.423V23.12h5.384v4.433Z",
|
|
|
fill: "#4CACFF"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M16.057 10.005a1.22 1.22 0 0 1 1.238 1.189v6.812a1.213 1.213 0 0 1-.376.846c-.232.222-.542.34-.862.332H8.238A1.213 1.213 0 0 1 7 18.005v-6.811a1.22 1.22 0 0 1 1.238-1.19Zm-1.239 2.41H9.434v4.401h5.384v-4.4Z",
|
|
|
fill: "#94CDFF"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M20.418 12.632h11.189a1.213 1.213 0 0 0 1.238-1.179 1.224 1.224 0 0 0-.371-.857 1.214 1.214 0 0 0-.867-.343H20.418a1.203 1.203 0 0 0-.866.336c-.233.223-.367.53-.372.854.005.323.14.63.372.854.232.223.544.344.866.335ZM31.575 16.027h-11.19a1.183 1.183 0 0 0-1.119.557c-.237.384-.237.87 0 1.254.238.384.672.6 1.12.557h11.189c.448.043.882-.173 1.119-.557.237-.384.237-.87 0-1.254a1.183 1.183 0 0 0-1.12-.557ZM31.575 21.595h-11.19a1.183 1.183 0 0 0-1.119.557c-.237.384-.237.87 0 1.254.238.384.672.6 1.12.557h11.189c.448.043.882-.173 1.119-.557.237-.384.237-.87 0-1.254a1.183 1.183 0 0 0-1.12-.557ZM31.575 27.163h-11.19a1.183 1.183 0 0 0-1.119.557c-.237.384-.237.87 0 1.254.238.384.672.6 1.12.557h11.189c.448.043.882-.173 1.119-.557.237-.384.237-.87 0-1.254a1.183 1.183 0 0 0-1.12-.557Z",
|
|
|
fill: "#1890FF"
|
|
|
}))));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var show = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjEwMCUiIGlkPSJhIj48c3RvcCBzdG9wLWNvbG9yPSIjRUVGN0ZGIiBvZmZzZXQ9IjAlIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0MxRTJGRiIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSJ1cmwoI2EpIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHJ4PSI4Ii8+PGcgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNMTYuMDU3IDIwLjc4NEg4LjIzOEExLjIyIDEuMjIgMCAwIDAgNyAyMS45NzR2Ni44MTFhMS4yMiAxLjIyIDAgMCAwIDEuMjM4IDEuMTloNy44MTlhMS4yMTMgMS4yMTMgMCAwIDAgMS4yMzgtMS4xOXYtNi44MTFhMS4yMTMgMS4yMTMgMCAwIDAtLjM3Ni0uODQ3IDEuMjAzIDEuMjAzIDAgMCAwLS44NjItLjMzMnYtLjAxWm0tMS4yNSA2Ljc2OUg5LjQyM1YyMy4xMmg1LjM4NHY0LjQzM1oiIGZpbGw9IiM0Q0FDRkYiLz48cGF0aCBkPSJNMTYuMDU3IDEwLjAwNWExLjIyIDEuMjIgMCAwIDEgMS4yMzggMS4xODl2Ni44MTJhMS4yMTMgMS4yMTMgMCAwIDEtLjM3Ni44NDZjLS4yMzIuMjIyLS41NDIuMzQtLjg2Mi4zMzJIOC4yMzhBMS4yMTMgMS4yMTMgMCAwIDEgNyAxOC4wMDV2LTYuODExYTEuMjIgMS4yMiAwIDAgMSAxLjIzOC0xLjE5Wm0tMS4yMzkgMi40MUg5LjQzNHY0LjQwMWg1LjM4NHYtNC40WiIgZmlsbD0iIzk0Q0RGRiIvPjxwYXRoIGQ9Ik0yMC40MTggMTIuNjMyaDExLjE4OWExLjIxMyAxLjIxMyAwIDAgMCAxLjIzOC0xLjE3OSAxLjIyNCAxLjIyNCAwIDAgMC0uMzcxLS44NTcgMS4yMTQgMS4yMTQgMCAwIDAtLjg2Ny0uMzQzSDIwLjQxOGExLjIwMyAxLjIwMyAwIDAgMC0uODY2LjMzNmMtLjIzMy4yMjMtLjM2Ny41My0uMzcyLjg1NC4wMDUuMzIzLjE0LjYzLjM3Mi44NTQuMjMyLjIyMy41NDQuMzQ0Ljg2Ni4zMzVaTTMxLjU3NSAxNi4wMjdoLTExLjE5YTEuMTgzIDEuMTgzIDAgMCAwLTEuMTE5LjU1N2MtLjIzNy4zODQtLjIzNy44NyAwIDEuMjU0LjIzOC4zODQuNjcyLjYgMS4xMi41NTdoMTEuMTg5Yy40NDguMDQzLjg4Mi0uMTczIDEuMTE5LS41NTcuMjM3LS4zODQuMjM3LS44NyAwLTEuMjU0YTEuMTgzIDEuMTgzIDAgMCAwLTEuMTItLjU1N1pNMzEuNTc1IDIxLjU5NWgtMTEuMTlhMS4xODMgMS4xODMgMCAwIDAtMS4xMTkuNTU3Yy0uMjM3LjM4NC0uMjM3Ljg3IDAgMS4yNTQuMjM4LjM4NC42NzIuNiAxLjEyLjU1N2gxMS4xODljLjQ0OC4wNDMuODgyLS4xNzMgMS4xMTktLjU1Ny4yMzctLjM4NC4yMzctLjg3IDAtMS4yNTRhMS4xODMgMS4xODMgMCAwIDAtMS4xMi0uNTU3Wk0zMS41NzUgMjcuMTYzaC0xMS4xOWExLjE4MyAxLjE4MyAwIDAgMC0xLjExOS41NTdjLS4yMzcuMzg0LS4yMzcuODcgMCAxLjI1NC4yMzguMzg0LjY3Mi42IDEuMTIuNTU3aDExLjE4OWMuNDQ4LjA0My44ODItLjE3MyAxLjExOS0uNTU3LjIzNy0uMzg0LjIzNy0uODcgMC0xLjI1NGExLjE4MyAxLjE4MyAwIDAgMC0xLjEyLS41NTdaIiBmaWxsPSIjMTg5MEZGIi8+PC9nPjwvZz48L3N2Zz4=");
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./src/components/modal.tsx
|
|
|
var components_modal = __webpack_require__(2439);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(55794);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/service.ts
|
|
|
|
|
|
|
|
|
//
|
|
|
function getComments(params) {
|
|
|
return (0,fetch/* get */.U2)("comments.json", params);
|
|
|
}
|
|
|
function plusDiscuss(id) {
|
|
|
return (0,fetch/* post */.v_)("/discusses/".concat(id, "/plus.json"), {
|
|
|
container_type: "Discuss",
|
|
|
type: 1
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//
|
|
|
function replyDiscuss(params) {
|
|
|
return (0,fetch/* post */.v_)("comments/reply.json", params);
|
|
|
}
|
|
|
|
|
|
//
|
|
|
function createDiscuss(params) {
|
|
|
return (0,fetch/* post */.v_)("comments.json", params);
|
|
|
}
|
|
|
|
|
|
//
|
|
|
function hiddenDiscuss(params) {
|
|
|
return (0,fetch/* post */.v_)("comments/".concat(params === null || params === void 0 ? void 0 : params.id, "/hidden.json"), params);
|
|
|
}
|
|
|
function deleteDiscuss(params) {
|
|
|
return (0,fetch/* del */.IV)("comments/".concat(params === null || params === void 0 ? void 0 : params.id, ".json"));
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-item/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx + 1 modules
|
|
|
var discuss_editor = __webpack_require__(15273);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(85186);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-item/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function UserPhoto(_ref) {
|
|
|
var author = _ref.author;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/users/".concat(author.login),
|
|
|
target: "_blank",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
alt: "\u7528\u6237\u5934\u50CF",
|
|
|
height: "50",
|
|
|
style: {
|
|
|
borderRadius: '50%'
|
|
|
},
|
|
|
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(author.image_url),
|
|
|
width: "50"
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
function SecondLevelDiscuss(_ref2) {
|
|
|
var data = _ref2.data,
|
|
|
index = _ref2.index,
|
|
|
parentDiscussIndex = _ref2.parentDiscussIndex,
|
|
|
user = _ref2.user,
|
|
|
onSetActionType = _ref2.onSetActionType;
|
|
|
var author = data.author,
|
|
|
can_delete = data.can_delete,
|
|
|
content = data.content,
|
|
|
id = data.id,
|
|
|
time = data.time;
|
|
|
function onDeleteDiscuss() {
|
|
|
onSetActionType({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
type: 'delete-discuss',
|
|
|
parentDiscussIndex: parentDiscussIndex,
|
|
|
message: '确定要删除该条回复吗'
|
|
|
});
|
|
|
}
|
|
|
var canDelete = user.admin || can_delete || author.user_id === user.user_id;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-item-container second-discuss ",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(UserPhoto, {
|
|
|
author: author
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-info",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/users/".concat(author.login),
|
|
|
target: "_blank",
|
|
|
children: author.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "grey",
|
|
|
children: time
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "btn-group",
|
|
|
style: {
|
|
|
marginBottom: 0
|
|
|
},
|
|
|
children: canDelete ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onDeleteDiscuss,
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shanchu"
|
|
|
})
|
|
|
}) : null
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: "discuss-content",
|
|
|
value: content
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var discuss_item = (function (_ref3) {
|
|
|
var user = _ref3.user,
|
|
|
data = _ref3.data,
|
|
|
index = _ref3.index,
|
|
|
onPlusDiscuss = _ref3.onPlusDiscuss,
|
|
|
onSetActionType = _ref3.onSetActionType,
|
|
|
activeDiscussIndex = _ref3.activeDiscussIndex,
|
|
|
onReplyDiscuss = _ref3.onReplyDiscuss,
|
|
|
onSetActiveDiscussIndex = _ref3.onSetActiveDiscussIndex;
|
|
|
var content = data.content,
|
|
|
children = data.children,
|
|
|
hidden = data.hidden,
|
|
|
id = data.id,
|
|
|
praise_count = data.praise_count,
|
|
|
time = data.time,
|
|
|
user_praise = data.user_praise,
|
|
|
can_delete = data.can_delete,
|
|
|
author = data.author;
|
|
|
console.log(can_delete && (!children || children.length == 0), 'children22');
|
|
|
function onActiveDiscussIndex() {
|
|
|
onSetActiveDiscussIndex(id);
|
|
|
}
|
|
|
function onPlus() {
|
|
|
onPlusDiscuss(id, !user_praise, index);
|
|
|
}
|
|
|
function onDeleteDiscuss() {
|
|
|
onSetActionType({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
type: 'delete-discuss',
|
|
|
message: '确定要删除该条回复吗'
|
|
|
});
|
|
|
}
|
|
|
function onHiddenDiscuss() {
|
|
|
onSetActionType({
|
|
|
id: id,
|
|
|
index: index,
|
|
|
params: {
|
|
|
hidden: !hidden ? '1' : '0'
|
|
|
},
|
|
|
type: 'hidden-discuss',
|
|
|
message: !hidden ? '确定要隐藏该条回复吗' : '确定要取消隐藏该条回复吗'
|
|
|
});
|
|
|
}
|
|
|
var adminOrOperator = user.admin || user.user_id === author.user_id;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-item-container",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(UserPhoto, {
|
|
|
author: author
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-info",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
href: "/users/".concat(author.login),
|
|
|
target: "_blank",
|
|
|
children: [" ", author.name, " "]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "grey",
|
|
|
children: time
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: "discuss-content",
|
|
|
value: content
|
|
|
}), children && children.length > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "reply-discuss-container",
|
|
|
children: children.map(function (item, i) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(SecondLevelDiscuss, {
|
|
|
data: item,
|
|
|
index: i,
|
|
|
user: user,
|
|
|
onSetActionType: onSetActionType,
|
|
|
parentDiscussIndex: index
|
|
|
}, item.id);
|
|
|
})
|
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "btn-group",
|
|
|
children: [(0,authority/* isSuperAdmins */.Ny)() ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onHiddenDiscuss,
|
|
|
title: hidden ? '取消隐藏' : '隐藏评论',
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: hidden ? 'iconfont icon-yincangbiyan' : 'fa fa-eye'
|
|
|
})
|
|
|
}) : null, can_delete && (!children || children.length == 0) ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onDeleteDiscuss,
|
|
|
title: "\u5220\u9664",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shanchu"
|
|
|
})
|
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
onClick: onActiveDiscussIndex,
|
|
|
title: "\u56DE\u590D",
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-huifu1"
|
|
|
}), " "]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
onClick: onPlus,
|
|
|
className: user_praise ? 'c-orange' : '',
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: user_praise ? 'iconfont icon-dianzan mr3' : 'iconfont icon-dianzan-xian mr3 '
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: praise_count ? praise_count : ''
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_editor/* default */.Z, {
|
|
|
id: id,
|
|
|
activeDiscussIndex: activeDiscussIndex,
|
|
|
onReplyDiscuss: onReplyDiscuss
|
|
|
})]
|
|
|
})]
|
|
|
}, id);
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules
|
|
|
var image_preview = __webpack_require__(53333);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-input-editor/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
|
var markdown_editor = __webpack_require__(15396);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-input-editor/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var discuss_input_editor = (function (_ref) {
|
|
|
var user_praise = _ref.user_praise,
|
|
|
praise_count = _ref.praise_count,
|
|
|
praisePlus = _ref.praisePlus,
|
|
|
onCreateDiscuss = _ref.onCreateDiscuss,
|
|
|
discuss_count = _ref.discuss_count;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
showMd = _useState2[0],
|
|
|
setShowMd = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
value = _useState4[0],
|
|
|
setValue = _useState4[1];
|
|
|
function onChangeHandler(v) {
|
|
|
setValue(v);
|
|
|
}
|
|
|
function onShowMd() {
|
|
|
setShowMd(true);
|
|
|
}
|
|
|
function onCancel() {
|
|
|
setShowMd(false);
|
|
|
}
|
|
|
function onCommit() {
|
|
|
return _onCommit.apply(this, arguments);
|
|
|
}
|
|
|
function _onCommit() {
|
|
|
_onCommit = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
onCreateDiscuss(value);
|
|
|
setValue('');
|
|
|
setShowMd(false);
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _onCommit.apply(this, arguments);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "dis-input-editor-container ".concat(showMd ? 'active' : '', " "),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: showMd ? 'text-area hide' : 'text-area',
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("input", {
|
|
|
placeholder: "\u8BF4\u70B9\u4EC0\u4E48",
|
|
|
onClick: onShowMd
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
style: {
|
|
|
alignItems: "center"
|
|
|
},
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-huifu1"
|
|
|
}), " \xA0 \xA0", discuss_count, " "]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
className: "c-light-black",
|
|
|
onClick: praisePlus,
|
|
|
style: {
|
|
|
alignItems: "center"
|
|
|
},
|
|
|
title: user_praise ? '取消点赞' : '点赞',
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "mr3 ".concat(user_praise ? 'iconfont icon-dianzan c-orange' : 'iconfont icon-dianzan-xian', " ")
|
|
|
}), praise_count ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: praise_count
|
|
|
}) : '']
|
|
|
})]
|
|
|
}), showMd ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "input-mask",
|
|
|
onClick: onCancel
|
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: showMd ? 'md-container' : 'md-container hide',
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
id: "discuss-input-editor",
|
|
|
miniToolbar: true,
|
|
|
watch: false,
|
|
|
noStorage: true,
|
|
|
defaultValue: value,
|
|
|
height: 240,
|
|
|
onChange: onChangeHandler
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tip-container",
|
|
|
onClick: onCancel,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: "btn-send",
|
|
|
onClick: onCommit,
|
|
|
children: " \u53D1\u9001 "
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var initialState = {
|
|
|
loading: false,
|
|
|
page: 1,
|
|
|
data: [],
|
|
|
count: 0,
|
|
|
actionType: null,
|
|
|
activeDiscussIndex: null
|
|
|
};
|
|
|
var Types = /*#__PURE__*/function (Types) {
|
|
|
Types[Types["GET_DISCUSSES"] = 0] = "GET_DISCUSSES";
|
|
|
Types[Types["TOP_OR_DOWN_DISCUSS"] = 1] = "TOP_OR_DOWN_DISCUSS";
|
|
|
Types[Types["ACTIVE_DISCUSS_INDEX"] = 2] = "ACTIVE_DISCUSS_INDEX";
|
|
|
Types[Types["PLUS_DISCUSS"] = 3] = "PLUS_DISCUSS";
|
|
|
Types[Types["SET_ACTION_TYPE"] = 4] = "SET_ACTION_TYPE";
|
|
|
Types[Types["SET_PAGE"] = 5] = "SET_PAGE";
|
|
|
Types[Types["SHOW_DISCUSSES_LOADING"] = 6] = "SHOW_DISCUSSES_LOADING";
|
|
|
return Types;
|
|
|
}(Types || {});
|
|
|
function reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case Types.SHOW_DISCUSSES_LOADING:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
loading: true
|
|
|
});
|
|
|
case Types.GET_DISCUSSES:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case Types.TOP_OR_DOWN_DISCUSS:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case Types.SET_ACTION_TYPE:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case Types.PLUS_DISCUSS:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case Types.SET_PAGE:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case Types.ACTIVE_DISCUSS_INDEX:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
/* harmony default export */ var Discuss = (function (_ref) {
|
|
|
var user = _ref.user,
|
|
|
identifier = _ref.identifier,
|
|
|
hack = _ref.hack,
|
|
|
onTriggerPraise = _ref.onTriggerPraise,
|
|
|
setDiscussTotal = _ref.setDiscussTotal;
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(reducer, initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var loading = state.loading,
|
|
|
page = state.page,
|
|
|
data = state.data,
|
|
|
count = state.count,
|
|
|
actionType = state.actionType,
|
|
|
activeDiscussIndex = state.activeDiscussIndex;
|
|
|
console.log('---', state);
|
|
|
var initData = (0,_react_17_0_2_react.useCallback)( /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var response, comments, disscuss_count;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: Types.SHOW_DISCUSSES_LOADING
|
|
|
});
|
|
|
_context.next = 3;
|
|
|
return getComments({
|
|
|
container_type: 'Practice',
|
|
|
container_identifier: identifier,
|
|
|
limit: 10,
|
|
|
page: page
|
|
|
});
|
|
|
case 3:
|
|
|
response = _context.sent;
|
|
|
comments = response.comments, disscuss_count = response.disscuss_count;
|
|
|
dispatch({
|
|
|
type: Types.GET_DISCUSSES,
|
|
|
payload: {
|
|
|
data: comments,
|
|
|
count: disscuss_count,
|
|
|
loading: false
|
|
|
}
|
|
|
});
|
|
|
setDiscussTotal(disscuss_count);
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})), [page, identifier]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
initData();
|
|
|
}, [identifier, page]);
|
|
|
function onPaginationChange(value) {
|
|
|
dispatch({
|
|
|
type: Types.SET_PAGE,
|
|
|
payload: {
|
|
|
page: value
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function onSetActionType(value) {
|
|
|
dispatch({
|
|
|
type: Types.SET_ACTION_TYPE,
|
|
|
payload: {
|
|
|
actionType: value
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function onSetActiveDiscussIndex(value) {
|
|
|
if (activeDiscussIndex === value) {
|
|
|
dispatch({
|
|
|
type: Types.ACTIVE_DISCUSS_INDEX,
|
|
|
payload: {
|
|
|
activeDiscussIndex: null
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
dispatch({
|
|
|
type: Types.ACTIVE_DISCUSS_INDEX,
|
|
|
payload: {
|
|
|
activeDiscussIndex: value
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
function onPlusDiscuss(_x, _x2, _x3) {
|
|
|
return _onPlusDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function _onPlusDiscuss() {
|
|
|
_onPlusDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(id, user_praise, index) {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.prev = 0;
|
|
|
_context2.next = 3;
|
|
|
return plusDiscuss(id);
|
|
|
case 3:
|
|
|
response = _context2.sent;
|
|
|
data[index].user_praise = user_praise;
|
|
|
data[index].praise_count = response.praise_count;
|
|
|
dispatch({
|
|
|
type: Types.PLUS_DISCUSS,
|
|
|
payload: {
|
|
|
data: toConsumableArray_default()(data)
|
|
|
}
|
|
|
});
|
|
|
_context2.next = 12;
|
|
|
break;
|
|
|
case 9:
|
|
|
_context2.prev = 9;
|
|
|
_context2.t0 = _context2["catch"](0);
|
|
|
console.log(_context2.t0);
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2, null, [[0, 9]]);
|
|
|
}));
|
|
|
return _onPlusDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function onProcessAction() {
|
|
|
return _onProcessAction.apply(this, arguments);
|
|
|
}
|
|
|
function _onProcessAction() {
|
|
|
_onProcessAction = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var id, params, type, index, parentDiscussIndex;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
id = actionType.id, params = actionType.params, type = actionType.type, index = actionType.index, parentDiscussIndex = actionType.parentDiscussIndex;
|
|
|
if (!(type === 'hidden-discuss')) {
|
|
|
_context3.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
console.log(params, 'params');
|
|
|
_context3.next = 5;
|
|
|
return hiddenDiscuss(objectSpread2_default()({
|
|
|
id: id,
|
|
|
container_type: 'Practice',
|
|
|
container_identifier: identifier
|
|
|
}, params));
|
|
|
case 5:
|
|
|
if (!parentDiscussIndex) {
|
|
|
data[index].hidden = params.hidden == 1 ? true : false;
|
|
|
} else {
|
|
|
data[parentDiscussIndex].children[index].hidden = params.hidden == 1 ? true : false;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: Types.SET_ACTION_TYPE,
|
|
|
payload: {
|
|
|
actionType: null,
|
|
|
data: toConsumableArray_default()(data)
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
if (!(type === 'delete-discuss')) {
|
|
|
_context3.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
_context3.next = 10;
|
|
|
return deleteDiscuss({
|
|
|
id: id,
|
|
|
container_type: 'Practice',
|
|
|
container_identifier: identifier
|
|
|
});
|
|
|
case 10:
|
|
|
// if (parentDiscussIndex || parentDiscussIndex === 0) {
|
|
|
// let secondDicusses = data[parentDiscussIndex].children
|
|
|
// for (let i = secondDicusses.length - 1; i >= 0; i--) {
|
|
|
// if (secondDicusses[i].id === id) {
|
|
|
// secondDicusses.splice(i, 1)
|
|
|
// break
|
|
|
// }
|
|
|
// }
|
|
|
// data[parentDiscussIndex].children = secondDicusses
|
|
|
// } else {
|
|
|
// for (let i = data.length - 1; i >= 0; i--) {
|
|
|
// if (data[i].id === id) {
|
|
|
// data.splice(i, 1)
|
|
|
// break
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
dispatch({
|
|
|
type: Types.SET_ACTION_TYPE,
|
|
|
payload: {
|
|
|
actionType: null
|
|
|
// data: [...data],
|
|
|
}
|
|
|
});
|
|
|
_context3.next = 13;
|
|
|
return initData();
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return _onProcessAction.apply(this, arguments);
|
|
|
}
|
|
|
function onCancelAction() {
|
|
|
dispatch({
|
|
|
type: Types.SET_ACTION_TYPE,
|
|
|
payload: {
|
|
|
actionType: null
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function onReplyDiscuss(_x4, _x5) {
|
|
|
return _onReplyDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function _onReplyDiscuss() {
|
|
|
_onReplyDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(id, value) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.prev = 0;
|
|
|
_context4.next = 3;
|
|
|
return replyDiscuss({
|
|
|
container_type: 'Practice',
|
|
|
container_identifier: identifier,
|
|
|
comments: {
|
|
|
content: value,
|
|
|
parent_id: id
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
initData();
|
|
|
_context4.next = 9;
|
|
|
break;
|
|
|
case 6:
|
|
|
_context4.prev = 6;
|
|
|
_context4.t0 = _context4["catch"](0);
|
|
|
console.log(_context4.t0);
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4, null, [[0, 6]]);
|
|
|
}));
|
|
|
return _onReplyDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function onCreateDiscuss(_x6) {
|
|
|
return _onCreateDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
function _onCreateDiscuss() {
|
|
|
_onCreateDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(value) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: Types.SHOW_DISCUSSES_LOADING
|
|
|
});
|
|
|
_context5.next = 3;
|
|
|
return createDiscuss({
|
|
|
comments: {
|
|
|
content: value
|
|
|
},
|
|
|
container_type: 'Practice',
|
|
|
container_identifier: identifier
|
|
|
});
|
|
|
case 3:
|
|
|
initData();
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return _onCreateDiscuss.apply(this, arguments);
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "discuss-panel",
|
|
|
children: [data.length === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
spinning: loading,
|
|
|
children: data.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_item, {
|
|
|
onReplyDiscuss: onReplyDiscuss,
|
|
|
onPlusDiscuss: onPlusDiscuss,
|
|
|
onSetActiveDiscussIndex: onSetActiveDiscussIndex,
|
|
|
onSetActionType: onSetActionType,
|
|
|
data: item,
|
|
|
index: index,
|
|
|
user: user,
|
|
|
activeDiscussIndex: activeDiscussIndex
|
|
|
});
|
|
|
})
|
|
|
}), count > 10 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "pagination-container mt10 mb10",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
showQuickJumper: true,
|
|
|
onChange: onPaginationChange,
|
|
|
current: page,
|
|
|
total: count,
|
|
|
showTotal: function showTotal(total) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#656F87'
|
|
|
},
|
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: total
|
|
|
}), "\u6761\u6570\u636E"]
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}) : null]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_input_editor, {
|
|
|
user_praise: hack.user_praise,
|
|
|
praise_count: hack.praises_count,
|
|
|
praisePlus: onTriggerPraise,
|
|
|
discuss_count: hack.comments_count,
|
|
|
onCreateDiscuss: onCreateDiscuss
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(components_modal/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
title: "\u63D0\u793A",
|
|
|
open: !!actionType,
|
|
|
onOk: onProcessAction,
|
|
|
onCancel: onCancelAction,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: actionType ? actionType.message : ''
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(image_preview/* default */.Z, {})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var FilterListmodules = ({"flex_box_center":"flex_box_center___tosr6","flex_space_between":"flex_space_between___cQaTP","flex_box_vertical_center":"flex_box_vertical_center___uovxL","flex_box_center_end":"flex_box_center_end___b4gLY","flex_box_column":"flex_box_column___Umjm_","flex-col":"flex-col___K66bF","flex-row":"flex-row___hLdBV","justify-start":"justify-start___MhQqv","justify-center":"justify-center___xOA32","justify-end":"justify-end___FmJvB","justify-evenly":"justify-evenly___HYApG","justify-around":"justify-around___asXSo","justify-between":"justify-between___LAMV0","align-start":"align-start___I3spn","align-center":"align-center___lmUwE","align-end":"align-end___iN99F","wrap":"wrap___sgoJE","head":"head___b9a9v","sort":"sort___L2Zw8","btn":"btn___khuE4","listWarp":"listWarp___zZj6C","pagination":"pagination___XlROP","fixedRight":"fixedRight___MuAXo","oj-width-input":"oj-width-input___RsZb6"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Listmodules = ({"flex_box_center":"flex_box_center___EahWI","flex_space_between":"flex_space_between___zopS4","flex_box_vertical_center":"flex_box_vertical_center___w03mz","flex_box_center_end":"flex_box_center_end___lr0Fp","flex_box_column":"flex_box_column___KFHVi","flex-col":"flex-col___HrhsJ","flex-row":"flex-row___MX6nx","justify-start":"justify-start___wkAVz","justify-center":"justify-center___TU5NO","justify-end":"justify-end___V4A35","justify-evenly":"justify-evenly___Blufs","justify-around":"justify-around___ae_LO","justify-between":"justify-between___xTfPu","align-start":"align-start___KGnbg","align-center":"align-center___uIjm1","align-end":"align-end___zqHtI","active":"active___BczOO","line":"line___VC_Ry","list":"list___n9ABd","left":"left___LVHqw","mask":"mask___fP13z","right":"right___iLe52","name":"name___Oz_7h","title":"title___2Sess","a":"a___t7rIW","b":"b___Kb_45","des":"des___CjMBM","tag":"tag___V0PVb"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/b.svg
|
|
|
function b_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = b_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function b_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return b_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return b_arrayLikeToArray(o, minLen); }
|
|
|
function b_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var b_defProp = Object.defineProperty;
|
|
|
var b_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var b_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var b_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var b_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? b_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var b_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (b_hasOwnProp.call(b, prop)) b_defNormalProp(a, prop, b[prop]);
|
|
|
if (b_getOwnPropSymbols) {
|
|
|
var _iterator = b_createForOfIteratorHelper(b_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (b_propIsEnum.call(b, prop)) b_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgB = function SvgB(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", b_spreadValues({
|
|
|
width: 12,
|
|
|
height: 10,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u89C2\u770B"), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M11 0a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h10ZM4.4 2.4a.4.4 0 0 0-.4.4v4.4a.4.4 0 0 0 .64.32l2.72-2.04a.6.6 0 0 0 0-.96L4.64 2.48a.4.4 0 0 0-.24-.08Z",
|
|
|
fill: "#FFF",
|
|
|
fillRule: "evenodd"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var b = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTExIDBhMSAxIDAgMCAxIDEgMXY4YTEgMSAwIDAgMS0xIDFIMWExIDEgMCAwIDEtMS0xVjFhMSAxIDAgMCAxIDEtMWgxMFpNNC40IDIuNGEuNC40IDAgMCAwLS40LjR2NC40YS40LjQgMCAwIDAgLjY0LjMybDIuNzItMi4wNGEuNi42IDAgMCAwIDAtLjk2TDQuNjQgMi40OGEuNC40IDAgMCAwLS4yNC0uMDhaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/c.svg
|
|
|
function c_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = c_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function c_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return c_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return c_arrayLikeToArray(o, minLen); }
|
|
|
function c_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var c_defProp = Object.defineProperty;
|
|
|
var c_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var c_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var c_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var c_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? c_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var c_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (c_hasOwnProp.call(b, prop)) c_defNormalProp(a, prop, b[prop]);
|
|
|
if (c_getOwnPropSymbols) {
|
|
|
var _iterator = c_createForOfIteratorHelper(c_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (c_propIsEnum.call(b, prop)) c_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgC = function SvgC(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", c_spreadValues({
|
|
|
width: 16,
|
|
|
height: 14,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u70B9\u8D5E1"), /* @__PURE__ */React.createElement("g", {
|
|
|
fillRule: "nonzero",
|
|
|
fill: "none"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M2.593 13.356V5.694c0-.31-.231-.561-.516-.561H.976c-.532 0-.962.468-.962 1.047v6.69c0 .579.43 1.047.962 1.047h1.101c.285 0 .516-.251.516-.561Z",
|
|
|
fill: "#999"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M3.335 13.512V5.53c0-.184.136-.346.333-.391.695-.16 2.289-.735 2.967-2.694C7.048.73 7.495-.08 8.823.017c1.328.097 1.417 1.263 1.417 1.618v2.752s-.107.42.34.453c.45.033 3.947 0 3.947 0s1.919-.029 1.309 2.122c-.53 1.871-1.58 4.882-1.846 5.635a1.606 1.606 0 0 1-.235.438c-.257.338-.796.88-1.62.88H3.782c-.247.002-.447-.179-.447-.403Z",
|
|
|
fill: "#CCC"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var c = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNMi41OTMgMTMuMzU2VjUuNjk0YzAtLjMxLS4yMzEtLjU2MS0uNTE2LS41NjFILjk3NmMtLjUzMiAwLS45NjIuNDY4LS45NjIgMS4wNDd2Ni42OWMwIC41NzkuNDMgMS4wNDcuOTYyIDEuMDQ3aDEuMTAxYy4yODUgMCAuNTE2LS4yNTEuNTE2LS41NjFaIiBmaWxsPSIjOTk5Ii8+PHBhdGggZD0iTTMuMzM1IDEzLjUxMlY1LjUzYzAtLjE4NC4xMzYtLjM0Ni4zMzMtLjM5MS42OTUtLjE2IDIuMjg5LS43MzUgMi45NjctMi42OTRDNy4wNDguNzMgNy40OTUtLjA4IDguODIzLjAxN2MxLjMyOC4wOTcgMS40MTcgMS4yNjMgMS40MTcgMS42MTh2Mi43NTJzLS4xMDcuNDIuMzQuNDUzYy40NS4wMzMgMy45NDcgMCAzLjk0NyAwczEuOTE5LS4wMjkgMS4zMDkgMi4xMjJjLS41MyAxLjg3MS0xLjU4IDQuODgyLTEuODQ2IDUuNjM1YTEuNjA2IDEuNjA2IDAgMCAxLS4yMzUuNDM4Yy0uMjU3LjMzOC0uNzk2Ljg4LTEuNjIuODhIMy43ODJjLS4yNDcuMDAyLS40NDctLjE3OS0uNDQ3LS40MDNaIiBmaWxsPSIjQ0NDIi8+PC9nPjwvc3ZnPg==");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/c1.svg
|
|
|
function c1_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = c1_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function c1_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return c1_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return c1_arrayLikeToArray(o, minLen); }
|
|
|
function c1_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var c1_defProp = Object.defineProperty;
|
|
|
var c1_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var c1_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var c1_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var c1_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? c1_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var c1_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (c1_hasOwnProp.call(b, prop)) c1_defNormalProp(a, prop, b[prop]);
|
|
|
if (c1_getOwnPropSymbols) {
|
|
|
var _iterator = c1_createForOfIteratorHelper(c1_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (c1_propIsEnum.call(b, prop)) c1_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgC1 = function SvgC1(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", c1_spreadValues({
|
|
|
width: 16,
|
|
|
height: 14,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u70B9\u8D5E2"), /* @__PURE__ */React.createElement("g", {
|
|
|
fillRule: "nonzero",
|
|
|
fill: "none"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M2.593 13.356V5.694c0-.31-.231-.561-.516-.561H.976c-.532 0-.962.468-.962 1.047v6.69c0 .579.43 1.047.962 1.047h1.101c.285 0 .516-.251.516-.561Z",
|
|
|
fill: "#0152d9"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M3.335 13.512V5.53c0-.184.136-.346.333-.391.695-.16 2.289-.735 2.967-2.694C7.048.73 7.495-.08 8.823.017c1.328.097 1.417 1.263 1.417 1.618v2.752s-.107.42.34.453c.45.033 3.947 0 3.947 0s1.919-.029 1.309 2.122c-.53 1.871-1.58 4.882-1.846 5.635a1.606 1.606 0 0 1-.235.438c-.257.338-.796.88-1.62.88H3.782c-.247.002-.447-.179-.447-.403Z",
|
|
|
fill: "#B6D0FC"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var c1 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNMi41OTMgMTMuMzU2VjUuNjk0YzAtLjMxLS4yMzEtLjU2MS0uNTE2LS41NjFILjk3NmMtLjUzMiAwLS45NjIuNDY4LS45NjIgMS4wNDd2Ni42OWMwIC41NzkuNDMgMS4wNDcuOTYyIDEuMDQ3aDEuMTAxYy4yODUgMCAuNTE2LS4yNTEuNTE2LS41NjFaIiBmaWxsPSIjMDE1MmQ5Ii8+PHBhdGggZD0iTTMuMzM1IDEzLjUxMlY1LjUzYzAtLjE4NC4xMzYtLjM0Ni4zMzMtLjM5MS42OTUtLjE2IDIuMjg5LS43MzUgMi45NjctMi42OTRDNy4wNDguNzMgNy40OTUtLjA4IDguODIzLjAxN2MxLjMyOC4wOTcgMS40MTcgMS4yNjMgMS40MTcgMS42MTh2Mi43NTJzLS4xMDcuNDIuMzQuNDUzYy40NS4wMzMgMy45NDcgMCAzLjk0NyAwczEuOTE5LS4wMjkgMS4zMDkgMi4xMjJjLS41MyAxLjg3MS0xLjU4IDQuODgyLTEuODQ2IDUuNjM1YTEuNjA2IDEuNjA2IDAgMCAxLS4yMzUuNDM4Yy0uMjU3LjMzOC0uNzk2Ljg4LTEuNjIuODhIMy43ODJjLS4yNDcuMDAyLS40NDctLjE3OS0uNDQ3LS40MDNaIiBmaWxsPSIjQjZEMEZDIi8+PC9nPjwvc3ZnPg==");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/d.svg
|
|
|
function d_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = d_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function d_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return d_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return d_arrayLikeToArray(o, minLen); }
|
|
|
function d_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var d_defProp = Object.defineProperty;
|
|
|
var d_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var d_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var d_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var d_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? d_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var d_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (d_hasOwnProp.call(b, prop)) d_defNormalProp(a, prop, b[prop]);
|
|
|
if (d_getOwnPropSymbols) {
|
|
|
var _iterator = d_createForOfIteratorHelper(d_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (d_propIsEnum.call(b, prop)) d_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgD = function SvgD(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", d_spreadValues({
|
|
|
width: 16,
|
|
|
height: 14,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u8BC4\u8BBA1"), /* @__PURE__ */React.createElement("g", {
|
|
|
fillRule: "nonzero",
|
|
|
fill: "none"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M4.717.01h8.84c1.571 0 2.357.777 2.357 2.332v5.25c0 1.556-.786 2.334-2.357 2.334h-8.84c-1.572 0-2.357-.778-2.357-2.334v-5.25C2.36.787 3.145.01 4.717.01Z",
|
|
|
fill: "#999"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M2.36 2.342h8.84a2.37 2.37 0 0 1 1.666.684c.442.437.69 1.03.69 1.65v5.25c0 1.288-1.055 2.333-2.357 2.333H7.94l-1.16 1.153-1.167-1.153H2.36a2.37 2.37 0 0 1-1.667-.683 2.321 2.321 0 0 1-.69-1.65v-5.25c0-.62.248-1.213.69-1.65a2.37 2.37 0 0 1 1.667-.684Z",
|
|
|
fill: "#B6D0FC"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M2.36 2.926h8.84c1.301 0 2.357 1.044 2.357 2.333v5.25c0 .619-.249 1.212-.69 1.65a2.37 2.37 0 0 1-1.668.683H7.94l-1.16 1.154-1.167-1.154H2.36a2.37 2.37 0 0 1-1.667-.683 2.321 2.321 0 0 1-.69-1.65V5.26c0-.619.248-1.212.69-1.65a2.37 2.37 0 0 1 1.667-.683Z",
|
|
|
fill: "#CCC"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M3.538 5.842h6.483c.393 0 .589.195.589.584 0 .389-.196.583-.59.583H3.539c-.393 0-.59-.194-.59-.583 0-.39.197-.584.59-.584ZM3.538 8.76h4.715c.393 0 .59.194.59.582 0 .39-.197.584-.59.584H3.538c-.393 0-.59-.195-.59-.584 0-.388.197-.583.59-.583Z",
|
|
|
fill: "#FFF"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var d = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNNC43MTcuMDFoOC44NGMxLjU3MSAwIDIuMzU3Ljc3NyAyLjM1NyAyLjMzMnY1LjI1YzAgMS41NTYtLjc4NiAyLjMzNC0yLjM1NyAyLjMzNGgtOC44NGMtMS41NzIgMC0yLjM1Ny0uNzc4LTIuMzU3LTIuMzM0di01LjI1QzIuMzYuNzg3IDMuMTQ1LjAxIDQuNzE3LjAxWiIgZmlsbD0iIzk5OSIvPjxwYXRoIGQ9Ik0yLjM2IDIuMzQyaDguODRhMi4zNyAyLjM3IDAgMCAxIDEuNjY2LjY4NGMuNDQyLjQzNy42OSAxLjAzLjY5IDEuNjV2NS4yNWMwIDEuMjg4LTEuMDU1IDIuMzMzLTIuMzU3IDIuMzMzSDcuOTRsLTEuMTYgMS4xNTMtMS4xNjctMS4xNTNIMi4zNmEyLjM3IDIuMzcgMCAwIDEtMS42NjctLjY4MyAyLjMyMSAyLjMyMSAwIDAgMS0uNjktMS42NXYtNS4yNWMwLS42Mi4yNDgtMS4yMTMuNjktMS42NWEyLjM3IDIuMzcgMCAwIDEgMS42NjctLjY4NFoiIGZpbGw9IiNCNkQwRkMiLz48cGF0aCBkPSJNMi4zNiAyLjkyNmg4Ljg0YzEuMzAxIDAgMi4zNTcgMS4wNDQgMi4zNTcgMi4zMzN2NS4yNWMwIC42MTktLjI0OSAxLjIxMi0uNjkgMS42NWEyLjM3IDIuMzcgMCAwIDEtMS42NjguNjgzSDcuOTRsLTEuMTYgMS4xNTQtMS4xNjctMS4xNTRIMi4zNmEyLjM3IDIuMzcgMCAwIDEtMS42NjctLjY4MyAyLjMyMSAyLjMyMSAwIDAgMS0uNjktMS42NVY1LjI2YzAtLjYxOS4yNDgtMS4yMTIuNjktMS42NWEyLjM3IDIuMzcgMCAwIDEgMS42NjctLjY4M1oiIGZpbGw9IiNDQ0MiLz48cGF0aCBkPSJNMy41MzggNS44NDJoNi40ODNjLjM5MyAwIC41ODkuMTk1LjU4OS41ODQgMCAuMzg5LS4xOTYuNTgzLS41OS41ODNIMy41MzljLS4zOTMgMC0uNTktLjE5NC0uNTktLjU4MyAwLS4zOS4xOTctLjU4NC41OS0uNTg0Wk0zLjUzOCA4Ljc2aDQuNzE1Yy4zOTMgMCAuNTkuMTk0LjU5LjU4MiAwIC4zOS0uMTk3LjU4NC0uNTkuNTg0SDMuNTM4Yy0uMzkzIDAtLjU5LS4xOTUtLjU5LS41ODQgMC0uMzg4LjE5Ny0uNTgzLjU5LS41ODNaIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/e.svg
|
|
|
function e_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = e_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function e_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return e_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return e_arrayLikeToArray(o, minLen); }
|
|
|
function e_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var e_defProp = Object.defineProperty;
|
|
|
var e_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var e_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var e_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var e_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? e_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var e_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (e_hasOwnProp.call(b, prop)) e_defNormalProp(a, prop, b[prop]);
|
|
|
if (e_getOwnPropSymbols) {
|
|
|
var _iterator = e_createForOfIteratorHelper(e_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (e_propIsEnum.call(b, prop)) e_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgE = function SvgE(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", e_spreadValues({
|
|
|
width: 16,
|
|
|
height: 12,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u67E5\u770B1"), /* @__PURE__ */React.createElement("g", {
|
|
|
fillRule: "nonzero",
|
|
|
fill: "none"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M7.965 11.961C2.593 11.961 0 6.926 0 5.981 0 5.035 2.623 0 7.965 0s7.965 4.984 7.965 5.98c0 .997-2.593 5.981-7.965 5.981Zm0-2.208c1.296 0 2.494-.72 3.142-1.886a3.902 3.902 0 0 0 0-3.773c-.648-1.167-1.846-1.886-3.142-1.886-2.004 0-3.629 1.69-3.629 3.773s1.625 3.772 3.629 3.772Z",
|
|
|
fill: "#CCC"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M7.965 8.28c-1.222 0-2.213-1.029-2.213-2.3 0-1.27.991-2.3 2.213-2.3s2.212 1.03 2.212 2.3c0 1.271-.99 2.3-2.212 2.3Z",
|
|
|
fill: "#999"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var e = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNNy45NjUgMTEuOTYxQzIuNTkzIDExLjk2MSAwIDYuOTI2IDAgNS45ODEgMCA1LjAzNSAyLjYyMyAwIDcuOTY1IDBzNy45NjUgNC45ODQgNy45NjUgNS45OGMwIC45OTctMi41OTMgNS45ODEtNy45NjUgNS45ODFabTAtMi4yMDhjMS4yOTYgMCAyLjQ5NC0uNzIgMy4xNDItMS44ODZhMy45MDIgMy45MDIgMCAwIDAgMC0zLjc3M2MtLjY0OC0xLjE2Ny0xLjg0Ni0xLjg4Ni0zLjE0Mi0xLjg4Ni0yLjAwNCAwLTMuNjI5IDEuNjktMy42MjkgMy43NzNzMS42MjUgMy43NzIgMy42MjkgMy43NzJaIiBmaWxsPSIjQ0NDIi8+PHBhdGggZD0iTTcuOTY1IDguMjhjLTEuMjIyIDAtMi4yMTMtMS4wMjktMi4yMTMtMi4zIDAtMS4yNy45OTEtMi4zIDIuMjEzLTIuM3MyLjIxMiAxLjAzIDIuMjEyIDIuM2MwIDEuMjcxLS45OSAyLjMtMi4yMTIgMi4zWiIgZmlsbD0iIzk5OSIvPjwvZz48L3N2Zz4=");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var List = function List(_ref) {
|
|
|
var _ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_onClick = _ref.onClick,
|
|
|
onAssist = _ref.onAssist,
|
|
|
onHide = _ref.onHide,
|
|
|
data = _ref.data,
|
|
|
active = _ref.active,
|
|
|
showLine = _ref.showLine;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: active === (data === null || data === void 0 ? void 0 : data.id) ? "".concat(Listmodules.list, " ").concat(Listmodules.active) : Listmodules.list,
|
|
|
style: style,
|
|
|
onClick: function onClick() {
|
|
|
return _onClick(data);
|
|
|
},
|
|
|
children: [(data === null || data === void 0 ? void 0 : data.video) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.left,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: data === null || data === void 0 ? void 0 : data.video_cover
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: b
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.video_duration
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Listmodules.mask
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.right,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.name,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.IMG_SERVER + '/images/' + (data === null || data === void 0 ? void 0 : data.image_url),
|
|
|
width: 30,
|
|
|
height: 30
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
title: data === null || data === void 0 ? void 0 : data.name,
|
|
|
className: Listmodules.title,
|
|
|
children: data === null || data === void 0 ? void 0 : data.name
|
|
|
}), (data === null || data === void 0 ? void 0 : data.is_authority) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Listmodules.b,
|
|
|
children: "\u5B98\u65B9"
|
|
|
}), (data === null || data === void 0 ? void 0 : data.is_excellent) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Listmodules.a,
|
|
|
children: "\u7CBE\u9009"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Listmodules.des,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
showLines: 2,
|
|
|
showTextOnly: true,
|
|
|
value: (data === null || data === void 0 ? void 0 : data.content) || '暂无内容'
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Listmodules.tag,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "current",
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
onAssist(data);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: data !== null && data !== void 0 && data.user_liker ? c1 : c
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: data !== null && data !== void 0 && data.user_liker ? '#0152d9' : '#656f87'
|
|
|
},
|
|
|
children: data === null || data === void 0 ? void 0 : data.praises_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: d
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.discusses_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: e
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.viewed_count
|
|
|
})]
|
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "current",
|
|
|
style: {
|
|
|
color: '#0152d9',
|
|
|
marginRight: 0,
|
|
|
userSelect: 'none'
|
|
|
},
|
|
|
onClick: function onClick(e) {
|
|
|
e.stopPropagation();
|
|
|
onHide(data);
|
|
|
},
|
|
|
children: data !== null && data !== void 0 && data.is_hidden ? '取消隐藏' : '隐藏'
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), showLine && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Listmodules.line
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var FilterList_List = (List);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var ListFormmodules = ({"flex_box_center":"flex_box_center___C6sVF","flex_space_between":"flex_space_between___VEt8l","flex_box_vertical_center":"flex_box_vertical_center___qeD5F","flex_box_center_end":"flex_box_center_end___iYJd9","flex_box_column":"flex_box_column___iAKJf","flex-col":"flex-col___rKpNH","flex-row":"flex-row___Qu29h","justify-start":"justify-start___lceju","justify-center":"justify-center___P4l34","justify-end":"justify-end___mY0hr","justify-evenly":"justify-evenly___BnS2V","justify-around":"justify-around___c8gjx","justify-between":"justify-between___R2BdN","align-start":"align-start___I5_So","align-center":"align-center___PXyM3","align-end":"align-end___SEBIk","listForm":"listForm___leDJL","scroll":"scroll___wtFaF","formWrap":"formWrap___p3W41","btns":"btns___Izl4q","main":"main___xTqlG","mainLoading":"mainLoading___QLa9s","tip":"tip___a0tbY","proWarp":"proWarp___BZhOt","pro":"pro___Yp1Rx","mainSucceed":"mainSucceed___HfaTf","del":"del___TXGhB"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/v.svg
|
|
|
function v_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = v_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function v_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return v_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return v_arrayLikeToArray(o, minLen); }
|
|
|
function v_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var v_defProp = Object.defineProperty;
|
|
|
var v_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var v_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var v_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var v_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? v_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var v_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (v_hasOwnProp.call(b, prop)) v_defNormalProp(a, prop, b[prop]);
|
|
|
if (v_getOwnPropSymbols) {
|
|
|
var _iterator = v_createForOfIteratorHelper(v_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (v_propIsEnum.call(b, prop)) v_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgV = function SvgV(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", v_spreadValues({
|
|
|
width: 32,
|
|
|
height: 30,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u4E0A\u4F20\u89C6\u9891"), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M1.6 0C1.175 0 .768.17.468.474A1.63 1.63 0 0 0 0 1.622v3.243h3.237L7.378 0H1.6Zm7.876 0L5.338 4.865h5.9L15.371 0H9.476Zm7.998 0-4.137 4.865h5.896L23.372 0h-5.898Zm8 0-4.138 4.865h6.66V1.622a1.629 1.629 0 0 0-.467-1.148A1.585 1.585 0 0 0 26.397 0h-.924ZM0 6.487v17.837c0 .43.167.844.468 1.148.3.305.707.475 1.132.474h18.61a6.515 6.515 0 0 1 1.652-6.218 6.31 6.31 0 0 1 6.134-1.675V6.487H0Zm11.998 5.675 6.4 4.056-6.4 4.055v-8.11Zm14.399 6.487c-3.092.002-5.597 2.544-5.595 5.678.001 3.134 2.508 5.674 5.6 5.673C29.494 30 32 27.458 32 24.324c0-1.506-.59-2.95-1.641-4.014a5.561 5.561 0 0 0-3.962-1.661Zm0 2.027c.22.003.428.1.574.266.663.6 1.327 1.352 1.99 2.002a.8.8 0 0 1 0 1.14.788.788 0 0 1-1.125 0l-.638-.646v3.724a.814.814 0 0 1-.392.724.79.79 0 0 1-.815 0 .814.814 0 0 1-.392-.724v-3.724l-.637.646a.79.79 0 0 1-.773.215.803.803 0 0 1-.567-.575.816.816 0 0 1 .212-.783c.651-.664 1.333-1.388 1.99-2.002a.778.778 0 0 1 .575-.266l-.002.003Z",
|
|
|
fill: "#0152d9",
|
|
|
fillRule: "nonzero"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var v = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNiAwQzEuMTc1IDAgLjc2OC4xNy40NjguNDc0QTEuNjMgMS42MyAwIDAgMCAwIDEuNjIydjMuMjQzaDMuMjM3TDcuMzc4IDBIMS42Wm03Ljg3NiAwTDUuMzM4IDQuODY1aDUuOUwxNS4zNzEgMEg5LjQ3NlptNy45OTggMC00LjEzNyA0Ljg2NWg1Ljg5NkwyMy4zNzIgMGgtNS44OThabTggMC00LjEzOCA0Ljg2NWg2LjY2VjEuNjIyYTEuNjI5IDEuNjI5IDAgMCAwLS40NjctMS4xNDhBMS41ODUgMS41ODUgMCAwIDAgMjYuMzk3IDBoLS45MjRaTTAgNi40ODd2MTcuODM3YzAgLjQzLjE2Ny44NDQuNDY4IDEuMTQ4LjMuMzA1LjcwNy40NzUgMS4xMzIuNDc0aDE4LjYxYTYuNTE1IDYuNTE1IDAgMCAxIDEuNjUyLTYuMjE4IDYuMzEgNi4zMSAwIDAgMSA2LjEzNC0xLjY3NVY2LjQ4N0gwWm0xMS45OTggNS42NzUgNi40IDQuMDU2LTYuNCA0LjA1NXYtOC4xMVptMTQuMzk5IDYuNDg3Yy0zLjA5Mi4wMDItNS41OTcgMi41NDQtNS41OTUgNS42NzguMDAxIDMuMTM0IDIuNTA4IDUuNjc0IDUuNiA1LjY3M0MyOS40OTQgMzAgMzIgMjcuNDU4IDMyIDI0LjMyNGMwLTEuNTA2LS41OS0yLjk1LTEuNjQxLTQuMDE0YTUuNTYxIDUuNTYxIDAgMCAwLTMuOTYyLTEuNjYxWm0wIDIuMDI3Yy4yMi4wMDMuNDI4LjEuNTc0LjI2Ni42NjMuNiAxLjMyNyAxLjM1MiAxLjk5IDIuMDAyYS44LjggMCAwIDEgMCAxLjE0Ljc4OC43ODggMCAwIDEtMS4xMjUgMGwtLjYzOC0uNjQ2djMuNzI0YS44MTQuODE0IDAgMCAxLS4zOTIuNzI0Ljc5Ljc5IDAgMCAxLS44MTUgMCAuODE0LjgxNCAwIDAgMS0uMzkyLS43MjR2LTMuNzI0bC0uNjM3LjY0NmEuNzkuNzkgMCAwIDEtLjc3My4yMTUuODAzLjgwMyAwIDAgMS0uNTY3LS41NzUuODE2LjgxNiAwIDAgMSAuMjEyLS43ODNjLjY1MS0uNjY0IDEuMzMzLTEuMzg4IDEuOTktMi4wMDJhLjc3OC43NzggMCAwIDEgLjU3NS0uMjY2bC0uMDAyLjAwM1oiIGZpbGw9IiMwMTUyZDkiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/s.svg
|
|
|
function s_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = s_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function s_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return s_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return s_arrayLikeToArray(o, minLen); }
|
|
|
function s_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var s_defProp = Object.defineProperty;
|
|
|
var s_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var s_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var s_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var s_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? s_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var s_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (s_hasOwnProp.call(b, prop)) s_defNormalProp(a, prop, b[prop]);
|
|
|
if (s_getOwnPropSymbols) {
|
|
|
var _iterator = s_createForOfIteratorHelper(s_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (s_propIsEnum.call(b, prop)) s_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgS = function SvgS(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", s_spreadValues({
|
|
|
width: 30,
|
|
|
height: 30,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u4E0A\u4F20\u6210\u529F"), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M15 0c8.285 0 15 6.717 15 15 0 8.285-6.715 15-15 15-8.283 0-15-6.715-15-15C0 6.717 6.717 0 15 0Zm10.041 7.5v.01a47.934 47.934 0 0 0-11.232 9.386l-4.372-3.3v-.002L7.5 15.08l7.553 7.42A44.625 44.625 0 0 1 25.5 8.55l-.459-1.05Z",
|
|
|
fill: "#44D7B6",
|
|
|
fillRule: "nonzero"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var s = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDBjOC4yODUgMCAxNSA2LjcxNyAxNSAxNSAwIDguMjg1LTYuNzE1IDE1LTE1IDE1LTguMjgzIDAtMTUtNi43MTUtMTUtMTVDMCA2LjcxNyA2LjcxNyAwIDE1IDBabTEwLjA0MSA3LjV2LjAxYTQ3LjkzNCA0Ny45MzQgMCAwIDAtMTEuMjMyIDkuMzg2bC00LjM3Mi0zLjN2LS4wMDJMNy41IDE1LjA4bDcuNTUzIDcuNDJBNDQuNjI1IDQ0LjYyNSAwIDAgMSAyNS41IDguNTVsLS40NTktMS4wNVoiIGZpbGw9IiM0NEQ3QjYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/t.svg
|
|
|
function t_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = t_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function t_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return t_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return t_arrayLikeToArray(o, minLen); }
|
|
|
function t_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var t_defProp = Object.defineProperty;
|
|
|
var t_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var t_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var t_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var t_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? t_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var t_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (t_hasOwnProp.call(b, prop)) t_defNormalProp(a, prop, b[prop]);
|
|
|
if (t_getOwnPropSymbols) {
|
|
|
var _iterator = t_createForOfIteratorHelper(t_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (t_propIsEnum.call(b, prop)) t_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgT = function SvgT(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", t_spreadValues({
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
width: 20,
|
|
|
height: 20
|
|
|
}, props), /* @__PURE__ */React.createElement("path", {
|
|
|
fill: "#AFBACB",
|
|
|
d: "M9.99.02C4.482.02.02 4.482.02 9.99c0 5.506 4.463 9.97 9.97 9.97 5.506 0 9.97-4.464 9.97-9.97 0-5.507-4.464-9.97-9.97-9.97Zm1.636 13.69c-.744 1.19-1.488 2.083-2.827 2.083-.893-.149-1.19-.744-1.042-1.488l1.637-5.506c0-.149 0-.298-.149-.298-.148 0-.446 0-.595.298l-1.042 1.19v-.744c.745-1.19 1.935-2.083 2.828-2.083.744.149 1.19.744 1.042 1.488L9.84 14.305c0 .149 0 .298.148.298.15 0 .447-.15.596-.298l1.041-1.34v.745Zm-.297-7.292c-.596 0-1.19-.446-1.19-1.19 0-.745.446-1.191 1.19-1.191.595 0 1.19.446 1.19 1.19 0 .745-.595 1.191-1.19 1.191Z"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var t = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PHBhdGggZmlsbD0iI0FGQkFDQiIgZD0iTTkuOTkuMDJDNC40ODIuMDIuMDIgNC40ODIuMDIgOS45OWMwIDUuNTA2IDQuNDYzIDkuOTcgOS45NyA5Ljk3IDUuNTA2IDAgOS45Ny00LjQ2NCA5Ljk3LTkuOTcgMC01LjUwNy00LjQ2NC05Ljk3LTkuOTctOS45N1ptMS42MzYgMTMuNjljLS43NDQgMS4xOS0xLjQ4OCAyLjA4My0yLjgyNyAyLjA4My0uODkzLS4xNDktMS4xOS0uNzQ0LTEuMDQyLTEuNDg4bDEuNjM3LTUuNTA2YzAtLjE0OSAwLS4yOTgtLjE0OS0uMjk4LS4xNDggMC0uNDQ2IDAtLjU5NS4yOThsLTEuMDQyIDEuMTl2LS43NDRjLjc0NS0xLjE5IDEuOTM1LTIuMDgzIDIuODI4LTIuMDgzLjc0NC4xNDkgMS4xOS43NDQgMS4wNDIgMS40ODhMOS44NCAxNC4zMDVjMCAuMTQ5IDAgLjI5OC4xNDguMjk4LjE1IDAgLjQ0Ny0uMTUuNTk2LS4yOThsMS4wNDEtMS4zNHYuNzQ1Wm0tLjI5Ny03LjI5MmMtLjU5NiAwLTEuMTktLjQ0Ni0xLjE5LTEuMTkgMC0uNzQ1LjQ0Ni0xLjE5MSAxLjE5LTEuMTkxLjU5NSAwIDEuMTkuNDQ2IDEuMTkgMS4xOSAwIC43NDUtLjU5NSAxLjE5MS0xLjE5IDEuMTkxWiIvPjwvc3ZnPg==");
|
|
|
// EXTERNAL MODULE: ./src/components/ChunkedUpload/index.tsx + 1 modules
|
|
|
var ChunkedUpload = __webpack_require__(15473);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ListForm_List = function List(_ref) {
|
|
|
var _user$userInfo, _formValue$name;
|
|
|
var onClose = _ref.onClose,
|
|
|
onOk = _ref.onOk,
|
|
|
identifier = _ref.identifier,
|
|
|
active = _ref.active;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
formValue = _useState2[0],
|
|
|
setFormValue = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isLoading = _useState4[0],
|
|
|
setIsLoading = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
btnLoading = _useState6[0],
|
|
|
setBtnLoading = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
videoList = _useState8[0],
|
|
|
setVideoList = _useState8[1];
|
|
|
|
|
|
// const [data, setData] = useState<any>({});
|
|
|
var user = (0,authority/* userInfo */.eY)();
|
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
|
var uploader = (0,_react_17_0_2_react.useRef)();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (active) {
|
|
|
getData();
|
|
|
}
|
|
|
}, [active]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res, _res$data, _res$data2, _res$data3, value, _res$data4, _res$data5;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,service/* editArticlesDetails */.M3)(identifier, {
|
|
|
active: active
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
value = {
|
|
|
name: res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.name,
|
|
|
content: res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.content
|
|
|
};
|
|
|
form.setFieldsValue(value);
|
|
|
setFormValue(value);
|
|
|
if (res !== null && res !== void 0 && (_res$data3 = res.data) !== null && _res$data3 !== void 0 && (_res$data3 = _res$data3.videos) !== null && _res$data3 !== void 0 && _res$data3[0]) {
|
|
|
setVideoList([{
|
|
|
video_id: res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 || (_res$data4 = _res$data4.videos) === null || _res$data4 === void 0 || (_res$data4 = _res$data4[0]) === null || _res$data4 === void 0 ? void 0 : _res$data4.video_id,
|
|
|
name: res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5.videos) === null || _res$data5 === void 0 || (_res$data5 = _res$data5[0]) === null || _res$data5 === void 0 ? void 0 : _res$data5.title,
|
|
|
loaded: 100
|
|
|
}]);
|
|
|
}
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleValuesChange = function handleValuesChange(changeValues, values) {
|
|
|
setFormValue(objectSpread2_default()({}, values));
|
|
|
};
|
|
|
var handleFinish = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
|
|
|
var _res;
|
|
|
var sendData, res, _res2, _res3;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
sendData = {
|
|
|
videos: videoList,
|
|
|
articles: values
|
|
|
};
|
|
|
setBtnLoading(true);
|
|
|
if (!active) {
|
|
|
_context2.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
sendData.active = active;
|
|
|
_context2.next = 6;
|
|
|
return (0,service/* editArticles */.gu)(identifier, sendData);
|
|
|
case 6:
|
|
|
res = _context2.sent;
|
|
|
_context2.next = 12;
|
|
|
break;
|
|
|
case 9:
|
|
|
_context2.next = 11;
|
|
|
return (0,service/* addArticles */.bx)(identifier, sendData);
|
|
|
case 11:
|
|
|
res = _context2.sent;
|
|
|
case 12:
|
|
|
if (((_res = res) === null || _res === void 0 ? void 0 : _res.status) === 0) {
|
|
|
console.log(active || ((_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.id), 44);
|
|
|
onOk(active || ((_res3 = res) === null || _res3 === void 0 ? void 0 : _res3.id));
|
|
|
}
|
|
|
setBtnLoading(false);
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleFinish(_x) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleRemove = function handleRemove(name, isSuccess) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
children: ["\u60A8\u786E\u8BA4\u8981", isSuccess ? '删除' : '取消上传', "\u8BE5\u89C6\u9891\u5417\uFF1F"]
|
|
|
}),
|
|
|
onOk: function onOk() {
|
|
|
if (isSuccess) {
|
|
|
setVideoList([]);
|
|
|
} else {
|
|
|
uploader.current.cancel();
|
|
|
setVideoList([]);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var renderUpload = function renderUpload() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(ChunkedUpload/* default */.Z, objectSpread2_default()(objectSpread2_default()({}, uploadProps), {}, {
|
|
|
ref: uploader,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.main,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: v,
|
|
|
alt: ""
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u4E0A\u4F20\u89C6\u9891"
|
|
|
})]
|
|
|
})
|
|
|
}));
|
|
|
};
|
|
|
var renderUploadLoading = function renderUploadLoading(num) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.mainLoading,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.proWarp,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListFormmodules.pro,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
width: num
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [num || 0, "%"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
children: "\u4E0A\u4F20\u4E2D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListFormmodules.tip,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
|
return trigger.parentNode;
|
|
|
},
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: "current c-light-primary",
|
|
|
target: "_blank",
|
|
|
href: "/users/innov/videos/protocol",
|
|
|
children: "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"
|
|
|
}), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"
|
|
|
})]
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: t,
|
|
|
alt: ""
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderSucceed = function renderSucceed(item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.mainSucceed,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: s,
|
|
|
alt: ""
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u4E0A\u4F20\u6210\u529F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListFormmodules.tip,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
|
return trigger.parentNode;
|
|
|
},
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: "current c-light-primary",
|
|
|
target: "_blank",
|
|
|
href: "/users/innov/videos/protocol",
|
|
|
children: "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"
|
|
|
}), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: "3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B"
|
|
|
})]
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: t,
|
|
|
alt: ""
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.del,
|
|
|
onClick: function onClick() {
|
|
|
return handleRemove(item.name, item.loaded == 100);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shanchu7 mr5"
|
|
|
}), "\u5220\u9664\u89C6\u9891"]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderFile = function renderFile() {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
|
children: videoList === null || videoList === void 0 ? void 0 : videoList.map(function (item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
|
children: item.loaded == 100 ? renderSucceed(item) : renderUploadLoading(item.loaded)
|
|
|
}, index);
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var handleClose = function handleClose() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
width: 500,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '注意',
|
|
|
icon: null,
|
|
|
className: 'custom-modal-divider',
|
|
|
content: '您正在编写题解,点击关闭后,您的题解内容将不会进行保存。',
|
|
|
onOk: onClose
|
|
|
});
|
|
|
};
|
|
|
var handleChangeUpload = function handleChangeUpload(file) {
|
|
|
var MAX_FILE_SIZE = 1024;
|
|
|
var fileName = file.name.toLowerCase();
|
|
|
if (fileName && fileName.indexOf('.avi') == -1 && fileName.indexOf('.flv') == -1 && fileName.indexOf('.f4v') == -1 && fileName.indexOf('.m4v') == -1 && fileName.indexOf('.mov') == -1 && fileName.indexOf('.mp4') == -1 && fileName.indexOf('.rmvb') == -1 && fileName.indexOf('.swf') == -1 && fileName.indexOf('.webm') == -1 && fileName.indexOf('.wmv') == -1) {
|
|
|
message/* default */.ZP.info("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F");
|
|
|
return true;
|
|
|
}
|
|
|
if (file.size > MAX_FILE_SIZE * 1024 * 1024) {
|
|
|
message/* default */.ZP.info("\u89C6\u9891\u5927\u5C0F\u8D85\u8FC71G");
|
|
|
return true;
|
|
|
}
|
|
|
if (videoList !== null && videoList !== void 0 && videoList.find(function (item) {
|
|
|
return item.name === file.name;
|
|
|
})) {
|
|
|
message/* default */.ZP.info("\u4F60\u4E0D\u80FD\u4E0A\u4F20\u540C\u4E00\u4E2A\u89C6\u9891\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002");
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
};
|
|
|
var uploadProps = {
|
|
|
accept: '.mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*',
|
|
|
onBefore: handleChangeUpload,
|
|
|
onBeginInitFile: function onBeginInitFile(v) {
|
|
|
setVideoList([{
|
|
|
name: v.filename,
|
|
|
loaded: 0
|
|
|
}]);
|
|
|
},
|
|
|
onComplete: function onComplete(v) {
|
|
|
setVideoList([{
|
|
|
name: v.filename,
|
|
|
loaded: v.percent,
|
|
|
video_id: v.id
|
|
|
}]);
|
|
|
},
|
|
|
onError: function onError() {
|
|
|
setVideoList([]);
|
|
|
},
|
|
|
onProgress: function onProgress(v) {
|
|
|
setVideoList([{
|
|
|
name: v.filename,
|
|
|
loaded: v.percent
|
|
|
}]);
|
|
|
},
|
|
|
chunkSize: 1024 * 1024 * 2,
|
|
|
// 2MB
|
|
|
options: {
|
|
|
user_id: user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.user_id
|
|
|
}
|
|
|
};
|
|
|
var hasFile = videoList === null || videoList === void 0 ? void 0 : videoList.length;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.listForm,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("header", {
|
|
|
children: [active ? '编辑' : '发布', "\u9898\u89E3"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: ListFormmodules.scroll,
|
|
|
id: "sss",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.formWrap,
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
scrollToFirstError: true,
|
|
|
layout: "vertical",
|
|
|
onValuesChange: handleValuesChange,
|
|
|
onFinish: handleFinish,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "name",
|
|
|
label: "\u6807\u9898:",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入名称'
|
|
|
}, {
|
|
|
max: 60,
|
|
|
message: '请输入名称,最大限制60个字符'
|
|
|
}, {
|
|
|
whitespace: true,
|
|
|
message: '请勿输入空格'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
bordered: false,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",
|
|
|
suffix: "".concat(((_formValue$name = formValue.name) === null || _formValue$name === void 0 ? void 0 : _formValue$name.length) || 0, "/60")
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "content",
|
|
|
label: "\u5185\u5BB9:",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
defaultValue: formValue.content || '',
|
|
|
watch: true
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListFormmodules.upload,
|
|
|
children: hasFile ? renderFile() : renderUpload()
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListFormmodules.btns,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: handleClose,
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
children: "\u5173\u95ED"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
loading: btnLoading,
|
|
|
disabled: isLoading,
|
|
|
onClick: function onClick() {
|
|
|
return form.submit();
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: "\u53D1\u5E03\u9898\u89E3"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ListForm = (ListForm_List);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var ListDetailsmodules = ({"flex_box_center":"flex_box_center___Udvu8","flex_space_between":"flex_space_between___WNLp1","flex_box_vertical_center":"flex_box_vertical_center___ecch5","flex_box_center_end":"flex_box_center_end___cu_DJ","flex_box_column":"flex_box_column___zF2CU","flex-col":"flex-col___IYjfp","flex-row":"flex-row___K1Yy5","justify-start":"justify-start___B4Vd9","justify-center":"justify-center___j2p2G","justify-end":"justify-end___H6cy1","justify-evenly":"justify-evenly___fhtpi","justify-around":"justify-around___Mh351","justify-between":"justify-between___CLIGf","align-start":"align-start___eVB_9","align-center":"align-center___d80w3","align-end":"align-end___EG8yz","listDetails":"listDetails___HpDwH","head":"head___wipEz","name":"name___qdH8S","title":"title___B0yUa","a":"a___LB6ZS","b":"b___yvOON","tag":"tag___bRCso","btn":"btn___akBxg","scroll":"scroll___JKC_q","video":"video___nEr4F","html":"html___GDNSx","g":"g___LSOhO","btns":"btns___Ci727"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
|
var skeleton = __webpack_require__(61621);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/jx.svg
|
|
|
function jx_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = jx_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function jx_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return jx_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return jx_arrayLikeToArray(o, minLen); }
|
|
|
function jx_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var jx_defProp = Object.defineProperty;
|
|
|
var jx_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var jx_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var jx_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var jx_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? jx_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var jx_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (jx_hasOwnProp.call(b, prop)) jx_defNormalProp(a, prop, b[prop]);
|
|
|
if (jx_getOwnPropSymbols) {
|
|
|
var _iterator = jx_createForOfIteratorHelper(jx_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (jx_propIsEnum.call(b, prop)) jx_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgJx = function SvgJx(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", jx_spreadValues({
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
|
width: 15,
|
|
|
height: 16
|
|
|
}, props), /* @__PURE__ */React.createElement("defs", null, /* @__PURE__ */React.createElement("path", {
|
|
|
id: "jx_svg__a",
|
|
|
d: "M6.385.257c.616-.343 1.616-.342 2.23 0l5.27 2.94C14.501 3.538 15 4.38 15 5.071v5.856c0 .692-.501 1.533-1.115 1.876l-5.27 2.939c-.616.343-1.616.342-2.23 0l-5.27-2.94C.499 12.462 0 11.622 0 10.929V5.072C0 4.38.501 3.54 1.115 3.196Zm1.423 3.817c-.169-.341-.446-.341-.615 0L6.38 5.717c-.169.341-.616.665-.994.72l-1.82.264c-.378.055-.464.317-.19.583l1.317 1.278c.273.266.444.79.38 1.165l-.31 1.806c-.066.376.158.538.496.36l1.628-.853c.338-.177.89-.177 1.23 0l1.627.853c.337.177.561.015.497-.36l-.31-1.806c-.065-.375.105-.899.379-1.165l1.316-1.278c.274-.266.188-.529-.19-.583l-1.819-.264c-.377-.054-.825-.378-.994-.72Z"
|
|
|
})), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "none",
|
|
|
fillRule: "evenodd"
|
|
|
}, /* @__PURE__ */React.createElement("mask", {
|
|
|
id: "jx_svg__b",
|
|
|
fill: "#fff"
|
|
|
}, /* @__PURE__ */React.createElement("use", {
|
|
|
xlinkHref: "#jx_svg__a"
|
|
|
})), /* @__PURE__ */React.createElement("use", {
|
|
|
fill: "#8DC9FF",
|
|
|
fillRule: "nonzero",
|
|
|
xlinkHref: "#jx_svg__a"
|
|
|
}), /* @__PURE__ */React.createElement("circle", {
|
|
|
cx: -1.5,
|
|
|
cy: -3.5,
|
|
|
r: 16.5,
|
|
|
fill: "#C1E2FF",
|
|
|
fillRule: "nonzero",
|
|
|
mask: "url(#jx_svg__b)"
|
|
|
}), /* @__PURE__ */React.createElement("circle", {
|
|
|
cx: -2.5,
|
|
|
cy: -4.5,
|
|
|
r: 12.5,
|
|
|
fill: "#EEF7FF",
|
|
|
fillRule: "nonzero",
|
|
|
mask: "url(#jx_svg__b)"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var jx = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTUiIGhlaWdodD0iMTYiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNNi4zODUuMjU3Yy42MTYtLjM0MyAxLjYxNi0uMzQyIDIuMjMgMGw1LjI3IDIuOTRDMTQuNTAxIDMuNTM4IDE1IDQuMzggMTUgNS4wNzF2NS44NTZjMCAuNjkyLS41MDEgMS41MzMtMS4xMTUgMS44NzZsLTUuMjcgMi45MzljLS42MTYuMzQzLTEuNjE2LjM0Mi0yLjIzIDBsLTUuMjctMi45NEMuNDk5IDEyLjQ2MiAwIDExLjYyMiAwIDEwLjkyOVY1LjA3MkMwIDQuMzguNTAxIDMuNTQgMS4xMTUgMy4xOTZabTEuNDIzIDMuODE3Yy0uMTY5LS4zNDEtLjQ0Ni0uMzQxLS42MTUgMEw2LjM4IDUuNzE3Yy0uMTY5LjM0MS0uNjE2LjY2NS0uOTk0LjcybC0xLjgyLjI2NGMtLjM3OC4wNTUtLjQ2NC4zMTctLjE5LjU4M2wxLjMxNyAxLjI3OGMuMjczLjI2Ni40NDQuNzkuMzggMS4xNjVsLS4zMSAxLjgwNmMtLjA2Ni4zNzYuMTU4LjUzOC40OTYuMzZsMS42MjgtLjg1M2MuMzM4LS4xNzcuODktLjE3NyAxLjIzIDBsMS42MjcuODUzYy4zMzcuMTc3LjU2MS4wMTUuNDk3LS4zNmwtLjMxLTEuODA2Yy0uMDY1LS4zNzUuMTA1LS44OTkuMzc5LTEuMTY1bDEuMzE2LTEuMjc4Yy4yNzQtLjI2Ni4xODgtLjUyOS0uMTktLjU4M2wtMS44MTktLjI2NGMtLjM3Ny0uMDU0LS44MjUtLjM3OC0uOTk0LS43MloiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48dXNlIGZpbGw9IiM4REM5RkYiIGZpbGwtcnVsZT0ibm9uemVybyIgeGxpbms6aHJlZj0iI2EiLz48Y2lyY2xlIGN4PSItMS41IiBjeT0iLTMuNSIgcj0iMTYuNSIgZmlsbD0iI0MxRTJGRiIgZmlsbC1ydWxlPSJub256ZXJvIiBtYXNrPSJ1cmwoI2IpIi8+PGNpcmNsZSBjeD0iLTIuNSIgY3k9Ii00LjUiIHI9IjEyLjUiIGZpbGw9IiNFRUY3RkYiIGZpbGwtcnVsZT0ibm9uemVybyIgbWFzaz0idXJsKCNiKSIvPjwvZz48L3N2Zz4=");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/gf.svg
|
|
|
function gf_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = gf_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function gf_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return gf_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return gf_arrayLikeToArray(o, minLen); }
|
|
|
function gf_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var gf_defProp = Object.defineProperty;
|
|
|
var gf_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var gf_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var gf_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var gf_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? gf_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var gf_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (gf_hasOwnProp.call(b, prop)) gf_defNormalProp(a, prop, b[prop]);
|
|
|
if (gf_getOwnPropSymbols) {
|
|
|
var _iterator = gf_createForOfIteratorHelper(gf_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (gf_propIsEnum.call(b, prop)) gf_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgGf = function SvgGf(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", gf_spreadValues({
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
|
width: 16,
|
|
|
height: 16
|
|
|
}, props), /* @__PURE__ */React.createElement("defs", null, /* @__PURE__ */React.createElement("path", {
|
|
|
id: "gf_svg__a",
|
|
|
d: "m8 0 1.857 1.073h2.146l1.071 1.854L14.931 4v2.144L16 8l-1.069 1.857V12l-1.858 1.072-1.071 1.856H9.857L8 16l-1.855-1.073H4l-1.072-1.856L1.072 12V9.857L0 8l1.072-1.856V4l1.857-1.073 1.072-1.854h2.145L8 0Zm2.91 6.385H4.796V12h1.246v-.451h4.026v.435h1.247V9.196H6.043v-.515h4.866V6.385Zm-.84 3.681v.613H6.042v-.613h4.026ZM9.705 7.24v.588H6.043v-.588h3.663ZM8.615 4l-1.48.137c.055.133.12.284.192.453l.076.175H4v1.426h1.195v-.483h5.61v.483H12V4.765H8.883c-.078-.23-.148-.43-.21-.602L8.616 4Z"
|
|
|
})), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "none",
|
|
|
fillRule: "evenodd"
|
|
|
}, /* @__PURE__ */React.createElement("mask", {
|
|
|
id: "gf_svg__b",
|
|
|
fill: "#fff"
|
|
|
}, /* @__PURE__ */React.createElement("use", {
|
|
|
xlinkHref: "#gf_svg__a"
|
|
|
})), /* @__PURE__ */React.createElement("use", {
|
|
|
fill: "#8DC9FF",
|
|
|
fillRule: "nonzero",
|
|
|
xlinkHref: "#gf_svg__a"
|
|
|
}), /* @__PURE__ */React.createElement("circle", {
|
|
|
cx: 0.5,
|
|
|
cy: -3.5,
|
|
|
r: 16.5,
|
|
|
fill: "#C1E2FF",
|
|
|
fillRule: "nonzero",
|
|
|
mask: "url(#gf_svg__b)"
|
|
|
}), /* @__PURE__ */React.createElement("circle", {
|
|
|
cx: -0.5,
|
|
|
cy: -4.5,
|
|
|
r: 12.5,
|
|
|
fill: "#EEF7FF",
|
|
|
fillRule: "nonzero",
|
|
|
mask: "url(#gf_svg__b)"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var gf = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJtOCAwIDEuODU3IDEuMDczaDIuMTQ2bDEuMDcxIDEuODU0TDE0LjkzMSA0djIuMTQ0TDE2IDhsLTEuMDY5IDEuODU3VjEybC0xLjg1OCAxLjA3Mi0xLjA3MSAxLjg1Nkg5Ljg1N0w4IDE2bC0xLjg1NS0xLjA3M0g0bC0xLjA3Mi0xLjg1NkwxLjA3MiAxMlY5Ljg1N0wwIDhsMS4wNzItMS44NTZWNGwxLjg1Ny0xLjA3MyAxLjA3Mi0xLjg1NGgyLjE0NUw4IDBabTIuOTEgNi4zODVINC43OTZWMTJoMS4yNDZ2LS40NTFoNC4wMjZ2LjQzNWgxLjI0N1Y5LjE5Nkg2LjA0M3YtLjUxNWg0Ljg2NlY2LjM4NVptLS44NCAzLjY4MXYuNjEzSDYuMDQydi0uNjEzaDQuMDI2Wk05LjcwNSA3LjI0di41ODhINi4wNDN2LS41ODhoMy42NjNaTTguNjE1IDRsLTEuNDguMTM3Yy4wNTUuMTMzLjEyLjI4NC4xOTIuNDUzbC4wNzYuMTc1SDR2MS40MjZoMS4xOTV2LS40ODNoNS42MXYuNDgzSDEyVjQuNzY1SDguODgzYy0uMDc4LS4yMy0uMTQ4LS40My0uMjEtLjYwMkw4LjYxNiA0WiIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxtYXNrIGlkPSJiIiBmaWxsPSIjZmZmIj48dXNlIHhsaW5rOmhyZWY9IiNhIi8+PC9tYXNrPjx1c2UgZmlsbD0iIzhEQzlGRiIgZmlsbC1ydWxlPSJub256ZXJvIiB4bGluazpocmVmPSIjYSIvPjxjaXJjbGUgY3g9Ii41IiBjeT0iLTMuNSIgcj0iMTYuNSIgZmlsbD0iI0MxRTJGRiIgZmlsbC1ydWxlPSJub256ZXJvIiBtYXNrPSJ1cmwoI2IpIi8+PGNpcmNsZSBjeD0iLS41IiBjeT0iLTQuNSIgcj0iMTIuNSIgZmlsbD0iI0VFRjdGRiIgZmlsbC1ydWxlPSJub256ZXJvIiBtYXNrPSJ1cmwoI2IpIi8+PC9nPjwvc3ZnPg==");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/g.svg
|
|
|
function g_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = g_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function g_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return g_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return g_arrayLikeToArray(o, minLen); }
|
|
|
function g_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var g_defProp = Object.defineProperty;
|
|
|
var g_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var g_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var g_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var g_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? g_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var g_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (g_hasOwnProp.call(b, prop)) g_defNormalProp(a, prop, b[prop]);
|
|
|
if (g_getOwnPropSymbols) {
|
|
|
var _iterator = g_createForOfIteratorHelper(g_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (g_propIsEnum.call(b, prop)) g_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgG = function SvgG(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", g_spreadValues({
|
|
|
width: 22,
|
|
|
height: 20,
|
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u5927\u70B9\u8D5E"), /* @__PURE__ */React.createElement("g", {
|
|
|
fillRule: "nonzero",
|
|
|
fill: "none"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M3.566 19.08V8.134c0-.443-.318-.802-.71-.802H1.34c-.73 0-1.322.67-1.322 1.496v9.558c0 .827.593 1.496 1.322 1.496h1.515c.392 0 .71-.36.71-.802Z",
|
|
|
fill: "#A3D3FF"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M4.585 19.303V7.9c0-.263.188-.495.459-.559.955-.229 3.147-1.049 4.08-3.848.567-2.451 1.182-3.607 3.008-3.469 1.826.139 1.948 1.804 1.948 2.312v3.93s-.148.602.468.649c.617.046 5.426 0 5.426 0s2.639-.042 1.8 3.031c-.73 2.673-2.173 6.974-2.537 8.05a2.324 2.324 0 0 1-.324.626c-.353.483-1.094 1.258-2.228 1.258H5.201c-.341.002-.616-.257-.616-.577Z",
|
|
|
fill: "#FFF"
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var g = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNMy41NjYgMTkuMDhWOC4xMzRjMC0uNDQzLS4zMTgtLjgwMi0uNzEtLjgwMkgxLjM0Yy0uNzMgMC0xLjMyMi42Ny0xLjMyMiAxLjQ5NnY5LjU1OGMwIC44MjcuNTkzIDEuNDk2IDEuMzIyIDEuNDk2aDEuNTE1Yy4zOTIgMCAuNzEtLjM2LjcxLS44MDJaIiBmaWxsPSIjQTNEM0ZGIi8+PHBhdGggZD0iTTQuNTg1IDE5LjMwM1Y3LjljMC0uMjYzLjE4OC0uNDk1LjQ1OS0uNTU5Ljk1NS0uMjI5IDMuMTQ3LTEuMDQ5IDQuMDgtMy44NDguNTY3LTIuNDUxIDEuMTgyLTMuNjA3IDMuMDA4LTMuNDY5IDEuODI2LjEzOSAxLjk0OCAxLjgwNCAxLjk0OCAyLjMxMnYzLjkzcy0uMTQ4LjYwMi40NjguNjQ5Yy42MTcuMDQ2IDUuNDI2IDAgNS40MjYgMHMyLjYzOS0uMDQyIDEuOCAzLjAzMWMtLjczIDIuNjczLTIuMTczIDYuOTc0LTIuNTM3IDguMDVhMi4zMjQgMi4zMjQgMCAwIDEtLjMyNC42MjZjLS4zNTMuNDgzLTEuMDk0IDEuMjU4LTIuMjI4IDEuMjU4SDUuMjAxYy0uMzQxLjAwMi0uNjE2LS4yNTctLjYxNi0uNTc3WiIgZmlsbD0iI0ZGRiIvPjwvZz48L3N2Zz4=");
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var CustomDiscussmodules = ({"flex_box_center":"flex_box_center___Fl60v","flex_space_between":"flex_space_between___bECvI","flex_box_vertical_center":"flex_box_vertical_center___NasnL","flex_box_center_end":"flex_box_center_end___llsAF","flex_box_column":"flex_box_column___KaTPF","flex-col":"flex-col___bKJQ8","flex-row":"flex-row___Oi9dY","justify-start":"justify-start___mMGgB","justify-center":"justify-center___FHRVa","justify-end":"justify-end___WkbJO","justify-evenly":"justify-evenly___Fw3u8","justify-around":"justify-around___wMJr8","justify-between":"justify-between___jcbyt","align-start":"align-start___SDMO3","align-center":"align-center___Ulu1I","align-end":"align-end___aue0T","discuss":"discuss___fk6PE","reply":"reply___pOmly","pagination":"pagination___qEsHX"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
|
var col = __webpack_require__(43604);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/DiscussItem/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var DiscussItemmodules = ({"flex_box_center":"flex_box_center___qGmgZ","flex_space_between":"flex_space_between___PeDhE","flex_box_vertical_center":"flex_box_vertical_center___avs2o","flex_box_center_end":"flex_box_center_end___bpXQB","flex_box_column":"flex_box_column___bc5wd","flex-col":"flex-col___W2hk6","flex-row":"flex-row___Iw0iS","justify-start":"justify-start____DUyL","justify-center":"justify-center___iiwdO","justify-end":"justify-end___KRCzz","justify-evenly":"justify-evenly___MpHED","justify-around":"justify-around___I13YU","justify-between":"justify-between___H0uXH","align-start":"align-start___xkcOF","align-center":"align-center___A_BdG","align-end":"align-end___ci9BO","discussItem":"discussItem___zcesj","wrap":"wrap___ezVW4","list":"list___EEOWp","btns":"btns___Niwl7","secondLevelDiscuss":"secondLevelDiscuss___TXG1b","line":"line___ejh2a","thirdlyLevelDiscuss":"thirdlyLevelDiscuss___HRI5Q"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/DiscussItem/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Reply = function Reply(_ref) {
|
|
|
var id = _ref.id,
|
|
|
cb = _ref.cb;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
value = _useState2[0],
|
|
|
setValue = _useState2[1];
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "mt10",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
defaultValue: value,
|
|
|
id: "writeForumsReviewId",
|
|
|
onChange: function onChange(v) {
|
|
|
setValue(v);
|
|
|
},
|
|
|
placeholder: "\u6211\u8981\u56DE\u590D...",
|
|
|
height: 240
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (value === '') {
|
|
|
message/* default */.ZP.error('请输入内容');
|
|
|
} else {
|
|
|
cb(id, value);
|
|
|
}
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
})),
|
|
|
children: "\u53D1\u9001"
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var ThirdlyLevelDiscuss = function ThirdlyLevelDiscuss(_ref3) {
|
|
|
var _data$author;
|
|
|
var data = _ref3.data;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DiscussItemmodules.thirdlyLevelDiscuss,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "font 14 c-light-primary",
|
|
|
children: data === null || data === void 0 || (_data$author = data.author) === null || _data$author === void 0 ? void 0 : _data$author.name
|
|
|
}), "@", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "font 14 c-light-primary",
|
|
|
children: data === null || data === void 0 ? void 0 : data.parent_name
|
|
|
}), ":"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: data === null || data === void 0 ? void 0 : data.content
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var DiscussItem_SecondLevelDiscuss = function SecondLevelDiscuss(_ref4) {
|
|
|
var _data$author2, _data$author3, _data$author4, _data$children;
|
|
|
var data = _ref4.data,
|
|
|
onReplyDiscuss = _ref4.onReplyDiscuss,
|
|
|
thirdlyReply = _ref4.thirdlyReply,
|
|
|
setThirdlyReply = _ref4.setThirdlyReply;
|
|
|
var user = (0,authority/* userInfo */.eY)();
|
|
|
console.log(user, 'user');
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DiscussItemmodules.list,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.IMG_SERVER + '/images/' + (data === null || data === void 0 || (_data$author2 = data.author) === null || _data$author2 === void 0 ? void 0 : _data$author2.image_url)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DiscussItemmodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "font14",
|
|
|
style: {
|
|
|
marginBottom: 6
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-333",
|
|
|
children: data === null || data === void 0 || (_data$author3 = data.author) === null || _data$author3 === void 0 ? void 0 : _data$author3.name
|
|
|
}), (user === null || user === void 0 ? void 0 : user.login) !== (data === null || data === void 0 || (_data$author4 = data.author) === null || _data$author4 === void 0 ? void 0 : _data$author4.login) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return setThirdlyReply(data === null || data === void 0 ? void 0 : data.id);
|
|
|
},
|
|
|
className: "c-grey-999 current",
|
|
|
style: {
|
|
|
"float": 'right'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-huifu3 mr3 font12"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u56DE\u590D"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: data === null || data === void 0 ? void 0 : data.content
|
|
|
}), data === null || data === void 0 || (_data$children = data.children) === null || _data$children === void 0 ? void 0 : _data$children.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(ThirdlyLevelDiscuss, {
|
|
|
data: e
|
|
|
}, e.id);
|
|
|
}), thirdlyReply === (data === null || data === void 0 ? void 0 : data.id) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Reply, {
|
|
|
id: data === null || data === void 0 ? void 0 : data.id,
|
|
|
cb: onReplyDiscuss
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
textAlign: 'end',
|
|
|
paddingTop: 20
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
return setThirdlyReply(null);
|
|
|
},
|
|
|
className: "c-light-primary current",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
transform: 'scale(0.7)',
|
|
|
display: 'inline-block'
|
|
|
},
|
|
|
className: "iconfont icon-shouqi font12"
|
|
|
}), "\u6536\u8D77\u56DE\u590D"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: DiscussItemmodules.line
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var DiscussItem = function DiscussItem(_ref5) {
|
|
|
var _data$author5, _data$author6, _data$children3, _data$children4;
|
|
|
var data = _ref5.data,
|
|
|
onReplyDiscuss = _ref5.onReplyDiscuss,
|
|
|
secondReply = _ref5.secondReply,
|
|
|
setSecondReply = _ref5.setSecondReply,
|
|
|
thirdlyReply = _ref5.thirdlyReply,
|
|
|
setThirdlyReply = _ref5.setThirdlyReply,
|
|
|
onPlusDiscuss = _ref5.onPlusDiscuss;
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
remarkBool = _useState4[0],
|
|
|
setRemarkBool = _useState4[1];
|
|
|
console.log(data, 'data');
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: DiscussItemmodules.discussItem,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DiscussItemmodules.list,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.IMG_SERVER + '/images/' + (data === null || data === void 0 || (_data$author5 = data.author) === null || _data$author5 === void 0 ? void 0 : _data$author5.image_url)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DiscussItemmodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "font14",
|
|
|
style: {
|
|
|
marginBottom: 6
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-333 mr30",
|
|
|
children: data === null || data === void 0 || (_data$author6 = data.author) === null || _data$author6 === void 0 ? void 0 : _data$author6.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-999",
|
|
|
children: data === null || data === void 0 ? void 0 : data.time
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: data === null || data === void 0 ? void 0 : data.content
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: DiscussItemmodules.btns,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
return onPlusDiscuss(data === null || data === void 0 ? void 0 : data.id);
|
|
|
},
|
|
|
className: data !== null && data !== void 0 && data.user_praise ? 'c-light-primary' : 'c-grey-999',
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xiaodianzan2 mr3"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.praise_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
var _data$children2;
|
|
|
if ((data === null || data === void 0 || (_data$children2 = data.children) === null || _data$children2 === void 0 ? void 0 : _data$children2.length) === 0) {
|
|
|
return;
|
|
|
}
|
|
|
setSecondReply(null);
|
|
|
setRemarkBool(!remarkBool);
|
|
|
},
|
|
|
style: {
|
|
|
color: remarkBool ? '#0152d9' : '#999999'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-xiaopinglun2 mr3"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: remarkBool ? '收起评论' : data === null || data === void 0 || (_data$children3 = data.children) === null || _data$children3 === void 0 ? void 0 : _data$children3.length
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
setRemarkBool(false);
|
|
|
setSecondReply(secondReply === (data === null || data === void 0 ? void 0 : data.id) ? null : data === null || data === void 0 ? void 0 : data.id);
|
|
|
},
|
|
|
style: {
|
|
|
color: secondReply === (data === null || data === void 0 ? void 0 : data.id) ? '#0152d9' : '#999999'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-huifu3 mr3"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: secondReply === (data === null || data === void 0 ? void 0 : data.id) ? '收起回复' : '回复'
|
|
|
})]
|
|
|
})]
|
|
|
}), secondReply === (data === null || data === void 0 ? void 0 : data.id) && /*#__PURE__*/(0,jsx_runtime.jsx)(Reply, {
|
|
|
id: data === null || data === void 0 ? void 0 : data.id,
|
|
|
cb: function cb(id, value) {
|
|
|
onReplyDiscuss(id, value);
|
|
|
setRemarkBool(true);
|
|
|
}
|
|
|
}), remarkBool && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: DiscussItemmodules.secondLevelDiscuss,
|
|
|
children: data === null || data === void 0 || (_data$children4 = data.children) === null || _data$children4 === void 0 ? void 0 : _data$children4.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(DiscussItem_SecondLevelDiscuss, {
|
|
|
thirdlyReply: thirdlyReply,
|
|
|
setThirdlyReply: setThirdlyReply,
|
|
|
data: e,
|
|
|
onReplyDiscuss: onReplyDiscuss
|
|
|
}, e.id);
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var CustomDiscuss_DiscussItem = (DiscussItem);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CustomDiscuss_List = function List(_ref) {
|
|
|
var identifier = _ref.identifier,
|
|
|
active = _ref.active,
|
|
|
onOk = _ref.onOk;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
value = _useState2[0],
|
|
|
setValue = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
page = _useState4[0],
|
|
|
setPage = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
data = _useState6[0],
|
|
|
setData = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
total = _useState8[0],
|
|
|
setTotal = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
secondReply = _useState10[0],
|
|
|
setSecondReply = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
thirdlyReply = _useState12[0],
|
|
|
setThirdlyReply = _useState12[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getCommentsData(1);
|
|
|
setPage(1);
|
|
|
}, [active]);
|
|
|
var getCommentsData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(page) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return getComments({
|
|
|
container_type: 'QuestionSolutionArticle',
|
|
|
container_identifier: active,
|
|
|
limit: 5,
|
|
|
page: page
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res !== null && res !== void 0 && res.comments) {
|
|
|
setData((res === null || res === void 0 ? void 0 : res.comments) || []);
|
|
|
setPage(page);
|
|
|
setTotal(res === null || res === void 0 ? void 0 : res.disscuss_count);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getCommentsData(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var onCreateDiscuss = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (!(value === '')) {
|
|
|
_context2.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error('请输入内容');
|
|
|
return _context2.abrupt("return");
|
|
|
case 3:
|
|
|
_context2.next = 5;
|
|
|
return createDiscuss({
|
|
|
comments: {
|
|
|
content: value
|
|
|
},
|
|
|
container_type: 'QuestionSolutionArticle',
|
|
|
container_identifier: active
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context2.sent;
|
|
|
if (res !== null && res !== void 0 && res.discuss) {
|
|
|
setValue('');
|
|
|
getCommentsData(page);
|
|
|
onOk();
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function onCreateDiscuss() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var onReplyDiscuss = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(id, value, level) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return replyDiscuss({
|
|
|
container_type: 'QuestionSolutionArticle',
|
|
|
container_identifier: active,
|
|
|
comments: {
|
|
|
content: value,
|
|
|
parent_id: id
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
setSecondReply(null);
|
|
|
setThirdlyReply(null);
|
|
|
getCommentsData(page);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function onReplyDiscuss(_x2, _x3, _x4) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var onPlusDiscuss = /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(id) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.next = 2;
|
|
|
return plusDiscuss(id);
|
|
|
case 2:
|
|
|
res = _context4.sent;
|
|
|
getCommentsData(page);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function onPlusDiscuss(_x5) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChange = function handleChange(current) {
|
|
|
setPage(current);
|
|
|
getCommentsData(current);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: CustomDiscussmodules.discuss,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: CustomDiscussmodules.reply,
|
|
|
style: {
|
|
|
borderWidth: total ? 1 : 0
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
defaultValue: value,
|
|
|
id: "writeForumsReviewId",
|
|
|
onChange: function onChange(v) {
|
|
|
setValue(v);
|
|
|
},
|
|
|
placeholder: "\u6211\u8981\u56DE\u590D...",
|
|
|
height: 240
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
return onCreateDiscuss();
|
|
|
},
|
|
|
children: "\u53D1\u9001"
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}), data === null || data === void 0 ? void 0 : data.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(CustomDiscuss_DiscussItem, {
|
|
|
secondReply: secondReply,
|
|
|
setSecondReply: setSecondReply,
|
|
|
thirdlyReply: thirdlyReply,
|
|
|
setThirdlyReply: setThirdlyReply,
|
|
|
data: e,
|
|
|
onReplyDiscuss: onReplyDiscuss,
|
|
|
onPlusDiscuss: onPlusDiscuss
|
|
|
}, e.id);
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
className: CustomDiscussmodules.pagination,
|
|
|
showTotal: function showTotal(total) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#656F87'
|
|
|
},
|
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: total
|
|
|
}), "\u6761\u6570\u636E"]
|
|
|
});
|
|
|
},
|
|
|
current: page,
|
|
|
onChange: handleChange,
|
|
|
total: total,
|
|
|
showSizeChanger: false,
|
|
|
showQuickJumper: true,
|
|
|
hideOnSinglePage: true,
|
|
|
pageSize: 5
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var CustomDiscuss = (CustomDiscuss_List);
|
|
|
// EXTERNAL MODULE: ./src/components/Video/Play/index.jsx + 1 modules
|
|
|
var Play = __webpack_require__(50441);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ListDetails_List = function List(_ref) {
|
|
|
var _data$videos, _data$videos2, _data$videos3, _data$videos4, _data$videos5;
|
|
|
var active = _ref.active,
|
|
|
identifier = _ref.identifier,
|
|
|
onAssist = _ref.onAssist,
|
|
|
onEdit = _ref.onEdit,
|
|
|
onArticlesSkip = _ref.onArticlesSkip,
|
|
|
onClose = _ref.onClose,
|
|
|
onOk = _ref.onOk,
|
|
|
onDelete = _ref.onDelete,
|
|
|
detailsIndex = _ref.detailsIndex,
|
|
|
btnShowStatus = _ref.btnShowStatus;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
loading = _useState2[0],
|
|
|
setLoading = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
data = _useState4[0],
|
|
|
setData = _useState4[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (!!active) {
|
|
|
getData();
|
|
|
}
|
|
|
}, [active, detailsIndex]);
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var bool,
|
|
|
res,
|
|
|
_args = arguments;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
bool = _args.length > 0 && _args[0] !== undefined ? _args[0] : true;
|
|
|
if (bool) {
|
|
|
setLoading(true);
|
|
|
}
|
|
|
_context.next = 4;
|
|
|
return (0,service/* articlesDetails */.wO)(identifier, {
|
|
|
active: active
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
setData((res === null || res === void 0 ? void 0 : res.data) || {});
|
|
|
}
|
|
|
setLoading(false);
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleArticlesStatus = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(v) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return (0,service/* articlesStatus */.qe)(identifier, objectSpread2_default()({
|
|
|
active: active
|
|
|
}, v));
|
|
|
case 2:
|
|
|
res = _context2.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
getData(false);
|
|
|
onOk();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleArticlesStatus(_x) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleAssist = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(v) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,service/* articlesAssist */.Rg)(identifier, {
|
|
|
active: v === null || v === void 0 ? void 0 : v.id
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if (res.status === 0) {
|
|
|
getData(false);
|
|
|
onOk();
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleAssist(_x2) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleDelete = function handleDelete(v) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
width: 500,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
icon: null,
|
|
|
className: 'custom-modal-divider',
|
|
|
content: '确认要删除该题解吗?',
|
|
|
onOk: function onOk() {
|
|
|
return onDelete(v);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var handleOk = function handleOk() {
|
|
|
getData(false);
|
|
|
onOk();
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListDetailsmodules.listDetails,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
|
className: "pt20 pl20 pr20",
|
|
|
loading: loading,
|
|
|
active: true,
|
|
|
paragraph: {
|
|
|
rows: 5
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListDetailsmodules.head,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListDetailsmodules.name,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
title: data === null || data === void 0 ? void 0 : data.name,
|
|
|
className: ListDetailsmodules.title,
|
|
|
children: data === null || data === void 0 ? void 0 : data.name
|
|
|
}), (data === null || data === void 0 ? void 0 : data.is_authority) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListDetailsmodules.b,
|
|
|
children: "\u5B98\u65B9"
|
|
|
}), (data === null || data === void 0 ? void 0 : data.is_excellent) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListDetailsmodules.a,
|
|
|
children: "\u7CBE\u9009"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListDetailsmodules.tag,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.IMG_SERVER + '/images/' + (data === null || data === void 0 ? void 0 : data.image_url)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-grey-333 ml5 mr20 font14",
|
|
|
children: data === null || data === void 0 ? void 0 : data.username
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'inline-block',
|
|
|
marginBottom: -2
|
|
|
},
|
|
|
className: "c-grey-999 mr20 font12",
|
|
|
children: ["\u53D1\u5E03\u4E8E", dayjs_min_default()(data === null || data === void 0 ? void 0 : data.created_at).format('YYYY-MM-DD')]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: c
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.praises_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: d
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.discusses_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: e
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.viewed_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListDetailsmodules.btn,
|
|
|
children: [((0,authority/* isSuperAdmins */.Ny)() || (data === null || data === void 0 ? void 0 : data.is_self)) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
return handleDelete(data);
|
|
|
},
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
children: "\u5220\u9664"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
return onEdit(data);
|
|
|
},
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
children: "\u7F16\u8F91"
|
|
|
})]
|
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
return handleArticlesStatus({
|
|
|
is_authority: !(data !== null && data !== void 0 && data.is_authority)
|
|
|
});
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: gf
|
|
|
}), data !== null && data !== void 0 && data.is_authority ? '取消' : '设为', "\u5B98\u65B9"]
|
|
|
}), (0,authority/* isSuperAdmins */.Ny)() && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
return handleArticlesStatus({
|
|
|
is_excellent: !(data !== null && data !== void 0 && data.is_excellent)
|
|
|
});
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: jx
|
|
|
}), data !== null && data !== void 0 && data.is_excellent ? '取消' : '设为', "\u7CBE\u9009"]
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListDetailsmodules.scroll,
|
|
|
children: [(data === null || data === void 0 || (_data$videos = data.videos) === null || _data$videos === void 0 || (_data$videos = _data$videos[0]) === null || _data$videos === void 0 ? void 0 : _data$videos.id) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ListDetailsmodules.video,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
tip: "\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...",
|
|
|
spinning: !(data !== null && data !== void 0 && (_data$videos2 = data.videos) !== null && _data$videos2 !== void 0 && (_data$videos2 = _data$videos2[0]) !== null && _data$videos2 !== void 0 && _data$videos2.transcoded),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Play/* default */.Z, {
|
|
|
poster: data === null || data === void 0 || (_data$videos3 = data.videos) === null || _data$videos3 === void 0 || (_data$videos3 = _data$videos3[0]) === null || _data$videos3 === void 0 ? void 0 : _data$videos3.cover_url,
|
|
|
src: (data === null || data === void 0 || (_data$videos4 = data.videos) === null || _data$videos4 === void 0 || (_data$videos4 = _data$videos4[0]) === null || _data$videos4 === void 0 ? void 0 : _data$videos4.play_url) || '',
|
|
|
videoId: data === null || data === void 0 || (_data$videos5 = data.videos) === null || _data$videos5 === void 0 || (_data$videos5 = _data$videos5[0]) === null || _data$videos5 === void 0 ? void 0 : _data$videos5.id,
|
|
|
logWatchHistory: function logWatchHistory() {}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: ListDetailsmodules.html,
|
|
|
value: (data === null || data === void 0 ? void 0 : data.content) || ''
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
return handleAssist(data);
|
|
|
},
|
|
|
className: ListDetailsmodules.g,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
className: "mr10",
|
|
|
src: data !== null && data !== void 0 && data.user_liker ? g : g
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: data === null || data === void 0 ? void 0 : data.praises_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CustomDiscuss, {
|
|
|
onOk: handleOk,
|
|
|
active: active,
|
|
|
identifier: identifier
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListDetailsmodules.btns,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
return onClose();
|
|
|
},
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
children: "\u5173\u95ED"
|
|
|
}), btnShowStatus[0] && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick(e) {
|
|
|
return onArticlesSkip(e, 'prev');
|
|
|
},
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: "\u4E0A\u4E00\u9898\u89E3"
|
|
|
}), btnShowStatus[1] && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick(e) {
|
|
|
return onArticlesSkip(e, 'next');
|
|
|
},
|
|
|
style: {
|
|
|
marginLeft: 20
|
|
|
},
|
|
|
type: "primary",
|
|
|
children: "\u4E0B\u4E00\u9898\u89E3"
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ListDetails = (ListDetails_List);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/img/a.svg
|
|
|
function a_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = a_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function a_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return a_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return a_arrayLikeToArray(o, minLen); }
|
|
|
function a_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var a_defProp = Object.defineProperty;
|
|
|
var a_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var a_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var a_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var a_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? a_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var a_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (a_hasOwnProp.call(b, prop)) a_defNormalProp(a, prop, b[prop]);
|
|
|
if (a_getOwnPropSymbols) {
|
|
|
var _iterator = a_createForOfIteratorHelper(a_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (a_propIsEnum.call(b, prop)) a_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgA = function SvgA(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", a_spreadValues({
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
|
width: 16,
|
|
|
height: 16
|
|
|
}, props), /* @__PURE__ */React.createElement("defs", null, /* @__PURE__ */React.createElement("path", {
|
|
|
id: "a_svg__a",
|
|
|
d: "M13.727 0C14.983 0 16 .895 16 2v12c0 1.105-1.017 2-2.273 2H2.273C1.017 16 0 15.105 0 14V2C0 .895 1.017 0 2.273 0h11.454ZM7.464 11H2.955c-.266 0-.513.19-.646.5s-.133.69 0 1c.133.31.38.5.646.5h4.509c.411 0 .745-.448.745-1s-.334-1-.745-1Zm4-3.5H2.955c-.411 0-.745.448-.745 1s.334 1 .745 1h8.509c.412 0 .746-.448.746-1s-.334-1-.746-1ZM3.71 2.75a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z"
|
|
|
})), /* @__PURE__ */React.createElement("g", {
|
|
|
fill: "none",
|
|
|
fillRule: "evenodd"
|
|
|
}, /* @__PURE__ */React.createElement("mask", {
|
|
|
id: "a_svg__b",
|
|
|
fill: "#fff"
|
|
|
}, /* @__PURE__ */React.createElement("use", {
|
|
|
xlinkHref: "#a_svg__a"
|
|
|
})), /* @__PURE__ */React.createElement("use", {
|
|
|
fill: "#7DC1FF",
|
|
|
fillRule: "nonzero",
|
|
|
xlinkHref: "#a_svg__a"
|
|
|
}), /* @__PURE__ */React.createElement("circle", {
|
|
|
cx: 1.5,
|
|
|
cy: 0.5,
|
|
|
r: 16.5,
|
|
|
fill: "#A3D3FF",
|
|
|
fillRule: "nonzero",
|
|
|
mask: "url(#a_svg__b)"
|
|
|
}), /* @__PURE__ */React.createElement("ellipse", {
|
|
|
cx: 1.5,
|
|
|
cy: -0.5,
|
|
|
fill: "#C1E2FF",
|
|
|
fillRule: "nonzero",
|
|
|
mask: "url(#a_svg__b)",
|
|
|
rx: 12.5,
|
|
|
ry: 12
|
|
|
}), /* @__PURE__ */React.createElement("ellipse", {
|
|
|
cx: -2.5,
|
|
|
cy: -4,
|
|
|
fill: "#EEF7FF",
|
|
|
fillRule: "nonzero",
|
|
|
mask: "url(#a_svg__b)",
|
|
|
rx: 12.5,
|
|
|
ry: 12
|
|
|
})));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var a = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMTMuNzI3IDBDMTQuOTgzIDAgMTYgLjg5NSAxNiAydjEyYzAgMS4xMDUtMS4wMTcgMi0yLjI3MyAySDIuMjczQzEuMDE3IDE2IDAgMTUuMTA1IDAgMTRWMkMwIC44OTUgMS4wMTcgMCAyLjI3MyAwaDExLjQ1NFpNNy40NjQgMTFIMi45NTVjLS4yNjYgMC0uNTEzLjE5LS42NDYuNXMtLjEzMy42OSAwIDFjLjEzMy4zMS4zOC41LjY0Ni41aDQuNTA5Yy40MTEgMCAuNzQ1LS40NDguNzQ1LTFzLS4zMzQtMS0uNzQ1LTFabTQtMy41SDIuOTU1Yy0uNDExIDAtLjc0NS40NDgtLjc0NSAxcy4zMzQgMSAuNzQ1IDFoOC41MDljLjQxMiAwIC43NDYtLjQ0OC43NDYtMXMtLjMzNC0xLS43NDYtMVpNMy43MSAyLjc1YTEuNSAxLjUgMCAxIDAgMCAzIDEuNSAxLjUgMCAwIDAgMC0zWiIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxtYXNrIGlkPSJiIiBmaWxsPSIjZmZmIj48dXNlIHhsaW5rOmhyZWY9IiNhIi8+PC9tYXNrPjx1c2UgZmlsbD0iIzdEQzFGRiIgZmlsbC1ydWxlPSJub256ZXJvIiB4bGluazpocmVmPSIjYSIvPjxjaXJjbGUgY3g9IjEuNSIgY3k9Ii41IiByPSIxNi41IiBmaWxsPSIjQTNEM0ZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iIG1hc2s9InVybCgjYikiLz48ZWxsaXBzZSBjeD0iMS41IiBjeT0iLS41IiBmaWxsPSIjQzFFMkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iIG1hc2s9InVybCgjYikiIHJ4PSIxMi41IiByeT0iMTIiLz48ZWxsaXBzZSBjeD0iLTIuNSIgY3k9Ii00IiBmaWxsPSIjRUVGN0ZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iIG1hc2s9InVybCgjYikiIHJ4PSIxMi41IiByeT0iMTIiLz48L2c+PC9zdmc+");
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CaretUpOutlined.js + 1 modules
|
|
|
var CaretUpOutlined = __webpack_require__(59477);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/CaretDownOutlined.js + 1 modules
|
|
|
var CaretDownOutlined = __webpack_require__(89489);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FilterList = function FilterList(_ref) {
|
|
|
var identifier = _ref.identifier,
|
|
|
tabStatus = _ref.tabStatus,
|
|
|
setFilterListTotal = _ref.setFilterListTotal,
|
|
|
setListStatus = _ref.setListStatus;
|
|
|
var initParams = {
|
|
|
page: 1,
|
|
|
limit: 10,
|
|
|
total: 0,
|
|
|
search: '',
|
|
|
save_search: '',
|
|
|
sort_by: 'updated_at',
|
|
|
sort_direction: null
|
|
|
};
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(objectSpread2_default()({}, initParams)),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
params = _useState2[0],
|
|
|
setParams = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
loading = _useState4[0],
|
|
|
setLoading = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
width = _useState6[0],
|
|
|
setWidth = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
detailsIndex = _useState8[0],
|
|
|
setDetailsIndex = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
active = _useState10[0],
|
|
|
setActive = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
data = _useState12[0],
|
|
|
setData = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)([true, true]),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
btnShowStatus = _useState14[0],
|
|
|
setBtnShowStatus = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
status = _useState16[0],
|
|
|
setStatus = _useState16[1]; //1新增 2编辑 3详情
|
|
|
var leftWarp = (0,_react_17_0_2_react.useRef)(null);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
handleClose();
|
|
|
}, [tabStatus]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
dealBtnShowStatus();
|
|
|
}, [active]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData(objectSpread2_default()({}, initParams));
|
|
|
handleClose();
|
|
|
}, [identifier]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
window.addEventListener('resize', handleResize);
|
|
|
setListStatus(status);
|
|
|
return function () {
|
|
|
window.removeEventListener('resize', handleResize);
|
|
|
};
|
|
|
}, [status]);
|
|
|
var dealBtnShowStatus = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var item, activeIndex;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (active) {
|
|
|
_context.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
setBtnShowStatus([true, true]);
|
|
|
return _context.abrupt("return");
|
|
|
case 3:
|
|
|
item = [true, true];
|
|
|
activeIndex = data === null || data === void 0 ? void 0 : data.findIndex(function (v) {
|
|
|
return v.id === active;
|
|
|
});
|
|
|
if (activeIndex === 0 && params.page === 1) {
|
|
|
item[0] = false;
|
|
|
}
|
|
|
if ((params.page - 1) * params.limit + (activeIndex + 1) === params.total) {
|
|
|
item[1] = false;
|
|
|
}
|
|
|
setBtnShowStatus(item);
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function dealBtnShowStatus() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleResize = function handleResize() {
|
|
|
if (status) {
|
|
|
var _leftWarp$current;
|
|
|
var rightWidth = window.innerWidth - ((_leftWarp$current = leftWarp.current) === null || _leftWarp$current === void 0 ? void 0 : _leftWarp$current.clientWidth);
|
|
|
setWidth(rightWidth);
|
|
|
}
|
|
|
};
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(record) {
|
|
|
var res, _res$data, _res$data2, _res$data3;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
setLoading(true);
|
|
|
_context2.next = 3;
|
|
|
return (0,service/* articlesList */.WH)(identifier, record);
|
|
|
case 3:
|
|
|
res = _context2.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
setData((res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.articles) || []);
|
|
|
setParams(objectSpread2_default()(objectSpread2_default()({}, record), {}, {
|
|
|
total: res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.articles_count
|
|
|
}));
|
|
|
setFilterListTotal(res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.articles_count);
|
|
|
}
|
|
|
setLoading(false);
|
|
|
return _context2.abrupt("return", res);
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function getData(_x) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleSorter = function handleSorter() {
|
|
|
if ((params === null || params === void 0 ? void 0 : params.sort_direction) === null) {
|
|
|
params.sort_direction = 'asc';
|
|
|
} else if ((params === null || params === void 0 ? void 0 : params.sort_direction) === 'asc') {
|
|
|
params.sort_direction = 'desc';
|
|
|
} else if ((params === null || params === void 0 ? void 0 : params.sort_direction) === 'desc') {
|
|
|
params.sort_direction = null;
|
|
|
}
|
|
|
params.page = 1;
|
|
|
handleClose();
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var handleSearch = function handleSearch() {
|
|
|
params.page = 1;
|
|
|
params.search = params === null || params === void 0 ? void 0 : params.save_search;
|
|
|
handleClose();
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var sign = function sign() {
|
|
|
var _leftWarp$current2;
|
|
|
var dom = document.getElementsByClassName('btn-resize');
|
|
|
dom[0].style.visibility = 'hidden';
|
|
|
var rightWidth = window.innerWidth - ((_leftWarp$current2 = leftWarp.current) === null || _leftWarp$current2 === void 0 ? void 0 : _leftWarp$current2.clientWidth);
|
|
|
setWidth(rightWidth);
|
|
|
};
|
|
|
var addProblems = function addProblems() {
|
|
|
sign();
|
|
|
setStatus(1);
|
|
|
};
|
|
|
var handleDetails = function handleDetails(v) {
|
|
|
sign();
|
|
|
setActive(v === null || v === void 0 ? void 0 : v.id);
|
|
|
setStatus(3);
|
|
|
};
|
|
|
var handleEdit = function handleEdit(v) {
|
|
|
sign();
|
|
|
setActive(v === null || v === void 0 ? void 0 : v.id);
|
|
|
setStatus(2);
|
|
|
};
|
|
|
var handleClose = function handleClose() {
|
|
|
var dom = document.getElementsByClassName('btn-resize');
|
|
|
dom[0].style.visibility = 'visible';
|
|
|
setWidth(0);
|
|
|
setStatus(0);
|
|
|
setActive(null);
|
|
|
};
|
|
|
var handleOk = function handleOk(id) {
|
|
|
setStatus(3);
|
|
|
setActive(id);
|
|
|
params.page = 1;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var handleEditOk = function handleEditOk(id) {
|
|
|
setStatus(3);
|
|
|
setActive(id);
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var handleDetailsOk = function handleDetailsOk(id) {
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var handleAssist = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(v) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,service/* articlesAssist */.Rg)(identifier, {
|
|
|
active: v === null || v === void 0 ? void 0 : v.id
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if (res.status === 0) {
|
|
|
getData(params);
|
|
|
setDetailsIndex(detailsIndex + 1);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleAssist(_x2) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleHide = /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(v) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.next = 2;
|
|
|
return (0,service/* articlesHide */.rL)(identifier, {
|
|
|
active: v === null || v === void 0 ? void 0 : v.id
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context4.sent;
|
|
|
if (res.status === 0) {
|
|
|
getData(params);
|
|
|
setDetailsIndex(detailsIndex + 1);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function handleHide(_x3) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleDelete = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(v) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
_context5.next = 2;
|
|
|
return (0,service/* deleteArticles */.de)(identifier, {
|
|
|
active: v === null || v === void 0 ? void 0 : v.id
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context5.sent;
|
|
|
if (res.status === 0) {
|
|
|
handleClose();
|
|
|
getData(params);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function handleDelete(_x4) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChange = function handleChange(current) {
|
|
|
params.page = current;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var handleArticlesSkip = /*#__PURE__*/function () {
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(e, type) {
|
|
|
var activeIndex, res, _res$data4, _res$data5, param, _param, _res, _res$data6, _param2, _param3;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
activeIndex = data === null || data === void 0 ? void 0 : data.findIndex(function (v) {
|
|
|
return v.id === active;
|
|
|
});
|
|
|
console.log(activeIndex, type, 22);
|
|
|
if (!(type === 'prev')) {
|
|
|
_context6.next = 21;
|
|
|
break;
|
|
|
}
|
|
|
if (!(activeIndex === undefined)) {
|
|
|
_context6.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('上一题解不存在');
|
|
|
return _context6.abrupt("return");
|
|
|
case 6:
|
|
|
if (!(activeIndex === 0)) {
|
|
|
_context6.next = 19;
|
|
|
break;
|
|
|
}
|
|
|
if (!(params.page === 1)) {
|
|
|
_context6.next = 10;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('上一题解不存在');
|
|
|
return _context6.abrupt("return");
|
|
|
case 10:
|
|
|
if (!(params.page !== 1)) {
|
|
|
_context6.next = 17;
|
|
|
break;
|
|
|
}
|
|
|
params.page = params.page - 1;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
_context6.next = 15;
|
|
|
return getData(params);
|
|
|
case 15:
|
|
|
res = _context6.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
param = res === null || res === void 0 || (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.articles[(res === null || res === void 0 || (_res$data5 = res.data) === null || _res$data5 === void 0 || (_res$data5 = _res$data5.articles) === null || _res$data5 === void 0 ? void 0 : _res$data5.length) - 1];
|
|
|
setActive(param === null || param === void 0 ? void 0 : param.id);
|
|
|
console.log(e.target, 555);
|
|
|
}
|
|
|
case 17:
|
|
|
_context6.next = 21;
|
|
|
break;
|
|
|
case 19:
|
|
|
_param = data[activeIndex - 1];
|
|
|
setActive(_param === null || _param === void 0 ? void 0 : _param.id);
|
|
|
case 21:
|
|
|
if (!(type === 'next')) {
|
|
|
_context6.next = 39;
|
|
|
break;
|
|
|
}
|
|
|
if (!(activeIndex === undefined)) {
|
|
|
_context6.next = 25;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('下一题解不存在');
|
|
|
return _context6.abrupt("return");
|
|
|
case 25:
|
|
|
if (!((params.page - 1) * params.limit + (activeIndex + 1) === params.total)) {
|
|
|
_context6.next = 28;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('下一题解不存在');
|
|
|
return _context6.abrupt("return");
|
|
|
case 28:
|
|
|
if (!(activeIndex + 1 === params.limit)) {
|
|
|
_context6.next = 37;
|
|
|
break;
|
|
|
}
|
|
|
params.page = params.page + 1;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
_context6.next = 33;
|
|
|
return getData(params);
|
|
|
case 33:
|
|
|
_res = _context6.sent;
|
|
|
if ((_res === null || _res === void 0 ? void 0 : _res.status) === 0) {
|
|
|
_param2 = _res === null || _res === void 0 || (_res$data6 = _res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.articles[0];
|
|
|
setActive(_param2 === null || _param2 === void 0 ? void 0 : _param2.id);
|
|
|
}
|
|
|
_context6.next = 39;
|
|
|
break;
|
|
|
case 37:
|
|
|
//页码中间
|
|
|
_param3 = data[activeIndex + 1];
|
|
|
setActive(_param3 === null || _param3 === void 0 ? void 0 : _param3.id);
|
|
|
case 39:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return function handleArticlesSkip(_x5, _x6) {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: FilterListmodules.wrap,
|
|
|
ref: leftWarp,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: FilterListmodules.head,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: FilterListmodules.sort,
|
|
|
onClick: handleSorter,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u6700\u65B0"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(CaretUpOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
color: (params === null || params === void 0 ? void 0 : params.sort_direction) === 'asc' ? '#0152d9' : '#bfbfbf'
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CaretDownOutlined/* default */.Z, {
|
|
|
style: {
|
|
|
color: (params === null || params === void 0 ? void 0 : params.sort_direction) === 'desc' ? '#0152d9' : '#bfbfbf'
|
|
|
}
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
value: params.save_search,
|
|
|
className: FilterListmodules['oj-width-input'],
|
|
|
placeholder: "\u641C\u7D22\u9898\u89E3",
|
|
|
onChange: function onChange(e) {
|
|
|
params.save_search = e.target.value;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
},
|
|
|
onSearch: handleSearch
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: addProblems,
|
|
|
className: FilterListmodules.btn,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: a
|
|
|
}), "\u5199\u9898\u89E3"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: FilterListmodules.listWarp,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
spinning: loading,
|
|
|
className: "mt20",
|
|
|
children: [data === null || data === void 0 ? void 0 : data.map(function (e, i) {
|
|
|
var showLine = true;
|
|
|
if (i + 1 === data.length && i !== 0) {
|
|
|
showLine = false;
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(FilterList_List, {
|
|
|
active: active,
|
|
|
data: e,
|
|
|
showLine: showLine,
|
|
|
onClick: handleDetails,
|
|
|
onAssist: handleAssist,
|
|
|
onHide: handleHide
|
|
|
}, e.id);
|
|
|
}), (data === null || data === void 0 ? void 0 : data.length) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
|
customText: "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
className: FilterListmodules.pagination,
|
|
|
showTotal: function showTotal(total) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#656F87'
|
|
|
},
|
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: total
|
|
|
}), "\u6761\u6570\u636E"]
|
|
|
});
|
|
|
},
|
|
|
total: params.total,
|
|
|
showSizeChanger: false,
|
|
|
current: params === null || params === void 0 ? void 0 : params.page,
|
|
|
onChange: handleChange,
|
|
|
hideOnSinglePage: true,
|
|
|
showQuickJumper: true
|
|
|
}), status > 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: FilterListmodules.fixedRight,
|
|
|
style: {
|
|
|
width: width
|
|
|
},
|
|
|
children: [status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(ListForm, {
|
|
|
identifier: identifier,
|
|
|
onClose: handleClose,
|
|
|
onOk: handleOk
|
|
|
}), status === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(ListForm, {
|
|
|
active: active,
|
|
|
identifier: identifier,
|
|
|
onClose: handleClose,
|
|
|
onOk: handleEditOk
|
|
|
}), status === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)(ListDetails, {
|
|
|
btnShowStatus: btnShowStatus,
|
|
|
onArticlesSkip: handleArticlesSkip,
|
|
|
detailsIndex: detailsIndex,
|
|
|
active: active,
|
|
|
identifier: identifier,
|
|
|
onClose: handleClose,
|
|
|
onOk: handleDetailsOk,
|
|
|
onEdit: handleEdit,
|
|
|
onAssist: handleAssist,
|
|
|
onDelete: handleDelete
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var LeftPanel_FilterList = (FilterList);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Drawer/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Drawermodules = ({"flex_box_center":"flex_box_center___BbEkt","flex_space_between":"flex_space_between___v3cDl","flex_box_vertical_center":"flex_box_vertical_center___wUFLn","flex_box_center_end":"flex_box_center_end___Tdr08","flex_box_column":"flex_box_column___fYHlj","flex-col":"flex-col____HKJ3","flex-row":"flex-row___uYKba","justify-start":"justify-start___cTL9f","justify-center":"justify-center___wdDvn","justify-end":"justify-end___ibNgE","justify-evenly":"justify-evenly___g5Hjg","justify-around":"justify-around___iei7r","justify-between":"justify-between___FHdn1","align-start":"align-start___qbSTw","align-center":"align-center___e0HxG","align-end":"align-end___kBIpx","wrap":"wrap___UAZFM","head":"head___Nl6hk","title":"title___Ir573","content":"content___xUewa","list":"list___oi2ig","footer":"footer___V3bwQ"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Drawer/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Drawer = function Drawer(_ref) {
|
|
|
var _tableData;
|
|
|
var visible = _ref.visible,
|
|
|
onVisible = _ref.onVisible,
|
|
|
value = _ref.value,
|
|
|
onChange = _ref.onChange,
|
|
|
setIndex = _ref.setIndex;
|
|
|
var initParams = {
|
|
|
page: 1,
|
|
|
per_page: 30,
|
|
|
total: 0,
|
|
|
tag_discipline_id: [],
|
|
|
//知识点
|
|
|
search: '',
|
|
|
save_search: '',
|
|
|
difficulty: null
|
|
|
};
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(initParams),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
params = _useState2[0],
|
|
|
setParams = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
pointData = _useState4[0],
|
|
|
setPointData = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
tableData = _useState6[0],
|
|
|
setTableData = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
loading = _useState8[0],
|
|
|
setLoading = _useState8[1];
|
|
|
var data = (0,_react_17_0_2_react.useRef)([]);
|
|
|
var timer = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var urlParams = (0,_umi_production_exports.useParams)();
|
|
|
|
|
|
//30秒发一次记录
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (urlParams !== null && urlParams !== void 0 && urlParams.id) {
|
|
|
timer.current = setInterval(function () {
|
|
|
setTime(30);
|
|
|
}, 30000);
|
|
|
}
|
|
|
return function () {
|
|
|
clearInterval(timer.current);
|
|
|
};
|
|
|
}, []);
|
|
|
var setTime = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(num) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,service/* setLogTime */.uc)(urlParams === null || urlParams === void 0 ? void 0 : urlParams.id, {
|
|
|
practice_time: num
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function setTime(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData(params);
|
|
|
getPointData();
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
window.addEventListener('click', handleSkip);
|
|
|
return function () {
|
|
|
window.removeEventListener('click', handleSkip);
|
|
|
};
|
|
|
}, [urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier, visible]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var paramIndex = data.current.findIndex(function (e) {
|
|
|
return e.identifier === (urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier);
|
|
|
});
|
|
|
var paramPrev = data.current[paramIndex - 1];
|
|
|
var paramNext = data.current[paramIndex + 1];
|
|
|
var prev = document.getElementById('oj-prev');
|
|
|
var next = document.getElementById('oj-next');
|
|
|
if (paramPrev) {
|
|
|
prev.style.display = 'block';
|
|
|
} else {
|
|
|
prev.style.display = 'none';
|
|
|
}
|
|
|
if (paramNext) {
|
|
|
next.style.display = 'block';
|
|
|
} else {
|
|
|
next.style.display = 'none';
|
|
|
}
|
|
|
}, [urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier, data.current]);
|
|
|
|
|
|
//父级找元素
|
|
|
var parentIndexOf = function parentIndexOf(node, parent) {
|
|
|
if (node.id === parent) {
|
|
|
return node;
|
|
|
}
|
|
|
for (var i = 0, n = node; n = n.parentNode; i++) {
|
|
|
if (n.id === parent) {
|
|
|
return n;
|
|
|
}
|
|
|
if (n == document.documentElement) {
|
|
|
return false;
|
|
|
} //找不到目标父节点,防止死循环
|
|
|
}
|
|
|
};
|
|
|
var handleSkip = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(e) {
|
|
|
var paramIndex, paramPrev, paramNext;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (!parentIndexOf(e.target, 'oj-drawer') && visible) {
|
|
|
onVisible(false);
|
|
|
}
|
|
|
paramIndex = data.current.findIndex(function (e) {
|
|
|
return e.identifier === (urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier);
|
|
|
});
|
|
|
paramPrev = data.current[paramIndex - 1];
|
|
|
paramNext = data.current[paramIndex + 1];
|
|
|
if (!(e.target.id === 'oj-prev')) {
|
|
|
_context2.next = 14;
|
|
|
break;
|
|
|
}
|
|
|
if (!(!paramPrev || paramIndex === -1)) {
|
|
|
_context2.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('上一题不存在');
|
|
|
return _context2.abrupt("return");
|
|
|
case 8:
|
|
|
e.target.style.pointerEvents = 'none';
|
|
|
e.target.style.cursor = 'not-allowed';
|
|
|
_context2.next = 12;
|
|
|
return skip(paramPrev === null || paramPrev === void 0 ? void 0 : paramPrev.identifier);
|
|
|
case 12:
|
|
|
setIndex('0');
|
|
|
setTimeout(function () {
|
|
|
e.target.style.pointerEvents = 'auto';
|
|
|
e.target.style.cursor = 'pointer';
|
|
|
}, 400);
|
|
|
case 14:
|
|
|
if (!(e.target.id === 'oj-next' || e.target.id === 'oj-modal-next')) {
|
|
|
_context2.next = 24;
|
|
|
break;
|
|
|
}
|
|
|
if (!(!paramNext || paramIndex === -1)) {
|
|
|
_context2.next = 18;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.warning('下一题不存在');
|
|
|
return _context2.abrupt("return");
|
|
|
case 18:
|
|
|
e.target.style.pointerEvents = 'none';
|
|
|
e.target.style.cursor = 'not-allowed';
|
|
|
_context2.next = 22;
|
|
|
return skip(paramNext === null || paramNext === void 0 ? void 0 : paramNext.identifier);
|
|
|
case 22:
|
|
|
setIndex('0');
|
|
|
setTimeout(function () {
|
|
|
e.target.style.pointerEvents = 'auto';
|
|
|
e.target.style.cursor = 'pointer';
|
|
|
}, 400);
|
|
|
case 24:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleSkip(_x2) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
onChange(urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier);
|
|
|
var page = tableData.findIndex(function (e) {
|
|
|
return e.some(function (r) {
|
|
|
return r.identifier === (urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier);
|
|
|
});
|
|
|
});
|
|
|
if (page === -1) {
|
|
|
setParams(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
page: 1
|
|
|
}));
|
|
|
} else {
|
|
|
setParams(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
page: page + 1
|
|
|
}));
|
|
|
}
|
|
|
}, [urlParams === null || urlParams === void 0 ? void 0 : urlParams.save_identifier, tableData]);
|
|
|
var handlePoint = function handlePoint(v) {
|
|
|
params.page = 1;
|
|
|
params.tag_discipline_id = v;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var getPointData = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/tag_disciplines.json", {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
target: 'practice',
|
|
|
position: 'index'
|
|
|
}
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
setPointData(res.tag_disciplines || []);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function getPointData() {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleSelect = function handleSelect(v) {
|
|
|
params.page = 1;
|
|
|
params.difficulty = typeof v === 'number' ? v : null;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
};
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(record) {
|
|
|
var res, _res$practices_list, arr_length, newArr, i, _res$practices_list2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
setLoading(true);
|
|
|
_context4.next = 3;
|
|
|
return (0,service/* practicesList */.KC)(record);
|
|
|
case 3:
|
|
|
res = _context4.sent;
|
|
|
if (res !== null && res !== void 0 && res.practices_list) {
|
|
|
arr_length = res === null || res === void 0 || (_res$practices_list = res.practices_list) === null || _res$practices_list === void 0 ? void 0 : _res$practices_list.length;
|
|
|
newArr = [];
|
|
|
for (i = 0; i < arr_length; i += params === null || params === void 0 ? void 0 : params.per_page) {
|
|
|
newArr.push(res === null || res === void 0 || (_res$practices_list2 = res.practices_list) === null || _res$practices_list2 === void 0 ? void 0 : _res$practices_list2.slice(i, i + (params === null || params === void 0 ? void 0 : params.per_page)));
|
|
|
}
|
|
|
setParams(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
total: res === null || res === void 0 ? void 0 : res.practices_count
|
|
|
}));
|
|
|
data.current = (res === null || res === void 0 ? void 0 : res.practices_list) || [];
|
|
|
setTableData(newArr);
|
|
|
}
|
|
|
setLoading(false);
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function getData(_x3) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var skip = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(v, e) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
_context5.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/practices/".concat(v, "/start"), {
|
|
|
method: 'get'
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context5.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
_umi_production_exports.history.push("/problems/".concat(res === null || res === void 0 ? void 0 : res.identifier, "/oj/").concat(v));
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function skip(_x4, _x5) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChange = function handleChange(current) {
|
|
|
params.page = current;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Drawermodules.wrap,
|
|
|
id: "oj-drawer",
|
|
|
style: {
|
|
|
left: visible ? 0 : -700
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Drawermodules.head,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Drawermodules.title,
|
|
|
children: "\u9898\u76EE\u5217\u8868"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
|
|
|
value: params === null || params === void 0 ? void 0 : params.save_search,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",
|
|
|
style: {
|
|
|
width: 180,
|
|
|
marginLeft: 'auto',
|
|
|
marginRight: 10
|
|
|
},
|
|
|
onChange: function onChange(e) {
|
|
|
params.save_search = e.target.value;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
},
|
|
|
onSearch: function onSearch() {
|
|
|
params.page = 1;
|
|
|
params.search = params.save_search;
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
getData(params);
|
|
|
}
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
value: params === null || params === void 0 ? void 0 : params.tag_discipline_id,
|
|
|
style: {
|
|
|
width: 210
|
|
|
},
|
|
|
mode: "multiple",
|
|
|
placeholder: "\u9009\u62E9\u77E5\u8BC6\u70B9",
|
|
|
showSearch: false,
|
|
|
showArrow: true,
|
|
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
|
return trigger.parentNode;
|
|
|
},
|
|
|
maxTagTextLength: 2,
|
|
|
maxTagCount: 2,
|
|
|
onChange: handlePoint,
|
|
|
children: pointData.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: e.id,
|
|
|
children: e.name
|
|
|
}, e.id);
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_select["default"], {
|
|
|
style: {
|
|
|
width: 70,
|
|
|
marginLeft: 10
|
|
|
},
|
|
|
allowClear: true,
|
|
|
placeholder: "\u96BE\u5EA6",
|
|
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
|
return trigger.parentNode;
|
|
|
},
|
|
|
value: params === null || params === void 0 ? void 0 : params.difficulty,
|
|
|
onChange: handleSelect,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 1,
|
|
|
children: "\u7B80\u5355"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 2,
|
|
|
children: "\u9002\u4E2D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: 3,
|
|
|
children: "\u56F0\u96BE"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Drawermodules.content,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
spinning: loading,
|
|
|
children: tableData === null || tableData === void 0 || (_tableData = tableData[params.page - 1]) === null || _tableData === void 0 ? void 0 : _tableData.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Drawermodules.list,
|
|
|
onClick: function onClick(target) {
|
|
|
return skip(e.identifier, target);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
visibility: value === e.identifier ? 'visible' : 'hidden'
|
|
|
},
|
|
|
className: "iconfont icon-wancheng1 c-green-29b"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
fontWeight: value === e.identifier ? 'bold' : 400,
|
|
|
color: value === e.identifier ? '#ffffff' : '#bac4cd'
|
|
|
},
|
|
|
title: e === null || e === void 0 ? void 0 : e.name,
|
|
|
children: e.name
|
|
|
}), (e === null || e === void 0 ? void 0 : e.difficulty) === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
style: {
|
|
|
color: '#2FA34F'
|
|
|
},
|
|
|
children: "\u7B80\u5355"
|
|
|
}), (e === null || e === void 0 ? void 0 : e.difficulty) === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
style: {
|
|
|
color: '#0152d9'
|
|
|
},
|
|
|
children: "\u9002\u4E2D"
|
|
|
}), (e === null || e === void 0 ? void 0 : e.difficulty) === 3 && /*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
style: {
|
|
|
color: '#FA6400'
|
|
|
},
|
|
|
children: "\u56F0\u96BE"
|
|
|
})]
|
|
|
}, e.identifier);
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Drawermodules.footer,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
showTotal: function showTotal(total) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#656F87'
|
|
|
},
|
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: total
|
|
|
}), "\u6761\u6570\u636E"]
|
|
|
});
|
|
|
},
|
|
|
total: params.total,
|
|
|
pageSize: params === null || params === void 0 ? void 0 : params.per_page,
|
|
|
current: params === null || params === void 0 ? void 0 : params.page,
|
|
|
showSizeChanger: false,
|
|
|
onChange: handleChange,
|
|
|
showQuickJumper: true,
|
|
|
hideOnSinglePage: true
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var LeftPanel_Drawer = (Drawer);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var LeftPanel = (function (_ref) {
|
|
|
var hack = _ref.hack,
|
|
|
onTriggerPraise = _ref.onTriggerPraise,
|
|
|
topicId = _ref.topicId,
|
|
|
page = _ref.page,
|
|
|
onPageChange = _ref.onPageChange,
|
|
|
user = _ref.user,
|
|
|
submitRecords = _ref.submitRecords,
|
|
|
submitting = _ref.submitting,
|
|
|
submitResult = _ref.submitResult;
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(searchParams.get("tab") || '0'),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
index = _useState2[0],
|
|
|
setIndex = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
discussTotal = _useState4[0],
|
|
|
setDiscussTotal = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
listStatus = _useState6[0],
|
|
|
setListStatus = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
filterListTotal = _useState8[0],
|
|
|
setFilterListTotal = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
questionValue = _useState10[0],
|
|
|
setQuestionValue = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
visible = _useState12[0],
|
|
|
setVisible = _useState12[1];
|
|
|
function onTabIndexChange(e) {
|
|
|
var id = e.target.id;
|
|
|
if (index === '3' && id !== index && (listStatus === 1 || listStatus === 2)) {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
width: 500,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '注意',
|
|
|
icon: null,
|
|
|
className: 'custom-modal-divider',
|
|
|
content: '您正在编写题解,点击关闭后,您的题解内容将不会进行保存。',
|
|
|
onOk: function onOk() {
|
|
|
setIndex(id);
|
|
|
}
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
setIndex(id);
|
|
|
}
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var unSub = mediator/* default */.Z.subscribe('to-commit-info', function () {
|
|
|
setIndex('1');
|
|
|
});
|
|
|
return unSub;
|
|
|
}, []);
|
|
|
function toDiscuss() {
|
|
|
setIndex('2');
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: LeftPanelmodules["left-panel"],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
|
|
|
className: "".concat(LeftPanelmodules["s-navs"], " ").concat(LeftPanelmodules["bg-white"], " ").concat(LeftPanelmodules.b1),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: "mr40 current",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
onClick: function onClick() {
|
|
|
return setVisible(true);
|
|
|
},
|
|
|
src: show
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: LeftPanelmodules["oj-mr"],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: index === '0' ? LeftPanelmodules.active : '',
|
|
|
id: "0",
|
|
|
onClick: onTabIndexChange,
|
|
|
children: "\u4EFB\u52A1\u63CF\u8FF0"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: LeftPanelmodules["oj-mr"],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
className: index === '3' ? LeftPanelmodules.active : '',
|
|
|
id: "3",
|
|
|
onClick: onTabIndexChange,
|
|
|
children: ["\u9898\u89E3", filterListTotal ? "(".concat(filterListTotal, ")") : '']
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
className: LeftPanelmodules["oj-mr"],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
className: index === '2' ? LeftPanelmodules.active : '',
|
|
|
id: "2",
|
|
|
onClick: onTabIndexChange,
|
|
|
children: ["\u8BC4\u8BBA", discussTotal ? "(".concat(discussTotal, ")") : '']
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
className: index === '1' ? LeftPanelmodules.active : '',
|
|
|
id: "1",
|
|
|
onClick: onTabIndexChange,
|
|
|
children: "\u63D0\u4EA4\u8BB0\u5F55"
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(LeftPanelmodules["tab-panel-body"], " ").concat(index === '0' ? '' : 'hide'),
|
|
|
style: {
|
|
|
padding: '0 0 0 16px'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Description, {
|
|
|
hack: hack,
|
|
|
onTriggerPraise: onTriggerPraise,
|
|
|
toDiscuss: toDiscuss
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(LeftPanelmodules["tab-panel-body"], " ").concat(index === '1' ? '' : 'hide'),
|
|
|
children: !!(submitRecords !== null && submitRecords !== void 0 && submitRecords.records_count) ? /*#__PURE__*/(0,jsx_runtime.jsx)(SubmitList, {
|
|
|
page: page,
|
|
|
onPageChange: onPageChange,
|
|
|
topicId: topicId,
|
|
|
submitting: submitting,
|
|
|
submitRecords: submitRecords,
|
|
|
submitResult: submitResult
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(LeftPanelmodules["tab-panel-body"], " ").concat(index === '2' ? '' : 'hide'),
|
|
|
style: {
|
|
|
padding: 0
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Discuss, {
|
|
|
setDiscussTotal: setDiscussTotal,
|
|
|
user: user,
|
|
|
identifier: hack.identifier,
|
|
|
hack: hack,
|
|
|
onTriggerPraise: onTriggerPraise
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(LeftPanelmodules["tab-panel-body"], " ").concat(index === '3' ? '' : 'hide'),
|
|
|
style: {
|
|
|
padding: 0
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(LeftPanel_FilterList, {
|
|
|
setListStatus: setListStatus,
|
|
|
setFilterListTotal: setFilterListTotal,
|
|
|
tabStatus: index,
|
|
|
identifier: hack.identifier
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(LeftPanel_Drawer, {
|
|
|
visible: visible,
|
|
|
setIndex: setIndex,
|
|
|
onVisible: function onVisible(v) {
|
|
|
return setVisible(v);
|
|
|
},
|
|
|
value: questionValue,
|
|
|
onChange: function onChange(v) {
|
|
|
return setQuestionValue(v);
|
|
|
}
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/components/Timepiece/index.tsx
|
|
|
var Timepiece = __webpack_require__(79258);
|
|
|
// EXTERNAL MODULE: ./src/assets/images/question/internal.png
|
|
|
var internal = __webpack_require__(62522);
|
|
|
// EXTERNAL MODULE: ./src/assets/images/question/time.svg
|
|
|
var time = __webpack_require__(35081);
|
|
|
// EXTERNAL MODULE: ./src/assets/images/question/title.svg
|
|
|
var title = __webpack_require__(13544);
|
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.23@lodash/lodash.js
|
|
|
var lodash = __webpack_require__(78267);
|
|
|
var lodash_default = /*#__PURE__*/__webpack_require__.n(lodash);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-copy-to-clipboard@5.0.2@react-copy-to-clipboard/lib/index.js
|
|
|
var lib = __webpack_require__(56102);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["id", "input", "showNote", "onShowNote", "notes", "onCancelNote", "onAddNote", "debugResult", "language", "debuging", "submitting", "executingMessage", "code", "onSubmitCode", "onDebugCode", "onChangeCode", "onChangeInput", "onUpdateCode"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Countdown = statistic/* default */.Z.Countdown;
|
|
|
var LanguageSuf = {
|
|
|
'Java': 'java',
|
|
|
'C': 'c',
|
|
|
'Python': 'py',
|
|
|
'C++': 'c'
|
|
|
};
|
|
|
var OjProblem_Types = /*#__PURE__*/function (Types) {
|
|
|
Types[Types["SET_LOADING"] = 0] = "SET_LOADING";
|
|
|
Types[Types["GET_DATA"] = 1] = "GET_DATA";
|
|
|
Types[Types["GET_SUBMIT_RECORDS"] = 2] = "GET_SUBMIT_RECORDS";
|
|
|
Types[Types["SET_DATA"] = 3] = "SET_DATA";
|
|
|
Types[Types["SET_DEBUGING"] = 4] = "SET_DEBUGING";
|
|
|
Types[Types["SET_SUBMITING"] = 5] = "SET_SUBMITING";
|
|
|
Types[Types["SET_EXECUTE_MESSAGE"] = 6] = "SET_EXECUTE_MESSAGE";
|
|
|
Types[Types["SET_EXECUTE_RESULT"] = 7] = "SET_EXECUTE_RESULT";
|
|
|
Types[Types["SET_SUBMIT_RESULT"] = 8] = "SET_SUBMIT_RESULT";
|
|
|
Types[Types["SET_SHOW_NOTE"] = 9] = "SET_SHOW_NOTE";
|
|
|
Types[Types["SET_PAGE"] = 10] = "SET_PAGE";
|
|
|
Types[Types["GET_LANGUAGE"] = 11] = "GET_LANGUAGE";
|
|
|
Types[Types["GET_DRAWER"] = 12] = "GET_DRAWER";
|
|
|
return Types;
|
|
|
}(OjProblem_Types || {});
|
|
|
function getTimeStamp() {
|
|
|
return new Date().getTime();
|
|
|
}
|
|
|
var initalilState = {
|
|
|
loading: true,
|
|
|
data: undefined,
|
|
|
showNote: false,
|
|
|
debugResult: undefined,
|
|
|
submitResult: undefined,
|
|
|
debuging: false,
|
|
|
submitting: false,
|
|
|
submitRecords: undefined,
|
|
|
submitRecordPage: 1,
|
|
|
executingMessage: '',
|
|
|
languageValue: '',
|
|
|
languageList: [],
|
|
|
drawerData: []
|
|
|
};
|
|
|
function OjProblem_reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case OjProblem_Types.GET_DATA:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case OjProblem_Types.SET_DATA:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
data: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.SET_LOADING:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
loading: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.GET_LANGUAGE:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
languageList: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.GET_DRAWER:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
drawerData: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.SET_SHOW_NOTE:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
showNote: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.SET_DEBUGING:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
debuging: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.SET_SUBMITING:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
submitting: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.GET_SUBMIT_RECORDS:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
submitRecords: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.SET_PAGE:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
submitRecordPage: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.SET_EXECUTE_MESSAGE:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
executingMessage: action.payload
|
|
|
});
|
|
|
case OjProblem_Types.SET_EXECUTE_RESULT:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
case OjProblem_Types.SET_SUBMIT_RESULT:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
/* harmony default export */ var OjProblem = (function (_ref) {
|
|
|
var _data$test_case, _window$location;
|
|
|
var children = _ref.children;
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(OjProblem_reducer, initalilState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var _useParams = (0,_umi_production_exports.useParams)(),
|
|
|
id = _useParams.id;
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var languageValue = state.languageValue,
|
|
|
languageList = state.languageList,
|
|
|
loading = state.loading,
|
|
|
data = state.data,
|
|
|
debugResult = state.debugResult,
|
|
|
submitResult = state.submitResult,
|
|
|
submitRecords = state.submitRecords,
|
|
|
submitRecordPage = state.submitRecordPage,
|
|
|
showNote = state.showNote,
|
|
|
debuging = state.debuging,
|
|
|
submitting = state.submitting,
|
|
|
executingMessage = state.executingMessage;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)("#FFF"),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
countDownColor = _useState2[0],
|
|
|
setCountDownColor = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
countDownTime = _useState4[0],
|
|
|
setCountDownTime = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
exerciseData = _useState6[0],
|
|
|
setExerciseData = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
passModalData = _useState8[0],
|
|
|
setPassModalData = _useState8[1];
|
|
|
var timer = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var saveData = (0,_react_17_0_2_react.useRef)(null);
|
|
|
var user = data === null || data === void 0 ? void 0 : data.user;
|
|
|
var hack = data === null || data === void 0 ? void 0 : data.hack;
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
|
|
type: 'globalSetting/headerFooterToggle',
|
|
|
payload: false
|
|
|
});
|
|
|
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
|
|
type: 'globalSetting/onlyShowBackTopToggle',
|
|
|
payload: true
|
|
|
});
|
|
|
return function () {
|
|
|
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
|
|
type: 'globalSetting/headerFooterToggle',
|
|
|
payload: true
|
|
|
});
|
|
|
(0,_umi_production_exports.getDvaApp)()._store.dispatch({
|
|
|
type: 'globalSetting/onlyShowBackTopToggle',
|
|
|
payload: false
|
|
|
});
|
|
|
};
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setTimeout(function () {
|
|
|
document.title = "在线刷题";
|
|
|
}, 400);
|
|
|
});
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (passModalData) {
|
|
|
var _next$style;
|
|
|
var next = document.getElementById('oj-next');
|
|
|
var modalNext = document.getElementById('oj-modal-next');
|
|
|
if ((next === null || next === void 0 || (_next$style = next.style) === null || _next$style === void 0 ? void 0 : _next$style.display) === 'none') {
|
|
|
modalNext.style.display = 'none';
|
|
|
} else {
|
|
|
modalNext.style.display = 'block';
|
|
|
}
|
|
|
}
|
|
|
}, [passModalData]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
function init() {
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
function _init() {
|
|
|
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var response, _response$hack, _response$hack2, _response$hack3, recordStr;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,service/* getProgrammingTopic */.fu)(id);
|
|
|
case 2:
|
|
|
response = _context.sent;
|
|
|
if (response.status === 401) {
|
|
|
document.location.href = '/user/login';
|
|
|
// history.replace('/user/login', { from: location.pathname })
|
|
|
} else {
|
|
|
response.hack = response.practice;
|
|
|
response.hack.code = base64.Base64.decode(response === null || response === void 0 || (_response$hack = response.hack) === null || _response$hack === void 0 ? void 0 : _response$hack.code);
|
|
|
recordStr = "".concat(user === null || user === void 0 ? void 0 : user.login, "-language");
|
|
|
if (localStorage.getItem(recordStr)) {
|
|
|
response.hack.language = localStorage.getItem(recordStr);
|
|
|
}
|
|
|
saveData.current = lodash_default().cloneDeep(response);
|
|
|
saveData.current.language = response === null || response === void 0 || (_response$hack2 = response.hack) === null || _response$hack2 === void 0 ? void 0 : _response$hack2.language;
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.GET_DATA,
|
|
|
payload: {
|
|
|
loading: false,
|
|
|
data: response
|
|
|
}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SUBMIT_RESULT,
|
|
|
payload: {
|
|
|
languageValue: response === null || response === void 0 || (_response$hack3 = response.hack) === null || _response$hack3 === void 0 ? void 0 : _response$hack3.language
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
if (id) {
|
|
|
init();
|
|
|
}
|
|
|
}, [id]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SUBMIT_RESULT,
|
|
|
payload: {
|
|
|
debugResult: undefined
|
|
|
}
|
|
|
});
|
|
|
getLanguageData();
|
|
|
setPassModalData(false);
|
|
|
}, [id]);
|
|
|
|
|
|
//清除代码保存定时器
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
clearTimeout(timer.current);
|
|
|
}, [id]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getSubmitRecordsData();
|
|
|
}, [id, submitRecordPage]);
|
|
|
var backExercise = function backExercise() {
|
|
|
window.parent.postMessage('backExercise', '*');
|
|
|
// history.push(`/classrooms/${searchParams.get("coursesId")}/exercise/${searchParams.get("exercisesId")}/users/${searchParams.get("login")}`)
|
|
|
};
|
|
|
function getSubmitRecordsData() {
|
|
|
return _getSubmitRecordsData.apply(this, arguments);
|
|
|
}
|
|
|
function _getSubmitRecordsData() {
|
|
|
_getSubmitRecordsData = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.prev = 0;
|
|
|
_context4.next = 3;
|
|
|
return (0,service/* getSubmitRecords */.zO)(id, {
|
|
|
limit: 15,
|
|
|
page: submitRecordPage
|
|
|
});
|
|
|
case 3:
|
|
|
response = _context4.sent;
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.GET_SUBMIT_RECORDS,
|
|
|
payload: response
|
|
|
});
|
|
|
_context4.next = 10;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context4.prev = 7;
|
|
|
_context4.t0 = _context4["catch"](0);
|
|
|
console.log(_context4.t0);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4, null, [[0, 7]]);
|
|
|
}));
|
|
|
return _getSubmitRecordsData.apply(this, arguments);
|
|
|
}
|
|
|
function getLanguageData() {
|
|
|
return _getLanguageData.apply(this, arguments);
|
|
|
}
|
|
|
function _getLanguageData() {
|
|
|
_getLanguageData = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
_context5.prev = 0;
|
|
|
_context5.next = 3;
|
|
|
return (0,service/* updateLanguageCode */.dd)(id);
|
|
|
case 3:
|
|
|
response = _context5.sent;
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.GET_LANGUAGE,
|
|
|
payload: response === null || response === void 0 ? void 0 : response.data
|
|
|
});
|
|
|
_context5.next = 10;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context5.prev = 7;
|
|
|
_context5.t0 = _context5["catch"](0);
|
|
|
console.log(_context5.t0);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5, null, [[0, 7]]);
|
|
|
}));
|
|
|
return _getLanguageData.apply(this, arguments);
|
|
|
}
|
|
|
function onPageChange(value) {
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_PAGE,
|
|
|
payload: value
|
|
|
});
|
|
|
}
|
|
|
function onUpdateCode(_x) {
|
|
|
return _onUpdateCode.apply(this, arguments);
|
|
|
}
|
|
|
function _onUpdateCode() {
|
|
|
_onUpdateCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(re) {
|
|
|
var _window;
|
|
|
var relId, response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
relId = ((_window = window) === null || _window === void 0 || (_window = _window.location) === null || _window === void 0 || (_window = _window.pathname) === null || _window === void 0 || (_window = _window.split('/')) === null || _window === void 0 ? void 0 : _window[2]) || id;
|
|
|
_context6.next = 3;
|
|
|
return (0,service/* updateCode */.n4)(relId, re ? re : {
|
|
|
code: base64.Base64.encode(hack.code),
|
|
|
language: languageValue
|
|
|
});
|
|
|
case 3:
|
|
|
response = _context6.sent;
|
|
|
return _context6.abrupt("return", response);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
return _onUpdateCode.apply(this, arguments);
|
|
|
}
|
|
|
function onSubmitCode() {
|
|
|
return _onSubmitCode.apply(this, arguments);
|
|
|
}
|
|
|
function _onSubmitCode() {
|
|
|
_onSubmitCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
var response, executeCode, submitCodeParams, res, time_limit, test_case_size, startTime;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
if (!submitting) {
|
|
|
_context8.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context8.abrupt("return");
|
|
|
case 2:
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SUBMITING,
|
|
|
payload: true
|
|
|
});
|
|
|
_context8.prev = 3;
|
|
|
mediator/* default */.Z.publish('to-commit-info');
|
|
|
_context8.next = 7;
|
|
|
return onUpdateCode();
|
|
|
case 7:
|
|
|
response = _context8.sent;
|
|
|
if (!(response.status === 0)) {
|
|
|
_context8.next = 20;
|
|
|
break;
|
|
|
}
|
|
|
executeCode = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
var _yield$getOperationRe, status, data, executeTime, isTimeOut, submitResponse;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
_context7.next = 2;
|
|
|
return (0,service/* getOperationResult */.rX)(id, 'submit');
|
|
|
case 2:
|
|
|
_yield$getOperationRe = _context7.sent;
|
|
|
status = _yield$getOperationRe.status;
|
|
|
data = _yield$getOperationRe.data;
|
|
|
executeTime = getTimeStamp();
|
|
|
isTimeOut = executeTime - startTime > (time_limit * test_case_size + 3) * 1000;
|
|
|
if (status !== 0 && !isTimeOut) {
|
|
|
setTimeout(executeCode, 1000);
|
|
|
}
|
|
|
if (!isTimeOut) {
|
|
|
_context7.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
modal/* default */.Z.error({
|
|
|
centered: true,
|
|
|
okText: '知道啦',
|
|
|
title: '评测代码超时'
|
|
|
});
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SUBMITING,
|
|
|
payload: false
|
|
|
});
|
|
|
return _context7.abrupt("return");
|
|
|
case 12:
|
|
|
if (!(status === 0)) {
|
|
|
_context7.next = 19;
|
|
|
break;
|
|
|
}
|
|
|
if (data.status === 2) {
|
|
|
modal/* default */.Z.error({
|
|
|
centered: true,
|
|
|
okText: '知道啦',
|
|
|
title: '评测代码超时'
|
|
|
});
|
|
|
}
|
|
|
_context7.next = 16;
|
|
|
return (0,service/* getSubmitRecords */.zO)(id, {
|
|
|
limit: 15,
|
|
|
page: submitRecordPage
|
|
|
});
|
|
|
case 16:
|
|
|
submitResponse = _context7.sent;
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SUBMIT_RESULT,
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
submitResult: data,
|
|
|
// debugResult: data,
|
|
|
submitting: false,
|
|
|
submitRecords: submitResponse
|
|
|
})
|
|
|
});
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 0) {
|
|
|
setPassModalData(true);
|
|
|
}
|
|
|
case 19:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}));
|
|
|
return function executeCode() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
submitCodeParams = {};
|
|
|
_context8.next = 13;
|
|
|
return (0,service/* sumbitCode */.bM)(id, submitCodeParams);
|
|
|
case 13:
|
|
|
res = _context8.sent;
|
|
|
if (!(res.status === -1)) {
|
|
|
_context8.next = 17;
|
|
|
break;
|
|
|
}
|
|
|
window.parent.location.href = "/classrooms/".concat(searchParams.get("coursesId"), "/exercise/").concat(searchParams.get("exercisesId"), "/detail");
|
|
|
return _context8.abrupt("return");
|
|
|
case 17:
|
|
|
time_limit = hack.time_limit, test_case_size = hack.test_case_size;
|
|
|
startTime = getTimeStamp();
|
|
|
executeCode();
|
|
|
case 20:
|
|
|
_context8.next = 25;
|
|
|
break;
|
|
|
case 22:
|
|
|
_context8.prev = 22;
|
|
|
_context8.t0 = _context8["catch"](3);
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SUBMITING,
|
|
|
payload: false
|
|
|
});
|
|
|
case 25:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee8, null, [[3, 22]]);
|
|
|
}));
|
|
|
return _onSubmitCode.apply(this, arguments);
|
|
|
}
|
|
|
function onDebugCode() {
|
|
|
return _onDebugCode.apply(this, arguments);
|
|
|
}
|
|
|
function _onDebugCode() {
|
|
|
_onDebugCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
|
|
|
var response, executeCode, time_limit, submitCodeParams, res, startTime;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
case 0:
|
|
|
state.debuging = true;
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_DEBUGING,
|
|
|
payload: true
|
|
|
});
|
|
|
_context10.prev = 2;
|
|
|
_context10.next = 5;
|
|
|
return onUpdateCode();
|
|
|
case 5:
|
|
|
response = _context10.sent;
|
|
|
if (!(response.status === 0)) {
|
|
|
_context10.next = 20;
|
|
|
break;
|
|
|
}
|
|
|
executeCode = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
|
|
|
var _yield$getOperationRe2, status, message, data, executeTime, isTimeOut;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
case 0:
|
|
|
_context9.next = 2;
|
|
|
return (0,service/* getOperationResult */.rX)(id, 'debug');
|
|
|
case 2:
|
|
|
_yield$getOperationRe2 = _context9.sent;
|
|
|
status = _yield$getOperationRe2.status;
|
|
|
message = _yield$getOperationRe2.message;
|
|
|
data = _yield$getOperationRe2.data;
|
|
|
executeTime = getTimeStamp();
|
|
|
isTimeOut = executeTime - startTime > (time_limit + 3) * 1000;
|
|
|
if (status !== 0 && !isTimeOut) {
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_EXECUTE_MESSAGE,
|
|
|
payload: message
|
|
|
});
|
|
|
setTimeout(executeCode, 1000);
|
|
|
}
|
|
|
if (!isTimeOut) {
|
|
|
_context9.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
modal/* default */.Z.error({
|
|
|
centered: true,
|
|
|
okText: '知道啦',
|
|
|
title: '调试代码超时'
|
|
|
});
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_DEBUGING,
|
|
|
payload: false
|
|
|
});
|
|
|
return _context9.abrupt("return");
|
|
|
case 13:
|
|
|
if (status === 0) {
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_DEBUGING,
|
|
|
payload: false
|
|
|
});
|
|
|
if (data.status === 2) {
|
|
|
modal/* default */.Z.error({
|
|
|
centered: true,
|
|
|
okText: '知道啦',
|
|
|
title: '调试代码超时'
|
|
|
});
|
|
|
}
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_EXECUTE_RESULT,
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
debugResult: data,
|
|
|
debuging: false
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context9.stop();
|
|
|
}
|
|
|
}, _callee9);
|
|
|
}));
|
|
|
return function executeCode() {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
time_limit = hack.time_limit;
|
|
|
submitCodeParams = {
|
|
|
input: encodeURIComponent(data.test_case.input)
|
|
|
};
|
|
|
_context10.next = 12;
|
|
|
return (0,service/* debugCode */.MU)(id, submitCodeParams);
|
|
|
case 12:
|
|
|
res = _context10.sent;
|
|
|
if (!(res.status === -1)) {
|
|
|
_context10.next = 16;
|
|
|
break;
|
|
|
}
|
|
|
window.parent.location.href = "/classrooms/".concat(searchParams.get("coursesId"), "/exercise/").concat(searchParams.get("exercisesId"), "/detail");
|
|
|
return _context10.abrupt("return");
|
|
|
case 16:
|
|
|
startTime = getTimeStamp();
|
|
|
executeCode();
|
|
|
_context10.next = 21;
|
|
|
break;
|
|
|
case 20:
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_DEBUGING,
|
|
|
payload: false
|
|
|
});
|
|
|
case 21:
|
|
|
_context10.next = 26;
|
|
|
break;
|
|
|
case 23:
|
|
|
_context10.prev = 23;
|
|
|
_context10.t0 = _context10["catch"](2);
|
|
|
console.log(_context10.t0);
|
|
|
case 26:
|
|
|
_context10.prev = 26;
|
|
|
return _context10.finish(26);
|
|
|
case 28:
|
|
|
case "end":
|
|
|
return _context10.stop();
|
|
|
}
|
|
|
}, _callee10, null, [[2, 23, 26, 28]]);
|
|
|
}));
|
|
|
return _onDebugCode.apply(this, arguments);
|
|
|
}
|
|
|
function onChangeCode(value) {
|
|
|
var _saveData$current2;
|
|
|
clearTimeout(timer.current);
|
|
|
timer.current = setTimeout(function () {
|
|
|
var _saveData$current;
|
|
|
onUpdateCode({
|
|
|
code: base64.Base64.encode(value),
|
|
|
language: saveData === null || saveData === void 0 || (_saveData$current = saveData.current) === null || _saveData$current === void 0 ? void 0 : _saveData$current.language
|
|
|
});
|
|
|
}, 2000);
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_DATA,
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, saveData === null || saveData === void 0 ? void 0 : saveData.current), {}, {
|
|
|
hack: objectSpread2_default()(objectSpread2_default()({}, saveData === null || saveData === void 0 || (_saveData$current2 = saveData.current) === null || _saveData$current2 === void 0 ? void 0 : _saveData$current2.hack), {}, {
|
|
|
code: value
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
function onChangeInput(e) {
|
|
|
var input = e.target.value;
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_DATA,
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
test_case: {
|
|
|
input: input
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
var onChangeLanguage = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(v) {
|
|
|
var res, recordStr, response, _response$data, param;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_LOADING,
|
|
|
payload: true
|
|
|
});
|
|
|
_context2.next = 3;
|
|
|
return onUpdateCode();
|
|
|
case 3:
|
|
|
res = _context2.sent;
|
|
|
if (!(res.status === 0)) {
|
|
|
_context2.next = 14;
|
|
|
break;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SUBMIT_RESULT,
|
|
|
payload: {
|
|
|
languageValue: v
|
|
|
}
|
|
|
});
|
|
|
saveData.current.language = v;
|
|
|
recordStr = "".concat(user === null || user === void 0 ? void 0 : user.login, "-language");
|
|
|
localStorage.setItem(recordStr, v);
|
|
|
_context2.next = 11;
|
|
|
return (0,service/* updateLanguageCode */.dd)(id);
|
|
|
case 11:
|
|
|
response = _context2.sent;
|
|
|
if (response.status === 0) {
|
|
|
param = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.find(function (e) {
|
|
|
return e.language === v;
|
|
|
});
|
|
|
onChangeCode(base64.Base64.decode(param.code));
|
|
|
}
|
|
|
setTimeout(function () {
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_LOADING,
|
|
|
payload: false
|
|
|
});
|
|
|
}, 300);
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function onChangeLanguage(_x2) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
function onResetCode() {
|
|
|
return _onResetCode.apply(this, arguments);
|
|
|
}
|
|
|
function _onResetCode() {
|
|
|
_onResetCode = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
|
|
|
while (1) switch (_context11.prev = _context11.next) {
|
|
|
case 0:
|
|
|
_context11.prev = 0;
|
|
|
_context11.next = 3;
|
|
|
return (0,service/* resetCode */.H7)(id, {
|
|
|
language: languageValue
|
|
|
});
|
|
|
case 3:
|
|
|
response = _context11.sent;
|
|
|
if (response.status === 401) {
|
|
|
_umi_production_exports.history.replace('/login', {
|
|
|
from: location.pathname
|
|
|
});
|
|
|
} else {
|
|
|
onChangeCode(base64.Base64.decode(response.code));
|
|
|
getLanguageData();
|
|
|
}
|
|
|
_context11.next = 10;
|
|
|
break;
|
|
|
case 7:
|
|
|
_context11.prev = 7;
|
|
|
_context11.t0 = _context11["catch"](0);
|
|
|
console.log(_context11.t0);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context11.stop();
|
|
|
}
|
|
|
}, _callee11, null, [[0, 7]]);
|
|
|
}));
|
|
|
return _onResetCode.apply(this, arguments);
|
|
|
}
|
|
|
function onSyncCode() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
title: '提示',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"]
|
|
|
}),
|
|
|
onOk: function onOk() {
|
|
|
return asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,service/* syncCode */.fi)(id, {
|
|
|
language: languageValue
|
|
|
});
|
|
|
case 2:
|
|
|
response = _context3.sent;
|
|
|
if (response.status === 401) {
|
|
|
_umi_production_exports.history.replace('/login', {
|
|
|
from: location.pathname
|
|
|
});
|
|
|
} else {
|
|
|
onChangeCode(base64.Base64.decode(response.code));
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}))();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function onShowNote() {
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SHOW_NOTE,
|
|
|
payload: true
|
|
|
});
|
|
|
}
|
|
|
function onCancelNote() {
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_SHOW_NOTE,
|
|
|
payload: false
|
|
|
});
|
|
|
}
|
|
|
function onAddNote(_x3) {
|
|
|
return _onAddNote.apply(this, arguments);
|
|
|
}
|
|
|
function _onAddNote() {
|
|
|
_onAddNote = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12(values) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
|
|
|
while (1) switch (_context12.prev = _context12.next) {
|
|
|
case 0:
|
|
|
_context12.next = 2;
|
|
|
return (0,service/* addNotes */.MK)(id, values);
|
|
|
case 2:
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.GET_DATA,
|
|
|
payload: {
|
|
|
showNote: false,
|
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
hack: objectSpread2_default()(objectSpread2_default()({}, hack), {}, {
|
|
|
notes: values.notes
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context12.stop();
|
|
|
}
|
|
|
}, _callee12);
|
|
|
}));
|
|
|
return _onAddNote.apply(this, arguments);
|
|
|
}
|
|
|
var rightPanelOption = {
|
|
|
input: data === null || data === void 0 || (_data$test_case = data.test_case) === null || _data$test_case === void 0 ? void 0 : _data$test_case.input,
|
|
|
language: hack === null || hack === void 0 ? void 0 : hack.language,
|
|
|
code: hack === null || hack === void 0 ? void 0 : hack.code,
|
|
|
title: 'main.' + LanguageSuf[hack === null || hack === void 0 ? void 0 : hack.language],
|
|
|
modify_code: hack === null || hack === void 0 ? void 0 : hack.modify_code,
|
|
|
notes: hack === null || hack === void 0 ? void 0 : hack.notes,
|
|
|
debugResult: debugResult,
|
|
|
debuging: debuging,
|
|
|
submitting: submitting,
|
|
|
executingMessage: executingMessage,
|
|
|
id: id,
|
|
|
languageValue: languageValue,
|
|
|
languageList: languageList,
|
|
|
onChangeLanguage: onChangeLanguage,
|
|
|
onCancelNote: onCancelNote,
|
|
|
onAddNote: onAddNote,
|
|
|
showNote: showNote,
|
|
|
onShowNote: onShowNote,
|
|
|
onSubmitCode: onSubmitCode,
|
|
|
onChangeCode: onChangeCode,
|
|
|
onChangeInput: onChangeInput,
|
|
|
onDebugCode: onDebugCode,
|
|
|
onResetCode: onResetCode,
|
|
|
onSyncCode: onSyncCode,
|
|
|
onUpdateCode: onUpdateCode
|
|
|
};
|
|
|
function onTriggerPraise() {
|
|
|
return _onTriggerPraise.apply(this, arguments);
|
|
|
}
|
|
|
function _onTriggerPraise() {
|
|
|
_onTriggerPraise = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13() {
|
|
|
var _yield$triggerPlus, praise_count, rs;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
|
|
|
while (1) switch (_context13.prev = _context13.next) {
|
|
|
case 0:
|
|
|
_context13.next = 2;
|
|
|
return (0,service/* triggerPlus */.vl)(hack.id, {
|
|
|
container_type: 'Hack',
|
|
|
type: 1
|
|
|
});
|
|
|
case 2:
|
|
|
_yield$triggerPlus = _context13.sent;
|
|
|
praise_count = _yield$triggerPlus.praise_count;
|
|
|
rs = objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
|
hack: objectSpread2_default()(objectSpread2_default()({}, hack), {}, {
|
|
|
praises_count: praise_count,
|
|
|
user_praise: !hack.user_praise
|
|
|
})
|
|
|
});
|
|
|
dispatch({
|
|
|
type: OjProblem_Types.SET_DATA,
|
|
|
payload: rs
|
|
|
});
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context13.stop();
|
|
|
}
|
|
|
}, _callee13);
|
|
|
}));
|
|
|
return _onTriggerPraise.apply(this, arguments);
|
|
|
}
|
|
|
var leftPanelOption = {
|
|
|
topicId: id,
|
|
|
submitResult: submitResult,
|
|
|
submitRecords: submitRecords,
|
|
|
submitting: submitting,
|
|
|
page: submitRecordPage,
|
|
|
onPageChange: onPageChange,
|
|
|
hack: hack,
|
|
|
user: data === null || data === void 0 ? void 0 : data.user,
|
|
|
onTriggerPraise: onTriggerPraise
|
|
|
};
|
|
|
console.log(data, saveData === null || saveData === void 0 ? void 0 : saveData.current, 'data--------');
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
className: 'oj-custom-large-spin',
|
|
|
size: "large",
|
|
|
spinning: loading,
|
|
|
children: !data ? null : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: 'oj-custom-warp',
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("header", {
|
|
|
className: OjFormmodules/* default */.Z.header,
|
|
|
style: {
|
|
|
minWidth: 1200
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: "".concat(env/* default */.Z.IMG_SERVER, "/images/").concat(user.image_url),
|
|
|
alt: "user",
|
|
|
width: 30
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: user.name
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("h2", {
|
|
|
className: "flex-wrp flex_box_column flex_box_center",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: hack.name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Timepiece/* default */.Z, {
|
|
|
onChange: function onChange(v) {},
|
|
|
className: "font12 c-grey-999"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(lib.CopyToClipboard, {
|
|
|
text: "".concat((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.origin, "/problems/").concat(hack.identifier, "/share"),
|
|
|
onCopy: function onCopy() {
|
|
|
return message/* default */.ZP.success('复制题目链接成功');
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: OjFormmodules/* default */.Z.btn_back,
|
|
|
style: {
|
|
|
marginRight: 10,
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-fenxiang1 font14 mr5"
|
|
|
}), "\u5206\u4EAB\u9898\u76EE"]
|
|
|
})
|
|
|
}), hack.edit_privilege ? /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
|
|
|
className: OjFormmodules/* default */.Z.btn_back,
|
|
|
to: "/problems/".concat(hack.identifier, "/ojedit"),
|
|
|
style: {
|
|
|
marginRight: 10
|
|
|
},
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)(FormOutlined/* default */.Z, {}), " \u7F16\u8F91"]
|
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
|
|
|
className: OjFormmodules/* default */.Z.btn_back,
|
|
|
onClick: function onClick() {
|
|
|
111;
|
|
|
},
|
|
|
to: "/problems",
|
|
|
children: [" ", /*#__PURE__*/(0,jsx_runtime.jsx)(PoweroffOutlined/* default */.Z, {}), "\u9000\u51FA"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SplitContainer/* default */.Z, {
|
|
|
hideResize: true,
|
|
|
className: "my-problems oj-problems"
|
|
|
// defaultX={"40%"}
|
|
|
// hideResize={true}
|
|
|
,
|
|
|
leftChild: /*#__PURE__*/(0,jsx_runtime.jsx)(LeftPanel, objectSpread2_default()({}, leftPanelOption)),
|
|
|
rightChild: /*#__PURE__*/(0,jsx_runtime.jsx)(RightPanel, objectSpread2_default()({}, rightPanelOption))
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
closable: false,
|
|
|
width: 680,
|
|
|
footer: null,
|
|
|
open: passModalData,
|
|
|
className: "oj-modal",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "oj-modal-content",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "oj-modal-head",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: internal,
|
|
|
alt: ""
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
onClick: function onClick() {
|
|
|
return setPassModalData(false);
|
|
|
},
|
|
|
className: "iconfont icon-guanbi1"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
className: "mr30",
|
|
|
src: title/* default */.Z
|
|
|
}), "\u8FD0\u884C\u65F6\u95F4:\xA0", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#75d6ba',
|
|
|
marginRight: 100
|
|
|
},
|
|
|
children: [submitResult === null || submitResult === void 0 ? void 0 : submitResult.execute_time, "s"]
|
|
|
}), "\u4F18\u4E8E", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#f3b087',
|
|
|
margin: "0 5px"
|
|
|
},
|
|
|
children: [(submitResult === null || submitResult === void 0 ? void 0 : submitResult.time_better_than) || 100, "%"]
|
|
|
}), "\u7684\u7528\u6237"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "mb50",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: time/* default */.Z,
|
|
|
className: "mr30"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "oj-modal-tt",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5360\u7528\u5185\u5B58:\xA0"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-light-primary",
|
|
|
children: [submitResult === null || submitResult === void 0 ? void 0 : submitResult.execute_memory, "mb"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {})
|
|
|
})]
|
|
|
}), "\u4F18\u4E8E", /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#f3b087',
|
|
|
margin: "0 5px"
|
|
|
},
|
|
|
children: [(submitResult === null || submitResult === void 0 ? void 0 : submitResult.memory_better_than) || 100, "%"]
|
|
|
}), "\u7684\u7528\u6237"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
id: "oj-modal-next",
|
|
|
className: "oj-modal-btn",
|
|
|
children: "\u8FDB\u5165\u4E0B\u4E00\u9898"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
function ActionBar(_ref5) {
|
|
|
var languageValue = _ref5.languageValue,
|
|
|
languageList = _ref5.languageList,
|
|
|
onChangeLanguage = _ref5.onChangeLanguage,
|
|
|
title = _ref5.title,
|
|
|
modify_code = _ref5.modify_code,
|
|
|
onSyncCode = _ref5.onSyncCode,
|
|
|
onShowCodeSetting = _ref5.onShowCodeSetting,
|
|
|
onResetCode = _ref5.onResetCode;
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var opneModal = function opneModal() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
title: '恢复初始代码',
|
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {}),
|
|
|
content: '你在本文件中修改的内容将丢失,是否确定重新加载初始代码?',
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
onOk: onResetCode
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "action-bar",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"], {
|
|
|
className: "oj-select",
|
|
|
value: languageValue,
|
|
|
style: {
|
|
|
width: 100
|
|
|
},
|
|
|
placeholder: "\u9009\u62E9\u8BED\u8A00",
|
|
|
onChange: onChangeLanguage,
|
|
|
children: languageList === null || languageList === void 0 ? void 0 : languageList.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_select["default"].Option, {
|
|
|
value: e.language,
|
|
|
children: e.language
|
|
|
}, e.language);
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
title: "\u6062\u590D\u521D\u59CB\u4EE3\u7801",
|
|
|
onClick: opneModal,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-zhongzhi font-20 "
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
onClick: onShowCodeSetting,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-shezhi"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
function RightPanel(_ref6) {
|
|
|
var id = _ref6.id,
|
|
|
input = _ref6.input,
|
|
|
showNote = _ref6.showNote,
|
|
|
onShowNote = _ref6.onShowNote,
|
|
|
notes = _ref6.notes,
|
|
|
onCancelNote = _ref6.onCancelNote,
|
|
|
onAddNote = _ref6.onAddNote,
|
|
|
debugResult = _ref6.debugResult,
|
|
|
language = _ref6.language,
|
|
|
debuging = _ref6.debuging,
|
|
|
submitting = _ref6.submitting,
|
|
|
executingMessage = _ref6.executingMessage,
|
|
|
code = _ref6.code,
|
|
|
onSubmitCode = _ref6.onSubmitCode,
|
|
|
onDebugCode = _ref6.onDebugCode,
|
|
|
onChangeCode = _ref6.onChangeCode,
|
|
|
onChangeInput = _ref6.onChangeInput,
|
|
|
onUpdateCode = _ref6.onUpdateCode,
|
|
|
actionBarOpation = objectWithoutProperties_default()(_ref6, _excluded);
|
|
|
function ActionBarEL(onShowCodeSetting) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(ActionBar, objectSpread2_default()(objectSpread2_default()({}, actionBarOpation), {}, {
|
|
|
onShowCodeSetting: onShowCodeSetting
|
|
|
}));
|
|
|
}
|
|
|
var testCasePanelOption = {
|
|
|
id: id,
|
|
|
input: input,
|
|
|
debugResult: debugResult,
|
|
|
debuging: debuging,
|
|
|
submitting: submitting,
|
|
|
executingMessage: executingMessage,
|
|
|
onDebugCode: onDebugCode,
|
|
|
onChangeCode: onChangeCode,
|
|
|
onSubmitCode: onSubmitCode,
|
|
|
onChangeInput: onChangeInput
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "right-panel",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(CodePanel/* default */.Z, {
|
|
|
language: language,
|
|
|
value: code,
|
|
|
onChange: onChangeCode,
|
|
|
ActionBarRender: ActionBarEL
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "note-form-area ".concat(showNote ? 'active' : ''),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(NotesForm, {
|
|
|
onCancel: onCancelNote,
|
|
|
notes: notes,
|
|
|
callback: onAddNote
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(TestCasePanel/* default */.ZP, objectSpread2_default()({}, testCasePanelOption))]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 25769:
|
|
|
/*!**************************************************************************!*\
|
|
|
!*** ./node_modules/_copy-to-clipboard@3.3.3@copy-to-clipboard/index.js ***!
|
|
|
\**************************************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
var deselectCurrent = __webpack_require__(/*! toggle-selection */ 98040);
|
|
|
|
|
|
var clipboardToIE11Formatting = {
|
|
|
"text/plain": "Text",
|
|
|
"text/html": "Url",
|
|
|
"default": "Text"
|
|
|
}
|
|
|
|
|
|
var defaultMessage = "Copy to clipboard: #{key}, Enter";
|
|
|
|
|
|
function format(message) {
|
|
|
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
|
|
|
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
|
}
|
|
|
|
|
|
function copy(text, options) {
|
|
|
var debug,
|
|
|
message,
|
|
|
reselectPrevious,
|
|
|
range,
|
|
|
selection,
|
|
|
mark,
|
|
|
success = false;
|
|
|
if (!options) {
|
|
|
options = {};
|
|
|
}
|
|
|
debug = options.debug || false;
|
|
|
try {
|
|
|
reselectPrevious = deselectCurrent();
|
|
|
|
|
|
range = document.createRange();
|
|
|
selection = document.getSelection();
|
|
|
|
|
|
mark = document.createElement("span");
|
|
|
mark.textContent = text;
|
|
|
// avoid screen readers from reading out loud the text
|
|
|
mark.ariaHidden = "true"
|
|
|
// reset user styles for span element
|
|
|
mark.style.all = "unset";
|
|
|
// prevents scrolling to the end of the page
|
|
|
mark.style.position = "fixed";
|
|
|
mark.style.top = 0;
|
|
|
mark.style.clip = "rect(0, 0, 0, 0)";
|
|
|
// used to preserve spaces and line breaks
|
|
|
mark.style.whiteSpace = "pre";
|
|
|
// do not inherit user-select (it may be `none`)
|
|
|
mark.style.webkitUserSelect = "text";
|
|
|
mark.style.MozUserSelect = "text";
|
|
|
mark.style.msUserSelect = "text";
|
|
|
mark.style.userSelect = "text";
|
|
|
mark.addEventListener("copy", function(e) {
|
|
|
e.stopPropagation();
|
|
|
if (options.format) {
|
|
|
e.preventDefault();
|
|
|
if (typeof e.clipboardData === "undefined") { // IE 11
|
|
|
debug && console.warn("unable to use e.clipboardData");
|
|
|
debug && console.warn("trying IE specific stuff");
|
|
|
window.clipboardData.clearData();
|
|
|
var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]
|
|
|
window.clipboardData.setData(format, text);
|
|
|
} else { // all other browsers
|
|
|
e.clipboardData.clearData();
|
|
|
e.clipboardData.setData(options.format, text);
|
|
|
}
|
|
|
}
|
|
|
if (options.onCopy) {
|
|
|
e.preventDefault();
|
|
|
options.onCopy(e.clipboardData);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
document.body.appendChild(mark);
|
|
|
|
|
|
range.selectNodeContents(mark);
|
|
|
selection.addRange(range);
|
|
|
|
|
|
var successful = document.execCommand("copy");
|
|
|
if (!successful) {
|
|
|
throw new Error("copy command was unsuccessful");
|
|
|
}
|
|
|
success = true;
|
|
|
} catch (err) {
|
|
|
debug && console.error("unable to copy using execCommand: ", err);
|
|
|
debug && console.warn("trying IE specific stuff");
|
|
|
try {
|
|
|
window.clipboardData.setData(options.format || "text", text);
|
|
|
options.onCopy && options.onCopy(window.clipboardData);
|
|
|
success = true;
|
|
|
} catch (err) {
|
|
|
debug && console.error("unable to copy using clipboardData: ", err);
|
|
|
debug && console.error("falling back to prompt");
|
|
|
message = format("message" in options ? options.message : defaultMessage);
|
|
|
window.prompt(message, text);
|
|
|
}
|
|
|
} finally {
|
|
|
if (selection) {
|
|
|
if (typeof selection.removeRange == "function") {
|
|
|
selection.removeRange(range);
|
|
|
} else {
|
|
|
selection.removeAllRanges();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (mark) {
|
|
|
document.body.removeChild(mark);
|
|
|
}
|
|
|
reselectPrevious();
|
|
|
}
|
|
|
|
|
|
return success;
|
|
|
}
|
|
|
|
|
|
module.exports = copy;
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 83145:
|
|
|
/*!**********************************************************************************************!*\
|
|
|
!*** ./node_modules/_react-copy-to-clipboard@5.0.2@react-copy-to-clipboard/lib/Component.js ***!
|
|
|
\**********************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
|
value: true
|
|
|
}));
|
|
|
exports.CopyToClipboard = void 0;
|
|
|
|
|
|
var _react = _interopRequireDefault(__webpack_require__(/*! react */ 59301));
|
|
|
|
|
|
var _copyToClipboard = _interopRequireDefault(__webpack_require__(/*! copy-to-clipboard */ 25769));
|
|
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
|
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
|
|
|
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
var CopyToClipboard =
|
|
|
/*#__PURE__*/
|
|
|
function (_React$PureComponent) {
|
|
|
_inherits(CopyToClipboard, _React$PureComponent);
|
|
|
|
|
|
function CopyToClipboard() {
|
|
|
var _getPrototypeOf2;
|
|
|
|
|
|
var _this;
|
|
|
|
|
|
_classCallCheck(this, CopyToClipboard);
|
|
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(CopyToClipboard)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onClick", function (event) {
|
|
|
var _this$props = _this.props,
|
|
|
text = _this$props.text,
|
|
|
onCopy = _this$props.onCopy,
|
|
|
children = _this$props.children,
|
|
|
options = _this$props.options;
|
|
|
|
|
|
var elem = _react["default"].Children.only(children);
|
|
|
|
|
|
var result = (0, _copyToClipboard["default"])(text, options);
|
|
|
|
|
|
if (onCopy) {
|
|
|
onCopy(text, result);
|
|
|
} // Bypass onClick if it was present
|
|
|
|
|
|
|
|
|
if (elem && elem.props && typeof elem.props.onClick === 'function') {
|
|
|
elem.props.onClick(event);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
_createClass(CopyToClipboard, [{
|
|
|
key: "render",
|
|
|
value: function render() {
|
|
|
var _this$props2 = this.props,
|
|
|
_text = _this$props2.text,
|
|
|
_onCopy = _this$props2.onCopy,
|
|
|
_options = _this$props2.options,
|
|
|
children = _this$props2.children,
|
|
|
props = _objectWithoutProperties(_this$props2, ["text", "onCopy", "options", "children"]);
|
|
|
|
|
|
var elem = _react["default"].Children.only(children);
|
|
|
|
|
|
return _react["default"].cloneElement(elem, _objectSpread({}, props, {
|
|
|
onClick: this.onClick
|
|
|
}));
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
return CopyToClipboard;
|
|
|
}(_react["default"].PureComponent);
|
|
|
|
|
|
exports.CopyToClipboard = CopyToClipboard;
|
|
|
|
|
|
_defineProperty(CopyToClipboard, "defaultProps", {
|
|
|
onCopy: undefined,
|
|
|
options: undefined
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 56102:
|
|
|
/*!******************************************************************************************!*\
|
|
|
!*** ./node_modules/_react-copy-to-clipboard@5.0.2@react-copy-to-clipboard/lib/index.js ***!
|
|
|
\******************************************************************************************/
|
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
var _require = __webpack_require__(/*! ./Component */ 83145),
|
|
|
CopyToClipboard = _require.CopyToClipboard;
|
|
|
|
|
|
CopyToClipboard.CopyToClipboard = CopyToClipboard;
|
|
|
module.exports = CopyToClipboard;
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 98040:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_toggle-selection@1.0.6@toggle-selection/index.js ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(module) {
|
|
|
|
|
|
|
|
|
module.exports = function () {
|
|
|
var selection = document.getSelection();
|
|
|
if (!selection.rangeCount) {
|
|
|
return function () {};
|
|
|
}
|
|
|
var active = document.activeElement;
|
|
|
|
|
|
var ranges = [];
|
|
|
for (var i = 0; i < selection.rangeCount; i++) {
|
|
|
ranges.push(selection.getRangeAt(i));
|
|
|
}
|
|
|
|
|
|
switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML
|
|
|
case 'INPUT':
|
|
|
case 'TEXTAREA':
|
|
|
active.blur();
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
active = null;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
selection.removeAllRanges();
|
|
|
return function () {
|
|
|
selection.type === 'Caret' &&
|
|
|
selection.removeAllRanges();
|
|
|
|
|
|
if (!selection.rangeCount) {
|
|
|
ranges.forEach(function(range) {
|
|
|
selection.addRange(range);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
active &&
|
|
|
active.focus();
|
|
|
};
|
|
|
};
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |