|
|
@ -37,7 +37,11 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
|
|
|
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
|
|
|
<el-table-column v-if="settings[0].show" type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
<el-table-column v-if="settings[0].show" type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
|
|
|
|
<template scope="scope"> |
|
|
|
|
|
|
|
<span>{{(page - 1) * pageSize + scope.$index + 1}}</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[1].show" show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> |
|
|
|
<el-table-column v-if="settings[1].show" show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> |
|
|
|
<el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="120"></el-table-column> |
|
|
|
<el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="120"></el-table-column> |
|
|
|
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120"></el-table-column> |
|
|
|
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120"></el-table-column> |
|
|
@ -93,6 +97,7 @@ import ColumnConst from '@/const/column' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
last: this.$route.query.last, // 是否直接跳到最后一页的文章(编辑文章的时候改了所属栏目,返回到列表后则需要跳到最后一页文章) |
|
|
|
types: ColumnConst.types, |
|
|
|
types: ColumnConst.types, |
|
|
|
siteName: this.$store.state.content.site.siteName, |
|
|
|
siteName: this.$store.state.content.site.siteName, |
|
|
|
columns: [], |
|
|
|
columns: [], |
|
|
@ -126,7 +131,7 @@ export default { |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
modifiedTimeSort: '', |
|
|
|
modifiedTimeSort: '', |
|
|
|
publicationTimeSort: '', |
|
|
|
publicationTimeSort: '', |
|
|
|
ordinalSort: 0, |
|
|
|
topSort: 0, |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
originSettings: [], |
|
|
|
originSettings: [], |
|
|
|
settings: [ |
|
|
|
settings: [ |
|
|
@ -232,7 +237,7 @@ export default { |
|
|
|
columnIds: [id], |
|
|
|
columnIds: [id], |
|
|
|
pageNum: this.page, |
|
|
|
pageNum: this.page, |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageSize: this.pageSize, |
|
|
|
ordinalSort: this.ordinalSort, |
|
|
|
topSort: this.topSort, |
|
|
|
title: this.field === 'title' ? keyword : '', |
|
|
|
title: this.field === 'title' ? keyword : '', |
|
|
|
founder: this.field === 'founder' ? keyword : '', |
|
|
|
founder: this.field === 'founder' ? keyword : '', |
|
|
|
column: this.field === 'column' ? keyword : '', |
|
|
|
column: this.field === 'column' ? keyword : '', |
|
|
@ -247,7 +252,15 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.originList = JSON.parse(JSON.stringify(data.records)) |
|
|
|
this.originList = JSON.parse(JSON.stringify(data.records)) |
|
|
|
this.list = data.records |
|
|
|
this.list = data.records |
|
|
|
this.total = +data.total |
|
|
|
const total = +data.total |
|
|
|
|
|
|
|
this.total = total |
|
|
|
|
|
|
|
if (this.last) { |
|
|
|
|
|
|
|
let page = parseInt(total / 10) |
|
|
|
|
|
|
|
total % 10 && page++ |
|
|
|
|
|
|
|
this.page = page |
|
|
|
|
|
|
|
this.last = '' |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
} |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 重置栏位筛选 |
|
|
|
// 重置栏位筛选 |
|
|
@ -333,19 +346,19 @@ export default { |
|
|
|
this.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : '' |
|
|
|
this.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : '' |
|
|
|
if (order) { |
|
|
|
if (order) { |
|
|
|
this.publicationTimeSort = '' |
|
|
|
this.publicationTimeSort = '' |
|
|
|
this.ordinalSort = '' |
|
|
|
this.topSort = '' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (column.prop === 'releaseTime') { |
|
|
|
if (column.prop === 'releaseTime') { |
|
|
|
this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : '' |
|
|
|
this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : '' |
|
|
|
if (order) { |
|
|
|
if (order) { |
|
|
|
this.modifiedTimeSort = '' |
|
|
|
this.modifiedTimeSort = '' |
|
|
|
this.ordinalSort = '' |
|
|
|
this.topSort = '' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 序号排序 0默认升序 1倒序 |
|
|
|
// 序号排序 0默认升序 1倒序 |
|
|
|
if (column.prop === 'sequence') { |
|
|
|
if (column.prop === 'sequence') { |
|
|
|
this.ordinalSort = order ? order === 'ascending' ? 0 : 1 : '' |
|
|
|
this.topSort = order ? order === 'ascending' ? 0 : 1 : '' |
|
|
|
if (order) { |
|
|
|
if (order) { |
|
|
|
this.publicationTimeSort = '' |
|
|
|
this.publicationTimeSort = '' |
|
|
|
this.modifiedTimeSort = '' |
|
|
|
this.modifiedTimeSort = '' |
|
|
|