@titaui/pc 1.13.10-beta.3 → 1.13.10-beta.6
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/dialog-qq-docs/utils.js +5 -3
- 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/nav-top/index.js +6 -10
- package/lib/components/picker/range-picker/index.js +3 -2
- package/lib/components/rich-editor/plugins/inline/color/commond.js +3 -3
- package/lib/components/upload/components/uploadedPreview.js +37 -50
- package/lib/components/upload/index.css +0 -4
- package/lib/components/upload/index.js +2 -12
- package/lib/pages/new-okr-list/index.js +1 -5
- package/lib/utils/open-data.js +47 -38
- package/lib/utils/tools.js +2 -1
- package/package.json +1 -1
|
@@ -40,16 +40,18 @@ var checkTencentAuth = /*#__PURE__*/function () {
|
|
|
40
40
|
|
|
41
41
|
case 2:
|
|
42
42
|
tencentDocsRes = _context.sent;
|
|
43
|
+
console.log('Code', tencentDocsRes.Code); // 如果 Code = 0,代表需要进行授权
|
|
43
44
|
|
|
44
45
|
if (!(tencentDocsRes.Code === 0)) {
|
|
45
|
-
_context.next =
|
|
46
|
+
_context.next = 8;
|
|
46
47
|
break;
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
console.log('Message', tencentDocsRes.Message);
|
|
49
51
|
if (tencentDocsRes.Message) (0, _tools.openUrl)(tencentDocsRes.Message);
|
|
50
52
|
return _context.abrupt("return", false);
|
|
51
53
|
|
|
52
|
-
case
|
|
54
|
+
case 8:
|
|
53
55
|
// 格式化时间戳
|
|
54
56
|
_ref2 = tencentDocsRes.Data || {}, list = _ref2.list;
|
|
55
57
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, tencentDocsRes.Data), {}, {
|
|
@@ -63,7 +65,7 @@ var checkTencentAuth = /*#__PURE__*/function () {
|
|
|
63
65
|
})
|
|
64
66
|
}));
|
|
65
67
|
|
|
66
|
-
case
|
|
68
|
+
case 10:
|
|
67
69
|
case "end":
|
|
68
70
|
return _context.stop();
|
|
69
71
|
}
|
|
@@ -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);
|
|
@@ -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 =
|
|
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 =
|
|
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
|
-
|
|
298
|
-
|
|
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,
|
|
@@ -101,14 +101,14 @@ function toggleMark(markType, attrs) {
|
|
|
101
101
|
if (has) {
|
|
102
102
|
tr.removeMark(_$from.pos, _$to.pos, markType);
|
|
103
103
|
} else {
|
|
104
|
-
var
|
|
104
|
+
var _exec, _exec2;
|
|
105
105
|
|
|
106
106
|
var from = _$from.pos,
|
|
107
107
|
to = _$to.pos,
|
|
108
108
|
start = _$from.nodeAfter,
|
|
109
109
|
end = _$to.nodeBefore;
|
|
110
|
-
var spaceStart = start && start.isText ? ((
|
|
111
|
-
var spaceEnd = end && end.isText ? ((
|
|
110
|
+
var spaceStart = start && start.isText ? ((_exec = /^\s*/.exec(start.text)) === null || _exec === void 0 ? void 0 : _exec[0].length) || 0 : 0;
|
|
111
|
+
var spaceEnd = end && end.isText ? ((_exec2 = /\s*$/.exec(end.text)) === null || _exec2 === void 0 ? void 0 : _exec2[0].length) || 0 : 0;
|
|
112
112
|
|
|
113
113
|
if (from + spaceStart < to) {
|
|
114
114
|
from += spaceStart;
|
|
@@ -71,39 +71,9 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
71
71
|
}); // 上传成功且为图片时
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
_this.
|
|
75
|
-
var
|
|
76
|
-
onSubmit = _this$props.onSubmit,
|
|
77
|
-
index = _this$props.index;
|
|
78
|
-
event.stopPropagation();
|
|
79
|
-
onSubmit(index, 'delete');
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
_this.onCancel = function (event) {
|
|
83
|
-
var _this$props2 = _this.props,
|
|
84
|
-
onSubmit = _this$props2.onSubmit,
|
|
85
|
-
index = _this$props2.index;
|
|
86
|
-
event.stopPropagation();
|
|
87
|
-
onSubmit(index, 'cancel');
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
_this.onReupload = function (event) {
|
|
91
|
-
var _this$props3 = _this.props,
|
|
92
|
-
onSubmit = _this$props3.onSubmit,
|
|
93
|
-
index = _this$props3.index;
|
|
94
|
-
event.stopPropagation();
|
|
95
|
-
onSubmit(index, 'reupload');
|
|
96
|
-
};
|
|
74
|
+
_this.dealPreviewOptions = function (uploadStatus, index, deleteable, smallImageUrl) {
|
|
75
|
+
var onSubmit = _this.props.onSubmit;
|
|
97
76
|
|
|
98
|
-
_this.onPreview = function (event) {
|
|
99
|
-
var _this$props4 = _this.props,
|
|
100
|
-
onSubmit = _this$props4.onSubmit,
|
|
101
|
-
index = _this$props4.index;
|
|
102
|
-
event.stopPropagation();
|
|
103
|
-
onSubmit(index, 'preview');
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
_this.dealPreviewOptions = function (uploadStatus, deleteable, smallImageUrl, clientUrl) {
|
|
107
77
|
if (uploadStatus === 2 || uploadStatus === 1) {
|
|
108
78
|
// 上传中
|
|
109
79
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
@@ -113,13 +83,15 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
113
83
|
className: "upload-file-action-wrapper"
|
|
114
84
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
115
85
|
className: "tu-icon-canceled action-icon action-icon-delete",
|
|
116
|
-
onMouseDown:
|
|
86
|
+
onMouseDown: function onMouseDown() {
|
|
87
|
+
return onSubmit(index, 'cancel');
|
|
88
|
+
}
|
|
117
89
|
})));
|
|
118
90
|
}
|
|
119
91
|
|
|
120
92
|
if (uploadStatus === 3) {
|
|
121
93
|
// 上传成功
|
|
122
|
-
if (
|
|
94
|
+
if (smallImageUrl && deleteable) {
|
|
123
95
|
// 是图片且能删除
|
|
124
96
|
return [/*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
125
97
|
content: (0, _getLocale.getLocale)('Mod_Preview'),
|
|
@@ -127,7 +99,10 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
127
99
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
128
100
|
className: "upload-file-action-wrapper"
|
|
129
101
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
130
|
-
className: "tu-icon-yulan action-icon"
|
|
102
|
+
className: "tu-icon-yulan action-icon",
|
|
103
|
+
onMouseDown: function onMouseDown() {
|
|
104
|
+
return onSubmit(index, 'preview');
|
|
105
|
+
}
|
|
131
106
|
}))), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
132
107
|
content: (0, _getLocale.getLocale)('Mod_Delete'),
|
|
133
108
|
container: document.body
|
|
@@ -135,11 +110,13 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
135
110
|
className: "upload-file-action-wrapper"
|
|
136
111
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
137
112
|
className: "tu-icon-canceled action-icon delete",
|
|
138
|
-
onMouseDown:
|
|
113
|
+
onMouseDown: function onMouseDown() {
|
|
114
|
+
return onSubmit(index, 'delete');
|
|
115
|
+
}
|
|
139
116
|
})))];
|
|
140
117
|
}
|
|
141
118
|
|
|
142
|
-
if (!smallImageUrl &&
|
|
119
|
+
if (!smallImageUrl && deleteable) {
|
|
143
120
|
// 不是图片但能删除
|
|
144
121
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
145
122
|
content: (0, _getLocale.getLocale)('Mod_Delete'),
|
|
@@ -148,11 +125,13 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
148
125
|
className: "upload-file-action-wrapper"
|
|
149
126
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
150
127
|
className: "tu-icon-canceled action-icon delete",
|
|
151
|
-
onMouseDown:
|
|
128
|
+
onMouseDown: function onMouseDown() {
|
|
129
|
+
return onSubmit(index, 'delete');
|
|
130
|
+
}
|
|
152
131
|
})));
|
|
153
132
|
}
|
|
154
133
|
|
|
155
|
-
if (
|
|
134
|
+
if (smallImageUrl && !deleteable) {
|
|
156
135
|
// 是图片不能删除
|
|
157
136
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
158
137
|
content: (0, _getLocale.getLocale)('Mod_Preview'),
|
|
@@ -160,7 +139,10 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
160
139
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
161
140
|
className: "upload-file-action-wrapper"
|
|
162
141
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
163
|
-
className: "tu-icon-magnifier-circle action-icon"
|
|
142
|
+
className: "tu-icon-magnifier-circle action-icon",
|
|
143
|
+
onMouseDown: function onMouseDown() {
|
|
144
|
+
return onSubmit(index, 'preview');
|
|
145
|
+
}
|
|
164
146
|
})));
|
|
165
147
|
} // 不是图片也不能删除
|
|
166
148
|
|
|
@@ -176,7 +158,9 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
176
158
|
className: "upload-file-action-wrapper"
|
|
177
159
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
178
160
|
className: "tu-icon-canceled action-icon delete",
|
|
179
|
-
onMouseDown:
|
|
161
|
+
onMouseDown: function onMouseDown() {
|
|
162
|
+
return onSubmit(index, 'delete');
|
|
163
|
+
}
|
|
180
164
|
})));
|
|
181
165
|
} // 4:上传失败
|
|
182
166
|
|
|
@@ -188,7 +172,9 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
188
172
|
className: "upload-file-action-wrapper"
|
|
189
173
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
190
174
|
className: "tu-icon-gengxin1 action-icon",
|
|
191
|
-
onMouseDown:
|
|
175
|
+
onMouseDown: function onMouseDown() {
|
|
176
|
+
return onSubmit(index, 'reupload');
|
|
177
|
+
}
|
|
192
178
|
}))), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
193
179
|
content: (0, _getLocale.getLocale)('Mod_Delete'),
|
|
194
180
|
container: document.body
|
|
@@ -196,7 +182,9 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
196
182
|
className: "upload-file-action-wrapper"
|
|
197
183
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
198
184
|
className: "tu-icon-canceled action-icon delete",
|
|
199
|
-
onMouseDown:
|
|
185
|
+
onMouseDown: function onMouseDown() {
|
|
186
|
+
return onSubmit(index, 'delete');
|
|
187
|
+
}
|
|
200
188
|
}))));
|
|
201
189
|
};
|
|
202
190
|
|
|
@@ -212,13 +200,12 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
212
200
|
}, {
|
|
213
201
|
key: "render",
|
|
214
202
|
value: function render() {
|
|
215
|
-
var _this$
|
|
216
|
-
className = _this$
|
|
217
|
-
uploadResultItem = _this$
|
|
218
|
-
|
|
203
|
+
var _this$props = this.props,
|
|
204
|
+
className = _this$props.className,
|
|
205
|
+
uploadResultItem = _this$props.uploadResultItem,
|
|
206
|
+
index = _this$props.index;
|
|
219
207
|
return /*#__PURE__*/_react["default"].createElement(_style.PreviewContent, {
|
|
220
|
-
className: ['preview__content document-mouse-event-ignore', className].join(' ')
|
|
221
|
-
onMouseDown: this.onPreview
|
|
208
|
+
className: ['preview__content document-mouse-event-ignore', className].join(' ')
|
|
222
209
|
}, /*#__PURE__*/_react["default"].createElement(_style.PreviewImageWrapper, null, this.renderPreviewThumbnail()), /*#__PURE__*/_react["default"].createElement(_style.PreviewMessageWrapper, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
223
210
|
content: uploadResultItem.FileName,
|
|
224
211
|
container: document.body
|
|
@@ -232,7 +219,7 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
232
219
|
className: "upload-file--progress"
|
|
233
220
|
})) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
234
221
|
className: uploadResultItem.uploadStatus === 3 || uploadResultItem.uploadStatus === 2 ? 'upload-file-size' : 'upload-file-size upload-file-size--error'
|
|
235
|
-
}, uploadResultItem.uploadStatus === 3 || uploadResultItem.uploadStatus === 2 ? (0, _util.getFileSize)(uploadResultItem.FileSize) : uploadResultItem.Msg)))), /*#__PURE__*/_react["default"].createElement(_style.PreviewOptionsWrapper, null, this.dealPreviewOptions(uploadResultItem.uploadStatus, uploadResultItem.Deleteable, uploadResultItem.SmallImageUrl
|
|
222
|
+
}, uploadResultItem.uploadStatus === 3 || uploadResultItem.uploadStatus === 2 ? (0, _util.getFileSize)(uploadResultItem.FileSize) : uploadResultItem.Msg)))), /*#__PURE__*/_react["default"].createElement(_style.PreviewOptionsWrapper, null, this.dealPreviewOptions(uploadResultItem.uploadStatus, index, uploadResultItem.Deleteable, uploadResultItem.SmallImageUrl), ' '));
|
|
236
223
|
}
|
|
237
224
|
}]);
|
|
238
225
|
|
|
@@ -39,8 +39,6 @@ var _platform = require("../../utils/platform");
|
|
|
39
39
|
|
|
40
40
|
var _utils = require("../dialog-qq-docs/utils");
|
|
41
41
|
|
|
42
|
-
var _tools = require("../../utils/tools");
|
|
43
|
-
|
|
44
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
45
43
|
|
|
46
44
|
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); }
|
|
@@ -429,17 +427,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
429
427
|
uploadSuccessFiles: uploadResultFiles
|
|
430
428
|
});
|
|
431
429
|
} else if (options === 'preview') {
|
|
432
|
-
var
|
|
433
|
-
|
|
434
|
-
var currentFiles = _uploadResultFiles[index];
|
|
430
|
+
var imgIndex = _this.getImgIndex(index);
|
|
435
431
|
|
|
436
|
-
|
|
437
|
-
var imgIndex = _this.getImgIndex(index);
|
|
438
|
-
|
|
439
|
-
_this.refs.imgViewerRef.show(imgIndex);
|
|
440
|
-
} else if (currentFiles.ClientUrl) {
|
|
441
|
-
(0, _tools.openUrl)(currentFiles.ClientUrl);
|
|
442
|
-
}
|
|
432
|
+
_this.refs.imgViewerRef.show(imgIndex);
|
|
443
433
|
} else if (options === 'reupload') {
|
|
444
434
|
var _reUploadFileInfo = _this.state.uploadSuccessFiles[index];
|
|
445
435
|
var reUploadFile = _this.state.selectFiles[_reUploadFileInfo.FileName];
|
|
@@ -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(
|
|
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",
|
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,8 @@ 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
|
+
console.log('newTab', newTab);
|
|
42
43
|
if (!newTab) return;
|
|
43
44
|
newTab.opener = null;
|
|
44
45
|
newTab.location = url;
|