@yeeyoon/library 3.2.9 → 3.3.3
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.
@@ -18,27 +18,37 @@ const AvatarInfo = ({
|
|
18
18
|
style,
|
19
19
|
showInfo = true, // 是否展示信息卡片
|
20
20
|
size = 30,
|
21
|
+
mode,
|
21
22
|
...rest
|
22
23
|
}) => {
|
23
|
-
const CustomAvatar =
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
24
|
+
const CustomAvatar =
|
25
|
+
mode === 'group' ? (
|
26
|
+
<Avatar
|
27
|
+
size={size}
|
28
|
+
shape={shape}
|
29
|
+
className={styles['user-avatar-scale']}
|
30
|
+
src={icon || defaultHeadUrl}
|
31
|
+
style={{ ...defaultUserStyle, ...style }}
|
32
|
+
/>
|
33
|
+
) : (
|
34
|
+
<span>
|
35
|
+
{icon || name || id ? (
|
36
|
+
<Avatar
|
37
|
+
size={size}
|
38
|
+
shape={shape}
|
39
|
+
className={styles['user-avatar-scale']}
|
40
|
+
src={icon || defaultHeadUrl}
|
41
|
+
style={{ ...defaultUserStyle, ...style }}
|
42
|
+
/>
|
43
|
+
) : null}
|
44
|
+
{showName &&
|
45
|
+
(icon || name || id ? (
|
46
|
+
<span className={styles['user-avatar-name']}>{name || '-'}</span>
|
47
|
+
) : (
|
48
|
+
'-'
|
49
|
+
))}
|
50
|
+
</span>
|
51
|
+
);
|
42
52
|
|
43
53
|
return showInfo && id ? (
|
44
54
|
<Popover
|
@@ -76,7 +86,7 @@ const AvatarPackaged = ({ data, maxCount = 5, maxStyle, ...rest }) => {
|
|
76
86
|
}
|
77
87
|
>
|
78
88
|
{data.map((x, i) => (
|
79
|
-
<AvatarInfo key={i} {...rest} {...x} />
|
89
|
+
<AvatarInfo key={i} {...rest} {...x} mode="group" />
|
80
90
|
))}
|
81
91
|
</Avatar.Group>
|
82
92
|
) : data ? (
|
@@ -91,6 +101,7 @@ AvatarInfo.propTypes = {
|
|
91
101
|
showName: PropTypes.bool,
|
92
102
|
placement: PropTypes.string,
|
93
103
|
shape: PropTypes.string,
|
104
|
+
mode: PropTypes.string,
|
94
105
|
size: PropTypes.number,
|
95
106
|
style: PropTypes.object,
|
96
107
|
showInfo: PropTypes.bool,
|
@@ -6,6 +6,8 @@ import PropTypes from 'prop-types';
|
|
6
6
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
7
7
|
import { queryOidcUserCardData } from './service';
|
8
8
|
|
9
|
+
const defaultHeadUrl =
|
10
|
+
'https://pro-yeeyoon-fm.oss-cn-zhangjiakou.aliyuncs.com/oidc/user_avatar3.png';
|
9
11
|
function InfoCart(props) {
|
10
12
|
const { baseMsg, ...rest } = props;
|
11
13
|
const reg = /^(\d{3})\d*(\d{4})$/;
|
@@ -77,7 +79,7 @@ function InfoCart(props) {
|
|
77
79
|
height="50px"
|
78
80
|
preview={false}
|
79
81
|
style={{ borderRadius: '5px' }}
|
80
|
-
src={baseMsg?.headUrl || baseMsg?.icon}
|
82
|
+
src={baseMsg?.headUrl || baseMsg?.icon || defaultHeadUrl}
|
81
83
|
/>
|
82
84
|
<div className={styles['info-cart-np']}>
|
83
85
|
<span>{baseMsg?.name}</span>
|
package/lib/utils/utils.js
CHANGED
@@ -81,9 +81,9 @@ export function mergeTableColumnCommonConfig(config) {
|
|
81
81
|
render: (_, record) => {
|
82
82
|
const key = item.dataIndex;
|
83
83
|
let data;
|
84
|
-
if (key === 'creator') {
|
84
|
+
if (key === 'creator.name') {
|
85
85
|
data = record.creator;
|
86
|
-
} else if (key === 'updater') {
|
86
|
+
} else if (key === 'updater.name') {
|
87
87
|
data = record.updater;
|
88
88
|
}
|
89
89
|
return <UserAvatar data={data} showName={true} />;
|
package/package.json
CHANGED
package/src/global.css
CHANGED
package/src/pages/index.js
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react';
|
2
2
|
import Header from '../../lib/components/Header/';
|
3
|
+
import TenantSelector from '../../lib/components/TenantSelector';
|
3
4
|
|
4
5
|
// eslint-disable-next-line react/display-name
|
5
6
|
export default function () {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
return (
|
8
|
+
<>
|
9
|
+
<Header productName="bpm" slot={<div>nasa</div>} />
|
10
|
+
<TenantSelector
|
11
|
+
tenantId="b7b0e19414927b878814094f33b43543"
|
12
|
+
appId="bbe5c8f0063711ecb0c00c42a1ff8370"
|
13
|
+
tenantIdChangeCb={() => {}}
|
14
|
+
/>
|
15
|
+
</>
|
16
|
+
);
|
14
17
|
}
|