Explorar el Código

修改主页,改变模块数据关系

lrf402788946 hace 5 años
padre
commit
f1eb2bb31d

+ 14 - 2
src/layout/index/cause.vue

@@ -2,7 +2,7 @@
   <div id="cause">
     <el-row>
       <el-col :span="24">
-        <el-tabs v-model="activeName" type="border-card">
+        <el-tabs v-model="activeName" type="border-card" :before-leave="handleClick">
           <el-tab-pane v-for="(item, index) in enterList" :key="index">
             <span slot="label">{{ item.title }}</span>
             <el-col :span="24" v-for="(tag, index) in item.children" :key="index" class="enterList">
@@ -36,7 +36,19 @@ export default {
   computed: {},
   methods: {
     moreClick() {
-      this.$router.push({ path: `/info/list/${this.enterList[this.activeName].id}` });
+      let to = this.enterList[`${this.activeName}`];
+      if (!to) return false;
+      if (to.type === 'bugList') this.$router.push({ path: `/info/list/${to.content_id}?news_type=0` });
+      if (to.type === 'column') this.$router.push({ path: `/info/list/${to.id}` });
+    },
+    handleClick(active, old) {
+      //略过加载时处理,只有点击后才会走判断逻辑
+      if (!old) return true;
+      let to = this.enterList[`${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: `/info/detail?id=${to.content_id}` });
     },
   },
 };

+ 14 - 2
src/layout/index/danwei.vue

@@ -2,7 +2,7 @@
   <div id="danwei">
     <el-row>
       <el-col :span="24">
-        <el-tabs v-model="activeName" type="border-card">
+        <el-tabs v-model="activeName" type="border-card" :before-leave="handleClick">
           <el-tab-pane v-for="(item, index) in danweiList" :key="index">
             <span slot="label">{{ item.title }}</span>
             <el-col :span="24" v-for="(tag, index) in item.children" :key="index" class="shiyeList">
@@ -36,7 +36,19 @@ export default {
   computed: {},
   methods: {
     moreClick() {
-      this.$router.push({ path: `/info/list/${this.danweiList[this.activeName].id}` });
+      let to = this.danweiList[`${this.activeName}`];
+      if (!to) return false;
+      if (to.type === 'bugList') this.$router.push({ path: `/info/list/${to.content_id}?news_type=0` });
+      if (to.type === 'column') this.$router.push({ path: `/info/list/${to.id}` });
+    },
+    handleClick(active, old) {
+      //略过加载时处理,只有点击后才会走判断逻辑
+      if (!old) return true;
+      let to = this.danweiList[`${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: `/info/detail?id=${to.content_id}` });
     },
   },
 };

+ 1 - 1
src/layout/index/news.vue

@@ -4,7 +4,7 @@
       <el-col :span="24" class="news">
         <el-col :span="24" class="topTit">
           <el-col :span="20">
-            <span :style="`border-color:${borderColor}`">就业新闻</span>
+            <span :style="`border-color:${borderColor}`">{{ news.title }}</span>
           </el-col>
           <el-col :span="4" style="text-align:right;">
             <el-link :underline="false" :style="`color:${Color}`" @click="$router.push({ path: `/info/list/${news.column.id}` })">

+ 1 - 1
src/layout/index/notice.vue

@@ -4,7 +4,7 @@
       <el-col :span="24" class="notice">
         <el-col :span="24" class="topTit">
           <el-col :span="20">
-            <span :style="`border-color:${borderColor}`">最新公告</span>
+            <span :style="`border-color:${borderColor}`">{{ notice.title }}</span>
           </el-col>
           <el-col :span="4">
             <el-link :underline="false" :style="`color:${Color}`" @click="$router.push({ path: `/info/list/${notice.column.id}` })">

+ 18 - 9
src/layout/master/index/other.vue

@@ -2,14 +2,14 @@
   <div id="other">
     <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 otherList" :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>
@@ -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.otherList[`${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}` });
     },
   },
 };

+ 20 - 11
src/layout/master/index/recruit.vue

@@ -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}` });
     },
   },
 };