|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[2570],{
|
|
|
|
|
|
/***/ 75274:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./src/pages/Competitions/Detail/index.tsx + 13 modules ***!
|
|
|
\**************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// ESM COMPAT FLAG
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"default": function() { return /* binding */ Detail; }
|
|
|
});
|
|
|
|
|
|
// 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__(67866);
|
|
|
// EXTERNAL MODULE: ./src/pages/Competitions/Detail/index.less?modules
|
|
|
var Detailmodules = __webpack_require__(53135);
|
|
|
// EXTERNAL MODULE: ./src/components/AuthenticationModel/index.tsx
|
|
|
var AuthenticationModel = __webpack_require__(33971);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
|
var upload = __webpack_require__(46651);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var es_modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/InboxOutlined.js + 1 modules
|
|
|
var InboxOutlined = __webpack_require__(93737);
|
|
|
// EXTERNAL MODULE: ./src/components/UploadFile/index.tsx
|
|
|
var UploadFile = __webpack_require__(83951);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/AddSubmitModel.tsx
|
|
|
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;
|
|
|
};
|
|
|
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());
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { Dragger } = upload["default"];
|
|
|
const ShixunsListPage = ({
|
|
|
user,
|
|
|
dispatch,
|
|
|
classroomList,
|
|
|
shixunsDetail,
|
|
|
getResults
|
|
|
}) => {
|
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
|
const [time, setTime] = (0,_react_17_0_2_react.useState)();
|
|
|
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [confirmLoading, setConfirmLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const props = {
|
|
|
onRemove: () => {
|
|
|
setFileList([]);
|
|
|
},
|
|
|
beforeUpload: (file) => {
|
|
|
console.log(file);
|
|
|
if ((file == null ? void 0 : file.size) > 1024 * 1024 * 500) {
|
|
|
message/* default */.ZP.info("\u6587\u4EF6\u8D85\u8FC7500M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42");
|
|
|
return false;
|
|
|
}
|
|
|
let filelist = [];
|
|
|
filelist.push(file);
|
|
|
setFileList([...filelist]);
|
|
|
return false;
|
|
|
},
|
|
|
fileList
|
|
|
};
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_modal["default"],
|
|
|
{
|
|
|
title: "\u63D0\u4EA4\u6587\u4EF6",
|
|
|
open: shixunsDetail.actionTabs.key === "md-tab",
|
|
|
confirmLoading,
|
|
|
onOk: () => __async(void 0, null, function* () {
|
|
|
var _a, _b;
|
|
|
if ((fileList == null ? void 0 : fileList.length) <= 0) {
|
|
|
message/* default */.ZP.info("\u8BF7\u5148\u9009\u62E9\u6587\u4EF6");
|
|
|
return;
|
|
|
}
|
|
|
setConfirmLoading(true);
|
|
|
const resulr = yield (0,UploadFile/* uploadFile */.cT)(fileList[0], {
|
|
|
login: (_a = user.userInfo) == null ? void 0 : _a.login,
|
|
|
container_type: "Competition",
|
|
|
container_id: shixunsDetail.actionTabs.params.id,
|
|
|
stage_type: shixunsDetail.actionTabs.params.value,
|
|
|
file_name: (_b = fileList[0]) == null ? void 0 : _b.name
|
|
|
});
|
|
|
if ((resulr == null ? void 0 : resulr.status) === 0) {
|
|
|
message/* default */.ZP.info("\u63D0\u4EA4\u6210\u529F");
|
|
|
dispatch({
|
|
|
type: "shixunsDetail/setActionTabs",
|
|
|
payload: {
|
|
|
key: ""
|
|
|
}
|
|
|
});
|
|
|
setConfirmLoading(false);
|
|
|
setFileList([]);
|
|
|
getResults(shixunsDetail.actionTabs.params.value);
|
|
|
} else {
|
|
|
setConfirmLoading(false);
|
|
|
message/* default */.ZP.info("\u63D0\u4EA4\u5931\u8D25");
|
|
|
}
|
|
|
}),
|
|
|
onCancel: () => {
|
|
|
setFileList([]);
|
|
|
dispatch({
|
|
|
type: "shixunsDetail/setActionTabs",
|
|
|
payload: {
|
|
|
key: ""
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(Dragger, __spreadValues({}, props), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-drag-icon" }, /* @__PURE__ */ _react_17_0_2_react.createElement(InboxOutlined/* default */.Z, null)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-hint" }, "\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))
|
|
|
);
|
|
|
};
|
|
|
/* harmony default export */ var AddSubmitModel = ((0,_umi_production_exports.connect)(
|
|
|
({
|
|
|
user,
|
|
|
classroomList,
|
|
|
shixunsDetail
|
|
|
}) => ({
|
|
|
user,
|
|
|
classroomList,
|
|
|
shixunsDetail
|
|
|
})
|
|
|
)(ShixunsListPage));
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/breadcrumb/index.js + 6 modules
|
|
|
var breadcrumb = __webpack_require__(66104);
|
|
|
// 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/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
|
var RenderHtml = __webpack_require__(16921);
|
|
|
// 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/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(98135);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(21873);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var utils_fetch = __webpack_require__(51165);
|
|
|
// EXTERNAL MODULE: ./src/utils/verifyLogin.tsx + 2 modules
|
|
|
var verifyLogin = __webpack_require__(81261);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
|
var es_select = __webpack_require__(57809);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/carousel/index.js + 10 modules
|
|
|
var carousel = __webpack_require__(9951);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/LeftOutlined.js + 1 modules
|
|
|
var LeftOutlined = __webpack_require__(11407);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/RightOutlined.js + 1 modules
|
|
|
var RightOutlined = __webpack_require__(88845);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/Competitionbonus.tsx
|
|
|
var Competitionbonus_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 { Option } = es_select["default"];
|
|
|
|
|
|
|
|
|
function Bonus({ rewarddata, getlistdatas, is_signed, dispatch, userlist }) {
|
|
|
const Carousels = (0,_react_17_0_2_react.useRef)(null);
|
|
|
const [isshow, SetIsshow] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [className, SetClassname] = (0,_react_17_0_2_react.useState)(void 0);
|
|
|
const [id, SetId] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [name, SetName] = (0,_react_17_0_2_react.useState)(void 0);
|
|
|
const [email, SetEmail] = (0,_react_17_0_2_react.useState)(void 0);
|
|
|
const [phone, SetPhone] = (0,_react_17_0_2_react.useState)(void 0);
|
|
|
function receive(item) {
|
|
|
return Competitionbonus_async(this, null, function* () {
|
|
|
if (item.user_received) {
|
|
|
window.open(item.click_info);
|
|
|
return;
|
|
|
}
|
|
|
if (!(0,verifyLogin/* handleVerifyLogin */.o1)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
if (is_signed === false) {
|
|
|
message/* default */.ZP.info("\u60A8\u5C1A\u672A\u62A5\u540D\u53C2\u8D5B\uFF0C\u8BF7\u62A5\u540D\u53C2\u8D5B\u540E\u9886\u53D6");
|
|
|
return;
|
|
|
}
|
|
|
if (item.click_event === "Pop") {
|
|
|
SetId(item.id);
|
|
|
SetIsshow(true);
|
|
|
return;
|
|
|
} else {
|
|
|
SetClassname(void 0);
|
|
|
}
|
|
|
const result = yield dispatch({
|
|
|
type: "competitions/Reward",
|
|
|
payload: {
|
|
|
competition_module_setting_id: item.id
|
|
|
}
|
|
|
});
|
|
|
if (result && result.status === 0) {
|
|
|
getlistdatas();
|
|
|
if (item.click_event === "Link") {
|
|
|
message/* default */.ZP.info("\u9886\u53D6\u6210\u529F");
|
|
|
window.open(item.click_info);
|
|
|
} else {
|
|
|
message/* default */.ZP.info(item.click_info);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function submitreceive() {
|
|
|
return Competitionbonus_async(this, null, function* () {
|
|
|
if (userlist && !userlist.real_name) {
|
|
|
if (!name) {
|
|
|
message/* default */.ZP.info("\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (userlist && !userlist.email) {
|
|
|
if (!email) {
|
|
|
message/* default */.ZP.info("\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (userlist && !userlist.phone) {
|
|
|
if (!phone) {
|
|
|
message/* default */.ZP.info("\u624B\u673A\u53F7\u7801\u4E0D\u80FD\u4E3A\u7A7A");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (!className) {
|
|
|
message/* default */.ZP.info("\u8BF7\u9009\u62E9\u4F60\u7684\u5E74\u7EA7");
|
|
|
return;
|
|
|
}
|
|
|
const result = yield dispatch({
|
|
|
type: "competitions/Reward",
|
|
|
payload: {
|
|
|
competition_module_setting_id: id,
|
|
|
className,
|
|
|
name,
|
|
|
mail: email,
|
|
|
phone
|
|
|
}
|
|
|
});
|
|
|
if (result && result.status === 0) {
|
|
|
SetIsshow(false);
|
|
|
getlistdatas();
|
|
|
message/* default */.ZP.info("HCIA\u8BA4\u8BC1\u8003\u8BD5\u4EE3\u91D1\u52B5\u5C06\u7531Educoder\u5E73\u53F0\u7EDF\u4E00\u53D1\u653E\uFF0C\u8BF7\u53CA\u65F6\u5173\u6CE8\u90AE\u7BB1\u6216\u7AD9\u5185\u77ED\u4FE1\u67E5\u6536");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_modal["default"],
|
|
|
{
|
|
|
open: isshow,
|
|
|
title: "\u5B8C\u5584\u4FE1\u606F",
|
|
|
onCancel: () => SetIsshow(false),
|
|
|
onOk: () => {
|
|
|
submitreceive();
|
|
|
}
|
|
|
},
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u60A8\u7684\u59D3\u540D\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { className: userlist && userlist.real_name ? "" : Detailmodules/* default */.Z.bkfff, style: { width: "300px", marginLeft: "14px", background: userlist && userlist.phone ? "" : "#ffffff!important" }, value: userlist && userlist.real_name || name, disabled: userlist && userlist.real_name || false, onChange: (e) => SetName(e.target.value) })),
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "1em" } }, "\u60A8\u7684\u90AE\u7BB1\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { className: userlist && userlist.email ? "" : "bkfff", style: { width: "300px", marginLeft: "14px", background: userlist && userlist.phone ? "" : "#ffffff!important" }, value: userlist && userlist.email || email, disabled: userlist && userlist.email || false, onChange: (e) => SetEmail(e.target.value) })),
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "1em" } }, "\u60A8\u7684\u624B\u673A\u53F7\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { style: { width: "300px" }, className: userlist && userlist.phone ? "" : "bkfff", value: userlist && userlist.phone || phone, disabled: userlist && userlist.phone || false, onChange: (e) => SetPhone(e.target.value) })),
|
|
|
"\u60A8\u7684\u5E74\u7EA7\uFF1A",
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], { style: { width: "300px", marginTop: "1em", marginLeft: "14px" }, onChange: (e) => {
|
|
|
SetClassname(e);
|
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u5927\u4E00" }, "\u5927\u4E00"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u5927\u4E8C" }, "\u5927\u4E8C"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u5927\u4E09" }, "\u5927\u4E09"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u5927\u56DB" }, "\u5927\u56DB"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u5927\u4E94" }, "\u5927\u4E94"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u7855\u4E00" }, "\u7855\u4E00"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u7855\u4E8C" }, "\u7855\u4E8C"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u7855\u4E09" }, "\u7855\u4E09"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u535A\u4E00" }, "\u535A\u4E00"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u535A\u4E8C" }, "\u535A\u4E8C"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u535A\u4E09" }, "\u535A\u4E09"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u535A\u56DB" }, "\u535A\u56DB"), /* @__PURE__ */ _react_17_0_2_react.createElement(Option, { value: "\u535A\u4E94" }, "\u535A\u4E94")),
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "1em" } }, "\u63D0\u9192\uFF1A\u5982\u65E0\u534E\u4E3A\u4E91\u8D26\u53F7\uFF0C\u8BF7\u5C3D\u5FEB\u6CE8\u518C\u534E\u4E3A\u4E91\uFF01")
|
|
|
), rewarddata && rewarddata.length > 3 ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { position: "relative", marginBottom: "10px", marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Detailmodules/* default */.Z.spanprev, onClick: () => {
|
|
|
Carousels.current.prev();
|
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement(LeftOutlined/* default */.Z, { style: { color: "#fff", fontSize: "20px", marginLeft: "15px" } })), /* @__PURE__ */ _react_17_0_2_react.createElement(carousel/* default */.Z, { ref: Carousels, className: Detailmodules/* default */.Z.divwidth, slidesToShow: 3, slidesToScroll: 1 }, rewarddata && rewarddata.map((item, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "center", position: "relative" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + `/${item.image_url}` }), item.user_received === false || item.click_event === "Link" ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.receiveclick, onClick: () => receive(item) }, "\u70B9\u51FB\u9886\u53D6") : /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.receivealready }, "\u5DF2\u7ECF\u9886\u53D6"));
|
|
|
})), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Detailmodules/* default */.Z.spannext, onClick: () => {
|
|
|
Carousels.current.next();
|
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement(RightOutlined/* default */.Z, { style: { color: "#fff", fontSize: "20px", marginLeft: "5px" } }))) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.divwidth, style: { justifyContent: "space-around", marginBottom: "10px", marginTop: "10px" } }, rewarddata && rewarddata.map((item, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "center", position: "relative" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + `/${item.image_url}` }), item.user_received === false || item.click_event === "Link" ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.receiveclick, onClick: () => receive(item) }, "\u70B9\u51FB\u9886\u53D6") : /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.receivealready }, "\u5DF2\u7ECF\u9886\u53D6"));
|
|
|
})));
|
|
|
}
|
|
|
/* harmony default export */ var Competitionbonus = (Bonus);
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/SeeItem.tsx
|
|
|
var SeeItem_defProp = Object.defineProperty;
|
|
|
var SeeItem_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var SeeItem_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var SeeItem_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var SeeItem_defNormalProp = (obj, key, value) => key in obj ? SeeItem_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
|
var SeeItem_spreadValues = (a, b) => {
|
|
|
for (var prop in b || (b = {}))
|
|
|
if (SeeItem_hasOwnProp.call(b, prop))
|
|
|
SeeItem_defNormalProp(a, prop, b[prop]);
|
|
|
if (SeeItem_getOwnPropSymbols)
|
|
|
for (var prop of SeeItem_getOwnPropSymbols(b)) {
|
|
|
if (SeeItem_propIsEnum.call(b, prop))
|
|
|
SeeItem_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
var SeeItem_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 SeeItem = ({
|
|
|
StaffDetail,
|
|
|
HeaderDetail,
|
|
|
ItemData,
|
|
|
setIssee,
|
|
|
ModelType,
|
|
|
dispatch,
|
|
|
userinfo,
|
|
|
Editable
|
|
|
}, ref) => {
|
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [fileId, setFileId] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [text, setText] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const { identifier } = (0,_umi_production_exports.useParams)();
|
|
|
const enrolled = (0,_react_17_0_2_react.useRef)(null);
|
|
|
const dom = (0,_react_17_0_2_react.useRef)(null);
|
|
|
enrolled.current = StaffDetail == null ? void 0 : StaffDetail.enrolled;
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a;
|
|
|
(_a = dom.current) == null ? void 0 : _a.addEventListener("click", modal);
|
|
|
return () => {
|
|
|
var _a2;
|
|
|
(_a2 = dom.current) == null ? void 0 : _a2.removeEventListener("click", modal);
|
|
|
};
|
|
|
}, []);
|
|
|
const modal = (e) => {
|
|
|
var _a;
|
|
|
if (((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.id) === "modal-upload") {
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
if (!enrolled.current) {
|
|
|
es_modal["default"].info({
|
|
|
title: "\u63D0\u793A",
|
|
|
centered: true,
|
|
|
okText: "\u6211\u77E5\u9053\u4E86",
|
|
|
content: "\u8BF7\u5148\u62A5\u540D\uFF0C\u518D\u63D0\u4EA4\u4F5C\u54C1"
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
setVisible(true);
|
|
|
}
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a, _b, _c;
|
|
|
if (HeaderDetail == null ? void 0 : HeaderDetail.upload_file) {
|
|
|
setFileList([{
|
|
|
name: (_a = HeaderDetail == null ? void 0 : HeaderDetail.upload_file) == null ? void 0 : _a.title,
|
|
|
status: "done",
|
|
|
uid: "123456789"
|
|
|
}]);
|
|
|
setText(HeaderDetail == null ? void 0 : HeaderDetail.upload_file_url);
|
|
|
setFileId((_c = (_b = HeaderDetail == null ? void 0 : HeaderDetail.upload_file) == null ? void 0 : _b.url) == null ? void 0 : _c.split("/")[3]);
|
|
|
}
|
|
|
}, [HeaderDetail == null ? void 0 : HeaderDetail.upload_file]);
|
|
|
const uploadProps = {
|
|
|
name: "file",
|
|
|
multiple: false,
|
|
|
withCredentials: true,
|
|
|
// accept: ".doc, .docx, .pdf",
|
|
|
// action: '/api/attachments.json',
|
|
|
action: env/* default */.Z.API_SERVER + "/api/attachments.json",
|
|
|
showUploadList: { showRemoveIcon: false },
|
|
|
fileList,
|
|
|
onChange: (info) => {
|
|
|
var _a, _b;
|
|
|
const { status } = info.file;
|
|
|
const newFileList = [SeeItem_spreadValues({}, info.file)];
|
|
|
setFileList(newFileList);
|
|
|
if (info.file.status === "uploading") {
|
|
|
setLoading(true);
|
|
|
}
|
|
|
if (status === "done") {
|
|
|
setFileId((_b = (_a = newFileList[0]) == null ? void 0 : _a.response) == null ? void 0 : _b.id);
|
|
|
setLoading(false);
|
|
|
}
|
|
|
if (status === "error") {
|
|
|
setFileList([]);
|
|
|
setLoading(false);
|
|
|
}
|
|
|
},
|
|
|
beforeUpload: (file) => {
|
|
|
const isLt10M = file.size / 1024 / 1024 < 1e3;
|
|
|
if (!isLt10M) {
|
|
|
message/* default */.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E1000MB");
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
};
|
|
|
const handleVisible = () => {
|
|
|
setVisible(true);
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
|
|
handleVisible
|
|
|
}));
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: dom }, ModelType === "reward" ? /* @__PURE__ */ _react_17_0_2_react.createElement(Competitionbonus, { userlist: userinfo, dispatch, rewarddata: ItemData.reward_setting, is_signed: ItemData.is_signed }) : null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "right" } }, ((userinfo == null ? void 0 : userinfo.admin) || (userinfo == null ? void 0 : userinfo.business) || Editable) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => setIssee(false) }, "\u7F16\u8F91")), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: ItemData.md_content || "\u6682\u65E0" }), ItemData && ItemData.attachments && ItemData.attachments.map((item, index) => {
|
|
|
var _a;
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: ((_a = env/* default */.Z) == null ? void 0 : _a.API_SERVER) + item.url, target: "_self", download: item.title }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { style: { color: "#29BD8B" }, className: "font-14 color-green iconfont icon-fujian mr8" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#000000" } }, item.title), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#000000", marginLeft: "10px" } }, item.filesize)));
|
|
|
}), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_modal["default"],
|
|
|
{
|
|
|
centered: true,
|
|
|
title: "\u4E0A\u4F20\u4F5C\u54C1",
|
|
|
open: visible,
|
|
|
okText: "\u63D0\u4EA4\u4F5C\u54C1",
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
confirmLoading: loading,
|
|
|
onCancel: () => setVisible(false),
|
|
|
onOk: () => SeeItem_async(void 0, null, function* () {
|
|
|
if (!fileId && !text) {
|
|
|
setVisible(false);
|
|
|
return;
|
|
|
}
|
|
|
setLoading(true);
|
|
|
const res = yield (0,utils_fetch/* default */.ZP)(
|
|
|
`/api/competitions/${identifier}/upload_file.json`,
|
|
|
{
|
|
|
method: "post",
|
|
|
body: { attachment_id: fileId, upload_file_url: text }
|
|
|
}
|
|
|
);
|
|
|
if (res.status === 0) {
|
|
|
setVisible(false);
|
|
|
setLoading(false);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4F5C\u54C1\u94FE\u63A5\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { style: { width: 416 }, value: text, onChange: (e) => {
|
|
|
var _a;
|
|
|
return setText((_a = e.target) == null ? void 0 : _a.value);
|
|
|
} })), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "top" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { lineHeight: "28px" } }, "\u4F5C\u54C1\u6587\u4EF6\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], SeeItem_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", className: "mb10" }, "\u4E0A\u4F20\u4F5C\u54C1"))))
|
|
|
));
|
|
|
};
|
|
|
/* harmony default export */ var Detail_SeeItem = ((0,_react_17_0_2_react.forwardRef)(SeeItem));
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 15 modules
|
|
|
var markdown_editor = __webpack_require__(96180);
|
|
|
// EXTERNAL MODULE: ./src/service/competitions.ts
|
|
|
var competitions = __webpack_require__(87472);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/Update.tsx
|
|
|
var Update_defProp = Object.defineProperty;
|
|
|
var Update_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var Update_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var Update_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var Update_defNormalProp = (obj, key, value) => key in obj ? Update_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
|
var Update_spreadValues = (a, b) => {
|
|
|
for (var prop in b || (b = {}))
|
|
|
if (Update_hasOwnProp.call(b, prop))
|
|
|
Update_defNormalProp(a, prop, b[prop]);
|
|
|
if (Update_getOwnPropSymbols)
|
|
|
for (var prop of Update_getOwnPropSymbols(b)) {
|
|
|
if (Update_propIsEnum.call(b, prop))
|
|
|
Update_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
var Update_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());
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Update_SeeItem({ ItemData, setIssee, MenuItem, dispatch, identifier, ModelType, userinfo, getrightdatas }) {
|
|
|
let [defaultFileList, setDefaultFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [defaultcontent, setDefaultcontent] = (0,_react_17_0_2_react.useState)(ItemData.md_content);
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a;
|
|
|
let data = [];
|
|
|
(_a = ItemData == null ? void 0 : ItemData.attachments) == null ? void 0 : _a.map((item) => {
|
|
|
let tt = { uid: item.id, name: item.title, response: { id: item.id } };
|
|
|
data.push(tt);
|
|
|
});
|
|
|
setDefaultFileList(data);
|
|
|
}, [ItemData == null ? void 0 : ItemData.attachments]);
|
|
|
function getdata() {
|
|
|
var _a;
|
|
|
let data = [];
|
|
|
(_a = ItemData == null ? void 0 : ItemData.attachments) == null ? void 0 : _a.map((item) => {
|
|
|
let tt = { uid: item == null ? void 0 : item.id, name: item.title, response: { id: item.id } };
|
|
|
data.push(tt);
|
|
|
});
|
|
|
return data;
|
|
|
}
|
|
|
const uploadProps = {
|
|
|
name: "file",
|
|
|
multiple: true,
|
|
|
withCredentials: true,
|
|
|
action: env/* default */.Z.API_SERVER + "/api/attachments.json",
|
|
|
defaultFileList: getdata(),
|
|
|
onRemove(e) {
|
|
|
(0,competitions/* deletAttachments */.y8)({ id: e.uid });
|
|
|
},
|
|
|
onChange(info) {
|
|
|
const { status } = info.file;
|
|
|
if (status !== "uploading") {
|
|
|
}
|
|
|
if (status === "removed") {
|
|
|
setDefaultFileList(info.fileList);
|
|
|
}
|
|
|
if (status === "done") {
|
|
|
setDefaultFileList(info.fileList);
|
|
|
message/* default */.ZP.success(`${info.file.name} \u6587\u4EF6\u4E0A\u4F20\u6210\u529F`);
|
|
|
} else if (status === "error") {
|
|
|
message/* default */.ZP.error(`${info.file.name} \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`);
|
|
|
}
|
|
|
},
|
|
|
beforeUpload: (file) => {
|
|
|
const isLt150M = file.size / 1024 / 1024 < 150;
|
|
|
if (!isLt150M) {
|
|
|
message/* default */.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB");
|
|
|
}
|
|
|
return isLt150M;
|
|
|
}
|
|
|
};
|
|
|
console.log(uploadProps);
|
|
|
function updateItem() {
|
|
|
return Update_async(this, null, function* () {
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/updateMdContent",
|
|
|
payload: {
|
|
|
attachment_ids: getitemid(defaultFileList),
|
|
|
competition_module_id: ItemData.id,
|
|
|
md_content_id: ItemData.md_id,
|
|
|
content: defaultcontent,
|
|
|
identifier
|
|
|
}
|
|
|
});
|
|
|
if (data) {
|
|
|
message/* default */.ZP.info("\u63D0\u4EA4\u6210\u529F");
|
|
|
setIssee(true);
|
|
|
getrightdatas(MenuItem);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function getitemid(itemlist) {
|
|
|
let data = [];
|
|
|
itemlist && itemlist.map((item) => {
|
|
|
data.push(item.response.id);
|
|
|
});
|
|
|
return data;
|
|
|
}
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ModelType === "reward" ? /* @__PURE__ */ _react_17_0_2_react.createElement(Competitionbonus, { userlist: userinfo, dispatch, rewarddata: ItemData.reward_setting, is_signed: ItemData.is_signed }) : null, /* @__PURE__ */ _react_17_0_2_react.createElement(markdown_editor/* default */.Z, { defaultValue: defaultcontent, onChange: (e) => setDefaultcontent(e) }), /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], Update_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: "uploadBtn" }, "\u4E0A\u4F20\u9644\u4EF6"), "(\u5355\u4E2A\u6587\u4EF6150M\u4EE5\u5185)"), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { width: "90px" }, type: "primary", onClick: () => updateItem() }, "\u63D0\u4EA4"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: "30px", width: "90px" }, onClick: () => setIssee(true) }, "\u53D6\u6D88")));
|
|
|
}
|
|
|
/* harmony default export */ var Update = (Update_SeeItem);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
|
var tabs = __webpack_require__(99313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
|
|
|
var table = __webpack_require__(14491);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/RankingNuLL.tsx
|
|
|
|
|
|
|
|
|
function RankNull() {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "24px", color: "#05101a" } }, "\u603B\u6392\u884C"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + `/images/educoder/competitions/trophy.png` }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u8981\u6293\u4F4F\u4E00\u5207\u673A\u4F1A\uFF0C\u5411\u6240\u6709\u4EBA\u8BC1\u660E\u81EA\u5DF1\uFF0C\u8BC1\u660E\u4F60\u80FD\u591F\u8FCE\u63A5\u8363\u8000")));
|
|
|
}
|
|
|
/* harmony default export */ var RankingNuLL = (RankNull);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
|
var col = __webpack_require__(43604);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/card/index.js + 4 modules
|
|
|
var card = __webpack_require__(18889);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/RankingItem.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function RankingItem({ oneItem, towItem, threeItem }) {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { gutter: 16, style: { justifyContent: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 6, style: { marginTop: "30px", marginRight: "20px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(card/* default */.Z, { title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.towtop }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { style: { marginTop: "20px" }, src: env/* default */.Z.IMG_SERVER + `/images/educoder/huangguan-two.png` }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/users/${towItem == null ? void 0 : towItem.user_login}/classrooms` }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Detailmodules/* default */.Z.imgradius, src: env/* default */.Z.IMG_SERVER + `/images/${towItem == null ? void 0 : towItem.user_image}` }), (towItem == null ? void 0 : towItem.competition_prize) && /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.prize }, towItem == null ? void 0 : towItem.competition_prize), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { color: "#05101a", fontSize: "16px", marginTop: "10px" } }, towItem == null ? void 0 : towItem.record_user_name)))), className: Detailmodules/* default */.Z.towdiv, bordered: false }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "14px" } }, towItem == null ? void 0 : towItem.school_name), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "18px" } }, towItem == null ? void 0 : towItem.spend_time), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "26px", color: "#a55b29" } }, parseFloat(towItem == null ? void 0 : towItem.extra_score) + parseFloat(towItem == null ? void 0 : towItem.score), "\u5206"))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 6 }, /* @__PURE__ */ _react_17_0_2_react.createElement(card/* default */.Z, { title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.onetop }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { style: { marginTop: "20px" }, src: env/* default */.Z.IMG_SERVER + `/images/educoder/huangguan.png` }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/users/${oneItem == null ? void 0 : oneItem.user_login}/classrooms` }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Detailmodules/* default */.Z.imgradius, src: env/* default */.Z.IMG_SERVER + `/images/${oneItem == null ? void 0 : oneItem.user_image}` }), (oneItem == null ? void 0 : oneItem.competition_prize) && /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.prize }, oneItem == null ? void 0 : oneItem.competition_prize), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { color: "#05101a", fontSize: "16px", marginTop: "10px" } }, oneItem == null ? void 0 : oneItem.record_user_name)))), className: Detailmodules/* default */.Z.onediv, bordered: false }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "14px" } }, oneItem == null ? void 0 : oneItem.school_name), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "18px" } }, oneItem == null ? void 0 : oneItem.spend_time), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "26px", color: "#a55b29" } }, parseFloat(oneItem == null ? void 0 : oneItem.extra_score) + parseFloat(oneItem == null ? void 0 : oneItem.score), "\u5206"))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 6, style: { marginTop: "40px", marginLeft: "20px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(card/* default */.Z, { title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.threetop }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { style: { marginTop: "20px" }, src: env/* default */.Z.IMG_SERVER + `/images/educoder/huangguan-three.png` }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/users/${threeItem == null ? void 0 : threeItem.user_login}/classrooms` }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Detailmodules/* default */.Z.imgradius, src: env/* default */.Z.IMG_SERVER + `/images/${threeItem == null ? void 0 : threeItem.user_image}` }), (threeItem == null ? void 0 : threeItem.competition_prize) && /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.prize }, threeItem == null ? void 0 : threeItem.competition_prize), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { color: "#05101a", fontSize: "16px", marginTop: "10px" } }, threeItem == null ? void 0 : threeItem.record_user_name)))), className: Detailmodules/* default */.Z.threediv, bordered: false }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "14px" } }, threeItem == null ? void 0 : threeItem.school_name), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "18px" } }, threeItem == null ? void 0 : threeItem.spend_time), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "26px", color: "#a55b29" } }, parseFloat(threeItem == null ? void 0 : threeItem.extra_score) + parseFloat(threeItem == null ? void 0 : threeItem.score), "\u5206")))));
|
|
|
}
|
|
|
/* harmony default export */ var Detail_RankingItem = (RankingItem);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/RankingList.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function RanKingList({ ItemData }) {
|
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { fontSize: "24px", color: "#05101a" } }, "\u603B\u6392\u884C"), /* @__PURE__ */ _react_17_0_2_react.createElement(Detail_RankingItem, { oneItem: ItemData == null ? void 0 : ItemData.teams[0], towItem: ItemData == null ? void 0 : ItemData.teams[1], threeItem: ItemData == null ? void 0 : ItemData.teams[2] }), ((_a = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.myTeam }, ((_c = (_b = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _b[0]) == null ? void 0 : _c.success) === false ? /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: "70px", padding: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginBottom: "0px" } }, " \u662F\u5426\u664B\u7EA7\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { "color": ((_e = (_d = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _d[0]) == null ? void 0 : _e.success) === false ? "red" : "green" } }, ((_g = (_f = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _f[0]) == null ? void 0 : _g.success) === false ? "\u5426" : ((_i = (_h = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _h[0]) == null ? void 0 : _i.success) ? "\u662F" : "")), ((_k = (_j = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _j[0]) == null ? void 0 : _k.awards) && /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginBottom: "0px" } }, " \u662F\u5426\u83B7\u5956\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, ((_m = (_l = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _l[0]) == null ? void 0 : _m.awards) === "percent_20" ? "\u4E8C\u7B49\u5956" : ((_o = (_n = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _n[0]) == null ? void 0 : _o.awards) === "percent_30" ? "\u4E09\u7B49\u5956" : "\u6CA1\u6709\u83B7\u5F97\u5956\u9879"))) : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: "70px" } }, "\u6211\u7684\u6392\u540D\uFF1A", (_q = (_p = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _p[0]) == null ? void 0 : _q.rank), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u6218\u961F\u540D" }, (_s = (_r = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _r[0]) == null ? void 0 : _s.team_name)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u65F6\u95F4" }, (_u = (_t = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _t[0]) == null ? void 0 : _u.cost_time)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1, textAlign: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u8D4B\u80FD\u8D5B\u52A0\u5206" }, (_w = (_v = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _v[0]) == null ? void 0 : _w.extra_score)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u6BD4\u8D5B\u6210\u7EE9" }, (_y = (_x = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _x[0]) == null ? void 0 : _y.score)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u603B\u5206" }, parseFloat((_A = (_z = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _z[0]) == null ? void 0 : _A.extra_score) + parseFloat((_C = (_B = ItemData == null ? void 0 : ItemData.user_ranks) == null ? void 0 : _B[0]) == null ? void 0 : _C.score) || 0))), (_D = ItemData == null ? void 0 : ItemData.teams) == null ? void 0 : _D.map((item, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.bottomItem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#0152d9", marginRight: "20px" } }, index + 1), /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/users/${item == null ? void 0 : item.user_login}/classrooms`, style: { marginRight: "80px", position: "relative" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Detailmodules/* default */.Z.imgradius, src: env/* default */.Z.IMG_SERVER + `/images/${item == null ? void 0 : item.user_image}` }), (item == null ? void 0 : item.competition_prize) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Detailmodules/* default */.Z.spanrightradius }, item == null ? void 0 : item.competition_prize)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u6218\u961F\u540D" }, item == null ? void 0 : item.team_name)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5355\u4F4D/\u5B66\u6821\u540D" }, item.school_name)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1, textAlign: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u8D4B\u80FD\u8D5B\u52A0\u5206" }, item.extra_score)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flex: 1 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u6BD4\u8D5B\u6210\u7EE9" }, item.score)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#0152d9" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u603B\u5206" }, parseFloat(item.extra_score) + parseFloat(item.score))));
|
|
|
}));
|
|
|
}
|
|
|
/* harmony default export */ var RankingList = (RanKingList);
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/Ranking.tsx
|
|
|
var Ranking_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 { TabPane } = tabs["default"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Ranking({ ChartRules, ItemData, getCharts, Selectkey, getChartRules, userinfo, Editable, HeaderDetail }) {
|
|
|
var _a, _b, _c, _d, _e, _f;
|
|
|
const [isUpdate, setIsupdate] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [defaultValue, setDefaultValue] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [ClickButton, setClickButton] = (0,_react_17_0_2_react.useState)(true);
|
|
|
const [item, setItem] = (0,_react_17_0_2_react.useState)();
|
|
|
const [items, setItems] = (0,_react_17_0_2_react.useState)();
|
|
|
const { identifier } = (0,_umi_production_exports.useParams)();
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g;
|
|
|
if (ClickButton) {
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2[0];
|
|
|
setItem(data);
|
|
|
if (data == null ? void 0 : data.id) {
|
|
|
if ((HeaderDetail == null ? void 0 : HeaderDetail.task) === "mAP" || (HeaderDetail == null ? void 0 : HeaderDetail.task) === "dog") {
|
|
|
getCharts(data == null ? void 0 : data.id);
|
|
|
}
|
|
|
setDefaultValue(((_d2 = (_c2 = (_b2 = ChartRules.rule_contents) == null ? void 0 : _b2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(data == null ? void 0 : data.id))) == null ? void 0 : _c2[0]) == null ? void 0 : _d2["content"]) || "");
|
|
|
} else {
|
|
|
if ((HeaderDetail == null ? void 0 : HeaderDetail.task) === "mAP" || (HeaderDetail == null ? void 0 : HeaderDetail.task) === "dog") {
|
|
|
}
|
|
|
setDefaultValue(((_g = (_f2 = (_e2 = ChartRules.rule_contents) == null ? void 0 : _e2.filter((item2) => parseInt(item2.competition_stage_id) === 0)) == null ? void 0 : _f2[0]) == null ? void 0 : _g["content"]) || "");
|
|
|
}
|
|
|
}
|
|
|
}, [ChartRules]);
|
|
|
function updateitem() {
|
|
|
return Ranking_async(this, null, function* () {
|
|
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
|
if (!defaultValue) {
|
|
|
message/* default */.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A");
|
|
|
return;
|
|
|
}
|
|
|
setClickButton(false);
|
|
|
let id = item == null ? void 0 : item.id;
|
|
|
if (id) {
|
|
|
const res = yield (0,utils_fetch/* default */.ZP)(
|
|
|
`/api/competitions/${identifier}/update_md_content.json`,
|
|
|
{
|
|
|
method: "post",
|
|
|
body: {
|
|
|
competition_module_id: Selectkey,
|
|
|
content: defaultValue,
|
|
|
md_content_id: (_c2 = (_b2 = (_a2 = ChartRules.rule_contents) == null ? void 0 : _a2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(id))) == null ? void 0 : _b2[0]) == null ? void 0 : _c2["id"],
|
|
|
stage_id: item == null ? void 0 : item.id
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.info("\u66F4\u65B0\u6210\u529F");
|
|
|
setIsupdate(false);
|
|
|
getChartRules();
|
|
|
}
|
|
|
} else {
|
|
|
const res = yield (0,utils_fetch/* default */.ZP)(
|
|
|
`/api/competitions/${identifier}/update_md_content.json`,
|
|
|
{
|
|
|
method: "post",
|
|
|
body: {
|
|
|
competition_module_id: Selectkey,
|
|
|
content: defaultValue,
|
|
|
md_content_id: (_f2 = (_e2 = (_d2 = ChartRules.rule_contents) == null ? void 0 : _d2.filter((item2) => parseInt(item2.competition_stage_id) === 0)) == null ? void 0 : _e2[0]) == null ? void 0 : _f2["id"],
|
|
|
stage_id: item == null ? void 0 : item.id
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.info("\u66F4\u65B0\u6210\u529F");
|
|
|
setIsupdate(false);
|
|
|
getChartRules();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
const columns = [
|
|
|
{
|
|
|
title: "\u6392\u540D",
|
|
|
dataIndex: "name",
|
|
|
align: "center",
|
|
|
key: "name",
|
|
|
render: (a, b, c) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, c + 1);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: "\u5934\u50CF",
|
|
|
dataIndex: "user_image",
|
|
|
align: "center",
|
|
|
key: "user_image",
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("img", { className: Detailmodules/* default */.Z.imgradius, src: env/* default */.Z.IMG_SERVER + `/images/${text}` });
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: "\u6218\u961F\u540D\u79F0",
|
|
|
dataIndex: "team_name",
|
|
|
key: "team_name",
|
|
|
// width:120,
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { title: text }, text && (text == null ? void 0 : text.length) >= 15 ? (text == null ? void 0 : text.substr(0, 15)) + "..." : text || "--");
|
|
|
}
|
|
|
// align:'center',
|
|
|
},
|
|
|
{
|
|
|
title: "\u5355\u4F4D",
|
|
|
dataIndex: "school_name",
|
|
|
key: "school_name",
|
|
|
align: "center",
|
|
|
render: (a) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, a || "--");
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: (HeaderDetail == null ? void 0 : HeaderDetail.task) === "mAP" ? "mAP\u6307\u6807" : (HeaderDetail == null ? void 0 : HeaderDetail.task) === "Jittor-3" ? "\u603B\u5206" : "top1\u6307\u6807",
|
|
|
dataIndex: "score",
|
|
|
key: "score",
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, text || "--");
|
|
|
}
|
|
|
}
|
|
|
];
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ((_a = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a.length) > 0 ? null : /* @__PURE__ */ _react_17_0_2_react.createElement(RankingNuLL, null), ((_b = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { animated: true, tabBarExtraContent: ((userinfo == null ? void 0 : userinfo.admin) || (userinfo == null ? void 0 : userinfo.business) || Editable) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
|
setIsupdate(true);
|
|
|
} }, "\u7F16\u8F91"), onChange: (e) => {
|
|
|
var _a2, _b2, _c2, _d2, _e2;
|
|
|
setIsupdate(false);
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
setItem(data);
|
|
|
let datas = (_b2 = data == null ? void 0 : data.children) == null ? void 0 : _b2[0];
|
|
|
setItems(datas);
|
|
|
setDefaultValue(((_e2 = (_d2 = (_c2 = ChartRules.rule_contents) == null ? void 0 : _c2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(data == null ? void 0 : data.id))) == null ? void 0 : _d2[0]) == null ? void 0 : _e2["content"]) || "");
|
|
|
getCharts((datas == null ? void 0 : datas.id) || e);
|
|
|
} }, ChartRules && ChartRules.stages.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id }, isUpdate === false && ChartRules && ChartRules.rule_contents.map((items2, keys) => {
|
|
|
if (item2.id === items2.competition_stage_id) {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { key: keys, value: items2.content === void 0 || items2.content === null ? "" : items2.content });
|
|
|
} else if (item2.id === null && items2.competition_stage_id === 0) {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { key: keys, value: items2.content === void 0 || items2.content === null ? "" : items2.content });
|
|
|
}
|
|
|
}));
|
|
|
})), ((_c = item == null ? void 0 : item.children) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { activeKey: (items == null ? void 0 : items.id) + "", onChange: (e) => {
|
|
|
var _a2;
|
|
|
let data = (_a2 = item == null ? void 0 : item.children) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
setItems(data);
|
|
|
getCharts(e);
|
|
|
} }, (_d = item == null ? void 0 : item.children) == null ? void 0 : _d.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id });
|
|
|
})), isUpdate && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(markdown_editor/* default */.Z, { defaultValue, onChange: (e) => {
|
|
|
setDefaultValue(e);
|
|
|
} }), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginTop: "10px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { width: "90px" }, type: "primary", onClick: () => updateitem() }, "\u63D0\u4EA4"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: "30px", width: "90px" }, onClick: () => setIsupdate(false) }, "\u53D6\u6D88"))), ((_e = ItemData == null ? void 0 : ItemData.teams) == null ? void 0 : _e.length) > 0 && ((HeaderDetail == null ? void 0 : HeaderDetail.task) === "mAP" || (HeaderDetail == null ? void 0 : HeaderDetail.task) === "dog" || (HeaderDetail == null ? void 0 : HeaderDetail.task) === "Jittor-3") ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
table["default"],
|
|
|
{
|
|
|
dataSource: ItemData == null ? void 0 : ItemData.teams,
|
|
|
columns,
|
|
|
pagination: false
|
|
|
}
|
|
|
) : ((_f = ItemData == null ? void 0 : ItemData.teams) == null ? void 0 : _f.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(RankingList, { ItemData }));
|
|
|
}
|
|
|
/* harmony default export */ var Detail_Ranking = (Ranking);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/Competitions/Detail/AwardPdf.tsx + 5 modules
|
|
|
var AwardPdf = __webpack_require__(83957);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(13462);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(88141);
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.11@dayjs/dayjs.min.js
|
|
|
var dayjs_min = __webpack_require__(99232);
|
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/SubmitResult.tsx
|
|
|
/* provided dependency */ var React = __webpack_require__(/*! react */ 59301);
|
|
|
var SubmitResult_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 { TabPane: SubmitResult_TabPane } = tabs["default"];
|
|
|
function SubmitResult_Ranking({ ChartRules, ItemData, getCharts, Selectkey, HeaderDetail, getChartRules, userinfo, Editable, dispatch, StaffDetail }) {
|
|
|
var _a, _b, _c, _d, _e, _f;
|
|
|
const [isUpdate, setIsupdate] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [defaultValue, setDefaultValue] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [ClickButton, setClickButton] = (0,_react_17_0_2_react.useState)(true);
|
|
|
const [item, setItem] = (0,_react_17_0_2_react.useState)();
|
|
|
const [items, setItems] = (0,_react_17_0_2_react.useState)();
|
|
|
const { identifier } = (0,_umi_production_exports.useParams)();
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j;
|
|
|
if (ClickButton) {
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2[0];
|
|
|
setItem(data);
|
|
|
let datas = (_d2 = (_c2 = (_b2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.children) == null ? void 0 : _d2[0];
|
|
|
setItems(datas);
|
|
|
if (data == null ? void 0 : data.id) {
|
|
|
getCharts(data == null ? void 0 : data.id);
|
|
|
setDefaultValue(((_g = (_f2 = (_e2 = ChartRules.rule_contents) == null ? void 0 : _e2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(data == null ? void 0 : data.id))) == null ? void 0 : _f2[0]) == null ? void 0 : _g["content"]) || "");
|
|
|
} else {
|
|
|
getCharts(0);
|
|
|
setDefaultValue(((_j = (_i = (_h = ChartRules.rule_contents) == null ? void 0 : _h.filter((item2) => parseInt(item2.competition_stage_id) === 0)) == null ? void 0 : _i[0]) == null ? void 0 : _j["content"]) || "");
|
|
|
}
|
|
|
}
|
|
|
}, [ChartRules]);
|
|
|
function updateitem() {
|
|
|
return SubmitResult_async(this, null, function* () {
|
|
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
|
if (!defaultValue) {
|
|
|
message/* default */.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A");
|
|
|
return;
|
|
|
}
|
|
|
setClickButton(false);
|
|
|
let id = item == null ? void 0 : item.id;
|
|
|
if (id) {
|
|
|
const res = yield (0,utils_fetch/* default */.ZP)(
|
|
|
`/api/competitions/${identifier}/update_md_content.json`,
|
|
|
{
|
|
|
method: "post",
|
|
|
body: {
|
|
|
competition_module_id: Selectkey,
|
|
|
content: defaultValue,
|
|
|
md_content_id: (_c2 = (_b2 = (_a2 = ChartRules.rule_contents) == null ? void 0 : _a2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(id))) == null ? void 0 : _b2[0]) == null ? void 0 : _c2["id"],
|
|
|
stage_id: item == null ? void 0 : item.id
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.info("\u66F4\u65B0\u6210\u529F");
|
|
|
setIsupdate(false);
|
|
|
getChartRules();
|
|
|
}
|
|
|
} else {
|
|
|
const res = yield (0,utils_fetch/* default */.ZP)(
|
|
|
`/api/competitions/${identifier}/update_md_content.json`,
|
|
|
{
|
|
|
method: "post",
|
|
|
body: {
|
|
|
competition_module_id: Selectkey,
|
|
|
content: defaultValue,
|
|
|
md_content_id: (_f2 = (_e2 = (_d2 = ChartRules.rule_contents) == null ? void 0 : _d2.filter((item2) => parseInt(item2.competition_stage_id) === 0)) == null ? void 0 : _e2[0]) == null ? void 0 : _f2["id"],
|
|
|
stage_id: item == null ? void 0 : item.id
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
if (res.status === 0) {
|
|
|
message/* default */.ZP.info("\u66F4\u65B0\u6210\u529F");
|
|
|
setIsupdate(false);
|
|
|
getChartRules();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
const columns = [
|
|
|
{
|
|
|
title: "request_id",
|
|
|
dataIndex: "request_id",
|
|
|
width: 120,
|
|
|
align: "center",
|
|
|
key: "name",
|
|
|
render: (a, b, c) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, a);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: "\u9644\u4EF6",
|
|
|
dataIndex: "file_name",
|
|
|
align: "center",
|
|
|
width: 150,
|
|
|
key: "file_name",
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ React.createElement(tooltip/* default */.Z, { title: text }, /* @__PURE__ */ React.createElement("span", { title: text }, text && (text == null ? void 0 : text.length) >= 10 ? (text == null ? void 0 : text.substr(0, 10)) + "..." : text || "--"));
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: "\u63D0\u4EA4\u4EBA",
|
|
|
dataIndex: "user_name",
|
|
|
key: "user_name",
|
|
|
width: 100,
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", { title: text }, text && (text == null ? void 0 : text.length) >= 6 ? (text == null ? void 0 : text.substr(0, 6)) + "..." : text || "--");
|
|
|
}
|
|
|
// align:'center',
|
|
|
},
|
|
|
{
|
|
|
title: "\u63D0\u4EA4\u65F6\u95F4",
|
|
|
dataIndex: "created_at",
|
|
|
key: "created_at",
|
|
|
align: "center"
|
|
|
},
|
|
|
{
|
|
|
title: "\u72B6\u6001",
|
|
|
dataIndex: "status",
|
|
|
key: "status",
|
|
|
width: 50,
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, text === 1 ? "\u8BA1\u7B97\u4E2D" : text === 2 ? "\u5B8C\u6210" : text === 0 ? "\u5F85\u8BA1\u7B97" : text === 3 && "\u9519\u8BEF");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name) === "\u8BA1\u56FE\u6311\u6218\u70ED\u8EAB\u8D5B" && {
|
|
|
title: "\u6570\u636E\u6307\u68071",
|
|
|
dataIndex: "data_ranking",
|
|
|
key: "data_ranking",
|
|
|
align: "center",
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, text || "--");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name) === "\u8BA1\u56FE\u6311\u6218\u70ED\u8EAB\u8D5B" && {
|
|
|
title: "\u6570\u636E\u6307\u68072",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
if ((text == null ? void 0 : text.length) > 0) {
|
|
|
return text == null ? void 0 : text.map((item2, index) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, item2 == null ? void 0 : item2.name, "\uFF1A", item2 == null ? void 0 : item2.value, " ", /* @__PURE__ */ React.createElement("br", null));
|
|
|
});
|
|
|
} else {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, "--");
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_six_indicators) && {
|
|
|
title: "\u6570\u636E\u6307\u6807",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
if ((text == null ? void 0 : text.length) > 0) {
|
|
|
return text == null ? void 0 : text.map((item2, index) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, item2 == null ? void 0 : item2.name, "\uFF1A", item2 == null ? void 0 : item2.value, " ", /* @__PURE__ */ React.createElement("br", null));
|
|
|
});
|
|
|
} else {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, "--");
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_five_indicators) && {
|
|
|
title: "top1\u6307\u6807",
|
|
|
dataIndex: "data_indicators",
|
|
|
key: "data_indicators",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return ((_a2 = text == null ? void 0 : text[0]) == null ? void 0 : _a2.value) || "- -";
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_five_indicators) && {
|
|
|
title: "top5\u6307\u6807",
|
|
|
dataIndex: "data_indicators",
|
|
|
key: "data_indicators",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return ((_a2 = text == null ? void 0 : text[1]) == null ? void 0 : _a2.value) || "- -";
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_four_indicators) && {
|
|
|
title: "mask accuary",
|
|
|
dataIndex: "data_ranking",
|
|
|
key: "data_ranking",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, text || "--");
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_one_indicators) && {
|
|
|
title: "mIoU",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_ranking",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "mIoU")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_four_indicators) && {
|
|
|
title: "\u7F8E\u5B66\u8BC4\u5206",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "score")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_four_indicators) && {
|
|
|
title: "FID",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "fid")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_four_indicators) && {
|
|
|
title: "\u98CE\u683C\u76F8\u4F3C\u5EA6",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "style_similarity")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
(item == null ? void 0 : item.display_four_indicators) && {
|
|
|
title: "\u603B\u5206",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "left",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "total_score")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name.includes("\u53EF\u5FAE\u6E32\u67D3\u65B0\u89C6\u89D2\u751F\u6210\u8D5B\u9898")) && {
|
|
|
title: "Car",
|
|
|
dataIndex: "data_ranking",
|
|
|
key: "data_ranking",
|
|
|
align: "center",
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ React.createElement("span", null, text || "--");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name.includes("\u53EF\u5FAE\u6E32\u67D3\u65B0\u89C6\u89D2\u751F\u6210\u8D5B\u9898")) && {
|
|
|
title: "Coffee",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "center",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "Coffee")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name.includes("\u53EF\u5FAE\u6E32\u67D3\u65B0\u89C6\u89D2\u751F\u6210\u8D5B\u9898")) && {
|
|
|
title: "Easyship",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "center",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "Easyship")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name.includes("\u53EF\u5FAE\u6E32\u67D3\u65B0\u89C6\u89D2\u751F\u6210\u8D5B\u9898")) && {
|
|
|
title: "Scar",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "center",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "Scar")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name.includes("\u53EF\u5FAE\u6E32\u67D3\u65B0\u89C6\u89D2\u751F\u6210\u8D5B\u9898")) && {
|
|
|
title: "Scarf",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "center",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "Scarf")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
!(item == null ? void 0 : item.display_four_indicators) && (item == null ? void 0 : item.name.includes("\u53EF\u5FAE\u6E32\u67D3\u65B0\u89C6\u89D2\u751F\u6210\u8D5B\u9898")) && {
|
|
|
title: "\u603B\u5206",
|
|
|
dataIndex: "data_other",
|
|
|
key: "data_other",
|
|
|
align: "center",
|
|
|
render: (text) => {
|
|
|
var _a2;
|
|
|
return /* @__PURE__ */ React.createElement("span", null, ((_a2 = text == null ? void 0 : text.find((item2) => (item2 == null ? void 0 : item2.name) === "Total")) == null ? void 0 : _a2.value) || "--");
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: "\u64CD\u4F5C",
|
|
|
dataIndex: "result_url",
|
|
|
width: 50,
|
|
|
key: "result_url",
|
|
|
render: (text) => {
|
|
|
return /* @__PURE__ */ React.createElement("a", { href: text, target: "_blank", download: "\u9644\u4EF6" }, "\u4E0B\u8F7D");
|
|
|
}
|
|
|
}
|
|
|
].filter((item2) => !!item2);
|
|
|
;
|
|
|
return /* @__PURE__ */ React.createElement("div", null, ((_a = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a.length) > 0 ? null : /* @__PURE__ */ React.createElement(RankingNuLL, null), ((_b = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ React.createElement(tabs["default"], { animated: true, tabBarExtraContent: (userinfo == null ? void 0 : userinfo.admin) || (userinfo == null ? void 0 : userinfo.business) || Editable ? /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { onClick: () => {
|
|
|
setIsupdate(true);
|
|
|
} }, "\u7F16\u8F91") : StaffDetail.enrolled && (item == null ? void 0 : item.start_time) && (item == null ? void 0 : item.end_time) && /* @__PURE__ */ React.createElement("span", null, "\u63D0\u4EA4\u65F6\u95F4\uFF1A", dayjs_min_default()(item == null ? void 0 : item.start_time).format("YYYY-MM-DD HH:mm:ss"), "\u81F3", dayjs_min_default()(item == null ? void 0 : item.end_time).format("YYYY-MM-DD HH:mm:ss"), /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { style: { marginLeft: "20px" }, disabled: dayjs_min_default()(item == null ? void 0 : item.start_time).unix() > dayjs_min_default()(dayjs_min_default()().format("YYYY-MM-DD HH:mm:s")).unix() || dayjs_min_default()(dayjs_min_default()().format("YYYY-MM-DD HH:mm:s")).unix() > dayjs_min_default()(item == null ? void 0 : item.end_time).unix(), onClick: () => {
|
|
|
dispatch({
|
|
|
type: "shixunsDetail/setActionTabs",
|
|
|
payload: {
|
|
|
key: "md-tab",
|
|
|
params: {
|
|
|
value: (items == null ? void 0 : items.id) || (item == null ? void 0 : item.id),
|
|
|
id: HeaderDetail == null ? void 0 : HeaderDetail.id
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
} }, "\u63D0\u4EA4\u7ED3\u679C")), onChange: (e) => {
|
|
|
var _a2, _b2, _c2, _d2, _e2;
|
|
|
setIsupdate(false);
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
let datas = (_b2 = data == null ? void 0 : data.children) == null ? void 0 : _b2[0];
|
|
|
setItems(datas);
|
|
|
setItem(data);
|
|
|
setDefaultValue(((_e2 = (_d2 = (_c2 = ChartRules.rule_contents) == null ? void 0 : _c2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(data == null ? void 0 : data.id))) == null ? void 0 : _d2[0]) == null ? void 0 : _e2["content"]) || "");
|
|
|
getCharts((datas == null ? void 0 : datas.id) || e);
|
|
|
} }, ChartRules && ChartRules.stages.map((item2, index) => {
|
|
|
return /* @__PURE__ */ React.createElement(SubmitResult_TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id }, isUpdate === false && ChartRules && ChartRules.rule_contents.map((items2, keys) => {
|
|
|
if (item2.id === items2.competition_stage_id) {
|
|
|
return /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { key: keys, value: items2.content === void 0 || items2.content === null ? "" : items2.content });
|
|
|
} else if (item2.id === null && items2.competition_stage_id === 0) {
|
|
|
return /* @__PURE__ */ React.createElement(RenderHtml/* default */.Z, { key: keys, value: items2.content === void 0 || items2.content === null ? "" : items2.content });
|
|
|
}
|
|
|
}));
|
|
|
})), ((_c = item == null ? void 0 : item.children) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ React.createElement(tabs["default"], { activeKey: (items == null ? void 0 : items.id) + "", onChange: (e) => {
|
|
|
var _a2;
|
|
|
let data = (_a2 = item == null ? void 0 : item.children) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
setItems(data);
|
|
|
getCharts(e);
|
|
|
} }, (_d = item == null ? void 0 : item.children) == null ? void 0 : _d.map((item2, index) => {
|
|
|
return /* @__PURE__ */ React.createElement(SubmitResult_TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id });
|
|
|
})), isUpdate && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(markdown_editor/* default */.Z, { defaultValue, onChange: (e) => {
|
|
|
setDefaultValue(e);
|
|
|
} }), /* @__PURE__ */ React.createElement("p", { style: { marginTop: "10px" } }, /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { style: { width: "90px" }, type: "primary", onClick: () => updateitem() }, "\u63D0\u4EA4"), /* @__PURE__ */ React.createElement(es_button/* default */.ZP, { style: { marginLeft: "30px", width: "90px" }, onClick: () => setIsupdate(false) }, "\u53D6\u6D88"))), ((_f = (_e = HeaderDetail.competition_modules.filter((item2) => item2.id === Selectkey)) == null ? void 0 : _e[0]) == null ? void 0 : _f.show_leaderboard) && /* @__PURE__ */ React.createElement(
|
|
|
table["default"],
|
|
|
{
|
|
|
dataSource: ItemData == null ? void 0 : ItemData.results,
|
|
|
columns
|
|
|
}
|
|
|
));
|
|
|
}
|
|
|
/* harmony default export */ var SubmitResult = (SubmitResult_Ranking);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(53864);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/MakeItem.tsx
|
|
|
var MakeItem_defProp = Object.defineProperty;
|
|
|
var __defProps = Object.defineProperties;
|
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
var MakeItem_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var MakeItem_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var MakeItem_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var MakeItem_defNormalProp = (obj, key, value) => key in obj ? MakeItem_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
|
var MakeItem_spreadValues = (a, b) => {
|
|
|
for (var prop in b || (b = {}))
|
|
|
if (MakeItem_hasOwnProp.call(b, prop))
|
|
|
MakeItem_defNormalProp(a, prop, b[prop]);
|
|
|
if (MakeItem_getOwnPropSymbols)
|
|
|
for (var prop of MakeItem_getOwnPropSymbols(b)) {
|
|
|
if (MakeItem_propIsEnum.call(b, prop))
|
|
|
MakeItem_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
var MakeItem_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 { TabPane: MakeItem_TabPane } = tabs["default"];
|
|
|
|
|
|
|
|
|
|
|
|
function MakeItem_Ranking({ loading, ChartRules, ItemData, getCharts, Selectkey, HeaderDetail, getChartRules, userinfo, Editable, dispatch, StaffDetail }) {
|
|
|
var _a, _b, _c, _d, _e, _f;
|
|
|
const [isUpdate, setIsupdate] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [defaultValue, setDefaultValue] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [ClickButton, setClickButton] = (0,_react_17_0_2_react.useState)(true);
|
|
|
const [item, setItem] = (0,_react_17_0_2_react.useState)();
|
|
|
const [items, setItems] = (0,_react_17_0_2_react.useState)();
|
|
|
const { identifier } = (0,_umi_production_exports.useParams)();
|
|
|
let [params, setparams] = (0,_react_17_0_2_react.useState)({
|
|
|
page: 1,
|
|
|
limit: 10,
|
|
|
sort: "desc"
|
|
|
});
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a2;
|
|
|
if (ClickButton && ((_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2[0])) {
|
|
|
getDate();
|
|
|
}
|
|
|
}, [(_a = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a[0]]);
|
|
|
const getDate = () => MakeItem_async(this, null, function* () {
|
|
|
var _a2, _b2, _c2, _d2;
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2[0];
|
|
|
setItem(data);
|
|
|
let datas = (_d2 = (_c2 = (_b2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.children) == null ? void 0 : _d2[0];
|
|
|
setItems(datas);
|
|
|
params.id = (datas == null ? void 0 : datas.id) || (data == null ? void 0 : data.id), setparams(MakeItem_spreadValues({}, params));
|
|
|
yield getCharts(
|
|
|
__spreadProps(MakeItem_spreadValues({}, params), {
|
|
|
stage_id: params.id
|
|
|
})
|
|
|
);
|
|
|
});
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ((_b = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _b.length) > 0 ? null : /* @__PURE__ */ _react_17_0_2_react.createElement(RankingNuLL, null), ((_c = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { tabBarStyle: { height: 65, marginLeft: 35, marginRight: 30 }, animated: true, onChange: (e) => MakeItem_async(this, null, function* () {
|
|
|
var _a2, _b2, _c2, _d2, _e2;
|
|
|
setIsupdate(false);
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
let datas = (_b2 = data == null ? void 0 : data.children) == null ? void 0 : _b2[0];
|
|
|
setItems(datas);
|
|
|
setItem(data);
|
|
|
setDefaultValue(((_e2 = (_d2 = (_c2 = ChartRules.rule_contents) == null ? void 0 : _c2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(data == null ? void 0 : data.id))) == null ? void 0 : _d2[0]) == null ? void 0 : _e2["content"]) || "");
|
|
|
params.page = 1, params.limit = 10, params.id = (datas == null ? void 0 : datas.id) || e, setparams(MakeItem_spreadValues({}, params));
|
|
|
yield getCharts(
|
|
|
MakeItem_spreadValues({}, params)
|
|
|
);
|
|
|
}) }, ChartRules && ChartRules.stages.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(MakeItem_TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id });
|
|
|
})), ((_d = item == null ? void 0 : item.children) == null ? void 0 : _d.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { activeKey: (items == null ? void 0 : items.id) + "", onChange: (e) => MakeItem_async(this, null, function* () {
|
|
|
var _a2;
|
|
|
let data = (_a2 = item == null ? void 0 : item.children) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
setItems(data);
|
|
|
params.page = 1, params.limit = 10, params.id = e, setparams(MakeItem_spreadValues({}, params));
|
|
|
yield getCharts(
|
|
|
MakeItem_spreadValues({}, params)
|
|
|
);
|
|
|
}) }, (_e = item == null ? void 0 : item.children) == null ? void 0 : _e.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(MakeItem_TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id });
|
|
|
})), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: 10, background: "#F5F5F5" } }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { padding: "20px 30px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { cursor: "pointer", marginRight: 20 }, onClick: () => {
|
|
|
params.page = 1, params.sort = params.sort === "desc" ? "asc" : "desc";
|
|
|
setparams(MakeItem_spreadValues({}, params));
|
|
|
getCharts(
|
|
|
MakeItem_spreadValues({}, params)
|
|
|
);
|
|
|
} }, "\u6309\u63D0\u4EA4\u65F6\u95F4", params.sort === "asc" ? "\u6B63" : "\u5012", "\u5E8F\u6392\u5E8F ", /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
"i",
|
|
|
{
|
|
|
className: `iconfont font14 ${params.sort === "asc" ? "icon-jiantou9" : "icon-changyongtubiao-xianxingdaochu-zhuanqu-"}`
|
|
|
}
|
|
|
)), " ", /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"].Search, { onSearch: (e) => {
|
|
|
params.page = 1, params.search = e, setparams(MakeItem_spreadValues({}, params));
|
|
|
getCharts(
|
|
|
MakeItem_spreadValues({}, params)
|
|
|
);
|
|
|
}, style: { width: "82%" }, placeholder: "\u8F93\u5165\u4EBA\u5458/\u6218\u961F\u540D\u79F0\u8FDB\u884C\u641C\u7D22" }), /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading }, (_f = ItemData == null ? void 0 : ItemData.results) == null ? void 0 : _f.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { border: "1px solid #E3EFFC", height: 100, borderRadius: "2px 2px 0px 0px", marginTop: index === 0 ? 14 : 30 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: 60, padding: 10, display: "flex", alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.IMG_SERVER + "/images/" + (item2 == null ? void 0 : item2.image_url), style: { width: 40, height: 40, borderRadius: "50%" } }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginLeft: 10 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333333", fontWeight: 500, fontSize: "16px" } }, item2 == null ? void 0 : item2.user_name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#999999", fontWeight: 400, fontSize: "14px", marginLeft: 60 } }, "\u6240\u5C5E\u6218\u961F", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: 10, color: "#333" } }, (item2 == null ? void 0 : item2.team_name) || "- -")), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333333", fontWeight: 400, fontSize: "14px", marginLeft: 40 } }, "\u5B66\u6821 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: 10, color: "#333" } }, (item2 == null ? void 0 : item2.school_name) || "- -")))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { background: "#EEF2F8", height: 40, borderRadius: "0px 0px 2px 2px", paddingLeft: 60, paddingRight: 40, display: "flex", alignItems: "center", justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#666666", fontSize: "12px" } }, "\u63D0\u4EA4\u65F6\u95F4\uFF1A", item2 == null ? void 0 : item2.created_at), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#666666", fontSize: "12px", margin: "0px 40px" } }, "\u6D88\u8017\u5185\u5B58\uFF1A", (item2 == null ? void 0 : item2.ts_mem) || "- -", "MB"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#666666", fontSize: "12px" } }, "\u4EE3\u7801\u6267\u884C\u65F6\u95F4\uFF1A", (item2 == null ? void 0 : item2.ts_time) || "- -", "\u79D2")), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { style: { display: "flex", alignItems: "center" }, href: `/tasks/${item2 == null ? void 0 : item2.game_identifier}`, target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-chakandaima", style: { marginRight: 4 } }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { lineHeight: "14px" } }, "\u67E5\u770B\u4EE3\u7801"))));
|
|
|
})), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
pagination/* default */.Z,
|
|
|
{
|
|
|
total: ItemData == null ? void 0 : ItemData.total_count,
|
|
|
pageSize: 10,
|
|
|
hideOnSinglePage: true,
|
|
|
style: { marginTop: 40, textAlign: "center" },
|
|
|
showSizeChanger: false,
|
|
|
current: params.page,
|
|
|
onChange: (page, pageSize) => {
|
|
|
params.page = page, setparams(MakeItem_spreadValues({}, params));
|
|
|
getCharts(
|
|
|
MakeItem_spreadValues({}, params)
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
)));
|
|
|
}
|
|
|
/* harmony default export */ var MakeItem = (MakeItem_Ranking);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/Competitions/Detail/Challitems.tsx + 1 modules
|
|
|
var Challitems = __webpack_require__(59098);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/Entrance.tsx
|
|
|
var Entrance_defProp = Object.defineProperty;
|
|
|
var Entrance_defProps = Object.defineProperties;
|
|
|
var Entrance_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
var Entrance_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var Entrance_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var Entrance_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var Entrance_defNormalProp = (obj, key, value) => key in obj ? Entrance_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
|
var Entrance_spreadValues = (a, b) => {
|
|
|
for (var prop in b || (b = {}))
|
|
|
if (Entrance_hasOwnProp.call(b, prop))
|
|
|
Entrance_defNormalProp(a, prop, b[prop]);
|
|
|
if (Entrance_getOwnPropSymbols)
|
|
|
for (var prop of Entrance_getOwnPropSymbols(b)) {
|
|
|
if (Entrance_propIsEnum.call(b, prop))
|
|
|
Entrance_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
var Entrance_spreadProps = (a, b) => Entrance_defProps(a, Entrance_getOwnPropDescs(b));
|
|
|
var Entrance_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 { TabPane: Entrance_TabPane } = tabs["default"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Entrance_Ranking({ loading, ChartRules, ItemData, getCharts, Selectkey, HeaderDetail, getChartRules, userinfo, Editable, dispatch, StaffDetail }) {
|
|
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
|
const [isUpdate, setIsupdate] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [defaultValue, setDefaultValue] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [ClickButton, setClickButton] = (0,_react_17_0_2_react.useState)(true);
|
|
|
const [item, setItem] = (0,_react_17_0_2_react.useState)();
|
|
|
const [items, setItems] = (0,_react_17_0_2_react.useState)();
|
|
|
const [NewItems, setnewItems] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const { identifier } = (0,_umi_production_exports.useParams)();
|
|
|
let [params, setparams] = (0,_react_17_0_2_react.useState)({
|
|
|
page: 1,
|
|
|
limit: 10
|
|
|
});
|
|
|
let [openitem, setopenitem] = (0,_react_17_0_2_react.useState)();
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a2;
|
|
|
if (ClickButton && ((_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2[0])) {
|
|
|
getDate();
|
|
|
}
|
|
|
}, [(_a = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a[0]]);
|
|
|
const getDate = () => Entrance_async(this, null, function* () {
|
|
|
var _a2, _b2, _c2, _d2;
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2[0];
|
|
|
setItem(data);
|
|
|
let datas = (_d2 = (_c2 = (_b2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.children) == null ? void 0 : _d2[0];
|
|
|
setItems(datas);
|
|
|
params.id = (datas == null ? void 0 : datas.id) || (data == null ? void 0 : data.id), setparams(Entrance_spreadValues({}, params));
|
|
|
yield getCharts(
|
|
|
Entrance_spreadProps(Entrance_spreadValues({}, params), {
|
|
|
stage_id: params.id
|
|
|
})
|
|
|
);
|
|
|
});
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
if (HeaderDetail == null ? void 0 : HeaderDetail.is_new) {
|
|
|
getshixun();
|
|
|
}
|
|
|
}, [HeaderDetail]);
|
|
|
function getshixun() {
|
|
|
return Entrance_async(this, null, function* () {
|
|
|
let res = yield (0,utils_fetch/* default */.ZP)(`/api/competitions/${identifier}/get_shixun_settings.json`, {
|
|
|
method: "get"
|
|
|
});
|
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
|
setnewItems(res);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ((_b = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _b.length) > 0 ? null : /* @__PURE__ */ _react_17_0_2_react.createElement(RankingNuLL, null), ((_c = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { tabBarStyle: { height: 65, marginLeft: 35, marginRight: 30 }, animated: true, onChange: (e) => Entrance_async(this, null, function* () {
|
|
|
var _a2, _b2, _c2, _d2, _e2;
|
|
|
setIsupdate(false);
|
|
|
let data = (_a2 = ChartRules == null ? void 0 : ChartRules.stages) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
let datas = (_b2 = data == null ? void 0 : data.children) == null ? void 0 : _b2[0];
|
|
|
setItems(datas);
|
|
|
setItem(data);
|
|
|
setDefaultValue(((_e2 = (_d2 = (_c2 = ChartRules.rule_contents) == null ? void 0 : _c2.filter((item2) => parseInt(item2.competition_stage_id) === parseInt(data == null ? void 0 : data.id))) == null ? void 0 : _d2[0]) == null ? void 0 : _e2["content"]) || "");
|
|
|
params.page = 1, params.limit = 10, params.id = (datas == null ? void 0 : datas.id) || e, setparams(Entrance_spreadValues({}, params));
|
|
|
yield getCharts(
|
|
|
Entrance_spreadValues({}, params)
|
|
|
);
|
|
|
}) }, ChartRules && ChartRules.stages.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(Entrance_TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id });
|
|
|
})), ((_d = item == null ? void 0 : item.children) == null ? void 0 : _d.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { activeKey: (items == null ? void 0 : items.id) + "", tabBarStyle: { height: 65, marginLeft: 35, marginRight: 30 }, onChange: (e) => Entrance_async(this, null, function* () {
|
|
|
var _a2;
|
|
|
let data = (_a2 = item == null ? void 0 : item.children) == null ? void 0 : _a2.filter((item2) => parseInt(e) === parseInt(item2 == null ? void 0 : item2.id))[0];
|
|
|
setItems(data);
|
|
|
params.page = 1, params.limit = 10, params.id = e, setparams(Entrance_spreadValues({}, params));
|
|
|
yield getCharts(
|
|
|
Entrance_spreadValues({}, params)
|
|
|
);
|
|
|
}) }, (_e = item == null ? void 0 : item.children) == null ? void 0 : _e.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(Entrance_TabPane, { tab: item2.name, key: item2.id === null ? 0 : item2.id });
|
|
|
})), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: 10, background: "#F5F5F5" } }), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { padding: "20px 30px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9096A3" } }, "\u4F5C\u54C1\u63D0\u4EA4\u65F6\u95F4", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333333", marginLeft: 5 } }, ItemData == null ? void 0 : ItemData.start_time, "~", ItemData == null ? void 0 : ItemData.end_time)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9096A3" } }, "\u6210\u7EE9\u6765\u6E90", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333333", marginLeft: 5 } }, (ItemData == null ? void 0 : ItemData.score_source) === 0 ? "\u7ECF\u9A8C\u503C" : "\u9884\u6D4B\u51C6\u786E\u7387"), " ")), /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading }, !(HeaderDetail == null ? void 0 : HeaderDetail.is_new) && ((_f = ItemData == null ? void 0 : ItemData.results) == null ? void 0 : _f.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(Challitems/* default */.Z, { dispatch, Header: HeaderDetail, StaffDetail, item: item2, index });
|
|
|
})), (HeaderDetail == null ? void 0 : HeaderDetail.is_new) && ((_g = NewItems == null ? void 0 : NewItems.data) == null ? void 0 : _g.map((item2, index) => {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(Challitems/* default */.Z, { dispatch, Header: HeaderDetail, StaffDetail, item: item2, index });
|
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
pagination/* default */.Z,
|
|
|
{
|
|
|
total: ItemData == null ? void 0 : ItemData.total_count,
|
|
|
pageSize: 10,
|
|
|
hideOnSinglePage: true,
|
|
|
style: { marginTop: 40, textAlign: "center" },
|
|
|
showSizeChanger: false,
|
|
|
current: params.page,
|
|
|
onChange: (page, pageSize) => {
|
|
|
params.page = page, setparams(Entrance_spreadValues({}, params));
|
|
|
getCharts(
|
|
|
Entrance_spreadValues({}, params)
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
)));
|
|
|
}
|
|
|
/* harmony default export */ var Entrance = (Entrance_Ranking);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/Competitions/Entered/Enteredmodel/JoinModel.tsx
|
|
|
var JoinModel = __webpack_require__(15436);
|
|
|
// EXTERNAL MODULE: ./src/pages/Competitions/Entered/Enteredmodel/Addteams.tsx
|
|
|
var Addteams = __webpack_require__(94836);
|
|
|
// EXTERNAL MODULE: ./src/pages/Competitions/components/PhoneModal.tsx
|
|
|
var PhoneModal = __webpack_require__(21417);
|
|
|
// 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/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/UploadOutlined.js + 1 modules
|
|
|
var UploadOutlined = __webpack_require__(81407);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/components/WorkSubmit/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var WorkSubmitmodules = ({"WorkSubmitDesc":"WorkSubmitDesc___zk_Kc","WorkSubmit":"WorkSubmit___BOuVl","span":"span___sGFYr","search":"search___wZWVl","downBut":"downBut___tfNYQ"});
|
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
|
var NoData = __webpack_require__(87526);
|
|
|
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
|
|
|
var AsyncButton = __webpack_require__(16800);
|
|
|
// EXTERNAL MODULE: ./node_modules/_jszip@3.10.1@jszip/dist/jszip.min.js
|
|
|
var jszip_min = __webpack_require__(86129);
|
|
|
var jszip_min_default = /*#__PURE__*/__webpack_require__.n(jszip_min);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/components/WorkSubmit/index.tsx
|
|
|
var WorkSubmit_defProp = Object.defineProperty;
|
|
|
var WorkSubmit_defProps = Object.defineProperties;
|
|
|
var WorkSubmit_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
var WorkSubmit_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var WorkSubmit_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var WorkSubmit_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var WorkSubmit_defNormalProp = (obj, key, value) => key in obj ? WorkSubmit_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
|
var WorkSubmit_spreadValues = (a, b) => {
|
|
|
for (var prop in b || (b = {}))
|
|
|
if (WorkSubmit_hasOwnProp.call(b, prop))
|
|
|
WorkSubmit_defNormalProp(a, prop, b[prop]);
|
|
|
if (WorkSubmit_getOwnPropSymbols)
|
|
|
for (var prop of WorkSubmit_getOwnPropSymbols(b)) {
|
|
|
if (WorkSubmit_propIsEnum.call(b, prop))
|
|
|
WorkSubmit_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
var WorkSubmit_spreadProps = (a, b) => WorkSubmit_defProps(a, WorkSubmit_getOwnPropDescs(b));
|
|
|
var WorkSubmit_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 WorkSubmit = ({
|
|
|
dispatch,
|
|
|
userinfo,
|
|
|
Editable,
|
|
|
ItemData,
|
|
|
TabResults,
|
|
|
HeaderDetail,
|
|
|
StaffDetail,
|
|
|
getTabResults = () => {
|
|
|
}
|
|
|
}) => {
|
|
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
|
const [form] = es_form["default"].useForm();
|
|
|
const [formButLoading, setFormButLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isEdit, setIsEdit] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const { identifier } = (0,_umi_production_exports.useParams)();
|
|
|
const [modelType, setModelType] = (0,_react_17_0_2_react.useState)(1);
|
|
|
const [identity, setIdentity] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isSubmitModel, setIsSubmitModel] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [fileList, setFileList] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [tableLoading, setTableLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [teamList, setTeamlist] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [isloading, setisloading] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [rowTable, setRowTable] = (0,_react_17_0_2_react.useState)({
|
|
|
name: "",
|
|
|
url: "",
|
|
|
id: null,
|
|
|
fileList: [],
|
|
|
competition_team_id: ""
|
|
|
});
|
|
|
const [tableList, setTableList] = (0,_react_17_0_2_react.useState)({
|
|
|
total_count: 0,
|
|
|
results: []
|
|
|
});
|
|
|
const [gameItem, setGameItem] = (0,_react_17_0_2_react.useState)(null);
|
|
|
const [urlData, setUrlData] = (0,_react_17_0_2_react.useState)({
|
|
|
page: 1,
|
|
|
per_page: 20,
|
|
|
keyword: ""
|
|
|
});
|
|
|
const [mdContent, setMdContent] = (0,_react_17_0_2_react.useState)("");
|
|
|
const [zipAll, setZipAll] = (0,_react_17_0_2_react.useState)(new (jszip_min_default())());
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
setIdentity((userinfo == null ? void 0 : userinfo.admin) || (userinfo == null ? void 0 : userinfo.business) || Editable);
|
|
|
}, [userinfo == null ? void 0 : userinfo.admin, userinfo == null ? void 0 : userinfo.business, Editable]);
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
if (ItemData == null ? void 0 : ItemData.only_file)
|
|
|
setModelType(2);
|
|
|
}, [ItemData]);
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h;
|
|
|
if (TabResults.stages && ((_a2 = TabResults.stages) == null ? void 0 : _a2.length) > 0) {
|
|
|
((_d2 = (_c2 = (_b2 = TabResults.stages) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.children) == null ? void 0 : _d2.length) > 0 ? setGameItem(((_g2 = (_f2 = (_e2 = TabResults.stages) == null ? void 0 : _e2[0]) == null ? void 0 : _f2.children) == null ? void 0 : _g2[0]) || null) : setGameItem(((_h = TabResults.stages) == null ? void 0 : _h[0]) || null);
|
|
|
}
|
|
|
}, [TabResults.stages]);
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
getResults();
|
|
|
getTeam();
|
|
|
}, [gameItem == null ? void 0 : gameItem.id, urlData.page]);
|
|
|
function getTeamList() {
|
|
|
return WorkSubmit_async(this, null, function* () {
|
|
|
var _a2, _b2;
|
|
|
setisloading(true);
|
|
|
let res = yield (0,utils_fetch/* default */.ZP)(`/api/competitions/${identifier}/my_teams`, {
|
|
|
method: "get"
|
|
|
});
|
|
|
setisloading(false);
|
|
|
setIsSubmitModel(true);
|
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
|
setTeamlist(res == null ? void 0 : res.data);
|
|
|
form.setFieldsValue({
|
|
|
name: "",
|
|
|
url: "",
|
|
|
id: "",
|
|
|
competition_team_id: (_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.id
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function getTeam() {
|
|
|
return WorkSubmit_async(this, null, function* () {
|
|
|
let res = yield (0,utils_fetch/* default */.ZP)(`/api/competitions/${identifier}/my_teams`, {
|
|
|
method: "get"
|
|
|
});
|
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
|
setTeamlist(res == null ? void 0 : res.data);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
const columns = [
|
|
|
{
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u961F\u4F0D\u540D\u79F0"),
|
|
|
dataIndex: "team_name",
|
|
|
width: "120px",
|
|
|
ellipsis: true,
|
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, text || "- -"),
|
|
|
isShow: [1, 2]
|
|
|
},
|
|
|
{
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u63D0\u4EA4\u4EBA"),
|
|
|
dataIndex: "user_name",
|
|
|
width: "120px",
|
|
|
ellipsis: true,
|
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, text || "- -"),
|
|
|
isShow: [1, 2]
|
|
|
},
|
|
|
{
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u4F5C\u54C1\u540D\u79F0"),
|
|
|
dataIndex: "name",
|
|
|
ellipsis: true,
|
|
|
render: (text, record) => text ? /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: record.url || "#", target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, text)) : "--",
|
|
|
isShow: [1]
|
|
|
},
|
|
|
{
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u4F5C\u54C1\u6587\u4EF6"),
|
|
|
dataIndex: "file_name",
|
|
|
width: modelType == 1 ? "180px" : "",
|
|
|
ellipsis: true,
|
|
|
render: (text) => /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "topLeft", title: text }, text || "- -"),
|
|
|
isShow: [1, 2]
|
|
|
},
|
|
|
{
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u66F4\u65B0\u65F6\u95F4"),
|
|
|
dataIndex: "updated_at",
|
|
|
width: "180px",
|
|
|
render: (text) => text || "- -",
|
|
|
isShow: [1, 2]
|
|
|
},
|
|
|
{
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u64CD\u4F5C"),
|
|
|
dataIndex: "result_url",
|
|
|
ellipsis: true,
|
|
|
width: "200px",
|
|
|
align: "center",
|
|
|
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: identity ? "center" : "space-between" }, !identity && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "link", onClick: () => {
|
|
|
setIsSubmitModel(true);
|
|
|
setRowTable({
|
|
|
name: record.name,
|
|
|
url: record.url,
|
|
|
id: record.id,
|
|
|
competition_team_id: record.competition_team_id
|
|
|
});
|
|
|
form.setFieldsValue({
|
|
|
name: record.name,
|
|
|
url: record.url,
|
|
|
id: record.id,
|
|
|
competition_team_id: record.competition_team_id
|
|
|
});
|
|
|
if (record.file_name) {
|
|
|
setFileList([{
|
|
|
uid: "-1",
|
|
|
// TODO : 这里目前无法获取到id或者唯一标识,暂时只能用-1
|
|
|
name: record.file_name,
|
|
|
status: "done",
|
|
|
url: record.result_url || ""
|
|
|
}]);
|
|
|
}
|
|
|
} }, "\u7F16\u8F91"), /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { type: "link", disabled: !text, onClick: () => WorkSubmit_async(void 0, null, function* () {
|
|
|
return (0,util/* downLoadLink */.Nd)(record.file_name, text);
|
|
|
}) }, identity ? "\u4E0B\u8F7D\u6587\u4EF6" : "\u4E0B\u8F7D"), !identity && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "link", onClick: () => WorkSubmit_async(void 0, null, function* () {
|
|
|
es_modal["default"].confirm({
|
|
|
title: "\u63D0\u793A",
|
|
|
content: "\u63D0\u4EA4\u4F5C\u54C1\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D\uFF0C\u786E\u8BA4\u5220\u9664\u8BE5\u4F5C\u54C1",
|
|
|
onOk: () => WorkSubmit_async(void 0, null, function* () {
|
|
|
let res = yield (0,utils_fetch/* default */.ZP)(`/api/competitions/${identifier}/delete_result.json`, {
|
|
|
method: "Delete",
|
|
|
body: {
|
|
|
result_id: record == null ? void 0 : record.id
|
|
|
}
|
|
|
});
|
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info("\u5220\u9664\u6210\u529F");
|
|
|
getResults();
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
}) }, "\u5220\u9664")),
|
|
|
isShow: [1, 2]
|
|
|
}
|
|
|
].filter((item) => item.isShow.includes(modelType));
|
|
|
const getResults = () => WorkSubmit_async(void 0, null, function* () {
|
|
|
setTableLoading(true);
|
|
|
const data = yield dispatch({
|
|
|
type: "competitions/Results",
|
|
|
payload: WorkSubmit_spreadValues({
|
|
|
identifier,
|
|
|
stage_id: gameItem == null ? void 0 : gameItem.id,
|
|
|
module_type: "worksubmit"
|
|
|
}, urlData)
|
|
|
});
|
|
|
setTableList(data);
|
|
|
setTableLoading(false);
|
|
|
});
|
|
|
const getUpMDContent = (data) => WorkSubmit_async(void 0, null, function* () {
|
|
|
const res = yield dispatch({
|
|
|
type: "competitions/updateMdContent",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
stage_id: gameItem == null ? void 0 : gameItem.id,
|
|
|
competition_module_id: ItemData.id,
|
|
|
content: mdContent,
|
|
|
md_content_id: data == null ? void 0 : data.id
|
|
|
}
|
|
|
});
|
|
|
res.status == 0 && message/* default */.ZP.success(res.message);
|
|
|
setIsEdit(false);
|
|
|
yield getTabResults();
|
|
|
});
|
|
|
const handleFormFinish = (values) => WorkSubmit_async(void 0, null, function* () {
|
|
|
var _a2;
|
|
|
setFormButLoading(true);
|
|
|
let res;
|
|
|
if (modelType == 2 && fileList.length == 0) {
|
|
|
message/* default */.ZP.error("\u8BF7\u9009\u62E9\u6587\u4EF6");
|
|
|
return;
|
|
|
}
|
|
|
const Data = {
|
|
|
login: userinfo == null ? void 0 : userinfo.login,
|
|
|
container_type: "Competition",
|
|
|
file_name: (_a2 = fileList == null ? void 0 : fileList[0]) == null ? void 0 : _a2.name,
|
|
|
stage_type: gameItem == null ? void 0 : gameItem.id,
|
|
|
container_id: HeaderDetail == null ? void 0 : HeaderDetail.id,
|
|
|
result_id: rowTable == null ? void 0 : rowTable.id,
|
|
|
module_type: "worksubmit",
|
|
|
competition_team_id: values.competition_team_id
|
|
|
};
|
|
|
if (modelType == 1) {
|
|
|
const res2 = yield (0,utils_fetch/* default */.ZP)(
|
|
|
`/api/competitions/${identifier}/check_result_url.json`,
|
|
|
{
|
|
|
method: "GET",
|
|
|
params: {
|
|
|
url: values.url,
|
|
|
stage_id: gameItem == null ? void 0 : gameItem.id,
|
|
|
result_id: rowTable == null ? void 0 : rowTable.id,
|
|
|
competition_team_id: values.competition_team_id
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
setFormButLoading(false);
|
|
|
if ((res2 == null ? void 0 : res2.status) != 0)
|
|
|
return;
|
|
|
Data["name"] = values.name;
|
|
|
Data["url"] = values.url;
|
|
|
}
|
|
|
if (modelType == 1 && fileList.length == 0) {
|
|
|
res = yield dispatch({
|
|
|
type: "competitions/getWorkSubmitUpdateRes",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
result_id: rowTable == null ? void 0 : rowTable.id,
|
|
|
name: values.name,
|
|
|
url: values.url,
|
|
|
stage_id: gameItem == null ? void 0 : gameItem.id,
|
|
|
result_url: rowTable == null ? void 0 : rowTable.result_url,
|
|
|
module_type: "worksubmit",
|
|
|
competition_team_id: values.competition_team_id
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
res = yield (0,UploadFile/* uploadFile */.cT)(fileList[0], Data);
|
|
|
}
|
|
|
if ((res == null ? void 0 : res.status) == 0) {
|
|
|
message/* default */.ZP.success("\u63D0\u4EA4\u6210\u529F");
|
|
|
} else {
|
|
|
message/* default */.ZP.info((res == null ? void 0 : res.message) || "\u63D0\u4EA4\u5931\u8D25");
|
|
|
}
|
|
|
setFormButLoading(false);
|
|
|
setIsSubmitModel(false);
|
|
|
setFileList([]);
|
|
|
getResults();
|
|
|
});
|
|
|
const handleAllDownload = () => WorkSubmit_async(void 0, null, function* () {
|
|
|
var _a2;
|
|
|
const res = yield dispatch({
|
|
|
type: "competitions/Results",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
stage_id: gameItem == null ? void 0 : gameItem.id,
|
|
|
page: 1,
|
|
|
per_page: 9999999,
|
|
|
// TODO :查询所有列表数据
|
|
|
keyword: "",
|
|
|
module_type: "worksubmit"
|
|
|
}
|
|
|
});
|
|
|
const DownloadList = (_a2 = res == null ? void 0 : res.results) == null ? void 0 : _a2.filter((item) => (item == null ? void 0 : item.result_url) && item.file_name);
|
|
|
const modal = es_modal["default"].info({
|
|
|
width: 460,
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u6B63\u5728\u5BFC\u51FA\u53C2\u8D5B\u6587\u4EF6,", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3")),
|
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5F53\u524D\u8FDB\u5EA6: ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, 0), "/", DownloadList.length),
|
|
|
maskClosable: false,
|
|
|
className: WorkSubmitmodules.modal,
|
|
|
onOk: () => {
|
|
|
}
|
|
|
});
|
|
|
const nameLsit = [];
|
|
|
const addzip = (data, progress) => WorkSubmit_async(void 0, null, function* () {
|
|
|
try {
|
|
|
const zip = new (jszip_min_default())();
|
|
|
const response = yield fetch(data.result_url, { method: "get" });
|
|
|
const blob = yield response.blob();
|
|
|
zip.file(data.file_name, blob);
|
|
|
yield zip.generateAsync({ type: "blob" }).then((blob2) => {
|
|
|
const getNameFile = (name, index = 0) => {
|
|
|
if (index == 0 && nameLsit.includes(name) || nameLsit.includes(`${name}(${index})`)) {
|
|
|
getNameFile(name, index + 1);
|
|
|
} else {
|
|
|
nameLsit.push(index == 0 ? name : `${name}(${index})`);
|
|
|
zipAll.file(index == 0 ? name + ".zip" : `${name}(${index}).zip`, blob2);
|
|
|
}
|
|
|
};
|
|
|
getNameFile(`${data == null ? void 0 : data.team_name}-${data == null ? void 0 : data.user_name}`);
|
|
|
});
|
|
|
modal.update({
|
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5F53\u524D\u8FDB\u5EA6: ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue" }, progress), "/", DownloadList.length)
|
|
|
});
|
|
|
} catch (error) {
|
|
|
message/* default */.ZP.error(`${data.file_name}\u4E0B\u8F7D\u5931\u8D25`);
|
|
|
}
|
|
|
});
|
|
|
if (DownloadList.length > 0) {
|
|
|
let i = 0;
|
|
|
for (let item of DownloadList) {
|
|
|
yield addzip(item, ++i);
|
|
|
}
|
|
|
zipAll.generateAsync({ type: "blob" }).then((blob) => {
|
|
|
(0,util/* downLoadLink */.Nd)(HeaderDetail.name, window.URL.createObjectURL(blob));
|
|
|
});
|
|
|
}
|
|
|
modal.destroy();
|
|
|
});
|
|
|
const uploadProps = {
|
|
|
maxCount: 1,
|
|
|
withCredentials: true,
|
|
|
fileList,
|
|
|
onRemove: () => {
|
|
|
setFileList([]);
|
|
|
},
|
|
|
beforeUpload: (file) => {
|
|
|
const fileSize = file.size / 1024 / 1024;
|
|
|
const fileType = file.name.split(".").slice(-1)[0].toLowerCase();
|
|
|
if (modelType == 1 && fileSize > 150 || modelType == 2 && fileSize / 1024 > 1 || fileSize == 0) {
|
|
|
message/* default */.ZP.error(`${file.name} \u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002${fileSize == 0 ? "\u6587\u4EF6\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A" : `\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(${modelType == 1 ? "150MB" : "1G"})`}`);
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
setFileList([file]);
|
|
|
return false;
|
|
|
}
|
|
|
};
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: WorkSubmitmodules.WorkSubmit }, gameItem ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
tabs["default"],
|
|
|
{
|
|
|
defaultActiveKey: ((_b = (_a = TabResults.stages) == null ? void 0 : _a[0]) == null ? void 0 : _b.id) || 1,
|
|
|
destroyInactiveTabPane: true,
|
|
|
tabBarExtraContent: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { style: { marginBottom: "10px" } }, !identity && StaffDetail.enrolled && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", onClick: () => setIsSubmitModel(true) }, "\u4F5C\u54C1\u63D0\u4EA4"), identity && !isEdit && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: "10px" }, type: "primary", onClick: () => setIsEdit(true) }, "\u7F16\u8F91")),
|
|
|
onChange: (activeKey) => {
|
|
|
const item = TabResults.stages.find((item2) => item2.id == activeKey);
|
|
|
item.children.length > 0 ? setGameItem(item.children[0]) : setGameItem(item);
|
|
|
}
|
|
|
},
|
|
|
(_c = TabResults.stages) == null ? void 0 : _c.map((item, index) => {
|
|
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"].TabPane, { tab: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginBottom: "20px" } }, item.name), key: item.id }, isEdit ? /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(markdown_editor/* default */.Z, { defaultValue: ((_a2 = TabResults.rule_contents[index]) == null ? void 0 : _a2.content) || "", onChange: (e) => setMdContent(e) }), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { type: "primary", onClick: () => getUpMDContent(TabResults.rule_contents[index]) }, "\u63D0\u4EA4"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: "10px" }, onClick: () => WorkSubmit_async(void 0, null, function* () {
|
|
|
return setIsEdit(false);
|
|
|
}) }, "\u53D6\u6D88"))) : /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { style: { marginTop: "10px" }, value: ((_b2 = TabResults.rule_contents[index]) == null ? void 0 : _b2.content) || "" }), ((_c2 = item.children) == null ? void 0 : _c2.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { defaultActiveKey: (_e2 = (_d2 = item.children) == null ? void 0 : _d2[0]) == null ? void 0 : _e2.id, destroyInactiveTabPane: true, onChange: (activeKey) => {
|
|
|
var _a3;
|
|
|
setGameItem((_a3 = item.children) == null ? void 0 : _a3.find((item2) => item2.id == activeKey));
|
|
|
} }, (_f2 = item.children) == null ? void 0 : _f2.map((ChildItem) => /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"].TabPane, { tab: ChildItem.name, key: ChildItem.id }))));
|
|
|
})
|
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (StaffDetail.enrolled || identity) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { style: { marginBottom: "10px", paddingBottom: "10px", borderBottom: "1px solid #eee" } }, !identity && StaffDetail.enrolled && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: "auto" }, loading: isloading, type: "primary", onClick: () => {
|
|
|
getTeamList();
|
|
|
} }, "\u4F5C\u54C1\u63D0\u4EA4"), identity && !isEdit && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: !identity && StaffDetail.enrolled ? "10px" : "auto" }, type: "primary", onClick: () => setIsEdit(true) }, "\u7F16\u8F91")), isEdit ? /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(markdown_editor/* default */.Z, { defaultValue: ((_e = (_d = TabResults.rule_contents) == null ? void 0 : _d[0]) == null ? void 0 : _e.content) || "", onChange: (e) => setMdContent(e) }), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { type: "primary", onClick: () => {
|
|
|
var _a2;
|
|
|
return getUpMDContent((_a2 = TabResults.rule_contents) == null ? void 0 : _a2[0]);
|
|
|
} }, "\u63D0\u4EA4"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: "10px" }, onClick: () => WorkSubmit_async(void 0, null, function* () {
|
|
|
return setIsEdit(false);
|
|
|
}) }, "\u53D6\u6D88"))) : /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { style: { marginTop: "10px" }, value: ((_g = (_f = TabResults.rule_contents) == null ? void 0 : _f[0]) == null ? void 0 : _g.content) || "" })), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "space-between", style: { marginTop: "21px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
input["default"],
|
|
|
{
|
|
|
className: WorkSubmitmodules.search,
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u961F\u4F0D\u540D\u79F0\u6216\u63D0\u4EA4\u4EBA\u59D3\u540D\u641C\u7D22",
|
|
|
suffix: /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-sousuo9", onClick: getResults, style: { color: "#000", cursor: "pointer", fontSize: "14px" } }),
|
|
|
onChange: (e) => {
|
|
|
urlData.keyword = e.target.value;
|
|
|
urlData.search = e.target.value;
|
|
|
setUrlData(urlData);
|
|
|
},
|
|
|
style: { background: "#F6F7F9" },
|
|
|
bordered: false,
|
|
|
onPressEnter: getResults
|
|
|
}
|
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { color: "#9B9B9B", fontSize: "14px", marginLeft: "20px" } }, "\u5F53\u524D\u5171\u8BA1\u4F5C\u54C1", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF" } }, tableList.total_count), "\u4E2A")), identity && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, modelType == 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_button/* default */.ZP,
|
|
|
{
|
|
|
style: { lineHeight: "32px" },
|
|
|
target: "_blank",
|
|
|
href: `/api/competitions/${identifier}/results.xlsx?identifier=${identifier}&stage_id=${(gameItem == null ? void 0 : gameItem.id) || ""}&module_type=worksubmit`,
|
|
|
icon: /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-lianjie3", style: { fontSize: "16px", color: "#44D7B6" } }),
|
|
|
className: WorkSubmitmodules.downBut
|
|
|
},
|
|
|
"\u4E0B\u8F7D\u4F5C\u54C1\u94FE\u63A5"
|
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { icon: /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-wenjian4", style: { fontSize: "16px", color: "#F6C555" } }), className: WorkSubmitmodules.downBut, style: { marginLeft: "20px" }, onClick: handleAllDownload }, "\u4E0B\u8F7D\u6240\u6709\u6587\u4EF6"))), /* @__PURE__ */ _react_17_0_2_react.createElement(table["default"], { style: { marginTop: "17px" }, loading: tableLoading, columns, dataSource: tableList.results, locale: { emptyText: /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, null) }, pagination: false }), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { style: { marginTop: "20px" }, align: "middle", justify: "space-between" }, ((gameItem == null ? void 0 : gameItem.end_time) && (gameItem == null ? void 0 : gameItem.start_time) || HeaderDetail.start_time && HeaderDetail.end_time) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: WorkSubmitmodules.span }, "\u63D0\u4EA4\u65F6\u95F4\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, dayjs_min_default()((gameItem == null ? void 0 : gameItem.start_time) || HeaderDetail.start_time).format("YYYY-MM-DD HH:mm:ss")), " \u81F3 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, dayjs_min_default()((gameItem == null ? void 0 : gameItem.end_time) || HeaderDetail.end_time).format("YYYY-MM-DD HH:mm:ss"))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
pagination/* default */.Z,
|
|
|
{
|
|
|
showQuickJumper: true,
|
|
|
hideOnSinglePage: true,
|
|
|
current: urlData.page,
|
|
|
pageSize: urlData.per_page,
|
|
|
onChange: (page) => setUrlData(WorkSubmit_spreadProps(WorkSubmit_spreadValues({}, urlData), { page })),
|
|
|
onShowSizeChange: (page, per_page) => setUrlData(WorkSubmit_spreadProps(WorkSubmit_spreadValues({}, urlData), { page: 1, per_page })),
|
|
|
total: tableList.total_count || 0
|
|
|
}
|
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_modal["default"],
|
|
|
{
|
|
|
centered: true,
|
|
|
destroyOnClose: true,
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: {
|
|
|
fontWeight: "500",
|
|
|
color: "#000000",
|
|
|
marginTop: "10px"
|
|
|
} }, "\u4F5C\u54C1\u63D0\u4EA4"),
|
|
|
open: isSubmitModel,
|
|
|
bodyStyle: { padding: " 0px 25px 10px 25px" },
|
|
|
onOk: () => form.submit(),
|
|
|
confirmLoading: formButLoading,
|
|
|
onCancel: () => {
|
|
|
setIsSubmitModel(false);
|
|
|
setFileList([]);
|
|
|
setRowTable(null);
|
|
|
}
|
|
|
},
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: WorkSubmitmodules.WorkSubmitDesc }, "\u8BF4\u660E\uFF1A\u5927\u8D5B\u8FDB\u884C\u4E2D\u4E0A\u4F20\u540E\u7684\u4F5C\u54C1\u5982\u9700\u4FEE\u6539\uFF0C\u53EF\u5728\u3010\u4F5C\u54C1\u63D0\u4EA4\u3011\u5217\u8868\u70B9\u51FB\u201C\u7F16\u8F91\u201D\u8FDB\u884C\u4FEE\u6539\u3002"),
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { form, colon: false, onFinish: handleFormFinish }, modelType == 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u4F5C\u54C1\u540D\u79F0", name: "name", rules: [{ required: true, message: "\u8BF7\u586B\u5199\u4F5C\u54C1\u540D\u79F0" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { showCount: true, maxLength: 60, placeholder: "\u8BF7\u8F93\u5165\u4F5C\u54C1\u540D\u79F0" })), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u4F5C\u54C1\u94FE\u63A5", name: "url", rules: [{ required: true, message: "\u8BF7\u586B\u5199\u4F5C\u54C1\u94FE\u63A5" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { placeholder: "\u8BF7\u8F93\u5165\u4F5C\u54C1\u94FE\u63A5" }))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { label: "\u63D0\u4EA4\u6218\u961F", name: "competition_team_id", rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u6218\u961F" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], null, teamList == null ? void 0 : teamList.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: item == null ? void 0 : item.id, value: item == null ? void 0 : item.id }, item == null ? void 0 : item.name)))), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_form["default"].Item,
|
|
|
{
|
|
|
name: "fileList",
|
|
|
style: { paddingLeft: modelType == 1 ? "76px" : "0" },
|
|
|
valuePropName: "fileList",
|
|
|
getValueFromEvent: (e) => {
|
|
|
if (Array.isArray(e))
|
|
|
return e;
|
|
|
return e == null ? void 0 : e.fileList;
|
|
|
}
|
|
|
},
|
|
|
modelType == 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"], WorkSubmit_spreadValues({}, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", ghost: true, icon: /* @__PURE__ */ _react_17_0_2_react.createElement(UploadOutlined/* default */.Z, null) }, fileList.length > 0 ? "\u66F4\u6362\u6587\u4EF6" : "\u6587\u4EF6\u4E0A\u4F20"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
tooltip/* default */.Z,
|
|
|
{
|
|
|
placement: "right",
|
|
|
overlayStyle: { maxWidth: 600 },
|
|
|
title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: (e) => {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
} }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u63D0\u793A\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "1. \u4E00\u6B21\u6700\u591A\u4E0A\u4F201\u4E2A\u6587\u4EF6\u3002"), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "2. \u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u8BF7\u52FF\u8D85\u8FC7150M\u3002"))
|
|
|
},
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: (e) => {
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
}, className: "iconfont icon-tishixiaowenhao ml5", style: { cursor: "pointer", color: "#C5C5C5" } })
|
|
|
))),
|
|
|
modelType == 2 && /* @__PURE__ */ _react_17_0_2_react.createElement(upload["default"].Dragger, WorkSubmit_spreadValues({ className: WorkSubmitmodules.fileList, style: { background: "#fff", padding: "31px 0px" } }, uploadProps), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-drag-icon" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-shangchuan4", style: { fontSize: "32px", color: "#165DFF" } })), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "ant-upload-text" }, "\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))
|
|
|
))
|
|
|
));
|
|
|
};
|
|
|
/* harmony default export */ var components_WorkSubmit = ((0,_umi_production_exports.connect)(({}) => ({}))(WorkSubmit));
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Detail/index.tsx
|
|
|
var Detail_defProp = Object.defineProperty;
|
|
|
var Detail_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var Detail_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var Detail_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var Detail_defNormalProp = (obj, key, value) => key in obj ? Detail_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
|
var Detail_spreadValues = (a, b) => {
|
|
|
for (var prop in b || (b = {}))
|
|
|
if (Detail_hasOwnProp.call(b, prop))
|
|
|
Detail_defNormalProp(a, prop, b[prop]);
|
|
|
if (Detail_getOwnPropSymbols)
|
|
|
for (var prop of Detail_getOwnPropSymbols(b)) {
|
|
|
if (Detail_propIsEnum.call(b, prop))
|
|
|
Detail_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
var __objRest = (source, exclude) => {
|
|
|
var target = {};
|
|
|
for (var prop in source)
|
|
|
if (Detail_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
|
target[prop] = source[prop];
|
|
|
if (source != null && Detail_getOwnPropSymbols)
|
|
|
for (var prop of Detail_getOwnPropSymbols(source)) {
|
|
|
if (exclude.indexOf(prop) < 0 && Detail_propIsEnum.call(source, prop))
|
|
|
target[prop] = source[prop];
|
|
|
}
|
|
|
return target;
|
|
|
};
|
|
|
var Detail_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 competitionDetails = (_a) => {
|
|
|
var _b = _a, {
|
|
|
globalSetting,
|
|
|
loading,
|
|
|
dispatch,
|
|
|
user
|
|
|
} = _b, props = __objRest(_b, [
|
|
|
"globalSetting",
|
|
|
"loading",
|
|
|
"dispatch",
|
|
|
"user"
|
|
|
]);
|
|
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
|
const [HeaderDetail, setHeaderDetail] = (0,_react_17_0_2_react.useState)({
|
|
|
avatar_url: ""
|
|
|
});
|
|
|
const [StaffDetail, setStaffDetail] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const { identifier } = (0,_umi_production_exports.useParams)();
|
|
|
const [ItemData, setItemData] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [ISsee, setIssee] = (0,_react_17_0_2_react.useState)(true);
|
|
|
const [MenuItem, setMenuItem] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [ModelType, setModelType] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [isRanKing, setIsRanKing] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [ChartRules, setChartRules] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isAward, setIsAward] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [Prize, setPrize] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [Accounts, SetAccounts] = (0,_react_17_0_2_react.useState)([]);
|
|
|
let [Selectkey, setSeleckjey] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [MdTab, setMdTab] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [TabResults, setTabResults] = (0,_react_17_0_2_react.useState)([]);
|
|
|
const [isshowType, setisshowType] = (0,_react_17_0_2_react.useState)();
|
|
|
const [itLoading, setItLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
|
const [showmake, setshowmake] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [entrance, setentrance] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isshowmodal, setisshowmodal] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isAddmodel, setIsAddmodel] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isJoin, setJoin] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isClick, setIsClick] = (0,_react_17_0_2_react.useState)(true);
|
|
|
const [showphone, setshowphone] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [isopen, setisopen] = (0,_react_17_0_2_react.useState)(false);
|
|
|
const [datas, setdatas] = (0,_react_17_0_2_react.useState)("");
|
|
|
const loction = (0,_umi_production_exports.useLocation)();
|
|
|
const see = (0,_react_17_0_2_react.useRef)(null);
|
|
|
const [isWorkSubmit, setIsWorkSubmit] = (0,_react_17_0_2_react.useState)(false);
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
console.log("++++++++++++++++++++++++++++++++++++", identifier);
|
|
|
if (identifier) {
|
|
|
init();
|
|
|
}
|
|
|
(0,util/* setDocumentTitle */.Dk)("\u7ADE\u8D5B");
|
|
|
}, [identifier]);
|
|
|
function init() {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
setStaffDetail(yield dispatch({
|
|
|
type: "competitions/getStaff",
|
|
|
payload: {
|
|
|
identifier
|
|
|
}
|
|
|
}));
|
|
|
const res = yield dispatch({
|
|
|
type: "competitions/getHeader",
|
|
|
payload: {
|
|
|
identifier
|
|
|
}
|
|
|
});
|
|
|
setHeaderDetail(res);
|
|
|
(0,util/* setDocumentTitle */.Dk)((res == null ? void 0 : res.name) || "\u7ADE\u8D5B");
|
|
|
});
|
|
|
}
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a3;
|
|
|
setisshowType(parseInt((_a3 = loction == null ? void 0 : loction.query) == null ? void 0 : _a3.type) === 1);
|
|
|
}, [loction]);
|
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
|
var _a3, _b3, _c2, _d2;
|
|
|
if (((_a3 = HeaderDetail == null ? void 0 : HeaderDetail.competition_modules) == null ? void 0 : _a3.length) > 0) {
|
|
|
if (((_b3 = loction == null ? void 0 : loction.query) == null ? void 0 : _b3.active) === "\u8D5B\u9898\u53D1\u5E03") {
|
|
|
const item = (_c2 = HeaderDetail == null ? void 0 : HeaderDetail.competition_modules) == null ? void 0 : _c2.find((e) => e.name === "\u8D5B\u9898\u53D1\u5E03");
|
|
|
if (item) {
|
|
|
getrightdatas(item);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
getrightdatas((_d2 = HeaderDetail == null ? void 0 : HeaderDetail.competition_modules) == null ? void 0 : _d2[0]);
|
|
|
}
|
|
|
}, [HeaderDetail]);
|
|
|
function getrightdatas(item) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
setSeleckjey(item.id);
|
|
|
Selectkey = item.id;
|
|
|
setMenuItem(item);
|
|
|
let data;
|
|
|
if (item.module_type === "entrance") {
|
|
|
data = yield dispatch({
|
|
|
type: "competitions/getItem",
|
|
|
payload: {
|
|
|
url: item.module_url,
|
|
|
module_type: "entrance"
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
data = yield dispatch({
|
|
|
type: "competitions/getItem",
|
|
|
payload: {
|
|
|
url: item.module_url
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
setIsRanKing(false);
|
|
|
setIsAward(false);
|
|
|
setMdTab(false);
|
|
|
setItemData(data);
|
|
|
setshowmake(false);
|
|
|
setentrance(false);
|
|
|
setIsWorkSubmit(false);
|
|
|
setModelType(item.module_type);
|
|
|
if (item.module_type === "worksubmit") {
|
|
|
setIssee(false);
|
|
|
setIsWorkSubmit(true);
|
|
|
getTabResults();
|
|
|
} else if (item.module_type === "chart") {
|
|
|
setIsRanKing(true);
|
|
|
setIssee(false);
|
|
|
getChartRules();
|
|
|
} else if (item.module_type === "certificate") {
|
|
|
setIsAward(true);
|
|
|
setIsRanKing(false);
|
|
|
setIssee(false);
|
|
|
getPrize();
|
|
|
} else if (item.module_type === "md_tab") {
|
|
|
setMdTab(true);
|
|
|
setIssee(false);
|
|
|
localStorage.setItem("issee", "2");
|
|
|
setIsRanKing(false);
|
|
|
setIsAward(false);
|
|
|
getTabResults();
|
|
|
} else if (item.module_type === "md_shixun") {
|
|
|
setshowmake(true);
|
|
|
setIssee(false);
|
|
|
getTabResults();
|
|
|
} else if (item.module_type === "entrance") {
|
|
|
setentrance(true);
|
|
|
setIssee(false);
|
|
|
getTabResults();
|
|
|
} else {
|
|
|
setIssee(true);
|
|
|
localStorage.setItem("issee", "1");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function gotocourse(e, item, url) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
var _a3;
|
|
|
e.stopPropagation();
|
|
|
if (HeaderDetail.teacher_need_phone || HeaderDetail.member_need_phone) {
|
|
|
setshowphone(true);
|
|
|
return;
|
|
|
}
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
if ((HeaderDetail == null ? void 0 : HeaderDetail.is_authentication) && !((_a3 = user == null ? void 0 : user.userInfo) == null ? void 0 : _a3.authentication)) {
|
|
|
dispatch({
|
|
|
type: "shixunsDetail/setActionTabs",
|
|
|
payload: {
|
|
|
key: "Banner-Auth"
|
|
|
}
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
if (HeaderDetail == null ? void 0 : HeaderDetail.enroll_url) {
|
|
|
(0,util/* openNewWindow */.xg)(HeaderDetail == null ? void 0 : HeaderDetail.enroll_url);
|
|
|
return;
|
|
|
}
|
|
|
if (url === "ismodel") {
|
|
|
if (!item.invite_code) {
|
|
|
message/* default */.ZP.info("\u672C\u7ADE\u8D5B\u53EA\u9762\u5411\u90E8\u5206\u5B66\u6821/\u5355\u4F4D\u5F00\u653E\uFF0C\u4F60\u6682\u65F6\u6CA1\u6709\u53C2\u8D5B\u8D44\u683C");
|
|
|
return;
|
|
|
}
|
|
|
if (item.member_of_course === true) {
|
|
|
(0,util/* openNewWindow */.xg)(`/classrooms/${item.course_id}`);
|
|
|
} else {
|
|
|
if (!item.invite_code) {
|
|
|
message/* default */.ZP.info("\u672C\u7ADE\u8D5B\u53EA\u9762\u5411\u90E8\u5206\u5B66\u6821/\u5355\u4F4D\u5F00\u653E\uFF0C\u4F60\u6682\u65F6\u6CA1\u6709\u53C2\u8D5B\u8D44\u683C");
|
|
|
return;
|
|
|
}
|
|
|
const result = yield dispatch({
|
|
|
type: "competitions/addApplytojoincourse",
|
|
|
payload: {
|
|
|
invite_code: item.invite_code,
|
|
|
student: 1
|
|
|
}
|
|
|
});
|
|
|
if (result.status === 0) {
|
|
|
(0,util/* openNewWindow */.xg)(`/classrooms/${item.course_id}`);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
if (StaffDetail.enrolled === true) {
|
|
|
(0,util/* openNewWindow */.xg)(url);
|
|
|
return;
|
|
|
}
|
|
|
setisshowmodal(true);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function getChartRules() {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
yield setChartRules(
|
|
|
yield dispatch({
|
|
|
type: "competitions/ChartRules",
|
|
|
payload: {
|
|
|
identifier
|
|
|
}
|
|
|
})
|
|
|
);
|
|
|
});
|
|
|
}
|
|
|
function getCharts(id) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/Charts",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
stage_id: id
|
|
|
}
|
|
|
});
|
|
|
setItemData(data);
|
|
|
});
|
|
|
}
|
|
|
function getshixunCharts(params) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
setItLoading(true);
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/Results",
|
|
|
payload: Detail_spreadValues({
|
|
|
identifier,
|
|
|
stage_id: params == null ? void 0 : params.id
|
|
|
}, params)
|
|
|
});
|
|
|
setItemData(data);
|
|
|
setItLoading(false);
|
|
|
});
|
|
|
}
|
|
|
function getEntrance(params) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
setItLoading(true);
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/Results",
|
|
|
payload: Detail_spreadValues({
|
|
|
identifier,
|
|
|
stage_id: params == null ? void 0 : params.id,
|
|
|
module_type: "entrance"
|
|
|
}, params)
|
|
|
});
|
|
|
setItemData(data);
|
|
|
setItLoading(false);
|
|
|
});
|
|
|
}
|
|
|
function getResults(id) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/Results",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
stage_id: id
|
|
|
}
|
|
|
});
|
|
|
if (localStorage.getItem("issee") === "1")
|
|
|
return;
|
|
|
setItemData(data);
|
|
|
});
|
|
|
}
|
|
|
function getTabResults() {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
setTabResults(
|
|
|
yield dispatch({
|
|
|
type: "competitions/TabResults",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
competition_module_id: Selectkey
|
|
|
}
|
|
|
})
|
|
|
);
|
|
|
});
|
|
|
}
|
|
|
function getPrize() {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
var _a3;
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/Prize",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
user_id: (_a3 = user == null ? void 0 : user.userInfo) == null ? void 0 : _a3.user_id
|
|
|
//user_id:39416
|
|
|
}
|
|
|
});
|
|
|
setPrize(data);
|
|
|
});
|
|
|
}
|
|
|
function getAccounts() {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
var _a3;
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/Accounts",
|
|
|
payload: {
|
|
|
id: (_a3 = user == null ? void 0 : user.userInfo) == null ? void 0 : _a3.user_id
|
|
|
//user_id:39416
|
|
|
}
|
|
|
});
|
|
|
SetAccounts(data);
|
|
|
});
|
|
|
}
|
|
|
function addTeams(name) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
if (!isClick) {
|
|
|
return;
|
|
|
}
|
|
|
setIsClick(false);
|
|
|
if (isadd()) {
|
|
|
return;
|
|
|
}
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/AddTeam",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
name
|
|
|
}
|
|
|
});
|
|
|
if (data && data.status === 0) {
|
|
|
setdatas(data);
|
|
|
setisopen(true);
|
|
|
init();
|
|
|
setIsAddmodel(false);
|
|
|
} else {
|
|
|
setIsClick(true);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function isadd() {
|
|
|
var _a3, _b3, _c2, _d2, _e2, _f2;
|
|
|
if ((_a3 = user == null ? void 0 : user.userInfo) == null ? void 0 : _a3.is_teacher) {
|
|
|
if (((_b3 = StaffDetail == null ? void 0 : StaffDetail.all_staff) == null ? void 0 : _b3.mutiple_limited) || ((_c2 = StaffDetail == null ? void 0 : StaffDetail.teacher_staff) == null ? void 0 : _c2.mutiple_limited)) {
|
|
|
if (StaffDetail == null ? void 0 : StaffDetail.enrolled) {
|
|
|
message/* default */.ZP.info("\u4F60\u5DF2\u7ECF\u62A5\u540D\uFF0C\u4E0D\u80FD\u91CD\u590D\u62A5\u540D");
|
|
|
setIsClick(true);
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
if (((_d2 = StaffDetail == null ? void 0 : StaffDetail.all_staff) == null ? void 0 : _d2.mutiple_limited) || ((_e2 = StaffDetail == null ? void 0 : StaffDetail.member_staff) == null ? void 0 : _e2.mutiple_limited)) {
|
|
|
if (StaffDetail == null ? void 0 : StaffDetail.enrolled) {
|
|
|
message/* default */.ZP.info("\u4F60\u5DF2\u7ECF\u62A5\u540D\uFF0C\u4E0D\u80FD\u91CD\u590D\u62A5\u540D");
|
|
|
setIsClick(true);
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (StaffDetail == null ? void 0 : StaffDetail.enroll_ended) {
|
|
|
message/* default */.ZP.info("\u62A5\u540D\u5DF2\u622A\u6B62\uFF0C\u65E0\u9700\u62A5\u540D");
|
|
|
setIsClick(true);
|
|
|
return true;
|
|
|
}
|
|
|
if (StaffDetail == null ? void 0 : StaffDetail.all_staff)
|
|
|
return false;
|
|
|
if ((_f2 = user == null ? void 0 : user.userInfo) == null ? void 0 : _f2.is_teacher) {
|
|
|
if (!StaffDetail.teacher_staff) {
|
|
|
message/* default */.ZP.info("\u5DF2\u7981\u6B62\u8001\u5E08\u62A5\u540D");
|
|
|
setIsClick(true);
|
|
|
return true;
|
|
|
}
|
|
|
} else {
|
|
|
if (!(StaffDetail == null ? void 0 : StaffDetail.member_staff)) {
|
|
|
message/* default */.ZP.info("\u5DF2\u7981\u6B62\u5B66\u751F\u62A5\u540D");
|
|
|
setIsClick(true);
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
function JoinTeams(name) {
|
|
|
return Detail_async(this, null, function* () {
|
|
|
if (!isClick) {
|
|
|
return;
|
|
|
}
|
|
|
if (isadd()) {
|
|
|
return;
|
|
|
}
|
|
|
setIsClick(false);
|
|
|
let data = yield dispatch({
|
|
|
type: "competitions/JoinTeam",
|
|
|
payload: {
|
|
|
identifier,
|
|
|
invite_code: name
|
|
|
}
|
|
|
});
|
|
|
if (data && data.status === 0) {
|
|
|
setisopen(true);
|
|
|
setdatas(data);
|
|
|
setJoin(false);
|
|
|
setIsClick(true);
|
|
|
init();
|
|
|
} else {
|
|
|
setIsClick(true);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "edu-container minH500" }, /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z, { className: "mt10", separator: ">" }, /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z.Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: "/competitions/index" }, "\u5728\u7EBF\u7ADE\u8D5B")), /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z.Item, null, HeaderDetail.name, HeaderDetail.sub_title ? "-" + HeaderDetail.sub_title : null)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10", style: { display: "flex", background: "#fff", position: "relative", padding: "20px 12px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading.effects["competitions/getHeader"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: "355px", width: "800px" } }, (HeaderDetail == null ? void 0 : HeaderDetail.avatar_url) && (HeaderDetail == null ? void 0 : HeaderDetail.avatar_url) !== null && /* @__PURE__ */ _react_17_0_2_react.createElement("img", { style: { height: "355px", width: "800px" }, src: HeaderDetail == null ? void 0 : HeaderDetail.avatar_url }), !(HeaderDetail == null ? void 0 : HeaderDetail.avatar_url) && (HeaderDetail == null ? void 0 : HeaderDetail.avatar_url) == null && /* @__PURE__ */ _react_17_0_2_react.createElement("img", { style: { height: "355px", width: "800px" }, src: `/images/educoder/competitions/mainbanner.jpg` }))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginLeft: "20px", width: "400px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: `${Detailmodules/* default */.Z.titlesize}` }, HeaderDetail.name, HeaderDetail.sub_title ? "-" + HeaderDetail.sub_title : null), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { display: "flex", justifyContent: "space-between", marginRight: 18 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5956\u91D1"), !!(HeaderDetail == null ? void 0 : HeaderDetail.bonus) ? /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { fontSize: "24px" } }, "\xA5", parseInt(HeaderDetail && HeaderDetail.bonus).toLocaleString()) : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { fontSize: "24px" } }, "\u6682\u65E0")), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6D4F\u89C8"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { fontSize: "24px" } }, parseInt(HeaderDetail && HeaderDetail.visits_count).toLocaleString())), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { display: "flex", flexDirection: "column", alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u62A5\u540D"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { fontSize: "24px" } }, parseInt(HeaderDetail && HeaderDetail.member_count).toLocaleString()))), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.timesize, style: { marginTop: 30 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9b9b9b", marginTop: "30px" } }, "\u7ADE\u8D5B\u65F6\u95F4\uFF1A"), HeaderDetail.start_time, "~", HeaderDetail.end_time), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.timesize }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9b9b9b" } }, "\u62A5\u540D\u622A\u6B62\uFF1A"), HeaderDetail.enroll_end_time), HeaderDetail.competition_status === "ended" ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.timesize }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9b9b9b" } }, "\u7ADE\u8D5B\u72B6\u6001\uFF1A"), "\u5DF2\u7ED3\u675F") : null, HeaderDetail.competition_status === "nearly_published" ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.timesize }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9b9b9b" } }, "\u7ADE\u8D5B\u72B6\u6001\uFF1A"), "\u672A\u53D1\u5E03") : null, HeaderDetail.competition_status === "progressing" ? /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: Detailmodules/* default */.Z.timesize }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#9b9b9b" } }, "\u7ADE\u8D5B\u72B6\u6001\uFF1A"), "\u8FDB\u884C\u4E2D") : null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", justifyContent: "center" } }, (HeaderDetail == null ? void 0 : HeaderDetail.mode) <= 2 && StaffDetail.enrolled && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: (e) => {
|
|
|
var _a3;
|
|
|
if ((HeaderDetail == null ? void 0 : HeaderDetail.mode) === 1 || (HeaderDetail == null ? void 0 : HeaderDetail.mode) === 3) {
|
|
|
getrightdatas((_a3 = HeaderDetail.competition_modules) == null ? void 0 : _a3.find((item) => item.module_type === "entrance"));
|
|
|
} else {
|
|
|
gotocourse(e, HeaderDetail, "ismodel");
|
|
|
}
|
|
|
}, style: { background: "#07C160", color: "#fff", border: "1px solid #07C160", marginRight: 20, display: (HeaderDetail == null ? void 0 : HeaderDetail.mode) === 2 ? "" : (HeaderDetail == null ? void 0 : HeaderDetail.mode) === 1 && ((_b2 = (_a2 = HeaderDetail.competition_modules) == null ? void 0 : _a2.filter((item) => item.module_type === "entrance")) == null ? void 0 : _b2.length) > 0 ? "" : "none" }, className: Detailmodules/* default */.Z.buttonsize }, (HeaderDetail == null ? void 0 : HeaderDetail.mode) === 1 && "\u8D5B\u9898\u5165\u53E3", (HeaderDetail == null ? void 0 : HeaderDetail.mode) === 2 && "\u8FDB\u5165\u8BFE\u5802", (HeaderDetail == null ? void 0 : HeaderDetail.mode) === 3 && "\u8D5B\u9898\u5165\u53E3"), HeaderDetail.competition_status === "ended" ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", className: Detailmodules/* default */.Z.buttonsize, disabled: true }, "\u5DF2\u7ED3\u675F") : null, HeaderDetail.competition_status === "nearly_published" ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", className: Detailmodules/* default */.Z.buttonsize, disabled: true }, "\u672A\u53D1\u5E03") : null, HeaderDetail.competition_status !== "nearly_published" && HeaderDetail.enroll_end && HeaderDetail.competition_status !== "ended" ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", className: Detailmodules/* default */.Z.buttonsize, disabled: true }, "\u62A5\u540D\u622A\u6B62") : null, HeaderDetail.competition_status === "progressing" && HeaderDetail.enroll_end != true && HeaderDetail.enroll_end_time ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", disabled: StaffDetail.enrolled && !HeaderDetail.need_attachment, className: Detailmodules/* default */.Z.buttonsize, onClick: (e) => {
|
|
|
var _a3;
|
|
|
if (StaffDetail.enrolled && HeaderDetail.need_attachment) {
|
|
|
(_a3 = see.current) == null ? void 0 : _a3.handleVisible();
|
|
|
return;
|
|
|
}
|
|
|
gotocourse(e, HeaderDetail, HeaderDetail.mode === 2 ? "ismodel" : HeaderDetail.personal ? "personal" : `/competitions/${HeaderDetail.identifier}/detail/enroll`);
|
|
|
} }, StaffDetail.enrolled ? HeaderDetail.need_attachment ? "\u4E0A\u4F20\u4F5C\u54C1" : "\u5DF2\u62A5\u540D" : (HeaderDetail == null ? void 0 : HeaderDetail.enroll_url) ? "\u524D\u5F80\u5927\u8D5B\u5B98\u7F51\u62A5\u540D" : "\u7ACB\u5373\u62A5\u540D") : null), user.userInfo.real_name != "\u6E38\u5BA2" && !(HeaderDetail == null ? void 0 : HeaderDetail.enroll_url) && HeaderDetail.enroll_end_time && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: (e) => gotocourse(e, HeaderDetail, HeaderDetail.mode === 2 ? "ismodel" : HeaderDetail.personal ? "personal" : `/competitions/${HeaderDetail.identifier}/detail/enroll`), className: Detailmodules/* default */.Z.myteam }, (0,authority/* isSuperAdmin */.j5)() ? "\u53C2\u8D5B\u6218\u961F>>" : "\u6211\u7684\u6218\u961F>>"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.bootmdetail }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.flex1 }, /* @__PURE__ */ _react_17_0_2_react.createElement(menu["default"], { selectedKeys: [`${Selectkey}`] }, HeaderDetail && HeaderDetail.competition_modules && HeaderDetail.competition_modules.map((item, index) => {
|
|
|
if (item.module_type != "enroll") {
|
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(menu["default"].Item, { className: Detailmodules/* default */.Z.menuItem, onClick: () => {
|
|
|
if (item == null ? void 0 : item.is_authentication) {
|
|
|
if (!(0,verifyLogin/* handleVerify */.tJ)(dispatch)) {
|
|
|
return;
|
|
|
}
|
|
|
message/* default */.ZP.info("\u52A0\u5165\u6218\u961F\u624D\u80FD\u67E5\u770B");
|
|
|
return;
|
|
|
}
|
|
|
getrightdatas(item);
|
|
|
}, key: item.id }, item.name);
|
|
|
}
|
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.flex6, style: { padding: (showmake || entrance) && 0 } }, isAward ? /* @__PURE__ */ _react_17_0_2_react.createElement(AwardPdf/* default */.Z, { dispatch, userid: (_c = user == null ? void 0 : user.userInfo) == null ? void 0 : _c.user_id, Prize, Accounts, getAccounts }) : null, isRanKing ? /* @__PURE__ */ _react_17_0_2_react.createElement(Detail_Ranking, { HeaderDetail, userinfo: user.userInfo, Editable: (_d = HeaderDetail == null ? void 0 : HeaderDetail.permission) == null ? void 0 : _d.editable, getCharts, getChartRules, Selectkey, ChartRules, ItemData }) : null, ISsee ? /* @__PURE__ */ _react_17_0_2_react.createElement(Detail_SeeItem, { ref: see, StaffDetail, HeaderDetail, userinfo: user.userInfo, Editable: (_e = HeaderDetail == null ? void 0 : HeaderDetail.permission) == null ? void 0 : _e.editable, ItemData, setIssee, ModelType, dispatch }) : null, !ISsee && !showmake && !entrance && !isRanKing && !isAward && !MdTab && !isWorkSubmit ? /* @__PURE__ */ _react_17_0_2_react.createElement(Update, { userinfo: user.userInfo, ModelType, getrightdatas, dispatch, MenuItem, setIssee, identifier, ItemData }) : null, MdTab && /* @__PURE__ */ _react_17_0_2_react.createElement(SubmitResult, { dispatch, StaffDetail, userinfo: user.userInfo, HeaderDetail, Editable: (_f = HeaderDetail == null ? void 0 : HeaderDetail.permission) == null ? void 0 : _f.editable, getCharts: getResults, getChartRules: getTabResults, Selectkey, ChartRules: TabResults, ItemData }), showmake && /* @__PURE__ */ _react_17_0_2_react.createElement(MakeItem, { loading: itLoading, dispatch, StaffDetail, userinfo: user.userInfo, HeaderDetail, Editable: (_g = HeaderDetail == null ? void 0 : HeaderDetail.permission) == null ? void 0 : _g.editable, getCharts: getshixunCharts, getChartRules: getTabResults, Selectkey, ChartRules: TabResults, ItemData }), entrance && /* @__PURE__ */ _react_17_0_2_react.createElement(Entrance, { loading: itLoading, dispatch, StaffDetail, userinfo: user.userInfo, HeaderDetail, Editable: (_h = HeaderDetail == null ? void 0 : HeaderDetail.permission) == null ? void 0 : _h.editable, getCharts: getEntrance, getChartRules: getTabResults, Selectkey, ChartRules: TabResults, ItemData }), isWorkSubmit && /* @__PURE__ */ _react_17_0_2_react.createElement(components_WorkSubmit, { HeaderDetail, userinfo: user.userInfo, StaffDetail, Editable: (_i = HeaderDetail == null ? void 0 : HeaderDetail.permission) == null ? void 0 : _i.editable, ItemData: MenuItem, TabResults, getTabResults }))), /* @__PURE__ */ _react_17_0_2_react.createElement(AuthenticationModel/* default */.Z, null), /* @__PURE__ */ _react_17_0_2_react.createElement(AddSubmitModel, { getResults }), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_modal["default"],
|
|
|
{
|
|
|
open: isshowType,
|
|
|
footer: null,
|
|
|
width: 720,
|
|
|
title: "\u63D0\u793A",
|
|
|
centered: true,
|
|
|
onCancel: () => setisshowType(false)
|
|
|
},
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Detailmodules/* default */.Z.modal }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u534E\u4E3A\u6A21\u578B\u738B\u8005\u6311\u6218\u8D5B\u9EC4\u91D1\u8D5B\u6B63\u5F0F\u5F00\u542F\u5566"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u672C\u8D5B\u6BB5\u603B\u5956\u91D1\u9AD8\u8FBE", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#FF8C29" } }, "300,000"), "\u5143"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "1\u3001\u7B26\u5408\u8D5B\u9898\u8981\u6C42\u7684\u961F\u4F0D\uFF08\u517125\u652F\uFF09\u53EF\u83B7\u5F97\u5956\u91D1\uFF1A12000RMB/\u961F \uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "2\u3001\u53C2\u4E0E\u83B7\u5F97\u201C\u8363\u8000\u6BBF\u5802\u201D\u699C\u4E3B\u7684\u961F\u4F0D\uFF0C\u53EF\u83B7\u5F97\u7531\u4E2D\u56FD\u8F6F\u4EF6\u5F00\u6E90\u521B\u65B0\u5927\u8D5B\u7EC4\u59D4\u4F1A\u9881\u53D1\u7684\u9EC4\u91D1\u5B9D\u7BB1\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "3\u3001\u5404\u8D5B\u9898\u7CBE\u5EA6\u6700\u9AD8\u7684\u961F\u4F0D\uFF0C\u53EF\u83B7\u5F97\u7531\u4E2D\u56FD\u8F6F\u4EF6\u5F00\u6E90\u521B\u65B0\u5927\u8D5B\u7EC4\u59D4\u4F1A\u9881\u53D1\u7684\u9EC4\u91D1\u5B9D\u7BB1+\u8363\u8A89\u8BC1\u4E66\uFF1B"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5FC3\u52A8\u5427\uFF0C\u90A3\u5C31\u5FEB\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\u62A5\u540D\u53C2\u8D5B"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", onClick: () => (0,util/* openNewWindow */.xg)("https://competition.huaweicloud.com/information/1000041485/introduction") }, "\u524D\u5F80\u62A5\u540D\u53C2\u8D5B"))
|
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
|
es_modal["default"],
|
|
|
{
|
|
|
title: "\u9009\u62E9\u53C2\u8D5B\u65B9\u5F0F",
|
|
|
open: isshowmodal,
|
|
|
onCancel: () => {
|
|
|
setisshowmodal(false);
|
|
|
},
|
|
|
footer: false
|
|
|
},
|
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", justifyContent: "space-around", height: 100, alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", style: { height: 40 }, onClick: () => {
|
|
|
setJoin(true);
|
|
|
setisshowmodal(false);
|
|
|
} }, "\u52A0\u5165\u6218\u961F\u53C2\u8D5B"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { height: 40 }, onClick: () => {
|
|
|
setIsAddmodel(true);
|
|
|
setisshowmodal(false);
|
|
|
} }, "\u53BB\u521B\u5EFA\u6218\u961F\u53C2\u8D5B"))
|
|
|
), isJoin ? /* @__PURE__ */ _react_17_0_2_react.createElement(JoinModel/* default */.Z, { isjoin: isJoin, setJoin, JoinTeams }) : null, isAddmodel ? /* @__PURE__ */ _react_17_0_2_react.createElement(Addteams/* default */.Z, { isAddmodle: isAddmodel, setIsAdd: setIsAddmodel, createTeam: addTeams }) : null, /* @__PURE__ */ _react_17_0_2_react.createElement(PhoneModal/* default */.Z, { datas, isopen, setisopen, isShowPhone: showphone, setIsShowPhone: setshowphone, user, dispatch, onOK: () => Detail_async(void 0, null, function* () {
|
|
|
const res = yield dispatch({
|
|
|
type: "competitions/getHeader",
|
|
|
payload: {
|
|
|
identifier
|
|
|
}
|
|
|
});
|
|
|
setHeaderDetail(res);
|
|
|
}) }));
|
|
|
};
|
|
|
/* harmony default export */ var Detail = ((0,_umi_production_exports.connect)(
|
|
|
({
|
|
|
loading,
|
|
|
globalSetting,
|
|
|
user
|
|
|
}) => ({
|
|
|
globalSetting,
|
|
|
loading,
|
|
|
user
|
|
|
})
|
|
|
)(competitionDetails));
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 94836:
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./src/pages/Competitions/Entered/Enteredmodel/Addteams.tsx ***!
|
|
|
\******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 43418);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 8591);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 98135);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ant-design/icons */ 14834);
|
|
|
|
|
|
|
|
|
|
|
|
function Addteans({ isAddmodle, setIsAdd, createTeam }) {
|
|
|
const [personname, setpersonname] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
|
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
|
antd__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
|
{
|
|
|
className: "modal_styles",
|
|
|
centered: true,
|
|
|
title: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { alignItems: "center", display: "flex" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { textAlign: "left", flex: "1" } }, "\u521B\u5EFA\u6218\u961F"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ant_design_icons__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { onClick: () => setIsAdd(false), style: { cursor: "porint" } })),
|
|
|
open: isAddmodle,
|
|
|
closable: false,
|
|
|
destroyOnClose: true,
|
|
|
onOk: () => {
|
|
|
if (!personname) {
|
|
|
antd__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.info("\u6218\u961F\u540D\u4E0D\u80FD\u4E3A\u7A7A");
|
|
|
return;
|
|
|
}
|
|
|
createTeam(personname);
|
|
|
},
|
|
|
onCancel: () => setIsAdd(false)
|
|
|
},
|
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { fontSize: "14px", color: "#F73737", marginLeft: "10px" } }, "*"), "\u961F\u540D\uFF1A", /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { style: { marginTop: "15px", marginLeft: "10px", marginRight: "10px" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { placeholder: "\u8BF7\u8F93\u5165\u961F\u540D", value: personname, maxLength: 60, addonAfter: String(personname && personname.length || 0) + "/60", onChange: (e) => setpersonname(e.target.value) })))
|
|
|
);
|
|
|
}
|
|
|
/* harmony default export */ __webpack_exports__.Z = (Addteans);
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 15436:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./src/pages/Competitions/Entered/Enteredmodel/JoinModel.tsx ***!
|
|
|
\*******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 43418);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 8591);
|
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 98135);
|
|
|
/* harmony import */ var _ant_design_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ant-design/icons */ 14834);
|
|
|
|
|
|
|
|
|
|
|
|
function Jointeam({ isjoin, setJoin, JoinTeams }) {
|
|
|
const [code, setCode] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
|
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
|
antd__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
|
{
|
|
|
className: "modal_styles",
|
|
|
centered: true,
|
|
|
title: /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { alignItems: "center", display: "flex" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { textAlign: "left", flex: "1" } }, "\u52A0\u5165\u6218\u961F"), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_ant_design_icons__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { onClick: () => setJoin(false), style: { cursor: "porint" } })),
|
|
|
open: isjoin,
|
|
|
closable: false,
|
|
|
destroyOnClose: true,
|
|
|
onOk: () => {
|
|
|
if (!code) {
|
|
|
antd__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP.info("\u9080\u8BF7\u7801\u4E0D\u80FD\u4E3A\u7A7A");
|
|
|
return;
|
|
|
}
|
|
|
JoinTeams(code);
|
|
|
},
|
|
|
onCancel: () => setJoin(false)
|
|
|
},
|
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { style: { marginLeft: "10px", display: "flex", alignItems: "center", marginRight: "10px" } }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { style: { flex: "none" } }, "\u9080\u8BF7\u7801\uFF1A"), " ", /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_4__["default"], { placeholder: "\u8BF7\u8F93\u5165\u9080\u8BF7\u7801", value: code, maxLength: 60, addonAfter: String(code && code.length || 0) + "/60", onChange: (e) => setCode(e.target.value) })))
|
|
|
);
|
|
|
}
|
|
|
/* harmony default export */ __webpack_exports__.Z = (Jointeam);
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |