cfel-base-components 0.0.9 → 0.0.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.
@@ -1,28 +1,15 @@
1
1
  import React from "react"
2
2
  import { createRoot } from 'react-dom/client';
3
- import { WidthAutoLabel } from '../../src/index'; // 引入组件
4
3
  import './index.scss';
5
- // import WidthAutoLabel from 'text-width-auto-label';
4
+ import Layout from '../../src/components/layout';
6
5
 
7
6
  const App = () => {
8
7
  return (
9
- <div className="container">
10
- <div className="text">
11
- <p>示例文本:</p><p>文本宽度自适应标签组件</p>
12
- </div>
13
- <div className="normal">
14
- <p>宽度100px:</p><p>文本宽度自适应标签组件</p>
15
- </div>
16
- <div className="style1">
17
- <p>宽度100px:</p><p><WidthAutoLabel>文本宽度自适应标签组件</WidthAutoLabel></p>
18
- </div>
19
- <div className="style2">
20
- <p>宽度80px:</p><p><WidthAutoLabel>文本宽度自适应标签组件</WidthAutoLabel></p>
21
- </div>
22
- <div className="style3">
23
- <p>宽度50px:</p><p><WidthAutoLabel>文本宽度自适应标签组件</WidthAutoLabel></p>
24
- </div>
25
- </div>
8
+ < Layout appName="123123" productCode="lios-iot-wifi">
9
+
10
+ </Layout >
11
+
12
+
26
13
  );
27
14
  }
28
15
  const container = document.getElementById('root');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfel-base-components",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "cfel-base-components",
5
5
  "main": "/src/index.tsx",
6
6
  "types": "src/index.d.ts",
@@ -66,7 +66,7 @@ body {
66
66
  }
67
67
 
68
68
  .app-list {
69
- .current {
69
+ .app-list-current {
70
70
  font-size: 12px;
71
71
  height: 24px;
72
72
  line-height: 24px;
@@ -81,9 +81,10 @@ body {
81
81
  font-weight: 400;
82
82
  }
83
83
 
84
- .current:hover {
84
+ .app-list-current:hover {
85
85
  background: rgba(0, 0, 0, 0.1);
86
86
  }
87
+
87
88
  }
88
89
  }
89
90
 
@@ -183,7 +184,7 @@ body {
183
184
  background: rgba(255, 255, 255, 0.3);
184
185
  margin-right: 12px;
185
186
  }
186
-
187
+
187
188
  }
188
189
 
189
190
  .lios-tenant {
@@ -221,4 +222,36 @@ body {
221
222
  margin-right: 8px;
222
223
  }
223
224
  }
225
+ }
226
+
227
+
228
+
229
+ .app-list-other {
230
+
231
+ .product-list-item {
232
+ display: flex;
233
+ justify-content: flex-start;
234
+ align-items: center;
235
+ margin: 8px 0;
236
+ padding: 6px 12px;
237
+ cursor: pointer;
238
+ border-radius: 4px;
239
+ transition: all .3s;
240
+ color: rgba(0, 0, 0, .65);
241
+
242
+
243
+ &:hover {
244
+ background: rgba(22, 119, 255, .08);
245
+ color: rgba(22, 119, 255, .8);
246
+ }
247
+
248
+ img {
249
+ width: 32px;
250
+ margin-right: 12px;
251
+ }
252
+ }
253
+
254
+ .current-product {
255
+ color: #1677FF !important;
256
+ }
224
257
  }
@@ -4,6 +4,7 @@ import "./index.scss"
4
4
 
5
5
  export interface LiosLayoutlProps {
6
6
  appName: string;
7
+ productCode: string;
7
8
  children: any;
8
9
  menuList: any;
9
10
  onMenuClick: (item: any) => void;
@@ -15,19 +16,22 @@ export interface LiosLayoutlProps {
15
16
  tenantName: string
16
17
  };
17
18
  logoutUrl?: string
18
- defaultOpenKeys?: string[]
19
+ defaultOpenKeys?: string[],
20
+ productList?: any[],
19
21
  }
20
22
 
21
23
  export default function LiosLayout(props: LiosLayoutlProps) {
22
24
  const {
23
25
  appName,
26
+ productCode,
24
27
  menuList,
25
28
  onMenuClick,
26
29
  selectedKeys,
27
30
  actions,
28
31
  user,
29
32
  logoutUrl,
30
- defaultOpenKeys
33
+ defaultOpenKeys,
34
+ productList
31
35
  } = props
32
36
 
33
37
  const {
@@ -67,6 +71,23 @@ export default function LiosLayout(props: LiosLayoutlProps) {
67
71
  </div >
68
72
  }
69
73
 
74
+ const ProductList = () => {
75
+ return <div className='app-list-other'>
76
+ {productList?.map((item) => {
77
+ return <div
78
+ onClick={() => {
79
+ item.productCode != productCode && item?.portalUrl && window.open(item?.portalUrl)
80
+ }}
81
+ key={item.id}
82
+ className={`product-list-item ${item.productCode == productCode ? "current-product" : ""}`}
83
+ >
84
+ <img src={item?.logoUrl || "https://pic.imgdb.cn/item/64c760291ddac507cc68440a.png"} alt="" />
85
+ <div> {item?.productName}</div>
86
+ </div>
87
+ })}
88
+ </div>
89
+ }
90
+
70
91
  return (<Layout>
71
92
  <div className="lios-header">
72
93
 
@@ -81,9 +102,11 @@ export default function LiosLayout(props: LiosLayoutlProps) {
81
102
  </div>
82
103
  <div className="interval" />
83
104
  <div className="app-list">
84
- <div className="current">
85
- {appName}
86
- </div>
105
+ <Popover placement="bottom" content={<ProductList />} arrow={false} trigger="click">
106
+ <div className="app-list-current">
107
+ {appName}
108
+ </div>
109
+ </Popover>
87
110
  </div>
88
111
  </strong>
89
112
  <div className='lios-header-fill' />