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: '编码',
    align:"center",
    dataIndex: 'code',
    width:80,
    resizable:true,
    sorter: true,
   },
   {
    title: '调查问题',
    align:"left",
    dataIndex: 'sname',
    width:300,
    resizable:true,
    sorter: true,
   },
   {
    title: '填写格式',
    align:"left",
    dataIndex: 'sformat',
    width:150,
    resizable:true,
    sorter: true,
   },
   {
    title: '值类型',
    align:"left",
    dataIndex: 'valtp',
    width:80,
    resizable:true,
    sorter: true,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '编码',
    field: 'code',
    component: 'Input',
  },
  {
    label: '调查问题',
    field: 'sname',
    component: 'Input',
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '编码',
    field: 'code',
    component: 'Input',
  },
  {
    label: '问题',
    field: 'sname',
    component: 'Input',
  },
  {
    label: '填写格式',
    field: 'sformat',
    component: 'Input',
  },
  {
    label: '值类型',
    field: 'valtp',
    component: 'RadioGroup',
    componentProps: {
      options: [
        {
          label: '数字',
          value: '1',
        },
        {
          label: '是否',
          value: '2',
        },
        {
          label: '选择',
          value: '3',
        }
      ]
    },
  },
  {
    label: '值描述',
    field: 'valdes',
    component: 'InputTextArea',
    componentProps: {
      rows: 5
    },
  },
  {
    field: 'files',
    component: 'InputTextArea',
    label: '相关资料',
    componentProps: { rows: 5 },
  },
  // {
  //   label: '说明',
  //   field: 'des',
  //   component: 'InputTextArea',
  //   componentProps: {
  //     rows: 3
  //   },
  // },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'tplid',
	  component: 'Input',
	  show: false
	},
  {
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}