cfel-base-components 2.5.9 → 2.5.10

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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "typescript.tsdk": "node_modules/typescript/lib"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfel-base-components",
3
- "version": "2.5.9",
3
+ "version": "2.5.10",
4
4
  "description": "cfel-base-components",
5
5
  "main": "/src/index.tsx",
6
6
  "types": "src/index.d.ts",
@@ -0,0 +1,10 @@
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React from 'react';
5
+ import { HelmetProvider } from '/Users/wujingang/Desktop/workspace/base-components/node_modules/@umijs/renderer-react';
6
+ import { context } from './helmetContext';
7
+
8
+ export const innerProvider = (container) => {
9
+ return React.createElement(HelmetProvider, { context }, container);
10
+ }
@@ -0,0 +1,4 @@
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ export const context = {};
@@ -56,11 +56,19 @@ export default function LiosLayout(props: LiosLayoutlProps) {
56
56
  const [collapsed, setCollapsed] = useState(
57
57
  localStorage.getItem("layout_collapsed") === "true"
58
58
  );
59
+ const [isCopied, setIsCopied] = useState(false);
59
60
 
60
61
  const onOpenChange: MenuProps["onOpenChange"] = (keys) => {
61
62
  setOpenKeys(keys);
62
63
  };
63
64
 
65
+ const copyTextToClipboard = async (text:string) => {
66
+ try {
67
+ await navigator.clipboard.writeText(text);
68
+ setIsCopied(true);
69
+ } catch (err) {}
70
+ };
71
+
64
72
  return (
65
73
  <Layout className="layout-warp">
66
74
  {Array.isArray(menuList) && menuList.length > 0 && (
@@ -143,12 +151,15 @@ export default function LiosLayout(props: LiosLayoutlProps) {
143
151
  myWalletInfo={myWalletInfo}
144
152
  amountInfo={amountInfo}
145
153
  customAction={customAction}
154
+ isCopied={isCopied}
155
+ copyTextToClipboard={copyTextToClipboard}
146
156
  />
147
157
  }
148
158
  arrow={false}
149
159
  trigger="click"
150
160
  onOpenChange={(e) => {
151
161
  if (!e) return;
162
+ setIsCopied(false);
152
163
  myWalletInfoAction && myWalletInfoAction();
153
164
  }}
154
165
  >
@@ -81,22 +81,30 @@
81
81
 
82
82
  .li-flex {
83
83
  display: flex;
84
-
84
+ .lios-keyMare {
85
+ width: 40px;
86
+ }
85
87
  .lios-value {
86
88
  flex: 1;
87
89
  }
90
+ .lios-valueMare {
91
+ flex: 1;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ }
95
+
88
96
  }
89
97
 
90
98
  .lios-li {
91
99
  line-height: 22px;
92
100
 
93
- .lios-key {
101
+ .lios-key, .lios-keyMare {
94
102
  font-size: 12px;
95
103
  color: rgba(0, 0, 0, 0.5);
96
104
  display: inline-block;
97
105
  }
98
106
 
99
- .lios-value {
107
+ .lios-value, .lios-valueMare {
100
108
  padding-left: 8px;
101
109
  display: inline-block;
102
110
  font-size: 12px;
@@ -106,7 +114,12 @@
106
114
  padding-left: 5px;
107
115
  }
108
116
  }
109
-
117
+ .lios-iconDone {
118
+ width: 40px;
119
+ text-align: center;
120
+ color: rgba(0, 0, 0, 0.45);
121
+ font-size: 10px;
122
+ }
110
123
  .lios-icon {
111
124
  width: 40px;
112
125
  text-align: center;
@@ -1,11 +1,13 @@
1
1
  import React from "react";
2
- import { SwapOutlined, FormOutlined } from "@ant-design/icons";
2
+ import { SwapOutlined, FormOutlined,CopyOutlined } from "@ant-design/icons";
3
3
  import "./index.scss";
4
4
 
5
5
  interface UserType {
6
6
  name: string;
7
7
  avatar: string;
8
8
  roleInfo: any[];
9
+ id: string;
10
+ account: string;
9
11
  }
10
12
  interface CustomType {
11
13
  type: string;
@@ -42,11 +44,12 @@ export default function UserCard({
42
44
  myWalletInfo,
43
45
  amountInfo,
44
46
  customAction,
47
+ isCopied,
48
+ copyTextToClipboard
45
49
  }: any) {
46
- const { user, tenant, custom, switchTenantUrl, logoutUrl } = (window as any)
47
- ?.g_config;
50
+ const { user, tenant, custom, switchTenantUrl, logoutUrl } = (window as any)?.g_config;
48
51
 
49
- const { name, avatar, roleInfo }: UserType = user || {};
52
+ const { name, avatar, roleInfo , id , account }: UserType = user || {};
50
53
 
51
54
  const { isCompleted, isAudited }: CustomType = custom || {};
52
55
 
@@ -70,7 +73,28 @@ export default function UserCard({
70
73
  </div>
71
74
  </div>
72
75
  </div>
73
-
76
+ <div className="lios-userInfo">
77
+ <div className="lios-li li-flex">
78
+ <div className="lios-keyMare">账号</div>
79
+ <div className="lios-valueMare" title={account}>{account}</div>
80
+ <div
81
+ className={
82
+ isCopied ? 'lios-iconDone' : 'lios-icon'
83
+ }
84
+ onClick={() => {
85
+ copyTextToClipboard(account)
86
+ }}>
87
+ {
88
+ isCopied ? '已复制' : <CopyOutlined />
89
+ }
90
+ </div>
91
+ </div>
92
+ <div className="lios-li li-flex">
93
+ <div className="lios-keyMare">账号ID</div>
94
+ <div className="lios-value">{id}
95
+ </div>
96
+ </div>
97
+ </div>
74
98
  {myWalletInfo && (
75
99
  <div className="lios-userInfo">
76
100
  <div className="lios-li">
@@ -56,7 +56,7 @@ export default function Account({
56
56
  ellipsis: true,
57
57
  },
58
58
  {
59
- title: '是否企业管理员',
59
+ title: '是否主账号',
60
60
  dataIndex: 'isAdmin',
61
61
  key: 'isAdmin',
62
62
  render: (text: any, rowData: any) => {
@@ -193,7 +193,7 @@ export default function AccountInfo() {
193
193
  <Descriptions.Item label="名称">{accountInfo?.name || ''}</Descriptions.Item>
194
194
  <Descriptions.Item label="手机号">{accountInfo?.mobile || ''}</Descriptions.Item>
195
195
  <Descriptions.Item label="邮箱">{accountInfo?.email || ''}</Descriptions.Item>
196
- <Descriptions.Item label="是否企业管理员">{accountInfo?.isAdmin ? '是' : '否'}</Descriptions.Item>
196
+ <Descriptions.Item label="是否主账号">{accountInfo?.isAdmin ? '是' : '否'}</Descriptions.Item>
197
197
  <Descriptions.Item label="创建时间">{timeFormatter(accountInfo?.gmtCreate)}</Descriptions.Item>
198
198
  <Descriptions.Item label="修改时间">{timeFormatter(accountInfo?.gmtModified)}</Descriptions.Item>
199
199
  </Descriptions>
@@ -74,7 +74,7 @@ export default function Account({
74
74
  ellipsis: true,
75
75
  },
76
76
  {
77
- title: '是否企业管理员',
77
+ title: '是否主账号',
78
78
  dataIndex: 'isAdmin',
79
79
  key: 'isAdmin',
80
80
  render: (text: any, rowData: any) => {
@@ -386,7 +386,7 @@ export default function AccountInfo({ isShowTab, getAuthTree, getAccountAuthTree
386
386
  <Descriptions.Item label='名称'>{accountInfo?.name || ''}</Descriptions.Item>
387
387
  <Descriptions.Item label='手机号'>{accountInfo?.mobile || ''}</Descriptions.Item>
388
388
  <Descriptions.Item label='邮箱'>{accountInfo?.email || ''}</Descriptions.Item>
389
- <Descriptions.Item label='是否企业管理员'>
389
+ <Descriptions.Item label='是否主账号'>
390
390
  {accountInfo?.isAdmin ? '是' : '否'}
391
391
  </Descriptions.Item>
392
392
  <Descriptions.Item label='创建时间'>
@@ -103,7 +103,7 @@ export default function RoleInfo({
103
103
  copyable: true
104
104
  },
105
105
  {
106
- title: '是否企业管理员',
106
+ title: '是否主账号',
107
107
  dataIndex: 'isAdmin',
108
108
  key: 'isAdmin',
109
109
  render: (cell: any) => {
@@ -53,7 +53,7 @@ export default function RoleInfo() {
53
53
  copyable: true,
54
54
  },
55
55
  {
56
- title: '是否企业管理员',
56
+ title: '是否主账号',
57
57
  dataIndex: 'isAdmin',
58
58
  key: 'isAdmin',
59
59
  render: (cell: any) => {