|
@@ -60,7 +60,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right">
|
|
|
- <el-button type="info">清空</el-button>
|
|
|
+ <el-button type="info" @click="getEmpty(item, index)">清空</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -237,7 +237,14 @@ export default {
|
|
|
moduleList(this.$route.query.moduleTypeId).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
res.data.elementIds.map(i => {
|
|
|
- this.module[moduleOptions[i]] = i === 'childList' ? [] : ''
|
|
|
+ if (i === '4') { // 内容 关联 音频数据 存在底层module
|
|
|
+ this.module.contentName = ''
|
|
|
+ this.module.module = {}
|
|
|
+ } else if (i === '9') {
|
|
|
+ this.module.childList = []
|
|
|
+ } else {
|
|
|
+ this.module[moduleOptions[i]] = ''
|
|
|
+ }
|
|
|
})
|
|
|
if (this.$route.query.threeId) {
|
|
|
this.getDetail()
|
|
@@ -275,12 +282,7 @@ export default {
|
|
|
obj.module = i.module
|
|
|
}
|
|
|
|
|
|
- // 是否有内容
|
|
|
- if (key === 'contentName') {
|
|
|
- obj.module = i.module
|
|
|
- }
|
|
|
-
|
|
|
- // 封面模式关联 图片
|
|
|
+ // 封面模式 关联 图片 缓存内容图片
|
|
|
if (i.isCustom === 1) {
|
|
|
this.picList[index] = i.pic
|
|
|
}
|
|
@@ -435,6 +437,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ // 清空
|
|
|
+ getEmpty(item) {
|
|
|
+ for (const key in item) {
|
|
|
+ item[key] = key === 'childrenList' ? [] : key === 'module' ? {} : ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 提交
|
|
|
getSubmit() {
|
|
|
let data = this.secondId ? {
|