79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
|
|
import { getStoreList } from '../api';
|
|
|
|
interface RowType {
|
|
id: string;
|
|
name: string;
|
|
logo: string;
|
|
introduce: string;
|
|
created_at: string;
|
|
}
|
|
|
|
export const gridOptions: VxeGridProps<RowType> = {
|
|
checkboxConfig: {
|
|
highlight: true,
|
|
labelField: '',
|
|
},
|
|
columnConfig: {
|
|
useKey: true,
|
|
},
|
|
rowConfig: {
|
|
useKey: true,
|
|
},
|
|
columns: [
|
|
{ type: 'checkbox', width: 60 },
|
|
{ field: 'id', align: 'left', title: 'ID', width: 100 },
|
|
{ field: 'name', align: 'left', title: '诊所名称' },
|
|
{
|
|
field: 'qr_code',
|
|
align: 'left',
|
|
title: '诊所二维码',
|
|
slots: { default: 'qr_code' },
|
|
width: 130,
|
|
},
|
|
// { field: 'erp_id', title: 'erpID' },
|
|
// { field: 'shouzimu', title: '诊所首字母' },
|
|
{ field: 'position', title: '详细地址' },
|
|
// { field: 'contact', title: '联系人' },
|
|
{ field: 'mobile', title: '联系人、电话', slots: { default: 'mobile' } },
|
|
{ field: 'start_time', title: '营业时间', slots: { default: 'start-time' } },
|
|
{ field: 'created_at', title: '注册时间' },
|
|
{ type: 'html', title: '操作', align: 'right', slots: { default: 'action' } },
|
|
],
|
|
keepSource: true,
|
|
pagerConfig: {},
|
|
proxyConfig: {
|
|
ajax: {
|
|
// 请求后端接口方法
|
|
query: async ({ page }, formValues) => {
|
|
return await getStoreList({
|
|
page: page.currentPage,
|
|
pageSize: page.pageSize,
|
|
...formValues,
|
|
});
|
|
},
|
|
},
|
|
},
|
|
height: 'auto',
|
|
border: false,
|
|
toolbarConfig: {
|
|
// 是否显示搜索表单控制按钮
|
|
// @ts-ignore 正式环境时有完整的类型声明
|
|
search: true,
|
|
refresh: true, // 刷新
|
|
print: false, // 打印
|
|
export: false, // 导出
|
|
// custom: true, // 自定义列
|
|
zoom: true, // 最大化最小化
|
|
slots: {
|
|
buttons: 'toolbar-buttons',
|
|
},
|
|
custom: {
|
|
// 自定义列-图标
|
|
icon: 'vxe-icon-menu',
|
|
},
|
|
},
|
|
showOverflow: false,
|
|
};
|