cfel-base-components 1.0.7 → 1.0.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfel-base-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "cfel-base-components",
5
5
  "main": "/src/index.tsx",
6
6
  "types": "src/index.d.ts",
@@ -68,8 +68,8 @@ body {
68
68
  .app-list {
69
69
  .app-list-current {
70
70
  font-size: 12px;
71
- height: 24px;
72
- line-height: 24px;
71
+ height: 32px;
72
+ line-height: 32px;
73
73
  padding: 0 12px;
74
74
  border-radius: 6px;
75
75
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
@@ -79,6 +79,11 @@ body {
79
79
  transition: all 0.3s;
80
80
  color: rgba(0, 0, 0, 0.88);
81
81
  font-weight: 400;
82
+ display: flex;
83
+ img{
84
+ max-width: 32px;
85
+ margin-right: 4px;
86
+ }
82
87
  }
83
88
 
84
89
  .app-list-current:hover {
@@ -1,10 +1,10 @@
1
- import React, { useState } from 'react'
1
+ import React, { useEffect, useState } from 'react'
2
2
  import { Layout, Menu, MenuProps, Popover } from 'antd';
3
3
  import { SwapOutlined, } from '@ant-design/icons';
4
4
  import "./index.scss"
5
5
 
6
6
  export interface LiosLayoutlProps {
7
- appName: string;
7
+ appName?: string;
8
8
  productCode: string;
9
9
  children: any;
10
10
  menuList: any;
@@ -25,7 +25,6 @@ export interface LiosLayoutlProps {
25
25
 
26
26
  export default function LiosLayout(props: LiosLayoutlProps) {
27
27
  const {
28
- appName,
29
28
  productCode,
30
29
  menuList,
31
30
  onMenuClick,
@@ -45,6 +44,12 @@ export default function LiosLayout(props: LiosLayoutlProps) {
45
44
  role,
46
45
  } = user || {}
47
46
  const [openKeys, setOpenKeys] = useState<any>(defaultOpenKeys || []);
47
+ const [currentProduct, setCurrentProduct] = useState<any>({});
48
+
49
+ useEffect(() => {
50
+ let cp = productList?.filter((i: any) => i.productCode == productCode)[0]
51
+ setCurrentProduct(cp)
52
+ }, [productList])
48
53
 
49
54
  const onOpenChange: MenuProps['onOpenChange'] = (keys) => {
50
55
  setOpenKeys(keys);
@@ -90,7 +95,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
90
95
  </div >
91
96
  }
92
97
 
93
- const ProductList = () => {
98
+ const ProductListFunc = () => {
94
99
  return <div className='app-list-other'>
95
100
  {productList?.map((item) => {
96
101
  return <div
@@ -121,11 +126,23 @@ export default function LiosLayout(props: LiosLayoutlProps) {
121
126
  </div>
122
127
  <div className="interval" />
123
128
  <div className="app-list">
124
- <Popover placement="bottom" content={<ProductList />} arrow={false} trigger="click">
125
- <div className="app-list-current">
126
- {appName}
127
- </div>
128
- </Popover>
129
+ {
130
+ productList ?
131
+ <Popover placement="bottom" content={<ProductListFunc />} arrow={false} trigger="click">
132
+ <div className="app-list-current">
133
+ {currentProduct?.logoUrl && <img src={currentProduct?.logoUrl || ""} alt="" />}
134
+ <div>
135
+ {currentProduct?.productName || "请选择应用"}
136
+ </div>
137
+ </div>
138
+ </Popover> :
139
+ <div className="app-list-current">
140
+ {currentProduct?.logoUrl && <img src={currentProduct?.logoUrl || ""} alt="" />}
141
+ <div>
142
+ {currentProduct?.productName}
143
+ </div>
144
+ </div>
145
+ }
129
146
  </div>
130
147
  </strong>
131
148
  <div className='lios-header-fill' />
@@ -1,3 +0,0 @@
1
- {
2
- "typescript.tsdk": "node_modules/typescript/lib"
3
- }
@@ -1,10 +0,0 @@
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
- }
@@ -1,4 +0,0 @@
1
- // @ts-nocheck
2
- // This file is generated by Umi automatically
3
- // DO NOT CHANGE IT MANUALLY!
4
- export const context = {};