@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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export const notAllowData = [
|
|
2
|
+
366131,
|
|
3
|
+
307425,
|
|
4
|
+
386434,
|
|
5
|
+
318995,
|
|
6
|
+
516911,
|
|
7
|
+
520530,
|
|
8
|
+
529247,
|
|
9
|
+
283929,
|
|
10
|
+
521974,
|
|
11
|
+
525553,
|
|
12
|
+
524783,
|
|
13
|
+
533197,
|
|
14
|
+
506389,
|
|
15
|
+
541245,
|
|
16
|
+
265530,
|
|
17
|
+
542555,
|
|
18
|
+
322665,
|
|
19
|
+
388103,
|
|
20
|
+
523558,
|
|
21
|
+
521070,
|
|
22
|
+
547650,
|
|
23
|
+
527324,
|
|
24
|
+
543000,
|
|
25
|
+
536771,
|
|
26
|
+
377798,
|
|
27
|
+
548066,
|
|
28
|
+
541479,
|
|
29
|
+
538509,
|
|
30
|
+
509148,
|
|
31
|
+
383549,
|
|
32
|
+
533456,
|
|
33
|
+
395251,
|
|
34
|
+
516682,
|
|
35
|
+
546877,
|
|
36
|
+
521818,
|
|
37
|
+
552965,
|
|
38
|
+
551336,
|
|
39
|
+
518051,
|
|
40
|
+
544736,
|
|
41
|
+
552455,
|
|
42
|
+
534044,
|
|
43
|
+
529329,
|
|
44
|
+
554018,
|
|
45
|
+
518791,
|
|
46
|
+
392024,
|
|
47
|
+
553462,
|
|
48
|
+
504585,
|
|
49
|
+
551576,
|
|
50
|
+
547861,
|
|
51
|
+
504087,
|
|
52
|
+
555603,
|
|
53
|
+
526408,
|
|
54
|
+
536559,
|
|
55
|
+
555641,
|
|
56
|
+
553800,
|
|
57
|
+
553083,
|
|
58
|
+
554654,
|
|
59
|
+
552158,
|
|
60
|
+
542587,
|
|
61
|
+
379998,
|
|
62
|
+
510788,
|
|
63
|
+
553836,
|
|
64
|
+
529906,
|
|
65
|
+
511358,
|
|
66
|
+
551913,
|
|
67
|
+
543085,
|
|
68
|
+
514568,
|
|
69
|
+
397292,
|
|
70
|
+
556796,
|
|
71
|
+
538802,
|
|
72
|
+
546456,
|
|
73
|
+
549378,
|
|
74
|
+
542520,
|
|
75
|
+
560327,
|
|
76
|
+
548612,
|
|
77
|
+
522327,
|
|
78
|
+
555225,
|
|
79
|
+
530370,
|
|
80
|
+
565991,
|
|
81
|
+
547082,
|
|
82
|
+
564585,
|
|
83
|
+
535986,
|
|
84
|
+
502385,
|
|
85
|
+
391420,
|
|
86
|
+
560552,
|
|
87
|
+
558317,
|
|
88
|
+
564416,
|
|
89
|
+
552974,
|
|
90
|
+
318867,
|
|
91
|
+
570075,
|
|
92
|
+
560793,
|
|
93
|
+
565994,
|
|
94
|
+
533855,
|
|
95
|
+
375844,
|
|
96
|
+
549354,
|
|
97
|
+
571823,
|
|
98
|
+
537982,
|
|
99
|
+
528567,
|
|
100
|
+
568168,
|
|
101
|
+
569066,
|
|
102
|
+
515852,
|
|
103
|
+
566360,
|
|
104
|
+
548969,
|
|
105
|
+
553532,
|
|
106
|
+
352728,
|
|
107
|
+
562259,
|
|
108
|
+
521375,
|
|
109
|
+
];
|
|
110
|
+
export default notAllowData;
|
|
@@ -5,8 +5,8 @@ import { getMonth } from "../../utils/constant";
|
|
|
5
5
|
|
|
6
6
|
export const dealSelectedPeriodData = (period: string) => {
|
|
7
7
|
const option: any = {};
|
|
8
|
-
option.cycleType = period
|
|
9
|
-
option.yqmNum = period.substring(2)
|
|
8
|
+
option.cycleType = period === "-1" ? "-1" : period.substring(0, 1);
|
|
9
|
+
option.yqmNum = period.substring(2) === "" ? "0" : period.substring(2);
|
|
10
10
|
return option;
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -27,7 +27,7 @@ export const dealYearsRange = (
|
|
|
27
27
|
}
|
|
28
28
|
const startYear = yearsRange[0];
|
|
29
29
|
const endYear = yearsRange[yearsRange.length - 1];
|
|
30
|
-
for (let i = startYear; i <= endYear; i
|
|
30
|
+
for (let i = startYear; i <= endYear; i += 1) {
|
|
31
31
|
yearsData.push({
|
|
32
32
|
checked: false,
|
|
33
33
|
order: [`${i}`],
|
|
@@ -51,7 +51,7 @@ export const formatPeriod = (selected: SelectedInterface) => {
|
|
|
51
51
|
if (!selected) return "";
|
|
52
52
|
const quarter = ["", `${getLocale("OKR_MyO_Pop_1stQuarter")}`, `${getLocale("OKR_MyO_Pop_2ndQuarter")}`, `${getLocale("OKR_MyO_Pop_3rdQuarter")}`, `${getLocale("OKR_MyO_Pop_4thQuarter")}`];
|
|
53
53
|
let cycleDate = "";
|
|
54
|
-
const annualNum = selected.annualNum
|
|
54
|
+
const annualNum = selected.annualNum === "-1" ? `${getLocale("OKR_MyO_Butt_Allyears")}` : `${selected.annualNum}${isEn ? "" : "年"}`;
|
|
55
55
|
const month = getMonth();
|
|
56
56
|
switch (`${selected.cycleType}`) {
|
|
57
57
|
case "-1":
|
|
@@ -73,7 +73,7 @@ export const formatPeriod = (selected: SelectedInterface) => {
|
|
|
73
73
|
}`;
|
|
74
74
|
break;
|
|
75
75
|
case "5":
|
|
76
|
-
cycleDate = selected.yqmNum
|
|
76
|
+
cycleDate = selected.yqmNum === "1" ? `${getLocale("OKR_MyO_Pop_Firsthalf")}` : `${getLocale("OKR_MyO_Pop_Secondhalf")}`;
|
|
77
77
|
break;
|
|
78
78
|
default:
|
|
79
79
|
cycleDate = `${getLocale("Mod_Customization")}`;
|
|
@@ -88,9 +88,9 @@ export const computeYearIndex = (
|
|
|
88
88
|
) => {
|
|
89
89
|
let newIndex;
|
|
90
90
|
const currentYearIndex = yearsData.findIndex(
|
|
91
|
-
(item) => Number(item.title)
|
|
91
|
+
(item) => Number(item.title) === currentYear,
|
|
92
92
|
);
|
|
93
|
-
if (computeType
|
|
93
|
+
if (computeType === "add") {
|
|
94
94
|
newIndex = currentYearIndex + 1;
|
|
95
95
|
} else {
|
|
96
96
|
newIndex = currentYearIndex - 1;
|
|
@@ -112,6 +112,12 @@ export const getDateRangeByCycle = (cycle: ICycle, startMonth: number = 1) => {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
switch (cycle.cycleType) {
|
|
115
|
+
case "-1": {
|
|
116
|
+
return {
|
|
117
|
+
startDate: "",
|
|
118
|
+
endDate: "",
|
|
119
|
+
};
|
|
120
|
+
}
|
|
115
121
|
case "1": {
|
|
116
122
|
const start = moment()
|
|
117
123
|
.year(Number(cycle.annualNum))
|
|
@@ -159,7 +165,7 @@ export const getDateRangeByCycle = (cycle: ICycle, startMonth: number = 1) => {
|
|
|
159
165
|
.year(Number(cycle.annualNum))
|
|
160
166
|
.month(startMonth - 1)
|
|
161
167
|
.date(1);
|
|
162
|
-
if (cycle.yqmNum
|
|
168
|
+
if (cycle.yqmNum === "2") start.add(6, "M");
|
|
163
169
|
return {
|
|
164
170
|
startDate: start.format("YYYY/MM/DD"),
|
|
165
171
|
endDate: start.add(5, "month").endOf("M").format("YYYY/MM/DD"),
|
|
@@ -210,8 +216,8 @@ export function getDefalutCycle(setting) {
|
|
|
210
216
|
};
|
|
211
217
|
} if (setting.isOpenBimonthly) {
|
|
212
218
|
let month = new Date().getMonth() + 1;
|
|
213
|
-
if (setting.yearStartMonth % 2
|
|
214
|
-
month -= (month % 2
|
|
219
|
+
if (setting.yearStartMonth % 2 === 1) {
|
|
220
|
+
month -= (month % 2 === 1 ? 0 : 1);
|
|
215
221
|
} else {
|
|
216
222
|
month = month - (month % 2) || 12;
|
|
217
223
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
$font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica,
|
|
1
|
+
$font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica,
|
|
2
|
+
sans-serif, PingFang SC, Microsoft YaHei;
|
|
2
3
|
|
|
3
4
|
.titapage-okr-map {
|
|
4
5
|
&__header {
|
|
@@ -6,7 +7,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
6
7
|
background: #ffffff;
|
|
7
8
|
box-shadow: 0px 0px 8px 0px #e9eef3;
|
|
8
9
|
position: relative;
|
|
9
|
-
border-bottom: 1px solid #
|
|
10
|
+
border-bottom: 1px solid #e9ecf0;
|
|
10
11
|
&__folded {
|
|
11
12
|
// top: -114px;
|
|
12
13
|
height: 0;
|
|
@@ -65,7 +66,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
65
66
|
vertical-align: middle;
|
|
66
67
|
}
|
|
67
68
|
&:hover {
|
|
68
|
-
color: #
|
|
69
|
+
color: #2879ff;
|
|
69
70
|
&:before {
|
|
70
71
|
background-image: url('../../../images/trigger-hover.svg');
|
|
71
72
|
}
|
|
@@ -103,11 +104,11 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
|
-
&-showkr
|
|
107
|
-
|
|
107
|
+
&-showkr,
|
|
108
|
+
&-level {
|
|
108
109
|
padding: 5px 20px;
|
|
109
110
|
&:hover {
|
|
110
|
-
background: #
|
|
111
|
+
background: #f7f8fa;
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
&--show-more {
|
|
@@ -119,21 +120,22 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
119
120
|
height: 30px;
|
|
120
121
|
line-height: 30px;
|
|
121
122
|
cursor: pointer;
|
|
122
|
-
color: #
|
|
123
|
+
color: #3f4755;
|
|
123
124
|
font-family: $font-family;
|
|
124
125
|
font-size: 12px;
|
|
125
126
|
&:after {
|
|
126
127
|
position: absolute;
|
|
127
128
|
display: inline-block;
|
|
128
|
-
background: url('../../../images/line-down-arrow.svg') transparent
|
|
129
|
-
|
|
129
|
+
background: url('../../../images/line-down-arrow.svg') transparent
|
|
130
|
+
no-repeat 50% 50%;
|
|
131
|
+
content: '';
|
|
130
132
|
height: 6px;
|
|
131
133
|
width: 10px;
|
|
132
134
|
right: 0;
|
|
133
135
|
top: calc(50% - 3px);
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
|
-
|
|
138
|
+
|
|
137
139
|
&-btns {
|
|
138
140
|
position: absolute;
|
|
139
141
|
vertical-align: middle;
|
|
@@ -145,22 +147,24 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
145
147
|
}
|
|
146
148
|
&__show-more-popup {
|
|
147
149
|
padding: 11px 0;
|
|
148
|
-
background: #
|
|
150
|
+
background: #ffffff;
|
|
149
151
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
150
|
-
border: 1px solid #
|
|
152
|
+
border: 1px solid #e9ecf0;
|
|
151
153
|
border-radius: 2px;
|
|
152
154
|
}
|
|
153
155
|
}
|
|
154
156
|
.titapage-okr-map__dark {
|
|
155
157
|
.titapage-okr-map__content-search {
|
|
156
158
|
&:before {
|
|
157
|
-
background: url(../../../images/line-down-arrow-dark.svg) transparent
|
|
159
|
+
background: url(../../../images/line-down-arrow-dark.svg) transparent
|
|
160
|
+
no-repeat 50% 50%;
|
|
158
161
|
background-size: 100%;
|
|
159
162
|
}
|
|
160
163
|
}
|
|
161
164
|
.tui-select-selector {
|
|
162
165
|
&:before {
|
|
163
|
-
background: url(../../../images/down-arrow-dark.svg) transparent no-repeat
|
|
166
|
+
background: url(../../../images/down-arrow-dark.svg) transparent no-repeat
|
|
167
|
+
50% 50%;
|
|
164
168
|
background-size: 100%;
|
|
165
169
|
}
|
|
166
170
|
}
|
|
@@ -212,7 +216,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
212
216
|
border: none;
|
|
213
217
|
color: #fff;
|
|
214
218
|
&:hover {
|
|
215
|
-
background: #
|
|
219
|
+
background: #5c8eff;
|
|
216
220
|
}
|
|
217
221
|
}
|
|
218
222
|
.titaui-period-selector__down-arrow {
|
|
@@ -242,7 +246,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
242
246
|
}
|
|
243
247
|
}
|
|
244
248
|
&:hover {
|
|
245
|
-
background-color: #
|
|
249
|
+
background-color: #515a69;
|
|
246
250
|
}
|
|
247
251
|
}
|
|
248
252
|
}
|
|
@@ -261,14 +265,14 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
261
265
|
top: 0;
|
|
262
266
|
bottom: 0;
|
|
263
267
|
}
|
|
264
|
-
.titapage-okr-map--kr-dialog{
|
|
268
|
+
.titapage-okr-map--kr-dialog {
|
|
265
269
|
&--title {
|
|
266
270
|
&:before {
|
|
267
271
|
display: inline-block;
|
|
268
272
|
content: 'i';
|
|
269
273
|
width: 16px;
|
|
270
274
|
height: 16px;
|
|
271
|
-
background-color: #
|
|
275
|
+
background-color: #ffbc00;
|
|
272
276
|
color: #fff;
|
|
273
277
|
text-align: center;
|
|
274
278
|
line-height: 16px;
|
|
@@ -281,8 +285,9 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
|
|
|
281
285
|
&--content {
|
|
282
286
|
font-size: 14px;
|
|
283
287
|
font-family: $font-family;
|
|
284
|
-
color: #
|
|
288
|
+
color: #6f7886;
|
|
285
289
|
line-height: 20px;
|
|
286
290
|
padding: 0 32px;
|
|
291
|
+
display: block;
|
|
287
292
|
}
|
|
288
293
|
}
|
package/src/utils/tools.js
CHANGED
|
@@ -30,7 +30,7 @@ export function htmlDecodeByRegExp(str) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export function changeQueryString(key, value) {
|
|
33
|
-
const hash = decodeURIComponent(location.hash);
|
|
33
|
+
const hash = decodeURIComponent(window.location.hash);
|
|
34
34
|
const queryObject = {};
|
|
35
35
|
const markIndex = hash.indexOf("?");
|
|
36
36
|
// contain query string in fragments
|
|
@@ -40,23 +40,23 @@ export function changeQueryString(key, value) {
|
|
|
40
40
|
const queryString = hash.slice(markIndex + 1);
|
|
41
41
|
const queryArray = queryString.split("&");
|
|
42
42
|
queryArray.forEach((item) => {
|
|
43
|
-
|
|
44
|
-
queryObject[
|
|
43
|
+
const [tempItem0, tempItem1] = item.split("=");
|
|
44
|
+
queryObject[tempItem0] = tempItem1;
|
|
45
45
|
});
|
|
46
46
|
queryObject[key] = value;
|
|
47
47
|
const arr = [];
|
|
48
|
-
|
|
48
|
+
Object.keys(queryObject).forEach((name) => {
|
|
49
49
|
arr.push(`${name}=${queryObject[name]}`);
|
|
50
|
-
}
|
|
51
|
-
location.hash = `${hashName}?${arr.join("&")}`;
|
|
50
|
+
});
|
|
51
|
+
window.location.hash = `${hashName}?${arr.join("&")}`;
|
|
52
52
|
} else {
|
|
53
|
-
location.hash = hash;
|
|
53
|
+
window.location.hash = hash;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export function getQueryString() {
|
|
58
58
|
// 获取Url上的参数,以{}返回
|
|
59
|
-
const hash = decodeURIComponent(location.hash);
|
|
59
|
+
const hash = decodeURIComponent(window.location.hash);
|
|
60
60
|
const queryObject = {};
|
|
61
61
|
const markIndex = hash.indexOf("?");
|
|
62
62
|
// contain query string in fragments
|
|
@@ -64,7 +64,7 @@ export function getQueryString() {
|
|
|
64
64
|
// build query object
|
|
65
65
|
const queryString = hash.slice(markIndex + 1);
|
|
66
66
|
const queryArray = queryString.split("&");
|
|
67
|
-
for (let i = 0; i < queryArray.length; i
|
|
67
|
+
for (let i = 0; i < queryArray.length; i += 1) {
|
|
68
68
|
const queryPair = queryArray[i].split("=");
|
|
69
69
|
if (queryPair[0] !== "_k") {
|
|
70
70
|
queryObject[queryPair[0]] = decodeURIComponent(queryPair[1]);
|
|
@@ -97,9 +97,8 @@ export const highLightWord = ({
|
|
|
97
97
|
}
|
|
98
98
|
} else {
|
|
99
99
|
const doms = Array.from(parentDom.childNodes);
|
|
100
|
-
doms
|
|
101
|
-
|
|
102
|
-
&& doms.map((dom) => {
|
|
100
|
+
if (doms && doms.length > 0) {
|
|
101
|
+
doms.forEach((dom) => {
|
|
103
102
|
// @ts-ignore 1是元素 3是文本节点
|
|
104
103
|
if (dom.nodeType === 3) {
|
|
105
104
|
let match = dom.data.match(reg);
|
|
@@ -115,11 +114,12 @@ export const highLightWord = ({
|
|
|
115
114
|
match = currentDom.data.match(reg);
|
|
116
115
|
}
|
|
117
116
|
} else if (dom.nodeType === 1 && dom.childNodes) {
|
|
118
|
-
for (let i = 0; i < dom.childNodes.length; i
|
|
117
|
+
for (let i = 0; i < dom.childNodes.length; i += 1) {
|
|
119
118
|
i += highLightWord({ parentDom: dom.childNodes[i], keyWord });
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
});
|
|
122
|
+
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
};
|
|
@@ -130,22 +130,23 @@ export const unHighLight = ({
|
|
|
130
130
|
nodeType = "span",
|
|
131
131
|
}) => {
|
|
132
132
|
const doms = parentDom.querySelectorAll(`${nodeType} .${className}`);
|
|
133
|
-
doms
|
|
134
|
-
|
|
133
|
+
if (doms) {
|
|
134
|
+
doms.forEach((dom) => {
|
|
135
135
|
const { parentNode } = dom;
|
|
136
136
|
const { firstChild } = dom;
|
|
137
137
|
parentNode.replaceChild(firstChild, dom);
|
|
138
138
|
parentNode.normalize();
|
|
139
139
|
});
|
|
140
|
+
}
|
|
140
141
|
};
|
|
141
142
|
|
|
142
143
|
export const hexToRgba = (hex, opacity = 1) => (
|
|
143
144
|
`rgba(${
|
|
144
|
-
parseInt(`0x${hex.slice(1, 3)}
|
|
145
|
+
parseInt(`0x${hex.slice(1, 3)}`, 16)
|
|
145
146
|
},${
|
|
146
|
-
parseInt(`0x${hex.slice(3, 5)}
|
|
147
|
+
parseInt(`0x${hex.slice(3, 5)}`, 16)
|
|
147
148
|
},${
|
|
148
|
-
parseInt(`0x${hex.slice(5, 7)}
|
|
149
|
+
parseInt(`0x${hex.slice(5, 7)}`, 16)
|
|
149
150
|
},${
|
|
150
151
|
opacity
|
|
151
152
|
})`
|
|
@@ -163,13 +164,13 @@ export const getUrlForUserPage = (options) => {
|
|
|
163
164
|
!configs.userId
|
|
164
165
|
|| isDD(true)
|
|
165
166
|
|| isFeishu(true)
|
|
166
|
-
|| configs.userType
|
|
167
|
+
|| configs.userType === 2
|
|
167
168
|
) {
|
|
168
169
|
return "";
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
const userInfo = window.BSGlobal.loginUserInfo;
|
|
172
|
-
if (configs.userId
|
|
173
|
+
if (configs.userId === undefined) {
|
|
173
174
|
configs.userId = userInfo.Id;
|
|
174
175
|
}
|
|
175
176
|
const urlHost = window.BSGlobal.titaHost;
|
|
@@ -196,3 +197,30 @@ export const openPage = (url) => {
|
|
|
196
197
|
window.open(url, "_blank");
|
|
197
198
|
}
|
|
198
199
|
};
|
|
200
|
+
|
|
201
|
+
// html标签转义
|
|
202
|
+
export function htmlEncodeToHtmlByRegExp(str) {
|
|
203
|
+
let temp = "";
|
|
204
|
+
if (str.length === 0) return "";
|
|
205
|
+
// temp = str.replace(/&/g, "&")
|
|
206
|
+
temp = str.replace(/</g, "<");
|
|
207
|
+
temp = temp.replace(/>/g, ">");
|
|
208
|
+
// temp = temp.replace(/ /g, " ")
|
|
209
|
+
temp = temp.replace(/'/g, "'");
|
|
210
|
+
temp = temp.replace(/"/g, """);
|
|
211
|
+
temp = temp.replace(/\n/g, "<br/>");
|
|
212
|
+
return temp;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function htmlDecodeByHtmlRegExp(str) {
|
|
216
|
+
let temp = "";
|
|
217
|
+
if (str.length === 0) return "";
|
|
218
|
+
temp = str.replace(/&/g, "&");
|
|
219
|
+
temp = temp.replace(/</g, "<");
|
|
220
|
+
temp = temp.replace(/>/g, ">");
|
|
221
|
+
temp = temp.replace(/ /g, " ");
|
|
222
|
+
temp = temp.replace(/'/g, "'");
|
|
223
|
+
temp = temp.replace(/"/g, "\"");
|
|
224
|
+
temp = temp.replace(/<br\/>/g, "\n");
|
|
225
|
+
return temp;
|
|
226
|
+
}
|