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:"left",
    dataIndex: 'mtrcNo',
    width:100,
    sorter: true,
    resizable: true,
   },
   {
    title: '指标名称',
    align:"left",
    dataIndex: 'mtrcName',
    width:150,
    sorter: true,
    resizable: true,
   },
   {
    title: '公式',
    align:"center",
    dataIndex: 'formula',
    ifShow:false,
   },
   {
    title: '公式',
    align:"left",
    dataIndex: 'formulaName',
    width:250,
    sorter: true,
    resizable: true,
   },
   {
    title: '单位',
    align:"center",
    dataIndex: 'unit',
    ifShow:false,
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'des',
    ifShow:false,
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '指标名称',
    field: 'mtrcName',
    component: 'Input',
  },
  {
    label: '指标编号',
    field: 'mtrcNo',
    component: 'Input',
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '指标名称',
    field: 'mtrcName',
    component: 'Input',
  },
  {
    label: '指标编号',
    field: 'mtrcNo',
    component: 'Input',
  },
  {
    label: '公式',
    field: 'formula',
    component: 'Input',
  },
  {
    label: '公式名称',
    field: 'formulaName',
    component: 'Input',
  },
  {
    label: '单位',
    field: 'unit',
    component: 'Input',
  },
  {
    label: '变量',
    field: 'params',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'des',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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