|
@@ -1,57 +1,74 @@
|
|
|
<template>
|
|
|
<div class="member-table-container">
|
|
|
- <Table :columns="columns" :data="data"></Table>
|
|
|
+ <Table :columns="columns" :data="data" height="750">
|
|
|
+ <template slot-scope="{ row, index }" slot="header">
|
|
|
+ <PersonalPhoto :name="row.name" :picture="row.picture"></PersonalPhoto>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
|
|
|
export default {
|
|
|
- props:['members'],
|
|
|
+ props: ["members"],
|
|
|
+ components:{
|
|
|
+ PersonalPhoto
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
columns: [
|
|
|
{
|
|
|
- title: "Name",
|
|
|
- key: "name",
|
|
|
+ slot: "header",
|
|
|
+ title: " ",
|
|
|
+ align: "center",
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
- title: "Age",
|
|
|
- key: "age",
|
|
|
- },
|
|
|
- {
|
|
|
- title: "Address",
|
|
|
- key: "address",
|
|
|
- },
|
|
|
- ],
|
|
|
- data: [
|
|
|
- {
|
|
|
- name: "John Brown",
|
|
|
- age: 18,
|
|
|
- address: "New York No. 1 Lake Park",
|
|
|
- date: "2016-10-03",
|
|
|
+ key: "name",
|
|
|
+ title: this.$t("stuAccount.stuName"),
|
|
|
+ align: "center",
|
|
|
},
|
|
|
{
|
|
|
- name: "Jim Green",
|
|
|
- age: 24,
|
|
|
- address: "London No. 1 Lake Park",
|
|
|
- date: "2016-10-01",
|
|
|
+ key: "id",
|
|
|
+ title: this.$t("stuAccount.account"),
|
|
|
+ align: "center",
|
|
|
+ sortable: true,
|
|
|
+ sortMethod: (a, b, type) => {
|
|
|
+ if (type == "asc") {
|
|
|
+ return a.localeCompare(b);
|
|
|
+ } else {
|
|
|
+ return b.localeCompare(a);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- name: "Joe Black",
|
|
|
- age: 30,
|
|
|
- address: "Sydney No. 1 Lake Park",
|
|
|
- date: "2016-10-02",
|
|
|
+ key: "irs",
|
|
|
+ title: this.$t('courseManage.classroom.studentTableC9'),
|
|
|
+ align: "center",
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
- name: "Jon Snow",
|
|
|
- age: 26,
|
|
|
- address: "Ottawa No. 2 Lake Park",
|
|
|
- date: "2016-10-04",
|
|
|
+ key: "no",
|
|
|
+ title: this.$t("stuAccount.seatNo"),
|
|
|
+ align: "center",
|
|
|
+ width: 120,
|
|
|
+ sortable: true,
|
|
|
+ sortMethod: (a, b, type) => {
|
|
|
+ if (type == "desc") {
|
|
|
+ return parseInt(a) > parseInt(b) ? -1 : 1;
|
|
|
+ } else {
|
|
|
+ return parseInt(a) < parseInt(b) ? -1 : 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
+
|
|
|
],
|
|
|
+ data: [],
|
|
|
};
|
|
|
},
|
|
|
- created(){
|
|
|
+ created() {
|
|
|
console.log(this.members);
|
|
|
- }
|
|
|
+ this.data = this.members;
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|