Merge pull request 'clay commit : 解决有三级菜单时跳转出现问题' (#35) from clay into master

Reviewed-on: http://git.hchyun.com/feashow/sist_web/pulls/35
This commit is contained in:
clay
2022-10-07 13:04:07 +00:00
9 changed files with 86 additions and 134 deletions

View File

@@ -30,6 +30,13 @@ export function getNode(data) {
data:data
})
}
export function getNodeNav(data) {
return request({
url: '/web/nodeNav',
method: 'post',
data:data
})
}
// 获取文章列表
export function getArticleList(data) {
return request({

View File

@@ -98,20 +98,22 @@ export function toArticle(news, width) {
if (info == null) {
return
}
let routeData = null;
if (info.three == null) {
if (width) {
vm.$router.push("/pc/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
routeData = vm.$router.resolve("/pc/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} else {
vm.$router.push("/mobile/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
routeData = vm.$router.resolve("/mobile/" + info.second.encodeId + "?id=" + news.id + "&type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
}
} else {
console.log(info.three,"toArticle,info.three")
console.log(info.three, "toArticle,info.three")
if (width) {
vm.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
routeData = vm.$router.resolve("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
} else {
vm.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
routeData = vm.$router.resolve("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
}
}
window.open(routeData.href,"_blank")
})
}

View File

@@ -64,8 +64,8 @@ export default {
<style scoped lang="scss">
.context {
margin: 3rem 2rem;
padding-bottom: 3rem;
margin: 2rem 2rem;
//padding-bottom: 3rem;
//width: 84.3rem;
//background: #FFFFFF;

View File

@@ -39,7 +39,8 @@
<div class="tw_context_title" @click="getContext(item)">
{{ item.title }}
</div>
<div class="tw_context_text" v-html="item.content"></div>
<div v-if="item.description" class="tw_context_text">{{item.description}}</div>
<div v-if="!item.description" class="tw_context_text" v-html="item.content"></div>
</div>
</el-col>
<el-col v-show="width>992" :xs="1" :sm="1" :md="3" :lg="4" :xl="3">

View File

@@ -16,7 +16,7 @@
<div style="background-color:#F8F8F8 ; padding-bottom: 19rem">
<!--有三级菜单-->
<el-row v-show="false">
<el-row v-show="showSecond">
<el-col v-if="$i18n.locale === 'cn'" :xs="2" :sm="2" :md="1.5" :lg="2" :xl="4">
<div class="grid-content"></div>
</el-col>
@@ -45,82 +45,6 @@
</div>
</el-col>
<el-col v-if="$i18n.locale === 'en'" :xs="2" :sm="2" :md="2" :lg="2" :xl="3">
<div class="grid-content"></div>
</el-col>
<el-col v-if="$i18n.locale === 'en'" v-show="width" :md="6" :lg="6" :xl="5">
<div class="left_lab english" ref="lab">
<div class="lab">
<div v-for="(nav,index) in navList" class="lab_div">
<div v-if="index === showIndex" class="lab_list lab_select" @click="navClick(nav,index)">
<div class="lab_img">
<img src="@/assets/school_profile/eji_icon_xz.png" alt="">
</div>
<div class="lab_title">
{{ nav.englishTitle }}
</div>
</div>
<div v-if="index !== showIndex" class="lab_list" @click="navClick(nav,index)">
<div class="lab_img">
<img src="@/assets/school_profile/eji_icon_xz.png" alt="">
</div>
<div class="lab_title">
{{ nav.englishTitle }}
</div>
</div>
</div>
</div>
</div>
</el-col>
<!--<el-col v-if="$i18n.locale === 'cn'" :xs="20" :sm="20" :md="15" :lg="14" :xl="12">-->
<el-col :xs="20" :sm="20" :md="15" :lg="14" :xl="12">
<el-row>
<el-col>
<div class="tab">
<router-link style="color: #1956BC; font-size: 16px;" to="/home">{{ $t('message.home') }}</router-link>
<span> > </span>
<span>
<!--<router-link to="">-->
<span v-if="$i18n.locale === 'cn'">{{ crumbs.one.title }}</span>
<span v-if="$i18n.locale === 'en'">{{ crumbs.one.englishTitle }}</span>
<!--</router-link>-->
</span>
<span> > </span>
<span>
<span v-if="$i18n.locale === 'cn'">{{ crumbs.two.title }}</span>
<span v-if="$i18n.locale === 'en'">{{ crumbs.two.englishTitle }}</span>
</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col>
<Introduction :introduction="contextData" v-if="type === 1"/>
<List :list="contextData" v-if="type === 2 && listDataType == 0"/>
<SimpleList :list="contextData" v-if="type === 2 && listDataType == 1"/>
<FileList :value="contextData" v-if="type === 4"/>
<DireData :value="contextData" v-if="type === 3 && dreDataType == '1'"/>
<DireDataTow :value="contextData" v-if="type === 3 && dreDataType == '2'"/>
<Details :value="detailsData" v-if="type == null"/>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row v-show="true">
<el-col v-if="$i18n.locale === 'cn'" :xs="2" :sm="2" :md="1.5" :lg="2" :xl="4">
<div class="grid-content"></div>
</el-col>
<el-col v-if="$i18n.locale === 'cn'" v-show="width" :md="6" :lg="6" :xl="4">
<div class="left_bgc">
<div class="right_bgc">
</div>
</div>
</el-col>
<el-col v-if="$i18n.locale === 'en'" :xs="2" :sm="2" :md="2" :lg="2" :xl="3">
<div class="grid-content"></div>
@@ -151,6 +75,7 @@
</div>
</el-col>
<!--<el-col v-if="$i18n.locale === 'cn'" :xs="20" :sm="20" :md="15" :lg="14" :xl="12">-->
<el-col :xs="20" :sm="20" :md="15" :lg="14" :xl="12">
<el-row>
@@ -244,6 +169,7 @@ import FileList from './components/file_list.vue'
import SimpleList from './components/simple_list.vue'
import {handleTree} from "@/utils/ebts";
import {getParentNode, setLanguage} from "@/utils/sist";
import {getNodeNav} from "../../api";
export default {
name: "index",
@@ -282,8 +208,9 @@ export default {
},
watch: {
$route(to, from) {
console.log("我被触发了")
console.log("$route触发了")
this.showIndex = 0
this.rest()
let arcId = this.$route.params && this.$route.query.id
this.navId = this.$route.params && this.$route.params.navId;
let id = this.$route.params && this.$route.params.secondId
@@ -305,6 +232,7 @@ export default {
} else {
console.log(this.navId, "this.navId")
if (undefined == this.navId) {
this.secondId = id
this.getNodes()
}
}
@@ -316,14 +244,18 @@ export default {
this.$refs.lab.style.height = this.navList.length * 8 + 10 + 'rem'
} catch (e) {
}
this.showIndex = 0
console.log("开始循环查找id信息")
if (this.secondId == id && this.navList) {
for (let i = 0; i < this.navList.length; i++) {
if (this.navId == this.navList[i].encodeId) {
console.log("找到了")
this.showIndex = i
this.getContent(this.navList[i])
}
}
} else {
console.log("跳转的路由和以前不一样")
this.navList = []
this.secondId = id
this.getNav()
@@ -331,6 +263,7 @@ export default {
}
},
created() {
console.log("created触发了")
setLanguage(this)
this.showIndex = 0
this.secondId = this.$route.params && this.$route.params.secondId;
@@ -339,11 +272,17 @@ export default {
console.log(this.type, "this.type")
setTimeout(() => {
this.getNav()
this.getNodes()
}, 200);
//this.getNav()
this.getCrumbs();
},
methods: {
rest() {
this.showIndex = 0
this.navId = null
this.type = null
},
/**
* 获得面包屑导航
*/
@@ -388,13 +327,13 @@ export default {
return
}
this.showSecond = true
this.getNodes()
},
/**
* 获得节点信息
*/
async getNodes() {
console.log("getNodes被触发了")
this.navList = []
// await getNode({id: this.secondId}).then(res => {
// this.navList = res.data
@@ -425,12 +364,20 @@ export default {
// }
// }
// })
let res = await getNode({id: this.secondId})
let res = await getNodeNav({id: this.secondId})
// todo 延时异步问题
setTimeout(() => {
this.$refs.lab.style.height = res.data.length * 8 + 10 + 'rem'
}, 100);
console.log(res, "2222")
if (res.data.length == 0) {
this.navList = []
this.showSecond = false
return
}
this.navList = res.data
// setTimeout(() => {
this.$refs.lab.style.height = res.data.length * 8 + 10 + 'rem'
console.log("qqq")
// }, 100);
// if (!this.navList){
// return
// }
@@ -440,10 +387,11 @@ export default {
}
}
let arcId = this.$route.query && this.$route.query.id
console.log("进入到arcId 的判断", arcId)
if (arcId != undefined) {
this.getContext(arcId)
} else {
console.log("测试,我被触发了!")
console.log("进入到this.navId 的判断", this.navId)
if (this.navId == undefined) {
this.getContent(this.navList[0])
} else {
@@ -456,8 +404,7 @@ export default {
* @param menu
*/
getContent(menu) {
console.log("getContent内部,menu:", menu)
console.log(menu)
console.log("getContent被触发了", menu)
if (menu == undefined) {
return
}
@@ -472,6 +419,7 @@ export default {
pageSize: 5
}
this.listDataType = 0
console.log(menu.isSimple,"menu.isSimple")
if (this.type === 4 || menu.isSimple == 1) {
data.pageSize = 10
this.listDataType = 1
@@ -637,22 +585,6 @@ export default {
}
}
.left_bgc{
width: 13.8rem;
//height: 250px;
background: #1956BC;
border-radius: 0px 0px 13px 0px;
position: relative;
.right_bgc{
width: 119px;
height: 200px;
background: #FFFFFF;
box-shadow: 0px 1px 3px 0px rgba(6,42,102,0.67);
border-radius: 0px 0px 16px 13px;
}
}
.tab {
margin-left: 1.9rem;
margin-top: 1.5rem;

View File

@@ -34,8 +34,8 @@
<div class="academy_content_title">
{{sciencesData[0].title}}
</div>
<div class="academy_content_text" v-html="sciencesData[0].content">
</div>
<div v-if="sciencesData[0].description" class="academy_content_text">{{sciencesData[0].description}}</div>
<div v-if="!sciencesData[0].description" class="academy_content_text" v-html="sciencesData[0].content"></div>
</div>
</el-col>
<el-col :span="2">
@@ -50,8 +50,8 @@
<div class="academy_content_title">
{{sciencesData[1].title}}
</div>
<div class="academy_content_text" v-html="sciencesData[1].content">
</div>
<div v-if="sciencesData[1].description" class="academy_content_text">{{sciencesData[1].description}}</div>
<div v-if="!sciencesData[1].description" class="academy_content_text" v-html="sciencesData[1].content"></div>
</div>
</el-col>
</el-row>
@@ -65,8 +65,8 @@
<div class="academy_content_title">
{{sciencesData[2].title}}
</div>
<div class="academy_content_text" v-html="sciencesData[2].content">
</div>
<div v-if="sciencesData[2].description" class="academy_content_text">{{sciencesData[2].description}}</div>
<div v-if="!sciencesData[2].description" class="academy_content_text" v-html="sciencesData[2].content"></div>
</div>
</el-col>
<el-col :span="2">
@@ -83,8 +83,8 @@
<div class="academy_content_title">
{{sciencesData[3].title}}
</div>
<div class="academy_content_text" v-html="sciencesData[3].content">
</div>
<div v-if="sciencesData[3].description" class="academy_content_text">{{sciencesData[3].description}}</div>
<div v-if="!sciencesData[3].description" class="academy_content_text" v-html="sciencesData[3].content"></div>
</div>
</el-col>
</el-row>
@@ -264,6 +264,7 @@ export default {
color: #0049AF;
.academy_content_text{
color: #575757;
font-size: 1.4rem !important;
}
.img {
@@ -314,7 +315,7 @@ export default {
//width: 139px;
width: 100%;
//height: 38px;
font-size: 1.4rem;
font-size: 1.6rem;
font-weight: bold;
//color: #FFFFFF;
line-height: 1.9rem;

View File

@@ -23,8 +23,8 @@
</div>
<div class="announcements_text_line"></div>
<div class="announcements_text_title">{{item.title}}</div>
<div class="announcements_text_content" v-html="item.content">
</div>
<div v-if="item.description" class="announcements_text_content">{{item.description}}</div>
<div v-if="!item.description" class="announcements_text_content" v-html="item.content"></div>
</div>
</el-col>
</el-row>
@@ -173,7 +173,7 @@ export default {
width: 100%;
height: 3.8rem;
font-size: 1.4rem;
font-size: 1.6rem;
font-weight: bold;
color: #000000;
line-height: 1.9rem;
@@ -189,7 +189,7 @@ export default {
&_content {
width: 100%;
height: 7rem;
font-size: 1rem;
font-size: 1.4rem;
font-weight: 500;
color: #777777;
line-height: 1.8rem;

View File

@@ -21,7 +21,7 @@
<td>
<div class="right one">
<div class="table_tr_left">{{ $t('message.employees') }}</div>
<div class="table_tr_right">{{data.worker}}</div>
<div class="table_tr_right">{{data.worker}}</div>
</div>
</td>
</tr>
@@ -29,7 +29,7 @@
<td>
<div class="right tow">
<div class="table_tr_left">{{ $t('message.number_students') }}</div>
<div class="table_tr_right">{{data.students}}</div>
<div class="table_tr_right">{{data.students}}</div>
</div>
</td>
</tr>
@@ -37,7 +37,7 @@
<td>
<div class="right three">
<div class="table_tr_left">{{ $t('message.graduate_tutor') }}</div>
<div class="table_tr_right">{{data.postgraduateTutor}}</div>
<div class="table_tr_right">{{data.postgraduateTutor}}</div>
</div>
</td>
</tr>
@@ -45,7 +45,7 @@
<td>
<div class="right fourth">
<div class="table_tr_left">{{ $t('message.research_team') }}</div>
<div class="table_tr_right">{{data.scientificTeam}}</div>
<div class="table_tr_right">{{data.scientificTeam}}</div>
</div>
</td>
</tr>
@@ -53,7 +53,7 @@
<td>
<div class="right five">
<div class="table_tr_left">{{ $t('message.high_level_talents') }}</div>
<div class="table_tr_right">{{data.highLevelTalents}}</div>
<div class="table_tr_right">{{data.highLevelTalents}}</div>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@
<td>
<div class="right six">
<div class="table_tr_left">{{ $t('message.major_projects') }}</div>
<div class="table_tr_right">{{data.majorProjects}}</div>
<div class="table_tr_right">{{data.majorProjects}}</div>
</div>
</td>
</tr>

View File

@@ -19,15 +19,15 @@
<!--轮播图下的新闻-->
<div class="news">
<el-row>
<el-col :span="6" v-for="(item,index) in newsData" :key="index">
<el-col :span="6" v-for="(item,index) in newsData" :key="index" :class="'border_right-' + (index + 1)">
<div class="news_context" @click="getArticle(item)">
<div class="news_context_img">
<img v-if="item.imgurl" :src="item.imgurl" alt="">
</div>
<div class="news_context_text" style="border-right: 1px solid #CCCCCC;">
<div class="news_context_text" >
<div class="news_context_text-title">{{ item.title }}</div>
<div class="news_context_text-content" v-html="item.content">
</div>
<div v-if="item.description" class="news_context_text-content">{{item.description}}</div>
<div v-if="!item.description" class="news_context_text-content" v-html="item.content"></div>
<div class="news_context_time">
<div class="icon"><img src="../../../assets/index/news_center/shijian.png" alt=""></div>
<span class="time">{{ getDateTime(item.publishTime) }}</span>
@@ -222,6 +222,15 @@ export default {
}
}
.border_right-4{
.news_context{
.news_context_text{
border-right: none!important;
}
}
}
.news {
margin: 4rem auto 0 auto;
width: 115.4rem;
@@ -260,7 +269,7 @@ export default {
.news_context_text {
margin: 2rem 0 2rem 2rem;
padding-right: 2rem;
//border-right: 1px solid #CCCCCC;
border-right: 1px solid #CCCCCC;
.news_context_text-title {
&:hover {
color: #0040A4;