@bit-sun/business-component 2.3.10 → 2.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -12975,7 +12975,8 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
12975
12975
  }))))), /*#__PURE__*/React.createElement("div", {
12976
12976
  onClick: this.showModal,
12977
12977
  style: {
12978
- fontSize: 14
12978
+ fontSize: 14,
12979
+ textAlign: 'center'
12979
12980
  }
12980
12981
  }, "\u641C\u7D22\u9879\u8BBE\u7F6E"));
12981
12982
  }
@@ -13307,7 +13308,8 @@ var BsSulaQueryTable = (function (props) {
13307
13308
  overlay: /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, null, /*#__PURE__*/React.createElement("div", {
13308
13309
  onClick: sortTableRef === null || sortTableRef === void 0 ? void 0 : (_sortTableRef$current = sortTableRef.current) === null || _sortTableRef$current === void 0 ? void 0 : _sortTableRef$current.showModal,
13309
13310
  style: {
13310
- fontSize: 14
13311
+ fontSize: 14,
13312
+ textAlign: 'center'
13311
13313
  }
13312
13314
  }, "\u5217\u8BBE\u7F6E")), /*#__PURE__*/React.createElement(Menu.Item, null, /*#__PURE__*/React.createElement(SearchItemTable, {
13313
13315
  ref: searchTableRef,
@@ -15692,10 +15694,6 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
15692
15694
  _this.allFunc = /*#__PURE__*/createRef('');
15693
15695
  _this.customerMenuRef = /*#__PURE__*/createRef('');
15694
15696
  _this.actionRef = /*#__PURE__*/createRef();
15695
- _this.handleBeforeUnload = function () {
15696
- // 储存当前router信息
15697
- sessionStorage.setItem('@listenRouterState', JSON.stringify(_this.state.listenRouterState));
15698
- };
15699
15697
  _this.parseQueryString = function (queryString) {
15700
15698
  if (!queryString) {
15701
15699
  return '';
@@ -16099,49 +16097,15 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16099
16097
  },
16100
16098
  currentSubMenuData: [],
16101
16099
  showSubMenu: false,
16102
- isSlider: false,
16103
- _routerArray: routerArray
16100
+ isSlider: false
16104
16101
  };
16105
16102
  return _this;
16106
16103
  }
16107
16104
  _createClass(BasicLayout, [{
16108
- key: "componentWillMount",
16109
- value: function componentWillMount() {
16110
- var _this2 = this;
16111
- // 检查页面是否为刷新之后的
16112
- if (sessionStorage.getItem('@listenRouterState')) {
16113
- var lastListenRouterState = JSON.parse(sessionStorage.getItem('@listenRouterState')),
16114
- showListenRouterState = [],
16115
- nowItem = {};
16116
- if (lastListenRouterState.length === 1) {
16117
- sessionStorage.removeItem('@listenRouterState');
16118
- return;
16119
- }
16120
- lastListenRouterState.forEach(function (item) {
16121
- var _this2$state;
16122
- nowItem = _this2 === null || _this2 === void 0 ? void 0 : (_this2$state = _this2.state) === null || _this2$state === void 0 ? void 0 : _this2$state._routerArray.find(function (i) {
16123
- var _item$match;
16124
- return item.key === i.key || (item === null || item === void 0 ? void 0 : item.match) && (item === null || item === void 0 ? void 0 : (_item$match = item.match) === null || _item$match === void 0 ? void 0 : _item$match.path) === i.key;
16125
- });
16126
- // 详情页保留问题尚未解决
16127
- if (nowItem) {
16128
- showListenRouterState.push(_objectSpread2(_objectSpread2({}, item), {}, {
16129
- content: nowItem.content,
16130
- tab: item.tab || _this2.getPageTitle(nowItem.key)
16131
- }));
16132
- }
16133
- });
16134
- this.setState({
16135
- listenRouterState: [].concat(showListenRouterState)
16136
- });
16137
- sessionStorage.removeItem('@listenRouterState');
16138
- }
16139
- }
16140
- }, {
16141
16105
  key: "componentDidMount",
16142
16106
  value: function componentDidMount() {
16143
16107
  var _window$$wujie,
16144
- _this3 = this,
16108
+ _this2 = this,
16145
16109
  _localStorage$getItem,
16146
16110
  _localStorage$getItem2;
16147
16111
  var _this$props = this.props,
@@ -16191,11 +16155,11 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16191
16155
  // if (window.location.href.indexOf(`/${itemPath}`) === -1) return;
16192
16156
  // }
16193
16157
  if (route.pathname.startsWith("/".concat(itemPath, "/"))) return;
16194
- var _this3$state = _this3.state,
16195
- listenRouterState = _this3$state.listenRouterState,
16196
- listenRouterKey = _this3$state.listenRouterKey,
16197
- customerMatchs = _this3$state.customerMatchs,
16198
- hideMenuArray = _this3$state.hideMenuArray;
16158
+ var _this2$state = _this2.state,
16159
+ listenRouterState = _this2$state.listenRouterState,
16160
+ listenRouterKey = _this2$state.listenRouterKey,
16161
+ customerMatchs = _this2$state.customerMatchs,
16162
+ hideMenuArray = _this2$state.hideMenuArray;
16199
16163
  var newListenRouterState = _toConsumableArray(listenRouterState);
16200
16164
  var newListenRouterKey = _toConsumableArray(listenRouterKey);
16201
16165
  var replaceRouter = routerArray.filter(function (itemRoute) {
@@ -16206,7 +16170,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16206
16170
  // 处理中英文和特殊字符
16207
16171
  currentKey = decodeURIComponent(route.pathname);
16208
16172
  } else {
16209
- currentKey = decodeURIComponent(route.pathname + _this3.parseQueryString(route.search));
16173
+ currentKey = decodeURIComponent(route.pathname + _this2.parseQueryString(route.search));
16210
16174
  }
16211
16175
  if (!istParent) {
16212
16176
  var _window$$wujie2;
@@ -16226,7 +16190,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16226
16190
  replaceRouter = (_routerArray$filter = routerArray.filter(function (itemroute) {
16227
16191
  return itemroute.key === '/404';
16228
16192
  })) === null || _routerArray$filter === void 0 ? void 0 : _routerArray$filter[0];
16229
- _this3.setState({
16193
+ _this2.setState({
16230
16194
  listenRouterState: [].concat(_toConsumableArray(listenRouterState), [_objectSpread2(_objectSpread2({}, replaceRouter), {}, {
16231
16195
  key: currentKey,
16232
16196
  tab: '404'
@@ -16234,7 +16198,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16234
16198
  activeKey: currentKey,
16235
16199
  listenRouterKey: [].concat(_toConsumableArray(listenRouterKey), [currentKey])
16236
16200
  }, function () {
16237
- _this3.checkisNavSlide();
16201
+ _this2.checkisNavSlide();
16238
16202
  });
16239
16203
  } else {
16240
16204
  var match = matchPath(route.pathname, {
@@ -16244,7 +16208,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16244
16208
  query: route.query,
16245
16209
  match: match,
16246
16210
  key: currentKey,
16247
- tab: _this3.getPageTitle(route.pathname) + ''
16211
+ tab: _this2.getPageTitle(route.pathname) + ''
16248
16212
  })]);
16249
16213
  newListenRouterKey = [].concat(_toConsumableArray(listenRouterKey), [currentKey]);
16250
16214
  }
@@ -16282,13 +16246,13 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16282
16246
  localStorage.removeItem('isMenuClick');
16283
16247
  }, 0);
16284
16248
  }
16285
- _this3.setState({
16249
+ _this2.setState({
16286
16250
  //路由监听函数最后执行setState,避免处理hideMenu类型页面自动关闭的逻辑块内获取不到最新state的listenRouterState和listenRouterKey
16287
16251
  activeKey: currentKey,
16288
16252
  listenRouterState: newListenRouterState,
16289
16253
  listenRouterKey: newListenRouterKey
16290
16254
  }, function () {
16291
- _this3.checkisNavSlide();
16255
+ _this2.checkisNavSlide();
16292
16256
  });
16293
16257
  istParent = 0;
16294
16258
  });
@@ -16303,35 +16267,17 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16303
16267
  } else {
16304
16268
  history.push(location);
16305
16269
  }
16306
- try {
16307
- window.addEventListener('beforeunload', this.handleBeforeUnload);
16308
- } catch (error) {
16309
- console.log("\uD83D\uDE80 => componentDidMount => error:", error);
16310
- }
16311
16270
  }
16312
16271
  }, {
16313
16272
  key: "componentWillUnmount",
16314
16273
  value: function componentWillUnmount() {
16315
- window.removeEventListener('beforeunload', this.handleBeforeUnload);
16316
16274
  // eslint-disable-next-line no-unused-expressions
16317
16275
  UN_LISTTEN_DRP && UN_LISTTEN_DRP();
16318
16276
  }
16319
- }, {
16320
- key: "getWelcomePage",
16321
- value: function getWelcomePage() {
16322
- var homeRouter = routerArray.filter(function (itemroute) {
16323
- return itemroute.key === '/';
16324
- })[0];
16325
- return _objectSpread2(_objectSpread2({}, homeRouter), {}, {
16326
- key: '/',
16327
- tab: '欢迎',
16328
- closable: false
16329
- });
16330
- }
16331
16277
  }, {
16332
16278
  key: "render",
16333
16279
  value: function render() {
16334
- var _this4 = this;
16280
+ var _this3 = this;
16335
16281
  var _this$state4 = this.state,
16336
16282
  listenRouterState = _this$state4.listenRouterState,
16337
16283
  activeKey = _this$state4.activeKey,
@@ -16355,7 +16301,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16355
16301
  className: "tab_title_content"
16356
16302
  }, item.tab, item.key !== '/' && /*#__PURE__*/React.createElement(ItemMenu, {
16357
16303
  info: item,
16358
- operateFun: _this4.operateFun,
16304
+ operateFun: _this3.operateFun,
16359
16305
  listenRouterState: listenRouterState
16360
16306
  }));
16361
16307
  };
@@ -16389,7 +16335,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16389
16335
  }, /*#__PURE__*/React.createElement("a", {
16390
16336
  onClick: function onClick() {
16391
16337
  // 关闭全部
16392
- _this4.updateState([_objectSpread2(_objectSpread2({}, _this4.state.homeRouter), {}, {
16338
+ _this3.updateState([_objectSpread2(_objectSpread2({}, _this3.state.homeRouter), {}, {
16393
16339
  key: '/',
16394
16340
  tab: '欢迎',
16395
16341
  closable: false
@@ -16415,7 +16361,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16415
16361
  } else {
16416
16362
  newActiveKey = listenRouterState[1].key;
16417
16363
  }
16418
- _this4.updateState(listenRouterState.filter(function (d) {
16364
+ _this3.updateState(listenRouterState.filter(function (d) {
16419
16365
  return d.key !== activeKey;
16420
16366
  }), listenRouterKey.filter(function (d) {
16421
16367
  return d !== activeKey;
@@ -16442,7 +16388,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16442
16388
  // message.warning('首页不可关闭。');
16443
16389
  // return;
16444
16390
  // }
16445
- _this4.updateState(listenRouterState.filter(function (d, i) {
16391
+ _this3.updateState(listenRouterState.filter(function (d, i) {
16446
16392
  return i >= index || d.key === '/';
16447
16393
  }), listenRouterKey.filter(function (d, i) {
16448
16394
  return i >= index || d === '/';
@@ -16459,7 +16405,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16459
16405
  var index = listenRouterState.findIndex(function (item) {
16460
16406
  return item.key === activeKey;
16461
16407
  });
16462
- _this4.updateState(listenRouterState.filter(function (d, i) {
16408
+ _this3.updateState(listenRouterState.filter(function (d, i) {
16463
16409
  return i <= index || d.key === '/';
16464
16410
  }), listenRouterKey.filter(function (d, i) {
16465
16411
  return i <= index || d === '/';
@@ -16502,7 +16448,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16502
16448
  opacity: this.state.isSlider ? 1 : 0.5
16503
16449
  },
16504
16450
  onClick: function onClick() {
16505
- _this4.setTabNavTransLate(-100);
16451
+ _this3.setTabNavTransLate(-100);
16506
16452
  }
16507
16453
  }, /*#__PURE__*/React.createElement(DoubleLeftOutlined, null))),
16508
16454
  right: /*#__PURE__*/React.createElement("div", {
@@ -16511,7 +16457,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16511
16457
  },
16512
16458
  className: 'tab_right_operate',
16513
16459
  onClick: function onClick() {
16514
- _this4.setTabNavTransLate(100);
16460
+ _this3.setTabNavTransLate(100);
16515
16461
  }
16516
16462
  }, /*#__PURE__*/React.createElement(DoubleRightOutlined, null))
16517
16463
  };
@@ -16525,7 +16471,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16525
16471
  return /*#__PURE__*/React.createElement(CustomerMenuHeader, {
16526
16472
  originRoutes: originRoutes,
16527
16473
  itemPath: itemPath,
16528
- handleClose: _this4.handleClose,
16474
+ handleClose: _this3.handleClose,
16529
16475
  collapsed: collapse
16530
16476
  });
16531
16477
  },
@@ -16534,10 +16480,10 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16534
16480
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CustomerMenu, {
16535
16481
  originRoutes: originRoutes,
16536
16482
  itemPath: itemPath,
16537
- ref: _this4.customerMenuRef,
16538
- actionRef: _this4.actionRef,
16539
- handleClose: _this4.handleClose,
16540
- isCollapse: _this4.state.collapse
16483
+ ref: _this3.customerMenuRef,
16484
+ actionRef: _this3.actionRef,
16485
+ handleClose: _this3.handleClose,
16486
+ isCollapse: _this3.state.collapse
16541
16487
  }));
16542
16488
  }
16543
16489
  return /*#__PURE__*/React.createElement("div", {
@@ -16545,7 +16491,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16545
16491
  }, /*#__PURE__*/React.createElement("span", {
16546
16492
  className: "collapse_icon",
16547
16493
  onClick: function onClick() {
16548
- _this4.setState({
16494
+ _this3.setState({
16549
16495
  collapse: !collapse
16550
16496
  });
16551
16497
  }
@@ -16558,7 +16504,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16558
16504
  },
16559
16505
  collapsed: collapse,
16560
16506
  onCollapse: function onCollapse(boo) {
16561
- _this4.setState({
16507
+ _this3.setState({
16562
16508
  collapse: boo
16563
16509
  });
16564
16510
  },
@@ -16594,14 +16540,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16594
16540
  },
16595
16541
  onMouseEnter: function onMouseEnter() {
16596
16542
  if (menuItemProps.pro_layout_parentKeys && menuItemProps.pro_layout_parentKeys.length) return;
16597
- _this4.setState({
16543
+ _this3.setState({
16598
16544
  currentSubMenuData: menuItemProps.children,
16599
16545
  currentSubPath: menuItemProps.path
16600
16546
  });
16601
- _this4.setShowMenu(true);
16547
+ _this3.setShowMenu(true);
16602
16548
  },
16603
16549
  onMouseLeave: function onMouseLeave() {
16604
- _this4.setShowMenu(false);
16550
+ _this3.setShowMenu(false);
16605
16551
  }
16606
16552
  }, defaultDom, showSubMenu && currentSubPath === menuItemProps.path && !collapse && /*#__PURE__*/React.createElement(CaretLeftOutlined, {
16607
16553
  style: {
@@ -16620,7 +16566,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16620
16566
  }, '');
16621
16567
  },
16622
16568
  postMenuData: function postMenuData(menus) {
16623
- return _toConsumableArray(filterByMenuDate(menus || [], _this4.state.keyWord));
16569
+ return _toConsumableArray(filterByMenuDate(menus || [], _this3.state.keyWord));
16624
16570
  },
16625
16571
  links: [!this.state.collapse ? /*#__PURE__*/React.createElement(AllFunc$1, {
16626
16572
  ref: this.allFunc,
@@ -16694,7 +16640,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16694
16640
  tab: /*#__PURE__*/React.createElement(TabTitle, {
16695
16641
  item: item,
16696
16642
  index: index,
16697
- updateState: _this4.updateState
16643
+ updateState: _this3.updateState
16698
16644
  }),
16699
16645
  style: {
16700
16646
  marginTop: isWeiqianduan ? 0 : 30
@@ -16706,10 +16652,10 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16706
16652
  })
16707
16653
  }, /*#__PURE__*/React.createElement(WrapperComponent, {
16708
16654
  item: item,
16709
- routerProps: _this4.props,
16710
- getDictionarySource: _this4.getDictionarySource,
16711
- getDictionaryTextByValue: _this4.getDictionaryTextByValue,
16712
- timeFormat: _this4.timeFormat,
16655
+ routerProps: _this3.props,
16656
+ getDictionarySource: _this3.getDictionarySource,
16657
+ getDictionaryTextByValue: _this3.getDictionaryTextByValue,
16658
+ timeFormat: _this3.timeFormat,
16713
16659
  transparentProps: transparentProps
16714
16660
  }));
16715
16661
  })), /*#__PURE__*/React.createElement("div", {
@@ -16734,10 +16680,10 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16734
16680
  itemPath: itemPath
16735
16681
  }, drawerLeftParams)), /*#__PURE__*/React.createElement("div", {
16736
16682
  onMouseEnter: function onMouseEnter() {
16737
- _this4.setShowMenu(true);
16683
+ _this3.setShowMenu(true);
16738
16684
  },
16739
16685
  onMouseLeave: function onMouseLeave() {
16740
- _this4.setShowMenu(false);
16686
+ _this3.setShowMenu(false);
16741
16687
  },
16742
16688
  className: 'sub_menu_content',
16743
16689
  style: {
package/dist/index.js CHANGED
@@ -12994,7 +12994,8 @@ var SearchItemTable = /*#__PURE__*/function (_React$Component) {
12994
12994
  }))))), /*#__PURE__*/React__default['default'].createElement("div", {
12995
12995
  onClick: this.showModal,
12996
12996
  style: {
12997
- fontSize: 14
12997
+ fontSize: 14,
12998
+ textAlign: 'center'
12998
12999
  }
12999
13000
  }, "\u641C\u7D22\u9879\u8BBE\u7F6E"));
13000
13001
  }
@@ -13326,7 +13327,8 @@ var BsSulaQueryTable = (function (props) {
13326
13327
  overlay: /*#__PURE__*/React__default['default'].createElement(antd.Menu, null, /*#__PURE__*/React__default['default'].createElement(antd.Menu.Item, null, /*#__PURE__*/React__default['default'].createElement("div", {
13327
13328
  onClick: sortTableRef === null || sortTableRef === void 0 ? void 0 : (_sortTableRef$current = sortTableRef.current) === null || _sortTableRef$current === void 0 ? void 0 : _sortTableRef$current.showModal,
13328
13329
  style: {
13329
- fontSize: 14
13330
+ fontSize: 14,
13331
+ textAlign: 'center'
13330
13332
  }
13331
13333
  }, "\u5217\u8BBE\u7F6E")), /*#__PURE__*/React__default['default'].createElement(antd.Menu.Item, null, /*#__PURE__*/React__default['default'].createElement(SearchItemTable, {
13332
13334
  ref: searchTableRef,
@@ -15711,10 +15713,6 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
15711
15713
  _this.allFunc = /*#__PURE__*/React.createRef('');
15712
15714
  _this.customerMenuRef = /*#__PURE__*/React.createRef('');
15713
15715
  _this.actionRef = /*#__PURE__*/React.createRef();
15714
- _this.handleBeforeUnload = function () {
15715
- // 储存当前router信息
15716
- sessionStorage.setItem('@listenRouterState', JSON.stringify(_this.state.listenRouterState));
15717
- };
15718
15716
  _this.parseQueryString = function (queryString) {
15719
15717
  if (!queryString) {
15720
15718
  return '';
@@ -16118,49 +16116,15 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16118
16116
  },
16119
16117
  currentSubMenuData: [],
16120
16118
  showSubMenu: false,
16121
- isSlider: false,
16122
- _routerArray: routerArray
16119
+ isSlider: false
16123
16120
  };
16124
16121
  return _this;
16125
16122
  }
16126
16123
  _createClass(BasicLayout, [{
16127
- key: "componentWillMount",
16128
- value: function componentWillMount() {
16129
- var _this2 = this;
16130
- // 检查页面是否为刷新之后的
16131
- if (sessionStorage.getItem('@listenRouterState')) {
16132
- var lastListenRouterState = JSON.parse(sessionStorage.getItem('@listenRouterState')),
16133
- showListenRouterState = [],
16134
- nowItem = {};
16135
- if (lastListenRouterState.length === 1) {
16136
- sessionStorage.removeItem('@listenRouterState');
16137
- return;
16138
- }
16139
- lastListenRouterState.forEach(function (item) {
16140
- var _this2$state;
16141
- nowItem = _this2 === null || _this2 === void 0 ? void 0 : (_this2$state = _this2.state) === null || _this2$state === void 0 ? void 0 : _this2$state._routerArray.find(function (i) {
16142
- var _item$match;
16143
- return item.key === i.key || (item === null || item === void 0 ? void 0 : item.match) && (item === null || item === void 0 ? void 0 : (_item$match = item.match) === null || _item$match === void 0 ? void 0 : _item$match.path) === i.key;
16144
- });
16145
- // 详情页保留问题尚未解决
16146
- if (nowItem) {
16147
- showListenRouterState.push(_objectSpread2(_objectSpread2({}, item), {}, {
16148
- content: nowItem.content,
16149
- tab: item.tab || _this2.getPageTitle(nowItem.key)
16150
- }));
16151
- }
16152
- });
16153
- this.setState({
16154
- listenRouterState: [].concat(showListenRouterState)
16155
- });
16156
- sessionStorage.removeItem('@listenRouterState');
16157
- }
16158
- }
16159
- }, {
16160
16124
  key: "componentDidMount",
16161
16125
  value: function componentDidMount() {
16162
16126
  var _window$$wujie,
16163
- _this3 = this,
16127
+ _this2 = this,
16164
16128
  _localStorage$getItem,
16165
16129
  _localStorage$getItem2;
16166
16130
  var _this$props = this.props,
@@ -16210,11 +16174,11 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16210
16174
  // if (window.location.href.indexOf(`/${itemPath}`) === -1) return;
16211
16175
  // }
16212
16176
  if (route.pathname.startsWith("/".concat(itemPath, "/"))) return;
16213
- var _this3$state = _this3.state,
16214
- listenRouterState = _this3$state.listenRouterState,
16215
- listenRouterKey = _this3$state.listenRouterKey,
16216
- customerMatchs = _this3$state.customerMatchs,
16217
- hideMenuArray = _this3$state.hideMenuArray;
16177
+ var _this2$state = _this2.state,
16178
+ listenRouterState = _this2$state.listenRouterState,
16179
+ listenRouterKey = _this2$state.listenRouterKey,
16180
+ customerMatchs = _this2$state.customerMatchs,
16181
+ hideMenuArray = _this2$state.hideMenuArray;
16218
16182
  var newListenRouterState = _toConsumableArray(listenRouterState);
16219
16183
  var newListenRouterKey = _toConsumableArray(listenRouterKey);
16220
16184
  var replaceRouter = routerArray.filter(function (itemRoute) {
@@ -16225,7 +16189,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16225
16189
  // 处理中英文和特殊字符
16226
16190
  currentKey = decodeURIComponent(route.pathname);
16227
16191
  } else {
16228
- currentKey = decodeURIComponent(route.pathname + _this3.parseQueryString(route.search));
16192
+ currentKey = decodeURIComponent(route.pathname + _this2.parseQueryString(route.search));
16229
16193
  }
16230
16194
  if (!istParent) {
16231
16195
  var _window$$wujie2;
@@ -16245,7 +16209,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16245
16209
  replaceRouter = (_routerArray$filter = routerArray.filter(function (itemroute) {
16246
16210
  return itemroute.key === '/404';
16247
16211
  })) === null || _routerArray$filter === void 0 ? void 0 : _routerArray$filter[0];
16248
- _this3.setState({
16212
+ _this2.setState({
16249
16213
  listenRouterState: [].concat(_toConsumableArray(listenRouterState), [_objectSpread2(_objectSpread2({}, replaceRouter), {}, {
16250
16214
  key: currentKey,
16251
16215
  tab: '404'
@@ -16253,7 +16217,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16253
16217
  activeKey: currentKey,
16254
16218
  listenRouterKey: [].concat(_toConsumableArray(listenRouterKey), [currentKey])
16255
16219
  }, function () {
16256
- _this3.checkisNavSlide();
16220
+ _this2.checkisNavSlide();
16257
16221
  });
16258
16222
  } else {
16259
16223
  var match = matchPath(route.pathname, {
@@ -16263,7 +16227,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16263
16227
  query: route.query,
16264
16228
  match: match,
16265
16229
  key: currentKey,
16266
- tab: _this3.getPageTitle(route.pathname) + ''
16230
+ tab: _this2.getPageTitle(route.pathname) + ''
16267
16231
  })]);
16268
16232
  newListenRouterKey = [].concat(_toConsumableArray(listenRouterKey), [currentKey]);
16269
16233
  }
@@ -16301,13 +16265,13 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16301
16265
  localStorage.removeItem('isMenuClick');
16302
16266
  }, 0);
16303
16267
  }
16304
- _this3.setState({
16268
+ _this2.setState({
16305
16269
  //路由监听函数最后执行setState,避免处理hideMenu类型页面自动关闭的逻辑块内获取不到最新state的listenRouterState和listenRouterKey
16306
16270
  activeKey: currentKey,
16307
16271
  listenRouterState: newListenRouterState,
16308
16272
  listenRouterKey: newListenRouterKey
16309
16273
  }, function () {
16310
- _this3.checkisNavSlide();
16274
+ _this2.checkisNavSlide();
16311
16275
  });
16312
16276
  istParent = 0;
16313
16277
  });
@@ -16322,35 +16286,17 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16322
16286
  } else {
16323
16287
  history.push(location);
16324
16288
  }
16325
- try {
16326
- window.addEventListener('beforeunload', this.handleBeforeUnload);
16327
- } catch (error) {
16328
- console.log("\uD83D\uDE80 => componentDidMount => error:", error);
16329
- }
16330
16289
  }
16331
16290
  }, {
16332
16291
  key: "componentWillUnmount",
16333
16292
  value: function componentWillUnmount() {
16334
- window.removeEventListener('beforeunload', this.handleBeforeUnload);
16335
16293
  // eslint-disable-next-line no-unused-expressions
16336
16294
  UN_LISTTEN_DRP && UN_LISTTEN_DRP();
16337
16295
  }
16338
- }, {
16339
- key: "getWelcomePage",
16340
- value: function getWelcomePage() {
16341
- var homeRouter = routerArray.filter(function (itemroute) {
16342
- return itemroute.key === '/';
16343
- })[0];
16344
- return _objectSpread2(_objectSpread2({}, homeRouter), {}, {
16345
- key: '/',
16346
- tab: '欢迎',
16347
- closable: false
16348
- });
16349
- }
16350
16296
  }, {
16351
16297
  key: "render",
16352
16298
  value: function render() {
16353
- var _this4 = this;
16299
+ var _this3 = this;
16354
16300
  var _this$state4 = this.state,
16355
16301
  listenRouterState = _this$state4.listenRouterState,
16356
16302
  activeKey = _this$state4.activeKey,
@@ -16374,7 +16320,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16374
16320
  className: "tab_title_content"
16375
16321
  }, item.tab, item.key !== '/' && /*#__PURE__*/React__default['default'].createElement(ItemMenu, {
16376
16322
  info: item,
16377
- operateFun: _this4.operateFun,
16323
+ operateFun: _this3.operateFun,
16378
16324
  listenRouterState: listenRouterState
16379
16325
  }));
16380
16326
  };
@@ -16408,7 +16354,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16408
16354
  }, /*#__PURE__*/React__default['default'].createElement("a", {
16409
16355
  onClick: function onClick() {
16410
16356
  // 关闭全部
16411
- _this4.updateState([_objectSpread2(_objectSpread2({}, _this4.state.homeRouter), {}, {
16357
+ _this3.updateState([_objectSpread2(_objectSpread2({}, _this3.state.homeRouter), {}, {
16412
16358
  key: '/',
16413
16359
  tab: '欢迎',
16414
16360
  closable: false
@@ -16434,7 +16380,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16434
16380
  } else {
16435
16381
  newActiveKey = listenRouterState[1].key;
16436
16382
  }
16437
- _this4.updateState(listenRouterState.filter(function (d) {
16383
+ _this3.updateState(listenRouterState.filter(function (d) {
16438
16384
  return d.key !== activeKey;
16439
16385
  }), listenRouterKey.filter(function (d) {
16440
16386
  return d !== activeKey;
@@ -16461,7 +16407,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16461
16407
  // message.warning('首页不可关闭。');
16462
16408
  // return;
16463
16409
  // }
16464
- _this4.updateState(listenRouterState.filter(function (d, i) {
16410
+ _this3.updateState(listenRouterState.filter(function (d, i) {
16465
16411
  return i >= index || d.key === '/';
16466
16412
  }), listenRouterKey.filter(function (d, i) {
16467
16413
  return i >= index || d === '/';
@@ -16478,7 +16424,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16478
16424
  var index = listenRouterState.findIndex(function (item) {
16479
16425
  return item.key === activeKey;
16480
16426
  });
16481
- _this4.updateState(listenRouterState.filter(function (d, i) {
16427
+ _this3.updateState(listenRouterState.filter(function (d, i) {
16482
16428
  return i <= index || d.key === '/';
16483
16429
  }), listenRouterKey.filter(function (d, i) {
16484
16430
  return i <= index || d === '/';
@@ -16521,7 +16467,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16521
16467
  opacity: this.state.isSlider ? 1 : 0.5
16522
16468
  },
16523
16469
  onClick: function onClick() {
16524
- _this4.setTabNavTransLate(-100);
16470
+ _this3.setTabNavTransLate(-100);
16525
16471
  }
16526
16472
  }, /*#__PURE__*/React__default['default'].createElement(icons.DoubleLeftOutlined, null))),
16527
16473
  right: /*#__PURE__*/React__default['default'].createElement("div", {
@@ -16530,7 +16476,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16530
16476
  },
16531
16477
  className: 'tab_right_operate',
16532
16478
  onClick: function onClick() {
16533
- _this4.setTabNavTransLate(100);
16479
+ _this3.setTabNavTransLate(100);
16534
16480
  }
16535
16481
  }, /*#__PURE__*/React__default['default'].createElement(icons.DoubleRightOutlined, null))
16536
16482
  };
@@ -16544,7 +16490,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16544
16490
  return /*#__PURE__*/React__default['default'].createElement(CustomerMenuHeader, {
16545
16491
  originRoutes: originRoutes,
16546
16492
  itemPath: itemPath,
16547
- handleClose: _this4.handleClose,
16493
+ handleClose: _this3.handleClose,
16548
16494
  collapsed: collapse
16549
16495
  });
16550
16496
  },
@@ -16553,10 +16499,10 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16553
16499
  return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(CustomerMenu, {
16554
16500
  originRoutes: originRoutes,
16555
16501
  itemPath: itemPath,
16556
- ref: _this4.customerMenuRef,
16557
- actionRef: _this4.actionRef,
16558
- handleClose: _this4.handleClose,
16559
- isCollapse: _this4.state.collapse
16502
+ ref: _this3.customerMenuRef,
16503
+ actionRef: _this3.actionRef,
16504
+ handleClose: _this3.handleClose,
16505
+ isCollapse: _this3.state.collapse
16560
16506
  }));
16561
16507
  }
16562
16508
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -16564,7 +16510,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16564
16510
  }, /*#__PURE__*/React__default['default'].createElement("span", {
16565
16511
  className: "collapse_icon",
16566
16512
  onClick: function onClick() {
16567
- _this4.setState({
16513
+ _this3.setState({
16568
16514
  collapse: !collapse
16569
16515
  });
16570
16516
  }
@@ -16577,7 +16523,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16577
16523
  },
16578
16524
  collapsed: collapse,
16579
16525
  onCollapse: function onCollapse(boo) {
16580
- _this4.setState({
16526
+ _this3.setState({
16581
16527
  collapse: boo
16582
16528
  });
16583
16529
  },
@@ -16613,14 +16559,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16613
16559
  },
16614
16560
  onMouseEnter: function onMouseEnter() {
16615
16561
  if (menuItemProps.pro_layout_parentKeys && menuItemProps.pro_layout_parentKeys.length) return;
16616
- _this4.setState({
16562
+ _this3.setState({
16617
16563
  currentSubMenuData: menuItemProps.children,
16618
16564
  currentSubPath: menuItemProps.path
16619
16565
  });
16620
- _this4.setShowMenu(true);
16566
+ _this3.setShowMenu(true);
16621
16567
  },
16622
16568
  onMouseLeave: function onMouseLeave() {
16623
- _this4.setShowMenu(false);
16569
+ _this3.setShowMenu(false);
16624
16570
  }
16625
16571
  }, defaultDom, showSubMenu && currentSubPath === menuItemProps.path && !collapse && /*#__PURE__*/React__default['default'].createElement(icons.CaretLeftOutlined, {
16626
16572
  style: {
@@ -16639,7 +16585,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16639
16585
  }, '');
16640
16586
  },
16641
16587
  postMenuData: function postMenuData(menus) {
16642
- return _toConsumableArray(filterByMenuDate(menus || [], _this4.state.keyWord));
16588
+ return _toConsumableArray(filterByMenuDate(menus || [], _this3.state.keyWord));
16643
16589
  },
16644
16590
  links: [!this.state.collapse ? /*#__PURE__*/React__default['default'].createElement(AllFunc$1, {
16645
16591
  ref: this.allFunc,
@@ -16713,7 +16659,7 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16713
16659
  tab: /*#__PURE__*/React__default['default'].createElement(TabTitle, {
16714
16660
  item: item,
16715
16661
  index: index,
16716
- updateState: _this4.updateState
16662
+ updateState: _this3.updateState
16717
16663
  }),
16718
16664
  style: {
16719
16665
  marginTop: isWeiqianduan ? 0 : 30
@@ -16725,10 +16671,10 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16725
16671
  })
16726
16672
  }, /*#__PURE__*/React__default['default'].createElement(WrapperComponent, {
16727
16673
  item: item,
16728
- routerProps: _this4.props,
16729
- getDictionarySource: _this4.getDictionarySource,
16730
- getDictionaryTextByValue: _this4.getDictionaryTextByValue,
16731
- timeFormat: _this4.timeFormat,
16674
+ routerProps: _this3.props,
16675
+ getDictionarySource: _this3.getDictionarySource,
16676
+ getDictionaryTextByValue: _this3.getDictionaryTextByValue,
16677
+ timeFormat: _this3.timeFormat,
16732
16678
  transparentProps: transparentProps
16733
16679
  }));
16734
16680
  })), /*#__PURE__*/React__default['default'].createElement("div", {
@@ -16753,10 +16699,10 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
16753
16699
  itemPath: itemPath
16754
16700
  }, drawerLeftParams)), /*#__PURE__*/React__default['default'].createElement("div", {
16755
16701
  onMouseEnter: function onMouseEnter() {
16756
- _this4.setShowMenu(true);
16702
+ _this3.setShowMenu(true);
16757
16703
  },
16758
16704
  onMouseLeave: function onMouseLeave() {
16759
- _this4.setShowMenu(false);
16705
+ _this3.setShowMenu(false);
16760
16706
  },
16761
16707
  className: 'sub_menu_content',
16762
16708
  style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.3.10",
3
+ "version": "2.3.12",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -324,41 +324,9 @@ class BasicLayout extends React.PureComponent {
324
324
  currentSubMenuData: [],
325
325
  showSubMenu: false,
326
326
  isSlider: false,
327
- _routerArray: routerArray
328
327
  };
329
328
  }
330
329
 
331
- componentWillMount() {
332
- // 检查页面是否为刷新之后的
333
- if (sessionStorage.getItem('@listenRouterState')) {
334
- let lastListenRouterState = JSON.parse(sessionStorage.getItem('@listenRouterState')),
335
- showListenRouterState = [],
336
- nowItem = {};
337
- if (lastListenRouterState.length === 1) {
338
- sessionStorage.removeItem('@listenRouterState');
339
- return
340
- }
341
- lastListenRouterState.forEach((item: any) => {
342
- nowItem = this?.state?._routerArray.find((i: any) =>
343
- item.key === i.key ||
344
- (item?.match && item?.match?.path === i.key)
345
- );
346
- // 详情页保留问题尚未解决
347
- if (nowItem) {
348
- showListenRouterState.push({
349
- ...item,
350
- content: nowItem.content,
351
- tab: item.tab || this.getPageTitle(nowItem.key)
352
- })
353
- }
354
- });
355
- this.setState({
356
- listenRouterState: [ ...showListenRouterState ]
357
- });
358
- sessionStorage.removeItem('@listenRouterState');
359
- }
360
- }
361
-
362
330
  componentDidMount() {
363
331
  const {
364
332
  history,
@@ -553,32 +521,13 @@ class BasicLayout extends React.PureComponent {
553
521
  } else {
554
522
  history.push(location);
555
523
  }
556
-
557
- try {
558
- window.addEventListener('beforeunload', this.handleBeforeUnload);
559
- } catch (error) {
560
- console.log(`🚀 => componentDidMount => error:`, error)
561
- }
562
524
  }
563
525
 
564
526
  componentWillUnmount() {
565
- window.removeEventListener('beforeunload', this.handleBeforeUnload);
566
527
  // eslint-disable-next-line no-unused-expressions
567
528
  UN_LISTTEN_DRP && UN_LISTTEN_DRP();
568
529
  }
569
530
 
570
- handleBeforeUnload = () => {
571
- // 储存当前router信息
572
- sessionStorage.setItem('@listenRouterState', JSON.stringify(this.state.listenRouterState))
573
- }
574
-
575
- getWelcomePage() {
576
- const homeRouter = routerArray.filter(
577
- (itemroute) => itemroute.key === '/',
578
- )[0];
579
- return { ...homeRouter, key: '/', tab: '欢迎', closable: false }
580
- }
581
-
582
531
  parseQueryString = (queryString) => {
583
532
  if (!queryString) {
584
533
  return '';
@@ -555,7 +555,7 @@ class SearchItemTable extends React.Component {
555
555
  </div>
556
556
  </Modal>
557
557
  )}
558
- <div onClick={this.showModal} style={{fontSize:14}}>搜索项设置</div>
558
+ <div onClick={this.showModal} style={{fontSize:14, textAlign: 'center'}}>搜索项设置</div>
559
559
  </div>
560
560
  );
561
561
  }
@@ -369,9 +369,12 @@ export default (props: any) => {
369
369
  children: (
370
370
  <span className="ant-dropdown-link">
371
371
  <Dropdown overlay={
372
- <Menu >
372
+ <Menu>
373
373
  <Menu.Item>
374
- <div onClick={sortTableRef?.current?.showModal} style={{fontSize:14}}>列设置</div>
374
+ <div
375
+ onClick={sortTableRef?.current?.showModal}
376
+ style={{fontSize:14, textAlign: 'center'}}
377
+ >列设置</div>
375
378
  </Menu.Item>
376
379
  <Menu.Item>
377
380
  <SearchItemTable