// 移除 top-level await，改为静态配置
export const userStatus = [
  { label: '启用', value: 1 },
  { label: '禁用', value: 2 }
]

export const ORDER_SEARCH_CONFIG = [
  {
    type: 'input',
    prop:'order_no',
    label: '订单号',
    placeholder: '请输入订单号',
  },
  {
    type: 'input',
    prop:'title',
    label: '商品名称',
    placeholder: '请输入商品名称',
  },
  {
    type: 'input',
    prop:'name',
    label: '用户姓名',
    placeholder: '请输入用户姓名',
  },
  {
    type: 'select',
    prop:'order_type',
    label: '订单类型',
    placeholder: '请选择订单类型',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        },
        {
          label: '课程',
          value: 1
        },
        {
          label: 'VIP',
          value: 2
        }
      ]
    },
  },
  {
    type: 'select',
    prop:'pay_type',
    label: '支付方式',
    placeholder: '请选择支付方式',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        },
        {
          label: '微信',
          value: 1
        },
        {
          label: '支付宝',
          value: 2
        },
        {
          label: '余额',
          value: 3
        }
      ]
    },
  },
  {
    type: 'select',
    prop:'status',
    label: '订单状态',
    placeholder: '请选择订单状态',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        },
        {
          label: '未付款',
          value: 1
        },
        {
          label: '已付款',
          value: 2
        },
        {
          label: '已过期',
          value: 3
        }
      ]
    },
  },
  {
    type: 'daterange',
    prop: 'times',
    label: '创建时间',
    valueFormat: 'YYYY-MM-DD',
    placeholder: '请选择创建时间',
    startPlaceholder: '开始日期',
    endPlaceholder: '结束日期',
    rangeSeparator: '-'
  },
]
export  const USER_SEARCH_CONFIG = [
  {
    type: 'input',
    prop:'name',
    label: '用户名称',
    placeholder: '请输入',
  },
  {
    type: 'select',
    prop:'status',
    label: '状态',
    placeholder: '请选择',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        },
        ...userStatus
      ]
    },
  },
  {
    type: 'select',
    prop:'type',
    label: '用户类型',
    placeholder: '请选择',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        },
        {
          label: '普通用户',
          value: 1
        },
        {
          label: '讲师',
          value: 2
        }
      ]
    },
  },
  {
    type: 'select',
    prop:'user_label',
    label: 'VIP等级',
    placeholder: '请选择',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        },
        {
          label: '注册会员',
          value: 1
        },
        {
          label: 'VIP',
          value: 2
        },
        {
          label: 'SVIP',
          value: 3
        },
        {
          label: '过期VIP用户',
          value: 4
        }
      ]
    },
  },
]
export  const ARTICLE_SEARCH_CONFIG = [
  {
    type: 'input',
    prop:'title',
    label: '文章标题',
    placeholder: '请输入文章标题',
  },
  {
    type: 'select',
    prop:'categoryId',
    label: '文章分类',
    placeholder: '请选择分类',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        }
      ]
    },
  },
  {
    type: 'select',
    prop:'teacherId',
    label: '讲师',
    placeholder: '请选择讲师',
    children:{
      list: [
        {
          label: '全部',
          value: ''
        }
      ]
    },
  },
]

// 订单列表
export const ORDER_TABLE_CONFIG = {
  index: true,
  schemes: [
    {
      attrs: {
        label: '订单号',
        prop: 'order_no',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '商品名称',
        prop: 'title',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '用户姓名',
        prop: 'name',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '价格',
        align: 'center',
        prop: 'price',
        slot: 'price'
      }
    },
    {
      attrs: {
        label: '订单类型',
        align: 'center',
        prop: 'order_type',
        slot: 'order_type'
      }
    },
    {
      attrs: {
        label: '支付方式',
        align: 'center',
        prop: 'pay_type',
        slot: 'pay_type'
      }
    },
    {
      attrs: {
        label: '订单状态',
        prop: 'status',
        align: 'center',
        slot: 'status'
      }
    },
    {
      attrs: {
        label: '创建时间',
        prop: 'CreatedAt',
        align: 'center',
        slot: 'CreatedAt'
      }
    },
    {
      attrs: {
        label: '操作',
        prop: 'operate',
        align: 'center'
      },
      slot: 'operate'
    }
  ]
}

// VIP用户搜索配置
export const VIP_USER_SEARCH_CONFIG = [
  {
    type: 'input',
    prop: 'user_id',
    label: '用户ID',
    placeholder: '请输入用户ID',
  },
  {
    type: 'input',
    prop: 'name',
    label: '用户名称',
    placeholder: '请输入用户名称',
  }
]

