|
|
|
|
@ -15,6 +15,15 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
"default": function() { return /* binding */ ResearchCenter; }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
|
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
|
|
@ -22,8 +31,8 @@ var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
|
|
var _umi_production_exports = __webpack_require__(49389);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
|
|
var message = __webpack_require__(8591);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/ResearchCenter/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var ResearchCentermodules = ({"flex_box_center":"flex_box_center___U_WpC","flex_space_between":"flex_space_between___x00bj","flex_box_vertical_center":"flex_box_vertical_center___Jx9vT","flex_box_center_end":"flex_box_center_end___MFPAm","flex_box_column":"flex_box_column___pF9Pi","page":"page___yjL89","header":"header___LLncc","header_img":"header_img___dsreb","content":"content___yw7sG","left":"left___comGU","left_img":"left_img___Hiekq","left_items":"left_items___lVCUg","items_active":"items_active___lnmNq","items_text":"items_text___nRDN4","items":"items___mk992","right":"right___CGpYV","fieldWrap":"fieldWrap___vwMua","updata_style":"updata_style___VDjlZ","updata_img":"updata_img___H6k50","updata_text":"updata_text___VVxAH","no_data":"no_data___O8Ouh","right_img":"right_img___w2hJw","right_text":"right_text___neJMO","button_list":"button_list___vmOvJ","submit_button":"submit_button___atg0T","close_button":"close_button___IM5BY"});
|
|
|
|
|
@ -35,6 +44,8 @@ var nodata = __webpack_require__(9333);
|
|
|
|
|
var RenderHtml = __webpack_require__(51151);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
|
|
|
|
|
var markdown_editor = __webpack_require__(59081);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
|
|
var fetch = __webpack_require__(94171);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/ResearchCenter/index.tsx
|
|
|
|
|
@ -47,68 +58,117 @@ var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import { trend_informations_query, trend_informations_edit } from '@/service/educationFiles'
|
|
|
|
|
|
|
|
|
|
// import WangEditor from '@/components/WangEditor'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Page = function Page(_ref) {
|
|
|
|
|
var _data$active2, _data$active3;
|
|
|
|
|
var globalSetting = _ref.globalSetting,
|
|
|
|
|
dispatch = _ref.dispatch,
|
|
|
|
|
user = _ref.user;
|
|
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([{
|
|
|
|
|
name: '中心简介',
|
|
|
|
|
value: '1'
|
|
|
|
|
content: ''
|
|
|
|
|
}, {
|
|
|
|
|
name: '现任领导',
|
|
|
|
|
value: '2'
|
|
|
|
|
content: ''
|
|
|
|
|
}, {
|
|
|
|
|
name: '联系我们',
|
|
|
|
|
value: '3'
|
|
|
|
|
content: ''
|
|
|
|
|
}]),
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
data = _useState2[0],
|
|
|
|
|
setData = _useState2[1];
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)('1'),
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(0),
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
active = _useState4[0],
|
|
|
|
|
setActive = _useState4[1];
|
|
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
|
|
form = _Form$useForm2[0];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
content = _useState6[0],
|
|
|
|
|
setContent = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(),
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(true),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
id = _useState8[0],
|
|
|
|
|
setId = _useState8[1];
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(true),
|
|
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
|
|
showButton = _useState10[0],
|
|
|
|
|
setShowButton = _useState10[1];
|
|
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)([]),
|
|
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
|
|
list = _useState12[0],
|
|
|
|
|
setList = _useState12[1];
|
|
|
|
|
var pathParams = (0,_umi_production_exports.useParams)();
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
getData(active);
|
|
|
|
|
}, [active]);
|
|
|
|
|
showButton = _useState8[0],
|
|
|
|
|
setShowButton = _useState8[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
setActive(pathParams === null || pathParams === void 0 ? void 0 : pathParams.typeId);
|
|
|
|
|
setShowButton(true);
|
|
|
|
|
}, [pathParams === null || pathParams === void 0 ? void 0 : pathParams.typeId]);
|
|
|
|
|
var getData = function getData(type) {
|
|
|
|
|
// trend_informations_query({ category: 1, trend_type: type }).then((res) => {
|
|
|
|
|
// if (res?.status == 0) {
|
|
|
|
|
// setList(res?.item)
|
|
|
|
|
// setContent(res?.item?.content)
|
|
|
|
|
// setId(res?.item?.id)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
};
|
|
|
|
|
getData();
|
|
|
|
|
}, []);
|
|
|
|
|
var saveData = /*#__PURE__*/function () {
|
|
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
|
|
var params, res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
params = {};
|
|
|
|
|
if (active == 0) {
|
|
|
|
|
params = {
|
|
|
|
|
center_intr: content
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (active == 1) {
|
|
|
|
|
params = {
|
|
|
|
|
leader_intr: content
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (active == 2) {
|
|
|
|
|
params = {
|
|
|
|
|
contact_us: content
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
_context.next = 6;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/home/update_intr.json", {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: params
|
|
|
|
|
});
|
|
|
|
|
case 6:
|
|
|
|
|
res = _context.sent;
|
|
|
|
|
if (res.status == 0) {
|
|
|
|
|
message/* default */.ZP.success('操作成功');
|
|
|
|
|
setShowButton(true);
|
|
|
|
|
getData();
|
|
|
|
|
}
|
|
|
|
|
case 8:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee);
|
|
|
|
|
}));
|
|
|
|
|
return function saveData() {
|
|
|
|
|
return _ref2.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
|
|
var res;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
_context2.next = 2;
|
|
|
|
|
return (0,fetch/* default */.ZP)("/api/home/center.json", {
|
|
|
|
|
method: 'get'
|
|
|
|
|
});
|
|
|
|
|
case 2:
|
|
|
|
|
res = _context2.sent;
|
|
|
|
|
if (res.status == 0) {
|
|
|
|
|
data[0].content = res.data.center_intr;
|
|
|
|
|
data[1].content = res.data.leader_intr;
|
|
|
|
|
data[2].content = res.data.contact_us;
|
|
|
|
|
setData(toConsumableArray_default()(data));
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context2.stop();
|
|
|
|
|
}
|
|
|
|
|
}, _callee2);
|
|
|
|
|
}));
|
|
|
|
|
return function getData() {
|
|
|
|
|
return _ref3.apply(this, arguments);
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
|
|
className: ResearchCentermodules.page,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
@ -128,10 +188,9 @@ var Page = function Page(_ref) {
|
|
|
|
|
className: ResearchCentermodules.left_items,
|
|
|
|
|
children: data === null || data === void 0 ? void 0 : data.map(function (v, k) {
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: active == (v === null || v === void 0 ? void 0 : v.value) ? ResearchCentermodules.items_active : ResearchCentermodules.items,
|
|
|
|
|
className: active == k ? ResearchCentermodules.items_active : ResearchCentermodules.items,
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
setActive(v === null || v === void 0 ? void 0 : v.value);
|
|
|
|
|
// getData(v?.value)
|
|
|
|
|
setActive(k);
|
|
|
|
|
setShowButton(true);
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
@ -152,8 +211,9 @@ var Page = function Page(_ref) {
|
|
|
|
|
children: [showButton && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: ResearchCentermodules.updata_style,
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
var _data$active;
|
|
|
|
|
setShowButton(false);
|
|
|
|
|
getData(active);
|
|
|
|
|
setContent(data === null || data === void 0 || (_data$active = data[active]) === null || _data$active === void 0 ? void 0 : _data$active.content);
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
|
|
className: "iconfont icon-bianji-moren mr5",
|
|
|
|
|
@ -164,10 +224,10 @@ var Page = function Page(_ref) {
|
|
|
|
|
className: ResearchCentermodules.updata_text,
|
|
|
|
|
children: "\u7F16\u8F91"
|
|
|
|
|
})]
|
|
|
|
|
}), showButton && list && /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
}), showButton && (data !== null && data !== void 0 && (_data$active2 = data[active]) !== null && _data$active2 !== void 0 && _data$active2.content ? /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
className: ResearchCentermodules.render_html,
|
|
|
|
|
value: list === null || list === void 0 ? void 0 : list.content
|
|
|
|
|
}), showButton && !list && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
value: data === null || data === void 0 || (_data$active3 = data[active]) === null || _data$active3 === void 0 ? void 0 : _data$active3.content
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: ResearchCentermodules.no_data,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
|
|
src: nodata,
|
|
|
|
|
@ -176,25 +236,12 @@ var Page = function Page(_ref) {
|
|
|
|
|
className: ResearchCentermodules.right_text,
|
|
|
|
|
children: "\u5EFA\u8BBE\u4E2D\uFF0C\u656C\u8BF7\u671F\u5F85..."
|
|
|
|
|
})]
|
|
|
|
|
}), !showButton && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z, {
|
|
|
|
|
form: form,
|
|
|
|
|
scrollToFirstError: true,
|
|
|
|
|
className: ResearchCentermodules.fieldWrap,
|
|
|
|
|
onValuesChange: function onValuesChange() {
|
|
|
|
|
setContent(form.getFieldValue('content'));
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "content",
|
|
|
|
|
colon: false,
|
|
|
|
|
rules: [{
|
|
|
|
|
max: 60000,
|
|
|
|
|
message: "".concat(active == 1 ? '中心简介' : active == 2 ? '现任领导' : '联系我们', "\u6700\u5927\u9650\u523660000\u4E2A\u5B57\u7B26")
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
|
|
watch: true,
|
|
|
|
|
defaultValue: content
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})), !showButton && /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
|
|
watch: true,
|
|
|
|
|
defaultValue: content,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
setContent(e);
|
|
|
|
|
}
|
|
|
|
|
}), !showButton && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: ResearchCentermodules.button_list,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
@ -205,13 +252,7 @@ var Page = function Page(_ref) {
|
|
|
|
|
children: "\u53D6\u6D88"
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
// trend_informations_edit({ id: id, trend_information: { content: content } }).then((res) => {
|
|
|
|
|
// if (res?.status == 0) {
|
|
|
|
|
// getData(active)
|
|
|
|
|
// message.success('编辑成功')
|
|
|
|
|
// setShowButton(true)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
saveData();
|
|
|
|
|
},
|
|
|
|
|
className: ResearchCentermodules.submit_button,
|
|
|
|
|
children: "\u63D0\u4EA4"
|
|
|
|
|
@ -221,9 +262,9 @@ var Page = function Page(_ref) {
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var ResearchCenter = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
|
|
|
var user = _ref2.user,
|
|
|
|
|
globalSetting = _ref2.globalSetting;
|
|
|
|
|
/* harmony default export */ var ResearchCenter = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
|
|
var user = _ref4.user,
|
|
|
|
|
globalSetting = _ref4.globalSetting;
|
|
|
|
|
return {
|
|
|
|
|
user: user,
|
|
|
|
|
globalSetting: globalSetting
|