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: '诊所名称', width: 140 }, { 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: 'see_rate', align: 'left', title: '查看毛利率', slots: { default: 'see_rate' }, width: 120, }, { field: 'qr_code', align: 'left', title: '诊所二维码', slots: { default: 'qr_code' }, width: 130, }, { field: 'erp_id', align: 'left', title: 'ERP ID', width: 140, slots: { default: 'erp_id_cell' }, }, // { // field: 'mes_id', // align: 'left', // title: 'MES ID', // width: 140, // slots: { default: 'mes_id_cell' }, // }, // { field: 'shouzimu', title: '诊所首字母' }, { field: 'position', title: '详细地址', width: 140 }, { field: 'new_admin.nick_name', title: '业务员', slots: { default: 'sales_admin' }, width: 140 }, { field: 'store_admin.phone', title: '管理员手机', slots: { default: 'store_admin_phone' }, width: 140 }, { field: 'mobile', title: '联系人、电话', slots: { default: 'mobile' }, width: 140 }, { field: 'start_time', title: '营业时间', slots: { default: 'start-time' }, width: 140, }, { field: 'created_at', title: '注册时间', width: 140 }, { type: 'html', title: '操作', fixed: 'right', width: 200, 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, };