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

合并冲突

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