|
@@ -67,6 +67,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import SessionCache from './aJs/cache'
|
|
|
import box_block from '../../../../image/map/box_block.png'
|
|
|
import box_block_x from '../../../../image/map/box_block_x.png'
|
|
|
import box_bottom_left from '../../../../image/map/box_bottom_left.png'
|
|
@@ -80,7 +81,7 @@ import box_top_right_x from '../../../../image/map/box_top_right_x.png'
|
|
|
import {mapState} from "vuex";
|
|
|
import map from '@/api/knowledge/map'
|
|
|
export default {
|
|
|
- name: 'contentData',
|
|
|
+ name: 'mapIndex',
|
|
|
components: {
|
|
|
|
|
|
},
|
|
@@ -158,6 +159,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ if(SessionCache.getCache('mapData')) {
|
|
|
+ console.log(11111111)
|
|
|
+ let info = SessionCache.getCache('mapData')
|
|
|
+ this.menuArr = info.menuArr
|
|
|
+ this.actionMenu = info.actionMenu
|
|
|
+ this.titleArr = info.titleArr
|
|
|
+ this.titleIndex = info.titleIndex
|
|
|
+ this.menuDataArr = info.menuDataArr
|
|
|
+ this.menuIndex = info.menuIndex
|
|
|
+ this.dataArr = info.dataArr
|
|
|
+ this.showBoxArr = info.showBoxArr
|
|
|
+ this.overArr = info.overArr
|
|
|
+ return
|
|
|
+ }
|
|
|
let getData={'alias':'KNOWLEDGE_MAP'}
|
|
|
map.commonDic(getData).then((res) => {
|
|
|
if(res.code == 200) {
|
|
@@ -167,6 +182,12 @@ export default {
|
|
|
})
|
|
|
this.showData()
|
|
|
},
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ if(from.name != 'knowledgeContentInfo') {
|
|
|
+ SessionCache.deleteCache('mapData')
|
|
|
+ }
|
|
|
+ next()
|
|
|
+ },
|
|
|
methods: {
|
|
|
//设置地图学习内容学习状态
|
|
|
changeState(data){
|
|
@@ -179,7 +200,24 @@ export default {
|
|
|
if(data.type==1){
|
|
|
window.open(data.outerAccessUrl)
|
|
|
}else{
|
|
|
- window.open('knowledgeContentInfo?pkId='+data.knowledgeId)
|
|
|
+ // window.open('knowledgeContentInfo?pkId='+data.knowledgeId)
|
|
|
+ this.$router.push({
|
|
|
+ path: '/knowledgePage/knowledgeContentInfo',
|
|
|
+ query: { pkId: data.knowledgeId, type: 1 }
|
|
|
+ })
|
|
|
+ // 存储已选择的内容
|
|
|
+ let raw = {
|
|
|
+ menuArr: this.menuArr,
|
|
|
+ actionMenu: this.actionMenu,
|
|
|
+ titleArr: this.titleArr,
|
|
|
+ titleIndex: this.titleIndex,
|
|
|
+ menuDataArr: this.menuDataArr,
|
|
|
+ menuIndex: this.menuIndex,
|
|
|
+ dataArr: this.dataArr,
|
|
|
+ showBoxArr: this.showBoxArr,
|
|
|
+ overArr: this.overArr
|
|
|
+ }
|
|
|
+ SessionCache.setCache('mapData',raw)
|
|
|
}
|
|
|
this.getContentTops(this.menuDataArr[this.menuIndex].pkId)
|
|
|
}
|