|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[45261],{
|
|
|
|
|
|
/***/ 47073:
|
|
|
/*!**********************************************************************!*\
|
|
|
!*** ./src/pages/Forums/Index/components/Drop/index.tsx + 1 modules ***!
|
|
|
\**********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ Drop; }
|
|
|
});
|
|
|
|
|
|
// 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/notification/index.js + 5 modules
|
|
|
var notification = __webpack_require__(28909);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
|
|
|
var es_menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
|
var dropdown = __webpack_require__(38854);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-router-dom@6.3.0@react-router-dom/index.js
|
|
|
var _react_router_dom_6_3_0_react_router_dom = __webpack_require__(32451);
|
|
|
// EXTERNAL MODULE: ./src/service/forums.ts
|
|
|
var forums = __webpack_require__(11996);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Index/components/Drop/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Index/components/Drop/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// permission = {
|
|
|
// admin://管理员
|
|
|
// banned_permission://管理员、且有置顶、推荐权限
|
|
|
// is_currentUser: true, #是否为当前用户,判断是否显示编辑/删除,并隐藏其他的
|
|
|
// is_fine: true, #是否精华帖子
|
|
|
// sticky: true, #是否置顶
|
|
|
// memo_watched: true, #是否收藏
|
|
|
// is_deleted:true#是否已经申请删除
|
|
|
// }
|
|
|
|
|
|
|
|
|
/* harmony default export */ var Drop = (function (_ref) {
|
|
|
var id = _ref.id,
|
|
|
permission = _ref.permission,
|
|
|
calbackFunc = _ref.calbackFunc;
|
|
|
// 置顶、取消置顶
|
|
|
function changeSticky(s) {
|
|
|
var sticky = s ? 0 : 1; //1为置顶,0为取消置顶
|
|
|
var params = {
|
|
|
id: id,
|
|
|
sticky: sticky
|
|
|
};
|
|
|
(0,forums/* changeTopOrDown */.rK)(params).then(function (res) {
|
|
|
if (res) {
|
|
|
notification/* default */.Z.open({
|
|
|
message: "提示",
|
|
|
description: res.message
|
|
|
});
|
|
|
calbackFunc && calbackFunc();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
// 推荐、取消推荐
|
|
|
function changeFine(f) {
|
|
|
var is_fine = f ? 0 : 1; //1表示加精,0表示取消加精
|
|
|
var params = {
|
|
|
id: id,
|
|
|
is_fine: is_fine
|
|
|
};
|
|
|
(0,forums/* changeIsFine */.d6)(params).then(function (res) {
|
|
|
if (res) {
|
|
|
notification/* default */.Z.open({
|
|
|
message: "提示",
|
|
|
description: res.message
|
|
|
});
|
|
|
calbackFunc && calbackFunc();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 关注、取消关注
|
|
|
function changeMemoWatched(m) {
|
|
|
var is_watch = m ? 0 : 1; //1为添加关注,0为取消关注
|
|
|
var params = {
|
|
|
id: id,
|
|
|
is_watch: is_watch
|
|
|
};
|
|
|
(0,forums/* changeWatchMemo */.FF)(params).then(function (res) {
|
|
|
if (res) {
|
|
|
notification/* default */.Z.open({
|
|
|
message: "提示",
|
|
|
description: res.message
|
|
|
});
|
|
|
calbackFunc && calbackFunc();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
// 管理员直接删除帖子
|
|
|
function deleteForum() {
|
|
|
modal/* default */.Z.confirm({
|
|
|
content: '确认删除帖子?',
|
|
|
title: '提示',
|
|
|
icon: null,
|
|
|
onOk: function onOk() {
|
|
|
(0,forums/* deleteMemosForum */.ok)(id).then(function (res) {
|
|
|
if (res.status !== -1) {
|
|
|
notification/* default */.Z.open({
|
|
|
message: "提示",
|
|
|
description: res.message
|
|
|
});
|
|
|
calbackFunc && calbackFunc();
|
|
|
window.location.href = "/forums";
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 发布者申请删除、撤销申请删除
|
|
|
function sendDeleteForum(d) {
|
|
|
var is_apply = d ? 0 : 1; //1为申请删除,0为撤销申请删除
|
|
|
var params = {
|
|
|
id: id,
|
|
|
is_apply: is_apply
|
|
|
};
|
|
|
modal/* default */.Z.confirm({
|
|
|
content: '确认申请删帖?',
|
|
|
title: '提示',
|
|
|
icon: null,
|
|
|
onOk: function onOk() {
|
|
|
(0,forums/* confirmDelete */.j3)(params).then(function (res) {
|
|
|
if (res) {
|
|
|
notification/* default */.Z.open({
|
|
|
message: "提示",
|
|
|
description: res.message
|
|
|
});
|
|
|
calbackFunc && calbackFunc();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
var menu = permission && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_menu/* default */.Z, {
|
|
|
style: {
|
|
|
minWidth: "100px",
|
|
|
textAlign: 'center'
|
|
|
},
|
|
|
children: [permission.banned_permission && /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return changeSticky(permission.sticky);
|
|
|
},
|
|
|
children: permission.sticky ? "取消置顶" : "置顶"
|
|
|
}), permission.banned_permission && /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return changeFine(permission.is_fine);
|
|
|
},
|
|
|
children: permission.is_fine ? "取消推荐" : "推荐"
|
|
|
}), permission.login && /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return changeMemoWatched(permission.memo_watched);
|
|
|
},
|
|
|
children: permission.memo_watched ? "取消收藏" : "收藏"
|
|
|
}), (permission.admin || permission.is_currentUser) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_react_router_dom_6_3_0_react_router_dom/* Link */.rU, {
|
|
|
to: "/forums/".concat(id, "/edit"),
|
|
|
children: "\u7F16\u8F91"
|
|
|
})
|
|
|
}), permission.admin ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return deleteForum();
|
|
|
},
|
|
|
children: "\u5220\u9664"
|
|
|
}) : permission.is_currentUser ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_menu/* default */.Z.Item, {
|
|
|
onClick: function onClick() {
|
|
|
return sendDeleteForum(permission.is_deleted);
|
|
|
},
|
|
|
children: permission.is_deleted ? "撤销申请" : "申请删帖"
|
|
|
}) : ""]
|
|
|
});
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(dropdown/* default */.Z, {
|
|
|
overlay: menu,
|
|
|
align: "center",
|
|
|
placement: "bottomCenter",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "gengduo icon-gengduo1"
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1491:
|
|
|
/*!**************************************************************************!*\
|
|
|
!*** ./src/pages/Forums/Index/components/ListItem/index.tsx + 1 modules ***!
|
|
|
\**************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ components_ListItem; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(39647);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Index/components/ListItem/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var ListItemmodules = ({"flex":"flex___eARTA","gMAmTc":"gMAmTc___lGbG_","kJYYQv":"kJYYQv___QtsiV","kTLhbM":"kTLhbM___LsxGI","listPagin":"listPagin___AANwv","iwMcWy":"iwMcWy___ZYE3E","kgxtyB":"kgxtyB___tIUuB","cPointer":"cPointer___Kz_aU","forumList":"forumList___lFpN6","cOuXkk":"cOuXkk___NaYdD","tag":"tag___FmK71","tagRed":"tagRed___iYUXx","tagOrange":"tagOrange___iiaBw","tagBlue":"tagBlue___iV1_Z","tag_Red":"tag_Red___R1aSz","tag_Orange":"tag_Orange___xkdLE","tag_Blue":"tag_Blue___TaePK","orange":"orange___g238b","blue":"blue___HqZNF","iconWrap":"iconWrap____jGlq","spanText":"spanText___AlivR","dGqnMq":"dGqnMq___Hp9vj","dicrWo":"dicrWo___o1yQM","task-hide":"task-hide___oGAxf","textTitle":"textTitle___n_yp2","textType":"textType___XlSnX"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EyeOutlined.js + 1 modules
|
|
|
var EyeOutlined = __webpack_require__(15277);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LikeOutlined.js + 1 modules
|
|
|
var LikeOutlined = __webpack_require__(63524);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/MessageOutlined.js + 1 modules
|
|
|
var MessageOutlined = __webpack_require__(13133);
|
|
|
// EXTERNAL MODULE: ./src/pages/Forums/Index/components/Drop/index.tsx + 1 modules
|
|
|
var Drop = __webpack_require__(47073);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(67390);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(80184);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Index/components/ListItem/index.tsx
|
|
|
|
|
|
var _excluded = ["user"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ListItem = function ListItem(_ref) {
|
|
|
var user = _ref.user,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var current_user = user.userInfo;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
|
|
|
className: ListItemmodules.forumList,
|
|
|
children: props.memos.map(function (item, key) {
|
|
|
var permission = {
|
|
|
index: key,
|
|
|
admin: current_user && current_user.admin,
|
|
|
banned_permission: item.banned_permission,
|
|
|
login: current_user && current_user.login,
|
|
|
is_currentUser: current_user && item.user_login === current_user.login,
|
|
|
is_fine: item.is_fine,
|
|
|
sticky: item.sticky,
|
|
|
memo_watched: item.memo_watched,
|
|
|
user_banned_permission: item.banned_permission,
|
|
|
is_deleted: item.apply_destroy
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListItemmodules.cOuXkk,
|
|
|
style: {
|
|
|
lineHeight: "36px"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListItemmodules.kTLhbM,
|
|
|
style: {
|
|
|
marginLeft: "-8px"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: item.tag_name == '交流' ? ListItemmodules.blue : ListItemmodules.orange,
|
|
|
children: ["\u3010", item.tag_name, "\u3011"]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/forums/".concat(item.id),
|
|
|
className: "".concat(ListItemmodules.taskHide, " ").concat(ListItemmodules.textTitle),
|
|
|
children: item.subject
|
|
|
}), item.sticky === true ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(ListItemmodules.tag, " ").concat(ListItemmodules.tagRed),
|
|
|
children: "\u7F6E\u9876"
|
|
|
}) : "", item.is_original === true ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(ListItemmodules.tag, " ").concat(ListItemmodules.tagOrange),
|
|
|
children: "\u539F\u521B"
|
|
|
}) : "", item.is_fine === true ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(ListItemmodules.tag, " ").concat(ListItemmodules.tagBlue),
|
|
|
children: "\u7CBE\u534E"
|
|
|
}) : ""]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListItemmodules.kTLhbM,
|
|
|
children: [item.apply_destroy ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(ListItemmodules.orange, " mr10"),
|
|
|
style: {
|
|
|
fontSize: "12px"
|
|
|
},
|
|
|
children: "\u5DF2\u7533\u8BF7\u5220\u5E16"
|
|
|
}) : "", current_user && current_user.login ? /*#__PURE__*/(0,jsx_runtime.jsx)(Drop/* default */.Z, {
|
|
|
permission: permission,
|
|
|
id: item.id,
|
|
|
calbackFunc: props.calbackFunc
|
|
|
}) : ""]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListItemmodules.cOuXkk,
|
|
|
style: {
|
|
|
marginTop: "8px"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListItemmodules.kTLhbM,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/forums/accounts/".concat(item.user_login, "/memos"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ListItemmodules.kTLhbM,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.IMG_SERVER + '/images/' + item.image_url,
|
|
|
alt: "",
|
|
|
className: ListItemmodules.dGqnMq
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ListItemmodules.dicrWo,
|
|
|
children: item.username
|
|
|
})]
|
|
|
})
|
|
|
}), item.forum_section_title ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "",
|
|
|
className: "".concat(ListItemmodules.iwMcWy, " ").concat(ListItemmodules.textType),
|
|
|
children: item.forum_section_title
|
|
|
}) : "", item.published_time ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ListItemmodules.iwMcWy,
|
|
|
children: item.published_time
|
|
|
}) : ""]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: ListItemmodules.iconWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(EyeOutlined/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ListItemmodules.spanText,
|
|
|
children: item.viewed_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: ListItemmodules.iconWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LikeOutlined/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ListItemmodules.spanText,
|
|
|
children: item.praises_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: ListItemmodules.iconWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(MessageOutlined/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ListItemmodules.spanText,
|
|
|
children: item.replies_count
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}, item.id);
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_ListItem = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
|
var user = _ref2.user;
|
|
|
return {
|
|
|
user: user
|
|
|
};
|
|
|
})(ListItem));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 50479:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/pages/Forums/User/index.tsx + 23 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 */ User; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectDestructuringEmpty.js
|
|
|
var objectDestructuringEmpty = __webpack_require__(70236);
|
|
|
var objectDestructuringEmpty_default = /*#__PURE__*/__webpack_require__.n(objectDestructuringEmpty);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(67390);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/UserIdentify/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/UserIdentify/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function user_identify(_ref) {
|
|
|
var user_info = _ref.user_info;
|
|
|
var identityImage = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-identityed.svg";
|
|
|
var identityIng = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-identity.svg";
|
|
|
var autoPosted = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-posted.svg";
|
|
|
var autoPost = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-post.svg";
|
|
|
var autoPhone = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-phone.svg";
|
|
|
var autoPhoned = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-phoneed.svg";
|
|
|
var autoMailed = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-emailed.svg";
|
|
|
var autoMail = env/* default */.Z.API_SERVER + "images/educoder/icon/auto-email.svg";
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "educontent clearfix edu-txt-center mt10",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "divInline",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "gridItem5",
|
|
|
children: user_info.identify && user_info.identify !== "学生" && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "identifyName",
|
|
|
children: user_info.identify
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var UserIdentify = (user_identify);
|
|
|
// 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/avatar/index.js + 4 modules
|
|
|
var es_avatar = __webpack_require__(26743);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd-img-crop@4.25.0@antd-img-crop/dist/antd-img-crop.esm.js + 19 modules
|
|
|
var antd_img_crop_esm = __webpack_require__(50581);
|
|
|
// EXTERNAL MODULE: ./src/service/forums.ts
|
|
|
var forums = __webpack_require__(11996);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/UserAvatar/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/UserAvatar/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function user_avatar(_ref) {
|
|
|
var avatar = _ref.avatar,
|
|
|
is_current_user = _ref.is_current_user,
|
|
|
user_id = _ref.user_id,
|
|
|
login = _ref.login;
|
|
|
var current_route = window.location.protocol + "//" + window.location.host;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isHover = _useState2[0],
|
|
|
setIsHover = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isClick = _useState4[0],
|
|
|
setIsClick = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(""),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
userAvatar = _useState6[0],
|
|
|
setUserAvatar = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
isLoading = _useState8[0],
|
|
|
setLoadinStatus = _useState8[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setUserAvatar(avatar);
|
|
|
}, []);
|
|
|
var beforeUpload = function beforeUpload(file) {
|
|
|
var isJPG = file.type === "image/jpeg";
|
|
|
var isPNG = file.type === "image/png";
|
|
|
var isGIF = file.type === "image/gif";
|
|
|
if (!isJPG && !isPNG && !isGIF) {
|
|
|
message/* default */.ZP.error("只能上传图片文件!(jpg、png或gif)");
|
|
|
setIsHover(false);
|
|
|
setIsClick(false);
|
|
|
return false;
|
|
|
}
|
|
|
var isLt2M = file.size / 1024 / 1024 < 1;
|
|
|
if (!isLt2M) {
|
|
|
setIsHover(false);
|
|
|
setIsClick(false);
|
|
|
message/* default */.ZP.error("图片大小必须小于 2MB!");
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
};
|
|
|
function sync_upload_picture(file) {
|
|
|
setLoadinStatus(true);
|
|
|
var base64Url = "";
|
|
|
var reader = new FileReader();
|
|
|
reader.readAsDataURL(file.file);
|
|
|
reader.onloadend = function () {
|
|
|
base64Url = reader.result;
|
|
|
if (base64Url && base64Url.length > 0) {
|
|
|
handleUpload(base64Url);
|
|
|
} else {
|
|
|
setLoadinStatus(false);
|
|
|
message/* default */.ZP.error("上传失败,请稍后重试");
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
function handleUpload(base64Url) {
|
|
|
var formData = new FormData();
|
|
|
formData.append("img", base64Url);
|
|
|
formData.append("source_type", "User");
|
|
|
formData.append("source_id", user_id);
|
|
|
formData.append("is_direct", 0);
|
|
|
(0,forums/* uploadAvatar */.gg)(formData).then(function (result) {
|
|
|
if (result && result.data.status === 0) {
|
|
|
setUserAvatar(result.data.url);
|
|
|
} else {
|
|
|
message/* default */.ZP.error(result.data.message);
|
|
|
}
|
|
|
setIsHover(false);
|
|
|
setIsClick(false);
|
|
|
setLoadinStatus(false);
|
|
|
})["catch"](function (e) {
|
|
|
setIsHover(false);
|
|
|
setIsClick(false);
|
|
|
setLoadinStatus(false);
|
|
|
console.log(e);
|
|
|
});
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "headPhoto",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
|
href: "javascript:void(0)",
|
|
|
onMouseEnter: function onMouseEnter() {
|
|
|
return setIsHover(true);
|
|
|
},
|
|
|
onMouseLeave: function onMouseLeave() {
|
|
|
return setIsHover(isClick);
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_avatar/* default */.C, {
|
|
|
size: 109,
|
|
|
src: env/* default */.Z.IMG_SERVER + '/images/' + userAvatar
|
|
|
}), false && /*#__PURE__*/0]
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var UserAvatar = (user_avatar);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(10249);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EditOutlined.js + 1 modules
|
|
|
var EditOutlined = __webpack_require__(16180);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/UserBrief/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/UserBrief/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Item = es_form/* default */.Z.Item;
|
|
|
function user_brief(_ref) {
|
|
|
var brief = _ref.brief,
|
|
|
login = _ref.login,
|
|
|
is_current_user = _ref.is_current_user;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
editBrief = _useState2[0],
|
|
|
setEditBrief = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isEdit = _useState4[0],
|
|
|
setEditStatus = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
isLoading = _useState6[0],
|
|
|
setLoadingStatus = _useState6[1];
|
|
|
var changeInput = function changeInput(e) {
|
|
|
setEditBrief(e.target.value);
|
|
|
};
|
|
|
var edit_brief = function edit_brief() {
|
|
|
setLoadingStatus(true);
|
|
|
var params = {
|
|
|
login: login,
|
|
|
content: editBrief
|
|
|
};
|
|
|
(0,forums/* saveEditBrief */.oQ)(params).then(function (result) {
|
|
|
if (result && result.status >= 0) {
|
|
|
message/* default */.ZP.success(result.message);
|
|
|
setEditStatus(false);
|
|
|
} else {
|
|
|
message/* default */.ZP.error(result.message);
|
|
|
}
|
|
|
setLoadingStatus(false);
|
|
|
})["catch"](function (e) {
|
|
|
setLoadingStatus(false);
|
|
|
console.log(e);
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mb25 flex_center",
|
|
|
children: [!isEdit && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [editBrief ? editBrief : brief ? brief : "这家伙很懒,什么都没留下~", is_current_user && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml15",
|
|
|
onClick: function onClick() {
|
|
|
return setEditStatus(true);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(EditOutlined/* default */.Z, {})
|
|
|
})]
|
|
|
}), isEdit && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "inline",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u4E2A\u4EBA\u7B80\u4ECB",
|
|
|
defaultValue: brief,
|
|
|
onChange: function onChange(e) {
|
|
|
return changeInput(e);
|
|
|
},
|
|
|
maxLength: 20
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
size: "small",
|
|
|
loading: isLoading,
|
|
|
className: "mt8 t4",
|
|
|
onClick: function onClick() {
|
|
|
return edit_brief();
|
|
|
},
|
|
|
children: "\u63D0\u4EA4"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "default",
|
|
|
size: "small",
|
|
|
onClick: function onClick() {
|
|
|
return setEditStatus(false);
|
|
|
},
|
|
|
className: "ml15 mt8 t4",
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var UserBrief = (user_brief);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/HeadUser/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/HeadUser/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import StarUser from "./StarUser";
|
|
|
|
|
|
|
|
|
|
|
|
function head_user(_ref) {
|
|
|
var UserInfo = _ref.UserInfo;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
fansCount = _useState2[0],
|
|
|
setFansCount = _useState2[1];
|
|
|
var fans_count = function fans_count(count) {
|
|
|
var new_fans_count = UserInfo.fans_count + count;
|
|
|
setFansCount(new_fans_count);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "pr",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "educontent clearfix edu-txt-center pt80",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "divInline",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: " headTab fl",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u7C89\u4E1D"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "javascript:void(0)",
|
|
|
children: fansCount <= 0 ? UserInfo && UserInfo.fans_count : fansCount
|
|
|
})]
|
|
|
}), UserInfo && /*#__PURE__*/(0,jsx_runtime.jsx)(UserAvatar, {
|
|
|
avatar: UserInfo.image_url,
|
|
|
user_id: UserInfo.user_id,
|
|
|
is_current_user: UserInfo.is_current_user,
|
|
|
login: UserInfo.login
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "headTab fr",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5173\u6CE8"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "javascript:void(0)",
|
|
|
children: UserInfo && UserInfo.stars_count
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "showName",
|
|
|
children: UserInfo && UserInfo.username
|
|
|
})]
|
|
|
})
|
|
|
}), UserInfo && /*#__PURE__*/(0,jsx_runtime.jsx)(UserIdentify, {
|
|
|
user_info: UserInfo
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt15 educontent clearfix edu-txt-center",
|
|
|
children: UserInfo && /*#__PURE__*/(0,jsx_runtime.jsx)(UserBrief, {
|
|
|
brief: UserInfo.brief,
|
|
|
login: UserInfo.login,
|
|
|
is_current_user: UserInfo.is_current_user
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var HeadUser = (head_user);
|
|
|
// 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/menu/index.js + 11 modules
|
|
|
var menu = __webpack_require__(20834);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(80184);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Menu/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Menu/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function user_menu(_ref) {
|
|
|
var is_current_user = _ref.is_current_user,
|
|
|
login = _ref.login,
|
|
|
props = _ref.props;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)("memos"),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
defaultMenu = _useState2[0],
|
|
|
setDefaultMenu = _useState2[1];
|
|
|
var handleClick = function handleClick(e) {
|
|
|
setDefaultMenu(e.key);
|
|
|
_umi_production_exports.history.push("/forums/accounts/".concat(login, "/").concat(e.key));
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var location_path = window.location.pathname.split("/");
|
|
|
var current_path = location_path[location_path.length - 1];
|
|
|
if (location_path.length > 3 && current_path) {
|
|
|
setDefaultMenu(current_path);
|
|
|
} else {
|
|
|
setDefaultMenu("memos");
|
|
|
}
|
|
|
}, [props.location]);
|
|
|
var show_name = is_current_user ? "我" : "TA";
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt15 educontent clearfix edu-txt-center user-menu",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z, {
|
|
|
onClick: function onClick(e) {
|
|
|
return handleClick(e);
|
|
|
},
|
|
|
selectedKeys: defaultMenu,
|
|
|
mode: "horizontal",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
children: [show_name, "\u7684\u5E16\u5B50"]
|
|
|
}, "memos"), /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
children: [show_name, "\u7684\u56DE\u5E16"]
|
|
|
}, "replies"), is_current_user && /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
children: [show_name, "\u7684\u8DB3\u8FF9"]
|
|
|
}, "histories"), is_current_user && /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
children: [show_name, "\u7684\u6536\u85CF"]
|
|
|
}, "stars"), is_current_user && /*#__PURE__*/(0,jsx_runtime.jsxs)(menu/* default */.Z.Item, {
|
|
|
children: [show_name, "\u611F\u5174\u8DA3\u7684\u8BBA\u575B"]
|
|
|
}, "interesting")]
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var Menu = (user_menu);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Account/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Account/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Account = function Account(_ref) {
|
|
|
var props = Object.assign({}, (objectDestructuringEmpty_default()(_ref), _ref));
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
UserInfo = _useState2[0],
|
|
|
setUserInfo = _useState2[1]; //用户的内容
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isSpin = _useState4[0],
|
|
|
setSpin = _useState4[1]; //用户的内容
|
|
|
var param = (0,_umi_production_exports.useParams)();
|
|
|
var user_login = param.login;
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
function init(_x) {
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
function _init() {
|
|
|
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(login) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setSpin(true);
|
|
|
(0,forums/* getUserInfo */.bG)(login).then(function (result) {
|
|
|
if (result) {
|
|
|
setUserInfo(result.user);
|
|
|
}
|
|
|
setSpin(false);
|
|
|
})["catch"](function (e) {
|
|
|
setSpin(false);
|
|
|
console.log(e);
|
|
|
});
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
if (user_login) {
|
|
|
init(user_login);
|
|
|
}
|
|
|
}, []);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
spinning: isSpin,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mainUser",
|
|
|
style: {
|
|
|
height: UserInfo && UserInfo.is_current_user ? "336px" : "400px"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "headImage"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "headCon",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(HeadUser, {
|
|
|
UserInfo: UserInfo
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Menu, {
|
|
|
is_current_user: UserInfo && UserInfo.is_current_user,
|
|
|
login: UserInfo && UserInfo.login,
|
|
|
props: props
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var User_Account = (Account);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/empty/index.js + 3 modules
|
|
|
var empty = __webpack_require__(64165);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
|
|
|
var pagination = __webpack_require__(58421);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/cascader/index.js + 18 modules
|
|
|
var cascader = __webpack_require__(19842);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/date-picker/index.js + 66 modules
|
|
|
var date_picker = __webpack_require__(5083);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/select_title.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/SelectTitle.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SectionOptions = [{
|
|
|
title: "待审查的话题",
|
|
|
id: "hidden"
|
|
|
}, {
|
|
|
title: "已发布的话题",
|
|
|
id: "show"
|
|
|
}];
|
|
|
var InputSize = "large";
|
|
|
function select_title(_ref) {
|
|
|
var section_params = _ref.section_params,
|
|
|
select_memos = _ref.select_memos;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isLoading = _useState2[0],
|
|
|
setLoadingType = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
forumSections = _useState4[0],
|
|
|
setSectionsType = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
sectionParams = _useState6[0],
|
|
|
setSectionParams = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
selectedOptions = _useState8[0],
|
|
|
setSelectedOptions = _useState8[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
function init() {
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
function _init() {
|
|
|
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setLoadingType(true);
|
|
|
(0,forums/* getSelectSections */.Lw)().then(function (result) {
|
|
|
if (result) {
|
|
|
setSectionsType(result);
|
|
|
}
|
|
|
setLoadingType(false);
|
|
|
})["catch"](function (e) {
|
|
|
setLoadingType(false);
|
|
|
console.log(e);
|
|
|
});
|
|
|
case 2:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
init();
|
|
|
}, []);
|
|
|
function onChange(value, selectedOptions) {
|
|
|
if (value.length > 0) {
|
|
|
var new_section_params = objectSpread2_default()(objectSpread2_default()({}, sectionParams), {}, {
|
|
|
forum_section_id: value[value.length - 1]
|
|
|
});
|
|
|
setSectionParams(new_section_params);
|
|
|
select_memos(new_section_params);
|
|
|
} else {
|
|
|
setSectionParams([]);
|
|
|
select_memos([]);
|
|
|
}
|
|
|
}
|
|
|
function isHiddenChange(value, selectedOptions) {
|
|
|
var new_section_params = objectSpread2_default()(objectSpread2_default()({}, sectionParams), {}, {
|
|
|
is_hidden: value[0]
|
|
|
});
|
|
|
setSectionParams(new_section_params);
|
|
|
select_memos(new_section_params);
|
|
|
}
|
|
|
function selectBeginTime(date, dateString) {
|
|
|
setSectionParams(objectSpread2_default()(objectSpread2_default()({}, sectionParams), {}, {
|
|
|
start_time: dateString
|
|
|
}));
|
|
|
}
|
|
|
function selectEndTime(date, dateString) {
|
|
|
setSectionParams(objectSpread2_default()(objectSpread2_default()({}, sectionParams), {}, {
|
|
|
end_time: dateString
|
|
|
}));
|
|
|
}
|
|
|
function SectionSearch() {
|
|
|
select_memos(sectionParams);
|
|
|
}
|
|
|
function filter(inputValue, path) {
|
|
|
return path.some(function (option) {
|
|
|
return option.title.toLowerCase().indexOf(inputValue.toLowerCase()) > -1;
|
|
|
});
|
|
|
}
|
|
|
function handleDeleteFilter(visible) {
|
|
|
if (!visible) {
|
|
|
setSectionParams([]); // 重置筛选条件为空对象
|
|
|
select_memos([]); // 获取全部数据
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "selectSection enUFLZ",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "gridItem2",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr15 d-inline-block section-cascader",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(cascader/* default */.Z, {
|
|
|
fieldNames: {
|
|
|
label: "title",
|
|
|
value: "id",
|
|
|
children: "childrens"
|
|
|
},
|
|
|
changeOnSelect: true,
|
|
|
options: forumSections,
|
|
|
onChange: onChange,
|
|
|
placeholder: "\u9009\u62E9\u7248\u5757",
|
|
|
showSearch: {
|
|
|
filter: filter
|
|
|
},
|
|
|
size: InputSize
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "d-inline-block section-cascader",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(cascader/* default */.Z, {
|
|
|
fieldNames: {
|
|
|
label: "title",
|
|
|
value: "id"
|
|
|
},
|
|
|
options: SectionOptions,
|
|
|
onChange: isHiddenChange,
|
|
|
placeholder: "\u9009\u62E9\u8BDD\u9898",
|
|
|
size: InputSize
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "text-right",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr15",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
|
onChange: selectBeginTime,
|
|
|
placeholder: "\u5F00\u59CB\u65E5\u671F",
|
|
|
size: InputSize
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr15",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(date_picker["default"], {
|
|
|
onChange: selectEndTime,
|
|
|
placeholder: "\u7ED3\u675F\u65E5\u671F",
|
|
|
size: InputSize
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "success",
|
|
|
className: "success-button",
|
|
|
onClick: SectionSearch,
|
|
|
children: "\u641C\u7D22"
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var SelectTitle = (select_title);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/menos.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/Forums/Index/components/ListItem/index.tsx + 1 modules
|
|
|
var ListItem = __webpack_require__(1491);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/replies.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/Forums/Index/components/Drop/index.tsx + 1 modules
|
|
|
var Drop = __webpack_require__(47073);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-router-dom@6.3.0@react-router-dom/index.js
|
|
|
var _react_router_dom_6_3_0_react_router_dom = __webpack_require__(32451);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(13277);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/Replies.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function replies_memos(_ref) {
|
|
|
var memos = _ref.memos;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
memoList = _useState2[0],
|
|
|
setMemoList = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isSpin = _useState4[0],
|
|
|
setSpinType = _useState4[1];
|
|
|
var initMemoList = function initMemoList() {
|
|
|
var memoList = memos.map(function (item) {
|
|
|
var memoItem = objectSpread2_default()({}, item);
|
|
|
return memoItem;
|
|
|
});
|
|
|
return memoList;
|
|
|
};
|
|
|
var handleToggleCollection = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(id) {
|
|
|
var updatedMemos;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!(0,authority/* isLogin */.bg)()) {
|
|
|
_context.next = 7;
|
|
|
break;
|
|
|
}
|
|
|
setSpinType(true);
|
|
|
updatedMemos = memoList.map(function (item) {
|
|
|
if (item.id === id) {
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
|
memo_watched: !item.memo_watched
|
|
|
});
|
|
|
} else {
|
|
|
return item;
|
|
|
}
|
|
|
});
|
|
|
setMemoList(updatedMemos);
|
|
|
_context.next = 6;
|
|
|
return new Promise(function (resolve) {
|
|
|
return setTimeout(resolve, 1000);
|
|
|
});
|
|
|
case 6:
|
|
|
setSpinType(false);
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleToggleCollection(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setMemoList(initMemoList());
|
|
|
}, [memos]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
spinning: isSpin,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
|
|
|
className: "forumList",
|
|
|
children: memoList.map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flexAJ",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "alignCenter",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "color-gray-8",
|
|
|
children: "\u8BC4\u8BBA\u6587\u7AE0\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(_react_router_dom_6_3_0_react_router_dom/* Link */.rU, {
|
|
|
to: "/forums/".concat(item.id),
|
|
|
className: "grey-3 task-hide",
|
|
|
style: {
|
|
|
maxWidth: "700px"
|
|
|
},
|
|
|
children: item.subject
|
|
|
})]
|
|
|
}), (0,authority/* isLogin */.bg)() ? /*#__PURE__*/(0,jsx_runtime.jsx)(Drop/* default */.Z, {
|
|
|
permission: objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
|
login: true
|
|
|
}),
|
|
|
id: item.id,
|
|
|
calbackFunc: function calbackFunc() {
|
|
|
return handleToggleCollection(item.id);
|
|
|
}
|
|
|
}) : '']
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flexAJ mt8",
|
|
|
children: [item && item.new_reply && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
width: "1024px"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
lineHeight: "28px"
|
|
|
},
|
|
|
children: item.new_reply.content
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt8 color-gray-8 font-12",
|
|
|
children: item.new_reply.published_time
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(_react_router_dom_6_3_0_react_router_dom/* Link */.rU, {
|
|
|
to: "/forums/".concat(item.id),
|
|
|
className: "reply-link",
|
|
|
children: "\u67E5\u770B"
|
|
|
})]
|
|
|
})]
|
|
|
}, key);
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var Replies = (replies_memos);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/Memos.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function memos(props) {
|
|
|
var param = (0,_umi_production_exports.useParams)();
|
|
|
var user_login = param.login;
|
|
|
var localtion = (0,_umi_production_exports.useLocation)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
is_current_uesr = _useState2[0],
|
|
|
setIsCurrentUser = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
memos = _useState4[0],
|
|
|
getMemos = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
memosSize = _useState6[0],
|
|
|
setMemosSize = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
page = _useState8[0],
|
|
|
setListPage = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
memo_type = _useState10[0],
|
|
|
setMemoType = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(15),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
limit = _useState12[0],
|
|
|
setLimitType = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
isSpin = _useState14[0],
|
|
|
setSpinType = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(null),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
common_select = _useState16[0],
|
|
|
setCommonSelect = _useState16[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var memos_type = window.location.pathname.split("/");
|
|
|
setMemoType(memos_type.pop());
|
|
|
}, [localtion]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (memo_type) {
|
|
|
init();
|
|
|
}
|
|
|
}, [memo_type, common_select, page]);
|
|
|
function init() {
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
function _init() {
|
|
|
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var params;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setSpinType(true);
|
|
|
params = objectSpread2_default()(objectSpread2_default()({
|
|
|
user_login: user_login
|
|
|
}, common_select), {}, {
|
|
|
limit: limit,
|
|
|
memo_type: memo_type,
|
|
|
page: page
|
|
|
});
|
|
|
(0,forums/* getMyMemos */.VD)(params).then(function (result) {
|
|
|
if (result) {
|
|
|
getMemos(result.memos);
|
|
|
setMemosSize(result.memos_count);
|
|
|
setIsCurrentUser(result.is_current_user);
|
|
|
}
|
|
|
setSpinType(false);
|
|
|
})["catch"](function (e) {
|
|
|
setSpinType(false);
|
|
|
console.log(e);
|
|
|
});
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
function select_memos(target_params) {
|
|
|
setCommonSelect(target_params);
|
|
|
}
|
|
|
var handleChangePage = function handleChangePage(page) {
|
|
|
setListPage(page);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [is_current_uesr && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SelectTitle, {
|
|
|
select_memos: select_memos
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "color-grey font-12 mt15",
|
|
|
children: ["\u5171", memosSize, "\u4E2A\u5E16\u5B50"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "selectSection",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
spinning: isSpin,
|
|
|
children: memos && memos.length > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: memo_type === "replies" ? /*#__PURE__*/(0,jsx_runtime.jsx)(Replies, {
|
|
|
memos: memos
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(ListItem/* default */.Z, {
|
|
|
memos: memos,
|
|
|
calbackFunc: init,
|
|
|
confirm: props.confirm,
|
|
|
current_user: props.current_user
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(empty/* default */.Z, {
|
|
|
image: empty/* default */.Z.PRESENTED_IMAGE_SIMPLE,
|
|
|
className: "pd100"
|
|
|
})
|
|
|
})
|
|
|
}), memosSize > limit && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "pagenationDiv",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
showQuickJumper: true,
|
|
|
current: page,
|
|
|
onChange: handleChangePage,
|
|
|
total: memosSize,
|
|
|
pageSize: limit
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var Memos = (memos);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
|
var col = __webpack_require__(43604);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/card/index.js + 4 modules
|
|
|
var card = __webpack_require__(18889);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/sectionItem.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/SectionItem.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function section_item(_ref) {
|
|
|
var forum_section = _ref.forum_section,
|
|
|
key = _ref.key;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isStar = _useState2[0],
|
|
|
setIsStar = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isLoading = _useState4[0],
|
|
|
setIsLoading = _useState4[1];
|
|
|
function rendomColor() {
|
|
|
var r_a = Math.floor(Math.random() * 255);
|
|
|
var r_g = Math.floor(Math.random() * 255);
|
|
|
var r_b = Math.floor(Math.random() * 255);
|
|
|
var radom_color = "rgba(" + r_a + "," + r_g + "," + r_b + ",0.8)";
|
|
|
return radom_color;
|
|
|
}
|
|
|
function handleClick() {
|
|
|
setIsLoading(true);
|
|
|
var params = {
|
|
|
id: forum_section.id,
|
|
|
is_watch: isStar ? 0 : 1
|
|
|
};
|
|
|
(0,forums/* forumSectionIsWatch */.aR)(params).then(function (result) {
|
|
|
if (result.status === 0) {
|
|
|
message/* default */.ZP.success(result.message);
|
|
|
setIsStar(!isStar);
|
|
|
} else {
|
|
|
message/* default */.ZP.error(result.message);
|
|
|
}
|
|
|
setIsLoading(false);
|
|
|
})["catch"](function (e) {
|
|
|
setIsLoading(false);
|
|
|
console.log(e);
|
|
|
});
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
span: 6,
|
|
|
className: "project-card-item forum-section-card",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(card/* default */.Z, {
|
|
|
bordered: false,
|
|
|
hoverable: true,
|
|
|
actions: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "link",
|
|
|
size: "small",
|
|
|
onClick: function onClick() {
|
|
|
return handleClick();
|
|
|
},
|
|
|
loading: isLoading,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "color-grey",
|
|
|
children: isStar ? "取消收藏" : "收藏"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "link",
|
|
|
size: "small",
|
|
|
href: "/forums/subject/".concat(forum_section.id),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "color-green",
|
|
|
children: "\u67E5\u770B"
|
|
|
})
|
|
|
})],
|
|
|
bodyStyle: {
|
|
|
background: rendomColor()
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "intresting-forum-section",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "font-20 color-white",
|
|
|
children: forum_section.title
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt10 color-white",
|
|
|
children: [forum_section.memos_count, "\u4E2A\u8BDD\u9898"]
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
}, key);
|
|
|
}
|
|
|
/* harmony default export */ var SectionItem = (section_item);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/sections.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/Memo/Sections.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sections(props) {
|
|
|
var param = (0,_umi_production_exports.useParams)();
|
|
|
var user_login = param.login;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
isSpin = _useState2[0],
|
|
|
setSpinType = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
forum_sections = _useState4[0],
|
|
|
getSections = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
page = _useState6[0],
|
|
|
setListPage = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(32),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
limit = _useState8[0],
|
|
|
setLimitType = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
sectionsSize = _useState10[0],
|
|
|
setSectinsSize = _useState10[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
function init() {
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
function _init() {
|
|
|
_init = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var params;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setSpinType(true);
|
|
|
params = {
|
|
|
user_login: user_login,
|
|
|
limit: limit,
|
|
|
page: page
|
|
|
};
|
|
|
(0,forums/* getMyInterested */.Fz)(params).then(function (result) {
|
|
|
if (result) {
|
|
|
getSections(result.forum_details);
|
|
|
setSectinsSize(result.count);
|
|
|
}
|
|
|
setSpinType(false);
|
|
|
})["catch"](function (e) {
|
|
|
setSpinType(false);
|
|
|
console.log(e);
|
|
|
});
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _init.apply(this, arguments);
|
|
|
}
|
|
|
init();
|
|
|
}, [page]);
|
|
|
var handleChangePage = function handleChangePage(page) {
|
|
|
setListPage(page);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "mt15",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
spinning: isSpin,
|
|
|
children: forum_sections && forum_sections.length > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
gutter: 20,
|
|
|
children: forum_sections.map(function (item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(SectionItem, {
|
|
|
forum_section: item
|
|
|
}, key);
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(empty/* default */.Z, {
|
|
|
image: empty/* default */.Z.PRESENTED_IMAGE_SIMPLE,
|
|
|
className: "pd100"
|
|
|
})
|
|
|
}), sectionsSize > limit && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "pagenationDiv",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
|
showQuickJumper: true,
|
|
|
current: page,
|
|
|
onChange: handleChangePage,
|
|
|
total: sectionsSize,
|
|
|
pageSize: limit
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var Sections = (sections);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/User/index.tsx
|
|
|
|
|
|
|
|
|
// import Loadable from "react-loadable";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import '../forums/css/All.scss';
|
|
|
// import '../forums/css/Index.css';
|
|
|
|
|
|
// const Projects = Loadable({
|
|
|
// loader: () => import("./User/Projects"),
|
|
|
// loading: Loading,
|
|
|
// });
|
|
|
|
|
|
// const Memos = Loadable({
|
|
|
// loader: () => import("./Memo/Memos"),
|
|
|
// loading: Loading,
|
|
|
// });
|
|
|
|
|
|
// const Sections = Loadable({
|
|
|
// loader: () => import("./Memo/Sections"),
|
|
|
// loading: Loading,
|
|
|
// });
|
|
|
|
|
|
// const Blocks = Loadable({
|
|
|
// loader: () => import("./User/BlockUsers"),
|
|
|
// loading: Loading,
|
|
|
// });
|
|
|
|
|
|
|
|
|
function Index(props) {
|
|
|
// const history = props.history;
|
|
|
// useEffect(() => {
|
|
|
// history.listen(() => {
|
|
|
// if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
|
|
|
// window.scrollTo(0, 0)
|
|
|
// }
|
|
|
// })
|
|
|
// }, [history])
|
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
|
|
|
window.scrollTo(0, 0);
|
|
|
}
|
|
|
}, []);
|
|
|
var param = (0,_umi_production_exports.useParams)();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "newMain",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(User_Account, objectSpread2_default()({}, props)), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mainContent",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "minH400",
|
|
|
children: param.key == "interesting" ? /*#__PURE__*/(0,jsx_runtime.jsx)(Sections, objectSpread2_default()({}, props)) : /*#__PURE__*/(0,jsx_runtime.jsx)(Memos, objectSpread2_default()({}, props))
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
/* harmony default export */ var User = (Index);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |