@titaui/pc 1.9.76 → 1.9.81
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 +7 -5
- package/lib/components/change-okr-modal/Item.js +26 -24
- package/lib/components/change-okr-modal/styledComponents.js +5 -5
- package/lib/components/mblog/style.js +2 -2
- 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-flow/export-modal/index.js +65 -41
- 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/period-selector/common.js +18 -10
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +12 -11
- package/package.json +2 -1
- package/src/components/change-okr-modal/Item.tsx +22 -22
- package/src/components/change-okr-modal/styledComponents.ts +11 -5
- package/src/components/mblog/style.ts +4 -5
- 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-flow/export-modal/index.tsx +52 -39
- 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/period-selector/common.ts +16 -10
- package/src/pages/okr-map/export-modules/okr-map/header/index.scss +24 -19
- package/yarn-error.log +0 -103
|
@@ -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 () => {
|
|
@@ -57,7 +59,7 @@ function ExportMapModal(props: IProps) {
|
|
|
57
59
|
const width = okrMapRef.clientWidth; // 获取dom 宽度
|
|
58
60
|
const height = okrMapRef.clientHeight; // 获取dom 高度
|
|
59
61
|
const canvas = document.createElement("canvas"); // 创建一个canvas节点
|
|
60
|
-
const scale =
|
|
62
|
+
const scale = 10; // 定义任意放大倍数 支持小数 设置成20之后企业微信工作台导出不了
|
|
61
63
|
canvas.width = width * scale; // 定义canvas 宽度 * 缩放
|
|
62
64
|
canvas.height = height * scale; // 定义canvas高度 *缩放
|
|
63
65
|
canvas.style.width = `${width}px`;
|
|
@@ -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 = () => {
|
|
@@ -107,7 +116,7 @@ function ExportMapModal(props: IProps) {
|
|
|
107
116
|
Toast.Warning("正在导出中", { canClose: true });
|
|
108
117
|
return;
|
|
109
118
|
}
|
|
110
|
-
setIsExport(true);
|
|
119
|
+
// setIsExport(true);
|
|
111
120
|
downloadImg();
|
|
112
121
|
};
|
|
113
122
|
const fitViewHandler = (instance) => {
|
|
@@ -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 getOSetting = () => ({
|
|
5
5
|
settingTitle: getLocale("OKR_MyO_Pop_Upd_Setmatically"),
|
|
6
6
|
switchLabel: getLocale("OKR_MyO_Pop_Upd_Setmatically"),
|
|
7
7
|
options: [
|
|
@@ -16,31 +16,35 @@ export const getO_SETTING = () => ({
|
|
|
16
16
|
tooltip: getLocale("OKR_MyO_Pop_Upd_SubO"),
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
|
-
getRecommandText: (autoUpdate = true, updateWay = 1
|
|
19
|
+
getRecommandText: (recommandProgressObj, autoUpdate = true, updateWay = 1) => {
|
|
20
20
|
if (autoUpdate) {
|
|
21
|
-
if (updateWay
|
|
22
|
-
if (updateWay
|
|
23
|
-
|
|
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
|
-
);
|
|
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
|
+
return <span />;
|
|
39
24
|
}
|
|
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
|
+
);
|
|
40
44
|
},
|
|
41
45
|
});
|
|
42
46
|
|
|
43
|
-
export const
|
|
47
|
+
export const getKrSetting = () => ({
|
|
44
48
|
settingTitle: getLocale("OKR_MyO_KRCompletion"),
|
|
45
49
|
switchLabel: getLocale("OKR_MyO_SetKRcompletion"),
|
|
46
50
|
options: [
|
|
@@ -55,31 +59,35 @@ export const getKR_SETTING = () => ({
|
|
|
55
59
|
tooltip: getLocale("OKR_MyO_KRcompletionde"),
|
|
56
60
|
},
|
|
57
61
|
],
|
|
58
|
-
getRecommandText: (autoUpdate = true, updateWay = 1
|
|
62
|
+
getRecommandText: (recommandProgressObj, autoUpdate = true, updateWay = 1) => {
|
|
59
63
|
if (autoUpdate) {
|
|
60
|
-
if (updateWay
|
|
61
|
-
if (updateWay
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<span className="auto-update__recommand-tip" style={{ marginLeft: 0 }}>
|
|
72
|
-
(
|
|
73
|
-
{textArr.join(",")}
|
|
74
|
-
)
|
|
75
|
-
</span>
|
|
76
|
-
</>
|
|
77
|
-
);
|
|
64
|
+
if (updateWay === 1) return <span className="auto-update__recommand-tip">{getLocale("OKR_MyO_Automatic")}</span>;
|
|
65
|
+
if (updateWay === 2) return <span className="auto-update__recommand-tip">{getLocale("OKR_MyO_calculationSubO")}</span>;
|
|
66
|
+
return <span />;
|
|
67
|
+
}
|
|
68
|
+
const { childOkrProgress, childEProgress } = recommandProgressObj;
|
|
69
|
+
const textArr = [];
|
|
70
|
+
if (childEProgress !== -1) {
|
|
71
|
+
textArr.push(`${getLocale("OKR_MyO_Ecompletion")}${childEProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
72
|
+
}
|
|
73
|
+
if (childOkrProgress !== -1) {
|
|
74
|
+
textArr.push(`${getLocale("OKR_MyO_Ew_SubobjCom")}${childOkrProgress}${getLocale("OKR_MyO_Pop_Upd_Percentage")}`);
|
|
78
75
|
}
|
|
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
|
+
);
|
|
79
87
|
},
|
|
80
88
|
});
|
|
81
89
|
|
|
82
|
-
export const transProgress = (progress) => (progress
|
|
90
|
+
export const transProgress = (progress) => (progress === -1 ? 0 : progress);
|
|
83
91
|
|
|
84
92
|
export const getKrOptions = () => [
|
|
85
93
|
{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
1
|
+
import React, { useEffect, useState, FC } 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
|
+
getOSetting, getKrSetting, 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:
|
|
18
|
+
const ProgressModal: FC<IProgressModalProps> = (props:IProgressModalProps) => {
|
|
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 ? getKrSetting() : getOSetting();
|
|
24
24
|
|
|
25
25
|
const reg = /^[0-9]*[1-9][0-9]*$/;
|
|
26
26
|
const [errorProgress, setErrorProgress] = useState(false);
|
|
@@ -34,10 +34,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
|
|
|
34
34
|
const [selected, setSelected] = useState<number>(
|
|
35
35
|
isKr ? okrInfo.riskLevel : okrInfo.manualRiskLevel,
|
|
36
36
|
);
|
|
37
|
-
const [ShowKrProgress] = useState(
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
window.BSGlobal.OkrAdvancedSetting.KRSetting.ShowKrProgress);
|
|
40
|
-
|
|
37
|
+
const [ShowKrProgress] = useState(window?.BSGlobal?.OkrAdvancedSetting?.KRSetting?.ShowKrProgress);
|
|
41
38
|
const [autoUpdate, setUpdate] = useState(true); // 设置自动更新
|
|
42
39
|
const [updateWay, setUpdateWay] = useState(0); // 自动更新方式 0: 关闭, 1: 根据关见成果, 2: 子目标
|
|
43
40
|
const [settingFolded, setSettingFold] = useState(false);
|
|
@@ -46,11 +43,11 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
|
|
|
46
43
|
const getRecommendProgress = async () => {
|
|
47
44
|
const getRecommandHandler = isKr ? getKrRecommandProgress : getORecommandProgress;
|
|
48
45
|
const data = await getRecommandHandler(isKr ? okrInfo.mileStoneId : okrInfo.workId);
|
|
49
|
-
if (data.Code
|
|
46
|
+
if (data.Code === 1) {
|
|
50
47
|
const { UpdateProgressWay, Progress } = data.Data;
|
|
51
48
|
setRecommandProgressObj(data.Data);
|
|
52
|
-
setUpdate(UpdateProgressWay
|
|
53
|
-
setUpdateWay(UpdateProgressWay
|
|
49
|
+
setUpdate(UpdateProgressWay !== 0);
|
|
50
|
+
setUpdateWay(UpdateProgressWay === 0 ? 1 : UpdateProgressWay);
|
|
54
51
|
setProgress(Progress);
|
|
55
52
|
}
|
|
56
53
|
};
|
|
@@ -66,9 +63,12 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
|
|
|
66
63
|
useEffect(() => {
|
|
67
64
|
if (!autoUpdate) return;
|
|
68
65
|
const { childOkrProgress, childkrProgress, childEProgress } = recommandProgressObj;
|
|
69
|
-
updateWay
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
if (updateWay === 1) {
|
|
67
|
+
setProgress(isKr ? transProgress(childEProgress) : transProgress(childkrProgress));
|
|
68
|
+
}
|
|
69
|
+
if (updateWay === 2) {
|
|
70
|
+
setProgress(transProgress(childOkrProgress));
|
|
71
|
+
}
|
|
72
72
|
}, [updateWay, autoUpdate, recommandProgressObj]);
|
|
73
73
|
|
|
74
74
|
let descriptionText = (
|
|
@@ -131,6 +131,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
|
|
|
131
131
|
title={title}
|
|
132
132
|
visible={visible}
|
|
133
133
|
width={600}
|
|
134
|
+
zIndex={2400}
|
|
134
135
|
>
|
|
135
136
|
<List>
|
|
136
137
|
<Item>
|
|
@@ -165,7 +166,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
|
|
|
165
166
|
<Icon
|
|
166
167
|
color={option.color}
|
|
167
168
|
className={
|
|
168
|
-
selected
|
|
169
|
+
selected === option.id ? "tu-icon-singlebox-avtive" : "tu-icon-singlebox-have"
|
|
169
170
|
}
|
|
170
171
|
/>
|
|
171
172
|
<p>{option.text}</p>
|
|
@@ -195,7 +196,7 @@ const ProgressModal: React.FC<IProgressModalProps> = (props) => {
|
|
|
195
196
|
<span
|
|
196
197
|
className={classNames(
|
|
197
198
|
"auto-update-setting__radio",
|
|
198
|
-
`auto-update-setting__radio${updateWay
|
|
199
|
+
`auto-update-setting__radio${updateWay === option.key ? "--selected" : ""
|
|
199
200
|
}`,
|
|
200
201
|
)}
|
|
201
202
|
/>
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
data: any;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const ShareContent =
|
|
14
|
+
const ShareContent = ({ closeModal, getModalRef, data }: Props) => {
|
|
15
15
|
const [shareImg, setShareImg] = useState<string>();
|
|
16
16
|
const [showPublish, setShowPublish] = useState(false);
|
|
17
17
|
return (
|
|
@@ -43,12 +43,14 @@ const ShareContent = function ({ closeModal, getModalRef, data }: Props) {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
interface ShareProps {
|
|
46
|
-
shareComponent
|
|
47
46
|
data: any;
|
|
48
47
|
visible:boolean;
|
|
48
|
+
zIndex?: number;
|
|
49
49
|
onClose: () => void
|
|
50
50
|
}
|
|
51
|
-
const OkrShare: React.FC<ShareProps> = ({
|
|
51
|
+
const OkrShare: React.FC<ShareProps> = ({
|
|
52
|
+
data, visible, onClose, zIndex,
|
|
53
|
+
}) => {
|
|
52
54
|
const modalRef = useRef<any>();
|
|
53
55
|
|
|
54
56
|
return (
|
|
@@ -60,6 +62,7 @@ const OkrShare: React.FC<ShareProps> = ({ data, visible, onClose }) => {
|
|
|
60
62
|
// maskClosable
|
|
61
63
|
onCancel={() => onClose()}
|
|
62
64
|
ref={modalRef}
|
|
65
|
+
zIndex={zIndex}
|
|
63
66
|
>
|
|
64
67
|
{visible ? (
|
|
65
68
|
<ShareContent
|
|
@@ -71,5 +74,7 @@ const OkrShare: React.FC<ShareProps> = ({ data, visible, onClose }) => {
|
|
|
71
74
|
</Modal>
|
|
72
75
|
);
|
|
73
76
|
};
|
|
74
|
-
|
|
77
|
+
OkrShare.defaultProps = {
|
|
78
|
+
zIndex: 1300,
|
|
79
|
+
};
|
|
75
80
|
export default OkrShare;
|
|
@@ -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 = Number(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 = 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")}`;
|
|
@@ -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
|
}
|