@titaui/pc 1.10.26 → 1.10.29
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/create-okr-modal/fields/o-new-name.js +31 -21
- package/lib/components/create-okr-modal/kr-items/krDatas.js +15 -15
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +3 -2
- package/lib/components/menus/export-modules/demo-menus/menus.js +8 -7
- package/lib/components/okr-detail/components/header/o-score.js +4 -6
- package/lib/components/toast/index.js +3 -7
- package/lib/utils/open-data.js +2 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] =
|
|
8
|
+
exports["default"] = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -52,7 +52,7 @@ var initOCheckResult = function initOCheckResult() {
|
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
function
|
|
55
|
+
function ONewName(_ref) {
|
|
56
56
|
var okrName = _ref.okrName,
|
|
57
57
|
setOkrName = _ref.setOkrName,
|
|
58
58
|
container = _ref.container,
|
|
@@ -60,14 +60,15 @@ function _default(_ref) {
|
|
|
60
60
|
setUser = _ref.setUser,
|
|
61
61
|
onOInputFocusStateChange = _ref.onOInputFocusStateChange,
|
|
62
62
|
setONameCheckResult = _ref.setONameCheckResult,
|
|
63
|
-
|
|
63
|
+
_ref$setIsInputConten = _ref.setIsInputContent,
|
|
64
|
+
setIsInputContent = _ref$setIsInputConten === void 0 ? function () {} : _ref$setIsInputConten;
|
|
64
65
|
var oCheckId = 0;
|
|
65
66
|
var timerRef = (0, _react.useRef)();
|
|
66
67
|
var okrNameIsEmpty = (0, _react.useRef)(!okrName);
|
|
67
68
|
var oldONameRef = (0, _react.useRef)("");
|
|
68
69
|
var formatUser = (0, _react.useMemo)(function () {
|
|
69
|
-
var medium = user.avatar
|
|
70
|
-
var color = user.avatar
|
|
70
|
+
var medium = user.avatar && (user.avatar.Medium || user.avatar.medium);
|
|
71
|
+
var color = user.avatar && (user.avatar.Color || user.avatar.color);
|
|
71
72
|
return {
|
|
72
73
|
Medium: medium,
|
|
73
74
|
Color: color,
|
|
@@ -84,14 +85,17 @@ function _default(_ref) {
|
|
|
84
85
|
Small: user.UserAvatar.Small,
|
|
85
86
|
Medium: user.UserAvatar.Medium
|
|
86
87
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
|
|
89
|
+
if (setUser) {
|
|
90
|
+
setUser({
|
|
91
|
+
name: user.Name,
|
|
92
|
+
id: user.Id,
|
|
93
|
+
avatar: avatar
|
|
94
|
+
});
|
|
95
|
+
}
|
|
92
96
|
}, [setUser]);
|
|
93
97
|
var getOAnalysisInfo = (0, _react.useCallback)(function () {
|
|
94
|
-
oCheckId
|
|
98
|
+
oCheckId += 1;
|
|
95
99
|
var tempCheckId = oCheckId; // @ts-ignore
|
|
96
100
|
|
|
97
101
|
return (0, _requestApi.getOAnalysisInfos)({
|
|
@@ -99,7 +103,7 @@ function _default(_ref) {
|
|
|
99
103
|
}) // @ts-ignore
|
|
100
104
|
.then(function (data) {
|
|
101
105
|
if (tempCheckId !== oCheckId) {
|
|
102
|
-
return;
|
|
106
|
+
return null;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
var result = (0, _constant.OCheckTarget)().map(function (item, index) {
|
|
@@ -121,6 +125,8 @@ function _default(_ref) {
|
|
|
121
125
|
} else {
|
|
122
126
|
setONameCheckResult(result);
|
|
123
127
|
}
|
|
128
|
+
|
|
129
|
+
return null;
|
|
124
130
|
})["catch"](function (err) {
|
|
125
131
|
_toast["default"].Error(err);
|
|
126
132
|
})["finally"](function () {
|
|
@@ -134,25 +140,26 @@ function _default(_ref) {
|
|
|
134
140
|
if (!okrName) {
|
|
135
141
|
setONameCheckResult(initOCheckResult());
|
|
136
142
|
setIsInputContent(false);
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (timerRef.current) {
|
|
143
|
+
} else if (timerRef.current) {
|
|
141
144
|
clearTimeout(timerRef.current);
|
|
142
145
|
timerRef.current = setTimeout(getOAnalysisInfo, 1000);
|
|
143
|
-
|
|
146
|
+
} else {
|
|
147
|
+
timerRef.current = setTimeout(getOAnalysisInfo, 1000);
|
|
144
148
|
}
|
|
145
149
|
|
|
146
|
-
timerRef.current = setTimeout(getOAnalysisInfo, 1000);
|
|
147
150
|
return function () {
|
|
148
151
|
clearTimeout(timerRef.current);
|
|
149
152
|
};
|
|
150
153
|
}, [okrName]);
|
|
151
154
|
var handleInputFocus = (0, _react.useCallback)(function () {
|
|
152
|
-
|
|
155
|
+
if (onOInputFocusStateChange) {
|
|
156
|
+
onOInputFocusStateChange(true);
|
|
157
|
+
}
|
|
153
158
|
}, []);
|
|
154
159
|
var handleInputBlur = (0, _react.useCallback)(function () {
|
|
155
|
-
|
|
160
|
+
if (onOInputFocusStateChange) {
|
|
161
|
+
onOInputFocusStateChange(false);
|
|
162
|
+
}
|
|
156
163
|
}, []);
|
|
157
164
|
var handleOnKeyDown = (0, _react.useCallback)(function () {
|
|
158
165
|
setIsInputContent(true);
|
|
@@ -195,4 +202,7 @@ function _default(_ref) {
|
|
|
195
202
|
container: container,
|
|
196
203
|
changeUser: changeUser
|
|
197
204
|
}));
|
|
198
|
-
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var _default = ONewName;
|
|
208
|
+
exports["default"] = _default;
|
|
@@ -71,7 +71,8 @@ function KrDatas(props) {
|
|
|
71
71
|
setKrsCheckResult = props.setKrsCheckResult,
|
|
72
72
|
krIsValidate = props.krIsValidate,
|
|
73
73
|
setKrIsValidate = props.setKrIsValidate,
|
|
74
|
-
|
|
74
|
+
_props$setIsInputCont = props.setIsInputContent,
|
|
75
|
+
setIsInputContent = _props$setIsInputCont === void 0 ? function () {} : _props$setIsInputCont;
|
|
75
76
|
var krCheckId = 0;
|
|
76
77
|
|
|
77
78
|
var _useState = (0, _react.useState)(),
|
|
@@ -144,7 +145,7 @@ function KrDatas(props) {
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
var getKrAnalysisInfo = function getKrAnalysisInfo() {
|
|
147
|
-
krCheckId
|
|
148
|
+
krCheckId += 1;
|
|
148
149
|
var tempCheckId = krCheckId;
|
|
149
150
|
(0, _requestApi.getKrAnalysisInfos)({
|
|
150
151
|
text: inputKrInfo.mileStoneName
|
|
@@ -194,10 +195,10 @@ function KrDatas(props) {
|
|
|
194
195
|
|
|
195
196
|
var changeKr = function changeKr(kr) {
|
|
196
197
|
var index = krDatas.findIndex(function (k) {
|
|
197
|
-
return k.uuid
|
|
198
|
+
return k.uuid === kr.uuid;
|
|
198
199
|
});
|
|
199
200
|
|
|
200
|
-
if (krDatas[index].krWeight
|
|
201
|
+
if (krDatas[index].krWeight !== kr.krWeight) {
|
|
201
202
|
setIsCustomWeight(true);
|
|
202
203
|
}
|
|
203
204
|
|
|
@@ -218,16 +219,13 @@ function KrDatas(props) {
|
|
|
218
219
|
finalResult: _okrCreateSuggest.EOkrCreateSuggestResultType.normal,
|
|
219
220
|
friendlyResult: []
|
|
220
221
|
});
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (timerRef.current) {
|
|
222
|
+
} else if (timerRef.current) {
|
|
225
223
|
clearTimeout(timerRef.current);
|
|
226
224
|
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
227
|
-
|
|
225
|
+
} else {
|
|
226
|
+
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
228
227
|
}
|
|
229
228
|
|
|
230
|
-
timerRef.current = setTimeout(getKrAnalysisInfo, 1000);
|
|
231
229
|
return function () {
|
|
232
230
|
clearTimeout(timerRef.current);
|
|
233
231
|
};
|
|
@@ -268,29 +266,31 @@ function KrDatas(props) {
|
|
|
268
266
|
|
|
269
267
|
var onKrInputStateChange = (0, _react.useCallback)(function (isFocus, krInfo) {
|
|
270
268
|
setInputKrInfo(krInfo);
|
|
271
|
-
|
|
269
|
+
|
|
270
|
+
if (handleKrInputStateChange) {
|
|
271
|
+
handleKrInputStateChange(isFocus);
|
|
272
|
+
}
|
|
272
273
|
}, []);
|
|
273
274
|
return /*#__PURE__*/_react["default"].createElement("div", null, krs.map(function (kr, index) {
|
|
274
275
|
return /*#__PURE__*/_react["default"].createElement(_krItem["default"], {
|
|
275
|
-
key: index,
|
|
276
276
|
krData: kr,
|
|
277
277
|
changeKr: changeKr,
|
|
278
278
|
deleteKr: deleteKr,
|
|
279
279
|
container: container,
|
|
280
280
|
index: index + 1,
|
|
281
281
|
onKrInputStateChange: onKrInputStateChange,
|
|
282
|
-
onAddKr: addKr,
|
|
283
282
|
krIsValidate: krIsValidate,
|
|
284
283
|
setIsInputContent: setIsInputContent
|
|
285
284
|
});
|
|
286
285
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
287
286
|
className: "krs-info"
|
|
288
|
-
}, /*#__PURE__*/_react["default"].createElement("
|
|
287
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
289
288
|
className: "add-kr-btn",
|
|
290
289
|
onClick: addKr
|
|
291
290
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
292
291
|
className: "add-kr-btn__icon",
|
|
293
|
-
src: _krAdd["default"]
|
|
292
|
+
src: _krAdd["default"],
|
|
293
|
+
alt: ""
|
|
294
294
|
}), (0, _getLocale.getLocale)("OKR_MyO_Pop_Butt_AddKR")), krs.length > 0 && openKrWeight && /*#__PURE__*/_react["default"].createElement("span", {
|
|
295
295
|
className: "krs-info__total-weight"
|
|
296
296
|
}, (0, _getLocale.getLocale)("OKR_MyO_Pop_Text_Total"), "\uFF1A", total, "%")));
|
|
@@ -62,8 +62,9 @@ var DynamicCreateO = function DynamicCreateO(_ref) {
|
|
|
62
62
|
okrTypeId = data.okrTypeId,
|
|
63
63
|
principalUser = data.principalUser,
|
|
64
64
|
_data$riskLevel = data.riskLevel,
|
|
65
|
-
riskLevel = _data$riskLevel === void 0 ?
|
|
66
|
-
okrStatus = data.okrStatus,
|
|
65
|
+
riskLevel = _data$riskLevel === void 0 ? 1 : _data$riskLevel,
|
|
66
|
+
_data$okrStatus = data.okrStatus,
|
|
67
|
+
okrStatus = _data$okrStatus === void 0 ? 1 : _data$okrStatus,
|
|
67
68
|
_data$okrProgress = data.okrProgress,
|
|
68
69
|
okrProgress = _data$okrProgress === void 0 ? 0 : _data$okrProgress;
|
|
69
70
|
|
|
@@ -100,13 +100,14 @@ var DemoMenuData = /*#__PURE__*/function () {
|
|
|
100
100
|
key: PAGE_RECHARGE_LIST,
|
|
101
101
|
href: "#/demofree/recharge/list",
|
|
102
102
|
isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
|
|
103
|
-
}, {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
},
|
|
103
|
+
}, // {
|
|
104
|
+
// icon: "",
|
|
105
|
+
// label: "续费状态",
|
|
106
|
+
// key: PAGE_RECHARGE_STATUS,
|
|
107
|
+
// href: "#/demofree/recharge/status",
|
|
108
|
+
// isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
|
|
109
|
+
// },
|
|
110
|
+
{
|
|
110
111
|
icon: "",
|
|
111
112
|
label: "数据统计",
|
|
112
113
|
key: PAGE_RECHARGE_STATISTICS,
|
|
@@ -75,7 +75,7 @@ function OScore(props) {
|
|
|
75
75
|
refreshAll = _useContext.refreshAll;
|
|
76
76
|
|
|
77
77
|
var _useState3 = (0, _react.useState)({
|
|
78
|
-
score: score
|
|
78
|
+
score: Number(score) === 1 ? "1" : Number(score).toFixed(2) * 1
|
|
79
79
|
}),
|
|
80
80
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
81
|
formFiedlsValue = _useState4[0],
|
|
@@ -85,7 +85,7 @@ function OScore(props) {
|
|
|
85
85
|
var formRef = (0, _react.useRef)();
|
|
86
86
|
(0, _react.useEffect)(function () {
|
|
87
87
|
setFormFiedlsValue({
|
|
88
|
-
score: score
|
|
88
|
+
score: Number(score) === 1 ? "1" : Number(score).toFixed(2) * 1
|
|
89
89
|
});
|
|
90
90
|
}, [score]);
|
|
91
91
|
|
|
@@ -115,9 +115,7 @@ function OScore(props) {
|
|
|
115
115
|
} else {
|
|
116
116
|
_toast["default"].Error(res.Message || "".concat((0, _getLocale.getLocale)("OKR_MyO_Ew_Fail")));
|
|
117
117
|
}
|
|
118
|
-
})["catch"](function (
|
|
119
|
-
console.log(err);
|
|
120
|
-
|
|
118
|
+
})["catch"](function () {
|
|
121
119
|
_toast["default"].Error("".concat((0, _getLocale.getLocale)("OKR_MyO_Ew_Fail")));
|
|
122
120
|
});
|
|
123
121
|
};
|
|
@@ -133,7 +131,7 @@ function OScore(props) {
|
|
|
133
131
|
score: score,
|
|
134
132
|
onClick: changeOScore
|
|
135
133
|
}, restProps)), /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
136
|
-
title: "
|
|
134
|
+
title: "".concat((0, _getLocale.getLocale)("Mod_Objective")).concat((0, _getLocale.getLocale)("Per_Ass_New_Appr_detail_Scor")),
|
|
137
135
|
visible: visible,
|
|
138
136
|
animation: "slide-fade",
|
|
139
137
|
maskAnimation: "fade",
|
|
@@ -47,8 +47,8 @@ function _getInstance() {
|
|
|
47
47
|
style: {
|
|
48
48
|
top: "36px",
|
|
49
49
|
left: "50%",
|
|
50
|
-
position: "
|
|
51
|
-
// 'transform': 'translate(-50%, 0)'
|
|
50
|
+
position: "fixed",
|
|
51
|
+
// 'transform': 'translate(-50%, 0)',
|
|
52
52
|
borderRadius: 12
|
|
53
53
|
},
|
|
54
54
|
maxCount: 1,
|
|
@@ -90,11 +90,7 @@ var Toast = /*#__PURE__*/function () {
|
|
|
90
90
|
while (1) {
|
|
91
91
|
switch (_context.prev = _context.next) {
|
|
92
92
|
case 0:
|
|
93
|
-
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {
|
|
94
|
-
style: {
|
|
95
|
-
position: "fixed"
|
|
96
|
-
}
|
|
97
|
-
};
|
|
93
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
98
94
|
key = (0, _uuid["default"])();
|
|
99
95
|
_context.next = 4;
|
|
100
96
|
return getInstance();
|
package/lib/utils/open-data.js
CHANGED
|
@@ -178,7 +178,8 @@ var parseTag = function parseTag(str) {
|
|
|
178
178
|
} else {
|
|
179
179
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
180
180
|
style: {
|
|
181
|
-
color: "#1890ff"
|
|
181
|
+
color: "#1890ff",
|
|
182
|
+
margin: '0 4px'
|
|
182
183
|
},
|
|
183
184
|
onClick: function onClick(e) {
|
|
184
185
|
return e.stopPropagation();
|