@titaui/pc 1.15.82 → 1.15.84-beta.1

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 (117) 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/change-okr-modal/Filter.js +3 -1
  4. package/lib/components/change-okr-modal/Item.js +3 -1
  5. package/lib/components/common-share/publishMblog.js +3 -1
  6. package/lib/components/common-share/request-apis.js +4 -2
  7. package/lib/components/create-okr-modal/fields/okr-classify.js +3 -1
  8. package/lib/components/create-okr-modal/fields/okr-type.js +3 -1
  9. package/lib/components/create-okr-modal/index.js +3 -1
  10. package/lib/components/create-okr-modal/request-api.js +4 -2
  11. package/lib/components/create-okr-modal/utils/helper.js +3 -1
  12. package/lib/components/dynamic/components/comments-dialog/api.js +4 -2
  13. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +4 -2
  14. package/lib/components/dynamic/dynamic-item/dynamic-discovery/dynamic-footer.js +4 -2
  15. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +3 -1
  16. package/lib/components/dynamic/dynamic-item/dynamic-learning/index.js +3 -1
  17. package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +3 -1
  18. package/lib/components/dynamic/dynamic-item/index.js +4 -2
  19. package/lib/components/dynamic/request-api.js +3 -1
  20. package/lib/components/eReport/eReportShare/index.js +3 -1
  21. package/lib/components/grid-layout/personal-info/index.js +4 -4
  22. package/lib/components/grid-layout/sub-employee-okr/index.js +3 -1
  23. package/lib/components/grid-layout/util/network.js +4 -2
  24. package/lib/components/grid-page/personal-info/index.js +4 -4
  25. package/lib/components/help-card/index.js +3 -1
  26. package/lib/components/help-card/request-api.js +4 -2
  27. package/lib/components/hr-header/index.js +4 -2
  28. package/lib/components/import-modal/helper.js +1 -1
  29. package/lib/components/import-modal/request-api.js +6 -2
  30. package/lib/components/import-modal/tree/okr-tree/search-form.js +2 -2
  31. package/lib/components/import-modal/tree/task-work-tree/index.js +3 -1
  32. package/lib/components/import-modal/tree-node/work-node/index.js +3 -1
  33. package/lib/components/mblog/index.js +3 -1
  34. package/lib/components/menus/components/menu-card/index.js +3 -1
  35. package/lib/components/menus/export-modules/appraisal-menus/menus.js +7 -5
  36. package/lib/components/menus/export-modules/okr-menus/menus.js +3 -1
  37. package/lib/components/menus/export-modules/okr-menus/subordinate-menus/index.js +3 -1
  38. package/lib/components/menus/export-modules/research-menu/index.css +9 -0
  39. package/lib/components/menus/export-modules/research-menu/index.js +120 -0
  40. package/lib/components/menus/export-modules/research-menu/menu-highlight.js +44 -0
  41. package/lib/components/menus/export-modules/research-menu/menus.js +78 -0
  42. package/lib/components/menus/export-modules/research-menu/research-front-menus.js +158 -0
  43. package/lib/components/menus/export-modules/summary-menus/depart-menus/index.js +1 -1
  44. package/lib/components/menus/export-modules/summary-menus/menus.js +3 -1
  45. package/lib/components/menus/export-modules/summary-menus/request-api.js +1 -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/index.js +13 -5
  50. package/lib/components/nav-top/index.js +21 -11
  51. package/lib/components/nav-top/request.apis.js +4 -3
  52. package/lib/components/nav-top/utils.js +1 -1
  53. package/lib/components/okr-detail/base-info/base-info.js +14 -14
  54. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +3 -1
  55. package/lib/components/okr-detail/detail-footer/index.js +3 -1
  56. package/lib/components/okr-detail/detail-header/actions.js +1 -1
  57. package/lib/components/okr-detail/detail-header/index.js +3 -1
  58. package/lib/components/okr-detail/index.js +6 -2
  59. package/lib/components/okr-detail/request-apis.js +3 -1
  60. package/lib/components/okr-detail/schedule/components/o-progress/index.js +6 -2
  61. package/lib/components/okr-detail/schedule/util.js +3 -1
  62. package/lib/components/okr-filter-drawer/filter-form.js +3 -1
  63. package/lib/components/okr-flow/open-data/index.js +3 -1
  64. package/lib/components/okr-flow/request-apis.js +4 -2
  65. package/lib/components/okr-flow/utils/config.js +7 -3
  66. package/lib/components/okr-progress/components/o-progress/index.js +6 -2
  67. package/lib/components/okr-progress/util.js +3 -1
  68. package/lib/components/okr-progress-modal/request-apis.js +4 -2
  69. package/lib/components/okr-share/publishMblog.js +3 -1
  70. package/lib/components/okr-share/request-apis.js +4 -2
  71. package/lib/components/okrcase-library/index.js +3 -1
  72. package/lib/components/order-have-award/index.js +6 -2
  73. package/lib/components/part-notice/index.js +5 -1
  74. package/lib/components/period-selector/helper/index.js +3 -1
  75. package/lib/components/point-demo/index.js +9 -7
  76. package/lib/components/point-demo/point-demo.js +5 -3
  77. package/lib/components/stop-taking-modal/index.js +3 -1
  78. package/lib/components/superset-charts/utils/axios.js +4 -2
  79. package/lib/components/survey-model/index.js +7 -7
  80. package/lib/components/survey-model/instance.js +4 -2
  81. package/lib/components/task-relation-modal/helper.js +1 -1
  82. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +2 -2
  83. package/lib/components/task-relation-modal/okr-relation/request-api.js +3 -1
  84. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +3 -1
  85. package/lib/components/task-relation-modal/request-api.js +3 -1
  86. package/lib/components/task-relation-modal/tree/okr-tree/index.js +3 -1
  87. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +2 -2
  88. package/lib/components/task-relation-modal/tree/work-list/search-form.js +2 -2
  89. package/lib/components/task-relation-modal/tree/work-tree/search-form.js +2 -2
  90. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  91. package/lib/components/upload/index.js +4 -2
  92. package/lib/components/upvote/request-apis.js +4 -2
  93. package/lib/components/user-selector/empty/group.js +4 -2
  94. package/lib/components/user-selector/request-apis.js +4 -2
  95. package/lib/components/version-change-modal/index.js +6 -2
  96. package/lib/components/video-modal/index.js +3 -1
  97. package/lib/components/weekly-report/card.js +9 -9
  98. package/lib/components/word-cloud/request-apis.js +4 -2
  99. package/lib/pages/aha2021/index.js +8 -4
  100. package/lib/pages/group-management/components/openData/index.js +9 -3
  101. package/lib/pages/group-management/groupInterface.js +10 -4
  102. package/lib/pages/group-management/page-view/importGroupStaff/index.js +5 -3
  103. package/lib/pages/like-ranking/index.js +3 -1
  104. package/lib/pages/new-okr-list/header/index.js +10 -4
  105. package/lib/pages/new-okr-list/index.js +31 -23
  106. package/lib/pages/okr-map/hooks/useStorage.js +3 -1
  107. package/lib/pages/okr-map/open-data/index.js +3 -1
  108. package/lib/pages/okr-map/request-apis.js +4 -2
  109. package/lib/pages/okr-map/utils.js +10 -7
  110. package/lib/utils/auth.js +9 -7
  111. package/lib/utils/bs-global.js +18 -7
  112. package/lib/utils/helpers.js +15 -5
  113. package/lib/utils/open-data.js +14 -6
  114. package/lib/utils/platform.js +15 -5
  115. package/lib/utils/request-v1.js +9 -3
  116. package/lib/utils/request.js +3 -3
  117. package/package.json +3 -3
