@bit-sun/business-component 2.2.11 → 2.2.13

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
@@ -18007,10 +18007,14 @@ var BsSulaQueryTable = (function (props) {
18007
18007
  // 获取table高度
18008
18008
  var getTableHeight = function getTableHeight() {
18009
18009
  setTimeout(function () {
18010
- var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
18010
+ var _window$top, _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
18011
18011
  var cancelHeight = window.top == window ? 303 : 223;
18012
18012
  var isFullScreen = window.top.document.fullScreen || window.top.document.webkitIsFullScreen || window.top.document.mozFullScreen;
18013
- var h = document.body.clientHeight - (((_document$querySelect = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 0) - (((_document$querySelect2 = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 0) - (((_document$querySelect3 = document.querySelector(".ant-tabs-tabpane-active .ant-form ant-form-horizontal")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0) - (isFullScreen ? 0 : ((_document$querySelect4 = document.querySelector(".ant-tabs-tabpane-active .ant-pro-page-container-warp")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 0) - cancelHeight + 'px';
18013
+ // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
18014
+ var realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : ((_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.document.body.clientHeight) - 76;
18015
+ var summaryHeight = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary") ? ((_document$querySelect = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 22 : 0;
18016
+ var listTabHeight = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav") ? ((_document$querySelect2 = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 48 : 0;
18017
+ var h = realIframeClientHeight - summaryHeight - listTabHeight - (((_document$querySelect3 = document.querySelector(".ant-tabs-tabpane-active .ant-form ant-form-horizontal")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0) - (isFullScreen ? 0 : ((_document$querySelect4 = document.querySelector(".ant-tabs-tabpane-active .ant-pro-page-container-warp")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 0) - cancelHeight + 'px';
18014
18018
  setHeight(h);
18015
18019
  setValue(_objectSpread2({}, value));
18016
18020
  }, 0);
@@ -21069,7 +21073,8 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21069
21073
  value: function componentDidMount() {
21070
21074
  var _window$$wujie,
21071
21075
  _this2 = this,
21072
- _localStorage$getItem;
21076
+ _localStorage$getItem,
21077
+ _localStorage$getItem2;
21073
21078
  var _this$props = this.props,
21074
21079
  history = _this$props.history,
21075
21080
  location = _this$props.location,
@@ -21096,7 +21101,6 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21096
21101
  // }
21097
21102
  // });
21098
21103
  (_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.bus.$on("main-route-change", function (appname, info) {
21099
- console.log('$on main route change ----------------------------', appname, info);
21100
21104
  if (appname === itemPath) {
21101
21105
  istParent = 1;
21102
21106
  if (info.type === 'main') {
@@ -21214,10 +21218,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21214
21218
  });
21215
21219
  istParent = 0;
21216
21220
  });
21217
- if (localStorage.getItem('firstPage') && ((_localStorage$getItem = localStorage.getItem('firstPage')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("#/".concat(itemPath, "/")))) {
21218
- var _localStorage$getItem2;
21221
+ if (localStorage.getItem('mainRoutePath') && ((_localStorage$getItem = localStorage.getItem('mainRoutePath')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("/".concat(itemPath, "/")))) {
21219
21222
  istParent = 1;
21220
- history.push((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.slice(1).replace(/^\/\w+\//, '/'));
21223
+ history.push(localStorage.getItem('mainRoutePath').replace(/^\/\w+\//, '/'));
21224
+ } else if (localStorage.getItem('firstPage') && ((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.startsWith("#/".concat(itemPath, "/")))) {
21225
+ var _localStorage$getItem3;
21226
+ // 暂时保留,兼容老版本
21227
+ istParent = 1;
21228
+ history.push((_localStorage$getItem3 = localStorage.getItem('firstPage')) === null || _localStorage$getItem3 === void 0 ? void 0 : _localStorage$getItem3.slice(1).replace(/^\/\w+\//, '/'));
21221
21229
  } else {
21222
21230
  history.push(location);
21223
21231
  }
package/dist/index.js CHANGED
@@ -18025,10 +18025,14 @@ var BsSulaQueryTable = (function (props) {
18025
18025
  // 获取table高度
18026
18026
  var getTableHeight = function getTableHeight() {
18027
18027
  setTimeout(function () {
18028
- var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
18028
+ var _window$top, _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
18029
18029
  var cancelHeight = window.top == window ? 303 : 223;
18030
18030
  var isFullScreen = window.top.document.fullScreen || window.top.document.webkitIsFullScreen || window.top.document.mozFullScreen;
18031
- var h = document.body.clientHeight - (((_document$querySelect = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 0) - (((_document$querySelect2 = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 0) - (((_document$querySelect3 = document.querySelector(".ant-tabs-tabpane-active .ant-form ant-form-horizontal")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0) - (isFullScreen ? 0 : ((_document$querySelect4 = document.querySelector(".ant-tabs-tabpane-active .ant-pro-page-container-warp")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 0) - cancelHeight + 'px';
18031
+ // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
18032
+ var realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : ((_window$top = window.top) === null || _window$top === void 0 ? void 0 : _window$top.document.body.clientHeight) - 76;
18033
+ var summaryHeight = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary") ? ((_document$querySelect = document.querySelector(".ant-tabs-tabpane-active .table-bssula-summary")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 22 : 0;
18034
+ var listTabHeight = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav") ? ((_document$querySelect2 = document.querySelector(".ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 48 : 0;
18035
+ var h = realIframeClientHeight - summaryHeight - listTabHeight - (((_document$querySelect3 = document.querySelector(".ant-tabs-tabpane-active .ant-form ant-form-horizontal")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0) - (isFullScreen ? 0 : ((_document$querySelect4 = document.querySelector(".ant-tabs-tabpane-active .ant-pro-page-container-warp")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 0) - cancelHeight + 'px';
18032
18036
  setHeight(h);
18033
18037
  setValue(_objectSpread2({}, value));
18034
18038
  }, 0);
@@ -21087,7 +21091,8 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21087
21091
  value: function componentDidMount() {
21088
21092
  var _window$$wujie,
21089
21093
  _this2 = this,
21090
- _localStorage$getItem;
21094
+ _localStorage$getItem,
21095
+ _localStorage$getItem2;
21091
21096
  var _this$props = this.props,
21092
21097
  history = _this$props.history,
21093
21098
  location = _this$props.location,
@@ -21114,7 +21119,6 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21114
21119
  // }
21115
21120
  // });
21116
21121
  (_window$$wujie = window.$wujie) === null || _window$$wujie === void 0 ? void 0 : _window$$wujie.bus.$on("main-route-change", function (appname, info) {
21117
- console.log('$on main route change ----------------------------', appname, info);
21118
21122
  if (appname === itemPath) {
21119
21123
  istParent = 1;
21120
21124
  if (info.type === 'main') {
@@ -21232,10 +21236,14 @@ var BasicLayout = /*#__PURE__*/function (_React$PureComponent) {
21232
21236
  });
21233
21237
  istParent = 0;
21234
21238
  });
21235
- if (localStorage.getItem('firstPage') && ((_localStorage$getItem = localStorage.getItem('firstPage')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("#/".concat(itemPath, "/")))) {
21236
- var _localStorage$getItem2;
21239
+ if (localStorage.getItem('mainRoutePath') && ((_localStorage$getItem = localStorage.getItem('mainRoutePath')) === null || _localStorage$getItem === void 0 ? void 0 : _localStorage$getItem.startsWith("/".concat(itemPath, "/")))) {
21237
21240
  istParent = 1;
21238
- history.push((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.slice(1).replace(/^\/\w+\//, '/'));
21241
+ history.push(localStorage.getItem('mainRoutePath').replace(/^\/\w+\//, '/'));
21242
+ } else if (localStorage.getItem('firstPage') && ((_localStorage$getItem2 = localStorage.getItem('firstPage')) === null || _localStorage$getItem2 === void 0 ? void 0 : _localStorage$getItem2.startsWith("#/".concat(itemPath, "/")))) {
21243
+ var _localStorage$getItem3;
21244
+ // 暂时保留,兼容老版本
21245
+ istParent = 1;
21246
+ history.push((_localStorage$getItem3 = localStorage.getItem('firstPage')) === null || _localStorage$getItem3 === void 0 ? void 0 : _localStorage$getItem3.slice(1).replace(/^\/\w+\//, '/'));
21239
21247
  } else {
21240
21248
  history.push(location);
21241
21249
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.2.11",
3
+ "version": "2.2.13",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -360,7 +360,6 @@ class BasicLayout extends React.PureComponent {
360
360
  // });
361
361
 
362
362
  window.$wujie?.bus.$on("main-route-change", function (appname, info) {
363
- console.log('$on main route change ----------------------------', appname, info);
364
363
  if (appname === itemPath) {
365
364
  istParent = 1;
366
365
  if (info.type === 'main') {
@@ -502,10 +501,11 @@ class BasicLayout extends React.PureComponent {
502
501
  istParent = 0;
503
502
  });
504
503
 
505
- if (
506
- localStorage.getItem('firstPage') &&
507
- localStorage.getItem('firstPage')?.startsWith(`#/${itemPath}/`)
508
- ) {
504
+ if ( localStorage.getItem('mainRoutePath') && localStorage.getItem('mainRoutePath')?.startsWith(`/${itemPath}/`)) {
505
+ istParent = 1;
506
+ history.push(localStorage.getItem('mainRoutePath').replace(/^\/\w+\//, '/'))
507
+ } else if (localStorage.getItem('firstPage') && localStorage.getItem('firstPage')?.startsWith(`#/${itemPath}/`)) {
508
+ // 暂时保留,兼容老版本
509
509
  istParent = 1;
510
510
  history.push(
511
511
  localStorage
@@ -70,10 +70,17 @@ export default (props: any) => {
70
70
  window.top.document.fullScreen ||
71
71
  window.top.document.webkitIsFullScreen ||
72
72
  window.top.document.mozFullScreen;
73
+
74
+ // wujie子应用iframe首次加载获取不到client以及dom元素高度兼容处理
75
+ let realIframeClientHeight = document.body.clientHeight ? document.body.clientHeight : window.top?.document.body.clientHeight - 76;
76
+ let summaryHeight = document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`) ?
77
+ (document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 22) : 0;
78
+ let listTabHeight = document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`) ?
79
+ (document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`)?.clientHeight || 48) : 0;
80
+
81
+
73
82
  const h =
74
- document.body.clientHeight -
75
- (document.querySelector(`.ant-tabs-tabpane-active .table-bssula-summary`)?.clientHeight || 0) -
76
- (document.querySelector(`.ant-tabs-tabpane-active .list_top_tab .ant-tabs-nav`)?.clientHeight || 0) -
83
+ realIframeClientHeight - summaryHeight - listTabHeight -
77
84
  (document.querySelector(`.ant-tabs-tabpane-active .ant-form ant-form-horizontal`)?.clientHeight ||
78
85
  0) -
79
86
  (isFullScreen