@titaui/pc 1.10.28 → 1.10.31
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 +16 -16
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +3 -2
- package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +7 -1
- package/lib/components/menus/export-modules/demo-menus/menus.js +21 -11
- package/lib/components/okr-detail/components/header/o-score.js +4 -6
- 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,32 +266,34 @@ 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
|
-
}, (0, _getLocale.getLocale)("OKR_MyO_Pop_Text_Total"),
|
|
296
|
+
}, (0, _getLocale.getLocale)("OKR_MyO_Pop_Text_Total"), total, "%")));
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
var _default = KrDatas;
|
|
@@ -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
|
|
|
@@ -25,7 +25,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
25
25
|
_createClass(_default, [{
|
|
26
26
|
key: "highlight",
|
|
27
27
|
value: function highlight(cb) {
|
|
28
|
-
if (this.isUnAssigned()) cb(_menus.PAGE_UNASSIGNED_DEMOFREE);else if (this.isAssigned()) cb(_menus.PAGE_ASSIGNED_DEMOFREE);else if (this.isReserved()) cb(_menus.PAGE_RESERVED_DEMOFREE);else if (this.isDone()) cb(_menus.PAGE_DONE_DEMOFREE);else if (this.isIgnore()) cb(_menus.PAGE_IGNORED_DEMOFREE);else if (this.isChart()) cb(_menus.PAGE_CHARTS_DEMOFREE);else if (this.isRechargeList()) cb(_menus.PAGE_RECHARGE_LIST);else if (this.isRechargeStatistics()) cb(_menus.PAGE_RECHARGE_STATISTICS);else if (this.isRechargeStatus()) cb(_menus.PAGE_RECHARGE_STATUS);
|
|
28
|
+
if (this.isUnAssigned()) cb(_menus.PAGE_UNASSIGNED_DEMOFREE);else if (this.isAssigned()) cb(_menus.PAGE_ASSIGNED_DEMOFREE);else if (this.isReserved()) cb(_menus.PAGE_RESERVED_DEMOFREE);else if (this.isDone()) cb(_menus.PAGE_DONE_DEMOFREE);else if (this.isIgnore()) cb(_menus.PAGE_IGNORED_DEMOFREE);else if (this.isChart()) cb(_menus.PAGE_CHARTS_DEMOFREE);else if (this.isRechargeList()) cb(_menus.PAGE_RECHARGE_LIST);else if (this.isRechargeStatistics()) cb(_menus.PAGE_RECHARGE_STATISTICS);else if (this.isRechargeStatus()) cb(_menus.PAGE_RECHARGE_STATUS);else if (this.isDueDateOrder()) cb(_menus.PAGE_DUEDATE_ORDER);
|
|
29
29
|
}
|
|
30
30
|
}, {
|
|
31
31
|
key: "isChart",
|
|
@@ -39,6 +39,12 @@ var _default = /*#__PURE__*/function () {
|
|
|
39
39
|
var pathname = this.history.location.pathname;
|
|
40
40
|
return pathname.match(/demofree\/recharge\/status/);
|
|
41
41
|
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "isDueDateOrder",
|
|
44
|
+
value: function isDueDateOrder() {
|
|
45
|
+
var pathname = this.history.location.pathname;
|
|
46
|
+
return pathname.match(/demofree\/recharge\/order/);
|
|
47
|
+
}
|
|
42
48
|
}, {
|
|
43
49
|
key: "isRechargeList",
|
|
44
50
|
value: function isRechargeList() {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.defaultRefObject = exports["default"] = exports.PAGE_UNASSIGNED_DEMOFREE = exports.PAGE_RESERVED_DEMOFREE = exports.PAGE_RECHARGE_STATUS = exports.PAGE_RECHARGE_STATISTICS = exports.PAGE_RECHARGE_LIST = exports.PAGE_IGNORED_DEMOFREE = exports.PAGE_DONE_DEMOFREE = exports.PAGE_CHARTS_DEMOFREE = exports.PAGE_ASSIGNED_DEMOFREE = void 0;
|
|
6
|
+
exports.defaultRefObject = exports["default"] = exports.PAGE_UNASSIGNED_DEMOFREE = exports.PAGE_RESERVED_DEMOFREE = exports.PAGE_RECHARGE_STATUS = exports.PAGE_RECHARGE_STATISTICS = exports.PAGE_RECHARGE_LIST = exports.PAGE_IGNORED_DEMOFREE = exports.PAGE_DUEDATE_ORDER = exports.PAGE_DONE_DEMOFREE = exports.PAGE_CHARTS_DEMOFREE = exports.PAGE_ASSIGNED_DEMOFREE = void 0;
|
|
7
7
|
|
|
8
8
|
var _index = require("../../components/menu-tree/tree-node/index");
|
|
9
9
|
|
|
@@ -41,6 +41,8 @@ var PAGE_CHARTS_DEMOFREE = "charts";
|
|
|
41
41
|
exports.PAGE_CHARTS_DEMOFREE = PAGE_CHARTS_DEMOFREE;
|
|
42
42
|
var PAGE_RECHARGE_LIST = "rechargeList";
|
|
43
43
|
exports.PAGE_RECHARGE_LIST = PAGE_RECHARGE_LIST;
|
|
44
|
+
var PAGE_DUEDATE_ORDER = "dueDateOrder";
|
|
45
|
+
exports.PAGE_DUEDATE_ORDER = PAGE_DUEDATE_ORDER;
|
|
44
46
|
var PAGE_RECHARGE_STATISTICS = "rechargeStatistics";
|
|
45
47
|
exports.PAGE_RECHARGE_STATISTICS = PAGE_RECHARGE_STATISTICS;
|
|
46
48
|
var PAGE_RECHARGE_STATUS = "rechargeStatus";
|
|
@@ -102,17 +104,25 @@ var DemoMenuData = /*#__PURE__*/function () {
|
|
|
102
104
|
isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
|
|
103
105
|
}, {
|
|
104
106
|
icon: "",
|
|
105
|
-
label: "
|
|
106
|
-
key:
|
|
107
|
-
href: "#/demofree/recharge/
|
|
107
|
+
label: "到期订单",
|
|
108
|
+
key: PAGE_DUEDATE_ORDER,
|
|
109
|
+
href: "#/demofree/recharge/order",
|
|
108
110
|
isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
111
|
+
} // {
|
|
112
|
+
// icon: "",
|
|
113
|
+
// label: "续费状态",
|
|
114
|
+
// key: PAGE_RECHARGE_STATUS,
|
|
115
|
+
// href: "#/demofree/recharge/status",
|
|
116
|
+
// isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
|
|
117
|
+
// },
|
|
118
|
+
// {
|
|
119
|
+
// icon: "",
|
|
120
|
+
// label: "数据统计",
|
|
121
|
+
// key: PAGE_RECHARGE_STATISTICS,
|
|
122
|
+
// href: "#/demofree/recharge/statistics",
|
|
123
|
+
// isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
|
|
124
|
+
// },
|
|
125
|
+
]
|
|
116
126
|
}, {
|
|
117
127
|
icon: "KH-help",
|
|
118
128
|
label: "预约演示报表",
|
|
@@ -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",
|
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();
|