feat: 表格增加手动刷新按钮

This commit is contained in:
ssongliu 2024-10-10 16:45:10 +08:00
parent 2565373db6
commit b84e4d148f
20 changed files with 56 additions and 18 deletions

View file

@ -6,6 +6,7 @@ import ErrPrompt from './error-prompt/index.vue';
import OpDialog from './del-dialog/index.vue';
import TableSearch from './table-search/index.vue';
import TableSetting from './table-setting/index.vue';
import TableRefresh from './table-refresh/index.vue';
import Tooltip from '@/components/tooltip/index.vue';
import CopyButton from '@/components/copy-button/index.vue';
import MsgInfo from '@/components/msg-info/index.vue';
@ -22,6 +23,7 @@ export default {
app.component(CopyButton.name, CopyButton);
app.component(TableSearch.name, TableSearch);
app.component(TableSetting.name, TableSetting);
app.component(TableRefresh.name, TableRefresh);
app.component(MsgInfo.name, MsgInfo);
app.component(MainDiv.name, MainDiv);
app.component(DrawerPro.name, DrawerPro);

View file

@ -0,0 +1,19 @@
<template>
<el-button class="fresh-button" icon="Refresh" @click="onRefresh"></el-button>
</template>
<script setup lang="ts">
defineOptions({ name: 'TableRefresh' });
const emit = defineEmits(['search']);
const onRefresh = () => {
emit('search');
};
</script>
<style lang="scss" scoped>
.fresh-button {
float: right;
}
</style>

View file

@ -2,7 +2,7 @@
<div>
<el-popover placement="bottom-start" :width="200" trigger="click">
<template #reference>
<el-button class="timer-button" icon="Refresh"></el-button>
<el-button class="timer-button" icon="Clock"></el-button>
</template>
<el-select v-model="refreshRate" @change="changeRefresh">
<template #prefix>{{ $t('commons.table.refreshRate') }}</template>

View file

@ -31,7 +31,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="compose-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -106,6 +106,7 @@
{{ $t('container.includeAppstore') }}
</el-checkbox>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="container-refresh" @search="refresh()" class="mr-2.5" />
<fu-table-column-select
:columns="columns"

View file

@ -26,7 +26,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="image-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search" :heightDiff="300">

View file

@ -20,7 +20,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="network-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -14,7 +14,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="repo-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -17,7 +17,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="template-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -20,7 +20,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="volume-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -27,7 +27,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="cronjob-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -28,7 +28,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="firewall-forward-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -35,7 +35,8 @@
<el-option :label="$t('firewall.deny')" value="drop"></el-option>
</el-select>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="firewall-ip-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -57,7 +57,8 @@
<el-option :label="$t('firewall.drop')" value="drop"></el-option>
</el-select>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="firewall-port-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable

View file

@ -12,8 +12,9 @@
<el-option :label="$t('commons.status.success')" value="Success"></el-option>
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
</el-select>
<TableSetting @search="search()" class="mr-2.5" />
<TableSearch @search="search()" v-model:searchName="searchInfo" />
<TableSearch @search="search()" v-model:searchName="searchInfo" class="mr-2.5" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="ssh-log-refresh" @search="search()" />
</template>
<template #main>

View file

@ -17,7 +17,8 @@
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
</el-select>
<TableSearch @search="search()" v-model:searchName="searchIP" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="login-log-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search" :heightDiff="370">

View file

@ -32,7 +32,8 @@
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
</el-select>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="operation-log-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search" :heightDiff="370">

View file

@ -12,7 +12,8 @@
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
<el-option :label="$t('logs.taskRunning')" value="Running"></el-option>
</el-select>
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="task-log-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search" :heightDiff="370">

View file

@ -8,7 +8,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="paginationConfig.name" class="mr-2.5" />
<TableSetting @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="backup-account-refresh" @search="search()" />
</template>
<template #main>
<el-alert type="info" :closable="false" class="common-div">

View file

@ -17,7 +17,8 @@
</template>
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" class="mr-2.5" />
<TableSetting ref="timerRef" @search="search()" />
<TableRefresh @search="search()" class="mr-2.5" />
<TableSetting title="snapshot-refresh" ref="timerRef" @search="search()" />
</template>
<template #main>
<ComplexTable