@@ -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
 
@@ -118,12 +118,12 @@ var NewOkrList = function NewOkrList(props) {
118
118
  SetCycleModal = props.SetCycleModal,
119
119
  OkrOperateRecordDrawer = props.OkrOperateRecordDrawer;
120
120
  var useLocalStorage = new _localStorage.LocalStorage();
121
- var formFieldValues = useLocalStorage.getItem("okr-filter-values") || {
122
- targetType: "",
123
- targetCategory: "",
124
- targetSort: "",
125
- okrType: "",
126
- okrClassify: "",
121
+ var formFieldValues = useLocalStorage.getItem('okr-filter-values') || {
122
+ targetType: '',
123
+ targetCategory: '',
124
+ targetSort: '',
125
+ okrType: '',
126
+ okrClassify: '',
127
127
  orderType: 0
128
128
  };
129
129
 
@@ -141,14 +141,14 @@ var NewOkrList = function NewOkrList(props) {
141
141
  };
142
142
  }
143
143
 
144
- return useLocalStorage.getItem("okr-filter-cycle") || {
144
+ return useLocalStorage.getItem('okr-filter-cycle') || {
145
145
  annualNum: "".concat(new Date().getFullYear()),
146
- cycleType: "2",
146
+ cycleType: '2',
147
147
  yqmNum: "".concat((0, _moment["default"])().quarter())
148
148
  };
149
149
  }();
150
150
 
151
- var showWorkExecution = (0, _bsGlobal.getBSGlobal)("OkrAdvancedSetting").KRSetting.ShowWorkExecution;
151
+ var showWorkExecution = (0, _bsGlobal.getBSGlobal)('OkrAdvancedSetting').KRSetting.ShowWorkExecution;
152
152
 
153
153
  var _useState = (0, _react.useState)(true),
154
154
  _useState2 = _slicedToArray(_useState, 2),
@@ -183,7 +183,7 @@ var NewOkrList = function NewOkrList(props) {
183
183
  cycleType: filterCycle.cycleType,
184
184
  yqmNum: filterCycle.yqmNum,
185
185
  onlyThisDept: false,
186
- keyWords: ""
186
+ keyWords: ''
187
187
  }),
