@titaui/pc 1.9.72 → 1.9.76
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/.eslintrc.js +1 -1
- package/lib/components/change-okr-modal/Filter.js +1 -1
- package/lib/components/change-okr-modal/Item.js +1 -1
- package/lib/components/change-okr-modal/filterTab.js +1 -1
- package/lib/components/change-okr-modal/index.js +1 -1
- package/lib/components/communication/CommunicationAttachments.js +1 -1
- package/lib/components/communication/ConvertUserName.js +1 -1
- package/lib/components/communication/index.js +1 -1
- package/lib/components/create-okr-modal/fields/okr-case.js +8 -9
- package/lib/components/create-okr-modal/objectType.js +1 -1
- package/lib/components/date-picker/BodyItem.js +1 -1
- package/lib/components/date-picker/CalendarBody.js +1 -1
- package/lib/components/date-picker/CalendarHeader.js +1 -1
- package/lib/components/date-picker/index.js +1 -1
- package/lib/components/date-range-picker/index.js +1 -1
- package/lib/components/delete-confirm-pop/ConfirmPop.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-project/constant.js +15 -10
- package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +4 -3
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.css +5 -3
- package/lib/components/dynamic/dynamic-item/dynamic-replay/index.js +6 -4
- package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +15 -10
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +6 -5
- package/lib/components/dynamic/dynamic-like-ranking/index.css +2 -5
- package/lib/components/dynamic/dynamic-liking/item.js +1 -2
- package/lib/components/dynamic/dynamic.js +7 -2
- package/lib/components/eReport/eReportListEmpty.js +1 -1
- package/lib/components/eReport/eReportLists/reportList.js +1 -1
- package/lib/components/eReport/eReportShare/index.js +1 -1
- package/lib/components/eReport/eReportShare/toast/index.js +1 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +1 -1
- package/lib/components/edit-kr-wight/FormItemV2.js +1 -1
- package/lib/components/emotions-selector/selector-content.js +1 -1
- package/lib/components/emotions-selector/selector-pop.js +1 -1
- package/lib/components/ereport-list/index.js +1 -1
- package/lib/components/error-boundary/index.js +1 -1
- package/lib/components/mblog/components/ConfirmPop.js +1 -1
- package/lib/components/mblog/components/MblogAction.js +1 -1
- package/lib/components/mblog/components/MblogContent.js +1 -1
- package/lib/components/mblog/index.js +1 -1
- package/lib/components/mblog/style.js +2 -2
- package/lib/components/okr-detail/auth.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/confirm/buttonv2.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
- package/lib/components/okr-detail/components/base-okr-type/object-type.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.js +1 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +1 -1
- package/lib/components/okr-review/ReviewPop/components/Toast/index.js +1 -1
- package/lib/components/okr-review/ReviewPop/index.js +1 -1
- package/lib/components/okr-review/components/ReviewItem/index.js +1 -1
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +1 -1
- package/lib/components/okr-review/index.js +1 -1
- package/lib/components/okrcase-library/index.css +3 -1
- package/lib/components/operation-records/OperationRecordItem.js +1 -1
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/part-notice/index.js +6 -0
- package/lib/components/part-notice/not-allow-data.js +10 -0
- package/lib/components/photo-card/index.js +3 -6
- package/lib/components/photo-card/request.apis.js +2 -2
- package/lib/components/point-demo/input/index.js +1 -1
- package/lib/components/praise-record/PraiseRecordItem.js +1 -1
- package/lib/components/praise-record/index.js +1 -1
- package/lib/components/range-picker-pop/index.js +1 -1
- package/lib/components/range-selector-pop/RangeList.js +1 -1
- package/lib/components/range-selector-pop/RangeSelectorPop.js +1 -1
- package/lib/components/select/Option.js +1 -1
- package/lib/components/select/index.js +1 -1
- package/lib/components/tita-chart/errorBoundary/index.js +1 -1
- package/lib/components/upload/components/uploadedPreview.js +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/viewer/ImageListRender.js +1 -1
- package/lib/components/viewer/index.js +1 -1
- package/lib/components-v1/animate/AnimateChild.js +1 -1
- package/lib/components-v1/animate/animate.js +1 -1
- package/lib/components-v1/avatar/index.js +1 -1
- package/lib/components-v1/buttonv2/ButtonOutlined.js +1 -1
- package/lib/components-v1/buttonv2/ButtonRounded.js +1 -1
- package/lib/components-v1/buttonv2/DefaultButton.js +1 -1
- package/lib/components-v1/confirm/index.js +1 -1
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +1 -1
- package/lib/components-v1/dropDownSelector/dropDownSelector.js +1 -1
- package/lib/components-v1/input/Input.js +1 -1
- package/lib/components-v1/input/InputNumber.js +1 -1
- package/lib/components-v1/placement/placement.js +1 -1
- package/lib/components-v1/placement/placementInner.js +1 -1
- package/lib/components-v1/pop/Pop.js +1 -1
- package/lib/components-v1/pop/PopInner.js +1 -1
- package/lib/components-v1/portals/Portals.js +1 -1
- package/lib/components-v1/progress/CircleProgress.js +1 -1
- package/lib/components-v1/progress/LineProgress.js +1 -1
- package/lib/components-v1/progress/index.js +1 -1
- package/lib/components-v1/radio/radio.js +1 -1
- package/lib/components-v1/radio/radioGroup.js +1 -1
- package/lib/components-v1/search/index.js +1 -1
- package/lib/components-v1/select/Option.js +1 -1
- package/lib/components-v1/select/index.js +1 -1
- package/lib/components-v1/tabs/index.js +1 -1
- package/lib/components-v1/textarea/index.js +1 -1
- package/lib/components-v1/transition/index.js +1 -1
- package/lib/components-v1/userSelector/UserSelectorPop.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/index.js +1 -1
- package/lib/components-v1/userSelector/components/SearchBar.js +1 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +1 -1
- package/lib/components-v1/userSelector/components/UserItem.js +1 -1
- package/lib/components-v1/userSelector/index.js +1 -1
- package/lib/pages/appointment-demo/input/index.js +1 -1
- package/lib/pages/group-management/components/input-form/index.js +1 -1
- package/lib/pages/new-okr-list/index.js +1 -1
- package/lib/utils/auth.js +1 -1
- package/lib/utils/helpers.js +12 -6
- package/lib/utils/tools.js +94 -45
- package/package.json +1 -1
- package/src/components/create-okr-modal/fields/okr-case.tsx +7 -7
- package/src/components/dynamic/constant.ts +18 -18
- package/src/components/dynamic/dynamic-item/dynamic-project/constant.ts +4 -2
- package/src/components/dynamic/dynamic-item/dynamic-project/index.tsx +5 -5
- package/src/components/dynamic/dynamic-item/dynamic-replay/index.scss +5 -3
- package/src/components/dynamic/dynamic-item/dynamic-replay/index.tsx +6 -5
- package/src/components/dynamic/dynamic-item/dynamic-task/constant.ts +4 -2
- package/src/components/dynamic/dynamic-item/dynamic-task/index.tsx +6 -6
- package/src/components/dynamic/dynamic-like-ranking/index.scss +2 -3
- package/src/components/dynamic/dynamic-liking/item.tsx +1 -2
- package/src/components/dynamic/dynamic.tsx +8 -3
- package/src/components/mblog/style.ts +2 -2
- package/src/components/okr-detail/components/okr-tree/tree-node/o-child-node/edit-child-okr-weight.tsx +1 -1
- package/src/components/okrcase-library/index.scss +9 -7
- package/src/components/part-notice/index.tsx +3 -0
- package/src/components/part-notice/not-allow-data.tsx +110 -0
- package/src/components/photo-card/index.tsx +5 -6
- package/src/components/photo-card/request.apis.ts +1 -1
- package/src/pages/new-okr-list/index.tsx +1 -1
- package/src/utils/helpers.ts +6 -4
- package/src/utils/tools.js +48 -20
- package/yarn-error.log +16 -15807
package/lib/utils/tools.js
CHANGED
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.changeQueryString = changeQueryString;
|
|
7
7
|
exports.getQueryString = getQueryString;
|
|
8
8
|
exports.highLightWord = exports.hexToRgba = exports.getUrlForUserPage = void 0;
|
|
9
|
+
exports.htmlDecodeByHtmlRegExp = htmlDecodeByHtmlRegExp;
|
|
9
10
|
exports.htmlDecodeByRegExp = htmlDecodeByRegExp;
|
|
10
11
|
exports.htmlEncodeByRegExp = htmlEncodeByRegExp;
|
|
12
|
+
exports.htmlEncodeToHtmlByRegExp = htmlEncodeToHtmlByRegExp;
|
|
11
13
|
exports.unHighLight = exports.openPage = void 0;
|
|
12
14
|
|
|
13
15
|
var _platform = require("./platform");
|
|
@@ -20,6 +22,18 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
20
22
|
|
|
21
23
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
24
|
|
|
25
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
26
|
+
|
|
27
|
+
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."); }
|
|
28
|
+
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
+
|
|
31
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
32
|
+
|
|
33
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
34
|
+
|
|
35
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
|
+
|
|
23
37
|
function htmlEncodeByRegExp(str) {
|
|
24
38
|
if (!str) return "";
|
|
25
39
|
var htmlString = {
|
|
@@ -50,7 +64,7 @@ function htmlDecodeByRegExp(str) {
|
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
function changeQueryString(key, value) {
|
|
53
|
-
var hash = decodeURIComponent(location.hash);
|
|
67
|
+
var hash = decodeURIComponent(window.location.hash);
|
|
54
68
|
var queryObject = {};
|
|
55
69
|
var markIndex = hash.indexOf("?"); // contain query string in fragments
|
|
56
70
|
|
|
@@ -60,25 +74,27 @@ function changeQueryString(key, value) {
|
|
|
60
74
|
var queryString = hash.slice(markIndex + 1);
|
|
61
75
|
var queryArray = queryString.split("&");
|
|
62
76
|
queryArray.forEach(function (item) {
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
var _item$split = item.split("="),
|
|
78
|
+
_item$split2 = _slicedToArray(_item$split, 2),
|
|
79
|
+
tempItem0 = _item$split2[0],
|
|
80
|
+
tempItem1 = _item$split2[1];
|
|
81
|
+
|
|
82
|
+
queryObject[tempItem0] = tempItem1;
|
|
65
83
|
});
|
|
66
84
|
queryObject[key] = value;
|
|
67
85
|
var arr = [];
|
|
68
|
-
|
|
69
|
-
for (var name in queryObject) {
|
|
86
|
+
Object.keys(queryObject).forEach(function (name) {
|
|
70
87
|
arr.push("".concat(name, "=").concat(queryObject[name]));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
location.hash = "".concat(hashName, "?").concat(arr.join("&"));
|
|
88
|
+
});
|
|
89
|
+
window.location.hash = "".concat(hashName, "?").concat(arr.join("&"));
|
|
74
90
|
} else {
|
|
75
|
-
location.hash = hash;
|
|
91
|
+
window.location.hash = hash;
|
|
76
92
|
}
|
|
77
93
|
}
|
|
78
94
|
|
|
79
95
|
function getQueryString() {
|
|
80
96
|
// 获取Url上的参数,以{}返回
|
|
81
|
-
var hash = decodeURIComponent(location.hash);
|
|
97
|
+
var hash = decodeURIComponent(window.location.hash);
|
|
82
98
|
var queryObject = {};
|
|
83
99
|
var markIndex = hash.indexOf("?"); // contain query string in fragments
|
|
84
100
|
|
|
@@ -87,7 +103,7 @@ function getQueryString() {
|
|
|
87
103
|
var queryString = hash.slice(markIndex + 1);
|
|
88
104
|
var queryArray = queryString.split("&");
|
|
89
105
|
|
|
90
|
-
for (var i = 0; i < queryArray.length; i
|
|
106
|
+
for (var i = 0; i < queryArray.length; i += 1) {
|
|
91
107
|
var queryPair = queryArray[i].split("=");
|
|
92
108
|
|
|
93
109
|
if (queryPair[0] !== "_k") {
|
|
@@ -127,39 +143,42 @@ var highLightWord = function highLightWord(_ref) {
|
|
|
127
143
|
}
|
|
128
144
|
} else {
|
|
129
145
|
var doms = Array.from(parentDom.childNodes);
|
|
130
|
-
doms && doms.length > 0 && doms.map(function (dom) {
|
|
131
|
-
// @ts-ignore 1是元素 3是文本节点
|
|
132
|
-
if (dom.nodeType === 3) {
|
|
133
|
-
var _match = dom.data.match(reg);
|
|
134
146
|
|
|
135
|
-
|
|
147
|
+
if (doms && doms.length > 0) {
|
|
148
|
+
doms.forEach(function (dom) {
|
|
149
|
+
// @ts-ignore 1是元素 3是文本节点
|
|
150
|
+
if (dom.nodeType === 3) {
|
|
151
|
+
var _match = dom.data.match(reg);
|
|
136
152
|
|
|
137
|
-
|
|
138
|
-
var _highlight = document.createElement(nodeType);
|
|
153
|
+
var _currentDom = dom;
|
|
139
154
|
|
|
140
|
-
|
|
155
|
+
while (_match) {
|
|
156
|
+
var _highlight = document.createElement(nodeType);
|
|
141
157
|
|
|
142
|
-
|
|
158
|
+
_highlight.className = className;
|
|
143
159
|
|
|
144
|
-
|
|
160
|
+
var _wordNode = _currentDom.splitText(_match.index);
|
|
145
161
|
|
|
146
|
-
|
|
162
|
+
_currentDom = _wordNode.splitText(_match[0].length);
|
|
147
163
|
|
|
148
|
-
|
|
164
|
+
var _wordClone = _wordNode.cloneNode(true);
|
|
149
165
|
|
|
150
|
-
|
|
166
|
+
_highlight.appendChild(_wordClone);
|
|
151
167
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
168
|
+
_wordNode.parentNode.replaceChild(_highlight, _wordNode);
|
|
169
|
+
|
|
170
|
+
_match = _currentDom.data.match(reg);
|
|
171
|
+
}
|
|
172
|
+
} else if (dom.nodeType === 1 && dom.childNodes) {
|
|
173
|
+
for (var i = 0; i < dom.childNodes.length; i += 1) {
|
|
174
|
+
i += highLightWord({
|
|
175
|
+
parentDom: dom.childNodes[i],
|
|
176
|
+
keyWord: keyWord
|
|
177
|
+
});
|
|
178
|
+
}
|
|
160
179
|
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
163
182
|
}
|
|
164
183
|
}
|
|
165
184
|
};
|
|
@@ -173,19 +192,22 @@ var unHighLight = function unHighLight(_ref2) {
|
|
|
173
192
|
_ref2$nodeType = _ref2.nodeType,
|
|
174
193
|
nodeType = _ref2$nodeType === void 0 ? "span" : _ref2$nodeType;
|
|
175
194
|
var doms = parentDom.querySelectorAll("".concat(nodeType, " .").concat(className));
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
195
|
+
|
|
196
|
+
if (doms) {
|
|
197
|
+
doms.forEach(function (dom) {
|
|
198
|
+
var parentNode = dom.parentNode;
|
|
199
|
+
var firstChild = dom.firstChild;
|
|
200
|
+
parentNode.replaceChild(firstChild, dom);
|
|
201
|
+
parentNode.normalize();
|
|
202
|
+
});
|
|
203
|
+
}
|
|
182
204
|
};
|
|
183
205
|
|
|
184
206
|
exports.unHighLight = unHighLight;
|
|
185
207
|
|
|
186
208
|
var hexToRgba = function hexToRgba(hex) {
|
|
187
209
|
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
188
|
-
return "rgba(".concat(parseInt("0x".concat(hex.slice(1, 3))), ",").concat(parseInt("0x".concat(hex.slice(3, 5))), ",").concat(parseInt("0x".concat(hex.slice(5, 7))), ",").concat(opacity, ")");
|
|
210
|
+
return "rgba(".concat(parseInt("0x".concat(hex.slice(1, 3)), 16), ",").concat(parseInt("0x".concat(hex.slice(3, 5)), 16), ",").concat(parseInt("0x".concat(hex.slice(5, 7)), 16), ",").concat(opacity, ")");
|
|
189
211
|
};
|
|
190
212
|
|
|
191
213
|
exports.hexToRgba = hexToRgba;
|
|
@@ -199,13 +221,13 @@ var getUrlForUserPage = function getUrlForUserPage(options) {
|
|
|
199
221
|
|
|
200
222
|
var configs = _objectSpread(_objectSpread({}, defults), options);
|
|
201
223
|
|
|
202
|
-
if (!configs.userId || (0, _platform.isDD)(true) || (0, _platform.isFeishu)(true) || configs.userType
|
|
224
|
+
if (!configs.userId || (0, _platform.isDD)(true) || (0, _platform.isFeishu)(true) || configs.userType === 2) {
|
|
203
225
|
return "";
|
|
204
226
|
}
|
|
205
227
|
|
|
206
228
|
var userInfo = window.BSGlobal.loginUserInfo;
|
|
207
229
|
|
|
208
|
-
if (configs.userId
|
|
230
|
+
if (configs.userId === undefined) {
|
|
209
231
|
configs.userId = userInfo.Id;
|
|
210
232
|
}
|
|
211
233
|
|
|
@@ -223,6 +245,33 @@ var openPage = function openPage(url) {
|
|
|
223
245
|
} else {
|
|
224
246
|
window.open(url, "_blank");
|
|
225
247
|
}
|
|
226
|
-
};
|
|
248
|
+
}; // html标签转义
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
exports.openPage = openPage;
|
|
252
|
+
|
|
253
|
+
function htmlEncodeToHtmlByRegExp(str) {
|
|
254
|
+
var temp = "";
|
|
255
|
+
if (str.length === 0) return ""; // temp = str.replace(/&/g, "&")
|
|
256
|
+
|
|
257
|
+
temp = str.replace(/</g, "<");
|
|
258
|
+
temp = temp.replace(/>/g, ">"); // temp = temp.replace(/ /g, " ")
|
|
259
|
+
|
|
260
|
+
temp = temp.replace(/'/g, "'");
|
|
261
|
+
temp = temp.replace(/"/g, """);
|
|
262
|
+
temp = temp.replace(/\n/g, "<br/>");
|
|
263
|
+
return temp;
|
|
264
|
+
}
|
|
227
265
|
|
|
228
|
-
|
|
266
|
+
function htmlDecodeByHtmlRegExp(str) {
|
|
267
|
+
var temp = "";
|
|
268
|
+
if (str.length === 0) return "";
|
|
269
|
+
temp = str.replace(/&/g, "&");
|
|
270
|
+
temp = temp.replace(/</g, "<");
|
|
271
|
+
temp = temp.replace(/>/g, ">");
|
|
272
|
+
temp = temp.replace(/ /g, " ");
|
|
273
|
+
temp = temp.replace(/'/g, "'");
|
|
274
|
+
temp = temp.replace(/"/g, "\"");
|
|
275
|
+
temp = temp.replace(/<br\/>/g, "\n");
|
|
276
|
+
return temp;
|
|
277
|
+
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { CaseLink, Line } from "../style";
|
|
|
3
3
|
import OKRCases from "../../okrcase-library";
|
|
4
4
|
import Dialog from "../../dialog";
|
|
5
5
|
import Toast from "../../toast";
|
|
6
|
-
import { isLocal } from "../../../utils/helpers";
|
|
6
|
+
import { isLocal, isTencentHr } from "../../../utils/helpers";
|
|
7
7
|
import { getLocale } from "../../../utils/getLocale";
|
|
8
8
|
import "./index.scss";
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ interface Props {
|
|
|
12
12
|
okrTemplateEnabled: boolean;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export default function ({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
15
|
+
export default function OkrCase({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
16
16
|
const [visible, setVisible] = useState(false);
|
|
17
17
|
|
|
18
18
|
const okrCaseClickHandler = () => {
|
|
@@ -24,14 +24,14 @@ export default function ({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const OnOkrApplyHandler = (data) => {
|
|
27
|
-
onOkrApply
|
|
27
|
+
onOkrApply?.(data);
|
|
28
28
|
setVisible(false);
|
|
29
29
|
Toast.Success("成功套用");
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Line>
|
|
34
|
-
{okrTemplateEnabled && !isLocal() ? (
|
|
34
|
+
{okrTemplateEnabled && !isLocal() && !isTencentHr() ? (
|
|
35
35
|
<CaseLink onClick={okrCaseClickHandler} className="tu-icon-shoushi">
|
|
36
36
|
{getLocale("OKR_MyO_Pop_Butt_AddfromOKR")}
|
|
37
37
|
</CaseLink>
|
|
@@ -68,7 +68,7 @@ export default function ({ onOkrApply, okrTemplateEnabled }: Props) {
|
|
|
68
68
|
// offsetPosition={{ 'top': 41 }}
|
|
69
69
|
// fullSize={true}
|
|
70
70
|
// >
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
}
|
|
71
|
+
// {
|
|
72
|
+
// /* <OKRCases onClose={onCasesCloseHandler} onApplyTpl={OnOkrApplyHandler} /> */
|
|
73
|
+
// }
|
|
74
74
|
// </OldModal>
|
|
@@ -55,25 +55,25 @@ export const ObjTypeMapText = {
|
|
|
55
55
|
[EObjType.KanBan]: getLocale("Pro_page_V_Tab_Kanban"),
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export const ObjectType = () => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
42: getLocale("OKR_MyO_E_Reward"),
|
|
75
|
-
};
|
|
58
|
+
export const ObjectType = () => ({
|
|
59
|
+
1: getLocale("Mod_sannouncement"),
|
|
60
|
+
4: getLocale("Menu_Title_Projects"),
|
|
61
|
+
5: getLocale("Mod_sPerformanceForm"),
|
|
62
|
+
6: getLocale("Mod_sPerformanceGoals"),
|
|
63
|
+
7: getLocale("Mod_stasks"),
|
|
64
|
+
8: getLocale("Mod_sDailySummary"),
|
|
65
|
+
10: getLocale("Feed_sFeed"),
|
|
66
|
+
11: getLocale("Pro_page_Plan"),
|
|
67
|
+
12: getLocale("Feed_OperationTasks"),
|
|
68
|
+
62: getLocale("Mod_sobjective"),
|
|
69
|
+
65: getLocale("Feed_Keyresults"),
|
|
70
|
+
70: getLocale("OKR_MyO_KRP_Review"),
|
|
71
|
+
79: getLocale("Mod_skeyprogress"),
|
|
72
|
+
80: getLocale("Feed_sAnnouncement"),
|
|
73
|
+
42: getLocale("OKR_MyO_E_Reward"),
|
|
76
74
|
}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
77
|
|
|
78
78
|
export const EStatusStatus2ClassType = {
|
|
79
79
|
2: "tu-icon-finished",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLocale } from "../../../../utils/getLocale";
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const getEStatusClass2StatusTypeText = () => ({
|
|
4
4
|
2: getLocale("OKR_MyO_E_From_Completed"),
|
|
5
5
|
1: getLocale("Per_MyRe_text_Inprogress"),
|
|
6
6
|
4: getLocale("OKR_MyO_E_From_Cancelled"),
|
|
@@ -8,4 +8,6 @@ export const EStatusClass2StatusTypeText = {
|
|
|
8
8
|
6: getLocale("OKR_MyO_E_From_Suspended"),
|
|
9
9
|
0: getLocale("OKR_MyO_E_From_NotStarted"),
|
|
10
10
|
5: getLocale("OKR_MyO_E_From_Notaccepted"),
|
|
11
|
-
};
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default getEStatusClass2StatusTypeText;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, {
|
|
2
|
-
FC, useContext, useMemo,
|
|
2
|
+
FC, useContext, useMemo,
|
|
3
3
|
} from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { IDynamicItemContentProps } from "../../interface";
|
|
6
6
|
import DynamicItemHeader from "../components/header";
|
|
7
|
-
import {
|
|
7
|
+
import { getEStatusClass2StatusTypeText } from "./constant";
|
|
8
8
|
import { EStatusStatus2ClassType } from "../../constant";
|
|
9
9
|
import { SearchKeyContext } from "../../context";
|
|
10
10
|
import SearchKeyHandle from "../../../search-key-handle";
|
|
@@ -31,7 +31,7 @@ const DynamicProject: FC<IDynamicItemContentProps> = ({
|
|
|
31
31
|
const handleClickTitle = () => {
|
|
32
32
|
window.open(
|
|
33
33
|
window.location.href.replace(
|
|
34
|
-
location.hash,
|
|
34
|
+
window.location.hash,
|
|
35
35
|
`#work?iTalentNavCode=tita-work&work_id=${data.obj.objId}`,
|
|
36
36
|
),
|
|
37
37
|
);
|
|
@@ -69,7 +69,7 @@ const DynamicProject: FC<IDynamicItemContentProps> = ({
|
|
|
69
69
|
user={principalUser}
|
|
70
70
|
/>
|
|
71
71
|
<div className={`${prefix}__content`}>
|
|
72
|
-
<img className={`${prefix}__content-img`} src={ProjectImg} />
|
|
72
|
+
<img className={`${prefix}__content-img`} src={ProjectImg} alt="" />
|
|
73
73
|
<div className={`${prefix}__content-info`}>
|
|
74
74
|
<div className={`${prefix}__content-title`}>
|
|
75
75
|
<Tooltip.Text isPercent text={renderName} minusWidth={30} />
|
|
@@ -77,7 +77,7 @@ const DynamicProject: FC<IDynamicItemContentProps> = ({
|
|
|
77
77
|
<div className={`${prefix}__content-status-and-time-range`}>
|
|
78
78
|
<i className={classNames(EStatusStatus2ClassType[status])} />
|
|
79
79
|
<span className={`${prefix}__content-status-text`}>
|
|
80
|
-
{
|
|
80
|
+
{getEStatusClass2StatusTypeText()[status]}
|
|
81
81
|
</span>
|
|
82
82
|
<i className={classNames("tu-icon-deferred")} />
|
|
83
83
|
<span className={`${prefix}__content-time-range`}>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
line-height: 22px;
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
&::before {
|
|
25
|
-
content:
|
|
25
|
+
content: '';
|
|
26
26
|
display: inline-block;
|
|
27
27
|
width: 6px;
|
|
28
28
|
height: 6px;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
align-items: center;
|
|
46
46
|
margin-bottom: 8px;
|
|
47
47
|
&::before {
|
|
48
|
-
content:
|
|
48
|
+
content: '';
|
|
49
49
|
display: inline-block;
|
|
50
50
|
width: 4px;
|
|
51
51
|
height: 12px;
|
|
@@ -63,8 +63,9 @@
|
|
|
63
63
|
color: #3f4755;
|
|
64
64
|
line-height: 22px;
|
|
65
65
|
margin-left: 8px;
|
|
66
|
+
white-space: pre-wrap;
|
|
66
67
|
&::before {
|
|
67
|
-
content:
|
|
68
|
+
content: '';
|
|
68
69
|
display: inline-block;
|
|
69
70
|
width: 6px;
|
|
70
71
|
height: 6px;
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
line-height: 22px;
|
|
81
82
|
margin-bottom: 4px;
|
|
82
83
|
margin-left: 8px;
|
|
84
|
+
white-space: pre-wrap;
|
|
83
85
|
}
|
|
84
86
|
&-content--sub {
|
|
85
87
|
margin-left: 20px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, {
|
|
2
|
-
FC, useContext, useMemo,
|
|
2
|
+
FC, useContext, useMemo,
|
|
3
3
|
} from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { IDynamicItemContentProps } from "../../interface";
|
|
@@ -12,6 +12,7 @@ import DynamicTitle from "../../components/title";
|
|
|
12
12
|
import { getFeedTypeAndTypeColor } from "../../util";
|
|
13
13
|
import Tooltip from "../../../tooltip";
|
|
14
14
|
import { getLocale } from "../../../../utils/getLocale";
|
|
15
|
+
import { htmlDecodeByHtmlRegExp } from "../../../../utils/tools";
|
|
15
16
|
import "./index.scss";
|
|
16
17
|
|
|
17
18
|
const prefix = "titaui-dynamic-reply-item";
|
|
@@ -84,7 +85,7 @@ const DynamicReply: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
84
85
|
<div className={`${prefix}__detail-gain`}>
|
|
85
86
|
<div className={`${prefix}__detail-block-title`}>{getLocale("OKR_MyO_KRP_Pop_Value")}</div>
|
|
86
87
|
<div className={`${prefix}__detail-block-content`}>
|
|
87
|
-
<SearchKeyHandle str={data.gains} keyWord={searchKeyWord} />
|
|
88
|
+
<SearchKeyHandle str={htmlDecodeByHtmlRegExp(data.gains)} keyWord={searchKeyWord} />
|
|
88
89
|
</div>
|
|
89
90
|
</div>
|
|
90
91
|
<div>
|
|
@@ -101,7 +102,7 @@ const DynamicReply: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
101
102
|
</div>
|
|
102
103
|
<div className={`${prefix}__detail-block-content`}>
|
|
103
104
|
<SearchKeyHandle
|
|
104
|
-
str={item.drawback}
|
|
105
|
+
str={htmlDecodeByHtmlRegExp(item.drawback)}
|
|
105
106
|
keyWord={searchKeyWord}
|
|
106
107
|
/>
|
|
107
108
|
</div>
|
|
@@ -117,7 +118,7 @@ const DynamicReply: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
117
118
|
)}
|
|
118
119
|
>
|
|
119
120
|
<SearchKeyHandle
|
|
120
|
-
str={item.cause}
|
|
121
|
+
str={htmlDecodeByHtmlRegExp(item.cause)}
|
|
121
122
|
keyWord={searchKeyWord}
|
|
122
123
|
/>
|
|
123
124
|
</div>
|
|
@@ -135,7 +136,7 @@ const DynamicReply: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
135
136
|
)}
|
|
136
137
|
>
|
|
137
138
|
<SearchKeyHandle
|
|
138
|
-
str={item.measures}
|
|
139
|
+
str={htmlDecodeByHtmlRegExp(item.measures)}
|
|
139
140
|
keyWord={searchKeyWord}
|
|
140
141
|
/>
|
|
141
142
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLocale } from "../../../../utils/getLocale";
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const getEStatusClass2StatusTypeText = () => ({
|
|
4
4
|
2: getLocale("OKR_MyO_E_From_Completed"),
|
|
5
5
|
1: getLocale("Per_MyRe_text_Inprogress"),
|
|
6
6
|
4: getLocale("OKR_MyO_E_From_Cancelled"),
|
|
@@ -8,4 +8,6 @@ export const EStatusClass2StatusTypeText = {
|
|
|
8
8
|
6: getLocale("OKR_MyO_E_From_Suspended"),
|
|
9
9
|
0: getLocale("OKR_MyO_E_From_NotStarted"),
|
|
10
10
|
5: getLocale("OKR_MyO_E_From_Notaccepted"),
|
|
11
|
-
};
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default getEStatusClass2StatusTypeText;
|
|
@@ -4,7 +4,7 @@ import React, {
|
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { IDynamicItemContentProps } from "../../interface";
|
|
6
6
|
import DynamicItemHeader from "../components/header";
|
|
7
|
-
import {
|
|
7
|
+
import { getEStatusClass2StatusTypeText } from "./constant";
|
|
8
8
|
import TaskPng from "./img/task-icon.png";
|
|
9
9
|
import {
|
|
10
10
|
EObjType,
|
|
@@ -51,7 +51,7 @@ const DynamicTask: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
51
51
|
if (objType === EObjType.Project) {
|
|
52
52
|
window.open(
|
|
53
53
|
window.location.href.replace(
|
|
54
|
-
location.hash,
|
|
54
|
+
window.location.hash,
|
|
55
55
|
`#work?iTalentNavCode=tita-work&work_id=${objId}`,
|
|
56
56
|
),
|
|
57
57
|
);
|
|
@@ -60,7 +60,7 @@ const DynamicTask: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
60
60
|
if (workId <= 0) return;
|
|
61
61
|
window.open(
|
|
62
62
|
window.location.href.replace(
|
|
63
|
-
location.hash,
|
|
63
|
+
window.location.hash,
|
|
64
64
|
`#work?work_id=${workId}&detail_type=milepost`,
|
|
65
65
|
),
|
|
66
66
|
);
|
|
@@ -70,7 +70,7 @@ const DynamicTask: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
70
70
|
if (workId <= 0) return;
|
|
71
71
|
window.open(
|
|
72
72
|
window.location.href.replace(
|
|
73
|
-
location.hash,
|
|
73
|
+
window.location.hash,
|
|
74
74
|
`#work?work_id=${workId}&detail_type=kanban`,
|
|
75
75
|
),
|
|
76
76
|
);
|
|
@@ -125,7 +125,7 @@ const DynamicTask: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
125
125
|
user={principalUser}
|
|
126
126
|
/>
|
|
127
127
|
<div className={`${prefix}__content`}>
|
|
128
|
-
<img className={`${prefix}__content-img`} src={TaskPng} />
|
|
128
|
+
<img className={`${prefix}__content-img`} src={TaskPng} alt="" />
|
|
129
129
|
<div className={`${prefix}__content-info`}>
|
|
130
130
|
<div className={`${prefix}__content-title`}>
|
|
131
131
|
<Tooltip.Text isPercent text={renderName} minusWidth={30} />
|
|
@@ -133,7 +133,7 @@ const DynamicTask: FC<IDynamicItemContentProps> = ({ data, ...restProps }) => {
|
|
|
133
133
|
<div className={`${prefix}__content-status-and-time-range`}>
|
|
134
134
|
<i className={classNames(EStatusStatus2ClassType[status])} />
|
|
135
135
|
<span className={`${prefix}__content-status-text`}>
|
|
136
|
-
{
|
|
136
|
+
{getEStatusClass2StatusTypeText()[status]}
|
|
137
137
|
</span>
|
|
138
138
|
<i className={classNames("tu-icon-deferred")} />
|
|
139
139
|
<span className={`${prefix}__content-time-range`}>
|
|
@@ -66,8 +66,9 @@
|
|
|
66
66
|
}
|
|
67
67
|
&-items {
|
|
68
68
|
display: grid;
|
|
69
|
-
grid-template-columns: auto
|
|
69
|
+
grid-template-columns: auto 28px auto auto;
|
|
70
70
|
grid-row-gap: 16px;
|
|
71
|
+
margin-left: -8px;
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -93,8 +94,6 @@
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
&-avatar {
|
|
96
|
-
margin-left: 9px;
|
|
97
|
-
|
|
98
97
|
.titaui-pc-avator-container {
|
|
99
98
|
display: inline-flex !important;
|
|
100
99
|
}
|
|
@@ -28,7 +28,6 @@ const Item: FC<any> = ({ userInfo }) => {
|
|
|
28
28
|
// const handleOpenUserPage = () => {
|
|
29
29
|
// window.open(url, "_blank");
|
|
30
30
|
// };
|
|
31
|
-
const ObjectTypeText = ObjectType();
|
|
32
31
|
return (
|
|
33
32
|
<div className={`${preCls}`}>
|
|
34
33
|
<div className={`${preCls}-center`}>
|
|
@@ -48,7 +47,7 @@ const Item: FC<any> = ({ userInfo }) => {
|
|
|
48
47
|
<span>
|
|
49
48
|
{getLocale("Feed_Kudos")}
|
|
50
49
|
<OpenUserName id={toUserId} name={toUserName} />
|
|
51
|
-
{`${
|
|
50
|
+
{`${ObjectType()[pariseObjType] || "feed"}`}
|
|
52
51
|
</span>
|
|
53
52
|
)}
|
|
54
53
|
maxWidth={150}
|
|
@@ -80,9 +80,14 @@ const Dynamic: FC = () => {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
const handleDeleteFeed = (feedId) => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
const newDatas = dynamicData.filter((item: any) => item.feedId !== feedId);
|
|
84
|
+
setDynamicData([]);
|
|
85
|
+
// 动画效果如果直接设置新的数据,diff时间会比较长,所以直接清空再赋值,这样不会出现删除时等待长时间空白
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
setDynamicData([
|
|
88
|
+
...newDatas,
|
|
89
|
+
]);
|
|
90
|
+
}, 0);
|
|
86
91
|
};
|
|
87
92
|
|
|
88
93
|
const getDynamicData = (needResetValue) => {
|
|
@@ -26,7 +26,7 @@ export const DivMblogContent = styled.div`
|
|
|
26
26
|
background-color: #fff;
|
|
27
27
|
position: relative;
|
|
28
28
|
transition: all .2s ease-in-out;
|
|
29
|
-
height:
|
|
29
|
+
height: 200px;
|
|
30
30
|
box-sizing: border-box;
|
|
31
31
|
|
|
32
32
|
&.input_default-active {
|
|
@@ -60,7 +60,7 @@ export const Textarea = styled.textarea`
|
|
|
60
60
|
resize: none;
|
|
61
61
|
word-break: break-all;
|
|
62
62
|
word-wrap: break-word;
|
|
63
|
-
height:
|
|
63
|
+
height: 160px;
|
|
64
64
|
|
|
65
65
|
&.textarea-setheight {
|
|
66
66
|
visibility: hidden;
|
|
@@ -114,7 +114,7 @@ function EditChildOkrWeight(props: IProps) {
|
|
|
114
114
|
))}
|
|
115
115
|
</div>
|
|
116
116
|
</Dialog>
|
|
117
|
-
<DialogConfirm zIndex={
|
|
117
|
+
<DialogConfirm zIndex={2301} visible={showDialogConfirm} type="warning" className={`${precls}__confirm`}>
|
|
118
118
|
{/* @ts-ignore */}
|
|
119
119
|
<span type="title">{getLocale("OKR_MyO_Err_Delefocus")}</span>
|
|
120
120
|
<CancelButton type="button" onClick={closeDialogConfirm}>
|