@titaui/pc 1.15.100 → 1.15.101

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.
Files changed (122) hide show
  1. package/lib/components/book-demo/components/pc/components/content/index.js +8 -6
  2. package/lib/components/book-demo/components/pc/index.js +22 -18
  3. package/lib/components/book-demo/constant.js +115 -0
  4. package/lib/components/book-demo/interface.js +1 -0
  5. package/lib/components/change-okr-modal/Filter.js +3 -1
  6. package/lib/components/change-okr-modal/Item.js +3 -1
  7. package/lib/components/common-share/publishMblog.js +3 -1
  8. package/lib/components/common-share/request-apis.js +4 -2
  9. package/lib/components/create-okr-modal/fields/okr-classify.js +3 -1
  10. package/lib/components/create-okr-modal/fields/okr-type.js +3 -1
  11. package/lib/components/create-okr-modal/index.js +3 -1
  12. package/lib/components/create-okr-modal/request-api.js +4 -2
  13. package/lib/components/create-okr-modal/utils/helper.js +3 -1
  14. package/lib/components/dynamic/components/comments-dialog/api.js +4 -2
  15. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +4 -2
  16. package/lib/components/dynamic/dynamic-item/dynamic-discovery/dynamic-footer.js +4 -2
  17. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +3 -1
  18. package/lib/components/dynamic/dynamic-item/dynamic-learning/index.js +3 -1
  19. package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +3 -1
  20. package/lib/components/dynamic/dynamic-item/index.js +4 -2
  21. package/lib/components/dynamic/request-api.js +3 -1
  22. package/lib/components/eReport/eReportShare/index.js +3 -1
  23. package/lib/components/grid-layout/personal-info/index.js +4 -4
  24. package/lib/components/grid-layout/sub-employee-okr/index.js +3 -1
  25. package/lib/components/grid-layout/util/network.js +4 -2
  26. package/lib/components/grid-page/personal-info/index.js +4 -4
  27. package/lib/components/help-card/index.js +3 -1
  28. package/lib/components/help-card/request-api.js +4 -2
  29. package/lib/components/hr-header/index.js +4 -2
  30. package/lib/components/import-modal/helper.js +1 -1
  31. package/lib/components/import-modal/request-api.js +6 -2
  32. package/lib/components/import-modal/tree/okr-tree/search-form.js +2 -2
  33. package/lib/components/import-modal/tree/task-work-tree/index.js +3 -1
  34. package/lib/components/import-modal/tree-node/work-node/index.js +3 -1
  35. package/lib/components/mblog/index.js +3 -1
  36. package/lib/components/menus/components/menu-card/index.js +3 -1
  37. package/lib/components/menus/export-modules/appraisal-menus/menus.js +7 -5
  38. package/lib/components/menus/export-modules/okr-menus/menus.js +3 -1
  39. package/lib/components/menus/export-modules/okr-menus/subordinate-menus/index.js +3 -1
  40. package/lib/components/menus/export-modules/research-menu/index.css +9 -0
  41. package/lib/components/menus/export-modules/research-menu/index.js +120 -0
  42. package/lib/components/menus/export-modules/research-menu/menu-highlight.js +44 -0
  43. package/lib/components/menus/export-modules/research-menu/menus.js +78 -0
  44. package/lib/components/menus/export-modules/research-menu/research-front-menus.js +158 -0
  45. package/lib/components/menus/export-modules/summary-menus/menus.js +3 -1
  46. package/lib/components/menus/export-modules/summary-menus/subordinate-menus/index.js +3 -1
  47. package/lib/components/menus/index.js +6 -0
  48. package/lib/components/menus/request-apis.js +4 -2
  49. package/lib/components/nav-top/components/app-center/images/research.png +0 -0
  50. package/lib/components/nav-top/components/app-center/index.css +8 -0
  51. package/lib/components/nav-top/components/app-center/index.js +13 -5
  52. package/lib/components/nav-top/index.js +21 -11
  53. package/lib/components/nav-top/request.apis.js +4 -3
  54. package/lib/components/nav-top/utils.js +1 -1
  55. package/lib/components/okr-detail/base-info/base-info.js +10 -13
  56. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +3 -1
  57. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +3 -1
  58. package/lib/components/okr-detail/detail-footer/index.js +3 -1
  59. package/lib/components/okr-detail/detail-header/actions.js +1 -1
  60. package/lib/components/okr-detail/detail-header/index.js +3 -1
  61. package/lib/components/okr-detail/index.js +6 -2
  62. package/lib/components/okr-detail/request-apis.js +3 -1
  63. package/lib/components/okr-detail/schedule/components/o-progress/index.js +6 -2
  64. package/lib/components/okr-detail/schedule/util.js +3 -1
  65. package/lib/components/okr-excel/setting.js +6 -4
  66. package/lib/components/okr-filter-drawer/filter-form.js +3 -1
  67. package/lib/components/okr-flow/open-data/index.js +3 -1
  68. package/lib/components/okr-flow/request-apis.js +4 -2
  69. package/lib/components/okr-flow/utils/config.js +7 -3
  70. package/lib/components/okr-progress/components/o-progress/index.js +6 -2
  71. package/lib/components/okr-progress/util.js +3 -1
  72. package/lib/components/okr-progress-modal/request-apis.js +4 -2
  73. package/lib/components/okr-review/common.js +1 -1
  74. package/lib/components/okr-share/publishMblog.js +3 -1
  75. package/lib/components/okr-share/request-apis.js +4 -2
  76. package/lib/components/okrcase-library/index.js +3 -1
  77. package/lib/components/order-have-award/index.js +6 -2
  78. package/lib/components/part-notice/index.js +5 -1
  79. package/lib/components/period-selector/helper/index.js +3 -1
  80. package/lib/components/point-demo/index.js +9 -7
  81. package/lib/components/point-demo/point-demo.js +5 -3
  82. package/lib/components/stop-taking-modal/index.js +3 -1
  83. package/lib/components/superset-charts/utils/axios.js +4 -2
  84. package/lib/components/survey-model/index.js +7 -7
  85. package/lib/components/survey-model/instance.js +4 -2
  86. package/lib/components/task-relation-modal/helper.js +1 -1
  87. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +2 -2
  88. package/lib/components/task-relation-modal/okr-relation/request-api.js +3 -1
  89. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +3 -1
  90. package/lib/components/task-relation-modal/request-api.js +3 -1
  91. package/lib/components/task-relation-modal/tree/okr-tree/index.js +3 -1
  92. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +2 -2
  93. package/lib/components/task-relation-modal/tree/work-list/search-form.js +2 -2
  94. package/lib/components/task-relation-modal/tree/work-tree/search-form.js +2 -2
  95. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  96. package/lib/components/textarea/index.js +4 -2
  97. package/lib/components/upload/index.js +4 -2
  98. package/lib/components/upvote/request-apis.js +4 -2
  99. package/lib/components/user-selector/empty/group.js +4 -2
  100. package/lib/components/user-selector/request-apis.js +4 -2
  101. package/lib/components/version-change-modal/index.js +6 -2
  102. package/lib/components/video-modal/index.js +3 -1
  103. package/lib/components/weekly-report/card.js +9 -9
  104. package/lib/components/word-cloud/request-apis.js +4 -2
  105. package/lib/pages/aha2021/index.js +8 -4
  106. package/lib/pages/group-management/components/openData/index.js +9 -3
  107. package/lib/pages/group-management/groupInterface.js +10 -4
  108. package/lib/pages/group-management/page-view/importGroupStaff/index.js +5 -3
  109. package/lib/pages/like-ranking/index.js +3 -1
  110. package/lib/pages/new-okr-list/header/index.js +10 -4
  111. package/lib/pages/okr-map/hooks/useStorage.js +3 -1
  112. package/lib/pages/okr-map/open-data/index.js +3 -1
  113. package/lib/pages/okr-map/request-apis.js +4 -2
  114. package/lib/pages/okr-map/utils.js +10 -7
  115. package/lib/utils/auth.js +22 -14
  116. package/lib/utils/bs-global.js +21 -8
  117. package/lib/utils/helpers.js +15 -5
  118. package/lib/utils/open-data.js +14 -6
  119. package/lib/utils/platform.js +15 -5
  120. package/lib/utils/request-v1.js +9 -3
  121. package/lib/utils/request.js +3 -3
  122. package/package.json +3 -3
