@titaui/pc 1.13.10-beta.10 → 1.13.10-beta.11

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.
@@ -49,10 +49,14 @@ var _auth = require("../../utils/auth");
49
49
 
50
50
  var _invitePoint = _interopRequireDefault(require("./images/invite-point.png"));
51
51
 
52
+ var _tooltip = _interopRequireDefault(require("../tooltip"));
53
+
52
54
  var _inviteTanhao = _interopRequireDefault(require("./images/invite-tanhao.png"));
53
55
 
54
56
  require("./index.css");
55
57
 
58
+ var _getBSGlobal, _getBSGlobal2;
59
+
56
60
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
57
61
 
58
62
  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); }
@@ -74,6 +78,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
74
78
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
75
79
 
76
80
  var Role = new _auth.MyRole();
81
+ var isTry = ((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantAuthentication')) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.Version) === 1;
82
+ var staffCount = (_getBSGlobal2 = (0, _bsGlobal.getBSGlobal)('tenantAuthentication')) === null || _getBSGlobal2 === void 0 ? void 0 : _getBSGlobal2.StaffCount;
77
83
  var Logo = (0, _utils.getLogo)();
78
84
  var newNavigation = (0, _bsGlobal.getBSGlobal)('newNavigation') || [];
79
85
  var hasOKRApp = newNavigation.find(function (item) {
@@ -153,43 +159,25 @@ var NavTop = function NavTop() {
153
159
 
154
160
  var ua = navigator.userAgent.toLowerCase(); // const showWxInvite = getTenantInfo().mainCorpId && ua.indexOf("micromessenger") !== -1;
155
161
 
156
- var showWxInvite = (0, _bsGlobal.getTenantInfo)().Source === 860 && ua.indexOf("micromessenger") !== -1;
162
+ var showWxInvite = (0, _bsGlobal.getTenantInfo)().Source === 860 && ua.indexOf('micromessenger') !== -1 && isTry;
157
163
  var openWxInvite = (0, _react.useCallback)(function () {
158
- console.log(123, '我点击了');
159
-
160
164
  if (Role.isSuperManager) {
161
165
  if (window.WeixinJSBridge !== undefined) {
162
- console.log(345, '我开始点击调用了');
163
166
  window.WeixinJSBridge.invoke('openAppManage', {}, function (res) {
164
- console.log(678, res.err_msg);
167
+ console.log(res.err_msg);
165
168
 
166
169
  if (res.err_msg == 'openAppManage:ok') {// 调用成功
167
- }
168
-
169
- if (res.err_msg == "openAppManage:fail_no permission") {
170
- // 调用人身份不符合
171
- console.log(999, res.err_msg, inviteVisible);
172
-
170
+ } else {
173
171
  if (!inviteVisible) {
174
172
  setInviteVisible(true);
175
173
  }
176
174
 
177
175
  setInviteAuth(false);
178
176
  }
179
-
180
- if (res.err_msg == 'openAppManage:fail:unknown app') {// 应用信息获取失败
181
- }
182
-
183
- if (res.err_msg == 'openAppManage:fail:unsupported app type') {// 应用类型不符合要求
184
- }
185
-
186
- if (res.err_msg == 'openAppManage:fail') {// 其它错误
187
- }
188
177
  });
189
178
  }
190
179
  } else {
191
180
  if (window.WeixinJSBridge !== undefined) {
192
- console.log(777, '普通员工调用');
193
181
  window.WeixinJSBridge.invoke('selectPrivilegedContact', {
194
182
  fromDepartmentId: -1,
195
183
  // 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
@@ -375,9 +363,9 @@ var NavTop = function NavTop() {
375
363
  (0, _react.useEffect)(function () {
376
364
  var version = (0, _bsGlobal.getBSGlobal)('tenantAuthentication').Version;
377
365
  if (localStorage.getItem("cycle_setting_stop_show".concat((0, _bsGlobal.getUserInfo)().Id)) === 'true') return;
378
- localStorage.removeItem("OKR_CYCLE_SETTING");
366
+ localStorage.removeItem('OKR_CYCLE_SETTING');
379
367
  (0, _request2.getCycleSetting)().then(function (res) {
380
- localStorage.setItem("OKR_CYCLE_SETTING", JSON.stringify(res || {}));
368
+ localStorage.setItem('OKR_CYCLE_SETTING', JSON.stringify(res || {}));
381
369
  var hasSetting = res.hasSetting;
382
370
 
383
371
  if (version === 1 && isHasOkr() && !hasSetting) {
@@ -426,7 +414,18 @@ var NavTop = function NavTop() {
426
414
  }, /*#__PURE__*/_react["default"].createElement(_menu["default"], {
427
415
  menus: menu,
428
416
  activeMenuId: activeMenuId
429
- })), showWxInvite && /*#__PURE__*/_react["default"].createElement(_guideTip["default"], {
417
+ })), showWxInvite && (staffCount > 3 ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
418
+ overlay: Role.isSuperManager ? '添加员工' : '邀请同事',
419
+ placement: "bottom",
420
+ align: {
421
+ offset: [0, 5]
422
+ }
423
+ }, /*#__PURE__*/_react["default"].createElement("div", {
424
+ className: "".concat(preCls, "__invite"),
425
+ onClick: openWxInvite
426
+ }, /*#__PURE__*/_react["default"].createElement("i", {
427
+ className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
428
+ }))) : /*#__PURE__*/_react["default"].createElement(_guideTip["default"], {
430
429
  visible: inviteVisible,
431
430
  content: renderInviteContent(),
432
431
  type: inviteAuth ? 'default' : 'button',
@@ -443,7 +442,7 @@ var NavTop = function NavTop() {
443
442
  onClick: openWxInvite
444
443
  }, /*#__PURE__*/_react["default"].createElement("i", {
445
444
  className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
446
- }))), hasOKRApp && /*#__PURE__*/_react["default"].createElement("div", {
445
+ })))), hasOKRApp && /*#__PURE__*/_react["default"].createElement("div", {
447
446
  className: (0, _classnames["default"])("".concat(preCls, "__left-home"), (_classNames4 = {}, _defineProperty(_classNames4, "".concat(preCls, "__left-home--active"), activeMenuId === 99999), _defineProperty(_classNames4, "".concat(preCls, "__left-home--hover"), hasOKRApp), _classNames4))
448
447
  }, /*#__PURE__*/_react["default"].createElement("a", {
449
448
  href: "#homepage"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.13.10-beta.10",
3
+ "version": "1.13.10-beta.11",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",