@titaui/pc 1.10.10 → 1.10.11
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.
|
@@ -19,6 +19,10 @@ var _clickLink = _interopRequireWildcard(require("../util/click-link"));
|
|
|
19
19
|
|
|
20
20
|
var _getLocale = require("../../../utils/getLocale");
|
|
21
21
|
|
|
22
|
+
var _OKRprogressEmpty = _interopRequireDefault(require("../image/OKRprogress-empty.png"));
|
|
23
|
+
|
|
24
|
+
var _Progress = _interopRequireDefault(require("../image/Progress.png"));
|
|
25
|
+
|
|
22
26
|
require("../index.css");
|
|
23
27
|
|
|
24
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -27,8 +31,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
31
|
|
|
28
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
33
|
|
|
30
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
31
|
-
|
|
32
34
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
35
|
|
|
34
36
|
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."); }
|
|
@@ -71,38 +73,26 @@ function OKRProgressComponent() {
|
|
|
71
73
|
|
|
72
74
|
(0, _react.useEffect)(function () {
|
|
73
75
|
(0, _network["default"])(ComponentId).then(function (res) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
79
|
-
var item = _step.value;
|
|
80
|
-
|
|
81
|
-
switch (item.componentDataProp) {
|
|
82
|
-
case "allMyProgressCount":
|
|
83
|
-
setHadUpdateOkrNum(item.componentDataCount);
|
|
84
|
-
break;
|
|
76
|
+
Object.values(res).forEach(function (item) {
|
|
77
|
+
if (item.componentDataProp === "allMyProgressCount") {
|
|
78
|
+
setHadUpdateOkrNum(item.componentDataCount);
|
|
79
|
+
}
|
|
85
80
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
if (item.componentDataProp === "allMyNoProgressCount") {
|
|
82
|
+
setHadNotUpdateOkrNum(item.componentDataCount);
|
|
83
|
+
}
|
|
89
84
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
85
|
+
if (item.componentDataProp === "weekLatelyUpdatekrProgress") {
|
|
86
|
+
setWeekLatelyUpdatekrProgress(item.componentDataCount);
|
|
93
87
|
}
|
|
94
|
-
}
|
|
95
|
-
_iterator.e(err);
|
|
96
|
-
} finally {
|
|
97
|
-
_iterator.f();
|
|
98
|
-
}
|
|
88
|
+
});
|
|
99
89
|
});
|
|
100
90
|
}, []);
|
|
101
91
|
(0, _react.useEffect)(function () {
|
|
102
92
|
if (hadUpdateOkrNum + hadNotUpdateOkrNum === 0) {
|
|
103
|
-
|
|
93
|
+
setIsMyOKREmpty(isMyOKREmpty);
|
|
104
94
|
} else {
|
|
105
|
-
|
|
95
|
+
setIsMyOKREmpty(!isMyOKREmpty);
|
|
106
96
|
setUpdatePercent(Number.parseFloat((hadUpdateOkrNum / (hadNotUpdateOkrNum + hadUpdateOkrNum)).toFixed(2)) * 100);
|
|
107
97
|
}
|
|
108
98
|
}, [hadUpdateOkrNum + hadNotUpdateOkrNum]);
|
|
@@ -119,16 +109,16 @@ function OKRProgressComponent() {
|
|
|
119
109
|
padding: "20px 22px 0"
|
|
120
110
|
}
|
|
121
111
|
}, /*#__PURE__*/_react["default"].createElement(_commenComponents.CardTitle, {
|
|
122
|
-
content: (0, _getLocale.getLocale)("
|
|
123
|
-
iconUrl:
|
|
112
|
+
content: (0, _getLocale.getLocale)("HP_KRProgress"),
|
|
113
|
+
iconUrl: _Progress["default"],
|
|
124
114
|
tips: (0, _getLocale.getLocale)("HP_ProgressKROKR")
|
|
125
|
-
}, !isMyOKREmpty && /*#__PURE__*/_react["default"].createElement("
|
|
115
|
+
}, !isMyOKREmpty && /*#__PURE__*/_react["default"].createElement("span", {
|
|
126
116
|
onClick: function onClick() {
|
|
127
117
|
return (0, _clickLink["default"])("okr%2Fmanage");
|
|
128
118
|
},
|
|
129
119
|
className: "grid-component-card-title__behave"
|
|
130
120
|
}, (0, _getLocale.getLocale)("OKR_OKRW_Gotoupdate"))), isMyOKREmpty ? /*#__PURE__*/_react["default"].createElement(_commenComponents.EmptyBackGround, {
|
|
131
|
-
imgSrc:
|
|
121
|
+
imgSrc: _OKRprogressEmpty["default"],
|
|
132
122
|
content: (0, _getLocale.getLocale)("HP_Regulgoodwork"),
|
|
133
123
|
behave: {
|
|
134
124
|
type: "moreinfo",
|