feat: 操作日志

This commit is contained in:
dap
2024-10-05 12:12:14 +08:00
parent 82e63dbcf6
commit 51c63c1b69
4 changed files with 2373 additions and 2428 deletions

View File

@@ -4,6 +4,8 @@ import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
import { Button, Image } from 'ant-design-vue';
import { renderDict } from '#/utils/render';
import { useVbenForm } from './form';
setupVbenVxeTable({
@@ -16,15 +18,15 @@ setupVbenVxeTable({
proxyConfig: {
autoLoad: true,
response: {
result: 'items',
result: 'rows',
total: 'total',
list: 'items',
list: 'rows',
},
showActiveMsg: true,
showResponseMsg: false,
},
round: true,
size: 'small',
size: 'medium',
},
});
@@ -48,6 +50,23 @@ 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 的全局配置,比如自定义格式化
// vxeUI.formats.add
},