课程数据字典及题目批量新增和删除
This commit is contained in:
parent
d0e56e7b99
commit
c85f134c9d
|
@ -8,7 +8,10 @@
|
||||||
<!-- 课程名称 -->
|
<!-- 课程名称 -->
|
||||||
<a-col :span="18" :offset="3">
|
<a-col :span="18" :offset="3">
|
||||||
<a-form-model-item label="课程名称" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
|
<a-form-model-item label="课程名称" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
|
||||||
<a-input v-model="form.courseName" v-decorator="['courseName', { rules: [{ required: true, message: '请填写课程名称' }] }]" />
|
<a-input
|
||||||
|
v-model="form.courseName"
|
||||||
|
v-decorator="['courseName', { rules: [{ required: true, message: '请填写课程名称' }] }]"
|
||||||
|
/>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
|
@ -16,8 +19,7 @@
|
||||||
<a-col :span="9" :offset="3">
|
<a-col :span="9" :offset="3">
|
||||||
<a-form-model-item label="课程类别" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
|
<a-form-model-item label="课程类别" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
|
||||||
<a-select v-model="form.courseType" placeholder="--请选择--">
|
<a-select v-model="form.courseType" placeholder="--请选择--">
|
||||||
<a-select-option value="1"> 商业 </a-select-option>
|
<a-select-option v-for="(item,index) in dictCourseType" :key="index" :value="item.value"> {{item.name}} </a-select-option>
|
||||||
<a-select-option value="2"> 政务 </a-select-option>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -25,7 +27,14 @@
|
||||||
<!-- 课件大小 -->
|
<!-- 课件大小 -->
|
||||||
<a-col :span="9">
|
<a-col :span="9">
|
||||||
<a-form-item label="课时" :label-col="{ span: 4 }" :wrapper-col="{ span: 10 }">
|
<a-form-item label="课时" :label-col="{ span: 4 }" :wrapper-col="{ span: 10 }">
|
||||||
<a-input-number id="hour" v-model="dataValue" :min="1" :max="1000" @change="onChange" :style="{ display: 'ln', width: '100%' }" />
|
<a-input-number
|
||||||
|
id="hour"
|
||||||
|
v-model="dataValue"
|
||||||
|
:min="1"
|
||||||
|
:max="1000"
|
||||||
|
@change="onChange"
|
||||||
|
:style="{ display: 'ln', width: '100%' }"
|
||||||
|
/>
|
||||||
{{ dataValue }}分钟
|
{{ dataValue }}分钟
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -41,8 +50,7 @@
|
||||||
<a-col :span="9" :offset="3">
|
<a-col :span="9" :offset="3">
|
||||||
<a-form-model-item label="所属行业" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
|
<a-form-model-item label="所属行业" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
|
||||||
<a-select v-model="form.industryInvolved" placeholder="--请选择--">
|
<a-select v-model="form.industryInvolved" placeholder="--请选择--">
|
||||||
<a-select-option value="1"> 医疗 </a-select-option>
|
<a-select-option v-for="(item,index) in industry" :key="index" :value="item.value"> {{item.name}} </a-select-option>
|
||||||
<a-select-option value="0"> 建筑 </a-select-option>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -61,7 +69,7 @@
|
||||||
<a-col :span="9" :offset="3">
|
<a-col :span="9" :offset="3">
|
||||||
<a-form-model-item label="选择岗位" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
|
<a-form-model-item label="选择岗位" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
|
||||||
<a-select v-model="form.job" placeholder="--请选择--">
|
<a-select v-model="form.job" placeholder="--请选择--">
|
||||||
<a-select-option v-for="item in personType" :key="item.id"> {{ item.name }} </a-select-option>
|
<a-select-option v-for="(item,index) in dictPerson" :key="index" :value="item.value"> {{ item.name }} </a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -76,7 +84,14 @@
|
||||||
<!-- 上传封面图片 -->
|
<!-- 上传封面图片 -->
|
||||||
<a-col :span="18" :offset="3">
|
<a-col :span="18" :offset="3">
|
||||||
<a-form-model-item label="上传封面图片" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
|
<a-form-model-item label="上传封面图片" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
|
||||||
<a-upload action="/dawa/sys/oss/upload?sourceId=course" list-type="picture-card" :file-list="fileList" :headers="getToken()" @change="handleChange" @preview="handlePreview">
|
<a-upload
|
||||||
|
action="/dawa/sys/oss/upload?sourceId=course"
|
||||||
|
list-type="picture-card"
|
||||||
|
:file-list="fileList"
|
||||||
|
:headers="getToken()"
|
||||||
|
@change="handleChange"
|
||||||
|
@preview="handlePreview"
|
||||||
|
>
|
||||||
<div v-if="fileList.length < 1">
|
<div v-if="fileList.length < 1">
|
||||||
<a-icon type="plus" />
|
<a-icon type="plus" />
|
||||||
<div class="ant-upload-text">上传</div>
|
<div class="ant-upload-text">上传</div>
|
||||||
|
@ -109,6 +124,7 @@
|
||||||
import { courseAdd, getCourseDetails } from '@/api/course/course'
|
import { courseAdd, getCourseDetails } from '@/api/course/course'
|
||||||
import storage from 'store'
|
import storage from 'store'
|
||||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
|
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'step1',
|
name: 'step1',
|
||||||
|
@ -118,36 +134,35 @@ export default {
|
||||||
form: {
|
form: {
|
||||||
coverPath: '',
|
coverPath: '',
|
||||||
},
|
},
|
||||||
personType: [
|
|
||||||
{ id: '1', name: '人员类别1' },
|
|
||||||
{ id: '2', name: '人员类别2' },
|
|
||||||
{ id: '3', name: '人员类别3' },
|
|
||||||
],
|
|
||||||
url: '',
|
url: '',
|
||||||
previewVisible: false,
|
previewVisible: false,
|
||||||
fileList: [],
|
fileList: [],
|
||||||
previewImage :[
|
previewImage: [],
|
||||||
|
dictPerson:[],
|
||||||
]
|
dictCourseType:[],
|
||||||
|
industry:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
courseAdd,
|
courseAdd,
|
||||||
getCourseDetails
|
getCourseDetails,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.$route.query.id) {
|
if (this.$route.query.id) {
|
||||||
getCourseDetails({ id: this.$route.query.id }).then(res => {
|
getCourseDetails({ id: this.$route.query.id }).then((res) => {
|
||||||
this.form = res.data;
|
this.form = res.data
|
||||||
|
|
||||||
this.form.courseType = this.form.courseType + '';
|
// this.form.courseType = this.form.courseType + ''
|
||||||
this.form.industryInvolved = this.form.industryInvolved + '';
|
// this.form.industryInvolved = this.form.industryInvolved + ''
|
||||||
this.form.isRequired = this.form.isRequired + '';
|
this.form.isRequired = this.form.isRequired + ''
|
||||||
|
// this.form.is
|
||||||
});
|
this.dictEcho();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.dictionaryDropDown()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// getPersonType() {
|
// getPersonType() {
|
||||||
// return dictGet(Object.assign(parameter)).then((res) => {
|
// return dictGet(Object.assign(parameter)).then((res) => {
|
||||||
|
@ -170,60 +185,75 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
dictionaryDropDown () {
|
||||||
|
this.formLoading = true
|
||||||
|
// 行业
|
||||||
|
dictionaryDropDown({ dictionaryCode: '0007' }).then((res) => {
|
||||||
|
this.industry = res.data
|
||||||
|
this.formLoading = false
|
||||||
|
})
|
||||||
|
// 课程类别
|
||||||
|
dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => {
|
||||||
|
this.dictCourseType = res.data
|
||||||
|
this.formLoading = false
|
||||||
|
})
|
||||||
|
// 人员类型
|
||||||
|
dictionaryDropDown({ dictionaryCode: '0005' }).then((res) => {
|
||||||
|
this.dictPerson = res.data
|
||||||
|
this.formLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 编辑回显字典项
|
||||||
|
dictEcho(){
|
||||||
|
console.log("form___",this.form)
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//返回
|
//返回
|
||||||
goback() {
|
goback() {
|
||||||
this.$router.push({path:"/course/CourseList",query:{
|
this.$router.push({
|
||||||
courseName:this.$route.query.courseName
|
path: '/course/CourseList',
|
||||||
} })
|
query: {
|
||||||
|
courseName: this.$route.query.courseName,
|
||||||
|
},
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getToken() {
|
getToken() {
|
||||||
let hreader = {};
|
let hreader = {}
|
||||||
hreader[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN);
|
hreader[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN)
|
||||||
return hreader;
|
return hreader
|
||||||
},
|
},
|
||||||
onSuccess(file) {
|
onSuccess(file) {
|
||||||
console.log('1---', file);
|
console.log('1---', file)
|
||||||
|
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.previewVisible = false;
|
this.previewVisible = false
|
||||||
},
|
},
|
||||||
async handlePreview(file) {
|
async handlePreview(file) {
|
||||||
if (!file.url && !file.preview) {
|
if (!file.url && !file.preview) {
|
||||||
file.preview = await getBase64(file.originFileObj);
|
file.preview = await getBase64(file.originFileObj)
|
||||||
}
|
}
|
||||||
this.previewImage = file.url || file.preview;
|
this.previewImage = file.url || file.preview
|
||||||
this.previewVisible = true;
|
this.previewVisible = true
|
||||||
},
|
},
|
||||||
handleChange({ fileList }) {
|
handleChange({ fileList }) {
|
||||||
this.fileList = fileList;
|
this.fileList = fileList
|
||||||
console.log("fileList-------",fileList);
|
this.fileList.file = fileList[0]
|
||||||
this.fileList.file=fileList[0];
|
this.form.coverPath = this.fileList.file.response.url
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片预览Base64
|
// 图片预览Base64
|
||||||
function getBase64(file) {
|
function getBase64(file) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader()
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file)
|
||||||
reader.onload = () => resolve(reader.result);
|
reader.onload = () => resolve(reader.result)
|
||||||
reader.onerror = error => reject(error);
|
reader.onerror = (error) => reject(error)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -3,11 +3,19 @@
|
||||||
<a-descriptions layout="horizontal" bordered size="small" :column="1">
|
<a-descriptions 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="课程类别" v-for="(item,index) in dictCourseType" :key="index" :value="item.value"> {{ item.name }} </a-descriptions-item>
|
||||||
<a-descriptions-item label="课时"> {{ detailData.hour }} </a-descriptions-item>
|
<a-descriptions-item label="课时"> {{ detailData.hour }} </a-descriptions-item>
|
||||||
<a-descriptions-item label="试题数量"> {{ detailData.questionCount }} </a-descriptions-item>
|
|
||||||
<a-descriptions-item label="学习内容"> {{ detailData.learningContent }} </a-descriptions-item>
|
<a-descriptions-item label="学习内容"> {{ detailData.learningContent }} </a-descriptions-item>
|
||||||
|
<a-descriptions-item label="试题数量"> {{ detailData.questionCount }} </a-descriptions-item>
|
||||||
<a-descriptions-item label="备注"> {{ detailData.remark }} </a-descriptions-item>
|
<a-descriptions-item label="备注"> {{ detailData.remark }} </a-descriptions-item>
|
||||||
|
<a-descriptions-item label="课程封面图">
|
||||||
|
<viewer :images="detailData.coverPath">
|
||||||
|
<img :src="detailData.coverPath" />
|
||||||
|
</viewer>
|
||||||
|
<!-- <div>
|
||||||
|
<img :src="detailData.coverPath" v-image-preview width="100" height="100">
|
||||||
|
</div> -->
|
||||||
|
</a-descriptions-item>
|
||||||
</a-descriptions>
|
</a-descriptions>
|
||||||
<div class="buttonGroup">
|
<div class="buttonGroup">
|
||||||
<a-button type="primary" @click="close"> 返回 </a-button>
|
<a-button type="primary" @click="close"> 返回 </a-button>
|
||||||
|
@ -17,29 +25,45 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getCourseDetails } from '@/api/course/course'
|
import { getCourseDetails } from '@/api/course/course'
|
||||||
|
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
|
||||||
export default {
|
export default {
|
||||||
name: 'details',
|
name: 'details',
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
queryParam: { id: this.$route.query.id },
|
queryParam: { id: this.$route.query.id },
|
||||||
detailData: {}
|
detailData: {
|
||||||
|
coverPath: [],
|
||||||
|
},
|
||||||
|
dictCourseType:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
let parameter = {};
|
let parameter = {}
|
||||||
getCourseDetails(Object.assign(parameter, this.queryParam)).then(res => { this.detailData = res.data });
|
getCourseDetails(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||||
|
this.detailData = res.data
|
||||||
|
})
|
||||||
|
|
||||||
|
//调用词典
|
||||||
|
this.dictionaryDropDown();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.$router.push({ path: '/course/CourseList', query: { } });
|
this.$router.push({ path: '/course/CourseList', query: {} })
|
||||||
},
|
},
|
||||||
edit(record) {
|
edit(record) {
|
||||||
this.$router.push({ path : '/course/CourseAdd', query:{ id: this.queryParam.id }});
|
this.$router.push({ path: '/course/CourseAdd', query: { id: this.queryParam.id } })
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//获取数据字典
|
||||||
|
dictionaryDropDown() {
|
||||||
|
// 课程类别
|
||||||
|
dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => {
|
||||||
|
this.dictCourseType = res.data
|
||||||
|
this.formLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- <page-header-wrapper> -->
|
|
||||||
<a-card :bordered="false" title="题库管理">
|
<a-card :bordered="false" title="题库管理">
|
||||||
<template slot="extra">
|
<template slot="extra">
|
||||||
<a-button size="small" @click="questionColse">返回</a-button>
|
<a-button size="small" @click="questionColse">返回</a-button>
|
||||||
|
@ -20,6 +19,7 @@
|
||||||
|
|
||||||
<div class="questionDetail">
|
<div class="questionDetail">
|
||||||
<br />
|
<br />
|
||||||
|
<div>
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
class="create-button"
|
class="create-button"
|
||||||
|
@ -39,10 +39,15 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
class="create-button"
|
class="create-button"
|
||||||
style="font-size: 15px; margin: 0px 10px 10px 0px"
|
style="font-size: 15px; margin: 0px 10px 10px 0px"
|
||||||
@click="questionBatchDownload"
|
@click="showModal"
|
||||||
>
|
>
|
||||||
模板下载
|
模板下载
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-modal v-model="visible" title="模板下载" cancelText="关闭" :ok-button-props="{ style: { display: 'none' } }">
|
||||||
|
<a-button type="primary" class="create-button" style="font-size: 15px; margin:-15px 50px 3px 50px" @click="questionBatchDownloadDemo">示例模板</a-button>
|
||||||
|
<a-button type="primary" class="create-button" style="font-size: 15px; margin:-15px 30px 3px 70px" @click="questionBatchDownload">纯净模板</a-button>
|
||||||
|
</a-modal>
|
||||||
|
</div>
|
||||||
<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">
|
||||||
|
@ -86,7 +91,6 @@
|
||||||
|
|
||||||
<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> -->
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -104,6 +108,7 @@ export default {
|
||||||
quesitonList: [],
|
quesitonList: [],
|
||||||
questionDetail: {},
|
questionDetail: {},
|
||||||
isactive: 1,
|
isactive: 1,
|
||||||
|
visible: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -123,8 +128,9 @@ export default {
|
||||||
|
|
||||||
//题目ID查看题目
|
//题目ID查看题目
|
||||||
quesionId: function (i, index) {
|
quesionId: function (i, index) {
|
||||||
if (this.quesitonList != null && this.quesitonList.length != 0) {//ID不为空则执行下面
|
if (this.quesitonList != null && this.quesitonList.length != 0) {
|
||||||
console.log("题目!!!!",this.quesitonList.length)
|
//ID不为空则执行下面
|
||||||
|
console.log('题目!!!!', this.quesitonList.length)
|
||||||
this.isactive = index
|
this.isactive = index
|
||||||
this.questionId = i
|
this.questionId = i
|
||||||
|
|
||||||
|
@ -146,7 +152,7 @@ export default {
|
||||||
path: '/course/CourseList',
|
path: '/course/CourseList',
|
||||||
query: {
|
query: {
|
||||||
courseName: this.$route.query.courseName,
|
courseName: this.$route.query.courseName,
|
||||||
pageNum:this.$route.query.pageNum
|
pageNum: this.$route.query.pageNum,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -217,10 +223,22 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showModal() {
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
handleOk(e) {
|
||||||
|
console.log(e)
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
|
||||||
// 下载模板
|
// 下载模板
|
||||||
questionBatchDownload() {
|
questionBatchDownload() {
|
||||||
window.location.href = '/dawa/sys/oss/show/20211108/2420f1de94174bb8a0fb1a2f1e9e1742.xlsx'
|
window.location.href = '/dawa/sys/oss/show/20211108/2420f1de94174bb8a0fb1a2f1e9e1742.xlsx'
|
||||||
},
|
},
|
||||||
|
//下载示例模板
|
||||||
|
questionBatchDownloadDemo() {
|
||||||
|
window.location.href = '/dawa/sys/oss/show/20211114/d82abc89cfba4e18b3f4bc0f9dfa6b96.xlsx'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue