import { FormSchema } from '/@/components/Form/index';
import { rules } from '/@/utils/helper/validator';

export interface ListItem {
  key: string;
  title: string;
  description: string;
  extra?: string;
  avatar?: string;
  color?: string;
}

// tab的list
export const settingList = [
  {
    key: '1',
    name: '首页配置',
    component: 'BaseSetting',
  },
  {
    key: '2',
    name: '风险监测指标配置',
    component: 'SecureSetting',
  },
   {
    key: '3',
    name: '趋势图表配置',
    component: 'AccountBind',
  },
  
];


//表单数据
export const btbaseSetschemas: FormSchema[] = [
  {
    label: '标题1',
    field: 'desctitlename1',
    component: 'Input',
    defaultValue: '未配置',
    colProps: {lg: 6},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou1',
    component: 'JSelectFxcTplTree',
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 20},}},
  },
  {
    label: '标题2',
    field: 'desctitlename2',
    component: 'Input',
    defaultValue: '未配置',
    colProps: {lg: 6},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou2',
    checkable:false,
    component: 'JSelectFxcTplTree',
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '标题3',
    field: 'desctitlename3',
    component: 'Input',
    defaultValue: '未配置',
    colProps: {lg: 6},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou3',
    component: 'JSelectFxcTplTree',
    checkable:false,
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '标题4',
    field: 'desctitlename4',
    component: 'Input',
    colProps: {lg: 6},
    defaultValue: '未配置',
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou4',
    component: 'JSelectFxcTplTree',
    checkable:false,
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '标题5',
    field: 'desctitlename5',
    component: 'Input',
    defaultValue: '未配置',
    colProps: {lg: 6},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou5',
    component: 'JSelectFxcTplTree',
    checkable:false,
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '标题6',
    field: 'desctitlename6',
    component: 'Input',
    defaultValue: '未配置',
    colProps: {lg: 6},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou6',
    component: 'JSelectFxcTplTree',
    checkable:false,
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '标题7',
    field: 'desctitlename7',
    component: 'Input',

    colProps: {lg: 6},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou7',
    component: 'JSelectFxcTplTree',
    checkable:false,
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '标题8',
    field: 'desctitlename8',
    component: 'Input',
    defaultValue: '未配置',
    colProps: {lg: 6},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },
  {
    label: '数据来源',
    field: 'datatabsou8',
    component: 'JSelectFxcTplTree',
    checkable:false,
    colProps: {lg: 18},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },

  /**
  {
    label: '数据来源',
    field: 'datatabsou',
    component: 'JSelectFxcTplTree',
    componentProps: {
      rowKey: 'id',
      labelKey: 'datatabsou',
    },
    colProps: {lg: 16},
    itemProps:{labelCol:{xs: {span: 24},sm: {span: 6},},wrapperCol:{xs: {span: 24},sm: {span: 18},}},
  },

  {
    label: '表id',
    field: 'tabid',
    component: 'InputNumber',
  },
  {
    label: '表名',
    field: 'tabname',
    component: 'Input',
  },
  {
    label: '业务表id',
    field: 'pjid',
    component: 'InputNumber',
  },
  {
    label: '标题id',
    field: 'tpid',
    component: 'InputNumber',
  },
  {
    label: '字段id',
    field: 'itemid',
    component: 'InputNumber',
  },
  {
    label: '填报字段id',
    field: 'pjcntid',
    component: 'InputNumber',
  },
  {
    label: '标题',
    field: 'tp',
    component: 'Input',
  },
  {
    label: '字段',
    field: 'item',
    component: 'Input',
  },
  {
    label: '字段',
    field: 'pjcnt',
    component: 'Input',
  },
  */
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 基础设置 form
export const baseSetschemas: FormSchema[] = [
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    field: 'realname',
    component: 'Input',
    label: '昵称',
    colProps: { span: 18 },
  },
  {
    field: 'sex',
    label: '性别',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'sex',
      placeholder: '请选择性别',
      stringToNumber: true,
    },
    colProps: { span: 18 },
  },
  {
    label: '生日',
    field: 'birthday',
    component: 'DatePicker',
    colProps: { span: 18 },
  },
  {
    field: 'email',
    component: 'Input',
    label: '邮箱',
    colProps: { span: 18 },
  },
  {
    field: 'phone',
    component: 'Input',
    label: '联系电话',
    dynamicRules: ({ model, schema }) => {
      return [
        { ...rules.duplicateCheckRule('sys_user', 'phone', model, schema, false)[0] },
        { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误' },
      ];
    },
    colProps: { span: 18 },
  },
];

// 安全设置 list
export const secureSettingList: ListItem[] = [
  {
    key: '1',
    title: '账户密码',
    description: '当前密码强度：：强',
    extra: '修改',
  },
  {
    key: '2',
    title: '密保手机',
    description: '已绑定手机：：138****8293',
    extra: '修改',
  },
  {
    key: '3',
    title: '密保问题',
    description: '未设置密保问题，密保问题可有效保护账户安全',
    extra: '修改',
  },
  {
    key: '4',
    title: '备用邮箱',
    description: '已绑定邮箱：：ant***sign.com',
    extra: '修改',
  },
  {
    key: '5',
    title: 'MFA 设备',
    description: '未绑定 MFA 设备，绑定后，可以进行二次确认',
    extra: '修改',
  },
];

// 账号绑定 list
export const accountBindList: ListItem[] = [
  {
    key: '1',
    title: '绑定淘宝',
    description: '当前未绑定淘宝账号',
    extra: '绑定',
    avatar: 'ri:taobao-fill',
    color: '#ff4000',
  },
  {
    key: '2',
    title: '绑定支付宝',
    description: '当前未绑定支付宝账号',
    extra: '绑定',
    avatar: 'fa-brands:alipay',
    color: '#2eabff',
  },
  {
    key: '3',
    title: '绑定钉钉',
    description: '当前未绑定钉钉账号',
    extra: '绑定',
    avatar: 'ri:dingding-fill',
    color: '#2eabff',
  },
];

// 新消息通知 list
export const msgNotifyList: ListItem[] = [
  {
    key: '1',
    title: '账户密码',
    description: '其他用户的消息将以站内信的形式通知',
  },
  {
    key: '2',
    title: '系统消息',
    description: '系统消息将以站内信的形式通知',
  },
  {
    key: '3',
    title: '待办任务',
    description: '待办任务将以站内信的形式通知',
  },
];
