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.
NewEduCoderBuild/p__OfficialList__index.e4e4...

342 lines
16 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[5808],{
/***/ 85852:
/*!******************************************************!*\
!*** ./src/pages/OfficialList/index.tsx + 1 modules ***!
\******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ OfficialList; }
});
// 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/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(88271);
;// CONCATENATED MODULE: ./src/pages/OfficialList/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var OfficialListmodules = ({"officialNotice":"officialNotice___aPu5P","nav_add":"nav_add___MOSy5","content":"content___WYYge","content_left":"content_left___IDSCJ","menu_item_no":"menu_item_no___En8Cu","menu_item_yes":"menu_item_yes____O6A9","menu_item":"menu_item___EwUiB","content_right":"content_right___fREBG","div_two":"div_two___gjlAu","two_item":"two_item___h54Zk","two_img":"two_img___cBgt8","two_text":"two_text___Mghla","two_time":"two_time___DWfwV","time_year":"time_year___lD5w4","time_month":"time_month___nTMBD","div_one":"div_one___K4jEm","one_item":"one_item___pCRop","one_img":"one_img___lNghr","one_text":"one_text___J7ce_","one_title":"one_title___WSpHH","one_neirong":"one_neirong___aPVXr","one_time":"one_time___QxD0Q"});
// EXTERNAL MODULE: ./src/pages/OfficialNotice/img/bg_top.png
var bg_top = __webpack_require__(25399);
// EXTERNAL MODULE: ./src/pages/OfficialNotice/img/bg_bottom.png
var bg_bottom = __webpack_require__(21634);
// EXTERNAL MODULE: ./src/pages/OfficialNotice/OfficialModal/index.tsx
var OfficialModal = __webpack_require__(73961);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(58421);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(95972);
// EXTERNAL MODULE: ./src/service/broadcast.ts
var broadcast = __webpack_require__(27895);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(69423);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.13@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(61186);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./src/components/HeaderNav/index.tsx + 4 modules
var HeaderNav = __webpack_require__(59827);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/OfficialList/index.tsx
var OfficialNotice = function OfficialNotice(_ref) {
var user = _ref.user,
dispatch = _ref.dispatch;
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
menuName = _useState2[0],
setMenuName = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)({
page: 1,
limit: 20
}),
_useState4 = slicedToArray_default()(_useState3, 2),
params = _useState4[0],
setParams = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(0),
_useState6 = slicedToArray_default()(_useState5, 2),
total = _useState6[0],
setTotal = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
tableData = _useState8[0],
setTableData = _useState8[1];
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
var handleChangePage = function handleChangePage(page, pageSize) {
params.page = page;
params.limit = pageSize;
setParams(objectSpread2_default()({}, params));
};
(0,_react_17_0_2_react.useEffect)(function () {
if (menuName) {
getData();
}
}, [menuName, params]);
(0,_react_17_0_2_react.useEffect)(function () {
if (searchParams.get("indexType")) {
setMenuName(searchParams.get("indexType"));
} else {
setMenuName('news');
}
}, []);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,broadcast/* broadcasts_query */.u$)(objectSpread2_default()({
type: 'public',
keyword: '',
source: 'broadcast',
category: menuName
}, params)).then(function (res) {
if ((res === null || res === void 0 ? void 0 : res.status) == 0) {
var _res$data, _res$data2;
setTotal(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.count);
setTableData(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list);
}
});
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var addDom = function addDom() {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.nav_add,
onClick: function onClick() {
dispatch({
type: 'account/setActionTabs',
payload: {
key: '发布公告'
}
});
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: __webpack_require__(/*! ../OfficialNotice/img/fabu.png */ 457),
style: {
width: '2.5vh',
height: '2.5vh'
}
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
marginLeft: '0.6vw',
fontSize: '1.4vh',
color: '#fff'
},
children: "\u53D1\u5E03\u516C\u544A"
})]
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.officialNotice,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(HeaderNav/* default */.Z, {
addDom: addDom,
goBackUrl: '/officialNotice',
imgUrl: __webpack_require__(/*! ../OfficialNotice/img/biaoti.png */ 50801)
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.content,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.content_left,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(OfficialListmodules.menu_item, " ").concat(menuName == 'news' ? OfficialListmodules.menu_item_yes : OfficialListmodules.menu_item_no),
onClick: function onClick() {
setMenuName('news');
params.page = 1;
setParams(objectSpread2_default()({}, params));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-xueyuanyaowen mr10"
}), "\u5B66\u9662\u8981\u95FB"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(OfficialListmodules.menu_item, " ").concat(menuName == 'developments' ? OfficialListmodules.menu_item_yes : OfficialListmodules.menu_item_no),
onClick: function onClick() {
setMenuName('developments');
params.page = 1;
setParams(objectSpread2_default()({}, params));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-xueyuandongtai mr10"
}), "\u5B66\u9662\u52A8\u6001"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(OfficialListmodules.menu_item, " ").concat(menuName == 'notice' ? OfficialListmodules.menu_item_yes : OfficialListmodules.menu_item_no),
onClick: function onClick() {
setMenuName('notice');
params.page = 1;
setParams(objectSpread2_default()({}, params));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-tongzhigonggao mr10"
}), "\u901A\u77E5\u516C\u544A"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.content_right,
style: {
backgroundImage: "url(".concat(menuName == 'notice' ? bg_bottom : bg_top, ")")
},
children: [menuName == 'notice' ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.div_two,
children: tableData === null || tableData === void 0 ? void 0 : tableData.map(function (item, index) {
var _item$bg, _item$bg2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.two_item,
onClick: function onClick() {
return (0,util/* openNewWindow */.xg)("/broadcast/".concat(item === null || item === void 0 ? void 0 : item.id, "/detail"));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: item !== null && item !== void 0 && (_item$bg = item.bg) !== null && _item$bg !== void 0 && _item$bg.url ? env/* default */.Z.API_SERVER + (item === null || item === void 0 || (_item$bg2 = item.bg) === null || _item$bg2 === void 0 ? void 0 : _item$bg2.url) : __webpack_require__(/*! ../OfficialNotice/img/mock_img.png */ 86738),
className: OfficialListmodules.two_img
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "topLeft",
title: item === null || item === void 0 ? void 0 : item.name,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.two_text,
children: item === null || item === void 0 ? void 0 : item.name
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.two_time,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.time_year,
children: dayjs_min_default()(item === null || item === void 0 ? void 0 : item.created_at).format('YYYY')
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.time_month,
children: dayjs_min_default()(item === null || item === void 0 ? void 0 : item.created_at).format('MM-DD')
})]
})]
}, index);
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.div_one,
children: tableData === null || tableData === void 0 ? void 0 : tableData.map(function (item, index) {
var _item$bg3, _item$bg4;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.one_item,
onClick: function onClick() {
return (0,util/* openNewWindow */.xg)("/broadcast/".concat(item === null || item === void 0 ? void 0 : item.id, "/detail"));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: item !== null && item !== void 0 && (_item$bg3 = item.bg) !== null && _item$bg3 !== void 0 && _item$bg3.url ? env/* default */.Z.API_SERVER + (item === null || item === void 0 || (_item$bg4 = item.bg) === null || _item$bg4 === void 0 ? void 0 : _item$bg4.url) : __webpack_require__(/*! ../OfficialNotice/img/mock_img.png */ 86738),
className: OfficialListmodules.one_img
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.one_text,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "topLeft",
title: item === null || item === void 0 ? void 0 : item.name,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.one_title,
children: item === null || item === void 0 ? void 0 : item.name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
placement: "topLeft",
title: item === null || item === void 0 ? void 0 : item.subtitle,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.one_neirong,
children: item === null || item === void 0 ? void 0 : item.subtitle
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: OfficialListmodules.one_time,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.time_year,
children: dayjs_min_default()(item === null || item === void 0 ? void 0 : item.created_at).format('YYYY')
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: OfficialListmodules.time_month,
children: dayjs_min_default()(item === null || item === void 0 ? void 0 : item.created_at).format('MM-DD')
})]
})]
}, index);
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
className: "mt20",
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ['10', '20', '50', '100', '200'],
total: total,
onChange: handleChangePage,
pageSize: params.limit,
current: params.page
// hideOnSinglePage={!total}
,
showTotal: util/* showTotal */.rU
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(OfficialModal/* default */.Z, {
getData: getData
})]
});
};
/* harmony default export */ var OfficialList = ((0,_umi_production_exports.connect)(function (_ref3) {
var user = _ref3.user;
return {
user: user
};
})(OfficialNotice));
/***/ }),
/***/ 21634:
/*!****************************************************!*\
!*** ./src/pages/OfficialNotice/img/bg_bottom.png ***!
\****************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/bg_bottom.ad8567a0.png";
/***/ }),
/***/ 25399:
/*!*************************************************!*\
!*** ./src/pages/OfficialNotice/img/bg_top.png ***!
\*************************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/bg_top.d6dde0ed.png";
/***/ })
}]);