mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 21:06:42 +08:00
179 lines
3.4 KiB
JavaScript
179 lines
3.4 KiB
JavaScript
// import ajax from '@/utils/xajax.js'
|
|
// import ajax from '../cesource/index.js';
|
|
import ajax from '../ajax';
|
|
const baseURL = process.env.VUE_APP_CESOURCE_BASE_API;
|
|
|
|
|
|
/**
|
|
* 添加或者编辑
|
|
* @param 参数见设计文档
|
|
* */
|
|
const save=function (data){
|
|
return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/save',data);
|
|
}
|
|
|
|
/**
|
|
* 添加或者编辑
|
|
* @param 参数见设计文档
|
|
* */
|
|
const update=function (data){
|
|
return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/update',data);
|
|
}
|
|
|
|
/**
|
|
* 详情
|
|
* */
|
|
const detail=function (id){
|
|
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/detail?id='+id);
|
|
}
|
|
|
|
/**
|
|
* 删除笔记
|
|
* */
|
|
const del=function (id){
|
|
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/delete?id='+id);
|
|
}
|
|
|
|
/**
|
|
* 查询课程笔记
|
|
* @param{
|
|
* pageIndex
|
|
* pageSize
|
|
* courseId 课程id
|
|
* openType 公开类型
|
|
* }
|
|
* */
|
|
const coursePage=function (query){
|
|
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/course-page',query);
|
|
}
|
|
|
|
/**
|
|
* 查询我的指定课程笔记
|
|
* */
|
|
const myCourse=function (courseId){
|
|
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/mycourse?courseId='+courseId);
|
|
}
|
|
|
|
/**
|
|
* 查询笔记的修改历史
|
|
* */
|
|
const history=function (noteId){
|
|
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/modify/history?noteId='+noteId);
|
|
}
|
|
|
|
|
|
/**
|
|
* 我的笔记
|
|
* type 我发布的是1 我导入的是2
|
|
* orderType 升序降序
|
|
* orderField排序字段
|
|
* courseId 课程id
|
|
* */
|
|
const query=function (data){
|
|
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/query',data);
|
|
}
|
|
|
|
/**
|
|
* 课程列表 应该是当前用户记过笔记的课程
|
|
* */
|
|
const course=function (){
|
|
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/course');
|
|
}
|
|
/**
|
|
* 还原
|
|
* 笔记id
|
|
* */
|
|
const restore=function (id){
|
|
return ajax.get(baseURL,'/xboe/subgroup/m/noteinfo/restore?id='+id);
|
|
}
|
|
|
|
/**
|
|
* 二次查询
|
|
* @param{
|
|
* ids
|
|
* }
|
|
* */
|
|
const ids=function (data){
|
|
return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/ids',data);
|
|
}
|
|
|
|
/**
|
|
* 导出excel
|
|
* @param {
|
|
* ids ["",""]
|
|
* }
|
|
* */
|
|
const exportExcel=function (data){
|
|
// return ajax.postJsonToFile(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data);
|
|
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data,{responseType: 'blob'});
|
|
}
|
|
|
|
/**
|
|
* 导出excel预览
|
|
* @param {
|
|
* ids ["",""]
|
|
* }
|
|
* */
|
|
const exportExcelPre=function (data){
|
|
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/excel-detail',data,{responseType: 'blob'});
|
|
}
|
|
|
|
/**
|
|
* 导出pdf预览
|
|
* @param {
|
|
* ids ["",""]
|
|
* }
|
|
* */
|
|
const exportPdfPre=function (data){
|
|
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/pdf-detail',data);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 导出pdf
|
|
* @param{
|
|
*
|
|
* }
|
|
* */
|
|
const exportPdf=function (data){
|
|
// return ajax.postJson(baseURL,'/xboe/subgroup/m/noteinfo/exportPdf',data);
|
|
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/exportPdf',data);
|
|
}
|
|
|
|
/**
|
|
* 我的笔记收藏和分享都是这一个,目前只有收藏
|
|
* @param{
|
|
* paegIndex
|
|
* pageSize
|
|
* dataType 1收藏 2分享
|
|
* orderType 排序顺序 顺序倒叙
|
|
* orderField 排序字段
|
|
* keyword 关键字查询
|
|
* }
|
|
* */
|
|
const pagelist=function (query){
|
|
return ajax.post('/xboe/subgroup/m/noteinfo/pagelist',query);
|
|
}
|
|
|
|
export default {
|
|
save,
|
|
detail,
|
|
del,
|
|
coursePage,
|
|
myCourse,
|
|
history,
|
|
pagelist,
|
|
query,
|
|
course,
|
|
update,
|
|
restore,
|
|
ids,
|
|
exportExcel,
|
|
exportPdf,
|
|
exportExcelPre,
|
|
exportPdfPre
|
|
}
|