You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Innovation__MyProject__i...

361 lines
15 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[67242],{
/***/ 82982:
/*!*****************************************!*\
!*** ./src/components/NoData/index.tsx ***!
\*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/button/style */ 29913);
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/button */ 71577);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
var noData = function noData(_ref) {
var _ref$buttonProps = _ref.buttonProps,
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
_ref$styles = _ref.styles,
styles = _ref$styles === void 0 ? {} : _ref$styles,
customText = _ref.customText,
ButtonText = _ref.ButtonText,
ButtonClick = _ref.ButtonClick,
Buttonclass = _ref.Buttonclass,
ButtonTwo = _ref.ButtonTwo;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("section", {
className: "tc animated fadeIn",
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, {
color: '#999',
margin: '200px auto'
}), styles),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
src: _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_3__
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
className: "mt20 font14",
children: customText || '暂时还没有相关数据哦!'
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd_es_button__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({
className: Buttonclass,
onClick: ButtonClick
}, buttonProps), {}, {
children: ButtonText
})), ButtonTwo && ButtonTwo]
});
};
/* harmony default export */ __webpack_exports__["Z"] = (noData);
/***/ }),
/***/ 18263:
/*!**************************************************************!*\
!*** ./src/pages/Innovation/MyProject/index.tsx + 1 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 */ MyProject; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(17061);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/style/index.js + 1 modules
var style = __webpack_require__(14182);
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(260);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(42122);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/antd/es/divider/style/index.js + 1 modules
var divider_style = __webpack_require__(98541);
// EXTERNAL MODULE: ./node_modules/antd/es/divider/index.js
var divider = __webpack_require__(27049);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
var tooltip_style = __webpack_require__(38390);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(84908);
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
var button_style = __webpack_require__(29913);
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
var es_button = __webpack_require__(71577);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
var modal_style = __webpack_require__(35611);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
var modal = __webpack_require__(85402);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(17156);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(27424);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/antd/es/tabs/style/index.js + 1 modules
var tabs_style = __webpack_require__(99558);
// EXTERNAL MODULE: ./node_modules/antd/es/tabs/index.js + 22 modules
var tabs = __webpack_require__(3381);
// EXTERNAL MODULE: ./node_modules/antd/es/typography/style/index.js + 1 modules
var typography_style = __webpack_require__(59988);
// EXTERNAL MODULE: ./node_modules/antd/es/typography/index.js + 16 modules
var typography = __webpack_require__(80254);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ForkOutlined.js + 1 modules
var ForkOutlined = __webpack_require__(9641);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(89214);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(84519);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(82982);
// EXTERNAL MODULE: ./node_modules/moment/moment.js
var moment = __webpack_require__(30381);
var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(7);
;// CONCATENATED MODULE: ./src/pages/Innovation/MyProject/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var MyProjectmodules = ({"flex_box_center":"flex_box_center___vI0AN","flex_space_between":"flex_space_between___lnVde","flex_box_vertical_center":"flex_box_vertical_center___x1xpO","flex_box_center_end":"flex_box_center_end___fiRM8","flex_box_column":"flex_box_column___erHFl","count":"count___ZMhqS","header":"header___w7qxt","title":"title___cx4uQ"});
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(59758);
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Innovation/MyProject/index.tsx
var Paragraph = typography/* default.Paragraph */.Z.Paragraph;
var TabPane = tabs/* default.TabPane */.Z.TabPane;
var ProjectDetailPage = function ProjectDetailPage(_ref) {
var _datas$sci_projects;
var dispatch = _ref.dispatch;
var _useState = (0,react.useState)({
limit: 10,
page: 1,
tab: 'mine'
}),
_useState2 = slicedToArray_default()(_useState, 2),
params = _useState2[0],
setparasm = _useState2[1];
var _useState3 = (0,react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
datas = _useState4[0],
setdatas = _useState4[1];
var _useState5 = (0,react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
datacount = _useState6[0],
setdatacount = _useState6[1];
(0,react.useEffect)(function () {
getdata();
}, []);
function getdata() {
return _getdata.apply(this, arguments);
}
function _getdata() {
_getdata = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
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/sci/projects.json", {
method: 'get',
params: params
});
case 2:
res = _context.sent;
if ((params === null || params === void 0 ? void 0 : params.tab) === 'mine') {
setdatacount(res === null || res === void 0 ? void 0 : res.my_sci_projects_num);
}
setdatas(res);
case 5:
case "end":
return _context.stop();
}
}, _callee);
}));
return _getdata.apply(this, arguments);
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
activeKey: params.tab,
onChange: function onChange(e) {
params.tab = e;
params.page = 1;
setparasm(params);
getdata();
},
tabBarExtraContent: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
type: "primary",
onClick: function onClick() {
if ((datas === null || datas === void 0 ? void 0 : datas.my_sci_projects_num) === 10 && !(0,authority/* isSuperAdmins */.Ny)()) {
modal/* default.warning */.Z.warning({
title: '项目数量达到上限',
content: '每位用户最多只能创建10个项目你的项目数量已经 达到上限。'
});
return;
}
_umi_production_exports.history.push('/innovation/project/create');
},
children: "\u521B\u5EFA\u9879\u76EE"
}),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: !(0,authority/* isSuperAdmins */.Ny)() ? /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u9879\u76EE\u4E0A\u965010\uFF0C\u5DF2\u7528".concat(datacount),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: MyProjectmodules.title,
children: ["\u6211\u7684\u9879\u76EE\uFF08", datacount, "/10\uFF09"]
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: MyProjectmodules.title,
children: "\u6211\u7684\u9879\u76EE"
})
}, "mine"), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
tab: '他人共享'
}, "share")]
})
}), (datas === null || datas === void 0 ? void 0 : datas.count) <= 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), datas === null || datas === void 0 ? void 0 : (_datas$sci_projects = datas.sci_projects) === null || _datas$sci_projects === void 0 ? void 0 : _datas$sci_projects.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
cursor: 'pointer'
},
onClick: function onClick() {
_umi_production_exports.history.push("/innovation/project/detail/".concat(item === null || item === void 0 ? void 0 : item.id));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
justifyContent: 'space-between'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
style: {
width: 30,
height: 30,
borderRadius: '50%',
marginRight: 10
},
src: env/* default.IMG_SERVER */.Z.IMG_SERVER + '/images/' + item.avatar_url
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
fontSize: '14px',
color: '#6B758B',
marginRight: 10
},
children: item === null || item === void 0 ? void 0 : item.username
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#464F66',
fontSize: '14px',
fontWeight: 400
},
children: item === null || item === void 0 ? void 0 : item.name
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginRight: 20,
color: '#464F66'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-chakan1 current ml5",
style: {
marginRight: 8,
color: '#B1BACD'
}
}), item === null || item === void 0 ? void 0 : item.visits]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
marginRight: 20,
color: '#464F66'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ForkOutlined/* default */.Z, {
style: {
marginRight: 8
}
}), item === null || item === void 0 ? void 0 : item.forked_count]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: MyProjectmodules.count,
style: {
marginTop: 5,
color: '#464F66',
fontSize: 14,
marginLeft: 40
},
children: item === null || item === void 0 ? void 0 : item.description
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: 15,
color: '#B1BACD',
fontSize: 14,
marginLeft: 40
},
children: ["\u521B\u5EFA\u65F6\u95F4\uFF1A", moment_default()(item === null || item === void 0 ? void 0 : item.created_at).format('YYYY-MM-DD HH:mm')]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
});
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
style: {
textAlign: 'center',
marginTop: 20
},
current: params.page,
pageSize: 10,
showSizeChanger: false,
total: datas === null || datas === void 0 ? void 0 : datas.count,
hideOnSinglePage: true,
onChange: function onChange(e) {
params.page = e, setparasm(objectSpread2_default()({}, params));
getdata();
}
})]
});
};
/* harmony default export */ var MyProject = ((0,_umi_production_exports.connect)(function (_ref2) {
var innovation = _ref2.innovation;
return {
innovation: innovation
};
})(ProjectDetailPage));
/***/ })
}]);