lrf402788946 před 5 roky
rodič
revize
6a642ecc71

+ 9 - 9
src/layout/index/law.vue

@@ -10,7 +10,7 @@
         </el-col>
       </el-col>
       <el-col :span="24" class="info">
-        <el-col :span="24" class="list" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
+        <el-col :span="24" class="list" v-for="(item, index) in infoList" :key="index" @click.native="$turnTo(item)">
           <el-col :span="19" class="title">
             <p class="textOver"><i class="el-icon-caret-right icon"></i>{{ item.title }}</p>
           </el-col>
@@ -60,14 +60,14 @@ export default {
       this.$set(this, `infoList`, notice);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/detail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/detail?id=${item.id}` });
+    //   }
+    // },
   },
   filters: {
     getDate(meta) {

+ 9 - 9
src/layout/index/lunbo.vue

@@ -4,7 +4,7 @@
       <el-col :span="24" style="width:540;height:304px;" v-loading="loading">
         <div class="block">
           <el-carousel height="304px">
-            <el-carousel-item class="list" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
+            <el-carousel-item class="list" v-for="(item, index) in infoList" :key="index" @click.native="$turnTo(item)">
               <el-image style="width:540px;height:304px;" :src="item.pic"></el-image>
               <span class="title textOver">{{ item.title }}</span>
               <span>{{ item.url }}</span>
@@ -51,14 +51,14 @@ export default {
       this.$set(this, `infoList`, news);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.location.href = item.url;
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/detail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.location.href = item.url;
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/detail?id=${item.id}` });
+    //   }
+    // },
   },
 };
 </script>

+ 10 - 10
src/layout/index/noticeNews.vue

@@ -13,7 +13,7 @@
           </el-col>
         </el-col>
         <el-col :span="24" class="info">
-          <el-col :span="24" class="list" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
+          <el-col :span="24" class="list" v-for="(item, index) in infoList" :key="index" @click.native="$turnTo(item)">
             <el-col :span="19" class="title">
               <p class="textOver"><i class="el-icon-caret-right icon"></i>{{ item.title }}</p>
             </el-col>
@@ -64,15 +64,15 @@ export default {
       this.$set(this, `infoList`, notice);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        // window.location.href = item.url;
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/detail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     // window.location.href = item.url;
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/detail?id=${item.id}` });
+    //   }
+    // },
   },
   filters: {
     getDate(meta) {

+ 9 - 9
src/layout/index/recruit.vue

@@ -65,7 +65,7 @@
                   </el-col>
                 </el-col>
                 <el-col :span="24">
-                  <el-col :span="24" class="zixunList" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
+                  <el-col :span="24" class="zixunList" v-for="(item, index) in infoList" :key="index" @click.native="$turnTo(item)">
                     <p class="title textOver">{{ item.title }}</p>
                   </el-col>
                 </el-col>
@@ -122,14 +122,14 @@ export default {
       this.$set(this, `infoList`, notice);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/detail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/detail?id=${item.id}` });
+    //   }
+    // },
   },
   filters: {
     getJobs(jobs) {

+ 9 - 9
src/layout/index/zhidao.vue

@@ -12,7 +12,7 @@
         </el-col>
       </el-col>
       <el-col :span="24" class="info">
-        <el-col :span="24" class="list" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
+        <el-col :span="24" class="list" v-for="(item, index) in infoList" :key="index" @click.native="$turnTo(item)">
           <el-col :span="19" class="title">
             <p class="textOver"><i class="el-icon-caret-right icon"></i>{{ item.title }}</p>
           </el-col>
@@ -62,14 +62,14 @@ export default {
       this.$set(this, `infoList`, notice);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/detail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/detail?id=${item.id}` });
+    //   }
+    // },
   },
   filters: {
     getDate(meta) {

+ 9 - 9
src/layout/list/mainRight.vue

@@ -5,7 +5,7 @@
         <span :style="`background:${backColor}`">{{ topTitile }}</span>
       </el-col>
       <el-col :span="24" class="info">
-        <el-col :span="24" class="list" v-for="(item, index) in rightList" :key="index" @click.native="turnTo(item)">
+        <el-col :span="24" class="list" v-for="(item, index) in rightList" :key="index" @click.native="$turnTo(item)">
           <el-col :span="5" class="images">
             <el-image style="width:150px;height:95px;" :src="item.pic" v-if="item.pic"></el-image>
             <el-image style="width:150px;height:95px;" :src="Nopic" v-else></el-image>
@@ -58,14 +58,14 @@ export default {
       let skip = (page - 1) * this.pageSize;
       this.$emit('search', { skip: skip, limit: this.pageSize });
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/memberDetail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/memberDetail?id=${item.id}` });
+    //   }
+    // },
   },
 };
 </script>

+ 10 - 10
src/layout/list/newsInfo.vue

@@ -21,7 +21,7 @@
             </el-col>
             <el-col :span="19">
               <el-col :span="24">
-                <el-col :span="20" class="title" @click.native="turnTo(item)">
+                <el-col :span="20" class="title" @click.native="$turnTo(item)">
                   <p class="textOver">{{ item.title }}</p>
                 </el-col>
                 <el-col :span="4" class="date">
