import request from '@/utils/request';
import { REQUEST } from '@/utils/request';

// 用户信息
export const user_info = (data = {}) =>
  request({
    url: '/user/main/user_info',
    data: data
  })

// 年级 jcxx_grade 列表接口
export const grade_list = (data = {}) =>
  request({
    url: '/jcxx/grade/index',
    data: data
  })

// 双师一生列表
export const ssyskc_list = (data = {}) =>
  request({
    url: '/kzkt/ssyskc/index',
    data: data
  })

// 双师一生详情
export const ssyskc_detail = (data = {}) =>
  request({
    url: '/kzkt/ssyskc/detail',
    data: data
  })

// 学科 jcxx_subject 列表接口
export const subject_list = (data = {}) =>
  request({
    url: '/jcxx/subject/index',
    data: data
  })


// 文件上传
export const upload_file = (file, firstpage = "", lastpage = "", convert = "") =>
  REQUEST.upload({
    url: '/upload/main/file',
    data: { filedata: file, firstpage: firstpage, lastpage: lastpage, convert: convert }
  })


// 双师一生添加
export const ssyskc_add = (data = {}) =>
  request({
    url: '/kzkt/ssyskc/add',
    data: data
  })

// 双师一生编辑
export const ssyskc_edit = (data = {}) =>
  request({
    url: '/kzkt/ssyskc/edit',
    data: data
  })

// 双师一生删除
export const ssyskc_delete = (data = {}) =>
  request({
    url: '/kzkt/ssyskc/delete',
    data: data
  })

// 用户列表
export const user_list = (data = {}) => {
  return request({
    url: '/user/main/index',
    data,
  })
}

// 协同备课创建
export const xtbk_add = (data = {}) => {
  return request({
    url: '/zhjy/xtbk/add',
    data: {
      zhjy_xtbk: data.zhjy_xtbk
    }
  })
}
// 协同备课编辑
export const xtbk_edit = (data = {}) => {
  return request({
    url: '/zhjy/xtbk/edit',
    data: {
      zx_id: data.zx_id,
      zhjy_xtbk: data.zhjy_xtbk
    }
  })
}
// 协同备课删除
export const xtbk_delete = (data = {}) => {
  return request({
    url: '/zhjy/xtbk/delete',
    data,
  })
}
// 协同备课列表
export const xtbk_list = (data = {}) =>
  request({
    url: '/zhjy/xtbk/index',
    data,
  })

// 协同备课详情
export const xtbk_detail = (data = {}) => {
  return request({
    url: '/zhjy/xtbk/detail',
    data,
  })
}

//同步教研列表
export const tbjy_list = (data = {}) =>
  request({
    url: '/zhjy/tbjy/index',
    data,
  })
//同步教研新建
export const tbjy_add = (data = {}) => {
  return request({
    url: '/zhjy/tbjy/add',
    data: {
      issubmit: '1',
      zhjy_tbjy: {
        zt_img: data.zt_img,
        zt_content: data.zt_content,
        zt_name: data.zt_name,
        zt_zrjs: data.zt_zrjs,
        grade_name: data.grade_name,
        grade_id: data.grade_id,
        subject_id: data.subject_id,
        subject_name: data.subject_name,
        zt_kssj: data.zt_kssj,
        zt_jssj: data.zt_jssj,
        zt_cyjyjs_json: data.zt_cyjyjs_json
      }

    }

  })
}
//同步教研编辑
export const tbjy_edit = (data = {}) => {
  return request({
    url: '/zhjy/tbjy/edit',
    data: {
      issubmit: '1',
      zt_id: data.zt_id,
      zhjy_tbjy: {
        zt_img: data.zt_img,
        zt_content: data.zt_content,
        zt_name: data.zt_name,
        zt_zrjs: data.zt_zrjs,
        grade_name: data.grade_name,
        grade_id: data.grade_id,
        subject_id: data.subject_id,
        subject_name: data.subject_name,
        zt_kssj: data.zt_kssj,
        zt_jssj: data.zt_jssj,
        zt_cyjyjs_json: data.zt_cyjyjs_json

      }

    }

  })
}
//同步教研详情
export const tbjy_detail = (data = {}) => {
  return request({
    url: '/zhjy/tbjy/detail',
    data,
  })
}
//同步教研删除

