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: '外链id',
    align:"center",
    dataIndex: 'externalLinkId'
   },
   {
    title: '标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '文章发布的链接地址',
    align:"center",
    dataIndex: 'url'
   },
   {
    title: '图片地址',
    align:"center",
    dataIndex: 'pic'
   },
   {
    title: '文章ai检测分数',
    align:"center",
    dataIndex: 'reportScore'
   },
   {
    title: '检测报告地址',
    align:"center",
    dataIndex: 'reportLink'
   },
   {
    title: '启用标志',
    align:"center",
    dataIndex: 'enableFlag_dictText'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '更新日期',
    align:"center",
    dataIndex: 'updateTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '外链id',
    field: 'externalLinkId',
    component: 'InputNumber',
  },
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '文章发布的链接地址',
    field: 'url',
    component: 'Input',
  },
  {
    label: '图片地址',
    field: 'pic',
    component: 'Input',
  },
  {
    label: '文章内容',
    field: 'content',
    component: 'JEditor',
  },
  {
    label: '文章ai检测分数',
    field: 'reportScore',
    component: 'InputNumber',
  },
  {
    label: '检测报告地址',
    field: 'reportLink',
    component: 'Input',
  },
  {
    label: '启用标志',
    field: 'enableFlag',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"enable_flag"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  externalLinkId: {title: '外链id',order: 0,view: 'number', type: 'number',},
  title: {title: '标题',order: 1,view: 'text', type: 'string',},
  url: {title: '文章发布的链接地址',order: 2,view: 'text', type: 'string',},
  pic: {title: '图片地址',order: 3,view: 'text', type: 'string',},
  reportScore: {title: '文章ai检测分数',order: 5,view: 'number', type: 'number',},
  reportLink: {title: '检测报告地址',order: 6,view: 'text', type: 'string',},
  enableFlag: {title: '启用标志',order: 7,view: 'number', type: 'number',},
  createTime: {title: '创建日期',order: 8,view: 'datetime', type: 'string',},
  updateTime: {title: '更新日期',order: 9,view: 'datetime', type: 'string',},
};

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