许成详 6 лет назад
Родитель
Сommit
ab7e5e9114
1 измененных файлов: 21 добавлений и 8 удалений
  1. 21
    8
      src/pages/system/cmsManager/majorProjects/index.vue

+ 21
- 8
src/pages/system/cmsManager/majorProjects/index.vue Просмотреть файл

@@ -59,9 +59,13 @@
59 59
               type="warning"
60 60
               v-if="scope.row.Status === 0"
61 61
               @click="editItem(scope.$index, scope.row)">编辑</el-button>
62
-            <!-- <el-button
62
+            <el-button
63 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 69
             <el-button
66 70
               size="mini"
67 71
               type="danger"
@@ -142,15 +146,12 @@ export default {
142 146
       })
143 147
     },
144 148
     editItem (index, row) { // 编辑
145
-      console.log(index, row)
146 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 154
     deleteItem (index, row) { // 删除
153
-      console.log(index, row)
154 155
       this.$confirm('确认删除此项目专题?', '提示', {
155 156
         confirmButtonText: '确定',
156 157
         cancelButtonText: '取消',
@@ -208,6 +209,18 @@ export default {
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 226
 </script>