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__Materials__Index__index....

317 lines
16 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[40665],{
/***/ 28663:
/*!*********************************************************!*\
!*** ./src/pages/Materials/Index/index.tsx + 2 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 */ Index; }
});
// 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);
;// CONCATENATED MODULE: ./src/pages/Materials/Index/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Indexmodules = ({"flex_box_center":"flex_box_center___8xiZJ","flex_space_between":"flex_space_between___EMAgA","flex_box_vertical_center":"flex_box_vertical_center___g0rJN","flex_box_center_end":"flex_box_center_end___zq8m9","flex_box_column":"flex_box_column___zTz5T","flex-col":"flex-col___Ei7kx","flex-row":"flex-row___TB3_d","justify-start":"justify-start___IyOga","justify-center":"justify-center___VQC2q","justify-end":"justify-end___vL3U7","justify-evenly":"justify-evenly___AGuju","justify-around":"justify-around___QgCxW","justify-between":"justify-between___JlU3K","align-start":"align-start___eQmQP","align-center":"align-center___NJMKx","align-end":"align-end___b6pwW","all_box":"all_box___Zzniq","wrap":"wrap___iS9Ds","left":"left___uwJ18","home":"home___h4pJO","info":"info___ajb2g","right":"right___ZLCec","search-bar":"search-bar___GkyTq"});
;// CONCATENATED MODULE: ./src/pages/Materials/Index/index2.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
var input = __webpack_require__(92832);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(88271);
// 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/Materials/Index/index.tsx
var logo = __webpack_require__(/*! @/../public/images/materials/logo.png */ 12017);
var Search = input/* default */.Z.Search;
var Engineering = function Engineering(_ref) {
var _user$userInfo, _user$userInfo2, _user$userInfo3, _user$userInfo4, _user$userInfo5, _user$userInfo6;
var user = _ref.user,
globalSetting = _ref.globalSetting,
engineering = _ref.engineering,
dispatch = _ref.dispatch;
var location = (0,_umi_production_exports.useLocation)();
var _useState = (0,_react_17_0_2_react.useState)(1),
_useState2 = slicedToArray_default()(_useState, 2),
menuKey = _useState2[0],
setMenuKey = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
openSearch = _useState4[0],
setOpenSearch = _useState4[1];
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
searchParams = _useSearchParams2[0];
function onGlobalSearch(value) {
_umi_production_exports.history.push('/search?value=' + value);
}
var SearchInput = function SearchInput() {
if (openSearch && !hideSearch) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onBlur: function onBlur() {
setTimeout(function () {
setOpenSearch(false);
}, 300);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(Search, {
placeholder: "\u5B9E\u8DF5\u8BFE\u7A0B/\u6559\u5B66\u8BFE\u5802/\u5B9E\u8DF5\u9879\u76EE/\u4EA4\u6D41\u95EE\u7B54",
className: "search-input mr20",
onSearch: onGlobalSearch,
autoFocus: true
})
});
} else {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconfont icon-sousuo font18 current ml15 mr15",
onClick: function onClick() {
// setOpenSearch(true)
_umi_production_exports.history.push('/search?value=');
}
});
}
};
(0,_react_17_0_2_react.useEffect)(function () {
if (location.pathname == '/materials') {
_umi_production_exports.history.replace('/materials/itemAssets');
}
setMenuKey(function (e) {
return e + 1;
});
}, [location.pathname]);
(0,_react_17_0_2_react.useEffect)(function () {
dispatch({
type: 'globalSetting/headerFooterToggle',
payload: false
});
return function () {
dispatch({
type: 'globalSetting/headerFooterToggle',
payload: true
});
};
}, []);
function getItem(label, key, icon, children, type) {
return {
key: key,
icon: icon,
children: children,
label: label,
type: type
};
}
var items = [getItem('物资领用', '/materials/itemAssets', /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-shiyanshiyuyue"
})), getItem('我的物资领用', '/materials/myReceive', /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-wodelingyongshenqing"
})), getItem('我的采购建议', '/materials/myProcure', /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-wodecaigoushenqing"
})), ((user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.classroom_center_auth) || (user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.classroom_auth)) && getItem('工作台', 'workbench', /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-wodegongzuotai"
}), [getItem('物资类别管理', '/materials/itemAssetsType'), getItem('物资', '/materials/itemAssetsList'), getItem('领用申请管理', '/materials/receive'), getItem('采购申请管理', '/materials/procure'), getItem('入账管理', '/materials/entry'), getItem('操作日志', '/materials/log')])];
// 获取所有二级菜单项的key
var allSubMenuKeys = items.filter(function (item) {
return item === null || item === void 0 ? void 0 : item.children;
}).map(function (item) {
return item.key;
});
var isSelected = function isSelected(path) {
//
if (searchParams.get("backUrl")) {
if (path === "/materials/itemAssets" && (searchParams.get("backUrl").indexOf("itemAssetsList") > -1 || searchParams.get("backUrl").indexOf("itemAssetsType") > -1)) {
return false;
}
return searchParams.get("backUrl").indexOf(path) > -1 ? true : false;
}
if (location.pathname.indexOf(path) > -1) {
if (path === "/materials/itemAssets" && (location.pathname.indexOf("itemAssetsList") > -1 || location.pathname.indexOf("itemAssetsType") > -1)) {
return false;
}
return true;
} else {
return false;
}
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(Indexmodules.all_box, " materials-wrp"),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(HeaderNav/* default */.Z, {
title: "\u7269\u8D44\u7BA1\u7406",
goBackUrl: '/laboratoryOverview',
imgUrl: logo
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Indexmodules.wrap,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Indexmodules.left,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "block_1 flex-col",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text_8",
children: "\u65E5\u5E38\u5DE5\u4F5C\u53F0"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/itemAssets") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
to: "/materials/itemAssets",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "iconzzxy icon-zzxy-wuziguanli"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text_5",
children: "\u7269\u8D44\u9886\u7528"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/myReceive") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
to: "/materials/myReceive",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-wodewuzilingyong"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text_5",
children: "\u6211\u7684\u7269\u8D44\u9886\u7528"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/myProcure") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
to: "/materials/myProcure",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-wodecaigoujianyi"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text_5",
children: "\u6211\u7684\u91C7\u8D2D\u5EFA\u8BAE"
})]
})
}), ((user === null || user === void 0 || (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.classroom_center_auth) || (user === null || user === void 0 || (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.classroom_auth)) && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text_8",
children: "\u7BA1\u7406\u5DE5\u4F5C\u53F0"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/itemAssetsType") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(_umi_production_exports.Link, {
to: "/materials/itemAssetsType",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-wuzileibieguanli"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text_5",
children: "\u7269\u8D44\u7C7B\u522B\u7BA1\u7406"
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/itemAssetsList") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/materials/itemAssetsList",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "image-text_19 flex-row justify-between",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-wuziguanli"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text-group_1 text_5",
children: "\u7269\u8D44\u7BA1\u7406"
})]
})
})
}), (user === null || user === void 0 || (_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.admin_and_review) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/receive") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/materials/receive",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "image-text_20 flex-row justify-between",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-lingyongshenqingguanli"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text-group_2 text_5",
children: "\u9886\u7528\u7533\u8BF7\u7BA1\u7406"
})]
})
})
}), (user === null || user === void 0 || (_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.admin_and_review) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/procure") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/materials/procure",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "image-text_21 flex-row justify-between",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-caigoujianyiguanli"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text-group_3 text_5",
children: "\u91C7\u8D2D\u5EFA\u8BAE\u7BA1\u7406"
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/entry") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/materials/entry",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "image-text_22 flex-row justify-between",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-ruzhangguanli"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text-group_4 text_5",
children: "\u5165\u8D26\u7BA1\u7406"
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(isSelected("/materials/log") ? "section_7" : "section_8", " flex-row"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/materials/log",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "image-text_23 flex-row justify-between",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zzxy-caozuorizhi"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "text-group_5 text_5",
children: "\u64CD\u4F5C\u65E5\u5FD7"
})]
})
})
})]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Indexmodules.right,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {})
})]
})]
});
};
/* harmony default export */ var Index = ((0,_umi_production_exports.connect)(function (_ref2) {
var globalSetting = _ref2.globalSetting,
user = _ref2.user,
engineering = _ref2.engineering,
dispatch = _ref2.dispatch;
return {
user: user,
globalSetting: globalSetting,
engineering: engineering,
dispatch: dispatch
};
})(Engineering));
/***/ })
}]);