clay commit : 解决有三级菜单时面包屑问题

This commit is contained in:
clay
2022-10-09 22:21:21 +08:00
parent b533dddb3f
commit d1215780d3
6 changed files with 66 additions and 32 deletions

View File

@@ -102,7 +102,13 @@ export default {
let time = new Date(date);
let year = time.getFullYear();
let month = time.getMonth() + 1
if (month < 10){
month = "0"+month
}
let day = time.getDate();
if (day<10){
day = "0"+ day
}
return year + "-" + month + "-" + day;
},
getContext(context) {
@@ -177,6 +183,7 @@ export default {
.article_name {
float: left;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; //作为弹性伸缩盒子模型显示。

View File

@@ -217,8 +217,8 @@ export default {
this.type = this.$route.query && this.$route.query.type
if (this.type == 3 || this.type == 1 || this.type == 2) {
this.secondId = id
this.getCrumbs();
this.showSecond = false
this.getCrumbs();
let info = getParentNode(this.secondId);
console.log("获取到info", info)
if (arcId != undefined) {
@@ -232,8 +232,10 @@ export default {
} else {
console.log(this.navId, "this.navId")
if (undefined == this.navId) {
console.log(this.navId, "this.navId1")
this.secondId = id
this.getNodes()
this.getCrumbs();
}
}
this.showSecond = true
@@ -245,7 +247,10 @@ export default {
} catch (e) {
}
this.showIndex = 0
console.log("开始循环查找id信息")
// if (this.secondId!=id){
// this.getCrumbs();
// }
console.log("开始循环查找id信息",this.secondId == id && this.navList,this.secondId , id, this.navList)
if (this.secondId == id && this.navList) {
for (let i = 0; i < this.navList.length; i++) {
if (this.navId == this.navList[i].encodeId) {
@@ -286,7 +291,7 @@ export default {
/**
* 获得面包屑导航
*/
getCrumbs() {
getCrumbs(id) {
crumbs(this.secondId).then(res => {
this.crumbs = res.data
})
@@ -593,7 +598,6 @@ export default {
a {
text-decoration: none;
font-size: 1.4rem !important;
color: #3C3C3C;
}
}

View File

@@ -153,14 +153,26 @@ export default {
let time = new Date(date);
let year = time.getFullYear();
let month = time.getMonth() + 1
if (month < 10){
month = "0"+month
}
let day = time.getDate();
if (day<10){
day = "0"+ day
}
return year + "-" + month + "-" + day;
},
getMonthTime(date) {
let time = new Date(date);
let month = time.getMonth() + 1
if (month < 10){
month = "0"+month
}
let day = time.getDate();
if (day<10){
day = "0"+ day
}
return month + "-" + day;
},
},

View File

@@ -81,7 +81,13 @@ export default {
let time = new Date(date);
let year = time.getFullYear();
let month = time.getMonth() + 1
if (month < 10){
month = "0"+month
}
let day = time.getDate();
if (day<10){
day = "0"+ day
}
return year + "-" + month + "-" + day;
},
},
@@ -318,7 +324,6 @@ export default {
}
.time {
width: 6rem;
height: 1.4rem;
font-size: 1rem;
font-weight: 500;

View File

@@ -9,12 +9,13 @@
<span>{{ $t("message.undergraduate_education") }}</span>
</div>
<div class="vline">
<div class="undergraduate_content" v-for="(item,index) in undergraduateData" :key="index" @click="getArticle(item)">
<div class="undergraduate_content" v-for="(item,index) in undergraduateData" :key="index"
@click="getArticle(item)">
<div class="undergraduate_content_time">
{{getMonthTime(item.publishTime)}}
{{ getMonthTime(item.publishTime) }}
</div>
<div class="undergraduate_content_text">
{{item.title}}
{{ item.title }}
</div>
</div>
<div class="more" @click="lookMore('KW_T7dJ2lt5sC-RJZSnPtk0')">
@@ -25,15 +26,17 @@
</el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
<div class="graduate headline">
<img class="graduate_img" src="../../../assets/index/undergraduate_and_graduate/boshimaobeifen.png" alt=""/>
<img class="graduate_img" src="../../../assets/index/undergraduate_and_graduate/boshimaobeifen.png"
alt=""/>
<span>{{ $t("message.postgraduate_education") }}</span>
</div>
<div class="undergraduate_content" v-for="(item,index) in graduateData" :key="index" @click="getArticle(item)">
<div class="undergraduate_content" v-for="(item,index) in graduateData" :key="index"
@click="getArticle(item)">
<div class="undergraduate_content_time">
{{getMonthTime(item.publishTime)}}
{{ getMonthTime(item.publishTime) }}
</div>
<div class="undergraduate_content_text">
{{item.title}}
{{ item.title }}
</div>
</div>
<div class="more" @click="lookMore('1yaM_T4qiBsFULvLXHbMflQ')">
@@ -54,10 +57,10 @@ import {lookMoreFixedComment} from "../../../utils/sist";
export default {
name: "undergraduate_and_graduate",
data(){
return{
undergraduateData:[],
graduateData:[],
data() {
return {
undergraduateData: [],
graduateData: [],
width: document.documentElement.clientWidth > 992
}
},
@@ -97,18 +100,16 @@ export default {
});
},
getDateTime(date) {
let time = new Date(date);
let year = time.getFullYear();
let month = time.getMonth() + 1
let day = time.getDate();
return year + "-" + month + "-" + day;
},
getMonthTime(date) {
let time = new Date(date);
let month = time.getMonth() + 1
if (month < 10) {
month = "0" + month
}
let day = time.getDate();
if (day < 10) {
day = "0" + day
}
return month + "-" + day;
},
},
@@ -118,9 +119,10 @@ export default {
<style scoped lang="scss">
.undergraduate_content{
.undergraduate_content {
cursor: pointer;
}
@media screen and (max-width: 960px) {
.undergraduate {
border-radius: 36px 36px 0 0 !important;
@@ -129,12 +131,13 @@ export default {
border-radius: 36px 36px 0 0 !important;
}
.more {
justify-content: center!important;
justify-content: center !important;
}
.vline {
border-right: none!important;
border-right: none !important;
}
}
@media screen and (max-width: 768px) {
.undergraduate {
border-radius: 36px 36px 0 0 !important;
@@ -143,11 +146,11 @@ export default {
border-radius: 36px 36px 0 0 !important;
}
.more {
justify-content: center!important;
justify-content: center !important;
}
.vline {
border-right: none!important;
border-right: none !important;
}
}
@@ -193,10 +196,12 @@ export default {
.undergraduate {
border-radius: 36px 0 0 0;
&_img{
&_img {
width: 3.1rem;
height: 3.3rem;
}
&_content {
display: flex;
margin-bottom: 1.5rem;
@@ -259,7 +264,8 @@ export default {
.graduate {
border-radius: 0 36px 0 0;
&_img{
&_img {
width: 4.3rem;
height: 3.3rem;
}