@titaui/pc 1.12.7 → 1.12.8
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/change-okr-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
- package/lib/components/create-okr-modal/fields/index.css +14 -3
- package/lib/components/create-okr-modal/fields/o-new-name.js +31 -20
- package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
- package/lib/components/create-okr-modal/index.js +197 -132
- package/lib/components/create-okr-modal/kr-items/index.css +23 -13
- package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
- package/lib/components/create-okr-modal/kr-items/krItem.js +54 -57
- package/lib/components/create-okr-modal/style.js +5 -5
- package/lib/components/dynamic/components/title/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
- package/lib/components/eReport/eReportLists/reportList.js +29 -30
- package/lib/components/eReport/eReportShare/style.js +1 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
- package/lib/components/nav-top/components/menu/index.js +3 -3
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
- package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
- package/lib/components/okr-detail/components/ao-nice/index.css +0 -1
- package/lib/components/okr-detail/components/header/edit-name.js +76 -39
- package/lib/components/okr-detail/components/header/index.css +122 -41
- package/lib/components/okr-detail/components/header/index.js +45 -48
- package/lib/components/okr-detail/components/header/o-classify.js +154 -0
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/o-progress-update/index.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +174 -64
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
- package/lib/components/okr-detail/components/tab-panel-content/index.css +1 -0
- package/lib/components/okr-detail/detail-header/index.js +11 -5
- package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
- package/lib/components/okr-detail/okr-list/index.css +9 -0
- package/lib/components/okr-detail/okr-list/index.js +25 -25
- package/lib/components/okr-detail/request-apis.js +73 -69
- package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
- package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
- package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-flow/child-node/kr-node.js +3 -1
- package/lib/components/okr-flow/child-node/work-node.js +3 -1
- package/lib/components/okr-flow/export-modal/index.js +6 -6
- package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
- package/lib/components/okr-progress/components/o-progress/index.js +3 -1
- package/lib/components/okr-progress/components/o-progress-update/index.js +2 -2
- package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
- package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
- package/lib/components/okr-share/common-painter/utils.js +187 -36
- package/lib/components/okr-share/index.css +5 -4
- package/lib/components/okr-share/pink-card/card.js +3 -3
- package/lib/components/okr-share/pink-card/drawKrs.js +97 -18
- package/lib/components/okr-share/pink-card/index.js +20 -12
- package/lib/components/open-data-painter/index.js +6 -5
- package/lib/components/search-key-handle/index.js +12 -10
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +2 -2
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
- package/lib/components/upload/components/uploadedPreview.js +17 -17
- package/lib/components/upload/index.js +23 -23
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +14 -14
- package/lib/components/user-selector/searched-panel/index.js +4 -4
- package/lib/components/wechat-btn/index.css +5 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
- package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
- package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
- package/lib/pages/new-okr-list/header/index.js +15 -15
- package/lib/utils/hooks.js +5 -5
- package/lib/utils/open-data.js +216 -66
- package/lib/utils/tita-okr-cycle.js +3 -3
- package/package.json +2 -1
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _richEditor = require("@titaui/rich-editor");
|
|
15
|
+
|
|
14
16
|
var _toast = _interopRequireDefault(require("../../../toast"));
|
|
15
17
|
|
|
16
18
|
var _requestApis = require("../../request-apis");
|
|
@@ -31,6 +33,12 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
31
33
|
|
|
32
34
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
33
35
|
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
34
42
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
43
|
|
|
36
44
|
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."); }
|
|
@@ -43,25 +51,38 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
43
51
|
|
|
44
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
53
|
|
|
54
|
+
var prefixCls = 'okr-drawer-header__edit';
|
|
55
|
+
|
|
46
56
|
function EditNameCmp(props) {
|
|
47
|
-
var
|
|
57
|
+
var _classNames;
|
|
58
|
+
|
|
59
|
+
var editable = props.editable,
|
|
60
|
+
okrName = props.okrName,
|
|
48
61
|
okrId = props.okrId,
|
|
49
|
-
setIsEdit = props.setIsEdit,
|
|
50
62
|
setOkrName = props.setOkrName;
|
|
51
63
|
|
|
52
|
-
var _useState = (0, _react.useState)(
|
|
64
|
+
var _useState = (0, _react.useState)(false),
|
|
53
65
|
_useState2 = _slicedToArray(_useState, 2),
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
editing = _useState2[0],
|
|
67
|
+
setEditing = _useState2[1];
|
|
68
|
+
|
|
69
|
+
var _useState3 = (0, _react.useState)(''),
|
|
70
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
71
|
+
errorTip = _useState4[0],
|
|
72
|
+
setErrorTip = _useState4[1];
|
|
73
|
+
|
|
74
|
+
var _useState5 = (0, _react.useState)(_objectSpread(_objectSpread({}, okrName), {}, {
|
|
75
|
+
editorState: 'normal'
|
|
76
|
+
})),
|
|
77
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
78
|
+
okrNameData = _useState6[0],
|
|
79
|
+
setOkrNameData = _useState6[1];
|
|
56
80
|
|
|
57
|
-
var
|
|
58
|
-
(0, _react.useEffect)(function () {
|
|
59
|
-
inputRef.current.setSelectionRange(9999999, 9999999);
|
|
60
|
-
}, []);
|
|
81
|
+
var mentionInputRef = (0, _react.useRef)();
|
|
61
82
|
|
|
62
83
|
var checkError = function checkError(val) {
|
|
63
84
|
if (val.length == 0) {
|
|
64
|
-
setErrorTip((0, _getLocale.getLocale)(
|
|
85
|
+
setErrorTip((0, _getLocale.getLocale)('OKR_MyO_Pop_Targetname'));
|
|
65
86
|
return;
|
|
66
87
|
}
|
|
67
88
|
|
|
@@ -70,21 +91,33 @@ function EditNameCmp(props) {
|
|
|
70
91
|
return;
|
|
71
92
|
}
|
|
72
93
|
|
|
73
|
-
setErrorTip(
|
|
94
|
+
setErrorTip('');
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
var onChangeHandler = function onChangeHandler(data) {
|
|
98
|
+
setOkrNameData(function (prevData) {
|
|
99
|
+
return _objectSpread(_objectSpread({}, prevData), data);
|
|
100
|
+
});
|
|
101
|
+
checkError(data.pureTextExcludeAt);
|
|
74
102
|
};
|
|
75
103
|
|
|
76
|
-
var
|
|
77
|
-
|
|
104
|
+
var onFocusHandler = function onFocusHandler() {
|
|
105
|
+
return setEditing(true);
|
|
78
106
|
};
|
|
79
107
|
|
|
80
108
|
var cancelEditHandler = function cancelEditHandler() {
|
|
81
|
-
|
|
82
|
-
setErrorTip(
|
|
109
|
+
setEditing(false);
|
|
110
|
+
setErrorTip('');
|
|
111
|
+
setOkrNameData(function (prevData) {
|
|
112
|
+
return _objectSpread(_objectSpread({}, okrName), {}, {
|
|
113
|
+
editorState: prevData.editorState === 'normal' ? 'reset' : 'normal'
|
|
114
|
+
});
|
|
115
|
+
});
|
|
83
116
|
};
|
|
84
117
|
|
|
85
118
|
var confiremEditHandle = /*#__PURE__*/function () {
|
|
86
119
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
87
|
-
var
|
|
120
|
+
var mentionUsers, pureText, richText, data;
|
|
88
121
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
89
122
|
while (1) {
|
|
90
123
|
switch (_context.prev = _context.next) {
|
|
@@ -97,31 +130,35 @@ function EditNameCmp(props) {
|
|
|
97
130
|
return _context.abrupt("return");
|
|
98
131
|
|
|
99
132
|
case 2:
|
|
100
|
-
|
|
133
|
+
mentionUsers = okrNameData.mentionUsers, pureText = okrNameData.pureText, richText = okrNameData.richText;
|
|
101
134
|
|
|
102
|
-
if (!(okrName ==
|
|
135
|
+
if (!(okrName.pureText == pureText)) {
|
|
103
136
|
_context.next = 6;
|
|
104
137
|
break;
|
|
105
138
|
}
|
|
106
139
|
|
|
107
|
-
|
|
140
|
+
setEditing(false);
|
|
108
141
|
return _context.abrupt("return");
|
|
109
142
|
|
|
110
143
|
case 6:
|
|
111
144
|
_context.next = 8;
|
|
112
145
|
return (0, _requestApis.updateOkrName)({
|
|
113
146
|
workId: okrId,
|
|
114
|
-
workName:
|
|
147
|
+
workName: pureText,
|
|
148
|
+
workNameRichText: richText,
|
|
149
|
+
aiteUsers: mentionUsers.map(function (user) {
|
|
150
|
+
return user.mentionId;
|
|
151
|
+
})
|
|
115
152
|
});
|
|
116
153
|
|
|
117
154
|
case 8:
|
|
118
155
|
data = _context.sent;
|
|
119
156
|
|
|
120
157
|
if (data.Code == 1) {
|
|
121
|
-
|
|
122
|
-
setOkrName(
|
|
158
|
+
setEditing(false);
|
|
159
|
+
setOkrName(okrNameData.richText);
|
|
123
160
|
|
|
124
|
-
_toast["default"].Success(
|
|
161
|
+
_toast["default"].Success('修改成功');
|
|
125
162
|
} else {
|
|
126
163
|
_toast["default"].Error(data.Message);
|
|
127
164
|
}
|
|
@@ -140,27 +177,27 @@ function EditNameCmp(props) {
|
|
|
140
177
|
}();
|
|
141
178
|
|
|
142
179
|
return /*#__PURE__*/_react["default"].createElement("section", {
|
|
143
|
-
className:
|
|
180
|
+
className: prefixCls
|
|
144
181
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
145
|
-
className: (0, _classnames["default"])("
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
})),
|
|
154
|
-
className: "
|
|
182
|
+
className: (0, _classnames["default"])("".concat(prefixCls, "-input"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-input--editable"), editable), _defineProperty(_classNames, "".concat(prefixCls, "-input--editing"), editing), _defineProperty(_classNames, "".concat(prefixCls, "-input--error"), errorTip.length > 0), _classNames))
|
|
183
|
+
}, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
|
|
184
|
+
key: okrNameData.editorState,
|
|
185
|
+
editable: editable,
|
|
186
|
+
initialState: okrNameData.richText,
|
|
187
|
+
onDocChange: onChangeHandler,
|
|
188
|
+
onFocus: onFocusHandler,
|
|
189
|
+
ref: mentionInputRef
|
|
190
|
+
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
191
|
+
className: (0, _classnames["default"])("".concat(prefixCls, "-error-tip"), _defineProperty({}, "".concat(prefixCls, "-error-tip--visible"), errorTip.length > 0))
|
|
155
192
|
}, errorTip), /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
|
-
className: "
|
|
193
|
+
className: (0, _classnames["default"])("".concat(prefixCls, "-btns"), _defineProperty({}, "".concat(prefixCls, "-btns--visible"), editing))
|
|
157
194
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
158
|
-
className: (0, _classnames["default"])(
|
|
195
|
+
className: (0, _classnames["default"])('titaui-pc-button', "".concat(prefixCls, "-btns-cancel")),
|
|
159
196
|
onClick: cancelEditHandler
|
|
160
|
-
}, (0, _getLocale.getLocale)(
|
|
161
|
-
className: (0, _classnames["default"])(
|
|
197
|
+
}, (0, _getLocale.getLocale)('Mod_Cancel')), /*#__PURE__*/_react["default"].createElement("span", {
|
|
198
|
+
className: (0, _classnames["default"])('titaui-pc-button', "".concat(prefixCls, "-btns-confirm"), _defineProperty({}, "".concat(prefixCls, "-btns-confirm--disabled"), errorTip.length > 0)),
|
|
162
199
|
onClick: confiremEditHandle
|
|
163
|
-
}, (0, _getLocale.getLocale)(
|
|
200
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Butt_Determine'))));
|
|
164
201
|
}
|
|
165
202
|
|
|
166
203
|
var _default = EditNameCmp;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
.okr-drawer-header__content {
|
|
8
8
|
flex: 1;
|
|
9
9
|
position: relative;
|
|
10
|
+
overflow: visible;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
.okr-drawer-header__avatar {
|
|
@@ -35,37 +36,46 @@
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
.okr-drawer-header__classify {
|
|
39
|
+
padding: 3px 4px;
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
line-height: 18px;
|
|
42
|
+
border: 1px solid transparent;
|
|
43
|
+
border-radius: 4px;
|
|
44
|
+
transition: all 0.3s ease;
|
|
45
|
+
color: #89919f;
|
|
38
46
|
display: inline-block;
|
|
39
|
-
width: 18px;
|
|
40
|
-
height: 20px;
|
|
41
|
-
margin: 0 9px;
|
|
42
47
|
vertical-align: middle;
|
|
48
|
+
white-space: nowrap;
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
.okr-drawer-header__classify--
|
|
46
|
-
|
|
51
|
+
.okr-drawer-header__classify--editable:hover {
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
border-color: #e9ecf0;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
|
-
.okr-drawer-header__classify
|
|
50
|
-
|
|
56
|
+
.okr-drawer-header__classify::before {
|
|
57
|
+
margin-right: 7px;
|
|
58
|
+
position: relative;
|
|
59
|
+
top: 1px;
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
.okr-drawer-header__over-tag {
|
|
54
|
-
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
55
|
-
font-size: 12px;
|
|
56
|
-
display: inline-flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: center;
|
|
59
|
-
color: #a4acb9;
|
|
60
63
|
width: 52px;
|
|
61
64
|
height: 18px;
|
|
65
|
+
margin: 0 8px;
|
|
62
66
|
line-height: 24px;
|
|
63
67
|
border-radius: 9px;
|
|
68
|
+
font-size: 12px;
|
|
69
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
64
70
|
background-color: #f7f8fa;
|
|
71
|
+
color: #a4acb9;
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
65
75
|
vertical-align: middle;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
|
-
.okr-drawer-header__action-item {
|
|
78
|
+
.okr-drawer-header__action-item:not(:empty) {
|
|
69
79
|
margin-right: 12px;
|
|
70
80
|
}
|
|
71
81
|
|
|
@@ -88,18 +98,15 @@
|
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
.okr-drawer-header__edit {
|
|
91
|
-
position:
|
|
92
|
-
left: 0;
|
|
93
|
-
right: 0;
|
|
94
|
-
top: 0;
|
|
95
|
-
bottom: 0;
|
|
101
|
+
position: relative;
|
|
96
102
|
background-color: #fff;
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
.okr-drawer-header__edit-input {
|
|
106
|
+
min-height: calc(100% - 32px);
|
|
100
107
|
margin-bottom: 8px;
|
|
101
|
-
border-bottom: 1px solid
|
|
102
|
-
|
|
108
|
+
border-bottom: 1px solid transparent;
|
|
109
|
+
transition: border 0.3s ease;
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
.okr-drawer-header__edit-input textarea {
|
|
@@ -114,65 +121,139 @@
|
|
|
114
121
|
font-size: 20px;
|
|
115
122
|
line-height: 24px;
|
|
116
123
|
font-weight: 600;
|
|
117
|
-
caret-color: #
|
|
124
|
+
caret-color: #2879ff;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.okr-drawer-header__edit-input--editable:hover {
|
|
128
|
+
border-bottom-color: #e9ecf0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.okr-drawer-header__edit-input--editing, .okr-drawer-header__edit-input--editing:hover {
|
|
132
|
+
border-bottom-color: #2879ff;
|
|
118
133
|
}
|
|
119
134
|
|
|
120
135
|
.okr-drawer-header__edit-input--error {
|
|
121
|
-
border-bottom: 1px solid #
|
|
136
|
+
border-bottom: 1px solid #f05e5e;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.okr-drawer-header__edit-input .tita-rich-editor {
|
|
140
|
+
height: 100%;
|
|
141
|
+
padding: 0;
|
|
142
|
+
overflow: auto;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.okr-drawer-header__edit-input .tita-rich-editor .ProseMirror p {
|
|
146
|
+
padding: 0 0 4px 0;
|
|
147
|
+
font-size: 20px;
|
|
148
|
+
font-weight: 600;
|
|
149
|
+
white-space: normal !important;
|
|
122
150
|
}
|
|
123
151
|
|
|
124
152
|
.okr-drawer-header__edit-btns {
|
|
125
|
-
|
|
153
|
+
background-color: #ffffff;
|
|
154
|
+
opacity: 0;
|
|
155
|
+
transition: all 0.3s ease;
|
|
156
|
+
text-align: right;
|
|
157
|
+
visibility: hidden;
|
|
158
|
+
position: absolute;
|
|
159
|
+
right: 0;
|
|
160
|
+
left: 0;
|
|
126
161
|
}
|
|
127
162
|
|
|
128
163
|
.okr-drawer-header__edit-btns .titaui-pc-button {
|
|
129
|
-
|
|
130
|
-
display: inline-block;
|
|
164
|
+
padding: 5px 19px;
|
|
131
165
|
font-size: 13px;
|
|
132
166
|
line-height: 18px;
|
|
133
|
-
|
|
134
|
-
|
|
167
|
+
border-radius: 15px;
|
|
168
|
+
transform: translateY(-100%);
|
|
169
|
+
transition: all 0.3s ease;
|
|
170
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
171
|
+
display: inline-block;
|
|
135
172
|
cursor: pointer;
|
|
136
173
|
}
|
|
137
174
|
|
|
175
|
+
.okr-drawer-header__edit-btns--visible {
|
|
176
|
+
opacity: 1;
|
|
177
|
+
z-index: 2;
|
|
178
|
+
visibility: visible;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.okr-drawer-header__edit-btns--visible .titaui-pc-button {
|
|
182
|
+
transform: translateY(0);
|
|
183
|
+
}
|
|
184
|
+
|
|
138
185
|
.okr-drawer-header__edit-btns-confirm {
|
|
186
|
+
border: 1px solid #2879ff;
|
|
187
|
+
background: #2879ff;
|
|
139
188
|
color: #fff;
|
|
140
|
-
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.okr-drawer-header__edit-btns-confirm:hover {
|
|
192
|
+
background-color: #5c8eff;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.okr-drawer-header__edit-btns-confirm--disabled, .okr-drawer-header__edit-btns-confirm--disabled:hover {
|
|
196
|
+
background-color: rgba(40, 121, 255, 0.4);
|
|
197
|
+
cursor: not-allowed;
|
|
141
198
|
}
|
|
142
199
|
|
|
143
200
|
.okr-drawer-header__edit-btns-cancel {
|
|
144
|
-
color: #6F7886;
|
|
145
|
-
background: #fff;
|
|
146
|
-
border: 1px solid #DFE3EA;
|
|
147
201
|
margin-right: 10px;
|
|
202
|
+
border: 1px solid #dfe3ea;
|
|
203
|
+
background: #fff;
|
|
204
|
+
color: #6f7886;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.okr-drawer-header__edit-btns-cancel:hover {
|
|
208
|
+
border-color: #2879ff;
|
|
209
|
+
color: #2879ff;
|
|
148
210
|
}
|
|
149
211
|
|
|
150
212
|
.okr-drawer-header__edit-error-tip {
|
|
151
|
-
|
|
213
|
+
margin-top: -6px;
|
|
152
214
|
font-size: 12px;
|
|
153
215
|
line-height: 18px;
|
|
216
|
+
opacity: 0;
|
|
217
|
+
transform: translateY(-100%);
|
|
218
|
+
transition: all 0.3s ease;
|
|
154
219
|
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
155
|
-
color: #
|
|
156
|
-
|
|
220
|
+
color: #f05e5e;
|
|
221
|
+
visibility: hidden;
|
|
222
|
+
position: absolute;
|
|
223
|
+
z-index: 3;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.okr-drawer-header__edit-error-tip--visible {
|
|
227
|
+
opacity: 1;
|
|
228
|
+
transform: translateY(0);
|
|
229
|
+
visibility: visible;
|
|
157
230
|
}
|
|
158
231
|
|
|
159
232
|
.okr-drawer-header__classify-popup {
|
|
160
|
-
|
|
161
|
-
|
|
233
|
+
padding: 16px 6px;
|
|
234
|
+
border: 1px solid #f0f2f5;
|
|
235
|
+
border-radius: 8px;
|
|
162
236
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
163
|
-
|
|
237
|
+
background: #ffffff;
|
|
164
238
|
}
|
|
165
239
|
|
|
166
240
|
.okr-drawer-header__classify-popup-item {
|
|
167
|
-
|
|
168
|
-
color: #3F4755;
|
|
241
|
+
padding: 5px 30px;
|
|
169
242
|
font-size: 14px;
|
|
170
243
|
line-height: 22px;
|
|
171
|
-
|
|
244
|
+
border-radius: 8px;
|
|
245
|
+
transition: all 0.3s ease;
|
|
246
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
247
|
+
color: #3f4755;
|
|
172
248
|
cursor: pointer;
|
|
173
249
|
}
|
|
174
250
|
|
|
175
251
|
.okr-drawer-header__classify-popup-item:hover {
|
|
252
|
+
background: #f7f8fa;
|
|
253
|
+
color: #2879ff;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.okr-drawer-header__classify-popup-item.active {
|
|
176
257
|
color: #2879ff;
|
|
177
258
|
}
|
|
178
259
|
|
|
@@ -11,9 +11,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _richEditor = require("@titaui/rich-editor");
|
|
15
15
|
|
|
16
|
-
var _oClassify = _interopRequireDefault(require("
|
|
16
|
+
var _oClassify = _interopRequireDefault(require("./o-classify"));
|
|
17
17
|
|
|
18
18
|
var _oProgressUpdate = _interopRequireDefault(require("../o-progress-update"));
|
|
19
19
|
|
|
@@ -61,23 +61,26 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
61
61
|
|
|
62
62
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
63
63
|
|
|
64
|
-
var precls =
|
|
64
|
+
var precls = 'okr-drawer-header';
|
|
65
65
|
|
|
66
66
|
function Header(props) {
|
|
67
67
|
var _window, _window$BSGlobal, _window$BSGlobal$OkrA, _window$BSGlobal$OkrA2;
|
|
68
68
|
|
|
69
69
|
// 外部取到的 headInfo
|
|
70
70
|
var okrInfo = props.okrInfo;
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
var workName = okrInfo.workName,
|
|
72
|
+
workNameRichText = okrInfo.workNameRichText;
|
|
73
|
+
var richText = workNameRichText ? JSON.parse(workNameRichText) : (0, _richEditor.TitaRichEditorInitTextState)(workName);
|
|
74
|
+
|
|
75
|
+
var _useState = (0, _react.useState)({
|
|
76
|
+
mentionsUsers: [],
|
|
77
|
+
pureText: workName,
|
|
78
|
+
pureTextExcludeAt: workName,
|
|
79
|
+
richText: richText
|
|
80
|
+
}),
|
|
73
81
|
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var _useState3 = (0, _react.useState)(okrInfo.workName),
|
|
78
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
|
-
okrName = _useState4[0],
|
|
80
|
-
setOkrName = _useState4[1];
|
|
82
|
+
okrNameData = _useState2[0],
|
|
83
|
+
setOkrNameData = _useState2[1];
|
|
81
84
|
|
|
82
85
|
var _useContext = (0, _react.useContext)(_context.GeneralDataContext),
|
|
83
86
|
generalPrincipalUser = _useContext.generalPrincipalUser,
|
|
@@ -94,10 +97,10 @@ function Header(props) {
|
|
|
94
97
|
progressGrow = _okrInfo$progressGrow === void 0 ? 0 : _okrInfo$progressGrow,
|
|
95
98
|
progress = okrInfo.progress;
|
|
96
99
|
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
auth =
|
|
100
|
-
setAuth =
|
|
100
|
+
var _useState3 = (0, _react.useState)(false),
|
|
101
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
102
|
+
auth = _useState4[0],
|
|
103
|
+
setAuth = _useState4[1];
|
|
101
104
|
|
|
102
105
|
(0, _react.useEffect)(function () {
|
|
103
106
|
setAuth(new _auth.OAuth({
|
|
@@ -113,45 +116,45 @@ function Header(props) {
|
|
|
113
116
|
var progressCmp = /*#__PURE__*/_react["default"].createElement(_progress["default"], {
|
|
114
117
|
percent: progress,
|
|
115
118
|
backgroundColor: "#F7F8FA",
|
|
116
|
-
textColor: okrInfo.status === 2 ?
|
|
117
|
-
color: okrInfo.status === 2 ?
|
|
119
|
+
textColor: okrInfo.status === 2 ? '#89919f' : _utils.OkrRiskMapping[okrInfo.manualRiskLevel].textColor,
|
|
120
|
+
color: okrInfo.status === 2 ? 'linear-gradient(270deg, #BFC7D5, #E1E5EC)' : _utils.OkrRiskMapping[okrInfo.manualRiskLevel].line
|
|
118
121
|
});
|
|
119
122
|
|
|
120
123
|
if (!editable) {
|
|
121
124
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
122
125
|
className: "okr-drawer-header__action-progress"
|
|
123
126
|
}, progressCmp, progressGrow !== 0 && /*#__PURE__*/_react["default"].createElement("span", {
|
|
124
|
-
className: (0, _classnames["default"])(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
className: (0, _classnames["default"])('okr-drawer-header__action-progress-diff', {
|
|
128
|
+
'okr-drawer-header__action-progress-diff--up': progressGrow > 0,
|
|
129
|
+
'okr-drawer-header__action-progress-diff--down': progressGrow < 0
|
|
127
130
|
})
|
|
128
131
|
}, progressGrow > 0 ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
129
132
|
className: "tu-icon-simple-sort-up"
|
|
130
133
|
}) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
131
134
|
className: "tu-icon-simple-sort-down"
|
|
132
|
-
}), progressGrow.toString().replace(
|
|
135
|
+
}), progressGrow.toString().replace('-', ''), "%"));
|
|
133
136
|
}
|
|
134
137
|
|
|
135
138
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
136
139
|
className: "okr-drawer-header__action-progress"
|
|
137
140
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
138
|
-
overlay: (0, _getLocale.getLocale)(
|
|
141
|
+
overlay: (0, _getLocale.getLocale)('OKR_MyO_Pop_Upd_Upd'),
|
|
139
142
|
placement: "top"
|
|
140
143
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
141
144
|
onClick: onOpenModal,
|
|
142
145
|
style: {
|
|
143
|
-
cursor:
|
|
146
|
+
cursor: 'pointer'
|
|
144
147
|
}
|
|
145
148
|
}, progressCmp)), progressGrow !== 0 && /*#__PURE__*/_react["default"].createElement("span", {
|
|
146
|
-
className: (0, _classnames["default"])(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
className: (0, _classnames["default"])('okr-drawer-header__action-progress-diff', {
|
|
150
|
+
'okr-drawer-header__action-progress-diff--up': progressGrow > 0,
|
|
151
|
+
'okr-drawer-header__action-progress-diff--down': progressGrow < 0
|
|
149
152
|
})
|
|
150
153
|
}, progressGrow > 0 ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
151
154
|
className: "tu-icon-simple-sort-up"
|
|
152
155
|
}) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
153
156
|
className: "tu-icon-simple-sort-down"
|
|
154
|
-
}), progressGrow.toString().replace(
|
|
157
|
+
}), progressGrow.toString().replace('-', ''), "%"));
|
|
155
158
|
};
|
|
156
159
|
|
|
157
160
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -164,24 +167,16 @@ function Header(props) {
|
|
|
164
167
|
okrId: okrInfo.workId
|
|
165
168
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
169
|
className: "".concat(precls, "__content")
|
|
167
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
168
|
-
editable: editable,
|
|
169
|
-
okrName: okrName,
|
|
170
|
-
setIsEdit: setIsEdit,
|
|
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
|
|
175
|
-
}, /*#__PURE__*/_react["default"].createElement(_oClassify["default"], {
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement(_editName["default"], {
|
|
176
171
|
editable: editable,
|
|
172
|
+
okrName: okrNameData,
|
|
177
173
|
okrId: okrInfo.workId,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
})), /*#__PURE__*/_react["default"].createElement("section", {
|
|
174
|
+
setOkrName: setOkrNameData
|
|
175
|
+
}), /*#__PURE__*/_react["default"].createElement("section", {
|
|
181
176
|
className: "".concat(precls, "__action")
|
|
182
177
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
183
178
|
style: {
|
|
184
|
-
position:
|
|
179
|
+
position: 'relative',
|
|
185
180
|
left: -4
|
|
186
181
|
}
|
|
187
182
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -193,8 +188,15 @@ function Header(props) {
|
|
|
193
188
|
onTypeChange: setGeneralOkrType
|
|
194
189
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
195
190
|
className: "".concat(precls, "__action-item")
|
|
191
|
+
}, /*#__PURE__*/_react["default"].createElement(_oClassify["default"], {
|
|
192
|
+
editable: editable,
|
|
193
|
+
okrId: okrInfo.workId,
|
|
194
|
+
okrClassify: generalOkrClassify,
|
|
195
|
+
onOkrClassifyChange: setGeneralOkrClassify
|
|
196
|
+
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
197
|
+
className: "".concat(precls, "__action-item")
|
|
196
198
|
}, /*#__PURE__*/_react["default"].createElement(_oCycle["default"], {
|
|
197
|
-
editable: editable && (0, _helper.getApprovalOkr)(approvalSetting,
|
|
199
|
+
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),
|
|
198
200
|
okrId: okrInfo.workId
|
|
199
201
|
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
200
202
|
className: "".concat(precls, "__action-item")
|
|
@@ -206,12 +208,7 @@ function Header(props) {
|
|
|
206
208
|
}))), /*#__PURE__*/_react["default"].createElement(_oProgressUpdate["default"], {
|
|
207
209
|
okrInfo: okrInfo,
|
|
208
210
|
renderContent: renderContent
|
|
209
|
-
}))
|
|
210
|
-
okrName: okrName,
|
|
211
|
-
okrId: okrInfo.workId,
|
|
212
|
-
setOkrName: setOkrName,
|
|
213
|
-
setIsEdit: setIsEdit
|
|
214
|
-
})));
|
|
211
|
+
}))));
|
|
215
212
|
}
|
|
216
213
|
|
|
217
214
|
var _default = Header;
|