@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.
@@ -57,7 +57,6 @@
57
57
  background: rgba(246, 189, 22, 0.16);
58
58
  border-radius: 0px 14px 14px 0px;
59
59
  font-size: 12px;
60
- font-family: OPPOSans-R, OPPOSans;
61
60
  font-weight: normal;
62
61
  color: #BD7500;
63
62
  line-height: 18px;
@@ -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 (messageType == 131 || messageType == 136) {
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,
@@ -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 || getUA().includes(WX_UA_STR)) {
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
- try {
116
- // BSGlobal
117
- var openIds;
118
-
119
- if (pType === 'userName') {
120
- openIds = (0, _bsGlobal.getBSGlobal)('openIds');
121
- } else if (pType === 'departmentName') {
122
- openIds = (0, _bsGlobal.getBSGlobal)('openDepartmentIds');
123
- }
124
-
125
- (0, _helpers.errorLog)(1, JSON.stringify({
126
- errorType: 'openId 不存在',
127
- pName: pName == undefined ? 'undefined' : pName,
128
- pId: pId == undefined ? 'undefined' : pId,
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',
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.14.0-beta.1",
3
+ "version": "1.15.2",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",