|
@@ -1,13 +1,19 @@
|
|
<template>
|
|
<template>
|
|
<div id="jobs">
|
|
<div id="jobs">
|
|
- <jobs-detail :info="info" :backColor="backColor" :Color="Color" :jobInfo="jobInfo" :corpsInfo="corpsInfo"></jobs-detail>
|
|
|
|
|
|
+ <jobs-detail :info="site" :menuList="menu" :backColor="backColor" :Color="Color" :jobInfo="jobInfo" :corpsInfo="corpInfo"></jobs-detail>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import jobsDetail from '@/components/jobs.vue';
|
|
import jobsDetail from '@/components/jobs.vue';
|
|
import { mapActions, mapState } from 'vuex';
|
|
import { mapActions, mapState } from 'vuex';
|
|
|
|
+import _ from 'lodash';
|
|
export default {
|
|
export default {
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return {
|
|
|
|
+ title: this.siteTitle ? this.siteTitle : '就业信息网',
|
|
|
|
+ };
|
|
|
|
+ },
|
|
name: 'jobs',
|
|
name: 'jobs',
|
|
props: {},
|
|
props: {},
|
|
components: {
|
|
components: {
|
|
@@ -25,17 +31,7 @@ export default {
|
|
date: '办公时间:周一至周五,法定假日不对外办公。',
|
|
date: '办公时间:周一至周五,法定假日不对外办公。',
|
|
copyright: '吉ICP备09006292号-1 Copyright 2013 版权所有 吉林省高等学校毕业生就业指导中心 All Rights Reserved',
|
|
copyright: '吉ICP备09006292号-1 Copyright 2013 版权所有 吉林省高等学校毕业生就业指导中心 All Rights Reserved',
|
|
},
|
|
},
|
|
- jobInfo: {
|
|
|
|
- job_name: 'web',
|
|
|
|
- text: '1-2k/月',
|
|
|
|
- city: '不知道',
|
|
|
|
- xl_req: '不知道',
|
|
|
|
- job_tag: '不知道',
|
|
|
|
- welfare: '不知道',
|
|
|
|
- end_date: '不知道',
|
|
|
|
- content: '不知道',
|
|
|
|
- intro: '不知道',
|
|
|
|
- },
|
|
|
|
|
|
+ jobInfo: {},
|
|
corpsInfo: {
|
|
corpsInfo: {
|
|
logo_url: require('@/assets/banner.png'),
|
|
logo_url: require('@/assets/banner.png'),
|
|
corpname: '不知道',
|
|
corpname: '不知道',
|
|
@@ -43,12 +39,112 @@ export default {
|
|
address: '不知道',
|
|
address: '不知道',
|
|
tel: '不知道',
|
|
tel: '不知道',
|
|
},
|
|
},
|
|
|
|
+ corpInfo: {},
|
|
backColor: '#0457c7',
|
|
backColor: '#0457c7',
|
|
Color: '#0457c7',
|
|
Color: '#0457c7',
|
|
|
|
+ menu: [],
|
|
|
|
+ site: {},
|
|
|
|
+ siteTitle: '',
|
|
}),
|
|
}),
|
|
- created() {},
|
|
|
|
|
|
+ async created() {
|
|
|
|
+ await this.toGetSite(); //获取主站信息
|
|
|
|
+ await this.loadMenu(); //获取菜单信息
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
computed: {},
|
|
computed: {},
|
|
- methods: {},
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapActions(['getSite', 'getMenu', 'getColumn', 'getPosts', 'getCorp']),
|
|
|
|
+ async search() {
|
|
|
|
+ let result = await this.getPosts({ type: 'fetch', data: { id: this.$route.query.id } });
|
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
|
+ //给this=>vue的实例下在中的list属性,赋予result.data的值
|
|
|
|
+ this.$set(this, `jobInfo`, result.data);
|
|
|
|
+ this.searchCorpInfo(this.jobInfo.corpid);
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async searchCorpInfo(corpid) {
|
|
|
|
+ let result = await this.getCorp({ type: 'component', data: { corpid: corpid } });
|
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
|
+ this.$set(this, 'corpInfo', result.data);
|
|
|
|
+ // this.$set(this.corpInfo, `id`, this.info.corpid);
|
|
|
|
+ // this.$set(this.corpInfo, `corpname`, this.info.corpname);
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //站点信息
|
|
|
|
+ async toGetSite() {
|
|
|
|
+ let site = sessionStorage.getItem('site');
|
|
|
|
+ if (!site) {
|
|
|
|
+ let result = await this.getSite({ type: 'search' });
|
|
|
|
+ if (result.errcode === 0) {
|
|
|
|
+ sessionStorage.setItem('site', JSON.stringify(result.data));
|
|
|
|
+ if (_.get(result.data, `custom`)) {
|
|
|
|
+ let item = result.custom;
|
|
|
|
+ }
|
|
|
|
+ this.$set(this, `site`, result.data);
|
|
|
|
+ this.$set(this, `siteTitle`, this.site.name);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$set(this, `site`, JSON.parse(site));
|
|
|
|
+ this.$set(this, `siteTitle`, this.site.name);
|
|
|
|
+ let arr = this.site;
|
|
|
|
+ if (arr.custom) {
|
|
|
|
+ let item = arr.custom;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //菜单
|
|
|
|
+ async loadMenu() {
|
|
|
|
+ let menu = sessionStorage.getItem('menu');
|
|
|
|
+ if (menu) {
|
|
|
|
+ this.$set(this, `menu`, JSON.parse(menu));
|
|
|
|
+ await this.finishedMenu();
|
|
|
|
+ } else this.toGetMenu();
|
|
|
|
+ },
|
|
|
|
+ async toGetMenu() {
|
|
|
|
+ let result = await this.getMenu({ type: `list` });
|
|
|
|
+ if (result.errcode === 0) {
|
|
|
|
+ sessionStorage.setItem('menu', JSON.stringify(result.data));
|
|
|
|
+ this.$set(this, `menu`, result.data);
|
|
|
|
+ this.finishedMenu();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async finishedMenu() {
|
|
|
|
+ let menus = JSON.parse(JSON.stringify(this.menu));
|
|
|
|
+ for (const item of menus) {
|
|
|
|
+ if (item.type === 'content') {
|
|
|
|
+ item.path = `/detail/${item.content_id}`;
|
|
|
|
+ } else if (item.type !== 'url') {
|
|
|
|
+ let res = await this.completeMenu(item);
|
|
|
|
+ item.children = res;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$set(this, `menu`, menus);
|
|
|
|
+ },
|
|
|
|
+ async completeMenu(item) {
|
|
|
|
+ let result = await this.getColumn({
|
|
|
|
+ type: `list`,
|
|
|
|
+ data: { parent_id: item.id },
|
|
|
|
+ });
|
|
|
|
+ if (result.errcode === 0) {
|
|
|
|
+ let columns = result.data;
|
|
|
|
+ for (const col of columns) {
|
|
|
|
+ if (col.type === 'content') {
|
|
|
|
+ col.path = `/detail/${col.content_id}`;
|
|
|
|
+ } else if (col.type !== 'url') {
|
|
|
|
+ col.path = `/newsList/menu/${col.id}?title=${col.title}`;
|
|
|
|
+ if (col.parent.includes('党员')) {
|
|
|
|
+ col.path = `/memberList/menu/${col.id}?title=${col.title}`;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return columns;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|