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.
896 lines
47 KiB
896 lines
47 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[508],{
|
|
|
|
/***/ 35027:
|
|
/*!************************************************************!*\
|
|
!*** ./src/components/image-preview/index.tsx + 1 modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ image_preview; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
var mediator = __webpack_require__(88675);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/image/index.js + 26 modules
|
|
var es_image = __webpack_require__(13879);
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.tsx
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var image_preview = (() => {
|
|
const [url, setUrl] = (0,_react_17_0_2_react.useState)("");
|
|
const [deg, setDeg] = (0,_react_17_0_2_react.useState)(0);
|
|
let [width, setwidth] = (0,_react_17_0_2_react.useState)();
|
|
let [height, setheight] = (0,_react_17_0_2_react.useState)();
|
|
const [down, setdown] = (0,_react_17_0_2_react.useState)(false);
|
|
const saveUrl = (0,_react_17_0_2_react.useRef)("");
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
const unSub = mediator/* default */.Z.subscribe("preview-image", (value) => {
|
|
setUrl(value);
|
|
console.log(imgref.current);
|
|
document.body.style.overflow = "hidden";
|
|
});
|
|
return unSub;
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
document.addEventListener("keydown", onViewEscClose);
|
|
return () => {
|
|
document.removeEventListener("keydown", onViewEscClose);
|
|
};
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
saveUrl.current = url;
|
|
}, [url]);
|
|
function onViewEscClose(e) {
|
|
if (e.keyCode == 27 && saveUrl.current) {
|
|
onClose();
|
|
}
|
|
}
|
|
function onClose() {
|
|
document.body.style.overflow = "auto";
|
|
setwidth(void 0);
|
|
setheight(void 0);
|
|
setDeg(0);
|
|
setUrl("");
|
|
}
|
|
function onRotate() {
|
|
setDeg(deg + 90);
|
|
}
|
|
function big() {
|
|
width = imgref.current.width * 1.1;
|
|
height = imgref.current.height * 1.1;
|
|
setheight(height);
|
|
setwidth(width);
|
|
}
|
|
function small() {
|
|
width = imgref.current.width / 1.1;
|
|
height = imgref.current.height / 1.1;
|
|
setheight(height);
|
|
setwidth(width);
|
|
}
|
|
const maskRef = (0,_react_17_0_2_react.useRef)();
|
|
const previewWrapperRef = (0,_react_17_0_2_react.useRef)();
|
|
const imgref = (0,_react_17_0_2_react.useRef)();
|
|
const handleMaskClick = (e) => {
|
|
if (e.nativeEvent.target === maskRef.current || e.nativeEvent.target === previewWrapperRef.current) {
|
|
onClose();
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, !url ? null : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
null,
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "preview-wrp-group", ref: previewWrapperRef }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_image/* default */.Z,
|
|
{
|
|
className: "image-preview",
|
|
src: url,
|
|
style: { display: "none" },
|
|
preview: {
|
|
visible: true,
|
|
src: url,
|
|
movable: false,
|
|
onVisibleChange: (value) => {
|
|
setUrl("");
|
|
}
|
|
},
|
|
alt: "\u9884\u89C8\u5927\u56FE"
|
|
}
|
|
))
|
|
));
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 94116:
|
|
/*!******************************************************!*\
|
|
!*** ./src/pages/Forums/Detail/[id].tsx + 8 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 */ _id_; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
var _umi_production_exports = __webpack_require__(67866);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(21873);
|
|
// 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/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/components/Right/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Rightmodules = ({"wrap":"wrap___oiJRJ","head":"head___zCLJu","recommendItem":"recommendItem___Z46_0","buttonWrap":"buttonWrap___Gol4S","privateMessage":"privateMessage___UCiuy","flex1":"flex1___FVk7y","mWidth147":"mWidth147___f_pcl"});
|
|
// EXTERNAL MODULE: ./src/service/forums.ts
|
|
var forums = __webpack_require__(34985);
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/components/Right/index.tsx
|
|
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));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && __getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
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 Right = (_a) => {
|
|
var _b = _a, {
|
|
user,
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading,
|
|
dispatch
|
|
} = _b, props = __objRest(_b, [
|
|
"user",
|
|
"forumsDetail",
|
|
"globalSetting",
|
|
"loading",
|
|
"dispatch"
|
|
]);
|
|
var _a2, _b2, _c, _d;
|
|
const { author_info, memo, recommend_shixuns } = forumsDetail.forumsDetailData || {};
|
|
const handleFollow = () => __async(void 0, null, function* () {
|
|
const res = (author_info == null ? void 0 : author_info.watched) ? yield (0,forums/* cancelWatch */.Sr)({ user_id: author_info.user_id }) : yield (0,forums/* watch */.YP)({ user_id: author_info.user_id });
|
|
if (res) {
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: __spreadProps(__spreadValues({}, forumsDetail.forumsDetailData), { author_info: __spreadProps(__spreadValues({}, author_info), { watched: !(author_info == null ? void 0 : author_info.watched) }) })
|
|
});
|
|
}
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: Rightmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: "ml20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `bg-white pt40 pb40 pl20 pr20 ${Rightmodules.head}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/users/${author_info == null ? void 0 : author_info.login}`, target: "_blank" }, (author_info == null ? void 0 : author_info.image_url) && /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: `${env/* default */.Z.API_SERVER}/images/${author_info == null ? void 0 : author_info.image_url}` })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc font20" }, author_info == null ? void 0 : author_info.username), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc c-grey-999" }, author_info == null ? void 0 : author_info.identity), ((_a2 = user.userInfo) == null ? void 0 : _a2.user_id) !== (author_info == null ? void 0 : author_info.user_id) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "center", className: `mt30 ${Rightmodules.buttonWrap}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { type: "primary", className: "mr10", onClick: handleFollow }, (author_info == null ? void 0 : author_info.watched) ? "\u53D6\u6D88\u5173\u6CE8" : "\u5173\u6CE8")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
className: Rightmodules.privateMessage,
|
|
href: `/messages/${(_b2 = user.userInfo) == null ? void 0 : _b2.login}/message_detail?target_ids=${author_info == null ? void 0 : author_info.user_id}`,
|
|
target: "_blank"
|
|
},
|
|
"\u79C1\u4FE1"
|
|
)))), !!((_c = memo == null ? void 0 : memo.tag) == null ? void 0 : _c.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "bg-white mt10 pt40 pb40 pl20 pr20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font16" }, "\u8BDD\u9898\u6807\u7B7E"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt10 ${Rightmodules.tag}` }, (_d = memo == null ? void 0 : memo.tag) == null ? void 0 : _d.map((item, i) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", { key: i, className: "c-light-primary mr10" }, item);
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "pt10 pb10 pl10 pr10" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font16 mb20" }, "\u63A8\u8350\u5B9E\u8BAD"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.recommend }, recommend_shixuns == null ? void 0 : recommend_shixuns.map((item) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Rightmodules.recommendItem }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/shixuns/${item.identifier}/challenges`, target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { alt: item.id, src: `${item.image_url}` })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Rightmodules.flex1} ml10` }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"a",
|
|
{
|
|
href: `/shixuns/${item.identifier}/challenges`,
|
|
target: "_blank",
|
|
title: item.name,
|
|
className: `${Rightmodules.mWidth147} multi-llipsis1e c-grey-666 mb10`
|
|
},
|
|
item.name
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-999" }, item.myshixuns_count, " \u4EBA\u5B66\u4E60")));
|
|
})))));
|
|
};
|
|
/* harmony default export */ var components_Right = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
forumsDetail,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
user,
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading: loading.models.forumsDetail
|
|
})
|
|
)(Right));
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.11@dayjs/dayjs.min.js
|
|
var dayjs_min = __webpack_require__(99232);
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
var RenderHtml = __webpack_require__(16921);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(98135);
|
|
// 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/breadcrumb/index.js + 6 modules
|
|
var breadcrumb = __webpack_require__(66104);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules
|
|
var dropdown = __webpack_require__(38854);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 15 modules
|
|
var markdown_editor = __webpack_require__(96180);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/DeleteOutlined.js + 1 modules
|
|
var DeleteOutlined = __webpack_require__(20360);
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/components/Comment/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Commentmodules = ({"flex_box_center":"flex_box_center___nMc3G","flex_space_between":"flex_space_between___gTlaF","flex_box_vertical_center":"flex_box_vertical_center___GQv6O","flex_box_center_end":"flex_box_center_end___nrFEP","flex_box_column":"flex_box_column___Ls1oQ","reply":"reply___jb23w","replyList":"replyList___ryiUt","comment":"comment___QJ1eT","content":"content___X2UnY","commentItem":"commentItem___h_wnY"});
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/components/Comment/components/Second.tsx
|
|
var Second_defProp = Object.defineProperty;
|
|
var Second_defProps = Object.defineProperties;
|
|
var Second_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Second_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Second_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Second_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Second_defNormalProp = (obj, key, value) => key in obj ? Second_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Second_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Second_hasOwnProp.call(b, prop))
|
|
Second_defNormalProp(a, prop, b[prop]);
|
|
if (Second_getOwnPropSymbols)
|
|
for (var prop of Second_getOwnPropSymbols(b)) {
|
|
if (Second_propIsEnum.call(b, prop))
|
|
Second_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Second_spreadProps = (a, b) => Second_defProps(a, Second_getOwnPropDescs(b));
|
|
var Second_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());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dayjs_min_default().locale("ZH-cn");
|
|
function second({ user, vlist = [], dispatch, params, id, memo_replies, forumsDetail }) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: Commentmodules.comment }, vlist.map(function(val, key) {
|
|
var _a, _b;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { key, className: Commentmodules.commentItem }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24 }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/users/${val.user_login}`, target: "_blank", className: "c-light-black" }, val == null ? void 0 : val.username), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-black ml10" }, val.time)), (val.can_delete || val.user_id === ((_a = user.userInfo) == null ? void 0 : _a.user_id) || val.user_login === ((_b = user.userInfo) == null ? void 0 : _b.login)) && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "forums-comment-delete", style: { display: "none" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
DeleteOutlined/* default */.Z,
|
|
{
|
|
className: "current",
|
|
onClick: () => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
width: 530,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font16 tc" }, "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"),
|
|
onOk: () => Second_async(this, null, function* () {
|
|
const res = yield (0,forums/* deleteForums */.sW)({ id: val.id });
|
|
const filterData = memo_replies.find((x) => x.id === id).children.filter((y) => y.id !== val.id);
|
|
memo_replies.find((x) => x.id === id).children = filterData;
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Second_spreadProps(Second_spreadValues({}, forumsDetail.forumsDetailData), { memo_replies: [...memo_replies] })
|
|
});
|
|
})
|
|
});
|
|
}
|
|
}
|
|
))))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: val.content })));
|
|
}));
|
|
}
|
|
/* harmony default export */ var Second = (second);
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(13462);
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/components/Comment/index.tsx
|
|
var Comment_defProp = Object.defineProperty;
|
|
var Comment_defProps = Object.defineProperties;
|
|
var Comment_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Comment_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Comment_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Comment_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Comment_defNormalProp = (obj, key, value) => key in obj ? Comment_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Comment_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Comment_hasOwnProp.call(b, prop))
|
|
Comment_defNormalProp(a, prop, b[prop]);
|
|
if (Comment_getOwnPropSymbols)
|
|
for (var prop of Comment_getOwnPropSymbols(b)) {
|
|
if (Comment_propIsEnum.call(b, prop))
|
|
Comment_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Comment_spreadProps = (a, b) => Comment_defProps(a, Comment_getOwnPropDescs(b));
|
|
var Comment_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (Comment_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && Comment_getOwnPropSymbols)
|
|
for (var prop of Comment_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && Comment_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var Comment_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());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dayjs_min_default().locale("ZH-cn");
|
|
const Comment = (_a, ref) => {
|
|
var _b = _a, {
|
|
user,
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading,
|
|
dispatch,
|
|
handleClick
|
|
} = _b, props = Comment_objRest(_b, [
|
|
"user",
|
|
"forumsDetail",
|
|
"globalSetting",
|
|
"loading",
|
|
"dispatch",
|
|
"handleClick"
|
|
]);
|
|
const { memo, memo_replies } = forumsDetail.forumsDetailData || {};
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const [value, setValue] = (0,_react_17_0_2_react.useState)("");
|
|
const [childValue, setChildValue] = (0,_react_17_0_2_react.useState)("");
|
|
const [showItemReply, setShowItemReply] = (0,_react_17_0_2_react.useState)(-1);
|
|
const [hasMore, setHasMore] = (0,_react_17_0_2_react.useState)(false);
|
|
const [page, setPage] = (0,_react_17_0_2_react.useState)(1);
|
|
const [isMdFouch, setIsMdFouch] = (0,_react_17_0_2_react.useState)(false);
|
|
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
|
onMdFouch: handleMdFouch
|
|
}));
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
setHasMore((memo == null ? void 0 : memo.replies_count) > 10);
|
|
}, [memo == null ? void 0 : memo.replies_count]);
|
|
const handeGetMoreData = () => Comment_async(void 0, null, function* () {
|
|
var _a2;
|
|
const currentPage = page + 1;
|
|
setPage(currentPage);
|
|
const res = yield (0,forums/* getMoreReply */.z5)({ id: params.memoId, page: currentPage });
|
|
if (res == null ? void 0 : res.memo_replies) {
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Comment_spreadProps(Comment_spreadValues({}, forumsDetail.forumsDetailData), { memo_replies: [...memo_replies, ...res.memo_replies] })
|
|
});
|
|
setHasMore(((_a2 = res.memo_replies) == null ? void 0 : _a2.length) === 10);
|
|
}
|
|
});
|
|
const formatReplieData = (data) => {
|
|
var _a2, _b2, _c, _d;
|
|
return Comment_spreadProps(Comment_spreadValues({}, data), { image_url: (_a2 = user.userInfo) == null ? void 0 : _a2.image_url, children: [], user_id: (_b2 = user.userInfo) == null ? void 0 : _b2.user_id, user_login: (_c = user.userInfo) == null ? void 0 : _c.login, username: (_d = user.userInfo) == null ? void 0 : _d.username, time: `${(0,util/* toTimeFormat */.li)(((/* @__PURE__ */ new Date()).getTime() - new Date(data.created_at).getTime()) / 1e3)}\u524D` });
|
|
};
|
|
const handleMdFouch = () => {
|
|
setIsMdFouch(true);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: Commentmodules.wrap }, !!(memo_replies == null ? void 0 : memo_replies.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: Commentmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { padding: "10px 15px 5px 15px", justifyContent: "space-between", display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5168\u90E8\u56DE\u590D\uFF08", memo.replies_count, "\uFF09")), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: Commentmodules.replyList }, memo_replies == null ? void 0 : memo_replies.map(function(v, k) {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { gutter: [12, 12], key: k }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "40px" }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/users/${v.user_login}`, target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { alt: "\u7528\u6237\u5934\u50CF", width: "50", height: "50", src: `${env/* default */.Z.IMG_SERVER}/images/${v == null ? void 0 : v.image_url}` }))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24 }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: `/users/${v.user_login}`, target: "_blank" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-black" }, v == null ? void 0 : v.username)), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-black ml10" }, v.time)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24 }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: handleClick }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: v.content }))), !!((_a2 = v == null ? void 0 : v.children) == null ? void 0 : _a2.length) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
Second,
|
|
{
|
|
user,
|
|
id: v == null ? void 0 : v.id,
|
|
vlist: v == null ? void 0 : v.children,
|
|
dispatch,
|
|
params,
|
|
memo_replies,
|
|
forumsDetail
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24, className: "mt5 c-light-black" }, showItemReply === k ? /* @__PURE__ */ _react_17_0_2_react.createElement("aside", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
onChange: (v2) => {
|
|
setChildValue(v2);
|
|
},
|
|
height: 150,
|
|
isFocus: true,
|
|
placeholder: "\u6211\u8981\u56DE\u590D..."
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 24, className: "tr" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
size: "middle",
|
|
onClick: () => Comment_async(this, null, function* () {
|
|
if (childValue === "") {
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u5185\u5BB9");
|
|
} else {
|
|
const res = yield (0,forums/* reply */.ts)({ parent_id: v.id, content: childValue });
|
|
setChildValue(null);
|
|
if (res) {
|
|
setShowItemReply(-1);
|
|
memo_replies.find((x) => x.id === res.parent_id).children.push(formatReplieData(res));
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Comment_spreadProps(Comment_spreadValues({}, forumsDetail.forumsDetailData), {
|
|
memo: Comment_spreadProps(Comment_spreadValues({}, memo), { replies_count: memo.replies_count + 1 }),
|
|
memo_replies: [...memo_replies]
|
|
})
|
|
});
|
|
}
|
|
}
|
|
})
|
|
},
|
|
"\u53D1\u9001"
|
|
)))) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tr" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "iconfont icon-huifu1 mr15 ml30 current", onClick: () => setShowItemReply(k) }), /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: v.user_praise ? "\u53D6\u6D88\u70B9\u8D5E" : "\u70B9\u8D5E" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: v.user_praise ? "c-orange" : "c-gery-888" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: "iconfont icon-dianzan mr3 current",
|
|
onClick: () => Comment_async(this, null, function* () {
|
|
const res = yield (0,forums/* like */.vL)({ id: v.id, container_type: "Memo", type: v.user_praise ? 0 : 1 });
|
|
if ((res == null ? void 0 : res.praise_count) >= 0) {
|
|
memo_replies.find((x) => x.id === v.id).user_praise = !v.user_praise;
|
|
memo_replies.find((x) => x.id === v.id).praise_count = res == null ? void 0 : res.praise_count;
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Comment_spreadProps(Comment_spreadValues({}, forumsDetail.forumsDetailData), { memo_replies: [...memo_replies] })
|
|
});
|
|
}
|
|
})
|
|
}
|
|
), v.praise_count > 0 ? v.praise_count : "")))))));
|
|
}))), hasMore && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: "bg-white pb20", style: { display: "flex", justifyContent: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, hasMore && /* @__PURE__ */ _react_17_0_2_react.createElement("a", { className: "c-black", onClick: handeGetMoreData }, "\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA")))), /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: Commentmodules.reply }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
onBlur: () => setIsMdFouch(false),
|
|
isFocus: isMdFouch,
|
|
defaultValue: value,
|
|
id: "writeForumsReviewId",
|
|
onChange: (v) => {
|
|
setValue(v);
|
|
},
|
|
placeholder: "\u6211\u8981\u56DE\u590D...",
|
|
height: 240
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
type: "primary",
|
|
size: "middle",
|
|
onClick: () => Comment_async(void 0, null, function* () {
|
|
if (value === "") {
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u5185\u5BB9");
|
|
} else {
|
|
const res = yield (0,forums/* reply */.ts)({ parent_id: memo.id, content: value });
|
|
setValue(null);
|
|
if (res) {
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Comment_spreadProps(Comment_spreadValues({}, forumsDetail.forumsDetailData), {
|
|
memo: Comment_spreadProps(Comment_spreadValues({}, memo), { replies_count: memo.replies_count + 1 }),
|
|
memo_replies: [formatReplieData(res), ...memo_replies]
|
|
})
|
|
});
|
|
}
|
|
}
|
|
})
|
|
},
|
|
"\u53D1\u9001"
|
|
)))));
|
|
};
|
|
/* harmony default export */ var components_Comment = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
forumsDetail,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
user,
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading: loading.models.forumsDetail
|
|
}),
|
|
null,
|
|
null,
|
|
{ forwardRef: true }
|
|
)((0,_react_17_0_2_react.forwardRef)(Comment)));
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/components/Content/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Contentmodules = ({"wrap":"wrap___Soi3l","header":"header___vk3EC","title":"title___WJAyR","menu":"menu___yMPKF","top":"top___ZqzEM","line":"line___EQKlG","flexCenter":"flexCenter___Rcnhr","like":"like___uNtmq","canLike":"canLike___Lu04z","attachmentName":"attachmentName___nwdzp"});
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.7@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
var ExclamationCircleOutlined = __webpack_require__(88289);
|
|
// EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules
|
|
var image_preview = __webpack_require__(35027);
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
var mediator = __webpack_require__(88675);
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/components/Content/index.tsx
|
|
var Content_defProp = Object.defineProperty;
|
|
var Content_defProps = Object.defineProperties;
|
|
var Content_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var Content_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var Content_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var Content_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var Content_defNormalProp = (obj, key, value) => key in obj ? Content_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var Content_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (Content_hasOwnProp.call(b, prop))
|
|
Content_defNormalProp(a, prop, b[prop]);
|
|
if (Content_getOwnPropSymbols)
|
|
for (var prop of Content_getOwnPropSymbols(b)) {
|
|
if (Content_propIsEnum.call(b, prop))
|
|
Content_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var Content_spreadProps = (a, b) => Content_defProps(a, Content_getOwnPropDescs(b));
|
|
var Content_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (Content_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && Content_getOwnPropSymbols)
|
|
for (var prop of Content_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && Content_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var Content_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 typeMapping = {
|
|
5: "\u6280\u672F\u5206\u4EAB",
|
|
3: "\u64CD\u4F5C\u6307\u5357",
|
|
16: "\u901A\u77E5\u516C\u544A"
|
|
};
|
|
const Content = (_a) => {
|
|
var _b = _a, {
|
|
user,
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading,
|
|
dispatch
|
|
} = _b, props = Content_objRest(_b, [
|
|
"user",
|
|
"forumsDetail",
|
|
"globalSetting",
|
|
"loading",
|
|
"dispatch"
|
|
]);
|
|
var _a2, _b2, _c, _d, _e;
|
|
const { author_info, memo, attachments_list } = forumsDetail.forumsDetailData || {};
|
|
const rewardRef = (0,_react_17_0_2_react.useRef)();
|
|
const commentRef = (0,_react_17_0_2_react.useRef)();
|
|
const handleTop = () => Content_async(void 0, null, function* () {
|
|
const query = {
|
|
id: memo.id,
|
|
sticky: memo.sticky ? 0 : 1
|
|
};
|
|
const res = yield (0,forums/* stickyOrCancel */.B0)(query);
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Content_spreadProps(Content_spreadValues({}, forumsDetail.forumsDetailData), { memo: Content_spreadProps(Content_spreadValues({}, memo), { sticky: !(memo == null ? void 0 : memo.sticky) }) })
|
|
});
|
|
}
|
|
});
|
|
const handleDelete = () => Content_async(void 0, null, function* () {
|
|
const res = yield (0,forums/* deleteForums */.sW)({ id: memo == null ? void 0 : memo.id });
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
message/* default */.ZP.success("\u5220\u9664\u6210\u529F");
|
|
_umi_production_exports.history.push("/forums");
|
|
}
|
|
if ((res == null ? void 0 : res.status) === -1) {
|
|
_umi_production_exports.history.push("/forums");
|
|
}
|
|
});
|
|
const handleReward = () => Content_async(void 0, null, function* () {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
width: 530,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u5956\u52B1\u8BBE\u7F6E",
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font14 tc" }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { defaultValue: rewardRef.current, onChange: (e) => rewardRef.current = e.target.value })),
|
|
onOk: () => Content_async(void 0, null, function* () {
|
|
const res = yield (0,forums/* rewardCode */.eh)({
|
|
id: memo == null ? void 0 : memo.id,
|
|
container_type: "Memo",
|
|
score: rewardRef.current ? Number(rewardRef.current) : 0,
|
|
user_id: author_info == null ? void 0 : author_info.user_id
|
|
});
|
|
rewardRef.current = null;
|
|
if ((res == null ? void 0 : res.code) > 0) {
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Content_spreadProps(Content_spreadValues({}, forumsDetail.forumsDetailData), { memo: Content_spreadProps(Content_spreadValues({}, memo), { reward: res == null ? void 0 : res.code }) })
|
|
});
|
|
message/* default */.ZP.success("\u5956\u52B1\u6210\u529F");
|
|
return;
|
|
}
|
|
message/* default */.ZP.success("\u5956\u52B1\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01");
|
|
})
|
|
});
|
|
});
|
|
const handleJumpToComment = () => {
|
|
commentRef.current.onMdFouch && commentRef.current.onMdFouch();
|
|
};
|
|
const handleLike = () => Content_async(void 0, null, function* () {
|
|
const res = yield (0,forums/* like */.vL)({ id: memo.id, container_type: "Memo", type: 1 });
|
|
if ((res == null ? void 0 : res.praise_count) >= 0) {
|
|
dispatch({
|
|
type: "forumsDetail/setForumsDetailData",
|
|
payload: Content_spreadProps(Content_spreadValues({}, forumsDetail.forumsDetailData), { memo: Content_spreadProps(Content_spreadValues({}, memo), { user_praise: !(memo == null ? void 0 : memo.user_praise), memo_praise_count: res == null ? void 0 : res.praise_count }) })
|
|
});
|
|
}
|
|
});
|
|
const menu = /* @__PURE__ */ _react_17_0_2_react.createElement(es_menu["default"], { className: Contentmodules.menu }, ((_a2 = user.userInfo) == null ? void 0 : _a2.admin) && (memo == null ? void 0 : memo.sticky) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_menu["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: () => handleTop() }, "\u53D6\u6D88\u7F6E\u9876")), ((_b2 = user.userInfo) == null ? void 0 : _b2.admin) && !(memo == null ? void 0 : memo.sticky) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_menu["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: () => handleTop() }, "\u7F6E\xA0\xA0\u9876")), /* @__PURE__ */ _react_17_0_2_react.createElement(es_menu["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { to: `/forums/${memo == null ? void 0 : memo.id}/edit` }, "\u7F16\xA0\xA0\u8F91")), /* @__PURE__ */ _react_17_0_2_react.createElement(es_menu["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { onClick: () => {
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
icon: /* @__PURE__ */ _react_17_0_2_react.createElement(ExclamationCircleOutlined/* default */.Z, null),
|
|
content: "\u5E16\u5B50\u5C06\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",
|
|
okText: "\u786E\u8BA4",
|
|
onOk: () => {
|
|
handleDelete();
|
|
},
|
|
cancelText: "\u53D6\u6D88"
|
|
});
|
|
} }, "\u5220\xA0\xA0\u9664")));
|
|
const handleClick = (e) => {
|
|
let { nodeName, src } = e.target;
|
|
if (nodeName === "IMG") {
|
|
mediator/* default */.Z.publish("preview-image", src);
|
|
console.log("src:", src);
|
|
}
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
}, []);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: Contentmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z, { separator: "/", className: "mb5" }, /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z.Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
_umi_production_exports.Link,
|
|
{
|
|
to: `/forums/categories/${memo == null ? void 0 : memo.forum_id}`
|
|
},
|
|
typeMapping[memo == null ? void 0 : memo.forum_id]
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(breadcrumb/* default */.Z.Item, null, "\u8BE6\u60C5")), /* @__PURE__ */ _react_17_0_2_react.createElement("header", { className: `bg-white pt40 pb40 pl30 pr30 ${Contentmodules.header}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: "font24 mb5" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Contentmodules.title }, memo == null ? void 0 : memo.subject), (memo == null ? void 0 : memo.sticky) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Contentmodules.top }, "\u7F6E\u9876"), !!(memo == null ? void 0 : memo.reward) && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "bottom", title: `\u83B7\u5F97\u5E73\u53F0\u5956\u52B1\u91D1\u5E01\uFF1A${memo == null ? void 0 : memo.reward}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10 c-orange-ff7" }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-gift font16 mr5" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14" }, memo == null ? void 0 : memo.reward)))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, (((_c = user.userInfo) == null ? void 0 : _c.admin) || ((_d = user.userInfo) == null ? void 0 : _d.user_id) === (author_info == null ? void 0 : author_info.user_id)) && /* @__PURE__ */ _react_17_0_2_react.createElement(dropdown/* default */.Z, { dropdownRender: () => menu }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "fa fa-bars font-16 current c-grey-bcb" })))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: "font14" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: "c-grey-999" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, dayjs_min_default()(memo == null ? void 0 : memo.time).fromNow(), " \u66F4\u65B0")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "c-grey-999" }, ((_e = user.userInfo) == null ? void 0 : _e.admin) && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "bottom", title: `\u5E16\u5B50\u5956\u52B1` }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `current pr10 ${Contentmodules.line}`, onClick: handleReward }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-jiangli font18 mr5" }))), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `pr10 pl10 ${!!(memo == null ? void 0 : memo.replies_count) ? Contentmodules.line : ""}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-liulanyan font18 mr5" }), memo == null ? void 0 : memo.viewed_count), !!(memo == null ? void 0 : memo.replies_count) && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { placement: "bottom", title: `\u5199\u8BC4\u8BBA` }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "current pl10", onClick: handleJumpToComment }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-huifu1 font18 mr5" }), memo == null ? void 0 : memo.replies_count))))), /* @__PURE__ */ _react_17_0_2_react.createElement("main", { className: "bg-white pt40 pb40 pl40 pr40" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: handleClick }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: memo == null ? void 0 : memo.content })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "bg-white pl40 pr40 mt40" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt10 mb20 ${Contentmodules.flexCenter}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Contentmodules.like} ${(memo == null ? void 0 : memo.user_praise) ? "" : Contentmodules.canLike}`, onClick: handleLike }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-dianzan font18" }), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, memo == null ? void 0 : memo.memo_praise_count)))), !!(attachments_list == null ? void 0 : attachments_list.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt40" }, attachments_list == null ? void 0 : attachments_list.map((item) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `c-grey-888 ${Contentmodules.flexCenter}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-fujian mr10 font14 c-green-29b" }), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: item == null ? void 0 : item.url, title: item == null ? void 0 : item.title, className: `${Contentmodules.attachmentName} mr10` }, item == null ? void 0 : item.title), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font12 c-grey-666 mt3" }, item == null ? void 0 : item.filesize));
|
|
}))), /* @__PURE__ */ _react_17_0_2_react.createElement(components_Comment, { ref: commentRef, handleClick }), /* @__PURE__ */ _react_17_0_2_react.createElement(image_preview/* default */.Z, null));
|
|
};
|
|
/* harmony default export */ var components_Content = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
forumsDetail,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
user,
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading: loading.effects
|
|
})
|
|
)(Content));
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Detailmodules = ({"flex":"flex___fgmSn"});
|
|
;// CONCATENATED MODULE: ./src/pages/Forums/Detail/[id].tsx
|
|
var _id_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var _id_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var _id_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var _id_objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (_id_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && _id_getOwnPropSymbols)
|
|
for (var prop of _id_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && _id_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var _id_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 ForumsDetailPage = (_a) => {
|
|
var _b = _a, {
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading,
|
|
dispatch
|
|
} = _b, props = _id_objRest(_b, [
|
|
"forumsDetail",
|
|
"globalSetting",
|
|
"loading",
|
|
"dispatch"
|
|
]);
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
handleGetData();
|
|
}, [params.memoId]);
|
|
const handleGetData = () => _id_async(void 0, null, function* () {
|
|
dispatch({
|
|
type: "forumsDetail/getForumsDetailData",
|
|
payload: { id: params.memoId }
|
|
});
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: `edu-container mb20 mt30 ${Detailmodules.flex}` }, /* @__PURE__ */ _react_17_0_2_react.createElement(components_Content, null), /* @__PURE__ */ _react_17_0_2_react.createElement(components_Right, null));
|
|
};
|
|
/* harmony default export */ var _id_ = ((0,_umi_production_exports.connect)(
|
|
({
|
|
forumsDetail,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
forumsDetail,
|
|
globalSetting,
|
|
loading: loading.models.forumsDetail
|
|
})
|
|
)(ForumsDetailPage));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |