@titaui/pc 1.7.2 → 1.7.3
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.
|
@@ -47,7 +47,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
47
47
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
48
48
|
|
|
49
49
|
function _formatCycleData(periodParams, getCycleRange) {
|
|
50
|
-
debugger;
|
|
51
50
|
if (!periodParams) return "";
|
|
52
51
|
var startDate = periodParams.startDate;
|
|
53
52
|
var endDate = periodParams.endDate;
|
|
@@ -63,7 +63,6 @@ var dealYearsRange = function dealYearsRange(yearsRange, showAllYears) {
|
|
|
63
63
|
exports.dealYearsRange = dealYearsRange;
|
|
64
64
|
|
|
65
65
|
var formatPeriod = function formatPeriod(selected) {
|
|
66
|
-
debugger;
|
|
67
66
|
if (!selected) return "";
|
|
68
67
|
var quarter = ["", "第一季度", "第二季度", "第三季度", "第四季度"];
|
|
69
68
|
var cycleDate = "";
|
|
@@ -222,6 +222,13 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
222
222
|
var isShowPeriod = (0, _react.useMemo)(function () {
|
|
223
223
|
return Number(query.cycleType) == -1;
|
|
224
224
|
}, [query]);
|
|
225
|
+
var replaceOkr = (0, _react.useCallback)(function (data) {
|
|
226
|
+
var index = okrsRef.current.findIndex(function (item) {
|
|
227
|
+
return item.workId == data.workId;
|
|
228
|
+
});
|
|
229
|
+
okrsRef.current.splice(index, 1, data);
|
|
230
|
+
setOkrs(_toConsumableArray(okrsRef.current));
|
|
231
|
+
}, [okrs]);
|
|
225
232
|
|
|
226
233
|
var openCreateModal = function openCreateModal() {
|
|
227
234
|
headerRef && headerRef.current.openCreateModal();
|
|
@@ -259,6 +266,10 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
259
266
|
OkrListCmp: OkrListCmp,
|
|
260
267
|
okrs: okrs,
|
|
261
268
|
setOkrs: setOkrs,
|
|
269
|
+
refreshList: function refreshList() {
|
|
270
|
+
return setTimeout(getOkrs, 500);
|
|
271
|
+
},
|
|
272
|
+
replaceOkr: replaceOkr,
|
|
262
273
|
isShowPrincple: isShowPrincple,
|
|
263
274
|
isShowPeriod: isShowPeriod,
|
|
264
275
|
isShowEasyCreate: relation != 2 && relation != 3,
|
|
@@ -27,13 +27,17 @@ var List = function List(props) {
|
|
|
27
27
|
isShowPrincple = props.isShowPrincple,
|
|
28
28
|
isShowPeriod = props.isShowPeriod,
|
|
29
29
|
openCreateModal = props.openCreateModal,
|
|
30
|
-
isShowEasyCreate = props.isShowEasyCreate
|
|
30
|
+
isShowEasyCreate = props.isShowEasyCreate,
|
|
31
|
+
refreshList = props.refreshList,
|
|
32
|
+
replaceOkr = props.replaceOkr;
|
|
31
33
|
var OkrListCmp = props.OkrListCmp;
|
|
32
34
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(OkrListCmp, {
|
|
33
35
|
okrData: okrs,
|
|
34
36
|
addOkr: function addOkr(okr) {
|
|
35
37
|
setOkrs([].concat(_toConsumableArray(okrs), [okr]));
|
|
36
38
|
},
|
|
39
|
+
refreshList: refreshList,
|
|
40
|
+
replaceOkr: replaceOkr,
|
|
37
41
|
onpenCreateModalWithData: function onpenCreateModalWithData(data) {// createModalRef.current && createModalRef.current.setData(data);
|
|
38
42
|
// setVisible(true);
|
|
39
43
|
},
|