cfel-base-components 2.5.9 → 2.5.11

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
+ }
@@ -23,13 +23,14 @@
23
23
  shortName: "\u8FDC\u822A\u8DE8\u56FD\u63A7\u80A1\u96C6\u56E2",
24
24
  },
25
25
  user: {
26
- id: 1676424765496406018,
26
+ id: "1676424765496406018",
27
27
  userId: "01436565094521893533",
28
28
  unionId: "xsU4QrgEfZxxj8YxEWAYJAiEiE",
29
29
  name: "\u5434\u5434\u5434\u5434",
30
- avatar: "https://static-legacy.dingtalk.com/media/lQLPM5AkqOufBy7NAyDNAyCwJZ592czMOC4EeIgNJAAGAA_800_800.png",
30
+ avatar: "https://cfel-front.oss-cn-hangzhou.aliyuncs.com/logo/puhui-home/userLogo.jpeg",
31
31
  account: "15957797376",
32
- roleInfo: []
32
+ roleInfo: ["\u8D85\u7EA7\u7BA1\u7406\u5458"],
33
+ isMaster: false
33
34
  },
34
35
  custom: {
35
36
  id: 1727864976691109890,
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.11",
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,24 @@ 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({
60
+ account:false,
61
+ id:false,
62
+ tenantName:false,
63
+ tenantId:false
64
+ });
59
65
 
60
66
  const onOpenChange: MenuProps["onOpenChange"] = (keys) => {
61
67
  setOpenKeys(keys);
62
68
  };
63
69
 
70
+ const copyTextToClipboard = async (text:string,key:string) => {
71
+ try {
72
+ await navigator.clipboard.writeText(text);
73
+ setIsCopied({...isCopied,[key]:true});
74
+ } catch (err) {}
75
+ };
76
+
64
77
  return (
65
78
  <Layout className="layout-warp">
66
79
  {Array.isArray(menuList) && menuList.length > 0 && (
@@ -143,12 +156,20 @@ export default function LiosLayout(props: LiosLayoutlProps) {
143
156
  myWalletInfo={myWalletInfo}
144
157
  amountInfo={amountInfo}
145
158
  customAction={customAction}
159
+ isCopied={isCopied}
160
+ copyTextToClipboard={copyTextToClipboard}
146
161
  />
147
162
  }
148
163
  arrow={false}
149
164
  trigger="click"
150
165
  onOpenChange={(e) => {
151
166
  if (!e) return;
167
+ setIsCopied({
168
+ account:false,
169
+ id:false,
170
+ tenantName:false,
171
+ tenantId:false
172
+ });
152
173
  myWalletInfoAction && myWalletInfoAction();
153
174
  }}
154
175
  >
@@ -6,12 +6,30 @@
6
6
  .user-info {
7
7
  display: flex;
8
8
 
9
- .user-avatar {
9
+ .user-avatarBox{
10
10
  width: 72px;
11
11
  height: 72px;
12
- border-radius: 50%;
13
- background: rgba(255, 255, 255, 0.3);
14
12
  margin-right: 12px;
13
+ position: relative;
14
+ .user-avatar {
15
+ width: 100%;
16
+ height: 100%;
17
+ border-radius: 50%;
18
+ background: rgba(255, 255, 255, 0.3);
19
+ }
20
+ .user-mater{
21
+ position: absolute;
22
+ bottom: 0px;
23
+ left: 0px;
24
+ right: 0px;
25
+ text-align: center;
26
+ background-color: rgba(62, 119, 189 ,0.9);
27
+ width: 50px;
28
+ border-radius: 50px;
29
+ color: #fff;
30
+ transform: scale(0.9);
31
+ margin: auto;
32
+ }
15
33
  }
16
34
 
17
35
  .user-info-right {
@@ -81,22 +99,30 @@
81
99
 
82
100
  .li-flex {
83
101
  display: flex;
84
-
102
+ .lios-keyMare {
103
+ width: 50px;
104
+ }
85
105
  .lios-value {
86
106
  flex: 1;
87
107
  }
108
+ .lios-valueMare {
109
+ flex: 1;
110
+ overflow: hidden;
111
+ text-overflow: ellipsis;
112
+ }
113
+
88
114
  }
89
115
 
90
116
  .lios-li {
91
117
  line-height: 22px;
92
118
 
93
- .lios-key {
119
+ .lios-key, .lios-keyMare {
94
120
  font-size: 12px;
95
121
  color: rgba(0, 0, 0, 0.5);
96
122
  display: inline-block;
97
123
  }
98
124
 
99
- .lios-value {
125
+ .lios-value, .lios-valueMare {
100
126
  padding-left: 8px;
101
127
  display: inline-block;
102
128
  font-size: 12px;
@@ -106,7 +132,12 @@
106
132
  padding-left: 5px;
107
133
  }
108
134
  }
109
-
135
+ .lios-iconDone {
136
+ width: 40px;
137
+ text-align: center;
138
+ color: rgba(0, 0, 0, 0.45);
139
+ font-size: 10px;
140
+ }
110
141
  .lios-icon {
111
142
  width: 40px;
112
143
  text-align: center;
@@ -120,6 +151,8 @@
120
151
  }
121
152
  }
122
153
  }
154
+ .lios-logoutBox{
155
+ display: flex;
123
156
 
124
157
  .lios-logout {
125
158
  cursor: pointer;
@@ -127,18 +160,21 @@
127
160
  justify-content: center;
128
161
  align-items: center;
129
162
  color: rgba(0, 0, 0, 0.45);
130
- border-radius: 4px;
163
+ border-radius: 2px;
131
164
  transition: background 0.3s;
132
165
  padding: 4px;
133
-
166
+ flex: 1;
167
+ border: 1px solid rgba(5, 5, 5, 0.06);
168
+ margin: 4px 4px;
134
169
  &:hover {
135
- background: rgba(0, 0, 0, 0.08);
170
+ background: rgba(0, 0, 0, 0.03);
136
171
  }
137
172
 
138
173
  .logout-icon {
139
174
  width: 16px;
140
175
  height: 16px;
141
- margin-right: 8px;
176
+ margin-right: 3px;
142
177
  }
143
178
  }
179
+ }
144
180
  }
@@ -1,11 +1,19 @@
1
1
  import React from "react";
2
- import { SwapOutlined, FormOutlined } from "@ant-design/icons";
2
+ import {
3
+ SwapOutlined,
4
+ FormOutlined,
5
+ CopyOutlined,
6
+ LogoutOutlined,
7
+ } from "@ant-design/icons";
3
8
  import "./index.scss";
4
9
 
5
10
  interface UserType {
6
11
  name: string;
7
12
  avatar: string;
8
13
  roleInfo: any[];
14
+ id: string;
15
+ account: string;
16
+ isMaster: boolean;
9
17
  }
10
18
  interface CustomType {
11
19
  type: string;
@@ -42,11 +50,14 @@ export default function UserCard({
42
50
  myWalletInfo,
43
51
  amountInfo,
44
52
  customAction,
53
+ isCopied,
54
+ copyTextToClipboard,
45
55
  }: any) {
46
56
  const { user, tenant, custom, switchTenantUrl, logoutUrl } = (window as any)
47
57
  ?.g_config;
48
58
 
49
- const { name, avatar, roleInfo }: UserType = user || {};
59
+ const { name, avatar, roleInfo, id, account, isMaster }: UserType =
60
+ user || {};
50
61
 
51
62
  const { isCompleted, isAudited }: CustomType = custom || {};
52
63
 
@@ -58,7 +69,10 @@ export default function UserCard({
58
69
  return (
59
70
  <div className="layout-user-card">
60
71
  <div className="user-info">
61
- <img className="user-avatar" src={avatar} />
72
+ <div className="user-avatarBox">
73
+ <img className="user-avatar" src={avatar} />
74
+ <div className="user-mater">{isMaster ? "主账号" : "子账号"}</div>
75
+ </div>
62
76
  <div className="user-info-right">
63
77
  <span className="name">{name}</span>
64
78
  <div className="role-list">
@@ -70,8 +84,61 @@ export default function UserCard({
70
84
  </div>
71
85
  </div>
72
86
  </div>
73
-
74
- {myWalletInfo && (
87
+ <div className="lios-userInfo">
88
+ <div className="lios-li li-flex">
89
+ <div className="lios-keyMare">账号</div>
90
+ <div className="lios-valueMare" title={account}>
91
+ {account}
92
+ </div>
93
+ <div
94
+ className={isCopied?.['account'] ? "lios-iconDone" : "lios-icon"}
95
+ onClick={() => {
96
+ copyTextToClipboard(account,'account');
97
+ }}
98
+ >
99
+ {isCopied?.['account'] ? "已复制" : <CopyOutlined />}
100
+ </div>
101
+ </div>
102
+ <div className="lios-li li-flex">
103
+ <div className="lios-keyMare">账号ID</div>
104
+ <div className="lios-valueMare" title={id}>{id}</div>
105
+ <div
106
+ className={isCopied?.['id'] ? "lios-iconDone" : "lios-icon"}
107
+ onClick={() => {
108
+ copyTextToClipboard(id,'id');
109
+ }}
110
+ >
111
+ {isCopied?.['id'] ? "已复制" : <CopyOutlined />}
112
+ </div>
113
+ </div>
114
+ <div className="lios-li li-flex">
115
+ <div className="lios-keyMare">租户名称</div>
116
+ <div className="lios-valueMare" title={tenant?.name}>{tenant?.name}</div>
117
+ <div
118
+ className={"lios-icon"}
119
+ onClick={() => {
120
+ customAction && customAction();
121
+ }}
122
+ >
123
+ <FormOutlined />
124
+ </div>
125
+ </div>
126
+ <div className="lios-li li-flex">
127
+ <div className="lios-keyMare">租户ID</div>
128
+ <div className="lios-valueMare" title={tenant?.id}>{tenant?.id}</div>
129
+ <div
130
+ className={isCopied?.['tenantId'] ? "lios-iconDone" : "lios-icon"}
131
+ onClick={() => {
132
+ copyTextToClipboard(tenant?.id,'tenantId');
133
+ }}
134
+ >
135
+ {isCopied?.['tenantId'] ? "已复制" : <CopyOutlined />}
136
+ </div>
137
+ </div>
138
+ </div>
139
+
140
+ {/* myWalletInfo */}
141
+ { true && (
75
142
  <div className="lios-userInfo">
76
143
  <div className="lios-li">
77
144
  <div className="lios-key">现金余额</div>
@@ -98,81 +165,26 @@ export default function UserCard({
98
165
  )}
99
166
  </div>
100
167
  )}
101
-
102
- {custom && (
103
- <div className="lios-userInfo">
104
- <div className="lios-li li-flex">
105
- <div className="lios-key">客户类型</div>
106
- <div className="lios-value">{custom.type || ""}</div>
107
- <div
108
- className="lios-icon"
109
- onClick={() => {
110
- customAction && customAction();
111
- }}
112
- >
113
- <FormOutlined />
114
- </div>
115
- </div>
116
- <div className="lios-li">
117
- <div className="lios-key">是否审核</div>
118
- <div className="lios-value">{isAudited ? "是" : "否"}</div>
119
- </div>
120
- <div className="lios-li">
121
- <div className="lios-key">是否资料完备</div>
122
- <div className="lios-value">{isCompleted ? "是" : "否"}</div>
123
- </div>
124
- </div>
125
- )}
126
-
127
- {tenant?.name && (
128
- <div className="lios-tenant">
129
- <div className="tenant-label">租户</div>
130
- <div className="tenant-switch">
131
- <div className="tenant-value">{tenant?.name}</div>
132
- {switchTenantUrl && (
133
- <div
134
- className="tenant-icon"
135
- onClick={() => {
136
- location.href = switchTenantUrl;
137
- }}
138
- >
139
- <SwapOutlined />
140
- </div>
141
- )}
142
- </div>
168
+ <div className="lios-logoutBox">
169
+ <div
170
+ className="lios-logout"
171
+ onClick={() => {
172
+ location.href = switchTenantUrl;
173
+ }}
174
+ >
175
+ <SwapOutlined className="logout-icon" />
176
+ 切换租户
143
177
  </div>
144
- )}
145
-
146
- {logoutUrl && (
147
178
  <div
148
179
  className="lios-logout"
149
180
  onClick={() => {
150
181
  location.href = logoutUrl;
151
182
  }}
152
183
  >
153
- <svg
154
- className="logout-icon"
155
- viewBox="0 0 1024 1024"
156
- version="1.1"
157
- xmlns="http://www.w3.org/2000/svg"
158
- p-id="5022"
159
- width="16"
160
- height="16"
161
- >
162
- <path
163
- d="M295.589 239.512c17.942-12.888 42.935-8.79 55.823 9.153 12.888 17.942 8.79 42.935-9.153 55.823C266.667 358.783 221 445.786 221 540.488 221 700.92 351.272 831 512 831s291-130.08 291-290.512c0-94.663-45.63-181.634-121.17-235.935-17.937-12.895-22.026-37.89-9.131-55.827 12.894-17.938 37.889-22.026 55.827-9.132C824.752 308.766 883 419.788 883 540.488 883 745.13 716.884 911 512 911S141 745.13 141 540.488c0-120.75 58.297-231.812 154.589-300.976z"
164
- fill="currentColor"
165
- p-id="5023"
166
- ></path>
167
- <path
168
- d="M512 113c21.87 0 39.641 17.552 39.995 39.339L552 153v297c0 22.091-17.909 40-40 40-21.87 0-39.641-17.552-39.995-39.339L472 450V153c0-22.091 17.909-40 40-40z"
169
- fill="currentColor"
170
- p-id="5024"
171
- ></path>
172
- </svg>
184
+ <LogoutOutlined className="logout-icon" />
173
185
  退出登录
174
186
  </div>
175
- )}
187
+ </div>
176
188
  </div>
177
189
  );
178
190
  };
@@ -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>