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.
300 lines
12 KiB
300 lines
12 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[6366],{
|
|
|
|
/***/ 46948:
|
|
/*!*****************************************!*\
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
\*****************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 93314);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antd */ 3113);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
|
|
|
|
|
const noData = ({
|
|
img,
|
|
buttonProps = {},
|
|
styles = {},
|
|
customText,
|
|
ButtonText,
|
|
ButtonClick,
|
|
Buttonclass,
|
|
ButtonTwo,
|
|
imgStyles,
|
|
loading = false
|
|
}) => {
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
"section",
|
|
{
|
|
className: "tc animated fadeIn",
|
|
style: __spreadValues(__spreadValues({}, { color: "#999", margin: "100px auto", visibility: loading ? "hidden" : "visible" }), styles)
|
|
},
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("img", { src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_1__, style: __spreadProps(__spreadValues({}, imgStyles), { pointerEvents: "none", userSelect: "none" }) }),
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "mt20 font14" }, customText || "\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),
|
|
ButtonText && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP, __spreadValues({ className: Buttonclass, onClick: ButtonClick }, buttonProps), ButtonText),
|
|
ButtonTwo && ButtonTwo
|
|
);
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = (noData);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 81481:
|
|
/*!******************************************************************!*\
|
|
!*** ./src/pages/Innovation/PublicProject/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 */ PublicProject; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/typography/index.js + 18 modules
|
|
var typography = __webpack_require__(896);
|
|
// 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/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules
|
|
var divider = __webpack_require__(28103);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(36697);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules
|
|
var PlusOutlined = __webpack_require__(79297);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.1@@ant-design/icons/es/icons/ForkOutlined.js + 1 modules
|
|
var ForkOutlined = __webpack_require__(30114);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(23852);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(77883);
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(64841);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(46948);
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(9498);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
;// CONCATENATED MODULE: ./src/pages/Innovation/PublicProject/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var PublicProjectmodules = ({"flex_box_center":"flex_box_center___usqtP","flex_space_between":"flex_space_between___Q1rHf","flex_box_vertical_center":"flex_box_vertical_center___iwfef","flex_box_center_end":"flex_box_center_end___UgC5k","flex_box_column":"flex_box_column___vaSfm","count":"count___EA_49","header":"header___K169U","title":"title___LKM3L"});
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(19351);
|
|
;// CONCATENATED MODULE: ./src/pages/Innovation/PublicProject/index.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 { Paragraph } = typography["default"];
|
|
const { TabPane } = tabs["default"];
|
|
const ProjectDetailPage = ({ dispatch }) => {
|
|
var _a;
|
|
let [params, setparasm] = (0,_react_17_0_2_react.useState)({
|
|
limit: 10,
|
|
page: 1,
|
|
tab: "public"
|
|
});
|
|
const [datas, setdatas] = (0,_react_17_0_2_react.useState)([]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
getdata();
|
|
}, []);
|
|
function getdata() {
|
|
return __async(this, null, function* () {
|
|
let res = yield (0,fetch/* default */.ZP)(`/api/sci/projects.json`, {
|
|
method: "get",
|
|
params
|
|
});
|
|
setdatas(res);
|
|
});
|
|
}
|
|
const handleCreateProject = () => {
|
|
if ((datas == null ? void 0 : datas.my_sci_projects_num) >= 10 && !(0,authority/* isSuperAdmins */.Ny)()) {
|
|
dispatch({
|
|
type: "innovation/openSimpleModal",
|
|
payload: {
|
|
title: "\u9879\u76EE\u6570\u91CF\u8FBE\u5230\u4E0A\u9650",
|
|
children: "\u6BCF\u4F4D\u7528\u6237\u6700\u591A\u53EA\u80FD\u521B\u5EFA10\u4E2A\u9879\u76EE\uFF0C\u4F60\u7684\u9879\u76EE\u6570\u91CF\u5DF2\u7ECF\u8FBE\u5230\u4E0A\u9650\u3002",
|
|
footer: /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
onClick: () => dispatch({ type: "innovation/closeSimpleModal" }),
|
|
type: "primary"
|
|
},
|
|
"\u6211\u77E5\u9053\u4E86"
|
|
)
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
_umi_production_exports.history.push("/innovation/project/create");
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: PublicProjectmodules.header }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: PublicProjectmodules.title }, "\u516C\u5F00\u9879\u76EE"), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
onClick: handleCreateProject,
|
|
className: PublicProjectmodules.createProjectBtn,
|
|
icon: /* @__PURE__ */ _react_17_0_2_react.createElement(PlusOutlined/* default */.Z, null)
|
|
},
|
|
"\u521B\u5EFA\u9879\u76EE"
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null), (datas == null ? void 0 : datas.count) <= 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(NoData/* default */.Z, null), (_a = datas == null ? void 0 : datas.sci_projects) == null ? void 0 : _a.map((item, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
key: index,
|
|
style: { cursor: "pointer" },
|
|
onClick: () => {
|
|
_umi_production_exports.history.push(`/innovation/project/detail/${item == null ? void 0 : item.id}`);
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"img",
|
|
{
|
|
style: {
|
|
width: 30,
|
|
height: 30,
|
|
borderRadius: "50%",
|
|
marginRight: 10
|
|
},
|
|
src: env/* default */.Z.IMG_SERVER + "/images/" + item.avatar_url
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
style: {
|
|
fontSize: "14px",
|
|
color: "#6B758B",
|
|
marginRight: 10
|
|
}
|
|
},
|
|
item == null ? void 0 : item.username
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#464F66", fontSize: "14px" } }, item == null ? void 0 : item.name)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: 20, color: "#464F66" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: "iconfont icon-chakan1 current ml5",
|
|
style: { marginRight: 8, color: "#B1BACD", fontSize: 12 }
|
|
}
|
|
), item == null ? void 0 : item.visits), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginRight: 20, color: "#464F66" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(ForkOutlined/* default */.Z, { style: { marginRight: 8 } }), item == null ? void 0 : item.forked_count))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
className: PublicProjectmodules.count,
|
|
style: {
|
|
marginTop: 5,
|
|
color: "#464F66",
|
|
fontSize: 14,
|
|
marginLeft: 40
|
|
}
|
|
},
|
|
item == null ? void 0 : item.description
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
style: {
|
|
marginTop: 15,
|
|
color: "#B1BACD",
|
|
fontSize: 14,
|
|
marginLeft: 40
|
|
}
|
|
},
|
|
"\u521B\u5EFA\u65F6\u95F4\uFF1A",
|
|
dayjs_min_default()(item == null ? void 0 : item.created_at).format("YYYY-MM-DD HH:mm")
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(divider/* default */.Z, null)
|
|
);
|
|
}), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
pagination/* default */.Z,
|
|
{
|
|
style: { textAlign: "center", marginTop: 20 },
|
|
current: params.page,
|
|
pageSize: 10,
|
|
showSizeChanger: false,
|
|
total: datas == null ? void 0 : datas.count,
|
|
hideOnSinglePage: true,
|
|
onChange: (e) => {
|
|
params.page = e, setparasm(__spreadValues({}, params));
|
|
getdata();
|
|
}
|
|
}
|
|
));
|
|
};
|
|
/* harmony default export */ var PublicProject = ((0,_umi_production_exports.connect)(
|
|
({ innovation }) => ({
|
|
innovation
|
|
})
|
|
)(ProjectDetailPage));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |