import { BasicColumn, FormSchema } from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';

//列表数据
export const columns: BasicColumn[] = [
  {
    title: '控制活动',
    align:"left",
    dataIndex: 'caName',
    width:150
   },
   {
    title: '所属领域',
    align:"left",
    dataIndex: 'domainName',
    width:150
   },
   {
    title: '检查内容',
    align:"left",
    dataIndex: 'checkCountent',
    width:250
   },
   {
    title: '问询',
    align:"left",
    dataIndex: 'checkAsk',
    width:100
   },
   {
    title: '交叉/确证寻问',
    align:"left",
    dataIndex: 'checkCross',
    width:150
   },
   {
    title: '审阅',
    align:"left",
    dataIndex: 'fileUploadPath',
    width:100
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'confirmStatus',
    customRender:({text}) =>{
      const color =  text == '1' ?"green":"red";
      const temptext =  text == '1' ?"已检查":"待检查";
      return render.renderTag(temptext, color);

    },
    width:100
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '控制活动',
    field: 'caName',
    component: 'Input',
    dynamicDisabled: true,
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '检查内容',
    field: 'checkCountent',
    component: 'Input',
    dynamicDisabled: true,
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '检查依据',
    field: 'checkDoc',
    component: 'Input',
    dynamicDisabled: true,
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '现状描述',
    field: 'execContent',
    component: 'Input',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '问题项',
    field: 'problemTitle',
    component: 'Input',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '问题描述',
    field: 'problemContent',
    component: 'Input',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '事件分类',
    field: 'riskTitle',
    component: 'Input',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '风险事件',
    field: 'riskContent',
    component: 'Input',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



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