188
188
  _useState12 = _slicedToArray(_useState11, 2),
189
189
  query = _useState12[0],
@@ -233,7 +233,7 @@ var NewOkrList = function NewOkrList(props) {
233
233
  (0, _react.useEffect)(function () {
234
234
  if (isInit) {
235
235
  handleOnSearch({
236
- keyWords: ""
236
+ keyWords: ''
237
237
  });
238
238
  }
239
239
  }, [relation, toUserId, departmentId]);
@@ -266,8 +266,8 @@ var NewOkrList = function NewOkrList(props) {
266
266
  params.Searchpage = 2;
267
267
  }
268
268
 
269
- if (departmentId !== 0 && departmentId !== "0") {
270
- params.keyWords = "";
269
+ if (departmentId !== 0 && departmentId !== '0') {
270
+ params.keyWords = '';
271
271
  }
272
272
 
273
273
  recordVisitUser();
@@ -330,22 +330,24 @@ var NewOkrList = function NewOkrList(props) {
330
330
 
331
331
  setCasesVisible(false);
332
332
 
333
- _toast["default"].Success("成功套用");
333
+ _toast["default"].Success('成功套用');
334
334
  };
335
335
 
336
336
  var triggerAnimation = function triggerAnimation() {
337
+ var _window$titaTracker, _window;
338
+
337
339
  // @ts-ignore
338
- document.querySelector(".tita-okr-list-v2").scrollTop = 0;
339
- var twinkleEles = document.getElementsByClassName("okr-list__twinkle");
340
+ document.querySelector('.tita-okr-list-v2').scrollTop = 0;
341
+ var twinkleEles = document.getElementsByClassName('okr-list__twinkle');
340
342
 
341
343
  var _loop = function _loop(i) {
342
344
  if (twinkleEles[i]) {
343
- twinkleEles[i].classList.add("okr-list__twinkle--animation");
345
+ twinkleEles[i].classList.add('okr-list__twinkle--animation');
344
346
  }
345
347
 
346
348
  setTimeout(function () {
347
349
  if (twinkleEles[i]) {
348
- twinkleEles[i].classList.remove("okr-list__twinkle--animation");
350
+ twinkleEles[i].classList.remove('okr-list__twinkle--animation');
349
351
  }
350
352
  }, 3000);
351
353
  };
@@ -353,6 +355,12 @@ var NewOkrList = function NewOkrList(props) {
353
355
  for (var i = 0; i < twinkleEles.length; i += 1) {
354
356
  _loop(i);
355
357
  }
358
+
359
+ (_window$titaTracker = (_window = window).titaTracker) === null || _window$titaTracker === void 0 ? void 0 : _window$titaTracker.call(_window, 'action').record({
360
+ productName: 'OKR',
361
+ actionGroup: 'OKR列表-筛选条件',
362
+ actionName: '检查OKR筛选条件'
363
+ });
356
364
  };
357
365
 
358
366
  var onCasesCloseHandler = function onCasesCloseHandler() {
@@ -398,7 +406,7 @@ var NewOkrList = function NewOkrList(props) {
398
406
  replaceOkr: replaceOkr,
399
407
  isShowPrincple: isShowPrincple,
400
408
  isShowPeriod: isShowPeriod,
401
- isShowEasyCreate: relation !== "2" && relation !== "3",
409
+ isShowEasyCreate: relation !== '2' && relation !== '3',
402
410
  openCreateModal: openCreateModal
403
411
  }), /*#__PURE__*/_react["default"].createElement("div", {
404
412
  className: "".concat(_precls.precls, "__pagination")
@@ -436,10 +444,10 @@ var NewOkrList = function NewOkrList(props) {
436
444
  }
437
445
  })), !loading && /*#__PURE__*/_react["default"].createElement("div", {
438
446
  className: "okr-list__check-filter-tips"
439
- }, (0, _getLocale.getLocale)("OKR_MyO_Text_CanfindOKR"), /*#__PURE__*/_react["default"].createElement("span", {
447
+ }, (0, _getLocale.getLocale)('OKR_MyO_Text_CanfindOKR'), /*#__PURE__*/_react["default"].createElement("span", {
440
448
  className: "okr-list__check-filter-btn",
441
449
  onClick: triggerAnimation
442
- }, (0, _getLocale.getLocale)("OKR_MyO_Text_Check")), (0, _getLocale.getLocale)("OKR_MyO_Text_Topfiltercriteria")), /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
450
+ }, (0, _getLocale.getLocale)('OKR_MyO_Text_Check')), (0, _getLocale.getLocale)('OKR_MyO_Text_Topfiltercriteria')), /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
443
451
  zIndex: 1200,
