许成详 6 年前
父节点
当前提交
ab7e5e9114
共有 1 个文件被更改,包括 21 次插入8 次删除
  1. 21
    8
      src/pages/system/cmsManager/majorProjects/index.vue

+ 21
- 8
src/pages/system/cmsManager/majorProjects/index.vue 查看文件

59
               type="warning"
59
               type="warning"
60
               v-if="scope.row.Status === 0"
60
               v-if="scope.row.Status === 0"
61
               @click="editItem(scope.$index, scope.row)">编辑</el-button>
61
               @click="editItem(scope.$index, scope.row)">编辑</el-button>
62
-            <!-- <el-button
62
+            <el-button
63
               size="mini"
63
               size="mini"
64
-              @click="copyItemUrl(scope.$index, scope.row)">复制专题链接</el-button> -->
64
+              type="success"
65
+              v-clipboard:copy="returnUrl(scope.row.CmsCaseId)"
66
+              v-clipboard:success="onCopy"
67
+              v-clipboard:error="onError"
68
+              >点击复制链接</el-button>
65
             <el-button
69
             <el-button
66
               size="mini"
70
               size="mini"
67
               type="danger"
71
               type="danger"
142
       })
146
       })
143
     },
147
     },
144
     editItem (index, row) { // 编辑
148
     editItem (index, row) { // 编辑
145
-      console.log(index, row)
146
       this.$router.push({ name: 'editIndexCase', query: { id: row.CmsCaseId } })
149
       this.$router.push({ name: 'editIndexCase', query: { id: row.CmsCaseId } })
147
     },
150
     },
148
-    // copyItemUrl (index, row) { // 复制专题链接
149
-    //   console.log(index, row)
150
-    //   window.clipboardData.setData('Text', row.Title)
151
-    // },
151
+    returnUrl (id) {
152
+      return window.location.origin + window.location.pathname + 'user.html#/majorProjects?id=' + id
153
+    },
152
     deleteItem (index, row) { // 删除
154
     deleteItem (index, row) { // 删除
153
-      console.log(index, row)
154
       this.$confirm('确认删除此项目专题?', '提示', {
155
       this.$confirm('确认删除此项目专题?', '提示', {
155
         confirmButtonText: '确定',
156
         confirmButtonText: '确定',
156
         cancelButtonText: '取消',
157
         cancelButtonText: '取消',
208
 
209
 
209
       })
210
       })
210
     },
211
     },
212
+    onCopy () {
213
+      this.$message({
214
+        type: 'success',
215
+        message: '复制成功!'
216
+      })
217
+    },
218
+    onError () {
219
+      this.$message({
220
+        type: 'error',
221
+        message: '复制失败!'
222
+      })
223
+    },
211
   }
224
   }
212
 }
225
 }
213
 </script>
226
 </script>