@titaui/pc 1.11.44 → 1.12.0-beta.0
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 +0 -1
- package/lib/components/avatar/name-avatar/index.js +13 -22
- package/lib/components/avatar/text-avatar/index.css +2 -2
- package/lib/components/avatar/text-avatar/index.js +6 -6
- package/lib/components/button/rect-btn/index.css +11 -45
- package/lib/components/button/rect-btn/index.js +6 -12
- package/lib/components/change-okr-modal/index.js +1 -2
- package/lib/components/checkbox/index.css +3 -3
- package/lib/components/create-okr-modal/index.js +41 -45
- 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 +1 -5
- package/lib/components/drawer/headerDrop.js +4 -42
- package/lib/components/drawer/index.css +0 -33
- package/lib/components/drawer/index.js +3 -26
- package/lib/components/dynamic/constant.js +33 -38
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +10 -48
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +2 -4
- package/lib/components/dynamic/new-ui.css +4 -4
- package/lib/components/dynamic/online-broadcast/data.js +1 -19
- package/lib/components/e-priority/index.css +4 -4
- package/lib/components/e-priority/index.js +2 -10
- package/lib/components/mblog/components/MblogContent.js +2 -5
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +8 -7
- package/lib/components/nav-top/components/menu/index.css +0 -91
- package/lib/components/nav-top/components/menu/index.js +24 -72
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -2
- package/lib/components/nav-top/components/user-message/components/todos/index.css +0 -1
- package/lib/components/nav-top/index.js +2 -6
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +4 -20
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +1 -9
- package/lib/components/okr-detail/components/header/index.js +3 -10
- package/lib/components/okr-detail/components/header/o-name.js +3 -10
- package/lib/components/okr-detail/components/o-classify.js +1 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +16 -16
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +0 -10
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +54 -111
- package/lib/components/okr-detail/detail-header/delete-confirm/style.js +38 -0
- package/lib/components/okr-detail/detail-header/index.css +0 -11
- package/lib/components/okr-detail/detail-header/index.js +234 -228
- package/lib/components/okr-detail/index.js +4 -21
- package/lib/components/okr-detail/okr-list/index.js +6 -13
- package/lib/components/okr-detail/request-apis.js +8 -14
- package/lib/components/okr-flow/child-node/index.css +1 -1
- package/lib/components/okr-flow/export-modal/index.js +3 -66
- package/lib/components/okr-period-selector/index.js +5 -9
- package/lib/components/okr-period-selector/select-cycle.js +19 -23
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/operation-records/style.js +1 -1
- package/lib/components/survey-model/index.js +0 -3
- package/lib/components/task-relation-modal/index.js +1 -0
- package/lib/components/task-relation-modal/request-api.js +1 -2
- package/lib/components/task-tree/index.js +7 -1
- package/lib/components/task-tree/mock.js +944 -0
- package/lib/components/task-tree/task-item-node/constant.js +22 -39
- package/lib/components/task-tree/task-item-node/e-status-dropdown.js +8 -38
- package/lib/components/task-tree/task-item-node/e-task.js +24 -24
- package/lib/components/task-tree/task-item-node/index.css +18 -28
- package/lib/components/task-tree/task-tree.css +1 -1
- package/lib/components/time-picker/time-picker.js +102 -34
- package/lib/components/time-picker/timer-picker-input.js +6 -0
- package/lib/components/toast/index.js +3 -5
- package/lib/index.js +0 -40
- package/lib/pages/new-okr-list/header/index.css +0 -45
- package/lib/pages/new-okr-list/header/index.js +29 -51
- package/lib/pages/new-okr-list/index.js +2 -4
- package/lib/pages/new-okr-list/list/index.js +2 -19
- package/lib/pages/new-okr-list/request-api.js +2 -8
- package/lib/pages/okr-map/unsupport-ie/index.js +5 -3
- package/lib/utils/format-time.js +1 -8
- package/lib/utils/open-data.js +1 -5
- package/package.json +1 -1
- package/lib/components/nav-top/components/menu/img/new.svg +0 -30
- package/lib/components/nav-top/components/menu/img/wecome-temp.png +0 -0
- package/lib/components/okr-detail/detail-header/constant.js +0 -53
- package/lib/components/okr-detail/detail-header/delete-confirm/index.css +0 -59
- package/lib/components/okr-detail/helper.js +0 -108
- package/lib/components/textarea/index.css +0 -142
- package/lib/components/textarea/index.js +0 -259
- package/lib/pages/new-okr-list/header/common.js +0 -52
- package/lib/pages/new-okr-list/header/operate-record.js +0 -129
|
@@ -58,10 +58,7 @@ var NameAvatar = function NameAvatar(props) {
|
|
|
58
58
|
onDelUser = props.onDelUser,
|
|
59
59
|
_props$textWidth = props.textWidth,
|
|
60
60
|
textWidth = _props$textWidth === void 0 ? 42 : _props$textWidth,
|
|
61
|
-
textClass = props.textClass
|
|
62
|
-
renderRightTopCmp = props.renderRightTopCmp,
|
|
63
|
-
_props$avatarTips = props.avatarTips,
|
|
64
|
-
avatarTips = _props$avatarTips === void 0 ? '' : _props$avatarTips;
|
|
61
|
+
textClass = props.textClass;
|
|
65
62
|
var hasAvatar = src && !src.match(/default\w*.jpg$/);
|
|
66
63
|
|
|
67
64
|
var _useState = (0, _react.useState)(false),
|
|
@@ -106,7 +103,7 @@ var NameAvatar = function NameAvatar(props) {
|
|
|
106
103
|
style: {
|
|
107
104
|
width: size.width,
|
|
108
105
|
height: size.width,
|
|
109
|
-
verticalAlign:
|
|
106
|
+
verticalAlign: "top"
|
|
110
107
|
},
|
|
111
108
|
src: src
|
|
112
109
|
});
|
|
@@ -123,11 +120,11 @@ var NameAvatar = function NameAvatar(props) {
|
|
|
123
120
|
}
|
|
124
121
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
125
122
|
style: {
|
|
126
|
-
display:
|
|
123
|
+
display: "inline-block",
|
|
127
124
|
width: "".concat(size.fontSize, "px"),
|
|
128
|
-
margin:
|
|
129
|
-
overflow:
|
|
130
|
-
whiteSpace:
|
|
125
|
+
margin: "0 auto",
|
|
126
|
+
overflow: "hidden",
|
|
127
|
+
whiteSpace: "nowrap",
|
|
131
128
|
fontSize: "".concat(size.fontSize, "px"),
|
|
132
129
|
lineHeight: "".concat(size.width, "px")
|
|
133
130
|
}
|
|
@@ -137,7 +134,7 @@ var NameAvatar = function NameAvatar(props) {
|
|
|
137
134
|
})));
|
|
138
135
|
}
|
|
139
136
|
|
|
140
|
-
var cuttedName =
|
|
137
|
+
var cuttedName = "";
|
|
141
138
|
var cuttedNameLen = 0;
|
|
142
139
|
|
|
143
140
|
for (var i = 0, lent = name.length; i < lent; i++) {
|
|
@@ -170,11 +167,11 @@ var NameAvatar = function NameAvatar(props) {
|
|
|
170
167
|
className: "titaui-pc-avator__name-avatar-container",
|
|
171
168
|
onMouseEnter: handleMouseEnter,
|
|
172
169
|
onMouseLeave: handleMouseLeave
|
|
173
|
-
},
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
174
171
|
onClick: handleDelUser,
|
|
175
172
|
onMouseLeave: handleCloseIconMouseLeave,
|
|
176
173
|
onMouseEnter: handleCloseIconMouseEnter,
|
|
177
|
-
className: "titaui-pc-avator__delete-wrapper ".concat(canDelUser && mouseIsEnterUser ?
|
|
174
|
+
className: "titaui-pc-avator__delete-wrapper ".concat(canDelUser && mouseIsEnterUser ? "titaui-pc-avator--enter" : ""),
|
|
178
175
|
style: {
|
|
179
176
|
left: "".concat(size.width - 14, "px")
|
|
180
177
|
}
|
|
@@ -188,10 +185,7 @@ var NameAvatar = function NameAvatar(props) {
|
|
|
188
185
|
onClick: onClick,
|
|
189
186
|
onMouseEnter: onMouseEnter,
|
|
190
187
|
onMouseLeave: onMouseLeave
|
|
191
|
-
},
|
|
192
|
-
overlay: avatarTips,
|
|
193
|
-
placement: "top"
|
|
194
|
-
}, hasAvatar ? renderImgAvatar() : renderTextAvatar()), !avatarTips && (hasAvatar ? renderImgAvatar() : renderTextAvatar())), showNameTips && isNameOverflow ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
188
|
+
}, hasAvatar ? renderImgAvatar() : renderTextAvatar()), showNameTips && isNameOverflow ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
195
189
|
overlay: /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
196
190
|
name: name,
|
|
197
191
|
id: userId
|
|
@@ -200,17 +194,14 @@ var NameAvatar = function NameAvatar(props) {
|
|
|
200
194
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
201
195
|
className: "titaui-pc-avator__name ".concat(textClass),
|
|
202
196
|
style: {
|
|
203
|
-
|
|
197
|
+
width: textWidth
|
|
204
198
|
}
|
|
205
199
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
206
200
|
ref: textRef
|
|
207
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
208
|
-
name: name,
|
|
209
|
-
id: userId
|
|
210
|
-
})))) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
201
|
+
}, name))) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
211
202
|
className: "titaui-pc-avator__name ".concat(textClass),
|
|
212
203
|
style: {
|
|
213
|
-
|
|
204
|
+
width: textWidth
|
|
214
205
|
}
|
|
215
206
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
216
207
|
ref: textRef
|
|
@@ -41,7 +41,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
41
41
|
|
|
42
42
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
43
|
|
|
44
|
-
var preCls =
|
|
44
|
+
var preCls = "titaui-text-avatar";
|
|
45
45
|
|
|
46
46
|
function TextAvatar(props) {
|
|
47
47
|
var name = props.name,
|
|
@@ -54,7 +54,7 @@ function TextAvatar(props) {
|
|
|
54
54
|
_props$isGetRoot = props.isGetRoot,
|
|
55
55
|
isGetRoot = _props$isGetRoot === void 0 ? false : _props$isGetRoot,
|
|
56
56
|
_props$extraCls = props.extraCls,
|
|
57
|
-
extraCls = _props$extraCls === void 0 ?
|
|
57
|
+
extraCls = _props$extraCls === void 0 ? "" : _props$extraCls,
|
|
58
58
|
_props$nameTips = props.nameTips,
|
|
59
59
|
nameTips = _props$nameTips === void 0 ? function (name) {
|
|
60
60
|
return name;
|
|
@@ -83,7 +83,7 @@ function TextAvatar(props) {
|
|
|
83
83
|
}; // 非编辑态,不可以弹出选人组件
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
var FieldPerson = editable ? _userSelector["default"] :
|
|
86
|
+
var FieldPerson = editable ? _userSelector["default"] : "span";
|
|
87
87
|
|
|
88
88
|
var renderAvatar = function renderAvatar() {
|
|
89
89
|
if (showAvatar) {
|
|
@@ -91,7 +91,7 @@ function TextAvatar(props) {
|
|
|
91
91
|
className: "".concat(preCls, "__img")
|
|
92
92
|
}, /*#__PURE__*/_react["default"].createElement(_default2["default"], {
|
|
93
93
|
userId: id,
|
|
94
|
-
src: avatar !== null && avatar !== void 0 && avatar.HasAvatar || avatar !== null && avatar !== void 0 && avatar.hasAvatar ? avatar.medium :
|
|
94
|
+
src: avatar !== null && avatar !== void 0 && avatar.HasAvatar || avatar !== null && avatar !== void 0 && avatar.hasAvatar ? avatar.medium : "",
|
|
95
95
|
color: avatar === null || avatar === void 0 ? void 0 : avatar.color,
|
|
96
96
|
name: name,
|
|
97
97
|
size: {
|
|
@@ -132,7 +132,7 @@ function TextAvatar(props) {
|
|
|
132
132
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
133
133
|
className: (0, _classnames["default"])(preCls, extraCls, _defineProperty({}, "".concat(preCls, "--editable"), editable)),
|
|
134
134
|
style: {
|
|
135
|
-
|
|
135
|
+
maxWidth: width
|
|
136
136
|
}
|
|
137
137
|
}, renderAvatar(), /*#__PURE__*/_react["default"].createElement("span", {
|
|
138
138
|
ref: text,
|
|
@@ -143,7 +143,7 @@ function TextAvatar(props) {
|
|
|
143
143
|
})))), !showTooltip && /*#__PURE__*/_react["default"].createElement("span", {
|
|
144
144
|
className: (0, _classnames["default"])(preCls, extraCls, _defineProperty({}, "".concat(preCls, "--editable"), editable)),
|
|
145
145
|
style: {
|
|
146
|
-
|
|
146
|
+
maxWidth: width
|
|
147
147
|
}
|
|
148
148
|
}, renderAvatar(), /*#__PURE__*/_react["default"].createElement("span", {
|
|
149
149
|
ref: text,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: center;
|
|
15
15
|
min-width: 64px;
|
|
16
|
-
font-size:
|
|
16
|
+
font-size: 13px;
|
|
17
17
|
padding: 0 12px;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -60,35 +60,21 @@
|
|
|
60
60
|
background: #5c8eff;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
.titaui-rect-btn--secondary {
|
|
64
|
-
font-size: 14px;
|
|
65
|
-
font-weight: normal;
|
|
66
|
-
color: #2879ff;
|
|
67
|
-
line-height: 28px;
|
|
68
|
-
background: rgba(40, 121, 255, 0.2);
|
|
69
|
-
margin-right: 16px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.titaui-rect-btn--secondary:hover {
|
|
73
|
-
color: #fff;
|
|
74
|
-
background-color: #2879ff;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
63
|
.titaui-rect-btn--cancel {
|
|
78
|
-
color: #
|
|
79
|
-
border: 1px solid #
|
|
80
|
-
background: #
|
|
64
|
+
color: #6F7886;
|
|
65
|
+
border: 1px solid #DFE3EA;
|
|
66
|
+
background: #FFFFFF;
|
|
81
67
|
}
|
|
82
68
|
|
|
83
69
|
.titaui-rect-btn--cancel:hover {
|
|
84
|
-
color: #
|
|
85
|
-
border: 1px solid #
|
|
70
|
+
color: #2879FF;
|
|
71
|
+
border: 1px solid #2879FF;
|
|
86
72
|
}
|
|
87
73
|
|
|
88
74
|
.titaui-rect-btn--delete {
|
|
89
|
-
background: #
|
|
90
|
-
color: #
|
|
91
|
-
border: 1px solid #
|
|
75
|
+
background: #FFFFFF;
|
|
76
|
+
color: #F05E5E;
|
|
77
|
+
border: 1px solid #F05E5E;
|
|
92
78
|
}
|
|
93
79
|
|
|
94
80
|
.titaui-rect-btn--delete:hover {
|
|
@@ -106,31 +92,11 @@
|
|
|
106
92
|
user-select: none;
|
|
107
93
|
}
|
|
108
94
|
|
|
109
|
-
.titaui-rect-btn--disabled:hover .titaui-rect-btn--default:hover {
|
|
110
|
-
background: #fff;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.titaui-rect-btn--disabled:hover .titaui-rect-btn--primary:hover {
|
|
114
|
-
background: #2879ff;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.titaui-rect-btn--disabled:hover .titaui-rect-btn--secondary:hover {
|
|
118
|
-
background: rgba(40, 121, 255, 0.2);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.titaui-rect-btn--disabled:hover .titaui-rect-btn--cancel:hover {
|
|
122
|
-
background: #ffffff;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.titaui-rect-btn--disabled:hover .titaui-rect-btn--delete:hover {
|
|
126
|
-
background: #ffffff;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
95
|
.titaui-rect-btn--primary.titaui-rect-btn--disabled {
|
|
130
|
-
background: #
|
|
96
|
+
background: #93BCFF;
|
|
131
97
|
opacity: 1;
|
|
132
98
|
}
|
|
133
99
|
|
|
134
100
|
.titaui-rect-btn--primary.titaui-rect-btn--disabled:hover {
|
|
135
|
-
background: #
|
|
101
|
+
background: #93BCFF;
|
|
136
102
|
}
|
|
@@ -34,10 +34,7 @@ function RectBtn(props) {
|
|
|
34
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
|
-
style = props.style
|
|
38
|
-
children = props.children,
|
|
39
|
-
_props$loading = props.loading,
|
|
40
|
-
loading = _props$loading === void 0 ? false : _props$loading;
|
|
37
|
+
style = props.style;
|
|
41
38
|
|
|
42
39
|
var renderIcon = function renderIcon() {
|
|
43
40
|
if (typeof icon === 'string') {
|
|
@@ -53,19 +50,16 @@ function RectBtn(props) {
|
|
|
53
50
|
}, icon);
|
|
54
51
|
};
|
|
55
52
|
|
|
56
|
-
var onClickHandler = function onClickHandler(
|
|
57
|
-
if (disabled
|
|
58
|
-
|
|
59
|
-
if (onClick) {
|
|
60
|
-
onClick(e);
|
|
61
|
-
}
|
|
53
|
+
var onClickHandler = function onClickHandler() {
|
|
54
|
+
if (disabled) return;
|
|
55
|
+
onClick && onClick();
|
|
62
56
|
};
|
|
63
57
|
|
|
64
58
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
65
|
-
className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), "".concat(precls, "--").concat(size), _defineProperty({}, "".concat(precls, "--disabled"), disabled
|
|
59
|
+
className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), "".concat(precls, "--").concat(size), _defineProperty({}, "".concat(precls, "--disabled"), disabled), className),
|
|
66
60
|
style: style,
|
|
67
61
|
onClick: onClickHandler
|
|
68
|
-
}, icon && renderIcon(), children || text);
|
|
62
|
+
}, icon && renderIcon(), props.children || text);
|
|
69
63
|
}
|
|
70
64
|
|
|
71
65
|
var _default = RectBtn;
|
|
@@ -564,8 +564,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
564
564
|
}).join(','),
|
|
565
565
|
searchKr: okrPopType,
|
|
566
566
|
// 是否搜索KR:默认为0-不搜索,1-只有对齐目标弹层可以搜索KR
|
|
567
|
-
toUserId: toUserId
|
|
568
|
-
includeCreateFailApprovalOkr: false
|
|
567
|
+
toUserId: toUserId
|
|
569
568
|
}).then(function (res) {
|
|
570
569
|
_this4.pending = false;
|
|
571
570
|
var resData = res && res.Data && res.Data.works || [];
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
display: inline-block;
|
|
3
3
|
width: 16px;
|
|
4
4
|
height: 16px;
|
|
5
|
-
background: #
|
|
5
|
+
background: #FFFFFF;
|
|
6
6
|
border-radius: 4px;
|
|
7
|
-
border: 1px solid #
|
|
7
|
+
border: 1px solid #DFE3EA;
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
}
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.titaui-checkbox--disabled {
|
|
18
|
-
background-color: #
|
|
18
|
+
background-color: #F0F2F5;
|
|
19
19
|
cursor: not-allowed;
|
|
20
20
|
}
|
|
@@ -117,9 +117,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
117
117
|
_ref$visible = _ref.visible,
|
|
118
118
|
visible = _ref$visible === void 0 ? false : _ref$visible,
|
|
119
119
|
_ref$onClose = _ref.onClose,
|
|
120
|
-
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose
|
|
121
|
-
_ref$isFromAssess = _ref.isFromAssess,
|
|
122
|
-
isFromAssess = _ref$isFromAssess === void 0 ? false : _ref$isFromAssess;
|
|
120
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose;
|
|
123
121
|
|
|
124
122
|
var _useState = (0, _react.useState)(visible),
|
|
125
123
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -128,7 +126,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
128
126
|
|
|
129
127
|
|
|
130
128
|
var userId = BSGlobal.loginUserInfo.Id;
|
|
131
|
-
var setting = (0, _bsGlobal.getBSGlobal)(
|
|
129
|
+
var setting = (0, _bsGlobal.getBSGlobal)("OkrAdvancedSetting").KRSetting;
|
|
132
130
|
var openOkrType = setting.OkrTypeSetting;
|
|
133
131
|
var openClassify = setting.OkrClassify;
|
|
134
132
|
var openKrWeight = setting.KrWeight;
|
|
@@ -138,7 +136,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
138
136
|
Id = _ref2.Id,
|
|
139
137
|
UserAvatar = _ref2.UserAvatar;
|
|
140
138
|
|
|
141
|
-
var _useState3 = (0, _react.useState)(
|
|
139
|
+
var _useState3 = (0, _react.useState)(""),
|
|
142
140
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
143
141
|
okrName = _useState4[0],
|
|
144
142
|
setOkrName = _useState4[1]; // 目标名称
|
|
@@ -162,7 +160,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
162
160
|
|
|
163
161
|
var _useState9 = (0, _react.useState)({
|
|
164
162
|
departmentId: 0,
|
|
165
|
-
departmentName:
|
|
163
|
+
departmentName: ""
|
|
166
164
|
}),
|
|
167
165
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
168
166
|
dept = _useState10[0],
|
|
@@ -171,7 +169,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
171
169
|
|
|
172
170
|
var _useState11 = (0, _react.useState)({
|
|
173
171
|
groupId: 0,
|
|
174
|
-
groupName:
|
|
172
|
+
groupName: ""
|
|
175
173
|
}),
|
|
176
174
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
177
175
|
team = _useState12[0],
|
|
@@ -179,7 +177,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
179
177
|
|
|
180
178
|
|
|
181
179
|
var _useState13 = (0, _react.useState)({
|
|
182
|
-
typeName: (0, _getLocale.getLocale)(
|
|
180
|
+
typeName: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
|
|
183
181
|
typeId: 1
|
|
184
182
|
}),
|
|
185
183
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
@@ -218,7 +216,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
218
216
|
principalName: Name,
|
|
219
217
|
userAvatar: UserAvatar,
|
|
220
218
|
krWeight: 100,
|
|
221
|
-
mileStoneName:
|
|
219
|
+
mileStoneName: "",
|
|
222
220
|
confidenceIndex: 5
|
|
223
221
|
}]),
|
|
224
222
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
@@ -228,7 +226,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
228
226
|
var _useState25 = (0, _react.useState)({
|
|
229
227
|
// 对其目标
|
|
230
228
|
parentWorkId: 0,
|
|
231
|
-
parentWorkName:
|
|
229
|
+
parentWorkName: "",
|
|
232
230
|
parentType: 0,
|
|
233
231
|
parentKrId: 0
|
|
234
232
|
}),
|
|
@@ -285,7 +283,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
285
283
|
tipIndex = _useState44[0],
|
|
286
284
|
setTipIndex = _useState44[1];
|
|
287
285
|
|
|
288
|
-
var _useState45 = (0, _react.useState)(
|
|
286
|
+
var _useState45 = (0, _react.useState)(""),
|
|
289
287
|
_useState46 = _slicedToArray(_useState45, 2),
|
|
290
288
|
userAvatarBase64Url = _useState46[0],
|
|
291
289
|
setUserAvatarBase64Url = _useState46[1];
|
|
@@ -309,7 +307,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
309
307
|
var modalRef = (0, _react.useRef)();
|
|
310
308
|
var oInputFoucsRef = (0, _react.useRef)(false);
|
|
311
309
|
var krInputFoucsRef = (0, _react.useRef)(false);
|
|
312
|
-
var downloadDomRef = (0, _react.useRef)(document.createElement(
|
|
310
|
+
var downloadDomRef = (0, _react.useRef)(document.createElement("div"));
|
|
313
311
|
var newOkrDataRef = (0, _react.useRef)(); // kr权重总计
|
|
314
312
|
|
|
315
313
|
var total = 0;
|
|
@@ -365,7 +363,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
365
363
|
setShowCreatedSuccessInfo(true);
|
|
366
364
|
setTipIndex(Math.floor(Math.random() * 6));
|
|
367
365
|
} else {
|
|
368
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
366
|
+
_toast["default"].Success((0, _getLocale.getLocale)("OKR_Db_Success"), {
|
|
369
367
|
duration: 3000
|
|
370
368
|
});
|
|
371
369
|
|
|
@@ -409,7 +407,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
409
407
|
break;
|
|
410
408
|
}
|
|
411
409
|
|
|
412
|
-
_toast["default"].Error((0, _getLocale.getLocale)(
|
|
410
|
+
_toast["default"].Error((0, _getLocale.getLocale)("OKR_MyO_Pop_Targetname"), {
|
|
413
411
|
canClose: false
|
|
414
412
|
});
|
|
415
413
|
|
|
@@ -421,7 +419,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
421
419
|
break;
|
|
422
420
|
}
|
|
423
421
|
|
|
424
|
-
_toast["default"].Error(
|
|
422
|
+
_toast["default"].Error("目标名称不能超过500字", {
|
|
425
423
|
canClose: false
|
|
426
424
|
});
|
|
427
425
|
|
|
@@ -433,7 +431,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
433
431
|
break;
|
|
434
432
|
}
|
|
435
433
|
|
|
436
|
-
_toast["default"].Error(
|
|
434
|
+
_toast["default"].Error("关键成果不能为空", {
|
|
437
435
|
canClose: false
|
|
438
436
|
});
|
|
439
437
|
|
|
@@ -450,7 +448,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
450
448
|
break;
|
|
451
449
|
}
|
|
452
450
|
|
|
453
|
-
_toast["default"].Error(
|
|
451
|
+
_toast["default"].Error("关键成果不能超过500字", {
|
|
454
452
|
canClose: false
|
|
455
453
|
});
|
|
456
454
|
|
|
@@ -464,7 +462,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
464
462
|
break;
|
|
465
463
|
}
|
|
466
464
|
|
|
467
|
-
_toast["default"].Error((0, _getLocale.getLocale)(
|
|
465
|
+
_toast["default"].Error((0, _getLocale.getLocale)("OKR_MyO_Pop_Totalkrnot100"), {
|
|
468
466
|
canClose: false
|
|
469
467
|
});
|
|
470
468
|
|
|
@@ -482,7 +480,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
482
480
|
handleCreatedClose();
|
|
483
481
|
visibilityArea = formatVisiableLimit();
|
|
484
482
|
_context.next = 24;
|
|
485
|
-
return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
483
|
+
return (0, _requestApi.createWidthKr)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
486
484
|
krInfos: krDatas.map(function (kr) {
|
|
487
485
|
return _objectSpread(_objectSpread({}, kr), {}, {
|
|
488
486
|
startDate: cycle.startDate,
|
|
@@ -494,16 +492,14 @@ function CreateOkrModal(_ref, ref) {
|
|
|
494
492
|
}, parent), {}, {
|
|
495
493
|
workType: 6,
|
|
496
494
|
visibility: visibility,
|
|
497
|
-
okrClassify: openClassify ? okrClassify :
|
|
498
|
-
okrType: openOkrType ? type.typeId :
|
|
495
|
+
okrClassify: openClassify ? okrClassify : "",
|
|
496
|
+
okrType: openOkrType ? type.typeId : ""
|
|
499
497
|
}, dept), team), {}, {
|
|
500
498
|
workRoles: [{
|
|
501
499
|
roleType: 1,
|
|
502
500
|
models: [user]
|
|
503
501
|
}]
|
|
504
|
-
}, visibilityArea)
|
|
505
|
-
CreateFromAssess: isFromAssess
|
|
506
|
-
}));
|
|
502
|
+
}, visibilityArea));
|
|
507
503
|
|
|
508
504
|
case 24:
|
|
509
505
|
data = _context.sent;
|
|
@@ -513,7 +509,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
513
509
|
break;
|
|
514
510
|
}
|
|
515
511
|
|
|
516
|
-
_toast["default"].Error(
|
|
512
|
+
_toast["default"].Error("创建失败,请重试", {
|
|
517
513
|
canClose: false
|
|
518
514
|
});
|
|
519
515
|
|
|
@@ -528,7 +524,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
528
524
|
krTotalLength = 0;
|
|
529
525
|
krDatas && krDatas.forEach(function (kr) {
|
|
530
526
|
// 计算平均长度要去掉百分号和数字
|
|
531
|
-
krTotalLength += kr.mileStoneName.replace(/(%|\d)/g,
|
|
527
|
+
krTotalLength += kr.mileStoneName.replace(/(%|\d)/g, "").length;
|
|
532
528
|
});
|
|
533
529
|
krAvarageLength = krDatas.length > 0 ? krTotalLength / krDatas.length : 0;
|
|
534
530
|
krMeasurableLength = krsCheckResult.friendlyResult.filter(function (kr) {
|
|
@@ -536,13 +532,13 @@ function CreateOkrModal(_ref, ref) {
|
|
|
536
532
|
}).length;
|
|
537
533
|
oHasVtWords = oNameCheckResult[0].result === _okrCreateSuggest.EOkrCreateSuggestResultType.correct;
|
|
538
534
|
callData = data;
|
|
539
|
-
callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrName.replace(/(%|\d)/g,
|
|
535
|
+
callData.countSurpassPercentage = (0, _getCreateOkrSurpassPercent["default"])(okrName.replace(/(%|\d)/g, "").length, oHasVtWords, krNum, krMeasurableLength, Number.parseInt(krAvarageLength.toString()));
|
|
540
536
|
newOkrDataRef.current = callData;
|
|
541
537
|
handleOnSuccess();
|
|
542
538
|
} else {
|
|
543
539
|
workId = data.workId;
|
|
544
540
|
|
|
545
|
-
_drawerManager["default"].open(
|
|
541
|
+
_drawerManager["default"].open("okrDetail", {
|
|
546
542
|
okrId: workId
|
|
547
543
|
});
|
|
548
544
|
}
|
|
@@ -590,10 +586,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
590
586
|
principalName: Name,
|
|
591
587
|
userAvatar: UserAvatar,
|
|
592
588
|
krWeight: 100,
|
|
593
|
-
mileStoneName:
|
|
589
|
+
mileStoneName: "",
|
|
594
590
|
confidenceIndex: 5
|
|
595
591
|
}]);
|
|
596
|
-
setOkrName(
|
|
592
|
+
setOkrName("");
|
|
597
593
|
setUser({
|
|
598
594
|
name: Name,
|
|
599
595
|
id: Id,
|
|
@@ -602,10 +598,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
602
598
|
setIsCustomWeight(false);
|
|
603
599
|
setDept({
|
|
604
600
|
departmentId: 0,
|
|
605
|
-
departmentName:
|
|
601
|
+
departmentName: ""
|
|
606
602
|
});
|
|
607
603
|
setType({
|
|
608
|
-
typeName: (0, _getLocale.getLocale)(
|
|
604
|
+
typeName: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
|
|
609
605
|
typeId: 1
|
|
610
606
|
});
|
|
611
607
|
setCycle(cycle);
|
|
@@ -613,7 +609,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
613
609
|
setVisibility(1);
|
|
614
610
|
setParent({
|
|
615
611
|
parentWorkId: 0,
|
|
616
|
-
parentWorkName:
|
|
612
|
+
parentWorkName: "",
|
|
617
613
|
parentType: 0,
|
|
618
614
|
parentKrId: 0
|
|
619
615
|
});
|
|
@@ -727,7 +723,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
727
723
|
var ModalTitle = (0, _react.useMemo)(function () {
|
|
728
724
|
return /*#__PURE__*/_react["default"].createElement(_style.Line, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
729
725
|
className: "create-modal__title"
|
|
730
|
-
}, (0, _getLocale.getLocale)(
|
|
726
|
+
}, (0, _getLocale.getLocale)("OKR_MyO_Pop_Title_Newobjective")), /*#__PURE__*/_react["default"].createElement(_okrCase["default"], {
|
|
731
727
|
okrTemplateEnabled: true,
|
|
732
728
|
onOkrApply: OnOkRApplyTplHandler
|
|
733
729
|
}));
|
|
@@ -769,7 +765,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
769
765
|
|
|
770
766
|
setShowCreatedSuccessInfo(false);
|
|
771
767
|
|
|
772
|
-
_drawerManager["default"].open(
|
|
768
|
+
_drawerManager["default"].open("okrDetail", {
|
|
773
769
|
okrId: workId
|
|
774
770
|
});
|
|
775
771
|
|
|
@@ -788,10 +784,10 @@ function CreateOkrModal(_ref, ref) {
|
|
|
788
784
|
|
|
789
785
|
var trackAction = function trackAction() {
|
|
790
786
|
// @ts-ignore
|
|
791
|
-
window.titaTracker && window.titaTracker(
|
|
792
|
-
actionName:
|
|
793
|
-
actionGroup: (0, _getLocale.getLocale)(
|
|
794
|
-
productName: (0, _getLocale.getLocale)(
|
|
787
|
+
window.titaTracker && window.titaTracker("action").record({
|
|
788
|
+
actionName: "点击【教你写OKR】",
|
|
789
|
+
actionGroup: (0, _getLocale.getLocale)("OKR_MyO_Collr_Butt_CreatOKR"),
|
|
790
|
+
productName: (0, _getLocale.getLocale)("Menu_Title_OKRs")
|
|
795
791
|
});
|
|
796
792
|
};
|
|
797
793
|
|
|
@@ -801,7 +797,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
801
797
|
}
|
|
802
798
|
return /*#__PURE__*/_react["default"].createElement("a", {
|
|
803
799
|
className: "teact-write-okr",
|
|
804
|
-
href: (0, _helpers.isDingDing)() ?
|
|
800
|
+
href: (0, _helpers.isDingDing)() ? "https://wiki.tita.com/pages/viewpage.action?pageId=15696093" : "https://docs.tita.com/question/okr-write/",
|
|
805
801
|
target: "_blank",
|
|
806
802
|
onClick: trackAction,
|
|
807
803
|
rel: "noreferrer"
|
|
@@ -810,7 +806,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
810
806
|
src: _teachOkr["default"]
|
|
811
807
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
812
808
|
className: "teact-write-okr__text"
|
|
813
|
-
}, (0, _getLocale.getLocale)(
|
|
809
|
+
}, (0, _getLocale.getLocale)("OKR_MyO_Pop_TeachwriteOKR")));
|
|
814
810
|
}, []);
|
|
815
811
|
(0, _react.useEffect)(function () {
|
|
816
812
|
// @ts-ignore
|
|
@@ -824,8 +820,8 @@ function CreateOkrModal(_ref, ref) {
|
|
|
824
820
|
mask: true,
|
|
825
821
|
centered: true,
|
|
826
822
|
onOk: onModalOkHandler,
|
|
827
|
-
okText: (0, _getLocale.getLocale)(
|
|
828
|
-
cancelText: (0, _getLocale.getLocale)(
|
|
823
|
+
okText: (0, _getLocale.getLocale)("OKR_MyO_Pop_Createnow"),
|
|
824
|
+
cancelText: (0, _getLocale.getLocale)("Mod_Cancel"),
|
|
829
825
|
title: ModalTitle,
|
|
830
826
|
visible: isVisible,
|
|
831
827
|
onCancel: hideCreateOkrModal,
|
|
@@ -833,7 +829,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
833
829
|
footerLeftContent: renderFooterTeachWriteOKr,
|
|
834
830
|
zIndex: 1200,
|
|
835
831
|
bodyStyle: {
|
|
836
|
-
flexBasis:
|
|
832
|
+
flexBasis: "auto"
|
|
837
833
|
}
|
|
838
834
|
}, /*#__PURE__*/_react["default"].createElement(_style.Wrapper, {
|
|
839
835
|
ref: wrapperRef
|
|
@@ -861,7 +857,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
861
857
|
setIsInputContent: setIsInputContent
|
|
862
858
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
863
859
|
className: "create-modal__title-line"
|
|
864
|
-
}, /*#__PURE__*/_react["default"].createElement(_style.BlueBar, null), (0, _getLocale.getLocale)(
|
|
860
|
+
}, /*#__PURE__*/_react["default"].createElement(_style.BlueBar, null), (0, _getLocale.getLocale)("Per_Ass_New_Appr_detail_moreS")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
865
861
|
className: "space-between-row"
|
|
866
862
|
}, /*#__PURE__*/_react["default"].createElement(_okrParent["default"], {
|
|
867
863
|
parent: parent,
|
|
@@ -46,7 +46,7 @@ var createWidthKr = /*#__PURE__*/function () {
|
|
|
46
46
|
while (1) {
|
|
47
47
|
switch (_context.prev = _context.next) {
|
|
48
48
|
case 0:
|
|
49
|
-
url = "".concat(requestDomain(), "/api/
|
|
49
|
+
url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/work/createWithKr");
|
|
50
50
|
_context.next = 3;
|
|
51
51
|
return _axios["default"].post(url, _objectSpread({
|
|
52
52
|
workType: 6
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
|
|
34
34
|
.titaui-dialog-confirm__btn-cancel {
|
|
35
35
|
background: #ffffff;
|
|
36
|
-
border: 1px solid #dfe3ea
|
|
36
|
+
border: 1px solid #dfe3ea;
|
|
37
37
|
color: #6f7886;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.titaui-dialog-confirm__btn-cancel:hover {
|
|
41
41
|
color: #2879ff;
|
|
42
|
-
border: 1px solid #2879ff
|
|
42
|
+
border: 1px solid #2879ff;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.titaui-dialog-confirm__btn-cancel-text {
|