@@ -63,15 +63,15 @@ export default {
       let skip = (page - 1) * this.pageSize;
       this.$emit('search', { skip: skip, limit: this.pageSize });
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        if (route.includes('member')) this.$router.push({ path: '/memberDetail', query: { id: item.id } });
-        else this.$router.push({ path: `/detail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     if (route.includes('member')) this.$router.push({ path: '/memberDetail', query: { id: item.id } });
+    //     else this.$router.push({ path: `/detail?id=${item.id}` });
+    //   }
+    // },
   },
 };
 </script>

+ 9 - 9
src/layout/member/dangjian.vue

@@ -68,7 +68,7 @@
             </el-col>
           </el-col>
           <el-col :span="24" class="infoLeftList">
-            <el-col :span="24" class="rencaiList" v-for="(item, index) in infossList" :key="index" @click.native="turnTo(item)">
+            <el-col :span="24" class="rencaiList" v-for="(item, index) in infossList" :key="index" @click.native="$turnTo(item)">
               <el-col :span="16" class="title">
                 <p class="textOver"><i class="el-icon-s-flag icon"></i>{{ item.title }}</p>
               </el-col>
@@ -139,14 +139,14 @@ export default {
       this.$set(this, `infossList`, infossList);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/memberDetail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/memberDetail?id=${item.id}` });
+    //   }
+    // },
   },
   filters: {
     getDate(meta) {

+ 10 - 10
src/layout/member/gaoceng.vue

@@ -15,7 +15,7 @@
       <el-col :span="24" class="info">
         <el-col :span="12" class="carousel" v-loading="loading">
           <el-carousel height="400">
-            <el-carousel-item class="infoList" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
+            <el-carousel-item class="infoList" v-for="(item, index) in infoList" :key="index" @click.native="$turnTo(item)">
               <el-image style="width:100%;height:400px;" :src="item.pic" v-if="item.pic"></el-image>
               <el-image style="width:100%;height:400px;" :src="noPic" v-else></el-image>
               <span class="textOver">{{ item.title }}</span>
@@ -23,7 +23,7 @@
           </el-carousel>
         </el-col>
         <el-col :span="12" style="height:400px;" v-loading="loading">
-          <el-col :span="24" class="newsList" v-for="(item, index) in infosList" :key="index" @click.native="turnTo(item)">
+          <el-col :span="24" class="newsList" v-for="(item, index) in infosList" :key="index" @click.native="$turnTo(item)">
             <el-col :span="20" class="title">
               <p class="textOver">
                 <i class="el-icon-s-flag icon"></i><span>{{ item.title }}</span>
@@ -86,14 +86,14 @@ export default {
       this.$set(this, `infosList`, columns);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/memberDetail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/memberDetail?id=${item.id}` });
+    //   }
+    // },
   },
   filters: {
     getDate(meta) {

+ 9 - 9
src/layout/member/photo.vue

@@ -14,7 +14,7 @@
       </el-col>
       <el-col :span="24" class="info">
         <el-col :span="24" class="list" v-loading="loading">
-          <el-col :span="6" class="tujiList" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
+          <el-col :span="6" class="tujiList" v-for="(item, index) in infoList" :key="index" @click.native="$turnTo(item)">
             <el-col :span="24" class="image">
               <el-image style="width:270px;height:180px;" :src="item.pic"></el-image>
             </el-col>
@@ -76,14 +76,14 @@ export default {
       this.$set(this, `infoList`, infoList);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/memberDetail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/memberDetail?id=${item.id}` });
+    //   }
+    // },
   },
 };
 </script>

+ 9 - 9
src/layout/member/xuexi.vue

@@ -64,7 +64,7 @@
             </el-col>
           </el-col>
           <el-col :span="24" class="infoRightList">
-            <el-col :span="24" v-for="(item, index) in infossList" :key="index" @click.native="turnTo(item)">
+            <el-col :span="24" v-for="(item, index) in infossList" :key="index" @click.native="$turnTo(item)">
               <el-col :span="24">
                 <el-image style="width:400px;height:280px;" :src="item.pic" v-if="item.pic"></el-image>
                 <el-image style="width:400px;height:280px;" :src="Nopic" v-else></el-image>
@@ -132,14 +132,14 @@ export default {
       this.$set(this, `infossList`, infossList);
       this.loading = false;
     },
-    turnTo(item) {
-      if (item.url !== undefined) {
-        window.open(item.url);
-      } else {
-        let route = this.$route.path;
-        this.$router.push({ path: `/memberDetail?id=${item.id}` });
-      }
-    },
+    // turnTo(item) {
+    //   if (item.info_type == 1) {
+    //     window.open(item.url);
+    //   } else {
+    //     let route = this.$route.path;
+    //     this.$router.push({ path: `/memberDetail?id=${item.id}` });
+    //   }
+    // },
   },
   filters: {
     getDate(meta) {

+ 5 - 0
src/main.js

@@ -8,6 +8,7 @@ import '@/plugins/check-res';
 import '@/plugins/meta';
 import '@/plugins/filters';
 import '@/plugins/loading';
+import '@/plugins/methods';
 
 Vue.config.productionTip = false;
 
@@ -16,3 +17,7 @@ new Vue({
   store,
   render: h => h(App),
 }).$mount('#app');
+
+window.vm = new Vue({
+  router,
+});

+ 17 - 0
src/plugins/methods.js

@@ -0,0 +1,17 @@
+import Vue from 'vue';
+import router from '@/router/index';
+const Plugin = {
+  install(vue, options) {
+    vue.prototype.$turnTo = item => {
+      if (item.info_type == 1) {
+        window.open(item.url);
+      } else {
+        let router = window.vm.$router;
+        let route = window.vm.$route.path;
+        if (route.includes('member')) router.push({ path: '/memberDetail', query: { id: item.id } });
+        else router.push({ path: `/detail?id=${item.id}` });
+      }
+    };
+  },
+};
+Vue.use(Plugin);