import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '站点id',
    align:"center",
    dataIndex: 'siteId'
   },
   {
    title: '页面路径',
    align:"center",
    dataIndex: 'url'
   },
   {
    title: '询盘的板式',
    align:"center",
    dataIndex: 'inquiryType_dictText'
   },
   {
    title: 'ai检测分数',
    align:"center",
    dataIndex: 'reportScore'
   },
   {
    title: 'ai检测报告地址',
    align:"center",
    dataIndex: 'reportLink'
   },
   {
    title: '同步状态',
    align:"center",
    dataIndex: 'status'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '更新日期',
    align:"center",
    dataIndex: 'updateTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '站点id',
    field: 'siteId',
    component: 'InputNumber',
  },
  {
    label: '页面路径',
    field: 'url',
    component: 'Input',
  },
  {
    label: '结构化数据',
    field: 'jsonLd',
    component: 'InputTextArea',
  },
  {
    label: '询盘的板式',
    field: 'inquiryType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"inquiry_type"
     },
  },
  {
    label: 'ai检测分数',
    field: 'reportScore',
    component: 'InputNumber',
  },
  {
    label: 'ai检测报告地址',
    field: 'reportLink',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
export const okkiOverviewFormSchema: FormSchema[] = [
  {
    label: '概览类型',
    field: 'overviewType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"overview_type"
     },
  },
  {
    label: '概览标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '概览内容',
    field: 'content',
    component: 'InputTextArea',
  },
  {
    label: '概览图片链接',
    field: 'pic',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '按钮文字',
    field: 'buttonName',
    component: 'Input',
  },
  {
    label: '按钮跳转链接',
    field: 'buttonUrl',
    component: 'Input',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiProductListFormSchema: FormSchema[] = [
  {
    label: '产品列表类型',
    field: 'productListType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"product_list_type"
     },
  },
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '字幕',
    field: 'subtitles',
    component: 'Input',
  },
  {
    label: '商品pid',
    field: 'pidList',
    component: 'Input',
  },
  {
    label: '商品分类sid',
    field: 'sid',
    component: 'InputNumber',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiHighlightFormSchema: FormSchema[] = [
  {
    label: '模块标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '模块简介',
    field: 'content',
    component: 'InputTextArea',
  },
  {
    label: '文字对齐方式',
    field: 'layoutAlignment',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"layout_alignment"
     },
  },
  {
    label: '每行列数',
    field: 'layoutColumnsPerRow',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"layout_columns_per_row"
     },
  },
  // {
  //   label: '组件',
  //   field: 'block',
  //   component: 'Input',
  // },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiRecommendedProductsFormSchema: FormSchema[] = [
  {
    label: '类型',
    field: 'productListType',
    component: 'InputNumber',
  },
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '字幕',
    field: 'subtitles',
    component: 'Input',
  },
  {
    label: '商品pid',
    field: 'pidList',
    component: 'Input',
  },
  {
    label: '商品分类sid',
    field: 'sid',
    component: 'InputNumber',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiKeywordsFormSchema: FormSchema[] = [
  {
    label: '关键词标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '关键词列表',
    field: 'keywordList',
    component: 'Input',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiKeywordsSeriesFormSchema: FormSchema[] = [
  {
    label: '关键词系列标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '关键词系列排版结构',
    field: 'layoutType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"layout_type"
     },
  },
  {
    label: '关键词',
    field: 'keywords',
    component: 'Input',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiReviewFormSchema: FormSchema[] = [
  {
    label: '评价标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '评价字幕',
    field: 'subtitles',
    component: 'Input',
  },
  {
    label: '文字对齐方式',
    field: 'layoutAlignment',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"layout_alignment"
     },
  },
  {
    label: '每行列数',
    field: 'layoutColumnsPerRow',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"layout_columns_per_row"
     },
  },
  {
    label: '评价列表',
    field: 'reviewList',
    component: 'Input',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiFaqFormSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '字幕',
    field: 'subtitles',
    component: 'Input',
  },
  {
    label: '常见问题列表',
    field: 'faqList',
    component: 'Input',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
export const okkiShowlistBlogFormSchema: FormSchema[] = [
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '文字对齐方式',
    field: 'layoutAlignment',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"layout_alignment"
     },
  },
  {
    label: '每行列数',
    field: 'layoutColumnsPerRow',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"layout_columns_per_row"
     },
  },
  {
    label: '博客列表',
    field: 'blogList',
    component: 'Input',
  },
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表表格配置
export const okkiAdvantageColumns: JVxeColumn[] = [
    {
      title: '标题',
      key: 'title',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '内容',
      key: 'content',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '文字对齐方式',
      key: 'layoutAlignment',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '每行列数',
      key: 'layoutColumnsPerRow',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '组件',
      key: 'block',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]

// 高级查询数据
export const superQuerySchema = {
  siteId: {title: '站点id',order: 0,view: 'number', type: 'number',},
  url: {title: '页面路径',order: 1,view: 'text', type: 'string',},
  inquiryType: {title: '询盘的板式',order: 3,view: 'number', type: 'number',},
  reportScore: {title: 'ai检测分数',order: 4,view: 'number', type: 'number',},
  reportLink: {title: 'ai检测报告地址',order: 5,view: 'number', type: 'number',},
  status: {title: '同步状态',order: 6,view: 'number', type: 'number',},
  createTime: {title: '创建日期',order: 7,view: 'datetime', type: 'string',},
  updateTime: {title: '更新日期',order: 8,view: 'datetime', type: 'string',},
  //子表高级查询
  okkiOverview: {
    title: '概览',
    view: 'table',
    fields: {
        overviewType: {title: '概览类型',order: 0,view: 'number', type: 'number',},
        title: {title: '概览标题',order: 1,view: 'text', type: 'string',},
        content: {title: '概览内容',order: 2,view: 'textarea', type: 'string',},
        pic: {title: '概览图片链接',order: 3,view: 'image', type: 'string',},
        buttonName: {title: '按钮文字',order: 4,view: 'text', type: 'string',},
        buttonUrl: {title: '按钮跳转链接',order: 5,view: 'text', type: 'string',},
    }
  },
  okkiProductList: {
    title: '产品',
    view: 'table',
    fields: {
        productListType: {title: '产品列表类型',order: 0,view: 'number', type: 'number',},
        title: {title: '标题',order: 1,view: 'text', type: 'string',},
        subtitles: {title: '字幕',order: 2,view: 'text', type: 'string',},
        pidList: {title: '商品pid',order: 3,view: 'text', type: 'string',},
        sid: {title: '商品分类sid',order: 4,view: 'number', type: 'number',},
    }
  },
  okkiHighlight: {
    title: '亮点',
    view: 'table',
    fields: {
        title: {title: '模块标题',order: 0,view: 'text', type: 'string',},
        content: {title: '模块简介',order: 1,view: 'textarea', type: 'string',},
        layoutAlignment: {title: '文字对齐方式',order: 2,view: 'number', type: 'number',},
        layoutColumnsPerRow: {title: '每行列数',order: 3,view: 'number', type: 'number',},
        // block: {title: '组件',order: 4,view: 'text', type: 'string',},
    }
  },
  okkiAdvantage: {
    title: '优势',
    view: 'table',
    fields: {
        title: {title: '标题',order: 0,view: 'text', type: 'string',},
        content: {title: '内容',order: 1,view: 'text', type: 'string',},
        layoutAlignment: {title: '文字对齐方式',order: 2,view: 'number', type: 'number',},
        layoutColumnsPerRow: {title: '每行列数',order: 3,view: 'number', type: 'number',},
        block: {title: '组件',order: 4,view: 'text', type: 'string',},
    }
  },
  okkiRecommendedProducts: {
    title: '推荐商品列表',
    view: 'table',
    fields: {
        productListType: {title: '类型',order: 0,view: 'number', type: 'number',},
        title: {title: '标题',order: 1,view: 'text', type: 'string',},
        subtitles: {title: '字幕',order: 2,view: 'text', type: 'string',},
        pidList: {title: '商品pid',order: 3,view: 'text', type: 'string',},
        sid: {title: '商品分类sid',order: 4,view: 'number', type: 'number',},
    }
  },
  okkiKeywords: {
    title: '关键词',
    view: 'table',
    fields: {
        title: {title: '关键词标题',order: 0,view: 'text', type: 'string',},
        keywordList: {title: '关键词列表',order: 1,view: 'text', type: 'string',},
    }
  },
  okkiKeywordsSeries: {
    title: '关键词系列',
    view: 'table',
    fields: {
        title: {title: '关键词系列标题',order: 0,view: 'text', type: 'string',},
        layoutType: {title: '关键词系列排版结构',order: 1,view: 'number', type: 'number',},
        keywords: {title: '关键词',order: 2,view: 'text', type: 'string',},
    }
  },
  okkiReview: {
    title: '评价',
    view: 'table',
    fields: {
        title: {title: '评价标题',order: 0,view: 'text', type: 'string',},
        subtitles: {title: '评价字幕',order: 1,view: 'text', type: 'string',},
        layoutAlignment: {title: '文字对齐方式',order: 2,view: 'number', type: 'number',},
        layoutColumnsPerRow: {title: '每行列数',order: 3,view: 'number', type: 'number',},
    }
  },
  okkiFaq: {
    title: '常见问题',
    view: 'table',
    fields: {
        title: {title: '标题',order: 0,view: 'text', type: 'string',},
        subtitles: {title: '字幕',order: 1,view: 'text', type: 'string',},
        faqList: {title: '常见问题列表',order: 2,view: 'text', type: 'string',},
    }
  },
  okkiShowlistBlog: {
    title: '博客',
    view: 'table',
    fields: {
        title: {title: '标题',order: 0,view: 'text', type: 'string',},
        layoutAlignment: {title: '文字对齐方式',order: 1,view: 'number', type: 'number',},
        layoutColumnsPerRow: {title: '每行列数',order: 2,view: 'number', type: 'number',},
        blogList: {title: '博客列表',order: 3,view: 'text', type: 'string',},
    }
  },
};
