mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-11 13:22:09 +08:00
feat: table 类型VxeTableGridColumns替代VxeTableGridOptions['columns']魔法值写法
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
|
||||
import type { VxeTableGridColumns } from '@vben/plugins/vxe-table';
|
||||
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { OnActionClickFn } from '#/adapter/vxe-table';
|
||||
@@ -76,7 +76,7 @@ export function useSchema(): VbenFormSchema[] {
|
||||
*/
|
||||
export function useColumns(
|
||||
onActionClick?: OnActionClickFn<SystemDeptApi.SystemDept>,
|
||||
): VxeTableGridOptions<SystemDeptApi.SystemDept>['columns'] {
|
||||
): VxeTableGridColumns<SystemDeptApi.SystemDept> {
|
||||
return [
|
||||
{
|
||||
align: 'left',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { OnActionClickFn, VxeTableGridColumns } from '#/adapter/vxe-table';
|
||||
import type { SystemMenuApi } from '#/api/system/menu';
|
||||
|
||||
import { $t } from '#/locales';
|
||||
@@ -23,7 +23,7 @@ export function getMenuTypeOptions() {
|
||||
|
||||
export function useColumns(
|
||||
onActionClick: OnActionClickFn<SystemMenuApi.SystemMenu>,
|
||||
): VxeTableGridOptions<SystemMenuApi.SystemMenu>['columns'] {
|
||||
): VxeTableGridColumns<SystemMenuApi.SystemMenu> {
|
||||
return [
|
||||
{
|
||||
align: 'left',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { OnActionClickFn, VxeTableGridColumns } from '#/adapter/vxe-table';
|
||||
import type { SystemRoleApi } from '#/api';
|
||||
|
||||
import { $t } from '#/locales';
|
||||
@@ -77,7 +77,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
export function useColumns<T = SystemRoleApi.SystemRole>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
onStatusChange?: (newStatus: any, row: T) => PromiseLike<boolean | undefined>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
): VxeTableGridColumns {
|
||||
return [
|
||||
{
|
||||
field: 'name',
|
||||
|
||||
Reference in New Issue
Block a user