@titaui/pc 1.7.55 → 1.7.59
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/error-boundary/index.js +11 -7
- package/lib/components/file-list/index.js +12 -1
- package/lib/components/img-viewer/index.js +1 -1
- package/lib/components/menus/export-modules/manage-menus/index.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +5 -2
- package/lib/components/okr-flow/child-node/index.js +2 -2
- package/lib/components/upload/components/uploadedPreview.js +1 -1
- package/lib/components/upload/index.js +16 -1
- package/package.json +1 -1
|
@@ -58,13 +58,17 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
58
58
|
_createClass(ErrorBoundary, [{
|
|
59
59
|
key: "componentDidCatch",
|
|
60
60
|
value: function componentDidCatch(error, errorInfo) {
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
eventId
|
|
61
|
+
var _this2 = this;
|
|
62
|
+
|
|
63
|
+
Sentry.withScope(function (scope) {
|
|
64
|
+
scope.setTag("error-level", "P".concat(_this2.props.errorLevel || 0));
|
|
65
|
+
scope.setTag("error-type", "\u767D\u9875");
|
|
66
|
+
scope.setExtra("componentStack", errorInfo.componentStack);
|
|
67
|
+
var eventId = Sentry.captureException(new Error(error), scope);
|
|
68
|
+
|
|
69
|
+
_this2.setState({
|
|
70
|
+
eventId: eventId
|
|
71
|
+
});
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
}, {
|
|
@@ -30,19 +30,30 @@ var FileList = function FileList(_ref) {
|
|
|
30
30
|
_ref$showDownload = _ref.showDownload,
|
|
31
31
|
showDownload = _ref$showDownload === void 0 ? true : _ref$showDownload;
|
|
32
32
|
var imgViewerRef = (0, _react.useRef)();
|
|
33
|
+
var imageIndexRef = (0, _react.useRef)(0);
|
|
33
34
|
|
|
34
35
|
var handleImgPreview = function handleImgPreview(index) {
|
|
35
36
|
// @ts-ignore
|
|
36
37
|
imgViewerRef.current && imgViewerRef.current.show(index);
|
|
37
38
|
};
|
|
38
39
|
|
|
40
|
+
var getIndex = function getIndex(file) {
|
|
41
|
+
var index = imageIndexRef.current;
|
|
42
|
+
|
|
43
|
+
if ((0, _util.isImg)(file.fileType)) {
|
|
44
|
+
imageIndexRef.current = index + 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return index;
|
|
48
|
+
};
|
|
49
|
+
|
|
39
50
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
40
51
|
className: prefix
|
|
41
52
|
}, data.map(function (file, index) {
|
|
42
53
|
return /*#__PURE__*/_react["default"].createElement(_singleFile["default"], {
|
|
43
54
|
key: file.documentSource + index,
|
|
44
55
|
data: file,
|
|
45
|
-
index:
|
|
56
|
+
index: getIndex(file),
|
|
46
57
|
showDownload: showDownload,
|
|
47
58
|
onPreview: handleImgPreview
|
|
48
59
|
});
|
|
@@ -150,7 +150,7 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
150
150
|
var renderPreviewer = function renderPreviewer() {
|
|
151
151
|
if (!visible) return null;
|
|
152
152
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
153
|
-
className: prefix
|
|
153
|
+
className: (0, _classnames["default"])(prefix, 'document-mouse-event-ignore')
|
|
154
154
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
155
155
|
className: prefix + "__header"
|
|
156
156
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -78,7 +78,7 @@ var ManageMenus = function ManageMenus(props) {
|
|
|
78
78
|
var search = history.location.search;
|
|
79
79
|
var activeMenu = new _handleHighlight.JudgeManageHighLightMenu(search).getHighLightMenu();
|
|
80
80
|
setSelectedMenuKeys([activeMenu]);
|
|
81
|
-
}, [history]);
|
|
81
|
+
}, [history.location.pathname, history.location.search]);
|
|
82
82
|
|
|
83
83
|
var onSelectHandler = function onSelectHandler(selectedKyes, _ref) {
|
|
84
84
|
var node = _ref.node;
|
|
@@ -196,8 +196,11 @@ var _default = function _default(props) {
|
|
|
196
196
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
197
197
|
className: "tu-icon-okr"
|
|
198
198
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
199
|
-
className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-parent-node-target-title"))
|
|
200
|
-
|
|
199
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-parent-node-target-title")),
|
|
200
|
+
dangerouslySetInnerHTML: {
|
|
201
|
+
__html: data.parentOkr.workName
|
|
202
|
+
}
|
|
203
|
+
})), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
201
204
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-parent-node-h1"))
|
|
202
205
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
203
206
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-parent-node-prefix"))
|
|
@@ -71,12 +71,12 @@ var ChildNode = function ChildNode(props) {
|
|
|
71
71
|
|
|
72
72
|
var expandChild = function expandChild(e) {
|
|
73
73
|
e.stopPropagation();
|
|
74
|
-
isChildExpand ? onChildClose(id) : onChildExpand(data);
|
|
74
|
+
isChildExpand ? onChildClose && onChildClose(id) : onChildExpand && onChildExpand(data);
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
var expandParent = function expandParent(e) {
|
|
78
78
|
e.stopPropagation();
|
|
79
|
-
onParentExpand(data);
|
|
79
|
+
onParentExpand && onParentExpand(data);
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
var NodeTypeComp = modelType == 'kr' ? _krNode["default"] : _workNode["default"];
|
|
@@ -195,7 +195,7 @@ var UploadedPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
195
195
|
uploadResultItem = _this$props.uploadResultItem,
|
|
196
196
|
index = _this$props.index;
|
|
197
197
|
return /*#__PURE__*/_react["default"].createElement(_style.PreviewContent, {
|
|
198
|
-
className: ['preview__content', className].join(' ')
|
|
198
|
+
className: ['preview__content document-mouse-event-ignore', className].join(' ')
|
|
199
199
|
}, /*#__PURE__*/_react["default"].createElement(_style.PreviewImageWrapper, null, this.renderPreviewThumbnail()), /*#__PURE__*/_react["default"].createElement(_style.PreviewMessageWrapper, null, /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
200
200
|
content: uploadResultItem.FileName,
|
|
201
201
|
container: document.body
|
|
@@ -329,6 +329,19 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
329
329
|
});
|
|
330
330
|
};
|
|
331
331
|
|
|
332
|
+
_this.getImgIndex = function (index) {
|
|
333
|
+
var newIndex = 0;
|
|
334
|
+
var uploadSuccessFiles = _this.state.uploadSuccessFiles;
|
|
335
|
+
|
|
336
|
+
for (var i = 0; i < index; i++) {
|
|
337
|
+
if ((0, _util.isImg)(uploadSuccessFiles[i].FileType)) {
|
|
338
|
+
newIndex++;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return newIndex;
|
|
343
|
+
};
|
|
344
|
+
|
|
332
345
|
_this.handlerUploadPreviewOptions = function (index, options) {
|
|
333
346
|
var _this$props2 = _this.props,
|
|
334
347
|
onSubmit = _this$props2.onSubmit,
|
|
@@ -356,7 +369,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
356
369
|
uploadSuccessFiles: uploadResultFiles
|
|
357
370
|
});
|
|
358
371
|
} else if (options === 'preview') {
|
|
359
|
-
_this.
|
|
372
|
+
var imgIndex = _this.getImgIndex(index);
|
|
373
|
+
|
|
374
|
+
_this.refs.imgViewerRef.show(imgIndex);
|
|
360
375
|
} else if (options === 'reupload') {
|
|
361
376
|
var _reUploadFileInfo = _this.state.uploadSuccessFiles[index];
|
|
362
377
|
var reUploadFile = _this.state.selectFiles[_reUploadFileInfo.FileName];
|