cfel-base-components 0.0.11 → 0.0.13
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/README.md +2 -0
- package/demo/src/index.jsx +38 -11
- package/lib/index.js +1 -0
- package/lib/index.min.css +2 -0
- package/package.json +5 -3
- package/src/.umi/core/helmet.ts +10 -0
- package/src/.umi/core/helmetContext.ts +4 -0
- package/src/components/Pagecontainer/index.scss +13 -0
- package/src/components/Pagecontainer/index.tsx +22 -0
- package/src/components/Pagination/index.scss +4 -0
- package/src/components/Pagination/index.tsx +20 -0
- package/src/components/ProTable/index.scss +0 -0
- package/src/components/ProTable/index.tsx +22 -0
- package/src/components/QueryFilter/index.scss +0 -0
- package/src/components/QueryFilter/index.tsx +20 -0
- package/src/components/account/index.scss +0 -0
- package/src/components/account/index.tsx +55 -0
- package/src/components/accountInfo/EditAccountDrawer/index.tsx +80 -0
- package/src/components/accountInfo/index.scss +3 -0
- package/src/components/accountInfo/index.tsx +93 -0
- package/src/components/button/index.scss +0 -3
- package/src/components/layout/index.scss +20 -4
- package/src/components/layout/index.tsx +14 -2
package/README.md
CHANGED
package/demo/src/index.jsx
CHANGED
|
@@ -2,22 +2,49 @@ import React from "react"
|
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import './index.scss';
|
|
4
4
|
import Layout from '../../src/components/layout';
|
|
5
|
+
import Account from '../../src/components/account';
|
|
6
|
+
import AccountInfo from '../../src/components/accountinfo';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
5
10
|
|
|
6
11
|
const App = () => {
|
|
7
12
|
return (
|
|
8
|
-
< Layout appName="123123" productCode="lios-iot-wifi"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
>
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
// < Layout appName="123123" productCode="lios-iot-wifi"
|
|
14
|
+
// user={{
|
|
15
|
+
// name: "\u5434\u6668\u61CB\uFF08\u592A\u4E00\uFF09",
|
|
16
|
+
// avatar: "https:\/\/static-legacy.dingtalk.com\/media\/lQLPM5AkqOufBy7NAyDNAyCwJZ592czMOC4EeIgNJAAGAA_800_800.png",
|
|
17
|
+
// tenantName: "\u8FDC\u822A\u8DE8\u56FD\u63A7\u80A1\u96C6\u56E2",
|
|
18
|
+
// role:["超级管理员","超管","子管理员","超级管理员","超级管理员123","子管理员","超级管理员","超级管理员123","子管理员","超级管理员","超级管理员123超级管理员123超级管理员123超级管理员123","子管理员"]
|
|
19
|
+
// // role:["超级管理员"]
|
|
20
|
+
// }}
|
|
21
|
+
// >
|
|
22
|
+
// </Layout >
|
|
23
|
+
<>
|
|
24
|
+
|
|
25
|
+
{/* <Account
|
|
26
|
+
// dataList={dataList} //表格数据
|
|
27
|
+
// columns={columns} //列
|
|
28
|
+
// isLoading={isLoading} //加载
|
|
29
|
+
// handleRoload={handleRoload} //分页
|
|
30
|
+
// handleOnReset={handleOnReset} //重置
|
|
31
|
+
// handleOnFinish={handleOnFinish} //搜索
|
|
32
|
+
// pagination={pagination} //分页配置
|
|
33
|
+
></Account> */}
|
|
19
34
|
|
|
35
|
+
<AccountInfo
|
|
36
|
+
accountInfo={accountInfo} //用户详情
|
|
37
|
+
timeFormatter={timeFormatter} //时间戳转换
|
|
38
|
+
dataList={dataList} //表格数据
|
|
39
|
+
columns={columns} //列
|
|
40
|
+
isLoading={isLoading} //加载
|
|
41
|
+
handleRoload={handleRoload} //分页
|
|
42
|
+
pagination={pagination} //分页配置
|
|
43
|
+
isBoundRolesFunc={isBoundRolesFunc} //绑定/解绑事件
|
|
44
|
+
getQueryBoundRolesFunc={getQueryBoundRolesFunc} //绑定打开弹框
|
|
45
|
+
/>
|
|
20
46
|
|
|
47
|
+
</>
|
|
21
48
|
);
|
|
22
49
|
}
|
|
23
50
|
const container = document.getElementById('root');
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cfel-base-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "cfel-base-components",
|
|
5
5
|
"main": "/src/index.tsx",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
"webpack-dev-server": "^4.15.1",
|
|
41
41
|
"webpack-merge": "^5.9.0"
|
|
42
42
|
},
|
|
43
|
-
"peerDependencies":{
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@ant-design/icons": "^5.1.4",
|
|
45
|
+
"@ant-design/pro-components": "^2.6.12",
|
|
44
46
|
"antd": "^5.5.2"
|
|
45
47
|
}
|
|
46
|
-
}
|
|
48
|
+
}
|
|
@@ -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,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import "./index.scss"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default function PageContainer({
|
|
6
|
+
className,
|
|
7
|
+
children,
|
|
8
|
+
...restFileds
|
|
9
|
+
}: any) {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<div
|
|
13
|
+
className={`page-container ${className}`}
|
|
14
|
+
{...restFileds}
|
|
15
|
+
>
|
|
16
|
+
{children}
|
|
17
|
+
</div>
|
|
18
|
+
<div className="page-footEmpower">
|
|
19
|
+
©{new Date().getFullYear() || ''} 橙蜂而来{' '}
|
|
20
|
+
</div>
|
|
21
|
+
</>)
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pagination, PaginationProps } from 'antd';
|
|
3
|
+
import "./index.scss"
|
|
4
|
+
|
|
5
|
+
export default function PaginationComponent (props: PaginationProps){
|
|
6
|
+
const { className } = props
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className={`pagination ${className}`}
|
|
10
|
+
>
|
|
11
|
+
<Pagination
|
|
12
|
+
showQuickJumper
|
|
13
|
+
showSizeChanger
|
|
14
|
+
showTotal={(total) => `共 ${total} 条`}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ProTable,
|
|
4
|
+
ProTableProps
|
|
5
|
+
} from '@ant-design/pro-components';
|
|
6
|
+
import "./index.scss"
|
|
7
|
+
|
|
8
|
+
export default function ProTableComponent (props: ProTableProps<any,any>){
|
|
9
|
+
const { className } = props
|
|
10
|
+
return (
|
|
11
|
+
<ProTable
|
|
12
|
+
className={`protable ${className}`}
|
|
13
|
+
search={false}
|
|
14
|
+
pagination={false}
|
|
15
|
+
scroll={{
|
|
16
|
+
x: 'max-content'
|
|
17
|
+
}}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
QueryFilter,
|
|
4
|
+
QueryFilterProps
|
|
5
|
+
} from '@ant-design/pro-components';
|
|
6
|
+
import "./index.scss"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export default function PaginationComponent (props: QueryFilterProps<any>){
|
|
11
|
+
const { className } = props
|
|
12
|
+
return (
|
|
13
|
+
<QueryFilter
|
|
14
|
+
className={`queryfilter ${className}`}
|
|
15
|
+
layout="vertical"
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import Pagecontainer from '../Pagecontainer';
|
|
3
|
+
import QueryFilter from '../QueryFilter';
|
|
4
|
+
import ProTable from '../ProTable';
|
|
5
|
+
import Pagination from '../Pagination';
|
|
6
|
+
import {
|
|
7
|
+
ProFormText,
|
|
8
|
+
} from '@ant-design/pro-components';
|
|
9
|
+
|
|
10
|
+
import "./index.scss"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export interface AccountProps {
|
|
14
|
+
dataList:any;
|
|
15
|
+
columns:any;
|
|
16
|
+
isLoading:any;
|
|
17
|
+
handleRoload:()=>any;
|
|
18
|
+
pagination:any;
|
|
19
|
+
handleOnReset:(item:any)=>any;
|
|
20
|
+
handleOnFinish:(item:any)=>any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function Account({
|
|
24
|
+
dataList,
|
|
25
|
+
columns,
|
|
26
|
+
isLoading,
|
|
27
|
+
handleRoload,
|
|
28
|
+
pagination,
|
|
29
|
+
handleOnReset,
|
|
30
|
+
handleOnFinish
|
|
31
|
+
}: AccountProps) {
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Pagecontainer>
|
|
35
|
+
<QueryFilter
|
|
36
|
+
onReset={handleOnReset}
|
|
37
|
+
onFinish={handleOnFinish}
|
|
38
|
+
>
|
|
39
|
+
<ProFormText name="name" label="名称" />
|
|
40
|
+
<ProFormText name="account" label="账号" />
|
|
41
|
+
</QueryFilter>
|
|
42
|
+
<ProTable
|
|
43
|
+
headerTitle={"账号列表"}
|
|
44
|
+
dataSource={dataList}
|
|
45
|
+
loading={isLoading}
|
|
46
|
+
columns={columns}
|
|
47
|
+
rowKey="id"
|
|
48
|
+
options={{
|
|
49
|
+
reload: handleRoload
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
<Pagination {...pagination} />
|
|
53
|
+
</Pagecontainer>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Button, Drawer, Select, Form, Space } from 'antd';
|
|
3
|
+
|
|
4
|
+
interface propsType {
|
|
5
|
+
open: boolean;
|
|
6
|
+
editOpenStatus: Function;
|
|
7
|
+
isBoundRolesFunc: Function;
|
|
8
|
+
rolelistRoleData: any;
|
|
9
|
+
roleCheckData: any;
|
|
10
|
+
}
|
|
11
|
+
export default function index({
|
|
12
|
+
open,
|
|
13
|
+
editOpenStatus,
|
|
14
|
+
isBoundRolesFunc,
|
|
15
|
+
rolelistRoleData,
|
|
16
|
+
roleCheckData,
|
|
17
|
+
}: propsType) {
|
|
18
|
+
|
|
19
|
+
const [form] = Form.useForm();
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!open) return
|
|
22
|
+
form.setFieldsValue({
|
|
23
|
+
roleCodes: roleCheckData || [],
|
|
24
|
+
})
|
|
25
|
+
}, [open])
|
|
26
|
+
|
|
27
|
+
const onCloseDrawer = () => {
|
|
28
|
+
editOpenStatus(false)
|
|
29
|
+
}
|
|
30
|
+
const onFinishForm = () => {
|
|
31
|
+
form.validateFields()
|
|
32
|
+
.then((values) => {
|
|
33
|
+
isBoundRolesFunc(true, values).then((res: any) => {
|
|
34
|
+
form.resetFields()
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
return (<Drawer
|
|
39
|
+
title="绑定的角色"
|
|
40
|
+
closable={false}
|
|
41
|
+
open={open}
|
|
42
|
+
destroyOnClose={true}
|
|
43
|
+
onClose={() => { onCloseDrawer() }}
|
|
44
|
+
footer={<Space>
|
|
45
|
+
<Button
|
|
46
|
+
type="primary"
|
|
47
|
+
onClick={() => {
|
|
48
|
+
onFinishForm()
|
|
49
|
+
}}
|
|
50
|
+
>保存</Button>
|
|
51
|
+
<Button
|
|
52
|
+
onClick={() => { onCloseDrawer() }}
|
|
53
|
+
>取消</Button>
|
|
54
|
+
</Space>
|
|
55
|
+
}
|
|
56
|
+
>
|
|
57
|
+
<Form
|
|
58
|
+
form={form}
|
|
59
|
+
layout={'vertical'}
|
|
60
|
+
initialValues={{ remember: true }}
|
|
61
|
+
autoComplete="off"
|
|
62
|
+
>
|
|
63
|
+
<Form.Item
|
|
64
|
+
name="roleCodes"
|
|
65
|
+
label="绑定角色"
|
|
66
|
+
rules={[{ required: true, message: '' }]} >
|
|
67
|
+
<Select
|
|
68
|
+
mode="multiple"
|
|
69
|
+
allowClear
|
|
70
|
+
placeholder="请选择"
|
|
71
|
+
options={rolelistRoleData?.map((d: any) => ({
|
|
72
|
+
label: d.roleName,
|
|
73
|
+
value: d.roleCode,
|
|
74
|
+
}))}
|
|
75
|
+
/>
|
|
76
|
+
</Form.Item>
|
|
77
|
+
</Form>
|
|
78
|
+
</Drawer >
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { useEffect, useRef ,useState} from 'react';
|
|
2
|
+
import Pagecontainer from '../Pagecontainer';
|
|
3
|
+
import ProTable from '../ProTable';
|
|
4
|
+
import Pagination from '../Pagination';
|
|
5
|
+
|
|
6
|
+
import { Modal, Button, Divider, Descriptions, Space, message, Avatar } from 'antd';
|
|
7
|
+
import { UserOutlined } from '@ant-design/icons';
|
|
8
|
+
import EditAccountDrawer from './EditAccountDrawer/index'
|
|
9
|
+
|
|
10
|
+
import "./index.scss"
|
|
11
|
+
|
|
12
|
+
export interface AccountInfoProps {
|
|
13
|
+
accountInfo:any;
|
|
14
|
+
timeFormatter:(item:any)=>any;
|
|
15
|
+
dataList:any;
|
|
16
|
+
columns:any;
|
|
17
|
+
isLoading:any;
|
|
18
|
+
handleRoload:()=>any;
|
|
19
|
+
pagination:any;
|
|
20
|
+
isBoundRolesFunc:(type:any,item:any)=>any;
|
|
21
|
+
getQueryBoundRolesFunc:()=>any;
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default function AccountInfo ({
|
|
26
|
+
accountInfo,
|
|
27
|
+
timeFormatter,
|
|
28
|
+
dataList,
|
|
29
|
+
columns,
|
|
30
|
+
isLoading,
|
|
31
|
+
handleRoload,
|
|
32
|
+
pagination,
|
|
33
|
+
isBoundRolesFunc,
|
|
34
|
+
getQueryBoundRolesFunc
|
|
35
|
+
}: AccountInfoProps) {
|
|
36
|
+
const [rolelistRoleData, setRolelistRoleData]: any = useState([]); // 角色总数据
|
|
37
|
+
const [roleCheckData, setRoleCheckData]: any = useState([]); //当前选中的角色list
|
|
38
|
+
|
|
39
|
+
const [editAccountOpen, setEditAccountOpen] = useState(false);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Pagecontainer>
|
|
43
|
+
<Divider orientation="left">
|
|
44
|
+
<Avatar
|
|
45
|
+
style={{ backgroundColor: '#1677ff', marginRight: '8px' }}
|
|
46
|
+
draggable={false}
|
|
47
|
+
icon={<UserOutlined />}
|
|
48
|
+
src={!!accountInfo.avatar ? accountInfo.avatar : undefined}
|
|
49
|
+
/>
|
|
50
|
+
{accountInfo?.name || ''}
|
|
51
|
+
</Divider>
|
|
52
|
+
<Descriptions className='basicInfoWrap'>
|
|
53
|
+
<Descriptions.Item label="账号">{accountInfo?.account || ''}</Descriptions.Item>
|
|
54
|
+
<Descriptions.Item label="员工工号">{accountInfo?.jobNumber || ''}</Descriptions.Item>
|
|
55
|
+
<Descriptions.Item label="名称">{accountInfo?.name || ''}</Descriptions.Item>
|
|
56
|
+
<Descriptions.Item label="手机号">{accountInfo?.mobile || ''}</Descriptions.Item>
|
|
57
|
+
<Descriptions.Item label="邮箱">{accountInfo?.email || ''}</Descriptions.Item>
|
|
58
|
+
<Descriptions.Item label="是否企业管理员">{accountInfo?.isAdmin ? '是' : '否'}</Descriptions.Item>
|
|
59
|
+
<Descriptions.Item label="创建时间">{timeFormatter(accountInfo?.gmtCreate)}</Descriptions.Item>
|
|
60
|
+
<Descriptions.Item label="修改时间">{timeFormatter(accountInfo?.gmtModified)}</Descriptions.Item>
|
|
61
|
+
</Descriptions>
|
|
62
|
+
|
|
63
|
+
<ProTable
|
|
64
|
+
headerTitle={"绑定的角色"}
|
|
65
|
+
dataSource={dataList}
|
|
66
|
+
loading={isLoading}
|
|
67
|
+
columns={columns}
|
|
68
|
+
rowKey="id"
|
|
69
|
+
options={{
|
|
70
|
+
reload: handleRoload
|
|
71
|
+
}}
|
|
72
|
+
toolBarRender={() => {
|
|
73
|
+
return [
|
|
74
|
+
<Button type="primary" onClick={(() => {
|
|
75
|
+
getQueryBoundRolesFunc()
|
|
76
|
+
})}>绑定</Button>
|
|
77
|
+
];
|
|
78
|
+
}}
|
|
79
|
+
/>
|
|
80
|
+
<Pagination {...pagination} />
|
|
81
|
+
|
|
82
|
+
<EditAccountDrawer
|
|
83
|
+
open={editAccountOpen} // 状态
|
|
84
|
+
editOpenStatus={setEditAccountOpen} //修改弹框显隐事件
|
|
85
|
+
rolelistRoleData={rolelistRoleData} //总角色
|
|
86
|
+
roleCheckData={roleCheckData} //当前角色选中数据
|
|
87
|
+
isBoundRolesFunc={isBoundRolesFunc}
|
|
88
|
+
></EditAccountDrawer>
|
|
89
|
+
</Pagecontainer>
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -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={() => {
|