Skip to content

Commit a9847b9

Browse files
committed
111
1 parent 88a00bd commit a9847b9

File tree

6 files changed

+22
-102
lines changed

6 files changed

+22
-102
lines changed

electron/main/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async function createWindow() {
6565
if (VITE_DEV_SERVER_URL) { // #298
6666
win.loadURL(VITE_DEV_SERVER_URL)
6767
// Open devTool if the app is not packaged
68-
win.webContents.openDevTools()
68+
// win.webContents.openDevTools()
6969
} else {
7070
win.loadFile(indexHtml)
7171
}

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"e2e": "playwright test"
2020
},
2121
"dependencies": {
22+
"@react-login-page/page1": "^1.0.4",
2223
"antd": "^5.18.0",
2324
"electron-updater": "^6.1.8",
2425
"mysql": "^2.18.1"
@@ -32,11 +33,8 @@
3233
"autoprefixer": "^10.4.18",
3334
"electron": "^29.1.1",
3435
"electron-builder": "^24.13.3",
35-
"postcss": "^8.4.35",
36-
"postcss-import": "^16.0.1",
3736
"react": "^18.2.0",
3837
"react-dom": "^18.2.0",
39-
"tailwindcss": "^3.4.1",
4038
"typescript": "^5.4.2",
4139
"vite": "^5.1.5",
4240
"vite-plugin-electron": "^0.28.4",

postcss.config.cjs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/App.tsx

Lines changed: 19 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,22 @@
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;

src/index.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
41

52
:root {
63
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('tailwindcss').Config} */
1+
22
export default {
33
content: [
44
'./index.html',

0 commit comments

Comments
 (0)