Commit 260af2eb authored by 刘怀志's avatar 刘怀志

题库管理暂存

parent e360ca85
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询试题表列表
export function listTeaExamQuestions(query) {
return request({
url: '/post/questions/questionList/' + query.id,
method: 'get',
params: query
})
}
// 2. 查询试题表详细信息
export function getTeaExamQuestions(businessId) {
return request({
url: '/post/questions/detail/' + businessId,
method: 'get'
})
}
// 3. 新增试题表
export function addTeaExamQuestions(data) {
return request({
url: '/post/blesson/addtopic',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
// 4. 修改试题表
export function updateTeaExamQuestions(data) {
return request({
url: '/post/questions/update',
method: 'put',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
// 5. 逻辑删除试题表
export function delTeaExamQuestions(businessId) {
return request({
url: '/teaexamquestions/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出试题表
export function exportTeaExamQuestions(query) {
return request({
url: '/teaexamquestions/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 7.修改试题状态
export function updateStatus(data) {
return request({
url: `/post/questions/updateStatus/${data.flag}/${data.businessId}`,
method: 'put'
})
}
// 8.下载开课导入模板
export function importTemplateTrialCourse(params) {
return request({
url: '/teaexamquestions/importTemplate',
method: 'get',
responseType: 'blob',
params
})
}
// 9.导入开课信息
export function importExcel(data, courseId) {
return request({
url: '/teaexamquestions/importDictData',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
transformRequest: [(data) => {
return data
}],
data,
params: { courseId }
})
}
...@@ -91,6 +91,12 @@ export function blessonRemove(data) { ...@@ -91,6 +91,12 @@ export function blessonRemove(data) {
url: '/post/blesson/deleteLogical/' + data, url: '/post/blesson/deleteLogical/' + data,
method: 'DELETE' method: 'DELETE'
}) })
}// 课程管理删除
export function deleteEnterprise(data) {
return request({
url: `/post/blesson/deleteEnterprise/${data.id}/${data.busId}`,
method: 'DELETE'
})
} }
// 课程管理导入 // 课程管理导入
export function excelImport(data) { export function excelImport(data) {
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
<el-option label="单选题" value="1" /> <el-option label="单选题" value="1" />
<el-option label="多选题" value="2" /> <el-option label="多选题" value="2" />
<el-option label="判断题" value="3" /> <el-option label="判断题" value="3" />
<el-option label="简答题" value="4" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="题目难度" prop="unit"> <el-form-item label="题目难度" prop="unit">
...@@ -93,8 +92,8 @@ ...@@ -93,8 +92,8 @@
<el-switch <el-switch
v-model="scope.row.flag" v-model="scope.row.flag"
class="switchDisabledStyle" class="switchDisabledStyle"
inactive-value="0" :inactive-value="0"
active-value="1" :active-value="1"
@click.native="handleStatusChange(scope.row,scope.$index)" @click.native="handleStatusChange(scope.row,scope.$index)"
/> />
</template> </template>
...@@ -283,8 +282,8 @@ ...@@ -283,8 +282,8 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="状态" prop="flag"> <el-form-item label="状态" prop="flag">
<el-radio-group v-model="form.flag"> <el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio> <el-radio :label="1">启用</el-radio>
<el-radio label="0">停用</el-radio> <el-radio :label="0">停用</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -340,7 +339,7 @@ import { ...@@ -340,7 +339,7 @@ import {
addTeaExamQuestions, addTeaExamQuestions,
delTeaExamQuestions, getTeaExamQuestions, delTeaExamQuestions, getTeaExamQuestions,
listTeaExamQuestions, updateStatus, updateTeaExamQuestions, importExcel, importTemplateTrialCourse listTeaExamQuestions, updateStatus, updateTeaExamQuestions, importExcel, importTemplateTrialCourse
} from '@/api/examination/teaExamQuestions' } from '@/api/examination/teaExamQuestionsCompany'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
export default { export default {
...@@ -394,7 +393,7 @@ export default { ...@@ -394,7 +393,7 @@ export default {
optionC: '', optionC: '',
optionD: '', optionD: '',
mark: '', mark: '',
flag: '1', flag: 1,
remarks: '', remarks: '',
weight: '', weight: '',
optionsList: [] optionsList: []
...@@ -403,8 +402,7 @@ export default { ...@@ -403,8 +402,7 @@ export default {
questionTypeList: [ questionTypeList: [
{ label: '单选题', value: 1 }, { label: '单选题', value: 1 },
{ label: '多选题', value: 2 }, { label: '多选题', value: 2 },
{ label: '判断题', value: 3 }, { label: '判断题', value: 3 }
{ label: '简答题', value: 4 }
], ],
// 难度List // 难度List
difficultyList: [ difficultyList: [
...@@ -518,7 +516,7 @@ export default { ...@@ -518,7 +516,7 @@ export default {
this.form.mark = '' this.form.mark = ''
this.form.number = '' this.form.number = ''
this.form.weight = '0' this.form.weight = '0'
this.form.flag = '1' this.form.flag = 1
break break
case 4: case 4:
this.form.optionA = '' this.form.optionA = ''
...@@ -530,7 +528,7 @@ export default { ...@@ -530,7 +528,7 @@ export default {
this.form.mark = '' this.form.mark = ''
this.form.number = '' this.form.number = ''
this.form.weight = '0' this.form.weight = '0'
this.form.flag = '1' this.form.flag = 1
break break
} }
console.log('form', this.form) console.log('form', this.form)
...@@ -693,7 +691,7 @@ export default { ...@@ -693,7 +691,7 @@ export default {
this.tableData = [] this.tableData = []
_this.fullscreenLoading = true _this.fullscreenLoading = true
const params = { const params = {
courseId: _this.form.courseId, id: _this.form.courseId,
page: _this.queryParams.page, page: _this.queryParams.page,
rows: _this.queryParams.rows, rows: _this.queryParams.rows,
number: _this.queryParams.number, number: _this.queryParams.number,
...@@ -717,8 +715,8 @@ export default { ...@@ -717,8 +715,8 @@ export default {
}, },
// 修改状态 // 修改状态
handleStatusChange(row, index) { handleStatusChange(row, index) {
const flag = row.flag === '1' ? '0' : '1' const flag = row.flag === 1 ? 0 : 1
const text = row.flag === '1' ? '启用' : '停用' const text = row.flag === 1 ? '启用' : '停用'
const params = { const params = {
businessId: row.businessId, businessId: row.businessId,
flag: row.flag flag: row.flag
...@@ -857,7 +855,7 @@ export default { ...@@ -857,7 +855,7 @@ export default {
optionC: '', optionC: '',
optionD: '', optionD: '',
mark: '', mark: '',
flag: '1', flag: 1,
remarks: '', remarks: '',
weight: '', weight: '',
optionsList: [], optionsList: [],
......
...@@ -466,7 +466,7 @@ import { ...@@ -466,7 +466,7 @@ import {
downloadZip, downloadZip,
queryPcLessonEvaluationByPagination, queryPcLessonEvaluationByPagination,
findAllUnitInfo, findAllUnitInfo,
getEnterpriseListById, addEnterprise, blessonUpdate getEnterpriseListById, addEnterprise, blessonUpdate, deleteEnterprise
} from '@/api/jobQuestionBank/index' } from '@/api/jobQuestionBank/index'
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { getDict } from '@/api/system/dict/data' import { getDict } from '@/api/system/dict/data'
...@@ -1650,18 +1650,18 @@ export default { ...@@ -1650,18 +1650,18 @@ export default {
}).then(() => { }).then(() => {
const _this = this const _this = this
const params = { const params = {
lessonId: _this.lessonId, id: _this.currentLessionId,
ossId: data.businessId busId: data.enterpriseId
} }
console.log('params', params) console.log('params', params)
delZip(params).then(res => { deleteEnterprise(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
// _this.success(res) // _this.success(res)
this.$message({ this.$message({
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
_this.getZipList() _this.getEnterpriseList(_this.currentLessionId)
} else { } else {
_this.warning(res) _this.warning(res)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment