feat: 优化布局

master
绝弹 2023-10-16 22:15:47 +08:00
parent 8c0c5037b5
commit 649ca40f12
9 changed files with 117 additions and 87 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="h-full grid grid-rows-[auto_1fr]"> <div class="h-full grid grid-rows-[auto_1fr]">
<div class="bg-white dark:bg-gray-800 px-4 py-2"> <div class="bg-[#f8f8f8] dark:bg-gray-800 px-4 py-2">
<div class="flex justify-between gap-4"> <div class="flex justify-between gap-4">
<BreadCrumb></BreadCrumb> <BreadCrumb></BreadCrumb>
<div> <div>
@ -9,7 +9,7 @@
</div> </div>
</div> </div>
<slot name="content"> <slot name="content">
<div class="m-4 p-4 bg-white dark:bg-gray-700"> <div class="w-full h-full overflow-hidden p-6">
<slot></slot> <slot></slot>
</div> </div>
</slot> </slot>

View File

@ -8,6 +8,7 @@
{{ userStore.nickname }} {{ userStore.nickname }}
</span> </span>
<i class="icon-park-outline-down"></i> <i class="icon-park-outline-down"></i>
<password-modal></password-modal>
</span> </span>
<template #content> <template #content>
<a-doption> <a-doption>
@ -22,7 +23,7 @@
</div> </div>
</a-doption> </a-doption>
<a-divider :margin="4"></a-divider> <a-divider :margin="4"></a-divider>
<a-doption> <a-doption @click="password.open()">
<template #icon> <template #icon>
<i class="icon-park-outline-lock"></i> <i class="icon-park-outline-lock"></i>
</template> </template>
@ -46,6 +47,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useAniFormModal } from "@/components";
import { useUserStore } from "@/store"; import { useUserStore } from "@/store";
import { Message } from "@arco-design/web-vue"; import { Message } from "@arco-design/web-vue";
@ -58,6 +60,40 @@ const logout = async () => {
Message.success("提示:已退出登陆!"); Message.success("提示:已退出登陆!");
router.push({ path: "/login", query: { redirect: route.path } }); router.push({ path: "/login", query: { redirect: route.path } });
}; };
const [PasswordModal, password] = useAniFormModal({
title: "修改密码",
trigger: false,
modalProps: {
width: 452,
},
items: [
{
field: "password",
label: "原密码",
type: "input",
nodeProps: {
placeholder: "请输入原密码",
},
},
{
field: "password1",
label: "新密码",
type: "input",
nodeProps: {
placeholder: "请输入新密码",
},
},
{
field: "password2",
label: "确认密码",
type: "input",
nodeProps: {
placeholder: "请再次输入新密码",
},
},
],
});
</script> </script>
<style scoped></style> <style scoped></style>

View File

@ -1,7 +1,7 @@
<template> <template>
<a-layout class="layout"> <a-layout class="layout">
<a-layout-header <a-layout-header
class="h-13 overflow-hidden flex justify-between items-center gap-4 px-2 pr-4 border-b border-slate-200 bg-white dark:bg-slate-800 dark:border-slate-700" class="h-13 overflow-hidden flex justify-between items-center gap-4 px-2 pr-4 bg-[#dddddd] dark:bg-slate-800"
> >
<div class="h-13 flex items-center border-b border-slate-200 dark:border-slate-800"> <div class="h-13 flex items-center border-b border-slate-200 dark:border-slate-800">
<router-link to="/" class="px-2 py-2 rounded flex items-center gap-2 text-slate-700"> <router-link to="/" class="px-2 py-2 rounded flex items-center gap-2 text-slate-700">
@ -35,7 +35,7 @@
<a-layout class="flex flex-1 overflow-hidden"> <a-layout class="flex flex-1 overflow-hidden">
<a-layout-sider <a-layout-sider
class="h-full overflow-hidden dark:bg-slate-800 border-r border-slate-200 dark:border-slate-700" class="h-full overflow-hidden !bg-[#f3f3f3] dark:bg-slate-800"
:width="224" :width="224"
:collapsed-width="52" :collapsed-width="52"
:collapsible="true" :collapsible="true"
@ -55,8 +55,8 @@
></i> ></i>
</template> </template>
</a-layout-sider> </a-layout-sider>
<a-layout class="layout-content flex-1"> <a-layout class="layout-content flex-1 bg-white">
<a-layout-header class="h-8 bg-white border-b border-slate-200 dark:bg-slate-800 dark:border-slate-700"> <a-layout-header class="h-8 bg-[#ececec] dark:bg-slate-800">
<div class="h-full flex items-center justify-between gap-2 px-4"> <div class="h-full flex items-center justify-between gap-2 px-4">
<div class="space-x-2"> <div class="space-x-2">
<a-tag <a-tag
@ -83,7 +83,7 @@
</div> </div>
</a-layout-header> </a-layout-header>
<a-layout-content class="overflow-x-auto"> <a-layout-content class="overflow-x-auto">
<a-spin :loading="appStore.pageLoding" tip="加载中,请稍等..." class="block h-full w-full"> <a-spin :loading="appStore.pageLoding" tip="页面加载中,请稍等..." class="block h-full w-full">
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
<component :is="Component"></component> <component :is="Component"></component>
</router-view> </router-view>
@ -246,7 +246,6 @@ const tagItems = [
// //
// min-height: 100vh; // min-height: 100vh;
overflow-y: hidden; overflow-y: hidden;
background-color: var(--color-fill-2);
transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 1); transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
} }
</style> </style>

