Просмотр исходного кода

Merge branch 'develop/3.0.8' into test

DESKTOP-2S67K1S\31396 2 лет назад
Родитель
Сommit
4b3097ae82
1 измененных файлов с 17 добавлено и 8 удалено
  1. 17 8
      src/views/operation/recommend/detail.vue

+ 17 - 8
src/views/operation/recommend/detail.vue

@@ -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 ? {