MCPcopy Create free account
hub / github.com/chunshand/qdev / useTable

Function useTable

admin/src/components/Qdev/Table/hook.ts:11–278  ·  view source on GitHub ↗
(props: {
  options: defaultTableOptions
}, { QdevFormRef }: { QdevFormRef: Ref })

Source from the content-addressed store, hash-verified

9 * 表格处理
10 */
11export const useTable = (props: {
12 options: defaultTableOptions
13}, { QdevFormRef }: { QdevFormRef: Ref }) => {
14 /**
15 * 弹窗Name
16 */
17 const modalName = computed(() => {
18 return props ? props.options.ModalConfig.modalName : '';
19 })
20 /**
21 * 列表加载装填
22 */
23 const loading = ref<boolean>(false)
24 /**
25 * 分页
26 */
27 const { paginationData, handleCurrentChange, handleSizeChange } = usePagination()
28
29 /**
30 * 修改对象的主键 临时变量
31 */
32 const currentUpdateId = ref<undefined | string | number>(undefined)
33
34 /**
35 * 表格数据
36 */
37 const tableData = ref<any[]>([])
38
39 /**
40 * 搜索区 ref
41 */
42 const searchFormRef = ref<FormInstance | null>(null)
43
44 /**
45 * 搜索数据
46 */
47 const searchData = ref({})
48
49 /**
50 * 固定参数 应对外部设置进来的固定参数
51 */
52 const fixedData = ref({})
53
54 const handleSetFixedData = (value: any) => {
55 fixedData.value = value;
56 }
57 /**
58 * 获取列表数据
59 */
60 const handleGetTableData = async () => {
61 loading.value = true
62 try {
63 let data: any = {};
64 // 存在分页则添加分页参数
65 if (props.options.PaginationConfig.IsPagination) {
66 data.currentPage = paginationData.currentPage;
67 data.pageSize = paginationData.pageSize;
68 }

Callers

nothing calls this directly

Calls 3

usePaginationFunction · 0.90
useTransformOnBindFunction · 0.90
handleInitLoadDataFunction · 0.85

Tested by

no test coverage detected