@titaui/pc 1.13.10 → 1.15.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.
@@ -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);
@@ -47,8 +47,6 @@ var _request2 = require("./request.apis");
47
47
 
48
48
  require("./index.css");
49
49
 
50
- var _excluded = ["hasSetting"];
51
-
52
50
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
53
51
 
54
52
  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); }
@@ -57,10 +55,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
57
55
 
58
56
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
59
57
 
60
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
61
-
62
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
63
-
64
58
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
65
59
 
66
60
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -280,7 +274,7 @@ var NavTop = function NavTop() {
280
274
 
281
275
  var isHasOkr = function isHasOkr() {
282
276
  //判断是否安装了OKR
283
- var okrIndex = window.BSGlobal.WebHead.AppHead.findIndex(function (item) {
277
+ var okrIndex = (0, _bsGlobal.getBSGlobal)('WebHead').AppHead.findIndex(function (item) {
284
278
  return item.AppId === '113';
285
279
  });
286
280
 
@@ -292,10 +286,12 @@ var NavTop = function NavTop() {
292
286
  };
293
287
 
294
288
  (0, _react.useEffect)(function () {
295
- var version = window.BSGlobal.tenantAuthentication.Version;
289
+ var version = (0, _bsGlobal.getBSGlobal)('tenantAuthentication').Version;
290
+ if (localStorage.getItem("cycle_setting_stop_show".concat((0, _bsGlobal.getUserInfo)().Id)) === 'true') return;
291
+ localStorage.removeItem("OKR_CYCLE_SETTING");
296
292
  (0, _request2.getCycleSetting)().then(function (res) {
297
- var hasSetting = res.hasSetting,
298
- onthers = _objectWithoutProperties(res, _excluded);
293
+ localStorage.setItem("OKR_CYCLE_SETTING", JSON.stringify(res || {}));
294
+ var hasSetting = res.hasSetting;
299
295
 
300
296
  if (version === 1 && isHasOkr() && !hasSetting) {
301
297
  setOkrGuideVisible(true);
@@ -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,
@@ -27,8 +27,6 @@ var _list = _interopRequireDefault(require("./list"));
27
27
 
28
28
  var _loading = _interopRequireDefault(require("./loading"));
29
29
 
30
- var _initCycleSetting = _interopRequireDefault(require("./init-cycle-setting"));
31
-
32
30
  var _bsGlobal = require("../../utils/bs-global");
33
31
 
34
32
  var _tools = require("../../utils/tools");
@@ -365,9 +363,7 @@ var NewOkrList = function NewOkrList(props) {
365
363
  cycleType: query.cycleType,
366
364
  yqmNum: query.yqmNum
367
365
  }
368
- })), /*#__PURE__*/_react["default"].createElement(_initCycleSetting["default"], {
369
- SetCycleModal: SetCycleModal
370
- }), !loading && /*#__PURE__*/_react["default"].createElement("div", {
366
+ })), !loading && /*#__PURE__*/_react["default"].createElement("div", {
371
367
  className: "okr-list__check-filter-tips"
372
368
  }, (0, _getLocale.getLocale)("OKR_MyO_Text_CanfindOKR"), /*#__PURE__*/_react["default"].createElement("span", {
373
369
  className: "okr-list__check-filter-btn",
@@ -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',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.13.10",
3
+ "version": "1.15.1",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",