import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
export const columns: BasicColumn[] = [
  {
    title: '名称',
    dataIndex: 'strname',
    width: 120,
  },
  {
    title: '安装位置',
    dataIndex: 'strinstallpos',
    width: 100,
  },
  {
    title: '读取数据方式',
    dataIndex: 'strtype',
    width: 100,
    // customRender: render.renderAvatar,
  },
  {
    title: '分站用途',
    dataIndex: 'nkj980use_dictText',
    width: 80,
  },
  {
    title: '分站IP地址',
    dataIndex: 'strip',
    width: 100,
  },
  {
    title: '链接状态',
    dataIndex: 'linkstatus_dictText',
    width: 100,
  },
  {
    title: '备注',
    width: 150,
    dataIndex: 'strremark',
  },
];

export const recycleColumns: BasicColumn[] = [
  {
    title: '名称',
    dataIndex: 'strname',
    width: 100,
  },
  {
    title: '安装位置',
    dataIndex: 'strinstallpos',
    width: 100,
  },
  {
    title: '链接状态',
    dataIndex: 'linkstatus',
    width: 80,
    customRender: render.renderAvatar,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '名称',
    field: 'strname',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '安装位置',
    field: 'strinstallpos',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '链接状态',
    field: 'linkstatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'user_status',
      placeholder: '请选择读写类型',
      stringToNumber: true,
    },
    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: 'strtype',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'getdatatype',
      placeholder: '请选择分站用途',
    },
  },
  {
    label: '分站用途',
    field: 'nkj980use',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'nkj980use',
      placeholder: '请选择分站用途',
      stringToNumber: true,
    },
  },
  {
    label: '分站IP地址',
    field: 'strip',
    component: 'Input',
  },
  {
    label: '链接状态',
    field: 'linkstatus_dictText',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'linkstatus',
      placeholder: '请选择链接状态',
      stringToNumber: true,
    },
  },
  {
    label: '备注',
    field: 'strremark',
    component: 'InputTextArea',
  },
];
