import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Form';
import { projectInfoList } from '@/api/basicInfo/projectsInfo';

export const formSchemas: FormSchema[] = [
  {
    label: '项目',
    field: 'organizationId',
    component: 'ApiSelect',
    componentProps: {
      api: projectInfoList,
      labelField: 'name',
      valueField: 'id',
      placeholder: '请选择项目',
      afterFetch: (res) => {
        return res.rows;
      },
    },
  },

  {
    label: '设备编号',
    field: 'name',
    component: 'Input',
  },
];

export const columns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },

  {
    title: '设备编号',
    dataIndex: 'name',
  },
  {
    title: '设备名称',
    dataIndex: 'address',
  },

  {
    title: '关联电梯名称',
    dataIndex: 'contacts',
  },
  {
    title: '版本类型',
    dataIndex: 'phone',
  },

  {
    title: '在线状态',
    dataIndex: 'organizationId',
  },
];

export const modalSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },
  {
    label: '用户编号',
    field: 'code',
    required: false,
    component: 'Input',
  },
  {
    label: '单位管理员',
    field: 'organizationId',
    required: false,
    component: 'Select',
    componentProps: {
      options: [
        { label: '是', value: 1 },
        { label: '否', value: 2 },
      ],
    },
  },
  {
    label: '用户名称',
    field: 'name',
    required: true,
    component: 'Input',
  },
  {
    label: '电子邮箱',
    field: 'address',
    required: false,
    component: 'Input',
  },

  {
    label: '备注',
    field: 'remark',
    required: false,
    component: 'Input',
  },
];
export const energyModalSchemas: FormSchema[] = [
  {
    label: '主键id',
    field: 'id',
    required: false,
    component: 'Input',
    show: false,
  },

  {
    label: '节能停梯间隔(s) 多个;分隔',
    field: 'remark',
    required: false,
    component: 'InputTextArea',
    colProps: { span: 24 },
  },
];

export const formDeviceSchemas: FormSchema[] = [
  {
    label: '设备版本类型',
    field: 'organizationId',
    component: 'Select',
    componentProps: {
      options: [
        { label: '离线版本', value: 1 },
        { label: '2G版', value: 1 },
        { label: '2GW版', value: 1 },
        { label: '4G版', value: 1 },
        { label: '4GW版', value: 1 },
        { label: 'cat1版', value: 1 },
        { label: 'cat1w版', value: 1 },
        { label: '4G光感', value: 1 },
        { label: '4GW光感', value: 1 },
        { label: '视频版', value: 1 },
        { label: 'AIBOX内置网桥', value: 1 },
        { label: 'AIBOX外置网桥', value: 1 },
      ],
    },
  },

  {
    label: '设备编号',
    field: 'name',
    component: 'Input',
  },
  {
    label: '设备名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'name',
    component: 'Input',
  },
];
export const deviceColumns: BasicColumn[] = [
  {
    title: '主键id',
    dataIndex: 'id',
    ifShow: false,
  },

  {
    title: '设备编号',
    dataIndex: 'name',
  },
  {
    title: '设备名称',
    dataIndex: 'address',
  },
];
