feat: 优化列表布局

master
绝弹 2023-08-07 21:49:54 +08:00
parent 89b1de9b02
commit dc178f5b60
4 changed files with 49 additions and 21 deletions

View File

@ -103,7 +103,7 @@ const onSubmitClick = async () => {
loading.value = true; loading.value = true;
const res = await api.auth.login(model); const res = await api.auth.login(model);
userStore.setUser(res.data.data); userStore.setUser(res.data.data);
Message.success(`欢迎回来,${res.data.data.username}!`); Message.success(`欢迎回来,${res.data.data.nickname}!`);
router.push({ path: (route.query.redirect as string) || "/" }); router.push({ path: (route.query.redirect as string) || "/" });
} catch (error: any) { } catch (error: any) {
const message = error?.response?.data?.message; const message = error?.response?.data?.message;

View File

@ -3,7 +3,7 @@
<template #content> <template #content>
<AList class="mx-5 mt-3 bg-white" :bordered="true"> <AList class="mx-5 mt-3 bg-white" :bordered="true">
<template #header> <template #header>
<div class="flex gap-2 items-center justify-between text-sm bg-gray-50 px-5 py-4"> <div class="flex gap-2 items-center justify-between text-sm bg-[#fbfbfc] px-5 py-2">
<div class="flex gap-4"> <div class="flex gap-4">
<ACheckbox></ACheckbox> <ACheckbox></ACheckbox>
<AInput class="inline-block w-80" placeholder="输入名称关键字"></AInput> <AInput class="inline-block w-80" placeholder="输入名称关键字"></AInput>
@ -15,14 +15,18 @@
<i class="icon-park-outline-down"></i> <i class="icon-park-outline-down"></i>
</span> </span>
<template #content> <template #content>
<ADoption> <ADoption class="!hover:bg-transparent !px-0 flex">
<div class="border-b border-gray-200 w-full pb-1">
<AInput placeholder="用户名关键字" /> <AInput placeholder="用户名关键字" />
</div>
</ADoption> </ADoption>
<ADoption> <ADoption v-for="j in 10">
<AAvatar :size="20"> <div class="flex items-center gap-1 w-48">
<AAvatar :size="20" class="mr-1">
<img src="https://picsum.photos/seed/picsum/200/300" alt="" /> <img src="https://picsum.photos/seed/picsum/200/300" alt="" />
</AAvatar> </AAvatar>
绝弹土豆 绝弹土豆
</div>
</ADoption> </ADoption>
</template> </template>
</ADropdown> </ADropdown>
@ -33,7 +37,7 @@
</span> </span>
<template #content> <template #content>
<ADoption> <ADoption>
<div class="w-40">默认</div> <div class="w-48">默认</div>
</ADoption> </ADoption>
<ADoption> <ADoption>
<template #icon> <template #icon>
@ -102,13 +106,18 @@
绝弹 绝弹
</span> </span>
<span class="text-xs text-gray-400">2023-08-17 17:00:01</span> <span class="text-xs text-gray-400">2023-08-17 17:00:01</span>
<ADropdown> <ADropdown @select="onRowActionsSelect">
<span class="inline-flex p-1 hover:bg-slate-100 rounded cursor-pointer"> <span class="inline-flex p-1 hover:bg-slate-100 rounded cursor-pointer">
<i class="icon-park-outline-more"></i> <i class="icon-park-outline-more"></i>
</span> </span>
<template #content> <template #content>
<ADoption class="w-32"> <div class="w-32">详情</div> </ADoption> <ADoption value="detail" class="w-32">
<ADoption class="!text-red-500 !hover-bg-red-50"> <template #icon>
<i class="icon-park-outline-repair"></i>
</template>
<div class="w-32">详情</div>
</ADoption>
<ADoption value="delete" class="!text-red-500 !hover-bg-red-50">
<template #icon> <template #icon>
<i class="icon-park-outline-delete"></i> <i class="icon-park-outline-delete"></i>
</template> </template>
@ -123,16 +132,39 @@
</bread-page> </bread-page>
</template> </template>
<script setup lang="ts"></script> <script setup lang="tsx">
import { Modal } from "@arco-design/web-vue";
const onRowActionsSelect = () => {
Modal.open({
title: "提示",
titleAlign: "start",
width: 432,
content: "确定删除该文件吗?该操作不可恢复。",
maskClosable: false,
closable: false,
okText: "确定删除",
okButtonProps: {
status: "danger",
},
});
};
</script>
<style lang="less"> <style lang="less">
#list-page { #list-page {
.arco-list-header { .arco-list-header {
padding: 0; padding: 0;
} }
.arco-dropdown-list { }
padding: 0 4px; // .arco-dropdown-list {
} // padding: 0 4px;
// .arco-dropdown-option {
// border-radius: 4px;
// }
// }
.arco-list-medium .arco-list-content-wrapper .arco-list-content > .arco-list-item {
padding: 4px 20px;
} }
</style> </style>

View File

@ -9,6 +9,4 @@
[class^="icon-"] { [class^="icon-"] {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 16px;
height: 16px;
} }

View File

@ -14,7 +14,6 @@ declare module '@vue/runtime-core' {
ACheckbox: typeof import('@arco-design/web-vue')['Checkbox'] ACheckbox: typeof import('@arco-design/web-vue')['Checkbox']
AConfigProvider: typeof import('@arco-design/web-vue')['ConfigProvider'] AConfigProvider: typeof import('@arco-design/web-vue')['ConfigProvider']
ADoption: typeof import('@arco-design/web-vue')['Doption'] ADoption: typeof import('@arco-design/web-vue')['Doption']
ADot: typeof import('@arco-design/web-vue')['Dot']
ADrawer: typeof import('@arco-design/web-vue')['Drawer'] ADrawer: typeof import('@arco-design/web-vue')['Drawer']
ADropdown: typeof import('@arco-design/web-vue')['Dropdown'] ADropdown: typeof import('@arco-design/web-vue')['Dropdown']
AForm: typeof import('@arco-design/web-vue')['Form'] AForm: typeof import('@arco-design/web-vue')['Form']
@ -32,7 +31,6 @@ declare module '@vue/runtime-core' {
AListItemMeta: typeof import('@arco-design/web-vue')['ListItemMeta'] AListItemMeta: typeof import('@arco-design/web-vue')['ListItemMeta']
AMenu: typeof import('@arco-design/web-vue')['Menu'] AMenu: typeof import('@arco-design/web-vue')['Menu']
AMenuItem: typeof import('@arco-design/web-vue')['MenuItem'] AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']
APopover: typeof import('@arco-design/web-vue')['Popover']
ASpace: typeof import('@arco-design/web-vue')['Space'] ASpace: typeof import('@arco-design/web-vue')['Space']
ASubMenu: typeof import('@arco-design/web-vue')['SubMenu'] ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']
ATag: typeof import('@arco-design/web-vue')['Tag'] ATag: typeof import('@arco-design/web-vue')['Tag']