// 考试管理 import ajax from '@/utils/xajax.js' // 分页查询 // 参数 pageIndex 第几页 // pageSize 每页展示条数 // keyWord 关键字 // published true或者false // // ownership2(2级资源归属) // ownership1(1级资源归属) // ownership3(3级资源归属) // const querylist = function(query) { return ajax.post('/xboe/m/exam/test/pageList', query); } // 新建考试 // 参数这块我给截图 const save = function(data) { return ajax.postJson('/xboe/m/exam/test/save', data); } // 修改考试,参数和添加一样 const update = function(data) { return ajax.postJson('/xboe/m/exam/test/update', data); } // 考试详情 // 参数 考试id const detail = function(id) { return ajax.get('/xboe/m/exam/test/detail?id=' + id); } // 删除 const del = function(id) { return ajax.get('/xboe/m/exam/test/delete?id=' + id); } /** * 发布考试 * @param {Object} id * @param {Object} publish 如果不传就是true */ const pulish = function(id, publish) { let flag = true; if (!publish) { flag = publish; } return ajax.post('/xboe/m/exam/test/publish?id=' + id + '&publish=' + flag); } /** *@parma{ * testId 考试id *} */ const exports=function (query){ return ajax.post('/xboe/m/exam/alone/answer/export',query,{responseType: 'blob'}); } /** * @param{ * id 考试id * enabled true 上架 false 下架 * } * */ const enabled=function(query){ return ajax.post('/xboe/m/exam/test/enabled',query); } export default { detail, update, del, save, querylist, pulish, exports, enabled }