index.vue
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<div>
<BasicTable :clickToRowSelect="false" @register="registerTable">
<template #toolbar>
<Authority value="api:yt:product:category:post">
<Button type="primary" @click="handleCreate">
{{ t('inspection.servicePlan.createCategoryText') }}
</Button>
</Authority>
</template>
</BasicTable>
</div>
</template>
<script setup lang="ts">
import { useTable } from '/@/components/Table';
import { getRepairOrderList } from '/@/api/repair/order';
import { columns, searchFormSchema } from './index';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const [
registerTable,
{ reload, setLoading, getSelectRowKeys, setSelectedRowKeys, getRowSelection },
] = useTable({
title: t('inspection.servicePlan.listText'),
api: getRepairOrderList,
columns,
formConfig: {
labelWidth: 100,
schemas: searchFormSchema,
},
immediate: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: false,
clickToRowSelect: false,
rowKey: 'id',
actionColumn: {
width: 230,
title: t('common.actionText'),
slots: { customRender: 'action' },
fixed: 'right',
},
rowSelection: {
type: 'checkbox',
getCheckboxProps: (record: any) => {},
},
});
</script>