|
@@ -48,13 +48,16 @@ export default {
|
|
|
async mounted() {
|
|
|
// 当前菜单参数
|
|
|
this.code = this.$route.params.code;
|
|
|
- // 顶级菜单参数
|
|
|
- this.parentCode = this.$route.query.parentCode;
|
|
|
- await this.filterQuery();
|
|
|
- // 获取一例菜单
|
|
|
- this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
|
|
|
- // 控制左侧菜单当前选项
|
|
|
- this.$refs.letnav.setIndex();
|
|
|
+ const topahes = await this.topage();
|
|
|
+ if (topahes) {
|
|
|
+ // 顶级菜单参数
|
|
|
+ this.parentCode = this.$route.query.parentCode;
|
|
|
+ await this.filterQuery();
|
|
|
+ // 获取一例菜单
|
|
|
+ this.menu = this.$setChildrenSession({ menus: this.menusall, iscode: this.parentCode });
|
|
|
+ // 控制左侧菜单当前选项
|
|
|
+ this.$refs.letnav.setIndex();
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['contentsList']),
|
|
@@ -67,6 +70,14 @@ export default {
|
|
|
// 列表点击
|
|
|
newClick(e) {
|
|
|
this.$router.push(`/details/${e._id}`);
|
|
|
+ },
|
|
|
+ topage() {
|
|
|
+ const item = this.menusall.find(e => e.code == this.code);
|
|
|
+ if (item.type == '2') {
|
|
|
+ this.$router.push(`/pages/${item.code}`);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
@@ -88,49 +99,49 @@ export default {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
.listBoxLeft {
|
|
|
- width: 25%;
|
|
|
+ width: 20%;
|
|
|
margin-top: 5%;
|
|
|
margin-right: 5%;
|
|
|
}
|
|
|
.listBoxRight {
|
|
|
- width: 70%;
|
|
|
+ width: 75%;
|
|
|
margin-top: 5%;
|
|
|
.listBox {
|
|
|
width: 100%;
|
|
|
margin: 0 auto;
|
|
|
margin-bottom: 5%;
|
|
|
- .el-card__body {
|
|
|
+ ::v-deep .el-card__body {
|
|
|
display: flex;
|
|
|
- }
|
|
|
- .listimg {
|
|
|
- display: block;
|
|
|
- width: 15%;
|
|
|
- height: 150px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- .text {
|
|
|
- width: 70%;
|
|
|
- margin-left: 5%;
|
|
|
- .title {
|
|
|
+ .listimg {
|
|
|
+ display: block;
|
|
|
+ width: 15%;
|
|
|
+ height: 150px;
|
|
|
cursor: pointer;
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
- }
|
|
|
- .describe {
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
- color: #999;
|
|
|
}
|
|
|
- .date {
|
|
|
- width: 100%;
|
|
|
- color: #999;
|
|
|
- line-height: 3em;
|
|
|
+ .text {
|
|
|
+ width: 70%;
|
|
|
+ margin-left: 5%;
|
|
|
+ .title {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ .describe {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ .date {
|
|
|
+ width: 100%;
|
|
|
+ color: #999;
|
|
|
+ line-height: 3em;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|