@yeeyoon/library 3.7.3 → 3.7.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -51,9 +51,11 @@ export function getProfileRedirectUrl(path) {
|
|
51
51
|
case 'localhost:8003':
|
52
52
|
case 'localhost:8009':
|
53
53
|
case 'localhost:8010':
|
54
|
+
case 'localhost:8011':
|
54
55
|
case 'testing-collab.yeeyoon.com':
|
55
56
|
case 'testing-profile.yeeyoon.com':
|
56
57
|
case 'testing-bpm.yeeyoon.com':
|
58
|
+
case 'testing-wms.yeeyoon.com':
|
57
59
|
return `https://testing-profile.yeeyoon.com/${path}`;
|
58
60
|
case 'demo-profile.yeeyoon.com':
|
59
61
|
return `https://demo-profile.yeeyoon.com/${path}`;
|
@@ -4,7 +4,7 @@ import styles from './index.less';
|
|
4
4
|
import { LineChart, Line, Tooltip, XAxis } from 'recharts';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
7
|
-
import { queryOidcUserCardData } from './service';
|
7
|
+
import { queryOidcUserCardData, fetchUserInfo } from './service';
|
8
8
|
|
9
9
|
const defaultHeadUrl =
|
10
10
|
'https://pro-yeeyoon-fm.oss-cn-zhangjiakou.aliyuncs.com/oidc/user_avatar3.png';
|
@@ -13,6 +13,7 @@ function InfoCart(props) {
|
|
13
13
|
const reg = /^(\d{3})\d*(\d{4})$/;
|
14
14
|
const [cardData, setCardData] = useState({});
|
15
15
|
const [chartData, setChartData] = useState([]);
|
16
|
+
const [tenantList, setTenantList] = useState([]);
|
16
17
|
const [projectData] = useState([
|
17
18
|
{
|
18
19
|
title: '贡献数据',
|
@@ -50,6 +51,7 @@ function InfoCart(props) {
|
|
50
51
|
};
|
51
52
|
useEffect(() => {
|
52
53
|
getCardData();
|
54
|
+
getUserInfo();
|
53
55
|
}, [baseMsg.userId, baseMsg.id]);
|
54
56
|
const getCardData = async () => {
|
55
57
|
const resp = await queryOidcUserCardData({
|
@@ -71,6 +73,21 @@ function InfoCart(props) {
|
|
71
73
|
}
|
72
74
|
}
|
73
75
|
};
|
76
|
+
const getUserInfo = async () => {
|
77
|
+
const resp = await fetchUserInfo({
|
78
|
+
id: baseMsg.userId || baseMsg?.id,
|
79
|
+
});
|
80
|
+
const { success, data } = resp;
|
81
|
+
if (success) {
|
82
|
+
if (data.tenants.length > 0) {
|
83
|
+
setTenantList(
|
84
|
+
data.tenants.map((item) => {
|
85
|
+
return item.name;
|
86
|
+
})
|
87
|
+
);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
};
|
74
91
|
return (
|
75
92
|
<div className={styles['info-cart-content']} {...rest}>
|
76
93
|
<div className={styles['info-cart-base']}>
|
@@ -88,46 +105,53 @@ function InfoCart(props) {
|
|
88
105
|
</span>
|
89
106
|
</div>
|
90
107
|
</div>
|
91
|
-
<div className={styles['info-cart-
|
92
|
-
<
|
93
|
-
|
94
|
-
{
|
95
|
-
projectData
|
96
|
-
|
97
|
-
<
|
98
|
-
{item
|
99
|
-
|
100
|
-
|
101
|
-
<
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
{
|
109
|
-
|
110
|
-
|
111
|
-
{
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
108
|
+
<div className={styles['info-cart-bottom']}>
|
109
|
+
<div className={styles['info-cart-project']}>
|
110
|
+
<p>{cardData.application_name}</p>
|
111
|
+
<div className={styles['info-cart-data']}>
|
112
|
+
{projectData &&
|
113
|
+
projectData.map((item, index) => (
|
114
|
+
<div className={styles['info-cart-data-item']} key={index}>
|
115
|
+
<span className={styles['info-cart-data-item-title']}>
|
116
|
+
{item.title}
|
117
|
+
{item.tips && (
|
118
|
+
<AntdTooltip title={item.tips}>
|
119
|
+
<QuestionCircleOutlined
|
120
|
+
style={{ fontSize: '14px', marginLeft: '4px' }}
|
121
|
+
/>
|
122
|
+
</AntdTooltip>
|
123
|
+
)}
|
124
|
+
</span>
|
125
|
+
<b style={{ color: '#5e5873', fontSize: '16px' }}>
|
126
|
+
{cardData[item.number] || 0}
|
127
|
+
</b>
|
128
|
+
<span style={{ color: '#6E6B7B', fontSize: '12px' }}>
|
129
|
+
{item.updateTitle}
|
130
|
+
{cardData[item.updateNumber] || 0}
|
131
|
+
</span>
|
132
|
+
</div>
|
133
|
+
))}
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
<div className={styles['info-cart-form']}>
|
137
|
+
<p>贡献数据(最近30天)</p>
|
138
|
+
<LineChart width={288} height={70} data={chartData}>
|
139
|
+
<Line
|
140
|
+
type="monotone"
|
141
|
+
dataKey="贡献数据数"
|
142
|
+
stroke="#7367F0"
|
143
|
+
strokeWidth="2"
|
144
|
+
dot={false}
|
145
|
+
/>
|
146
|
+
<Tooltip cursor={false} />
|
147
|
+
<XAxis dataKey="name" style={{ display: 'none' }} />
|
148
|
+
</LineChart>
|
149
|
+
</div>
|
150
|
+
<div className={styles['info-cart-company']}>
|
151
|
+
<h4>所属公司</h4>
|
152
|
+
{tenantList.length > 0 &&
|
153
|
+
tenantList.map((item, index) => <p key={index}>{item}</p>)}
|
116
154
|
</div>
|
117
|
-
</div>
|
118
|
-
<div className={styles['info-cart-form']}>
|
119
|
-
<p>贡献数据(最近30天)</p>
|
120
|
-
<LineChart width={288} height={70} data={chartData}>
|
121
|
-
<Line
|
122
|
-
type="monotone"
|
123
|
-
dataKey="贡献数据数"
|
124
|
-
stroke="#7367F0"
|
125
|
-
strokeWidth="2"
|
126
|
-
dot={false}
|
127
|
-
/>
|
128
|
-
<Tooltip cursor={false} />
|
129
|
-
<XAxis dataKey="name" style={{ display: 'none' }} />
|
130
|
-
</LineChart>
|
131
155
|
</div>
|
132
156
|
</div>
|
133
157
|
);
|
@@ -4,8 +4,7 @@
|
|
4
4
|
.info-cart-base {
|
5
5
|
display: flex;
|
6
6
|
width: 320px;
|
7
|
-
padding
|
8
|
-
border-bottom: 1px solid #eeeeee;
|
7
|
+
padding: 5px 0 23px 0;
|
9
8
|
.info-cart-np {
|
10
9
|
display: flex;
|
11
10
|
flex-direction: column;
|
@@ -16,44 +15,60 @@
|
|
16
15
|
}
|
17
16
|
}
|
18
17
|
}
|
19
|
-
.info-cart-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
18
|
+
.info-cart-bottom {
|
19
|
+
background-color: #f4f4f4;
|
20
|
+
height: 400px;
|
21
|
+
overflow-x: scroll;
|
22
|
+
padding: 0 20px;
|
23
|
+
margin: 0 -20px -20px -20px;
|
24
|
+
.info-cart-project {
|
25
|
+
margin-top: 20px;
|
26
|
+
p {
|
27
|
+
margin-bottom: 24px;
|
28
|
+
color: #5e5873;
|
29
|
+
font-size: 16px;
|
30
|
+
}
|
31
|
+
.info-cart-data {
|
29
32
|
display: flex;
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
&-item {
|
34
|
+
display: flex;
|
35
|
+
flex-direction: column;
|
36
|
+
align-items: center;
|
37
|
+
justify-content: center;
|
38
|
+
width: 96px;
|
39
|
+
margin-right: 16px;
|
40
|
+
&-title {
|
41
|
+
color: #5e5873;
|
42
|
+
}
|
43
|
+
b {
|
44
|
+
margin: 14px 0 6px 0;
|
45
|
+
}
|
37
46
|
}
|
38
|
-
|
39
|
-
margin:
|
47
|
+
:last-child {
|
48
|
+
margin-right: 0;
|
40
49
|
}
|
41
50
|
}
|
42
|
-
|
43
|
-
|
51
|
+
}
|
52
|
+
.info-cart-form {
|
53
|
+
width: 320px;
|
54
|
+
height: 126px;
|
55
|
+
margin-top: 24px;
|
56
|
+
border-radius: 4px;
|
57
|
+
p {
|
58
|
+
margin-bottom: 16px;
|
59
|
+
color: #6e6b7b;
|
44
60
|
}
|
45
61
|
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
margin-bottom: 16px;
|
56
|
-
color: #6e6b7b;
|
62
|
+
.info-cart-company {
|
63
|
+
border-top: 1px dashed #BABFC7;
|
64
|
+
color: #5E5873;
|
65
|
+
padding-top: 24px;
|
66
|
+
h4 {
|
67
|
+
margin-bottom: 15px;
|
68
|
+
font-size: 14px;
|
69
|
+
}
|
70
|
+
|
57
71
|
}
|
58
72
|
}
|
73
|
+
|
59
74
|
}
|
@@ -8,3 +8,11 @@ export async function queryOidcUserCardData(params) {
|
|
8
8
|
method: 'post',
|
9
9
|
});
|
10
10
|
}
|
11
|
+
// 获取用户信息
|
12
|
+
export async function fetchUserInfo(params) {
|
13
|
+
return request('/findOidcUser', {
|
14
|
+
prefix: `${API_IAM}/api/oidc/v1/oidcuser`,
|
15
|
+
method: 'post',
|
16
|
+
data: params,
|
17
|
+
});
|
18
|
+
}
|
@@ -10,6 +10,8 @@ const TenantSelector = (props) => {
|
|
10
10
|
tenantId,
|
11
11
|
tenantIdChangeCb,
|
12
12
|
appId,
|
13
|
+
isSharePlatform,
|
14
|
+
shareTenantIdList,
|
13
15
|
// handleException,
|
14
16
|
} = props;
|
15
17
|
const [options, setOptions] = useState([]);
|
@@ -35,6 +37,11 @@ const TenantSelector = (props) => {
|
|
35
37
|
value: item.id,
|
36
38
|
});
|
37
39
|
});
|
40
|
+
if (isSharePlatform) {
|
41
|
+
tenantList = tenantList.filter((item) =>
|
42
|
+
shareTenantIdList.includes(item.value)
|
43
|
+
);
|
44
|
+
}
|
38
45
|
setOptions(tenantList);
|
39
46
|
}
|
40
47
|
};
|
@@ -64,8 +71,9 @@ const TenantSelector = (props) => {
|
|
64
71
|
// }
|
65
72
|
}}
|
66
73
|
onSelect={(value, option) => {
|
67
|
-
|
68
|
-
|
74
|
+
const { label } = option;
|
75
|
+
setValue(label);
|
76
|
+
tenantIdChangeCb && tenantIdChangeCb(value, label, option);
|
69
77
|
}}
|
70
78
|
/>
|
71
79
|
);
|
@@ -76,6 +84,8 @@ TenantSelector.propTypes = {
|
|
76
84
|
appId: PropTypes.string,
|
77
85
|
tenantIdChangeCb: PropTypes.func,
|
78
86
|
handleException: PropTypes.func,
|
87
|
+
shareTenantIdList: PropTypes.array,
|
88
|
+
isSharePlatform: PropTypes.bool,
|
79
89
|
};
|
80
90
|
|
81
91
|
export default TenantSelector;
|