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: 'title'
   },
   {
    title: '主图url地址',
    align:"center",
    dataIndex: 'pic'
   },
   {
    title: '博客URL路径',
    align:"center",
    dataIndex: 'url'
   },
   {
    title: '博客内容',
    align:"center",
    dataIndex: 'content'
   },
   {
    title: '添加时间',
    align:"center",
    dataIndex: 'addtime'
   },
   {
    title: '服务商的blog主键id',
    align:"center",
    dataIndex: 'uid'
   },
   {
    title: 'ai检测分数',
    align:"center",
    dataIndex: 'reportScore'
   },
   {
    title: 'ai检测报告链接',
    align:"center",
    dataIndex: 'reportLink'
   },
   {
    title: '同步状态',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '博客标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '主图url地址',
    field: 'pic',
    component: 'Input',
  },
  {
    label: '博客URL路径',
    field: 'url',
    component: 'Input',
  },
  {
    label: '博客内容',
    field: 'content',
    component: 'Input',
  },
  {
    label: '添加时间',
    field: 'addtime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '服务商的blog主键id',
    field: 'uid',
    component: 'InputNumber',
  },
  {
    label: 'ai检测分数',
    field: 'reportScore',
    component: 'InputNumber',
  },
  {
    label: 'ai检测报告链接',
    field: 'reportLink',
    component: 'Input',
  },
  {
    label: '同步状态',
    field: 'status',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  title: {title: '博客标题',order: 0,view: 'text', type: 'string',},
  pic: {title: '主图url地址',order: 1,view: 'text', type: 'string',},
  url: {title: '博客URL路径',order: 2,view: 'text', type: 'string',},
  content: {title: '博客内容',order: 3,view: 'text', type: 'string',},
  addtime: {title: '添加时间',order: 4,view: 'datetime', type: 'string',},
  uid: {title: '服务商的blog主键id',order: 5,view: 'number', type: 'number',},
  reportScore: {title: 'ai检测分数',order: 6,view: 'number', type: 'number',},
  reportLink: {title: 'ai检测报告链接',order: 7,view: 'text', type: 'string',},
  status: {title: '同步状态',order: 8,view: 'number', type: 'number',},
  createTime: {title: '创建日期',order: 9,view: 'datetime', type: 'string',},
};

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