style(system/dict): 优化字典管理页面布局与样式
1. 重构搜索区域为卡片标题栏和内联搜索栏 2. 调整页面内边距与搜索栏间距样式 3. 统一按钮图标插槽写法 4. 移除冗余less语法并简化样式结构
This commit is contained in:
1 parent
5ff31e4582
commit
cbc0a936b7
1 file changed
+56
-58
@@ -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">
|
||||||
<a-select
|
<template #icon><PlusOutlined /></template>
|
||||||
v-model:value="queryParams.dictType"
|
新增字典
|
||||||
placeholder="请选择字典类型"
|
</a-button>
|
||||||
allow-clear
|
</template>
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
<a-select-option v-for="type in dictTypeOptions" :key="type" :value="type">{{ type }}</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="关键词">
|
|
||||||
<a-input v-model:value="queryParams.keyword" placeholder="字典标签/值" allow-clear style="width: 200px" @pressEnter="handleSearch" />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="状态">
|
|
||||||
<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="0">禁用</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item>
|
|
||||||
<a-space>
|
|
||||||
<a-button type="primary" @click="handleSearch">
|
|
||||||
<template #icon><SearchOutlined /></template>
|
|
||||||
搜索
|
|
||||||
</a-button>
|
|
||||||
<a-button @click="handleReset">
|
|
||||||
<template #icon><ReloadOutlined /></template>
|
|
||||||
重置
|
|
||||||
</a-button>
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</a-card>
|
|
||||||
|
|
||||||
<div class="table-operations">
|
<div class="search-bar">
|
||||||
<a-button type="primary" @click="handleAdd">
|
<a-select
|
||||||
<template #icon><PlusOutlined /></template>
|
v-model:value="queryParams.dictType"
|
||||||
新增字典
|
placeholder="字典类型"
|
||||||
</a-button>
|
allow-clear
|
||||||
</div>
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<a-select-option v-for="type in dictTypeOptions" :key="type" :value="type">{{ type }}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<a-input
|
||||||
|
v-model:value="queryParams.keyword"
|
||||||
|
placeholder="字典标签/值"
|
||||||
|
allow-clear
|
||||||
|
style="width: 200px"
|
||||||
|
@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="0">禁用</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<a-button type="primary" @click="handleSearch">
|
||||||
|
<template #icon><SearchOutlined /></template>
|
||||||
|
查询
|
||||||
|
</a-button>
|
||||||
|
<a-button @click="handleReset">
|
||||||
|
<template #icon><ReloadOutlined /></template>
|
||||||
|
重置
|
||||||
|
</a-button>
|
||||||
|
</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 {
|
.search-bar {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.table-operations {
|
:deep(.ant-table) {
|
||||||
margin-bottom: 16px;
|
font-size: 14px;
|
||||||
display: flex;
|
}
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-btn-link) {
|
:deep(.ant-btn-link) {
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user