You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3795 lines
213 KiB
3795 lines
213 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[7460],{
|
|
|
|
/***/ 18343:
|
|
/*!******************************************************!*\
|
|
!*** ./src/components/Spinner/index.tsx + 1 modules ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ Spinner; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(23852);
|
|
;// CONCATENATED MODULE: ./src/components/Spinner/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Spinnermodules = ({"ldsRing":"ldsRing___mpBZC","idsRingWrapper":"idsRingWrapper___Of9_n","ldsring":"ldsring___o0w2t"});
|
|
;// CONCATENATED MODULE: ./src/components/Spinner/index.tsx
|
|
|
|
|
|
|
|
/* harmony default export */ var Spinner = (({ message, className, children, style = {} }) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Spinnermodules.idsRingWrapper} ${className}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Spinnermodules.ldsRing }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null)), message ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style }, message) : null, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Outlet, null));
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 56729:
|
|
/*!**************************************************************************!*\
|
|
!*** ./src/pages/Question/OjProblem/TestCasePanel/index.tsx + 1 modules ***!
|
|
\**************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Im: function() { return /* binding */ ExecuteDict; },
|
|
ZP: function() { return /* binding */ TestCasePanel; },
|
|
gZ: function() { return /* binding */ getDetailCommitOut; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: getCommitOut
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(20008);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/DownOutlined.js + 1 modules
|
|
var DownOutlined = __webpack_require__(77800);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/UpOutlined.js + 1 modules
|
|
var UpOutlined = __webpack_require__(23420);
|
|
// EXTERNAL MODULE: ./src/pages/Question/OjProblem/interface.ts
|
|
var OjProblem_interface = __webpack_require__(95958);
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
var base64 = __webpack_require__(24334);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/TestCasePanel/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
// EXTERNAL MODULE: ./src/components/Spinner/index.tsx + 1 modules
|
|
var Spinner = __webpack_require__(18343);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
var RenderHtml = __webpack_require__(92936);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(75798);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/TestCasePanel/index.tsx
|
|
/* provided dependency */ var React = __webpack_require__(/*! react */ 59301);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { TextArea } = input["default"];
|
|
const initialState = {
|
|
visible: false,
|
|
tabIndex: "0"
|
|
};
|
|
const ExecuteDict = {
|
|
[OjProblem_interface/* ExecuteStatus */.h.NOMATCH]: "\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D",
|
|
[OjProblem_interface/* ExecuteStatus */.h.OK]: "\u8C03\u8BD5\u901A\u8FC7",
|
|
2: "\u8C03\u8BD5\u8D85\u65F6",
|
|
3: "\u8C03\u8BD5pod\u5931\u8D25",
|
|
4: "\u7F16\u8BD1\u5931\u8D25",
|
|
5: "\u6267\u884C\u5931\u8D25"
|
|
};
|
|
var Types = /* @__PURE__ */ ((Types2) => {
|
|
Types2[Types2["SET_VISIBLE"] = 0] = "SET_VISIBLE";
|
|
Types2[Types2["SET_TABINDEX"] = 1] = "SET_TABINDEX";
|
|
return Types2;
|
|
})(Types || {});
|
|
function Reducer(state, action) {
|
|
switch (action.type) {
|
|
case 0 /* SET_VISIBLE */:
|
|
return __spreadProps(__spreadValues({}, state), { visible: action.payload });
|
|
case 1 /* SET_TABINDEX */:
|
|
return __spreadProps(__spreadValues({}, state), { tabIndex: action.payload });
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
function getDetailCommitOut(debugResult) {
|
|
const { status, error_msg, output, input, expected_output, is_file, input_file_url, output_file_url, expected_output_file_url } = debugResult;
|
|
let rs = null;
|
|
const mdStyle = {
|
|
minHeight: 150,
|
|
marginBottom: 10,
|
|
paddingLeft: 24,
|
|
background: "#070f19",
|
|
color: "#fff"
|
|
};
|
|
switch (status) {
|
|
case OjProblem_interface/* ExecuteStatus */.h.NOMATCH:
|
|
rs = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: "c-red" }, "\u5B9E\u9645\u8F93\u5165\uFF1A"), !is_file && /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { value: input, style: mdStyle }), is_file && /* @__PURE__ */ React.createElement("div", { style: mdStyle }, /* @__PURE__ */ React.createElement(
|
|
"a",
|
|
{
|
|
onClick: () => (0,util/* download */.LR)(input_file_url, input)
|
|
},
|
|
input
|
|
)), /* @__PURE__ */ React.createElement("p", { className: "c-red" }, "\u5B9E\u9645\u8F93\u51FA\uFF1A"), !is_file && /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { value: output && base64.Base64.decode(output) || "", style: mdStyle }), is_file && /* @__PURE__ */ React.createElement("div", { style: mdStyle }, /* @__PURE__ */ React.createElement(
|
|
"a",
|
|
{
|
|
onClick: () => (0,util/* download */.LR)(output_file_url, output)
|
|
},
|
|
output
|
|
)), /* @__PURE__ */ React.createElement("p", { className: "c-red" }, "\u9884\u671F\u8F93\u51FA\uFF1A"), !is_file && /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { value: expected_output && base64.Base64.decode(expected_output) || "", style: mdStyle }), is_file && /* @__PURE__ */ React.createElement("div", { style: mdStyle }, /* @__PURE__ */ React.createElement(
|
|
"a",
|
|
{
|
|
onClick: () => (0,util/* download */.LR)(expected_output_file_url, expected_output)
|
|
},
|
|
expected_output
|
|
)));
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.EXECUTEFAILURE:
|
|
rs = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"), !is_file && /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { value: input, style: mdStyle }), is_file && /* @__PURE__ */ React.createElement("div", { style: mdStyle }, /* @__PURE__ */ React.createElement(
|
|
"a",
|
|
{
|
|
onClick: () => (0,util/* download */.LR)(input_file_url, input)
|
|
},
|
|
input
|
|
)), /* @__PURE__ */ React.createElement("p", null, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ React.createElement("pre", { className: "error" }, base64.Base64.decode(error_msg)));
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.COMPILEFAILURE:
|
|
rs = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"), !is_file && /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { value: input, style: mdStyle }), is_file && /* @__PURE__ */ React.createElement("div", { style: mdStyle }, /* @__PURE__ */ React.createElement(
|
|
"a",
|
|
{
|
|
onClick: () => (0,util/* download */.LR)(input_file_url, input)
|
|
},
|
|
input
|
|
)), /* @__PURE__ */ React.createElement("p", null, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ React.createElement("pre", { className: "error" }, base64.Base64.decode(error_msg)));
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.PODFAILURE:
|
|
rs = /* @__PURE__ */ React.createElement("p", null, "\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.TIMEOUT:
|
|
rs = /* @__PURE__ */ React.createElement("p", null, "\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
break;
|
|
}
|
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, " ", rs, " ");
|
|
}
|
|
function getCommitOut(debugResult) {
|
|
const { status, error_msg, execute_time, output, input, expected_output, is_file, input_file_url, output_file_url, expected_output_file_url } = debugResult;
|
|
let rs = null;
|
|
switch (status) {
|
|
case OjProblem_interface/* ExecuteStatus */.h.OK:
|
|
rs = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "\u6267\u884C\u7528\u65F6\uFF1A", execute_time, "\u79D2"), /* @__PURE__ */ React.createElement("p", null, "\u6267\u884C\u7ED3\u679C\uFF1A"), /* @__PURE__ */ React.createElement("pre", null, base64.Base64.decode(output)));
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.NOMATCH:
|
|
rs = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "\u8F93\u5165\uFF1A", /* @__PURE__ */ React.createElement("pre", null, input)), /* @__PURE__ */ React.createElement("p", null, "\u8F93\u51FA\uFF1A", output && base64.Base64.decode(output)), /* @__PURE__ */ React.createElement("p", null, "\u9884\u671F\u8F93\u51FA\uFF1A", expected_output && base64.Base64.decode(expected_output)));
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.EXECUTEFAILURE:
|
|
rs = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A", /* @__PURE__ */ React.createElement("pre", null, input)), /* @__PURE__ */ React.createElement("p", null, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ React.createElement("pre", { className: "error" }, base64.Base64.decode(error_msg)));
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.COMPILEFAILURE:
|
|
rs = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A", /* @__PURE__ */ React.createElement("pre", null, input)), /* @__PURE__ */ React.createElement("p", null, "\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"), /* @__PURE__ */ React.createElement("pre", { className: "error" }, base64.Base64.decode(error_msg)));
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.PODFAILURE:
|
|
rs = /* @__PURE__ */ React.createElement("p", null, "\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
break;
|
|
case OjProblem_interface/* ExecuteStatus */.h.TIMEOUT:
|
|
rs = /* @__PURE__ */ React.createElement("p", null, "\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
|
|
break;
|
|
}
|
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, " ", rs, " ");
|
|
}
|
|
/* harmony default export */ var TestCasePanel = (({ id, is_file, input, debuging, submitting, executingMessage, debugResult, onChangeInput, onDebugCode, onSubmitCode }) => {
|
|
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(Reducer, initialState);
|
|
const { visible, tabIndex } = state;
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
dispatch({
|
|
type: 0 /* SET_VISIBLE */,
|
|
payload: false
|
|
});
|
|
}, [id]);
|
|
function onTabIndexChange(e) {
|
|
let id2 = e.target.id;
|
|
dispatch({
|
|
type: 1 /* SET_TABINDEX */,
|
|
payload: id2
|
|
});
|
|
}
|
|
function onTriggerCollapse() {
|
|
dispatch({
|
|
type: 0 /* SET_VISIBLE */,
|
|
payload: !visible
|
|
});
|
|
}
|
|
const executeResult = (0,_react_17_0_2_react.useMemo)(() => {
|
|
if (debugResult) {
|
|
const { status } = debugResult;
|
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, getCommitOut(debugResult));
|
|
}
|
|
return null;
|
|
}, [debugResult]);
|
|
function onDebug() {
|
|
if (!input || is_file) {
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u81EA\u6D4B\u7528\u4F8B");
|
|
dispatch({
|
|
type: 0 /* SET_VISIBLE */,
|
|
payload: true
|
|
});
|
|
dispatch({
|
|
type: 1 /* SET_TABINDEX */,
|
|
payload: "0"
|
|
});
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: 0 /* SET_VISIBLE */,
|
|
payload: true
|
|
});
|
|
dispatch({
|
|
type: 1 /* SET_TABINDEX */,
|
|
payload: "1"
|
|
});
|
|
onDebugCode();
|
|
}
|
|
return /* @__PURE__ */ React.createElement("div", { className: "test-case-panel" }, /* @__PURE__ */ React.createElement("div", { className: `test-case-panel-body ${visible ? "active" : ""}` }, /* @__PURE__ */ React.createElement("ul", { className: "s-navs" }, /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("a", { className: tabIndex === "0" ? "active" : "", id: "0", onClick: onTabIndexChange }, "\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")), /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("a", { className: tabIndex === "1" ? "active" : "", id: "1", onClick: onTabIndexChange }, "\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))), /* @__PURE__ */ React.createElement("div", { className: `tab-panel-body inputs ${tabIndex === "0" ? "" : "hide"}` }, /* @__PURE__ */ React.createElement(TextArea, { placeholder: "\u8BF7\u8F93\u5165\u81EA\u6D4B\u7528\u4F8B\uFF08\u5982\u679C\u672A\u586B\u5199\uFF0C\u81EA\u6D4B\u8FD0\u884C\u65F6\uFF0C\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u586B\u5145\u7B2C\u4E00\u4E2A\u975E\u9690\u85CF\u7684\u6587\u672C\u7C7B\u578B\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF09", value: is_file ? "" : input, onChange: onChangeInput })), /* @__PURE__ */ React.createElement("div", { className: `tab-panel-body ${tabIndex === "1" ? "" : "hide"}` }, debuging ? /* @__PURE__ */ React.createElement(Spinner/* default */.Z, { message: executingMessage }) : debugResult ? /* @__PURE__ */ React.createElement("section", { style: { height: 200 } }, " ", executeResult, " ") : /* @__PURE__ */ React.createElement("p", { className: "tip" }, "\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))), /* @__PURE__ */ React.createElement("a", { className: `btn-collapse ${visible ? "up" : ""}`, onClick: onTriggerCollapse }, visible ? /* @__PURE__ */ React.createElement(DownOutlined/* default */.Z, null) : /* @__PURE__ */ React.createElement(UpOutlined/* default */.Z, null)), /* @__PURE__ */ React.createElement("footer", { className: "footer" }, /* @__PURE__ */ React.createElement("span", { style: { visibility: "hidden" } }, "\u63A7\u5236\u53F0"), /* @__PURE__ */ React.createElement("div", { className: "flex-container" }, /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { id: "oj-prev", className: "btn-blue", type: "ghost" }, "\u4E0A\u4E00\u9898"), /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { id: "oj-next", className: "btn-blue", type: "ghost" }, "\u4E0B\u4E00\u9898"), /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { className: "btn-green", type: "ghost", loading: debuging, onClick: onDebug }, "\u8C03\u8BD5\u4EE3\u7801"), /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { type: "primary", className: "custom-ant-disabled", loading: submitting, disabled: submitting, onClick: () => {
|
|
dispatch({
|
|
type: 0 /* SET_VISIBLE */,
|
|
payload: false
|
|
});
|
|
onSubmitCode();
|
|
} }, "\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))));
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 49168:
|
|
/*!*************************************************************!*\
|
|
!*** ./src/pages/Question/OjProblem/index.tsx + 42 modules ***!
|
|
\*************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ OjProblem; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/FormOutlined.js + 1 modules
|
|
var FormOutlined = __webpack_require__(23333);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/PoweroffOutlined.js + 1 modules
|
|
var PoweroffOutlined = __webpack_require__(23742);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(23852);
|
|
// 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__(63329);
|
|
// EXTERNAL MODULE: ./src/components/SplitContainer/index.tsx + 1 modules
|
|
var SplitContainer = __webpack_require__(70225);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(19351);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
var ExclamationCircleOutlined = __webpack_require__(6246);
|
|
// EXTERNAL MODULE: ./src/pages/Problems/OjForm/CodePanel/index.tsx + 1 modules
|
|
var CodePanel = __webpack_require__(48458);
|
|
// 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__(654);
|
|
;// 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__(56729);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(20008);
|
|
// 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);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/NotesForm/index.tsx
|
|
|
|
|
|
const { TextArea } = input["default"];
|
|
const MaxNotCount = 5e3;
|
|
/* harmony default export */ var NotesForm = (({ callback, onCancel, notes }) => {
|
|
function onSubmit(values) {
|
|
callback(values);
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { className: "note-form-panel", onFinish: onSubmit, initialValues: { notes } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "notes",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9" },
|
|
{ max: MaxNotCount, message: `\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A${MaxNotCount}` }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(TextArea, { placeholder: "\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9", rows: 5 })
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { style: { textAlign: "right" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "ghost", onClick: onCancel, style: { marginRight: 10 } }, " \u53D6\u6D88 "), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", htmlType: "submit" }, " \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__(86383);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(36697);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/LoadingOutlined.js + 1 modules
|
|
var LoadingOutlined = __webpack_require__(45161);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/CopyOutlined.js + 1 modules
|
|
var CopyOutlined = __webpack_require__(29117);
|
|
// EXTERNAL MODULE: ./src/pages/Question/OjProblem/interface.ts
|
|
var OjProblem_interface = __webpack_require__(95958);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(75798);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(9498);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/SubmitList/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { Column } = table["default"];
|
|
/* harmony default export */ var SubmitList = (({
|
|
submitResult,
|
|
submitting,
|
|
submitRecords,
|
|
page,
|
|
onPageChange,
|
|
topicId
|
|
}) => {
|
|
const { status, id, input, output, expected_output, is_file, input_file_url, output_file_url, expected_output_file_url, error_msg } = submitResult || {};
|
|
const { records, records_count } = submitRecords || {};
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
function onCopy() {
|
|
if (!is_file) {
|
|
navigator.clipboard.writeText(base64.Base64.decode(output)).then(() => {
|
|
message/* default */.ZP.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F");
|
|
});
|
|
} else {
|
|
navigator.clipboard.writeText(base64.Base64.decode(error_msg)).then(() => {
|
|
message/* default */.ZP.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F");
|
|
});
|
|
}
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: submitting, tip: "\u8BC4\u6D4B\u4E2D...", indicator: /* @__PURE__ */ _react_17_0_2_react.createElement(LoadingOutlined/* default */.Z, { style: { fontSize: 24 }, spin: true }) }, id ? /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: SubmitListmodules.info }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, "\u6267\u884C\u7ED3\u679C\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: status === OjProblem_interface/* ExecuteStatus */.h.OK ? "c-green" : "c-red" }, TestCasePanel/* ExecuteDict */.Im[status])), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: SubmitListmodules.error }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onCopy }, "\u590D\u5236\u9519\u8BEF\u4FE1\u606F ", /* @__PURE__ */ _react_17_0_2_react.createElement(CopyOutlined/* default */.Z, null), " ")), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/problems/${topicId}/record-detail/${id}?backId=${urlParams == null ? void 0 : urlParams.save_identifier}` }, "\u663E\u793A\u8BE6\u60C5 > "))), status !== OjProblem_interface/* ExecuteStatus */.h.OK ? /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "c-red" }, "\u5B9E\u9645\u8F93\u5165\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", null, !is_file && input, is_file && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"a",
|
|
{
|
|
style: { fontSize: "16px" },
|
|
onClick: () => (0,util/* download */.LR)(input_file_url, input)
|
|
},
|
|
input
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "c-red" }, "\u5B9E\u9645\u8F93\u51FA\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", null, (status === 4 || status === 5) && base64.Base64.decode(error_msg), status != 4 && status != 5 && (is_file ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"a",
|
|
{
|
|
style: { fontSize: "16px" },
|
|
onClick: () => (0,util/* download */.LR)(output_file_url, output)
|
|
},
|
|
output
|
|
) : base64.Base64.decode(output))), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "c-red" }, "\u9884\u671F\u8F93\u51FA\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("pre", null, !is_file && base64.Base64.decode(expected_output), is_file && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"a",
|
|
{
|
|
style: { fontSize: "16px" },
|
|
onClick: () => (0,util/* download */.LR)(expected_output_file_url, expected_output)
|
|
},
|
|
expected_output
|
|
))) : null) : null, (records == null ? void 0 : records.length) > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(table["default"], { dataSource: records, rowKey: "id", pagination: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
Column,
|
|
{
|
|
title: "\u63D0\u4EA4\u65F6\u95F4",
|
|
dataIndex: "created_at",
|
|
key: "created_at",
|
|
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, " ", dayjs_min_default()(text).format("YYYY-MM-DD HH:mm:ss"))
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
Column,
|
|
{
|
|
title: "\u63D0\u4EA4\u7ED3\u679C",
|
|
dataIndex: "status",
|
|
key: "status",
|
|
render: (text, record) => {
|
|
var _a;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { className: text === 0 ? "c-green" : "c-red", to: `/problems/${topicId}/record-detail/${record.id}?backId=${urlParams == null ? void 0 : urlParams.save_identifier}` }, (_a = TestCasePanel/* ExecuteDict */.Im[text]) == null ? void 0 : _a.replace("\u8C03\u8BD5", "\u8BC4\u6D4B"));
|
|
}
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(Column, { title: "\u6267\u884C\u7528\u65F6 (S)", dataIndex: "execute_time", key: "execute_time" }), /* @__PURE__ */ _react_17_0_2_react.createElement(Column, { title: "\u5185\u5B58\u6D88\u8017\uFF08MB\uFF09", dataIndex: "execute_memory", key: "execute_memory" }), /* @__PURE__ */ _react_17_0_2_react.createElement(Column, { title: "\u8BED\u8A00", dataIndex: "language", key: "language" })) : null, records_count > 15 ? /* @__PURE__ */ _react_17_0_2_react.createElement(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__(46948);
|
|
// 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
|
|
var RenderHtml = __webpack_require__(92936);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Description/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
const DifficultDesc = {
|
|
1: {
|
|
name: "\u7B80\u5355",
|
|
color: "#52c41a"
|
|
},
|
|
2: {
|
|
name: "\u9002\u4E2D",
|
|
color: "#faad14"
|
|
},
|
|
3: {
|
|
name: "\u56F0\u96BE",
|
|
color: "#f5222d"
|
|
}
|
|
};
|
|
/* harmony default export */ var Description = (({ hack, onTriggerPraise, toDiscuss }) => {
|
|
const { language, difficulty, time_limit, username, user_path, user_praise, comments_count, praises_count, description, pass_count, submit_count } = hack;
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
console.log(hack.language, "language");
|
|
const diffItem = DifficultDesc[difficulty];
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: Descriptionmodules.info }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, "\u96BE\u5EA6\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement(tag["default"], { color: diffItem.color }, diffItem.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, "\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, time_limit, "\u79D2"))), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: description, className: Descriptionmodules.desc }), /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: Descriptionmodules["commit-info"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement(space/* default */.Z, { size: 4 }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u901A\u8FC7\u6B21\u6570"), " ", /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, pass_count))), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement(space/* default */.Z, { size: 4 }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u63D0\u4EA4\u6B21\u6570"), " ", /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, submit_count)), " "), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { style: { flex: "1 0 0" } }), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement(space/* default */.Z, { size: 4 }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-huifu1", onClick: toDiscuss }), " ", /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, comments_count)), " ")));
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
var mediator = __webpack_require__(50993);
|
|
;// CONCATENATED MODULE: ./src/assets/images/question/show.svg
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgShow = (props) => /* @__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: ./src/components/modal.tsx
|
|
var components_modal = __webpack_require__(9805);
|
|
;// 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__(64841);
|
|
;// 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/${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/${params == null ? void 0 : params.id}/hidden.json`, params);
|
|
}
|
|
function deleteDiscuss(params) {
|
|
return (0,fetch/* del */.IV)(`comments/${params == null ? 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__(5695);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(77883);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-item/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function UserPhoto({ author }) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/users/${author.login}`, target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"img",
|
|
{
|
|
alt: "\u7528\u6237\u5934\u50CF",
|
|
height: "50",
|
|
style: { borderRadius: "50%" },
|
|
src: `${env/* default */.Z.IMG_SERVER}/images/${author.image_url}`,
|
|
width: "50"
|
|
}
|
|
));
|
|
}
|
|
function SecondLevelDiscuss({
|
|
data,
|
|
index,
|
|
parentDiscussIndex,
|
|
user,
|
|
onSetActionType
|
|
}) {
|
|
const { author, can_delete, content, id, time } = data;
|
|
function onDeleteDiscuss() {
|
|
onSetActionType({
|
|
id,
|
|
index,
|
|
type: "delete-discuss",
|
|
parentDiscussIndex,
|
|
message: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"
|
|
});
|
|
}
|
|
const canDelete = user.admin || can_delete || author.user_id === user.user_id;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "discuss-item-container second-discuss " }, /* @__PURE__ */ _react_17_0_2_react.createElement(UserPhoto, { author }), /* @__PURE__ */ _react_17_0_2_react.createElement("section", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "discuss-info" }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/users/${author.login}`, target: "_blank" }, author.name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "grey" }, time), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "btn-group", style: { marginBottom: 0 } }, canDelete ? /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onDeleteDiscuss, title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shanchu" })) : null)), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: "discuss-content", value: content })));
|
|
}
|
|
/* harmony default export */ var discuss_item = (({
|
|
user,
|
|
data,
|
|
index,
|
|
onPlusDiscuss,
|
|
onSetActionType,
|
|
activeDiscussIndex,
|
|
onReplyDiscuss,
|
|
onSetActiveDiscussIndex
|
|
}) => {
|
|
const {
|
|
content,
|
|
children,
|
|
hidden,
|
|
id,
|
|
praise_count,
|
|
time,
|
|
user_praise,
|
|
can_delete,
|
|
author
|
|
} = data;
|
|
console.log(can_delete && (!children || children.length == 0), "children22");
|
|
function onActiveDiscussIndex() {
|
|
onSetActiveDiscussIndex(id);
|
|
}
|
|
function onPlus() {
|
|
onPlusDiscuss(id, !user_praise, index);
|
|
}
|
|
function onDeleteDiscuss() {
|
|
onSetActionType({
|
|
id,
|
|
index,
|
|
type: "delete-discuss",
|
|
message: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"
|
|
});
|
|
}
|
|
function onHiddenDiscuss() {
|
|
onSetActionType({
|
|
id,
|
|
index,
|
|
params: { hidden: !hidden ? "1" : "0" },
|
|
type: "hidden-discuss",
|
|
message: !hidden ? "\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417" : "\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"
|
|
});
|
|
}
|
|
const adminOrOperator = user.admin || user.user_id === author.user_id;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "discuss-item-container", key: id }, /* @__PURE__ */ _react_17_0_2_react.createElement(UserPhoto, { author }), /* @__PURE__ */ _react_17_0_2_react.createElement("section", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "discuss-info" }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/users/${author.login}`, target: "_blank" }, " ", author.name, " "), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "grey" }, time)), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: "discuss-content", value: content }), children && children.length > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "reply-discuss-container" }, children.map((item, i) => /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
SecondLevelDiscuss,
|
|
{
|
|
key: item.id,
|
|
data: item,
|
|
index: i,
|
|
user,
|
|
onSetActionType,
|
|
parentDiscussIndex: index
|
|
}
|
|
))) : null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "btn-group" }, (0,authority/* isSuperAdmins */.Ny)() ? /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onHiddenDiscuss, title: hidden ? "\u53D6\u6D88\u9690\u85CF" : "\u9690\u85CF\u8BC4\u8BBA" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: hidden ? "iconfont icon-yincangbiyan" : "fa fa-eye" })) : null, can_delete && (!children || children.length == 0) ? /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onDeleteDiscuss, title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shanchu" })) : null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onActiveDiscussIndex, title: "\u56DE\u590D" }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-huifu1" }), " "), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onPlus, className: user_praise ? "c-orange" : "" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: user_praise ? "iconfont icon-dianzan mr3" : "iconfont icon-dianzan-xian mr3 "
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, praise_count ? praise_count : ""))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
discuss_editor/* default */.Z,
|
|
{
|
|
id,
|
|
activeDiscussIndex,
|
|
onReplyDiscuss
|
|
}
|
|
)));
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules
|
|
var image_preview = __webpack_require__(35894);
|
|
;// 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 + 15 modules
|
|
var markdown_editor = __webpack_require__(16393);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-input-editor/index.tsx
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
/* harmony default export */ var discuss_input_editor = (({ user_praise, praise_count, praisePlus, onCreateDiscuss, discuss_count }) => {
|
|
const [showMd, setShowMd] = (0,_react_17_0_2_react.useState)(false);
|
|
const [value, setValue] = (0,_react_17_0_2_react.useState)("");
|
|
function onChangeHandler(v) {
|
|
setValue(v);
|
|
}
|
|
function onShowMd() {
|
|
setShowMd(true);
|
|
}
|
|
function onCancel() {
|
|
setShowMd(false);
|
|
}
|
|
function onCommit() {
|
|
return __async(this, null, function* () {
|
|
onCreateDiscuss(value);
|
|
setValue("");
|
|
setShowMd(false);
|
|
});
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `dis-input-editor-container ${showMd ? "active" : ""} ` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: showMd ? "text-area hide" : "text-area" }, /* @__PURE__ */ _react_17_0_2_react.createElement("input", { placeholder: "\u8BF4\u70B9\u4EC0\u4E48", onClick: onShowMd }), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { style: { alignItems: "center" } }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-huifu1" }), " \xA0 \xA0", discuss_count, " "), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"a",
|
|
{
|
|
className: "c-light-black",
|
|
onClick: praisePlus,
|
|
style: { alignItems: "center" },
|
|
title: user_praise ? "\u53D6\u6D88\u70B9\u8D5E" : "\u70B9\u8D5E"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: `mr3 ${user_praise ? "iconfont icon-dianzan c-orange" : "iconfont icon-dianzan-xian"} `
|
|
}
|
|
),
|
|
praise_count ? /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, praise_count) : ""
|
|
)), showMd ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "input-mask", onClick: onCancel }) : null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: showMd ? "md-container" : "md-container hide" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
id: "discuss-input-editor",
|
|
miniToolbar: true,
|
|
watch: false,
|
|
noStorage: true,
|
|
defaultValue: value,
|
|
height: 240,
|
|
onChange: onChangeHandler
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tip-container", onClick: onCancel }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: "btn-send", onClick: onCommit }, " \u53D1\u9001 "))));
|
|
});
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/Discuss/index.tsx
|
|
var Discuss_defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Discuss_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Discuss_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Discuss_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Discuss_defNormalProp = (obj, key, value) => key in obj ? Discuss_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Discuss_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Discuss_hasOwnProp.call(b, prop))
|
|
Discuss_defNormalProp(a, prop, b[prop]);
|
|
if (Discuss_getOwnPropSymbols)
|
|
for (var prop of Discuss_getOwnPropSymbols(b)) {
|
|
if (Discuss_propIsEnum.call(b, prop))
|
|
Discuss_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var Discuss_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const initialState = {
|
|
loading: false,
|
|
page: 1,
|
|
data: [],
|
|
count: 0,
|
|
actionType: null,
|
|
activeDiscussIndex: null
|
|
};
|
|
var Types = /* @__PURE__ */ ((Types2) => {
|
|
Types2[Types2["GET_DISCUSSES"] = 0] = "GET_DISCUSSES";
|
|
Types2[Types2["TOP_OR_DOWN_DISCUSS"] = 1] = "TOP_OR_DOWN_DISCUSS";
|
|
Types2[Types2["ACTIVE_DISCUSS_INDEX"] = 2] = "ACTIVE_DISCUSS_INDEX";
|
|
Types2[Types2["PLUS_DISCUSS"] = 3] = "PLUS_DISCUSS";
|
|
Types2[Types2["SET_ACTION_TYPE"] = 4] = "SET_ACTION_TYPE";
|
|
Types2[Types2["SET_PAGE"] = 5] = "SET_PAGE";
|
|
Types2[Types2["SHOW_DISCUSSES_LOADING"] = 6] = "SHOW_DISCUSSES_LOADING";
|
|
return Types2;
|
|
})(Types || {});
|
|
function reducer(state, action) {
|
|
switch (action.type) {
|
|
case 6 /* SHOW_DISCUSSES_LOADING */:
|
|
return __spreadProps(Discuss_spreadValues({}, state), { loading: true });
|
|
case 0 /* GET_DISCUSSES */:
|
|
return Discuss_spreadValues(Discuss_spreadValues({}, state), action.payload);
|
|
case 1 /* TOP_OR_DOWN_DISCUSS */:
|
|
return Discuss_spreadValues(Discuss_spreadValues({}, state), action.payload);
|
|
case 4 /* SET_ACTION_TYPE */:
|
|
return Discuss_spreadValues(Discuss_spreadValues({}, state), action.payload);
|
|
case 3 /* PLUS_DISCUSS */:
|
|
return Discuss_spreadValues(Discuss_spreadValues({}, state), action.payload);
|
|
case 5 /* SET_PAGE */:
|
|
return Discuss_spreadValues(Discuss_spreadValues({}, state), action.payload);
|
|
case 2 /* ACTIVE_DISCUSS_INDEX */:
|
|
return Discuss_spreadValues(Discuss_spreadValues({}, state), action.payload);
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
/* harmony default export */ var Discuss = (({ user, identifier, hack, onTriggerPraise, setDiscussTotal }) => {
|
|
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(reducer, initialState);
|
|
const { loading, page, data, count, actionType, activeDiscussIndex } = state;
|
|
console.log("---", state);
|
|
const initData = (0,_react_17_0_2_react.useCallback)(() => Discuss_async(void 0, null, function* () {
|
|
dispatch({
|
|
type: 6 /* SHOW_DISCUSSES_LOADING */
|
|
});
|
|
const response = yield getComments({
|
|
container_type: "Practice",
|
|
container_identifier: identifier,
|
|
limit: 10,
|
|
page
|
|
});
|
|
const { comments, disscuss_count } = response;
|
|
dispatch({
|
|
type: 0 /* GET_DISCUSSES */,
|
|
payload: {
|
|
data: comments,
|
|
count: disscuss_count,
|
|
loading: false
|
|
}
|
|
});
|
|
setDiscussTotal(disscuss_count);
|
|
}), [page, identifier]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
initData();
|
|
}, [identifier, page]);
|
|
function onPaginationChange(value) {
|
|
dispatch({
|
|
type: 5 /* SET_PAGE */,
|
|
payload: {
|
|
page: value
|
|
}
|
|
});
|
|
}
|
|
function onSetActionType(value) {
|
|
dispatch({
|
|
type: 4 /* SET_ACTION_TYPE */,
|
|
payload: {
|
|
actionType: value
|
|
}
|
|
});
|
|
}
|
|
function onSetActiveDiscussIndex(value) {
|
|
if (activeDiscussIndex === value) {
|
|
dispatch({
|
|
type: 2 /* ACTIVE_DISCUSS_INDEX */,
|
|
payload: {
|
|
activeDiscussIndex: null
|
|
}
|
|
});
|
|
} else {
|
|
dispatch({
|
|
type: 2 /* ACTIVE_DISCUSS_INDEX */,
|
|
payload: {
|
|
activeDiscussIndex: value
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function onPlusDiscuss(id, user_praise, index) {
|
|
return Discuss_async(this, null, function* () {
|
|
try {
|
|
const response = yield plusDiscuss(id);
|
|
data[index].user_praise = user_praise;
|
|
data[index].praise_count = response.praise_count;
|
|
dispatch({
|
|
type: 3 /* PLUS_DISCUSS */,
|
|
payload: {
|
|
data: [...data]
|
|
}
|
|
});
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
});
|
|
}
|
|
function onProcessAction() {
|
|
return Discuss_async(this, null, function* () {
|
|
const { id, params, type, index, parentDiscussIndex } = actionType;
|
|
if (type === "hidden-discuss") {
|
|
console.log(params, "params");
|
|
yield hiddenDiscuss(Discuss_spreadValues({ id, container_type: "Practice", container_identifier: identifier }, params));
|
|
if (!parentDiscussIndex) {
|
|
data[index].hidden = params.hidden == 1 ? true : false;
|
|
} else {
|
|
data[parentDiscussIndex].children[index].hidden = params.hidden == 1 ? true : false;
|
|
}
|
|
dispatch({
|
|
type: 4 /* SET_ACTION_TYPE */,
|
|
payload: {
|
|
actionType: null,
|
|
data: [...data]
|
|
}
|
|
});
|
|
}
|
|
if (type === "delete-discuss") {
|
|
yield deleteDiscuss({ id, container_type: "Practice", container_identifier: identifier });
|
|
dispatch({
|
|
type: 4 /* SET_ACTION_TYPE */,
|
|
payload: {
|
|
actionType: null
|
|
// data: [...data],
|
|
}
|
|
});
|
|
yield initData();
|
|
}
|
|
});
|
|
}
|
|
function onCancelAction() {
|
|
dispatch({
|
|
type: 4 /* SET_ACTION_TYPE */,
|
|
payload: {
|
|
actionType: null
|
|
}
|
|
});
|
|
}
|
|
function onReplyDiscuss(id, value) {
|
|
return Discuss_async(this, null, function* () {
|
|
try {
|
|
yield replyDiscuss({
|
|
container_type: "Practice",
|
|
container_identifier: identifier,
|
|
comments: {
|
|
content: value,
|
|
parent_id: id
|
|
}
|
|
});
|
|
initData();
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
});
|
|
}
|
|
function onCreateDiscuss(value) {
|
|
return Discuss_async(this, null, function* () {
|
|
dispatch({
|
|
type: 6 /* SHOW_DISCUSSES_LOADING */
|
|
});
|
|
yield createDiscuss({
|
|
comments: {
|
|
content: value
|
|
},
|
|
container_type: "Practice",
|
|
container_identifier: identifier
|
|
});
|
|
initData();
|
|
});
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "discuss-panel" }, data.length === 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, null) : /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading }, data.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement(discuss_item, { onReplyDiscuss, onPlusDiscuss, onSetActiveDiscussIndex, onSetActionType, data: item, index, user, activeDiscussIndex }))), count > 10 ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "pagination-container mt10 mb10" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
pagination/* default */.Z,
|
|
{
|
|
showQuickJumper: true,
|
|
onChange: onPaginationChange,
|
|
current: page,
|
|
total: count,
|
|
showTotal: (total) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#656F87" } }, "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, total), "\u6761\u6570\u636E")
|
|
}
|
|
)) : null), /* @__PURE__ */ _react_17_0_2_react.createElement(discuss_input_editor, { user_praise: hack.user_praise, praise_count: hack.praises_count, praisePlus: onTriggerPraise, discuss_count: hack.comments_count, onCreateDiscuss }), /* @__PURE__ */ _react_17_0_2_react.createElement(components_modal/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
title: "\u63D0\u793A",
|
|
open: !!actionType,
|
|
onOk: onProcessAction,
|
|
onCancel: onCancelAction
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("p", null, actionType ? actionType.message : "")
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(image_preview/* default */.Z, null)));
|
|
});
|
|
|
|
;// 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_","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","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
|
|
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 = (obj, key, value) => key in obj ? b_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var b_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (b_hasOwnProp.call(b, prop))
|
|
b_defNormalProp(a, prop, b[prop]);
|
|
if (b_getOwnPropSymbols)
|
|
for (var prop of b_getOwnPropSymbols(b)) {
|
|
if (b_propIsEnum.call(b, prop))
|
|
b_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgB = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? c_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var c_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (c_hasOwnProp.call(b, prop))
|
|
c_defNormalProp(a, prop, b[prop]);
|
|
if (c_getOwnPropSymbols)
|
|
for (var prop of c_getOwnPropSymbols(b)) {
|
|
if (c_propIsEnum.call(b, prop))
|
|
c_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgC = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? c1_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var c1_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (c1_hasOwnProp.call(b, prop))
|
|
c1_defNormalProp(a, prop, b[prop]);
|
|
if (c1_getOwnPropSymbols)
|
|
for (var prop of c1_getOwnPropSymbols(b)) {
|
|
if (c1_propIsEnum.call(b, prop))
|
|
c1_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgC1 = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? d_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var d_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (d_hasOwnProp.call(b, prop))
|
|
d_defNormalProp(a, prop, b[prop]);
|
|
if (d_getOwnPropSymbols)
|
|
for (var prop of d_getOwnPropSymbols(b)) {
|
|
if (d_propIsEnum.call(b, prop))
|
|
d_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgD = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? e_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var e_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (e_hasOwnProp.call(b, prop))
|
|
e_defNormalProp(a, prop, b[prop]);
|
|
if (e_getOwnPropSymbols)
|
|
for (var prop of e_getOwnPropSymbols(b)) {
|
|
if (e_propIsEnum.call(b, prop))
|
|
e_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgE = (props) => /* @__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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const List = ({
|
|
style = {},
|
|
onClick,
|
|
onAssist,
|
|
onHide,
|
|
data,
|
|
active,
|
|
showLine
|
|
}) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: active === (data == null ? void 0 : data.id) ? `${Listmodules.list} ${Listmodules.active}` : Listmodules.list, style, onClick: () => onClick(data) }, (data == null ? void 0 : data.video) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.left }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: data == null ? void 0 : data.video_cover }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: b }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.video_duration)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.mask })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.right }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.name }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + "/images/" + (data == null ? void 0 : data.image_url), width: 30, height: 30 }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { title: data == null ? void 0 : data.name, className: Listmodules.title }, data == null ? void 0 : data.name), (data == null ? void 0 : data.is_authority) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.b }, "\u5B98\u65B9"), (data == null ? void 0 : data.is_excellent) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.a }, "\u7CBE\u9009")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.des }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { showLines: 2, showTextOnly: true, value: (data == null ? void 0 : data.content) || "\u6682\u65E0\u5185\u5BB9" })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Listmodules.tag }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "current", onClick: (e2) => {
|
|
e2.stopPropagation();
|
|
onAssist(data);
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: (data == null ? void 0 : data.user_liker) ? c1 : c }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: (data == null ? void 0 : data.user_liker) ? "#0152d9" : "#656f87" } }, data == null ? void 0 : data.praises_count)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: d }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.discusses_count)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: e }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.viewed_count)), (0,authority/* isSuperAdmins */.Ny)() && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "current", style: { color: "#0152d9", marginRight: 0, userSelect: "none" }, onClick: (e2) => {
|
|
e2.stopPropagation();
|
|
onHide(data);
|
|
} }, (data == null ? void 0 : data.is_hidden) ? "\u53D6\u6D88\u9690\u85CF" : "\u9690\u85CF")))), showLine && /* @__PURE__ */ _react_17_0_2_react.createElement("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","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);
|
|
// EXTERNAL MODULE: ./src/utils/aliyunUpload.ts
|
|
var aliyunUpload = __webpack_require__(8251);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/v.svg
|
|
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 = (obj, key, value) => key in obj ? v_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var v_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (v_hasOwnProp.call(b, prop))
|
|
v_defNormalProp(a, prop, b[prop]);
|
|
if (v_getOwnPropSymbols)
|
|
for (var prop of v_getOwnPropSymbols(b)) {
|
|
if (v_propIsEnum.call(b, prop))
|
|
v_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgV = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? s_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var s_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (s_hasOwnProp.call(b, prop))
|
|
s_defNormalProp(a, prop, b[prop]);
|
|
if (s_getOwnPropSymbols)
|
|
for (var prop of s_getOwnPropSymbols(b)) {
|
|
if (s_propIsEnum.call(b, prop))
|
|
s_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgS = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? t_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var t_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (t_hasOwnProp.call(b, prop))
|
|
t_defNormalProp(a, prop, b[prop]);
|
|
if (t_getOwnPropSymbols)
|
|
for (var prop of t_getOwnPropSymbols(b)) {
|
|
if (t_propIsEnum.call(b, prop))
|
|
t_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgT = (props) => /* @__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==");
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/index.tsx
|
|
var ListForm_defProp = Object.defineProperty;
|
|
var ListForm_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var ListForm_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var ListForm_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var ListForm_defNormalProp = (obj, key, value) => key in obj ? ListForm_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var ListForm_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (ListForm_hasOwnProp.call(b, prop))
|
|
ListForm_defNormalProp(a, prop, b[prop]);
|
|
if (ListForm_getOwnPropSymbols)
|
|
for (var prop of ListForm_getOwnPropSymbols(b)) {
|
|
if (ListForm_propIsEnum.call(b, prop))
|
|
ListForm_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var ListForm_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const videoReducer = (state, action) => {
|
|
var _a, _b, _c;
|
|
const { uploadInfo = {} } = action.payload;
|
|
switch (action.type) {
|
|
case "addVideo":
|
|
return {
|
|
videoList: [...state.videoList, {
|
|
name: uploadInfo.file.name,
|
|
size: uploadInfo.file.size,
|
|
type: uploadInfo.file.type,
|
|
fileHash: uploadInfo.fileHash,
|
|
state: uploadInfo.state,
|
|
video_id: uploadInfo.videoId,
|
|
attachment_id: "",
|
|
article_id: -1,
|
|
loaded: 0,
|
|
title: ""
|
|
}]
|
|
};
|
|
case "removeVideo":
|
|
return {
|
|
videoList: state.videoList.filter((item) => item.name !== action.payload.name)
|
|
};
|
|
case "replaceVideo":
|
|
return {
|
|
videoList: action.payload
|
|
};
|
|
case "removeAll":
|
|
return [];
|
|
case "updateProgress":
|
|
return {
|
|
videoList: state.videoList.map((item) => {
|
|
if (item.name === action.payload.uploadInfo.file.name) {
|
|
return ListForm_spreadValues(ListForm_spreadValues({}, item), { loaded: action.payload.progressPercent, video_id: uploadInfo.videoId, fileHash: uploadInfo.fileHash });
|
|
}
|
|
return item;
|
|
})
|
|
};
|
|
case "updateTitle":
|
|
return {
|
|
videoList: (_a = state.videoList) == null ? void 0 : _a.map((video) => {
|
|
if (video.name === action.payload.item.name) {
|
|
return ListForm_spreadValues(ListForm_spreadValues({}, video), { title: action.payload.title });
|
|
}
|
|
return video;
|
|
})
|
|
};
|
|
case "updateImg":
|
|
return {
|
|
videoList: (_b = state.videoList) == null ? void 0 : _b.map((video) => {
|
|
if (video.name === action.payload.item.name) {
|
|
return ListForm_spreadValues(ListForm_spreadValues({}, video), { attachment_id: action.payload.attachment_id });
|
|
}
|
|
return video;
|
|
})
|
|
};
|
|
case "updateImg":
|
|
return {
|
|
videoList: (_c = state.videoList) == null ? void 0 : _c.map((video) => {
|
|
if (video.name === action.payload.item.name) {
|
|
return ListForm_spreadValues(ListForm_spreadValues({}, video), { attachment_id: action.payload.attachment_id });
|
|
}
|
|
return video;
|
|
})
|
|
};
|
|
default:
|
|
return [];
|
|
}
|
|
};
|
|
const ListForm_List = ({
|
|
onClose,
|
|
onOk,
|
|
identifier,
|
|
active
|
|
}) => {
|
|
var _a, _b;
|
|
const [form] = es_form["default"].useForm();
|
|
const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({});
|
|
const [isLoading, setIsLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [btnLoading, setBtnLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [state, stateDispatch] = (0,_react_17_0_2_react.useReducer)(videoReducer, { videoList: [] });
|
|
const user = (0,authority/* userInfo */.eY)();
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
const uploader = (0,_react_17_0_2_react.useRef)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (active) {
|
|
getData();
|
|
}
|
|
}, [active]);
|
|
const getData = () => ListForm_async(void 0, null, function* () {
|
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
const res = yield (0,service/* editArticlesDetails */.M3)(identifier, { active });
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
const value = {
|
|
name: (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.name,
|
|
content: (_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.content
|
|
};
|
|
form.setFieldsValue(value);
|
|
setFormValue(value);
|
|
if ((_d = (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.videos) == null ? void 0 : _d[0]) {
|
|
stateDispatch({
|
|
type: "replaceVideo",
|
|
payload: [{
|
|
video_id: (_g = (_f = (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.videos) == null ? void 0 : _f[0]) == null ? void 0 : _g.video_id,
|
|
name: (_j = (_i = (_h = res == null ? void 0 : res.data) == null ? void 0 : _h.videos) == null ? void 0 : _i[0]) == null ? void 0 : _j.title,
|
|
loaded: 100
|
|
}]
|
|
});
|
|
}
|
|
}
|
|
});
|
|
const handleValuesChange = (changeValues, values) => {
|
|
setFormValue(ListForm_spreadValues({}, values));
|
|
};
|
|
const handleFinish = (values) => ListForm_async(void 0, null, function* () {
|
|
const sendData = {
|
|
videos: state.videoList,
|
|
articles: values
|
|
};
|
|
setBtnLoading(true);
|
|
let res;
|
|
if (active) {
|
|
sendData.active = active;
|
|
res = yield (0,service/* editArticles */.gu)(identifier, sendData);
|
|
} else {
|
|
res = yield (0,service/* addArticles */.bx)(identifier, sendData);
|
|
}
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
console.log(active || (res == null ? void 0 : res.id), 44);
|
|
onOk(active || (res == null ? void 0 : res.id));
|
|
}
|
|
setBtnLoading(false);
|
|
});
|
|
const clearInput = () => {
|
|
const input = document.getElementById("fileUpload");
|
|
input.value = "";
|
|
};
|
|
const handleUpload = (file) => {
|
|
var userData = '{"Vod":{}}';
|
|
setIsLoading(true);
|
|
if (uploader.current) {
|
|
uploader.current.addFile(file, null, null, null, userData);
|
|
return;
|
|
}
|
|
(0,aliyunUpload/* getUploader */.o)(
|
|
user == null ? void 0 : user.login,
|
|
"",
|
|
{
|
|
create: !uploader,
|
|
addFileSuccess: (uploadInfo) => {
|
|
stateDispatch({
|
|
type: "addVideo",
|
|
payload: {
|
|
uploadInfo
|
|
}
|
|
});
|
|
},
|
|
onUploadProgress: (uploadInfo, totalSize, progress) => {
|
|
const progressPercent = Math.ceil(progress * 100);
|
|
stateDispatch({
|
|
type: "updateProgress",
|
|
payload: {
|
|
uploadInfo,
|
|
progressPercent
|
|
}
|
|
});
|
|
clearInput();
|
|
},
|
|
onUploadFailed: (uploadInfo) => {
|
|
message/* default */.ZP.info("\u89C6\u9891\u4E91\u670D\u52A1\u51FA\u73B0\u5F02\u5E38\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20\u3002");
|
|
},
|
|
onUploadEnd: (uploadInfo) => {
|
|
setIsLoading(false);
|
|
},
|
|
onUploadSucceed: (uploadInfo) => {
|
|
setIsLoading(false);
|
|
},
|
|
onUploadError: (uploadInfo) => {
|
|
setIsLoading(false);
|
|
},
|
|
gotUploader: (_uploader) => {
|
|
_uploader.addFile(file, null, null, null, userData);
|
|
uploader.current = _uploader;
|
|
}
|
|
}
|
|
);
|
|
};
|
|
const handleChangeUpload = (e) => {
|
|
var _a2;
|
|
const MAX_FILE_SIZE = 1024;
|
|
const file = e.target.files[0];
|
|
if (!file) {
|
|
clearInput();
|
|
return;
|
|
}
|
|
let name = file.name.toLowerCase();
|
|
if (name && name.indexOf(".avi") == -1 && name.indexOf(".flv") == -1 && name.indexOf(".f4v") == -1 && name.indexOf(".m4v") == -1 && name.indexOf(".mov") == -1 && name.indexOf(".mp4") == -1 && name.indexOf(".rmvb") == -1 && name.indexOf(".swf") == -1 && name.indexOf(".webm") == -1 && name.indexOf(".wmv") == -1) {
|
|
message/* default */.ZP.info(`\u4E0D\u652F\u6301\u7684\u89C6\u9891\u683C\u5F0F`);
|
|
clearInput();
|
|
return;
|
|
}
|
|
if (file.size > MAX_FILE_SIZE * 1024 * 1024) {
|
|
message/* default */.ZP.info(`\u89C6\u9891\u5927\u5C0F\u8D85\u8FC7${MAX_FILE_SIZE}M`);
|
|
clearInput();
|
|
return;
|
|
}
|
|
if ((_a2 = state.videoList) == null ? void 0 : _a2.find((item) => 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`);
|
|
clearInput();
|
|
return;
|
|
}
|
|
handleUpload(file);
|
|
};
|
|
const handleRemove = (name, isSuccess) => {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc" }, "\u60A8\u786E\u8BA4\u8981", isSuccess ? "\u5220\u9664" : "\u53D6\u6D88\u4E0A\u4F20", "\u8BE5\u89C6\u9891\u5417\uFF1F"),
|
|
onOk: () => {
|
|
clearInput();
|
|
stateDispatch({
|
|
type: "removeVideo",
|
|
payload: {
|
|
name
|
|
}
|
|
});
|
|
}
|
|
});
|
|
};
|
|
const renderUpload = () => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("label", { htmlFor: "fileUpload", className: ListFormmodules.main }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: v, alt: "" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E0A\u4F20\u89C6\u9891"));
|
|
};
|
|
const renderUploadLoading = (num) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.mainLoading }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.proWarp }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.pro }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { width: num } })), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, num || 0, "%")), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, "\u4E0A\u4F20\u4E2D"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.tip }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { getPopupContainer: (trigger) => trigger.parentNode, title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: "current c-light-primary", target: "_blank", href: "/users/innov/videos/protocol" }, "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B")) }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: t, alt: "" }))));
|
|
};
|
|
const renderSucceed = (item) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.mainSucceed }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: s, alt: "" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E0A\u4F20\u6210\u529F"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.tip }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { getPopupContainer: (trigger) => trigger.parentNode, title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "1\u3001\u4E0A\u4F20\u89C6\u9891\uFF0C\u5373\u8868\u793A\u60A8\u5DF2\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: "current c-light-primary", target: "_blank", href: "/users/innov/videos/protocol" }, "\u4E0A\u4F20\u5185\u5BB9\u534F\u8BAE"), "\uFF0C\u4E0D\u5F97\u4E0A\u4F20\u672A\u7ECF\u4ED6\u4EBA\u6388\u6743\u7684\u4F5C\u54C1\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "2\u3001\u4E0D\u652F\u6301\u65AD\u70B9\u7EED\u4F20\uFF0C\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC71G\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "3\u3001\u652F\u6301\u6587\u4EF6\u683C\u5F0F\uFF1Aavi\u3001flv\u3001f4v\u3001m4v\u3001mov\u3001mp4\u3001rmvb\u3001swf\u3001webm\u3001wmv\uFF1B")) }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: t, alt: "" }))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.del, onClick: () => handleRemove(item.name, item.loaded == 100) }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shanchu7 mr5" }), "\u5220\u9664\u89C6\u9891"));
|
|
};
|
|
const renderFile = () => {
|
|
var _a2;
|
|
return (
|
|
// <div className='ml30 mb30 mr40'>
|
|
// <Spin spinning={isLoading}>
|
|
// {
|
|
// state.videoList?.map((item: any, index: number) => {
|
|
// return <div>
|
|
// <div>{item.name}</div>
|
|
// <div>
|
|
// <Progress percent={item.loaded} status={item.loaded == 100 ? "normal" : 'active'} />
|
|
// <div>
|
|
// <Button type="primary" onClick={() => handleRemove(item.name, item.loaded == 100)}>{item.loaded === 100 ? '删除' : '取消上传'}</Button>
|
|
// </div>
|
|
// </div>
|
|
// </div>
|
|
// })
|
|
// }
|
|
// </Spin>
|
|
// </div>
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, (_a2 = state.videoList) == null ? void 0 : _a2.map((item, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: index }, item.loaded == 100 ? renderSucceed(item) : renderUploadLoading(item.loaded));
|
|
}))
|
|
);
|
|
};
|
|
const handleClose = () => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
width: 500,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u6CE8\u610F",
|
|
icon: null,
|
|
className: "custom-modal-divider",
|
|
content: "\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",
|
|
onOk: onClose
|
|
});
|
|
};
|
|
const hasFile = (_a = state.videoList) == null ? void 0 : _a.length;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.listForm }, /* @__PURE__ */ _react_17_0_2_react.createElement("header", null, active ? "\u7F16\u8F91" : "\u53D1\u5E03", "\u9898\u89E3"), /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: ListFormmodules.scroll, id: "sss" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.formWrap }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
scrollToFirstError: true,
|
|
layout: "vertical",
|
|
onValuesChange: handleValuesChange,
|
|
onFinish: handleFinish
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "name",
|
|
label: "\u6807\u9898:",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u540D\u79F0" },
|
|
{ max: 60, message: "\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26" },
|
|
{ whitespace: true, message: "\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C" }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
bordered: false,
|
|
placeholder: "\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26",
|
|
suffix: `${((_b = formValue.name) == null ? void 0 : _b.length) || 0}/60`
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "content",
|
|
label: "\u5185\u5BB9:"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(markdown_editor/* default */.Z, { defaultValue: formValue.content || "", watch: true })
|
|
)
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.upload }, hasFile ? renderFile() : renderUpload(), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"input",
|
|
{
|
|
type: "file",
|
|
id: "fileUpload",
|
|
style: { display: "none" },
|
|
onChange: handleChangeUpload,
|
|
accept: ".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListFormmodules.btns }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: handleClose, type: "primary", ghost: true }, "\u5173\u95ED"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { loading: btnLoading, disabled: isLoading, onClick: () => form.submit(), type: "primary" }, "\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","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__(2518);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/jx.svg
|
|
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 = (obj, key, value) => key in obj ? jx_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var jx_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (jx_hasOwnProp.call(b, prop))
|
|
jx_defNormalProp(a, prop, b[prop]);
|
|
if (jx_getOwnPropSymbols)
|
|
for (var prop of jx_getOwnPropSymbols(b)) {
|
|
if (jx_propIsEnum.call(b, prop))
|
|
jx_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgJx = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? gf_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var gf_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (gf_hasOwnProp.call(b, prop))
|
|
gf_defNormalProp(a, prop, b[prop]);
|
|
if (gf_getOwnPropSymbols)
|
|
for (var prop of gf_getOwnPropSymbols(b)) {
|
|
if (gf_propIsEnum.call(b, prop))
|
|
gf_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgGf = (props) => /* @__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
|
|
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 = (obj, key, value) => key in obj ? g_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var g_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (g_hasOwnProp.call(b, prop))
|
|
g_defNormalProp(a, prop, b[prop]);
|
|
if (g_getOwnPropSymbols)
|
|
for (var prop of g_getOwnPropSymbols(b)) {
|
|
if (g_propIsEnum.call(b, prop))
|
|
g_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgG = (props) => /* @__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","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","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 DiscussItem_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Reply = ({ id, cb }) => {
|
|
const [value, setValue] = (0,_react_17_0_2_react.useState)("");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: "mt10" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
defaultValue: value,
|
|
id: "writeForumsReviewId",
|
|
onChange: (v) => {
|
|
setValue(v);
|
|
},
|
|
placeholder: "\u6211\u8981\u56DE\u590D...",
|
|
height: 240
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
size: "middle",
|
|
onClick: () => DiscussItem_async(void 0, null, function* () {
|
|
if (value === "") {
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u5185\u5BB9");
|
|
} else {
|
|
cb(id, value);
|
|
}
|
|
})
|
|
},
|
|
"\u53D1\u9001"
|
|
))));
|
|
};
|
|
const ThirdlyLevelDiscuss = ({ data }) => {
|
|
var _a;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.thirdlyLevelDiscuss }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font 14 c-light-primary" }, (_a = data == null ? void 0 : data.author) == null ? void 0 : _a.name), "@", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font 14 c-light-primary" }, data == null ? void 0 : data.parent_name), ":"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: data == null ? void 0 : data.content }));
|
|
};
|
|
const DiscussItem_SecondLevelDiscuss = ({
|
|
data,
|
|
onReplyDiscuss,
|
|
thirdlyReply,
|
|
setThirdlyReply
|
|
}) => {
|
|
var _a, _b, _c, _d;
|
|
const user = (0,authority/* userInfo */.eY)();
|
|
console.log(user, "user");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.list }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + "/images/" + ((_a = data == null ? void 0 : data.author) == null ? void 0 : _a.image_url) }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font14", style: { marginBottom: 6 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, (_b = data == null ? void 0 : data.author) == null ? void 0 : _b.name), (user == null ? void 0 : user.login) !== ((_c = data == null ? void 0 : data.author) == null ? void 0 : _c.login) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => setThirdlyReply(data == null ? void 0 : data.id), className: "c-grey-999 current", style: { float: "right" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-huifu3 mr3 font12" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u56DE\u590D"))), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: data == null ? void 0 : data.content }), (_d = data == null ? void 0 : data.children) == null ? void 0 : _d.map((e) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ThirdlyLevelDiscuss,
|
|
{
|
|
key: e.id,
|
|
data: e
|
|
}
|
|
);
|
|
}), thirdlyReply === (data == null ? void 0 : data.id) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(Reply, { id: data == null ? void 0 : data.id, cb: onReplyDiscuss }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "end", paddingTop: 20 }, onClick: () => setThirdlyReply(null), className: "c-light-primary current" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { style: {
|
|
transform: "scale(0.7)",
|
|
display: "inline-block"
|
|
}, className: "iconfont icon-shouqi font12" }), "\u6536\u8D77\u56DE\u590D")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.line })));
|
|
};
|
|
const DiscussItem = ({
|
|
data,
|
|
onReplyDiscuss,
|
|
secondReply,
|
|
setSecondReply,
|
|
thirdlyReply,
|
|
setThirdlyReply,
|
|
onPlusDiscuss
|
|
}) => {
|
|
var _a, _b, _c, _d;
|
|
const [remarkBool, setRemarkBool] = (0,_react_17_0_2_react.useState)(false);
|
|
console.log(data, "data");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.discussItem }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.list }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + "/images/" + ((_a = data == null ? void 0 : data.author) == null ? void 0 : _a.image_url) }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font14", style: { marginBottom: 6 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333 mr30" }, (_b = data == null ? void 0 : data.author) == null ? void 0 : _b.name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999" }, data == null ? void 0 : data.time)), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: data == null ? void 0 : data.content }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.btns }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => onPlusDiscuss(data == null ? void 0 : data.id), className: (data == null ? void 0 : data.user_praise) ? "c-light-primary" : "c-grey-999" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xiaodianzan2 mr3" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.praise_count)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
|
|
var _a2;
|
|
if (((_a2 = data == null ? void 0 : data.children) == null ? void 0 : _a2.length) === 0) {
|
|
return;
|
|
}
|
|
setSecondReply(null);
|
|
setRemarkBool(!remarkBool);
|
|
}, style: { color: remarkBool ? "#0152d9" : "#999999" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-xiaopinglun2 mr3" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, remarkBool ? "\u6536\u8D77\u8BC4\u8BBA" : (_c = data == null ? void 0 : data.children) == null ? void 0 : _c.length)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
|
|
setRemarkBool(false);
|
|
setSecondReply(secondReply === (data == null ? void 0 : data.id) ? null : data == null ? void 0 : data.id);
|
|
}, style: { color: secondReply === (data == null ? void 0 : data.id) ? "#0152d9" : "#999999" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-huifu3 mr3" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, secondReply === (data == null ? void 0 : data.id) ? "\u6536\u8D77\u56DE\u590D" : "\u56DE\u590D"))), secondReply === (data == null ? void 0 : data.id) && /* @__PURE__ */ _react_17_0_2_react.createElement(Reply, { id: data == null ? void 0 : data.id, cb: (id, value) => {
|
|
onReplyDiscuss(id, value);
|
|
setRemarkBool(true);
|
|
} }), remarkBool && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: DiscussItemmodules.secondLevelDiscuss }, (_d = data == null ? void 0 : data.children) == null ? void 0 : _d.map((e) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
DiscussItem_SecondLevelDiscuss,
|
|
{
|
|
thirdlyReply,
|
|
setThirdlyReply,
|
|
key: e.id,
|
|
data: e,
|
|
onReplyDiscuss
|
|
}
|
|
);
|
|
})))));
|
|
};
|
|
/* harmony default export */ var CustomDiscuss_DiscussItem = (DiscussItem);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/index.tsx
|
|
var CustomDiscuss_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CustomDiscuss_List = ({
|
|
identifier,
|
|
active,
|
|
onOk
|
|
}) => {
|
|
const [value, setValue] = (0,_react_17_0_2_react.useState)("");
|
|
const [page, setPage] = (0,_react_17_0_2_react.useState)(1);
|
|
const [data, setData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [total, setTotal] = (0,_react_17_0_2_react.useState)(0);
|
|
const [secondReply, setSecondReply] = (0,_react_17_0_2_react.useState)(null);
|
|
const [thirdlyReply, setThirdlyReply] = (0,_react_17_0_2_react.useState)(null);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
getCommentsData(1);
|
|
setPage(1);
|
|
}, [active]);
|
|
const getCommentsData = (page2) => CustomDiscuss_async(void 0, null, function* () {
|
|
const res = yield getComments({
|
|
container_type: "QuestionSolutionArticle",
|
|
container_identifier: active,
|
|
limit: 5,
|
|
page: page2
|
|
});
|
|
if (res == null ? void 0 : res.comments) {
|
|
setData((res == null ? void 0 : res.comments) || []);
|
|
setPage(page2);
|
|
setTotal(res == null ? void 0 : res.disscuss_count);
|
|
}
|
|
});
|
|
const onCreateDiscuss = () => CustomDiscuss_async(void 0, null, function* () {
|
|
if (value === "") {
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u5185\u5BB9");
|
|
return;
|
|
}
|
|
const res = yield createDiscuss({
|
|
comments: {
|
|
content: value
|
|
},
|
|
container_type: "QuestionSolutionArticle",
|
|
container_identifier: active
|
|
});
|
|
if (res == null ? void 0 : res.discuss) {
|
|
setValue("");
|
|
getCommentsData(page);
|
|
onOk();
|
|
}
|
|
});
|
|
const onReplyDiscuss = (id, value2, level) => CustomDiscuss_async(void 0, null, function* () {
|
|
const res = yield replyDiscuss({
|
|
container_type: "QuestionSolutionArticle",
|
|
container_identifier: active,
|
|
comments: {
|
|
content: value2,
|
|
parent_id: id
|
|
}
|
|
});
|
|
setSecondReply(null);
|
|
setThirdlyReply(null);
|
|
getCommentsData(page);
|
|
});
|
|
const onPlusDiscuss = (id) => CustomDiscuss_async(void 0, null, function* () {
|
|
const res = yield plusDiscuss(id);
|
|
getCommentsData(page);
|
|
});
|
|
const handleChange = (current) => {
|
|
setPage(current);
|
|
getCommentsData(current);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: CustomDiscussmodules.discuss }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: CustomDiscussmodules.reply, style: { borderWidth: total ? 1 : 0 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
defaultValue: value,
|
|
id: "writeForumsReviewId",
|
|
onChange: (v) => {
|
|
setValue(v);
|
|
},
|
|
placeholder: "\u6211\u8981\u56DE\u590D...",
|
|
height: 240
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
size: "middle",
|
|
onClick: () => onCreateDiscuss()
|
|
},
|
|
"\u53D1\u9001"
|
|
)))), data == null ? void 0 : data.map((e) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
CustomDiscuss_DiscussItem,
|
|
{
|
|
secondReply,
|
|
setSecondReply,
|
|
thirdlyReply,
|
|
setThirdlyReply,
|
|
key: e.id,
|
|
data: e,
|
|
onReplyDiscuss,
|
|
onPlusDiscuss
|
|
}
|
|
);
|
|
}), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
pagination/* default */.Z,
|
|
{
|
|
className: CustomDiscussmodules.pagination,
|
|
showTotal: (total2) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#656F87" } }, "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, total2), "\u6761\u6570\u636E"),
|
|
current: page,
|
|
onChange: handleChange,
|
|
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__(8048);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/index.tsx
|
|
var ListDetails_defProp = Object.defineProperty;
|
|
var ListDetails_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var ListDetails_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var ListDetails_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var ListDetails_defNormalProp = (obj, key, value) => key in obj ? ListDetails_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var ListDetails_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (ListDetails_hasOwnProp.call(b, prop))
|
|
ListDetails_defNormalProp(a, prop, b[prop]);
|
|
if (ListDetails_getOwnPropSymbols)
|
|
for (var prop of ListDetails_getOwnPropSymbols(b)) {
|
|
if (ListDetails_propIsEnum.call(b, prop))
|
|
ListDetails_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var ListDetails_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e2) {
|
|
reject(e2);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e2) {
|
|
reject(e2);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ListDetails_List = ({
|
|
active,
|
|
identifier,
|
|
onAssist,
|
|
onEdit,
|
|
onArticlesSkip,
|
|
onClose,
|
|
onOk,
|
|
onDelete,
|
|
detailsIndex,
|
|
btnShowStatus
|
|
}) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
const [data, setData] = (0,_react_17_0_2_react.useState)({});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (!!active) {
|
|
getData();
|
|
}
|
|
}, [active, detailsIndex]);
|
|
const getData = (bool = true) => ListDetails_async(void 0, null, function* () {
|
|
if (bool) {
|
|
setLoading(true);
|
|
}
|
|
const res = yield (0,service/* articlesDetails */.wO)(identifier, { active });
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
setData((res == null ? void 0 : res.data) || {});
|
|
}
|
|
setLoading(false);
|
|
});
|
|
const handleArticlesStatus = (v) => ListDetails_async(void 0, null, function* () {
|
|
const res = yield (0,service/* articlesStatus */.qe)(identifier, ListDetails_spreadValues({ active }, v));
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
getData(false);
|
|
onOk();
|
|
}
|
|
});
|
|
const handleAssist = (v) => ListDetails_async(void 0, null, function* () {
|
|
const res = yield (0,service/* articlesAssist */.Rg)(identifier, { active: v == null ? void 0 : v.id });
|
|
if (res.status === 0) {
|
|
getData(false);
|
|
onOk();
|
|
}
|
|
});
|
|
const handleDelete = (v) => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
width: 500,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
icon: null,
|
|
className: "custom-modal-divider",
|
|
content: "\u786E\u8BA4\u8981\u5220\u9664\u8BE5\u9898\u89E3\u5417?",
|
|
onOk: () => onDelete(v)
|
|
});
|
|
};
|
|
const handleOk = () => {
|
|
getData(false);
|
|
onOk();
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.listDetails }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
skeleton/* default */.Z,
|
|
{
|
|
className: "pt20 pl20 pr20",
|
|
loading,
|
|
active: true,
|
|
paragraph: { rows: 5 }
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.head }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.name }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { title: data == null ? void 0 : data.name, className: ListDetailsmodules.title }, data == null ? void 0 : data.name), (data == null ? void 0 : data.is_authority) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.b }, "\u5B98\u65B9"), (data == null ? void 0 : data.is_excellent) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.a }, "\u7CBE\u9009")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.tag }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + "/images/" + (data == null ? void 0 : data.image_url) }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-333 ml5 mr20 font14" }, data == null ? void 0 : data.username), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "inline-block", marginBottom: -2 }, className: "c-grey-999 mr20 font12" }, "\u53D1\u5E03\u4E8E", dayjs_min_default()(data == null ? void 0 : data.created_at).format("YYYY-MM-DD")), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: c }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.praises_count)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: d }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.discusses_count)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: e }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.viewed_count)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.btn }, ((0,authority/* isSuperAdmins */.Ny)() || (data == null ? void 0 : data.is_self)) && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => handleDelete(data), type: "primary", ghost: true }, "\u5220\u9664"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => onEdit(data), type: "primary", ghost: true }, "\u7F16\u8F91")), (0,authority/* isSuperAdmins */.Ny)() && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => handleArticlesStatus({ is_authority: !(data == null ? void 0 : data.is_authority) }), type: "primary" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: gf }), (data == null ? void 0 : data.is_authority) ? "\u53D6\u6D88" : "\u8BBE\u4E3A", "\u5B98\u65B9"), (0,authority/* isSuperAdmins */.Ny)() && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => handleArticlesStatus({ is_excellent: !(data == null ? void 0 : data.is_excellent) }), type: "primary" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: jx }), (data == null ? void 0 : data.is_excellent) ? "\u53D6\u6D88" : "\u8BBE\u4E3A", "\u7CBE\u9009")))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.scroll }, ((_b = (_a = data == null ? void 0 : data.videos) == null ? void 0 : _a[0]) == null ? void 0 : _b.id) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.video }, /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { tip: "\u6B63\u5728\u8F6C\u7801\uFF0C\u8BF7\u7A0D\u7B49...", spinning: !((_d = (_c = data == null ? void 0 : data.videos) == null ? void 0 : _c[0]) == null ? void 0 : _d.transcoded) }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
Play/* default */.Z,
|
|
{
|
|
poster: (_f = (_e = data == null ? void 0 : data.videos) == null ? void 0 : _e[0]) == null ? void 0 : _f.cover_url,
|
|
src: ((_h = (_g = data == null ? void 0 : data.videos) == null ? void 0 : _g[0]) == null ? void 0 : _h.play_url) || "",
|
|
videoId: (_j = (_i = data == null ? void 0 : data.videos) == null ? void 0 : _i[0]) == null ? void 0 : _j.id,
|
|
logWatchHistory: () => {
|
|
}
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: ListDetailsmodules.html, value: (data == null ? void 0 : data.content) || "" }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => handleAssist(data), className: ListDetailsmodules.g }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: "mr10", src: (data == null ? void 0 : data.user_liker) ? g : g }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, data == null ? void 0 : data.praises_count)), /* @__PURE__ */ _react_17_0_2_react.createElement(CustomDiscuss, { onOk: handleOk, active, identifier })),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: ListDetailsmodules.btns }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => onClose(), type: "primary", ghost: true }, "\u5173\u95ED"), btnShowStatus[0] && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: (e2) => onArticlesSkip(e2, "prev"), style: { marginLeft: 20 }, type: "primary" }, "\u4E0A\u4E00\u9898\u89E3"), btnShowStatus[1] && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: (e2) => onArticlesSkip(e2, "next"), style: { marginLeft: 20 }, type: "primary" }, "\u4E0B\u4E00\u9898\u89E3"))
|
|
));
|
|
};
|
|
/* harmony default export */ var ListDetails = (ListDetails_List);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/img/a.svg
|
|
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 = (obj, key, value) => key in obj ? a_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var a_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (a_hasOwnProp.call(b, prop))
|
|
a_defNormalProp(a, prop, b[prop]);
|
|
if (a_getOwnPropSymbols)
|
|
for (var prop of a_getOwnPropSymbols(b)) {
|
|
if (a_propIsEnum.call(b, prop))
|
|
a_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgA = (props) => /* @__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.3.1@@ant-design/icons/es/icons/CaretUpOutlined.js + 1 modules
|
|
var CaretUpOutlined = __webpack_require__(14613);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/CaretDownOutlined.js + 1 modules
|
|
var CaretDownOutlined = __webpack_require__(63810);
|
|
;// CONCATENATED MODULE: ./src/pages/Question/OjProblem/LeftPanel/FilterList/index.tsx
|
|
var FilterList_defProp = Object.defineProperty;
|
|
var FilterList_defProps = Object.defineProperties;
|
|
var FilterList_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var FilterList_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var FilterList_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var FilterList_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var FilterList_defNormalProp = (obj, key, value) => key in obj ? FilterList_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var FilterList_spreadValues = (a2, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (FilterList_hasOwnProp.call(b, prop))
|
|
FilterList_defNormalProp(a2, prop, b[prop]);
|
|
if (FilterList_getOwnPropSymbols)
|
|
for (var prop of FilterList_getOwnPropSymbols(b)) {
|
|
if (FilterList_propIsEnum.call(b, prop))
|
|
FilterList_defNormalProp(a2, prop, b[prop]);
|
|
}
|
|
return a2;
|
|
};
|
|
var FilterList_spreadProps = (a2, b) => FilterList_defProps(a2, FilterList_getOwnPropDescs(b));
|
|
var FilterList_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FilterList = ({
|
|
identifier,
|
|
tabStatus,
|
|
setFilterListTotal,
|
|
setListStatus
|
|
}) => {
|
|
const initParams = {
|
|
page: 1,
|
|
limit: 10,
|
|
total: 0,
|
|
search: "",
|
|
save_search: "",
|
|
sort_by: "updated_at",
|
|
sort_direction: null
|
|
};
|
|
let [params, setParams] = (0,_react_17_0_2_react.useState)(FilterList_spreadValues({}, initParams));
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [width, setWidth] = (0,_react_17_0_2_react.useState)(0);
|
|
const [detailsIndex, setDetailsIndex] = (0,_react_17_0_2_react.useState)(1);
|
|
const [active, setActive] = (0,_react_17_0_2_react.useState)(null);
|
|
const [data, setData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [btnShowStatus, setBtnShowStatus] = (0,_react_17_0_2_react.useState)([true, true]);
|
|
const [status, setStatus] = (0,_react_17_0_2_react.useState)(0);
|
|
const leftWarp = (0,_react_17_0_2_react.useRef)(null);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
handleClose();
|
|
}, [tabStatus]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
dealBtnShowStatus();
|
|
}, [active]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
getData(FilterList_spreadValues({}, initParams));
|
|
handleClose();
|
|
}, [identifier]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
window.addEventListener("resize", handleResize);
|
|
setListStatus(status);
|
|
return () => {
|
|
window.removeEventListener("resize", handleResize);
|
|
};
|
|
}, [status]);
|
|
const dealBtnShowStatus = () => FilterList_async(void 0, null, function* () {
|
|
if (!active) {
|
|
setBtnShowStatus([true, true]);
|
|
return;
|
|
}
|
|
const item = [true, true];
|
|
const activeIndex = data == null ? void 0 : data.findIndex((v) => 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);
|
|
});
|
|
const handleResize = () => {
|
|
var _a;
|
|
if (status) {
|
|
const rightWidth = window.innerWidth - ((_a = leftWarp.current) == null ? void 0 : _a.clientWidth);
|
|
setWidth(rightWidth);
|
|
}
|
|
};
|
|
const getData = (record) => FilterList_async(void 0, null, function* () {
|
|
var _a, _b, _c;
|
|
setLoading(true);
|
|
const res = yield (0,service/* articlesList */.WH)(identifier, record);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
setData(((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.articles) || []);
|
|
setParams(FilterList_spreadProps(FilterList_spreadValues({}, record), { total: (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.articles_count }));
|
|
setFilterListTotal((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.articles_count);
|
|
}
|
|
setLoading(false);
|
|
return res;
|
|
});
|
|
const handleSorter = () => {
|
|
if ((params == null ? void 0 : params.sort_direction) === null) {
|
|
params.sort_direction = "asc";
|
|
} else if ((params == null ? void 0 : params.sort_direction) === "asc") {
|
|
params.sort_direction = "desc";
|
|
} else if ((params == null ? void 0 : params.sort_direction) === "desc") {
|
|
params.sort_direction = null;
|
|
}
|
|
params.page = 1;
|
|
handleClose();
|
|
setParams(FilterList_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const handleSearch = () => {
|
|
params.page = 1;
|
|
params.search = params == null ? void 0 : params.save_search;
|
|
handleClose();
|
|
setParams(FilterList_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const sign = () => {
|
|
var _a;
|
|
const dom = document.getElementsByClassName("btn-resize");
|
|
dom[0].style.visibility = "hidden";
|
|
const rightWidth = window.innerWidth - ((_a = leftWarp.current) == null ? void 0 : _a.clientWidth);
|
|
setWidth(rightWidth);
|
|
};
|
|
const addProblems = () => {
|
|
sign();
|
|
setStatus(1);
|
|
};
|
|
const handleDetails = (v) => {
|
|
sign();
|
|
setActive(v == null ? void 0 : v.id);
|
|
setStatus(3);
|
|
};
|
|
const handleEdit = (v) => {
|
|
sign();
|
|
setActive(v == null ? void 0 : v.id);
|
|
setStatus(2);
|
|
};
|
|
const handleClose = () => {
|
|
const dom = document.getElementsByClassName("btn-resize");
|
|
dom[0].style.visibility = "visible";
|
|
setWidth(0);
|
|
setStatus(0);
|
|
setActive(null);
|
|
};
|
|
const handleOk = (id) => {
|
|
setStatus(3);
|
|
setActive(id);
|
|
params.page = 1;
|
|
setParams(FilterList_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const handleEditOk = (id) => {
|
|
setStatus(3);
|
|
setActive(id);
|
|
setParams(FilterList_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const handleDetailsOk = (id) => {
|
|
setParams(FilterList_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const handleAssist = (v) => FilterList_async(void 0, null, function* () {
|
|
const res = yield (0,service/* articlesAssist */.Rg)(identifier, { active: v == null ? void 0 : v.id });
|
|
if (res.status === 0) {
|
|
getData(params);
|
|
setDetailsIndex(detailsIndex + 1);
|
|
}
|
|
});
|
|
const handleHide = (v) => FilterList_async(void 0, null, function* () {
|
|
const res = yield (0,service/* articlesHide */.rL)(identifier, { active: v == null ? void 0 : v.id });
|
|
if (res.status === 0) {
|
|
getData(params);
|
|
setDetailsIndex(detailsIndex + 1);
|
|
}
|
|
});
|
|
const handleDelete = (v) => FilterList_async(void 0, null, function* () {
|
|
const res = yield (0,service/* deleteArticles */.de)(identifier, { active: v == null ? void 0 : v.id });
|
|
if (res.status === 0) {
|
|
handleClose();
|
|
getData(params);
|
|
}
|
|
});
|
|
const handleChange = (current) => {
|
|
params.page = current;
|
|
setParams(FilterList_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const handleArticlesSkip = (e, type) => FilterList_async(void 0, null, function* () {
|
|
var _a, _b, _c, _d;
|
|
const activeIndex = data == null ? void 0 : data.findIndex((v) => v.id === active);
|
|
console.log(activeIndex, type, 22);
|
|
if (type === "prev") {
|
|
if (activeIndex === void 0) {
|
|
message/* default */.ZP.warning("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728");
|
|
return;
|
|
}
|
|
if (activeIndex === 0) {
|
|
if (params.page === 1) {
|
|
message/* default */.ZP.warning("\u4E0A\u4E00\u9898\u89E3\u4E0D\u5B58\u5728");
|
|
return;
|
|
}
|
|
if (params.page !== 1) {
|
|
params.page = params.page - 1;
|
|
setParams(FilterList_spreadValues({}, params));
|
|
const res = yield getData(params);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
const param = (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.articles[((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.articles) == null ? void 0 : _b.length) - 1];
|
|
setActive(param == null ? void 0 : param.id);
|
|
console.log(e.target, 555);
|
|
}
|
|
}
|
|
} else {
|
|
const param = data[activeIndex - 1];
|
|
setActive(param == null ? void 0 : param.id);
|
|
}
|
|
}
|
|
if (type === "next") {
|
|
if (activeIndex === void 0) {
|
|
message/* default */.ZP.warning("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728");
|
|
return;
|
|
}
|
|
if ((params.page - 1) * params.limit + (activeIndex + 1) === params.total) {
|
|
message/* default */.ZP.warning("\u4E0B\u4E00\u9898\u89E3\u4E0D\u5B58\u5728");
|
|
return;
|
|
}
|
|
if (activeIndex + 1 === params.limit) {
|
|
params.page = params.page + 1;
|
|
setParams(FilterList_spreadValues({}, params));
|
|
const res = yield getData(params);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
const param = (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.articles[0];
|
|
setActive(param == null ? void 0 : param.id);
|
|
}
|
|
} else {
|
|
const param = data[activeIndex + 1];
|
|
setActive(param == null ? void 0 : param.id);
|
|
}
|
|
}
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FilterListmodules.wrap, ref: leftWarp }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FilterListmodules.head }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FilterListmodules.sort, onClick: handleSorter }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6700\u65B0"), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement(CaretUpOutlined/* default */.Z, { style: { color: (params == null ? void 0 : params.sort_direction) === "asc" ? "#0152d9" : "#bfbfbf" } }), /* @__PURE__ */ _react_17_0_2_react.createElement(CaretDownOutlined/* default */.Z, { style: { color: (params == null ? void 0 : params.sort_direction) === "desc" ? "#0152d9" : "#bfbfbf" } }))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].Search,
|
|
{
|
|
value: params.save_search,
|
|
className: FilterListmodules["oj-width-input"],
|
|
placeholder: "\u641C\u7D22\u9898\u89E3",
|
|
onChange: (e) => {
|
|
params.save_search = e.target.value;
|
|
setParams(FilterList_spreadValues({}, params));
|
|
},
|
|
onSearch: handleSearch
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: addProblems, className: FilterListmodules.btn }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: a }), "\u5199\u9898\u89E3")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FilterListmodules.listWarp }, /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading, className: "mt20" }, data == null ? void 0 : data.map((e, i) => {
|
|
let showLine = true;
|
|
if (i + 1 === data.length && i !== 0) {
|
|
showLine = false;
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
FilterList_List,
|
|
{
|
|
active,
|
|
key: e.id,
|
|
data: e,
|
|
showLine,
|
|
onClick: handleDetails,
|
|
onAssist: handleAssist,
|
|
onHide: handleHide
|
|
}
|
|
);
|
|
}), (data == null ? void 0 : data.length) === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, { customText: "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!" }))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
pagination/* default */.Z,
|
|
{
|
|
className: FilterListmodules.pagination,
|
|
showTotal: (total) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#656F87" } }, "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, total), "\u6761\u6570\u636E"),
|
|
total: params.total,
|
|
showSizeChanger: false,
|
|
current: params == null ? void 0 : params.page,
|
|
onChange: handleChange,
|
|
hideOnSinglePage: true,
|
|
showQuickJumper: true
|
|
}
|
|
), status > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FilterListmodules.fixedRight, style: { width } }, status === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(ListForm, { identifier, onClose: handleClose, onOk: handleOk }), status === 2 && /* @__PURE__ */ _react_17_0_2_react.createElement(ListForm, { active, identifier, onClose: handleClose, onOk: handleEditOk }), status === 3 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
ListDetails,
|
|
{
|
|
btnShowStatus,
|
|
onArticlesSkip: handleArticlesSkip,
|
|
detailsIndex,
|
|
active,
|
|
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","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_defProp = Object.defineProperty;
|
|
var Drawer_defProps = Object.defineProperties;
|
|
var Drawer_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Drawer_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Drawer_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Drawer_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Drawer_defNormalProp = (obj, key, value) => key in obj ? Drawer_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Drawer_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Drawer_hasOwnProp.call(b, prop))
|
|
Drawer_defNormalProp(a, prop, b[prop]);
|
|
if (Drawer_getOwnPropSymbols)
|
|
for (var prop of Drawer_getOwnPropSymbols(b)) {
|
|
if (Drawer_propIsEnum.call(b, prop))
|
|
Drawer_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Drawer_spreadProps = (a, b) => Drawer_defProps(a, Drawer_getOwnPropDescs(b));
|
|
var Drawer_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Drawer = ({
|
|
visible,
|
|
onVisible,
|
|
value,
|
|
onChange,
|
|
setIndex
|
|
}) => {
|
|
var _a;
|
|
const initParams = {
|
|
page: 1,
|
|
per_page: 30,
|
|
total: 0,
|
|
tag_discipline_id: [],
|
|
//知识点
|
|
search: "",
|
|
save_search: "",
|
|
difficulty: null
|
|
};
|
|
let [params, setParams] = (0,_react_17_0_2_react.useState)(initParams);
|
|
const [pointData, setPointData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [tableData, setTableData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const data = (0,_react_17_0_2_react.useRef)([]);
|
|
const timer = (0,_react_17_0_2_react.useRef)(null);
|
|
const urlParams = (0,_umi_production_exports.useParams)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (urlParams == null ? void 0 : urlParams.id) {
|
|
timer.current = setInterval(() => {
|
|
setTime(30);
|
|
}, 3e4);
|
|
}
|
|
return () => {
|
|
clearInterval(timer.current);
|
|
};
|
|
}, []);
|
|
const setTime = (num) => Drawer_async(void 0, null, function* () {
|
|
const res = yield (0,service/* setLogTime */.uc)(urlParams == null ? void 0 : urlParams.id, { practice_time: num });
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
getData(params);
|
|
getPointData();
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
window.addEventListener("click", handleSkip);
|
|
return () => {
|
|
window.removeEventListener("click", handleSkip);
|
|
};
|
|
}, [urlParams == null ? void 0 : urlParams.save_identifier, visible]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
const paramIndex = data.current.findIndex((e) => e.identifier === (urlParams == null ? void 0 : urlParams.save_identifier));
|
|
const paramPrev = data.current[paramIndex - 1];
|
|
const paramNext = data.current[paramIndex + 1];
|
|
const prev = document.getElementById("oj-prev");
|
|
const 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 ? void 0 : urlParams.save_identifier, data.current]);
|
|
const parentIndexOf = (node, parent) => {
|
|
if (node.id === parent) {
|
|
return node;
|
|
}
|
|
for (let i = 0, n = node; n = n.parentNode; i++) {
|
|
if (n.id === parent) {
|
|
return n;
|
|
}
|
|
if (n == document.documentElement) {
|
|
return false;
|
|
}
|
|
}
|
|
};
|
|
const handleSkip = (e) => Drawer_async(void 0, null, function* () {
|
|
if (!parentIndexOf(e.target, "oj-drawer") && visible) {
|
|
onVisible(false);
|
|
}
|
|
const paramIndex = data.current.findIndex((e2) => e2.identifier === (urlParams == null ? void 0 : urlParams.save_identifier));
|
|
const paramPrev = data.current[paramIndex - 1];
|
|
const paramNext = data.current[paramIndex + 1];
|
|
if (e.target.id === "oj-prev") {
|
|
if (!paramPrev || paramIndex === -1) {
|
|
message/* default */.ZP.warning("\u4E0A\u4E00\u9898\u4E0D\u5B58\u5728");
|
|
return;
|
|
}
|
|
e.target.style.pointerEvents = "none";
|
|
e.target.style.cursor = "not-allowed";
|
|
yield skip(paramPrev == null ? void 0 : paramPrev.identifier);
|
|
setIndex("0");
|
|
setTimeout(() => {
|
|
e.target.style.pointerEvents = "auto";
|
|
e.target.style.cursor = "pointer";
|
|
}, 400);
|
|
}
|
|
if (e.target.id === "oj-next" || e.target.id === "oj-modal-next") {
|
|
if (!paramNext || paramIndex === -1) {
|
|
message/* default */.ZP.warning("\u4E0B\u4E00\u9898\u4E0D\u5B58\u5728");
|
|
return;
|
|
}
|
|
e.target.style.pointerEvents = "none";
|
|
e.target.style.cursor = "not-allowed";
|
|
yield skip(paramNext == null ? void 0 : paramNext.identifier);
|
|
setIndex("0");
|
|
setTimeout(() => {
|
|
e.target.style.pointerEvents = "auto";
|
|
e.target.style.cursor = "pointer";
|
|
}, 400);
|
|
}
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
onChange(urlParams == null ? void 0 : urlParams.save_identifier);
|
|
const page = tableData.findIndex((e) => e.some((r) => r.identifier === (urlParams == null ? void 0 : urlParams.save_identifier)));
|
|
if (page === -1) {
|
|
setParams(Drawer_spreadProps(Drawer_spreadValues({}, params), { page: 1 }));
|
|
} else {
|
|
setParams(Drawer_spreadProps(Drawer_spreadValues({}, params), { page: page + 1 }));
|
|
}
|
|
}, [urlParams == null ? void 0 : urlParams.save_identifier, tableData]);
|
|
const handlePoint = (v) => {
|
|
params.page = 1;
|
|
params.tag_discipline_id = v;
|
|
setParams(Drawer_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const getPointData = () => Drawer_async(void 0, null, function* () {
|
|
const res = yield (0,fetch/* default */.ZP)(`/api/tag_disciplines.json`, {
|
|
method: "get",
|
|
params: {
|
|
target: "practice",
|
|
position: "index"
|
|
}
|
|
});
|
|
setPointData(res.tag_disciplines || []);
|
|
});
|
|
const handleSelect = (v) => {
|
|
params.page = 1;
|
|
params.difficulty = typeof v === "number" ? v : null;
|
|
setParams(Drawer_spreadValues({}, params));
|
|
getData(params);
|
|
};
|
|
const getData = (record) => Drawer_async(void 0, null, function* () {
|
|
var _a2, _b;
|
|
setLoading(true);
|
|
const res = yield (0,service/* practicesList */.KC)(record);
|
|
if (res == null ? void 0 : res.practices_list) {
|
|
var arr_length = (_a2 = res == null ? void 0 : res.practices_list) == null ? void 0 : _a2.length;
|
|
var newArr = [];
|
|
for (var i = 0; i < arr_length; i += params == null ? void 0 : params.per_page) {
|
|
newArr.push((_b = res == null ? void 0 : res.practices_list) == null ? void 0 : _b.slice(i, i + (params == null ? void 0 : params.per_page)));
|
|
}
|
|
setParams(Drawer_spreadProps(Drawer_spreadValues({}, params), { total: res == null ? void 0 : res.practices_count }));
|
|
data.current = (res == null ? void 0 : res.practices_list) || [];
|
|
setTableData(newArr);
|
|
}
|
|
setLoading(false);
|
|
});
|
|
const skip = (v, e) => Drawer_async(void 0, null, function* () {
|
|
const res = yield (0,fetch/* default */.ZP)(`/api/practices/${v}/start`, {
|
|
method: "get"
|
|
});
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
_umi_production_exports.history.push(`/problems/${res == null ? void 0 : res.identifier}/oj/${v}`);
|
|
}
|
|
});
|
|
const handleChange = (current) => {
|
|
params.page = current;
|
|
setParams(Drawer_spreadValues({}, params));
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Drawermodules.wrap, id: "oj-drawer", style: { left: visible ? 0 : -700 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Drawermodules.head }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Drawermodules.title }, "\u9898\u76EE\u5217\u8868"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].Search,
|
|
{
|
|
value: params == null ? void 0 : params.save_search,
|
|
placeholder: "\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22",
|
|
style: { width: 180, marginLeft: "auto", marginRight: 10 },
|
|
onChange: (e) => {
|
|
params.save_search = e.target.value;
|
|
setParams(Drawer_spreadValues({}, params));
|
|
},
|
|
onSearch: () => {
|
|
params.page = 1;
|
|
params.search = params.save_search;
|
|
setParams(Drawer_spreadValues({}, params));
|
|
getData(params);
|
|
}
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_select["default"],
|
|
{
|
|
value: params == null ? void 0 : params.tag_discipline_id,
|
|
style: { width: 210 },
|
|
mode: "multiple",
|
|
placeholder: "\u9009\u62E9\u77E5\u8BC6\u70B9",
|
|
showSearch: false,
|
|
showArrow: true,
|
|
getPopupContainer: (trigger) => trigger.parentNode,
|
|
maxTagTextLength: 2,
|
|
maxTagCount: 2,
|
|
onChange: handlePoint
|
|
},
|
|
pointData.map((e) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: e.id, value: e.id }, e.name);
|
|
})
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_select["default"],
|
|
{
|
|
style: { width: 70, marginLeft: 10 },
|
|
allowClear: true,
|
|
placeholder: "\u96BE\u5EA6",
|
|
getPopupContainer: (trigger) => trigger.parentNode,
|
|
value: params == null ? void 0 : params.difficulty,
|
|
onChange: handleSelect
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { value: 1 }, "\u7B80\u5355"),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { value: 2 }, "\u9002\u4E2D"),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { value: 3 }, "\u56F0\u96BE")
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Drawermodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading }, (_a = tableData == null ? void 0 : tableData[params.page - 1]) == null ? void 0 : _a.map((e) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
key: e.identifier,
|
|
className: Drawermodules.list,
|
|
onClick: (target) => skip(e.identifier, target)
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { style: { visibility: value === e.identifier ? "visible" : "hidden" }, className: "iconfont icon-wancheng1 c-green-29b" }),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { fontWeight: value === e.identifier ? "bold" : 400, color: value === e.identifier ? "#ffffff" : "#bac4cd" }, title: e == null ? void 0 : e.name }, e.name),
|
|
(e == null ? void 0 : e.difficulty) === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("b", { style: { color: "#2FA34F" } }, "\u7B80\u5355"),
|
|
(e == null ? void 0 : e.difficulty) === 2 && /* @__PURE__ */ _react_17_0_2_react.createElement("b", { style: { color: "#0152d9" } }, "\u9002\u4E2D"),
|
|
(e == null ? void 0 : e.difficulty) === 3 && /* @__PURE__ */ _react_17_0_2_react.createElement("b", { style: { color: "#FA6400" } }, "\u56F0\u96BE")
|
|
);
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Drawermodules.footer }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
pagination/* default */.Z,
|
|
{
|
|
showTotal: (total) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#656F87" } }, "\u5171", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, total), "\u6761\u6570\u636E"),
|
|
total: params.total,
|
|
pageSize: params == null ? void 0 : params.per_page,
|
|
current: params == null ? 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 = (({
|
|
hack,
|
|
onTriggerPraise,
|
|
topicId,
|
|
page,
|
|
onPageChange,
|
|
user,
|
|
submitRecords,
|
|
submitting,
|
|
submitResult
|
|
}) => {
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const [index, setIndex] = (0,_react_17_0_2_react.useState)(searchParams.get("tab") || "0");
|
|
const [discussTotal, setDiscussTotal] = (0,_react_17_0_2_react.useState)(0);
|
|
const [listStatus, setListStatus] = (0,_react_17_0_2_react.useState)(0);
|
|
const [filterListTotal, setFilterListTotal] = (0,_react_17_0_2_react.useState)(0);
|
|
const [questionValue, setQuestionValue] = (0,_react_17_0_2_react.useState)();
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
function onTabIndexChange(e) {
|
|
const id = e.target.id;
|
|
if (index === "3" && id !== index && (listStatus === 1 || listStatus === 2)) {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
width: 500,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u6CE8\u610F",
|
|
icon: null,
|
|
className: "custom-modal-divider",
|
|
content: "\u60A8\u6B63\u5728\u7F16\u5199\u9898\u89E3\uFF0C\u70B9\u51FB\u5173\u95ED\u540E\uFF0C\u60A8\u7684\u9898\u89E3\u5185\u5BB9\u5C06\u4E0D\u4F1A\u8FDB\u884C\u4FDD\u5B58\u3002",
|
|
onOk: () => {
|
|
setIndex(id);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
setIndex(id);
|
|
}
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
const unSub = mediator/* default */.Z.subscribe("to-commit-info", () => {
|
|
setIndex("1");
|
|
});
|
|
return unSub;
|
|
}, []);
|
|
function toDiscuss() {
|
|
setIndex("2");
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: LeftPanelmodules["left-panel"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { className: `${LeftPanelmodules["s-navs"]} ${LeftPanelmodules["bg-white"]} ${LeftPanelmodules.b1}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: "mr40 current" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { onClick: () => setVisible(true), src: show })), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: LeftPanelmodules["oj-mr"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: index === "0" ? LeftPanelmodules.active : "", id: "0", onClick: onTabIndexChange }, "\u4EFB\u52A1\u63CF\u8FF0")), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: LeftPanelmodules["oj-mr"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: index === "3" ? LeftPanelmodules.active : "", id: "3", onClick: onTabIndexChange }, "\u9898\u89E3", filterListTotal ? `(${filterListTotal})` : "")), /* @__PURE__ */ _react_17_0_2_react.createElement("li", { className: LeftPanelmodules["oj-mr"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: index === "2" ? LeftPanelmodules.active : "", id: "2", onClick: onTabIndexChange }, "\u8BC4\u8BBA", discussTotal ? `(${discussTotal})` : "")), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: index === "1" ? LeftPanelmodules.active : "", id: "1", onClick: onTabIndexChange }, "\u63D0\u4EA4\u8BB0\u5F55"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${LeftPanelmodules["tab-panel-body"]} ${index === "0" ? "" : "hide"}`, style: { padding: "0 0 0 16px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(Description, { hack, onTriggerPraise, toDiscuss })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${LeftPanelmodules["tab-panel-body"]} ${index === "1" ? "" : "hide"}` }, !!(submitRecords == null ? void 0 : submitRecords.records_count) ? /* @__PURE__ */ _react_17_0_2_react.createElement(SubmitList, { page, onPageChange, topicId, submitting, submitRecords, submitResult }) : /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, null)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${LeftPanelmodules["tab-panel-body"]} ${index === "2" ? "" : "hide"}`, style: { padding: 0 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(Discuss, { setDiscussTotal, user, identifier: hack.identifier, hack, onTriggerPraise })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${LeftPanelmodules["tab-panel-body"]} ${index === "3" ? "" : "hide"}`, style: { padding: 0 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(LeftPanel_FilterList, { setListStatus, setFilterListTotal, tabStatus: index, identifier: hack.identifier })), /* @__PURE__ */ _react_17_0_2_react.createElement(LeftPanel_Drawer, { visible, setIndex, onVisible: (v) => setVisible(v), value: questionValue, onChange: (v) => setQuestionValue(v) }));
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./src/components/Timepiece/index.tsx
|
|
var Timepiece = __webpack_require__(73329);
|
|
// 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__(86210);
|
|
// EXTERNAL MODULE: ./src/assets/images/question/title.svg
|
|
var title = __webpack_require__(38246);
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
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 OjProblem_defProp = Object.defineProperty;
|
|
var OjProblem_defProps = Object.defineProperties;
|
|
var OjProblem_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var OjProblem_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var OjProblem_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var OjProblem_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var OjProblem_defNormalProp = (obj, key, value) => key in obj ? OjProblem_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var OjProblem_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (OjProblem_hasOwnProp.call(b, prop))
|
|
OjProblem_defNormalProp(a, prop, b[prop]);
|
|
if (OjProblem_getOwnPropSymbols)
|
|
for (var prop of OjProblem_getOwnPropSymbols(b)) {
|
|
if (OjProblem_propIsEnum.call(b, prop))
|
|
OjProblem_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var OjProblem_spreadProps = (a, b) => OjProblem_defProps(a, OjProblem_getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (OjProblem_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && OjProblem_getOwnPropSymbols)
|
|
for (var prop of OjProblem_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && OjProblem_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var OjProblem_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { Countdown } = statistic["default"];
|
|
const LanguageSuf = {
|
|
"Java": "java",
|
|
"C": "c",
|
|
"Python": "py",
|
|
"C++": "c"
|
|
};
|
|
var OjProblem_Types = /* @__PURE__ */ ((Types2) => {
|
|
Types2[Types2["SET_LOADING"] = 0] = "SET_LOADING";
|
|
Types2[Types2["GET_DATA"] = 1] = "GET_DATA";
|
|
Types2[Types2["GET_SUBMIT_RECORDS"] = 2] = "GET_SUBMIT_RECORDS";
|
|
Types2[Types2["SET_DATA"] = 3] = "SET_DATA";
|
|
Types2[Types2["SET_DEBUGING"] = 4] = "SET_DEBUGING";
|
|
Types2[Types2["SET_SUBMITING"] = 5] = "SET_SUBMITING";
|
|
Types2[Types2["SET_EXECUTE_MESSAGE"] = 6] = "SET_EXECUTE_MESSAGE";
|
|
Types2[Types2["SET_EXECUTE_RESULT"] = 7] = "SET_EXECUTE_RESULT";
|
|
Types2[Types2["SET_SUBMIT_RESULT"] = 8] = "SET_SUBMIT_RESULT";
|
|
Types2[Types2["SET_SHOW_NOTE"] = 9] = "SET_SHOW_NOTE";
|
|
Types2[Types2["SET_PAGE"] = 10] = "SET_PAGE";
|
|
Types2[Types2["GET_LANGUAGE"] = 11] = "GET_LANGUAGE";
|
|
Types2[Types2["GET_DRAWER"] = 12] = "GET_DRAWER";
|
|
return Types2;
|
|
})(OjProblem_Types || {});
|
|
function getTimeStamp() {
|
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
}
|
|
const initalilState = {
|
|
loading: true,
|
|
data: void 0,
|
|
showNote: false,
|
|
debugResult: void 0,
|
|
submitResult: void 0,
|
|
debuging: false,
|
|
submitting: false,
|
|
submitRecords: void 0,
|
|
submitRecordPage: 1,
|
|
executingMessage: "",
|
|
languageValue: "",
|
|
languageList: [],
|
|
drawerData: []
|
|
};
|
|
function OjProblem_reducer(state, action) {
|
|
switch (action.type) {
|
|
case 1 /* GET_DATA */:
|
|
return OjProblem_spreadValues(OjProblem_spreadValues({}, state), action.payload);
|
|
case 3 /* SET_DATA */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { data: action.payload });
|
|
case 0 /* SET_LOADING */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { loading: action.payload });
|
|
case 11 /* GET_LANGUAGE */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { languageList: action.payload });
|
|
case 12 /* GET_DRAWER */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { drawerData: action.payload });
|
|
case 9 /* SET_SHOW_NOTE */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { showNote: action.payload });
|
|
case 4 /* SET_DEBUGING */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { debuging: action.payload });
|
|
case 5 /* SET_SUBMITING */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { submitting: action.payload });
|
|
case 2 /* GET_SUBMIT_RECORDS */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { submitRecords: action.payload });
|
|
case 10 /* SET_PAGE */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { submitRecordPage: action.payload });
|
|
case 6 /* SET_EXECUTE_MESSAGE */:
|
|
return OjProblem_spreadProps(OjProblem_spreadValues({}, state), { executingMessage: action.payload });
|
|
case 7 /* SET_EXECUTE_RESULT */:
|
|
return OjProblem_spreadValues(OjProblem_spreadValues({}, state), action.payload);
|
|
case 8 /* SET_SUBMIT_RESULT */:
|
|
return OjProblem_spreadValues(OjProblem_spreadValues({}, state), action.payload);
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
/* harmony default export */ var OjProblem = (({ children }) => {
|
|
var _a, _b, _c;
|
|
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(OjProblem_reducer, initalilState);
|
|
const { id } = (0,_umi_production_exports.useParams)();
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const { languageValue, languageList, loading, data, debugResult, submitResult, submitRecords, submitRecordPage, showNote, debuging, submitting, executingMessage } = state;
|
|
const [countDownColor, setCountDownColor] = (0,_react_17_0_2_react.useState)("#FFF");
|
|
const [countDownTime, setCountDownTime] = (0,_react_17_0_2_react.useState)(null);
|
|
const [exerciseData, setExerciseData] = (0,_react_17_0_2_react.useState)({});
|
|
const [passModalData, setPassModalData] = (0,_react_17_0_2_react.useState)(false);
|
|
const timer = (0,_react_17_0_2_react.useRef)(null);
|
|
const saveData = (0,_react_17_0_2_react.useRef)(null);
|
|
const user = data == null ? void 0 : data.user;
|
|
const hack = data == null ? void 0 : data.hack;
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
(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 () => {
|
|
(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)(() => {
|
|
setTimeout(() => {
|
|
document.title = "\u5728\u7EBF\u5237\u9898";
|
|
}, 400);
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2;
|
|
if (passModalData) {
|
|
const next = document.getElementById("oj-next");
|
|
const modalNext = document.getElementById("oj-modal-next");
|
|
if (((_a2 = next == null ? void 0 : next.style) == null ? void 0 : _a2.display) === "none") {
|
|
modalNext.style.display = "none";
|
|
} else {
|
|
modalNext.style.display = "block";
|
|
}
|
|
}
|
|
}, [passModalData]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
function init() {
|
|
return OjProblem_async(this, null, function* () {
|
|
var _a2, _b2, _c2;
|
|
const response = yield (0,service/* getProgrammingTopic */.fu)(id);
|
|
if (response.status === 401) {
|
|
document.location.href = "/user/login";
|
|
} else {
|
|
response.hack = response.practice;
|
|
response.hack.code = base64.Base64.decode((_a2 = response == null ? void 0 : response.hack) == null ? void 0 : _a2.code);
|
|
const recordStr = `${user == null ? void 0 : user.login}-language`;
|
|
if (localStorage.getItem(recordStr)) {
|
|
response.hack.language = localStorage.getItem(recordStr);
|
|
}
|
|
saveData.current = lodash_default().cloneDeep(response);
|
|
saveData.current.language = (_b2 = response == null ? void 0 : response.hack) == null ? void 0 : _b2.language;
|
|
dispatch({
|
|
type: 1 /* GET_DATA */,
|
|
payload: {
|
|
loading: false,
|
|
data: response
|
|
}
|
|
});
|
|
dispatch({
|
|
type: 8 /* SET_SUBMIT_RESULT */,
|
|
payload: {
|
|
languageValue: (_c2 = response == null ? void 0 : response.hack) == null ? void 0 : _c2.language
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
if (id) {
|
|
init();
|
|
}
|
|
}, [id]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
dispatch({
|
|
type: 8 /* SET_SUBMIT_RESULT */,
|
|
payload: {
|
|
debugResult: void 0
|
|
}
|
|
});
|
|
getLanguageData();
|
|
setPassModalData(false);
|
|
}, [id]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
clearTimeout(timer.current);
|
|
}, [id]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
getSubmitRecordsData();
|
|
}, [id, submitRecordPage]);
|
|
const backExercise = () => {
|
|
window.parent.postMessage("backExercise", "*");
|
|
};
|
|
function getSubmitRecordsData() {
|
|
return OjProblem_async(this, null, function* () {
|
|
try {
|
|
const response = yield (0,service/* getSubmitRecords */.zO)(id, { limit: 15, page: submitRecordPage });
|
|
dispatch({
|
|
type: 2 /* GET_SUBMIT_RECORDS */,
|
|
payload: response
|
|
});
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
});
|
|
}
|
|
function getLanguageData() {
|
|
return OjProblem_async(this, null, function* () {
|
|
try {
|
|
const response = yield (0,service/* updateLanguageCode */.dd)(id);
|
|
dispatch({
|
|
type: 11 /* GET_LANGUAGE */,
|
|
payload: response == null ? void 0 : response.data
|
|
});
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
});
|
|
}
|
|
function onPageChange(value) {
|
|
dispatch({ type: 10 /* SET_PAGE */, payload: value });
|
|
}
|
|
function onUpdateCode(re) {
|
|
return OjProblem_async(this, null, function* () {
|
|
var _a2, _b2, _c2;
|
|
const relId = ((_c2 = (_b2 = (_a2 = window == null ? void 0 : window.location) == null ? void 0 : _a2.pathname) == null ? void 0 : _b2.split("/")) == null ? void 0 : _c2[2]) || id;
|
|
const response = yield (0,service/* updateCode */.n4)(relId, re ? re : { code: base64.Base64.encode(hack.code), language: languageValue });
|
|
return response;
|
|
});
|
|
}
|
|
function onSubmitCode() {
|
|
return OjProblem_async(this, null, function* () {
|
|
if (submitting) {
|
|
return;
|
|
}
|
|
dispatch({
|
|
type: 5 /* SET_SUBMITING */,
|
|
payload: true
|
|
});
|
|
try {
|
|
mediator/* default */.Z.publish("to-commit-info");
|
|
const response = yield onUpdateCode();
|
|
if (response.status === 0) {
|
|
let submitCodeParams = {};
|
|
const res = yield (0,service/* sumbitCode */.bM)(id, submitCodeParams);
|
|
if (res.status === -1) {
|
|
window.parent.location.href = `/classrooms/${searchParams.get("coursesId")}/exercise/${searchParams.get("exercisesId")}/detail`;
|
|
return;
|
|
}
|
|
const { time_limit, test_case_size } = hack;
|
|
const startTime = getTimeStamp();
|
|
function executeCode() {
|
|
return OjProblem_async(this, null, function* () {
|
|
const { status, data: data2 } = yield (0,service/* getOperationResult */.rX)(id, "submit");
|
|
const executeTime = getTimeStamp();
|
|
const isTimeOut = executeTime - startTime > (time_limit * test_case_size + 3) * 1e3;
|
|
if (status !== 0 && !isTimeOut) {
|
|
setTimeout(executeCode, 1e3);
|
|
}
|
|
if (isTimeOut) {
|
|
modal["default"].error({
|
|
centered: true,
|
|
okText: "\u77E5\u9053\u5566",
|
|
title: "\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"
|
|
});
|
|
dispatch({
|
|
type: 5 /* SET_SUBMITING */,
|
|
payload: false
|
|
});
|
|
return;
|
|
}
|
|
if (status === 0) {
|
|
if (data2.status === 2) {
|
|
modal["default"].error({
|
|
centered: true,
|
|
okText: "\u77E5\u9053\u5566",
|
|
title: "\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"
|
|
});
|
|
}
|
|
const submitResponse = yield (0,service/* getSubmitRecords */.zO)(id, { limit: 15, page: submitRecordPage });
|
|
dispatch({
|
|
type: 8 /* SET_SUBMIT_RESULT */,
|
|
payload: OjProblem_spreadProps(OjProblem_spreadValues({}, state), {
|
|
submitResult: data2,
|
|
// debugResult: data,
|
|
submitting: false,
|
|
submitRecords: submitResponse
|
|
})
|
|
});
|
|
if ((data2 == null ? void 0 : data2.status) === 0) {
|
|
setPassModalData(true);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
executeCode();
|
|
}
|
|
} catch (error) {
|
|
dispatch({
|
|
type: 5 /* SET_SUBMITING */,
|
|
payload: false
|
|
});
|
|
}
|
|
});
|
|
}
|
|
function onDebugCode() {
|
|
return OjProblem_async(this, null, function* () {
|
|
state.debuging = true;
|
|
dispatch({
|
|
type: 4 /* SET_DEBUGING */,
|
|
payload: true
|
|
});
|
|
try {
|
|
const response = yield onUpdateCode();
|
|
if (response.status === 0) {
|
|
const { time_limit } = hack;
|
|
let submitCodeParams = { input: encodeURIComponent(data.test_case.input) };
|
|
const res = yield (0,service/* debugCode */.MU)(id, submitCodeParams);
|
|
if (res.status === -1) {
|
|
window.parent.location.href = `/classrooms/${searchParams.get("coursesId")}/exercise/${searchParams.get("exercisesId")}/detail`;
|
|
return;
|
|
}
|
|
const startTime = getTimeStamp();
|
|
function executeCode() {
|
|
return OjProblem_async(this, null, function* () {
|
|
const { status, message: message2, data: data2 } = yield (0,service/* getOperationResult */.rX)(id, "debug");
|
|
const executeTime = getTimeStamp();
|
|
const isTimeOut = executeTime - startTime > (time_limit + 3) * 1e3;
|
|
if (status !== 0 && !isTimeOut) {
|
|
dispatch({
|
|
type: 6 /* SET_EXECUTE_MESSAGE */,
|
|
payload: message2
|
|
});
|
|
setTimeout(executeCode, 1e3);
|
|
}
|
|
if (isTimeOut) {
|
|
modal["default"].error({
|
|
centered: true,
|
|
okText: "\u77E5\u9053\u5566",
|
|
content: "\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"
|
|
});
|
|
dispatch({
|
|
type: 4 /* SET_DEBUGING */,
|
|
payload: false
|
|
});
|
|
return;
|
|
}
|
|
if (status === 0) {
|
|
dispatch({
|
|
type: 4 /* SET_DEBUGING */,
|
|
payload: false
|
|
});
|
|
if (data2.status === 2) {
|
|
modal["default"].error({
|
|
centered: true,
|
|
okText: "\u77E5\u9053\u5566",
|
|
content: "\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"
|
|
});
|
|
}
|
|
dispatch({
|
|
type: 7 /* SET_EXECUTE_RESULT */,
|
|
payload: OjProblem_spreadProps(OjProblem_spreadValues({}, state), {
|
|
debugResult: data2,
|
|
debuging: false
|
|
})
|
|
});
|
|
}
|
|
});
|
|
}
|
|
executeCode();
|
|
} else {
|
|
dispatch({
|
|
type: 4 /* SET_DEBUGING */,
|
|
payload: false
|
|
});
|
|
}
|
|
} catch (error) {
|
|
console.log(error);
|
|
} finally {
|
|
}
|
|
});
|
|
}
|
|
function onChangeCode(value) {
|
|
var _a2;
|
|
clearTimeout(timer.current);
|
|
timer.current = setTimeout(() => {
|
|
var _a3;
|
|
onUpdateCode({ code: base64.Base64.encode(value), language: (_a3 = saveData == null ? void 0 : saveData.current) == null ? void 0 : _a3.language });
|
|
}, 2e3);
|
|
dispatch({
|
|
type: 3 /* SET_DATA */,
|
|
payload: OjProblem_spreadProps(OjProblem_spreadValues({}, saveData == null ? void 0 : saveData.current), {
|
|
hack: OjProblem_spreadProps(OjProblem_spreadValues({}, (_a2 = saveData == null ? void 0 : saveData.current) == null ? void 0 : _a2.hack), {
|
|
code: value
|
|
})
|
|
})
|
|
});
|
|
}
|
|
function onChangeInput(e) {
|
|
let input = e.target.value;
|
|
dispatch({
|
|
type: 3 /* SET_DATA */,
|
|
payload: OjProblem_spreadProps(OjProblem_spreadValues({}, data), {
|
|
test_case: {
|
|
input
|
|
}
|
|
})
|
|
});
|
|
}
|
|
const onChangeLanguage = (v) => OjProblem_async(void 0, null, function* () {
|
|
var _a2;
|
|
dispatch({
|
|
type: 0 /* SET_LOADING */,
|
|
payload: true
|
|
});
|
|
const res = yield onUpdateCode();
|
|
if (res.status === 0) {
|
|
dispatch({
|
|
type: 8 /* SET_SUBMIT_RESULT */,
|
|
payload: {
|
|
languageValue: v
|
|
}
|
|
});
|
|
saveData.current.language = v;
|
|
const recordStr = `${user == null ? void 0 : user.login}-language`;
|
|
localStorage.setItem(recordStr, v);
|
|
const response = yield (0,service/* updateLanguageCode */.dd)(id);
|
|
if (response.status === 0) {
|
|
const param = (_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.find((e) => e.language === v);
|
|
onChangeCode(base64.Base64.decode(param.code));
|
|
}
|
|
setTimeout(() => {
|
|
dispatch({
|
|
type: 0 /* SET_LOADING */,
|
|
payload: false
|
|
});
|
|
}, 300);
|
|
}
|
|
});
|
|
function onResetCode() {
|
|
return OjProblem_async(this, null, function* () {
|
|
try {
|
|
const response = yield (0,service/* resetCode */.H7)(id, { language: languageValue });
|
|
if (response.status === 401) {
|
|
_umi_production_exports.history.replace("/login", { from: location.pathname });
|
|
} else {
|
|
onChangeCode(base64.Base64.decode(response.code));
|
|
getLanguageData();
|
|
}
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
});
|
|
}
|
|
function onSyncCode() {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),
|
|
onOk() {
|
|
return OjProblem_async(this, null, function* () {
|
|
const response = yield (0,service/* syncCode */.fi)(id, { language: languageValue });
|
|
if (response.status === 401) {
|
|
_umi_production_exports.history.replace("/login", { from: location.pathname });
|
|
} else {
|
|
onChangeCode(base64.Base64.decode(response.code));
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
function onShowNote() {
|
|
dispatch({
|
|
type: 9 /* SET_SHOW_NOTE */,
|
|
payload: true
|
|
});
|
|
}
|
|
function onCancelNote() {
|
|
dispatch({
|
|
type: 9 /* SET_SHOW_NOTE */,
|
|
payload: false
|
|
});
|
|
}
|
|
function onAddNote(values) {
|
|
return OjProblem_async(this, null, function* () {
|
|
yield (0,service/* addNotes */.MK)(id, values);
|
|
dispatch({
|
|
type: 1 /* GET_DATA */,
|
|
payload: {
|
|
showNote: false,
|
|
data: OjProblem_spreadProps(OjProblem_spreadValues({}, data), {
|
|
hack: OjProblem_spreadProps(OjProblem_spreadValues({}, hack), {
|
|
notes: values.notes
|
|
})
|
|
})
|
|
}
|
|
});
|
|
});
|
|
}
|
|
const rightPanelOption = {
|
|
input: (_a = data == null ? void 0 : data.test_case) == null ? void 0 : _a.input,
|
|
is_file: (_b = data == null ? void 0 : data.test_case) == null ? void 0 : _b.is_file,
|
|
language: hack == null ? void 0 : hack.language,
|
|
code: hack == null ? void 0 : hack.code,
|
|
title: "main." + LanguageSuf[hack == null ? void 0 : hack.language],
|
|
modify_code: hack == null ? void 0 : hack.modify_code,
|
|
notes: hack == null ? void 0 : hack.notes,
|
|
debugResult,
|
|
debuging,
|
|
submitting,
|
|
executingMessage,
|
|
id,
|
|
languageValue,
|
|
languageList,
|
|
onChangeLanguage,
|
|
onCancelNote,
|
|
onAddNote,
|
|
showNote,
|
|
onShowNote,
|
|
onSubmitCode,
|
|
onChangeCode,
|
|
onChangeInput,
|
|
onDebugCode,
|
|
onResetCode,
|
|
onSyncCode,
|
|
onUpdateCode
|
|
};
|
|
function onTriggerPraise() {
|
|
return OjProblem_async(this, null, function* () {
|
|
const { praise_count } = yield (0,service/* triggerPlus */.vl)(hack.id, { container_type: "Hack", type: 1 });
|
|
let rs = OjProblem_spreadProps(OjProblem_spreadValues({}, data), {
|
|
hack: OjProblem_spreadProps(OjProblem_spreadValues({}, hack), {
|
|
praises_count: praise_count,
|
|
user_praise: !hack.user_praise
|
|
})
|
|
});
|
|
dispatch({
|
|
type: 3 /* SET_DATA */,
|
|
payload: rs
|
|
});
|
|
});
|
|
}
|
|
const leftPanelOption = {
|
|
topicId: id,
|
|
submitResult,
|
|
submitRecords,
|
|
submitting,
|
|
page: submitRecordPage,
|
|
onPageChange,
|
|
hack,
|
|
user: data == null ? void 0 : data.user,
|
|
onTriggerPraise
|
|
};
|
|
console.log(data, saveData == null ? void 0 : saveData.current, "data--------");
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { className: "oj-custom-large-spin", size: "large", spinning: loading }, !data ? null : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "oj-custom-warp" }, /* @__PURE__ */ _react_17_0_2_react.createElement("header", { className: OjFormmodules/* default */.Z.header, style: { minWidth: 1200 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: `${env/* default */.Z.IMG_SERVER}/images/${user.image_url}`, alt: "user", width: 30 }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, user.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("h2", { className: "flex-wrp flex_box_column flex_box_center" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, hack.name), /* @__PURE__ */ _react_17_0_2_react.createElement(Timepiece/* default */.Z, { onChange: (v) => {
|
|
}, className: "font12 c-grey-999" })), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
lib.CopyToClipboard,
|
|
{
|
|
text: `${(_c = window.location) == null ? void 0 : _c.origin}/problems/${hack.identifier}/share`,
|
|
onCopy: () => message/* default */.ZP.success("\u590D\u5236\u9898\u76EE\u94FE\u63A5\u6210\u529F")
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: OjFormmodules/* default */.Z.btn_back, style: { marginRight: 10, cursor: "pointer" } }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-fenxiang1 font14 mr5" }), "\u5206\u4EAB\u9898\u76EE")
|
|
), hack.edit_privilege ? /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { className: OjFormmodules/* default */.Z.btn_back, to: `/problems/${hack.identifier}/ojedit`, style: { marginRight: 10 } }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement(FormOutlined/* default */.Z, null), " \u7F16\u8F91") : null, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { className: OjFormmodules/* default */.Z.btn_back, onClick: () => {
|
|
111;
|
|
}, to: "/problems" }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement(PoweroffOutlined/* default */.Z, null), "\u9000\u51FA")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
SplitContainer/* default */.Z,
|
|
{
|
|
hideResize: true,
|
|
className: "my-problems oj-problems",
|
|
leftChild: /* @__PURE__ */ _react_17_0_2_react.createElement(LeftPanel, OjProblem_spreadValues({}, leftPanelOption)),
|
|
rightChild: /* @__PURE__ */ _react_17_0_2_react.createElement(RightPanel, OjProblem_spreadValues({}, rightPanelOption))
|
|
}
|
|
))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
closable: false,
|
|
width: 680,
|
|
footer: null,
|
|
open: passModalData,
|
|
className: "oj-modal"
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: "oj-modal-content" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "oj-modal-head" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: internal, alt: "" }), /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => setPassModalData(false), className: "iconfont icon-guanbi1" })), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: "mr30", src: title/* default */.Z }), "\u8FD0\u884C\u65F6\u95F4:\xA0", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#75d6ba", marginRight: 100 } }, submitResult == null ? void 0 : submitResult.execute_time, "s"), "\u4F18\u4E8E", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#f3b087", margin: "0 5px" } }, (submitResult == null ? void 0 : submitResult.time_better_than) || 100, "%"), "\u7684\u7528\u6237"), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: "mb50" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: time/* default */.Z, className: "mr30" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "oj-modal-tt" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5360\u7528\u5185\u5B58:\xA0"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, submitResult == null ? void 0 : submitResult.execute_memory, "mb")), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null))), "\u4F18\u4E8E", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#f3b087", margin: "0 5px" } }, (submitResult == null ? void 0 : submitResult.memory_better_than) || 100, "%"), "\u7684\u7528\u6237"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: "oj-modal-next", className: "oj-modal-btn" }, "\u8FDB\u5165\u4E0B\u4E00\u9898"))
|
|
));
|
|
});
|
|
function ActionBar({ languageValue, languageList, onChangeLanguage, title, modify_code, onSyncCode, onShowCodeSetting, onResetCode }) {
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const opneModal = () => {
|
|
modal["default"].confirm({
|
|
title: "\u6062\u590D\u521D\u59CB\u4EE3\u7801",
|
|
icon: /* @__PURE__ */ _react_17_0_2_react.createElement(ExclamationCircleOutlined/* default */.Z, null),
|
|
content: "\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
onOk: onResetCode
|
|
});
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "action-bar" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_select["default"],
|
|
{
|
|
className: "oj-select",
|
|
value: languageValue,
|
|
style: { width: 100 },
|
|
placeholder: "\u9009\u62E9\u8BED\u8A00",
|
|
onChange: onChangeLanguage
|
|
},
|
|
languageList == null ? void 0 : languageList.map((e) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: e.language, value: e.language }, e.language);
|
|
})
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { title: "\u6062\u590D\u521D\u59CB\u4EE3\u7801", onClick: opneModal }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-zhongzhi font-20 " })), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: onShowCodeSetting }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shezhi" })));
|
|
}
|
|
function RightPanel(_a) {
|
|
var _b = _a, { id, input, is_file, showNote, onShowNote, notes, onCancelNote, onAddNote, debugResult, language, debuging, submitting, executingMessage, code, onSubmitCode, onDebugCode, onChangeCode, onChangeInput, onUpdateCode } = _b, actionBarOpation = __objRest(_b, ["id", "input", "is_file", "showNote", "onShowNote", "notes", "onCancelNote", "onAddNote", "debugResult", "language", "debuging", "submitting", "executingMessage", "code", "onSubmitCode", "onDebugCode", "onChangeCode", "onChangeInput", "onUpdateCode"]);
|
|
function ActionBarEL(onShowCodeSetting) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(ActionBar, OjProblem_spreadProps(OjProblem_spreadValues({}, actionBarOpation), { onShowCodeSetting }));
|
|
}
|
|
const testCasePanelOption = {
|
|
id,
|
|
input,
|
|
debugResult,
|
|
debuging,
|
|
is_file,
|
|
submitting,
|
|
executingMessage,
|
|
onDebugCode,
|
|
onChangeCode,
|
|
onSubmitCode,
|
|
onChangeInput
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "right-panel" }, /* @__PURE__ */ _react_17_0_2_react.createElement(CodePanel/* default */.Z, { language, value: code, onChange: onChangeCode, ActionBarRender: ActionBarEL }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `note-form-area ${showNote ? "active" : ""}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(NotesForm, { onCancel: onCancelNote, notes, callback: onAddNote })), /* @__PURE__ */ _react_17_0_2_react.createElement(TestCasePanel/* default */.ZP, OjProblem_spreadValues({}, testCasePanelOption)));
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 95958:
|
|
/*!***************************************************!*\
|
|
!*** ./src/pages/Question/OjProblem/interface.ts ***!
|
|
\***************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ h: function() { return /* binding */ ExecuteStatus; }
|
|
/* harmony export */ });
|
|
var ExecuteStatus = /* @__PURE__ */ ((ExecuteStatus2) => {
|
|
ExecuteStatus2[ExecuteStatus2["NOMATCH"] = -1] = "NOMATCH";
|
|
ExecuteStatus2[ExecuteStatus2["OK"] = 0] = "OK";
|
|
ExecuteStatus2[ExecuteStatus2["TIMEOUT"] = 2] = "TIMEOUT";
|
|
ExecuteStatus2[ExecuteStatus2["PODFAILURE"] = 3] = "PODFAILURE";
|
|
ExecuteStatus2[ExecuteStatus2["COMPILEFAILURE"] = 4] = "COMPILEFAILURE";
|
|
ExecuteStatus2[ExecuteStatus2["EXECUTEFAILURE"] = 5] = "EXECUTEFAILURE";
|
|
return ExecuteStatus2;
|
|
})(ExecuteStatus || {});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 63329:
|
|
/*!*************************************************!*\
|
|
!*** ./src/pages/Question/OjProblem/service.ts ***!
|
|
\*************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ H7: function() { return /* binding */ resetCode; },
|
|
/* harmony export */ KC: function() { return /* binding */ practicesList; },
|
|
/* harmony export */ M3: function() { return /* binding */ editArticlesDetails; },
|
|
/* harmony export */ MK: function() { return /* binding */ addNotes; },
|
|
/* harmony export */ MU: function() { return /* binding */ debugCode; },
|
|
/* harmony export */ Rg: function() { return /* binding */ articlesAssist; },
|
|
/* harmony export */ WH: function() { return /* binding */ articlesList; },
|
|
/* harmony export */ X6: function() { return /* binding */ getRecordDetail; },
|
|
/* harmony export */ bM: function() { return /* binding */ sumbitCode; },
|
|
/* harmony export */ bx: function() { return /* binding */ addArticles; },
|
|
/* harmony export */ dd: function() { return /* binding */ updateLanguageCode; },
|
|
/* harmony export */ de: function() { return /* binding */ deleteArticles; },
|
|
/* harmony export */ fi: function() { return /* binding */ syncCode; },
|
|
/* harmony export */ fu: function() { return /* binding */ getProgrammingTopic; },
|
|
/* harmony export */ gu: function() { return /* binding */ editArticles; },
|
|
/* harmony export */ n4: function() { return /* binding */ updateCode; },
|
|
/* harmony export */ qe: function() { return /* binding */ articlesStatus; },
|
|
/* harmony export */ rL: function() { return /* binding */ articlesHide; },
|
|
/* harmony export */ rX: function() { return /* binding */ getOperationResult; },
|
|
/* harmony export */ uc: function() { return /* binding */ setLogTime; },
|
|
/* harmony export */ vl: function() { return /* binding */ triggerPlus; },
|
|
/* harmony export */ wO: function() { return /* binding */ articlesDetails; },
|
|
/* harmony export */ zO: function() { return /* binding */ getSubmitRecords; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 64841);
|
|
|
|
function getProgrammingTopic(id) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`mypractices/${id}.json`, { hidePopLogin: true });
|
|
}
|
|
function sumbitCode(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/code_submit.json`, params);
|
|
}
|
|
function debugCode(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/code_debug.json`, params);
|
|
}
|
|
function getSubmitRecords(id, params) {
|
|
if (params.language) {
|
|
params.language = encodeURIComponent(params.language);
|
|
}
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`mypractices/${id}/submit_records.json`, params);
|
|
}
|
|
function getRecordDetail(id) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`mypractices/record_detail.json`, { id });
|
|
}
|
|
function getOperationResult(id, mode) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`mypractices/${id}/result.json`, { mode });
|
|
}
|
|
function addNotes(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/add_notes.json`, params);
|
|
}
|
|
function resetCode(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/restore_initial_code.json`, params);
|
|
}
|
|
function syncCode(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/sync_code.json`, params);
|
|
}
|
|
function updateCode(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/update_code.json`, params);
|
|
}
|
|
function updateLanguageCode(id) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/initial_codes.json`);
|
|
}
|
|
function triggerPlus(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`discusses/${id}/plus.json`, params);
|
|
}
|
|
function practicesList(params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`practices/practices_list.json`, params);
|
|
}
|
|
function articlesList(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`practices/${id}/question_solution_articles`, params);
|
|
}
|
|
function addArticles(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`practices/${id}/question_solution_articles`, params);
|
|
}
|
|
function editArticles(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .put */ .gz)(`practices/${id}/question_solution_articles/${params == null ? void 0 : params.active}`, params);
|
|
}
|
|
function editArticlesDetails(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`practices/${id}/question_solution_articles/${params == null ? void 0 : params.active}/edit`, params);
|
|
}
|
|
function articlesDetails(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)(`practices/${id}/question_solution_articles/${params == null ? void 0 : params.active}`, params);
|
|
}
|
|
function articlesStatus(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`practices/${id}/question_solution_articles/${params == null ? void 0 : params.active}/set_authority_or_excellent`, params);
|
|
}
|
|
function articlesAssist(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`practices/${id}/question_solution_articles/${params == null ? void 0 : params.active}/praise_or_treads`, params);
|
|
}
|
|
function articlesHide(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`practices/${id}/question_solution_articles/${params == null ? void 0 : params.active}/hide`);
|
|
}
|
|
function deleteArticles(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .del */ .IV)(`practices/${id}/question_solution_articles/${params == null ? void 0 : params.active}`, params);
|
|
}
|
|
function setLogTime(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)(`mypractices/${id}/update_practice_time_sum`, params);
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8251:
|
|
/*!***********************************!*\
|
|
!*** ./src/utils/aliyunUpload.ts ***!
|
|
\***********************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ o: function() { return /* binding */ getUploader; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 64841);
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! aliyun-vod-upload-ll */ 93125);
|
|
/* harmony import */ var aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
let login = "";
|
|
let uploader;
|
|
let virtual_classroom_id = "";
|
|
function createUploader(options) {
|
|
doCreateUploader(options);
|
|
}
|
|
function doCreateUploader(options) {
|
|
uploader = new (aliyun_vod_upload_ll__WEBPACK_IMPORTED_MODULE_1___default().Vod)({
|
|
timeout: 6e4,
|
|
partSize: 1048576,
|
|
parallel: 5,
|
|
retryCount: 3,
|
|
retryDuration: 2,
|
|
region: "ap-southeast-1",
|
|
userId: 1829848226361863,
|
|
enableUploadProgress: false,
|
|
addFileSuccess: function(uploadInfo) {
|
|
console.log("addFileSuccess: " + uploadInfo.file.name);
|
|
options.addFileSuccess && options.addFileSuccess(uploadInfo);
|
|
uploader.startUpload();
|
|
},
|
|
// 开始上传
|
|
onUploadstarted: function(uploadInfo) {
|
|
const fileName = uploadInfo.file.name;
|
|
if (!uploadInfo.videoId) {
|
|
var createUrl = `/api/users/${login}/video_auths.json`;
|
|
const _random = "";
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(createUrl, {
|
|
method: "Post",
|
|
body: {
|
|
title: _random + fileName,
|
|
file_name: _random + fileName,
|
|
virtual_classroom_id
|
|
}
|
|
}).then((response) => {
|
|
if (response) {
|
|
const data = response.data;
|
|
var uploadAuth = data.UploadAuth;
|
|
var uploadAddress = data.UploadAddress;
|
|
var videoId = data.VideoId;
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId);
|
|
}
|
|
}).catch((error) => {
|
|
uploader.deleteFile(uploader._curIndex);
|
|
uploader.nextUpload();
|
|
console.log(error);
|
|
});
|
|
console.log("\u6587\u4EF6\u5F00\u59CB\u4E0A\u4F20...");
|
|
} else {
|
|
var refreshUrl = `/api/users/${login}/video_auths.json`;
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(refreshUrl, {
|
|
method: "put",
|
|
body: {
|
|
video_id: uploadInfo.videoId,
|
|
title: fileName,
|
|
file_name: fileName,
|
|
virtual_classroom_id
|
|
}
|
|
}).then((response) => {
|
|
if (response.status == -1) {
|
|
options.onUploadError && options.onUploadError(uploadInfo);
|
|
return;
|
|
}
|
|
const data = response.data;
|
|
var uploadAuth = data.UploadAuth;
|
|
var uploadAddress = data.UploadAddress;
|
|
var videoId = data.VideoId;
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress);
|
|
}).catch((error) => {
|
|
uploader.deleteFile(uploader._curIndex);
|
|
uploader.nextUpload();
|
|
console.log(error);
|
|
});
|
|
}
|
|
},
|
|
// 文件上传成功
|
|
onUploadSucceed: function(uploadInfo) {
|
|
options.onUploadSucceed && options.onUploadSucceed(uploadInfo);
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u6210\u529F!");
|
|
},
|
|
// 文件上传失败
|
|
onUploadFailed: function(uploadInfo, code, message) {
|
|
options.onUploadFailed && options.onUploadFailed(uploadInfo);
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25!");
|
|
},
|
|
// 取消文件上传
|
|
onUploadCanceled: function(uploadInfo, code, message) {
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u5DF2\u6682\u505C!");
|
|
},
|
|
// 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
|
|
onUploadProgress: function(uploadInfo, totalSize, progress) {
|
|
options.onUploadProgress && options.onUploadProgress(uploadInfo, totalSize, progress);
|
|
var progressPercent = Math.ceil(progress * 100);
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u4E2D...");
|
|
},
|
|
// 上传凭证超时
|
|
onUploadTokenExpired: function(uploadInfo) {
|
|
console.log("\u6587\u4EF6\u4E0A\u4F20\u8D85\u65F6!");
|
|
var refreshUrl = `/api/users/${login}/video_auths.json`;
|
|
(0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)(refreshUrl, {
|
|
method: "put",
|
|
body: {
|
|
video_id: uploadInfo.videoId
|
|
}
|
|
}).then((response) => {
|
|
const data = response.data;
|
|
var uploadAuth = data.UploadAuth;
|
|
uploader.resumeUploadWithAuth(uploadAuth);
|
|
}).catch((error) => {
|
|
console.log(error);
|
|
});
|
|
},
|
|
// 全部文件上传结束
|
|
onUploadEnd: function(uploadInfo) {
|
|
options.onUploadEnd && options.onUploadEnd(uploadInfo);
|
|
console.log("onUploadEnd: uploaded all the files");
|
|
}
|
|
});
|
|
if (options.gotUploader) {
|
|
options.gotUploader(uploader);
|
|
}
|
|
}
|
|
function getUploader(_login, _virtual_classroom_id, options) {
|
|
_login && (login = _login);
|
|
_virtual_classroom_id && (virtual_classroom_id = _virtual_classroom_id);
|
|
createUploader(options);
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |