import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
import Icon from '@/components/Icon/Icon.vue';

export const columns: BasicColumn[] = [
  {
    title: '按钮名称',
    dataIndex: 'name',
  },
  {
    title: 'DOMID',
    dataIndex: 'domId',
  },
  {
    title: '排序',
    dataIndex: 'sort',
  },
  {
    title: '样式',
    dataIndex: 'class',
  },
  {
    title: '状态',
    dataIndex: 'enabledMark',
    width: 80,
    customRender: ({ record }) => {
      const color = record.status == 1 ? 'blue' : 'red';
      const text = record.status == 1 ? '启用' : '停用';
      return h(Tag, { color: color }, () => text);
    },
  },
];


export const searchFormSchema: FormSchema[] = [
  {
    field: 'key',
    label: '关键字',
    component: 'Input',
    colProps: { span: 8 },
  },
];
