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 = { 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: 'clinic_type', align: 'left', title: '诊所类型', width: 120, slots: { default: 'clinic_type' }, }, { field: 'online_consultation_config', align: 'left', title: '在线复诊配置', width: 160, slots: { default: 'online_consultation_config' }, }, { field: 'is_shipping_free', align: 'left', title: '是否包邮', slots: { default: 'is_shipping_free' }, width: 120, }, { // 订阅价格波动列(显示为开关) field: 'subscribe_price_change', align: 'left', title: '订阅价格', slots: { default: 'subscribe_price_change' }, width: 120, }, { field: 'qr_code', align: 'left', title: '诊所二维码', slots: { default: 'qr_code' }, width: 130, }, // { field: 'erp_id', title: 'erpID' }, // { field: 'shouzimu', title: '诊所首字母' }, { field: 'position', title: '详细地址' }, { field: 'new_admin.nick_name', 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: { // 请求后端接口方法 // 注意:会自动添加type=0参数,只查询诊所类型的数据 query: async ({ page }, formValues) => { return await getStoreList({ page: page.currentPage, pageSize: page.pageSize, type: 0, // 固定为诊所类型 ...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, };