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',
    ifShow: false,
  },
  {
    title: '条目',
    align: 'left',
    dataIndex: 'item',
    width: 150,
    sorter: true,
  },
  {
    title: '内容',
    align: 'left',
    dataIndex: 'content',
  },
  {
    title: '标签',
    align: 'left',
    dataIndex: 'labelNames',
    ifShow: false,
  },
  {
    title: '控制项',
    align: 'left',
    dataIndex: 'caName',
    ifShow: false,
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '条目',
    field: 'item',
    component: 'InputTextArea',
    componentProps: {
      rows: 2,
      showCount: true,
      maxlength: 128,
    },
    required: true,
  },
  {
    label: '内容',
    field: 'content',
    component: 'InputTextArea',
    componentProps: {
      rows: 4,
      showCount: true,
      maxlength: 2000,
    },
    required: true,
  },

  {
    label: '标签',
    field: 'labels',
    component: 'StSelectLable',
    show: false,
  },
  {
    label: '来源文件',
    field: 'fileId',
    component: 'InputNumber',
    show: false,
  },
  {
    label: 'fileId',
    field: 'fileId',
    component: 'Input',
    show: false,
  },
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: '序号',
    field: 'ind',
    component: 'InputNumber',
    required: false,
  },
];

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