|
@@ -150,7 +150,7 @@ export default {
|
|
// 表单
|
|
// 表单
|
|
form: [],
|
|
form: [],
|
|
// 模板
|
|
// 模板
|
|
- module: {},
|
|
|
|
|
|
+ module: [],
|
|
// 弹窗
|
|
// 弹窗
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
// 弹窗表单
|
|
// 弹窗表单
|
|
@@ -238,12 +238,11 @@ export default {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
res.data.elementIds.map(i => {
|
|
res.data.elementIds.map(i => {
|
|
if (i === '4') { // 内容 关联 音频数据 存在底层module
|
|
if (i === '4') { // 内容 关联 音频数据 存在底层module
|
|
- this.module.contentName = ''
|
|
|
|
- this.module.module = {}
|
|
|
|
|
|
+ this.module.push('contentName', 'module')
|
|
} else if (i === '9') {
|
|
} else if (i === '9') {
|
|
- this.module.childList = []
|
|
|
|
|
|
+ this.module.push('childList')
|
|
} else {
|
|
} else {
|
|
- this.$set(this.module, moduleOptions[i], '')
|
|
|
|
|
|
+ this.module.push(moduleOptions[i])
|
|
}
|
|
}
|
|
})
|
|
})
|
|
if (this.$route.query.threeId) {
|
|
if (this.$route.query.threeId) {
|
|
@@ -263,13 +262,13 @@ export default {
|
|
let obj = {}
|
|
let obj = {}
|
|
|
|
|
|
// 是否有简介
|
|
// 是否有简介
|
|
- if ('description' in this.module) {
|
|
|
|
|
|
+ if (this.module.find(i => i === 'description')) {
|
|
obj.description = i.module.description
|
|
obj.description = i.module.description
|
|
}
|
|
}
|
|
|
|
|
|
// 只保留组件模板的参数
|
|
// 只保留组件模板的参数
|
|
for (const key in i) {
|
|
for (const key in i) {
|
|
- if (this.module.hasOwnProperty(key)) {
|
|
|
|
|
|
+ if (this.module.find(j => j === key)) {
|
|
obj[key] = i[key]
|
|
obj[key] = i[key]
|
|
// 跳转方式关联 内容 栏目 地址
|
|
// 跳转方式关联 内容 栏目 地址
|
|
if ([0, 1, 2, 3, 4].includes(i.forwardType)) {
|
|
if ([0, 1, 2, 3, 4].includes(i.forwardType)) {
|
|
@@ -297,7 +296,11 @@ export default {
|
|
|
|
|
|
// 新增模块
|
|
// 新增模块
|
|
getPush() {
|
|
getPush() {
|
|
- this.form.push(this.module)
|
|
|
|
|
|
+ let obj = {}
|
|
|
|
+ this.module.map(i => {
|
|
|
|
+ obj[i] = i === 'childrenList' ? [] : i === 'module' ? {} : ''
|
|
|
|
+ })
|
|
|
|
+ this.form.push(obj)
|
|
},
|
|
},
|
|
|
|
|
|
// 爱听专区
|
|
// 爱听专区
|
|
@@ -408,7 +411,7 @@ export default {
|
|
// 封面模式自定义封面会丢失内容封面图片 所以缓存以便改回来使用
|
|
// 封面模式自定义封面会丢失内容封面图片 所以缓存以便改回来使用
|
|
this.picList[this.index] = row.audioPic
|
|
this.picList[this.index] = row.audioPic
|
|
// 是否有简介 若有则将音频的简介赋值进去
|
|
// 是否有简介 若有则将音频的简介赋值进去
|
|
- if ('description' in this.module) {
|
|
|
|
|
|
+ if (this.module.find(i => i === 'description')) {
|
|
e.description = row.description
|
|
e.description = row.description
|
|
}
|
|
}
|
|
this.$message.success('选择成功!')
|
|
this.$message.success('选择成功!')
|