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: 'status_dictText'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '站点id',
    field: 'siteId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];
//子表单数据
//子表列表数据
export const okkiYoutubeMarketingDataDetailColumns: BasicColumn[] = [
   {
    title: '视频id',
    align:"center",
    dataIndex: 'vid'
   },
   {
    title: '视频标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '视频创建时间',
    align:"center",
    dataIndex: 'addtime'
   },
   {
    title: '视频当月观看次数',
    align:"center",
    dataIndex: 'views'
   },
   {
    title: '视频当月总观看时长 (单位：小时)',
    align:"center",
    dataIndex: 'duration'
   },
   {
    title: '当月订阅量',
    align:"center",
    dataIndex: 'subscribe'
   },
   {
    title: '当月曝光数量',
    align:"center",
    dataIndex: 'showtimes'
   },
   {
    title: '月份',
    align:"center",
    dataIndex: 'month'
   },
];
//子表表格配置
export const okkiYoutubeMarketingDataDetailJVxeColumns: JVxeColumn[] = [
    {
      title: '视频id',
      key: 'vid',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '视频标题',
      key: 'title',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '视频创建时间',
      key: 'addtime',
      type: JVxeTypes.datetime,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '视频当月观看次数',
      key: 'views',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '视频当月总观看时长 (单位：小时)',
      key: 'duration',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '当月订阅量',
      key: 'subscribe',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '当月曝光数量',
      key: 'showtimes',
      type: JVxeTypes.inputNumber,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
    {
      title: '月份',
      key: 'month',
      type: JVxeTypes.input,
      width:"200px",
      placeholder: '请输入${title}',
      defaultValue:'',
    },
  ]

// 高级查询数据
export const superQuerySchema = {
  siteId: {title: '站点id',order: 0,view: 'text', type: 'string',},
  status: {title: '同步状态',order: 1,view: 'number', type: 'number',},
  createTime: {title: '创建日期',order: 2,view: 'datetime', type: 'string',},
  //子表高级查询
  okkiYoutubeMarketingDataDetail: {
    title: 'Youtube营销效果数据详情',
    view: 'table',
    fields: {
        vid: {title: '视频id',order: 0,view: 'text', type: 'string',},
        title: {title: '视频标题',order: 1,view: 'text', type: 'string',},
        addtime: {title: '视频创建时间',order: 2,view: 'datetime', type: 'string',},
        views: {title: '视频当月观看次数',order: 3,view: 'number', type: 'number',},
        duration: {title: '视频当月总观看时长 (单位：小时)',order: 4,view: 'number', type: 'number',},
        subscribe: {title: '当月订阅量',order: 5,view: 'number', type: 'number',},
        showtimes: {title: '当月曝光数量',order: 6,view: 'number', type: 'number',},
        month: {title: '月份',order: 7,view: 'text', type: 'string',},
    }
  },
};

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