@titaui/pc 1.14.0-beta.1 → 1.15.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.
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.css +0 -1
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +2 -2
- package/lib/components/nav-top/components/user-message/utils.js +2 -0
- package/lib/components/picker/range-picker/index.js +3 -2
- package/lib/utils/open-data.js +47 -38
- package/lib/utils/tools.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -18,6 +18,8 @@ exports.htmlToText = htmlToText;
|
|
|
18
18
|
|
|
19
19
|
var deleteText = function deleteText(text) {
|
|
20
20
|
var last = text.trim().slice(-4);
|
|
21
|
+
var pattern = /(查看详情|Details)(?!.*\1)/;
|
|
22
|
+
text = text.replace(pattern, '');
|
|
21
23
|
|
|
22
24
|
if (last === "查看任务") {
|
|
23
25
|
text = text.trim().slice(0, -4);
|
|
@@ -33,7 +33,7 @@ var _picker = _interopRequireDefault(require("../picker"));
|
|
|
33
33
|
|
|
34
34
|
var _pickerTrigger = _interopRequireDefault(require("./components/picker-trigger"));
|
|
35
35
|
|
|
36
|
-
var _excluded = ["onChange", "format", "values", "picker", "children", "popupPlacement", "direction", "onPopupVisibleChange", "visible", "canEmpty"];
|
|
36
|
+
var _excluded = ["onChange", "format", "values", "picker", "children", "popupPlacement", "direction", "onPopupVisibleChange", "visible", "canEmpty", "className"];
|
|
37
37
|
|
|
38
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
39
39
|
|
|
@@ -72,6 +72,7 @@ var RangePicker = function RangePicker(props) {
|
|
|
72
72
|
visible = _props$visible === void 0 ? false : _props$visible,
|
|
73
73
|
_props$canEmpty = props.canEmpty,
|
|
74
74
|
canEmpty = _props$canEmpty === void 0 ? true : _props$canEmpty,
|
|
75
|
+
className = props.className,
|
|
75
76
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
76
77
|
|
|
77
78
|
var initValues = (0, _react.useCallback)(function () {
|
|
@@ -204,7 +205,7 @@ var RangePicker = function RangePicker(props) {
|
|
|
204
205
|
return !!v;
|
|
205
206
|
}).length !== 2;
|
|
206
207
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
207
|
-
className: _utils.PickerRangesClass
|
|
208
|
+
className: (0, _classnames["default"])(_utils.PickerRangesClass, className)
|
|
208
209
|
}, /*#__PURE__*/_react["default"].createElement(_placeholder["default"], {
|
|
209
210
|
viewDate: viewDate,
|
|
210
211
|
onChange: setViewDate,
|
package/lib/utils/open-data.js
CHANGED
|
@@ -9,8 +9,6 @@ exports.parseTag = exports.parseStringV2 = exports.parseString = exports.parseOp
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var Sentry = _interopRequireWildcard(require("@sentry/browser"));
|
|
13
|
-
|
|
14
12
|
var _bsGlobal = require("./bs-global");
|
|
15
13
|
|
|
16
14
|
var _openDataPainter = require("../components/open-data-painter");
|
|
@@ -37,6 +35,7 @@ var WX_SOURCE = 860;
|
|
|
37
35
|
var WX_UA_STR = 'micromessenger';
|
|
38
36
|
var FEISHU_SOURCE = 862;
|
|
39
37
|
var DINGTALK_SOURCE = 861;
|
|
38
|
+
var ignorePIds = [-1, 0, 10000];
|
|
40
39
|
|
|
41
40
|
var getSource = function getSource() {
|
|
42
41
|
return (0, _bsGlobal.getBSGlobal)('tenantInfo').Source;
|
|
@@ -78,7 +77,8 @@ function openData() {
|
|
|
78
77
|
var _getBSGlobal;
|
|
79
78
|
|
|
80
79
|
// 企业微信租户 && 非自建应用
|
|
81
|
-
if (getSource() === WX_SOURCE && ((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantInfo')) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.corpCreateType) !== 2
|
|
80
|
+
if ((getSource() === WX_SOURCE || getUA().includes(WX_UA_STR)) && ((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('tenantInfo')) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.corpCreateType) !== 2 // 2:自建应用
|
|
81
|
+
) {
|
|
82
82
|
// 企业微信初始化失败
|
|
83
83
|
// if (!window.WWOpenData && !window.top.WWOpenData) {
|
|
84
84
|
// return (p) => {
|
|
@@ -102,6 +102,34 @@ function openData() {
|
|
|
102
102
|
pName = p.name,
|
|
103
103
|
pCorpId = p.corpId,
|
|
104
104
|
pType = p.type;
|
|
105
|
+
(0, _react.useEffect)(function () {
|
|
106
|
+
var openId = pCorpId || getOpenId(pId, pType);
|
|
107
|
+
|
|
108
|
+
if (!openId) {
|
|
109
|
+
if (pId !== undefined && !ignorePIds.includes(pId)) {
|
|
110
|
+
try {
|
|
111
|
+
// BSGlobal
|
|
112
|
+
var openIds;
|
|
113
|
+
|
|
114
|
+
if (pType === 'userName') {
|
|
115
|
+
openIds = (0, _bsGlobal.getBSGlobal)('openIds');
|
|
116
|
+
} else if (pType === 'departmentName') {
|
|
117
|
+
openIds = (0, _bsGlobal.getBSGlobal)('openDepartmentIds');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
(0, _helpers.errorLog)(1, JSON.stringify({
|
|
121
|
+
errorType: 'openId 不存在',
|
|
122
|
+
pName: pName === undefined ? 'undefined' : pName,
|
|
123
|
+
pId: pId === undefined ? 'undefined' : pId,
|
|
124
|
+
pType: pType,
|
|
125
|
+
openIds: openIds
|
|
126
|
+
}));
|
|
127
|
+
} catch (e) {
|
|
128
|
+
console.log(e);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, [pId, pName]);
|
|
105
133
|
|
|
106
134
|
if (pId === undefined && pCorpId === undefined) {
|
|
107
135
|
return pName || null;
|
|
@@ -111,40 +139,21 @@ function openData() {
|
|
|
111
139
|
var openId = pCorpId || getOpenId(pId, pType);
|
|
112
140
|
|
|
113
141
|
if (!openId) {
|
|
114
|
-
if (pId) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
pType: pType,
|
|
130
|
-
openIds: openIds
|
|
131
|
-
}));
|
|
132
|
-
} catch (e) {
|
|
133
|
-
console.log(e);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
Sentry.withScope(function (scope) {
|
|
137
|
-
scope.setTag('error-level', 'P1');
|
|
138
|
-
scope.setTag('error-type', '企业微信openData调用失败');
|
|
139
|
-
scope.setExtra('fail_type', pType);
|
|
140
|
-
scope.setExtra('p_id', pId);
|
|
141
|
-
scope.setExtra('p_name', pName);
|
|
142
|
-
scope.setExtra('corp_id', pCorpId);
|
|
143
|
-
scope.setExtra('open_id', getOpenId(pId, pType));
|
|
144
|
-
p.callFunc && scope.setExtra('fail_callFunc', p.callFunc);
|
|
145
|
-
p.extra && scope.setExtra('fail_extra', p.extra);
|
|
146
|
-
Sentry.captureException(new Error('企业微信openData调用失败'), scope);
|
|
147
|
-
});
|
|
142
|
+
if (pId !== undefined && !ignorePIds.includes(pId)) {// Sentry.withScope((scope) => {
|
|
143
|
+
// scope.setTag('error-level', 'P1')
|
|
144
|
+
// scope.setTag('error-type', '企业微信openData调用失败')
|
|
145
|
+
// scope.setExtra('fail_type', pType)
|
|
146
|
+
// scope.setExtra('p_id', pId)
|
|
147
|
+
// scope.setExtra('p_name', pName)
|
|
148
|
+
// scope.setExtra('corp_id', pCorpId)
|
|
149
|
+
// scope.setExtra('open_id', getOpenId(pId, pType))
|
|
150
|
+
// p.callFunc && scope.setExtra('fail_callFunc', p.callFunc)
|
|
151
|
+
// p.extra && scope.setExtra('fail_extra', p.extra)
|
|
152
|
+
// Sentry.captureException(
|
|
153
|
+
// new Error('企业微信openData调用失败'),
|
|
154
|
+
// scope,
|
|
155
|
+
// )
|
|
156
|
+
// })
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
return pName || pId || null;
|
|
@@ -156,7 +165,7 @@ function openData() {
|
|
|
156
165
|
|
|
157
166
|
// @ts-ignore
|
|
158
167
|
(_ref = window.WWOpenData && window.WWOpenData || window.top.WWOpenData) === null || _ref === void 0 ? void 0 : _ref.bind(ref.current);
|
|
159
|
-
}, []);
|
|
168
|
+
}, [pId, pName]);
|
|
160
169
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
161
170
|
style: {
|
|
162
171
|
display: 'inline',
|
package/lib/utils/tools.js
CHANGED
|
@@ -38,7 +38,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
38
38
|
|
|
39
39
|
function openUrl(url) {
|
|
40
40
|
if (typeof url !== 'string') return;
|
|
41
|
-
var newTab = window.open();
|
|
41
|
+
var newTab = window.open(url);
|
|
42
42
|
if (!newTab) return;
|
|
43
43
|
newTab.opener = null;
|
|
44
44
|
newTab.location = url;
|