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

//列表数据
export const columns: BasicColumn[] = [
   {
    title: '控制活动',
    align:"left",
    dataIndex: 'caName',
    width:200
   },
   {
    title: '所属领域',
    align:"left",
    dataIndex: 'domainName',
    width:200
   },
   {
    title: '检查内容',
    align:"left",
    dataIndex: 'checkCountent',
    width:250
   },
   {
    title: '部门',
    align:"left",
    dataIndex: 'execDepName',
    width:100
   },
   {
    title: '责任人',
    align:"left",
    dataIndex: 'headName',
    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: 'checkDoc',
    component: 'Input',
    dynamicDisabled: true,
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '备注',
    field: 'des',
    component: 'Input',
    dynamicDisabled: true,
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '相关附件',
    field: 'fileUploadPath',
    component: 'JUpload',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 3},},wrapperCol:{xs: {span: 24},sm: {span: 21},}},
    componentProps: { desText:"支持扩展名: .rar .zip .doc .docx .pdf .jpg..."},
  },

	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	}
];



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