cfel-base-components 0.0.11 → 0.0.12
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/demo/src/index.jsx
CHANGED
|
@@ -10,7 +10,8 @@ const App = () => {
|
|
|
10
10
|
name: "\u5434\u6668\u61CB\uFF08\u592A\u4E00\uFF09",
|
|
11
11
|
avatar: "https:\/\/static-legacy.dingtalk.com\/media\/lQLPM5AkqOufBy7NAyDNAyCwJZ592czMOC4EeIgNJAAGAA_800_800.png",
|
|
12
12
|
tenantName: "\u8FDC\u822A\u8DE8\u56FD\u63A7\u80A1\u96C6\u56E2",
|
|
13
|
-
|
|
13
|
+
switchTenantUrl: "https:\/\/cfel-sso-daily.chengfengerlai.com\/tenant\/switch?fakeAccountId=1676424765496406018\u0026redirect=http:\/\/lios-iot-obee-daily.chengfengerlai.com\/sso\/login?back=http%3A%2F%2Flios-iot-obee-daily.chengfengerlai.com%2Fweb",
|
|
14
|
+
// role:["超级管理员","超管","子管理员","超级管理员","超级管理员123","子管理员","超级管理员","超级管理员123","子管理员","超级管理员","超级管理员123超级管理员123超级管理员123超级管理员123","子管理员"]
|
|
14
15
|
// role:["超级管理员"]
|
|
15
16
|
}}
|
|
16
17
|
>
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var r="object"==typeof exports?t(require("react")):t(e.React);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(self,(e=>(()=>{"use strict";var t={787:t=>{t.exports=e}},r={};var o={};return function e(o){var f=r[o];if(void 0!==f)return f.exports;var p=r[o]={exports:{}};return t[o](p,p.exports,e),p.exports}(787),o.default})()));
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
body{margin:0}.lios-header{height:48px;background:white;z-index:1;box-shadow:1px 0px 5px #ccc;position:relative;display:flex;justify-content:flex-start;align-items:center}.lios-header .background{width:800px;height:100%;position:absolute;top:0;right:0;overflow:hidden}.lios-header .background .background-img{width:800px;position:absolute;top:-65px}.lios-header .background .background-mask{position:absolute;left:0;top:0;width:100%;height:100%;background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.lios-header .lios-header-fill{flex:1}.lios-header .lios-logo{left:48px;top:0;width:255px;position:absolute;z-index:1;display:inline-flex;align-items:center}.lios-header .lios-logo .img{color:#1677ff;font-size:20px;line-height:48px;font-family:Lucida Calligraphy, cursive, serif, sans-serif;margin-right:12px}.lios-header .lios-logo .interval{color:rgba(0,0,0,0.1);width:1px;height:12px;background-color:rgba(0,0,0,0.1);margin:8px}.lios-header .lios-logo .app-list .app-list-current{font-size:12px;height:24px;line-height:24px;padding:0 12px;border-radius:6px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';cursor:pointer;transition:all 0.3s;color:rgba(0,0,0,0.88);font-weight:400}.lios-header .lios-logo .app-list .app-list-current:hover{background:rgba(0,0,0,0.1)}.lios-header .lios-header-actions{display:flex;justify-content:flex-start;align-items:center;height:100%;max-width:300px;z-index:2}.lios-header .lios-header-actions .actions-item{height:36px;border-radius:6px;transition:all .3s;cursor:pointer;margin:0 4px;padding:0 12px;display:flex;justify-content:center;align-items:center}.lios-header .lios-header-actions .actions-item:hover{background:rgba(255,255,255,0.15)}.lios-header .lios-header-user{height:40px;display:flex;justify-content:flex-start;align-items:center;z-index:2;transition:all .3s;padding:0 12px;margin:0 12px;border-radius:6px;cursor:pointer}.lios-header .lios-header-user:hover{background:rgba(255,255,255,0.15)}.lios-header .lios-header-user .author{width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,0.3);margin-right:12px}.lios-header .lios-header-user .name{color:white}.lios-main{display:flex;height:100%}.lios-side{max-width:255px;height:calc(100vh - 48px);background:white;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding-top:12px}.lios-content{width:100%;height:calc(100vh - 48px);overflow-y:auto;padding:16px 16px 5px;display:flex;flex-direction:column}.lios-user-card{min-width:182px;max-width:262px}.lios-user-card .user-info{display:flex;margin-bottom:12px}.lios-user-card .user-info .author{width:72px;height:72px;border-radius:50%;background:rgba(255,255,255,0.3);margin-right:12px}.lios-user-card .user-info .user-info-right{flex:1}.lios-user-card .user-info .name{display:inline-block;margin-top:18px}.lios-user-card .user-info .role-list{font-size:12px;line-height:16px;margin-top:4px}.lios-user-card .user-info .role-list .role-item{background:rgba(204,204,204,0.55);padding:2px 8px;border-radius:8px;display:inline-block;margin-right:4px;margin-bottom:4px}.lios-user-card .lios-tenant{margin-bottom:12px}.lios-user-card .lios-tenant .tenant-label{font-size:12px;color:rgba(0,0,0,0.65)}.lios-user-card .lios-tenant .tenant-switch{display:flex}.lios-user-card .lios-tenant .tenant-switch .tenant-value{flex:1;font-size:14px;color:rgba(0,0,0,0.85)}.lios-user-card .lios-tenant .tenant-switch .tenant-icon{width:40px;text-align:center;color:rgba(0,0,0,0.45);display:flex;justify-content:center;align-items:center}.lios-user-card .lios-tenant .tenant-switch .tenant-icon:hover{cursor:pointer;color:rgba(0,0,0,0.85)}.lios-user-card .lios-logout{cursor:pointer;display:flex;justify-content:center;align-items:center;color:rgba(0,0,0,0.45);border-radius:4px;transition:background .3s;padding:4px}.lios-user-card .lios-logout:hover{background:rgba(0,0,0,0.08)}.lios-user-card .lios-logout .logout-icon{width:16px;height:16px;margin-right:8px}.app-list-other .product-list-item{display:flex;justify-content:flex-start;align-items:center;margin:8px 0;padding:6px 12px;cursor:pointer;border-radius:4px;transition:all .3s;color:rgba(0,0,0,0.65)}.app-list-other .product-list-item:hover{background:rgba(22,119,255,0.08);color:rgba(22,119,255,0.8)}.app-list-other .product-list-item img{width:32px;height:32px;margin-right:12px}.app-list-other .current-product{color:#1677FF !important}
|
|
2
|
+
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
|
@@ -216,11 +216,27 @@ body {
|
|
|
216
216
|
font-size: 12px;
|
|
217
217
|
color: rgba(0, 0, 0, .65);
|
|
218
218
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
.tenant-switch{
|
|
220
|
+
display: flex;
|
|
221
|
+
.tenant-value {
|
|
222
|
+
flex: 1;
|
|
223
|
+
font-size: 14px;
|
|
224
|
+
color: rgba(0, 0, 0, .85);
|
|
225
|
+
}
|
|
226
|
+
.tenant-icon{
|
|
227
|
+
width: 40px;
|
|
228
|
+
text-align: center;
|
|
229
|
+
color: rgba(0, 0, 0, .45);
|
|
230
|
+
display: flex;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
align-items: center;
|
|
233
|
+
}
|
|
234
|
+
.tenant-icon:hover{
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
color: rgba(0, 0, 0, .85);
|
|
237
|
+
}
|
|
223
238
|
}
|
|
239
|
+
|
|
224
240
|
|
|
225
241
|
}
|
|
226
242
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { Layout, Menu, MenuProps, Popover } from 'antd';
|
|
3
|
+
import { SwapOutlined, } from '@ant-design/icons';
|
|
3
4
|
import "./index.scss"
|
|
4
5
|
|
|
5
6
|
export interface LiosLayoutlProps {
|
|
@@ -16,7 +17,8 @@ export interface LiosLayoutlProps {
|
|
|
16
17
|
tenantName: string,
|
|
17
18
|
role: any[]
|
|
18
19
|
};
|
|
19
|
-
logoutUrl?: string
|
|
20
|
+
logoutUrl?: string,
|
|
21
|
+
switchTenantUrl?: string,
|
|
20
22
|
defaultOpenKeys?: string[],
|
|
21
23
|
productList?: any[],
|
|
22
24
|
}
|
|
@@ -31,6 +33,7 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
31
33
|
actions,
|
|
32
34
|
user,
|
|
33
35
|
logoutUrl,
|
|
36
|
+
switchTenantUrl,
|
|
34
37
|
defaultOpenKeys,
|
|
35
38
|
productList
|
|
36
39
|
} = props
|
|
@@ -66,7 +69,16 @@ export default function LiosLayout(props: LiosLayoutlProps) {
|
|
|
66
69
|
|
|
67
70
|
{tenantName && <div className='lios-tenant'>
|
|
68
71
|
<div className='tenant-label'>租户</div>
|
|
69
|
-
<div className='tenant-
|
|
72
|
+
<div className='tenant-switch'>
|
|
73
|
+
<div className='tenant-value'>{tenantName}</div>
|
|
74
|
+
{
|
|
75
|
+
switchTenantUrl && <div className='tenant-icon' onClick={() => {
|
|
76
|
+
location.href = switchTenantUrl;
|
|
77
|
+
}}>
|
|
78
|
+
<SwapOutlined />
|
|
79
|
+
</div>
|
|
80
|
+
}
|
|
81
|
+
</div>
|
|
70
82
|
</div>}
|
|
71
83
|
|
|
72
84
|
{logoutUrl && <div className='lios-logout' onClick={() => {
|