Explorar el Código

TODO Detail page & complete mutil breadcrumb

Unknown %!s(int64=7) %!d(string=hace) años
padre
commit
22a9705358

+ 2 - 0
src/components/Breadcrumb/index.vue

26
   },
26
   },
27
   methods: {
27
   methods: {
28
     getBreadcrumb() {
28
     getBreadcrumb() {
29
+      console.log(this.$route.matched)
29
       let matched = this.$route.matched.filter(item => item.name)
30
       let matched = this.$route.matched.filter(item => item.name)
31
+      
30
       const first = matched[0]
32
       const first = matched[0]
31
       if (first && first.name !== 'dashboard') {
33
       if (first && first.name !== 'dashboard') {
32
         matched = [{ path: '/dashboard', meta: { title: '首頁' }}].concat(matched)
34
         matched = [{ path: '/dashboard', meta: { title: '首頁' }}].concat(matched)

+ 14 - 1
src/router/index.js

31
     children: [
31
     children: [
32
       {
32
       {
33
         path: 'dashboard',
33
         path: 'dashboard',
34
+        name: 'dashboard',
34
         component: _import('dashboard/index'),
35
         component: _import('dashboard/index'),
35
         meta: {
36
         meta: {
36
           title: '首頁',
37
           title: '首頁',
70
           title: '每局紀錄',
71
           title: '每局紀錄',
71
           icon: 'form'
72
           icon: 'form'
72
           // role: ['dd']
73
           // role: ['dd']
73
-        }
74
+        },
75
+        children: [
76
+          {
77
+            path: '/gambleGameBucket/index/detail',
78
+            name: 'GambleGameBucketDetail',
79
+            component: _import('gambleGameBucket/gambleGameBucketDetail/index'),
80
+            hidden: true,
81
+            meta: {
82
+              title: '詳細紀錄'
83
+              // role: ['dd']
84
+            }
85
+          }
86
+        ]
74
       }
87
       }
75
     ]
88
     ]
76
   },
89
   },

+ 91 - 0
src/views/gambleGameBucket/gambleGameBucketDetail/index.vue

1
+<template>
2
+  <div class="app-container">
3
+    <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
4
+      style="width: 100%">
5
+      <el-table-column label="ID">
6
+        <template slot-scope="scope">
7
+          {{scope.row.id}}
8
+        </template>
9
+      </el-table-column>
10
+      <el-table-column prop="GambleMember.name" label="莊家" width="200" align="center">
11
+        <!-- <template slot-scope="scope">
12
+          <span>{{scope.row.GambleMember.id}}</span>
13
+        </template> -->
14
+      </el-table-column>
15
+      <el-table-column align="center" label="時間" width="200">
16
+        <template slot-scope="scope">
17
+          <span>{{scope.row.createdAt}}</span>
18
+        </template>
19
+      </el-table-column>
20
+       <el-table-column align="center" label="操作">
21
+        <template slot-scope="scope">
22
+          <router-link to="/gambleGameBucket/index/detail">
23
+            <el-button type="primary" size="mini" @click="handlePage(scope.row)">查看</el-button>
24
+          </router-link>
25
+        </template>
26
+      </el-table-column>
27
+    </el-table>
28
+
29
+    <div v-show="!listLoading" class="pagination-container">
30
+      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.page"
31
+        :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
32
+      </el-pagination>
33
+    </div>
34
+
35
+  </div>
36
+</template>
37
+
38
+<script>
39
+import { fetchList } from '@/api/gambleGameBucket'
40
+
41
+export default {
42
+  data() {
43
+    return {
44
+      list: null,
45
+      listLoading: true,
46
+      total: null,
47
+      listQuery: {
48
+        page: 1,
49
+        limit: 20,
50
+        importance: '',
51
+        title: '',
52
+        type: '',
53
+        chipsSort: '',
54
+        updatedSort: ''
55
+      },
56
+      temp: {
57
+        id: '',
58
+        importance: 1,
59
+        name: '',
60
+        chips: '',
61
+        depositChips: ''
62
+      },
63
+    }
64
+  },
65
+  created() {
66
+    this.getList()
67
+  },
68
+  methods: {
69
+    getList() {
70
+      this.listLoading = true
71
+      fetchList(this.listQuery).then(response => {
72
+        this.list = response.data.rows
73
+        this.total = response.data.count
74
+        this.listLoading = false
75
+      })
76
+    },
77
+    handleFilter() {
78
+      this.listQuery.page = 1
79
+      this.getList()
80
+    },
81
+    handleSizeChange(val) {
82
+      this.listQuery.limit = val
83
+      this.getList()
84
+    },
85
+    handleCurrentChange(val) {
86
+      this.listQuery.page = val
87
+      this.getList()
88
+    }
89
+  }
90
+}
91
+</script>

+ 12 - 12
src/views/gambleGameBucket/index.vue

19
       </el-table-column>
19
       </el-table-column>
20
        <el-table-column align="center" label="操作">
20
        <el-table-column align="center" label="操作">
21
         <template slot-scope="scope">
21
         <template slot-scope="scope">
22
-            <el-button type="primary" size="mini" @click="handleDialog(scope.row)">查看</el-button>
22
+          <router-link to="/gambleGameBucket/index/detail">
23
+            <el-button type="primary" size="mini" @click="handlePage(scope.row)">查看</el-button>
24
+          </router-link>
23
         </template>
25
         </template>
24
       </el-table-column>
26
       </el-table-column>
25
     </el-table>
27
     </el-table>
30
       </el-pagination>
32
       </el-pagination>
31
     </div>
33
     </div>
32
 
34
 
33
-    <el-dialog title="詳細" :visible.sync="dialogVisible">
35
+    <!-- <el-dialog title="詳細" :visible.sync="dialogVisible">
34
     <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
36
     <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
35
       style="width: 100%">
37
       style="width: 100%">
36
       <el-table-column label="ID">
38
       <el-table-column label="ID">
39
         </template>
41
         </template>
40
       </el-table-column>
42
       </el-table-column>
41
       <el-table-column prop="GambleMember.name" label="莊家" width="200" align="center">
43
       <el-table-column prop="GambleMember.name" label="莊家" width="200" align="center">
42
-        <!-- <template slot-scope="scope">
43
-          <span>{{scope.row.GambleMember.id}}</span>
44
-        </template> -->
45
       </el-table-column>
44
       </el-table-column>
46
       <el-table-column align="center" label="時間" width="200">
45
       <el-table-column align="center" label="時間" width="200">
47
         <template slot-scope="scope">
46
         <template slot-scope="scope">
57
       <div slot="footer" align="center" class="dialog-footer">
56
       <div slot="footer" align="center" class="dialog-footer">
58
         <el-button type="primary" @click="closeDialog">確 定</el-button>
57
         <el-button type="primary" @click="closeDialog">確 定</el-button>
59
       </div>
58
       </div>
60
-    </el-dialog>
59
+    </el-dialog> -->
61
   </div>
60
   </div>
62
 </template>
61
 </template>
63
 
62
 
86
         chips: '',
85
         chips: '',
87
         depositChips: ''
86
         depositChips: ''
88
       },
87
       },
89
-      dialogVisible: false,
90
-      dialogStatus: ''
88
+      // dialogVisible: false,
89
+      // dialogStatus: ''
91
     }
90
     }
92
   },
91
   },
93
   created() {
92
   created() {
102
         this.listLoading = false
101
         this.listLoading = false
103
       })
102
       })
104
     },
103
     },
105
-    closeDialog() {
106
-      this.dialogVisible = false
107
-    },
108
-    handleDialog(row) {
104
+    // closeDialog() {
105
+    //   this.dialogVisible = false
106
+    // },
107
+    handlePage(row) {
109
       this.temp = Object.assign({}, row) // copy obj
108
       this.temp = Object.assign({}, row) // copy obj
109
+      // router.push({ path: '/gambleGameBucket/index/detail' })
110
       this.dialogVisible = true
110
       this.dialogVisible = true
111
     },
111
     },
112
     handleFilter() {
112
     handleFilter() {