Skip to content

Commit aa9c858

Browse files
author
sunshine824
committed
布局结构调整
1 parent df91f95 commit aa9c858

File tree

10 files changed

+81
-38
lines changed

10 files changed

+81
-38
lines changed

src/App.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
import { defineComponent } from 'vue'
1+
import { defineComponent, ref } from 'vue'
22
import { RouterView } from 'vue-router'
3+
import { ConfigProvider } from 'ant-design-vue'
4+
import zhCN from 'ant-design-vue/es/locale/zh_CN'
35

46
export default defineComponent({
57
name: 'App',
68
components: { RouterView },
79
setup() {
8-
return () => <router-view />
10+
const locale = zhCN
11+
return () => (
12+
<ConfigProvider locale={locale}>
13+
<RouterView></RouterView>
14+
</ConfigProvider>
15+
)
916
},
1017
})
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.bread-crumb {
2+
display: flex;
3+
flex-flow: row nowrap;
4+
align-items: center;
5+
.location {
6+
font-size: 13px;
7+
color: rgba(0, 0, 0, 0.8);
8+
margin-right: 5px;
9+
}
10+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { defineComponent } from 'vue'
2+
import { Breadcrumb } from 'ant-design-vue'
3+
4+
import styles from './index.module.less'
5+
6+
const ABreadCrumb = defineComponent({
7+
name: 'ABreadCrumb',
8+
setup({ props }) {
9+
return () => (
10+
<div class={styles['bread-crumb']}>
11+
<span class={styles['location']}>当前位置:</span>
12+
<Breadcrumb>
13+
<Breadcrumb.Item>Home</Breadcrumb.Item>
14+
<Breadcrumb.Item>Application</Breadcrumb.Item>
15+
<Breadcrumb.Item>Center</Breadcrumb.Item>
16+
</Breadcrumb>
17+
</div>
18+
)
19+
},
20+
})
21+
22+
export default ABreadCrumb

src/components/GlobalHeader/Menus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, onMounted, ref, watch, computed } from 'vue'
1+
import { defineComponent, ref, watch, computed } from 'vue'
22
import { useRoute, useRouter, RouteRecordRaw } from 'vue-router'
33
import { Menu } from 'ant-design-vue'
44

