提交 47fdd782 authored 作者: matian's avatar matian

updates

上级 10217077
<template> <template>
<div> <div>
<div class="banner"> <div class="banner">
<div v-if="roadList && roadList.length"> <div v-for="(item, index) in list" :key="index" class="roadList">
<div v-for="(item, index) in list" :key="index" class="roadList"> <el-popover
<el-popover title="我的项目"
title="我的项目" trigger="click"
trigger="click" popper-class="popover"
popper-class="popover" :placement="item.position"
:placement="item.position" v-model="item.isShow"
v-model="item.isShow" visible-arrow="true"
visible-arrow="true" @show="handleShow(item)"
@show="handleShow(item)" >
> <div>
<div> <!-- 我的项目 -->
<!-- 我的项目 --> <div v-for="(it, indexItem) in item.projectList" :key="indexItem" class="project_name">
<div v-for="(it, indexItem) in item.projectList" :key="indexItem" class="project_name"> <AppLink :data="it">
<AppLink :data="it"> {{ it.name }}
{{ it.name }} </AppLink>
</AppLink>
</div>
<!-- 未来可选项目 -->
<div class="line"></div>
<div class="el-popover__title">未来可选目标:</div>
<div v-for="(it, indexItem) in item.checkList" :key="it.name" class="project_name">{{ it.name }}</div>
</div>
<div slot="reference" class="roadList_con">
<img :src="item.icon" alt="" />
<div class="title">{{ item.title }}</div>
</div> </div>
</el-popover> <!-- 未来可选项目 -->
</div> <div class="line"></div>
<div class="el-popover__title">未来可选目标:</div>
<div v-for="(it, indexItem) in item.checkList" :key="it.name" class="project_name">{{ it.name }}</div>
</div>
<div slot="reference" class="roadList_con">
<img :src="item.icon" alt="" />
<div class="title">{{ item.title }}</div>
</div>
</el-popover>
</div> </div>
<div class="homeList" v-if="homeList && homeList.length"> <div class="homeList" v-if="homeList && homeList.length">
<div class="homeList_con" v-for="(itemRoad, index) in homeList" :key="index"> <div class="homeList_con" v-for="(itemRoad, index) in homeList" :key="index">
...@@ -69,17 +67,16 @@ import ProjectCard from '@/components/ProjectCard.vue' ...@@ -69,17 +67,16 @@ import ProjectCard from '@/components/ProjectCard.vue'
export default { export default {
components: { AppLink, ProjectCard }, components: { AppLink, ProjectCard },
computed: { computed: {
learning() { learningInfo() {
return this.$store.state.user.learning_info.filter(item => item.status === '1') return this.learning.filter(item => item.status === '1')
}, },
list() { list() {
if (this.learning.length) { if (this.learningInfo.length) {
this.roadList.forEach(item => { this.roadList.forEach(item => {
console.log(item, '000') if (item.projectList.find(it => it.tenant === this.learningInfo[0].tenant)) {
if (item.projectList.find(it => it.tenant === this.learning[0].tenant)) {
item.isShow = true item.isShow = true
item.project_name = '我的项目:' item.project_name = '我的项目:'
item.projectList = item.projectList.filter(it => it.tenant === this.learning[0].tenant) item.projectList = item.projectList.filter(it => it.tenant === this.learningInfo[0].tenant)
} }
}) })
return this.roadList return this.roadList
...@@ -90,6 +87,7 @@ export default { ...@@ -90,6 +87,7 @@ export default {
}, },
data() { data() {
return { return {
learning: [],
roadList: roadMapList, roadList: roadMapList,
homeList: homeList, homeList: homeList,
internationalDegreeProjectList: [ internationalDegreeProjectList: [
...@@ -131,6 +129,9 @@ export default { ...@@ -131,6 +129,9 @@ export default {
} }
}) })
} }
},
mounted() {
this.learning = JSON.parse(window.localStorage.getItem('learningList'))
} }
} }
</script> </script>
......
...@@ -197,7 +197,7 @@ export const homeList = [ ...@@ -197,7 +197,7 @@ export const homeList = [
] ]
}, },
{ {
position: 'top-start', position: 'top',
icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/home.png', icon: 'https://webapp-pub.ezijing.com/www/pc/lifeLearning/home.png',
isShow: false, isShow: false,
title: '企业培训', title: '企业培训',
......
...@@ -44,6 +44,9 @@ export const actions = { ...@@ -44,6 +44,9 @@ export const actions = {
const isLogin = await getUser() const isLogin = await getUser()
.then(response => { .then(response => {
commit('setUser', response.data) commit('setUser', response.data)
console.log(response.data.learning_info, 'data')
window.localStorage.setItem('learningList', JSON.stringify(response.data.learning_info))
console.log(JSON.parse(window.localStorage.getItem('learningList')))
return true return true
}) })
.catch(() => { .catch(() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论