style: 表格头按钮响应式

This commit is contained in:
TsMask
2023-12-12 12:14:20 +08:00
parent d9ec9fd1e1
commit 63e3f352b2
2 changed files with 35 additions and 53 deletions

View File

@@ -93,60 +93,46 @@ body .ant-pro-basicLayout {
padding: 6px !important;
}
/** ==== 表格头按钮区域 S === **/
/* 默认 */
.button-container {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin-bottom: 20px;
justify-content: flex-start;
align-items: center;
}
.primary-button,
.danger-button,
.dashed-button {
margin-bottom: 10px;
margin-right: 10px;
.button-container > button {
margin-right: 12px;
margin-bottom: 12px;
}
.primary-button:last-child,
.danger-button:last-child,
.dashed-button:last-child {
.button-container > button:last-child {
margin-right: 0;
}
.primary-button,
.danger-button,
.dashed-button {
padding: 8px 16px;
}
.primary-button {
background-color: #1890ff;
color: #fff;
border: none;
}
.danger-button {
background-color: #ff4d4f;
color: #fff;
border: none;
}
.dashed-button {
background-color: #f0f2f5;
color: #333;
border: 1px dashed #ccc;
}
@media (max-width: 768px) {
/* 平板端 */
@media (max-width: 992px) {
.button-container {
flex-direction: column;
flex-direction: row;
align-items: flex-start;
align-items: center;
}
.primary-button,
.danger-button,
.dashed-button {
margin-right: 0;
.button-container > button {
margin-right: 12px;
margin-bottom: 12px;
}
}
/* 手机端 */
@media (max-width: 576px) {
.button-container {
flex-direction: column;
align-items: flex-start;
align-items: center;
}
.button-container > button {
margin-right: 0px;
margin-bottom: 12px;
}
}
/** ==== 表格头按钮区域 E === **/
</style>

View File

@@ -962,16 +962,15 @@ onMounted(() => {
<a-card :bordered="false" :body-style="{ padding: '0px' }">
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<div class="button-container">
<a-button type="primary" class="primary-button" @click.prevent="fnModalVisibleByEdit()">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<template #icon>
<PlusOutlined />
</template>
{{ t('common.addText') }}
</a-button>
<a-button type="primary" class="primary-button" @click.prevent="fnModalVisibleByBatch(1)">
<a-button type="primary" @click.prevent="fnModalVisibleByBatch(1)">
<template #icon>
<PlusOutlined />
</template>
@@ -981,7 +980,6 @@ onMounted(() => {
type="primary"
danger
ghost
class="danger-button"
@click.prevent="fnModalVisibleByBatch(0)"
>
<template #icon>
@@ -999,7 +997,6 @@ onMounted(() => {
<a-button
type="dashed"
danger
class="dashed-button"
:disabled="modalState.loadDataLoading"
:loading="modalState.loadDataLoading"
>
@@ -1010,7 +1007,7 @@ onMounted(() => {
</a-button>
</a-popconfirm>
<a-button type="dashed" class="dashed-button" @click.prevent="fnModalUploadImportOpen">
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
<template #icon>
<ImportOutlined />
</template>
@@ -1034,12 +1031,11 @@ onMounted(() => {
</a-button>
</a-popconfirm>
</div>
</a-space>
</template>
<!-- 插槽-卡片右侧 -->
<template #extra>
<a-space :size="8" align="center">
<div class="button-container">
<a-tooltip>
<template #title>{{ t('common.searchBarText') }}</template>
<a-switch
@@ -1092,7 +1088,7 @@ onMounted(() => {
</template>
</a-dropdown>
</a-tooltip>
</a-space>
</div>
</template>
<!-- 表格列表 -->