@titaui/pc 1.11.43 → 1.11.46
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/name-avatar/index.css +1 -0
- package/lib/components/avatar/name-avatar/index.js +22 -13
- package/lib/components/button/rect-btn/index.css +45 -11
- package/lib/components/button/rect-btn/index.js +12 -6
- package/lib/components/change-okr-modal/index.js +2 -1
- package/lib/components/checkbox/index.css +3 -3
- package/lib/components/create-okr-modal/index.js +45 -41
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/dialog-confirm/index.css +2 -2
- package/lib/components/drawer/headerAction.js +5 -1
- package/lib/components/drawer/headerDrop.js +42 -4
- package/lib/components/drawer/index.css +33 -0
- package/lib/components/drawer/index.js +26 -3
- package/lib/components/dynamic/new-ui.css +4 -4
- package/lib/components/dynamic/online-broadcast/data.js +6 -0
- package/lib/components/mblog/components/MblogContent.js +5 -2
- package/lib/components/nav-top/components/user-message/components/todos/index.css +1 -0
- package/lib/components/nav-top/index.js +6 -2
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +20 -4
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +9 -1
- package/lib/components/okr-detail/components/header/index.js +10 -3
- package/lib/components/okr-detail/components/header/o-name.js +10 -3
- package/lib/components/okr-detail/components/o-classify.js +5 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +13 -14
- package/lib/components/okr-detail/detail-header/constant.js +53 -0
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +111 -54
- package/lib/components/okr-detail/detail-header/delete-confirm/index.css +59 -0
- package/lib/components/okr-detail/detail-header/index.css +11 -0
- package/lib/components/okr-detail/detail-header/index.js +228 -234
- package/lib/components/okr-detail/helper.js +108 -0
- package/lib/components/okr-detail/index.js +21 -4
- package/lib/components/okr-detail/okr-list/index.js +8 -3
- package/lib/components/okr-detail/request-apis.js +14 -8
- package/lib/components/okr-period-selector/index.js +9 -5
- package/lib/components/okr-period-selector/select-cycle.js +23 -19
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/operation-records/style.js +1 -1
- package/lib/components/task-relation-modal/index.js +0 -1
- package/lib/components/task-relation-modal/request-api.js +2 -1
- package/lib/components/textarea/index.css +142 -0
- package/lib/components/textarea/index.js +259 -0
- package/lib/components/toast/index.js +5 -3
- package/lib/index.js +40 -0
- package/lib/pages/new-okr-list/header/common.js +52 -0
- package/lib/pages/new-okr-list/header/index.css +45 -0
- package/lib/pages/new-okr-list/header/index.js +40 -16
- package/lib/pages/new-okr-list/header/operate-record.js +136 -0
- package/lib/pages/new-okr-list/index.js +4 -2
- package/lib/pages/new-okr-list/list/index.js +19 -2
- package/lib/pages/new-okr-list/request-api.js +8 -2
- package/lib/pages/okr-map/unsupport-ie/index.js +3 -5
- package/lib/utils/format-time.js +8 -1
- package/lib/utils/open-data.js +5 -1
- package/package.json +1 -1
- package/lib/components/okr-detail/detail-header/delete-confirm/style.js +0 -38
|
@@ -9,6 +9,8 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
+
var _helper = require("../okr-detail/helper");
|
|
13
|
+
|
|
12
14
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -44,7 +46,9 @@ var HeaderDropItem = function HeaderDropItem(_ref) {
|
|
|
44
46
|
colorInDrop = _ref.colorInDrop,
|
|
45
47
|
hoverColorInDrop = _ref.hoverColorInDrop,
|
|
46
48
|
_onClick = _ref.onClick,
|
|
47
|
-
onClose = _ref.onClose
|
|
49
|
+
onClose = _ref.onClose,
|
|
50
|
+
approvalSetting = _ref.approvalSetting,
|
|
51
|
+
detailInfo = _ref.detailInfo;
|
|
48
52
|
|
|
49
53
|
var _useState = (0, _react.useState)(false),
|
|
50
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -52,7 +56,37 @@ var HeaderDropItem = function HeaderDropItem(_ref) {
|
|
|
52
56
|
setHover = _useState2[1];
|
|
53
57
|
|
|
54
58
|
var hasIcon = !!icon && typeof icon === "string";
|
|
55
|
-
|
|
59
|
+
var applyState = detailInfo === null || detailInfo === void 0 ? void 0 : detailInfo.applyState;
|
|
60
|
+
var OkrAndKrApprovalTypes = detailInfo === null || detailInfo === void 0 ? void 0 : detailInfo.OkrAndKrApprovalTypes;
|
|
61
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, icon === 'tu-icon-del' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (0, _helper.getApprovalOkr)(approvalSetting, 'deleteOkr', applyState, OkrAndKrApprovalTypes) ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
62
|
+
className: "header-drop-item",
|
|
63
|
+
style: {
|
|
64
|
+
color: hover ? hoverColorInDrop || hoverColor : colorInDrop || color
|
|
65
|
+
},
|
|
66
|
+
onClick: function onClick(e) {
|
|
67
|
+
_onClick && _onClick(e);
|
|
68
|
+
onClose(false);
|
|
69
|
+
},
|
|
70
|
+
onMouseOver: function onMouseOver() {
|
|
71
|
+
return setHover(true);
|
|
72
|
+
},
|
|
73
|
+
onMouseOut: function onMouseOut() {
|
|
74
|
+
return setHover(false);
|
|
75
|
+
}
|
|
76
|
+
}, hasIcon && /*#__PURE__*/_react["default"].createElement("div", {
|
|
77
|
+
className: "header-drop-item-icon",
|
|
78
|
+
style: {
|
|
79
|
+
color: hover ? hoverIconColorInDrop || hoverColorInDrop || hoverColor : iconColorInDrop || colorInDrop || color
|
|
80
|
+
}
|
|
81
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
82
|
+
className: icon
|
|
83
|
+
}) : icon), title) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
84
|
+
className: "header-drop-item-approval"
|
|
85
|
+
}, hasIcon && /*#__PURE__*/_react["default"].createElement("div", {
|
|
86
|
+
className: "header-drop-item-icon"
|
|
87
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
88
|
+
className: icon
|
|
89
|
+
}) : icon), title)) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
56
90
|
className: "header-drop-item",
|
|
57
91
|
style: {
|
|
58
92
|
color: hover ? hoverColorInDrop || hoverColor : colorInDrop || color
|
|
@@ -74,19 +108,23 @@ var HeaderDropItem = function HeaderDropItem(_ref) {
|
|
|
74
108
|
}
|
|
75
109
|
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
76
110
|
className: icon
|
|
77
|
-
}) : icon), title);
|
|
111
|
+
}) : icon), title));
|
|
78
112
|
};
|
|
79
113
|
|
|
80
114
|
var HeaderDrop = function HeaderDrop(_ref2) {
|
|
81
115
|
var visible = _ref2.visible,
|
|
82
116
|
onVisibleChange = _ref2.onVisibleChange,
|
|
83
117
|
items = _ref2.items,
|
|
84
|
-
children = _ref2.children
|
|
118
|
+
children = _ref2.children,
|
|
119
|
+
approvalSetting = _ref2.approvalSetting,
|
|
120
|
+
detailInfo = _ref2.detailInfo;
|
|
85
121
|
var renderDrop = (0, _react.useMemo)(function () {
|
|
86
122
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
87
123
|
className: "titaui-drawer-header-action-drop-wrapper"
|
|
88
124
|
}, items.map(function (item) {
|
|
89
125
|
return /*#__PURE__*/_react["default"].createElement(HeaderDropItem, _extends({}, item, {
|
|
126
|
+
detailInfo: detailInfo,
|
|
127
|
+
approvalSetting: approvalSetting,
|
|
90
128
|
onClose: function onClose() {
|
|
91
129
|
return onVisibleChange(false);
|
|
92
130
|
}
|
|
@@ -164,6 +164,39 @@
|
|
|
164
164
|
background-repeat: no-repeat;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
.titaui-drawer-header-action-drop-wrapper .header-drop-item-approval {
|
|
168
|
+
height: 32px;
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
padding: 0 23px;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
color: #BFC7D5;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.titaui-drawer-header-action-drop-wrapper .header-drop-item-approval-icon {
|
|
177
|
+
font-size: 18px;
|
|
178
|
+
color: inherit;
|
|
179
|
+
width: 18px;
|
|
180
|
+
height: 18px;
|
|
181
|
+
cursor: pointer;
|
|
182
|
+
margin-right: 10px;
|
|
183
|
+
background-size: contain;
|
|
184
|
+
background-position: center center;
|
|
185
|
+
background-repeat: no-repeat;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.titaui-drawer-header-action-drop-wrapper .header-drop-item-approval-icon > span {
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
color: inherit;
|
|
193
|
+
width: 18px;
|
|
194
|
+
height: 18px;
|
|
195
|
+
background-size: contain;
|
|
196
|
+
background-position: center center;
|
|
197
|
+
background-repeat: no-repeat;
|
|
198
|
+
}
|
|
199
|
+
|
|
167
200
|
.drawer-left .drawer-content-wrapper,
|
|
168
201
|
.drawer-right .drawer-content-wrapper,
|
|
169
202
|
.drawer-left .drawer-content,
|
|
@@ -25,7 +25,9 @@ require("./index.css");
|
|
|
25
25
|
|
|
26
26
|
var _context = _interopRequireDefault(require("../drawer-manager/context"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _dom = require("./utils/dom");
|
|
29
|
+
|
|
30
|
+
var _excluded = ["visible", "placement", "children", "mask", "width", "className", "contentWrapperStyle", "onClose", "style", "afterVisibleChange", "destroyOnClose", "bodyStyle", "zIndex", "autoClosable"];
|
|
29
31
|
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
33
|
|
|
@@ -70,6 +72,8 @@ var Drawer = function Drawer(props) {
|
|
|
70
72
|
bodyStyle = props.bodyStyle,
|
|
71
73
|
_props$zIndex = props.zIndex,
|
|
72
74
|
zIndex = _props$zIndex === void 0 ? 1200 : _props$zIndex,
|
|
75
|
+
_props$autoClosable = props.autoClosable,
|
|
76
|
+
autoClosable = _props$autoClosable === void 0 ? false : _props$autoClosable,
|
|
73
77
|
rest = _objectWithoutProperties(props, _excluded);
|
|
74
78
|
|
|
75
79
|
var handleAfterVisibleChange = (0, _react.useCallback)(function (opened) {
|
|
@@ -89,6 +93,20 @@ var Drawer = function Drawer(props) {
|
|
|
89
93
|
return children;
|
|
90
94
|
}
|
|
91
95
|
|
|
96
|
+
var autoClose = function autoClose(e) {
|
|
97
|
+
if ((0, _dom.hasAncestorElement)(e.target, 'document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add')) return;
|
|
98
|
+
onClose();
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
(0, _react.useEffect)(function () {
|
|
102
|
+
if (autoClosable) {
|
|
103
|
+
document.addEventListener('mousedown', autoClose);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return function () {
|
|
107
|
+
document.removeEventListener('mousedown', autoClose);
|
|
108
|
+
};
|
|
109
|
+
}, []);
|
|
92
110
|
return /*#__PURE__*/_react["default"].createElement(DrawerContext.Provider, {
|
|
93
111
|
value: {
|
|
94
112
|
close: function close() {
|
|
@@ -123,7 +141,10 @@ function DrawerHeader(_ref) {
|
|
|
123
141
|
content = _ref.content,
|
|
124
142
|
style = _ref.style,
|
|
125
143
|
onClose = _ref.onClose,
|
|
126
|
-
actionComponent = _ref.actionComponent
|
|
144
|
+
actionComponent = _ref.actionComponent,
|
|
145
|
+
onlyShowContent = _ref.onlyShowContent,
|
|
146
|
+
approvalSetting = _ref.approvalSetting,
|
|
147
|
+
detailInfo = _ref.detailInfo;
|
|
127
148
|
var drawer = (0, _react.useContext)(DrawerContext);
|
|
128
149
|
var manager = (0, _react.useContext)(_context["default"]);
|
|
129
150
|
var showClose = closable && (!!onClose || !!drawer);
|
|
@@ -152,9 +173,11 @@ function DrawerHeader(_ref) {
|
|
|
152
173
|
style: {
|
|
153
174
|
flex: 1
|
|
154
175
|
}
|
|
155
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
|
|
176
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, onlyShowContent), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
|
|
156
177
|
return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
|
|
157
178
|
}), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
|
|
179
|
+
approvalSetting: approvalSetting,
|
|
180
|
+
detailInfo: detailInfo,
|
|
158
181
|
title: (0, _getLocale.getLocale)('Mod_MoreOperate'),
|
|
159
182
|
icon: "tu-icon-10",
|
|
160
183
|
children: collapsedActions
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.titaui-new-ui-dynamic__no-more-data::before {
|
|
132
|
-
content:
|
|
132
|
+
content: '';
|
|
133
133
|
display: inline-block;
|
|
134
134
|
margin-right: 12px;
|
|
135
135
|
width: 192px;
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
.titaui-new-ui-dynamic__no-more-data::after {
|
|
142
|
-
content:
|
|
142
|
+
content: '';
|
|
143
143
|
display: inline-block;
|
|
144
144
|
margin-left: 12px;
|
|
145
145
|
width: 192px;
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
|
|
151
151
|
.titaui-new-ui-dynamic__go-to-top {
|
|
152
152
|
position: fixed;
|
|
153
|
-
bottom:
|
|
154
|
-
right:
|
|
153
|
+
bottom: 20px;
|
|
154
|
+
right: 86px;
|
|
155
155
|
display: flex;
|
|
156
156
|
align-items: center;
|
|
157
157
|
justify-content: center;
|
|
@@ -18,6 +18,12 @@ exports.onlineBroadcastData = exports["default"] = void 0;
|
|
|
18
18
|
// href = "https://wiki.tita.com/pages/viewpage.action?pageId=15697741";
|
|
19
19
|
// }
|
|
20
20
|
var onlineBroadcastData = [{
|
|
21
|
+
hasOnline: true,
|
|
22
|
+
preContent: "「OKR」支持上级审批,管理更规范",
|
|
23
|
+
preHref: "https://wiki.tita.com/x/F4SeAQ",
|
|
24
|
+
isNew: true,
|
|
25
|
+
date: "5/05"
|
|
26
|
+
}, {
|
|
21
27
|
hasOnline: true,
|
|
22
28
|
preContent: "「考核」更多位置支持离职人员筛选啦",
|
|
23
29
|
preHref: "https://wiki.tita.com/x/pwDQAQ",
|
|
@@ -208,14 +208,16 @@ var MblogContent = /*#__PURE__*/function (_PureComponent) {
|
|
|
208
208
|
style: {
|
|
209
209
|
opacity: isFocus ? "0.8" : "1"
|
|
210
210
|
}
|
|
211
|
-
}, placeholderText)), /*#__PURE__*/_react["default"].createElement(_style.TextareaWrapper,
|
|
211
|
+
}, placeholderText)), /*#__PURE__*/_react["default"].createElement(_style.TextareaWrapper, {
|
|
212
|
+
className: "textarea-wrap"
|
|
213
|
+
}, /*#__PURE__*/_react["default"].createElement(_style.Textarea, {
|
|
212
214
|
ref: "textareaSetHeight",
|
|
213
215
|
value: textareaValue,
|
|
214
216
|
onChange: function onChange() {},
|
|
215
217
|
className: "textarea-setheight"
|
|
216
218
|
}), /*#__PURE__*/_react["default"].createElement(_style.Textarea, {
|
|
217
219
|
ref: "textareaInput",
|
|
218
|
-
className: "".concat(visibility === 1 ? "" : "private__bg"),
|
|
220
|
+
className: "textarea-details ".concat(visibility === 1 ? "" : "private__bg"),
|
|
219
221
|
value: textareaValue,
|
|
220
222
|
onFocus: this._handlerFocus,
|
|
221
223
|
onBlur: this._handlerBlur,
|
|
@@ -224,6 +226,7 @@ var MblogContent = /*#__PURE__*/function (_PureComponent) {
|
|
|
224
226
|
onPaste: this._handlerPaste,
|
|
225
227
|
onChange: this._handleInputChange
|
|
226
228
|
})), /*#__PURE__*/_react["default"].createElement(_style.Tips, {
|
|
229
|
+
className: "textarea-tips",
|
|
227
230
|
onMouseDown: this._handlerTipsLabelClick,
|
|
228
231
|
color: maxLength && textareaValueLen > maxLength ? "#EB4447" : textareaValueLen > 0 ? "#2879ff" : "#BFC3C7"
|
|
229
232
|
}, textareaValueLen, "/", maxLength));
|
|
@@ -15,6 +15,8 @@ var _bsGlobal = require("../../utils/bs-global");
|
|
|
15
15
|
|
|
16
16
|
var _userOwnMenu = _interopRequireDefault(require("./components/user-own-menu"));
|
|
17
17
|
|
|
18
|
+
var _useGlobalValue = _interopRequireDefault(require("./useGlobalValue"));
|
|
19
|
+
|
|
18
20
|
var _menu = _interopRequireDefault(require("./components/menu"));
|
|
19
21
|
|
|
20
22
|
var _userMessage = _interopRequireDefault(require("./components/user-message"));
|
|
@@ -170,5 +172,7 @@ var NavTop = function NavTop() {
|
|
|
170
172
|
}, /*#__PURE__*/_react["default"].createElement(_userOwnMenu["default"], null)));
|
|
171
173
|
};
|
|
172
174
|
|
|
173
|
-
var _default = NavTop;
|
|
174
|
-
|
|
175
|
+
var _default = NavTop; // @ts-ignore
|
|
176
|
+
|
|
177
|
+
exports["default"] = _default;
|
|
178
|
+
NavTop.useGlobalValue = _useGlobalValue["default"];
|
|
@@ -13,6 +13,10 @@ var _okrPeriodSelector = _interopRequireDefault(require("../../../../okr-period-
|
|
|
13
13
|
|
|
14
14
|
var _getLocale = require("../../../../../utils/getLocale");
|
|
15
15
|
|
|
16
|
+
var _context = require("../../../context");
|
|
17
|
+
|
|
18
|
+
var _helper = require("../../../helper");
|
|
19
|
+
|
|
16
20
|
require("./index.css");
|
|
17
21
|
|
|
18
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -40,14 +44,22 @@ var DateCycle = function DateCycle(_ref) {
|
|
|
40
44
|
_ref$canEdit = _ref.canEdit,
|
|
41
45
|
canEdit = _ref$canEdit === void 0 ? false : _ref$canEdit;
|
|
42
46
|
|
|
47
|
+
var _useContext = (0, _react.useContext)(_context.CommonContext),
|
|
48
|
+
okrInfo = _useContext.okrInfo,
|
|
49
|
+
approvalSetting = _useContext.approvalSetting;
|
|
50
|
+
|
|
51
|
+
var canCycleEdit = canEdit && (0, _helper.getApprovalOkr)(approvalSetting, "changeOkrTime", okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes);
|
|
52
|
+
|
|
43
53
|
var _useState = (0, _react.useState)(false),
|
|
44
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
55
|
isFocus = _useState2[0],
|
|
46
56
|
setIsFocus = _useState2[1];
|
|
47
57
|
|
|
48
58
|
var handleButtonFocus = (0, _react.useCallback)(function () {
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
if (canCycleEdit) {
|
|
60
|
+
setIsFocus(true);
|
|
61
|
+
}
|
|
62
|
+
}, [canCycleEdit]);
|
|
51
63
|
var handleButtonBlur = (0, _react.useCallback)(function () {
|
|
52
64
|
setIsFocus(false);
|
|
53
65
|
}, []);
|
|
@@ -57,9 +69,10 @@ var DateCycle = function DateCycle(_ref) {
|
|
|
57
69
|
clickCallback = _ref2.clickCallback,
|
|
58
70
|
text = _ref2.text;
|
|
59
71
|
return /*#__PURE__*/_react["default"].createElement("button", {
|
|
72
|
+
type: "button",
|
|
60
73
|
onFocus: handleButtonFocus,
|
|
61
74
|
onBlur: handleButtonBlur,
|
|
62
|
-
className: "base-info-date-cycle__button ".concat(isFocus ? "base-info-date-cycle__button--focus" : "", " ").concat(!
|
|
75
|
+
className: "base-info-date-cycle__button ".concat(isFocus ? "base-info-date-cycle__button--focus" : "", " ").concat(!canCycleEdit && "base-info-date-cycle__button--disable"),
|
|
63
76
|
ref: btnRef,
|
|
64
77
|
onClick: clickCallback
|
|
65
78
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -78,10 +91,13 @@ var DateCycle = function DateCycle(_ref) {
|
|
|
78
91
|
cycle: cycle,
|
|
79
92
|
setCycle: setCycle,
|
|
80
93
|
okrId: okrId,
|
|
81
|
-
canEdit:
|
|
94
|
+
canEdit: canCycleEdit,
|
|
82
95
|
getCycleRange: true
|
|
83
96
|
}));
|
|
84
97
|
};
|
|
85
98
|
|
|
99
|
+
DateCycle.defaultProps = {
|
|
100
|
+
canEdit: false
|
|
101
|
+
};
|
|
86
102
|
var _default = DateCycle;
|
|
87
103
|
exports["default"] = _default;
|
|
@@ -21,6 +21,10 @@ var _popConfirm = _interopRequireDefault(require("../../../../../components-v1/p
|
|
|
21
21
|
|
|
22
22
|
var _getLocale = require("../../../../../utils/getLocale");
|
|
23
23
|
|
|
24
|
+
var _context2 = require("../../../context");
|
|
25
|
+
|
|
26
|
+
var _helper = require("../../../helper");
|
|
27
|
+
|
|
24
28
|
require("./index.css");
|
|
25
29
|
|
|
26
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -60,6 +64,10 @@ var Principal = function Principal(_ref) {
|
|
|
60
64
|
selectUser = _useState2[0],
|
|
61
65
|
setSelectUser = _useState2[1];
|
|
62
66
|
|
|
67
|
+
var _useContext = (0, _react.useContext)(_context2.CommonContext),
|
|
68
|
+
okrInfo = _useContext.okrInfo,
|
|
69
|
+
approvalSetting = _useContext.approvalSetting;
|
|
70
|
+
|
|
63
71
|
var handleSelected = function handleSelected(_ref2) {
|
|
64
72
|
var _ref3 = _slicedToArray(_ref2, 1),
|
|
65
73
|
user = _ref3[0];
|
|
@@ -114,7 +122,7 @@ var Principal = function Principal(_ref) {
|
|
|
114
122
|
}, (0, _getLocale.getLocale)("Mod_Owner")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
123
|
className: "base-info-other-infos__principal-user",
|
|
116
124
|
ref: selectUserRef
|
|
117
|
-
}, canEdit ? /*#__PURE__*/_react["default"].createElement(_popConfirm["default"], {
|
|
125
|
+
}, canEdit && (0, _helper.getApprovalOkr)(approvalSetting, "changeOkrName", okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes) ? /*#__PURE__*/_react["default"].createElement(_popConfirm["default"], {
|
|
118
126
|
ref: popConfirmRef,
|
|
119
127
|
showArrow: false,
|
|
120
128
|
style: {
|
|
@@ -31,6 +31,8 @@ var _progress = _interopRequireDefault(require("../../../progress"));
|
|
|
31
31
|
|
|
32
32
|
var _utils = require("../../../progress/utils");
|
|
33
33
|
|
|
34
|
+
var _helper = require("../../helper");
|
|
35
|
+
|
|
34
36
|
var _tooltip = _interopRequireDefault(require("../../../tooltip"));
|
|
35
37
|
|
|
36
38
|
var _auth = require("../../../../utils/auth");
|
|
@@ -85,6 +87,8 @@ function Header(props) {
|
|
|
85
87
|
setGeneralOkrClassify = _useContext.setGeneralOkrClassify,
|
|
86
88
|
showOkrEvalute = _useContext.showOkrEvalute;
|
|
87
89
|
|
|
90
|
+
var commonContext = (0, _react.useContext)(_context.CommonContext);
|
|
91
|
+
var approvalSetting = commonContext.approvalSetting;
|
|
88
92
|
var showOScore = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$OkrA = _window$BSGlobal.OkrAdvancedSetting) === null || _window$BSGlobal$OkrA === void 0 ? void 0 : (_window$BSGlobal$OkrA2 = _window$BSGlobal$OkrA.KRSetting) === null || _window$BSGlobal$OkrA2 === void 0 ? void 0 : _window$BSGlobal$OkrA2.OScore;
|
|
89
93
|
var _okrInfo$progressGrow = okrInfo.progressGrow,
|
|
90
94
|
progressGrow = _okrInfo$progressGrow === void 0 ? 0 : _okrInfo$progressGrow,
|
|
@@ -156,7 +160,7 @@ function Header(props) {
|
|
|
156
160
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
157
161
|
className: "".concat(precls, "__avatar")
|
|
158
162
|
}, /*#__PURE__*/_react["default"].createElement(_oAvatar["default"], {
|
|
159
|
-
editable: editable,
|
|
163
|
+
editable: editable && (okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState) !== 1,
|
|
160
164
|
okrId: okrInfo.workId
|
|
161
165
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
162
166
|
className: "".concat(precls, "__content")
|
|
@@ -164,7 +168,10 @@ function Header(props) {
|
|
|
164
168
|
editable: editable,
|
|
165
169
|
okrName: okrName,
|
|
166
170
|
setIsEdit: setIsEdit,
|
|
167
|
-
okrStatus: okrInfo.status
|
|
171
|
+
okrStatus: okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.status,
|
|
172
|
+
OkrAndKrApprovalTypes: okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes,
|
|
173
|
+
applyState: okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState,
|
|
174
|
+
approvalSetting: approvalSetting
|
|
168
175
|
}, /*#__PURE__*/_react["default"].createElement(_oClassify["default"], {
|
|
169
176
|
editable: editable,
|
|
170
177
|
okrId: okrInfo.workId,
|
|
@@ -187,7 +194,7 @@ function Header(props) {
|
|
|
187
194
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
188
195
|
className: "".concat(precls, "__action-item")
|
|
189
196
|
}, /*#__PURE__*/_react["default"].createElement(_oCycle["default"], {
|
|
190
|
-
editable: editable,
|
|
197
|
+
editable: editable && (0, _helper.getApprovalOkr)(approvalSetting, "changeOkrTime", okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes),
|
|
191
198
|
okrId: okrInfo.workId
|
|
192
199
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
193
200
|
className: "".concat(precls, "__action-item")
|
|
@@ -13,6 +13,8 @@ var _getLocale = require("../../../../utils/getLocale");
|
|
|
13
13
|
|
|
14
14
|
var _tools = require("../../../../utils/tools");
|
|
15
15
|
|
|
16
|
+
var _helper = require("../../helper");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
19
|
|
|
18
20
|
function OName(props) {
|
|
@@ -20,11 +22,16 @@ function OName(props) {
|
|
|
20
22
|
okrName = props.okrName,
|
|
21
23
|
setIsEdit = props.setIsEdit,
|
|
22
24
|
okrStatus = props.okrStatus,
|
|
23
|
-
children = props.children
|
|
25
|
+
children = props.children,
|
|
26
|
+
approvalSetting = props.approvalSetting,
|
|
27
|
+
applyState = props.applyState,
|
|
28
|
+
OkrAndKrApprovalTypes = props.OkrAndKrApprovalTypes;
|
|
24
29
|
|
|
25
30
|
var handleEditClick = function handleEditClick() {
|
|
26
|
-
if (
|
|
27
|
-
|
|
31
|
+
if ((0, _helper.getApprovalOkr)(approvalSetting, "changeOkrName", applyState, OkrAndKrApprovalTypes)) {
|
|
32
|
+
if (editable) {
|
|
33
|
+
setIsEdit(true);
|
|
34
|
+
}
|
|
28
35
|
}
|
|
29
36
|
};
|
|
30
37
|
|
|
@@ -47,6 +47,8 @@ var _EditKrWightModal = _interopRequireDefault(require("../../../../../edit-kr-w
|
|
|
47
47
|
|
|
48
48
|
var _okrProgressModal = _interopRequireDefault(require("../../../../../okr-progress-modal"));
|
|
49
49
|
|
|
50
|
+
var _helper = require("../../../../helper");
|
|
51
|
+
|
|
50
52
|
var _getLocale = require("../../../../../../utils/getLocale");
|
|
51
53
|
|
|
52
54
|
require("./index.css");
|
|
@@ -99,7 +101,8 @@ function _default(props) {
|
|
|
99
101
|
|
|
100
102
|
var _useContext = (0, _react.useContext)(_context2.CommonContext),
|
|
101
103
|
refreshAll = _useContext.refreshAll,
|
|
102
|
-
okrInfo = _useContext.okrInfo
|
|
104
|
+
okrInfo = _useContext.okrInfo,
|
|
105
|
+
approvalSetting = _useContext.approvalSetting;
|
|
103
106
|
|
|
104
107
|
var _useState = (0, _react.useState)(data.confidenceIndex),
|
|
105
108
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -220,17 +223,13 @@ function _default(props) {
|
|
|
220
223
|
updateProgressWay: updateProgressWay
|
|
221
224
|
}).then(function (res) {
|
|
222
225
|
if (res.Code == 1) {
|
|
223
|
-
_toast["default"].Success("
|
|
224
|
-
top: 60
|
|
225
|
-
});
|
|
226
|
+
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"));
|
|
226
227
|
|
|
227
228
|
refreshAll();
|
|
228
229
|
updateKrs();
|
|
229
230
|
setKrModalVsible(false);
|
|
230
231
|
} else {
|
|
231
|
-
_toast["default"].Error(res.Message
|
|
232
|
-
top: 60
|
|
233
|
-
});
|
|
232
|
+
_toast["default"].Error(res.Message);
|
|
234
233
|
}
|
|
235
234
|
});
|
|
236
235
|
};
|
|
@@ -252,7 +251,7 @@ function _default(props) {
|
|
|
252
251
|
setDeleteModalVisible(false);
|
|
253
252
|
|
|
254
253
|
if (!Message) {
|
|
255
|
-
_toast["default"].Success((0, _getLocale.getLocale)("
|
|
254
|
+
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"));
|
|
256
255
|
|
|
257
256
|
setTimeout(function () {
|
|
258
257
|
refreshAll();
|
|
@@ -281,7 +280,7 @@ function _default(props) {
|
|
|
281
280
|
workId: data.workId,
|
|
282
281
|
workMileStoneId: data.mileStoneId
|
|
283
282
|
}).then(function () {
|
|
284
|
-
_toast["default"].Success("
|
|
283
|
+
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"));
|
|
285
284
|
});
|
|
286
285
|
};
|
|
287
286
|
|
|
@@ -316,7 +315,7 @@ function _default(props) {
|
|
|
316
315
|
}, "KR", index + 1), /*#__PURE__*/_react["default"].createElement("span", {
|
|
317
316
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-title"))
|
|
318
317
|
}, /*#__PURE__*/_react["default"].createElement(_editableInput["default"], {
|
|
319
|
-
editable: krCanEdit,
|
|
318
|
+
editable: krCanEdit && (0, _helper.getApprovalKr)(approvalSetting, "changeOkrName", okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes, data === null || data === void 0 ? void 0 : data.KrApprovalTypes),
|
|
320
319
|
defaultValue: krName,
|
|
321
320
|
emptyMessage: "KR\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",
|
|
322
321
|
onKeyDown: onKrNameChangeHandler,
|
|
@@ -330,10 +329,10 @@ function _default(props) {
|
|
|
330
329
|
name: user.name,
|
|
331
330
|
id: user.userId,
|
|
332
331
|
width: 68,
|
|
333
|
-
editable: krCanEdit,
|
|
332
|
+
editable: krCanEdit && okrInfo.applyState !== _helper.EApproveStatus.UnderApproval,
|
|
334
333
|
onEditUser: onEditUserHandler,
|
|
335
334
|
nameTips: function nameTips(name) {
|
|
336
|
-
return /*#__PURE__*/_react["default"].createElement("span", null,
|
|
335
|
+
return /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_Text_Owner'), name);
|
|
337
336
|
}
|
|
338
337
|
})), showKrWeight && /*#__PURE__*/_react["default"].createElement(OkrRowColumn, {
|
|
339
338
|
width: 60,
|
|
@@ -349,7 +348,7 @@ function _default(props) {
|
|
|
349
348
|
marginLeft: 16
|
|
350
349
|
}, /*#__PURE__*/_react["default"].createElement(_rangePickerPop["default"], {
|
|
351
350
|
data: data,
|
|
352
|
-
editable: krCanEdit
|
|
351
|
+
editable: krCanEdit && (0, _helper.getApprovalKr)(approvalSetting, "changeOkrTime", okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes, data === null || data === void 0 ? void 0 : data.KrApprovalTypes)
|
|
353
352
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
354
353
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-actions"))
|
|
355
354
|
}, showHeart && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -378,7 +377,7 @@ function _default(props) {
|
|
|
378
377
|
evaluateValue: evaluateValue,
|
|
379
378
|
setEvaluateValue: onEvaluateChangeHanler,
|
|
380
379
|
isEvaluate: isEvaluate
|
|
381
|
-
})), krCanEdit && /*#__PURE__*/_react["default"].createElement("div", {
|
|
380
|
+
})), krCanEdit && okrInfo.applyState !== _helper.EApproveStatus.UnderApproval && /*#__PURE__*/_react["default"].createElement("div", {
|
|
382
381
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-delete")),
|
|
383
382
|
onClick: function onClick() {
|
|
384
383
|
return setDeleteModalVisible(true);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getApproveStatusTextMap = exports.ApproveStatusColor = exports.ApproveStatus = void 0;
|
|
7
|
+
|
|
8
|
+
var _getLocale = require("../../../utils/getLocale");
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
var ApproveStatus;
|
|
13
|
+
exports.ApproveStatus = ApproveStatus;
|
|
14
|
+
|
|
15
|
+
(function (ApproveStatus) {
|
|
16
|
+
ApproveStatus[ApproveStatus["None"] = 0] = "None";
|
|
17
|
+
ApproveStatus[ApproveStatus["WaitCommit"] = 6] = "WaitCommit";
|
|
18
|
+
ApproveStatus[ApproveStatus["Rejected"] = 3] = "Rejected";
|
|
19
|
+
ApproveStatus[ApproveStatus["UnderApproval"] = 1] = "UnderApproval";
|
|
20
|
+
ApproveStatus[ApproveStatus["ApproveAgree"] = 2] = "ApproveAgree";
|
|
21
|
+
ApproveStatus[ApproveStatus["WithDraw"] = 4] = "WithDraw";
|
|
22
|
+
ApproveStatus[ApproveStatus["Done"] = 5] = "Done";
|
|
23
|
+
})(ApproveStatus || (exports.ApproveStatus = ApproveStatus = {}));
|
|
24
|
+
|
|
25
|
+
var getApproveStatusTextMap = function getApproveStatusTextMap(status) {
|
|
26
|
+
var _ApproveStatusTextMap;
|
|
27
|
+
|
|
28
|
+
var ApproveStatusTextMap = (_ApproveStatusTextMap = {}, _defineProperty(_ApproveStatusTextMap, ApproveStatus.WaitCommit, (0, _getLocale.getLocale)('OKR_MyO_Tobesubmitted')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.Rejected, (0, _getLocale.getLocale)('OKR_MyO_Tobesubmitted')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.UnderApproval, (0, _getLocale.getLocale)('Pro_detail_Approval')), _defineProperty(_ApproveStatusTextMap, ApproveStatus.ApproveAgree, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.WithDraw, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.None, ''), _defineProperty(_ApproveStatusTextMap, ApproveStatus.Done, ''), _ApproveStatusTextMap);
|
|
29
|
+
return ApproveStatusTextMap[status];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.getApproveStatusTextMap = getApproveStatusTextMap;
|
|
33
|
+
|
|
34
|
+
var ApproveStatusColor = function ApproveStatusColor(status) {
|
|
35
|
+
var _ApprovalStatusColorM;
|
|
36
|
+
|
|
37
|
+
var ApprovalStatusColorMap = (_ApprovalStatusColorM = {}, _defineProperty(_ApprovalStatusColorM, ApproveStatus.WaitCommit, {
|
|
38
|
+
color: '#F0A326',
|
|
39
|
+
bgColor: 'rgba(240, 163, 38, 0.1)'
|
|
40
|
+
}), _defineProperty(_ApprovalStatusColorM, ApproveStatus.Rejected, {
|
|
41
|
+
color: '#F0A326',
|
|
42
|
+
bgColor: 'rgba(240, 163, 38, 0.1)'
|
|
43
|
+
}), _defineProperty(_ApprovalStatusColorM, ApproveStatus.UnderApproval, {
|
|
44
|
+
color: '#2879FF',
|
|
45
|
+
bgColor: 'rgba(40, 121, 255, 0.1)'
|
|
46
|
+
}), _defineProperty(_ApprovalStatusColorM, ApproveStatus.ApproveAgree, {
|
|
47
|
+
color: '#ffffff',
|
|
48
|
+
bgColor: '#ffffff'
|
|
49
|
+
}), _ApprovalStatusColorM);
|
|
50
|
+
return ApprovalStatusColorMap[status];
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.ApproveStatusColor = ApproveStatusColor;
|