This commit is contained in:
43
src/components/business/package-silence/SilenceTable.vue
Normal file
43
src/components/business/package-silence/SilenceTable.vue
Normal file
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<ArtTableHeader v-model:columns="columnChecks" @refresh="$emit('refresh')"
|
||||
><template #left><slot name="toolbar" /></template
|
||||
></ArtTableHeader>
|
||||
<ArtTable
|
||||
:data="rows"
|
||||
:loading="loading"
|
||||
:row-key="rowKey || 'id'"
|
||||
:pagination="total != null"
|
||||
:current-page="page || 1"
|
||||
:page-size="size || 20"
|
||||
:total="total || 0"
|
||||
:margin-top="10"
|
||||
@current-change="(value) => $emit('page', value)"
|
||||
@size-change="(value) => $emit('size', value)"
|
||||
>
|
||||
<ElTableColumn
|
||||
v-for="column in columns"
|
||||
:key="column.prop"
|
||||
:prop="column.prop"
|
||||
:label="column.label"
|
||||
:min-width="column.width || 170"
|
||||
show-overflow-tooltip
|
||||
><template #default="{ row }">{{ silenceDisplay(row, column.prop) }}</template></ElTableColumn
|
||||
>
|
||||
<slot />
|
||||
</ArtTable>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useGatewayColumns } from '@/composables/useGateway'
|
||||
import { silenceDisplay } from '@/utils/business/silenceExtension'
|
||||
const props = defineProps<{
|
||||
rows: object[]
|
||||
rowKey?: string
|
||||
definitions: { prop: string; label: string; width?: number }[]
|
||||
loading?: boolean
|
||||
page?: number
|
||||
size?: number
|
||||
total?: number
|
||||
}>()
|
||||
defineEmits<{ refresh: []; page: [number]; size: [number] }>()
|
||||
const { columns, columnChecks } = useGatewayColumns(props.definitions)
|
||||
</script>
|
||||
Reference in New Issue
Block a user