// import { ModuleVersionOptions, ModuleChartTypeOptions, ModulePositionOptions, ModuleSizeOptions } from './options';
import { ModulePositionOptions, ModulePresetOptions, ModuleVersionOptions } from './options';
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '所属页面',
    dataIndex: 'pageType',
  },
  {
    title: '设备类型',
    dataIndex: 'deviceType',
  },
  {
    title: '模块标题',
    dataIndex: 'moduleName',
  },
  {
    title: '原始预设名称',
    dataIndex: 'desc',
  },
  {
    title: '模块尺寸',
    dataIndex: 'showStyle.size',
  },
  {
    title: '模块版本',
    dataIndex: 'showStyle.version',
  },
  {
    title: '模块定位',
    dataIndex: 'showStyle.position',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '设备类型',
    field: 'deviceType',
    component: 'Input',
    componentProps: {
      dictCode: 'devicekind',
      placeholder: '请选择设备类型',
    },
    colProps: { span: 6 },
  },
  {
    label: '所属页面',
    field: 'pageType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'configurable_homepage',
      placeholder: '请选择所属页面',
    },
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '',
    field: 'id',
    component: 'InputNumber',
    show: false,
  },
  {
    label: '',
    field: 'showStyle',
    component: 'InputNumber',
    show: false,
  },
  {
    label: '',
    field: 'moduleData',
    component: 'InputNumber',
    show: false,
  },
  {
    label: '模块标题',
    field: 'moduleName',
    component: 'Input',
    required: true,
  },
  // {
  //   label: '设备类型',
  //   field: 'deviceType',
  //   component: 'JDictSelectTag',
  //   required: true,
  //   componentProps: {
  //     dictCode: 'devicekind',
  //     placeholder: '请选择设备类型',
  //   },
  // },
  {
    label: '所属页面',
    field: 'pageType',
    component: 'JDictSelectTag',
    required: true,
    componentProps: {
      dictCode: 'configurable_homepage',
      placeholder: '请选择所属页面',
    },
  },
  {
    label: '原始预设名称',
    field: 'desc',
    component: 'Select',
    required: false,
    componentProps: {
      options: ModulePresetOptions,
    },
  },
  {
    label: '模块版本',
    field: 'showStyle.version',
    component: 'Select',
    required: true,
    componentProps: {
      options: ModuleVersionOptions,
    },
  },
  {
    label: '模块定位',
    field: 'showStyle.position',
    component: 'Select',
    required: true,
    componentProps: {
      options: ModulePositionOptions,
    },
  },
  {
    label: '允许预设配置覆盖',
    field: 'allowCover',
    component: 'Checkbox',
  },
];

export const pageTypeFormSchema: FormSchema[] = [
  {
    label: '所属页面',
    field: 'pageType',
    component: 'JDictSelectTag',
    required: true,
    componentProps: {
      dictCode: 'configurable_homepage',
      placeholder: '请选择所属页面',
    },
  },
  {
    label: '模块版本',
    field: 'showStyle.version',
    component: 'Select',
    required: true,
    componentProps: {
      options: ModuleVersionOptions,
    },
  },
];