export const tbjy_delete = (data = {}) => {
  return request({
    url: '/zhjy/tbjy/delete',
    data,
  })
}

//在线学习列表
export const zxxx_list = (data = {}) =>
  request({
    url: '/zhjy/zxxx/index',
    data: {
      page: data.page,
      limit: data.limit,
      keyword: data.keyword,
      zz_img: data.zz_img,
      zz_type: data.zz_type,
      grade_id: data.grade_id,
      grade_name: data.grade_name,
      subject_id: data.subject_id,
      subject_name: data.subject_name,
      zz_fbsj: data.zz_fbsj,
      zz_jsxx: data.zz_jsxx,
      zz_tag: data.zz_tag,
      zz_home_display: data.zz_home_display,


    }
  })

//在线学习新建
export const zxxx_add = (data = {}) => {
  return request({
    url: '/zhjy/zxxx/add',
    data: {
      issubmit: '1',
      zhjy_zxxx: {
        zz_img: data.zz_img,
        zz_content: data.zz_content,
        zz_name: data.zz_name,
        zz_jsxx: data.zz_jsxx,
        grade_name: data.grade_name,
        grade_id: data.grade_id,
        subject_id: data.subject_id,
        subject_name: data.subject_name,
        zz_starttime: data.zz_starttime,
        zz_endtime: data.zz_endtime,
        zz_bkjs_json: data.zz_bkjs_json,
        zz_fj: data.zz_fj,
        zz_video: data.zz_video,
      }

    }

  })
}
//在线学习编辑
export const zxxx_edit = (data = {}) => {
  return request({
    url: '/zhjy/zxxx/edit',
    data: {
      zz_id: data.zz_id,
      issubmit: '1',
      zhjy_zxxx: {
        zz_img: data.zz_img,
        zz_content: data.zz_content,
        zz_name: data.zz_name,
        zz_jsxx: data.zz_jsxx,
        grade_name: data.grade_name,
        grade_id: data.grade_id,
        subject_id: data.subject_id,
        subject_name: data.subject_name,
        zz_starttime: data.zz_starttime,
        zz_endtime: data.zz_endtime,
        zz_bkjs_json: data.zz_bkjs_json,
        zz_fj: data.zz_fj,
        zz_video: data.zz_video,
      }

    }

  })
}

//在线学习详情
export const zxxx_detail = (data = {}) => {
  return request({
    url: '/zhjy/zxxx/detail',
    data,
  })
}
//在线学习删除
export const zxxx_delete = (data = {}) => {
  return request({
    url: '/zhjy/zxxx/delete',
    data,
  })
}


export const user_avatar = (data = {}) =>
  request({
    url: '/user/main/user_avatar',
    data: {
      user_id: data.user_id
    }
  })

// 课程分类
export const cate_list = (data = {}) =>
  request({
    url: '/kczy/cate/index',
    data: data
  })
export const cate_tree_list = () =>
  request({
    url: '/kczy/cate/api_tree'
  })

// 课程列表
export const kc_list = (data = {}) =>
  request({
    url: '/kczy/kc/index',
    data: data
  })

// 课程删除
export const kc_delete = (data = {}) =>
  request({
    url: '/kczy/kc/delete',
    data: data
  })

// 课程添加
export const kc_add = (data = {}) =>
  request({
    url: '/kczy/kc/add',
    data: data
  })

// 课程编辑
export const kc_edit = (data = {}) =>
  request({
    url: '/kczy/kc/edit',
    data: data
  })

// 课程详情
export const kc_detail = (data = {}) =>
  request({
    url: '/kczy/kc/detail',
    data: data
  })


// 资源列表
export const files_list = (data = {}) =>
  request({
    url: '/kczy/files/index',
    data: data
  })

// 资源删除
export const files_delete = (data = {}) =>
  request({
    url: '/kczy/files/delete',
    data: data
  })

// 资源添加
export const files_add = (data = {}) =>
  request({
    url: '/kczy/files/add',
    data: data
  })

// 资源编辑
export const files_edit = (data = {}) =>
  request({
    url: '/kczy/files/edit',
    data: data
  })

// 资源详情
export const files_detail = (data = {}) =>
  request({
    url: '/kczy/files/detail',
    data: data
  })

