@titaui/pc 1.11.52-beta.13 → 1.11.52-beta.16
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 +7 -1
- package/lib/components/create-okr-modal/kr-items/krItem.js +7 -1
- package/lib/components/drop-selector/index.js +1 -2
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +2 -2
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +2 -2
- 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/edit-kr-wight/EditKrWightModal.js +11 -9
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
- package/lib/components/okr-detail/components/header/edit-name.js +10 -18
- package/lib/components/okr-detail/components/header/index.js +14 -7
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +78 -42
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +7 -0
- package/lib/components/okr-detail/detail-header/index.js +3 -1
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +3 -0
- package/lib/components/okr-flow/export-modal/index.js +26 -16
- package/lib/components/okr-share/common-painter/utils.js +2 -2
- package/lib/components/progress/circle-progress/index.css +2 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +8 -3
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +4 -2
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +3 -3
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +8 -2
- package/lib/components/task-tree/task-item-node/index.css +2 -2
- package/lib/components/upload/components/uploadedPreview.js +18 -18
- package/lib/components/upload/index.js +57 -29
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +14 -15
- package/lib/components/user-selector/searched-panel/index.js +12 -6
- 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/tita-okr-cycle.js +24 -0
- package/package.json +2 -2
|
@@ -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");
|
|
@@ -90,7 +92,7 @@ function _default(props) {
|
|
|
90
92
|
noAuth = _useState10[0],
|
|
91
93
|
setNoAuth = _useState10[1];
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
var searchUser = function searchUser() {
|
|
94
96
|
setLoading(true);
|
|
95
97
|
(0, _requestApis.search)({
|
|
96
98
|
searchKey: searchKey,
|
|
@@ -114,7 +116,11 @@ function _default(props) {
|
|
|
114
116
|
setDeparts((0, _utils.translateDepartsToTreeNode)(departments || []));
|
|
115
117
|
setLoading(false);
|
|
116
118
|
});
|
|
117
|
-
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
(0, _hooks.useDebouncedEffect)(function () {
|
|
122
|
+
searchUser();
|
|
123
|
+
}, 200, [searchKey]); // 计算结果,是否显示空值
|
|
118
124
|
|
|
119
125
|
var itemCount = 0;
|
|
120
126
|
|
|
@@ -133,21 +139,21 @@ function _default(props) {
|
|
|
133
139
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
134
140
|
className: "persel-searched"
|
|
135
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"], {
|
|
136
|
-
title: (0, _getLocale.getLocale)(
|
|
142
|
+
title: (0, _getLocale.getLocale)('Per_Ma_form_detail_Personnel'),
|
|
137
143
|
treeData: person,
|
|
138
144
|
onSelect: onNodeSelect,
|
|
139
145
|
selected: selected
|
|
140
146
|
}) : undefined, searchedPanes.depart && departs && departs.length ? /*#__PURE__*/_react["default"].createElement(_resultPart["default"], {
|
|
141
|
-
title: (0, _getLocale.getLocale)(
|
|
147
|
+
title: (0, _getLocale.getLocale)('Mod_Department'),
|
|
142
148
|
treeData: departs,
|
|
143
149
|
onSelect: onNodeSelect,
|
|
144
150
|
selected: selected
|
|
145
151
|
}) : undefined, searchedPanes.group && group && group.length ? /*#__PURE__*/_react["default"].createElement(_resultPart["default"], {
|
|
146
|
-
title: (0, _getLocale.getLocale)(
|
|
152
|
+
title: (0, _getLocale.getLocale)('Mod_Groups'),
|
|
147
153
|
treeData: group,
|
|
148
154
|
onSelect: onNodeSelect,
|
|
149
155
|
selected: selected
|
|
150
156
|
}) : undefined, itemCount == 0 && !noAuth && /*#__PURE__*/_react["default"].createElement(_empty["default"], null), itemCount == 0 && noAuth && /*#__PURE__*/_react["default"].createElement(_empty["default"], {
|
|
151
|
-
errorTip: (0, _getLocale.getLocale)(
|
|
157
|
+
errorTip: (0, _getLocale.getLocale)('Mod_Nopermissiondep')
|
|
152
158
|
})));
|
|
153
159
|
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cycleType = void 0;
|
|
7
|
+
// annualNum: "2022" 年份
|
|
8
|
+
// cycleType: "-1" 全部周期
|
|
9
|
+
// endDate: ""
|
|
10
|
+
// startDate: ""
|
|
11
|
+
// yqmNum: "0"
|
|
12
|
+
// annualNum: "2022"
|
|
13
|
+
// cycleType: "5" 上半年
|
|
14
|
+
// endDate: "2022/09/30"
|
|
15
|
+
// startDate: "2022/04/01"
|
|
16
|
+
// yqmNum: "1"
|
|
17
|
+
var cycleType = {
|
|
18
|
+
'-1': '全部周期',
|
|
19
|
+
'1': '年度',
|
|
20
|
+
'2': '季度',
|
|
21
|
+
'4': '双月',
|
|
22
|
+
'5': '半年度'
|
|
23
|
+
};
|
|
24
|
+
exports.cycleType = cycleType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.11.52-beta.
|
|
3
|
+
"version": "1.11.52-beta.16",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@titaui/rc-trigger": "5.2.5",
|
|
79
79
|
"@titaui/react-flow-renderer": "9.5.4",
|
|
80
80
|
"@titaui/request": "^1.0.1",
|
|
81
|
-
"@titaui/rich-editor": "^0.1.
|
|
81
|
+
"@titaui/rich-editor": "^0.1.35",
|
|
82
82
|
"@titaui/toast": "1.0.0",
|
|
83
83
|
"@types/color": "3.0.3",
|
|
84
84
|
"@types/prosemirror-commands": "1.0.4",
|