View File

@ -19,7 +19,7 @@
{ {
"meta": { "meta": {
"sort": 10001, "sort": 10001,
"title": "首页", "title": "概览",
"icon": "icon-park-outline-home" "icon": "icon-park-outline-home"
} }
} }

View File

@ -1,9 +1,8 @@
<template> <template>
<BreadPage> <BreadPage>
<template #content> <div class="overflow-hidden grid grid-cols-[auto_auto_1fr]">
<div class="overflow-hidden grid grid-cols-[auto_auto_1fr] m-4 p-4 bg-white">
<div class="w-[210px] h-full overflow-hidden grid grid-rows-[auto_1fr]"> <div class="w-[210px] h-full overflow-hidden grid grid-rows-[auto_1fr]">
<div class="flex gap-2 pr-2"> <div class="flex gap-2 pr-4">
<a-input-search allow-clear placeholder="分组名称..." class="mb-2"></a-input-search> <a-input-search allow-clear placeholder="分组名称..." class="mb-2"></a-input-search>
<a-button> <a-button>
<template #icon> <template #icon>
@ -14,7 +13,7 @@
<a-scrollbar outer-class="h-full overflow-hidden" class="h-full overflow-auto"> <a-scrollbar outer-class="h-full overflow-hidden" class="h-full overflow-auto">
<ul class="pr-4 pl-0 mt-0"> <ul class="pr-4 pl-0 mt-0">
<li <li
v-for="i in 50" v-for="i in 5"
class="group flex items-center justify-between gap-2 h-8 rounded mb-2 pl-3 hover:bg-gray-100 cursor-pointer" class="group flex items-center justify-between gap-2 h-8 rounded mb-2 pl-3 hover:bg-gray-100 cursor-pointer"
> >
<div> <div>
@ -65,7 +64,6 @@
</Table> </Table>
</div> </div>
</div> </div>
</template>
</BreadPage> </BreadPage>
</template> </template>

View File

@ -13,7 +13,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="flex gap-4 mt-6 px-6"> <div class="flex gap-4">
<div class="flex-1 bg-white p-4"> <div class="flex-1 bg-white p-4">
<a-form :model="{}" layout="vertical"> <a-form :model="{}" layout="vertical">
<a-form-item label="标题"> <a-form-item label="标题">

View File

@ -1,13 +1,11 @@
<template> <template>
<BreadPage> <BreadPage>
<template #content> <div class="">
<div class="p-4"> <a-alert :closable="true" class="mb-4"> 仅展示近 90 天内的数据如需查看更多数据请联系管理员 </a-alert>
<a-alert :closable="true" class="mb-2"> 仅展示近 90 天内的数据如需查看更多数据请联系管理员 </a-alert> <div class="">
<div class="bg-white p-4">
<Table v-bind="table"></Table> <Table v-bind="table"></Table>
</div> </div>
</div> </div>
</template>
</BreadPage> </BreadPage>
</template> </template>

View File

@ -1,6 +1,5 @@
<template> <template>
<BreadPage> <BreadPage>
<a-button @click="roleCtx.refresh()"></a-button>
<role-table></role-table> <role-table></role-table>
</BreadPage> </BreadPage>
</template> </template>

View File

@ -34,7 +34,7 @@ body {
box-shadow: none; box-shadow: none;
} }
.arco-menu, .arco-menu,
.arco-menu-item { .arco-menu-light .arco-menu-item {
background-color: transparent; background-color: transparent;
} }
.arco-menu-group-title { .arco-menu-group-title {
@ -68,10 +68,10 @@ body {
background-color: var(--color-neutral-2); background-color: var(--color-neutral-2);
} }
&.arco-menu-selected { &.arco-menu-selected {
color: @arcoblue-6; // color: @arcoblue-6;
background-color: @arcoblue-1; // background-color: @arcoblue-1;
// color: #fff; color: #fff;
// background-color: @arcoblue-6; background-color: rgb(var(--primary-6));
.arco-menu-icon { .arco-menu-icon {
color: inherit; color: inherit;
} }