// VIP用户表格配置
export const VIP_USER_TABLE_CONFIG = {
  index: true,
  schemes: [
    {
      attrs: {
        label: '头像',
        prop: 'avatar',
        align: 'center'
      },
      slot: 'avatar'
    },
    {
      attrs: {
        label: '用户ID',
        prop: 'id',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '用户名称',
        prop: 'nick_name',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '手机号',
        prop: 'phone',
        align: 'center'
      }
    },
    {
      attrs: {
        label: 'VIP等级',
        prop: 'user_label',
        align: 'center'
      },
      slot: 'user_label'
    },
    {
      attrs: {
        label: 'VIP到期时间',
        prop: 'vip_expire_time',
        align: 'center'
      },
      slot: 'vip_expire_time'
    },
    {
      attrs: {
        label: '账户余额',
        prop: 'balance',
        align: 'center'
      },
      slot: 'balance'
    },
    {
      attrs: {
        label: '操作',
        prop: 'operate',
        align: 'center'
      },
      slot: 'operate'
    }
  ]
}

// 用户登录日志搜索配置
export const LOGIN_LOG_SEARCH_CONFIG = [
  {
    type: 'input',
    prop: 'user_id',
    label: '用户ID',
    placeholder: '请输入用户ID',
  },
  {
    type: 'input',
    prop: 'user_name',
    label: '用户名称',
    placeholder: '请输入用户名称',
  },
  {
    type: 'input',
    prop: 'ip',
    label: '登录IP',
    placeholder: '请输入登录IP地址',
  },
]

// 用户登录日志表格配置
export const LOGIN_LOG_TABLE_CONFIG = {
  index: true,
  schemes: [
    {
      attrs: {
        label: '用户ID',
        prop: 'user_id',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '用户名称',
        prop: 'user_name',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '手机号',
        prop: 'phone',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '登录IP',
        prop: 'ip',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '登录地址',
        prop: 'address',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '设备信息',
        prop: 'device',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '登录方式',
        prop: 'mode',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '登录时间',
        prop: 'login_time',
        align: 'center'
      },
      slot: 'login_time'
    }
  ]
}

// 用户列表
export const USER_TABLE_CONFIG = {
  index: true,
  schemes: [
    {
      attrs: {
        label: '用户ID',
        prop: 'ID',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '头像',
        prop: 'avatar',
        align: 'center'
      },
      slot: 'avatar'
    },
    {
      attrs: {
        label: '名称',
        prop: 'nick_name',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '状态',
        prop: 'status',
        align: 'center'
      },
      slot: 'status'
    },{
      attrs: {
        label: 'VIP到期时间',
        prop: 'vip_expire_time',
        align: 'center'
      },
      slot: 'vip_expire_time'
    },{
      attrs: {
        label: '用户类别',
        prop: 'user_type',
        align: 'center'
      },
      slot: 'user_type'
    },
    {
      attrs: {
        label: 'VIP',
        prop: 'user_label',
        align: 'center'
      },
      slot: 'user_label'
    },
    {
      attrs: {
        label: '账户余额',
        prop: 'balance',
        align: 'center'
      },
      slot: 'balance'
    },
    {
      attrs: {
        label: '操作',
        prop: 'operate',
        align: 'center'
      },
      slot: 'operate'
    }
  ]
}

// 文章列表
export const ARTICLE_TABLE_CONFIG = {
  select: true,
  index: true,
  rowKey: 'ID',
  schemes: [
    {
      attrs: {
        label: '封面',
        prop: 'coverImg',
        align: 'center'
      },
      slot: 'coverImg'
    },
    {
      attrs: {
        label: '标题',
        prop: 'title',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '讲师',
        prop: 'teacherName',
        align: 'center'
      }
    },
    {
      attrs: {
        label: '价格',
        prop: 'price',
        align: 'center'
      },
      slot: 'price'
    },
    {
      attrs: {
        label: '是否免费',
        prop: 'isFree',
        align: 'center'
      },
      slot: 'isFree'
    },
    {
      attrs: {
        label: '更新时间',
        prop: 'UpdatedAt',
        align: 'center'
      },
      slot: 'UpdatedAt'
    },
    {
      attrs: {
        label: '发布状态',
        prop: 'status',
        align: 'center'
      },
      slot: 'status'
    },
    {
      attrs: {
        label: '操作',
        prop: 'operate',
        align: 'center'
      },
      slot: 'operate'
    }
  ]
}
