@titaui/pc 1.13.8 → 1.13.10-beta.2
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.
|
@@ -108,7 +108,7 @@ function Inform(props) {
|
|
|
108
108
|
} // 处理合并的消息
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
var isMessageMerging = [83, 94, 95, 96, 97, 98, 99, 100, 131, 136, 13018, 30362].includes(messageType);
|
|
111
|
+
var isMessageMerging = [83, 94, 95, 96, 97, 98, 99, 100, 131, 136, 180, 13018, 30362].includes(messageType);
|
|
112
112
|
|
|
113
113
|
if (!isMessageMerging) {
|
|
114
114
|
if (messageType === _constant.informType.details) {
|
|
@@ -217,7 +217,7 @@ function Inform(props) {
|
|
|
217
217
|
} else if (Number(messageType) > 93 && Number(messageType) <= 100) {
|
|
218
218
|
// OKR 仪表盘消息提醒
|
|
219
219
|
notificationType = "okr-dashBoard";
|
|
220
|
-
} else if (
|
|
220
|
+
} else if ([131, 136, 180].includes(Number(messageType))) {
|
|
221
221
|
notificationType = "performance";
|
|
222
222
|
content = item.content;
|
|
223
223
|
}
|
|
@@ -45,6 +45,8 @@ 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
|
+
|
|
48
50
|
require("./index.css");
|
|
49
51
|
|
|
50
52
|
var _excluded = ["hasSetting"];
|
|
@@ -73,6 +75,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
73
75
|
|
|
74
76
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
75
77
|
|
|
78
|
+
var Role = new _auth.MyRole();
|
|
76
79
|
var Logo = (0, _utils.getLogo)();
|
|
77
80
|
var newNavigation = (0, _bsGlobal.getBSGlobal)("newNavigation") || [];
|
|
78
81
|
var hasOKRApp = newNavigation.find(function (item) {
|
|
@@ -140,44 +143,73 @@ var NavTop = function NavTop() {
|
|
|
140
143
|
bookDemoVisible = _useState20[0],
|
|
141
144
|
setBookDemoVisible = _useState20[1];
|
|
142
145
|
|
|
143
|
-
var ua = navigator.userAgent.toLowerCase();
|
|
144
|
-
|
|
146
|
+
var ua = navigator.userAgent.toLowerCase(); // const showWxInvite = getTenantInfo().mainCorpId && ua.indexOf("micromessenger") !== -1;
|
|
147
|
+
|
|
148
|
+
var showWxInvite = (0, _bsGlobal.getTenantInfo)().Source === 860;
|
|
145
149
|
var openWxInvite = (0, _react.useCallback)(function () {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
150
|
+
debugger;
|
|
151
|
+
console.log(123, '我点击了');
|
|
152
|
+
|
|
153
|
+
if (Role.isSuperManager) {
|
|
154
|
+
if (window.WeixinJSBridge !== undefined) {
|
|
155
|
+
console.log(345, '我开始点击调用了');
|
|
156
|
+
window.WeixinJSBridge.invoke('openAppManage', {}, function (res) {
|
|
157
|
+
console.log(678, res.err_msg);
|
|
158
|
+
|
|
159
|
+
if (res.err_msg == 'openAppManage:ok') {// 调用成功
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (res.err_msg == 'openAppManage:fail:no permission') {// 调用人身份不符合
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (res.err_msg == 'openAppManage:fail:unknown app') {// 应用信息获取失败
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (res.err_msg == 'openAppManage:fail:unsupported app type') {// 应用类型不符合要求
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (res.err_msg == 'openAppManage:fail') {// 其它错误
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
if (window.WeixinJSBridge !== undefined) {
|
|
177
|
+
console.log(777, '普通员工调用');
|
|
178
|
+
window.WeixinJSBridge.invoke('selectPrivilegedContact', {
|
|
179
|
+
fromDepartmentId: -1,
|
|
180
|
+
// 必填,表示打开的通讯录从指定的部门开始展示,-1表示自己所在部门开始, 0表示从最上层开始
|
|
181
|
+
mode: 'multi',
|
|
182
|
+
// 必填,选择模式,single表示单选,multi表示多选
|
|
183
|
+
selectedContextContact: 0 // 是否勾选当前环境的参与者。例如在群+号聊天附件栏打开,默认勾选当前群成员。
|
|
184
|
+
|
|
185
|
+
}, function (res) {
|
|
186
|
+
if (res.err_msg === 'selectPrivilegedContact:ok') {
|
|
187
|
+
var selectedTicket = res.result.selectedTicket.replace(/['"]/g, ''); // 已选的集合Ticket
|
|
188
|
+
|
|
189
|
+
(0, _request.rpost)('v1')("wx/send/templateMessage?selectedTickets=".concat(selectedTicket)).then(function () {
|
|
190
|
+
_toast["default"].Success('邀请成功');
|
|
191
|
+
})["catch"](function () {
|
|
192
|
+
_toast["default"].Error('邀请失败');
|
|
193
|
+
});
|
|
194
|
+
} else {// console.log(res);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
166
198
|
}
|
|
167
199
|
}, []);
|
|
168
200
|
|
|
169
201
|
var handleHashChange = function handleHashChange() {
|
|
170
202
|
setAppCenterVisible(false);
|
|
171
|
-
var hash = window.location.hash.split(
|
|
203
|
+
var hash = window.location.hash.split('?')[0] || '';
|
|
172
204
|
|
|
173
205
|
if (hash) {
|
|
174
206
|
var activeMenu = menu.find(function (item) {
|
|
175
207
|
var _item$href$split, _item$href$split$;
|
|
176
208
|
|
|
177
|
-
return hash.includes((_item$href$split = item.href.split(
|
|
209
|
+
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]);
|
|
178
210
|
});
|
|
179
211
|
|
|
180
|
-
if (hash.includes(
|
|
212
|
+
if (hash.includes('homepage')) {
|
|
181
213
|
setActiveMenuId(99999);
|
|
182
214
|
return;
|
|
183
215
|
}
|
|
@@ -192,9 +224,9 @@ var NavTop = function NavTop() {
|
|
|
192
224
|
|
|
193
225
|
(0, _react.useEffect)(function () {
|
|
194
226
|
handleHashChange();
|
|
195
|
-
window.addEventListener(
|
|
227
|
+
window.addEventListener('hashchange', handleHashChange);
|
|
196
228
|
return function () {
|
|
197
|
-
window.removeEventListener(
|
|
229
|
+
window.removeEventListener('hashchange', handleHashChange);
|
|
198
230
|
};
|
|
199
231
|
}, [menu]);
|
|
200
232
|
(0, _react.useEffect)(function () {
|
|
@@ -292,12 +324,12 @@ var NavTop = function NavTop() {
|
|
|
292
324
|
};
|
|
293
325
|
|
|
294
326
|
(0, _react.useEffect)(function () {
|
|
327
|
+
var version = window.BSGlobal.tenantAuthentication.Version;
|
|
295
328
|
(0, _request2.getCycleSetting)().then(function (res) {
|
|
296
329
|
var hasSetting = res.hasSetting,
|
|
297
330
|
onthers = _objectWithoutProperties(res, _excluded);
|
|
298
331
|
|
|
299
|
-
if (isHasOkr() && !hasSetting) {
|
|
300
|
-
console.log(hasSetting, '66666666633');
|
|
332
|
+
if (version === 1 && isHasOkr() && !hasSetting) {
|
|
301
333
|
setOkrGuideVisible(true);
|
|
302
334
|
}
|
|
303
335
|
});
|
|
@@ -332,7 +364,7 @@ var NavTop = function NavTop() {
|
|
|
332
364
|
onClickClose: handleCloseSummaryGuide,
|
|
333
365
|
width: 197
|
|
334
366
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
335
|
-
className: (0, _classnames["default"])("".concat(preCls, "__left-app-center"),
|
|
367
|
+
className: (0, _classnames["default"])("".concat(preCls, "__left-app-center"), 'document-mouse-event-ignore', _defineProperty({}, "".concat(preCls, "__left-app-center--active"), appCenterVisible)),
|
|
336
368
|
onClick: function onClick() {
|
|
337
369
|
return setAppCenterVisible(!appCenterVisible);
|
|
338
370
|
}
|
|
@@ -343,6 +375,11 @@ var NavTop = function NavTop() {
|
|
|
343
375
|
}, /*#__PURE__*/_react["default"].createElement(_menu["default"], {
|
|
344
376
|
menus: menu,
|
|
345
377
|
activeMenuId: activeMenuId
|
|
378
|
+
})), showWxInvite && /*#__PURE__*/_react["default"].createElement("div", {
|
|
379
|
+
className: "".concat(preCls, "__invite"),
|
|
380
|
+
onClick: openWxInvite
|
|
381
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
382
|
+
className: (0, _classnames["default"])('tu-icon-add-people', "".concat(preCls, "__invite-icon"))
|
|
346
383
|
})), hasOKRApp && /*#__PURE__*/_react["default"].createElement("div", {
|
|
347
384
|
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))
|
|
348
385
|
}, /*#__PURE__*/_react["default"].createElement("a", {
|
|
@@ -351,12 +388,7 @@ var NavTop = function NavTop() {
|
|
|
351
388
|
alt: "home-img",
|
|
352
389
|
src: _home["default"],
|
|
353
390
|
className: "".concat(preCls, "__left-home-img")
|
|
354
|
-
}))),
|
|
355
|
-
className: "".concat(preCls, "__invite"),
|
|
356
|
-
onClick: openWxInvite
|
|
357
|
-
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
358
|
-
className: (0, _classnames["default"])("tu-icon-add-people", "".concat(preCls, "__invite-icon"))
|
|
359
|
-
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
391
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
360
392
|
className: "".concat(preCls, "__msg")
|
|
361
393
|
}, /*#__PURE__*/_react["default"].createElement(_userMessage["default"], null)), versionInfo.Version === 1 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
362
394
|
className: "".concat(preCls, "__version")
|
|
@@ -140,7 +140,6 @@ function PageLayout(props) {
|
|
|
140
140
|
errorLevel: _errorLevel["default"].P0,
|
|
141
141
|
errorTag: "\u7533\u8BF7\u9884\u7EA6\u6F14\u793A\u5F02\u5E38"
|
|
142
142
|
}, /*#__PURE__*/_react["default"].createElement(_bookDemo["default"].BookDemoPC, {
|
|
143
|
-
autoShow: true,
|
|
144
143
|
visible: false,
|
|
145
144
|
type: getBookDemoVersion()
|
|
146
145
|
})));
|
package/lib/utils/open-data.js
CHANGED
|
@@ -78,25 +78,23 @@ function openData() {
|
|
|
78
78
|
// 企业微信租户 && 非自建应用
|
|
79
79
|
if (getSource() === WX_SOURCE && ((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantInfo')) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.corpCreateType) !== 2 || getUA().includes(WX_UA_STR)) {
|
|
80
80
|
// 企业微信初始化失败
|
|
81
|
-
if (!window.WWOpenData && !window.top.WWOpenData) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
81
|
+
// if (!window.WWOpenData && !window.top.WWOpenData) {
|
|
82
|
+
// return (p) => {
|
|
83
|
+
// if (p.name == undefined || p.id == undefined) {
|
|
84
|
+
// try {
|
|
85
|
+
// errorLog(1, JSON.stringify({
|
|
86
|
+
// errorType: 'WWOpenData is undefined',
|
|
87
|
+
// pName: p.name == undefined ? 'undefined' : p.name,
|
|
88
|
+
// pId: p.id == undefined ? 'undefined' : p.id,
|
|
89
|
+
// pType: p.type,
|
|
90
|
+
// }))
|
|
91
|
+
// } catch (e) {
|
|
92
|
+
// console.log(e)
|
|
93
|
+
// }
|
|
94
|
+
// }
|
|
95
|
+
// return p.name || p.id || null
|
|
96
|
+
// }
|
|
97
|
+
// }
|
|
100
98
|
return function (p) {
|
|
101
99
|
var pId = p.id,
|
|
102
100
|
pName = p.name,
|
|
@@ -164,14 +162,11 @@ function openData() {
|
|
|
164
162
|
overflow: 'hidden',
|
|
165
163
|
textOverflow: 'ellipsis'
|
|
166
164
|
}
|
|
167
|
-
},
|
|
168
|
-
/*#__PURE__*/
|
|
169
|
-
// @ts-ignore
|
|
170
|
-
_react["default"].createElement("ww-open-data", {
|
|
165
|
+
}, (window.WWOpenData || window.top.WWOpenData) && /*#__PURE__*/_react["default"].createElement("ww-open-data", {
|
|
171
166
|
ref: ref,
|
|
172
167
|
type: pType,
|
|
173
168
|
openid: openId
|
|
174
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
|
+
}), !window.WWOpenData && !window.top.WWOpenData && (pName || pId), /*#__PURE__*/_react["default"].createElement("div", {
|
|
175
170
|
style: {
|
|
176
171
|
position: 'absolute',
|
|
177
172
|
top: 0,
|