Работа над HistoryPage
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
stripe
|
stripe
|
||||||
border
|
border
|
||||||
:default-sort = "{prop: 'touchTime', order: 'descending'}"
|
:default-sort = "{prop: 'touchTime', order: 'descending'}"
|
||||||
|
:header-cell-style = "headerCellStyle"
|
||||||
>
|
>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -20,20 +21,24 @@
|
|||||||
min-width="120px"
|
min-width="120px"
|
||||||
sortable
|
sortable
|
||||||
>
|
>
|
||||||
<template slot="header" slot-scope="scope">
|
<template slot="header" slot-scope="scope"><!-- eslint-disable-line vue/no-unused-vars -->
|
||||||
Время<br>просмотра
|
Время<br>просмотра
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
min-width="300px"
|
|
||||||
>
|
>
|
||||||
<template slot="header" slot-scope="scope">
|
<template slot="header" slot-scope="scope"><!-- eslint-disable-line vue/no-unused-vars -->
|
||||||
<el-input
|
<el-input
|
||||||
v-model="search"
|
v-model="search"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
style="margin: 0; padding: 0; vertical-align: bottom; margin-top: 10px"
|
||||||
placeholder="Найти"/>
|
placeholder="Найти"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
min-width="300px"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.desc.author }}</span><br>
|
<span>{{ scope.row.desc.author }}</span><br>
|
||||||
<span>{{ `"${scope.row.desc.title}"` }}</span>
|
<span>{{ `"${scope.row.desc.title}"` }}</span>
|
||||||
@@ -50,6 +55,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</Window>
|
</Window>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,6 +105,24 @@ class HistoryPage extends Vue {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const search = this.search;
|
||||||
|
return result.filter(item => {
|
||||||
|
return !search ||
|
||||||
|
item.touchTime.includes(search) ||
|
||||||
|
item.desc.title.toLowerCase().includes(search.toLowerCase()) ||
|
||||||
|
item.desc.author.toLowerCase().includes(search.toLowerCase())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
headerCellStyle(cell) {
|
||||||
|
let result = {margin: 0, padding: 0};
|
||||||
|
if (cell.columnIndex > 0) {
|
||||||
|
result['border-bottom'] = 0;
|
||||||
|
}
|
||||||
|
if (cell.rowIndex > 0) {
|
||||||
|
result.height = '0px';
|
||||||
|
result['border-right'] = 0;
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,4 +149,8 @@ class HistoryPage extends Vue {
|
|||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user