444
452
  noHeadLine: true,
445
453
  visible: casesVisible,
@@ -449,8 +457,8 @@ var NewOkrList = function NewOkrList(props) {
449
457
  noCloseIcon: true,
450
458
  destroyOnClose: true,
451
459
  style: {
452
- width: "100%",
453
- height: "100%"
460
+ width: '100%',
461
+ height: '100%'
454
462
  },
455
463
  maskClosable: true
456
464
  }, /*#__PURE__*/_react["default"].createElement(_okrcaseLibrary["default"], {
@@ -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
@@ -323,6 +323,8 @@ exports.ChildAuth = ChildAuth;
323
323
 
324
324
  var MyRole = /*#__PURE__*/function () {
325
325
  function MyRole() {
326
+ var _this$loginUserInfo, _this$loginUserInfo2, _this$loginUserInfo3, _this$loginUserInfo4, _this$loginUserInfo5, _this$loginUserInfo6, _this$loginUserInfo7;
327
+
326
328
  _classCallCheck(this, MyRole);
327
329
 
328
330
  this.loginUserInfo = (0, _bsGlobal.getBSGlobal)('loginUserInfo');
@@ -336,17 +338,17 @@ var MyRole = /*#__PURE__*/function () {
336
338
  4: 'adminManager' // 后台管理员
337
339
 
338
340
  };
339
- this.isLeader = this.loginUserInfo.IsLeader;
340
- this.isBoss = this.loginUserInfo.IsBoss;
341
- this.isSuperManager = this.loginUserInfo.Role === 2; // 超管
341
+ this.isLeader = (_this$loginUserInfo = this.loginUserInfo) === null || _this$loginUserInfo === void 0 ? void 0 : _this$loginUserInfo.IsLeader;
342
+ this.isBoss = (_this$loginUserInfo2 = this.loginUserInfo) === null || _this$loginUserInfo2 === void 0 ? void 0 : _this$loginUserInfo2.IsBoss;
343
+ this.isSuperManager = ((_this$loginUserInfo3 = this.loginUserInfo) === null || _this$loginUserInfo3 === void 0 ? void 0 : _this$loginUserInfo3.Role) === 2; // 超管
342
344
 
343
- this.isAssistant = this.loginUserInfo.Role === 1; // 助理或者说动态管理员
345
+ this.isAssistant = ((_this$loginUserInfo4 = this.loginUserInfo) === null || _this$loginUserInfo4 === void 0 ? void 0 : _this$loginUserInfo4.Role) === 1; // 助理或者说动态管理员
344
346
 
345
- this.isOkrManager = this.loginUserInfo.IsOkrManager; // 目标管理员
347
+ this.isOkrManager = (_this$loginUserInfo5 = this.loginUserInfo) === null || _this$loginUserInfo5 === void 0 ? void 0 : _this$loginUserInfo5.IsOkrManager; // 目标管理员
346
348
 
347
- this.isWorkManager = this.loginUserInfo.IsWorkManager; // 项目管理员
349
+ this.isWorkManager = (_this$loginUserInfo6 = this.loginUserInfo) === null || _this$loginUserInfo6 === void 0 ? void 0 : _this$loginUserInfo6.IsWorkManager; // 项目管理员
348
350
 
349
- this.isAdminManager = this.loginUserInfo.Role === 4; // 后台管理员
351
+ this.isAdminManager = ((_this$loginUserInfo7 = this.loginUserInfo) === null || _this$loginUserInfo7 === void 0 ? void 0 : _this$loginUserInfo7.Role) === 4; // 后台管理员
350
352
  }
351
353
 
352
354
  _createClass(MyRole, [{
@@ -7,13 +7,17 @@ exports.hasWebHead = exports.getVersion = exports.getUserInfo = exports.getUploa
7
7
  exports.isWx = isWx;
8
8
 
9
9
  var getUserInfo = function getUserInfo() {
10
- return window.BSGlobal && window.BSGlobal.loginUserInfo;
10
+ var _window$BSGlobal;
11
+
12
+ return ((_window$BSGlobal = window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : _window$BSGlobal.loginUserInfo) || {};
11
13
  };
12
14
 
13
15
  exports.getUserInfo = getUserInfo;
14
16
 
15
17
  var getTenantInfo = function getTenantInfo() {
16
- return window.BSGlobal && window.BSGlobal.tenantInfo;
18
+ var _window$BSGlobal2;
19
+
20
+ return ((_window$BSGlobal2 = window.BSGlobal) === null || _window$BSGlobal2 === void 0 ? void 0 : _window$BSGlobal2.tenantInfo) || {};
17
21
  };
18
22
 
19
23
  exports.getTenantInfo = getTenantInfo;
@@ -25,21 +29,26 @@ var getBSGlobal = function getBSGlobal(key) {
25
29
  exports.getBSGlobal = getBSGlobal;
26
30
 
27
31
  var getOkrAdvancedSetting = function getOkrAdvancedSetting() {
28
- return window.BSGlobal && window.BSGlobal.OkrAdvancedSetting;
32
+ var _window$BSGlobal3;
33
+
34
+ return ((_window$BSGlobal3 = window.BSGlobal) === null || _window$BSGlobal3 === void 0 ? void 0 : _window$BSGlobal3.OkrAdvancedSettingv) || {};
29
35
  }; // version 1 试用版
30
36
 
31
37
 
32
38
  exports.getOkrAdvancedSetting = getOkrAdvancedSetting;
33
39
 
34
40
  var getVersion = function getVersion() {
35
- return window.BSGlobal.tenantAuthentication.Version;
41
+ var _window$BSGlobal$tena;
42
+
43
+ return (_window$BSGlobal$tena = window.BSGlobal.tenantAuthentication) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Version;
36
44
  };
37
45
 
38
46
  exports.getVersion = getVersion;
39
47
 
40
48
  var getSource = function getSource() {
41
- var info = getBSGlobal('tenantInfo');
42
- return info.Source;
49
+ var _getTenantInfo;
50
+
51
+ return (_getTenantInfo = getTenantInfo()) === null || _getTenantInfo === void 0 ? void 0 : _getTenantInfo.Source;
43
52
  };
44
53
 
45
54
  exports.getSource = getSource;
@@ -57,7 +66,9 @@ var getUploadMaxSize = function getUploadMaxSize() {
57
66
  exports.getUploadMaxSize = getUploadMaxSize;
58
67
 
59
68
  function isWx() {
60
- return getTenantInfo().Source === 860 && getTenantInfo().corpCreateType !== 2;
69
+ var _getTenantInfo2, _getTenantInfo3;
70
+
71
+ return ((_getTenantInfo2 = getTenantInfo()) === null || _getTenantInfo2 === void 0 ? void 0 : _getTenantInfo2.Source) === 860 && ((_getTenantInfo3 = getTenantInfo()) === null || _getTenantInfo3 === void 0 ? void 0 : _getTenantInfo3.corpCreateType) !== 2;
61
72
  }
62
73
  /*
63
74
  *通过AppId,来查询是否开通这个产品
@@ -50,8 +50,10 @@ function getUploadMaxSize() {
50
50
  }
51
51
 
52
52
  function getApiUrl(url) {
53
+ var _getTenantInfo;
54
+
53
55
  var uid = (0, _bsGlobal.getUserInfo)().Id;
54
- var tid = getTenantInfo().Id;
56
+ var tid = (_getTenantInfo = getTenantInfo()) === null || _getTenantInfo === void 0 ? void 0 : _getTenantInfo.Id;
55
57
  var apiServer = (0, _bsGlobal.getBSGlobal)("apiPath");
56
58
  return "".concat(apiServer, "/api/v1/").concat(tid, "/").concat(uid, "/").concat(url);
57
59
  }
@@ -61,25 +63,33 @@ function getTenantInfo() {
61
63
  }
62
64
 
63
65
  var isDingDing = function isDingDing() {
64
- return getTenantInfo().Source === 861;
66
+ var _getTenantInfo2;
67
+
68
+ return ((_getTenantInfo2 = getTenantInfo()) === null || _getTenantInfo2 === void 0 ? void 0 : _getTenantInfo2.Source) === 861;
65
69
  };
66
70
 
67
71
  exports.isDingDing = isDingDing;
68
72
 
69
73
  var isFeishu = function isFeishu() {
70
- return getTenantInfo().Source === 862;
74
+ var _getTenantInfo3;
75
+
76
+ return ((_getTenantInfo3 = getTenantInfo()) === null || _getTenantInfo3 === void 0 ? void 0 : _getTenantInfo3.Source) === 862;
71
77
  };
72
78
 
73
79
  exports.isFeishu = isFeishu;
74
80
 
75
81
  var isLocal = function isLocal() {
76
- return !!getTenantInfo().isLocal;
82
+ var _getTenantInfo4;
83
+
84
+ return !!((_getTenantInfo4 = getTenantInfo()) !== null && _getTenantInfo4 !== void 0 && _getTenantInfo4.isLocal);
77
85
  };
78
86
 
79
87
  exports.isLocal = isLocal;
80
88
 
81
89
  var isTencentHr = function isTencentHr() {
82
- return getTenantInfo().Source === 964;
90
+ var _getTenantInfo5;
91
+
92
+ return ((_getTenantInfo5 = getTenantInfo()) === null || _getTenantInfo5 === void 0 ? void 0 : _getTenantInfo5.Source) === 964;
83
93
  };
84
94
 
85
95
  exports.isTencentHr = isTencentHr;
@@ -38,7 +38,9 @@ var DINGTALK_SOURCE = 861;
38
38
  var ignorePIds = [-1, 0, 10000];
39
39
 
40
40
  var getSource = function getSource() {
41
- return (0, _bsGlobal.getBSGlobal)('tenantInfo').Source;
41
+ var _getBSGlobal;
42
+
43
+ return (_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantInfo')) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.Source;
42
44
  };
43
45
 
44
46
  exports.getSource = getSource;
@@ -74,10 +76,10 @@ var getOpenId = function getOpenId(id, type) {
74
76
  exports.getOpenId = getOpenId;
75
77
 
76
78
  function openData() {
77
- var _getBSGlobal;
79
+ var _getBSGlobal2;
78
80
 
79
81
  // 企业微信租户 && 非自建应用
80
- if ((getSource() === WX_SOURCE || getUA().includes(WX_UA_STR)) && (_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantInfo')) !== null && _getBSGlobal !== void 0 && _getBSGlobal.isTranslate) {
82
+ if ((getSource() === WX_SOURCE || getUA().includes(WX_UA_STR)) && (_getBSGlobal2 = (0, _bsGlobal.getBSGlobal)('tenantInfo')) !== null && _getBSGlobal2 !== void 0 && _getBSGlobal2.isTranslate) {
81
83
  return function (p) {
82
84
  var pId = p.id,
83
85
  pName = p.name,
@@ -200,7 +202,9 @@ var isPlatform = function isPlatform(name) {
200
202
  exports.isPlatform = isPlatform;
201
203
 
202
204
  var parseTag = function parseTag(str) {
203
- var source = window.BSGlobal.tenantInfo.Source;
205
+ var _window$BSGlobal$tena;
206
+
207
+ var source = (_window$BSGlobal$tena = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena === void 0 ? void 0 : _window$BSGlobal$tena.Source;
204
208
  var ua = navigator.userAgent.toLowerCase();
205
209
  var reg = /<\w+[\w\W]*?(userId|departmentId)=["'](\S+?)["'][\w\W]*?>@([\w\W]*?)<\/\w+>/g;
206
210
  var strReg = /<\w+[\w\s"'\/=\:\.]*?(?:userId|departmentId)=["']\S+?["'][\w\s"'\/=\:\.]*?>[\w\W]*?<\/\w+?>/;
@@ -256,8 +260,10 @@ var parseTag = function parseTag(str) {
256
260
  exports.parseTag = parseTag;
257
261
 
258
262
  var parseString = function parseString(str) {
263
+ var _window$BSGlobal$tena2;
264
+
259
265
  // @ts-ignore
260
- var source = window.BSGlobal.tenantInfo.Source;
266
+ var source = (_window$BSGlobal$tena2 = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena2 === void 0 ? void 0 : _window$BSGlobal$tena2.Source;
261
267
  var ua = navigator.userAgent.toLowerCase();
262
268
 
263
269
  if (source != WX_SOURCE && ua.indexOf('wxwork') == -1) {
@@ -314,8 +320,10 @@ var openDataMapV2 = {
314
320
  };
315
321
 
316
322
  var parseStringV2 = function parseStringV2(str) {
323
+ var _window$BSGlobal$tena3;
324
+
317
325
  // @ts-ignore
318
- var source = window.BSGlobal.tenantInfo.Source;
326
+ var source = (_window$BSGlobal$tena3 = window.BSGlobal.tenantInfo) === null || _window$BSGlobal$tena3 === void 0 ? void 0 : _window$BSGlobal$tena3.Source;
319
327
  var ua = navigator.userAgent.toLowerCase();
320
328
 
321
329
  if (source != WX_SOURCE && ua.indexOf('micromessenger') == -1) {