提交 91340a9a 编写于 作者: zhentian.jia's avatar zhentian.jia

合并冲突

...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
<el-form-item label="选择证书" prop="certificateId"> <el-form-item label="选择证书" prop="certificateId">
<el-select v-model="componentList.certificateId" @change="selectChange" placeholder="请选择资源包" style="width:60%;"> <el-select v-model="componentList.certificateId" @change="selectChange" placeholder="请选择资源包" style="width:60%;">
<el-option <el-option
v-for="(item,index) in resourceArray" v-for="(item,index) in certificateIdSelect"
:key="index" :key="index"
:label="item.lecturerName" :label="item.name"
:value="item.lecturerId"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</div> </div>
<div class="tab-content"> <div class="tab-content">
<el-tabs type="card" v-model="firstTab" closable @tab-remove="removeTab"> <el-tabs type="card" v-model="firstTab" closable @tab-remove="removeTab">
<el-tab-pane v-for="(item,index) in componentList.moduleList" :key="index" :label="'模块' + parseInt(index + 1)" :name='"" + parseInt(index + 1)'> <el-tab-pane v-for="(item,index) in componentList.moduleModelList" :key="index" :label="'模块' + parseInt(index + 1)" :name='"" + parseInt(index + 1)'>
<div> <div>
<el-form ref="moduleForm" :model="item" :rules="rules" label-suffix=":" label-width="130px" style="width:100%;"> <el-form ref="moduleForm" :model="item" :rules="rules" label-suffix=":" label-width="130px" style="width:100%;">
<el-row> <el-row>
...@@ -108,13 +108,15 @@ ...@@ -108,13 +108,15 @@
</el-form> </el-form>
<div class="template-btn"> <div class="template-btn">
<span class="word-size">添加一个模板</span> <span class="word-size">添加一个模板</span>
<el-button type="primary" size="small" @click="addTest(index)" style="margin-left:0;">单个考试</el-button> <el-button
<el-button type="primary" size="small" @click="addCourse(index)" style="margin-left:0;">单个课程</el-button> v-for="(_item,_index) in templateDataList"
<el-button type="primary" size="small" @click="addMatterTest(index)" style="margin-left:0;">摸底考试后培训</el-button> :key="_index"
<el-button type="primary" size="small" @click="addTrainTest(index)" style="margin-left:0;">培训后考试</el-button> type="primary"
<el-button type="primary" size="small" @click="addMatterTrain(index)" style="margin-left:0;">摸底考试获得资格,培训再次考试</el-button> size="small"
@click="addTemplate(_item,index)"
style="margin-right:0px;">{{_item.name}}</el-button>
</div> </div>
<div v-for="(item1,index1) in item.templateList" :key="index1"> <div v-for="(item1,index1) in item.templetModelList" :key="index1">
<el-form ref="templateForm" :model="item1" :rules="templateRules" label-suffix=":" label-width="130px" style="width:100%;"> <el-form ref="templateForm" :model="item1" :rules="templateRules" label-suffix=":" label-width="130px" style="width:100%;">
<div class="template-content"> <div class="template-content">
<div class="template-content-div"> <div class="template-content-div">
...@@ -127,7 +129,7 @@ ...@@ -127,7 +129,7 @@
<i class="el-icon-delete" @click="deleteTemplate(index,index1)" style="color:red;"></i> <i class="el-icon-delete" @click="deleteTemplate(index,index1)" style="color:red;"></i>
</span> </span>
</div> </div>
<div v-for="(item2,index2) in item1.partList" :key="index2"> <div v-for="(item2,index2) in item1.partModelList" :key="index2">
<!-- 考试 --> <!-- 考试 -->
<div v-if="item2.type == 1"> <div v-if="item2.type == 1">
<el-row> <el-row>
...@@ -138,7 +140,14 @@ ...@@ -138,7 +140,14 @@
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="考试ID" prop="id"> <el-form-item label="考试ID" prop="id">
<el-input v-model="item2.id" size="mini" placeholder="请输入考试ID" style="width:288px;"></el-input> <el-select v-model="item2.id" size="mini" placeholder="请选择考试ID" style="width:288px;">
<el-option
v-for="(itemTest,indexTest) in testIdSelect"
:key="indexTest"
:label="itemTest.onlineExamName"
:value="itemTest.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -153,14 +162,21 @@ ...@@ -153,14 +162,21 @@
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="选择证书" prop="id"> <el-form-item label="选择证书" prop="id">
<el-input v-model="item2.id" size="mini" placeholder="请选择证书" style="width:288px;"></el-input> <el-select v-model="item2.id" size="mini" placeholder="请选择证书" style="width:288px;">
<el-option
v-for="(itemCertificate,indexCertificate) in certificateIdSelect"
:key="indexCertificate"
:label="itemCertificate.name"
:value="itemCertificate.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- 课程 --> <!-- 课程 -->
<div v-if="item2.type == 2"> <div v-if="item2.type == 2">
<el-row v-for="(item3,index3) in item2.partContentList" :key="index3"> <el-row v-for="(item3,index3) in item2.partContentModelList" :key="index3">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="课程名称" prop="name"> <el-form-item label="课程名称" prop="name">
<el-input v-model="item3.name" size="mini" placeholder="请输入课程名称" style="width:288px;"></el-input> <el-input v-model="item3.name" size="mini" placeholder="请输入课程名称" style="width:288px;"></el-input>
...@@ -170,7 +186,14 @@ ...@@ -170,7 +186,14 @@
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="课程ID" prop="id"> <el-form-item label="课程ID" prop="id">
<el-input v-model="item3.id" size="mini" placeholder="请输入课程ID" style="width:288px;"></el-input> <el-select v-model="item3.id" size="mini" placeholder="请选择课程ID" style="width:288px;">
<el-option
v-for="(itemCourse,indexCourse) in courseIdSelect"
:key="indexCourse"
:label="itemCourse.name"
:value="itemCourse.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -186,7 +209,6 @@ ...@@ -186,7 +209,6 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog :title="dialogTitle" :visible.sync="columnFormVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false"> <el-dialog :title="dialogTitle" :visible.sync="columnFormVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form ref="resourceForm" class="creat-form" :model="selectResource" label-width="125px" label-suffix=":" size="mini"> <el-form ref="resourceForm" class="creat-form" :model="selectResource" label-width="125px" label-suffix=":" size="mini">
<el-form-item label="请选择一个资源包" prop=""> <el-form-item label="请选择一个资源包" prop="">
...@@ -246,6 +268,11 @@ export default { ...@@ -246,6 +268,11 @@ export default {
title: '模块 1', title: '模块 1',
name: '1' name: '1'
}], }],
templateDataList: [],
templetIndex: 0,
testIdSelect: [], // 考试ID下拉列表
certificateIdSelect: [], // 证书下拉列表
courseIdSelect: [], // 课程下拉列表
componentList: { componentList: {
name: '', name: '',
id: '', id: '',
...@@ -254,10 +281,12 @@ export default { ...@@ -254,10 +281,12 @@ export default {
seqNo: '', seqNo: '',
certificateId: '', // 0 没有证书 certificateId: '', // 0 没有证书
certificateCondition: '60', certificateCondition: '60',
moduleList: [{ moduleModelList: [{
name: '', name: '',
openFlag: '', // 1不开放 2开放 openFlag: '', // 1不开放 2开放
templateList: [] templetModelList: [
]
}] }]
}, },
resourceArray: [], resourceArray: [],
...@@ -315,6 +344,7 @@ export default { ...@@ -315,6 +344,7 @@ export default {
}, },
created() { created() {
vm = this vm = this
vm.getCertificateList()
}, },
methods: { methods: {
// 暂存 // 暂存
...@@ -324,6 +354,10 @@ export default { ...@@ -324,6 +354,10 @@ export default {
// 下一步 // 下一步
nextStep() { nextStep() {
vm.stepNum = 2 vm.stepNum = 2
vm.getTemplateData()
vm.getModuleData()
vm.getTestListData()
vm.getCourseData()
}, },
// 上传组件图片 // 上传组件图片
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
...@@ -362,6 +396,46 @@ export default { ...@@ -362,6 +396,46 @@ export default {
// 获取组件完成率 // 获取组件完成率
handleChange(value) { handleChange(value) {
},
// 获取证书下拉列表
getCertificateList() {
vm.GET('portalComponent/CertificateList').then((res) => {
if( res.code == '000000') {
vm.certificateIdSelect = res.data.certificateList
}
})
},
// 获取考试下拉列表
getTestListData() {
vm.GET('portalComponent/OnlineExamList').then((res) => {
if( res.code == '000000') {
vm.testIdSelect = res.data.onlineExamList
}
})
},
// 获取课程下拉列表
getCourseData() {
vm.GET('portalComponent/CourseList').then((res) => {
if( res.code == '000000') {
vm.courseIdSelect = res.data.courseList
}
})
},
// 获取默认模板
getTemplateData() {
vm.GET('portalComponent/TempletConfigList').then((res) => {
if( res.code == '000000') {
vm.templateDataList = res.data.templetConfigModelList
}
})
},
// 通过编辑获取模块信息
getModuleData() {
vm.GET('portalComponent/ModuleList').then((res) => {
if( res.code == '000000') {
vm.componentList.moduleModelList = res.data.moduleModelList
}
})
}, },
// 是否对外开放 // 是否对外开放
selectIsOpen() { selectIsOpen() {
...@@ -369,128 +443,85 @@ export default { ...@@ -369,128 +443,85 @@ export default {
}, },
// 删除tab // 删除tab
removeTab(targetName) { removeTab(targetName) {
vm.componentList.moduleList.splice(targetName - 1,1) vm.componentList.moduleModelList.splice(targetName - 1,1)
}, },
// 添加空白模块 // 添加空白模块
addModule() { addModule() {
let seq = vm.componentList.moduleList.length + 1 let seq = vm.componentList.moduleModelList.length + 1
vm.componentList.moduleList.push({ vm.componentList.moduleModelList.push({
name: '', name: '',
openFlag: '', // 1不开放 2开放 openFlag: '', // 1不开放 2开放
templateList: [] templetModelList: []
}) })
}, },
// 从模板中添加 // 从模板中添加
addFromModule() { addFromModule() {
vm.columnFormVisible = true vm.columnFormVisible = true
}, },
// 添加单个考试 // 添加模板
addTest(index) { addTemplate(item,index) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) { vm.templetIndex = vm.componentList.moduleModelList[index].templetModelList.length
if(index == i) { vm.componentList.moduleModelList[index].templetModelList.push({
vm.componentList.moduleList[i].templateList.push({ name: item.name,
name: '单个考试', partModelList: []
partList: [{ })
for(let i = 0; i < item.partConfigModelList.length; i++) {
if(item.partConfigModelList[i].type == 1) { // 考试
vm.componentList.moduleModelList[index].templetModelList[vm.templetIndex].partModelList.push({
titleName: '', titleName: '',
type: 1, // 1考试 2课程 type: 1, // 1考试 2课程
name: '', name: '',
id: '', // 新增时为空 id: '', // 新增时为空
seqNo: '', seqNo: '',
conditionFlag: 1, // 1为没有限制 2有限制 conditionFlag: item.partConfigModelList[i].conditionFlag, // 1为没有限制 2有限制
numFlag: 1, // 1为单个 2为可以无限添加 numFlag: item.partConfigModelList[i].numFlag, // 1为单个 2为可以无限添加
templetSeqNo: '', templetSeqNo: '',
partContentList: [{ partContentModelList: [{
id: '',
}]
}]
})
}
}
},
// 添加单个课程
addCourse(index) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) {
if(index == i) {
vm.componentList.moduleList[i].templateList.push({
name: '单个课程',
partList:[{
titleName: '',
type: 2, // 1考试 2课程
name: '',
id: '', // 新增时为空
seqNo: '', seqNo: '',
conditionFlag: 1, // 1为没有限制 2有限制 content_1: '',
numFlag: 1, // 1为单个 2为可以无限添加 content_2: ''
templetSeqNo: '',
partContentList: [{
}]
}] }]
}) })
} }else if(item.partConfigModelList[i].type == 2) { // 课程
} vm.componentList.moduleModelList[index].templetModelList[vm.templetIndex].partModelList.push({
},
//摸底考试后培训
addMatterTest(index) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) {
if(index == i) {
vm.componentList.moduleList[i].templateList.push({
name: '摸底考试后培训',
partList: [{
titleName: '',
type: 1, // 1考试 2课程
name: '',
id: '', // 新增时为空
seqNo: '',
conditionFlag: 1, // 1为没有限制 2有限制
numFlag: 1, // 1为单个 2为可以无限添加
templetSeqNo: '',
partContentList: [{
}]
},{
titleName: '', titleName: '',
type: 2, // 1考试 2课程 type: 2, // 1考试 2课程
name: '', name: '',
id: '', // 新增时为空 id: '', // 新增时为空
seqNo: '', seqNo: '',
conditionFlag: 1, // 1为没有限制 2有限制 conditionFlag: item.partConfigModelList[i].conditionFlag, // 1为没有限制 2有限制
numFlag: 2, // 1为单个 2为可以无限添加 numFlag: item.partConfigModelList[i].numFlag, // 1为单个 2为可以无限添加
templetSeqNo: '', templetSeqNo: '',
partContentList: [{ partContentModelList: [{
id: '',
}] seqNo: '',
content_1: '',
content_2: ''
}] }]
}) })
} }
} }
}, vm.templetIndex ++
// 培训后考试
addTrainTest() {
},
// 摸底考试获得资格,培训再次考试
addMatterTrain() {
}, },
// 删除模板 // 删除模板
deleteTemplate(index,index1) { deleteTemplate(index,index1) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) { if(index == i) {
vm.componentList.moduleList[i].templateList.splice(index1,1) vm.componentList.moduleModelList[i].templetModelList.splice(index1,1)
break break
} }
} }
}, },
// 添加多个课程 // 添加多个课程
addMatterCourse(index,index1,index2) { addMatterCourse(index,index1,index2) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) { if(index == i) {
for(let j = 0; j < vm.componentList.moduleList[i].templateList.length; j++) { for(let j = 0; j < vm.componentList.moduleModelList[i].templetModelList.length; j++) {
if(index1 == j) { if(index1 == j) {
for(let q = 0; q < vm.componentList.moduleList[i].templateList[j].partList.length;q++){ for(let q = 0; q < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;q++){
if(index2 == q) { if(index2 == q) {
vm.componentList.moduleList[i].templateList[j].partList[q].partContentList.push({ vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList.push({
id: '', id: '',
seqNo: '', seqNo: '',
content_1: '', content_1: '',
...@@ -508,13 +539,13 @@ export default { ...@@ -508,13 +539,13 @@ export default {
}, },
// 删除多个课程 // 删除多个课程
deleteMatterCourse(index,index1,index2,index3) { deleteMatterCourse(index,index1,index2,index3) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) { if(index == i) {
for(let j = 0; j < vm.componentList.moduleList[i].templateList.length; j++) { for(let j = 0; j < vm.componentList.moduleModelList[i].templetModelList.length; j++) {
if(index1 == j) { if(index1 == j) {
for(let q = 0; q < vm.componentList.moduleList[i].templateList[j].partList.length;q++){ for(let q = 0; q < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;q++){
if(index2 == q) { if(index2 == q) {
vm.componentList.moduleList[i].templateList[j].partList[q].partContentList.splice(index3,1) vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList.splice(index3,1)
break break
} }
} }
...@@ -527,12 +558,12 @@ export default { ...@@ -527,12 +558,12 @@ export default {
}, },
// 模板下移 // 模板下移
sortUp(index,index1) { sortUp(index,index1) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) { if(index == i) {
if(index1 != vm.componentList.moduleList[i].templateList.length - 1) { // 判断是最后一个不能下移 if(index1 != vm.componentList.moduleModelList[i].templetModelList.length - 1) { // 判断是最后一个不能下移
let temp = vm.componentList.moduleList[i].templateList[index1] let temp = vm.componentList.moduleModelList[i].templetModelList[index1]
vm.$set(vm.componentList.moduleList[i].templateList,index1,vm.componentList.moduleList[i].templateList[index1 + 1]) vm.$set(vm.componentList.moduleModelList[i].templetModelList,index1,vm.componentList.moduleModelList[i].templetModelList[index1 + 1])
vm.$set(vm.componentList.moduleList[i].templateList,parseInt(index1+1),temp) vm.$set(vm.componentList.moduleModelList[i].templetModelList,parseInt(index1+1),temp)
} }
break break
} }
...@@ -540,12 +571,12 @@ export default { ...@@ -540,12 +571,12 @@ export default {
}, },
// 模板下移 // 模板下移
sortDown(index,index1) { sortDown(index,index1) {
for(let i = 0; i < vm.componentList.moduleList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) { if(index == i) {
if(index1 != 0) { // 判断是第一个不能上移 if(index1 != 0) { // 判断是第一个不能上移
let temp = vm.componentList.moduleList[i].templateList[index1] let temp = vm.componentList.moduleModelList[i].templetModelList[index1]
vm.$set(vm.componentList.moduleList[i].templateList,index1,vm.componentList.moduleList[i].templateList[index1 - 1]) vm.$set(vm.componentList.moduleModelList[i].templetModelList,index1,vm.componentList.moduleModelList[i].templetModelList[index1 - 1])
vm.$set(vm.componentList.moduleList[i].templateList,parseInt(index1-1),temp) vm.$set(vm.componentList.moduleModelList[i].templetModelList,parseInt(index1-1),temp)
} }
break break
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<el-table-column label="操作" fixed="right" align="center" min-width="200"> <el-table-column label="操作" fixed="right" align="center" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="small" @click="editComponentList(scope.row)">编辑</el-button> <el-button type="primary" size="small" @click="editComponentList(scope.row)">编辑</el-button>
<el-button type="primary" size="small" disabled>启用</el-button> <el-button type="primary" size="small" @click="enable(scope.row)">启用</el-button>
<el-button type="primary" size="small">禁用</el-button> <el-button type="primary" size="small">禁用</el-button>
<el-button type="primary" size="small">删除</el-button> <el-button type="primary" size="small">删除</el-button>
</template> </template>
...@@ -113,12 +113,7 @@ export default { ...@@ -113,12 +113,7 @@ export default {
methods: { methods: {
// 列表查询 // 列表查询
search() { search() {
let req = { vm.GET('/portalComponent/queryPortalComponent',vm.searchParam).then((res) => {
name: '',
pageNo: 1,
pageSize: 15
}
vm.GET('/portalComponent/queryPortalComponent',req).then((res) => {
if( res.code == '000000' ) { if( res.code == '000000' ) {
vm.tableData = res.data.queryList vm.tableData = res.data.queryList
vm.totalRows = res.data.total vm.totalRows = res.data.total
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册