import { BasicColumn } from '/@/components/Table'
import { FormSchema } from '/@/components/Table'
export const columns: BasicColumn[] = [
  {
    title: '角色名称',
    dataIndex: 'name',
    width: 200,
  },
  {
    title: '角色编码',
    dataIndex: 'slug',
    width: 180,
  },
  {
    width: 80,
    title: '操作',
    dataIndex: 'action',
    align: 'center',
    fixed: undefined,
  },
]

export const searchFormSchema: FormSchema[] = [
  // {
  //   field: 'roleNme',
  //   label: '角色名称',
  //   component: 'Input',
  //   colProps: { span: 8 },
  // },
  // {
  //   field: 'status',
  //   label: '状态',
  //   component: 'Select',
  //   componentProps: {
  //     options: [
  //       { label: '启用', value: '0' },
  //       { label: '停用', value: '1' },
  //     ],
  //   },
  //   colProps: { span: 8 },
  // },
]

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '角色ID',
    required: false,
    dynamicDisabled: true,
    component: 'Input',
    ifShow: ({ values }) => {
      return !!values.id
    },
  },
  {
    field: 'name',
    label: '角色名',
    required: true,
    component: 'Input',
  },
  {
    field: 'slug',
    label: '角色编码',
    required: true,
    component: 'Input',
  },
  {
    label: ' ',
    field: 'permission_ids',
    slot: 'menu',
    component: 'Input',
    ifShow: ({ values }) => {
      return !!values.id
    },
  },
]
