import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { list } from '../substationTabel/substation.api';

export const columns: BasicColumn[] = [
  {
    title: '名称',
    dataIndex: 'strname',
    width: 120,
  },
  {
    title: '安装位置',
    dataIndex: 'strinstallpos',
    width: 100,
  },
  {
    title: '风窗类型',
    dataIndex: 'nwindowtype_dictText',
    width: 100,
  },
  {
    title: '风窗净宽(m)',
    dataIndex: 'fclearwidth',
    width: 80,
  },
  {
    title: '活动扇叶高度(m)',
    dataIndex: 'fperheight',
    width: 100,
  },
  {
    title: '活动扇叶数量',
    dataIndex: 'nwindow',
    width: 100,
  },
  {
    title: '所属分站',
    width: 150,
    dataIndex: 'stationname',
  },
  {
    title: '安装位置巷道面积',
    width: 100,
    dataIndex: 'finstalltunarea',
  },
];

export const recycleColumns: BasicColumn[] = [
  {
    title: '名称',
    dataIndex: 'strname',
    width: 100,
  },
  {
    title: '是否为常闭型',
    dataIndex: 'bnormalclose',
    width: 100,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '名称',
    field: 'strname',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '安装位置',
    field: 'strinstallpos',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '风窗类型',
    field: 'nwindowtype',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'user_status',
      placeholder: '请选择读写类型',
      stringToNumber: true,
    },
    colProps: { span: 6 },
  },
  {
    label: '所属分站',
    field: 'nsubstationid',
    component: 'ApiSelect',
    componentProps: {
      api: list,
      labelField: 'strname',
      valueField: 'nsubstationid',
    },
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: '名称',
    field: 'strname',
    component: 'Input',
  },
  {
    label: '安装位置',
    field: 'strinstallpos',
    component: 'Input',
  },
  {
    label: '风窗类型',
    field: 'nwindowtype',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'nwindowtype',
      placeholder: '请选择',
      stringToNumber: true,
    },
  },
  {
    label: '风窗净宽(m)',
    field: 'fclearwidth',
    component: 'InputNumber',
  },
  {
    label: '活动扇叶高度(m)',
    field: 'fperheight',
    component: 'InputNumber',
  },
  {
    label: '风门道数',
    field: 'ndoorcount',
    component: 'InputNumber',
  },
  {
    label: '所属分站',
    field: 'nsubstationid',
    component: 'ApiSelect',
    componentProps: {
      api: list,
      labelField: 'strname',
      valueField: 'nsubstationid',
    },
  },
  {
    label: '安装位置巷道面积',
    field: 'finstalltunarea',
    component: 'InputNumber',
  },
];