@@ -41,6 +41,8 @@ var _utils = require("../dialog-qq-docs/utils");
41
41
 
42
42
  var _tools = require("../../utils/tools");
43
43
 
44
+ var _window$BSGlobal, _window$BSGlobal$Tena, _window$BSGlobal$Tena2;
45
+
44
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
45
47
 
46
48
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -91,8 +93,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
91
93
 
92
94
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
93
95
 
94
- var openTencentDocFile = window.BSGlobal && window.BSGlobal.TenantAdvancedSetting.TenantFunAdvancedSetting.TencentDocFile && // 默认在钉钉环境下禁用
95
- !(0, _platform.isDD)(true);
96
+ // 默认在钉钉环境下禁用
97
+ var openTencentDocFile = ((_window$BSGlobal = window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$Tena = _window$BSGlobal.TenantAdvancedSetting) === null || _window$BSGlobal$Tena === void 0 ? void 0 : (_window$BSGlobal$Tena2 = _window$BSGlobal$Tena.TenantFunAdvancedSetting) === null || _window$BSGlobal$Tena2 === void 0 ? void 0 : _window$BSGlobal$Tena2.TencentDocFile) && !(0, _platform.isDD)(true);
96
98
 
97
99
  var Upload = /*#__PURE__*/function (_PureComponent) {
98
100
  _inherits(Upload, _PureComponent);
@@ -7,10 +7,12 @@ exports.praise = exports.getPriseList = exports.cancelPraise = void 0;
7
7
 
8
8
  var _axios = _interopRequireDefault(require("axios"));
9
9
 
10
+ var _BSGlobal$tenantInfo, _BSGlobal$loginUserIn;
11
+
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
13
 
12
- var tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0;
13
- var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
14
+ var tenantId = BSGlobal && ((_BSGlobal$tenantInfo = BSGlobal.tenantInfo) === null || _BSGlobal$tenantInfo === void 0 ? void 0 : _BSGlobal$tenantInfo.Id) || 0;
15
+ var userId = BSGlobal && ((_BSGlobal$loginUserIn = BSGlobal.loginUserInfo) === null || _BSGlobal$loginUserIn === void 0 ? void 0 : _BSGlobal$loginUserIn.Id) || 0;
14
16
 
15
17
  var requestDomain = function requestDomain() {
16
18
  if (!window.location.hostname.match(/dev/)) return "";
@@ -16,11 +16,13 @@ require("./index.css");
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
17
 
18
18
  function _default() {
19
- var role = window.BSGlobal.loginUserInfo.Role;
19
+ var _window$BSGlobal$logi, _window$BSGlobal$logi2, _window$BSGlobal$logi3;
20
+
21
+ var role = (_window$BSGlobal$logi = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi === void 0 ? void 0 : _window$BSGlobal$logi.Role;
20
22
  var isManager = role == 4 || role == 2;
21
23
  var webPath = window.BSGlobal.webPath;
22
24
  var domain = (0, _openData.isWechat)() ? "work-weixin" : "admin";
23
- var url = "//".concat(domain, ".").concat(webPath, "/").concat(window.BSGlobal.loginUserInfo.Id, "/TmHome#?iTalentFrameType=iframe&iTalentNavId=44281&iTalentFrame=https://").concat(domain, ".").concat(webPath, "/").concat(window.BSGlobal.loginUserInfo.Id, "/indexV2#/groupManage&");
25
+ var url = "//".concat(domain, ".").concat(webPath, "/").concat((_window$BSGlobal$logi2 = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi2 === void 0 ? void 0 : _window$BSGlobal$logi2.Id, "/TmHome#?iTalentFrameType=iframe&iTalentNavId=44281&iTalentFrame=https://").concat(domain, ".").concat(webPath, "/").concat((_window$BSGlobal$logi3 = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi3 === void 0 ? void 0 : _window$BSGlobal$logi3.Id, "/indexV2#/groupManage&");
24
26
 
25
27
  if (isManager) {
26
28
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -11,6 +11,8 @@ var _utils = require("./utils");
11
11
 
12
12
  var _openData = require("../../utils/open-data");
13
13
 
14
+ var _BSGlobal, _BSGlobal$tenantInfo, _BSGlobal2, _BSGlobal2$loginUserI;
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
16
18
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -25,8 +27,8 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
25
27
 
26
28
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
27
29
 
28
- var tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0;
29
- var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
30
+ var tenantId = ((_BSGlobal = BSGlobal) === null || _BSGlobal === void 0 ? void 0 : (_BSGlobal$tenantInfo = _BSGlobal.tenantInfo) === null || _BSGlobal$tenantInfo === void 0 ? void 0 : _BSGlobal$tenantInfo.Id) || 0;
31
+ var userId = ((_BSGlobal2 = BSGlobal) === null || _BSGlobal2 === void 0 ? void 0 : (_BSGlobal2$loginUserI = _BSGlobal2.loginUserInfo) === null || _BSGlobal2$loginUserI === void 0 ? void 0 : _BSGlobal2$loginUserI.Id) || 0;
30
32
 
31
33
  var requestDomain = function requestDomain() {
32
34
  var modulePath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
@@ -53,6 +53,8 @@ function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("
53
53
 
54
54
  var prefix = "titaui-version-change-modal";
55
55
  var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
56
+ var _getBSGlobal, _getBSGlobal2;
57
+
56
58
  _objectDestructuringEmpty(_ref);
57
59
 
58
60
  var _useState = (0, _react.useState)(false),
@@ -60,7 +62,7 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
60
62
  pending = _useState2[0],
61
63
  setPending = _useState2[1];
62
64
 
63
- var _useState3 = (0, _react.useState)((0, _bsGlobal.getBSGlobal)("tenantAuthentication").MenuVersion && (0, _bsGlobal.getBSGlobal)("tenantAuthentication").MenuVersion !== 0 || _constant.Versions.Flagship),
65
+ var _useState3 = (0, _react.useState)(((_getBSGlobal = (0, _bsGlobal.getBSGlobal)("tenantAuthentication")) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.MenuVersion) && ((_getBSGlobal2 = (0, _bsGlobal.getBSGlobal)("tenantAuthentication")) === null || _getBSGlobal2 === void 0 ? void 0 : _getBSGlobal2.MenuVersion) !== 0 || _constant.Versions.Flagship),
64
66
  _useState4 = _slicedToArray(_useState3, 2),
65
67
  active = _useState4[0],
66
68
  setActive = _useState4[1];
@@ -130,7 +132,9 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
130
132
  }();
131
133
 
132
134
  var getBookDemoVersion = function getBookDemoVersion() {
133
- var menuVersion = window.BSGlobal.tenantAuthentication.MenuVersion;
135
+ var _window$BSGlobal$tena;
136
+
137
+ var menuVersion = (_window$BSGlobal$tena = window.BSGlobal.tenantAuthentication) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.MenuVersion;
134
138
 
135
139
  if (menuVersion === _interface.ETrialVersion.OKR) {
136
140
  return _bookDemo["default"].DemoType.TryOKR;
@@ -25,6 +25,8 @@ var _close = _interopRequireDefault(require("./img/close.png"));
25
25
 
26
26
  require("./index.css");
27
27
 
28
+ var _getBSGlobal;
29
+
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
31
 
30
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -44,7 +46,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
44
46
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
47
 
46
48
  var preCls = "titaui-pc-video-modal";
47
- var userId = (0, _bsGlobal.getBSGlobal)("loginUserInfo").Id;
49
+ var userId = (_getBSGlobal = (0, _bsGlobal.getBSGlobal)("loginUserInfo")) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.Id;
48
50
  var VideoModal = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
49
51
  var videoSrc = props.videoSrc,
50
52
  title = props.title,
@@ -139,23 +139,23 @@ function Card(_ref, ref) {
139
139
  window.WWOpenData && window.WWOpenData.enableCanvasSharing && window.WWOpenData.enableCanvasSharing();
140
140
  }
141
141
 
142
- if (loginUserInfo.UserAvatar.HasAvatar) {
143
- getImageBase64ByUrl(loginUserInfo.Id).then(function (data) {
142
+ if (loginUserInfo !== null && loginUserInfo !== void 0 && loginUserInfo.UserAvatar.HasAvatar) {
143
+ getImageBase64ByUrl(loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.Id).then(function (data) {
144
144
  return (0, _darwAvatar.drawAvatar)({
145
- name: loginUserInfo.Name,
146
- userId: loginUserInfo.Id,
147
- color: loginUserInfo.UserAvatar.Color
145
+ name: loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.Name,
146
+ userId: loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.Id,
147
+ color: loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.UserAvatar.Color
148
148
  }, "data:image/jpeg;base64,".concat(data.obj));
149
149
  }).then(setAvatarSrc);
150
150
  } else {
151
151
  (0, _darwAvatar.drawAvatar)({
152
- name: loginUserInfo.Name,
153
- userId: loginUserInfo.Id,
154
- color: loginUserInfo.UserAvatar.Color
152
+ name: loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.Name,
153
+ userId: loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.Id,
154
+ color: loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.UserAvatar.Color
155
155
  }, "").then(setAvatarSrc);
156
156
  }
157
157
 
158
- (0, _drawName["default"])(loginUserInfo.Name, loginUserInfo.Id).then(setNameSrc);
158
+ (0, _drawName["default"])(loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.Name, loginUserInfo === null || loginUserInfo === void 0 ? void 0 : loginUserInfo.Id).then(setNameSrc);
159
159
  return function () {
160
160
  if ((0, _bsGlobal.isWx)()) {
161
161
  window.WWOpenData && window.WWOpenData.disableCanvasSharing && window.WWOpenData.disableCanvasSharing();
@@ -7,10 +7,12 @@ exports.getWords = void 0;
7
7
 
8
8
  var _axios = _interopRequireDefault(require("axios"));
9
9
 
10
+ var _BSGlobal$tenantInfo, _BSGlobal$loginUserIn;
11
+
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
13
 
12
- var tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0;
13
- var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
14
+ var tenantId = BSGlobal && ((_BSGlobal$tenantInfo = BSGlobal.tenantInfo) === null || _BSGlobal$tenantInfo === void 0 ? void 0 : _BSGlobal$tenantInfo.Id) || 0;
15
+ var userId = BSGlobal && ((_BSGlobal$loginUserIn = BSGlobal.loginUserInfo) === null || _BSGlobal$loginUserIn === void 0 ? void 0 : _BSGlobal$loginUserIn.Id) || 0;
14
16
 
15
17
  var requestDomain = function requestDomain() {
16
18
  if (!window.location.hostname.match(/dev/)) return "";
@@ -89,6 +89,8 @@ function ContentTemplate(props) {
89
89
  }
90
90
 
91
91
  function PageLayout(props) {
92
+ var _window$BSGlobal$tena, _window$BSGlobal$tena2, _getTenantInfo;
93
+
92
94
  var children = props.children;
93
95
  var hideNavTop = (0, _hooks["default"])('hideNavTop');
94
96
 
@@ -98,11 +100,13 @@ function PageLayout(props) {
98
100
  _useState2 = _slicedToArray(_useState, 1),
99
101
  isShowUpdateTip = _useState2[0];
100
102
 
101
- var isTrial = window.BSGlobal.tenantAuthentication.Version === 1 && (0, _platform.isOfficialSite)();
102
- var isTencentHr = window.BSGlobal.tenantInfo.Source === 964;
103
+ var isTrial = ((_window$BSGlobal$tena = window.BSGlobal.tenantAuthentication) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Version) === 1 && (0, _platform.isOfficialSite)();
104
+ var isTencentHr = ((_window$BSGlobal$tena2 = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena2 === void 0 ? void 0 : _window$BSGlobal$tena2.Source) === 964;
103
105
 
104
106
  var getBookDemoVersion = function getBookDemoVersion() {
105
- var menuVersion = window.BSGlobal.tenantAuthentication.MenuVersion;
107
+ var _window$BSGlobal$tena3;
108
+
109
+ var menuVersion = (_window$BSGlobal$tena3 = window.BSGlobal.tenantAuthentication) === null || _window$BSGlobal$tena3 === void 0 ? void 0 : _window$BSGlobal$tena3.MenuVersion;
106
110
 
107
111
  if (menuVersion === _interface.ETrialVersion.OKR) {
108
112
  return _bookDemo["default"].DemoType.TryOKR;
@@ -119,7 +123,7 @@ function PageLayout(props) {
119
123
  className: (0, _classnames["default"])(preCls)
120
124
  }, hideNavTop !== 'true' && /*#__PURE__*/_react["default"].createElement("div", {
121
125
  className: (0, _classnames["default"])("".concat(preCls, "__header"))
122
- }, (0, _helpers.getTenantInfo)().Source === 964 ? /*#__PURE__*/_react["default"].createElement(_hrHeader["default"], null) : /*#__PURE__*/_react["default"].createElement(_navTop["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
126
+ }, ((_getTenantInfo = (0, _helpers.getTenantInfo)()) === null || _getTenantInfo === void 0 ? void 0 : _getTenantInfo.Source) === 964 ? /*#__PURE__*/_react["default"].createElement(_hrHeader["default"], null) : /*#__PURE__*/_react["default"].createElement(_navTop["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
123
127
  className: (0, _classnames["default"])("".concat(preCls, "__message"))
124
128
  }, /*#__PURE__*/_react["default"].createElement(_followerVisitor["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
125
129
  className: (0, _classnames["default"])("".concat(preCls, "__body")),
@@ -54,7 +54,9 @@ var getGlobal = function getGlobal(key) {
54
54
 
55
55
 
56
56
  var getSource = function getSource() {
57
- return getGlobal("tenantInfo").Source;
57
+ var _getGlobal;
58
+
59
+ return ((_getGlobal = getGlobal("tenantInfo")) === null || _getGlobal === void 0 ? void 0 : _getGlobal.Source) || 0;
58
60
  };
59
61
  /**
60
62
  * 用户浏览器 userAgent
@@ -214,8 +216,10 @@ var openDataMap = {
214
216
  */
215
217
 
216
218
  var parseString = function parseString(str) {
219
+ var _window$BSGlobal$tena;
220
+
217
221
  // @ts-ignore
218
- var source = window.BSGlobal.tenantInfo.Source;
222
+ var source = (_window$BSGlobal$tena = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Source;
219
223
  var ua = navigator.userAgent.toLowerCase();
220
224
  if (source != 860 && ua.indexOf("micromessenger") == -1) return /*#__PURE__*/_react["default"].createElement("span", {
221
225
  dangerouslySetInnerHTML: {
@@ -264,8 +268,10 @@ var parseString = function parseString(str) {
264
268
  exports.parseString = parseString;
265
269
 
266
270
  var parseTag = function parseTag(str) {
271
+ var _window$BSGlobal$tena2;
272
+
267
273
  // @ts-ignore
268
- var source = window.BSGlobal.tenantInfo.Source;
274
+ var source = (_window$BSGlobal$tena2 = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena2 === void 0 ? void 0 : _window$BSGlobal$tena2.Source;
269
275
  var ua = navigator.userAgent.toLowerCase();
270
276
  if (source != 860 && ua.indexOf("micromessenger") == -1) return /*#__PURE__*/_react["default"].createElement("span", {
271
277
  dangerouslySetInnerHTML: {
@@ -21,6 +21,8 @@ exports.searchGroupStaffList = searchGroupStaffList;
21
21
  exports.searchUserDetail = searchUserDetail;
22
22
  exports.taker = taker;
23
23
 
24
+ var _BSGlobal$tenantInfo, _BSGlobal$loginUserIn;
25
+
24
26
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
25
27
 
26
28
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -33,8 +35,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
33
35
 
34
36
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
35
37
 
36
- var tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0;
37
- var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
38
+ var tenantId = BSGlobal && ((_BSGlobal$tenantInfo = BSGlobal.tenantInfo) === null || _BSGlobal$tenantInfo === void 0 ? void 0 : _BSGlobal$tenantInfo.Id) || 0;
39
+ var userId = BSGlobal && ((_BSGlobal$loginUserIn = BSGlobal.loginUserInfo) === null || _BSGlobal$loginUserIn === void 0 ? void 0 : _BSGlobal$loginUserIn.Id) || 0;
38
40
 
39
41
  function getTenantInfo() {
40
42
  return BSGlobal && BSGlobal.tenantInfo;
@@ -281,7 +283,9 @@ function searchUserDetail(groupId) {
281
283
 
282
284
 
283
285
  var isDingDing = function isDingDing() {
284
- return getTenantInfo().Source == 861;
286
+ var _getTenantInfo;
287
+
288
+ return ((_getTenantInfo = getTenantInfo()) === null || _getTenantInfo === void 0 ? void 0 : _getTenantInfo.Source) == 861;
285
289
  };
286
290
  /*
287
291
  * 判断是企业微信
@@ -291,7 +295,9 @@ var isDingDing = function isDingDing() {
291
295
  exports.isDingDing = isDingDing;
292
296
 
293
297
  var isWx = function isWx() {
294
- return getTenantInfo().Source == 860;
298
+ var _getTenantInfo2;
299
+
300
+ return ((_getTenantInfo2 = getTenantInfo()) === null || _getTenantInfo2 === void 0 ? void 0 : _getTenantInfo2.Source) == 860;
295
301
  };
296
302
 
297
303
  exports.isWx = isWx;
@@ -48,10 +48,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
48
48
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
49
 
50
50
  function _default(props) {
51
+ var _window$BSGlobal$tena;
52
+
51
53
  var visible = props.visible,
52
54
  setVisible = props.setVisible,
53
55
  getGroup = props.getGroup;
54
- var type = window.BSGlobal.tenantInfo.Source;
56
+ var type = (_window$BSGlobal$tena = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Source;
55
57
  var sourceType = type == 861 ? 861 : type == 860 ? 860 : 0;
56
58
 
57
59
  var _useState = (0, _react.useState)([]),
@@ -78,7 +80,7 @@ function _default(props) {
78
80
  }
79
81
  });
80
82
  }; // const biggerTenant = [366123, 366434, 217208]
81
- // const size = biggerTenant.indexOf(window.BSGlobal.tenantInfo.Id - 0) == -1 ? 50 : 100
83
+ // const size = biggerTenant.indexOf(window.BSGlobal.tenantInfo?.Id - 0) == -1 ? 50 : 100
82
84
 
83
85
 
84
86
  var beforeUpload = function beforeUpload(file) {
@@ -140,7 +142,7 @@ function _default(props) {
140
142
  _toast["default"].Error("请至少上传一个文件");
141
143
  }
142
144
  }; // 下载模板链接
143
- // let type=window.BSGlobal.tenantInfo.Source
145
+ // let type=window.BSGlobal.tenantInfo?.Source
144
146
  // let sourceType = (type==861 ? 861 : type==860 ? 860 : 0)
145
147
  // let sourceType = 861
146
148
 
@@ -31,6 +31,8 @@ require("./index.css");
31
31
 
32
32
  require("./new-ui.css");
33
33
 
34
+ var _window$BSGlobal$tena;
35
+
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
37
 
36
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -55,7 +57,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
55
57
 
56
58
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
57
59
 
58
- var preCls = window.BSGlobal.tenantInfo.isNewIndex ? "titaui-new-ui-ranking-page" : "like-ranking-page";
60
+ var preCls = (_window$BSGlobal$tena = window.BSGlobal.tenantInfo) !== null && _window$BSGlobal$tena !== void 0 && _window$BSGlobal$tena.isNewIndex ? "titaui-new-ui-ranking-page" : "like-ranking-page";
59
61
  var hasAuth = new _auth.DynamicManagerAuth();
60
62
 
61
63
  var LikeRanking = function LikeRanking() {
@@ -88,11 +88,15 @@ var viewConfig = function viewConfig() {
88
88
  };
89
89
 
90
90
  var getTableTip = function getTableTip() {
91
- return !localStorage.getItem("OkrTableTypeTip_".concat(window.BSGlobal.loginUserInfo.Id));
91
+ var _window$BSGlobal$logi;
92
+
93
+ return !localStorage.getItem("OkrTableTypeTip_".concat((_window$BSGlobal$logi = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi === void 0 ? void 0 : _window$BSGlobal$logi.Id));
92
94
  };
93
95
 
94
96
  var setTableTip = function setTableTip() {
95
- localStorage.setItem("OkrTableTypeTip_".concat(window.BSGlobal.loginUserInfo.Id), 'true');
97
+ var _window$BSGlobal$logi2;
98
+
99
+ localStorage.setItem("OkrTableTypeTip_".concat((_window$BSGlobal$logi2 = window.BSGlobal.loginUserInfo) === null || _window$BSGlobal$logi2 === void 0 ? void 0 : _window$BSGlobal$logi2.Id), 'true');
96
100
  };
97
101
 
98
102
  var titaTracker = function titaTracker(type) {
@@ -222,15 +226,17 @@ function Header(props, ref) {
222
226
  });
223
227
 
224
228
  var gotoOkrMap = function gotoOkrMap() {
229
+ var _window$BSGlobal$tena, _window$BSGlobal$tena2;
230
+
225
231
  var rootNode = {
226
232
  rootId: 0,
227
233
  // @ts-ignore
228
- rootName: window.BSGlobal.tenantInfo.Name || ''
234
+ rootName: ((_window$BSGlobal$tena = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Name) || ''
229
235
  };
230
236
  var level2Selected = {
231
237
  id: 0,
232
238
  // @ts-ignore
233
- name: window.BSGlobal.tenantInfo.Name || ''
239
+ name: ((_window$BSGlobal$tena2 = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena2 === void 0 ? void 0 : _window$BSGlobal$tena2.Name) || ''
234
240
  };
235
241
  var searchType = 'company';
236
242
 
@@ -7,6 +7,8 @@ exports.getHashQuery = exports["default"] = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
+ var _window$BSGlobal$tena;
11
+
10
12
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
13
 
12
14
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -19,7 +21,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
19
21
 
20
22
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
23
 
22
- var tenantId = window.BSGlobal && window.BSGlobal.tenantInfo.Id || 0;
24
+ var tenantId = window.BSGlobal && ((_window$BSGlobal$tena = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Id) || 0;
23
25
 
24
26
  var getHashQuery = function getHashQuery(queryKey) {
25
27
  var queryValue;
@@ -27,7 +27,9 @@ var getGlobal = function getGlobal(key) {
27
27
  };
28
28
 
29
29
  var getSource = function getSource() {
30
- return getGlobal("tenantInfo").Source;
30
+ var _getGlobal;
31
+
32
+ return ((_getGlobal = getGlobal("tenantInfo")) === null || _getGlobal === void 0 ? void 0 : _getGlobal.Source) || 0;
31
33
  };
32
34
 
33
35
  exports.getSource = getSource;
@@ -9,6 +9,8 @@ exports.onUpdateKr = exports.getShareUrl = exports.checkTenantOkrExist = void 0;
9
9
 
10
10
  var _axios = _interopRequireDefault(require("axios"));
11
11
 
12
+ var _BSGlobal$tenantInfo, _BSGlobal$loginUserIn;
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
15
 
14
16
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
@@ -17,8 +19,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
17
19
 
18
20
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
19
21
 
20
- var tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0;
21
- var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
22
+ var tenantId = BSGlobal && ((_BSGlobal$tenantInfo = BSGlobal.tenantInfo) === null || _BSGlobal$tenantInfo === void 0 ? void 0 : _BSGlobal$tenantInfo.Id) || 0;
23
+ var userId = BSGlobal && ((_BSGlobal$loginUserIn = BSGlobal.loginUserInfo) === null || _BSGlobal$loginUserIn === void 0 ? void 0 : _BSGlobal$loginUserIn.Id) || 0;
22
24
 
23
25
  var requestDomain = function requestDomain() {
24
26
  if (!window.location.hostname.match(/dev/)) return "";
@@ -7,18 +7,21 @@ exports.closeFullscreen = exports.OkrTypeSetting = void 0;
7
7
  exports.getBSGlobal = getBSGlobal;
8
8
  exports.tenantName = exports.tenantLogo = exports.openFullscreen = exports.okrTypeMap = void 0;
9
9
 
10
+ var _getBSGlobal2, _getBSGlobal3;
11
+
10
12
  var openFullscreen = function openFullscreen() {
11
13
  // 隐藏侧边栏和头部
12
- if (!getBSGlobal("tenantInfo").isNewIndex) {
13
- document.querySelector(".tu-page-nav").style.display = "none";
14
- document.querySelector(".tu-page-header").style.display = "none";
15
- }
14
+ // if (!getBSGlobal("tenantInfo")?.isNewIndex) {
15
+ document.querySelector(".tu-page-nav").style.display = "none";
16
+ document.querySelector(".tu-page-header").style.display = "none"; // }
16
17
  };
17
18
 
18
19
  exports.openFullscreen = openFullscreen;
19
20
 
20
21
  var closeFullscreen = function closeFullscreen() {
21
- if (!getBSGlobal("tenantInfo").isNewIndex) {
22
+ var _getBSGlobal;
23
+
24
+ if (!((_getBSGlobal = getBSGlobal("tenantInfo")) !== null && _getBSGlobal !== void 0 && _getBSGlobal.isNewIndex)) {
22
25
  document.querySelector(".tu-page-nav").style.display = "block";
23
26
  document.querySelector(".tu-page-header").style.display = "block";
24
27
  }
@@ -30,9 +33,9 @@ function getBSGlobal(name) {
30
33
  return name ? BSGlobal && BSGlobal[name] : BSGlobal;
31
34
  }
32
35
 
33
- var tenantName = getBSGlobal("tenantInfo").Name || "";
36
+ var tenantName = ((_getBSGlobal2 = getBSGlobal("tenantInfo")) === null || _getBSGlobal2 === void 0 ? void 0 : _getBSGlobal2.Name) || "";
34
37
  exports.tenantName = tenantName;
35
- var tenantLogo = getBSGlobal("tenantInfo").Logo || "";
38
+ var tenantLogo = ((_getBSGlobal3 = getBSGlobal("tenantInfo")) === null || _getBSGlobal3 === void 0 ? void 0 : _getBSGlobal3.Logo) || "";
36
39
  exports.tenantLogo = tenantLogo;
37
40
 
38
41
  var _ref = getBSGlobal("OkrAdvancedSetting") || {},
package/lib/utils/auth.js CHANGED
@@ -33,7 +33,7 @@ var BaseAuth = /*#__PURE__*/function () {
33
33
  function BaseAuth() {
34
34
  _classCallCheck(this, BaseAuth);
35
35
 
36
- this.loginUserInfor = (0, _bsGlobal.getBSGlobal)('loginUserInfo');
36
+ this.loginUserInfor = (0, _bsGlobal.getBSGlobal)('loginUserInfo') || {};
37
37
  } // 老板
38
38
 
39
39
 
@@ -80,7 +80,9 @@ var BaseAuth = /*#__PURE__*/function () {
80
80
  }, {
81
81
  key: "isSurveyManager",
82
82
  value: function isSurveyManager() {
83
- return this.loginUserInfor.IsSuveryManager;
83
+ var _this$loginUserInfor;
84
+
85
+ return (_this$loginUserInfor = this.loginUserInfor) === null || _this$loginUserInfor === void 0 ? void 0 : _this$loginUserInfor.IsSuveryManager;
84
86
  }
85
87
  }]);
86
88
 
@@ -150,7 +152,7 @@ var KRAuth = /*#__PURE__*/function (_BaseAuth2) {
150
152
  _this2 = _super2.call(this, props);
151
153
  var user = props.user,
152
154
  createUserId = props.createUserId;
153
- _this2.loginUserInfor = (0, _bsGlobal.getBSGlobal)('loginUserInfo');
155
+ _this2.loginUserInfor = (0, _bsGlobal.getBSGlobal)('loginUserInfo') || {};
154
156
  _this2.userId = _this2.loginUserInfor.Id;
155
157
  _this2.user = user;
156
158
  _this2.createUserId = createUserId;
@@ -238,7 +240,9 @@ var EAuth = /*#__PURE__*/function (_BaseAuth3) {
238
240
  exports.EAuth = EAuth;
239
241
 
240
242
  var hasSuperior = function hasSuperior() {
241
- return !!(0, _bsGlobal.getBSGlobal)('loginUserInfo').ManagerId;
243
+ var _getBSGlobal;
244
+
245
+ return !!((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('loginUserInfo')) !== null && _getBSGlobal !== void 0 && _getBSGlobal.ManagerId);
242
246
  }; // 动态和项目文件管理权限
243
247
 
244
248
 
@@ -250,13 +254,15 @@ var DynamicManagerAuth = /*#__PURE__*/function (_BaseAuth4) {
250
254
  var _super4 = _createSuper(DynamicManagerAuth);
251
255
 
252
256
  function DynamicManagerAuth(props) {
257
+ var _getBSGlobal2, _getBSGlobal3;
258
+
253
259
  var _this4;
254
260
 
255
261
  _classCallCheck(this, DynamicManagerAuth);
256
262
 
257
263
  _this4 = _super4.call(this, props);
258
- _this4.isDynamicManager = (0, _bsGlobal.getBSGlobal)('loginUserInfo').IsFeedAndFileManager;
259
- _this4.isLeader = (0, _bsGlobal.getBSGlobal)('loginUserInfo').IsLeader;
264
+ _this4.isDynamicManager = (_getBSGlobal2 = (0, _bsGlobal.getBSGlobal)('loginUserInfo')) === null || _getBSGlobal2 === void 0 ? void 0 : _getBSGlobal2.IsFeedAndFileManager;
265
+ _this4.isLeader = (_getBSGlobal3 = (0, _bsGlobal.getBSGlobal)('loginUserInfo')) === null || _getBSGlobal3 === void 0 ? void 0 : _getBSGlobal3.IsLeader;
260
266
  return _this4;
261
267
  }
262
268
 
@@ -323,9 +329,11 @@ exports.ChildAuth = ChildAuth;
323
329
 
324
330
  var MyRole = /*#__PURE__*/function () {
325
331
  function MyRole() {
332
+ var _this$loginUserInfo, _this$loginUserInfo2, _this$loginUserInfo3, _this$loginUserInfo4, _this$loginUserInfo5, _this$loginUserInfo6, _this$loginUserInfo7;
333
+
326
334
  _classCallCheck(this, MyRole);
327
335
 
328
- this.loginUserInfo = (0, _bsGlobal.getBSGlobal)('loginUserInfo');
336
+ this.loginUserInfo = (0, _bsGlobal.getBSGlobal)('loginUserInfo') || {};
329
337
  this.role_label = {
330
338
  1: 'assistant',
331
339
  // 助理或者说动态管理员
@@ -336,17 +344,17 @@ var MyRole = /*#__PURE__*/function () {
336
344
  4: 'adminManager' // 后台管理员
337
345
 
338
346
  };
339
- this.isLeader = this.loginUserInfo.IsLeader;
340
- this.isBoss = this.loginUserInfo.IsBoss;
341
- this.isSuperManager = this.loginUserInfo.Role === 2; // 超管
347
+ this.isLeader = (_this$loginUserInfo = this.loginUserInfo) === null || _this$loginUserInfo === void 0 ? void 0 : _this$loginUserInfo.IsLeader;
348
+ this.isBoss = (_this$loginUserInfo2 = this.loginUserInfo) === null || _this$loginUserInfo2 === void 0 ? void 0 : _this$loginUserInfo2.IsBoss;
349
+ this.isSuperManager = ((_this$loginUserInfo3 = this.loginUserInfo) === null || _this$loginUserInfo3 === void 0 ? void 0 : _this$loginUserInfo3.Role) === 2; // 超管
342
350
 
343
- this.isAssistant = this.loginUserInfo.Role === 1; // 助理或者说动态管理员
351
+ this.isAssistant = ((_this$loginUserInfo4 = this.loginUserInfo) === null || _this$loginUserInfo4 === void 0 ? void 0 : _this$loginUserInfo4.Role) === 1; // 助理或者说动态管理员
344
352
 
345
- this.isOkrManager = this.loginUserInfo.IsOkrManager; // 目标管理员
353
+ this.isOkrManager = (_this$loginUserInfo5 = this.loginUserInfo) === null || _this$loginUserInfo5 === void 0 ? void 0 : _this$loginUserInfo5.IsOkrManager; // 目标管理员
346
354
 
347
- this.isWorkManager = this.loginUserInfo.IsWorkManager; // 项目管理员
355
+ this.isWorkManager = (_this$loginUserInfo6 = this.loginUserInfo) === null || _this$loginUserInfo6 === void 0 ? void 0 : _this$loginUserInfo6.IsWorkManager; // 项目管理员
348
356
 
349
- this.isAdminManager = this.loginUserInfo.Role === 4; // 后台管理员
357
+ this.isAdminManager = ((_this$loginUserInfo7 = this.loginUserInfo) === null || _this$loginUserInfo7 === void 0 ? void 0 : _this$loginUserInfo7.Role) === 4; // 后台管理员
350
358
  }
351
359
 
352
360
  _createClass(MyRole, [{