feat: useTable 支持 “无分页” 列表

This commit is contained in:
2024-05-11 22:26:33 +08:00
parent fe656af1aa
commit 1421412d67
13 changed files with 154 additions and 193 deletions

View File

@@ -13,17 +13,17 @@
@refresh="search"
>
<template #custom-left>
<a-button v-permission="['system:dict:add']" type="primary" @click="onAdd">
<template #icon><icon-plus /></template>
<span>新增</span>
</a-button>
</template>
<template #custom-right>
<a-input v-model="queryForm.description" placeholder="请输入关键词" allow-clear @change="search">
<template #prefix><icon-search /></template>
</a-input>
<a-button @click="reset">重置</a-button>
</template>
<template #custom-right>
<a-button v-permission="['system:dict:add']" type="primary" @click="onAdd">
<template #icon><icon-plus /></template>
<span>新增</span>
</a-button>
</template>
<template #isSystem="{ record }">
<a-tag v-if="record.isSystem" color="red"></a-tag>
<a-tag v-else color="arcoblue"></a-tag>
@@ -74,12 +74,6 @@ const {
handleDelete
} = useTable((p) => listDict({ ...queryForm, page: p.page, size: p.size }), { immediate: true })
// 重置
const reset = () => {
queryForm.description = undefined
search()
}
const columns: TableInstanceColumns[] = [
{
title: '序号',
@@ -105,6 +99,12 @@ const columns: TableInstanceColumns[] = [
}
]
// 重置
const reset = () => {
queryForm.description = undefined
search()
}
// 删除
const onDelete = (item: DictResp) => {
return handleDelete(() => deleteDict(item.id), { content: `是否确定删除字典 [${item.name}]`, showModal: true })