@titaui/pc 1.7.21 → 1.7.25
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/button/text-btn/index.css +1 -0
- package/lib/components/button/text-btn/index.js +10 -12
- package/lib/components/cascader/index.css +38 -11
- package/lib/components/cascader/index.js +10 -5
- package/lib/components/cascader/time.js +31 -0
- package/lib/components/common-share/index.css +223 -0
- package/lib/components/common-share/index.js +104 -0
- package/lib/components/common-share/publishMblog.js +155 -0
- package/lib/components/common-share/request-apis.js +56 -0
- package/lib/components/common-share/types.js +5 -0
- package/lib/components/follower-visitor/index.css +8 -3
- package/lib/components/form/form-fields/group/index.js +2 -1
- package/lib/components/menus/components/menu-tree/tree-node/index.css +9 -6
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +4 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -2
- package/lib/components/scrollbar/index.js +13 -3
- package/lib/components/select-tags/index.css +28 -18
- package/lib/components/select-tags/index.js +2 -2
- package/lib/components/weekly-report/board.js +43 -0
- package/lib/components/weekly-report/card.js +235 -0
- package/lib/components/weekly-report/common-painter/darwAvatar.js +157 -0
- package/lib/components/weekly-report/common-painter/drawName.js +59 -0
- package/lib/components/weekly-report/common-painter/openDataPainter.js +95 -0
- package/lib/components/weekly-report/common-painter/setSize.js +19 -0
- package/lib/components/weekly-report/common-painter/utils.js +85 -0
- package/lib/components/weekly-report/img/body.png +0 -0
- package/lib/components/weekly-report/img/bofang.png +0 -0
- package/lib/components/weekly-report/img/bottom.png +0 -0
- package/lib/components/weekly-report/img/communication.png +0 -0
- package/lib/components/weekly-report/img/down.png +0 -0
- package/lib/components/weekly-report/img/finish.png +0 -0
- package/lib/components/weekly-report/img/laba.png +0 -0
- package/lib/components/weekly-report/img/praise.png +0 -0
- package/lib/components/weekly-report/img/quote.png +0 -0
- package/lib/components/weekly-report/img/title.png +0 -0
- package/lib/components/weekly-report/img/triangle-pop.png +0 -0
- package/lib/components/weekly-report/img/up.png +0 -0
- package/lib/components/weekly-report/index.css +332 -0
- package/lib/components/weekly-report/index.js +134 -0
- package/lib/components/weekly-report/statistics.js +47 -0
- package/lib/index.js +8 -0
- package/lib/pages/aha2021/index.css +0 -1
- package/lib/pages/new-okr-list/header/filter.js +51 -2
- package/lib/pages/new-okr-list/index.js +44 -5
- package/lib/utils/helpers.js +8 -1
- package/package.json +1 -1
- package/src/components/button/text-btn/index.scss +1 -0
- package/src/components/button/text-btn/index.tsx +13 -13
- package/src/components/button/types.ts +1 -0
- package/src/components/cascader/index.scss +50 -27
- package/src/components/cascader/index.tsx +18 -16
- package/src/components/cascader/time.js +13 -0
- package/src/components/common-share/index.scss +199 -0
- package/src/components/common-share/index.tsx +91 -0
- package/src/components/common-share/publishMblog.tsx +79 -0
- package/src/components/common-share/request-apis.js +37 -0
- package/src/components/common-share/types.ts +4 -0
- package/src/components/follower-visitor/index.scss +9 -4
- package/src/components/form/form-fields/group/index.tsx +3 -3
- package/src/components/menus/components/menu-tree/tree-node/index.scss +2 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -2
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -2
- package/src/components/okr-share/index.tsx +4 -17
- package/src/components/scrollbar/index.tsx +2 -1
- package/src/components/select-tags/index.scss +9 -1
- package/src/components/select-tags/index.tsx +8 -12
- package/src/components/weekly-report/board.tsx +25 -0
- package/src/components/weekly-report/card.tsx +125 -0
- package/src/components/weekly-report/common-painter/darwAvatar.ts +81 -0
- package/src/components/weekly-report/common-painter/drawName.ts +19 -0
- package/src/components/weekly-report/common-painter/openDataPainter.ts +47 -0
- package/src/components/weekly-report/common-painter/setSize.ts +12 -0
- package/src/components/weekly-report/common-painter/utils.ts +83 -0
- package/src/components/weekly-report/img/body.png +0 -0
- package/src/components/weekly-report/img/bofang.png +0 -0
- package/src/components/weekly-report/img/bottom.png +0 -0
- package/src/components/weekly-report/img/communication.png +0 -0
- package/src/components/weekly-report/img/down.png +0 -0
- package/src/components/weekly-report/img/finish.png +0 -0
- package/src/components/weekly-report/img/laba.png +0 -0
- package/src/components/weekly-report/img/praise.png +0 -0
- package/src/components/weekly-report/img/quote.png +0 -0
- package/src/components/weekly-report/img/title.png +0 -0
- package/src/components/weekly-report/img/triangle-pop.png +0 -0
- package/src/components/weekly-report/img/up.png +0 -0
- package/src/components/weekly-report/index.scss +299 -0
- package/src/components/weekly-report/index.tsx +51 -0
- package/src/components/weekly-report/statistics.tsx +28 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -1
- package/src/pages/aha2021/index.scss +0 -1
- package/src/pages/new-okr-list/header/filter.tsx +35 -4
- package/src/pages/new-okr-list/index.tsx +33 -5
- package/src/utils/helpers.ts +4 -1
package/lib/utils/helpers.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.cssSupport = cssSupport;
|
|
7
7
|
exports.escapeHtml = escapeHtml;
|
|
8
|
+
exports.getLoginUserInfo = void 0;
|
|
8
9
|
exports.getTenantInfo = getTenantInfo;
|
|
9
10
|
exports.getUploadMaxSize = getUploadMaxSize;
|
|
10
11
|
exports.isLocal = exports.isDingDing = void 0;
|
|
@@ -58,4 +59,10 @@ function escapeHtml(str) {
|
|
|
58
59
|
return str.replace(/(&|<|>|"|')/g, function (str) {
|
|
59
60
|
return htmlEscapes[str];
|
|
60
61
|
});
|
|
61
|
-
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var getLoginUserInfo = function getLoginUserInfo() {
|
|
65
|
+
return (0, _bsGlobal.getBSGlobal)('loginUserInfo');
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports.getLoginUserInfo = getLoginUserInfo;
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import classNames from
|
|
3
|
-
import { TextBtnProps } from
|
|
4
|
-
import
|
|
5
|
-
const precls =
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { TextBtnProps } from "../types";
|
|
4
|
+
import "./index.scss";
|
|
5
|
+
const precls = "titaui-text-btn";
|
|
6
6
|
|
|
7
7
|
const TextBtn = (props: TextBtnProps) => {
|
|
8
8
|
const {
|
|
9
|
-
type =
|
|
10
|
-
icon =
|
|
11
|
-
|
|
12
|
-
text = '确定',
|
|
9
|
+
type = "default",
|
|
10
|
+
icon = "",
|
|
11
|
+
text = "确定",
|
|
13
12
|
onClick = () => {},
|
|
14
|
-
className =
|
|
13
|
+
className = "",
|
|
15
14
|
disabled = false,
|
|
15
|
+
style ={},
|
|
16
16
|
} = props;
|
|
17
17
|
|
|
18
18
|
const renderIcon = () => {
|
|
19
|
-
if (typeof icon ==
|
|
19
|
+
if (typeof icon == "string") {
|
|
20
20
|
return (
|
|
21
21
|
<span className={`${precls}__icon`}>
|
|
22
22
|
<span className={icon} />
|
|
@@ -37,10 +37,10 @@ const TextBtn = (props: TextBtnProps) => {
|
|
|
37
37
|
precls,
|
|
38
38
|
`${precls}--${type}`,
|
|
39
39
|
{ [`${precls}--disabled`]: disabled },
|
|
40
|
-
className
|
|
40
|
+
className
|
|
41
41
|
)}
|
|
42
42
|
onClick={onClickHandler}
|
|
43
|
-
style={
|
|
43
|
+
style={style}
|
|
44
44
|
>
|
|
45
45
|
{icon && renderIcon()}
|
|
46
46
|
{text}
|
|
@@ -13,37 +13,60 @@
|
|
|
13
13
|
font-size: 14px;
|
|
14
14
|
color: #3F4755;
|
|
15
15
|
}
|
|
16
|
+
&-popup{
|
|
17
|
+
z-index: 2000;
|
|
18
|
+
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
19
|
+
border: 1px solid #F0F2F5;
|
|
20
|
+
border-radius: 12px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
.rc-cascader-menu{
|
|
23
|
+
width: 139px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
border: 1px solid #F0F2F5;
|
|
26
|
+
padding: 16px 0 16px 6px;
|
|
27
|
+
&::-webkit-scrollbar{
|
|
28
|
+
width: 6px !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
.rc-cascader-menu-item-active{
|
|
33
|
+
background: unset;
|
|
34
|
+
color: #2879ff;
|
|
35
|
+
}
|
|
36
|
+
.rc-cascader-menu-item{
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
padding: 0 6px;
|
|
40
|
+
height: 36px;
|
|
41
|
+
align-items: center;
|
|
42
|
+
color: #3F4755;
|
|
43
|
+
&:hover{
|
|
44
|
+
color: #2879ff;
|
|
45
|
+
background: #F7F8FA;
|
|
46
|
+
border-radius: 8px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.rc-cascader-menu-item-disabled{
|
|
50
|
+
opacity:1;
|
|
51
|
+
cursor: auto;
|
|
52
|
+
&:hover{
|
|
53
|
+
color: #3F4755;
|
|
54
|
+
background: #FFFFFF;
|
|
55
|
+
border-radius: 8px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.rc-cascader-menu-item-expand-icon{
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
16
62
|
.tu-icon-caret-down{
|
|
17
63
|
font-size: 16px;
|
|
18
64
|
transform: scale(0.5);
|
|
19
65
|
}
|
|
20
66
|
}
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
.rc-cascader-menu{
|
|
28
|
-
width: 139px;
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
border: 1px solid #F0F2F5;
|
|
31
|
-
padding: 16px 6px;
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
.rc-cascader-menu-item-active{
|
|
35
|
-
background: unset;
|
|
36
|
-
color: #2879ff;
|
|
37
|
-
}
|
|
38
|
-
.rc-cascader-menu-item{
|
|
39
|
-
box-sizing: border-box;
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
padding: 0 6px;
|
|
42
|
-
height: 36px;
|
|
43
|
-
align-items: center;
|
|
44
|
-
&:hover{
|
|
45
|
-
color: #2879ff;
|
|
46
|
-
background: #F7F8FA;
|
|
47
|
-
border-radius: 8px;
|
|
67
|
+
.titaui-cascader-time-popup{
|
|
68
|
+
.rc-cascader-menu{
|
|
69
|
+
width: 80px;
|
|
70
|
+
text-align: center;
|
|
48
71
|
}
|
|
49
72
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { useState, useEffect
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import Rccascader from "rc-cascader";
|
|
3
|
+
import TimeCascader from "./time";
|
|
3
4
|
import "rc-cascader/assets/index.less";
|
|
4
5
|
import "./index.scss";
|
|
5
6
|
|
|
@@ -10,6 +11,7 @@ interface Props {
|
|
|
10
11
|
placeholder?: any;
|
|
11
12
|
initText?: any; //想要默认值输入框的值就传进来,不要问组件里为什么不做这个事情,优化算法
|
|
12
13
|
style?: any;
|
|
14
|
+
popupClassName?: any;
|
|
13
15
|
splitSymbol?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -23,13 +25,13 @@ const Cascader = ({
|
|
|
23
25
|
style = { width: "100px" },
|
|
24
26
|
placeholder = "请选择",
|
|
25
27
|
splitSymbol = "",
|
|
28
|
+
popupClassName = "",
|
|
26
29
|
...restProps
|
|
27
30
|
}: Props) => {
|
|
28
31
|
const [selectValue, setSelectValue] = useState(value);
|
|
29
32
|
const [inputValue, setInputValue] = useState(initText);
|
|
30
33
|
|
|
31
34
|
const handleChange = (value, selectedOptions) => {
|
|
32
|
-
console.log(value, selectedOptions);
|
|
33
35
|
onChange && onChange(value, selectedOptions);
|
|
34
36
|
setSelectValue(value);
|
|
35
37
|
let str = selectedOptions.map((o) => o.label).join(splitSymbol);
|
|
@@ -41,22 +43,22 @@ const Cascader = ({
|
|
|
41
43
|
}, [value]);
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>
|
|
55
|
-
<span className="tu-icon-caret-down" />
|
|
46
|
+
<Rccascader
|
|
47
|
+
options={options}
|
|
48
|
+
onChange={handleChange}
|
|
49
|
+
value={selectValue}
|
|
50
|
+
popupClassName={`${preCls}-popup ${popupClassName}`}
|
|
51
|
+
{...restProps}
|
|
52
|
+
>
|
|
53
|
+
<div className={preCls} style={style}>
|
|
54
|
+
<div className={`${preCls}-text`}>
|
|
55
|
+
{inputValue ? inputValue : placeholder}
|
|
56
56
|
</div>
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
<span className="tu-icon-caret-down" />
|
|
58
|
+
</div>
|
|
59
|
+
</Rccascader>
|
|
59
60
|
);
|
|
60
61
|
};
|
|
61
62
|
|
|
63
|
+
Cascader.TimeCascader = TimeCascader;
|
|
62
64
|
export default Cascader;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC,Fragment } from "react";
|
|
2
|
+
import Cascader from './index'
|
|
3
|
+
|
|
4
|
+
const TimeCascader = ({...restProps})=>{
|
|
5
|
+
return <Fragment>
|
|
6
|
+
<Cascader
|
|
7
|
+
popupClassName={' titaui-cascader-time-popup'}
|
|
8
|
+
{...restProps}
|
|
9
|
+
/>
|
|
10
|
+
</Fragment>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default TimeCascader
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
.okr-share-card {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 340px;
|
|
4
|
+
height: 434px;
|
|
5
|
+
border-radius: 24px;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
&-user__name {
|
|
12
|
+
margin-top: 4px;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
color: #141c28;
|
|
16
|
+
line-height: 22px;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
> span {
|
|
20
|
+
max-width: 170px;
|
|
21
|
+
margin-right: 5px;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
word-break: break-all;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
&::after {
|
|
29
|
+
content: "";
|
|
30
|
+
position: absolute;
|
|
31
|
+
height: 70px;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
left: 0px;
|
|
34
|
+
right: 0px;
|
|
35
|
+
border-bottom-left-radius: 24px;
|
|
36
|
+
border-bottom-right-radius: 24px;
|
|
37
|
+
}
|
|
38
|
+
&-user__dept {
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
color: #3f4755;
|
|
42
|
+
line-height: 18px;
|
|
43
|
+
max-width: 200px;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
word-break: break-all;
|
|
48
|
+
}
|
|
49
|
+
.card-okr__content {
|
|
50
|
+
flex: 1;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
padding-bottom: 50px;
|
|
55
|
+
}
|
|
56
|
+
.card-okr__name {
|
|
57
|
+
position: relative;
|
|
58
|
+
width: 250px;
|
|
59
|
+
font-size: 18px;
|
|
60
|
+
font-weight: bold;
|
|
61
|
+
color: #141c28;
|
|
62
|
+
line-height: 24px;
|
|
63
|
+
margin-top: 24px;
|
|
64
|
+
margin-bottom: 28px;
|
|
65
|
+
text-align: center;
|
|
66
|
+
&::before,
|
|
67
|
+
&::after {
|
|
68
|
+
content: "";
|
|
69
|
+
display: block;
|
|
70
|
+
position: absolute;
|
|
71
|
+
width: 16px;
|
|
72
|
+
height: 16px;
|
|
73
|
+
background-size: 100% 100%;
|
|
74
|
+
background-repeat: no-repeat;
|
|
75
|
+
}
|
|
76
|
+
&::before {
|
|
77
|
+
top: -16px;
|
|
78
|
+
left: -16px;
|
|
79
|
+
}
|
|
80
|
+
&::after {
|
|
81
|
+
bottom: -16px;
|
|
82
|
+
right: -16px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.card-kr__wrapper {
|
|
86
|
+
width: 100%;
|
|
87
|
+
max-height: 240px;
|
|
88
|
+
position: relative;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
align-items: center;
|
|
93
|
+
}
|
|
94
|
+
.card-kr__item {
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
color: #3f4755;
|
|
98
|
+
line-height: 22px;
|
|
99
|
+
margin-bottom: 6px;
|
|
100
|
+
position: relative;
|
|
101
|
+
width: 250px;
|
|
102
|
+
text-align: left;
|
|
103
|
+
&::before {
|
|
104
|
+
content: "";
|
|
105
|
+
position: absolute;
|
|
106
|
+
width: 6px;
|
|
107
|
+
height: 6px;
|
|
108
|
+
border-radius: 50%;
|
|
109
|
+
top: 8px;
|
|
110
|
+
left: -14px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
.okr-share-card__selector {
|
|
115
|
+
position: relative;
|
|
116
|
+
.tu-icon-close {
|
|
117
|
+
position: absolute;
|
|
118
|
+
top: -8.25px;
|
|
119
|
+
right: -20px;
|
|
120
|
+
font-size: 16.5px;
|
|
121
|
+
color: #fff;
|
|
122
|
+
}
|
|
123
|
+
.share-card-button__wrapper {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
}
|
|
128
|
+
.share-card-button {
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
width: 120px;
|
|
131
|
+
height: 36px;
|
|
132
|
+
border-radius: 18px;
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
margin: 20px 6px 0;
|
|
137
|
+
font-size: 14px;
|
|
138
|
+
color: #ffffff;
|
|
139
|
+
transition: all 0.2s ease;
|
|
140
|
+
&.download {
|
|
141
|
+
border: 1px solid #ffffff;
|
|
142
|
+
&:hover {
|
|
143
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
&.share {
|
|
147
|
+
background: rgba($color: #5c8eff, $alpha: 0);
|
|
148
|
+
position: relative;
|
|
149
|
+
&::after {
|
|
150
|
+
content: "";
|
|
151
|
+
position: absolute;
|
|
152
|
+
z-index: -1;
|
|
153
|
+
background: linear-gradient(180deg, #88bcff 0%, #2879ff 100%);
|
|
154
|
+
border-radius: 18px;
|
|
155
|
+
top: 0;
|
|
156
|
+
right: 0;
|
|
157
|
+
bottom: 0;
|
|
158
|
+
left: 0;
|
|
159
|
+
}
|
|
160
|
+
&:hover {
|
|
161
|
+
background: rgba($color: #5c8eff, $alpha: 1);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.okr-share-mblog {
|
|
167
|
+
&__container {
|
|
168
|
+
width: 480px;
|
|
169
|
+
height: 420px;
|
|
170
|
+
background-color: #fff;
|
|
171
|
+
border-radius: 6px;
|
|
172
|
+
}
|
|
173
|
+
&__header {
|
|
174
|
+
height: 58px;
|
|
175
|
+
padding: 0 32px;
|
|
176
|
+
display: flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
font-size: 18px;
|
|
179
|
+
font-weight: bold;
|
|
180
|
+
color: #141c28;
|
|
181
|
+
line-height: 26px;
|
|
182
|
+
border-bottom: 1px solid #e9ecf0;
|
|
183
|
+
justify-content: space-between;
|
|
184
|
+
.tu-icon-close {
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
&__body {
|
|
189
|
+
padding: 16px 32px 20px;
|
|
190
|
+
}
|
|
191
|
+
&__attachment {
|
|
192
|
+
width: 118px;
|
|
193
|
+
height: 160px;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
> img {
|
|
196
|
+
width: 100%;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React, { useRef, useState,useEffect } from 'react';
|
|
2
|
+
import { Modal } from 'tita-ui';
|
|
3
|
+
import PublishMblog from './publishMblog';
|
|
4
|
+
import Queue from 'rc-queue-anim';
|
|
5
|
+
import './index.scss';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
closeModal: Function;
|
|
9
|
+
getModalRef: Function;
|
|
10
|
+
uid: string;
|
|
11
|
+
shareComponent: any;
|
|
12
|
+
shareImage?:string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ShareContent = function({ closeModal, getModalRef, uid,shareComponent,shareImage }: Props) {
|
|
16
|
+
const [showPublish, setShowPublish] = useState(false);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if(shareImage){
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
setShowPublish(true)
|
|
21
|
+
}, 200);
|
|
22
|
+
}
|
|
23
|
+
}, [shareImage])
|
|
24
|
+
return (
|
|
25
|
+
<Queue type='bottom'>
|
|
26
|
+
{!shareImage && (
|
|
27
|
+
shareComponent
|
|
28
|
+
)}
|
|
29
|
+
{showPublish && shareImage && (
|
|
30
|
+
<PublishMblog
|
|
31
|
+
base64={shareImage}
|
|
32
|
+
getModalRef={getModalRef}
|
|
33
|
+
closeModal={closeModal}
|
|
34
|
+
key='publish'
|
|
35
|
+
uid={uid}
|
|
36
|
+
/>
|
|
37
|
+
)}
|
|
38
|
+
</Queue>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export interface ShareData {
|
|
42
|
+
okrName: string;
|
|
43
|
+
okrId: number;
|
|
44
|
+
krs: string[];
|
|
45
|
+
user: {
|
|
46
|
+
name: string;
|
|
47
|
+
userId: number;
|
|
48
|
+
departmentName: string;
|
|
49
|
+
departmentId: number;
|
|
50
|
+
avatar: {
|
|
51
|
+
color: string;
|
|
52
|
+
src?: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface ShareProps {
|
|
57
|
+
uid: any;
|
|
58
|
+
visible:boolean;
|
|
59
|
+
onClose: () => void
|
|
60
|
+
shareComponent: (share:(img:string) => void) => any
|
|
61
|
+
}
|
|
62
|
+
const OkrShare: React.FC<ShareProps> = ({ uid,visible,onClose,shareComponent }) => {
|
|
63
|
+
const [shareImage,setShareImage] = useState<string>()
|
|
64
|
+
const modalRef = useRef<any>();
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
<Modal
|
|
69
|
+
visible={visible}
|
|
70
|
+
className="document-mouse-event-ignore"
|
|
71
|
+
destroyOnClose
|
|
72
|
+
customContent
|
|
73
|
+
// maskClosable
|
|
74
|
+
onCancel={() => onClose()}
|
|
75
|
+
ref={modalRef}
|
|
76
|
+
>
|
|
77
|
+
{visible ? (
|
|
78
|
+
<ShareContent
|
|
79
|
+
closeModal={() => onClose()}
|
|
80
|
+
getModalRef={() => modalRef.current.getRef()}
|
|
81
|
+
uid={uid}
|
|
82
|
+
shareImage={shareImage}
|
|
83
|
+
shareComponent={shareComponent(setShareImage)}
|
|
84
|
+
/>
|
|
85
|
+
) : null}
|
|
86
|
+
</Modal>
|
|
87
|
+
</>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default OkrShare;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { ReactElement, useEffect, useState } from "react";
|
|
2
|
+
import MBlog from "../mblog";
|
|
3
|
+
import MBlogContext from "../mblog/context";
|
|
4
|
+
import { findDOMNode } from "react-dom";
|
|
5
|
+
import { addShare, uploadBase64 } from "./request-apis";
|
|
6
|
+
import Toast from "../toast";
|
|
7
|
+
import { getBSGlobal } from "../../utils/bs-global";
|
|
8
|
+
|
|
9
|
+
const loginUserId = getBSGlobal("loginUserInfo").Id;
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
base64: string;
|
|
13
|
+
getModalRef: Function;
|
|
14
|
+
closeModal: Function;
|
|
15
|
+
uid: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function PublishMblog({
|
|
19
|
+
base64,
|
|
20
|
+
getModalRef,
|
|
21
|
+
closeModal,
|
|
22
|
+
uid,
|
|
23
|
+
}: Props): ReactElement {
|
|
24
|
+
const [file, setFile] = useState({ url: "", pending: true });
|
|
25
|
+
const [status, setStatus] = useState(0);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
uploadBase64(base64.split(",")[1]).then((res) => {
|
|
28
|
+
setFile({
|
|
29
|
+
url: res.Data.obj,
|
|
30
|
+
pending: false,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}, []);
|
|
34
|
+
return (
|
|
35
|
+
<div className="okr-share-mblog__container">
|
|
36
|
+
<div className="okr-share-mblog__header">
|
|
37
|
+
发布动态
|
|
38
|
+
<i className="tu-icon-close" onClick={() => closeModal()} />
|
|
39
|
+
</div>
|
|
40
|
+
<div className="okr-share-mblog__body">
|
|
41
|
+
<MBlogContext.Provider
|
|
42
|
+
value={{ popContainer: findDOMNode(getModalRef()) }}
|
|
43
|
+
>
|
|
44
|
+
<MBlog
|
|
45
|
+
autoResizing={false}
|
|
46
|
+
defaultContent="秀一秀我的 OKR"
|
|
47
|
+
submitStatus={status}
|
|
48
|
+
commentsTypeKey={"share-okr" + loginUserId + uid}
|
|
49
|
+
autoFocus
|
|
50
|
+
onMblogSubmit={async (type, data) => {
|
|
51
|
+
if (file.pending) {
|
|
52
|
+
return Toast.Error("图片正在上传...");
|
|
53
|
+
}
|
|
54
|
+
setStatus(2);
|
|
55
|
+
await addShare({
|
|
56
|
+
...data,
|
|
57
|
+
FileUrls: file.url,
|
|
58
|
+
Visibility: 1,
|
|
59
|
+
isSendSMS: false,
|
|
60
|
+
});
|
|
61
|
+
Toast.Success("分享成功");
|
|
62
|
+
setStatus(1);
|
|
63
|
+
closeModal();
|
|
64
|
+
}}
|
|
65
|
+
isShowAttachment={false}
|
|
66
|
+
isShowSendSms={false}
|
|
67
|
+
isShowBtnCancel={false}
|
|
68
|
+
isShowRange={false}
|
|
69
|
+
/>
|
|
70
|
+
</MBlogContext.Provider>
|
|
71
|
+
<div className="okr-share-mblog__attachment">
|
|
72
|
+
<img src={base64} alt="" />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default PublishMblog;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
3
|
+
const tenantId = BSGlobal && BSGlobal.tenantInfo.Id || 0;
|
|
4
|
+
const userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
|
|
5
|
+
|
|
6
|
+
const requestDomain = () => {
|
|
7
|
+
if (!window.location.hostname.match(/dev/)) return '';
|
|
8
|
+
return 'http://www.tita.gift'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const getImageBase64ByUrl = toUserId => {
|
|
12
|
+
return axios.post(`${requestDomain()}/api/v1/${tenantId}/${userId}/okr/share/getBase64Str`, { toUserId })
|
|
13
|
+
.then(getBase64Str => {
|
|
14
|
+
return getBase64Str.data;
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const getBase64DownloadUrl = base64 => {
|
|
19
|
+
return axios.post(`${requestDomain()}/api/v1/${tenantId}/${userId}/okr/share/imageDownLoadDfs`, { 'SharePicLink': base64 })
|
|
20
|
+
.then(dfs => {
|
|
21
|
+
return dfs.data;
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const uploadBase64 = base64 => {
|
|
26
|
+
return axios.post(`${requestDomain()}/api/v1/${tenantId}/${userId}/okr/share/imagedfs`, { 'SharePicLink': base64 })
|
|
27
|
+
.then(dfs => {
|
|
28
|
+
return dfs.data;
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const addShare = data => {
|
|
33
|
+
return axios.post(`${requestDomain()}/api/v2/${tenantId}/${userId}/user/feed/AddShare`, data)
|
|
34
|
+
.then(dfs => {
|
|
35
|
+
return dfs.data;
|
|
36
|
+
})
|
|
37
|
+
}
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
+
position: relative;
|
|
6
|
+
top: -17px;
|
|
7
|
+
width: 634px;
|
|
5
8
|
height: 36px;
|
|
6
|
-
|
|
9
|
+
margin: 0 auto;
|
|
7
10
|
font-size: 14px;
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
background: #FFF4D6;
|
|
12
|
+
box-shadow: 0px 4px 16px 0px rgba(127, 145, 180, 0.2);
|
|
13
|
+
border-radius: 18px;
|
|
10
14
|
font-weight: 400;
|
|
11
|
-
color: #
|
|
15
|
+
color: #704600;
|
|
16
|
+
// color: #2879ff;
|
|
12
17
|
line-height: 22px;
|
|
13
18
|
position: relative;
|
|
14
19
|
transition: all 0.3s linear;
|