@titaui/pc 1.7.16 → 1.7.20
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/index.js +6 -6
- package/lib/components/drop-selector/index.js +1 -0
- package/lib/components/nav-top/components/user-own-menu/utils.js +1 -1
- package/lib/components/nav-top/index.js +2 -2
- package/lib/components/okr-detail/e-list/images/e-list-empty.png +0 -0
- package/lib/components/okr-detail/e-list/index.css +19 -1
- package/lib/components/okr-detail/e-list/index.js +32 -8
- package/lib/components/okr-detail/e-list/util.js +49 -22
- package/lib/components/select-tags/index.css +7 -0
- package/lib/components/user-selector/index.js +1 -1
- package/package.json +1 -1
- package/src/components/create-okr-modal/index.tsx +6 -6
- package/src/components/drop-selector/index.js +1 -0
- package/src/components/nav-top/components/user-own-menu/utils.ts +1 -3
- package/src/components/nav-top/index.tsx +2 -2
- package/src/components/okr-detail/e-list/images/e-list-empty.png +0 -0
- package/src/components/okr-detail/e-list/index.js +121 -70
- package/src/components/okr-detail/e-list/index.scss +17 -2
- package/src/components/okr-detail/e-list/util.ts +44 -18
- package/src/components/select-tags/index.scss +6 -0
- package/src/components/user-selector/index.js +1 -1
|
@@ -106,8 +106,8 @@ function CreateOkrModal(_ref, ref) {
|
|
|
106
106
|
var initCycle = _ref.initCycle,
|
|
107
107
|
userInfo = _ref.userInfo,
|
|
108
108
|
onSuccess = _ref.onSuccess,
|
|
109
|
-
_ref$
|
|
110
|
-
|
|
109
|
+
_ref$isHiddenCreatedC = _ref.isHiddenCreatedCard,
|
|
110
|
+
isHiddenCreatedCard = _ref$isHiddenCreatedC === void 0 ? false : _ref$isHiddenCreatedC,
|
|
111
111
|
_ref$handleCreatedClo = _ref.handleCreatedClose,
|
|
112
112
|
handleCreatedClose = _ref$handleCreatedClo === void 0 ? function () {} : _ref$handleCreatedClo,
|
|
113
113
|
_ref$visible = _ref.visible,
|
|
@@ -355,7 +355,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
355
355
|
data.userAvatarBase64Url = userAvatarBase64Url;
|
|
356
356
|
setCreatedSuccessInfo(data);
|
|
357
357
|
|
|
358
|
-
if (!localStorage.getItem("dontShowValue".concat(userId)) && !
|
|
358
|
+
if (!localStorage.getItem("dontShowValue".concat(userId)) && !isHiddenCreatedCard && !isApplyTpl) {
|
|
359
359
|
setShowCreatedSuccessInfo(true);
|
|
360
360
|
setTipIndex(Math.floor(Math.random() * 6));
|
|
361
361
|
} else {
|
|
@@ -514,7 +514,7 @@ function CreateOkrModal(_ref, ref) {
|
|
|
514
514
|
case 28:
|
|
515
515
|
hideCreateOkrModal();
|
|
516
516
|
|
|
517
|
-
if (onSuccess || !
|
|
517
|
+
if (onSuccess || !isHiddenCreatedCard) {
|
|
518
518
|
// 带上超过创建okr人数的计算值
|
|
519
519
|
krNum = krDatas.length;
|
|
520
520
|
krTotalLength = 0;
|
|
@@ -903,14 +903,14 @@ function CreateOkrModal(_ref, ref) {
|
|
|
903
903
|
className: "teach-suggest teach-suggest__kr",
|
|
904
904
|
src: _hand["default"],
|
|
905
905
|
onClick: handleShowKrSuggest
|
|
906
|
-
})))), !isApplyTpl && !
|
|
906
|
+
})))), !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement(_createSuccessCmpWrapper["default"], null, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
|
|
907
907
|
tipIndex: tipIndex,
|
|
908
908
|
createdSuccessInfo: createdSuccessInfo,
|
|
909
909
|
isDownload: false,
|
|
910
910
|
onCloseModel: handleCloseShowSuccessInfo,
|
|
911
911
|
onShowDetail: handleCloseAndShowDetail,
|
|
912
912
|
downLoadRef: downloadDomRef
|
|
913
|
-
})) : null, !isApplyTpl && !
|
|
913
|
+
})) : null, !isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
914
914
|
className: "download-dom--hidden"
|
|
915
915
|
}, /*#__PURE__*/_react["default"].createElement(_createSuccessCmp["default"], {
|
|
916
916
|
tipIndex: tipIndex,
|
|
@@ -38,7 +38,7 @@ var getOwnSet = function getOwnSet() {
|
|
|
38
38
|
id: "role",
|
|
39
39
|
url: "tu-icon-gongsi",
|
|
40
40
|
title: "企业管理规定",
|
|
41
|
-
objUrl: "".concat(apiServer, "/u/").concat(userId, "/Home
|
|
41
|
+
objUrl: "".concat(apiServer, "/u/").concat(userId, "/Home#/enterprise/manage")
|
|
42
42
|
}];
|
|
43
43
|
var exit = [{
|
|
44
44
|
id: "Logout",
|
|
@@ -108,11 +108,11 @@ var NavTop = function NavTop() {
|
|
|
108
108
|
}, []);
|
|
109
109
|
|
|
110
110
|
var handleHashChange = function handleHashChange() {
|
|
111
|
-
var hash = location.hash || "";
|
|
111
|
+
var hash = location.hash.split('?')[0] || "";
|
|
112
112
|
|
|
113
113
|
if (hash) {
|
|
114
114
|
var activeMenu = menu.find(function (item) {
|
|
115
|
-
return hash.includes(item.href.split("#")[1]);
|
|
115
|
+
return hash.includes(item.href.split("#")[1].split('?')[0]);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
if (hash.includes('homepage')) {
|
|
Binary file
|
|
@@ -4,6 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
.okr-detail-e .e__divider {
|
|
6
6
|
height: 8px;
|
|
7
|
-
background: #
|
|
7
|
+
background: #f0f2f5;
|
|
8
8
|
margin: 10px 32px;
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
.okr-detail-e__empty {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
align-items: center;
|
|
15
|
+
padding-top: 117px;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.okr-detail-e__empty-img {
|
|
20
|
+
width: 128px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.okr-detail-e__empty-text {
|
|
24
|
+
color: #3f4755;
|
|
25
|
+
line-height: 22px;
|
|
26
|
+
margin-top: 20px;
|
|
27
|
+
}
|
|
@@ -25,6 +25,10 @@ var _loading = _interopRequireDefault(require("../loading"));
|
|
|
25
25
|
|
|
26
26
|
var _bsGlobal = require("../../../utils/bs-global");
|
|
27
27
|
|
|
28
|
+
var _conditionRender = _interopRequireDefault(require("../../condition-render"));
|
|
29
|
+
|
|
30
|
+
var _eListEmpty = _interopRequireDefault(require("./images/e-list-empty.png"));
|
|
31
|
+
|
|
28
32
|
require("./index.css");
|
|
29
33
|
|
|
30
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -45,7 +49,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
45
49
|
|
|
46
50
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
51
|
|
|
48
|
-
var preCls =
|
|
52
|
+
var preCls = "okr-detail-e";
|
|
49
53
|
|
|
50
54
|
var _default = function _default(props) {
|
|
51
55
|
var okrId = props.okrId;
|
|
@@ -67,7 +71,7 @@ var _default = function _default(props) {
|
|
|
67
71
|
selectUsers = _useState6[0],
|
|
68
72
|
setSelectUsers = _useState6[1];
|
|
69
73
|
|
|
70
|
-
var _useState7 = (0, _react.useState)(hasCondition ? localStorage.getItem("okrDrawerESelectName".concat(loginUser)) :
|
|
74
|
+
var _useState7 = (0, _react.useState)(hasCondition ? localStorage.getItem("okrDrawerESelectName".concat(loginUser)) : "orderBySystem"),
|
|
71
75
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
72
76
|
selectName = _useState8[0],
|
|
73
77
|
setSelectName = _useState8[1];
|
|
@@ -102,20 +106,25 @@ var _default = function _default(props) {
|
|
|
102
106
|
loading = _useState20[0],
|
|
103
107
|
setLoading = _useState20[1];
|
|
104
108
|
|
|
109
|
+
var _useState21 = (0, _react.useState)(0),
|
|
110
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
111
|
+
totalDataNum = _useState22[0],
|
|
112
|
+
setTotalDataNum = _useState22[1];
|
|
113
|
+
|
|
105
114
|
var getKrEsData = function getKrEsData() {
|
|
106
115
|
setLoading(true);
|
|
107
116
|
(0, _requestApis.getKrsByCondition)({
|
|
108
117
|
okrId: okrId,
|
|
109
|
-
|
|
118
|
+
"condition": (0, _util.formatCondition)({
|
|
110
119
|
okrId: okrId,
|
|
111
120
|
noteOrder: noteOrder,
|
|
112
121
|
selectName: selectName,
|
|
113
122
|
checkedStatus: checkedStatus,
|
|
114
123
|
users: selectUsers,
|
|
115
|
-
|
|
124
|
+
"keyWord": searchKey
|
|
116
125
|
})
|
|
117
126
|
}).then(function (krs) {
|
|
118
|
-
var formatKrs = (0, _util.formatEListDataToSelectTree)(krs, okrId);
|
|
127
|
+
var formatKrs = (0, _util.formatEListDataToSelectTree)(krs, okrId, (0, _util.getIfInitCondition)(selectName, checkedStatus, selectUsers, searchKey));
|
|
119
128
|
var expandedKrEs = (formatKrs.krsEList || []).map(function (it) {
|
|
120
129
|
return it.key;
|
|
121
130
|
});
|
|
@@ -133,9 +142,13 @@ var _default = function _default(props) {
|
|
|
133
142
|
(0, _react.useEffect)(function () {
|
|
134
143
|
getKrEsData();
|
|
135
144
|
}, [noteOrder, searchKey, selectName, checkedStatus, selectUsers]);
|
|
145
|
+
(0, _react.useEffect)(function () {
|
|
146
|
+
var oElistLength = oEList[0] && oEList[0].length || 0;
|
|
147
|
+
setTotalDataNum(krList.length + oElistLength);
|
|
148
|
+
}, [krList, oEList]);
|
|
136
149
|
return /*#__PURE__*/_react["default"].createElement(_context.EListContext.Provider, {
|
|
137
150
|
value: {
|
|
138
|
-
|
|
151
|
+
"refreshEList": getKrEsData
|
|
139
152
|
}
|
|
140
153
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
141
154
|
className: preCls
|
|
@@ -150,7 +163,9 @@ var _default = function _default(props) {
|
|
|
150
163
|
selectUsers: selectUsers,
|
|
151
164
|
setSelectUsers: setSelectUsers,
|
|
152
165
|
okrId: okrId
|
|
153
|
-
})), !loading ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null,
|
|
166
|
+
})), !loading ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
167
|
+
condition: totalDataNum !== 0
|
|
168
|
+
}, krList.map(function (kr, index) {
|
|
154
169
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], {
|
|
155
170
|
padding: "0 32px 0 18px"
|
|
156
171
|
}, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
|
|
@@ -167,7 +182,16 @@ var _default = function _default(props) {
|
|
|
167
182
|
data: kr,
|
|
168
183
|
defaultExpandedKeys: expandedOEs
|
|
169
184
|
}));
|
|
170
|
-
}))
|
|
185
|
+
})), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
186
|
+
condition: totalDataNum === 0
|
|
187
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
188
|
+
className: "".concat(preCls, "__empty")
|
|
189
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
190
|
+
className: "".concat(preCls, "__empty-img"),
|
|
191
|
+
src: _eListEmpty["default"]
|
|
192
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
193
|
+
className: "".concat(preCls, "__empty-text")
|
|
194
|
+
}, "\u6CA1\u6709\u641C\u7D22\u5230\u7B26\u5408\u6761\u4EF6\u7684E-\u6267\u884C")))) : /*#__PURE__*/_react["default"].createElement(_loading["default"], {
|
|
171
195
|
type: "panel"
|
|
172
196
|
})));
|
|
173
197
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.toTree = exports.getETreeNode = exports.formatTreeDataToNode = exports.formatEListDataToSelectTree = exports.formatCondition = void 0;
|
|
6
|
+
exports.toTree = exports.getIfInitCondition = exports.getETreeNode = exports.formatTreeDataToNode = exports.formatEListDataToSelectTree = exports.formatCondition = void 0;
|
|
7
7
|
|
|
8
8
|
var _cloneDeep = _interopRequireDefault(require("clone-deep"));
|
|
9
9
|
|
|
@@ -75,24 +75,43 @@ var getETreeNode = function getETreeNode(tasks, isFirstLevel, createUserId, krUs
|
|
|
75
75
|
|
|
76
76
|
exports.getETreeNode = getETreeNode;
|
|
77
77
|
|
|
78
|
-
var formatTreeDataToNode = function formatTreeDataToNode(tree) {
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
var formatTreeDataToNode = function formatTreeDataToNode(tree, isInitCondition) {
|
|
79
|
+
if (isInitCondition) {
|
|
80
|
+
return tree.map(function (item, index) {
|
|
81
|
+
return {
|
|
82
|
+
'key': item.mileStoneId,
|
|
83
|
+
'index': index,
|
|
84
|
+
'title': item.mileStoneId !== 0 ? item.mileStoneName : '目标下的其他执行',
|
|
85
|
+
'nodeType': 'e-kr',
|
|
86
|
+
'isLeaf': false,
|
|
87
|
+
'children': getETreeNode(item.tasks, true, item.createUserId, item.user),
|
|
88
|
+
'data': _objectSpread({}, item),
|
|
89
|
+
'isOTask': item.mileStoneId === 0
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
var result = [];
|
|
94
|
+
tree.forEach(function (item, index) {
|
|
95
|
+
if (item.tasks && item.tasks.length > 0) {
|
|
96
|
+
result.push({
|
|
97
|
+
'key': item.mileStoneId,
|
|
98
|
+
'index': index,
|
|
99
|
+
'title': item.mileStoneId !== 0 ? item.mileStoneName : '目标下的其他执行',
|
|
100
|
+
'nodeType': 'e-kr',
|
|
101
|
+
'isLeaf': false,
|
|
102
|
+
'children': getETreeNode(item.tasks, true, item.createUserId, item.user),
|
|
103
|
+
'data': _objectSpread({}, item),
|
|
104
|
+
'isOTask': item.mileStoneId === 0
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
91
110
|
};
|
|
92
111
|
|
|
93
112
|
exports.formatTreeDataToNode = formatTreeDataToNode;
|
|
94
113
|
|
|
95
|
-
var formatEListDataToSelectTree = function formatEListDataToSelectTree(data, workId) {
|
|
114
|
+
var formatEListDataToSelectTree = function formatEListDataToSelectTree(data, workId, isInitCondition) {
|
|
96
115
|
var tree = data.map(function (item) {
|
|
97
116
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
98
117
|
'tasks': toTree(item.tasks)
|
|
@@ -100,15 +119,13 @@ var formatEListDataToSelectTree = function formatEListDataToSelectTree(data, wor
|
|
|
100
119
|
});
|
|
101
120
|
var formatKrsTreeDataToNode = formatTreeDataToNode(tree.filter(function (d) {
|
|
102
121
|
return d.mileStoneId !== 0;
|
|
103
|
-
}));
|
|
122
|
+
}), isInitCondition);
|
|
104
123
|
var formatOTreeDataToNode = formatTreeDataToNode(tree.filter(function (d) {
|
|
105
124
|
return d.mileStoneId === 0;
|
|
106
|
-
}));
|
|
125
|
+
}), isInitCondition);
|
|
107
126
|
var result = {
|
|
108
127
|
'krsEList': formatKrsTreeDataToNode,
|
|
109
|
-
'oEList': formatOTreeDataToNode.length
|
|
110
|
-
return d.mileStoneId === 0;
|
|
111
|
-
}))] : [[{
|
|
128
|
+
'oEList': isInitCondition && formatOTreeDataToNode.length === 0 ? [[{
|
|
112
129
|
'key': 0,
|
|
113
130
|
'index': 0,
|
|
114
131
|
'title': '目标下的其他执行',
|
|
@@ -128,7 +145,7 @@ var formatEListDataToSelectTree = function formatEListDataToSelectTree(data, wor
|
|
|
128
145
|
mileStoneId: 0
|
|
129
146
|
},
|
|
130
147
|
'isOTask': true
|
|
131
|
-
}]]
|
|
148
|
+
}]] : [formatOTreeDataToNode]
|
|
132
149
|
};
|
|
133
150
|
return result;
|
|
134
151
|
};
|
|
@@ -182,4 +199,14 @@ var formatCondition = function formatCondition(_ref) {
|
|
|
182
199
|
};
|
|
183
200
|
};
|
|
184
201
|
|
|
185
|
-
exports.formatCondition = formatCondition;
|
|
202
|
+
exports.formatCondition = formatCondition;
|
|
203
|
+
|
|
204
|
+
var getIfInitCondition = function getIfInitCondition(selectName, checkedStatus, users, keyWord) {
|
|
205
|
+
if (keyWord || selectName !== 'orderBySystem' || checkedStatus.length !== 0 || users.length !== 0) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return true;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
exports.getIfInitCondition = getIfInitCondition;
|
|
@@ -50,6 +50,13 @@
|
|
|
50
50
|
margin-bottom: 7px;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
.rc-select-multiple .rc-select-selector .rc-select-selection-placeholder {
|
|
54
|
+
line-height: 1;
|
|
55
|
+
margin-bottom: 7px;
|
|
56
|
+
position: relative;
|
|
57
|
+
top: -2px;
|
|
58
|
+
}
|
|
59
|
+
|
|
53
60
|
.rc-select-selection-item-content {
|
|
54
61
|
margin-right: 8px;
|
|
55
62
|
}
|
|
@@ -17,7 +17,7 @@ var _singleSelector = _interopRequireDefault(require("./export-modules/single-se
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
-
_fieldTreeSelector["default"].
|
|
20
|
+
_fieldTreeSelector["default"].Single = _singleSelector["default"];
|
|
21
21
|
_fieldTreeSelector["default"].Group = _groupSelector["default"];
|
|
22
22
|
_fieldTreeSelector["default"].Depart = _departSearchSelector["default"];
|
|
23
23
|
_fieldTreeSelector["default"].Duties = _dutiesSelector["default"];
|
package/package.json
CHANGED
|
@@ -67,7 +67,7 @@ interface Props {
|
|
|
67
67
|
userInfo?: UserInfoObj;
|
|
68
68
|
onSuccess?: Function;
|
|
69
69
|
onClose?: Function;
|
|
70
|
-
|
|
70
|
+
isHiddenCreatedCard?: boolean;
|
|
71
71
|
handleCreatedClose?:Function;
|
|
72
72
|
visible?: boolean;
|
|
73
73
|
}
|
|
@@ -80,7 +80,7 @@ const initOCheckResult = OCheckTarget.map((item) => {
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
function CreateOkrModal(
|
|
83
|
-
{ initCycle, userInfo, onSuccess,
|
|
83
|
+
{ initCycle, userInfo, onSuccess, isHiddenCreatedCard = false, handleCreatedClose = () => {}, visible = false,onClose = () => {}}: Props,
|
|
84
84
|
ref: Ref<CreateOkrRefObject>
|
|
85
85
|
) {
|
|
86
86
|
const [isVisible, setVisible] = useState(visible);
|
|
@@ -199,7 +199,7 @@ function CreateOkrModal(
|
|
|
199
199
|
setCreatedSuccessInfo(data);
|
|
200
200
|
if (
|
|
201
201
|
!localStorage.getItem(`dontShowValue${userId}`) &&
|
|
202
|
-
!
|
|
202
|
+
!isHiddenCreatedCard &&
|
|
203
203
|
!isApplyTpl
|
|
204
204
|
) {
|
|
205
205
|
setShowCreatedSuccessInfo(true);
|
|
@@ -278,7 +278,7 @@ function CreateOkrModal(
|
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
hideCreateOkrModal();
|
|
281
|
-
if (onSuccess || !
|
|
281
|
+
if (onSuccess || !isHiddenCreatedCard) {
|
|
282
282
|
// 带上超过创建okr人数的计算值
|
|
283
283
|
const krNum = krDatas.length;
|
|
284
284
|
let krTotalLength = 0;
|
|
@@ -692,7 +692,7 @@ function CreateOkrModal(
|
|
|
692
692
|
</Wrapper>
|
|
693
693
|
</Modal>
|
|
694
694
|
</div>
|
|
695
|
-
{!isApplyTpl && !
|
|
695
|
+
{!isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? (
|
|
696
696
|
<CreateSuccessCmpWrapper>
|
|
697
697
|
<CreateSuccessCmp
|
|
698
698
|
tipIndex={tipIndex}
|
|
@@ -705,7 +705,7 @@ function CreateOkrModal(
|
|
|
705
705
|
</CreateSuccessCmpWrapper>
|
|
706
706
|
) : null}
|
|
707
707
|
{/* 如果 isVisible 是 hidden,则因为无法获取到样式截取不到图片导致下载下来白图*/}
|
|
708
|
-
{!isApplyTpl && !
|
|
708
|
+
{!isApplyTpl && !isHiddenCreatedCard && showCreatedSuccessInfo ? (
|
|
709
709
|
<div className="download-dom--hidden">
|
|
710
710
|
<CreateSuccessCmp
|
|
711
711
|
tipIndex={tipIndex}
|
|
@@ -40,9 +40,7 @@ export const getOwnSet = () => {
|
|
|
40
40
|
id: "role",
|
|
41
41
|
url: "tu-icon-gongsi",
|
|
42
42
|
title: "企业管理规定",
|
|
43
|
-
objUrl: `${apiServer}/u/${userId}/Home
|
|
44
|
-
isTestCompanyManageRule ? "15709" : "12437"
|
|
45
|
-
}`,
|
|
43
|
+
objUrl: `${apiServer}/u/${userId}/Home#/enterprise/manage`,
|
|
46
44
|
},
|
|
47
45
|
];
|
|
48
46
|
|
|
@@ -62,10 +62,10 @@ const NavTop: FC = () => {
|
|
|
62
62
|
}, []);
|
|
63
63
|
|
|
64
64
|
const handleHashChange = () => {
|
|
65
|
-
const hash = location.hash || "";
|
|
65
|
+
const hash = location.hash.split('?')[0] || "";
|
|
66
66
|
if (hash) {
|
|
67
67
|
const activeMenu = menu.find((item) =>
|
|
68
|
-
hash.includes(item.href.split("#")[1])
|
|
68
|
+
hash.includes(item.href.split("#")[1].split('?')[0])
|
|
69
69
|
);
|
|
70
70
|
if (hash.includes('homepage')) {
|
|
71
71
|
setActiveMenuId(99999);
|
|
Binary file
|
|
@@ -1,104 +1,155 @@
|
|
|
1
|
-
import React, { useState, useEffect } from
|
|
2
|
-
import SearchForm from
|
|
3
|
-
import OkrTree from
|
|
4
|
-
import { getKrsByCondition } from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import SearchForm from "./search-form";
|
|
3
|
+
import OkrTree from "../components/okr-tree";
|
|
4
|
+
import { getKrsByCondition } from "../request-apis";
|
|
5
|
+
import {
|
|
6
|
+
formatEListDataToSelectTree,
|
|
7
|
+
formatCondition,
|
|
8
|
+
getIfInitCondition,
|
|
9
|
+
} from "./util";
|
|
10
|
+
import { EListContext } from "../context";
|
|
11
|
+
import PaddingLayout from "../components/padding-layout";
|
|
12
|
+
import Loading from "../loading";
|
|
13
|
+
import { getUserInfo } from "../../../utils/bs-global";
|
|
14
|
+
import ConditionRender from "../../condition-render";
|
|
15
|
+
import EmptyPng from './images/e-list-empty.png';
|
|
16
|
+
import "./index.scss";
|
|
11
17
|
|
|
12
|
-
const preCls =
|
|
18
|
+
const preCls = "okr-detail-e";
|
|
13
19
|
|
|
14
|
-
export default props => {
|
|
20
|
+
export default (props) => {
|
|
15
21
|
const { okrId } = props;
|
|
16
22
|
|
|
17
23
|
const loginUser = getUserInfo().Id;
|
|
18
24
|
const hasCondition = localStorage.getItem(`hasRememberCondition${loginUser}`);
|
|
19
25
|
|
|
20
|
-
const [krList, setKrList] = useState([])
|
|
21
|
-
const [checkedStatus, setCheckedStatus] = useState(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
const [krList, setKrList] = useState([]);
|
|
27
|
+
const [checkedStatus, setCheckedStatus] = useState(
|
|
28
|
+
hasCondition
|
|
29
|
+
? JSON.parse(localStorage.getItem(`okrDrawerECheckedStatus${loginUser}`))
|
|
30
|
+
: []
|
|
31
|
+
);
|
|
32
|
+
const [selectUsers, setSelectUsers] = useState(
|
|
33
|
+
hasCondition
|
|
34
|
+
? JSON.parse(localStorage.getItem(`okrDrawerESelectUsers${loginUser}`))
|
|
35
|
+
: []
|
|
36
|
+
);
|
|
37
|
+
const [selectName, setSelectName] = useState(
|
|
38
|
+
hasCondition
|
|
39
|
+
? localStorage.getItem(`okrDrawerESelectName${loginUser}`)
|
|
40
|
+
: "orderBySystem"
|
|
41
|
+
);
|
|
42
|
+
const [noteOrder, setNoteOrder] = useState(
|
|
43
|
+
hasCondition
|
|
44
|
+
? localStorage.getItem(`okrDrawerENoteOrder${loginUser}`)
|
|
45
|
+
: null
|
|
46
|
+
);
|
|
25
47
|
const [searchKey, setSearchKey] = useState();
|
|
26
48
|
const [oEList, setOEList] = useState([]);
|
|
27
49
|
const [expandedKrEs, setExpandedKrEs] = useState([]);
|
|
28
50
|
const [expandedOEs, setExpandedOEs] = useState([]);
|
|
29
51
|
const [loading, setLoading] = useState(true);
|
|
52
|
+
const [totalDataNum, setTotalDataNum] = useState(0);
|
|
30
53
|
|
|
31
54
|
const getKrEsData = () => {
|
|
32
55
|
setLoading(true);
|
|
33
56
|
getKrsByCondition({
|
|
34
57
|
okrId,
|
|
35
|
-
|
|
58
|
+
"condition": formatCondition({
|
|
36
59
|
okrId,
|
|
37
60
|
noteOrder,
|
|
38
61
|
selectName,
|
|
39
62
|
checkedStatus,
|
|
40
63
|
users: selectUsers,
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
}).then(krs => {
|
|
44
|
-
const formatKrs = formatEListDataToSelectTree(
|
|
45
|
-
|
|
46
|
-
|
|
64
|
+
"keyWord": searchKey,
|
|
65
|
+
}),
|
|
66
|
+
}).then((krs) => {
|
|
67
|
+
const formatKrs = formatEListDataToSelectTree(
|
|
68
|
+
krs,
|
|
69
|
+
okrId,
|
|
70
|
+
getIfInitCondition(selectName, checkedStatus, selectUsers, searchKey)
|
|
71
|
+
);
|
|
72
|
+
const expandedKrEs = (formatKrs.krsEList || []).map((it) => it.key);
|
|
73
|
+
const expandedOEs = (formatKrs.oEList[0] || []).map((it) => it.key);
|
|
47
74
|
setExpandedKrEs(expandedKrEs);
|
|
48
75
|
setExpandedOEs(expandedOEs);
|
|
49
76
|
setKrList(formatKrs.krsEList);
|
|
50
77
|
setOEList(formatKrs.oEList);
|
|
51
78
|
setLoading(false);
|
|
52
|
-
})
|
|
53
|
-
}
|
|
79
|
+
});
|
|
80
|
+
};
|
|
54
81
|
|
|
55
82
|
useEffect(() => {
|
|
56
83
|
getKrEsData();
|
|
57
84
|
}, [noteOrder, searchKey, selectName, checkedStatus, selectUsers]);
|
|
58
85
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const oElistLength = oEList[0] && oEList[0].length || 0;
|
|
88
|
+
setTotalDataNum(krList.length + oElistLength);
|
|
89
|
+
}, [krList, oEList]);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<EListContext.Provider
|
|
93
|
+
value={{
|
|
94
|
+
"refreshEList": getKrEsData,
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
<div className={preCls}>
|
|
98
|
+
<PaddingLayout>
|
|
99
|
+
<SearchForm
|
|
100
|
+
checkedStatus={checkedStatus}
|
|
101
|
+
setCheckedStatus={setCheckedStatus}
|
|
102
|
+
selectName={selectName}
|
|
103
|
+
setSelectName={setSelectName}
|
|
104
|
+
noteOrder={noteOrder}
|
|
105
|
+
setNoteOrder={setNoteOrder}
|
|
106
|
+
setSearchKey={setSearchKey}
|
|
107
|
+
selectUsers={selectUsers}
|
|
108
|
+
setSelectUsers={setSelectUsers}
|
|
109
|
+
okrId={okrId}
|
|
110
|
+
/>
|
|
111
|
+
</PaddingLayout>
|
|
79
112
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
{!loading ? (
|
|
114
|
+
<React.Fragment>
|
|
115
|
+
<ConditionRender condition={totalDataNum !== 0}>
|
|
116
|
+
{krList.map((kr, index) => {
|
|
117
|
+
return (
|
|
118
|
+
<React.Fragment>
|
|
119
|
+
<PaddingLayout padding={`0 32px 0 18px`}>
|
|
120
|
+
<OkrTree data={[kr]} defaultExpandedKeys={expandedKrEs} />
|
|
121
|
+
</PaddingLayout>
|
|
122
|
+
{
|
|
123
|
+
// kr左后一个节点 && 没有 OE 时,不显示横线
|
|
124
|
+
!(index + 1 == krList.length && oEList.length == 0) && (
|
|
125
|
+
<div className="e__divider"></div>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
</React.Fragment>
|
|
129
|
+
);
|
|
130
|
+
})}
|
|
94
131
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
132
|
+
{oEList.map((kr) => {
|
|
133
|
+
return (
|
|
134
|
+
<PaddingLayout padding={`0 32px 0 18px`}>
|
|
135
|
+
<OkrTree data={kr} defaultExpandedKeys={expandedOEs} />
|
|
136
|
+
</PaddingLayout>
|
|
137
|
+
);
|
|
138
|
+
})}
|
|
139
|
+
</ConditionRender>
|
|
140
|
+
<ConditionRender condition={totalDataNum === 0}>
|
|
141
|
+
<div className={`${preCls}__empty`}>
|
|
142
|
+
<img className={`${preCls}__empty-img`} src={EmptyPng}/>
|
|
143
|
+
<span className={`${preCls}__empty-text`}>
|
|
144
|
+
没有搜索到符合条件的E-执行
|
|
145
|
+
</span>
|
|
146
|
+
</div>
|
|
147
|
+
</ConditionRender>
|
|
148
|
+
</React.Fragment>
|
|
149
|
+
) : (
|
|
150
|
+
<Loading type="panel" />
|
|
151
|
+
)}
|
|
152
|
+
</div>
|
|
153
|
+
</EListContext.Provider>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
padding-bottom: 60px;
|
|
3
3
|
.e__divider {
|
|
4
4
|
height: 8px;
|
|
5
|
-
background: #
|
|
5
|
+
background: #f0f2f5;
|
|
6
6
|
margin: 10px 32px;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
&__empty {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding-top: 117px;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
&-img {
|
|
15
|
+
width: 128px;
|
|
16
|
+
}
|
|
17
|
+
&-text {
|
|
18
|
+
color: #3f4755;
|
|
19
|
+
line-height: 22px;
|
|
20
|
+
margin-top: 20px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -51,33 +51,52 @@ export const getETreeNode = (tasks, isFirstLevel, createUserId,krUser) => {
|
|
|
51
51
|
})
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export const formatTreeDataToNode = (tree) => {
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
export const formatTreeDataToNode = (tree, isInitCondition) => {
|
|
55
|
+
if(isInitCondition) {
|
|
56
|
+
return tree.map((item, index) => {
|
|
57
|
+
return {
|
|
58
|
+
'key': item.mileStoneId,
|
|
59
|
+
'index': index,
|
|
60
|
+
'title': item.mileStoneId !== 0 ? item.mileStoneName : '目标下的其他执行',
|
|
61
|
+
'nodeType': 'e-kr',
|
|
62
|
+
'isLeaf': false,
|
|
63
|
+
'children': getETreeNode(item.tasks, true, item.createUserId,item.user),
|
|
64
|
+
'data': { ...item },
|
|
65
|
+
'isOTask': item.mileStoneId === 0
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
} else {
|
|
69
|
+
const result: any = [];
|
|
70
|
+
tree.forEach((item, index) => {
|
|
71
|
+
if (item.tasks && item.tasks.length > 0) {
|
|
72
|
+
result.push({
|
|
73
|
+
'key': item.mileStoneId,
|
|
74
|
+
'index': index,
|
|
75
|
+
'title': item.mileStoneId !== 0 ? item.mileStoneName : '目标下的其他执行',
|
|
76
|
+
'nodeType': 'e-kr',
|
|
77
|
+
'isLeaf': false,
|
|
78
|
+
'children': getETreeNode(item.tasks, true, item.createUserId,item.user),
|
|
79
|
+
'data': { ...item },
|
|
80
|
+
'isOTask': item.mileStoneId === 0
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
67
86
|
}
|
|
68
87
|
|
|
69
|
-
export const formatEListDataToSelectTree = (data, workId) => {
|
|
88
|
+
export const formatEListDataToSelectTree = (data, workId, isInitCondition) => {
|
|
70
89
|
const tree = data.map(item => {
|
|
71
90
|
return {
|
|
72
91
|
...item,
|
|
73
92
|
'tasks': toTree(item.tasks)
|
|
74
93
|
}
|
|
75
94
|
})
|
|
76
|
-
const formatKrsTreeDataToNode = formatTreeDataToNode(tree.filter(d => d.mileStoneId !== 0));
|
|
77
|
-
const formatOTreeDataToNode = formatTreeDataToNode(tree.filter(d => d.mileStoneId === 0));
|
|
95
|
+
const formatKrsTreeDataToNode = formatTreeDataToNode(tree.filter(d => d.mileStoneId !== 0), isInitCondition);
|
|
96
|
+
const formatOTreeDataToNode = formatTreeDataToNode(tree.filter(d => d.mileStoneId === 0), isInitCondition);
|
|
78
97
|
const result = {
|
|
79
98
|
'krsEList': formatKrsTreeDataToNode,
|
|
80
|
-
'oEList': formatOTreeDataToNode.length
|
|
99
|
+
'oEList': isInitCondition && formatOTreeDataToNode.length === 0 ? [[{
|
|
81
100
|
'key': 0,
|
|
82
101
|
'index': 0,
|
|
83
102
|
'title': '目标下的其他执行',
|
|
@@ -99,7 +118,7 @@ export const formatEListDataToSelectTree = (data, workId) => {
|
|
|
99
118
|
mileStoneId: 0
|
|
100
119
|
},
|
|
101
120
|
'isOTask': true
|
|
102
|
-
}]]
|
|
121
|
+
}]] : [formatOTreeDataToNode]
|
|
103
122
|
}
|
|
104
123
|
return result;
|
|
105
124
|
}
|
|
@@ -142,4 +161,11 @@ export const formatCondition = ({okrId, noteOrder, selectName, checkedStatus, us
|
|
|
142
161
|
}))
|
|
143
162
|
}
|
|
144
163
|
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export const getIfInitCondition = (selectName, checkedStatus, users, keyWord) => {
|
|
167
|
+
if (keyWord || selectName !== 'orderBySystem' || checkedStatus.length !== 0 || users.length !== 0) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
return true;
|
|
145
171
|
}
|
|
@@ -47,6 +47,12 @@
|
|
|
47
47
|
align-items: center;
|
|
48
48
|
margin-bottom: 7px;
|
|
49
49
|
}
|
|
50
|
+
.rc-select-multiple .rc-select-selector .rc-select-selection-placeholder{
|
|
51
|
+
line-height: 1;
|
|
52
|
+
margin-bottom: 7px;
|
|
53
|
+
position: relative;
|
|
54
|
+
top: -2px;
|
|
55
|
+
}
|
|
50
56
|
|
|
51
57
|
.rc-select-selection-item-content{
|
|
52
58
|
margin-right: 8px;
|
|
@@ -6,7 +6,7 @@ import SingleSelectorCmp from './export-modules/single-selector';
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
FieldPersonSelectorComp.
|
|
9
|
+
FieldPersonSelectorComp.Single = SingleSelectorCmp
|
|
10
10
|
FieldPersonSelectorComp.Group = GroupSelectorComp
|
|
11
11
|
FieldPersonSelectorComp.Depart = DepartSearchSelectorComp
|
|
12
12
|
FieldPersonSelectorComp.Duties = DutiesSelectorComp
|