|
|
|
|
@ -3911,9 +3911,9 @@ function useInterval(callback, delay) {
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 98360:
|
|
|
|
|
/***/ 71980:
|
|
|
|
|
/*!************************************************************!*\
|
|
|
|
|
!*** ./src/pages/Competitions/Edit/index.tsx + 49 modules ***!
|
|
|
|
|
!*** ./src/pages/Competitions/Edit/index.tsx + 51 modules ***!
|
|
|
|
|
\************************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
@ -5151,7 +5151,7 @@ var StudentTeam_competitionsPage = function competitionsPage(_ref) {
|
|
|
|
|
}, (competitions === null || competitions === void 0 || (_competitions$competi4 = competitions.competition) === null || _competitions$competi4 === void 0 ? void 0 : _competitions$competi4.required_trade) && {
|
|
|
|
|
title: '所在行业',
|
|
|
|
|
align: 'left',
|
|
|
|
|
dataIndex: 'trade',
|
|
|
|
|
dataIndex: 'new_trade',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
render: function render(text) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
@ -5996,7 +5996,7 @@ var StudentTeam_competitionsPage = function competitionsPage(_ref) {
|
|
|
|
|
hideOnSinglePage: true,
|
|
|
|
|
showSizeChanger: true,
|
|
|
|
|
pageSizeOptions: ['10', '15', '50', '100', '200'],
|
|
|
|
|
total: total,
|
|
|
|
|
total: applyCount,
|
|
|
|
|
onChange: function onChange(page, pageSize) {
|
|
|
|
|
params.page = page;
|
|
|
|
|
params.per_page = pageSize;
|
|
|
|
|
@ -12892,6 +12892,373 @@ var DataSetModal = function DataSetModal(_ref) {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var components_DataSetModal = (DataSetModal);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Edit/view/components/PatternModal/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var PatternModalmodules = ({"Onerow":"Onerow___qbQVr","dataSetModSty":"dataSetModSty___sL3P_","boxLeft":"boxLeft___wfJ7E","headerBox":"headerBox___tflf4","scoreByBlankRadio":"scoreByBlankRadio___qlnX0","listSty":"listSty___i3br_","boxRight":"boxRight___LsDZR","titleSty":"titleSty___E8zEX"});
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Edit/view/components/PatternModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PatternModal_DataSetModal = function DataSetModal(_ref) {
|
|
|
|
|
var visible = _ref.visible,
|
|
|
|
|
teamId = _ref.teamId,
|
|
|
|
|
onCancle = _ref.onCancle,
|
|
|
|
|
onOK = _ref.onOK;
|
|
|
|
|
var _useParams = (0,_umi_production_exports.useParams)(),
|
|
|
|
|
identifier = _useParams.identifier;
|
|
|
|
|
// const [treeData, setTreeeData] = useState([
|
|
|
|
|
// {
|
|
|
|
|
// title:'123',
|
|
|
|
|
// key:1,
|
|
|
|
|
// tag:123,
|
|
|
|
|
// children:[{
|
|
|
|
|
// title:'123-1',key:110
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// title:'123-2',key:111
|
|
|
|
|
// }]
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// title:'456',
|
|
|
|
|
// key:2,
|
|
|
|
|
// tag:456,
|
|
|
|
|
// children:[{
|
|
|
|
|
// title:'456-1',key:112
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// title:'456-2',key:113
|
|
|
|
|
// }]
|
|
|
|
|
// }
|
|
|
|
|
// ]);
|
|
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
treeData = _useState2[0],
|
|
|
|
|
setTreeeData = _useState2[1];
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
selectDataset = _useState4[0],
|
|
|
|
|
setSelectDataset = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
checkedKeys = _useState6[0],
|
|
|
|
|
setCheckedKeys = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)({
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 10,
|
|
|
|
|
keyword: '',
|
|
|
|
|
type: 1
|
|
|
|
|
// cluster_type: cluster_type || '0'
|
|
|
|
|
}),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
params = _useState8[0],
|
|
|
|
|
setParams = _useState8[1];
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
|
|
totalCount = _useState10[0],
|
|
|
|
|
setTotalCount = _useState10[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
if (visible) {
|
|
|
|
|
getDataSetList();
|
|
|
|
|
}
|
|
|
|
|
}, [visible]);
|
|
|
|
|
var getDataSetList = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var res, _res$data, _res$data2, tempTreeData;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/competitions/".concat(identifier, "/competition_teams/").concat(teamId, "/get_models.json"), {
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: {
|
|
|
|
|
type: params.type || 1,
|
|
|
|
|
q: params.keyword,
|
|
|
|
|
page: params.page || 1,
|
|
|
|
|
limit: params.limit || 10
|
|
|
|
|
// cluster_type :params.cluster_type || '0'
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
tempTreeData = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.data) === null || _res$data === void 0 || (_res$data = _res$data.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item, index) {
|
|
|
|
|
var _item$modelFileList;
|
|
|
|
|
return {
|
|
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'space-between'
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
|
|
title: item === null || item === void 0 ? void 0 : item.description,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: item === null || item === void 0 ? void 0 : item.name
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#3061D0'
|
|
|
|
|
},
|
|
|
|
|
children: (item === null || item === void 0 ? void 0 : item.repoOwnerName) + "".concat(item !== null && item !== void 0 && item.repoName ? '/' : '') + (item === null || item === void 0 ? void 0 : item.repoName)
|
|
|
|
|
})]
|
|
|
|
|
}),
|
|
|
|
|
key: item === null || item === void 0 ? void 0 : item.id,
|
|
|
|
|
// disableCheckbox: true,
|
|
|
|
|
tag: (item === null || item === void 0 ? void 0 : item.repoOwnerName) + "/" + (item === null || item === void 0 ? void 0 : item.repoName),
|
|
|
|
|
children: item === null || item === void 0 || (_item$modelFileList = item.modelFileList) === null || _item$modelFileList === void 0 ? void 0 : _item$modelFileList.map(function (jtem) {
|
|
|
|
|
return {
|
|
|
|
|
title: jtem === null || jtem === void 0 ? void 0 : jtem.FileName,
|
|
|
|
|
key: jtem === null || jtem === void 0 ? void 0 : jtem.RelativePath,
|
|
|
|
|
disableCheckbox: true
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
setTreeeData(tempTreeData);
|
|
|
|
|
setTotalCount(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 || (_res$data2 = _res$data2.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.count);
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
return function getDataSetList() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleCheck = function handleCheck(checkedKeys, nodes) {
|
|
|
|
|
var _nodes$checkedNodes;
|
|
|
|
|
console.log("checkedKeys--", checkedKeys, 'nodes--', nodes);
|
|
|
|
|
var titles = [];
|
|
|
|
|
var tempSelectNodes = nodes === null || nodes === void 0 || (_nodes$checkedNodes = nodes.checkedNodes) === null || _nodes$checkedNodes === void 0 ? void 0 : _nodes$checkedNodes.filter(function (item) {
|
|
|
|
|
if (item !== null && item !== void 0 && item.tag) {
|
|
|
|
|
titles.push(item === null || item === void 0 ? void 0 : item.title);
|
|
|
|
|
}
|
|
|
|
|
return item === null || item === void 0 ? void 0 : item.tag;
|
|
|
|
|
});
|
|
|
|
|
console.log("tempSelectNodes--", tempSelectNodes);
|
|
|
|
|
var duplicates = titles === null || titles === void 0 ? void 0 : titles.filter(function (title, index) {
|
|
|
|
|
return (titles === null || titles === void 0 ? void 0 : titles.indexOf(title)) !== index;
|
|
|
|
|
});
|
|
|
|
|
if ((tempSelectNodes === null || tempSelectNodes === void 0 ? void 0 : tempSelectNodes.length) > 5) {
|
|
|
|
|
message/* default */.ZP.info("最多不超过5个文件");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ((duplicates === null || duplicates === void 0 ? void 0 : duplicates.length) > 0) {
|
|
|
|
|
message/* default */.ZP.info('不能选择相同名称的数据文件');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
setCheckedKeys(checkedKeys);
|
|
|
|
|
setSelectDataset(toConsumableArray_default()(tempSelectNodes));
|
|
|
|
|
};
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
|
|
centered: true,
|
|
|
|
|
title: "\u9009\u62E9\u6A21\u578B",
|
|
|
|
|
open: visible,
|
|
|
|
|
width: 1100,
|
|
|
|
|
okText: "\u786E\u5B9A",
|
|
|
|
|
cancelText: "\u53D6\u6D88",
|
|
|
|
|
zIndex: 1000,
|
|
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var _selectDataset$map;
|
|
|
|
|
var datasetsString, datasets;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (!((selectDataset === null || selectDataset === void 0 ? void 0 : selectDataset.length) === 0)) {
|
|
|
|
|
_context2.next = 3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
message/* default */.ZP.info('请选择数据集');
|
|
|
|
|
return _context2.abrupt("return");
|
|
|
|
|
case 3:
|
|
|
|
|
datasetsString = selectDataset === null || selectDataset === void 0 || (_selectDataset$map = selectDataset.map(function (item) {
|
|
|
|
|
return item === null || item === void 0 ? void 0 : item.title;
|
|
|
|
|
})) === null || _selectDataset$map === void 0 ? void 0 : _selectDataset$map.join('、');
|
|
|
|
|
datasets = selectDataset === null || selectDataset === void 0 ? void 0 : selectDataset.map(function (item) {
|
|
|
|
|
return {
|
|
|
|
|
name: item === null || item === void 0 ? void 0 : item.title,
|
|
|
|
|
id: item === null || item === void 0 ? void 0 : item.key
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
onOK(datasets, datasetsString);
|
|
|
|
|
onCancle();
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
})),
|
|
|
|
|
onCancel: function onCancel() {
|
|
|
|
|
onCancle();
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: PatternModalmodules.dataSetModSty,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: PatternModalmodules.boxLeft,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: PatternModalmodules.headerBox,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'baseline',
|
|
|
|
|
zIndex: 0
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
|
|
|
className: PatternModalmodules.scoreByBlankRadio,
|
|
|
|
|
optionType: "button",
|
|
|
|
|
options: [{
|
|
|
|
|
label: '本项目',
|
|
|
|
|
value: 4
|
|
|
|
|
}, {
|
|
|
|
|
label: '我的模型',
|
|
|
|
|
value: 2
|
|
|
|
|
}, {
|
|
|
|
|
label: '公开模型',
|
|
|
|
|
value: 1
|
|
|
|
|
}, {
|
|
|
|
|
label: '我收藏的模型',
|
|
|
|
|
value: 3
|
|
|
|
|
}, {
|
|
|
|
|
label: '我迁移的模型',
|
|
|
|
|
value: 5
|
|
|
|
|
}],
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
params.type = e.target.value;
|
|
|
|
|
params.keyword = '';
|
|
|
|
|
params.page = 1;
|
|
|
|
|
getDataSetList();
|
|
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
|
|
},
|
|
|
|
|
value: params.type
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ui_customization/* CustomInput */.t7, {
|
|
|
|
|
style: {
|
|
|
|
|
width: 300,
|
|
|
|
|
marginBottom: '20px'
|
|
|
|
|
},
|
|
|
|
|
placeholder: "\u8F93\u5165\u6A21\u578B\u540D\u79F0\u8FDB\u884C\u641C\u7D22",
|
|
|
|
|
value: params.keyword,
|
|
|
|
|
onChange: function onChange(keyword) {
|
|
|
|
|
params.keyword = keyword;
|
|
|
|
|
params.page = 1;
|
|
|
|
|
getDataSetList();
|
|
|
|
|
setParams(objectSpread2_default()({}, params));
|
|
|
|
|
}
|
|
|
|
|
})]
|
|
|
|
|
}), totalCount > 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: PatternModalmodules.listSty,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(tree/* default */.Z, {
|
|
|
|
|
checkable: true,
|
|
|
|
|
defaultExpandAll: false,
|
|
|
|
|
treeData: treeData,
|
|
|
|
|
onCheck: handleCheck,
|
|
|
|
|
checkedKeys: checkedKeys,
|
|
|
|
|
blockNode: true,
|
|
|
|
|
switcherIcon: function switcherIcon(_ref4) {
|
|
|
|
|
var isLeaf = _ref4.isLeaf,
|
|
|
|
|
expanded = _ref4.expanded;
|
|
|
|
|
return expanded ? /*#__PURE__*/(0,jsx_runtime.jsx)(MinusSquareOutlined/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#BACFFE',
|
|
|
|
|
fontSize: '14px'
|
|
|
|
|
}
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(PlusSquareOutlined/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#BACFFE',
|
|
|
|
|
fontSize: '14px'
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
|
|
showSizeChanger: true,
|
|
|
|
|
className: "mt20",
|
|
|
|
|
size: "small",
|
|
|
|
|
current: params.page,
|
|
|
|
|
pageSize: params.limit,
|
|
|
|
|
total: totalCount || 0,
|
|
|
|
|
onShowSizeChange: function onShowSizeChange(page, limit) {
|
|
|
|
|
getDataSetList();
|
|
|
|
|
setParams(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
|
|
page: page,
|
|
|
|
|
limit: limit
|
|
|
|
|
}));
|
|
|
|
|
},
|
|
|
|
|
showTotal: function showTotal(total) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
|
|
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
style: {
|
|
|
|
|
color: '#3061D0'
|
|
|
|
|
},
|
|
|
|
|
children: total
|
|
|
|
|
}), "\u6761\u6570\u636E"]
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onChange: function onChange(page, limit) {
|
|
|
|
|
getDataSetList();
|
|
|
|
|
setParams(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
|
|
|
|
|
page: page,
|
|
|
|
|
limit: limit
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
})]
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: PatternModalmodules.boxRight,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
height: '38px',
|
|
|
|
|
lineHeight: '38px',
|
|
|
|
|
marginBottom: '20px',
|
|
|
|
|
color: '#232B40'
|
|
|
|
|
},
|
|
|
|
|
children: "\u5DF2\u9009\u6570\u636E\u6587\u4EF6"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: selectDataset.map(function (item, index) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
|
|
checked: true,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
var keyIndex = checkedKeys.indexOf(item === null || item === void 0 ? void 0 : item.key);
|
|
|
|
|
if (keyIndex !== -1) {
|
|
|
|
|
checkedKeys.splice(keyIndex, 1);
|
|
|
|
|
setCheckedKeys(toConsumableArray_default()(checkedKeys));
|
|
|
|
|
}
|
|
|
|
|
selectDataset.splice(index, 1);
|
|
|
|
|
setSelectDataset(toConsumableArray_default()(selectDataset));
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: PatternModalmodules.titleSty,
|
|
|
|
|
title: item === null || item === void 0 ? void 0 : item.title,
|
|
|
|
|
children: item === null || item === void 0 ? void 0 : item.title
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}, item === null || item === void 0 ? void 0 : item.key);
|
|
|
|
|
})
|
|
|
|
|
})]
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var PatternModal = (PatternModal_DataSetModal);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Competitions/Edit/view/Entrance/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -12914,6 +13281,7 @@ var DataSetModal = function DataSetModal(_ref) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Entrance = function Entrance(_ref) {
|
|
|
|
|
@ -12955,38 +13323,41 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
|
|
form = _Form$useForm2[0];
|
|
|
|
|
// const [mirrorList, setMirrorList] = useState([])
|
|
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
|
|
dataSetVis = _useState12[0],
|
|
|
|
|
setDataSetVis = _useState12[1];
|
|
|
|
|
mirrorList = _useState12[0],
|
|
|
|
|
setMirrorList = _useState12[1];
|
|
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
|
|
patternVis = _useState14[0],
|
|
|
|
|
setPatternVis = _useState14[1];
|
|
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
dataSetVis = _useState14[0],
|
|
|
|
|
setDataSetVis = _useState14[1];
|
|
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
|
|
dataSets = _useState16[0],
|
|
|
|
|
setDataSets = _useState16[1];
|
|
|
|
|
patternVis = _useState16[0],
|
|
|
|
|
setPatternVis = _useState16[1];
|
|
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
|
|
models = _useState18[0],
|
|
|
|
|
setModels = _useState18[1];
|
|
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)({
|
|
|
|
|
dataSets = _useState18[0],
|
|
|
|
|
setDataSets = _useState18[1];
|
|
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
|
|
models = _useState20[0],
|
|
|
|
|
setModels = _useState20[1];
|
|
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)({
|
|
|
|
|
image_name: '',
|
|
|
|
|
image_id: ''
|
|
|
|
|
}),
|
|
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
|
|
mirrorParams = _useState20[0],
|
|
|
|
|
setMirrorParams = _useState20[1];
|
|
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)([{
|
|
|
|
|
"image_name": "mindspore_2_1_cann_6_3_xianxing-train",
|
|
|
|
|
"image_url": "",
|
|
|
|
|
"image_id": "qb39830ff2e445cdbb53a26690405811"
|
|
|
|
|
}]),
|
|
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
|
|
mirrorList = _useState22[0],
|
|
|
|
|
setMirrorList = _useState22[1];
|
|
|
|
|
mirrorParams = _useState22[0],
|
|
|
|
|
setMirrorParams = _useState22[1];
|
|
|
|
|
// const [mirrorList, setMirrorList] = useState([
|
|
|
|
|
// {
|
|
|
|
|
// "image_name": "mindspore_2_1_cann_6_3_xianxing-train",
|
|
|
|
|
// "image_url": "",
|
|
|
|
|
// "image_id": "qb39830ff2e445cdbb53a26690405811"
|
|
|
|
|
// }
|
|
|
|
|
// ]);
|
|
|
|
|
console.log("competitions----", competitions);
|
|
|
|
|
var Columns = [{
|
|
|
|
|
title: "提交ID",
|
|
|
|
|
dataIndex: "commit_id",
|
|
|
|
|
@ -13622,7 +13993,7 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
url: s3.getSignedUrl('getObject', {
|
|
|
|
|
Bucket: "naic",
|
|
|
|
|
Key: name,
|
|
|
|
|
Expires: 15748800 //半年
|
|
|
|
|
Expires: 604800 //7天 604800 半年 15748800
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
return toConsumableArray_default()(p);
|
|
|
|
|
@ -13658,25 +14029,41 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
// 获取规格和镜像
|
|
|
|
|
// const getMirrorAndSpecificList = async (keyword?: any) => {
|
|
|
|
|
// const res = await Fetch(`/api/competitions/${identifier}/get_resources.json`, {
|
|
|
|
|
// method: 'get',
|
|
|
|
|
// params: {
|
|
|
|
|
// keyword: keyword,
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// if (res?.status === 0) {
|
|
|
|
|
// setMirrorList(res?.data?.images);
|
|
|
|
|
// console.log('res?.data?.images---',res?.data?.images);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
var getMirrorAndSpecificList = /*#__PURE__*/function () {
|
|
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(keyword) {
|
|
|
|
|
var res, _res$data, _res$data2;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context9) {
|
|
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context9.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/competitions/".concat(identifier, "/get_resources.json"), {
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: {
|
|
|
|
|
keyword: keyword
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context9.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
|
|
setMirrorList(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.images);
|
|
|
|
|
console.log('res?.data?.images---', res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.images);
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context9.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee8);
|
|
|
|
|
}));
|
|
|
|
|
return function getMirrorAndSpecificList(_x8) {
|
|
|
|
|
return _ref7.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var handleCommit = /*#__PURE__*/function () {
|
|
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
|
|
|
|
|
var _CommitRecords$data6, _CommitRecords$data7;
|
|
|
|
|
var payload, res, _res$del_filename, _res$del_filename2, s3;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context9) {
|
|
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context10) {
|
|
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
payload = {
|
|
|
|
|
identifier: identifier,
|
|
|
|
|
@ -13703,13 +14090,13 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
payload.datasets = dataSets;
|
|
|
|
|
payload.models = models;
|
|
|
|
|
}
|
|
|
|
|
_context9.next = 4;
|
|
|
|
|
_context10.next = 4;
|
|
|
|
|
return dispatch({
|
|
|
|
|
type: "competitions/postCompetitionCommitRecords",
|
|
|
|
|
payload: objectSpread2_default()({}, payload)
|
|
|
|
|
});
|
|
|
|
|
case 4:
|
|
|
|
|
res = _context9.sent;
|
|
|
|
|
res = _context10.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.success(res === null || res === void 0 ? void 0 : res.message);
|
|
|
|
|
setFileList([]);
|
|
|
|
|
@ -13743,12 +14130,12 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context9.stop();
|
|
|
|
|
return _context10.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee8);
|
|
|
|
|
}, _callee9);
|
|
|
|
|
}));
|
|
|
|
|
return function handleCommit() {
|
|
|
|
|
return _ref7.apply(this, arguments);
|
|
|
|
|
return _ref8.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
|
|
@ -13766,7 +14153,7 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
if ((competitionStage === null || competitionStage === void 0 ? void 0 : competitionStage.category) === 'npu') {
|
|
|
|
|
setCommitModalVis(true);
|
|
|
|
|
// getMirrorAndSpecificList();
|
|
|
|
|
getMirrorAndSpecificList();
|
|
|
|
|
} else {
|
|
|
|
|
handleCommit();
|
|
|
|
|
}
|
|
|
|
|
@ -13979,12 +14366,12 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
size: "large",
|
|
|
|
|
className: "ml20",
|
|
|
|
|
type: "primary",
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
|
|
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context10) {
|
|
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee10$(_context11) {
|
|
|
|
|
while (1) switch (_context11.prev = _context11.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context10.next = 2;
|
|
|
|
|
_context11.next = 2;
|
|
|
|
|
return dispatch({
|
|
|
|
|
type: "competitions/putCompetitionEntries",
|
|
|
|
|
payload: objectSpread2_default()({
|
|
|
|
|
@ -13992,7 +14379,7 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
}, urlData)
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context10.sent;
|
|
|
|
|
res = _context11.sent;
|
|
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
|
|
|
|
|
message/* default */.ZP.success("修改成功");
|
|
|
|
|
setIsEdit(false);
|
|
|
|
|
@ -14000,9 +14387,9 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context10.stop();
|
|
|
|
|
return _context11.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee9);
|
|
|
|
|
}, _callee10);
|
|
|
|
|
})),
|
|
|
|
|
children: "\u4FDD\u5B58\u66F4\u6539"
|
|
|
|
|
})]
|
|
|
|
|
@ -14136,7 +14523,7 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_DataSetModal, {
|
|
|
|
|
visible: dataSetVis,
|
|
|
|
|
teamId: (CommitRecords === null || CommitRecords === void 0 || (_CommitRecords$data14 = CommitRecords.data) === null || _CommitRecords$data14 === void 0 ? void 0 : _CommitRecords$data14.team_id) || 48641,
|
|
|
|
|
teamId: CommitRecords === null || CommitRecords === void 0 || (_CommitRecords$data14 = CommitRecords.data) === null || _CommitRecords$data14 === void 0 ? void 0 : _CommitRecords$data14.competition_team_id,
|
|
|
|
|
cluster_type: (competitionStage === null || competitionStage === void 0 ? void 0 : competitionStage.category) === 'npu' ? 1 : 0,
|
|
|
|
|
onCancle: function onCancle() {
|
|
|
|
|
setDataSetVis(false);
|
|
|
|
|
@ -14145,9 +14532,9 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
setDataSets(datasets);
|
|
|
|
|
form.setFieldValue('data_sets', datasetsString);
|
|
|
|
|
}
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_DataSetModal, {
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(PatternModal, {
|
|
|
|
|
visible: patternVis,
|
|
|
|
|
teamId: (CommitRecords === null || CommitRecords === void 0 || (_CommitRecords$data15 = CommitRecords.data) === null || _CommitRecords$data15 === void 0 ? void 0 : _CommitRecords$data15.team_id) || 48641,
|
|
|
|
|
teamId: CommitRecords === null || CommitRecords === void 0 || (_CommitRecords$data15 = CommitRecords.data) === null || _CommitRecords$data15 === void 0 ? void 0 : _CommitRecords$data15.competition_team_id,
|
|
|
|
|
onCancle: function onCancle() {
|
|
|
|
|
setPatternVis(false);
|
|
|
|
|
},
|
|
|
|
|
@ -14158,11 +14545,11 @@ var Entrance = function Entrance(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var view_Entrance = ((0,_umi_production_exports.connect)(function (_ref9) {
|
|
|
|
|
var competitions = _ref9.competitions,
|
|
|
|
|
loading = _ref9.loading,
|
|
|
|
|
globalSetting = _ref9.globalSetting,
|
|
|
|
|
user = _ref9.user;
|
|
|
|
|
/* harmony default export */ var view_Entrance = ((0,_umi_production_exports.connect)(function (_ref10) {
|
|
|
|
|
var competitions = _ref10.competitions,
|
|
|
|
|
loading = _ref10.loading,
|
|
|
|
|
globalSetting = _ref10.globalSetting,
|
|
|
|
|
user = _ref10.user;
|
|
|
|
|
return {
|
|
|
|
|
competitions: competitions,
|
|
|
|
|
globalSetting: globalSetting,
|
|
|
|
|
@ -14902,6 +15289,7 @@ var Playerwork = function Playerwork(_ref) {
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
checkInfo = _useState6[0],
|
|
|
|
|
setCheckInfo = _useState6[1];
|
|
|
|
|
console.log("------------competitionStage--", competitionStage);
|
|
|
|
|
var Columns = [{
|
|
|
|
|
title: "选手名称",
|
|
|
|
|
dataIndex: "user_name",
|