提交 8fb4b40f authored 作者: lihuihui's avatar lihuihui

修改接口项目传参

上级 4b45049b
......@@ -58,9 +58,9 @@ export function questionDetail(id) {
/**
* 导入题
*/
export function importQuestion(data) {
export function importQuestion(tag, data) {
return httpRequest({
url: '/api/qbs/admin/v1/question/import/x1',
url: `/api/qbs/admin/v1/question/import/${tag}`,
method: 'post',
headers: { 'Content-Type': 'multipart/form-data' },
timeout: 900000,
......
......@@ -100,7 +100,7 @@ export default {
pointOptions: [],
ruleForm: {
permission: '1',
project_prefix: 'x1',
project_prefix: '',
question_type: 1,
question_difficulty: '',
question_title: '',
......
......@@ -48,6 +48,11 @@ export default {
fileList: []
}
},
computed: {
activeProject() {
return this.$store.state.activeProject || {}
}
},
methods: {
beforeUpload(file) {
const suffix = splitStrLast(file.name, '.')
......@@ -59,7 +64,7 @@ export default {
}
},
fetchFileUpload(data) {
importQuestion({ file: data.file, exam_id: this.id }).then(res => {
importQuestion(this.activeProject.tag, { file: data.file, exam_id: this.id }).then(res => {
if (res.code === 0) {
this.$message.success('导入数据成功')
history.go(0)
......
......@@ -39,13 +39,18 @@ export default {
}
}
},
computed: {
activeProject() {
return this.$store.state.activeProject || {}
}
},
mounted() {
this.getTreeList()
},
methods: {
// 获取tree列表
getTreeList() {
getQuestionCategory('x1').then(res => {
getQuestionCategory(this.activeProject.tag).then(res => {
if (Array.isArray(res.data)) {
this.initTree(res.data)
}
......@@ -54,7 +59,6 @@ export default {
// 发送请求添加 || 编辑tree
addTree() {
const data = {
project_prefix: 'x1',
pid: this.treeParams.id || 0,
category_name: this.treeParams.name || 'node'
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论