@titaui/pc 1.11.0 → 1.11.3-2.beta-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.
- package/lib/components/avatar/text-avatar/index.css +7 -0
- package/lib/components/avatar/text-avatar/index.js +32 -7
- package/lib/components/button/icon-btn/index.js +17 -8
- package/lib/components/button/rect-btn/index.js +7 -7
- package/lib/components/change-okr-modal/Item.js +15 -15
- package/lib/components/communication/index.js +30 -29
- package/lib/components/drawer/index.js +7 -6
- package/lib/components/drawer-manager/index.js +25 -27
- package/lib/components/drop-selector/index.js +25 -10
- package/lib/components/dynamic/constant.js +43 -36
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +243 -0
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +6 -2
- package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +6 -6
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +11 -11
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +14 -14
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +10 -10
- package/lib/components/dynamic/dynamic-item/index.js +70 -41
- package/lib/components/dynamic/dynamic-list/index.js +5 -13
- package/lib/components/e-priority/index.js +18 -12
- package/lib/components/eReport/eReportShare/index.js +12 -12
- package/lib/components/file-list/components/single-file/index.js +11 -11
- package/lib/components/form/form-fields/date/index.css +24 -0
- package/lib/components/form/form-fields/date/index.js +102 -0
- package/lib/components/form/form-fields/input/index.js +10 -10
- package/lib/components/form/form-fields/user/index.css +23 -3
- package/lib/components/form/form-fields/user/index.js +18 -8
- package/lib/components/form/form-fields/user/user-input.js +15 -6
- package/lib/components/form/index.js +10 -3
- package/lib/components/grid-layout/sub-employee-okr/person-okr.js +11 -5
- package/lib/components/icon-button-list/index.css +2 -57
- package/lib/components/icon-button-list/index.js +10 -7
- package/lib/components/img-viewer/index.css +10 -3
- package/lib/components/img-viewer/index.js +57 -18
- package/lib/components/mblog/components/MblogContent.js +5 -2
- package/lib/components/mblog/index.js +31 -30
- package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
- package/lib/components/menus/components/menu-tree/index.css +4 -2
- package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
- package/lib/components/menus/export-modules/interview-menus/constant.js +30 -0
- package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +63 -0
- package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
- package/lib/components/menus/export-modules/interview-menus/index.js +128 -0
- package/lib/components/menus/index.js +11 -5
- package/lib/components/nav-top/components/menu/index.js +14 -14
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
- package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
- package/lib/components/nav-top/components/user-message/constant.js +1 -0
- package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
- package/lib/components/nav-top/components/user-message/index.js +23 -20
- package/lib/components/nav-top/request.apis.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +3 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +10 -0
- package/lib/components/okr-detail/detail-header/actions.js +62 -66
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +205 -194
- package/lib/components/okr-detail/index.js +21 -19
- package/lib/components/okr-detail/okr-list/index.js +5 -3
- package/lib/components/okr-flow/child-node/index.css +67 -21
- package/lib/components/okr-flow/child-node/work-node.js +61 -24
- package/lib/components/okr-flow/empty/index.css +8 -1
- package/lib/components/okr-flow/export-modal/index.js +63 -21
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +30 -24
- package/lib/components/okr-flow/images/loading-light.gif +0 -0
- package/lib/components/okr-flow/okr-map/index.js +43 -22
- package/lib/components/okr-flow/request-apis.js +15 -8
- package/lib/components/okr-flow/root-node/index.css +2 -2
- package/lib/components/okr-flow/root-node/index.js +26 -25
- package/lib/components/okr-flow/utils/index.js +45 -29
- package/lib/components/okr-flow/utils/tree-handler.js +29 -18
- package/lib/components/okr-progress-modal/index.css +1 -1
- package/lib/components/okrcase-library/index.css +6 -4
- package/lib/components/okrcase-library/okrcases-components/caseLibrary-main.js +9 -2
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +36 -30
- package/lib/components/pagination/index.css +3 -3
- package/lib/components/pagination/select.css +58 -23
- package/lib/components/period-selector/index.css +9 -3
- package/lib/components/period-selector/index.js +14 -11
- package/lib/components/picker/components/panels/date-panel/date-body.js +118 -0
- package/lib/components/picker/components/panels/date-panel/date-head.js +87 -0
- package/lib/components/picker/components/panels/date-panel/index.css +14 -0
- package/lib/components/picker/components/panels/date-panel/index.js +49 -0
- package/lib/components/picker/components/panels/month-panel/index.css +27 -0
- package/lib/components/picker/components/panels/month-panel/index.js +63 -0
- package/lib/components/picker/components/panels/month-panel/month-body.js +89 -0
- package/lib/components/picker/components/panels/month-panel/month-head.js +47 -0
- package/lib/components/picker/components/panels/panel-body/index.js +53 -0
- package/lib/components/picker/components/panels/panel-head/index.js +48 -0
- package/lib/components/picker/components/panels/year-panel/index.css +23 -0
- package/lib/components/picker/components/panels/year-panel/index.js +65 -0
- package/lib/components/picker/components/panels/year-panel/year-body.js +92 -0
- package/lib/components/picker/components/panels/year-panel/year-head.js +35 -0
- package/lib/components/picker/components/picker-trigger/index.css +57 -0
- package/lib/components/picker/components/picker-trigger/index.js +94 -0
- package/lib/components/picker/context.js +15 -0
- package/lib/components/picker/index.css +121 -0
- package/lib/components/picker/index.js +13 -0
- package/lib/components/picker/picker-panels.js +182 -0
- package/lib/components/picker/picker.js +132 -0
- package/lib/components/picker/type.js +5 -0
- package/lib/components/picker/utils.js +28 -0
- package/lib/components/popup/index.js +4 -4
- package/lib/components/radio/index.css +9 -9
- package/lib/components/scroll-container/index.js +423 -0
- package/lib/components/scroll-container/style.css +35 -0
- package/lib/components/scrollbar/scroll-mask/index.js +1 -1
- package/lib/components/superset-charts/components/chart/index.js +1 -1
- package/lib/components/superset-charts/utils/axios.js +5 -13
- package/lib/components/survey-model/contact.js +93 -0
- package/lib/components/survey-model/index.css +141 -0
- package/lib/components/survey-model/index.js +268 -0
- package/lib/components/survey-model/instance.js +86 -0
- package/lib/components/survey-model/request-api.js +80 -0
- package/lib/components/task-tree/helper.js +61 -0
- package/lib/components/task-tree/images/P1.svg +15 -0
- package/lib/components/task-tree/images/P2.svg +15 -0
- package/lib/components/task-tree/images/P3.svg +15 -0
- package/lib/components/task-tree/images/P4.svg +15 -0
- package/lib/components/task-tree/images/P5.svg +15 -0
- package/lib/components/task-tree/images/arrow.svg +9 -0
- package/lib/components/task-tree/images/empty-131.png +0 -0
- package/lib/components/task-tree/images/followed.svg +33 -0
- package/lib/components/task-tree/images/nice.svg +108 -0
- package/lib/components/task-tree/images/struc12.png +0 -0
- package/lib/components/task-tree/images/struc2.png +0 -0
- package/lib/components/task-tree/images/xialat-s.svg +13 -0
- package/lib/components/task-tree/index.js +22 -0
- package/lib/components/task-tree/mock.js +944 -0
- package/lib/components/task-tree/precls.js +8 -0
- package/lib/components/task-tree/request-apis.js +88 -0
- package/lib/components/task-tree/task-item-node/constant.js +45 -0
- package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
- package/lib/components/task-tree/task-item-node/e-project.js +212 -0
- package/lib/components/task-tree/task-item-node/e-status-dropdown.js +94 -0
- package/lib/components/task-tree/task-item-node/e-task.js +426 -0
- package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
- package/lib/components/task-tree/task-item-node/index.css +289 -0
- package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
- package/lib/components/task-tree/task-tree.css +16 -0
- package/lib/components/task-tree/task-tree.js +49 -0
- package/lib/components/time-picker/index.css +123 -0
- package/lib/components/time-picker/index.js +13 -0
- package/lib/components/time-picker/time-picker-selector.js +138 -0
- package/lib/components/time-picker/time-picker.js +336 -0
- package/lib/components/time-picker/timer-picker-input.js +96 -0
- package/lib/components/time-picker/utils.js +52 -0
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
- package/lib/components/wechat-btn/index.css +14 -0
- package/lib/components/wechat-btn/index.js +338 -0
- package/lib/components-v1/radio/radio.js +3 -3
- package/lib/components-v1/radio/style/index.css +8 -8
- package/lib/index.js +101 -77
- package/lib/pages/aha2021/index.js +5 -1
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +7 -2
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +73 -34
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +65 -42
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +26 -14
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +58 -13
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +28 -20
- package/lib/pages/okr-map/number-select/index.css +12 -9
- package/lib/pages/okr-map/number-select/index.js +3 -3
- package/lib/utils/auth.js +65 -8
- package/lib/utils/bs-global.js +18 -6
- package/lib/utils/hooks.js +72 -0
- package/lib/utils/open-data.js +63 -43
- package/package.json +6 -2
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -223
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -31
- package/.prettierrc.js +0 -90
- package/.vscode/settings.json +0 -5
|
@@ -17,6 +17,8 @@ var _tooltip = _interopRequireDefault(require("../../tooltip"));
|
|
|
17
17
|
|
|
18
18
|
var _userSelector = _interopRequireDefault(require("../../user-selector"));
|
|
19
19
|
|
|
20
|
+
var _default2 = _interopRequireDefault(require("../default"));
|
|
21
|
+
|
|
20
22
|
require("./index.css");
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -56,7 +58,11 @@ function TextAvatar(props) {
|
|
|
56
58
|
_props$nameTips = props.nameTips,
|
|
57
59
|
nameTips = _props$nameTips === void 0 ? function (name) {
|
|
58
60
|
return name;
|
|
59
|
-
} : _props$nameTips
|
|
61
|
+
} : _props$nameTips,
|
|
62
|
+
_props$showAvatar = props.showAvatar,
|
|
63
|
+
showAvatar = _props$showAvatar === void 0 ? false : _props$showAvatar,
|
|
64
|
+
_props$avatar = props.avatar,
|
|
65
|
+
avatar = _props$avatar === void 0 ? {} : _props$avatar;
|
|
60
66
|
|
|
61
67
|
var _useState = (0, _react.useState)(false),
|
|
62
68
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -78,6 +84,29 @@ function TextAvatar(props) {
|
|
|
78
84
|
|
|
79
85
|
|
|
80
86
|
var FieldPerson = editable ? _userSelector["default"] : "span";
|
|
87
|
+
|
|
88
|
+
var renderAvatar = function renderAvatar() {
|
|
89
|
+
if (showAvatar) {
|
|
90
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
91
|
+
className: "".concat(preCls, "__img")
|
|
92
|
+
}, /*#__PURE__*/_react["default"].createElement(_default2["default"], {
|
|
93
|
+
userId: id,
|
|
94
|
+
src: avatar !== null && avatar !== void 0 && avatar.HasAvatar || avatar !== null && avatar !== void 0 && avatar.hasAvatar ? avatar.medium : "",
|
|
95
|
+
color: avatar === null || avatar === void 0 ? void 0 : avatar.color,
|
|
96
|
+
name: name,
|
|
97
|
+
size: {
|
|
98
|
+
fontSize: 12,
|
|
99
|
+
width: 24,
|
|
100
|
+
textNum: 1
|
|
101
|
+
}
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
106
|
+
className: "".concat(preCls, "__icon")
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
81
110
|
return /*#__PURE__*/_react["default"].createElement(FieldPerson, {
|
|
82
111
|
multiple: false,
|
|
83
112
|
selectNodes: {},
|
|
@@ -105,9 +134,7 @@ function TextAvatar(props) {
|
|
|
105
134
|
style: {
|
|
106
135
|
maxWidth: width
|
|
107
136
|
}
|
|
108
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
109
|
-
className: "".concat(preCls, "__icon")
|
|
110
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
137
|
+
}, renderAvatar(), /*#__PURE__*/_react["default"].createElement("span", {
|
|
111
138
|
ref: text,
|
|
112
139
|
className: "".concat(preCls, "__name")
|
|
113
140
|
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
@@ -118,9 +145,7 @@ function TextAvatar(props) {
|
|
|
118
145
|
style: {
|
|
119
146
|
maxWidth: width
|
|
120
147
|
}
|
|
121
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
122
|
-
className: "".concat(preCls, "__icon")
|
|
123
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
148
|
+
}, renderAvatar(), /*#__PURE__*/_react["default"].createElement("span", {
|
|
124
149
|
ref: text,
|
|
125
150
|
className: "".concat(preCls, "__name")
|
|
126
151
|
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
@@ -11,11 +11,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
require("./index.css");
|
|
13
13
|
|
|
14
|
+
var _excluded = ["border", "theme", "onClick", "disabled", "icon"];
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
17
|
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
16
20
|
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; }
|
|
17
21
|
|
|
18
|
-
var
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
var precls = 'titaui-icon-btn';
|
|
19
27
|
|
|
20
28
|
function IconBtn(props) {
|
|
21
29
|
var _classNames;
|
|
@@ -24,15 +32,16 @@ function IconBtn(props) {
|
|
|
24
32
|
theme = props.theme,
|
|
25
33
|
onClick = props.onClick,
|
|
26
34
|
disabled = props.disabled,
|
|
27
|
-
icon = props.icon
|
|
35
|
+
icon = props.icon,
|
|
36
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
28
37
|
|
|
29
38
|
var onClickHandler = function onClickHandler() {
|
|
30
39
|
if (disabled) return;
|
|
31
|
-
onClick
|
|
40
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
32
41
|
};
|
|
33
42
|
|
|
34
43
|
var renderIcon = function renderIcon() {
|
|
35
|
-
if (typeof icon ===
|
|
44
|
+
if (typeof icon === 'string') {
|
|
36
45
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
37
46
|
className: "".concat(precls, "__icon")
|
|
38
47
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -45,18 +54,18 @@ function IconBtn(props) {
|
|
|
45
54
|
}, icon);
|
|
46
55
|
};
|
|
47
56
|
|
|
48
|
-
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement("span", _extends({
|
|
49
58
|
className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(theme), (_classNames = {}, _defineProperty(_classNames, "".concat(precls, "--border"), border), _defineProperty(_classNames, "".concat(precls, "--disabled"), disabled), _classNames)),
|
|
50
59
|
onClick: onClickHandler
|
|
51
|
-
}, renderIcon());
|
|
60
|
+
}, restProps), renderIcon());
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
IconBtn.defaultProps = {
|
|
55
64
|
border: false,
|
|
56
|
-
theme:
|
|
65
|
+
theme: 'gray',
|
|
57
66
|
onClick: function onClick() {},
|
|
58
67
|
disabled: false,
|
|
59
|
-
icon:
|
|
68
|
+
icon: 'tu-icon-smile'
|
|
60
69
|
};
|
|
61
70
|
var _default = IconBtn;
|
|
62
71
|
exports["default"] = _default;
|
|
@@ -17,27 +17,27 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
17
17
|
|
|
18
18
|
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; }
|
|
19
19
|
|
|
20
|
-
var precls =
|
|
20
|
+
var precls = 'titaui-rect-btn';
|
|
21
21
|
|
|
22
22
|
function RectBtn(props) {
|
|
23
23
|
var _props$type = props.type,
|
|
24
|
-
type = _props$type === void 0 ?
|
|
24
|
+
type = _props$type === void 0 ? 'default' : _props$type,
|
|
25
25
|
_props$icon = props.icon,
|
|
26
|
-
icon = _props$icon === void 0 ?
|
|
26
|
+
icon = _props$icon === void 0 ? '' : _props$icon,
|
|
27
27
|
_props$text = props.text,
|
|
28
|
-
text = _props$text === void 0 ? (0, _getLocale.getLocale)(
|
|
28
|
+
text = _props$text === void 0 ? (0, _getLocale.getLocale)('OKR_MyO_Butt_Determine') : _props$text,
|
|
29
29
|
_props$size = props.size,
|
|
30
|
-
size = _props$size === void 0 ?
|
|
30
|
+
size = _props$size === void 0 ? 'normal' : _props$size,
|
|
31
31
|
_props$onClick = props.onClick,
|
|
32
32
|
onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
33
33
|
_props$className = props.className,
|
|
34
|
-
className = _props$className === void 0 ?
|
|
34
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
35
35
|
_props$disabled = props.disabled,
|
|
36
36
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
37
37
|
style = props.style;
|
|
38
38
|
|
|
39
39
|
var renderIcon = function renderIcon() {
|
|
40
|
-
if (typeof icon ===
|
|
40
|
+
if (typeof icon === 'string') {
|
|
41
41
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
42
42
|
className: "".concat(precls, "__icon")
|
|
43
43
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -54,27 +54,27 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
54
54
|
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; }
|
|
55
55
|
|
|
56
56
|
var colorMap = {
|
|
57
|
-
1:
|
|
58
|
-
2:
|
|
59
|
-
3:
|
|
60
|
-
4:
|
|
57
|
+
1: '132,117,255',
|
|
58
|
+
2: '79,115,255',
|
|
59
|
+
3: '46,156,255',
|
|
60
|
+
4: '12,192,201'
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
var formatKeywordsFunc = function formatKeywordsFunc(str, key) {
|
|
64
|
-
var reg = new RegExp("(".concat(key, ")"),
|
|
64
|
+
var reg = new RegExp("(".concat(key, ")"), 'g');
|
|
65
65
|
var newstr = str.replace(reg, "<span style=\"color: #2879ff;\">".concat(key, "</span>"));
|
|
66
66
|
return newstr;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
var unFormatKeywordsFunc = function unFormatKeywordsFunc(str, key) {
|
|
70
70
|
var regExpKey = "<span style=\"color: #2879ff;\">".concat(key, "</span>");
|
|
71
|
-
var reg = new RegExp("(".concat(regExpKey, ")"),
|
|
71
|
+
var reg = new RegExp("(".concat(regExpKey, ")"), 'g');
|
|
72
72
|
var newstr = str.replace(reg, key);
|
|
73
73
|
return newstr;
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
var htmlToText = function htmlToText(text) {
|
|
77
|
-
var div = document.createElement(
|
|
77
|
+
var div = document.createElement('div');
|
|
78
78
|
div.innerHTML = text;
|
|
79
79
|
var newtext = div.innerText || div.textContent;
|
|
80
80
|
return newtext;
|
|
@@ -153,11 +153,11 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
153
153
|
|
|
154
154
|
_this.getCycleText = function () {
|
|
155
155
|
var data = _this.props.data;
|
|
156
|
-
var hzNum = [(0, _getLocale.getLocale)(
|
|
156
|
+
var hzNum = [(0, _getLocale.getLocale)('OKR_MyO_Pop_1stQuarter'), (0, _getLocale.getLocale)('OKR_MyO_Pop_2ndQuarter'), (0, _getLocale.getLocale)('OKR_MyO_Pop_3rdQuarter'), (0, _getLocale.getLocale)('OKR_MyO_Pop_4thQuarter')];
|
|
157
157
|
|
|
158
158
|
switch (data.cycleType) {
|
|
159
159
|
case 1:
|
|
160
|
-
return "".concat(data.annualNum).concat(_getLocale.isEn ?
|
|
160
|
+
return "".concat(data.annualNum).concat(_getLocale.isEn ? '' : '年');
|
|
161
161
|
|
|
162
162
|
case 2:
|
|
163
163
|
return hzNum[data.yqmnum - 1];
|
|
@@ -166,13 +166,13 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
166
166
|
return (0, _constant2.getMonth)()[data.yqmnum - 1];
|
|
167
167
|
|
|
168
168
|
case 4:
|
|
169
|
-
return "".concat((0, _constant2.getMonth)()[data.yqmnum - 1], "-").concat((0, _constant2.getMonth)()[((data.yqmnum + 1) % 12 || 12) - 1]
|
|
169
|
+
return "".concat((0, _constant2.getMonth)()[data.yqmnum - 1], "-").concat((0, _constant2.getMonth)()[((data.yqmnum + 1) % 12 || 12) - 1]);
|
|
170
170
|
|
|
171
171
|
case 5:
|
|
172
|
-
return data.yqmnum === 1 ? (0, _getLocale.getLocale)(
|
|
172
|
+
return data.yqmnum === 1 ? (0, _getLocale.getLocale)('OKR_MyO_Pop_Firsthalf') : (0, _getLocale.getLocale)('OKR_MyO_Pop_Secondhalf');
|
|
173
173
|
|
|
174
174
|
default:
|
|
175
|
-
return (0, _getLocale.getLocale)(
|
|
175
|
+
return (0, _getLocale.getLocale)('Mod_Customization');
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
|
|
@@ -230,7 +230,7 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
230
230
|
}))));
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
return
|
|
233
|
+
return '';
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -290,12 +290,12 @@ var Item = /*#__PURE__*/function (_PureComponent) {
|
|
|
290
290
|
__html: okrData.workName
|
|
291
291
|
}
|
|
292
292
|
}))), this.isObjectiveRelevanceKr && isShowKr && data.Krs.length > 0 && /*#__PURE__*/_react["default"].createElement("span", {
|
|
293
|
-
className: "".concat(isExpand ?
|
|
293
|
+
className: "".concat(isExpand ? 'tu-icon-arrow-up' : 'tu-icon-arrow-down')
|
|
294
294
|
})), /*#__PURE__*/_react["default"].createElement(_styledComponents.ItemBottom, null, !isShowKr && [/*#__PURE__*/_react["default"].createElement("span", null, (0, _constant.getTypeMap)()[data.okrType]), /*#__PURE__*/_react["default"].createElement(_styledComponents.Separator, null)], /*#__PURE__*/_react["default"].createElement(_styledComponents.PricipleName, null, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
295
295
|
name: data.principalUser.name,
|
|
296
296
|
id: data.principalUser.userId
|
|
297
297
|
})), /*#__PURE__*/_react["default"].createElement(_styledComponents.Separator, null), /*#__PURE__*/_react["default"].createElement("span", null, data.startDate, "-", data.endDate), isShowKr && [/*#__PURE__*/_react["default"].createElement(_styledComponents.Separator, null), /*#__PURE__*/_react["default"].createElement("span", null, data.statusName)])), isShowKr && (this.isObjectiveRelevanceKr || !this.isObjectiveRelevanceKr && okrData.hasSub) && /*#__PURE__*/_react["default"].createElement(_styledComponents.ItemKrContainer, {
|
|
298
|
-
className: "".concat(isExpand ?
|
|
298
|
+
className: "".concat(isExpand ? 'slideIn' : 'slideOut')
|
|
299
299
|
}, this.renderItemKr()));
|
|
300
300
|
}
|
|
301
301
|
}]);
|
|
@@ -71,7 +71,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
71
71
|
|
|
72
72
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
73
73
|
|
|
74
|
-
var prefix =
|
|
74
|
+
var prefix = 'titaui-communication';
|
|
75
75
|
|
|
76
76
|
var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
77
77
|
_inherits(Communication, _PureComponent);
|
|
@@ -90,14 +90,14 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
90
90
|
commentType = _this$props.commentType,
|
|
91
91
|
okrFeedParams = _this$props.okrFeedParams;
|
|
92
92
|
var url = commentType == 1 ? (0, _requestV.getApiUrl2)("comment/Get?feed_id=".concat(feedId, "&comment_type=0")) : (0, _requestV.getApiUrl)("okr/cycle/getFeed?objId=".concat(okrFeedParams && okrFeedParams.objId, "&objType=").concat(okrFeedParams && okrFeedParams.objType, "&cycleType=").concat(okrFeedParams && okrFeedParams.cycleType, "&yqmNum=").concat(okrFeedParams && okrFeedParams.yqmNum, "&annualNum=").concat(okrFeedParams && okrFeedParams.annualNum, "&commentCount=").concat(commentCount));
|
|
93
|
-
(0, _requestV.taker)(url,
|
|
93
|
+
(0, _requestV.taker)(url, 'GET').then(function (res) {
|
|
94
94
|
if (res.Code === 1) {
|
|
95
95
|
var data = res.Data && (res.Data.feedComments || res.Data);
|
|
96
96
|
|
|
97
97
|
_this.setState({
|
|
98
98
|
communicationTrackList: data.comments ? data.comments : [],
|
|
99
99
|
communicationTrackTotal: data.total,
|
|
100
|
-
okrCommentFeedId: commentType === 2 ? res.Data.feedId :
|
|
100
|
+
okrCommentFeedId: commentType === 2 ? res.Data.feedId : ''
|
|
101
101
|
});
|
|
102
102
|
} else {
|
|
103
103
|
_this.setState({
|
|
@@ -137,10 +137,10 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
137
137
|
|
|
138
138
|
var communicationTrackList = _toConsumableArray(_this.state.communicationTrackList);
|
|
139
139
|
|
|
140
|
-
if (actionType ===
|
|
140
|
+
if (actionType === 'delete') {
|
|
141
141
|
// 删除
|
|
142
142
|
var url = (0, _requestV.getApiUrl2)("comment/Delete?comment_id=".concat(communicationTrackList[index].commentId, "&feed_id=").concat(feedId || _this.state.okrCommentFeedId));
|
|
143
|
-
(0, _requestV.taker)(url,
|
|
143
|
+
(0, _requestV.taker)(url, 'DELETE').then(function (res) {
|
|
144
144
|
if (res.Code === 1) {
|
|
145
145
|
isShowAllCommunicationRecord ? _this.getFeedInfo(feedId, communicationTrackTotal - 1) : _this.getFeedInfo(feedId, commentCount);
|
|
146
146
|
|
|
@@ -151,7 +151,7 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
|
-
} else if (actionType ===
|
|
154
|
+
} else if (actionType === 'reply') {
|
|
155
155
|
// 沟通里的回复
|
|
156
156
|
if (_this.props.useCustomMblog && _this.props.onComment) {
|
|
157
157
|
_this.props.onComment({
|
|
@@ -178,7 +178,7 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
178
178
|
isShowDefaultInput: false,
|
|
179
179
|
needAutoFocus: true
|
|
180
180
|
});
|
|
181
|
-
} else if (actionType ===
|
|
181
|
+
} else if (actionType === 'praise') {
|
|
182
182
|
// 沟通里的点赞
|
|
183
183
|
var isPraise = communicationTrackList[index].isPraise;
|
|
184
184
|
isPraise = !isPraise;
|
|
@@ -189,7 +189,7 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
189
189
|
|
|
190
190
|
var _url = isPraise ? (0, _requestV.getApiUrl)("praise/add?objId=".concat(communicationTrackList[index].commentId, "&objType=19&praiseType=1")) : (0, _requestV.getApiUrl)("praise/cancel?objId=".concat(communicationTrackList[index].commentId, "&objType=19"));
|
|
191
191
|
|
|
192
|
-
(0, _requestV.taker)(_url,
|
|
192
|
+
(0, _requestV.taker)(_url, 'POST').then(function (res) {
|
|
193
193
|
if (res.Code === 1) {
|
|
194
194
|
var praiseTotal = communicationTrackList[index].praiseTotal;
|
|
195
195
|
communicationTrackList[index].isPraise = isPraise;
|
|
@@ -205,7 +205,7 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
|
-
} else if (actionType ===
|
|
208
|
+
} else if (actionType === 'showPraiseRecord') {
|
|
209
209
|
// 显示点赞记录
|
|
210
210
|
_this.setState({
|
|
211
211
|
isShowPraiseRecordPop: true,
|
|
@@ -241,13 +241,13 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
241
241
|
communicationTrackTotal = _this$state3.communicationTrackTotal,
|
|
242
242
|
isShowAllCommunicationRecord = _this$state3.isShowAllCommunicationRecord;
|
|
243
243
|
|
|
244
|
-
if (submitType ===
|
|
244
|
+
if (submitType === 'submit') {
|
|
245
245
|
// 发送
|
|
246
246
|
sentData.FeedId = feedId;
|
|
247
247
|
sentData.CommentId = 0;
|
|
248
248
|
sentData.ObjId = 0;
|
|
249
249
|
sentData.ObjType = 0;
|
|
250
|
-
sentData.Content = sentData.Content ||
|
|
250
|
+
sentData.Content = sentData.Content || ' ';
|
|
251
251
|
|
|
252
252
|
if (isShowReplyToUser) {
|
|
253
253
|
sentData.CommentId = replyUserCommentId;
|
|
@@ -257,8 +257,8 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
257
257
|
submitStatus: 2
|
|
258
258
|
});
|
|
259
259
|
|
|
260
|
-
var url = commentType === 1 ? (0, _requestV.getApiUrl2)(
|
|
261
|
-
(0, _requestV.taker)(url,
|
|
260
|
+
var url = commentType === 1 ? (0, _requestV.getApiUrl2)('comment/Add') : (0, _requestV.getApiUrl)("okr/cycle/addComment?objId=".concat(okrFeedParams && okrFeedParams.objId, "&objType=").concat(okrFeedParams && okrFeedParams.objType, "&cycleType=").concat(okrFeedParams && okrFeedParams.cycleType, "&yqmNum=").concat(okrFeedParams && okrFeedParams.yqmNum, "&annualNum=").concat(okrFeedParams && okrFeedParams.annualNum));
|
|
261
|
+
(0, _requestV.taker)(url, 'POST', sentData).then(function (res) {
|
|
262
262
|
if (res.Code === 1) {
|
|
263
263
|
isShowAllCommunicationRecord ? _this.getFeedInfo(feedId, communicationTrackTotal + 1) : _this.getFeedInfo(feedId, commentCount);
|
|
264
264
|
|
|
@@ -313,17 +313,17 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
313
313
|
isShowAllCommunicationRecord: false,
|
|
314
314
|
// 是否显示所有记录
|
|
315
315
|
// 回复
|
|
316
|
-
replyUser:
|
|
317
|
-
replyUserId:
|
|
318
|
-
replyUserCommentId:
|
|
316
|
+
replyUser: '',
|
|
317
|
+
replyUserId: '',
|
|
318
|
+
replyUserCommentId: '0',
|
|
319
319
|
isShowReplyToUser: false,
|
|
320
320
|
// 是否显示回复谁
|
|
321
321
|
submitStatus: 0,
|
|
322
322
|
praiseStatus: 0,
|
|
323
323
|
// 点赞记录
|
|
324
|
-
praiseObjId:
|
|
324
|
+
praiseObjId: '',
|
|
325
325
|
isShowPraiseRecordPop: false,
|
|
326
|
-
okrCommentFeedId:
|
|
326
|
+
okrCommentFeedId: '',
|
|
327
327
|
isShowDefaultInput: showDefaultInput && communicationLength !== 0 ? true : false,
|
|
328
328
|
needAutoFocus: false
|
|
329
329
|
};
|
|
@@ -389,9 +389,9 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
389
389
|
commentCount = _this$props7.commentCount,
|
|
390
390
|
useCustomMblog = _this$props7.useCustomMblog,
|
|
391
391
|
_this$props7$submitTe = _this$props7.submitText,
|
|
392
|
-
submitText = _this$props7$submitTe === void 0 ? (0, _getLocale.getLocale)(
|
|
392
|
+
submitText = _this$props7$submitTe === void 0 ? (0, _getLocale.getLocale)('Mod_Reply') : _this$props7$submitTe,
|
|
393
393
|
_this$props7$highLigh = _this$props7.highLightKeyWord,
|
|
394
|
-
highLightKeyWord = _this$props7$highLigh === void 0 ?
|
|
394
|
+
highLightKeyWord = _this$props7$highLigh === void 0 ? '' : _this$props7$highLigh,
|
|
395
395
|
_this$props7$autoFocu = _this$props7.autoFocus,
|
|
396
396
|
autoFocus = _this$props7$autoFocu === void 0 ? false : _this$props7$autoFocu,
|
|
397
397
|
_this$props7$showUser = _this$props7.showUser,
|
|
@@ -404,10 +404,10 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
404
404
|
onMouseDown: function onMouseDown() {
|
|
405
405
|
return _this2.handlerSwitchShowRecord();
|
|
406
406
|
}
|
|
407
|
-
}, (0, _getLocale.getLocale)(
|
|
407
|
+
}, (0, _getLocale.getLocale)('Mod_Allcommu'), "\xA0", /*#__PURE__*/_react["default"].createElement("span", null, communicationTrackTotal), communicationTrackTotal > commentCount && /*#__PURE__*/_react["default"].createElement("i", {
|
|
408
408
|
className: (0, _classnames["default"])("".concat(prefix, "__communication-total-icon"), {
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
'tu-icon-APP-xi': !isShowAllCommunicationRecord,
|
|
410
|
+
'tu-icon-arrow-down1': isShowAllCommunicationRecord
|
|
411
411
|
})
|
|
412
412
|
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
413
413
|
className: (0, _classnames["default"])(_defineProperty({}, "".concat(prefix, "__communication-list"), communicationTrackList.length > 0))
|
|
@@ -432,12 +432,12 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
432
432
|
}))), !useCustomMblog && /*#__PURE__*/_react["default"].createElement("div", {
|
|
433
433
|
className: "".concat(prefix, "__reply-container")
|
|
434
434
|
}, isShowReplyToUser && /*#__PURE__*/_react["default"].createElement(_style.ReplyToUser, {
|
|
435
|
-
height: isShowReplyToUser ?
|
|
436
|
-
padding: isShowReplyToUser ?
|
|
435
|
+
height: isShowReplyToUser ? 'auto' : '0',
|
|
436
|
+
padding: isShowReplyToUser ? '4px 0' : '0',
|
|
437
437
|
className: (0, _classnames["default"])(_defineProperty({}, "".concat(prefix, "__reply-container--show-user"), showUser))
|
|
438
438
|
}, /*#__PURE__*/_react["default"].createElement(_style.ReplyUser, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
439
439
|
className: "".concat(prefix, "__reply-container-text")
|
|
440
|
-
}, (0, _getLocale.getLocale)(
|
|
440
|
+
}, (0, _getLocale.getLocale)('Mod_Reply')), /*#__PURE__*/_react["default"].createElement("span", {
|
|
441
441
|
className: "name"
|
|
442
442
|
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
443
443
|
name: replyUser,
|
|
@@ -457,14 +457,15 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
457
457
|
},
|
|
458
458
|
name: user.Name,
|
|
459
459
|
color: user.UserAvatar.Color,
|
|
460
|
-
src: user.UserAvatar.Medium
|
|
460
|
+
src: user.UserAvatar.Medium,
|
|
461
|
+
userId: user.Id
|
|
461
462
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
462
463
|
onClick: this.handleShowMblog,
|
|
463
464
|
className: "".concat(prefix, "__reply-default-input-text")
|
|
464
465
|
}, "\u8F93\u5165\u6C9F\u901A\u5185\u5BB9")), !isShowDefaultInput && /*#__PURE__*/_react["default"].createElement(_mblog["default"], {
|
|
465
466
|
setTextareaRef: setTextareaRef || function () {},
|
|
466
467
|
isHasPlaceholder: true,
|
|
467
|
-
placeholderText: (0, _getLocale.getLocale)(
|
|
468
|
+
placeholderText: (0, _getLocale.getLocale)('Mod_contentofyour'),
|
|
468
469
|
isShowRange: false,
|
|
469
470
|
isShowBtnCancel: false,
|
|
470
471
|
isShowSendSms: isShowSendSms,
|
|
@@ -486,7 +487,7 @@ var Communication = /*#__PURE__*/function (_PureComponent) {
|
|
|
486
487
|
onSubmit: function onSubmit() {
|
|
487
488
|
return _this2.setState({
|
|
488
489
|
isShowPraiseRecordPop: false,
|
|
489
|
-
praiseObjId:
|
|
490
|
+
praiseObjId: ''
|
|
490
491
|
});
|
|
491
492
|
}
|
|
492
493
|
}));
|
|
@@ -54,7 +54,7 @@ var Drawer = function Drawer(props) {
|
|
|
54
54
|
|
|
55
55
|
var visible = props.visible,
|
|
56
56
|
_props$placement = props.placement,
|
|
57
|
-
placement = _props$placement === void 0 ?
|
|
57
|
+
placement = _props$placement === void 0 ? 'right' : _props$placement,
|
|
58
58
|
children = props.children,
|
|
59
59
|
_props$mask = props.mask,
|
|
60
60
|
mask = _props$mask === void 0 ? false : _props$mask,
|
|
@@ -96,7 +96,7 @@ var Drawer = function Drawer(props) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}, /*#__PURE__*/_react["default"].createElement(_rcDrawer["default"], _extends({
|
|
99
|
-
className: (0, _classnames["default"])(
|
|
99
|
+
className: (0, _classnames["default"])('titaui-drawer', 'document-mouse-event-ignore', className),
|
|
100
100
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
101
101
|
zIndex: zIndex
|
|
102
102
|
})
|
|
@@ -122,7 +122,8 @@ function DrawerHeader(_ref) {
|
|
|
122
122
|
actionMaxCount = _ref$actionMaxCount === void 0 ? 4 : _ref$actionMaxCount,
|
|
123
123
|
content = _ref.content,
|
|
124
124
|
style = _ref.style,
|
|
125
|
-
onClose = _ref.onClose
|
|
125
|
+
onClose = _ref.onClose,
|
|
126
|
+
actionComponent = _ref.actionComponent;
|
|
126
127
|
var drawer = (0, _react.useContext)(DrawerContext);
|
|
127
128
|
var manager = (0, _react.useContext)(_context["default"]);
|
|
128
129
|
var showClose = closable && (!!onClose || !!drawer);
|
|
@@ -145,16 +146,16 @@ function DrawerHeader(_ref) {
|
|
|
145
146
|
onClick: manager && manager.goBack
|
|
146
147
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
147
148
|
className: "tu-icon-fanhui"
|
|
148
|
-
}), (0, _getLocale.getLocale)(
|
|
149
|
+
}), (0, _getLocale.getLocale)('Mod_Back')), showBackBtn && hasContent && /*#__PURE__*/_react["default"].createElement("div", {
|
|
149
150
|
className: "titaui-drawer-header-divider"
|
|
150
151
|
}), hasContent && content, /*#__PURE__*/_react["default"].createElement("div", {
|
|
151
152
|
style: {
|
|
152
153
|
flex: 1
|
|
153
154
|
}
|
|
154
|
-
}), displayActions.map(function (action) {
|
|
155
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
|
|
155
156
|
return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
|
|
156
157
|
}), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
|
|
157
|
-
title: (0, _getLocale.getLocale)(
|
|
158
|
+
title: (0, _getLocale.getLocale)('Mod_MoreOperate'),
|
|
158
159
|
icon: "tu-icon-10",
|
|
159
160
|
children: collapsedActions
|
|
160
161
|
}), showClose && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -25,45 +25,42 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
-
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
|
|
29
|
-
|
|
30
28
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
29
|
|
|
32
30
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
33
31
|
|
|
34
32
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
33
|
|
|
36
|
-
var typeMap = {};
|
|
37
|
-
|
|
38
34
|
var DrawerManager = /*#__PURE__*/function () {
|
|
39
35
|
function DrawerManager() {
|
|
40
36
|
var _this = this;
|
|
41
37
|
|
|
42
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
43
|
-
|
|
44
|
-
_objectDestructuringEmpty(_ref);
|
|
45
|
-
|
|
46
38
|
_classCallCheck(this, DrawerManager);
|
|
47
39
|
|
|
48
40
|
this.history = [];
|
|
49
41
|
this.uid = 0;
|
|
42
|
+
this.typeMap = {};
|
|
50
43
|
|
|
51
44
|
this.open = function (type) {
|
|
52
45
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
53
46
|
var drawerProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
54
|
-
if (!type) throw "need provide drawer type";
|
|
55
|
-
var Component = typeMap[type];
|
|
56
|
-
if (!Component) throw "the type is not regisited";
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
if (!type) throw new Error("need provide drawer type");
|
|
48
|
+
var Component = typeof type === "string" ? _this.typeMap[type] : type;
|
|
49
|
+
if (!Component) throw new Error("the type is not regisited");
|
|
50
|
+
|
|
51
|
+
if (window.titaTracker) {
|
|
52
|
+
window.titaTracker("action").record({
|
|
53
|
+
actionName: type,
|
|
54
|
+
actionGroup: "打开推屏",
|
|
55
|
+
productName: "OKR"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
62
59
|
return new Promise(function (resolve) {
|
|
63
60
|
clearTimeout(_this.timer);
|
|
64
61
|
_this.timer = setTimeout(function () {
|
|
65
62
|
var uid = _this.uid;
|
|
66
|
-
_this.uid
|
|
63
|
+
_this.uid += 1;
|
|
67
64
|
var extendedDrawerProps = drawerProps;
|
|
68
65
|
|
|
69
66
|
if (_this.history.length > 0) {
|
|
@@ -82,7 +79,7 @@ var DrawerManager = /*#__PURE__*/function () {
|
|
|
82
79
|
key: uid
|
|
83
80
|
}, props)), extendedDrawerProps);
|
|
84
81
|
|
|
85
|
-
if (_this.history.length
|
|
82
|
+
if (_this.history.length === 1) {
|
|
86
83
|
document.addEventListener("mousedown", _this.autoClose);
|
|
87
84
|
}
|
|
88
85
|
}, 200);
|
|
@@ -109,14 +106,16 @@ var DrawerManager = /*#__PURE__*/function () {
|
|
|
109
106
|
};
|
|
110
107
|
|
|
111
108
|
this.close = function () {
|
|
112
|
-
_this.history.reverse().forEach(function (
|
|
113
|
-
var resolve =
|
|
109
|
+
_this.history.reverse().forEach(function (_ref) {
|
|
110
|
+
var resolve = _ref.resolve;
|
|
114
111
|
return resolve();
|
|
115
112
|
});
|
|
116
113
|
|
|
117
114
|
_this.history = [];
|
|
118
115
|
|
|
119
116
|
_this.drawer.close();
|
|
117
|
+
|
|
118
|
+
document.removeEventListener("mousedown", _this.autoClose);
|
|
120
119
|
};
|
|
121
120
|
|
|
122
121
|
this.autoClose = function (e) {
|
|
@@ -125,20 +124,19 @@ var DrawerManager = /*#__PURE__*/function () {
|
|
|
125
124
|
return;
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
if ((0, _dom.hasAncestorElement)(e.target, "document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add"))
|
|
127
|
+
if ((0, _dom.hasAncestorElement)(e.target, "document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add")) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
129
130
|
|
|
130
131
|
_this.close();
|
|
132
|
+
};
|
|
131
133
|
|
|
132
|
-
|
|
134
|
+
this.regist = function (type, component) {
|
|
135
|
+
_this.typeMap[type] = component;
|
|
133
136
|
};
|
|
134
137
|
}
|
|
135
138
|
|
|
136
139
|
_createClass(DrawerManager, [{
|
|
137
|
-
key: "regist",
|
|
138
|
-
value: function regist(type, component) {
|
|
139
|
-
typeMap[type] = component;
|
|
140
|
-
}
|
|
141
|
-
}, {
|
|
142
140
|
key: "drawer",
|
|
143
141
|
get: function get() {
|
|
144
142
|
var _this2 = this;
|