committed by
GitHub
31 changed files with 720 additions and 888 deletions
@ -1,2 +0,0 @@ |
|||||
export * from './form'; |
|
||||
export * from './vxe-table'; |
|
||||
@ -1 +1,70 @@ |
|||||
|
import { h } from 'vue'; |
||||
|
|
||||
|
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table'; |
||||
|
|
||||
|
import { Button, Image } from 'ant-design-vue'; |
||||
|
|
||||
|
import { useVbenForm } from './form'; |
||||
|
|
||||
|
if (!import.meta.env.SSR) { |
||||
|
setupVbenVxeTable({ |
||||
|
configVxeTable: (vxeUI) => { |
||||
|
vxeUI.setConfig({ |
||||
|
grid: { |
||||
|
align: 'center', |
||||
|
border: false, |
||||
|
columnConfig: { |
||||
|
resizable: true, |
||||
|
}, |
||||
|
|
||||
|
formConfig: { |
||||
|
// 全局禁用vxe-table的表单配置,使用formOptions
|
||||
|
enabled: false, |
||||
|
}, |
||||
|
minHeight: 180, |
||||
|
proxyConfig: { |
||||
|
autoLoad: true, |
||||
|
response: { |
||||
|
result: 'items', |
||||
|
total: 'total', |
||||
|
list: 'items', |
||||
|
}, |
||||
|
showActiveMsg: true, |
||||
|
showResponseMsg: false, |
||||
|
}, |
||||
|
round: true, |
||||
|
showOverflow: true, |
||||
|
size: 'small', |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
// 表格配置项可以用 cellRender: { name: 'CellImage' },
|
||||
|
vxeUI.renderer.add('CellImage', { |
||||
|
renderTableDefault(_renderOpts, params) { |
||||
|
const { column, row } = params; |
||||
|
return h(Image, { src: row[column.field] }); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
// 表格配置项可以用 cellRender: { name: 'CellLink' },
|
||||
|
vxeUI.renderer.add('CellLink', { |
||||
|
renderTableDefault(renderOpts) { |
||||
|
const { props } = renderOpts; |
||||
|
return h( |
||||
|
Button, |
||||
|
{ size: 'small', type: 'link' }, |
||||
|
{ default: () => props?.text }, |
||||
|
); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
||||
|
// vxeUI.formats.add
|
||||
|
}, |
||||
|
useVbenForm, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export { useVbenVxeGrid }; |
||||
|
|
||||
export type * from '@vben/plugins/vxe-table'; |
export type * from '@vben/plugins/vxe-table'; |
||||
|
|||||
@ -0,0 +1,4 @@ |
|||||
|
export const useVbenForm = () => {}; |
||||
|
export const z = {}; |
||||
|
export type VbenFormSchema = any; |
||||
|
export type VbenFormProps = any; |
||||
@ -0,0 +1,3 @@ |
|||||
|
export type * from '@vben/plugins/vxe-table'; |
||||
|
|
||||
|
export const useVbenVxeGrid = () => {}; |
||||
File diff suppressed because it is too large
Loading…
Reference in new issue