@titaui/pc 1.9.77 → 1.9.78
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 +3 -5
- 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/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/detail-header/confirm.js +1 -2
- package/lib/components/okr-detail/detail-header/index.js +10 -13
- package/lib/components/okr-flow/export-modal/index.js +62 -38
- package/lib/components/okr-progress-modal/helper.js +45 -59
- package/lib/components/okr-progress-modal/index.js +14 -19
- 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/okr-share/index.js +2 -7
- package/lib/components/operation-records/OperationRecordItem.js +1 -1
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/period-selector/common.js +3 -3
- 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/package.json +1 -2
- package/src/components/mblog/style.ts +1 -4
- package/src/components/okr-detail/detail-header/confirm.tsx +1 -1
- package/src/components/okr-detail/detail-header/index.tsx +13 -19
- package/src/components/okr-flow/export-modal/index.tsx +50 -37
- package/src/components/okr-progress-modal/helper.js +41 -49
- package/src/components/okr-progress-modal/index.tsx +16 -17
- package/src/components/okr-share/index.tsx +4 -9
- package/src/components/period-selector/common.ts +3 -3
- package/yarn-error.log +0 -103
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.78",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -116,7 +116,6 @@
|
|
|
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",
|
|
120
119
|
"react-grid-layout": "^1.2.5",
|
|
121
120
|
"react-perfect-scrollbar": "^1.5.8",
|
|
122
121
|
"react-sizeme": "^3.0.1",
|
|
@@ -61,8 +61,6 @@ export const Textarea = styled.textarea`
|
|
|
61
61
|
word-break: break-all;
|
|
62
62
|
word-wrap: break-word;
|
|
63
63
|
height: 160px;
|
|
64
|
-
font-size: 14px;
|
|
65
|
-
line-height: 22px;
|
|
66
64
|
|
|
67
65
|
&.textarea-setheight {
|
|
68
66
|
visibility: hidden;
|
|
@@ -71,8 +69,7 @@ export const Textarea = styled.textarea`
|
|
|
71
69
|
`;
|
|
72
70
|
|
|
73
71
|
export const Tips = styled.div`
|
|
74
|
-
|
|
75
|
-
line-height: 22px;
|
|
72
|
+
line-height: 18px;
|
|
76
73
|
color: ${(p: any) => p.color};
|
|
77
74
|
text-align: right;
|
|
78
75
|
`;
|
|
@@ -18,7 +18,7 @@ function OkrDetailHeaderConfirm({ onConfirm, title = "", content = "" }: Props):
|
|
|
18
18
|
}, []);
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<Confirm visible={visible} type="warning"
|
|
21
|
+
<Confirm visible={visible} type="warning">
|
|
22
22
|
{
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
<span type="title">{title}</span>
|
|
@@ -71,15 +71,13 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
71
71
|
visibility: context.generalVisibility.visibility,
|
|
72
72
|
detailInfo,
|
|
73
73
|
openShareModal: async () => {
|
|
74
|
-
const
|
|
75
|
-
setKrs(
|
|
74
|
+
const krs = await getKrs({ okrId: detailInfo.workId });
|
|
75
|
+
setKrs(krs);
|
|
76
76
|
setShareVisible(true);
|
|
77
77
|
},
|
|
78
78
|
changeVisiblilty: (visibility) => {
|
|
79
|
-
if (visibility
|
|
80
|
-
|
|
81
|
-
userSelectRef.current.open();
|
|
82
|
-
}
|
|
79
|
+
if (visibility == 4) {
|
|
80
|
+
userSelectRef.current && userSelectRef.current.open();
|
|
83
81
|
return;
|
|
84
82
|
}
|
|
85
83
|
changVisiblity(detailInfo.workId, visibility);
|
|
@@ -102,11 +100,10 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
102
100
|
: getLocale("OKR_MyO_Err_Progress"),
|
|
103
101
|
);
|
|
104
102
|
if (res) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
await deleteUser(loginUserId, detailInfo.workId, 3);
|
|
109
|
-
}
|
|
103
|
+
follow
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
? await addUser(loginUserId, detailInfo.workId, 3)
|
|
106
|
+
: await deleteUser(loginUserId, detailInfo.workId, 3);
|
|
110
107
|
context.setGeneralRoleType(follow ? 3 : 0);
|
|
111
108
|
// 关注
|
|
112
109
|
Toast.Success(getLocale("Mod_Successfuloperat"));
|
|
@@ -120,11 +117,9 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
120
117
|
isFinish ? getLocale("OKR_MyO_Areycloseobjective") : getLocale("OKR_MyO_Err_Restart"),
|
|
121
118
|
);
|
|
122
119
|
if (res) {
|
|
123
|
-
|
|
124
|
-
await close(detailInfo.workId)
|
|
125
|
-
|
|
126
|
-
await start(detailInfo.workId);
|
|
127
|
-
}
|
|
120
|
+
isFinish
|
|
121
|
+
? await close(detailInfo.workId)
|
|
122
|
+
: await start(detailInfo.workId);
|
|
128
123
|
commonContext.refreshAll();
|
|
129
124
|
// 刷新
|
|
130
125
|
Toast.Success(getLocale("Mod_Successfuloperat"));
|
|
@@ -177,7 +172,7 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
177
172
|
<span className="okr-detail-head-parent">
|
|
178
173
|
<i className="tu-icon-liebiao-duiqinubiao" />
|
|
179
174
|
<span
|
|
180
|
-
onClick={() => (parent.type
|
|
175
|
+
onClick={() => (parent.type == "okr"
|
|
181
176
|
? drawerManager.open("okrDetail", {
|
|
182
177
|
okrId: parent.id,
|
|
183
178
|
})
|
|
@@ -185,7 +180,7 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
185
180
|
krId: parent.id,
|
|
186
181
|
}))}
|
|
187
182
|
>
|
|
188
|
-
<span>{parent.type
|
|
183
|
+
<span>{parent.type == "okr" ? "O " : "KR "}</span>
|
|
189
184
|
{parent.name}
|
|
190
185
|
</span>
|
|
191
186
|
</span>
|
|
@@ -207,7 +202,6 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
207
202
|
},
|
|
208
203
|
},
|
|
209
204
|
}}
|
|
210
|
-
zIndex={2400}
|
|
211
205
|
/>
|
|
212
206
|
<PopConfirm
|
|
213
207
|
ref={popRef}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, {
|
|
2
|
-
useState, useEffect, useRef,
|
|
2
|
+
useState, useEffect, useRef, FC,
|
|
3
3
|
} from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import Html2Canvas from "html2canvas";
|
|
@@ -25,7 +25,7 @@ interface IProps {
|
|
|
25
25
|
showkr: boolean;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const ExportMapModal: FC<IProps> = (props: IProps) => {
|
|
29
29
|
const {
|
|
30
30
|
visible = false,
|
|
31
31
|
onCloseHandler,
|
|
@@ -39,17 +39,19 @@ function ExportMapModal(props: IProps) {
|
|
|
39
39
|
const [isExport, setIsExport] = useState(false);
|
|
40
40
|
const modalRef = useRef();
|
|
41
41
|
useEffect(() => {
|
|
42
|
-
if (isWx()) {
|
|
43
|
-
window.WWOpenData
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
window.WWOpenData
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
if (isWx() && window.WWOpenData) {
|
|
43
|
+
if (window.WWOpenData.enableCanvasSharing) {
|
|
44
|
+
window.WWOpenData.enableCanvasSharing();
|
|
45
|
+
}
|
|
46
|
+
if (window.WWOpenData.initCanvas) {
|
|
47
|
+
window.WWOpenData.initCanvas();
|
|
48
|
+
}
|
|
49
49
|
}
|
|
50
50
|
}, []);
|
|
51
51
|
useEffect(() => {
|
|
52
|
-
visible && mapInstance
|
|
52
|
+
if (visible && mapInstance) {
|
|
53
|
+
mapInstance.fitView();
|
|
54
|
+
}
|
|
53
55
|
}, [visible, mapInstance]);
|
|
54
56
|
|
|
55
57
|
const downloadImg = async () => {
|
|
@@ -72,34 +74,41 @@ function ExportMapModal(props: IProps) {
|
|
|
72
74
|
useCORS: true, // 【重要】开启跨域配置
|
|
73
75
|
};
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
const imgUrl = result.toDataURL("image/png"); // 得到图片的base64编码数据
|
|
85
|
-
const url = await getBase64DownloadUrl(imgUrl.split(",")[1]);
|
|
86
|
-
const image = new Image();
|
|
87
|
-
|
|
88
|
-
image.setAttribute("crossOrigin", "anonymous");
|
|
89
|
-
image.onload = () => {
|
|
90
|
-
if (!url.Data.obj) {
|
|
91
|
-
Toast.Error("导出失败,请稍后重试", { canClose: false });
|
|
77
|
+
await Html2Canvas(okrMapRef, opts).then((result) => {
|
|
78
|
+
if (isWx() && window.WWOpenData) {
|
|
79
|
+
if (window.WWOpenData.enableCanvasSharing) {
|
|
80
|
+
window.WWOpenData.enableCanvasSharing();
|
|
81
|
+
}
|
|
82
|
+
if (window.WWOpenData.initCanvas) {
|
|
83
|
+
window.WWOpenData.initCanvas();
|
|
84
|
+
}
|
|
92
85
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
const imgUrl = result.toDataURL("image/png"); // 得到图片的base64编码数据
|
|
87
|
+
getBase64DownloadUrl(imgUrl.split(",")[1]).then((url) => {
|
|
88
|
+
const image = new Image();
|
|
89
|
+
|
|
90
|
+
image.setAttribute("crossOrigin", "anonymous");
|
|
91
|
+
image.onload = () => {
|
|
92
|
+
if (!url.Data.obj) {
|
|
93
|
+
Toast.Error("导出失败,请稍后重试", { canClose: false });
|
|
94
|
+
}
|
|
95
|
+
const a = document.createElement("a"); // 生成一个a元素
|
|
96
|
+
const event = new MouseEvent("click"); // 创建一个单击事件
|
|
97
|
+
a.download = "okr地图"; // 设置图片名称
|
|
98
|
+
a.href = url.Data.obj; // 将生成的URL设置为a.href属性
|
|
99
|
+
a.dispatchEvent(event); // 触发a的单击事件
|
|
100
|
+
Toast.Success("导出成功");
|
|
101
|
+
setIsExport(false);
|
|
102
|
+
if (onCloseHandler) {
|
|
103
|
+
onCloseHandler();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
image.src = imgUrl;
|
|
107
|
+
});
|
|
108
|
+
}).catch((err) => {
|
|
99
109
|
setIsExport(false);
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
image.src = imgUrl;
|
|
110
|
+
Toast.Error(err, { canClose: false });
|
|
111
|
+
});
|
|
103
112
|
};
|
|
104
113
|
|
|
105
114
|
const confirmHandler = () => {
|
|
@@ -178,5 +187,9 @@ function ExportMapModal(props: IProps) {
|
|
|
178
187
|
</>
|
|
179
188
|
</Dialog>
|
|
180
189
|
);
|
|
181
|
-
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
ExportMapModal.defaultProps = {
|
|
193
|
+
onCloseHandler: () => {},
|
|
194
|
+
};
|
|
182
195
|
export default ExportMapModal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Fragment } from "react";
|
|
2
2
|
import { getLocale } from "../../utils/getLocale";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const getO_SETTING = () => ({
|
|
5
5
|
settingTitle: getLocale("OKR_MyO_Pop_Upd_Setmatically"),
|
|
6
6
|
switchLabel: getLocale("OKR_MyO_Pop_Upd_Setmatically"),
|
|
7
7
|
options: [
|
|
@@ -16,35 +16,31 @@ export const getOSetting = () => ({
|
|
|
16
16
|
tooltip: getLocale("OKR_MyO_Pop_Upd_SubO"),
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
|
-
getRecommandText: (
|
|
19
|
+
getRecommandText: (autoUpdate = true, updateWay = 1, recommandProgressObj) => {
|
|
20
20
|
if (autoUpdate) {
|
|
21
|
-
if (updateWay
|
|
22
|
-
if (updateWay
|
|
23
|
-
|
|
21
|
+
if (updateWay == 1) return <span className="auto-update__recommand-tip">{getLocale("OKR_MyO_Pop_Upd_Automatic")}</span>;
|
|
22
|
+
if (updateWay == 2) return <span className="auto-update__recommand-tip">{getLocale("OKR_MyO_calculationSubO")}</span>;
|
|
23
|
+
} else {
|
|
24
|
+
const { childOkrProgress, childkrProgress } = recommandProgressObj;
|
|
25
|
+
const textArr = [];
|
|
26
|
+
childkrProgress !== -1 && textArr.push(`${getLocale("OKR_MyO_Pop_Upd_KRCom")}${childkrProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
27
|
+
childOkrProgress !== -1 && textArr.push(`${getLocale("OKR_MyO_Ew_SubobjCom")}${childOkrProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
28
|
+
if (textArr.length == 0) return "";
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<span className="auto-update__recommand-icon">{getLocale("Per_Ass_Pop_title_Recommend")}</span>
|
|
32
|
+
<span className="auto-update__recommand-tip">
|
|
33
|
+
(
|
|
34
|
+
{textArr.join(",")}
|
|
35
|
+
)
|
|
36
|
+
</span>
|
|
37
|
+
</>
|
|
38
|
+
);
|
|
24
39
|
}
|
|
25
|
-
const { childOkrProgress, childkrProgress } = recommandProgressObj;
|
|
26
|
-
const textArr = [];
|
|
27
|
-
if (childkrProgress !== -1) {
|
|
28
|
-
textArr.push(`${getLocale("OKR_MyO_Pop_Upd_KRCom")}${childkrProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
29
|
-
}
|
|
30
|
-
if (childOkrProgress !== -1) {
|
|
31
|
-
textArr.push(`${getLocale("OKR_MyO_Ew_SubobjCom")}${childOkrProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
32
|
-
}
|
|
33
|
-
if (textArr.length === 0) return "";
|
|
34
|
-
return (
|
|
35
|
-
<>
|
|
36
|
-
<span className="auto-update__recommand-icon">{getLocale("Per_Ass_Pop_title_Recommend")}</span>
|
|
37
|
-
<span className="auto-update__recommand-tip">
|
|
38
|
-
(
|
|
39
|
-
{textArr.join(",")}
|
|
40
|
-
)
|
|
41
|
-
</span>
|
|
42
|
-
</>
|
|
43
|
-
);
|
|
44
40
|
},
|
|
45
41
|
});
|
|
46
42
|
|
|
47
|
-
export const
|
|
43
|
+
export const getKR_SETTING = () => ({
|
|
48
44
|
settingTitle: getLocale("OKR_MyO_KRCompletion"),
|
|
49
45
|
switchLabel: getLocale("OKR_MyO_SetKRcompletion"),
|
|
50
46
|
options: [
|
|
@@ -59,35 +55,31 @@ export const getKrSetting = () => ({
|
|
|
59
55
|
tooltip: getLocale("OKR_MyO_KRcompletionde"),
|
|
60
56
|
},
|
|
61
57
|
],
|
|
62
|
-
getRecommandText: (
|
|
58
|
+
getRecommandText: (autoUpdate = true, updateWay = 1, recommandProgressObj) => {
|
|
63
59
|
if (autoUpdate) {
|
|
64
|
-
if (updateWay
|
|
65
|
-
if (updateWay
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
textArr.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
if (updateWay == 1) return <span className="auto-update__recommand-tip">{getLocale("OKR_MyO_Automatic")}</span>;
|
|
61
|
+
if (updateWay == 2) return <span className="auto-update__recommand-tip">{getLocale("OKR_MyO_calculationSubO")}</span>;
|
|
62
|
+
} else {
|
|
63
|
+
const { childOkrProgress, childEProgress } = recommandProgressObj;
|
|
64
|
+
const textArr = [];
|
|
65
|
+
childEProgress !== -1 && textArr.push(`${getLocale("OKR_MyO_Ecompletion")}${childEProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
66
|
+
childOkrProgress !== -1 && textArr.push(`${getLocale("OKR_MyO_Ew_SubobjCom")}${childOkrProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
67
|
+
if (textArr.length == 0) return "";
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
<span className="auto-update__recommand-icon">{getLocale("Per_Ass_Pop_title_Recommend")}</span>
|
|
71
|
+
<span className="auto-update__recommand-tip" style={{ marginLeft: 0 }}>
|
|
72
|
+
(
|
|
73
|
+
{textArr.join(",")}
|
|
74
|
+
)
|
|
75
|
+
</span>
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
75
78
|
}
|
|
76
|
-
if (textArr.length === 0) return "";
|
|
77
|
-
return (
|
|
78
|
-
<>
|
|
79
|
-
<span className="auto-update__recommand-icon">{getLocale("Per_Ass_Pop_title_Recommend")}</span>
|
|
80
|
-
<span className="auto-update__recommand-tip" style={{ marginLeft: 0 }}>
|
|
81
|
-
(
|
|
82
|
-
{textArr.join(",")}
|
|
83
|
-
)
|
|
84
|
-
</span>
|
|
85
|
-
</>
|
|
86
|
-
);
|
|
87
79
|
},
|
|
88
80
|
});
|
|
89
81
|
|
|
90
|
-
export const transProgress = (progress) => (progress
|
|
82
|
+
export const transProgress = (progress) => (progress == -1 ? 0 : progress);
|
|
91
83
|
|
|
92
84
|
export const getKrOptions = () => [
|
|
93
85
|
{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { useEffect, useState
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
2
|
import { Input, Modal, Tooltip } from "tita-ui";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { getKrRecommandProgress, getORecommandProgress } from "./request-apis";
|
|
5
5
|
import Switch from "../switch";
|
|
6
6
|
import Textarea from "./textarea";
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
getO_SETTING, getKR_SETTING, transProgress, getKrOptions, getOptions,
|
|
9
9
|
} from "./helper";
|
|
10
10
|
import {
|
|
11
11
|
ErrorTip, List, Item, Icon, Options, OptionsWrapper,
|
|
@@ -15,12 +15,12 @@ import { getLocale } from "../../utils/getLocale";
|
|
|
15
15
|
import { inputWordTrans } from "../../utils/i18n-front-translate";
|
|
16
16
|
import "./index.scss";
|
|
17
17
|
|
|
18
|
-
const ProgressModal: FC<IProgressModalProps> = (props
|
|
18
|
+
const ProgressModal: React.FC<IProgressModalProps> = (props) => {
|
|
19
19
|
const {
|
|
20
20
|
maxLength, okrInfo, onClose, onOk, title = window.getLocale("OKR_MyO_Prog_Butt_Update"), visible, isKr,
|
|
21
21
|
} = props;
|
|
22
22
|
|
|
23
|
-
const configure = isKr ?
|
|
23
|
+
const configure = isKr ? getKR_SETTING() : getO_SETTING();
|
|
24
24
|
|
|
25
25
|
const reg = /^[0-9]*[1-9][0-9]*$/;
|
|
26
26
|
const [errorProgress, setErrorProgress] = useState(false);
|
|
@@ -34,7 +34,10 @@ const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
|
|
|
34
34
|
const [selected, setSelected] = useState<number>(
|
|
35
35
|
isKr ? okrInfo.riskLevel : okrInfo.manualRiskLevel,
|
|
36
36
|
);
|
|
37
|
-
const [ShowKrProgress] = useState(
|
|
37
|
+
const [ShowKrProgress] = useState(() =>
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
window.BSGlobal.OkrAdvancedSetting.KRSetting.ShowKrProgress);
|
|
40
|
+
|
|
38
41
|
const [autoUpdate, setUpdate] = useState(true); // 设置自动更新
|
|
39
42
|
const [updateWay, setUpdateWay] = useState(0); // 自动更新方式 0: 关闭, 1: 根据关见成果, 2: 子目标
|
|
40
43
|
const [settingFolded, setSettingFold] = useState(false);
|
|
@@ -43,11 +46,11 @@ const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
|
|
|
43
46
|
const getRecommendProgress = async () => {
|
|
44
47
|
const getRecommandHandler = isKr ? getKrRecommandProgress : getORecommandProgress;
|
|
45
48
|
const data = await getRecommandHandler(isKr ? okrInfo.mileStoneId : okrInfo.workId);
|
|
46
|
-
if (data.Code
|
|
49
|
+
if (data.Code == 1) {
|
|
47
50
|
const { UpdateProgressWay, Progress } = data.Data;
|
|
48
51
|
setRecommandProgressObj(data.Data);
|
|
49
|
-
setUpdate(UpdateProgressWay
|
|
50
|
-
setUpdateWay(UpdateProgressWay
|
|
52
|
+
setUpdate(UpdateProgressWay != 0);
|
|
53
|
+
setUpdateWay(UpdateProgressWay == 0 ? 1 : UpdateProgressWay);
|
|
51
54
|
setProgress(Progress);
|
|
52
55
|
}
|
|
53
56
|
};
|
|
@@ -63,12 +66,9 @@ const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
|
|
|
63
66
|
useEffect(() => {
|
|
64
67
|
if (!autoUpdate) return;
|
|
65
68
|
const { childOkrProgress, childkrProgress, childEProgress } = recommandProgressObj;
|
|
66
|
-
|
|
67
|
-
setProgress(isKr ? transProgress(childEProgress) : transProgress(childkrProgress));
|
|
68
|
-
|
|
69
|
-
if (updateWay === 2) {
|
|
70
|
-
setProgress(transProgress(childOkrProgress));
|
|
71
|
-
}
|
|
69
|
+
updateWay == 1
|
|
70
|
+
&& setProgress(isKr ? transProgress(childEProgress) : transProgress(childkrProgress));
|
|
71
|
+
updateWay == 2 && setProgress(transProgress(childOkrProgress));
|
|
72
72
|
}, [updateWay, autoUpdate, recommandProgressObj]);
|
|
73
73
|
|
|
74
74
|
let descriptionText = (
|
|
@@ -131,7 +131,6 @@ const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
|
|
|
131
131
|
title={title}
|
|
132
132
|
visible={visible}
|
|
133
133
|
width={600}
|
|
134
|
-
zIndex={2400}
|
|
135
134
|
>
|
|
136
135
|
<List>
|
|
137
136
|
<Item>
|
|
@@ -166,7 +165,7 @@ const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
|
|
|
166
165
|
<Icon
|
|
167
166
|
color={option.color}
|
|
168
167
|
className={
|
|
169
|
-
selected
|
|
168
|
+
selected == option.id ? "tu-icon-singlebox-avtive" : "tu-icon-singlebox-have"
|
|
170
169
|
}
|
|
171
170
|
/>
|
|
172
171
|
<p>{option.text}</p>
|
|
@@ -196,7 +195,7 @@ const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
|
|
|
196
195
|
<span
|
|
197
196
|
className={classNames(
|
|
198
197
|
"auto-update-setting__radio",
|
|
199
|
-
`auto-update-setting__radio${updateWay
|
|
198
|
+
`auto-update-setting__radio${updateWay == option.key ? "--selected" : ""
|
|
200
199
|
}`,
|
|
201
200
|
)}
|
|
202
201
|
/>
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
data: any;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const ShareContent = ({ closeModal, getModalRef, data }: Props)
|
|
14
|
+
const ShareContent = function ({ closeModal, getModalRef, data }: Props) {
|
|
15
15
|
const [shareImg, setShareImg] = useState<string>();
|
|
16
16
|
const [showPublish, setShowPublish] = useState(false);
|
|
17
17
|
return (
|
|
@@ -43,14 +43,12 @@ const ShareContent = ({ closeModal, getModalRef, data }: Props) => {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
interface ShareProps {
|
|
46
|
+
shareComponent
|
|
46
47
|
data: any;
|
|
47
48
|
visible:boolean;
|
|
48
|
-
zIndex?: number;
|
|
49
49
|
onClose: () => void
|
|
50
50
|
}
|
|
51
|
-
const OkrShare: React.FC<ShareProps> = ({
|
|
52
|
-
data, visible, onClose, zIndex,
|
|
53
|
-
}) => {
|
|
51
|
+
const OkrShare: React.FC<ShareProps> = ({ data, visible, onClose }) => {
|
|
54
52
|
const modalRef = useRef<any>();
|
|
55
53
|
|
|
56
54
|
return (
|
|
@@ -62,7 +60,6 @@ const OkrShare: React.FC<ShareProps> = ({
|
|
|
62
60
|
// maskClosable
|
|
63
61
|
onCancel={() => onClose()}
|
|
64
62
|
ref={modalRef}
|
|
65
|
-
zIndex={zIndex}
|
|
66
63
|
>
|
|
67
64
|
{visible ? (
|
|
68
65
|
<ShareContent
|
|
@@ -74,7 +71,5 @@ const OkrShare: React.FC<ShareProps> = ({
|
|
|
74
71
|
</Modal>
|
|
75
72
|
);
|
|
76
73
|
};
|
|
77
|
-
|
|
78
|
-
zIndex: 1300,
|
|
79
|
-
};
|
|
74
|
+
|
|
80
75
|
export default OkrShare;
|
|
@@ -5,7 +5,7 @@ import { getMonth } from "../../utils/constant";
|
|
|
5
5
|
|
|
6
6
|
export const dealSelectedPeriodData = (period: string) => {
|
|
7
7
|
const option: any = {};
|
|
8
|
-
option.cycleType = period ===
|
|
8
|
+
option.cycleType = Number(period) === -1 ? "-1" : period.substring(0, 1);
|
|
9
9
|
option.yqmNum = period.substring(2) === "" ? "0" : period.substring(2);
|
|
10
10
|
return option;
|
|
11
11
|
};
|
|
@@ -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 = Number(`${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 = Number(`${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")}`;
|
package/yarn-error.log
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
Arguments:
|
|
2
|
-
/usr/local/bin/node /usr/local/bin/yarn
|
|
3
|
-
|
|
4
|
-
PATH:
|
|
5
|
-
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/opt/homebrew/sbin
|
|
6
|
-
|
|
7
|
-
Yarn version:
|
|
8
|
-
1.22.10
|
|
9
|
-
|
|
10
|
-
Node version:
|
|
11
|
-
12.22.1
|
|
12
|
-
|
|
13
|
-
Platform:
|
|
14
|
-
darwin x64
|
|
15
|
-
|
|
16
|
-
Trace:
|
|
17
|
-
SyntaxError: /Users/yang/tita/titaui-pc/package.json: Unexpected token < in JSON at position 26
|
|
18
|
-
at JSON.parse (<anonymous>)
|
|
19
|
-
at /usr/local/lib/node_modules/yarn/lib/cli.js:1625:59
|
|
20
|
-
at Generator.next (<anonymous>)
|
|
21
|
-
at step (/usr/local/lib/node_modules/yarn/lib/cli.js:310:30)
|
|
22
|
-
at /usr/local/lib/node_modules/yarn/lib/cli.js:321:13
|
|
23
|
-
|
|
24
|
-
npm manifest:
|
|
25
|
-
{
|
|
26
|
-
"name": "@titaui/pc",
|
|
27
|
-
<<<<<<< HEAD
|
|
28
|
-
"version": "1.2.22",
|
|
29
|
-
=======
|
|
30
|
-
"version": "1.2.13",
|
|
31
|
-
>>>>>>> master
|
|
32
|
-
"nameCN": "",
|
|
33
|
-
"description": "",
|
|
34
|
-
"main": "src/index.js",
|
|
35
|
-
"scripts": {
|
|
36
|
-
"storybook": "start-storybook -p 6006 --no-dll",
|
|
37
|
-
"start": "dev_server=on webpack-dev-server --disableHostCheck=true --progress --colors --config webpack-stories.config.js",
|
|
38
|
-
"build-storybook": "build-storybook --docs --no-dll",
|
|
39
|
-
"build:es": "babel src -d es --ignore **/__tests__",
|
|
40
|
-
"build:lib": "cross-env OUTPUT_MODULE=commonjs babel src -d lib --ignore **/__tests__",
|
|
41
|
-
"build:umd": "webpack --config ./.scripts/webpack.umd.js",
|
|
42
|
-
"build": "npm run build:lib && npm run build:es && npm run build:umd"
|
|
43
|
-
},
|
|
44
|
-
"author": "",
|
|
45
|
-
"license": "ISC",
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"del": "^6.0.0",
|
|
48
|
-
"gulp": "^3.x",
|
|
49
|
-
"gulp-autoprefixer": "^7.0.1",
|
|
50
|
-
"gulp-babel": "^8.0.0",
|
|
51
|
-
"gulp-concat": "^2.6.1",
|
|
52
|
-
"gulp-cssbeautify": "^3.0.0",
|
|
53
|
-
"gulp-cssnano": "^2.1.3",
|
|
54
|
-
"gulp-filesize": "0.0.6",
|
|
55
|
-
"gulp-postcss": "^9.0.0",
|
|
56
|
-
"gulp-rename": "^2.0.0",
|
|
57
|
-
"gulp-replace": "^1.0.0",
|
|
58
|
-
"gulp-sass": "^4.1.0",
|
|
59
|
-
"gulp-sourcemaps": "^2.6.5",
|
|
60
|
-
"sass-resources-loader": "^2.2.1"
|
|
61
|
-
},
|
|
62
|
-
"dependencies": {
|
|
63
|
-
"@titaui/dagre": "^0.8.8-pre",
|
|
64
|
-
"@titaui/rc-tree2": "^4.1.15",
|
|
65
|
-
"@titaui/rc-trigger": "^5.2.5",
|
|
66
|
-
"@titaui/react-flow-renderer": "9.5.4",
|
|
67
|
-
"@titaui/toast": "^1.0.0",
|
|
68
|
-
"axios": "^0.21.1",
|
|
69
|
-
"classnames": "^2.2.6",
|
|
70
|
-
"clone-deep": "^4.0.1",
|
|
71
|
-
"d3-cloud": "^1.2.5",
|
|
72
|
-
"dayjs": "^1.10.4",
|
|
73
|
-
"html2canvas": "^1.0.0-rc.7",
|
|
74
|
-
"moment": "^2.29.1",
|
|
75
|
-
"qs": "^6.10.1",
|
|
76
|
-
"rc-checkbox": "^2.3.2",
|
|
77
|
-
"rc-dialog": "8.5.2",
|
|
78
|
-
"rc-drawer": "^4.3.1",
|
|
79
|
-
"rc-input-number": "^5.0.0",
|
|
80
|
-
"rc-pagination": "^3.1.6",
|
|
81
|
-
"rc-queue-anim": "1.4.1",
|
|
82
|
-
"rc-select": "^12.1.7",
|
|
83
|
-
"rc-switch": "^3.2.2",
|
|
84
|
-
"rc-table": "^7.13.2",
|
|
85
|
-
"rc-tabs": "^11.7.3",
|
|
86
|
-
"rc-tooltip": "^5.1.1",
|
|
87
|
-
"rc-tree": "^4.1.5",
|
|
88
|
-
"rc-trigger": "^5.2.3",
|
|
89
|
-
"rc-upload": "^4.2.0-alpha.0",
|
|
90
|
-
"rc-util": "^5.13.1",
|
|
91
|
-
"react-collapse": "^5.1.0",
|
|
92
|
-
"react-perfect-scrollbar": "^1.5.2",
|
|
93
|
-
"url-parse": "^1.5.1",
|
|
94
|
-
"uuid": "^3.1.0",
|
|
95
|
-
"wordcloud": "^1.2.2"
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
yarn manifest:
|
|
100
|
-
No manifest
|
|
101
|
-
|
|
102
|
-
Lockfile:
|
|
103
|
-
No lockfile
|