@titaui/pc 1.9.73 → 1.9.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/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/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/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/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-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/operation-records/OperationRecordItem.js +1 -1
- package/lib/components/operation-records/index.js +1 -1
- 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/utils/auth.js +1 -1
- package/lib/utils/tools.js +94 -45
- package/package.json +1 -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/utils/tools.js +48 -20
- package/yarn-error.log +0 -15894
|
@@ -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`}>
|
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
|
+
}
|