Browse Source

添加一键复制功能

wolyshaw 4 years ago
parent
commit
77d215d12b
2 changed files with 9 additions and 6 deletions
  1. 0 3
      src/components/copy-text/index.vue
  2. 9 3
      src/views/teamDetail/teamList.vue

+ 0 - 3
src/components/copy-text/index.vue

@@ -20,9 +20,6 @@ export default {
       default: true
     }
   },
-  created() {
-    console.log(this)
-  },
   methods: {
     copyText() {
       const slot = this.$slots.default || []

+ 9 - 3
src/views/teamDetail/teamList.vue

@@ -80,11 +80,17 @@
                            width="100"
                            align='center'
                            label="乐团编号">
+                           <template slot-scope="scope">
+                             <copy-text>{{scope.row.id}}</copy-text>
+                           </template>
           </el-table-column>
           <el-table-column prop="name"
                            width="200px"
                            align='center'
                            label="乐团名称">
+                           <template slot-scope="scope">
+                             <copy-text>{{scope.row.name}}</copy-text>
+                           </template>
           </el-table-column>
           <el-table-column align='center'
                            width="200px"
@@ -385,7 +391,7 @@ export default {
       this.$router.push({ path: '/business/resetTeaming', query: { type: 'resetTeam', id: row.id, search, rules } })
     },
     setSearchList (obj) {
-      // 
+      //
       // 没有相同的key=>添加这个对象
       // 有相同的key => 替换这个对象
       if (obj.type == 1) {
@@ -437,7 +443,7 @@ export default {
           if (this.searchLsit[some].value == item.value && this.searchLsit[some].id == item.id) {
             this.searchLsit.splice(some, 1);
           }
-          // id: 'school', key: this.schools[item].text, value: val, type: 1 
+          // id: 'school', key: this.schools[item].text, value: val, type: 1
         }
 
 
@@ -560,7 +566,7 @@ export default {
       let rules = JSON.stringify(this.rules)
       this.$router.push({ path: '/business/teamDetailedList', query: { id: row.id, search, rules } })
     },
-    //  
+    //
     lookTeamInfo (row) {
       let search = JSON.stringify(this.topForm)
       let rules = JSON.stringify(this.rules)