@titaui/pc 1.13.2 → 1.13.5
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.
|
@@ -31,7 +31,10 @@ var renderTitle = function renderTitle(index, title, id) {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
34
|
-
onClick: handleTitleClick
|
|
34
|
+
onClick: handleTitleClick,
|
|
35
|
+
style: {
|
|
36
|
+
whiteSpace: "nowrap"
|
|
37
|
+
}
|
|
35
38
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
36
39
|
className: "kr-progress__order"
|
|
37
40
|
}, "KR", index + 1), /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
|
|
@@ -605,7 +605,7 @@ var ReviewBody = /*#__PURE__*/function (_PureComponent) {
|
|
|
605
605
|
data = _this$state.data,
|
|
606
606
|
popContainer = _this$state.popContainer;
|
|
607
607
|
var maxHeight = 595;
|
|
608
|
-
screenHeight <= 768 ? maxHeight = 300 : maxHeight =
|
|
608
|
+
screenHeight <= 768 ? maxHeight = 300 : maxHeight = 500;
|
|
609
609
|
return /*#__PURE__*/_react["default"].createElement(_style.ReviewBodyContainer, null, /*#__PURE__*/_react["default"].createElement(_style.ReviewBodyScroll, {
|
|
610
610
|
maxHeight: maxHeight
|
|
611
611
|
}, /*#__PURE__*/_react["default"].createElement(_style.ReviewTarget, null, /*#__PURE__*/_react["default"].createElement(_style.ReviewCatalog, null, (0, _getLocale.getLocale)("OKR_MyO_KRP_Pop_Reviewobject")), /*#__PURE__*/_react["default"].createElement(_style.ReviewContent, {
|
package/lib/utils/open-data.js
CHANGED
|
@@ -9,10 +9,10 @@ exports.parseTag = exports.parseStringV2 = exports.parseString = exports.parseOp
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _bsGlobal = require("./bs-global");
|
|
13
|
-
|
|
14
12
|
var Sentry = _interopRequireWildcard(require("@sentry/browser"));
|
|
15
13
|
|
|
14
|
+
var _bsGlobal = require("./bs-global");
|
|
15
|
+
|
|
16
16
|
var _openDataPainter = require("../components/open-data-painter");
|
|
17
17
|
|
|
18
18
|
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); }
|
|
@@ -43,13 +43,13 @@ var getSource = function getSource() {
|
|
|
43
43
|
exports.getSource = getSource;
|
|
44
44
|
|
|
45
45
|
var isWechat = function isWechat() {
|
|
46
|
-
return getSource()
|
|
46
|
+
return getSource() === WX_SOURCE;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
exports.isWechat = isWechat;
|
|
50
50
|
|
|
51
51
|
var isWxTrial = function isWxTrial() {
|
|
52
|
-
return getSource()
|
|
52
|
+
return getSource() === WX_SOURCE && (0, _bsGlobal.getVersion)() === 1;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
exports.isWxTrial = isWxTrial;
|
|
@@ -72,50 +72,48 @@ var getOpenId = function getOpenId(id, type) {
|
|
|
72
72
|
|
|
73
73
|
exports.getOpenId = getOpenId;
|
|
74
74
|
|
|
75
|
-
function openData(
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
function openData() {
|
|
76
|
+
var _getBSGlobal;
|
|
77
|
+
|
|
78
|
+
// 企业微信租户 && 非自建应用
|
|
79
|
+
if (getSource() === WX_SOURCE && ((_getBSGlobal = (0, _bsGlobal.getBSGlobal)("tenantInfo")) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.corpCreateType) !== 2 || getUA().includes(WX_UA_STR)) {
|
|
78
80
|
return function (p) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
});
|
|
91
|
-
return p.name || null;
|
|
92
|
-
} //@ts-ignore
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var openId = p.corpId || getOpenId(p.id, p.type);
|
|
81
|
+
var pId = p.id,
|
|
82
|
+
pName = p.name,
|
|
83
|
+
pCorpId = p.corpId,
|
|
84
|
+
pType = p.type;
|
|
85
|
+
|
|
86
|
+
if (pId === undefined && pCorpId === undefined) {
|
|
87
|
+
return pName || null;
|
|
88
|
+
} // @ts-ignore
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
var openId = pCorpId || getOpenId(pId, pType);
|
|
96
92
|
|
|
97
93
|
if (!openId) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
94
|
+
if (!pId) {
|
|
95
|
+
Sentry.withScope(function (scope) {
|
|
96
|
+
scope.setTag("error-level", "P1");
|
|
97
|
+
scope.setTag("error-type", "企业微信openData调用失败");
|
|
98
|
+
scope.setExtra("fail_type", pType);
|
|
99
|
+
scope.setExtra("p_id", pId);
|
|
100
|
+
scope.setExtra("p_name", pName);
|
|
101
|
+
scope.setExtra("corp_id", pCorpId);
|
|
102
|
+
scope.setExtra("open_id", getOpenId(pId, pType));
|
|
103
|
+
p.callFunc && scope.setExtra("fail_callFunc", p.callFunc);
|
|
104
|
+
p.extra && scope.setExtra("fail_extra", p.extra);
|
|
105
|
+
Sentry.captureException(new Error("企业微信openData调用失败"), scope);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
112
108
|
|
|
109
|
+
return pName || pId || null;
|
|
110
|
+
}
|
|
113
111
|
|
|
114
112
|
var ref = (0, _react.useRef)(null);
|
|
115
|
-
(0, _react.
|
|
113
|
+
(0, _react.useLayoutEffect)(function () {
|
|
116
114
|
var _ref;
|
|
117
115
|
|
|
118
|
-
|
|
116
|
+
// @ts-ignore
|
|
119
117
|
(_ref = window.WWOpenData && window.WWOpenData || window.top.WWOpenData) === null || _ref === void 0 ? void 0 : _ref.bind(ref.current);
|
|
120
118
|
if (!p.id) return;
|
|
121
119
|
var openId = getOpenId(p.id, p.type);
|
|
@@ -124,21 +122,21 @@ function openData(p) {
|
|
|
124
122
|
}, []);
|
|
125
123
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
126
124
|
style: {
|
|
127
|
-
display:
|
|
128
|
-
position:
|
|
129
|
-
overflow:
|
|
130
|
-
textOverflow:
|
|
125
|
+
display: "inline",
|
|
126
|
+
position: "relative",
|
|
127
|
+
overflow: "hidden",
|
|
128
|
+
textOverflow: "ellipsis"
|
|
131
129
|
}
|
|
132
130
|
},
|
|
133
131
|
/*#__PURE__*/
|
|
134
|
-
|
|
132
|
+
// @ts-ignore
|
|
135
133
|
_react["default"].createElement("ww-open-data", {
|
|
136
134
|
ref: ref,
|
|
137
135
|
type: p.type,
|
|
138
136
|
openid: openId
|
|
139
137
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
140
138
|
style: {
|
|
141
|
-
position:
|
|
139
|
+
position: "absolute",
|
|
142
140
|
top: 0,
|
|
143
141
|
left: 0,
|
|
144
142
|
right: 0,
|
|
@@ -147,11 +145,11 @@ function openData(p) {
|
|
|
147
145
|
}
|
|
148
146
|
}));
|
|
149
147
|
};
|
|
150
|
-
} else {
|
|
151
|
-
return function (p) {
|
|
152
|
-
return p.name || p.id || null;
|
|
153
|
-
};
|
|
154
148
|
}
|
|
149
|
+
|
|
150
|
+
return function (p) {
|
|
151
|
+
return p.name || p.id || null;
|
|
152
|
+
};
|
|
155
153
|
}
|
|
156
154
|
|
|
157
155
|
var getOpenData = openData();
|
|
@@ -182,20 +180,23 @@ var isPlatform = function isPlatform(name) {
|
|
|
182
180
|
switch (name) {
|
|
183
181
|
case "wx":
|
|
184
182
|
{
|
|
185
|
-
if (type == "source") return getSource()
|
|
183
|
+
if (type == "source") return getSource() === WX_SOURCE;
|
|
186
184
|
if (type == "env") return getUA().includes(WX_UA_STR);
|
|
187
|
-
return getSource()
|
|
185
|
+
return getSource() === WX_SOURCE || getUA().includes(WX_UA_STR);
|
|
188
186
|
}
|
|
189
187
|
|
|
190
188
|
case "dd":
|
|
191
189
|
{
|
|
192
|
-
return getSource()
|
|
190
|
+
return getSource() === DINGTALK_SOURCE;
|
|
193
191
|
}
|
|
194
192
|
|
|
195
193
|
case "feishu":
|
|
196
194
|
{
|
|
197
|
-
return getSource()
|
|
195
|
+
return getSource() === FEISHU_SOURCE;
|
|
198
196
|
}
|
|
197
|
+
|
|
198
|
+
default:
|
|
199
|
+
return false;
|
|
199
200
|
}
|
|
200
201
|
};
|
|
201
202
|
|
|
@@ -207,7 +208,7 @@ var parseTag = function parseTag(str) {
|
|
|
207
208
|
var reg = /<\w+[\w\W]*?(userId|departmentId)=["'](\S+?)["'][\w\W]*?>@([\w\W]*?)<\/\w+>/g;
|
|
208
209
|
var strReg = /<\w+[\w\s"'\/=\:\.]*?(?:userId|departmentId)=["']\S+?["'][\w\s"'\/=\:\.]*?>[\w\W]*?<\/\w+?>/;
|
|
209
210
|
var openDatas = [];
|
|
210
|
-
var matchStr = reg.exec(str); // if (source !=
|
|
211
|
+
var matchStr = reg.exec(str); // if (source != WX_SOURCE && ua.indexOf('micromessenger') == -1)
|
|
211
212
|
// return <span dangerouslySetInnerHTML={{ '__html': str }} />;
|
|
212
213
|
|
|
213
214
|
while (matchStr != null) {
|
|
@@ -258,14 +259,18 @@ var parseTag = function parseTag(str) {
|
|
|
258
259
|
exports.parseTag = parseTag;
|
|
259
260
|
|
|
260
261
|
var parseString = function parseString(str) {
|
|
261
|
-
|
|
262
|
-
var source = window.BSGlobal.tenantInfo.Source
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
262
|
+
// @ts-ignore
|
|
263
|
+
var source = window.BSGlobal.tenantInfo.Source;
|
|
264
|
+
var ua = navigator.userAgent.toLowerCase();
|
|
265
|
+
|
|
266
|
+
if (source != WX_SOURCE && ua.indexOf("wxwork") == -1) {
|
|
267
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
268
|
+
dangerouslySetInnerHTML: {
|
|
269
|
+
__html: str
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
269
274
|
var reg = /\[(\w+?)\:(\w+?)\]/g;
|
|
270
275
|
var strReg = /\[\w+?\:\w+?\]/;
|
|
271
276
|
var openDatas = [];
|
|
@@ -315,11 +320,15 @@ var parseStringV2 = function parseStringV2(str) {
|
|
|
315
320
|
// @ts-ignore
|
|
316
321
|
var source = window.BSGlobal.tenantInfo.Source;
|
|
317
322
|
var ua = navigator.userAgent.toLowerCase();
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
+
|
|
324
|
+
if (source != WX_SOURCE && ua.indexOf("micromessenger") == -1) {
|
|
325
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
326
|
+
dangerouslySetInnerHTML: {
|
|
327
|
+
__html: str
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
|
|
323
332
|
var reg = /\$(userName|departmentName)\=(.+?)\$/g;
|
|
324
333
|
var strReg = /\$(?:userName|departmentName)\=.+?\$/;
|
|
325
334
|
var openDatas = [];
|