@titaui/pc 1.9.73 → 1.9.77
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 +5 -3
- 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.js +7 -2
- package/lib/components/mblog/style.js +3 -3
- package/lib/components/okr-detail/detail-header/confirm.js +2 -1
- package/lib/components/okr-detail/detail-header/index.js +13 -10
- package/lib/components/okr-progress-modal/helper.js +59 -45
- package/lib/components/okr-progress-modal/index.js +19 -14
- package/lib/components/okr-share/index.js +7 -2
- package/lib/components/okrcase-library/index.css +3 -1
- package/lib/components/part-notice/index.js +6 -0
- package/lib/components/part-notice/not-allow-data.js +10 -0
- package/lib/components/period-selector/common.js +18 -10
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +12 -11
- package/lib/utils/tools.js +94 -45
- package/package.json +2 -1
- 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.tsx +8 -3
- package/src/components/mblog/style.ts +6 -7
- package/src/components/okr-detail/detail-header/confirm.tsx +1 -1
- package/src/components/okr-detail/detail-header/index.tsx +19 -13
- package/src/components/okr-progress-modal/helper.js +49 -41
- package/src/components/okr-progress-modal/index.tsx +17 -16
- package/src/components/okr-share/index.tsx +9 -4
- 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/period-selector/common.ts +16 -10
- package/src/pages/okr-map/export-modules/okr-map/header/index.scss +24 -19
- package/src/utils/tools.js +48 -20
- package/yarn-error.log +16 -15807
|
@@ -76,7 +76,8 @@ var ShareContent = function ShareContent(_ref) {
|
|
|
76
76
|
var OkrShare = function OkrShare(_ref2) {
|
|
77
77
|
var data = _ref2.data,
|
|
78
78
|
visible = _ref2.visible,
|
|
79
|
-
onClose = _ref2.onClose
|
|
79
|
+
onClose = _ref2.onClose,
|
|
80
|
+
zIndex = _ref2.zIndex;
|
|
80
81
|
var modalRef = (0, _react.useRef)();
|
|
81
82
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Modal, {
|
|
82
83
|
visible: visible,
|
|
@@ -87,7 +88,8 @@ var OkrShare = function OkrShare(_ref2) {
|
|
|
87
88
|
onCancel: function onCancel() {
|
|
88
89
|
return onClose();
|
|
89
90
|
},
|
|
90
|
-
ref: modalRef
|
|
91
|
+
ref: modalRef,
|
|
92
|
+
zIndex: zIndex
|
|
91
93
|
}, visible ? /*#__PURE__*/_react["default"].createElement(ShareContent, {
|
|
92
94
|
closeModal: function closeModal() {
|
|
93
95
|
return onClose();
|
|
@@ -99,5 +101,8 @@ var OkrShare = function OkrShare(_ref2) {
|
|
|
99
101
|
}) : null);
|
|
100
102
|
};
|
|
101
103
|
|
|
104
|
+
OkrShare.defaultProps = {
|
|
105
|
+
zIndex: 1300
|
|
106
|
+
};
|
|
102
107
|
var _default = OkrShare;
|
|
103
108
|
exports["default"] = _default;
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.okr-cases-library__navFirst__item-active::after {
|
|
143
|
-
content:
|
|
143
|
+
content: '';
|
|
144
144
|
position: absolute;
|
|
145
145
|
bottom: -14px;
|
|
146
146
|
left: 0;
|
|
@@ -277,6 +277,7 @@
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
.okr-cases-library__cardList__card__title__btn {
|
|
280
|
+
font-size: 14px;
|
|
280
281
|
position: absolute;
|
|
281
282
|
right: 15px;
|
|
282
283
|
top: 60px;
|
|
@@ -289,6 +290,7 @@
|
|
|
289
290
|
cursor: pointer;
|
|
290
291
|
opacity: 0;
|
|
291
292
|
transition: all 0.5s;
|
|
293
|
+
font-weight: 500;
|
|
292
294
|
}
|
|
293
295
|
|
|
294
296
|
.okr-cases-library__cardList__card__title__btn-show {
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _localStorage = require("../../utils/local-storage");
|
|
13
13
|
|
|
14
|
+
var _notAllowData = require("./not-allow-data");
|
|
15
|
+
|
|
14
16
|
require("./index.css");
|
|
15
17
|
|
|
16
18
|
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); }
|
|
@@ -31,6 +33,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
31
33
|
|
|
32
34
|
var preCls = "part-notice";
|
|
33
35
|
var storage = new _localStorage.LocalStorage();
|
|
36
|
+
var tenantId = window.BSGlobal.tenantInfo.Id;
|
|
34
37
|
|
|
35
38
|
var PartNotice = function PartNotice(_ref) {
|
|
36
39
|
var storageName = _ref.storageName,
|
|
@@ -69,6 +72,9 @@ var PartNotice = function PartNotice(_ref) {
|
|
|
69
72
|
window.open(link, "_target");
|
|
70
73
|
};
|
|
71
74
|
|
|
75
|
+
if (!_notAllowData.notAllowData.find(function (item) {
|
|
76
|
+
return item === tenantId;
|
|
77
|
+
})) return /*#__PURE__*/_react["default"].createElement("span", null);
|
|
72
78
|
if (!visible) return /*#__PURE__*/_react["default"].createElement("span", null);
|
|
73
79
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
74
80
|
className: "".concat(preCls)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.notAllowData = exports["default"] = void 0;
|
|
7
|
+
var notAllowData = [366131, 307425, 386434, 318995, 516911, 520530, 529247, 283929, 521974, 525553, 524783, 533197, 506389, 541245, 265530, 542555, 322665, 388103, 523558, 521070, 547650, 527324, 543000, 536771, 377798, 548066, 541479, 538509, 509148, 383549, 533456, 395251, 516682, 546877, 521818, 552965, 551336, 518051, 544736, 552455, 534044, 529329, 554018, 518791, 392024, 553462, 504585, 551576, 547861, 504087, 555603, 526408, 536559, 555641, 553800, 553083, 554654, 552158, 542587, 379998, 510788, 553836, 529906, 511358, 551913, 543085, 514568, 397292, 556796, 538802, 546456, 549378, 542520, 560327, 548612, 522327, 555225, 530370, 565991, 547082, 564585, 535986, 502385, 391420, 560552, 558317, 564416, 552974, 318867, 570075, 560793, 565994, 533855, 375844, 549354, 571823, 537982, 528567, 568168, 569066, 515852, 566360, 548969, 553532, 352728, 562259, 521375];
|
|
8
|
+
exports.notAllowData = notAllowData;
|
|
9
|
+
var _default = notAllowData;
|
|
10
|
+
exports["default"] = _default;
|
|
@@ -23,8 +23,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
23
23
|
|
|
24
24
|
var dealSelectedPeriodData = function dealSelectedPeriodData(period) {
|
|
25
25
|
var option = {};
|
|
26
|
-
option.cycleType = period
|
|
27
|
-
option.yqmNum = period.substring(2)
|
|
26
|
+
option.cycleType = period === "-1" ? "-1" : period.substring(0, 1);
|
|
27
|
+
option.yqmNum = period.substring(2) === "" ? "0" : period.substring(2);
|
|
28
28
|
return option;
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -45,7 +45,7 @@ var dealYearsRange = function dealYearsRange(yearsRange, showAllYears) {
|
|
|
45
45
|
var startYear = yearsRange[0];
|
|
46
46
|
var endYear = yearsRange[yearsRange.length - 1];
|
|
47
47
|
|
|
48
|
-
for (var i = startYear; i <= endYear; i
|
|
48
|
+
for (var i = startYear; i <= endYear; i += 1) {
|
|
49
49
|
yearsData.push({
|
|
50
50
|
checked: false,
|
|
51
51
|
order: ["".concat(i)],
|
|
@@ -70,7 +70,7 @@ var formatPeriod = function formatPeriod(selected) {
|
|
|
70
70
|
if (!selected) return "";
|
|
71
71
|
var quarter = ["", "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_1stQuarter")), "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_2ndQuarter")), "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_3rdQuarter")), "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_4thQuarter"))];
|
|
72
72
|
var cycleDate = "";
|
|
73
|
-
var annualNum = selected.annualNum
|
|
73
|
+
var annualNum = selected.annualNum === "-1" ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Butt_Allyears")) : "".concat(selected.annualNum).concat(_getLocale.isEn ? "" : "年");
|
|
74
74
|
var month = (0, _constant.getMonth)();
|
|
75
75
|
|
|
76
76
|
switch ("".concat(selected.cycleType)) {
|
|
@@ -96,7 +96,7 @@ var formatPeriod = function formatPeriod(selected) {
|
|
|
96
96
|
break;
|
|
97
97
|
|
|
98
98
|
case "5":
|
|
99
|
-
cycleDate = selected.yqmNum
|
|
99
|
+
cycleDate = selected.yqmNum === "1" ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Firsthalf")) : "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Secondhalf"));
|
|
100
100
|
break;
|
|
101
101
|
|
|
102
102
|
default:
|
|
@@ -111,10 +111,10 @@ exports.formatPeriod = formatPeriod;
|
|
|
111
111
|
var computeYearIndex = function computeYearIndex(currentYear, yearsData, computeType) {
|
|
112
112
|
var newIndex;
|
|
113
113
|
var currentYearIndex = yearsData.findIndex(function (item) {
|
|
114
|
-
return Number(item.title)
|
|
114
|
+
return Number(item.title) === currentYear;
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
if (computeType
|
|
117
|
+
if (computeType === "add") {
|
|
118
118
|
newIndex = currentYearIndex + 1;
|
|
119
119
|
} else {
|
|
120
120
|
newIndex = currentYearIndex - 1;
|
|
@@ -137,6 +137,14 @@ var getDateRangeByCycle = function getDateRangeByCycle(cycle) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
switch (cycle.cycleType) {
|
|
140
|
+
case "-1":
|
|
141
|
+
{
|
|
142
|
+
return {
|
|
143
|
+
startDate: "",
|
|
144
|
+
endDate: ""
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
140
148
|
case "1":
|
|
141
149
|
{
|
|
142
150
|
var _start = (0, _moment["default"])().year(Number(cycle.annualNum)).month(startMonth - 1).date(1);
|
|
@@ -179,7 +187,7 @@ var getDateRangeByCycle = function getDateRangeByCycle(cycle) {
|
|
|
179
187
|
{
|
|
180
188
|
var _start3 = (0, _moment["default"])().year(Number(cycle.annualNum)).month(startMonth - 1).date(1);
|
|
181
189
|
|
|
182
|
-
if (cycle.yqmNum
|
|
190
|
+
if (cycle.yqmNum === "2") _start3.add(6, "M");
|
|
183
191
|
return {
|
|
184
192
|
startDate: _start3.format("YYYY/MM/DD"),
|
|
185
193
|
endDate: _start3.add(5, "month").endOf("M").format("YYYY/MM/DD")
|
|
@@ -226,8 +234,8 @@ function getDefalutCycle(setting) {
|
|
|
226
234
|
if (setting.isOpenBimonthly) {
|
|
227
235
|
var month = new Date().getMonth() + 1;
|
|
228
236
|
|
|
229
|
-
if (setting.yearStartMonth % 2
|
|
230
|
-
month -= month % 2
|
|
237
|
+
if (setting.yearStartMonth % 2 === 1) {
|
|
238
|
+
month -= month % 2 === 1 ? 0 : 1;
|
|
231
239
|
} else {
|
|
232
240
|
month = month - month % 2 || 12;
|
|
233
241
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
background: #ffffff;
|
|
4
4
|
box-shadow: 0px 0px 8px 0px #e9eef3;
|
|
5
5
|
position: relative;
|
|
6
|
-
border-bottom: 1px solid #
|
|
6
|
+
border-bottom: 1px solid #e9ecf0;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.titapage-okr-map__header__folded {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.titapage-okr-map__header-theme:hover {
|
|
71
|
-
color: #
|
|
71
|
+
color: #2879ff;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.titapage-okr-map__header-theme:hover:before {
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.titapage-okr-map__header-action-showkr:hover, .titapage-okr-map__header-action-level:hover {
|
|
116
|
-
background: #
|
|
116
|
+
background: #f7f8fa;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.titapage-okr-map__header-action--show-more {
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
height: 30px;
|
|
126
126
|
line-height: 30px;
|
|
127
127
|
cursor: pointer;
|
|
128
|
-
color: #
|
|
128
|
+
color: #3f4755;
|
|
129
129
|
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
130
130
|
font-size: 12px;
|
|
131
131
|
}
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
position: absolute;
|
|
135
135
|
display: inline-block;
|
|
136
136
|
background: url("../../../images/line-down-arrow.svg") transparent no-repeat 50% 50%;
|
|
137
|
-
content:
|
|
137
|
+
content: '';
|
|
138
138
|
height: 6px;
|
|
139
139
|
width: 10px;
|
|
140
140
|
right: 0;
|
|
@@ -151,9 +151,9 @@
|
|
|
151
151
|
|
|
152
152
|
.titapage-okr-map__show-more-popup {
|
|
153
153
|
padding: 11px 0;
|
|
154
|
-
background: #
|
|
154
|
+
background: #ffffff;
|
|
155
155
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
156
|
-
border: 1px solid #
|
|
156
|
+
border: 1px solid #e9ecf0;
|
|
157
157
|
border-radius: 2px;
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
.titapage-okr-map__dark .titapage-okr-map__header .titaui-period-selector button:hover {
|
|
229
|
-
background: #
|
|
229
|
+
background: #5c8eff;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
.titapage-okr-map__dark .titapage-okr-map__header .titaui-period-selector .titaui-period-selector__down-arrow {
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
.titapage-okr-map__dark .titapage-okr-map__header .titaui-icon-button-list__btn:hover {
|
|
265
|
-
background-color: #
|
|
265
|
+
background-color: #515a69;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
.titapage-okr-map__dark .rc-select-selection-item {
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
content: 'i';
|
|
287
287
|
width: 16px;
|
|
288
288
|
height: 16px;
|
|
289
|
-
background-color: #
|
|
289
|
+
background-color: #ffbc00;
|
|
290
290
|
color: #fff;
|
|
291
291
|
text-align: center;
|
|
292
292
|
line-height: 16px;
|
|
@@ -299,7 +299,8 @@
|
|
|
299
299
|
.titapage-okr-map--kr-dialog--content {
|
|
300
300
|
font-size: 14px;
|
|
301
301
|
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
302
|
-
color: #
|
|
302
|
+
color: #6f7886;
|
|
303
303
|
line-height: 20px;
|
|
304
304
|
padding: 0 32px;
|
|
305
|
+
display: block;
|
|
305
306
|
}
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.77",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"react-content-loader": "^6.0.3",
|
|
117
117
|
"react-cropper": "^2.1.8",
|
|
118
118
|
"react-custom-scrollbars": "^4.2.1",
|
|
119
|
+
"react-dom": "^17.0.2",
|
|
119
120
|
"react-grid-layout": "^1.2.5",
|
|
120
121
|
"react-perfect-scrollbar": "^1.5.8",
|
|
121
122
|
"react-sizeme": "^3.0.1",
|
|
@@ -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>
|