+
+
+
+
+
+ diff --git a/src/api/index.js b/src/api/index.js index 49ade8be..f1afd2ed 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -37,11 +37,8 @@ import http from "./config"; // 接口-请求 -// 创建编辑单层项目 +// 创建编辑单层项目(type=3)/ 多层项目(type=1)/ 多层子项目(type=2) export const createProject = (obj) => http.post('/admin/project/edit', obj) -// 创建多层项目 -export const createStoreyProject = (obj) => http.post('/admin/project/edit', obj) - // 获取项目列表 export const getProjectList = (obj) => http.post('/admin/project/list', obj) \ No newline at end of file diff --git a/src/api/indexDiscuss.js b/src/api/indexDiscuss.js index cc9863a9..5167f69c 100644 --- a/src/api/indexDiscuss.js +++ b/src/api/indexDiscuss.js @@ -10,4 +10,4 @@ export const getDiscussDetail = (obj) => http.post('/discuss/getDiscussDetail', export const deleteDiscuss = (obj) => http.post('/discuss/deleteDiscuss', { params: obj }); //修改讨论接口 -export const updateDiscuss = (obj) => http.post('/discuss/updateDiscuss', { params: obj }); \ No newline at end of file +export const updateDiscuss = (obj) => http.post('/discuss/updateDiscuss', obj ); \ No newline at end of file diff --git a/src/api/indexEval.js b/src/api/indexEval.js index b02e4875..9967452d 100644 --- a/src/api/indexEval.js +++ b/src/api/indexEval.js @@ -1,5 +1,5 @@ import http from "./config"; -// import qs from 'qs'; +import qs from 'qs'; /** @@ -33,15 +33,19 @@ import http from "./config"; * axios.post(`${this.$url}/test/testRequest`,data).then() * */ - +// , { +// header: { +// 'token': '123', +// } +// } // 接口-请求 //创建测评 -export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj,); +export const createEvaluation = (obj) => http.post('/evaluation/createEvaluation', obj); //上传组件 -export const fileUp = (obj) => http.post('/file/upload', obj,); +export const fileUp = (obj) => http.post('/file/upload', obj, qs.stringify({ obj })); //删除测评信息 export const deleteEvaluationById = (obj) => http.post('/evaluation/deleteEvaluationById', { params: obj }) diff --git a/src/api/indexLevel.js b/src/api/indexLevel.js index 39e22fcd..b7b1b400 100644 --- a/src/api/indexLevel.js +++ b/src/api/indexLevel.js @@ -1,8 +1,14 @@ import http from "./config"; -//新建或编辑关卡 +//新建关卡 export const editChapter = (obj) => http.post('/admin/router/editChapter', obj, { headers: { 'token': '123' } +}); +//编辑关卡 +export const updateChapter = (obj) => http.post('/admin/router/editChapter', obj, { + headers: { + 'token': '123' + } }); \ No newline at end of file diff --git a/src/api/indexVote.js b/src/api/indexVote.js index e69de29b..ce450782 100644 --- a/src/api/indexVote.js +++ b/src/api/indexVote.js @@ -0,0 +1,75 @@ +import http from "./config"; +import qs from 'qs'; + + +/** + * 接口传参数方式(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() + * + */ +// , { +// header: { +// 'token': '123', +// } +// } + +// 接口-请求 + +//基础票数上传接口 +// export const baseVoteupload = (obj) => http.post('/vote/baseVoteupload', obj) + +//创建题干信息接口 +export const createOptionMessage = (obj) => http.post('/vote/createOptionMessage', obj) + +//投票信息创建接口 +export const createVote = (obj) => http.post('/vote/createVote', obj) + +//删除投票信息 +export const deleteVoteMessage = (obj) => http.post('/vote/deleteVoteMessage', { params: obj }) + +//修改投票信息接口 +export const editVote = (obj) => http.post('/vote/editVote', obj) + +//根据题干ID获取题干信息 +export const queryStemByStemId = (obj) => http.post('/vote/queryStemByStemId', { params: obj }) + +//修改题干信息接口 +export const updateStemMessage = (obj) => http.post('/vote/updateStemMessage', obj); + +//上传组件 +export const fileUp = (obj) => http.post('/file/upload', obj, qs.stringify({ obj })); + + +// 测试方法 +// import * as api from '../../api/index' +// api.getLearnPath({}).then(res => { +// console.log(res) +// }).catch(err => { +// console.log(err) +// }) diff --git a/src/components/drawers/AddActive.vue b/src/components/drawers/AddActive.vue index 5388f71c..baceb73c 100644 --- a/src/components/drawers/AddActive.vue +++ b/src/components/drawers/AddActive.vue @@ -71,6 +71,12 @@
+
+
+
+
+
+