style(system/dict): 优化字典管理页面布局与样式

1. 重构搜索区域为卡片标题栏和内联搜索栏
2. 调整页面内边距与搜索栏间距样式
3. 统一按钮图标插槽写法
4. 移除冗余less语法并简化样式结构
This commit is contained in:
andyesfly committed 2026-08-19 15:57:44 +08:00
1 parent 5ff31e4582
commit cbc0a936b7
1 file changed
+34 -36
+34 -36
View File
@@ -1,49 +1,45 @@
<template> <template>
<div class="dict-management"> <div class="dict-management">
<a-card :bordered="false"> <a-card title="数据字典">
<a-form layout="inline" :model="queryParams" class="search-form"> <template #extra>
<a-form-item label="字典类型"> <a-button type="primary" @click="handleAdd">
<template #icon><PlusOutlined /></template>
新增字典
</a-button>
</template>
<div class="search-bar">
<a-select <a-select
v-model:value="queryParams.dictType" v-model:value="queryParams.dictType"
placeholder="请选择字典类型" placeholder="字典类型"
allow-clear allow-clear
style="width: 200px" style="width: 200px"
> >
<a-select-option v-for="type in dictTypeOptions" :key="type" :value="type">{{ type }}</a-select-option> <a-select-option v-for="type in dictTypeOptions" :key="type" :value="type">{{ type }}</a-select-option>
</a-select> </a-select>
</a-form-item> <a-input
<a-form-item label="关键词"> v-model:value="queryParams.keyword"
<a-input v-model:value="queryParams.keyword" placeholder="字典标签/值" allow-clear style="width: 200px" @pressEnter="handleSearch" /> placeholder="字典标签/值"
</a-form-item> allow-clear
<a-form-item label="状态"> style="width: 200px"
<a-select v-model:value="queryParams.status" placeholder="请选择状态" allow-clear style="width: 120px"> @pressEnter="handleSearch"
>
<template #prefix><SearchOutlined /></template>
</a-input>
<a-select v-model:value="queryParams.status" placeholder="状态" allow-clear style="width: 120px">
<a-select-option :value="1">启用</a-select-option> <a-select-option :value="1">启用</a-select-option>
<a-select-option :value="0">禁用</a-select-option> <a-select-option :value="0">禁用</a-select-option>
</a-select> </a-select>
</a-form-item>
<a-form-item>
<a-space>
<a-button type="primary" @click="handleSearch"> <a-button type="primary" @click="handleSearch">
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
搜索 查询
</a-button> </a-button>
<a-button @click="handleReset"> <a-button @click="handleReset">
<template #icon><ReloadOutlined /></template> <template #icon><ReloadOutlined /></template>
重置 重置
</a-button> </a-button>
</a-space>
</a-form-item>
</a-form>
</a-card>
<div class="table-operations">
<a-button type="primary" @click="handleAdd">
<template #icon><PlusOutlined /></template>
新增字典
</a-button>
</div> </div>
<a-card :bordered="false">
<a-table <a-table
:columns="columns" :columns="columns"
:data-source="dataSource" :data-source="dataSource"
@@ -66,7 +62,8 @@
<template v-else-if="column.key === 'action'"> <template v-else-if="column.key === 'action'">
<a-space> <a-space>
<a-button type="link" size="small" @click="handleEdit(record)"> <a-button type="link" size="small" @click="handleEdit(record)">
<EditOutlined />编辑 <template #icon><EditOutlined /></template>
编辑
</a-button> </a-button>
<a-popconfirm <a-popconfirm
title="确定删除该字典?" title="确定删除该字典?"
@@ -75,7 +72,8 @@
@confirm="handleDelete(record)" @confirm="handleDelete(record)"
> >
<a-button type="link" size="small" danger> <a-button type="link" size="small" danger>
<DeleteOutlined />删除 <template #icon><DeleteOutlined /></template>
删除
</a-button> </a-button>
</a-popconfirm> </a-popconfirm>
</a-space> </a-space>
@@ -346,23 +344,23 @@ async function handleDelete(record: DictItem) {
} }
</script> </script>
<style scoped lang="less"> <style scoped>
.dict-management { .dict-management {
padding: 24px; padding: 20px;
.search-form {
margin-bottom: 16px;
} }
.table-operations { .search-bar {
margin-bottom: 16px; margin-bottom: 16px;
display: flex; display: flex;
justify-content: space-between; justify-content: flex-end;
align-items: center; gap: 8px;
}
:deep(.ant-table) {
font-size: 14px;
} }
:deep(.ant-btn-link) { :deep(.ant-btn-link) {
padding: 0 4px; padding: 0 4px;
} }
}
</style> </style>