@titaui/pc 1.15.3 → 1.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +1 -1
- package/lib/components/menus/components/menu-tree/tree-node/index.js +12 -2
- package/lib/components/menus/components/menu-tree/tree-node/same-level-user/index.css +58 -0
- package/lib/components/menus/components/menu-tree/tree-node/same-level-user/index.js +74 -0
- package/lib/components/menus/export-modules/summary-menus/menus.js +18 -18
- package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +1 -1
- package/lib/components/nav-top/images/invite-bkg.jpg +0 -0
- package/lib/components/nav-top/images/invite-person.jpg +0 -0
- package/lib/components/nav-top/images/invite-point.png +0 -0
- package/lib/components/nav-top/images/invite-tanhao.png +0 -0
- package/lib/components/nav-top/index.css +36 -0
- package/lib/components/nav-top/index.js +140 -41
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ var TableRowOKR = function TableRowOKR(_ref) {
|
|
|
57
57
|
onClick: handleClickTitle
|
|
58
58
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
59
59
|
className: "tu-icon-H5-".concat(isO ? "O" : "KR", "-s ").concat(prefix, "__common-icon")
|
|
60
|
-
}), /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement("span", null, (0, _openData.parseString)(text)), isO && Number(data.CycleType) !== 0
|
|
60
|
+
}), /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement("span", null, (0, _openData.parseString)(text)), isO && (Number(data.CycleType) !== 0 || Number(data.AnnualNum) !== 0 || Number(data.YqmNum !== 0) || data.StartDate && data.EndDate) && /*#__PURE__*/_react["default"].createElement("span", {
|
|
61
61
|
className: "".concat(prefix, "__common-time")
|
|
62
62
|
}, (0, _utils.formatPeriod)({
|
|
63
63
|
annualNum: data.AnnualNum,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.USER_NODE = exports.USER_CONCERN_NODE = exports.TONGJI_NODE = exports.SUB_MENU_ITEM_NOE = exports.SUBORDINATES_NODE = exports.SHARE_NODE = exports.PARENT_MENU_NODE = exports.NO_SUBORDINATES_NODE = exports.NO_FOLLOWER_NODE = exports.MENU_ITEM_NOE = exports.MENU_ASSESS_TEMPLATE = exports.MENU_ASSESS_MANAGE = exports.LOADING_NODE = exports.GROUP_NAME_NODE = exports.FOLLOWER_NODE = exports.DEPART_NODE = exports.COMPANY_NODE = exports.COMPANY_ALL_NODE = void 0;
|
|
6
|
+
exports.USER_NODE = exports.USER_CONCERN_NODE = exports.TONGJI_NODE = exports.SUB_MENU_ITEM_NOE = exports.SUBORDINATES_NODE = exports.SHARE_NODE = exports.SAME_LEVEL_USER_NODE = exports.PARENT_MENU_NODE = exports.NO_SUBORDINATES_NODE = exports.NO_FOLLOWER_NODE = exports.MENU_ITEM_NOE = exports.MENU_ASSESS_TEMPLATE = exports.MENU_ASSESS_MANAGE = exports.LOADING_NODE = exports.GROUP_NAME_NODE = exports.FOLLOWER_NODE = exports.DEPART_NODE = exports.COMPANY_NODE = exports.COMPANY_ALL_NODE = void 0;
|
|
7
7
|
exports["default"] = _default;
|
|
8
8
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -30,6 +30,8 @@ var _depart = _interopRequireDefault(require("./depart"));
|
|
|
30
30
|
|
|
31
31
|
var _user = _interopRequireDefault(require("./user"));
|
|
32
32
|
|
|
33
|
+
var _sameLevelUser = _interopRequireDefault(require("./same-level-user"));
|
|
34
|
+
|
|
33
35
|
var _companyAll = _interopRequireDefault(require("./company-all"));
|
|
34
36
|
|
|
35
37
|
var _noFollower = _interopRequireDefault(require("./no-follower"));
|
|
@@ -82,6 +84,12 @@ function _default(node, level, _ref) {
|
|
|
82
84
|
onExpand: onExpand
|
|
83
85
|
}));
|
|
84
86
|
|
|
87
|
+
case SAME_LEVEL_USER_NODE:
|
|
88
|
+
return /*#__PURE__*/_react["default"].createElement(_sameLevelUser["default"], _extends({}, node, {
|
|
89
|
+
level: level,
|
|
90
|
+
onExpand: onExpand
|
|
91
|
+
}));
|
|
92
|
+
|
|
85
93
|
case USER_CONCERN_NODE:
|
|
86
94
|
return /*#__PURE__*/_react["default"].createElement(_userConcern["default"], _extends({}, node, {
|
|
87
95
|
level: level,
|
|
@@ -182,4 +190,6 @@ exports.SUBORDINATES_NODE = SUBORDINATES_NODE;
|
|
|
182
190
|
var SHARE_NODE = 'share';
|
|
183
191
|
exports.SHARE_NODE = SHARE_NODE;
|
|
184
192
|
var TONGJI_NODE = 'tongji';
|
|
185
|
-
exports.TONGJI_NODE = TONGJI_NODE;
|
|
193
|
+
exports.TONGJI_NODE = TONGJI_NODE;
|
|
194
|
+
var SAME_LEVEL_USER_NODE = 'same-level-user';
|
|
195
|
+
exports.SAME_LEVEL_USER_NODE = SAME_LEVEL_USER_NODE;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.titaui-menus-tree__user-node {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: 40px;
|
|
5
|
+
line-height: 40px;
|
|
6
|
+
border-radius: 12px;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.titaui-menus-tree__user-node:hover .titaui-menus-tree__user-node-username {
|
|
12
|
+
color: #2879ff;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.titaui-menus-tree__user-node-avatar {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
line-height: 24px;
|
|
18
|
+
width: 24px;
|
|
19
|
+
height: 24px;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
color: white;
|
|
23
|
+
margin-right: 8px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.titaui-menus-tree__user-node-avatar-slice {
|
|
27
|
+
display: inline-block;
|
|
28
|
+
width: 18px;
|
|
29
|
+
text-indent: 6px;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.titaui-menus-tree__user-node-username {
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
font-weight: 400;
|
|
36
|
+
color: #3f4755;
|
|
37
|
+
line-height: 20px;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.titaui-menus-tree__user-node-sub {
|
|
44
|
+
position: absolute;
|
|
45
|
+
width: 24px;
|
|
46
|
+
height: 24px;
|
|
47
|
+
color: #2879ff;
|
|
48
|
+
right: 0;
|
|
49
|
+
top: 8px;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-items: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.titaui-menus-tree__user-node-sub:hover {
|
|
57
|
+
color: #5C8EFF;
|
|
58
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = _default;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _openData = require("../../../../../../utils/open-data");
|
|
15
|
+
|
|
16
|
+
var _context = require("../../../../context");
|
|
17
|
+
|
|
18
|
+
var _avatar = _interopRequireDefault(require("../avatar"));
|
|
19
|
+
|
|
20
|
+
var _precls = _interopRequireDefault(require("../../precls"));
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
30
|
+
function _default(props) {
|
|
31
|
+
var user = props.data,
|
|
32
|
+
_props$level = props.level,
|
|
33
|
+
level = _props$level === void 0 ? 0 : _props$level,
|
|
34
|
+
_props$isFlip = props.isFlip,
|
|
35
|
+
isFlip = _props$isFlip === void 0 ? true : _props$isFlip,
|
|
36
|
+
onExpand = props.onExpand;
|
|
37
|
+
var hasSubordinates = user.hasSubordinates;
|
|
38
|
+
|
|
39
|
+
var _useContext = (0, _react.useContext)(_context.FlipContext),
|
|
40
|
+
flipGoNext = _useContext.flipGoNext;
|
|
41
|
+
|
|
42
|
+
var openSubordinate = function openSubordinate(e) {
|
|
43
|
+
e.stopPropagation();
|
|
44
|
+
|
|
45
|
+
if (isFlip) {
|
|
46
|
+
flipGoNext({
|
|
47
|
+
type: "subordinate",
|
|
48
|
+
options: {
|
|
49
|
+
toUserId: user.userId
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
onExpand(e);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
58
|
+
title: "",
|
|
59
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "__user-node")),
|
|
60
|
+
style: {
|
|
61
|
+
paddingLeft: 12 + level * 10
|
|
62
|
+
}
|
|
63
|
+
}, /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
|
|
64
|
+
user: user
|
|
65
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
66
|
+
style: {
|
|
67
|
+
width: "calc(100% - ".concat(12 + 13 + 16 + level * 10, "px)")
|
|
68
|
+
},
|
|
69
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "__user-node-username"), "noselect")
|
|
70
|
+
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
71
|
+
name: user.name,
|
|
72
|
+
id: user.userId
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
@@ -87,15 +87,6 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
87
87
|
children: [],
|
|
88
88
|
href: "#/summary/subordinates",
|
|
89
89
|
isShow: window.BSGlobal.loginUserInfo.HasSub
|
|
90
|
-
}, {
|
|
91
|
-
icon: "caidan-enjoy",
|
|
92
|
-
label: _i18n.locale.menu_my_share,
|
|
93
|
-
key: this.SHARE,
|
|
94
|
-
type: this.SHARE,
|
|
95
|
-
isLeaf: false,
|
|
96
|
-
children: [],
|
|
97
|
-
href: "#/summary/share",
|
|
98
|
-
isShow: props.isShowShare
|
|
99
90
|
}, {
|
|
100
91
|
icon: "caidan-tongji",
|
|
101
92
|
label: _i18n.locale.menu_summary_tongji,
|
|
@@ -105,6 +96,15 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
105
96
|
children: [],
|
|
106
97
|
href: "#/summary/tongji",
|
|
107
98
|
isShow: props.isShowTongji
|
|
99
|
+
}, {
|
|
100
|
+
icon: "caidan-enjoy",
|
|
101
|
+
label: _i18n.locale.menu_my_share,
|
|
102
|
+
key: this.SHARE,
|
|
103
|
+
type: this.SHARE,
|
|
104
|
+
isLeaf: false,
|
|
105
|
+
children: [],
|
|
106
|
+
href: "#/summary/share",
|
|
107
|
+
isShow: props.isShowShare
|
|
108
108
|
}, {
|
|
109
109
|
icon: "bumen",
|
|
110
110
|
label: _i18n.locale.menu_department,
|
|
@@ -187,10 +187,10 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
187
187
|
}, {
|
|
188
188
|
key: "setShareLoading",
|
|
189
189
|
value: function setShareLoading(loading) {
|
|
190
|
-
this.menus[
|
|
190
|
+
this.menus[4].children = [];
|
|
191
191
|
|
|
192
192
|
if (loading) {
|
|
193
|
-
this.menus[
|
|
193
|
+
this.menus[4].children.push({
|
|
194
194
|
icon: "",
|
|
195
195
|
label: "loading",
|
|
196
196
|
key: "loading-subordinates",
|
|
@@ -203,10 +203,10 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
203
203
|
}, {
|
|
204
204
|
key: "setTongjiLoading",
|
|
205
205
|
value: function setTongjiLoading(loading) {
|
|
206
|
-
this.menus[
|
|
206
|
+
this.menus[3].children = [];
|
|
207
207
|
|
|
208
208
|
if (loading) {
|
|
209
|
-
this.menus[
|
|
209
|
+
this.menus[3].children.push({
|
|
210
210
|
icon: "",
|
|
211
211
|
label: "loading",
|
|
212
212
|
key: "loading-subordinates",
|
|
@@ -220,7 +220,7 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
220
220
|
key: "insertShare",
|
|
221
221
|
value: function insertShare(users) {
|
|
222
222
|
if (!users || !users.length) {
|
|
223
|
-
this.menus[
|
|
223
|
+
this.menus[4].children = [{
|
|
224
224
|
icon: "",
|
|
225
225
|
label: "empty-subordinates",
|
|
226
226
|
key: "empty-subordinates",
|
|
@@ -245,13 +245,13 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
this.menus[
|
|
248
|
+
this.menus[4].children = treeNodeUsers;
|
|
249
249
|
}
|
|
250
250
|
}, {
|
|
251
251
|
key: "insertTongji",
|
|
252
252
|
value: function insertTongji(users) {
|
|
253
253
|
if (!users || !users.length) {
|
|
254
|
-
this.menus[
|
|
254
|
+
this.menus[3].children = [{
|
|
255
255
|
icon: "",
|
|
256
256
|
label: "empty-subordinates",
|
|
257
257
|
key: "empty-subordinates",
|
|
@@ -270,13 +270,13 @@ var summaryMenus = /*#__PURE__*/function () {
|
|
|
270
270
|
icon: "",
|
|
271
271
|
label: user.name,
|
|
272
272
|
key: "".concat(user.userId),
|
|
273
|
-
type: _index.
|
|
273
|
+
type: _index.SAME_LEVEL_USER_NODE,
|
|
274
274
|
href: "",
|
|
275
275
|
data: user
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
this.menus[
|
|
279
|
+
this.menus[3].children = treeNodeUsers;
|
|
280
280
|
}
|
|
281
281
|
}, {
|
|
282
282
|
key: "getMenus",
|
|
@@ -122,7 +122,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
122
122
|
var nodeType = node.nodeType,
|
|
123
123
|
data = node.data;
|
|
124
124
|
|
|
125
|
-
if (nodeType == _index.USER_NODE || nodeType == _index.FOLLOWER_NODE) {
|
|
125
|
+
if (nodeType == _index.USER_NODE || nodeType == _index.FOLLOWER_NODE || nodeType == _index.SAME_LEVEL_USER_NODE) {
|
|
126
126
|
location.href = "#/summary/manage?toUserId=".concat(data.userId, "&subordinates=1");
|
|
127
127
|
}
|
|
128
128
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -170,6 +170,42 @@
|
|
|
170
170
|
color: #ffffff;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
.titaui-nav-top__invite-guide {
|
|
174
|
+
background-image: url("./images/invite-bkg.jpg"), url("./images/invite-person.jpg") !important;
|
|
175
|
+
background-repeat: no-repeat,no-repeat !important;
|
|
176
|
+
background-size: 87px 104px, 92px 53px !important;
|
|
177
|
+
background-position: 0% 0%,100% 100% !important;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.titaui-nav-top__invite-guide-content {
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: flex-start;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.titaui-nav-top__invite-guide-content-waring {
|
|
186
|
+
width: 18px;
|
|
187
|
+
margin-right: 6px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.titaui-nav-top__invite-guide-content-point {
|
|
191
|
+
width: 14px;
|
|
192
|
+
margin-right: 8px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.titaui-nav-top__invite-guide-content-title {
|
|
196
|
+
font-size: 14px;
|
|
197
|
+
color: #FFFFFF;
|
|
198
|
+
font-weight: 600;
|
|
199
|
+
line-height: 22px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.titaui-nav-top__invite-guide-content-subTitle {
|
|
203
|
+
margin-top: 8px;
|
|
204
|
+
font-size: 12px;
|
|
205
|
+
color: #FFFFFF;
|
|
206
|
+
line-height: 22px;
|
|
207
|
+
}
|
|
208
|
+
|
|
173
209
|
.titaui-nav-top__app-guide-content {
|
|
174
210
|
color: #fff;
|
|
175
211
|
margin-bottom: 8px;
|
|
@@ -45,8 +45,18 @@ var _interface = require("../../components/help-card/interface");
|
|
|
45
45
|
|
|
46
46
|
var _request2 = require("./request.apis");
|
|
47
47
|
|
|
48
|
+
var _auth = require("../../utils/auth");
|
|
49
|
+
|
|
50
|
+
var _invitePoint = _interopRequireDefault(require("./images/invite-point.png"));
|
|
51
|
+
|
|
52
|
+
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
53
|
+
|
|
54
|
+
var _inviteTanhao = _interopRequireDefault(require("./images/invite-tanhao.png"));
|
|
55
|
+
|
|
48
56
|
require("./index.css");
|
|
49
57
|
|
|
58
|
+
var _getBSGlobal, _getBSGlobal2;
|
|
59
|
+
|
|
50
60
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
51
61
|
|
|
52
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); }
|
|
@@ -67,12 +77,15 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
67
77
|
|
|
68
78
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
69
79
|
|
|
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)('tenantInfo')) === null || _getBSGlobal2 === void 0 ? void 0 : _getBSGlobal2.StaffCount;
|
|
70
83
|
var Logo = (0, _utils.getLogo)();
|
|
71
|
-
var newNavigation = (0, _bsGlobal.getBSGlobal)(
|
|
84
|
+
var newNavigation = (0, _bsGlobal.getBSGlobal)('newNavigation') || [];
|
|
72
85
|
var hasOKRApp = newNavigation.find(function (item) {
|
|
73
86
|
return item.appId === 113;
|
|
74
87
|
});
|
|
75
|
-
var preCls =
|
|
88
|
+
var preCls = 'titaui-nav-top';
|
|
76
89
|
|
|
77
90
|
var NavTop = function NavTop() {
|
|
78
91
|
var _classNames4;
|
|
@@ -87,7 +100,7 @@ var NavTop = function NavTop() {
|
|
|
87
100
|
menu = _useState2[0],
|
|
88
101
|
setMenu = _useState2[1];
|
|
89
102
|
|
|
90
|
-
var versionInfo = (0, _bsGlobal.getBSGlobal)(
|
|
103
|
+
var versionInfo = (0, _bsGlobal.getBSGlobal)('tenantAuthentication');
|
|
91
104
|
|
|
92
105
|
var _useState3 = (0, _react.useState)(-1),
|
|
93
106
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -134,44 +147,73 @@ var NavTop = function NavTop() {
|
|
|
134
147
|
bookDemoVisible = _useState20[0],
|
|
135
148
|
setBookDemoVisible = _useState20[1];
|
|
136
149
|
|
|
137
|
-
var
|
|
138
|
-
|
|
150
|
+
var _useState21 = (0, _react.useState)(true),
|
|
151
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
152
|
+
inviteVisible = _useState22[0],
|
|
153
|
+
setInviteVisible = _useState22[1];
|
|
154
|
+
|
|
155
|
+
var _useState23 = (0, _react.useState)(true),
|
|
156
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
157
|
+
inviteAuth = _useState24[0],
|
|
158
|
+
setInviteAuth = _useState24[1];
|
|
159
|
+
|
|
160
|
+
var ua = navigator.userAgent.toLowerCase(); // const showWxInvite = getTenantInfo().mainCorpId && ua.indexOf("micromessenger") !== -1;
|
|
161
|
+
|
|
162
|
+
var canShowInvite = (0, _bsGlobal.getTenantInfo)().mainCorpId || Role.isSuperManager;
|
|
163
|
+
var showWxInvite = (0, _bsGlobal.getTenantInfo)().Source === 860 && ua.indexOf('micromessenger') !== -1 && isTry && canShowInvite;
|
|
139
164
|
var openWxInvite = (0, _react.useCallback)(function () {
|
|
140
|
-
if (
|
|
141
|
-
window.WeixinJSBridge
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
165
|
+
if (Role.isSuperManager) {
|
|
166
|
+
if (window.WeixinJSBridge !== undefined) {
|
|
167
|
+
window.WeixinJSBridge.invoke('openAppManage', {}, function (res) {
|
|
168
|
+
console.log(res.err_msg);
|
|
169
|
+
|
|
170
|
+
if (res.err_msg == 'openAppManage:ok') {// 调用成功
|
|
171
|
+
} else {
|
|
172
|
+
if (!inviteVisible) {
|
|
173
|
+
setInviteVisible(true);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
setInviteAuth(false);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
if (window.WeixinJSBridge !== undefined) {
|
|
182
|
+
window.WeixinJSBridge.invoke('selectPrivilegedContact', {
|
|
183
|
+
fromDepartmentId: -1,
|
|
184
|
+
// 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
|
|
185
|
+
mode: 'multi',
|
|
186
|
+
// 必填,选择模式,single表示单选,multi表示多选
|
|
187
|
+
selectedContextContact: 0 // 是否勾选当前环境的参与者。例如在群+号聊天附件栏打开,默认勾选当前群成员。
|
|
188
|
+
|
|
189
|
+
}, function (res) {
|
|
190
|
+
if (res.err_msg === 'selectPrivilegedContact:ok') {
|
|
191
|
+
var selectedTicket = res.result.selectedTicket.replace(/['"]/g, ''); // 已选的集合Ticket
|
|
192
|
+
|
|
193
|
+
(0, _request.rpost)('v1')("wx/send/templateMessage?selectedTickets=".concat(selectedTicket)).then(function () {
|
|
194
|
+
_toast["default"].Success('邀请成功');
|
|
195
|
+
})["catch"](function () {
|
|
196
|
+
_toast["default"].Error('邀请失败');
|
|
197
|
+
});
|
|
198
|
+
} else {// console.log(res);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
160
202
|
}
|
|
161
|
-
}, []);
|
|
203
|
+
}, [inviteVisible]);
|
|
162
204
|
|
|
163
205
|
var handleHashChange = function handleHashChange() {
|
|
164
206
|
setAppCenterVisible(false);
|
|
165
|
-
var hash = window.location.hash.split(
|
|
207
|
+
var hash = window.location.hash.split('?')[0] || '';
|
|
166
208
|
|
|
167
209
|
if (hash) {
|
|
168
210
|
var activeMenu = menu.find(function (item) {
|
|
169
211
|
var _item$href$split, _item$href$split$;
|
|
170
212
|
|
|
171
|
-
return hash.includes((_item$href$split = item.href.split(
|
|
213
|
+
return hash.includes((_item$href$split = item.href.split('#')) === null || _item$href$split === void 0 ? void 0 : (_item$href$split$ = _item$href$split[1]) === null || _item$href$split$ === void 0 ? void 0 : _item$href$split$.split('?')[0]);
|
|
172
214
|
});
|
|
173
215
|
|
|
174
|
-
if (hash.includes(
|
|
216
|
+
if (hash.includes('homepage')) {
|
|
175
217
|
setActiveMenuId(99999);
|
|
176
218
|
return;
|
|
177
219
|
}
|
|
@@ -186,9 +228,9 @@ var NavTop = function NavTop() {
|
|
|
186
228
|
|
|
187
229
|
(0, _react.useEffect)(function () {
|
|
188
230
|
handleHashChange();
|
|
189
|
-
window.addEventListener(
|
|
231
|
+
window.addEventListener('hashchange', handleHashChange);
|
|
190
232
|
return function () {
|
|
191
|
-
window.removeEventListener(
|
|
233
|
+
window.removeEventListener('hashchange', handleHashChange);
|
|
192
234
|
};
|
|
193
235
|
}, [menu]);
|
|
194
236
|
(0, _react.useEffect)(function () {
|
|
@@ -211,6 +253,10 @@ var NavTop = function NavTop() {
|
|
|
211
253
|
}
|
|
212
254
|
}, [appCenterVisible]);
|
|
213
255
|
|
|
256
|
+
var handleCloseInviteGuide = function handleCloseInviteGuide() {
|
|
257
|
+
setInviteVisible(false);
|
|
258
|
+
};
|
|
259
|
+
|
|
214
260
|
var handleCloseSummaryGuide = function handleCloseSummaryGuide() {
|
|
215
261
|
setSummaryGuideVisible(false);
|
|
216
262
|
var loginUserId = BSGlobal.loginUserInfo.Id;
|
|
@@ -272,6 +318,36 @@ var NavTop = function NavTop() {
|
|
|
272
318
|
}
|
|
273
319
|
};
|
|
274
320
|
|
|
321
|
+
var renderInviteContent = (0, _react.useCallback)(function () {
|
|
322
|
+
var title = '你没有权限,快去联系企业微信超级管理员操';
|
|
323
|
+
if (!inviteAuth) return /*#__PURE__*/_react["default"].createElement("div", {
|
|
324
|
+
className: "".concat(preCls, "__invite-guide-content")
|
|
325
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
326
|
+
src: _inviteTanhao["default"],
|
|
327
|
+
alt: "",
|
|
328
|
+
className: "".concat(preCls, "__invite-guide-content-waring")
|
|
329
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
330
|
+
className: "".concat(preCls, "__invite-guide-content-right")
|
|
331
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
332
|
+
className: "".concat(preCls, "__invite-guide-content-title")
|
|
333
|
+
}, title)));
|
|
334
|
+
title = Role.isSuperManager ? '点击这里进入企业微信后台,添加公司员工,体验更多功能' : '邀请同事一起体验吧';
|
|
335
|
+
var subtitle = '试用 7 天内成功邀请 3 人加入,即可免费开启试用 OKR 案例库';
|
|
336
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
337
|
+
className: "".concat(preCls, "__invite-guide-content")
|
|
338
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
339
|
+
src: _invitePoint["default"],
|
|
340
|
+
alt: "",
|
|
341
|
+
className: "".concat(preCls, "__invite-guide-content-point")
|
|
342
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
343
|
+
className: "".concat(preCls, "__invite-guide-content-right")
|
|
344
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
345
|
+
className: "".concat(preCls, "__invite-guide-content-title")
|
|
346
|
+
}, title), /*#__PURE__*/_react["default"].createElement("div", {
|
|
347
|
+
className: "".concat(preCls, "__invite-guide-content-subTitle")
|
|
348
|
+
}, subtitle)));
|
|
349
|
+
}, [inviteAuth]);
|
|
350
|
+
|
|
275
351
|
var isHasOkr = function isHasOkr() {
|
|
276
352
|
//判断是否安装了OKR
|
|
277
353
|
var okrIndex = (0, _bsGlobal.getBSGlobal)('WebHead').AppHead.findIndex(function (item) {
|
|
@@ -288,9 +364,9 @@ var NavTop = function NavTop() {
|
|
|
288
364
|
(0, _react.useEffect)(function () {
|
|
289
365
|
var version = (0, _bsGlobal.getBSGlobal)('tenantAuthentication').Version;
|
|
290
366
|
if (localStorage.getItem("cycle_setting_stop_show".concat((0, _bsGlobal.getUserInfo)().Id)) === 'true') return;
|
|
291
|
-
localStorage.removeItem(
|
|
367
|
+
localStorage.removeItem('OKR_CYCLE_SETTING');
|
|
292
368
|
(0, _request2.getCycleSetting)().then(function (res) {
|
|
293
|
-
localStorage.setItem(
|
|
369
|
+
localStorage.setItem('OKR_CYCLE_SETTING', JSON.stringify(res || {}));
|
|
294
370
|
var hasSetting = res.hasSetting;
|
|
295
371
|
|
|
296
372
|
if (version === 1 && isHasOkr() && !hasSetting) {
|
|
@@ -328,7 +404,7 @@ var NavTop = function NavTop() {
|
|
|
328
404
|
onClickClose: handleCloseSummaryGuide,
|
|
329
405
|
width: 197
|
|
330
406
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
331
|
-
className: (0, _classnames["default"])("".concat(preCls, "__left-app-center"),
|
|
407
|
+
className: (0, _classnames["default"])("".concat(preCls, "__left-app-center"), 'document-mouse-event-ignore', _defineProperty({}, "".concat(preCls, "__left-app-center--active"), appCenterVisible)),
|
|
332
408
|
onClick: function onClick() {
|
|
333
409
|
return setAppCenterVisible(!appCenterVisible);
|
|
334
410
|
}
|
|
@@ -339,7 +415,35 @@ var NavTop = function NavTop() {
|
|
|
339
415
|
}, /*#__PURE__*/_react["default"].createElement(_menu["default"], {
|
|
340
416
|
menus: menu,
|
|
341
417
|
activeMenuId: activeMenuId
|
|
342
|
-
})),
|
|
418
|
+
})), showWxInvite && (staffCount > 3 ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
419
|
+
overlay: Role.isSuperManager ? '添加员工' : '邀请同事',
|
|
420
|
+
placement: "bottom",
|
|
421
|
+
align: {
|
|
422
|
+
offset: [0, 5]
|
|
423
|
+
}
|
|
424
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
425
|
+
className: "".concat(preCls, "__invite"),
|
|
426
|
+
onClick: openWxInvite
|
|
427
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
428
|
+
className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
|
|
429
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_guideTip["default"], {
|
|
430
|
+
visible: inviteVisible,
|
|
431
|
+
content: renderInviteContent(),
|
|
432
|
+
type: inviteAuth ? 'default' : 'button',
|
|
433
|
+
popupPlacement: "bottom",
|
|
434
|
+
classnames: inviteAuth ? "".concat(preCls, "__invite-guide") : '',
|
|
435
|
+
onClickClose: handleCloseInviteGuide,
|
|
436
|
+
popupAlign: {
|
|
437
|
+
offset: [0, 5]
|
|
438
|
+
},
|
|
439
|
+
zIndex: 1000,
|
|
440
|
+
width: 308
|
|
441
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
442
|
+
className: "".concat(preCls, "__invite"),
|
|
443
|
+
onClick: openWxInvite
|
|
444
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
445
|
+
className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
|
|
446
|
+
})))), hasOKRApp && /*#__PURE__*/_react["default"].createElement("div", {
|
|
343
447
|
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))
|
|
344
448
|
}, /*#__PURE__*/_react["default"].createElement("a", {
|
|
345
449
|
href: "#homepage"
|
|
@@ -347,12 +451,7 @@ var NavTop = function NavTop() {
|
|
|
347
451
|
alt: "home-img",
|
|
348
452
|
src: _home["default"],
|
|
349
453
|
className: "".concat(preCls, "__left-home-img")
|
|
350
|
-
}))),
|
|
351
|
-
className: "".concat(preCls, "__invite"),
|
|
352
|
-
onClick: openWxInvite
|
|
353
|
-
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
354
|
-
className: (0, _classnames["default"])("tu-icon-add-people", "".concat(preCls, "__invite-icon"))
|
|
355
|
-
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
454
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
356
455
|
className: "".concat(preCls, "__msg")
|
|
357
456
|
}, /*#__PURE__*/_react["default"].createElement(_userMessage["default"], null)), versionInfo.Version === 1 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
358
457
|
className: "".concat(preCls, "__version")
|