|
@@ -8,7 +8,7 @@
|
|
|
<div class="box" v-if="!isnew">
|
|
|
<div class="text" v-for="(item, index) in contentList" :key="index">
|
|
|
<el-image class="jt" :src="icon"></el-image>
|
|
|
- <div class="title" @click="newClick(item)">{{ item.title }}</div>
|
|
|
+ <div class="title" :class="{ istitle: item._id == id }" @click="newClick(item)">{{ item.title }}</div>
|
|
|
<span class="date">{{ item.date | dates }}</span>
|
|
|
</div>
|
|
|
<pagination ref="pagination" class="pagination" :total="listTotal" @query="filterQuery"></pagination>
|
|
@@ -47,6 +47,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ id: null,
|
|
|
code: null,
|
|
|
pageSize: 10,
|
|
|
parentCode: null,
|
|
@@ -57,6 +58,9 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
|
+ this.id = sessionStorage.getItem('id');
|
|
|
+ console.log(this.id);
|
|
|
+ const listPage = sessionStorage.getItem('listPage');
|
|
|
// 所有菜单
|
|
|
await this.menusQueryAll();
|
|
|
// 当前菜单参数
|
|
@@ -74,6 +78,10 @@ export default {
|
|
|
await this.filterQuery({ filter: {}, paging: { page: 0, size: 100 } });
|
|
|
return;
|
|
|
}
|
|
|
+ if (listPage) {
|
|
|
+ this.$refs.pagination.handleCurrentChange(Number(listPage) + 1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
await this.filterQuery();
|
|
|
}
|
|
|
},
|
|
@@ -84,6 +92,9 @@ export default {
|
|
|
filter.bind = this.code;
|
|
|
if (this.code.length == 2 && this.menu.children) filter.parentCode = this.code;
|
|
|
await this.contentsList({ filter, paging });
|
|
|
+ const listPage = sessionStorage.getItem('listPage');
|
|
|
+ if (listPage) sessionStorage.removeItem('listPage');
|
|
|
+ sessionStorage.setItem('listPage', paging.page);
|
|
|
},
|
|
|
// 列表点击
|
|
|
newClick(e) {
|
|
@@ -93,6 +104,9 @@ export default {
|
|
|
this.$setParentsetSession({ menus: this.menusall, iscode: item });
|
|
|
this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
|
|
|
this.$router.push(`/details/${e._id}`);
|
|
|
+ const ids = sessionStorage.getItem('id');
|
|
|
+ if (ids) sessionStorage.removeItem('id');
|
|
|
+ sessionStorage.setItem('id', e._id);
|
|
|
},
|
|
|
topage() {
|
|
|
const item = this.menusall.find(e => e.code == this.code);
|
|
@@ -144,6 +158,9 @@ export default {
|
|
|
margin-top: 2.5%;
|
|
|
margin-left: 5px;
|
|
|
}
|
|
|
+ .istitle {
|
|
|
+ color: #b30000;
|
|
|
+ }
|
|
|
.title {
|
|
|
margin-left: 5px;
|
|
|
cursor: pointer;
|