refactor:dashboard

This commit is contained in:
Pan
2017-11-16 17:25:28 +08:00
parent 35055c5e51
commit 6d1059f6a8
20 changed files with 720 additions and 120 deletions

View File

@@ -0,0 +1,55 @@
<template>
<el-table :data="list" style="width: 100%;padding-top: 15px;" >
<el-table-column label="Order_No">
<template slot-scope="scope">
{{scope.row.order_no}}
</template>
</el-table-column>
<el-table-column label="Price" width="195" align="center">
<template slot-scope="scope">
{{scope.row.price | toThousandslsFilter}}
</template>
</el-table-column>
<el-table-column label="Status" width="100" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter"> {{scope.row.status}}</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="Username" width="135" align="center">
<template slot-scope="scope">
{{scope.row.username}}
</template>
</el-table-column> -->
</el-table>
</template>
<script>
import { fetchList } from '@/api/transaction'
export default {
data() {
return {
list: null
}
},
filters: {
statusFilter(status) {
const statusMap = {
success: 'success',
pending: 'danger'
}
return statusMap[status]
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
fetchList().then(response => {
this.list = response.data.items.slice(0, 7)
})
} }
}
</script>