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: 'country'
  },
  {
    title: '城市',
    align: "center",
    dataIndex: 'city'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "国家",
    field: 'country',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "城市",
    field: 'city',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '国家',
    field: 'country',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入国家!'},
             ];
    },
  },
  {
    label: '城市',
    field: 'city',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入城市!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
