Files
xk-admin/apps/web-antd/src/views/system/store/config/table.ts

142 lines
3.5 KiB
TypeScript
Raw Normal View History

2025-04-01 19:13:44 +08:00
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 },
2026-05-19 09:52:55 +08:00
{ field: 'name', align: 'left', title: '诊所名称', width: 140 },
2026-02-04 08:53:52 +08:00
{
field: 'clinic_type',
align: 'left',
title: '诊所类型',
width: 120,
slots: { default: 'clinic_type' },
},
2025-12-25 11:18:18 +08:00
{
field: 'online_consultation_config',
align: 'left',
title: '在线复诊配置',
width: 160,
slots: { default: 'online_consultation_config' },
},
2025-12-17 10:12:54 +08:00
{
field: 'is_shipping_free',
align: 'left',
title: '是否包邮',
slots: { default: 'is_shipping_free' },
width: 120,
},
2025-12-18 09:22:12 +08:00
{
// 订阅价格波动列(显示为开关)
field: 'subscribe_price_change',
align: 'left',
title: '订阅价格',
slots: { default: 'subscribe_price_change' },
width: 120,
},
2026-06-04 16:05:02 +08:00
{
field: 'see_rate',
align: 'left',
title: '查看毛利率',
slots: { default: 'see_rate' },
width: 120,
},
2025-04-01 19:13:44 +08:00
{
field: 'qr_code',
align: 'left',
title: '诊所二维码',
slots: { default: 'qr_code' },
width: 130,
},
2026-03-26 10:31:19 +08:00
{
field: 'erp_id',
align: 'left',
title: 'ERP ID',
width: 140,
slots: { default: 'erp_id_cell' },
},
2026-05-19 09:52:55 +08:00
// {
// field: 'mes_id',
// align: 'left',
// title: 'MES ID',
// width: 140,
// slots: { default: 'mes_id_cell' },
// },
2025-04-01 19:13:44 +08:00
// { field: 'shouzimu', title: '诊所首字母' },
2026-05-19 09:52:55 +08:00
{ 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' },
2026-05-19 09:52:55 +08:00
width: 140,
},
2026-05-19 09:52:55 +08:00
{ field: 'created_at', title: '注册时间', width: 140 },
{
type: 'html',
title: '操作',
2026-05-19 09:52:55 +08:00
fixed: 'right',
width: 200,
slots: { default: 'action' },
},
2025-04-01 19:13:44 +08:00
],
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
// 请求后端接口方法
2025-12-17 13:29:54 +08:00
// 注意:会自动添加type=0参数,只查询诊所类型的数据
2025-04-01 19:13:44 +08:00
query: async ({ page }, formValues) => {
return await getStoreList({
page: page.currentPage,
pageSize: page.pageSize,
2025-12-17 13:29:54 +08:00
type: 0, // 固定为诊所类型
2025-04-01 19:13:44 +08:00
...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,
};