|
@@ -1,15 +1,15 @@
|
|
|
<template>
|
|
|
- <div id="huodong">
|
|
|
+ <div id="recruit">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tabs v-model="activeName" :before-leave="handleClick">
|
|
|
<el-tab-pane v-for="(item, index) in recruitList" :key="index" :label="item.title" :name="`${index}`">
|
|
|
<el-col
|
|
|
:span="24"
|
|
|
class="listinfo"
|
|
|
v-for="(child, index) in item.children"
|
|
|
:key="index"
|
|
|
- @click.native="$router.push({ path: `/master/detail/news/${item.id}` })"
|
|
|
+ @click.native="$router.push({ path: `/master/detail/news/${child.id}` })"
|
|
|
>
|
|
|
<el-col :span="20">
|
|
|
<span class="qiu"></span>
|
|
@@ -31,7 +31,7 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- name: 'huodong',
|
|
|
+ name: 'recruit',
|
|
|
props: {
|
|
|
recruitList: null,
|
|
|
},
|
|
@@ -42,14 +42,23 @@ export default {
|
|
|
created() {},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
- handleClick(tab, event) {
|
|
|
- // eslint-disable-next-line no-console
|
|
|
- // console.log(tab, event);
|
|
|
- },
|
|
|
turnTo() {
|
|
|
- let column = this.recruitList[this.activeName].id;
|
|
|
- let title = this.recruitList[this.activeName].title;
|
|
|
- this.$router.push({ path: `/master/notice/${column}`, query: { news_type: '0', title: title } });
|
|
|
+ let to = this.recruitList[`${this.activeName}`];
|
|
|
+ if (!to) return false;
|
|
|
+ let title = to.title;
|
|
|
+ let path;
|
|
|
+ if (to.type === 'bugList') path = `/master/notice/${to.content_id}?title=${title}&news_type=0`;
|
|
|
+ if (to.type === 'column') path = `/master/notice/${to.id}?title=${title}&news_type=1`;
|
|
|
+ this.$router.push({ path: path });
|
|
|
+ },
|
|
|
+ handleClick(active, old) {
|
|
|
+ //略过加载时处理,只有点击后才会走判断逻辑
|
|
|
+ if (!old) return true;
|
|
|
+ let to = this.recruitList[`${active}`];
|
|
|
+ if (!to) return false;
|
|
|
+ if (to.type === 'bugList' || to.type === 'column') return true;
|
|
|
+ if (to.type === 'url') window.open(to.url);
|
|
|
+ if (to.type === 'content') this.$router.push({ path: `/master/detail/news/${to.content_id}` });
|
|
|
},
|
|
|
},
|
|
|
};
|