lrf402788946 пре 5 година
родитељ
комит
d6b00ad710
5 измењених фајлова са 15 додато и 9 уклоњено
  1. 3 0
      src/main.js
  2. 9 0
      src/plugins/methods.js
  3. 1 4
      src/views/info/detail.vue
  4. 1 1
      src/views/info/list.vue
  5. 1 4
      src/views/jobinfo/list.vue

+ 3 - 0
src/main.js

@@ -20,3 +20,6 @@ new Vue({
   render: h => h(App),
 }).$mount('#app');
 InitStomp();
+window.vm = new Vue({
+  router,
+});

+ 9 - 0
src/plugins/methods.js

@@ -18,6 +18,15 @@ const Plugin = {
       });
       return object;
     };
+    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;
+        router.push({ path: `/info/detail?id=${item.id}` });
+      }
+    };
   },
 };
 

+ 1 - 4
src/views/info/detail.vue

@@ -51,10 +51,7 @@ export default {
   data: () => ({
     info: {},
     loading: true,
-    menuList: [
-      { index: '1', name: '学校简介' },
-      { index: '2', name: '学校概括' },
-    ],
+    menuList: [{ index: '1', name: '学校简介' }, { index: '2', name: '学校概括' }],
   }),
   created() {
     this.search();

+ 1 - 1
src/views/info/list.vue

@@ -18,7 +18,7 @@
       :key="index"
     >
       <el-col style="padding-top: 0.5rem;" :span="21">
-        <el-link :underline="false" @click="$router.push({ path: '/info/detail', query: { id: item.id } })"> {{ item.title }}</el-link>
+        <el-link :underline="false" @click="$turnTo(item)"> {{ item.title }}</el-link>
       </el-col>
       <el-col :span="3" style="color:#999999; padding-top: 0.7rem;">
         <span style="padding: 0.5rem 0;">{{ item.publish_time }}</span>

+ 1 - 4
src/views/jobinfo/list.vue

@@ -90,10 +90,7 @@ export default {
     totalRow: 0,
     list: [],
     loading: false,
-    filter: [
-      { label: '企业名称', name: 'corpname' },
-      { label: '标题', name: 'title' },
-    ],
+    filter: [{ label: '企业名称', name: 'corpname' }, { label: '标题', name: 'title' }],
   }),
   created() {
     this.search();