在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用table-list-patterns
星标9
分支0
更新时间2026年5月22日 05:45
表格列表页与数据展示的实现规范,包括搜索、分页、批量操作
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
表格列表页与数据展示的实现规范,包括搜索、分页、批量操作
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
生成完成后,检查代码是否符合基础质量指标
验证生成的页面在 4 个断点下的布局是否正常
生成前主动采集用户提供的参考图片或网页的设计风格,提取配色/布局/字体
API 调用模式最佳实践,包括列表查询、表单提交、数据删除等场景的异步处理规范
CSS 变量与设计 Token 体系规范,确保视觉一致性
表单校验的完整实现规范,适用于所有包含表单的页面
基于 SOC 职业分类
| name | table-list-patterns |
| description | 表格列表页与数据展示的实现规范,包括搜索、分页、批量操作 |
管理后台列表页、数据表格、搜索查询、批量操作、分页展示
<a-table> + :columns + :data-source + :paginationpagination = reactive({ current: 1, pageSize: 10, total: 0 })<a-form> 内联布局,onSearch() 统一提交并重置 current 到第 1 页rowSelection = { selectedRowKeys, onChange } + selectedRowKeystableRef.value?.scrollTo(0)fetchList() 函数,接收分页/搜索参数<a-table :loading="loading"><template #bodyCell> 做简单文本格式化,尽量用 customRenderfixed: 'right'<a-space> 排列Modal.confirm 二次确认<template>
<div>
<a-form layout="inline" :model="searchForm" @finish="onSearch">
<a-form-item name="keyword">
<a-input v-model:value="searchForm.keyword" placeholder="搜索关键词" />
</a-form-item>
<a-form-item>
<a-space>
<a-button type="primary" html-type="submit">搜索</a-button>
<a-button @click="onReset">重置</a-button>
</a-space>
</a-form-item>
</a-form>
<div style="margin-bottom: 12px">
<a-button type="primary" ghost @click="onAdd">新增</a-button>
<a-button danger :disabled="!selectedRowKeys.length" @click="onBatchDelete">
批量删除 ({{ selectedRowKeys.length }})
</a-button>
</div>
<a-table
ref="tableRef"
:columns="columns"
:data-source="list"
:loading="loading"
:row-key="(r) => r.id"
:row-selection="{ selectedRowKeys, onChange: (keys) => selectedRowKeys = keys }"
:pagination="pagination"
@change="onTableChange"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<a-space>
<a @click="onEdit(record)">编辑</a>
<a-popconfirm title="确认删除?" @confirm="onDelete(record.id)">
<a style="color: red">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</a-table>
</div>
</template>
<script setup>
import { reactive, ref, onMounted } from 'vue'
const list = ref([])
const loading = ref(false)
const selectedRowKeys = ref([])
const searchForm = reactive({ keyword: '' })
const pagination = reactive({ current: 1, pageSize: 10, total: 0 })
const columns = [
{ title: 'ID', dataIndex: 'id', width: 80 },
{ title: '名称', dataIndex: 'name' },
{ title: '状态', dataIndex: 'status' },
{ title: '创建时间', dataIndex: 'createTime' },
{ title: '操作', key: 'action', fixed: 'right', width: 150 }
]
const fetchList = async () => {
loading.value = true
try {
const res = await api.list({ ...searchForm, ...pagination })
list.value = res.records
pagination.total = res.total
} finally {
loading.value = false
}
}
const onSearch = () => {
pagination.current = 1
fetchList()
}
const onReset = () => {
searchForm.keyword = ''
onSearch()
}
const onTableChange = (pag) => {
pagination.current = pag.current
pagination.pageSize = pag.pageSize
fetchList()
}
const onBatchDelete = () => {
Modal.confirm({
title: '确认删除所选项目?',
content: `共 ${selectedRowKeys.value.length} 项将被删除`,
onOk: async () => {
await api.batchDelete(selectedRowKeys.value)
selectedRowKeys.value = []
fetchList()
}
})
}
onMounted(fetchList)
</script>