import request from '@/utils/request';
//民族 籍贯
export const option_list = (data = {}) =>
  request({
    url: '/common/sjzd/option',
    data: {
      cs_code: data.cs_code,
      admin: '1'
    }
  })
export const xsxx_list = (data = {}) =>
  request({
    url: '/user/main/index?admin=1',
    data: {
      admin: '1',
      page: data.page,
      limit: data.limit,
      keyword: data.keyword,
      user_name: data.user_name,
      user_role_id: '76',
      grade_id: data.grade_id,
      sm_id: data.sm_id,
      cm_id: data.cm_id,
      user_grade_num: data.user_grade_num,
      user_class_num: data.user_class_num,
      user_realname: data.user_realname,
      user_cardno: data.user_cardno,
      student_no: data.student_no,
      gender: data.gender,
    }
  })
export const xsxx_add = (data = {}) =>
  request({
    url: '/user/main/add',
    data: {
      admin: "1",
      user_main: {
        user_password: data.user_password,
        user_name: data.user_name,
        student_no: data.student_no,
        user_realname: data.user_realname,
        user_phone: data.user_phone,
        user_cardno: data.user_cardno,
        address: data.address,
        gender: data.gender,
        about: data.about,
        sm_id: data.sm_id,
        user_eyear: data.user_eyear,
        user_grade_num: data.user_grade_num,
        user_class_num: data.user_class_num,
        ue_jg_id: data.ue_jg_id,
        ue_jg_name: data.ue_jg_name,
        ue_mz_id: data.ue_mz_id,
        ue_mz_name: data.ue_mz_name,
        ue_zgbh: data.ue_zgbh,
        ue_zjlx: data.ue_zjlx,
        ue_zzmm: data.ue_zzmm,
        ue_xxmc: data.ue_xxmc,
        user_birthday: data.user_birthday,
        ue_grade_name: data.ue_grade_name,
        ue_class_name: data.ue_class_name,
        user_email: data.user_email,
        ue_province_id: data.ue_province_id,
        ue_city_id: data.ue_city_id,
        ue_jbxx_stu_jyxx: data.ue_jbxx_stu_jyxx,
        ue_jbxx_stu_ryxx: data.ue_jbxx_stu_jyxx,
         user_role_id: '76',
      }
    }
  })
export const xsxx_edit = (data = {}) =>
  request({
    url: '/user/main/edit',
    data: {
      admin: "1",
      user_id: data.user_id,
      user_main: {
        user_password: data.user_password,
        user_name: data.user_name,
        student_no: data.student_no,
        user_realname: data.user_realname,
        user_phone: data.user_phone,
        user_cardno: data.user_cardno,
        address: data.address,
        gender: data.gender,
        about: data.about,
        sm_id: data.sm_id,
        user_eyear: data.user_eyear,
        user_grade_num: data.user_grade_num,
        user_class_num: data.user_class_num,
        ue_jg_id: data.ue_jg_id,
        ue_jg_name: data.ue_jg_name,
        ue_mz_id: data.ue_mz_id,
        ue_mz_name: data.ue_mz_name,
        ue_zgbh: data.ue_zgbh,
        ue_zjlx: data.ue_zjlx,
        ue_zzmm: data.ue_zzmm,
        ue_xxmc: data.ue_xxmc,
        user_birthday: data.user_birthday,
        user_email: data.user_email,
        ue_province_id: data.ue_province_id,
        ue_city_id: data.ue_city_id,
        ue_xxmc: data.ue_xxmc,
        ue_grade_name: data.ue_grade_name,
        ue_class_name: data.ue_class_name,
        ue_jbxx_stu_jyxx: data.ue_jbxx_stu_jyxx,
        ue_jbxx_stu_ryxx: data.ue_jbxx_stu_jyxx
      }
    }
  })
export const xsxx_del = (data = {}) =>
  request({
    url: '/user/main/delete',
    data: {
      admin: "1",
      user_id: data.user_id
    }
  })
export const xsxx_detail = (data = {}) =>
  request({
    url: '/user/main/user_info',
    data: {
      admin: '1',
      user_id: data.user_id
    }
  })

// 学科 jcxx_subject 列表接口
export const subject_list = () =>
  request({
    url: '/jcxx/subject/index'
  })
// 年级 jcxx_grade 列表接口
export const grade_list = () =>
  request({
    url: '/jcxx/grade/index'
  })
// 学校列表接口
export const school_list = () =>
  request({
    url: '/school/main/index'
  })
// 班级列表接口
export const class_list = () =>
  request({
    url: '/jcxx/class/index'
  })
//省市接口
export const province_list = (data = {}) =>
  request({
    url: '/common/district/search',
    data: {
      upid: data.upid,
      admin: "1",
    },
  })