import * as api from '@/api/index'

// 学术活动
const symposiumForm = {
  fields: [
    {
      name: 'symposium_name',
      label: '名称',
      required: true,
      placeholder: '请输入学术活动名称',
      rules: [{ required: true, message: '请输入学术活动名称' }]
    },
    {
      fieldType: 'date',
      name: 'symposium_time',
      label: '时间',
      required: true,
      placeholder: '请选择学术活动时间',
      rules: [{ required: true, message: '请选择学术活动时间' }]
    },
    {
      name: 'symposium_lecturer',
      label: '主讲人',
      required: true,
      placeholder: '请输入主讲人姓名',
      rules: [{ required: true, message: '请输入主讲人姓名' }]
    },
    {
      name: 'symposium_address',
      label: '地址',
      required: true,
      placeholder: '请输入活动地址',
      rules: [{ required: true, message: '请输入活动地址' }]
    },
    {
      type: 'textarea',
      name: 'symposium_contents',
      label: '内容',
      required: true,
      placeholder: '请输入学术活动内容',
      autosize: { maxHeight: 200, minHeight: 140 },
      rules: [{ required: true, message: '请输入学术活动内容' }]
    }
  ]
}

// 乐分享
const sharingForm = {
  fields: [
    {
      name: 'personal_name',
      label: '姓名',
      required: true,
      placeholder: '请输入姓名',
      rules: [{ required: true, message: '请输入姓名' }]
    },
    {
      name: 'trade_name',
      label: '行业',
      required: true,
      placeholder: '请输入行业',
      rules: [{ required: true, message: '请输入行业' }]
    },
    {
      name: 'age',
      label: '年龄',
      required: true,
      placeholder: '请输入年龄',
      rules: [{ required: true, message: '请输入年龄' }]
    },
    {
      name: 'class_name',
      label: '班级',
      required: true,
      placeholder: '请输入班级',
      rules: [{ required: true, message: '请输入班级' }]
    },
    {
      type: 'tel',
      name: 'telephone',
      label: '电话',
      required: true,
      placeholder: '请输入电话',
      rules: [{ required: true, message: '请输入电话' }]
    },
    {
      name: 'sharing_theme',
      label: '主题',
      required: true,
      placeholder: '请输入乐分享内容',
      rules: [{ required: true, message: '请输入分享主题' }]
    }
  ]
}

// 重修
const retakeForm = {
  fields: [
    {
      name: 'personal_name',
      label: '姓名',
      required: true,
      placeholder: '请输入姓名',
      rules: [{ required: true, message: '请输入姓名' }]
    },
    {
      name: 'class_name',
      label: '班级',
      required: true,
      placeholder: '请输入班级',
      rules: [{ required: true, message: '请输入班级' }]
    },
    {
      fieldType: 'select',
      name: 'semester_name',
      label: '挂科学期',
      required: true,
      placeholder: '请选择挂科学期',
      rules: [{ required: true, message: '请选择挂科学期' }],
      remote: {
        request: api.getSemesters,
        valueKey: 'semester_name',
        change: 'course_name'
      }
    },
    {
      fieldType: 'select',
      name: 'course_name',
      label: '重修课程',
      required: true,
      placeholder: '请选择重修课程',
      rules: [{ required: true, message: '请选择重修课程' }],
      remote: {
        request: api.getCourses,
        valueKey: 'course_name'
      }
    },
    {
      fieldType: 'uploader',
      name: 'payment_instrument',
      label: '上传缴费凭证',
      required: true,
      placeholder: '请上传缴费凭证',
      rules: [{ required: true, message: '请上传缴费凭证' }]
    }
  ]
}
export default {
  // 学术活动
  symposium: {
    list: {
      title: '学术活动',
      emptyText: '您还没有申请过学术活动',
      buttonText: '申请新的活动',
      card: {
        title: { name: 'symposium_name' },
        fields: [
          { name: 'symposium_time', label: '活动时间' },
          { name: 'symposium_lecturer', label: '主讲人' }
        ]
      }
    },
    create: {
      title: '申请新的学术活动',
      tips:
        '温馨提示：学生自发组织的各类校友活动，包括并不限于：论坛、讲座、沙龙、参访、拓展、游学等，接受紫荆-索菲亚金融方向工商管理硕士学位中心的监督与指导。',
      buttonText: '提交',
      form: symposiumForm
    },
    edit: {
      title: '编辑学术活动',
      tips:
        '温馨提示：学生自发组织的各类校友活动，包括并不限于：论坛、讲座、沙龙、参访、拓展、游学等，接受紫荆-索菲亚金融方向工商管理硕士学位中心的监督与指导。',
      buttonText: '提交',
      form: symposiumForm
    }
  },
  // 乐分享
  sharing: {
    list: {
      title: '乐分享',
      emptyText: '您还没有申请过乐分享',
      buttonText: '申请新的分享',
      card: {
        title: { name: 'sharing_theme' },
        fields: [
          { name: 'class_name', label: '班级' },
          { name: 'personal_name', label: '申请人' },
          { name: 'telephone', label: '电话' }
        ]
      }
    },
    create: {
      title: '申请新的分享',
      buttonText: '提交',
      form: sharingForm
    },
    edit: {
      title: '编辑乐分享',
      buttonText: '提交',
      form: sharingForm
    }
  },
  // 重修
  retake: {
    list: {
      title: '重修',
      emptyText: '您还没有申请过重修',
      buttonText: '申请重修',
      card: {
        fields: [
          { name: 'class_name', label: '班级' },
          { name: 'semester_name', label: '挂科学期' },
          { name: 'course_name', label: '课程名称' }
        ]
      }
    },
    create: {
      title: '申请重修',
      buttonText: '提交',
      form: retakeForm
    },
    edit: {
      title: '编辑重修',
      buttonText: '提交',
      form: retakeForm
    }
  }
}
