Browse Source

推荐管理

DESKTOP-SVI9JE1\muzen 1 năm trước cách đây
mục cha
commit
73ad8d0e13

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

@@ -294,8 +294,8 @@ export default {
               this.module.push(moduleOptions[i])
             }
           })
-          if (this.$route.query.threeId) {
-            this.getDetail()
+          if (this.$route.query.threeId || this.$route.query.copyId) {
+            this.getDetail(this.$route.query.threeId || this.$route.query.copyId)
             this.isRead = Boolean(this.$route.query.boolean)
           }
         }
@@ -303,8 +303,8 @@ export default {
     },
 
     // 详情
-    getDetail() {
-      detail(this.$route.query.threeId).then(res => {
+    getDetail(id) {
+      detail(id).then(res => {
         if (res.code === 0 && res.data.list.length > 0) {
           this.form = JSON.parse(JSON.stringify(res.data))
           this.form.list = []
@@ -340,6 +340,9 @@ export default {
               obj.status = i.status
             }
             this.form.list.push(obj)
+            if(this.$route.query.copyId) {
+              this.form.threeId = ''
+            }
           })
         }
       })
@@ -555,7 +558,7 @@ export default {
             }
           })
         }
-      }else{
+      } else {
         this.$message.error('请添加新增内容')
       }
     },

+ 12 - 0
src/views/operation/recommend/index.vue

@@ -50,6 +50,7 @@
             <el-button type="text" @click="getDetail(scope.row)" v-hasPermi="['operation:recommend:edit']">编辑</el-button>
             <el-button type="delete" @click="getDelete(scope.row)"
               v-hasPermi="['operation:recommend:delete']">删除</el-button>
+            <el-button type="text" @click="getCopy(scope.row)">复制</el-button>
           </span>
         </template>
       </el-table-column>
@@ -328,6 +329,17 @@ export default {
       })
     },
 
+    // 复制
+    getCopy(row) {
+      this.$router.push({
+        path: `/operation/homePage/recommend/detail`,
+        query: {
+          copyId: row.id,
+          moduleTypeId: row.moduleTypeId
+        }
+      })
+    },
+
     // 字典翻译
     statusFormatter(row) {
       return this.selectDictLabel(this.statusOptions, row.isProgressStatus)