@@ -20,3 +20,6 @@ new Vue({
render: h => h(App),
}).$mount('#app');
InitStomp();
+window.vm = new Vue({
+ router,
+});
@@ -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}` });
+ }
+ };
},
@@ -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();
@@ -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>
@@ -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' }],