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) {
url: '/post/blesson/deleteLogical/' + data,
method: 'DELETE'
})
}// 课程管理删除
export function deleteEnterprise(data) {
return request({
url: `/post/blesson/deleteEnterprise/${data.id}/${data.busId}`,
method: 'DELETE'
})
}
// 课程管理导入
export function excelImport(data) {
......
......@@ -12,7 +12,6 @@
<el-option label="单选题" value="1" />
<el-option label="多选题" value="2" />
<el-option label="判断题" value="3" />
<el-option label="简答题" value="4" />
</el-select>
</el-form-item>
<el-form-item label="题目难度" prop="unit">
......@@ -93,8 +92,8 @@
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
:inactive-value="0"
:active-value="1"
@click.native="handleStatusChange(scope.row,scope.$index)"
/>
</template>
......@@ -283,8 +282,8 @@
<el-col :span="12">
<el-form-item label="状态" prop="flag">
<el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio>
<el-radio label="0">停用</el-radio>
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
......@@ -340,7 +339,7 @@ import {
addTeaExamQuestions,
delTeaExamQuestions, getTeaExamQuestions,
listTeaExamQuestions, updateStatus, updateTeaExamQuestions, importExcel, importTemplateTrialCourse
} from '@/api/examination/teaExamQuestions'
} from '@/api/examination/teaExamQuestionsCompany'
import { getToken } from '@/utils/auth'
export default {
......@@ -394,7 +393,7 @@ export default {
optionC: '',
optionD: '',
mark: '',
flag: '1',
flag: 1,
remarks: '',
weight: '',
optionsList: []
......@@ -403,8 +402,7 @@ export default {
questionTypeList: [
{ label: '单选题', value: 1 },
{ label: '多选题', value: 2 },
{ label: '判断题', value: 3 },
{ label: '简答题', value: 4 }
{ label: '判断题', value: 3 }
],
// 难度List
difficultyList: [
......@@ -518,7 +516,7 @@ export default {
this.form.mark = ''
this.form.number = ''
this.form.weight = '0'
this.form.flag = '1'
this.form.flag = 1
break
case 4:
this.form.optionA = ''
......@@ -530,7 +528,7 @@ export default {
this.form.mark = ''
this.form.number = ''
this.form.weight = '0'
this.form.flag = '1'
this.form.flag = 1
break
}
console.log('form', this.form)
......@@ -693,7 +691,7 @@ export default {
this.tableData = []
_this.fullscreenLoading = true
const params = {
courseId: _this.form.courseId,
id: _this.form.courseId,
page: _this.queryParams.page,
rows: _this.queryParams.rows,
number: _this.queryParams.number,
......@@ -717,8 +715,8 @@ export default {
},
// 修改状态
handleStatusChange(row, index) {
const flag = row.flag === '1' ? '0' : '1'
const text = row.flag === '1' ? '启用' : '停用'
const flag = row.flag === 1 ? 0 : 1
const text = row.flag === 1 ? '启用' : '停用'
const params = {
businessId: row.businessId,
flag: row.flag
......@@ -857,7 +855,7 @@ export default {
optionC: '',
optionD: '',
mark: '',
flag: '1',
flag: 1,
remarks: '',
weight: '',
optionsList: [],
......
......@@ -466,7 +466,7 @@ import {
downloadZip,
queryPcLessonEvaluationByPagination,
findAllUnitInfo,
getEnterpriseListById, addEnterprise, blessonUpdate
getEnterpriseListById, addEnterprise, blessonUpdate, deleteEnterprise
} from '@/api/jobQuestionBank/index'
import commonField from '@/utils/commonField'
import { getDict } from '@/api/system/dict/data'
......@@ -1650,18 +1650,18 @@ export default {
}).then(() => {
const _this = this
const params = {
lessonId: _this.lessonId,
ossId: data.businessId
id: _this.currentLessionId,
busId: data.enterpriseId
}
console.log('params', params)
delZip(params).then(res => {
deleteEnterprise(params).then(res => {
if (res.code === 200) {
// _this.success(res)
this.$message({
message: '删除成功',
type: 'success'
})
_this.getZipList()
_this.getEnterpriseList(_this.currentLessionId)
} else {
_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