src/components/GlobalHeader/index.module.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
}
99
:global {
1010
.ant-layout-header {
11+
background-color: #19192e;
1112
display: flex;
1213
flex-flow: row nowrap;
1314
justify-content: space-between;
1415
align-items: center;
1516
height: 54px;
1617
padding: 0 40px 0 15px;
17-
background: #1d1e1f;
1818
border-bottom: 1px solid #434343;
1919
.logo {
2020
min-width: 120px;
@@ -68,7 +68,7 @@
6868
&.horizontal-menu-class {
6969
:global {
7070
.ant-menu {
71-
background: #1d1e1f;
71+
background-color: #19192e;
7272
max-width: 700px;
7373
margin-right: 20px;
7474
.ant-menu-item {
@@ -84,7 +84,7 @@
8484
background-color: rgba(255, 255, 255, 0.7);
8585
}
8686
&-selected {
87-
background-color: #4a4b4c !important;
87+
background-color: rgba(54, 54, 80, 0.8) !important;
8888
position: relative;
8989
font-weight: 700;
9090
color: rgba(255, 255, 255, 0.9);

src/layouts/LevelBasicLayout.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ const LevelBasicLayout = defineComponent({
2929
return () => (
3030
<Layout class={styles['level-layout']}>
3131
<GlobalHeader v-slots={slots}></GlobalHeader>
32-
<Layout.Content>
33-
<RouterView />
34-
</Layout.Content>
32+
<div class={styles['level-content']}>
33+
<div class={styles['level-sub-menu']}></div>
34+
<Layout.Content>
35+
<RouterView />
36+
</Layout.Content>
37+
</div>
3538
</Layout>
3639
)
3740
},

src/layouts/RouteLayout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { defineComponent, watch, ref } from 'vue'
22
import { RouterView, useRoute } from 'vue-router'
3+
import ABreadCrumb from '@/components/ABreadCrumb'
34

45
import styles from './index.module.less'
56

@@ -22,7 +23,7 @@ const RouteLayout = defineComponent({
2223
return () => (
2324
<div class={styles['page-view']}>
2425
<div class={styles['top-info']}>
25-
<h3 class={styles['title']}>{routeName.value}</h3>
26+
<ABreadCrumb></ABreadCrumb>
2627
</div>
2728
<div class={styles['view-con']}>
2829
{props.isSubView ? <RouterView /> : slots.default?.()}

src/layouts/index.module.less

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
.level-layout {
22
padding-left: 0px;
3-
min-height: 100vh;
3+
height: 100% !important;
44
:global {
55
.ant-layout-content {
66
height: 100%;
77
}
88
}
9+
.level-content {
10+
display: flex;
11+
flex-flow: row nowrap;
12+
align-items: flex-start;
13+
height: 100%;
14+
.level-sub-menu {
15+
width: 210px;
16+
height: 100%;
17+
background: #fff;
18+
margin-right: 20px;
19+
}
20+
}
921
.user-info {
1022
min-width: 100px;
1123
display: flex;
@@ -59,32 +71,16 @@
5971
display: flex;
6072
flex-flow: column nowrap;
6173
.top-info {
62-
background: #fff;
63-
padding: 10px 10px;
64-
box-shadow: 0 2px 7px rgba(0, 21, 41, 0.08);
65-
.title {
66-
font-size: 18px;
67-
color: rgba(0, 0, 0, 0.8);
68-
display: flex;
69-
flex-flow: row nowrap;
70-
align-items: center;
71-
margin-bottom: 0;
72-
&::before {
73-
content: '';
74-
width: 4px;
75-
height: 24px;
76-
background: #1890ff;
77-
margin-right: 10px;
78-
}
79-
}
74+
background: #f0f2f5;
75+
padding: 10px 10px 10px 0;
8076
}
8177
.view-con {
8278
flex: 1;
83-
margin: 10px 10px 5px 10px;
84-
box-shadow: 0 1px 20px #c6c4c4;
85-
background: #fff;
79+
background: rgba(255, 255, 255, 0.9);
8680
border-radius: 4px;
8781
overflow-y: auto;
8882
overflow-x: hidden;
83+
padding: 10px;
84+
margin: 0 20px 10px 0;
8985
}
9086
}

src/main.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import { createApp } from 'vue'
22
import { store, key } from './store'
33
import router from './router'
4+
import moment from 'moment'
45
import App from './App'
56
import { setupAntd } from './plugins/antd'
67

7-
import '@/mock';
8+
moment.locale('zh-cn')
9+
10+
import '@/mock'
811

912
import './public/css/base.css'
1013
import './public/css/init.less'
11-
import '@/public/font/iconfont.css';
12-
import 'ant-design-vue/dist/antd.css';
14+
import '@/public/font/iconfont.css'
15+
import 'ant-design-vue/dist/antd.css'
1316

1417
const app = createApp(App)
1518

src/views/user/login/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, reactive, ref, onMounted } from 'vue'
22
import { useRouter } from 'vue-router'
3-
import { Form, Input, Button, Row, Col } from 'ant-design-vue'
3+
import { Form, Input, Button, Row, Col, message } from 'ant-design-vue'
44
import { uuid } from '@/utils/util'
55
import GlobalBg from '@/components/GlobalBg'
66
import { login } from '@/api/user.ts'
@@ -56,6 +56,7 @@ const Login = defineComponent({
5656
getCaptcha()
5757
}
5858
} catch (error) {
59+
message.warning('账号:admin 密码:666666')
5960
console.log(error)
6061
}
6162
}
@@ -92,7 +93,7 @@ const Login = defineComponent({
9293
placeholder="请输入密码"
9394
></Input>
9495
</Form.Item>
95-
<Form.Item name="captcha">
96+
{/* <Form.Item name="captcha">
9697
<Row gutter={20} class={styles['captcha-row']}>
9798
<Col span={16}>
9899
<Input
@@ -109,7 +110,7 @@ const Login = defineComponent({
109110
/>
110111
</Col>
111112
</Row>
112-
</Form.Item>
113+
</Form.Item> */}
113114
<Form.Item wrapperCol={{ span: 18, offset: 3 }}>
114115
<Button
115116
size="large"

0 commit comments

Comments
 (0)