@titaui/pc 1.11.52-beta.2 → 1.11.52-beta.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/button/images/blue.svg +21 -0
- package/lib/components/button/images/red.svg +21 -0
- package/lib/components/button/images/white.svg +19 -0
- package/lib/components/button/rect-btn/index.js +3 -3
- package/lib/components/change-okr-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- package/lib/components/checkbox/index.css +4 -0
- package/lib/components/contact-kefu/index.css +11 -1
- package/lib/components/contact-kefu/index.js +10 -4
- package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
- package/lib/components/create-okr-modal/fields/index.css +14 -3
- package/lib/components/create-okr-modal/fields/o-new-name.js +31 -20
- package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
- package/lib/components/create-okr-modal/index.js +197 -132
- package/lib/components/create-okr-modal/kr-items/index.css +23 -13
- package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
- package/lib/components/create-okr-modal/kr-items/krItem.js +54 -57
- package/lib/components/create-okr-modal/style.js +5 -5
- package/lib/components/drop-selector/index.js +1 -2
- package/lib/components/dynamic/components/title/index.js +1 -1
- package/lib/components/dynamic/constant.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
- package/lib/components/eReport/eReportLists/reportList.js +29 -30
- package/lib/components/eReport/eReportShare/style.js +1 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +11 -9
- package/lib/components/nav-top/components/menu/index.js +18 -16
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
- package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
- package/lib/components/okr-detail/components/header/edit-name.js +76 -39
- package/lib/components/okr-detail/components/header/index.css +122 -41
- package/lib/components/okr-detail/components/header/index.js +45 -48
- package/lib/components/okr-detail/components/header/o-classify.js +152 -0
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +81 -43
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +174 -64
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
- package/lib/components/okr-detail/detail-header/index.js +11 -5
- package/lib/components/okr-detail/e-list/index.js +2 -2
- package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
- package/lib/components/okr-detail/okr-list/index.css +9 -0
- package/lib/components/okr-detail/okr-list/index.js +25 -25
- package/lib/components/okr-detail/request-apis.js +73 -69
- package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
- package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
- package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-flow/child-node/kr-node.js +3 -1
- package/lib/components/okr-flow/child-node/work-node.js +3 -1
- package/lib/components/okr-flow/export-modal/index.js +26 -16
- package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
- package/lib/components/okr-progress/components/o-progress/index.js +3 -1
- package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
- package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
- package/lib/components/okr-share/common-painter/utils.js +183 -36
- package/lib/components/okr-share/index.css +5 -4
- package/lib/components/okr-share/pink-card/card.js +3 -3
- package/lib/components/okr-share/pink-card/drawKrs.js +93 -18
- package/lib/components/okr-share/pink-card/index.js +20 -12
- package/lib/components/open-data-painter/index.js +6 -5
- package/lib/components/period-selector/interface.js +7 -0
- package/lib/components/progress/circle-progress/index.css +2 -0
- package/lib/components/search-input/index.css +1 -1
- package/lib/components/search-key-handle/index.js +12 -10
- package/lib/components/select-layer/index.css +1 -1
- package/lib/components/task-relation-modal/helper.js +139 -2
- package/lib/components/task-relation-modal/image/loading.gif +0 -0
- package/lib/components/task-relation-modal/index.js +9 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +267 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +131 -0
- package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +191 -0
- package/lib/components/task-relation-modal/request-api.js +28 -2
- package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
- package/lib/components/task-relation-modal/search/principal.js +36 -19
- package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
- package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
- package/lib/components/task-relation-modal/search/task-relation.js +83 -0
- package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
- package/lib/components/task-relation-modal/search/work-relation.js +83 -0
- package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
- package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
- package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
- package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
- package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
- package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
- package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
- package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
- package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
- package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
- package/lib/components/task-relation-modal/work-relation/index.css +0 -0
- package/lib/components/task-relation-modal/work-relation/index.js +256 -0
- package/lib/components/task-tree/task-item-node/index.css +2 -2
- package/lib/components/tooltip/index.js +3 -0
- package/lib/components/tooltip/tooltip-rows/index.css +26 -0
- package/lib/components/tooltip/tooltip-rows/index.js +106 -0
- package/lib/components/upload/components/uploadedPreview.js +18 -18
- package/lib/components/upload/index.js +57 -29
- package/lib/components/user-selector/category-selector-panel/index.js +6 -1
- package/lib/components/user-selector/category-selector-panel/subordinate-tree.js +61 -0
- package/lib/components/user-selector/constant.js +10 -2
- package/lib/components/user-selector/empty/index.css +5 -0
- package/lib/components/user-selector/empty/index.js +9 -3
- package/lib/components/user-selector/export-modules/depart-search-selector/index.js +45 -17
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +16 -15
- package/lib/components/user-selector/images/no-auth.png +0 -0
- package/lib/components/user-selector/request-apis.js +28 -9
- package/lib/components/user-selector/searched-panel/index.js +32 -12
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
- package/lib/components/wechat-btn/index.css +5 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
- package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
- package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
- package/lib/pages/new-okr-list/header/index.js +16 -18
- package/lib/utils/auth.js +12 -0
- package/lib/utils/hooks.js +19 -5
- package/lib/utils/open-data.js +214 -66
- package/lib/utils/planDataJson.js +11115 -0
- package/lib/utils/tita-okr-cycle.js +24 -0
- package/package.json +2 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.searchGroups = exports.searchDuties = exports.search = exports.getTreeData = exports.getGourps = exports.getDuties = void 0;
|
|
6
|
+
exports.searchGroups = exports.searchDuties = exports.search = exports.getTreeData = exports.getSubordinateData = exports.getGourps = exports.getDuties = void 0;
|
|
7
7
|
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
9
|
|
|
@@ -137,10 +137,29 @@ var getTreeData = function getTreeData(id, opts, resolve) {
|
|
|
137
137
|
|
|
138
138
|
exports.getTreeData = getTreeData;
|
|
139
139
|
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
var getSubordinateData = function getSubordinateData(_ref3) {
|
|
141
|
+
var auth = _ref3.auth,
|
|
142
|
+
authType = _ref3.authType;
|
|
143
|
+
var authTypeId;
|
|
144
|
+
if (auth && !authType) authType = "okr";
|
|
145
|
+
if (authType == "okr") authTypeId = "62";
|
|
146
|
+
if (authType == "performance") authTypeId = "31";
|
|
147
|
+
if (authType == "total") authTypeId = "0";
|
|
148
|
+
return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/org/GetDepartmentSubordinates?objtype=").concat(authTypeId)).then(function (res) {
|
|
149
|
+
var _res$data$Data$users = res.data.Data.users,
|
|
150
|
+
users = _res$data$Data$users === void 0 ? [] : _res$data$Data$users;
|
|
151
|
+
var transUsers = (0, _utils.translateUsersToTreeNode)(users || []); // resolve && resolve([...transUsers]);
|
|
152
|
+
|
|
153
|
+
return _toConsumableArray(transUsers);
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
exports.getSubordinateData = getSubordinateData;
|
|
158
|
+
|
|
159
|
+
var search = function search(_ref4) {
|
|
160
|
+
var searchKey = _ref4.searchKey,
|
|
161
|
+
departOnly = _ref4.departOnly,
|
|
162
|
+
sourceFrom = _ref4.sourceFrom;
|
|
144
163
|
var args = [];
|
|
145
164
|
if (departOnly) args.push("isGetUser=false");
|
|
146
165
|
if (sourceFrom) args.push("sourceFrom=".concat(sourceFrom)); // 追加来源,用于企业微信搜索
|
|
@@ -153,8 +172,8 @@ var search = function search(_ref3) {
|
|
|
153
172
|
|
|
154
173
|
exports.search = search;
|
|
155
174
|
|
|
156
|
-
var searchGroups = function searchGroups(
|
|
157
|
-
var searchKey =
|
|
175
|
+
var searchGroups = function searchGroups(_ref5) {
|
|
176
|
+
var searchKey = _ref5.searchKey;
|
|
158
177
|
return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/map/group?keyWork=").concat(searchKey)).then(function (searchRes) {
|
|
159
178
|
return searchRes.data;
|
|
160
179
|
});
|
|
@@ -170,8 +189,8 @@ var getDuties = function getDuties() {
|
|
|
170
189
|
|
|
171
190
|
exports.getDuties = getDuties;
|
|
172
191
|
|
|
173
|
-
var searchDuties = function searchDuties(
|
|
174
|
-
var searchKey =
|
|
192
|
+
var searchDuties = function searchDuties(_ref6) {
|
|
193
|
+
var searchKey = _ref6.searchKey;
|
|
175
194
|
return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/position/search?status=1&pageNum=1&pageSize=100&filter=").concat(searchKey)).then(function (res) {
|
|
176
195
|
return res.data;
|
|
177
196
|
});
|
|
@@ -21,6 +21,8 @@ var _empty = _interopRequireDefault(require("../empty"));
|
|
|
21
21
|
|
|
22
22
|
var _group = _interopRequireDefault(require("../empty/group"));
|
|
23
23
|
|
|
24
|
+
var _hooks = require("../../../utils/hooks");
|
|
25
|
+
|
|
24
26
|
var _context = require("../context");
|
|
25
27
|
|
|
26
28
|
var _getLocale = require("../../../utils/getLocale");
|
|
@@ -85,25 +87,41 @@ function _default(props) {
|
|
|
85
87
|
group = _useState8[0],
|
|
86
88
|
setGroup = _useState8[1];
|
|
87
89
|
|
|
88
|
-
(0, _react.
|
|
90
|
+
var _useState9 = (0, _react.useState)(false),
|
|
91
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
92
|
+
noAuth = _useState10[0],
|
|
93
|
+
setNoAuth = _useState10[1];
|
|
94
|
+
|
|
95
|
+
var searchUser = function searchUser() {
|
|
89
96
|
setLoading(true);
|
|
90
97
|
(0, _requestApis.search)({
|
|
91
98
|
searchKey: searchKey,
|
|
92
99
|
departOnly: departOnly,
|
|
93
100
|
sourceFrom: sourceFrom
|
|
94
101
|
}).then(function (res) {
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
var Code = res.Code,
|
|
103
|
+
Data = res.Data;
|
|
104
|
+
var departments = Data.departments,
|
|
105
|
+
groups = Data.groups,
|
|
106
|
+
users = Data.users;
|
|
107
|
+
|
|
108
|
+
if (Code === 401) {
|
|
109
|
+
setNoAuth(true);
|
|
110
|
+
} else {
|
|
111
|
+
setNoAuth(false);
|
|
112
|
+
}
|
|
113
|
+
|
|
99
114
|
setPerson((0, _utils.translateUsersToTreeNode)(users || []));
|
|
100
115
|
setGroup((0, _utils.translateGroupsToTreeNode)(groups || []));
|
|
101
116
|
setDeparts((0, _utils.translateDepartsToTreeNode)(departments || []));
|
|
102
117
|
setLoading(false);
|
|
103
118
|
});
|
|
104
|
-
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
(0, _hooks.useDebouncedEffect)(function () {
|
|
122
|
+
searchUser();
|
|
123
|
+
}, 200, [searchKey]); // 计算结果,是否显示空值
|
|
105
124
|
|
|
106
|
-
var showEmpty = false;
|
|
107
125
|
var itemCount = 0;
|
|
108
126
|
|
|
109
127
|
if (searchedPanes.user && person) {
|
|
@@ -120,20 +138,22 @@ function _default(props) {
|
|
|
120
138
|
|
|
121
139
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
122
140
|
className: "persel-searched"
|
|
123
|
-
}, loading
|
|
124
|
-
title: (0, _getLocale.getLocale)(
|
|
141
|
+
}, loading && /*#__PURE__*/_react["default"].createElement(_loading["default"], null), !loading && /*#__PURE__*/_react["default"].createElement("div", null, searchedPanes.user && person && person.length ? /*#__PURE__*/_react["default"].createElement(_resultPart["default"], {
|
|
142
|
+
title: (0, _getLocale.getLocale)('Per_Ma_form_detail_Personnel'),
|
|
125
143
|
treeData: person,
|
|
126
144
|
onSelect: onNodeSelect,
|
|
127
145
|
selected: selected
|
|
128
146
|
}) : undefined, searchedPanes.depart && departs && departs.length ? /*#__PURE__*/_react["default"].createElement(_resultPart["default"], {
|
|
129
|
-
title: (0, _getLocale.getLocale)(
|
|
147
|
+
title: (0, _getLocale.getLocale)('Mod_Department'),
|
|
130
148
|
treeData: departs,
|
|
131
149
|
onSelect: onNodeSelect,
|
|
132
150
|
selected: selected
|
|
133
151
|
}) : undefined, searchedPanes.group && group && group.length ? /*#__PURE__*/_react["default"].createElement(_resultPart["default"], {
|
|
134
|
-
title: (0, _getLocale.getLocale)(
|
|
152
|
+
title: (0, _getLocale.getLocale)('Mod_Groups'),
|
|
135
153
|
treeData: group,
|
|
136
154
|
onSelect: onNodeSelect,
|
|
137
155
|
selected: selected
|
|
138
|
-
}) : undefined, itemCount == 0 && /*#__PURE__*/_react["default"].createElement(_empty["default"], null)
|
|
156
|
+
}) : undefined, itemCount == 0 && !noAuth && /*#__PURE__*/_react["default"].createElement(_empty["default"], null), itemCount == 0 && noAuth && /*#__PURE__*/_react["default"].createElement(_empty["default"], {
|
|
157
|
+
errorTip: (0, _getLocale.getLocale)('Mod_Nopermissiondep')
|
|
158
|
+
})));
|
|
139
159
|
}
|
|
@@ -35,30 +35,58 @@ function _default(props) {
|
|
|
35
35
|
onRemove && onRemove(props);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
var renderAvatar = function renderAvatar() {
|
|
39
|
+
var _data$avatar, _data$avatar2, _data$avatar3;
|
|
40
|
+
|
|
41
|
+
if ((data === null || data === void 0 ? void 0 : (_data$avatar = data.avatar) === null || _data$avatar === void 0 ? void 0 : _data$avatar.hasAvatar) === false) {
|
|
42
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
43
|
+
style: {
|
|
44
|
+
backgroundColor: data.avatar.color
|
|
45
|
+
}
|
|
46
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
47
|
+
className: "perspm-person__avatar-text",
|
|
48
|
+
title: ""
|
|
49
|
+
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
50
|
+
id: data.userId,
|
|
51
|
+
name: data.name
|
|
52
|
+
})));
|
|
53
|
+
} else if (data !== null && data !== void 0 && (_data$avatar2 = data.avatar) !== null && _data$avatar2 !== void 0 && _data$avatar2.original || data !== null && data !== void 0 && (_data$avatar3 = data.avatar) !== null && _data$avatar3 !== void 0 && _data$avatar3.small) {
|
|
54
|
+
var _data$avatar4, _data$avatar5;
|
|
55
|
+
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement("img", {
|
|
57
|
+
key: data.userId,
|
|
58
|
+
src: (data === null || data === void 0 ? void 0 : (_data$avatar4 = data.avatar) === null || _data$avatar4 === void 0 ? void 0 : _data$avatar4.original) || (data === null || data === void 0 ? void 0 : (_data$avatar5 = data.avatar) === null || _data$avatar5 === void 0 ? void 0 : _data$avatar5.small),
|
|
59
|
+
style: {
|
|
60
|
+
width: "100%",
|
|
61
|
+
height: "100%",
|
|
62
|
+
position: 'relative',
|
|
63
|
+
top: '-1px'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
} else {
|
|
67
|
+
var _data$avatar6;
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
70
|
+
style: {
|
|
71
|
+
backgroundColor: data === null || data === void 0 ? void 0 : (_data$avatar6 = data.avatar) === null || _data$avatar6 === void 0 ? void 0 : _data$avatar6.color
|
|
72
|
+
}
|
|
73
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
74
|
+
className: "perspm-person__avatar-text",
|
|
75
|
+
title: ""
|
|
76
|
+
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
77
|
+
id: data.userId,
|
|
78
|
+
name: data.name
|
|
79
|
+
})));
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
38
83
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
39
84
|
className: (0, _classnames["default"])("perspm-person", {
|
|
40
85
|
"perspm-person--small": hideUserInfo
|
|
41
86
|
})
|
|
42
87
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
43
88
|
className: "perspm-person__avatar"
|
|
44
|
-
},
|
|
45
|
-
key: data.userId,
|
|
46
|
-
src: data.avatar.small,
|
|
47
|
-
style: {
|
|
48
|
-
width: "100%",
|
|
49
|
-
height: "100%"
|
|
50
|
-
}
|
|
51
|
-
}) : /*#__PURE__*/_react["default"].createElement("span", {
|
|
52
|
-
style: {
|
|
53
|
-
backgroundColor: data.avatar.color
|
|
54
|
-
}
|
|
55
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
56
|
-
className: "perspm-person__avatar-text",
|
|
57
|
-
title: ""
|
|
58
|
-
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
59
|
-
id: data.userId,
|
|
60
|
-
name: data.name
|
|
61
|
-
})))), /*#__PURE__*/_react["default"].createElement("span", {
|
|
89
|
+
}, renderAvatar()), /*#__PURE__*/_react["default"].createElement("span", {
|
|
62
90
|
className: "perspm-person__info"
|
|
63
91
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
64
92
|
style: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.titaui-wechat-btn {
|
|
2
|
+
margin: 0 8px;
|
|
2
3
|
font-size: 18px;
|
|
3
4
|
color: #a4acb9;
|
|
4
|
-
margin: 0 8px;
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
color: #2879ff;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
.titaui-wechat-btn:not(:empty) {
|
|
13
|
+
margin: 0 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
.titaui-wechat-btn__chat {
|
|
13
17
|
color: #2879ff;
|
|
14
18
|
}
|
|
@@ -21,6 +21,8 @@ require("react-perfect-scrollbar/dist/css/styles.css");
|
|
|
21
21
|
|
|
22
22
|
var _openData = require("../../../utils/open-data");
|
|
23
23
|
|
|
24
|
+
var _getLocale = require("../../../utils/getLocale");
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
27
|
|
|
26
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -70,7 +72,7 @@ var SingleMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
70
72
|
if (users[activeIndex]) {
|
|
71
73
|
_this.props.onSelect(users[activeIndex]);
|
|
72
74
|
|
|
73
|
-
document.removeEventListener(
|
|
75
|
+
document.removeEventListener('keydown', _this.handleKeyDown);
|
|
74
76
|
}
|
|
75
77
|
} else if (e.keyCode == 38) {
|
|
76
78
|
var index = activeIndex > 0 ? activeIndex - 1 : (users.length || 1) - 1;
|
|
@@ -109,7 +111,7 @@ var SingleMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
109
111
|
};
|
|
110
112
|
|
|
111
113
|
_this.getSearchUsers = function () {
|
|
112
|
-
var url = (0, _openData.isPlatform)(
|
|
114
|
+
var url = (0, _openData.isPlatform)('wx') ? (0, _requestV.getApiUrl3)("staff/workwx/serarch?filter=".concat(_this.props.searchTxt)) : (0, _requestV.getApiUrl3)("staff/search?onlyMatchName=".concat(_this.props.onlySearchByName === true, "&filter=").concat(_this.props.searchTxt, "&pageNum=1&pageSize=999"));
|
|
113
115
|
(0, _requestV.taker)(url).then(function (res) {
|
|
114
116
|
if (res.Code == 1) {
|
|
115
117
|
var _users2 = [];
|
|
@@ -161,13 +163,13 @@ var SingleMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
if (this.props.useKeyBoard !== false) {
|
|
164
|
-
document.addEventListener(
|
|
166
|
+
document.addEventListener('keydown', this.handleKeyDown);
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
}, {
|
|
168
170
|
key: "componentWillUnmount",
|
|
169
171
|
value: function componentWillUnmount() {
|
|
170
|
-
document.removeEventListener(
|
|
172
|
+
document.removeEventListener('keydown', this.handleKeyDown);
|
|
171
173
|
}
|
|
172
174
|
}, {
|
|
173
175
|
key: "componentDidUpdate",
|
|
@@ -192,7 +194,7 @@ var SingleMode = /*#__PURE__*/function (_PureComponent) {
|
|
|
192
194
|
return /*#__PURE__*/_react["default"].createElement(_style.SingleModeWrapper, null, /*#__PURE__*/_react["default"].createElement(_reactPerfectScrollbar["default"], null, !users.length && !pending ? /*#__PURE__*/_react["default"].createElement(_style.EmptyWrapper, null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
193
195
|
src: require("../assets/emptyImg.png"),
|
|
194
196
|
width: "100px"
|
|
195
|
-
}), /*#__PURE__*/_react["default"].createElement(_style.ListEmptyText, null, getLocale(
|
|
197
|
+
}), /*#__PURE__*/_react["default"].createElement(_style.ListEmptyText, null, (0, _getLocale.getLocale)('Mod_ThereNothing'), "...")) : /*#__PURE__*/_react["default"].createElement(_style.SingleList, null, users.map(function (u, index) {
|
|
196
198
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
197
199
|
key: u.Id,
|
|
198
200
|
onMouseOver: function onMouseOver() {
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _openData = require("../../../../../../utils/open-data");
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
13
|
|
|
12
14
|
var preCls = "home-page-data-list-columns__krname";
|
|
@@ -19,7 +21,7 @@ function KrNameColumn(_ref) {
|
|
|
19
21
|
className: "".concat(preCls, "__tag")
|
|
20
22
|
}, "KR"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
21
23
|
className: "".concat(preCls, "__name")
|
|
22
|
-
}, name));
|
|
24
|
+
}, (0, _openData.parseString)(name)));
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
var _default = KrNameColumn;
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _openData = require("../../../../../../utils/open-data");
|
|
11
|
+
|
|
10
12
|
require("./index.css");
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -25,11 +27,11 @@ function OkrNameColumn(_ref) {
|
|
|
25
27
|
className: "".concat(preCls, "__tagO")
|
|
26
28
|
}, "O"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
27
29
|
className: "".concat(preCls, "__contentO")
|
|
28
|
-
}, children)), type === "KR" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
30
|
+
}, (0, _openData.parseString)(children))), type === "KR" && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
31
|
className: "".concat(preCls, "__tagKR")
|
|
30
32
|
}, "KR"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
31
33
|
className: "".concat(preCls, "__contentKR")
|
|
32
|
-
}, children)));
|
|
34
|
+
}, (0, _openData.parseString)(children))));
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
var _default = OkrNameColumn;
|
|
@@ -37,8 +37,6 @@ var _requestApi = require("../request-api");
|
|
|
37
37
|
|
|
38
38
|
var _getLocale = require("../../../utils/getLocale");
|
|
39
39
|
|
|
40
|
-
var _tools = require("../../../utils/tools");
|
|
41
|
-
|
|
42
40
|
require("./index.css");
|
|
43
41
|
|
|
44
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -126,45 +124,45 @@ function Header(props, ref) {
|
|
|
126
124
|
var rootNode = {
|
|
127
125
|
rootId: 0,
|
|
128
126
|
// @ts-ignore
|
|
129
|
-
rootName: window.BSGlobal.tenantInfo.Name ||
|
|
127
|
+
rootName: window.BSGlobal.tenantInfo.Name || ''
|
|
130
128
|
};
|
|
131
129
|
var level2Selected = {
|
|
132
130
|
id: 0,
|
|
133
131
|
// @ts-ignore
|
|
134
|
-
name: window.BSGlobal.tenantInfo.Name ||
|
|
132
|
+
name: window.BSGlobal.tenantInfo.Name || ''
|
|
135
133
|
};
|
|
136
|
-
var searchType =
|
|
134
|
+
var searchType = 'company';
|
|
137
135
|
|
|
138
136
|
if (departmentId && departmentId !== -1) {
|
|
139
137
|
rootNode.rootId = departmentId;
|
|
140
|
-
rootNode.rootName = departmentName ||
|
|
141
|
-
searchType =
|
|
138
|
+
rootNode.rootName = departmentName || '';
|
|
139
|
+
searchType = 'depart';
|
|
142
140
|
level2Selected.id = departmentId;
|
|
143
|
-
level2Selected.name = departmentName ||
|
|
141
|
+
level2Selected.name = departmentName || '';
|
|
144
142
|
}
|
|
145
143
|
|
|
146
144
|
if (toUserId) {
|
|
147
145
|
rootNode.rootId = toUserId;
|
|
148
|
-
rootNode.rootName = userInfo.name ||
|
|
149
|
-
searchType =
|
|
146
|
+
rootNode.rootName = userInfo.name || '';
|
|
147
|
+
searchType = 'user';
|
|
150
148
|
level2Selected.id = toUserId;
|
|
151
|
-
level2Selected.name = userInfo.name ||
|
|
149
|
+
level2Selected.name = userInfo.name || '';
|
|
152
150
|
}
|
|
153
151
|
|
|
154
152
|
if (parseInt(relation, 10) === 1) {
|
|
155
153
|
rootNode.rootId = (0, _bsGlobal.getUserInfo)().Id;
|
|
156
|
-
rootNode.rootName = (0, _bsGlobal.getUserInfo)().Name ||
|
|
157
|
-
searchType =
|
|
154
|
+
rootNode.rootName = (0, _bsGlobal.getUserInfo)().Name || '';
|
|
155
|
+
searchType = 'user';
|
|
158
156
|
level2Selected.id = (0, _bsGlobal.getUserInfo)().Id;
|
|
159
|
-
level2Selected.name = (0, _bsGlobal.getUserInfo)().Name ||
|
|
157
|
+
level2Selected.name = (0, _bsGlobal.getUserInfo)().Name || '';
|
|
160
158
|
}
|
|
161
159
|
|
|
162
160
|
var urlQuery = ["searchType=".concat(searchType), "period=".concat(JSON.stringify({
|
|
163
161
|
cycleType: cycleType,
|
|
164
162
|
annualNum: annualNum,
|
|
165
163
|
yqmNum: yqmNum
|
|
166
|
-
})), "rootNode=".concat(JSON.stringify(rootNode)), "level2Selected=".concat(JSON.stringify(level2Selected))].join(
|
|
167
|
-
var origin = window.location.href.split(
|
|
164
|
+
})), "rootNode=".concat(JSON.stringify(rootNode)), "level2Selected=".concat(JSON.stringify(level2Selected))].join('&');
|
|
165
|
+
var origin = window.location.href.split('#')[0];
|
|
168
166
|
window.location.href = "".concat(origin, "/#okr/map?").concat(urlQuery);
|
|
169
167
|
};
|
|
170
168
|
|
|
@@ -223,7 +221,7 @@ function Header(props, ref) {
|
|
|
223
221
|
className: "".concat(_precls.precls, "__header-item"),
|
|
224
222
|
onClick: gotoOkrMap
|
|
225
223
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
226
|
-
overlay: (0, _getLocale.getLocale)(
|
|
224
|
+
overlay: (0, _getLocale.getLocale)('OKR_MyO_Text_Alignment'),
|
|
227
225
|
placement: "top"
|
|
228
226
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
229
227
|
className: "".concat(_precls.precls, "__header-icon")
|
|
@@ -235,7 +233,7 @@ function Header(props, ref) {
|
|
|
235
233
|
userInfo: userInfo
|
|
236
234
|
}), /*#__PURE__*/_react["default"].createElement(_filter["default"], {
|
|
237
235
|
onSearch: onSearch
|
|
238
|
-
}), Number(cycleType) !== -1 &&
|
|
236
|
+
}), Number(cycleType) !== -1 && Number(relation) !== 2 && Number(relation) !== 3 && departmentId === undefined && /*#__PURE__*/_react["default"].createElement(_operateRecord["default"], {
|
|
239
237
|
toUserId: toUserId,
|
|
240
238
|
userInfo: userInfo,
|
|
241
239
|
relation: relationShip,
|
package/lib/utils/auth.js
CHANGED
|
@@ -49,6 +49,18 @@ var BaseAuth = /*#__PURE__*/function () {
|
|
|
49
49
|
value: function isManager() {
|
|
50
50
|
// console.log('ismanager', this.loginUserInfor.IsOkrManager)
|
|
51
51
|
return this.loginUserInfor.IsOkrManager;
|
|
52
|
+
} // 助理或者说动态管理员
|
|
53
|
+
|
|
54
|
+
}, {
|
|
55
|
+
key: "isAssistant",
|
|
56
|
+
value: function isAssistant() {
|
|
57
|
+
return this.loginUserInfor.Role === 1;
|
|
58
|
+
} // 项目管理员
|
|
59
|
+
|
|
60
|
+
}, {
|
|
61
|
+
key: "isWorkManager",
|
|
62
|
+
value: function isWorkManager() {
|
|
63
|
+
return this.loginUserInfor.IsWorkManager;
|
|
52
64
|
}
|
|
53
65
|
}, {
|
|
54
66
|
key: "isDepartmentLeader",
|
package/lib/utils/hooks.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = useQuery;
|
|
7
7
|
exports.parseUrl = parseUrl;
|
|
8
|
+
exports.useDebouncedEffect = useDebouncedEffect;
|
|
8
9
|
|
|
9
10
|
var _react = require("react");
|
|
10
11
|
|
|
@@ -23,15 +24,15 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
23
24
|
function parseUrl(fragmentStr) {
|
|
24
25
|
var queryObject = {};
|
|
25
26
|
if (!fragmentStr) return queryObject;
|
|
26
|
-
var markIndex = fragmentStr.indexOf(
|
|
27
|
+
var markIndex = fragmentStr.indexOf('?'); // contain query string in fragments
|
|
27
28
|
|
|
28
29
|
if (markIndex > -1) {
|
|
29
30
|
// build query object
|
|
30
31
|
var queryString = fragmentStr.slice(markIndex + 1);
|
|
31
|
-
var queryArray = queryString.split(
|
|
32
|
+
var queryArray = queryString.split('&');
|
|
32
33
|
|
|
33
34
|
for (var i = 0; i < queryArray.length; i += 1) {
|
|
34
|
-
var queryPair = queryArray[i].split(
|
|
35
|
+
var queryPair = queryArray[i].split('=');
|
|
35
36
|
queryObject[queryPair[0]] = decodeURIComponent(queryPair[1]);
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -63,10 +64,23 @@ function useQuery(name) {
|
|
|
63
64
|
}
|
|
64
65
|
}, []);
|
|
65
66
|
(0, _react.useEffect)(function () {
|
|
66
|
-
window.addEventListener(
|
|
67
|
+
window.addEventListener('hashchange', hashChangeHandler);
|
|
67
68
|
return function () {
|
|
68
|
-
window.removeEventListener(
|
|
69
|
+
window.removeEventListener('hashchange', hashChangeHandler);
|
|
69
70
|
};
|
|
70
71
|
}, []);
|
|
71
72
|
return state;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function useDebouncedEffect(fn, ms, deps) {
|
|
76
|
+
(0, _react.useEffect)(function () {
|
|
77
|
+
var clean = null;
|
|
78
|
+
var timer = setTimeout(function () {
|
|
79
|
+
clean = fn();
|
|
80
|
+
}, ms);
|
|
81
|
+
return function () {
|
|
82
|
+
clearTimeout(timer);
|
|
83
|
+
if (clean) clean();
|
|
84
|
+
};
|
|
85
|
+
}, deps);
|
|
72
86
|
}
|