题库细节优化
This commit is contained in:
parent
b45eddb9ee
commit
8228dd9b0f
|
@ -115,13 +115,15 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataValue: 1,
|
dataValue: 1,
|
||||||
form: {},
|
form: {
|
||||||
|
coverPath:'',
|
||||||
|
},
|
||||||
personType: [
|
personType: [
|
||||||
{ id: '1', name: '人员类别1' },
|
{ id: '1', name: '人员类别1' },
|
||||||
{ id: '2', name: '人员类别2' },
|
{ id: '2', name: '人员类别2' },
|
||||||
{ id: '3', name: '人员类别3' },
|
{ id: '3', name: '人员类别3' },
|
||||||
],
|
],
|
||||||
|
url:'',
|
||||||
previewVisible: false,
|
previewVisible: false,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
previewImage :[
|
previewImage :[
|
||||||
|
@ -147,7 +149,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取字典值
|
|
||||||
// getPersonType() {
|
// getPersonType() {
|
||||||
// return dictGet(Object.assign(parameter)).then((res) => {
|
// return dictGet(Object.assign(parameter)).then((res) => {
|
||||||
// return res
|
// return res
|
||||||
|
@ -171,7 +172,9 @@ export default {
|
||||||
|
|
||||||
//返回
|
//返回
|
||||||
goback(){
|
goback(){
|
||||||
this.$router.push({path:"/course/CourseList",query:{} })
|
this.$router.push({path:"/course/CourseList",query:{
|
||||||
|
courseName:this.$route.query.courseName
|
||||||
|
} })
|
||||||
},
|
},
|
||||||
|
|
||||||
getToken() {
|
getToken() {
|
||||||
|
@ -195,6 +198,17 @@ export default {
|
||||||
},
|
},
|
||||||
handleChange({ fileList }) {
|
handleChange({ fileList }) {
|
||||||
this.fileList = fileList;
|
this.fileList = fileList;
|
||||||
|
console.log("fileList-------",fileList);
|
||||||
|
this.fileList.file=fileList[0];
|
||||||
|
console.log('file``````',this.fileList.file)
|
||||||
|
console.log('response``````',this.fileList.file.response.url)
|
||||||
|
|
||||||
|
|
||||||
|
this.form.coverPath = this.fileList.file.response.url;
|
||||||
|
|
||||||
|
console.log("url",this.form.coverPath)
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,12 +1,28 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" title="课程列表">
|
<a-card :bordered="false" title="课程列表">
|
||||||
<div class="table-page-search-wrapper">
|
<div class="table-page-search-wrapper">
|
||||||
<SearchCom :form="queryParam" :list="queryOptions" @search="handleRefresh" @reset="() => {queryParam = {}, handleRefresh()}" ></SearchCom>
|
<SearchCom
|
||||||
<div style="width: 100%; height: 32px; margin-bottom: 8px;">
|
:form="queryParam"
|
||||||
|
:list="queryOptions"
|
||||||
|
@search="handleRefresh"
|
||||||
|
@reset="
|
||||||
|
() => {
|
||||||
|
;(queryParam = {}), handleRefresh()
|
||||||
|
}
|
||||||
|
"
|
||||||
|
></SearchCom>
|
||||||
|
<div style="width: 100%; height: 32px; margin-bottom: 8px">
|
||||||
<a-button type="primary" @click="courseAdd">新建课程</a-button>
|
<a-button type="primary" @click="courseAdd">新建课程</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.PageNum) || 1">
|
<s-table
|
||||||
|
ref="table"
|
||||||
|
size="default"
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:data="loadData"
|
||||||
|
:pageNum="Number(this.$route.query.PageNum) || 1"
|
||||||
|
>
|
||||||
<template slot="action" slot-scope="text, record">
|
<template slot="action" slot-scope="text, record">
|
||||||
<a href="javascript:;" @click="detail(record)">详情</a>
|
<a href="javascript:;" @click="detail(record)">详情</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
|
@ -30,58 +46,64 @@ import { getCourseList,deleteCourse } from '@/api/course/course'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
STable, SearchCom
|
STable,
|
||||||
|
SearchCom,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParam: { courseName: this.$route.query.courseName || '' }, //, orgId: this.$route.query.courseUserOrgId || ''
|
queryParam: { courseName: this.$route.query.courseName || '' }, //, orgId: this.$route.query.courseUserOrgId || ''
|
||||||
queryOptions: [
|
queryOptions: [{ type: 'input', placeholder: '课程名称', key: 'courseName' }],
|
||||||
{ type: 'input', placeholder: '课程名称', key: 'courseName' },
|
loadData: (parameter) => {
|
||||||
],
|
return getCourseList(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||||
loadData: parameter => {
|
return res
|
||||||
return getCourseList(Object.assign(parameter, this.queryParam)).then(res => { return res });
|
})
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{ title: '课程编号', width: '160px', align: 'center', dataIndex: 'courseCode', key: 'courseCode' },
|
{ title: '课程编号', width: '160px', align: 'center', dataIndex: 'courseCode', key: 'courseCode' },
|
||||||
{ title: '课程名称', width: 'auto', align: 'center', dataIndex: 'courseName', key: 'courseName' },
|
{ title: '课程名称', width: 'auto', align: 'center', dataIndex: 'courseName', key: 'courseName' },
|
||||||
{ title: '课时/分', width: '160px', align: 'center', dataIndex: 'hour', key: 'hour' },
|
{ title: '课时/分', width: '160px', align: 'center', dataIndex: 'hour', key: 'hour' },
|
||||||
{ title: '数量', width: '160px', align: 'center', dataIndex: 'questionCount', key: 'questionCount' },
|
{ title: '数量', width: '160px', align: 'center', dataIndex: 'questionCount', key: 'questionCount' },
|
||||||
{ title: '操作', key: 'operation', width: '300px', align: 'center', scopedSlots: { customRender: 'action' } }
|
{ title: '操作', key: 'operation', width: '300px', align: 'center', scopedSlots: { customRender: 'action' } },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {},
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleRefresh() {
|
handleRefresh() {
|
||||||
this.$refs.table.refresh(true)
|
this.$refs.table.refresh(true)
|
||||||
},
|
},
|
||||||
detail(record) {
|
detail(record) {
|
||||||
this.$router.push({ path: '/course/CourseDetail', query: { id: record.id } });
|
this.$router.push({ path: '/course/CourseDetail', query: { id: record.id } })
|
||||||
},
|
},
|
||||||
courseWare(record) {
|
courseWare(record) {
|
||||||
this.$router.push({ path: '/course/CoursewareList', query: { id: record.id } });
|
this.$router.push({ path: '/course/CoursewareList', query: { id: record.id } })
|
||||||
},
|
},
|
||||||
del(record) {
|
del(record) {
|
||||||
deleteCourse({ids:record.id}).then(res => {
|
deleteCourse({ ids: record.id }).then((res) => {
|
||||||
if(res.code == 200) this.$refs.table.refresh(true);
|
if (res.code == 200) this.$refs.table.refresh(true)
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//課程新增
|
//課程新增
|
||||||
courseAdd() {
|
courseAdd() {
|
||||||
this.$router.push({ path : '/course/CourseAdd' , query : {}})
|
this.$router.push({
|
||||||
|
path: '/course/CourseAdd',
|
||||||
|
query: {
|
||||||
|
courseName: this.queryParam.courseName
|
||||||
|
},
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//题库
|
//题库
|
||||||
courseQuestion(record) {
|
courseQuestion(record) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/course/question/QuestionList', query :{
|
path: '/course/question/QuestionList',
|
||||||
|
query: {
|
||||||
id: record.id,
|
id: record.id,
|
||||||
courseName: this.queryParam.courseName,
|
courseName: this.queryParam.courseName,
|
||||||
// courseUserOrgId : this.queryParam.orgId,
|
pageNum: this.$refs.table.pageNum
|
||||||
PageNum : this.$refs.table.localPagination.current
|
},
|
||||||
}});
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" title="项目档案">
|
<a-card :bordered="false" title="课件信息">
|
||||||
<template slot="extra">
|
<template slot="extra">
|
||||||
<a-button size="small" @click="goback">返回</a-button>
|
<a-button size="small" @click="goback">返回</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<page-header-wrapper :title="false">
|
<a-card :bordered="false" title="课程详情">
|
||||||
<a-card :bordered="false">
|
<a-descriptions layout="horizontal" bordered size="small" :column="1">
|
||||||
<a-descriptions title="课程详情" layout="horizontal" bordered size="small" :column="1">
|
|
||||||
<a-descriptions-item label="课程编号"> {{ detailData.courseCode }} </a-descriptions-item>
|
<a-descriptions-item label="课程编号"> {{ detailData.courseCode }} </a-descriptions-item>
|
||||||
<a-descriptions-item label="课程名称"> {{ detailData.courseName }} </a-descriptions-item>
|
<a-descriptions-item label="课程名称"> {{ detailData.courseName }} </a-descriptions-item>
|
||||||
<a-descriptions-item label="课程类别"> {{ detailData.courseType }} </a-descriptions-item>
|
<a-descriptions-item label="课程类别"> {{ detailData.courseType }} </a-descriptions-item>
|
||||||
|
@ -15,7 +14,6 @@
|
||||||
<a-button type="primary" @click="edit"> 编辑 </a-button>
|
<a-button type="primary" @click="edit"> 编辑 </a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</page-header-wrapper>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getCourseDetails } from '@/api/course/course'
|
import { getCourseDetails } from '@/api/course/course'
|
||||||
|
|
|
@ -92,8 +92,8 @@
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
选项(从选项中选择一个作为答案)<br />
|
选项(从选项中选择一个作为答案)<br />
|
||||||
<a-radio :value="1"> 正确 </a-radio>
|
<a-radio value="1"> 正确 </a-radio>
|
||||||
<a-radio :value="2"> 错误 </a-radio>
|
<a-radio value="2"> 错误 </a-radio>
|
||||||
</template>
|
</template>
|
||||||
</a-card>
|
</a-card>
|
||||||
<a-card title="答案解析" :bordered="false">
|
<a-card title="答案解析" :bordered="false">
|
||||||
|
@ -161,6 +161,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
|
//判断是否是编辑
|
||||||
if (this.$route.query.id && !this.$route.query.opt) {
|
if (this.$route.query.id && !this.$route.query.opt) {
|
||||||
|
|
||||||
this.radio.disabled = true;
|
this.radio.disabled = true;
|
||||||
|
@ -250,7 +252,6 @@ export default {
|
||||||
console.log('5---', this.Completion)
|
console.log('5---', this.Completion)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('a--')
|
|
||||||
from.courseId = this.$route.query.courseId
|
from.courseId = this.$route.query.courseId
|
||||||
|
|
||||||
questionAdd(from).then((res) => {
|
questionAdd(from).then((res) => {
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<b><h1 class="questionContent">课程题目库预览</h1></b>
|
<b><h1 class="questionContent">课程题目库预览</h1></b>
|
||||||
<a-divider :style="{ backgroundColor: '#000' }" />
|
<a-divider :style="{ backgroundColor: '#000' }" />
|
||||||
<div class="question">
|
<div class="question">
|
||||||
<h1 class="questionName">
|
<h1 class="questionName" v-if="quesitonList != null && quesitonList.length !=0">
|
||||||
({{ questionDetail.questionTypeName }}){{ questionDetail.questionName }}
|
({{ questionDetail.questionTypeName }}){{ questionDetail.questionName }}
|
||||||
<span class="edit" @click="edit(questionDetail.id)">编辑</span>
|
<span class="edit" @click="edit(questionDetail.id)">编辑</span>
|
||||||
<a-popconfirm title="确定要删除此题?" ok-text="确定" cancel-text="取消" @confirm="del(questionDetail.id)">
|
<a-popconfirm title="确定要删除此题?" ok-text="确定" cancel-text="取消" @confirm="del(questionDetail.id)">
|
||||||
|
@ -69,10 +69,12 @@
|
||||||
|
|
||||||
<!-- 显示填空题 -->
|
<!-- 显示填空题 -->
|
||||||
<div v-if="questionDetail.questionType == 5">
|
<div v-if="questionDetail.questionType == 5">
|
||||||
<div class="answer" v-for="(item,ind) in questionDetail.answerList" :key="ind">正确答案{{ ind+1 }}: {{ item }}</div>
|
<div class="answer" v-for="(item, ind) in questionDetail.answerList" :key="ind">
|
||||||
|
正确答案{{ ind + 1 }}: {{ item }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info_parent">
|
<div class="info_parent" v-if="quesitonList != null && quesitonList.length !=0">
|
||||||
<div class="info">解析</div>
|
<div class="info">解析</div>
|
||||||
<div class="info_main">
|
<div class="info_main">
|
||||||
{{ questionDetail.asnwerParse }}
|
{{ questionDetail.asnwerParse }}
|
||||||
|
@ -82,7 +84,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input ref="inputFile" type="file" style="display: none;" @change="questionBatchImport">
|
<input ref="inputFile" type="file" style="display: none" @change="questionBatchImport" />
|
||||||
</a-card>
|
</a-card>
|
||||||
<!-- </page-header-wrapper> -->
|
<!-- </page-header-wrapper> -->
|
||||||
</template>
|
</template>
|
||||||
|
@ -115,15 +117,16 @@ export default {
|
||||||
this.quesitonList = res.data
|
this.quesitonList = res.data
|
||||||
|
|
||||||
if (!res.data) return
|
if (!res.data) return
|
||||||
// this.quesionId(this.quesitonList[0])
|
this.quesionId(this.$route.query.questionId || this.quesitonList[0], this.$route.query.isactive || 0)
|
||||||
this.quesionId(this.$route.query.questionId || this.quesitonList[0], this.$route.query.isactive || 0);
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//题目ID查看题目
|
//题目ID查看题目
|
||||||
quesionId: function (i, index) {
|
quesionId: function (i, index) {
|
||||||
this.isactive = index;
|
if (this.quesitonList != null && this.quesitonList.length != 0) {//ID不为空则执行下面
|
||||||
this.questionId = i;
|
console.log("题目!!!!",this.quesitonList.length)
|
||||||
|
this.isactive = index
|
||||||
|
this.questionId = i
|
||||||
|
|
||||||
getQuestionDeatil({ id: i }).then((res) => {
|
getQuestionDeatil({ id: i }).then((res) => {
|
||||||
this.questionDetail = res.data
|
this.questionDetail = res.data
|
||||||
|
@ -134,13 +137,17 @@ export default {
|
||||||
if (this.questionDetail.questionType == '4') this.questionDetail.questionTypeName = '简答题'
|
if (this.questionDetail.questionType == '4') this.questionDetail.questionTypeName = '简答题'
|
||||||
if (this.questionDetail.questionType == '5') this.questionDetail.questionTypeName = '填空题'
|
if (this.questionDetail.questionType == '5') this.questionDetail.questionTypeName = '填空题'
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//关闭按钮
|
//关闭按钮
|
||||||
questionColse() {
|
questionColse() {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/course/CourseList',
|
path: '/course/CourseList',
|
||||||
query: {},
|
query: {
|
||||||
|
courseName:this.$route.query.courseName,
|
||||||
|
pageNum:this.$route.query.pageNum
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
questionSave() {
|
questionSave() {
|
||||||
|
@ -150,7 +157,7 @@ export default {
|
||||||
courseId: this.$route.query.id,
|
courseId: this.$route.query.id,
|
||||||
isactive: this.isactive,
|
isactive: this.isactive,
|
||||||
id: this.questionId,
|
id: this.questionId,
|
||||||
opt: 'add'
|
opt: 'add',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -162,7 +169,7 @@ export default {
|
||||||
id: record,
|
id: record,
|
||||||
isactive: this.isactive,
|
isactive: this.isactive,
|
||||||
questionType: this.questionDetail.questionType,
|
questionType: this.questionDetail.questionType,
|
||||||
courseId: this.$route.query.id
|
courseId: this.$route.query.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -176,36 +183,38 @@ export default {
|
||||||
|
|
||||||
//批量导入
|
//批量导入
|
||||||
questionBatch() {
|
questionBatch() {
|
||||||
this.$refs.inputFile.click();
|
this.$refs.inputFile.click()
|
||||||
},
|
},
|
||||||
questionBatchImport() {
|
questionBatchImport() {
|
||||||
if(!this.$refs.inputFile.value || this.$refs.inputFile.value === '') return;
|
if (!this.$refs.inputFile.value || this.$refs.inputFile.value === '') return
|
||||||
const data = new FormData();
|
const data = new FormData()
|
||||||
data.append('file', this.$refs.inputFile.files[0]);
|
data.append('file', this.$refs.inputFile.files[0])
|
||||||
data.append('sourceId', 'questionImport');
|
data.append('sourceId', 'questionImport')
|
||||||
data.append('fileType', 'excel');
|
data.append('fileType', 'excel')
|
||||||
|
|
||||||
const header = {};
|
const header = {}
|
||||||
header['Content-Type'] = 'multipart/form-data';
|
header['Content-Type'] = 'multipart/form-data'
|
||||||
header[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN);
|
header[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN)
|
||||||
|
|
||||||
axios.post(ossUpload(), data, { headers: header }).then(res => {
|
axios
|
||||||
|
.post(ossUpload(), data, { headers: header })
|
||||||
|
.then((res) => {
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
let params = { fileUrl: res.data.url, courseId: this.$route.query.id }
|
let params = { fileUrl: res.data.url, courseId: this.$route.query.id }
|
||||||
importTemplate(params).then(res1 => {
|
importTemplate(params).then((res1) => {
|
||||||
this.$refs.inputFile.value = '';
|
this.$refs.inputFile.value = ''
|
||||||
this.$message.success('题目导入成功!');
|
this.$message.success('题目导入成功!')
|
||||||
this.getQuestion()
|
this.getQuestion()
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.data.msg);
|
this.$message.error(res.data.msg)
|
||||||
this.$refs.inputFile.value = '';
|
this.$refs.inputFile.value = ''
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
})
|
||||||
this.$message.error(res);
|
.catch((err) => {
|
||||||
this.$refs.inputFile.value = '';
|
this.$message.error(res)
|
||||||
});
|
this.$refs.inputFile.value = ''
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 下载模板
|
// 下载模板
|
||||||
|
|
Loading…
Reference in New Issue