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

export const columns: BasicColumn[] = [
  {
    title: '业务类型',
    align: 'center',
    dataIndex: 'bizType',
  },
  {
    title: '业务ID',
    align: 'center',
    dataIndex: 'bizId',
  },
  {
    title: '媒体类型',
    align: 'center',
    dataIndex: 'mediaType',
  },
  {
    title: '媒体地址',
    align: 'center',
    dataIndex: 'mediaUrl',
  },
  {
    title: '预览',
    align: 'center',
    dataIndex: 'mediaUrl',
    customRender: render.renderImage,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '业务类型',
    field: 'bizType',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '业务ID',
    field: 'bizId',
    component: 'InputNumber',
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '业务类型',
    field: 'bizType',
    component: 'Input',
    required: true,
    helpMessage: '例如：school/campus/dorm/major 等，由后端约定',
  },
  {
    label: '业务ID',
    field: 'bizId',
    component: 'InputNumber',
    required: true,
  },
  {
    label: '媒体类型',
    field: 'mediaType',
    component: 'Input',
    helpMessage: '例如：image/video/cover 等，由后端约定',
  },
  {
    label: '媒体地址',
    field: 'mediaUrl',
    component: 'Input',
    required: true,
  },
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

export function getBpmFormSchema(_formData): FormSchema[] {
  return formSchema;
}

