Files
fe-manage/src/api/index1.js
2022-12-22 18:16:36 +08:00

157 lines
6.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-04 22:45:31
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-08 20:20:26
* @FilePath: /fe-manage/src/api/index1.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import http from "./config";
import qs from "qs";
// import { getCookie } from '../api/method'
/**
* 接口传参数方式get
* axios.get('/user', {
* params: {
* id: 12345
* name: user
* }
* }).then(res => console.log(res))
*
* 接口传参三种方式post/put/patch
*
* 1.'Content-Type'= 'multipart/form-data',传参格式为 formData。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'multipart/form-data'
* var formData=new FormData();
* formData.append('user',123456);formData.append('pass',12345678);
* axios.post("/notice",formData).then()
*
* 2.'Content-Type'= 'application/x-www-form-urlencoded',传参格式为 query 形式,使用$qs.stringify。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/x-www-form-urlencoded'
* let data = {"code":"1234","name":"yyyy"};
* axios.post(`${this.$url}/test/testRequest`,qs.stringify({data})).then()
*
*
* 3.'Content-Type'= 'application/json传参格式为 raw (JSON格式)。
* (全局请求头:'Content-Type'= 'application/x-www-form-urlencoded'
* request的Header:'Content-Type'= 'application/json;charset=UTF-8'
* let data = {"code":"1234","name":"yyyy"}
* axios.post(`${this.$url}/test/testRequest`,data).then()
*
*/
//上传文件
export const uploadFile = (obj) =>
http.post("/test/testRequest", qs.stringify({obj}));
// 接口-请求
//创建学习路径
export const createLearnPath = (obj) => http.post("/admin/router/edit", obj);
// 获取学习路径图列表
export const getLearnPath = (obj) => http.post("/admin/router/list", obj);
//学习路径图的发布、停用、删除
export const handleLearnPath = (obj) => http.post("/admin/router/handle", obj);
//获取路径图统计数据
export const getLearnCount = (routerId) =>
http.get("/admin/router/getCount", {params: {routerId: routerId}});
//新建或编辑关卡
export const editChapter = (obj) => http.post("/admin/router/editChapter", obj);
// 编辑路径图设置
export const setConfig = (obj) => http.post("/admin/router/setConfig", obj);
//获取学员列表
export const getStudent = (obj) => http.post("/admin/router/studentList", obj);
//获取路径图详情-包含关卡及任务列表
export const getRouterDetail = (routerId) =>
http.get("/admin/router/detail", {
params: {
routerId: routerId,
},
});
//添加学员
export const addStudent = (obj) => http.post("/admin/router/addStudent", obj);
//删除学员
export const delStudent = (obj) =>
http.post("/admin/router/deleteStudent", obj);
// 获取学员路径图进度明细
export const stuProgress = (obj) =>
http.post("/admin/router/studentProcess", obj);
//编辑学习路径基本信息
export const editLearnInfo = (obj) => http.post('/admin/router/editInfo', obj)
//项目基础信息-----------------------------------
//项目积分榜单
export const scoreRank = (obj) => http.post("/admin/project/scoreRank", obj);
//排行榜
export const billboard = (obj) => http.post("/admin/project/billboard", obj);
//项目基础信息-----------------------------------
//课程----------------------------------------------
// //提交审核
// export const courseHandle = (obj) => http.post('/admin/offcourse/handle', obj)
//课程----------------------------------------------
//公共信息---------------------------------------------------
// 获取字典信息
export const getDict = (obj) => http.post('/dict/getList', obj)
//获取组织树一级列表
export const getOrgTree = (obj) => http.post('/admin/router/orgList', obj)
//根据id获取组织树一级元素下所有子元素
export const orgTreeList = (obj) => http.post('/admin/router/orgTreeList', obj)
//根据id获取部门下学员
export const searchUsersByOrgId = (obj) => http.post('/admin/router/searchUsersByOrgId', obj)
//获取组织信息(修改版)
export const getOrgInfo = (obj) => http.post('/admin/orgStruct/getOrgInfo', obj)
export const getOrgTreeInfo = (obj) => http.get('/org/initOrg', {params: obj})
//获取员工(修改版)
export const getMemberInfo = (obj) => http.post('/admin/orgStruct/getMemberInfo', obj)
//获取受众(修改版)
export const getAudienceInfo = (obj) => http.post('/admin/orgStruct/getAudienceInfo', obj)
//获取、添加授权(修改版)
export const optionAuthPerm = (obj) => http.post('/admin/AuthPerm/optionAuthPerm', obj)
//获取学员列表
export const getStuList = (obj) => http.post('/admin/orgStruct/getStudentRef', obj)
//获取用户登录
export const getUser = () => http.post('/admin/CheckUser/login', {withCredentials: true})
//公共信息---------------------------------------------------
//添加项目学员
export const addStudentProject = (obj) => http.post('/admin/project/addStudent', obj)
//添加课程学员
export const addStudentCourse = (obj) => http.post("/admin/offcourse/addStudent", obj);
// 获取组织结构树
export const orgtree = () => http.get("/org/tree");
export const saveStu = obj => http.post("/admin/student/addStudent", obj);
export const moveStudent = obj => http.post("/admin/student/moveStudent", obj);
export const getStuPage = obj => http.get("/admin/student/getStudent", {params: obj});
export const delStudentList = obj => http.post("/admin/student/delStudent", obj);
export const validateName = obj => http.post("/admin/validate/validateName", obj);
//获取积分列表
export const noticeList = (projectId) =>
http.post(
`/admin/project/noticeList?projectId=` +
projectId +
``
);
// 测试方法
// import * as api from '../../api/index'
// api.getLearnPath({}).then(res => {
// console.log(res)
// }).catch(err => {
// console.log(err)
// })
// export const choiceEvaluation = (obj) => http.post('/evaluation/choiceEvaluation', obj);