|
@@ -0,0 +1,109 @@
|
|
|
+<template>
|
|
|
+ <div id="help">
|
|
|
+ <help-detail :info="site" :menuList="menu" :backColor="backColor" :Color="Color"></help-detail>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import helpDetail from '@/components/help.vue';
|
|
|
+import { mapActions, mapState } from 'vuex';
|
|
|
+import _ from 'lodash';
|
|
|
+export default {
|
|
|
+ metaInfo() {
|
|
|
+ return {
|
|
|
+ title: this.siteTitle ? this.siteTitle : '吉林省高等学校毕业生就业信息网',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ name: 'help',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ helpDetail, //帮助
|
|
|
+ },
|
|
|
+ data: () => ({
|
|
|
+ info: {},
|
|
|
+ site: {}, //站点信息
|
|
|
+ siteTitle: '吉林省高等学校毕业生就业信息网', //站点标题
|
|
|
+ menu: [], //菜单
|
|
|
+ modules: [], //模块
|
|
|
+ backColor: '#0457c7',
|
|
|
+ Color: '#0457c7',
|
|
|
+ }),
|
|
|
+ async created() {
|
|
|
+ await this.toGetSite(); //获取主站信息
|
|
|
+ this.loadMenu(); //获取菜单信息
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['getSite', `getMenu`, 'getColumn', 'getAllNews', 'getAllColumn', 'getModule', 'getNews', 'getJobInfo', 'getPosts', 'getLink']),
|
|
|
+ //站点信息
|
|
|
+ async toGetSite() {
|
|
|
+ let site = sessionStorage.getItem('site');
|
|
|
+ if (site) {
|
|
|
+ this.$set(this, `site`, JSON.parse(site));
|
|
|
+ this.$set(this, `siteTitle`, this.site.name);
|
|
|
+ } else {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //菜单
|
|
|
+ async loadMenu() {
|
|
|
+ let menu = sessionStorage.getItem('menu');
|
|
|
+ if (menu) {
|
|
|
+ this.$set(this, `menu`, JSON.parse(menu));
|
|
|
+ this.finishedMenu();
|
|
|
+ return;
|
|
|
+ } 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?id=${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>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|