1- import React , { useEffect , useState } from 'react' ;
2- import {
3- MenuFoldOutlined ,
4- MenuUnfoldOutlined ,
5- UploadOutlined ,
6- UserOutlined ,
7- VideoCameraOutlined ,
8- } from '@ant-design/icons' ;
9- import { Button , Layout , Menu , theme } from 'antd' ;
10- import { invokeIpcMethod } from './utils/ipcUtils' ;
1+ import React from 'react' ;
2+ import LoginPage , { Username , Password , Submit , Title , Logo , Reset } from '@react-login-page/page1' ;
3+ import LoginLogo from 'react-login-page/logo' ;
114
12- const { Header , Sider , Content } = Layout ;
5+ const styles = { height : "100vh" , width : "100vw" } ;
136
14- const App : React . FC = ( ) => {
15- const [ collapsed , setCollapsed ] = useState ( false ) ;
16- const {
17- token : { colorBgContainer, borderRadiusLG } ,
18- } = theme . useToken ( ) ;
7+ const Demo = ( ) => (
8+ < div style = { styles } >
9+ < LoginPage >
10+ < Username name = "userUserName" />
11+ < Password placeholder = "请输入密码" name = "userPassword" />
12+ < Submit > 提交</ Submit >
13+ < Reset disabled > 重置</ Reset >
14+ < Title />
15+ < Logo >
16+ < LoginLogo />
17+ </ Logo >
18+ </ LoginPage >
19+ </ div >
20+ ) ;
1921
20- useEffect ( ( ) => {
21- const getAreaList = async ( ) => {
22- const mysql = await invokeIpcMethod ( "mysqlQuery" , "SELECT * from tz_basket tb " )
23- console . log ( mysql ) ;
24- }
25- getAreaList ( ) ;
26- } , [ ] )
27-
28- return (
29- < Layout >
30- < Button onClick = { async ( ) => {
31- const mysql = await invokeIpcMethod ( 'SELECT * from tz_area ta ' )
32- console . log ( mysql ) ;
33-
34- } } > mysql</ Button >
35- < Sider trigger = { null } collapsible collapsed = { collapsed } >
36- < div className = "demo-logo-vertical" />
37- < Menu
38- theme = "dark"
39- mode = "inline"
40- defaultSelectedKeys = { [ '1' ] }
41- items = { [
42- {
43- key : '1' ,
44- icon : < UserOutlined /> ,
45- label : 'nav 1' ,
46- } ,
47- {
48- key : '2' ,
49- icon : < VideoCameraOutlined /> ,
50- label : 'nav 2' ,
51- } ,
52- {
53- key : '3' ,
54- icon : < UploadOutlined /> ,
55- label : 'nav 3' ,
56- } ,
57- ] }
58- />
59- </ Sider >
60- < Layout >
61- < Header style = { { padding : 0 , background : colorBgContainer } } >
62- < Button
63- type = "text"
64- icon = { collapsed ? < MenuUnfoldOutlined /> : < MenuFoldOutlined /> }
65- onClick = { ( ) => setCollapsed ( ! collapsed ) }
66- style = { {
67- fontSize : '16px' ,
68- width : 64 ,
69- height : 64 ,
70- } }
71- />
72- </ Header >
73- < Content
74- style = { {
75- margin : '24px 16px' ,
76- padding : 24 ,
77- minHeight : 280 ,
78- background : colorBgContainer ,
79- borderRadius : borderRadiusLG ,
80- } }
81- >
82- Content
83- </ Content >
84- </ Layout >
85- </ Layout >
86- ) ;
87- } ;
88-
89- export default App ;
22+ export default Demo ;
0 commit comments