chore: vxe默认配置
This commit is contained in:
parent
078524e7bd
commit
29f98a3961
@ -4,8 +4,6 @@ import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
|
|||||||
|
|
||||||
import { Button, Image } from 'ant-design-vue';
|
import { Button, Image } from 'ant-design-vue';
|
||||||
|
|
||||||
import { renderDict } from '#/utils/render';
|
|
||||||
|
|
||||||
import { useVbenForm } from './form';
|
import { useVbenForm } from './form';
|
||||||
|
|
||||||
setupVbenVxeTable({
|
setupVbenVxeTable({
|
||||||
@ -13,7 +11,7 @@ setupVbenVxeTable({
|
|||||||
vxeUI.setConfig({
|
vxeUI.setConfig({
|
||||||
grid: {
|
grid: {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
border: true,
|
border: false,
|
||||||
minHeight: 180,
|
minHeight: 180,
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
autoLoad: true,
|
autoLoad: true,
|
||||||
@ -25,9 +23,21 @@ setupVbenVxeTable({
|
|||||||
showActiveMsg: true,
|
showActiveMsg: true,
|
||||||
showResponseMsg: false,
|
showResponseMsg: false,
|
||||||
},
|
},
|
||||||
|
pagerConfig: {
|
||||||
|
// pageSize: 10,
|
||||||
|
// pageSizes: [10, 20, 30, 40, 50],
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
// 鼠标移入行显示 hover 样式
|
||||||
|
isHover: true,
|
||||||
|
// 点击行高亮
|
||||||
|
isCurrent: true,
|
||||||
|
},
|
||||||
columnConfig: {
|
columnConfig: {
|
||||||
|
// 可拖拽列宽
|
||||||
resizable: true,
|
resizable: true,
|
||||||
},
|
},
|
||||||
|
// 右上角工具栏
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
// 自定义列
|
// 自定义列
|
||||||
custom: true,
|
custom: true,
|
||||||
@ -36,7 +46,9 @@ setupVbenVxeTable({
|
|||||||
// 刷新
|
// 刷新
|
||||||
refresh: true,
|
refresh: true,
|
||||||
},
|
},
|
||||||
|
// 圆角按钮
|
||||||
round: true,
|
round: true,
|
||||||
|
// 表格尺寸
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -61,23 +73,6 @@ setupVbenVxeTable({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 表格dict渲染 必传 props: { field: 参数名, dictName: 字典名 }
|
|
||||||
*/
|
|
||||||
vxeUI.renderer.add('DictTag', {
|
|
||||||
renderDefault(renderOpts, params) {
|
|
||||||
const { props } = renderOpts;
|
|
||||||
const field = props?.field;
|
|
||||||
const dictName = props?.dictName;
|
|
||||||
if (!field || !dictName) {
|
|
||||||
console.warn('DictTag: field or dictName is not provided');
|
|
||||||
return 'error';
|
|
||||||
}
|
|
||||||
const { row } = params;
|
|
||||||
return renderDict(row[field], dictName);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
||||||
// vxeUI.formats.add
|
// vxeUI.formats.add
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user