@titaui/pc 1.15.3 → 1.15.6-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.
- 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 +156 -26
- 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,25 +147,57 @@ var NavTop = function NavTop() {
|
|
|
134
147
|
bookDemoVisible = _useState20[0],
|
|
135
148
|
setBookDemoVisible = _useState20[1];
|
|
136
149
|
|
|
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
|
+
|
|
137
160
|
var ua = navigator.userAgent.toLowerCase();
|
|
138
|
-
var showWxInvite = (0, _bsGlobal.getTenantInfo)().mainCorpId && ua.indexOf(
|
|
161
|
+
var showWxInvite = (0, _bsGlobal.getTenantInfo)().mainCorpId && ua.indexOf('micromessenger') !== -1;
|
|
162
|
+
var showMangeAdd = !(0, _bsGlobal.getTenantInfo)().mainCorpId && ua.indexOf('micromessenger') !== -1 && isTry && Role.isSuperManager; // const canShowInvite = getTenantInfo().mainCorpId || Role.isSuperManager
|
|
163
|
+
// const showWxInvite =
|
|
164
|
+
// getTenantInfo().Source === 860 &&
|
|
165
|
+
// ua.indexOf('micromessenger') !== -1 &&
|
|
166
|
+
// isTry && canShowInvite
|
|
167
|
+
|
|
168
|
+
var manageAdd = (0, _react.useCallback)(function () {
|
|
169
|
+
if (window.WeixinJSBridge !== undefined) {
|
|
170
|
+
window.WeixinJSBridge.invoke('openAppManage', {}, function (res) {
|
|
171
|
+
console.log(res.err_msg);
|
|
172
|
+
|
|
173
|
+
if (res.err_msg == 'openAppManage:ok') {// 调用成功
|
|
174
|
+
} else {
|
|
175
|
+
if (!inviteVisible) {
|
|
176
|
+
setInviteVisible(true);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
setInviteAuth(false);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}, [inviteVisible]);
|
|
139
184
|
var openWxInvite = (0, _react.useCallback)(function () {
|
|
140
185
|
if (window.WeixinJSBridge !== undefined) {
|
|
141
|
-
window.WeixinJSBridge.invoke(
|
|
186
|
+
window.WeixinJSBridge.invoke('selectPrivilegedContact', {
|
|
142
187
|
fromDepartmentId: -1,
|
|
143
188
|
// 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
|
|
144
|
-
mode:
|
|
189
|
+
mode: 'multi',
|
|
145
190
|
// 必填,选择模式,single表示单选,multi表示多选
|
|
146
191
|
selectedContextContact: 0 // 是否勾选当前环境的参与者。例如在群+号聊天附件栏打开,默认勾选当前群成员。
|
|
147
192
|
|
|
148
193
|
}, function (res) {
|
|
149
|
-
if (res.err_msg ===
|
|
150
|
-
var selectedTicket = res.result.selectedTicket.replace(/['"]/g,
|
|
194
|
+
if (res.err_msg === 'selectPrivilegedContact:ok') {
|
|
195
|
+
var selectedTicket = res.result.selectedTicket.replace(/['"]/g, ''); // 已选的集合Ticket
|
|
151
196
|
|
|
152
|
-
(0, _request.rpost)(
|
|
153
|
-
_toast["default"].Success(
|
|
197
|
+
(0, _request.rpost)('v1')("wx/send/templateMessage?selectedTickets=".concat(selectedTicket)).then(function () {
|
|
198
|
+
_toast["default"].Success('邀请成功');
|
|
154
199
|
})["catch"](function () {
|
|
155
|
-
_toast["default"].Error(
|
|
200
|
+
_toast["default"].Error('邀请失败');
|
|
156
201
|
});
|
|
157
202
|
} else {// console.log(res);
|
|
158
203
|
}
|
|
@@ -162,16 +207,16 @@ var NavTop = function NavTop() {
|
|
|
162
207
|
|
|
163
208
|
var handleHashChange = function handleHashChange() {
|
|
164
209
|
setAppCenterVisible(false);
|
|
165
|
-
var hash = window.location.hash.split(
|
|
210
|
+
var hash = window.location.hash.split('?')[0] || '';
|
|
166
211
|
|
|
167
212
|
if (hash) {
|
|
168
213
|
var activeMenu = menu.find(function (item) {
|
|
169
214
|
var _item$href$split, _item$href$split$;
|
|
170
215
|
|
|
171
|
-
return hash.includes((_item$href$split = item.href.split(
|
|
216
|
+
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
217
|
});
|
|
173
218
|
|
|
174
|
-
if (hash.includes(
|
|
219
|
+
if (hash.includes('homepage')) {
|
|
175
220
|
setActiveMenuId(99999);
|
|
176
221
|
return;
|
|
177
222
|
}
|
|
@@ -186,9 +231,9 @@ var NavTop = function NavTop() {
|
|
|
186
231
|
|
|
187
232
|
(0, _react.useEffect)(function () {
|
|
188
233
|
handleHashChange();
|
|
189
|
-
window.addEventListener(
|
|
234
|
+
window.addEventListener('hashchange', handleHashChange);
|
|
190
235
|
return function () {
|
|
191
|
-
window.removeEventListener(
|
|
236
|
+
window.removeEventListener('hashchange', handleHashChange);
|
|
192
237
|
};
|
|
193
238
|
}, [menu]);
|
|
194
239
|
(0, _react.useEffect)(function () {
|
|
@@ -211,6 +256,10 @@ var NavTop = function NavTop() {
|
|
|
211
256
|
}
|
|
212
257
|
}, [appCenterVisible]);
|
|
213
258
|
|
|
259
|
+
var handleCloseInviteGuide = function handleCloseInviteGuide() {
|
|
260
|
+
setInviteVisible(false);
|
|
261
|
+
};
|
|
262
|
+
|
|
214
263
|
var handleCloseSummaryGuide = function handleCloseSummaryGuide() {
|
|
215
264
|
setSummaryGuideVisible(false);
|
|
216
265
|
var loginUserId = BSGlobal.loginUserInfo.Id;
|
|
@@ -272,6 +321,36 @@ var NavTop = function NavTop() {
|
|
|
272
321
|
}
|
|
273
322
|
};
|
|
274
323
|
|
|
324
|
+
var renderInviteContent = (0, _react.useCallback)(function () {
|
|
325
|
+
var title = '你没有权限,快去联系企业微信超级管理员操';
|
|
326
|
+
if (!inviteAuth) return /*#__PURE__*/_react["default"].createElement("div", {
|
|
327
|
+
className: "".concat(preCls, "__invite-guide-content")
|
|
328
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
329
|
+
src: _inviteTanhao["default"],
|
|
330
|
+
alt: "",
|
|
331
|
+
className: "".concat(preCls, "__invite-guide-content-waring")
|
|
332
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
333
|
+
className: "".concat(preCls, "__invite-guide-content-right")
|
|
334
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
335
|
+
className: "".concat(preCls, "__invite-guide-content-title")
|
|
336
|
+
}, title)));
|
|
337
|
+
title = showMangeAdd ? '点击这里进入企业微信后台,添加公司员工,体验更多功能' : '邀请同事一起体验吧';
|
|
338
|
+
var subtitle = '试用 7 天内成功邀请 3 人加入,即可免费开启试用 OKR 案例库';
|
|
339
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
340
|
+
className: "".concat(preCls, "__invite-guide-content")
|
|
341
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
342
|
+
src: _invitePoint["default"],
|
|
343
|
+
alt: "",
|
|
344
|
+
className: "".concat(preCls, "__invite-guide-content-point")
|
|
345
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
346
|
+
className: "".concat(preCls, "__invite-guide-content-right")
|
|
347
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
348
|
+
className: "".concat(preCls, "__invite-guide-content-title")
|
|
349
|
+
}, title), /*#__PURE__*/_react["default"].createElement("div", {
|
|
350
|
+
className: "".concat(preCls, "__invite-guide-content-subTitle")
|
|
351
|
+
}, subtitle)));
|
|
352
|
+
}, [inviteAuth]);
|
|
353
|
+
|
|
275
354
|
var isHasOkr = function isHasOkr() {
|
|
276
355
|
//判断是否安装了OKR
|
|
277
356
|
var okrIndex = (0, _bsGlobal.getBSGlobal)('WebHead').AppHead.findIndex(function (item) {
|
|
@@ -288,9 +367,9 @@ var NavTop = function NavTop() {
|
|
|
288
367
|
(0, _react.useEffect)(function () {
|
|
289
368
|
var version = (0, _bsGlobal.getBSGlobal)('tenantAuthentication').Version;
|
|
290
369
|
if (localStorage.getItem("cycle_setting_stop_show".concat((0, _bsGlobal.getUserInfo)().Id)) === 'true') return;
|
|
291
|
-
localStorage.removeItem(
|
|
370
|
+
localStorage.removeItem('OKR_CYCLE_SETTING');
|
|
292
371
|
(0, _request2.getCycleSetting)().then(function (res) {
|
|
293
|
-
localStorage.setItem(
|
|
372
|
+
localStorage.setItem('OKR_CYCLE_SETTING', JSON.stringify(res || {}));
|
|
294
373
|
var hasSetting = res.hasSetting;
|
|
295
374
|
|
|
296
375
|
if (version === 1 && isHasOkr() && !hasSetting) {
|
|
@@ -328,7 +407,7 @@ var NavTop = function NavTop() {
|
|
|
328
407
|
onClickClose: handleCloseSummaryGuide,
|
|
329
408
|
width: 197
|
|
330
409
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
331
|
-
className: (0, _classnames["default"])("".concat(preCls, "__left-app-center"),
|
|
410
|
+
className: (0, _classnames["default"])("".concat(preCls, "__left-app-center"), 'document-mouse-event-ignore', _defineProperty({}, "".concat(preCls, "__left-app-center--active"), appCenterVisible)),
|
|
332
411
|
onClick: function onClick() {
|
|
333
412
|
return setAppCenterVisible(!appCenterVisible);
|
|
334
413
|
}
|
|
@@ -339,7 +418,63 @@ var NavTop = function NavTop() {
|
|
|
339
418
|
}, /*#__PURE__*/_react["default"].createElement(_menu["default"], {
|
|
340
419
|
menus: menu,
|
|
341
420
|
activeMenuId: activeMenuId
|
|
342
|
-
})),
|
|
421
|
+
})), showWxInvite && (staffCount > 3 ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
422
|
+
overlay: '邀请同事',
|
|
423
|
+
placement: "bottom",
|
|
424
|
+
align: {
|
|
425
|
+
offset: [0, 5]
|
|
426
|
+
}
|
|
427
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
428
|
+
className: "".concat(preCls, "__invite"),
|
|
429
|
+
onClick: openWxInvite
|
|
430
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
431
|
+
className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
|
|
432
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_guideTip["default"], {
|
|
433
|
+
visible: inviteVisible,
|
|
434
|
+
content: renderInviteContent(),
|
|
435
|
+
type: inviteAuth ? 'default' : 'button',
|
|
436
|
+
popupPlacement: "bottom",
|
|
437
|
+
classnames: inviteAuth ? "".concat(preCls, "__invite-guide") : '',
|
|
438
|
+
onClickClose: handleCloseInviteGuide,
|
|
439
|
+
popupAlign: {
|
|
440
|
+
offset: [0, 5]
|
|
441
|
+
},
|
|
442
|
+
zIndex: 1000,
|
|
443
|
+
width: 308
|
|
444
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
445
|
+
className: "".concat(preCls, "__invite"),
|
|
446
|
+
onClick: openWxInvite
|
|
447
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
448
|
+
className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
|
|
449
|
+
})))), showMangeAdd && (staffCount > 3 ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
450
|
+
overlay: '添加员工',
|
|
451
|
+
placement: "bottom",
|
|
452
|
+
align: {
|
|
453
|
+
offset: [0, 5]
|
|
454
|
+
}
|
|
455
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
456
|
+
className: "".concat(preCls, "__invite"),
|
|
457
|
+
onClick: manageAdd
|
|
458
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
459
|
+
className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
|
|
460
|
+
}))) : /*#__PURE__*/_react["default"].createElement(_guideTip["default"], {
|
|
461
|
+
visible: inviteVisible,
|
|
462
|
+
content: renderInviteContent(),
|
|
463
|
+
type: inviteAuth ? 'default' : 'button',
|
|
464
|
+
popupPlacement: "bottom",
|
|
465
|
+
classnames: inviteAuth ? "".concat(preCls, "__invite-guide") : '',
|
|
466
|
+
onClickClose: handleCloseInviteGuide,
|
|
467
|
+
popupAlign: {
|
|
468
|
+
offset: [0, 5]
|
|
469
|
+
},
|
|
470
|
+
zIndex: 1000,
|
|
471
|
+
width: 308
|
|
472
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
473
|
+
className: "".concat(preCls, "__invite"),
|
|
474
|
+
onClick: manageAdd
|
|
475
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
476
|
+
className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
|
|
477
|
+
})))), hasOKRApp && /*#__PURE__*/_react["default"].createElement("div", {
|
|
343
478
|
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
479
|
}, /*#__PURE__*/_react["default"].createElement("a", {
|
|
345
480
|
href: "#homepage"
|
|
@@ -347,12 +482,7 @@ var NavTop = function NavTop() {
|
|
|
347
482
|
alt: "home-img",
|
|
348
483
|
src: _home["default"],
|
|
349
484
|
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", {
|
|
485
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
356
486
|
className: "".concat(preCls, "__msg")
|
|
357
487
|
}, /*#__PURE__*/_react["default"].createElement(_userMessage["default"], null)), versionInfo.Version === 1 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
358
488
|
className: "".concat(preCls, "__version")
|