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.
2374 lines
99 KiB
2374 lines
99 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[32925],{
|
|
|
|
/***/ 7523:
|
|
/*!*************************************!*\
|
|
!*** ./src/pages/tasks/constant.js ***!
|
|
\*************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "$Y": function() { return /* binding */ SET_EDITOR_THEME; },
|
|
/* harmony export */ "A0": function() { return /* binding */ HIDE_EVALUATE_LOADING; },
|
|
/* harmony export */ "EP": function() { return /* binding */ HIDE_EVALUATE_RESULT; },
|
|
/* harmony export */ "F_": function() { return /* binding */ MOVE_X; },
|
|
/* harmony export */ "G9": function() { return /* binding */ UPDATE_TIMESTRAP; },
|
|
/* harmony export */ "GB": function() { return /* binding */ FETCH_REP_CONTENT; },
|
|
/* harmony export */ "GR": function() { return /* binding */ GET_DISCUSSES; },
|
|
/* harmony export */ "GW": function() { return /* binding */ SET_SHOW_DIR; },
|
|
/* harmony export */ "Hp": function() { return /* binding */ SHOW_TASK_LIST; },
|
|
/* harmony export */ "Ir": function() { return /* binding */ FETCH_TASK_FAILURE; },
|
|
/* harmony export */ "N$": function() { return /* binding */ EDIT_REP_CODE; },
|
|
/* harmony export */ "NZ": function() { return /* binding */ HIDE_TIP_MODAL; },
|
|
/* harmony export */ "Nv": function() { return /* binding */ HIDE_NOTICE; },
|
|
/* harmony export */ "OA": function() { return /* binding */ HIDE_PICTURE_VIEW; },
|
|
/* harmony export */ "OJ": function() { return /* binding */ SET_CHOOSE_ANSWERS; },
|
|
/* harmony export */ "QF": function() { return /* binding */ ON_AUTO_FORMAT; },
|
|
/* harmony export */ "RS": function() { return /* binding */ SHOW_REWARD_DIALOG; },
|
|
/* harmony export */ "RY": function() { return /* binding */ SET_VNC_LOADING; },
|
|
/* harmony export */ "Rj": function() { return /* binding */ SHOW_TIP_MODAL; },
|
|
/* harmony export */ "SX": function() { return /* binding */ ACTIVE_DISCUSS_INDEX; },
|
|
/* harmony export */ "Tp": function() { return /* binding */ SET_EDITOR_FONTSIZE; },
|
|
/* harmony export */ "Ui": function() { return /* binding */ SHOW_EVALUATE_LOADING; },
|
|
/* harmony export */ "V1": function() { return /* binding */ EVAL_CHOOSE_END; },
|
|
/* harmony export */ "Vn": function() { return /* binding */ SET_REWARD; },
|
|
/* harmony export */ "dL": function() { return /* binding */ SHOW_NOTICE; },
|
|
/* harmony export */ "fo": function() { return /* binding */ DISABLE_DISCUSS; },
|
|
/* harmony export */ "gK": function() { return /* binding */ TRIGGER_TAB_FIXED; },
|
|
/* harmony export */ "hK": function() { return /* binding */ HIDE_TASK_LIST; },
|
|
/* harmony export */ "i3": function() { return /* binding */ TRIGGER_RIGHT_PANEL_MASK; },
|
|
/* harmony export */ "ib": function() { return /* binding */ SET_TASK_STAR; },
|
|
/* harmony export */ "lS": function() { return /* binding */ TRIGGER_ENLARGE_UNITY3D; },
|
|
/* harmony export */ "m5": function() { return /* binding */ SHOW_EVALUATE_RESULT; },
|
|
/* harmony export */ "n4": function() { return /* binding */ FETCH_TASK_START; },
|
|
/* harmony export */ "n_": function() { return /* binding */ SET_ACTIVE_INDEX; },
|
|
/* harmony export */ "oP": function() { return /* binding */ SET_REPOS; },
|
|
/* harmony export */ "p2": function() { return /* binding */ SET_EVALUATE_MESSAGE; },
|
|
/* harmony export */ "pl": function() { return /* binding */ FETCH_ANSWER_INFO; },
|
|
/* harmony export */ "rM": function() { return /* binding */ PLUS_DISCUSS; },
|
|
/* harmony export */ "sM": function() { return /* binding */ GET_TASK_LIST; },
|
|
/* harmony export */ "t2": function() { return /* binding */ CANCEL_REWARD_DIALOG; },
|
|
/* harmony export */ "tD": function() { return /* binding */ SHOW_DISCUSSES_LOADING; },
|
|
/* harmony export */ "u8": function() { return /* binding */ TOP_OR_DOWN_DISCUSS; },
|
|
/* harmony export */ "um": function() { return /* binding */ ON_TAB_TO_SPACE; },
|
|
/* harmony export */ "vm": function() { return /* binding */ SHOW_PICTURE_VIEW; },
|
|
/* harmony export */ "wQ": function() { return /* binding */ MOVE_Y; },
|
|
/* harmony export */ "wj": function() { return /* binding */ EVAL_CHOOSE_START; },
|
|
/* harmony export */ "wt": function() { return /* binding */ SHOW_ANSWER_LOADING; },
|
|
/* harmony export */ "yS": function() { return /* binding */ SET_ACTION_TYPE; },
|
|
/* harmony export */ "yi": function() { return /* binding */ FETCH_TASK_SUCCESS; },
|
|
/* harmony export */ "ym": function() { return /* binding */ SELECT_UNLOCK_ANSWER; },
|
|
/* harmony export */ "z2": function() { return /* binding */ UPDATE_TASK_DATA; }
|
|
/* harmony export */ });
|
|
/* unused harmony exports CREATE_DISCUSS, SHOW_REP_LOADING, SET_REP_PATH, SET_EDITOR_SETTING, SHOW_PATH_LIST, HIDE_PATH_LIST, SET_TAB_INDEX, SET_SSH_TABS, SET_SSH_CONFIGDATA, SET_SSH_CONFIGDATAARR */
|
|
var FETCH_TASK_START = 'FETCH_TASK_START';
|
|
var FETCH_TASK_FAILURE = 'FETCH_TASK_FAILURE';
|
|
var FETCH_TASK_SUCCESS = 'FETCH_TASK_SUCCESS';
|
|
var UPDATE_TASK_DATA = 'UPDATE_TASK_DATA';
|
|
var HIDE_EVALUATE_RESULT = 'HIDE_EVALUATE_RESULT';
|
|
var SHOW_EVALUATE_RESULT = 'SHOW_EVALUATE_RESULT';
|
|
var UPDATE_TIMESTRAP = 'UPDATE_TIMESTRAP';
|
|
var MOVE_X = 'MOVE_X';
|
|
var MOVE_Y = 'MOVE_Y';
|
|
var TRIGGER_RIGHT_PANEL_MASK = 'TRIGGER_RIGHT_PANEL_MASK ';
|
|
|
|
//left_panel_action
|
|
var SET_ACTIVE_INDEX = 'SET_ACTIVE_INDEX';
|
|
var GET_TASK_LIST = 'GET_TASK_LIST';
|
|
var SHOW_TASK_LIST = 'SHOW_TASK_LIST';
|
|
var HIDE_TASK_LIST = 'HIDE_TASK_LIST';
|
|
var SET_TASK_STAR = 'SET_TASK_STAR';
|
|
var TRIGGER_ENLARGE_UNITY3D = 'TRIGGER_ENLARGE_UNITY3D ';
|
|
var TRIGGER_TAB_FIXED = 'TRIGGER_TAB_FIXED ';
|
|
|
|
//discuss action
|
|
var GET_DISCUSSES = 'GET_DISCUSSES';
|
|
var SHOW_DISCUSSES_LOADING = 'SHOW_DISCUSSES_LOADING';
|
|
var TOP_OR_DOWN_DISCUSS = 'TOP_OR_DOWN_DISCUSS';
|
|
var PLUS_DISCUSS = 'PLUS_DISCUSS';
|
|
var SET_ACTION_TYPE = 'SET_ACTION_TYPE';
|
|
var SHOW_REWARD_DIALOG = 'SHOW_REWARD_DIALOG';
|
|
var CANCEL_REWARD_DIALOG = 'CANCEL_REWARD_DIALOG';
|
|
var SET_REWARD = 'SET_REWARD';
|
|
var ACTIVE_DISCUSS_INDEX = 'ACTIVE_DISCUSS_INDEX';
|
|
var CREATE_DISCUSS = 'CREATE_DISCUSS';
|
|
var DISABLE_DISCUSS = 'DISABLE_DISCUSS';
|
|
|
|
//answer_panel_action
|
|
var SHOW_ANSWER_LOADING = 'SHOW_ANSWER_LOADING';
|
|
var FETCH_ANSWER_INFO = 'FETCH_ANSWER_INFO';
|
|
var HIDE_TIP_MODAL = 'HIGH_TIP_MODAL';
|
|
var SHOW_TIP_MODAL = 'SHOW_TIP_MODAL';
|
|
var SELECT_UNLOCK_ANSWER = 'SELECT_UNLOCK_ANSWER';
|
|
|
|
//choose_repository_action
|
|
var SET_CHOOSE_ANSWERS = 'SET_CHOOSE_ANSWERS';
|
|
var EVAL_CHOOSE_START = 'EVAL_CHOOSE_START';
|
|
var EVAL_CHOOSE_END = 'EVAL_CHOOSE_END';
|
|
|
|
//code_repository_action
|
|
var SHOW_REP_LOADING = 'SHOW_REP_loading';
|
|
var FETCH_REP_CONTENT = 'FETCH_REP_CONTENT';
|
|
var EDIT_REP_CODE = 'EDIT_REP_CONTENT';
|
|
var SET_REP_PATH = 'SET_REP_PATH';
|
|
var SHOW_EVALUATE_LOADING = 'SHOW_EVALUATE_LOADING';
|
|
var HIDE_EVALUATE_LOADING = 'HIDE_EVALUATE_LOADING';
|
|
var SET_EVALUATE_MESSAGE = 'SET_EVALUATE_MESSAGE';
|
|
var SET_SHOW_DIR = 'SET_SHOW_DIR';
|
|
var SET_EDITOR_SETTING = 'SET_EDITOR_SETTING';
|
|
var SET_EDITOR_THEME = 'SET_EDITOR_THEME';
|
|
var SET_EDITOR_FONTSIZE = 'SET_EDITOR_FONTSIZE';
|
|
var SET_REPOS = 'SET_REPOS';
|
|
var SHOW_PATH_LIST = 'SHOW_PATH_LIST';
|
|
var HIDE_PATH_LIST = 'HIDE_PATH_LIST';
|
|
var HIDE_PICTURE_VIEW = 'HIDE_PICTURE_VIEW';
|
|
var SHOW_PICTURE_VIEW = 'SHOW_PICTURE_VIEW';
|
|
var SHOW_NOTICE = 'SHOW_NOTICE';
|
|
var HIDE_NOTICE = 'HIDE_NOTICE';
|
|
var SET_TAB_INDEX = 'SET_TAB_INDEX';
|
|
var SET_SSH_TABS = 'SET_SSH_TABS';
|
|
var SET_SSH_CONFIGDATA = 'SET_SSH_CONFIGDATA';
|
|
var SET_SSH_CONFIGDATAARR = 'SET_SSH_CONFIGDATAARR';
|
|
var SET_VNC_LOADING = 'SET_VNC_LOADING ';
|
|
var ON_TAB_TO_SPACE = 'ON_TAB_TO_SPACE ';
|
|
var ON_AUTO_FORMAT = 'ON_AUTO_FORMAT ';
|
|
|
|
/***/ }),
|
|
|
|
/***/ 7387:
|
|
/*!*******************************************************!*\
|
|
!*** ./src/pages/tasks/left-panel/discuss/service.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "KQ": function() { return /* binding */ submitDiscusses; },
|
|
/* harmony export */ "KY": function() { return /* binding */ deleteDiscuss; },
|
|
/* harmony export */ "OY": function() { return /* binding */ hiddenDiscuss; },
|
|
/* harmony export */ "S8": function() { return /* binding */ rewardDiscuss; },
|
|
/* harmony export */ "U_": function() { return /* binding */ aiReply; },
|
|
/* harmony export */ "_Z": function() { return /* binding */ disableDiscuss; },
|
|
/* harmony export */ "ae": function() { return /* binding */ plusDiscuss; },
|
|
/* harmony export */ "o7": function() { return /* binding */ fetchDiscusses; },
|
|
/* harmony export */ "rd": function() { return /* binding */ createDiscuss; },
|
|
/* harmony export */ "wJ": function() { return /* binding */ topOrDownDiscuss; },
|
|
/* harmony export */ "wg": function() { return /* binding */ replyDiscuss; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/fetch */ 84519);
|
|
|
|
|
|
function fetchDiscusses(shixunIdentifier) {
|
|
var page = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .get */ .U2)("/discusses.json", {
|
|
container_type: "Shixun",
|
|
container_identifier: shixunIdentifier,
|
|
page: page - 1
|
|
});
|
|
}
|
|
function topOrDownDiscuss(id, top) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/".concat(id, "/top_or_down_discuss.json"), {
|
|
top: top
|
|
});
|
|
}
|
|
function disableDiscuss(id, is_disable) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/".concat(id, "/disable_or_open_discuss.json"), {
|
|
is_disable: !!is_disable
|
|
});
|
|
}
|
|
function plusDiscuss(id, user_praise) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/".concat(id, "/plus.json"), {
|
|
container_type: 'Discuss',
|
|
type: user_praise ? 1 : 0
|
|
});
|
|
}
|
|
function hiddenDiscuss(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/".concat(id, "/hidden.json"), params);
|
|
}
|
|
function rewardDiscuss(id, params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/".concat(id, "/reward_code.json"), params);
|
|
}
|
|
function deleteDiscuss(id) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP)("/api/discusses/".concat(id, ".json"), {
|
|
method: 'delete'
|
|
});
|
|
}
|
|
function replyDiscuss(id, content) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/".concat(id, "/reply.json"), {
|
|
container_type: 'Shixun',
|
|
content: content
|
|
});
|
|
}
|
|
function createDiscuss(params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses.json", params);
|
|
}
|
|
function aiReply(params) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/ai_reply.json", params);
|
|
}
|
|
function submitDiscusses(id, content) {
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_0__/* .post */ .v_)("/discusses/".concat(id, "/turing.json"), content);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 82982:
|
|
/*!*****************************************!*\
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
\*****************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var antd_es_button_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/button/style */ 29913);
|
|
/* harmony import */ var antd_es_button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd/es/button */ 71577);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 4977);
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var noData = function noData(_ref) {
|
|
var _ref$buttonProps = _ref.buttonProps,
|
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
_ref$styles = _ref.styles,
|
|
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
|
customText = _ref.customText,
|
|
ButtonText = _ref.ButtonText,
|
|
ButtonClick = _ref.ButtonClick,
|
|
Buttonclass = _ref.Buttonclass,
|
|
ButtonTwo = _ref.ButtonTwo,
|
|
imgStyles = _ref.imgStyles;
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("section", {
|
|
className: "tc animated fadeIn",
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
color: '#999',
|
|
margin: '200px auto'
|
|
}), styles),
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
|
src: _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_3__,
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({}, imgStyles)
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
|
className: "mt20 font14",
|
|
children: customText || '暂时还没有相关数据哦!'
|
|
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(antd_es_button__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
className: Buttonclass,
|
|
onClick: ButtonClick
|
|
}, buttonProps), {}, {
|
|
children: ButtonText
|
|
})), ButtonTwo && ButtonTwo]
|
|
});
|
|
};
|
|
/* harmony default export */ __webpack_exports__["Z"] = (noData);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 38054:
|
|
/*!******************************************************!*\
|
|
!*** ./src/components/Spinner/index.tsx + 1 modules ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ Spinner; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
;// CONCATENATED MODULE: ./src/components/Spinner/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Spinnermodules = ({"ldsRing":"ldsRing___mpBZC","idsRingWrapper":"idsRingWrapper___Of9_n","ldsring":"ldsring___o0w2t"});
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/components/Spinner/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var Spinner = (function (_ref) {
|
|
var message = _ref.message,
|
|
className = _ref.className,
|
|
children = _ref.children,
|
|
_ref$style = _ref.style,
|
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "".concat(Spinnermodules.idsRingWrapper, " ").concat(className),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: Spinnermodules.ldsRing,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {})]
|
|
}), message ? /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
style: style,
|
|
children: message
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {})]
|
|
});
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 75490:
|
|
/*!************************************************************!*\
|
|
!*** ./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/antd/es/button/style/index.js + 1 modules
|
|
var style = __webpack_require__(29913);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
var mediator = __webpack_require__(91562);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ReloadOutlined.js + 1 modules
|
|
var ReloadOutlined = __webpack_require__(33160);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/DownloadOutlined.js
|
|
var DownloadOutlined = __webpack_require__(69753);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/CloseOutlined.js
|
|
var CloseOutlined = __webpack_require__(28508);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/components/image-preview/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var image_preview = (function () {
|
|
var _useState = (0,react.useState)(''),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
url = _useState2[0],
|
|
setUrl = _useState2[1];
|
|
var _useState3 = (0,react.useState)(0),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
deg = _useState4[0],
|
|
setDeg = _useState4[1];
|
|
var saveUrl = (0,react.useRef)('');
|
|
(0,react.useEffect)(function () {
|
|
var unSub = mediator/* default.subscribe */.Z.subscribe('preview-image', function (value) {
|
|
setUrl(value);
|
|
// window.document.body
|
|
// document.body.style.height='100%'
|
|
document.body.style.overflow = 'hidden';
|
|
});
|
|
return unSub;
|
|
}, []);
|
|
(0,react.useEffect)(function () {
|
|
document.addEventListener('keydown', onViewEscClose);
|
|
return function () {
|
|
document.removeEventListener('keydown', onViewEscClose);
|
|
};
|
|
}, []);
|
|
(0,react.useEffect)(function () {
|
|
saveUrl.current = url;
|
|
}, [url]);
|
|
function onViewEscClose(e) {
|
|
if (e.keyCode == 27 && saveUrl.current) {
|
|
onClose();
|
|
}
|
|
}
|
|
|
|
// https://data.educoder.net/api/attachments/1571649
|
|
function onClose() {
|
|
// document.body.style.height='100%'
|
|
document.body.style.overflow = 'auto';
|
|
setUrl('');
|
|
}
|
|
function onRotate() {
|
|
setDeg(deg + 90);
|
|
}
|
|
var maskRef = (0,react.useRef)();
|
|
var previewWrapperRef = (0,react.useRef)();
|
|
var handleMaskClick = function handleMaskClick(e) {
|
|
if (e.nativeEvent.target === maskRef.current || e.nativeEvent.target === previewWrapperRef.current) {
|
|
onClose();
|
|
}
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
|
|
children: !url ? null : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "image-preview-container",
|
|
ref: maskRef,
|
|
onClick: handleMaskClick,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "button-group",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
onClick: onRotate,
|
|
children: ["\u65CB\u8F6C", /*#__PURE__*/(0,jsx_runtime.jsx)(ReloadOutlined/* default */.Z, {})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
href: url,
|
|
children: ["\u4E0B\u8F7D", /*#__PURE__*/(0,jsx_runtime.jsx)(DownloadOutlined/* default */.Z, {})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
onClick: onClose,
|
|
children: ["\u5173\u95ED", /*#__PURE__*/(0,jsx_runtime.jsx)(CloseOutlined/* default */.Z, {})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "preview-wrp-group",
|
|
ref: previewWrapperRef,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
className: "image-preview",
|
|
src: url,
|
|
alt: "\u9884\u89C8\u5927\u56FE",
|
|
style: {
|
|
transform: "rotate(".concat(deg, "deg)")
|
|
}
|
|
})
|
|
})]
|
|
})
|
|
});
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 43486:
|
|
/*!*********************************************************************************!*\
|
|
!*** ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx + 1 modules ***!
|
|
\*********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ discuss_editor; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
|
|
var style = __webpack_require__(14934);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
|
|
var message = __webpack_require__(12461);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-editor/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
var markdown_editor = __webpack_require__(55373);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var discuss_editor = (function (_ref) {
|
|
var id = _ref.id,
|
|
activeDiscussIndex = _ref.activeDiscussIndex,
|
|
onReplyDiscuss = _ref.onReplyDiscuss;
|
|
var _useState = (0,react.useState)(''),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
value = _useState2[0],
|
|
setValue = _useState2[1];
|
|
function onChange(v) {
|
|
setValue(v);
|
|
}
|
|
function onCommit() {
|
|
if (!value) {
|
|
message/* default.info */.ZP.info('回复内容不能为空!');
|
|
return;
|
|
}
|
|
// console.log('--------','0');
|
|
|
|
// if(!getAuthentication()){
|
|
// Modal.confirm({
|
|
// title: '提示',
|
|
// centered: true,
|
|
// content: <div className="tc">您需要去完成您的职业认证,才能使用此功能</div>,
|
|
// okText: `立即完善`,
|
|
// cancelText: "稍后完善",
|
|
// onOk: () => {
|
|
// openNewWindow('/account/certification');
|
|
// }
|
|
// })
|
|
|
|
// }
|
|
// console.log('-------',getAuthentication());
|
|
|
|
onReplyDiscuss(id, value);
|
|
setValue('');
|
|
}
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "discuss-item-editor",
|
|
style: {
|
|
display: activeDiscussIndex === id ? 'block' : 'none',
|
|
width: '100%'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
miniToolbar: true,
|
|
startInit: activeDiscussIndex === id,
|
|
defaultValue: value,
|
|
id: id,
|
|
noStorage: true,
|
|
watch: false,
|
|
height: 155,
|
|
placeholder: "\u6211\u8981\u56DE\u590D",
|
|
showResizeBar: true,
|
|
onChange: onChange
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onCommit,
|
|
className: "btn-send",
|
|
children: "\u53D1\u9001"
|
|
})]
|
|
}, id);
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 32925:
|
|
/*!******************************************************************!*\
|
|
!*** ./src/pages/tasks/left-panel/discuss/index.jsx + 8 modules ***!
|
|
\******************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ discuss; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input-number/style/index.js + 1 modules
|
|
var style = __webpack_require__(25359);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input-number/index.js + 9 modules
|
|
var input_number = __webpack_require__(87799);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
|
|
var modal_style = __webpack_require__(35611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
|
|
var modal = __webpack_require__(85402);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/style/index.js + 1 modules
|
|
var pagination_style = __webpack_require__(14182);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/pagination/index.js + 10 modules
|
|
var pagination = __webpack_require__(260);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
|
|
var button_style = __webpack_require__(29913);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(17061);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(17156);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(27424);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(42122);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
// EXTERNAL MODULE: ./src/components/Spinner/index.tsx + 1 modules
|
|
var Spinner = __webpack_require__(38054);
|
|
// EXTERNAL MODULE: ./src/components/modal.tsx
|
|
var components_modal = __webpack_require__(12264);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(82982);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/style/index.js + 1 modules
|
|
var skeleton_style = __webpack_require__(61099);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/skeleton/index.js + 11 modules
|
|
var skeleton = __webpack_require__(73481);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
|
|
var row_style = __webpack_require__(13062);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
|
|
var row = __webpack_require__(71230);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/style/index.js
|
|
var col_style = __webpack_require__(89032);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/col/index.js
|
|
var col = __webpack_require__(15746);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/popover/style/index.js + 1 modules
|
|
var popover_style = __webpack_require__(63942);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/popover/index.js
|
|
var popover = __webpack_require__(55241);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js + 1 modules
|
|
var form_style = __webpack_require__(75627);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 17 modules
|
|
var es_form = __webpack_require__(51018);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
var _umi_production_exports = __webpack_require__(89214);
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
var mediator = __webpack_require__(91562);
|
|
// EXTERNAL MODULE: ./src/pages/tasks/left-panel/discuss/service.js
|
|
var service = __webpack_require__(7387);
|
|
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 31 modules
|
|
var ImagesIcon = __webpack_require__(44190);
|
|
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(85893);
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/components/AiAnswer.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Interest = function Interest(_ref) {
|
|
var pathsList = _ref.pathsList,
|
|
dispatch = _ref.dispatch;
|
|
var _Form$useForm = es_form/* default.useForm */.Z.useForm(),
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
form = _Form$useForm2[0];
|
|
var _useState = (0,react.useState)(),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
subjects = _useState2[0],
|
|
setSubjects = _useState2[1];
|
|
var _useState3 = (0,react.useState)(true),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
loading = _useState4[0],
|
|
setLoading = _useState4[1];
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
visible = _useState6[0],
|
|
setVisible = _useState6[1];
|
|
var _useState7 = (0,react.useState)({}),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
keyword = _useState8[0],
|
|
setKeyword = _useState8[1];
|
|
var _useState9 = (0,react.useState)({
|
|
keyword: keyword,
|
|
robot: true,
|
|
page: 1
|
|
}),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
query = _useState10[0],
|
|
setQuery = _useState10[1];
|
|
(0,react.useEffect)(function () {
|
|
// if (pathsList.actionTabs.key === '立即发布') {
|
|
// setIsShowStep1(true)
|
|
// } else {
|
|
// setIsShowStep1(false);
|
|
// }
|
|
mediator/* default.subscribe */.Z.subscribe('ai-replay-show', function (data) {
|
|
setKeyword(data);
|
|
setVisible(true);
|
|
});
|
|
}, []);
|
|
(0,react.useEffect)(function () {
|
|
if (keyword !== null && keyword !== void 0 && keyword.id) getData();
|
|
}, [keyword]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(nextPage) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
setLoading(true);
|
|
_context.next = 3;
|
|
return (0,service/* aiReply */.U_)(objectSpread2_default()(objectSpread2_default()({}, query), {}, {
|
|
keyword: keyword === null || keyword === void 0 ? void 0 : keyword.content,
|
|
id: keyword === null || keyword === void 0 ? void 0 : keyword.id
|
|
}));
|
|
case 3:
|
|
res = _context.sent;
|
|
setLoading(false);
|
|
if (res !== null && res !== void 0 && res.data) {
|
|
query.page++;
|
|
setQuery(objectSpread2_default()({}, query));
|
|
setSubjects(res === null || res === void 0 ? void 0 : res.data);
|
|
}
|
|
case 6:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleOk = /*#__PURE__*/function () {
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
getData();
|
|
case 1:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2);
|
|
}));
|
|
return function handleOk() {
|
|
return _ref3.apply(this, arguments);
|
|
};
|
|
}();
|
|
var content = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: ImagesIcon/* qrCodeIcon */.wC,
|
|
width: 150
|
|
})
|
|
});
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
title: '其他回答',
|
|
mask: true,
|
|
open: visible,
|
|
okText: "换一换",
|
|
cancelText: "",
|
|
onOk: handleOk,
|
|
width: 800,
|
|
height: 500,
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
align: "middle",
|
|
justify: "center",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
className: "tc",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
type: "primary",
|
|
onClick: getData,
|
|
children: "\u6362\u4E00\u6362"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(popover/* default */.Z, {
|
|
content: content,
|
|
title: "\u5934\u6B4C\u6559\u5E08\u4EA4\u6D41\u793E\u533A",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
type: "dashed",
|
|
children: "\u4EBA\u5DE5\u670D\u52A1"
|
|
})
|
|
})]
|
|
})
|
|
}),
|
|
onCancel: function onCancel() {
|
|
setVisible(false);
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
style: {
|
|
minHeight: 300
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
|
|
loading: loading,
|
|
children: [subjects === null || subjects === void 0 ? void 0 : subjects.map(function (item) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
style: {
|
|
background: "#e9f3f1",
|
|
padding: "8px 20px",
|
|
marginBottom: 10,
|
|
borderRadius: 20
|
|
},
|
|
span: 24,
|
|
children: item.text
|
|
});
|
|
}), !(subjects !== null && subjects !== void 0 && subjects.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
width: "100%",
|
|
textAlign: "center"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: ImagesIcon/* qrCodeIcon */.wC,
|
|
width: 150
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u5934\u6B4C\u6559\u5E08\u4EA4\u6D41\u793E\u533A"]
|
|
})]
|
|
})
|
|
})
|
|
})
|
|
})
|
|
});
|
|
};
|
|
/* harmony default export */ var AiAnswer = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
var pathsList = _ref4.pathsList;
|
|
return {
|
|
pathsList: pathsList
|
|
};
|
|
})(Interest));
|
|
// EXTERNAL MODULE: ./src/pages/tasks/constant.js
|
|
var constant = __webpack_require__(7523);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
|
|
var tooltip_style = __webpack_require__(38390);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(84908);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(59758);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
var RenderHtml = __webpack_require__(12768);
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-item/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
// EXTERNAL MODULE: ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx + 1 modules
|
|
var discuss_editor = __webpack_require__(43486);
|
|
// EXTERNAL MODULE: ./src/components/image-preview/index.tsx + 1 modules
|
|
var image_preview = __webpack_require__(75490);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(7);
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-item/image/appoint1.svg
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
return key in obj ? __defProp(obj, key, {
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true,
|
|
value: value
|
|
}) : obj[key] = value;
|
|
};
|
|
var __spreadValues = function __spreadValues(a, b) {
|
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols) {
|
|
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
_step;
|
|
try {
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
var prop = _step.value;
|
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
}
|
|
} catch (err) {
|
|
_iterator.e(err);
|
|
} finally {
|
|
_iterator.f();
|
|
}
|
|
}
|
|
return a;
|
|
};
|
|
|
|
var SvgAppoint1 = function SvgAppoint1(props) {
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
width: 10,
|
|
height: 9,
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u6EE1\u610F"), /* @__PURE__ */React.createElement("path", {
|
|
d: "M10 2.731H5.141V0h-1.96L1.675 2.643H0v6.18h7.865L10 2.732Zm-9.431.487h.836v5.03H.569v-5.03Zm8.626.088L7.463 8.249h-5.49V3.218h.031L3.511.575h1.062v2.73h4.622Z",
|
|
fill: "#000",
|
|
fillRule: "nonzero"
|
|
}));
|
|
};
|
|
|
|
/* harmony default export */ var appoint1 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTAgMi43MzFINS4xNDFWMGgtMS45NkwxLjY3NSAyLjY0M0gwdjYuMThoNy44NjVMMTAgMi43MzJabS05LjQzMS40ODdoLjgzNnY1LjAzSC41Njl2LTUuMDNabTguNjI2LjA4OEw3LjQ2MyA4LjI0OWgtNS40OVYzLjIxOGguMDMxTDMuNTExLjU3NWgxLjA2MnYyLjczaDQuNjIyWiIgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIi8+PC9zdmc+");
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-item/image/appoint2.svg
|
|
function appoint2_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = appoint2_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
function appoint2_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return appoint2_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return appoint2_arrayLikeToArray(o, minLen); }
|
|
function appoint2_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
var appoint2_defProp = Object.defineProperty;
|
|
var appoint2_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var appoint2_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var appoint2_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var appoint2_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
return key in obj ? appoint2_defProp(obj, key, {
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true,
|
|
value: value
|
|
}) : obj[key] = value;
|
|
};
|
|
var appoint2_spreadValues = function __spreadValues(a, b) {
|
|
for (var prop in b || (b = {})) if (appoint2_hasOwnProp.call(b, prop)) appoint2_defNormalProp(a, prop, b[prop]);
|
|
if (appoint2_getOwnPropSymbols) {
|
|
var _iterator = appoint2_createForOfIteratorHelper(appoint2_getOwnPropSymbols(b)),
|
|
_step;
|
|
try {
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
var prop = _step.value;
|
|
if (appoint2_propIsEnum.call(b, prop)) appoint2_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
} catch (err) {
|
|
_iterator.e(err);
|
|
} finally {
|
|
_iterator.f();
|
|
}
|
|
}
|
|
return a;
|
|
};
|
|
|
|
var SvgAppoint2 = function SvgAppoint2(props) {
|
|
return /* @__PURE__ */React.createElement("svg", appoint2_spreadValues({
|
|
width: 10,
|
|
height: 9,
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u6EE1\u610F"), /* @__PURE__ */React.createElement("path", {
|
|
d: "M10 2.731H5.141V0h-1.96L1.675 2.643H0v6.18h7.865L10 2.732Zm-9.431.487h.836v5.03H.569v-5.03Zm8.626.088L7.463 8.249h-5.49V3.218h.031L3.511.575h1.062v2.73h4.622Z",
|
|
fill: "#0152D9",
|
|
fillRule: "nonzero"
|
|
}));
|
|
};
|
|
|
|
/* harmony default export */ var appoint2 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTAgMi43MzFINS4xNDFWMGgtMS45NkwxLjY3NSAyLjY0M0gwdjYuMThoNy44NjVMMTAgMi43MzJabS05LjQzMS40ODdoLjgzNnY1LjAzSC41Njl2LTUuMDNabTguNjI2LjA4OEw3LjQ2MyA4LjI0OWgtNS40OVYzLjIxOGguMDMxTDMuNTExLjU3NWgxLjA2MnYyLjczaDQuNjIyWiIgZmlsbD0iIzAxNTJEOSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PC9zdmc+");
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-item/image/disappoint1.svg
|
|
function disappoint1_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = disappoint1_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
function disappoint1_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return disappoint1_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return disappoint1_arrayLikeToArray(o, minLen); }
|
|
function disappoint1_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
var disappoint1_defProp = Object.defineProperty;
|
|
var disappoint1_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var disappoint1_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var disappoint1_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var disappoint1_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
return key in obj ? disappoint1_defProp(obj, key, {
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true,
|
|
value: value
|
|
}) : obj[key] = value;
|
|
};
|
|
var disappoint1_spreadValues = function __spreadValues(a, b) {
|
|
for (var prop in b || (b = {})) if (disappoint1_hasOwnProp.call(b, prop)) disappoint1_defNormalProp(a, prop, b[prop]);
|
|
if (disappoint1_getOwnPropSymbols) {
|
|
var _iterator = disappoint1_createForOfIteratorHelper(disappoint1_getOwnPropSymbols(b)),
|
|
_step;
|
|
try {
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
var prop = _step.value;
|
|
if (disappoint1_propIsEnum.call(b, prop)) disappoint1_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
} catch (err) {
|
|
_iterator.e(err);
|
|
} finally {
|
|
_iterator.f();
|
|
}
|
|
}
|
|
return a;
|
|
};
|
|
|
|
var SvgDisappoint1 = function SvgDisappoint1(props) {
|
|
return /* @__PURE__ */React.createElement("svg", disappoint1_spreadValues({
|
|
width: 10,
|
|
height: 9,
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u4E0D\u6EE1\u610F"), /* @__PURE__ */React.createElement("path", {
|
|
d: "M7.865 0H0v6.18h1.675l1.506 2.644h1.96V6.092H10L7.865 0ZM.57.575h.836v5.03H.569V.576Zm4.003 4.943v2.73H3.51L2.004 5.607h-.03V.576h5.489l1.732 4.942H4.572Z",
|
|
fill: "#000",
|
|
fillRule: "nonzero"
|
|
}));
|
|
};
|
|
|
|
/* harmony default export */ var disappoint1 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNy44NjUgMEgwdjYuMThoMS42NzVsMS41MDYgMi42NDRoMS45NlY2LjA5MkgxMEw3Ljg2NSAwWk0uNTcuNTc1aC44MzZ2NS4wM0guNTY5Vi41NzZabTQuMDAzIDQuOTQzdjIuNzNIMy41MUwyLjAwNCA1LjYwN2gtLjAzVi41NzZoNS40ODlsMS43MzIgNC45NDJINC41NzJaIiBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-item/image/disappoint2.svg
|
|
function disappoint2_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = disappoint2_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
function disappoint2_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return disappoint2_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return disappoint2_arrayLikeToArray(o, minLen); }
|
|
function disappoint2_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
var disappoint2_defProp = Object.defineProperty;
|
|
var disappoint2_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var disappoint2_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var disappoint2_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var disappoint2_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
return key in obj ? disappoint2_defProp(obj, key, {
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true,
|
|
value: value
|
|
}) : obj[key] = value;
|
|
};
|
|
var disappoint2_spreadValues = function __spreadValues(a, b) {
|
|
for (var prop in b || (b = {})) if (disappoint2_hasOwnProp.call(b, prop)) disappoint2_defNormalProp(a, prop, b[prop]);
|
|
if (disappoint2_getOwnPropSymbols) {
|
|
var _iterator = disappoint2_createForOfIteratorHelper(disappoint2_getOwnPropSymbols(b)),
|
|
_step;
|
|
try {
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
var prop = _step.value;
|
|
if (disappoint2_propIsEnum.call(b, prop)) disappoint2_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
} catch (err) {
|
|
_iterator.e(err);
|
|
} finally {
|
|
_iterator.f();
|
|
}
|
|
}
|
|
return a;
|
|
};
|
|
|
|
var SvgDisappoint2 = function SvgDisappoint2(props) {
|
|
return /* @__PURE__ */React.createElement("svg", disappoint2_spreadValues({
|
|
width: 10,
|
|
height: 9,
|
|
xmlns: "http://www.w3.org/2000/svg"
|
|
}, props), /* @__PURE__ */React.createElement("title", null, "\u4E0D\u6EE1\u610F"), /* @__PURE__ */React.createElement("path", {
|
|
d: "M7.865 0H0v6.18h1.675l1.506 2.644h1.96V6.092H10L7.865 0ZM.57.575h.836v5.03H.569V.576Zm4.003 4.943v2.73H3.51L2.004 5.607h-.03V.576h5.489l1.732 4.942H4.572Z",
|
|
fill: "#0152D9",
|
|
fillRule: "nonzero"
|
|
}));
|
|
};
|
|
|
|
/* harmony default export */ var disappoint2 = ("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNy44NjUgMEgwdjYuMThoMS42NzVsMS41MDYgMi42NDRoMS45NlY2LjA5MkgxMEw3Ljg2NSAwWk0uNTcuNTc1aC44MzZ2NS4wM0guNTY5Vi41NzZabTQuMDAzIDQuOTQzdjIuNzNIMy41MUwyLjAwNCA1LjYwN2gtLjAzVi41NzZoNS40ODlsMS43MzIgNC45NDJINC41NzJaIiBmaWxsPSIjMDE1MkQ5IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=");
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/discuss-item/index.jsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import {isCommonSuperAdmin} from '@/utils/authority'
|
|
|
|
|
|
|
|
|
|
function SecondLevelDiscuss(_ref) {
|
|
var data = _ref.data,
|
|
index = _ref.index,
|
|
adminOrOperator = _ref.adminOrOperator,
|
|
parentDiscussIndex = _ref.parentDiscussIndex,
|
|
shixunIdentifier = _ref.shixunIdentifier,
|
|
user = _ref.user,
|
|
onSetRewardData = _ref.onSetRewardData,
|
|
onSetActionType = _ref.onSetActionType,
|
|
onHandleSubmitDiscusses = _ref.onHandleSubmitDiscusses,
|
|
onTopOrDownDiscuss = _ref.onTopOrDownDiscuss,
|
|
handleChildrenPlus = _ref.handleChildrenPlus,
|
|
anserAuthor = _ref.anserAuthor,
|
|
onPlus = _ref.onPlus,
|
|
onHandleRepaly = _ref.onHandleRepaly,
|
|
userInfomation = _ref.userInfomation;
|
|
var author = data.author,
|
|
can_delete = data.can_delete,
|
|
content = data.content,
|
|
hidden = data.hidden,
|
|
id = data.id,
|
|
reward = data.reward,
|
|
time = data.time,
|
|
reply_status = data.reply_status,
|
|
user_praise = data.user_praise,
|
|
praise_count = data.praise_count;
|
|
var _useState = (0,react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
isHover = _useState2[0],
|
|
setHover = _useState2[1];
|
|
var _useState3 = (0,react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
isHoverSecond = _useState4[0],
|
|
setHoverSecond = _useState4[1];
|
|
var _useState5 = (0,react.useState)(false),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
isHoverSatisfied = _useState6[0],
|
|
setHoverSatisfied = _useState6[1];
|
|
var _useState7 = (0,react.useState)(false),
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
isHoverDisSatisfied = _useState8[0],
|
|
setHoverDisSatisfied = _useState8[1];
|
|
var handleQuestions = function handleQuestions() {
|
|
if (!isHover) return;
|
|
onHandleSubmitDiscusses(id, {
|
|
reply_status: 2
|
|
});
|
|
};
|
|
var handleRobot = function handleRobot() {
|
|
if (!isHoverSecond) return;
|
|
onHandleSubmitDiscusses(id, {
|
|
reply_status: 3
|
|
});
|
|
};
|
|
var handleSatisfy = function handleSatisfy() {
|
|
onHandleSubmitDiscusses(id, {
|
|
reply_status: 1
|
|
});
|
|
};
|
|
var handleVerySatisfy = function handleVerySatisfy() {
|
|
onHandleSubmitDiscusses(id, {
|
|
reply_status: 4
|
|
});
|
|
};
|
|
var renderRatify = function renderRatify() {
|
|
switch (reply_status) {
|
|
case 0:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
onClick: handleSatisfy,
|
|
className: "whether-satisfied ".concat(isHoverSatisfied ? 'cursorPoint blue-text-color' : ''),
|
|
onMouseEnter: function onMouseEnter() {
|
|
setHoverSatisfied(true);
|
|
},
|
|
onMouseLeave: function onMouseLeave() {
|
|
setHoverSatisfied(false);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: isHoverSatisfied ? appoint2 : appoint1,
|
|
className: "whether-img SVGColor"
|
|
}), "\u6EE1\u610F"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(popover/* default */.Z, {
|
|
placement: "bottomLeft",
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "content",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "content-disappoint",
|
|
children: "\u62B1\u6B49\u8BA9\u4F60\u5931\u671B\u4E86\uFF0C\u8BF7\u7EE7\u7EED\u5C1D\u8BD5:"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "radius-box marg15 height30-line black6c-optcity ".concat(isHover ? 'blue-background cursorPoint blue-background-write' : 'gray-background'),
|
|
onMouseEnter: function onMouseEnter() {
|
|
setHover(true);
|
|
},
|
|
onMouseLeave: function onMouseLeave() {
|
|
setHover(false);
|
|
},
|
|
onClick: handleQuestions,
|
|
children: ["\u8BF7", author === null || author === void 0 ? void 0 : author.name.trim(), "\u8001\u5E08\u518D\u5C1D\u8BD5\u56DE\u7B54\u4E00\u6B21\u3002"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "radius-box marg15 height30-line black6c-optcity ".concat(isHoverSecond ? 'blue-background cursorPoint blue-background-write' : 'gray-background'),
|
|
onMouseEnter: function onMouseEnter() {
|
|
setHoverSecond(true);
|
|
},
|
|
onMouseLeave: function onMouseLeave() {
|
|
setHoverSecond(false);
|
|
},
|
|
onClick: handleRobot,
|
|
children: "\u53EF\u80FD\u542F\u7528\u4E86\u673A\u5668\u4EBA\uFF0C\u8BF7\u5176\u4ED6\u8001\u5E08\u56DE\u7B54\u3002"
|
|
})]
|
|
}),
|
|
trigger: "click",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "whether-satisfied ".concat(isHoverDisSatisfied ? 'cursorPoint blue-text-color' : ''),
|
|
onMouseEnter: function onMouseEnter() {
|
|
setHoverDisSatisfied(true);
|
|
},
|
|
onMouseLeave: function onMouseLeave() {
|
|
setHoverDisSatisfied(false);
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: isHoverDisSatisfied ? disappoint2 : disappoint1,
|
|
className: "whether-img SVGColor"
|
|
}), "\u4E0D\u6EE1\u610F"]
|
|
})
|
|
})]
|
|
});
|
|
case 1:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "radius-box cursorPoint height30 ".concat(index > 0 ? 'gray-background' : 'blue-background'),
|
|
onClick: handleVerySatisfy,
|
|
children: "\u6211\u5F88\u6EE1\u610F"
|
|
});
|
|
case 2:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "radius-box height30 ".concat(index > 0 ? 'gray-background' : 'blue-background'),
|
|
children: "\u4E0D\u6EE1\u610F \u7B49\u5F85\u8001\u5E08\u518D\u6B21\u56DE\u7B54"
|
|
});
|
|
case 3:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "radius-box height30 ".concat(index > 0 ? 'gray-background' : 'blue-background'),
|
|
children: "\u4E0D\u6EE1\u610F \u7B49\u5F85\u5176\u4ED6\u8001\u5E08\u518D\u6B21\u56DE\u7B54"
|
|
});
|
|
case 4:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "radius-box height30 ".concat(index > 0 ? 'gray-background' : 'blue-background'),
|
|
children: "\u6211\u5F88\u6EE1\u610F"
|
|
});
|
|
default:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {});
|
|
}
|
|
};
|
|
function onRewardDialog() {
|
|
onSetRewardData({
|
|
id: id,
|
|
index: index,
|
|
user_id: author.user_id,
|
|
parentDiscussIndex: parentDiscussIndex
|
|
});
|
|
}
|
|
function onHiddenDiscuss() {
|
|
onSetActionType({
|
|
id: id,
|
|
index: index,
|
|
params: {
|
|
hidden: !hidden ? '1' : '0',
|
|
container_identifier: shixunIdentifier
|
|
},
|
|
type: 'hidden-discuss',
|
|
parentDiscussIndex: parentDiscussIndex,
|
|
message: !hidden ? '确定要隐藏该条回复吗' : '确定要取消隐藏该条回复吗'
|
|
});
|
|
}
|
|
function onDeleteDiscuss() {
|
|
onSetActionType({
|
|
id: id,
|
|
index: index,
|
|
type: 'delete-discuss',
|
|
parentDiscussIndex: parentDiscussIndex,
|
|
message: '确定要删除该条回复吗'
|
|
});
|
|
}
|
|
var handleChildrenPlusClick = function handleChildrenPlusClick() {
|
|
onHandleRepaly(id, !user_praise, parentDiscussIndex, index);
|
|
};
|
|
var canDelete = adminOrOperator || can_delete || author.user_id === user.user_id || author.login === user.login;
|
|
var anserReplay = (0,_umi_production_exports.useLocation)().pathname.split('/')[1] === 'tasks';
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "second-level-discuss",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "discuss-info-body",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "discuss-info",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/users/".concat(author.login),
|
|
target: "_blank",
|
|
children: author.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "grey",
|
|
children: time
|
|
}), reward ? /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
className: "c-orange gift",
|
|
title: "\u5DF2\u5956\u52B1\u91D1\u5E01".concat(reward),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-gift c-orange "
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: reward
|
|
})]
|
|
}) : null]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
className: "discuss-content ".concat(index > 0 ? 'content-gray' : ''),
|
|
value: content
|
|
// onClick={handleClick}
|
|
})]
|
|
}), anserReplay && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "btn-group-succes",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "btn-group-gratify",
|
|
children: renderRatify()
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "btn-group-other",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "discuss-info-body",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "btn-group",
|
|
children: [user.identity === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onRewardDialog,
|
|
title: '给TA奖励金币',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-jiangli"
|
|
})
|
|
}) : null, adminOrOperator ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onHiddenDiscuss,
|
|
title: hidden ? '取消隐藏' : '隐藏评论',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: hidden ? 'iconfont icon-yincangbiyan' : 'fa fa-eye'
|
|
})
|
|
}) : null, canDelete ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onDeleteDiscuss,
|
|
title: "\u5220\u9664",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shanchu"
|
|
})
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
onClick: handleChildrenPlusClick,
|
|
className: user_praise ? 'c-orange' : '',
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: user_praise ? 'iconfont icon-dianzan mr3' : 'iconfont icon-dianzan-xian mr3 '
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: praise_count ? praise_count : ''
|
|
})]
|
|
})]
|
|
})
|
|
})
|
|
})]
|
|
})]
|
|
});
|
|
}
|
|
/* harmony default export */ var discuss_item = (function (_ref2) {
|
|
var data = _ref2.data,
|
|
index = _ref2.index,
|
|
shixunIdentifier = _ref2.shixunIdentifier,
|
|
adminOrOperator = _ref2.adminOrOperator,
|
|
identity = _ref2.identity,
|
|
onTopOrDownDiscuss = _ref2.onTopOrDownDiscuss,
|
|
onPlusDiscuss = _ref2.onPlusDiscuss,
|
|
onDisableDiscuss = _ref2.onDisableDiscuss,
|
|
onSetActionType = _ref2.onSetActionType,
|
|
onSetRewardData = _ref2.onSetRewardData,
|
|
user = _ref2.user,
|
|
activeDiscussIndex = _ref2.activeDiscussIndex,
|
|
onReplyDiscuss = _ref2.onReplyDiscuss,
|
|
onSetActiveDiscussIndex = _ref2.onSetActiveDiscussIndex,
|
|
allowDisableDiscuss = _ref2.allowDisableDiscuss,
|
|
onHandleSubmitDiscusses = _ref2.onHandleSubmitDiscusses,
|
|
onHandleRepaly = _ref2.onHandleRepaly,
|
|
userInfomation = _ref2.userInfomation;
|
|
var content = data.content,
|
|
children = data.children,
|
|
game_url = data.game_url,
|
|
hidden = data.hidden,
|
|
id = data.id,
|
|
position = data.position,
|
|
praise_count = data.praise_count,
|
|
reward = data.reward,
|
|
sticky = data.sticky,
|
|
time = data.time,
|
|
user_praise = data.user_praise,
|
|
game_passed = data.game_passed,
|
|
ai_reply_text = data.ai_reply_text,
|
|
ai_reply_flag = data.ai_reply_flag,
|
|
author = data.author,
|
|
disable_discuss_status = data.disable_discuss_status,
|
|
reply_status = data.reply_status;
|
|
var _useState9 = (0,react.useState)(false),
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
showPlusAnimate = _useState10[0],
|
|
setShowPlusAnimate = _useState10[1];
|
|
(0,react.useEffect)(function () {
|
|
if (showPlusAnimate) {
|
|
setTimeout(function () {
|
|
return setShowPlusAnimate(false);
|
|
}, 800);
|
|
}
|
|
}, [showPlusAnimate]);
|
|
function onActiveDiscussIndex() {
|
|
var _userInfo;
|
|
if (!((_userInfo = (0,authority/* userInfo */.eY)()) !== null && _userInfo !== void 0 && _userInfo.authentication)) {
|
|
modal/* default.confirm */.Z.confirm({
|
|
title: '提示',
|
|
className: 'custom-modal-divider ',
|
|
icon: null,
|
|
content: '需要通过实名验证后,才能进行评论操作',
|
|
okText: '前往实名验证',
|
|
cancelText: '取消',
|
|
onOk: function onOk() {
|
|
window.open("/account/certification");
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
console.log(id, "idi---------------------------");
|
|
onSetActiveDiscussIndex(id);
|
|
}
|
|
function onTopOrDown() {
|
|
onTopOrDownDiscuss(id, !sticky, index);
|
|
}
|
|
function onPlus() {
|
|
onPlusDiscuss(id, !user_praise, index);
|
|
}
|
|
function onRewardDialog() {
|
|
onSetRewardData({
|
|
id: id,
|
|
index: index,
|
|
user_id: author.user_id
|
|
});
|
|
}
|
|
function onDeleteDiscuss() {
|
|
onSetActionType({
|
|
id: id,
|
|
index: index,
|
|
type: 'delete-discuss',
|
|
message: '确定要删除该条回复吗'
|
|
});
|
|
}
|
|
function onHiddenDiscuss() {
|
|
onSetActionType({
|
|
id: id,
|
|
index: index,
|
|
params: {
|
|
hidden: !hidden ? '1' : '0',
|
|
container_identifier: shixunIdentifier
|
|
},
|
|
type: 'hidden-discuss',
|
|
message: !hidden ? '确定要隐藏该条回复吗' : '确定要取消隐藏该条回复吗'
|
|
});
|
|
}
|
|
function onDisable() {
|
|
onDisableDiscuss(id, disable_discuss_status === 0 ? 2 : 0, index);
|
|
}
|
|
var handleClick = function handleClick(e) {
|
|
var _e$target = e.target,
|
|
nodeName = _e$target.nodeName,
|
|
src = _e$target.src;
|
|
if (nodeName === 'IMG') {
|
|
mediator/* default.publish */.Z.publish('preview-image', src);
|
|
console.log('src:', src);
|
|
}
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "discuss-item-container",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/users/".concat(author.login),
|
|
target: "_blank",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
alt: "\u7528\u6237\u5934\u50CF",
|
|
height: "50",
|
|
src: "".concat(env/* default.IMG_SERVER */.Z.IMG_SERVER, "/images/").concat(author.image_url),
|
|
width: "50"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "discuss-info",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: "/users/".concat(author.login),
|
|
target: "_blank",
|
|
children: author.name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "grey",
|
|
children: time
|
|
}), position ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "c-green",
|
|
children: [" [\u7B2C", position, "\u5173] "]
|
|
}) : null, game_url ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
href: game_url,
|
|
target: "_blank",
|
|
className: "view-code",
|
|
title: "\u70B9\u51FB\u67E5\u770BTA\u7684\u4EE3\u7801\u9875\u9762",
|
|
children: "\u67E5\u770B"
|
|
}) : null, allowDisableDiscuss && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
children: [disable_discuss_status === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: '禁止该用户在此项目的评论功能',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: onDisable,
|
|
className: "c-red current",
|
|
children: "\u7981\u6B62\u8BC4\u8BBA\u529F\u80FD"
|
|
})
|
|
}), disable_discuss_status === 2 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: '恢复该用户在此实践项目的评论功能',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: onDisable,
|
|
className: "c-light-primary current",
|
|
children: "\u6062\u590D\u8BC4\u8BBA\u529F\u80FD"
|
|
})
|
|
}), disable_discuss_status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: '该用户已被系统管理员禁言',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-red",
|
|
children: "\u88AB\u7BA1\u7406\u5458\u7981\u6B62\u8BC4\u8BBA"
|
|
})
|
|
})]
|
|
}), sticky ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "top",
|
|
children: "\u7F6E\u9876"
|
|
}) : null, reward ? /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
className: "c-orange gift",
|
|
title: "\u5DF2\u5956\u52B1\u91D1\u5E01".concat(reward),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-gift c-orange "
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: reward
|
|
})]
|
|
}) : null, identity <= 5 ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
flex: '1',
|
|
textAlign: 'right',
|
|
color: game_passed === 1 ? '#29bd8b' : ''
|
|
},
|
|
children: game_passed === 1 ? '已通关' : '未通关'
|
|
}) : null]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
onClick: handleClick,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
className: "discuss-content",
|
|
value: content
|
|
})
|
|
}), ai_reply_flag && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: {
|
|
padding: 10,
|
|
borderRadius: 4,
|
|
background: '#f4f4f4'
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
padding: '6px 0'
|
|
},
|
|
children: ai_reply_text
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.Z, {
|
|
style: {
|
|
background: '#d1e5f9',
|
|
borderRadius: 25,
|
|
border: 'none',
|
|
display: 'inline-flex',
|
|
justifyItems: 'center',
|
|
alignItems: 'center'
|
|
},
|
|
onClick: function onClick() {
|
|
return setShowPlusAnimate(true);
|
|
},
|
|
className: "mr10 mr5 relative c-blue",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: showPlusAnimate ? 'plus-one-animate' : 'hide',
|
|
style: {
|
|
position: 'absolute'
|
|
},
|
|
children: [' ', "+1"]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-blue icon-duiwoyouyong mr5"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-blue",
|
|
children: "\u5BF9\u6211\u6709\u7528"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-orange current",
|
|
onClick: function onClick() {
|
|
mediator/* default.publish */.Z.publish('ai-replay-show', {
|
|
content: content,
|
|
id: id
|
|
});
|
|
},
|
|
children: "\u5176\u4ED6\u56DE\u7B54"
|
|
})]
|
|
}), children && children.length > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "reply-discuss-containerActive",
|
|
onClick: handleClick,
|
|
children: children.map(function (item, i) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(SecondLevelDiscuss, {
|
|
data: item,
|
|
index: i,
|
|
userInfomation: userInfomation,
|
|
onTopOrDownDiscuss: onTopOrDownDiscuss,
|
|
shixunIdentifier: shixunIdentifier,
|
|
onHandleSubmitDiscusses: onHandleSubmitDiscusses,
|
|
adminOrOperator: adminOrOperator,
|
|
user: user,
|
|
onSetRewardData: onSetRewardData,
|
|
onSetActionType: onSetActionType,
|
|
parentDiscussIndex: index,
|
|
anserAuthor: author,
|
|
onHandleRepaly: onHandleRepaly
|
|
}, item.id);
|
|
})
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "btn-group",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "btn-group-other",
|
|
children: [user.identity === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onRewardDialog,
|
|
title: '给TA奖励金币',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-jiangli"
|
|
})
|
|
}) : null, adminOrOperator ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onHiddenDiscuss,
|
|
title: hidden ? '取消隐藏' : '隐藏评论',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: hidden ? 'iconfont icon-yincangbiyan' : 'fa fa-eye'
|
|
})
|
|
}) : null, identity <= 5 ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onTopOrDown,
|
|
className: sticky ? 'btn-top' : 'btn-down',
|
|
title: sticky ? '取消置顶' : '置顶',
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-zhiding1 "
|
|
})
|
|
}) : null, adminOrOperator && (!children || children.length == 0) ? /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onDeleteDiscuss,
|
|
title: "\u5220\u9664",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-shanchu"
|
|
})
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
onClick: onActiveDiscussIndex,
|
|
title: "\u56DE\u590D",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-huifu1"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("a", {
|
|
onClick: onPlus,
|
|
className: user_praise ? 'c-orange' : '',
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: user_praise ? 'iconfont icon-dianzan mr3' : 'iconfont icon-dianzan-xian mr3 '
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: praise_count ? praise_count : ''
|
|
})]
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_editor/* default */.Z, {
|
|
id: id,
|
|
activeDiscussIndex: activeDiscussIndex,
|
|
onReplyDiscuss: onReplyDiscuss
|
|
})]
|
|
})]
|
|
}, id);
|
|
});
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(29427);
|
|
;// CONCATENATED MODULE: ./src/pages/tasks/left-panel/discuss/index.jsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var initialState = {
|
|
showRewardDialog: false,
|
|
data: null,
|
|
page: 1,
|
|
loading: false,
|
|
actionType: null,
|
|
activeDiscussIndex: null
|
|
};
|
|
function reducer(state, action) {
|
|
switch (action.type) {
|
|
case constant/* SHOW_DISCUSSES_LOADING */.tD:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
loading: true
|
|
});
|
|
case constant/* SHOW_REWARD_DIALOG */.RS:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
showRewardDialog: true
|
|
});
|
|
case constant/* CANCEL_REWARD_DIALOG */.t2:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
showRewardDialog: false
|
|
});
|
|
case constant/* GET_DISCUSSES */.GR:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
case constant/* TOP_OR_DOWN_DISCUSS */.u8:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
case constant/* PLUS_DISCUSS */.rM:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
case constant/* DISABLE_DISCUSS */.fo:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
case constant/* SET_ACTION_TYPE */.yS:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
case constant/* SET_REWARD */.Vn:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
case constant/* ACTIVE_DISCUSS_INDEX */.SX:
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), action.payload);
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
/* harmony default export */ var discuss = (function (_ref) {
|
|
var shixunIdentifier = _ref.shixunIdentifier,
|
|
identity = _ref.identity,
|
|
activeIndex = _ref.activeIndex,
|
|
user = _ref.user,
|
|
allowDisableDiscuss = _ref.allowDisableDiscuss,
|
|
userInfo = _ref.userInfo,
|
|
_ref$isShixunDetail = _ref.isShixunDetail,
|
|
isShixunDetail = _ref$isShixunDetail === void 0 ? false : _ref$isShixunDetail,
|
|
taskData = _ref.taskData,
|
|
chatgpt = _ref.chatgpt,
|
|
to_user_id = _ref.to_user_id,
|
|
challengeId = _ref.challengeId;
|
|
var _useReducer = (0,react.useReducer)(reducer, initialState),
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
state = _useReducer2[0],
|
|
dispatch = _useReducer2[1];
|
|
var _useState = (0,react.useState)(true),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
open = _useState2[0],
|
|
setOpen = _useState2[1];
|
|
var _useState3 = (0,react.useState)(null),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
timeRefersh = _useState4[0],
|
|
settimeRefersh = _useState4[1];
|
|
var page = state.page,
|
|
loading = state.loading,
|
|
data = state.data,
|
|
actionType = state.actionType,
|
|
showRewardDialog = state.showRewardDialog,
|
|
activeDiscussIndex = state.activeDiscussIndex;
|
|
var rewardData = (0,react.useRef)();
|
|
var discussEl = (0,react.useRef)();
|
|
var refresh = (0,react.useRef)();
|
|
function getDiscusses(_x, _x2) {
|
|
return _getDiscusses.apply(this, arguments);
|
|
}
|
|
function _getDiscusses() {
|
|
_getDiscusses = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(value, bool) {
|
|
var response;
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
if (!loading) {
|
|
_context2.next = 2;
|
|
break;
|
|
}
|
|
return _context2.abrupt("return");
|
|
case 2:
|
|
_context2.prev = 2;
|
|
dispatch({
|
|
type: constant/* SHOW_DISCUSSES_LOADING */.tD
|
|
});
|
|
_context2.next = 6;
|
|
return (0,service/* fetchDiscusses */.o7)(shixunIdentifier, value);
|
|
case 6:
|
|
response = _context2.sent;
|
|
console.log("activeDiscussIndex", activeDiscussIndex);
|
|
dispatch({
|
|
type: constant/* GET_DISCUSSES */.GR,
|
|
payload: {
|
|
activeDiscussIndex: bool ? activeDiscussIndex : null,
|
|
page: value,
|
|
data: response,
|
|
loading: false
|
|
}
|
|
});
|
|
_context2.next = 14;
|
|
break;
|
|
case 11:
|
|
_context2.prev = 11;
|
|
_context2.t0 = _context2["catch"](2);
|
|
console.log(_context2.t0);
|
|
case 14:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}, _callee2, null, [[2, 11]]);
|
|
}));
|
|
return _getDiscusses.apply(this, arguments);
|
|
}
|
|
(0,react.useEffect)(function () {
|
|
if (activeIndex === 3 && chatgpt) {
|
|
console.log("开启定时器");
|
|
clearInterval(refresh.current);
|
|
refresh.current = setInterval(function () {
|
|
getDiscusses(page, true);
|
|
}, 5000);
|
|
} else {
|
|
console.log("清除定时器");
|
|
return function () {
|
|
clearInterval(refresh.current);
|
|
};
|
|
}
|
|
return function () {
|
|
clearInterval(refresh.current);
|
|
};
|
|
}, [chatgpt, activeIndex, activeDiscussIndex]);
|
|
(0,react.useEffect)(function () {
|
|
if (!open) {
|
|
clearInterval(timeRefersh);
|
|
settimeRefersh(setInterval(function () {
|
|
getDiscusses(page, true);
|
|
}, 5000));
|
|
}
|
|
return function () {
|
|
clearInterval(timeRefersh);
|
|
};
|
|
}, [open, page, activeDiscussIndex]);
|
|
function onPaginationChange(value) {
|
|
getDiscusses(value);
|
|
}
|
|
function onPlusDiscuss(_x3, _x4, _x5) {
|
|
return _onPlusDiscuss.apply(this, arguments);
|
|
}
|
|
function _onPlusDiscuss() {
|
|
_onPlusDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(id, user_praise, index) {
|
|
var response;
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
case 0:
|
|
_context3.prev = 0;
|
|
_context3.next = 3;
|
|
return (0,service/* plusDiscuss */.ae)(id, user_praise);
|
|
case 3:
|
|
response = _context3.sent;
|
|
comments[index].user_praise = user_praise;
|
|
comments[index].praise_count = response.praise_count;
|
|
dispatch({
|
|
type: constant/* PLUS_DISCUSS */.rM,
|
|
payload: {
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
comments: comments
|
|
})
|
|
}
|
|
});
|
|
_context3.next = 12;
|
|
break;
|
|
case 9:
|
|
_context3.prev = 9;
|
|
_context3.t0 = _context3["catch"](0);
|
|
console.log(_context3.t0);
|
|
case 12:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}, _callee3, null, [[0, 9]]);
|
|
}));
|
|
return _onPlusDiscuss.apply(this, arguments);
|
|
}
|
|
function onHandleRepaly(_x6, _x7, _x8, _x9) {
|
|
return _onHandleRepaly.apply(this, arguments);
|
|
}
|
|
function _onHandleRepaly() {
|
|
_onHandleRepaly = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(id, user_praise, index, i) {
|
|
var response;
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
_context4.prev = 0;
|
|
_context4.next = 3;
|
|
return (0,service/* plusDiscuss */.ae)(id, user_praise);
|
|
case 3:
|
|
response = _context4.sent;
|
|
comments[index].children[i].user_praise = user_praise;
|
|
comments[index].children[i].praise_count = response.praise_count;
|
|
dispatch({
|
|
type: constant/* PLUS_DISCUSS */.rM,
|
|
payload: {
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
comments: comments
|
|
})
|
|
}
|
|
});
|
|
_context4.next = 12;
|
|
break;
|
|
case 9:
|
|
_context4.prev = 9;
|
|
_context4.t0 = _context4["catch"](0);
|
|
console.log(_context4.t0);
|
|
case 12:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}, _callee4, null, [[0, 9]]);
|
|
}));
|
|
return _onHandleRepaly.apply(this, arguments);
|
|
}
|
|
function onDisableDiscuss(_x10, _x11, _x12) {
|
|
return _onDisableDiscuss.apply(this, arguments);
|
|
}
|
|
function _onDisableDiscuss() {
|
|
_onDisableDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(id, disable_discuss_status, index) {
|
|
var response, select_user_id, newComments;
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
case 0:
|
|
_context5.prev = 0;
|
|
_context5.next = 3;
|
|
return (0,service/* disableDiscuss */._Z)(id, disable_discuss_status);
|
|
case 3:
|
|
response = _context5.sent;
|
|
if (!(response.status !== 0)) {
|
|
_context5.next = 6;
|
|
break;
|
|
}
|
|
return _context5.abrupt("return");
|
|
case 6:
|
|
select_user_id = comments[index].author.user_id;
|
|
newComments = comments.map(function (e) {
|
|
if (e.author.user_id === select_user_id) {
|
|
return objectSpread2_default()(objectSpread2_default()({}, e), {}, {
|
|
disable_discuss_status: disable_discuss_status
|
|
});
|
|
}
|
|
return e;
|
|
});
|
|
dispatch({
|
|
type: constant/* DISABLE_DISCUSS */.fo,
|
|
payload: {
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
comments: newComments
|
|
})
|
|
}
|
|
});
|
|
_context5.next = 14;
|
|
break;
|
|
case 11:
|
|
_context5.prev = 11;
|
|
_context5.t0 = _context5["catch"](0);
|
|
console.log(_context5.t0);
|
|
case 14:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}, _callee5, null, [[0, 11]]);
|
|
}));
|
|
return _onDisableDiscuss.apply(this, arguments);
|
|
}
|
|
function onTopOrDownDiscuss(_x13, _x14, _x15) {
|
|
return _onTopOrDownDiscuss.apply(this, arguments);
|
|
}
|
|
function _onTopOrDownDiscuss() {
|
|
_onTopOrDownDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(id, sticky, index) {
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
case 0:
|
|
_context6.prev = 0;
|
|
_context6.next = 3;
|
|
return (0,service/* topOrDownDiscuss */.wJ)(id, sticky);
|
|
case 3:
|
|
comments[index].sticky = sticky;
|
|
dispatch({
|
|
type: constant/* TOP_OR_DOWN_DISCUSS */.u8,
|
|
payload: {
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
comments: comments
|
|
})
|
|
}
|
|
});
|
|
getDiscusses(state.page);
|
|
_context6.next = 11;
|
|
break;
|
|
case 8:
|
|
_context6.prev = 8;
|
|
_context6.t0 = _context6["catch"](0);
|
|
console.log(_context6.t0);
|
|
case 11:
|
|
case "end":
|
|
return _context6.stop();
|
|
}
|
|
}, _callee6, null, [[0, 8]]);
|
|
}));
|
|
return _onTopOrDownDiscuss.apply(this, arguments);
|
|
}
|
|
function onCancelAction() {
|
|
dispatch({
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
payload: {
|
|
actionType: null
|
|
}
|
|
});
|
|
}
|
|
function onProcessAction() {
|
|
return _onProcessAction.apply(this, arguments);
|
|
}
|
|
function _onProcessAction() {
|
|
_onProcessAction = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
var id, params, type, index, parentDiscussIndex, secondDicusses, i, _i;
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
case 0:
|
|
id = actionType.id, params = actionType.params, type = actionType.type, index = actionType.index, parentDiscussIndex = actionType.parentDiscussIndex;
|
|
if (!(type === 'hidden-discuss')) {
|
|
_context7.next = 6;
|
|
break;
|
|
}
|
|
_context7.next = 4;
|
|
return (0,service/* hiddenDiscuss */.OY)(id, params);
|
|
case 4:
|
|
if (!parentDiscussIndex) {
|
|
comments[index].hidden = params.hidden == 1 ? true : false;
|
|
} else {
|
|
comments[parentDiscussIndex].children[index].hidden = params.hidden == 1 ? true : false;
|
|
}
|
|
dispatch({
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
payload: {
|
|
actionType: null,
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
comments: comments
|
|
})
|
|
}
|
|
});
|
|
case 6:
|
|
if (!(type === 'delete-discuss')) {
|
|
_context7.next = 31;
|
|
break;
|
|
}
|
|
_context7.next = 9;
|
|
return (0,service/* deleteDiscuss */.KY)(id);
|
|
case 9:
|
|
if (!(parentDiscussIndex || parentDiscussIndex === 0)) {
|
|
_context7.next = 22;
|
|
break;
|
|
}
|
|
secondDicusses = comments[parentDiscussIndex].children;
|
|
i = secondDicusses.length - 1;
|
|
case 12:
|
|
if (!(i >= 0)) {
|
|
_context7.next = 19;
|
|
break;
|
|
}
|
|
if (!(secondDicusses[i].id === id)) {
|
|
_context7.next = 16;
|
|
break;
|
|
}
|
|
secondDicusses.splice(i, 1);
|
|
return _context7.abrupt("break", 19);
|
|
case 16:
|
|
i--;
|
|
_context7.next = 12;
|
|
break;
|
|
case 19:
|
|
comments[parentDiscussIndex].children = secondDicusses;
|
|
_context7.next = 30;
|
|
break;
|
|
case 22:
|
|
_i = comments.length - 1;
|
|
case 23:
|
|
if (!(_i >= 0)) {
|
|
_context7.next = 30;
|
|
break;
|
|
}
|
|
if (!(comments[_i].id === id)) {
|
|
_context7.next = 27;
|
|
break;
|
|
}
|
|
comments.splice(_i, 1);
|
|
return _context7.abrupt("break", 30);
|
|
case 27:
|
|
_i--;
|
|
_context7.next = 23;
|
|
break;
|
|
case 30:
|
|
dispatch({
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
payload: {
|
|
actionType: null,
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
comments: comments
|
|
})
|
|
}
|
|
});
|
|
case 31:
|
|
case "end":
|
|
return _context7.stop();
|
|
}
|
|
}, _callee7);
|
|
}));
|
|
return _onProcessAction.apply(this, arguments);
|
|
}
|
|
function onSetActionType(value) {
|
|
dispatch({
|
|
type: constant/* SET_ACTION_TYPE */.yS,
|
|
payload: {
|
|
actionType: value
|
|
}
|
|
});
|
|
}
|
|
function onCancelRewardDialog() {
|
|
dispatch({
|
|
type: constant/* CANCEL_REWARD_DIALOG */.t2
|
|
});
|
|
}
|
|
function onRewardDiscuss() {
|
|
return _onRewardDiscuss.apply(this, arguments);
|
|
}
|
|
function _onRewardDiscuss() {
|
|
_onRewardDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
var _rewardData$current, id, index, score, user_id, parentDiscussIndex, response;
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
case 0:
|
|
_rewardData$current = rewardData.current, id = _rewardData$current.id, index = _rewardData$current.index, score = _rewardData$current.score, user_id = _rewardData$current.user_id, parentDiscussIndex = _rewardData$current.parentDiscussIndex;
|
|
_context8.next = 3;
|
|
return (0,service/* rewardDiscuss */.S8)(id, {
|
|
container_type: 'Discusses',
|
|
score: score,
|
|
user_id: user_id
|
|
});
|
|
case 3:
|
|
response = _context8.sent;
|
|
if (!parentDiscussIndex) {
|
|
comments[index].reward = response.code;
|
|
} else {
|
|
comments[parentDiscussIndex].children[index].reward = response.code;
|
|
}
|
|
dispatch({
|
|
type: constant/* SET_REWARD */.Vn,
|
|
payload: {
|
|
showRewardDialog: false,
|
|
data: objectSpread2_default()(objectSpread2_default()({}, data), {}, {
|
|
comments: comments
|
|
})
|
|
}
|
|
});
|
|
rewardData.current = null;
|
|
case 7:
|
|
case "end":
|
|
return _context8.stop();
|
|
}
|
|
}, _callee8);
|
|
}));
|
|
return _onRewardDiscuss.apply(this, arguments);
|
|
}
|
|
function onSetRewardData(value) {
|
|
rewardData.current = value;
|
|
dispatch({
|
|
type: constant/* SHOW_REWARD_DIALOG */.RS
|
|
});
|
|
}
|
|
function onSetDiscussScore(value) {
|
|
rewardData.current.score = value;
|
|
}
|
|
function onReplyDiscuss(_x16, _x17) {
|
|
return _onReplyDiscuss.apply(this, arguments);
|
|
}
|
|
function _onReplyDiscuss() {
|
|
_onReplyDiscuss = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(id, value) {
|
|
var res;
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
case 0:
|
|
_context9.prev = 0;
|
|
_context9.next = 3;
|
|
return (0,service/* replyDiscuss */.wg)(id, value);
|
|
case 3:
|
|
res = _context9.sent;
|
|
if (!(res.status === -3)) {
|
|
_context9.next = 8;
|
|
break;
|
|
}
|
|
modal/* default.info */.Z.info({
|
|
title: '提示',
|
|
className: 'custom-modal-divider ',
|
|
icon: null,
|
|
content: '你的账号因为发布了不当内容,现已将评论功能屏蔽。',
|
|
okText: '确定'
|
|
});
|
|
onSetActiveDiscussIndex(null);
|
|
return _context9.abrupt("return");
|
|
case 8:
|
|
getDiscusses(page);
|
|
_context9.next = 14;
|
|
break;
|
|
case 11:
|
|
_context9.prev = 11;
|
|
_context9.t0 = _context9["catch"](0);
|
|
console.log(_context9.t0);
|
|
case 14:
|
|
case "end":
|
|
return _context9.stop();
|
|
}
|
|
}, _callee9, null, [[0, 11]]);
|
|
}));
|
|
return _onReplyDiscuss.apply(this, arguments);
|
|
}
|
|
function onSubmitDiscusses(_x18, _x19) {
|
|
return _onSubmitDiscusses.apply(this, arguments);
|
|
}
|
|
function _onSubmitDiscusses() {
|
|
_onSubmitDiscusses = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10(id, value) {
|
|
var _yield$submitDiscusse, status;
|
|
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
case 0:
|
|
_context10.prev = 0;
|
|
_context10.next = 3;
|
|
return (0,service/* submitDiscusses */.KQ)(id, value);
|
|
case 3:
|
|
_yield$submitDiscusse = _context10.sent;
|
|
status = _yield$submitDiscusse.status;
|
|
if (!(status !== 1)) {
|
|
_context10.next = 7;
|
|
break;
|
|
}
|
|
return _context10.abrupt("return");
|
|
case 7:
|
|
getDiscusses(page);
|
|
_context10.next = 13;
|
|
break;
|
|
case 10:
|
|
_context10.prev = 10;
|
|
_context10.t0 = _context10["catch"](0);
|
|
console.log(_context10.t0);
|
|
case 13:
|
|
case "end":
|
|
return _context10.stop();
|
|
}
|
|
}, _callee10, null, [[0, 10]]);
|
|
}));
|
|
return _onSubmitDiscusses.apply(this, arguments);
|
|
}
|
|
function onSetActiveDiscussIndex(value) {
|
|
if (activeDiscussIndex === value) {
|
|
dispatch({
|
|
type: constant/* ACTIVE_DISCUSS_INDEX */.SX,
|
|
payload: {
|
|
activeDiscussIndex: null
|
|
}
|
|
});
|
|
} else {
|
|
dispatch({
|
|
type: constant/* ACTIVE_DISCUSS_INDEX */.SX,
|
|
payload: {
|
|
activeDiscussIndex: value
|
|
}
|
|
});
|
|
}
|
|
}
|
|
(0,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:
|
|
if (!(activeIndex === 3 && !data && shixunIdentifier)) {
|
|
_context.next = 3;
|
|
break;
|
|
}
|
|
_context.next = 3;
|
|
return getDiscusses(page);
|
|
case 3:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return _init.apply(this, arguments);
|
|
}
|
|
init();
|
|
}, [shixunIdentifier, activeIndex, page, dispatch]);
|
|
(0,react.useEffect)(function () {
|
|
var unSub = mediator/* default.subscribe */.Z.subscribe('create-discuss', function () {
|
|
getDiscusses(page);
|
|
});
|
|
return unSub;
|
|
}, [shixunIdentifier]);
|
|
if (!data) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Spinner/* default */.Z, {});
|
|
}
|
|
// 开启实时刷新调用的函数
|
|
var handleRefresh = function handleRefresh() {
|
|
setOpen(!open);
|
|
if (!open) {
|
|
clearInterval(timeRefersh);
|
|
} else {
|
|
settimeRefersh(setInterval(function () {
|
|
getDiscusses(page, true);
|
|
}, 5000));
|
|
}
|
|
};
|
|
var disscuss_count = data.disscuss_count,
|
|
comments = data.comments,
|
|
all = data.all,
|
|
can_hidden = data.can_hidden;
|
|
console.log(to_user_id, "to_user_id");
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "discuss-container",
|
|
ref: discussEl,
|
|
children: [chatgpt && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
type: "primary",
|
|
style: {
|
|
"float": 'right',
|
|
marginBottom: 10
|
|
},
|
|
onClick: function onClick() {
|
|
(0,util/* openNewWindow */.xg)("/chatgpt?id=".concat(to_user_id, "&position=").concat(challengeId));
|
|
},
|
|
children: "\u8FDB\u5165\u5386\u53F2\u95EE\u7B54"
|
|
}), (taskData === null || taskData === void 0 ? void 0 : taskData.myshixun_manager) && !chatgpt && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
|
|
style: {
|
|
"float": 'right',
|
|
marginBottom: 10
|
|
},
|
|
type: "primary",
|
|
onClick: handleRefresh,
|
|
children: open ? '开启实时刷新' : '停止实时刷新'
|
|
}), disscuss_count === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
styles: {
|
|
clear: 'both'
|
|
}
|
|
}) : null, comments.map(function (item, index) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(discuss_item, {
|
|
user: user,
|
|
userInfomation: userInfo,
|
|
data: item,
|
|
index: index,
|
|
identity: identity,
|
|
onPaginationChange: onPaginationChange,
|
|
shixunIdentifier: shixunIdentifier,
|
|
onSetActionType: onSetActionType,
|
|
onTopOrDownDiscuss: onTopOrDownDiscuss,
|
|
adminOrOperator: can_hidden,
|
|
onPlusDiscuss: onPlusDiscuss,
|
|
onDisableDiscuss: onDisableDiscuss,
|
|
onSetRewardData: onSetRewardData,
|
|
activeDiscussIndex: activeDiscussIndex,
|
|
onHandleSubmitDiscusses: onSubmitDiscusses,
|
|
onSetActiveDiscussIndex: onSetActiveDiscussIndex,
|
|
onReplyDiscuss: onReplyDiscuss,
|
|
allowDisableDiscuss: allowDisableDiscuss,
|
|
onHandleRepaly: onHandleRepaly
|
|
}, item.id);
|
|
}), disscuss_count > 10 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "pagination-container",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
|
|
showQuickJumper: true,
|
|
showSizeChanger: false,
|
|
onChange: onPaginationChange,
|
|
current: page,
|
|
total: disscuss_count
|
|
})
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(AiAnswer, {})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(components_modal/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
centered: true,
|
|
title: "\u63D0\u793A",
|
|
open: !!actionType,
|
|
onOk: onProcessAction,
|
|
onCancel: onCancelAction,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
children: actionType ? actionType.message : ''
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
centered: true,
|
|
width: 400,
|
|
title: "\u5956\u52B1\u8BBE\u7F6E",
|
|
open: showRewardDialog,
|
|
onCancel: onCancelRewardDialog,
|
|
onOk: onRewardDiscuss,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
placeholder: "\u8BF7\u8F93\u5165\u5956\u52B1\u7684\u91D1\u5E01\u6570\u91CF",
|
|
min: 1,
|
|
onChange: onSetDiscussScore,
|
|
style: {
|
|
width: '228px'
|
|
}
|
|
})
|
|
})]
|
|
})]
|
|
});
|
|
});
|
|
|
|
/***/ })
|
|
|
|
}]); |