@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
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
// url("./image/head-background-right1.png");
|
|
26
26
|
background-repeat: no-repeat;
|
|
27
27
|
// background-position: center bottom, left bottom, right bottom;
|
|
28
|
-
background-image: url(
|
|
28
|
+
background-image: url('./image/head-background.png');
|
|
29
29
|
background-position: center top;
|
|
30
30
|
// &-mask {
|
|
31
31
|
// height: 100%;
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
position: relative;
|
|
136
136
|
font-weight: 600;
|
|
137
137
|
&::after {
|
|
138
|
-
content:
|
|
138
|
+
content: '';
|
|
139
139
|
position: absolute;
|
|
140
140
|
bottom: -14px;
|
|
141
141
|
left: 0;
|
|
@@ -253,6 +253,7 @@
|
|
|
253
253
|
font-weight: 600;
|
|
254
254
|
}
|
|
255
255
|
&__btn {
|
|
256
|
+
font-size: 14px;
|
|
256
257
|
position: absolute;
|
|
257
258
|
right: 15px;
|
|
258
259
|
top: 60px;
|
|
@@ -265,6 +266,7 @@
|
|
|
265
266
|
cursor: pointer;
|
|
266
267
|
opacity: 0;
|
|
267
268
|
transition: all 0.5s;
|
|
269
|
+
font-weight: 500;
|
|
268
270
|
&-show {
|
|
269
271
|
top: 37px;
|
|
270
272
|
opacity: 1;
|
|
@@ -287,12 +289,12 @@
|
|
|
287
289
|
}
|
|
288
290
|
}
|
|
289
291
|
&-blue {
|
|
290
|
-
background-image: url(
|
|
292
|
+
background-image: url('./image/蓝.png');
|
|
291
293
|
background-color: #f4f8ff;
|
|
292
294
|
color: #2879ff;
|
|
293
295
|
}
|
|
294
296
|
&-red {
|
|
295
|
-
background-image: url(
|
|
297
|
+
background-image: url('./image/红.png');
|
|
296
298
|
background-color: rgba(240, 94, 94, 0.1);
|
|
297
299
|
color: #f05e5e;
|
|
298
300
|
}
|
|
@@ -415,7 +417,7 @@
|
|
|
415
417
|
height: 64px;
|
|
416
418
|
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
|
|
417
419
|
border-radius: 6px;
|
|
418
|
-
background-image: url(
|
|
420
|
+
background-image: url('./image/会员背景.png');
|
|
419
421
|
background-size: 100%;
|
|
420
422
|
background-repeat: no-repeat;
|
|
421
423
|
background-position: center;
|
|
@@ -439,7 +441,7 @@
|
|
|
439
441
|
width: 100%;
|
|
440
442
|
height: 114px;
|
|
441
443
|
background-color: #fff;
|
|
442
|
-
background-image: url(
|
|
444
|
+
background-image: url('./image/广告图片.png');
|
|
443
445
|
background-size: 100%;
|
|
444
446
|
background-repeat: no-repeat;
|
|
445
447
|
background-position: center;
|
|
@@ -536,7 +538,7 @@
|
|
|
536
538
|
flex-direction: column;
|
|
537
539
|
justify-content: start;
|
|
538
540
|
align-items: center;
|
|
539
|
-
background-image: url(
|
|
541
|
+
background-image: url('./image/支付背景.svg');
|
|
540
542
|
background-repeat: no-repeat;
|
|
541
543
|
background-position: center;
|
|
542
544
|
background-size: 100%;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FC, useState, useCallback } from "react";
|
|
2
2
|
import { LocalStorage } from "../../utils/local-storage";
|
|
3
|
+
import { notAllowData } from "./not-allow-data";
|
|
3
4
|
import "./index.scss";
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -10,6 +11,7 @@ interface Props {
|
|
|
10
11
|
|
|
11
12
|
const preCls = "part-notice";
|
|
12
13
|
const storage = new LocalStorage();
|
|
14
|
+
const tenantId = window.BSGlobal.tenantInfo.Id;
|
|
13
15
|
|
|
14
16
|
const PartNotice: FC<Props> = ({ storageName, text, link }) => {
|
|
15
17
|
const [visible, setVisible] = useState(() => {
|
|
@@ -33,6 +35,7 @@ const PartNotice: FC<Props> = ({ storageName, text, link }) => {
|
|
|
33
35
|
const handleOpenLink = () => {
|
|
34
36
|
window.open(link, "_target");
|
|
35
37
|
};
|
|
38
|
+
if (!notAllowData.find((item) => item === tenantId)) return <span />;
|
|
36
39
|
if (!visible) return <span />;
|
|
37
40
|
return (
|
|
38
41
|
<div className={`${preCls}`}>
|
|
@@ -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;
|
|
@@ -6,7 +6,7 @@ import Tooltip from "../tooltip";
|
|
|
6
6
|
import ConditionRender from "../condition-render";
|
|
7
7
|
import Avatar from "../../components/avatar";
|
|
8
8
|
import { OpenUserName } from "../../utils/open-data";
|
|
9
|
-
import {
|
|
9
|
+
import { getUserInfo } from "../../utils/bs-global";
|
|
10
10
|
import Card from "./components/card";
|
|
11
11
|
import {
|
|
12
12
|
getAttentionData,
|
|
@@ -32,6 +32,7 @@ interface IProps {
|
|
|
32
32
|
|
|
33
33
|
function PhotoCard(props: IProps) {
|
|
34
34
|
const { userId, isNameVisible = true } = props;
|
|
35
|
+
|
|
35
36
|
const [userInfo, setUserInfo] = useState<any>();
|
|
36
37
|
const [isAttention, setIsAttention] = useState(false);
|
|
37
38
|
|
|
@@ -50,15 +51,13 @@ function PhotoCard(props: IProps) {
|
|
|
50
51
|
|
|
51
52
|
useEffect(() => {
|
|
52
53
|
getOtherUserInfo(userId).then((res) => {
|
|
53
|
-
let currentUser;
|
|
54
54
|
if (res.Code === 1) {
|
|
55
|
-
currentUser = res.Data;
|
|
56
55
|
setUserInfo(res.Data);
|
|
57
56
|
}
|
|
58
|
-
getAttentionData().then((res) => {
|
|
57
|
+
getAttentionData(userId).then((res) => {
|
|
59
58
|
if (res.Code === 1) {
|
|
60
|
-
|
|
61
|
-
if (item.userId ===
|
|
59
|
+
res.Data.followerUsers.forEach((item) => {
|
|
60
|
+
if (item.userId === userownInfo.Id) {
|
|
62
61
|
setIsAttention(true);
|
|
63
62
|
}
|
|
64
63
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rget, rpost } from "../../utils/request";
|
|
2
2
|
|
|
3
|
-
export const getAttentionData = () => rget("v1")(`follow/
|
|
3
|
+
export const getAttentionData = (userId) => rget("v1")(`follow/getFollowerList?toUserId=${userId}`);
|
|
4
4
|
|
|
5
5
|
export const getVisitData = (userId) => rget("v1")(`okr/okrCyclePageVisitor?toUserId=${userId}`);
|
|
6
6
|
|
|
@@ -234,7 +234,7 @@ const NewOkrList: FC<any> = (props: {
|
|
|
234
234
|
replaceOkr={replaceOkr}
|
|
235
235
|
isShowPrincple={isShowPrincple}
|
|
236
236
|
isShowPeriod={isShowPeriod}
|
|
237
|
-
isShowEasyCreate={relation !== 2 && relation !== 3}
|
|
237
|
+
isShowEasyCreate={relation !== "2" && relation !== "3"}
|
|
238
238
|
openCreateModal={openCreateModal}
|
|
239
239
|
/>
|
|
240
240
|
<div className={`${precls}__pagination`}>
|
package/src/utils/helpers.ts
CHANGED
|
@@ -10,8 +10,8 @@ export function cssSupport(attr, value) {
|
|
|
10
10
|
}
|
|
11
11
|
export function getUploadMaxSize() {
|
|
12
12
|
const info = getBSGlobal("tenantInfo");
|
|
13
|
-
const isDingDing = info.Source
|
|
14
|
-
const isDingZhi = window.dingZhiSize && (window.dingZhiSize).indexOf(info.Id)
|
|
13
|
+
const isDingDing = info.Source === 861;
|
|
14
|
+
const isDingZhi = window.dingZhiSize && (window.dingZhiSize).indexOf(info.Id) !== -1;
|
|
15
15
|
if (isDingDing) return 20;
|
|
16
16
|
if (isDingZhi) return 100;
|
|
17
17
|
return 50;
|
|
@@ -21,9 +21,11 @@ export function getTenantInfo() {
|
|
|
21
21
|
return getBSGlobal("tenantInfo");
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const isDingDing = () => getTenantInfo().Source
|
|
24
|
+
export const isDingDing = () => getTenantInfo().Source === 861;
|
|
25
25
|
|
|
26
26
|
export const isLocal = () => !!getTenantInfo().isLocal;
|
|
27
|
+
|
|
28
|
+
export const isTencentHr = () => getTenantInfo().Source === 964;
|
|
27
29
|
export function escapeHtml(str) {
|
|
28
30
|
const htmlEscapes = {
|
|
29
31
|
"&": "&",
|
|
@@ -32,6 +34,6 @@ export function escapeHtml(str) {
|
|
|
32
34
|
""": "\"",
|
|
33
35
|
"'": "'",
|
|
34
36
|
};
|
|
35
|
-
return str.replace(/(&|<|>|"|')/g, (
|
|
37
|
+
return str.replace(/(&|<|>|"|')/g, (s) => htmlEscapes[s]);
|
|
36
38
|
}
|
|
37
39
|
export const getLoginUserInfo = () => getBSGlobal("loginUserInfo");
|
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
|
+
}
|