lrf402788946 5 năm trước cách đây
mục cha
commit
b386293439

+ 6 - 7
src/components/detail.vue

@@ -7,14 +7,11 @@
         </div>
       </el-col>
       <el-col :span="24" class="menu">
-        <menuInfo :backColor="backColor"></menuInfo>
+        <menuInfo :menuList="menuList" :backColor="backColor"></menuInfo>
       </el-col>
       <el-col :span="24" class="main">
         <div class="w_1200">
-          <el-col :span="5" class="mainNav">
-            <listLeft :Color="Color"></listLeft>
-          </el-col>
-          <el-col :span="18" class="mainList">
+          <el-col :span="24" class="mainList">
             <detailInfo :detailInfo="detailInfo" :Color="Color"></detailInfo>
           </el-col>
         </div>
@@ -40,11 +37,13 @@ export default {
     Color: null, //头部电话字体颜色
     backColor: null, //导航菜单背景颜色
     detailInfo: null, //详情信息
+    menuList: null, //菜单信息
+    sideMenu: null, //侧菜单
   },
   components: {
     top, //头部
     menuInfo, //导航
-    listLeft, //二级左侧导航
+    // listLeft, //二级左侧导航
     foot, //底部信息
     detailInfo, //詳情
   },
@@ -75,7 +74,7 @@ export default {
 }
 .mainList {
   float: right;
-  width: 930px;
+  // width: 930px;
 }
 .foot {
   height: 133px;

+ 5 - 3
src/components/list.vue

@@ -7,15 +7,15 @@
         </div>
       </el-col>
       <el-col :span="24" class="menu">
-        <menuInfo :backColor="backColor"></menuInfo>
+        <menuInfo :menuList="menuList" :backColor="backColor"></menuInfo>
       </el-col>
       <el-col :span="24" class="main">
         <div class="w_1200">
           <el-col :span="5" class="mainNav">
-            <listLeft :Color="Color"></listLeft>
+            <listLeft :sideMenu="sideMenu" :Color="Color"></listLeft>
           </el-col>
           <el-col :span="18" class="mainList">
-            <listRight :rightList="rightList" :Color="Color"></listRight>
+            <listRight :rightList="rightList" :Color="Color" v-on="$listeners" v-bind="$attrs"></listRight>
           </el-col>
         </div>
       </el-col>
@@ -39,6 +39,8 @@ export default {
     Color: null, //头部电话字体颜色
     backColor: null, //导航菜单背景颜色
     rightList: null, //列表信息
+    menuList: null, //菜单列表
+    sideMenu: null, //侧菜单
   },
   components: {
     top, //头部

+ 2 - 8
src/components/newsList.vue

@@ -42,6 +42,7 @@ export default {
     menuList: null, //菜单
     sideMenu: null, //侧菜单
     title: null, //标题
+    listSpan: { type: Number, default: 18 }, //全屏还是左右
   },
   components: {
     top, //头部
@@ -52,14 +53,7 @@ export default {
   },
   data: () => ({}),
   created() {},
-  computed: {
-    listSpan() {
-      let span = 18;
-      if (this.sideMenu === null) span = 18;
-      else span = 24;
-      return span;
-    },
-  },
+  computed: {},
   methods: {},
 };
 </script>

+ 59 - 0
src/config/jobs-menu.js

@@ -0,0 +1,59 @@
+export const jobMenu = {
+  title: '招聘相关',
+  children: [
+    {
+      title: '校内宣讲会',
+      path: `/talk/list/in`,
+    },
+    {
+      title: '校外宣讲会',
+      path: `/talk/list/out`,
+    },
+    {
+      title: '校内招聘会',
+      path: `/jobfair/list/in`,
+    },
+    {
+      title: '校外招聘会',
+      path: `/jobfair/list/out`,
+    },
+    {
+      title: '招聘信息',
+      path: `/jobinfo/list`,
+    },
+    {
+      title: '正式岗位',
+      path: `/jobs/list/official`,
+    },
+    {
+      title: '实习岗位',
+      path: `/jobs/list/internship`,
+    },
+  ],
+};
+
+export const masterMenu = {
+  title: '招聘相关',
+  children: [
+    {
+      title: '宣讲会',
+      path: `/list/talk/out`,
+    },
+    {
+      title: '招聘会',
+      path: `/list/jobfair/out`,
+    },
+    {
+      title: '招聘信息',
+      path: `/list/jobinfo`,
+    },
+    {
+      title: '正式岗位',
+      path: `/list/jobs/official`,
+    },
+    {
+      title: '实习岗位',
+      path: `/list/jobs/internship`,
+    },
+  ],
+};

+ 1 - 1
src/layout/index/banner.vue

@@ -22,4 +22,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 10 - 0
src/layout/index/menuInfo.vue

@@ -13,6 +13,14 @@
             :router="true"
           >
             <el-menu-item index="/">首页</el-menu-item>
+            <template>
+              <el-submenu index="/jobs">
+                <template slot="title">
+                  {{ jobsMenu.title }}
+                </template>
+                <el-menu-item v-for="(sub, subIndex) in jobsMenu.children" :key="subIndex" :index="sub.path">{{ sub.title }}</el-menu-item>
+              </el-submenu>
+            </template>
             <template v-for="(item, index) in menuList">
               <el-submenu :index="`${index}`" :key="index" v-if="item.type !== 'url' && item.type !== 'content'">
                 <template slot="title">
@@ -34,6 +42,7 @@
 </template>
 
 <script>
+import { masterMenu } from '@/config/jobs-menu';
 export default {
   name: 'menuInfo',
   props: {
@@ -43,6 +52,7 @@ export default {
   components: {},
   data: () => ({
     activeIndex1: '1',
+    jobsMenu: masterMenu,
   }),
   created() {},
   computed: {},

+ 12 - 2
src/layout/list/listLeft.vue

@@ -2,7 +2,7 @@
   <div id="listLeft">
     <el-row>
       <el-col :span="24" class="listLeft">
-        <el-menu :default-active="$route.path" class="el-menu-vertical-demo" :router="true">
+        <el-menu :default-active="path" class="el-menu-vertical-demo" :router="true">
           <template v-for="(item, index) in sideMenu">
             <el-menu-item v-if="item.type !== 'url' && item.type !== 'content'" :index="item.path" :key="index" :style="`color:${Color}`">
               {{ item.title }}
@@ -17,6 +17,7 @@
 </template>
 
 <script>
+import _ from 'lodash';
 export default {
   name: 'listLeft',
   props: {
@@ -26,7 +27,16 @@ export default {
   components: {},
   data: () => ({}),
   created() {},
-  computed: {},
+  computed: {
+    title() {
+      return this.$route.query.title;
+    },
+    path() {
+      let path = `${this.$route.path}`;
+      if (this.title) path = `${path}?title=${this.title}`;
+      return path;
+    },
+  },
   methods: {
     turnTo(url) {
       window.open(url);

+ 21 - 19
src/layout/list/listRight.vue

@@ -3,13 +3,13 @@
     <el-row>
       <el-col :span="24" class="listRight" :style="`border-color:${Color}`">
         <el-col :span="24" class="topInfo">
-          <el-col :span="12" class="top">
+          <el-col :span="10" class="top">
             <p :style="`color:${Color}`"><i class="el-icon-document"></i>{{ title }}</p>
           </el-col>
-          <el-col :span="12" class="bread">
+          <el-col :span="14" class="bread">
             <el-breadcrumb separator-class="el-icon-arrow-right">
               <el-breadcrumb-item :to="{ path: '/' }">网站首页</el-breadcrumb-item>
-              <el-breadcrumb-item>信息列表</el-breadcrumb-item>
+              <el-breadcrumb-item>{{ title }}列表</el-breadcrumb-item>
             </el-breadcrumb>
           </el-col>
         </el-col>
@@ -28,14 +28,7 @@
         </el-col>
       </el-col>
       <el-col :span="24" class="page">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage4"
-          :page-size="8"
-          layout="total, prev, pager, next, jumper"
-          :total="1"
-        >
+        <el-pagination @current-change="search" :current-page="currentPage" :page-size="pageSize" layout="total, prev, pager, next, jumper" :total="total">
         </el-pagination>
       </el-col>
     </el-row>
@@ -48,20 +41,29 @@ export default {
   props: {
     rightList: null,
     Color: null,
-    title: { type: String, default: '就业动态' },
+    total: { type: Number, defaultl: 0 },
   },
   components: {},
   data: () => ({
-    currentPage4: 1,
+    currentPage: 1,
+    pageSize: 8,
   }),
   created() {},
-  computed: {},
-  methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
+  computed: {
+    title() {
+      let jobs = this.$route.params.jobs;
+      let returns;
+      if (jobs === 'talk') returns = '宣讲会';
+      if (jobs === 'jobfair') returns = '招聘会';
+      if (jobs === 'jobinfo') returns = '招聘信息';
+      if (jobs === 'jobs') returns = '岗位信息';
+      return returns;
     },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
+  },
+  methods: {
+    search(page) {
+      let skip = (page - 1) * this.pageSize;
+      this.$emit('search', { skip: skip, limit: this.pageSize });
     },
   },
 };

+ 0 - 6
src/layout/list/newsInfo.vue

@@ -61,12 +61,6 @@ export default {
       let skip = (page - 1) * this.pageSize;
       this.$emit('search', { skip: skip, limit: this.pageSize });
     },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-    },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-    },
   },
 };
 </script>

+ 1 - 1
src/layout/member/banner.vue

@@ -22,4 +22,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 6 - 1
src/router/index.js

@@ -13,7 +13,12 @@ export default new Router({
       component: () => import('../views/index.vue'),
     },
     {
-      path: '/list',
+      path: '/list/:jobs/:type',
+      name: 'list',
+      component: () => import('../views/list.vue'),
+    },
+    {
+      path: '/list/:jobs',
       name: 'list',
       component: () => import('../views/list.vue'),
     },

+ 1 - 1
src/views/aboutMe.vue

@@ -54,4 +54,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 100 - 13
src/views/detail.vue


+ 2 - 2
src/views/index.vue

@@ -128,7 +128,7 @@ export default {
           if (col.type === 'content') {
             col.path = `/detail/${col.content_id}`;
           } else if (col.type !== 'url') {
-            col.path = `/newsList/menu/${col.id}`;
+            col.path = `/newsList/menu/${col.id}?title=${col.title}`;
           }
         }
         return columns;
@@ -236,4 +236,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 107 - 5
src/views/list.vue

@@ -1,12 +1,29 @@
 <template>
   <div id="list">
-    <list-detail :info="info" :backColor="backColor" :Color="Color" :rightList="rightList"></list-detail>
+    <list-detail
+      :menuList="menu"
+      :sideMenu="sideMenu"
+      :info="site"
+      :backColor="backColor"
+      :Color="Color"
+      :rightList="rightList"
+      :total="total"
+      @search="search"
+    ></list-detail>
   </div>
 </template>
 
 <script>
+import { mapActions, mapState } from 'vuex';
+import _ from 'lodash';
+import { masterMenu } from '@/config/jobs-menu';
 import listDetail from '@/components/list.vue';
 export default {
+  metaInfo() {
+    return {
+      title: this.siteTitle ? this.siteTitle : '就业信息网',
+    };
+  },
   name: 'list',
   props: {},
   components: {
@@ -33,11 +50,96 @@ export default {
         content: '我省成功举办“创业有我•就在吉林我省成功举办“创业有我•就在吉林',
       },
     ],
+    menu: [],
+    sideMenu: masterMenu.children,
+    site: {},
+    siteTitle: '',
+    total: 0,
   }),
-  created() {},
-  computed: {},
-  methods: {},
+  async created() {
+    await this.toGetSite(); //获取主站信息
+    await this.loadMenu(); //获取菜单信息
+  },
+  computed: {
+    jobs() {
+      return this.$route.params.jobs;
+    },
+    type() {
+      return this.$route.params.type;
+    },
+  },
+  methods: {
+    ...mapActions(['getSite', 'getMenu', 'getColumn']),
+    async search({ skip = 0, limit = 8 } = {}) {},
+    //站点信息
+    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}`;
+          }
+        }
+        return columns;
+      }
+    },
+  },
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 1 - 1
src/views/memberDetail.vue

@@ -34,4 +34,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 1 - 1
src/views/memberList.vue

@@ -34,4 +34,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 8 - 2
src/views/newsList.vue

@@ -10,6 +10,7 @@
       :title="title"
       @search="toGetNews"
       :total="total"
+      :listSpan="listSpan"
     ></list-detail>
   </div>
 </template>
@@ -65,9 +66,14 @@ export default {
     title() {
       return this.$route.query.title;
     },
+    listSpan() {
+      return this.type === 'menu' ? 18 : 24;
+    },
   },
   watch: {
     type: 'getSubMenu',
+    id: 'toGetNews',
+    title: 'getSubMenu',
   },
   methods: {
     ...mapActions(['getSite', 'getMenu', 'getColumn', 'getNews']),
@@ -133,7 +139,7 @@ export default {
           if (col.type === 'content') {
             col.path = `/detail/${col.content_id}`;
           } else if (col.type !== 'url') {
-            col.path = `/newsList/menu/${col.id}`;
+            col.path = `/newsList/menu/${col.id}?title=${col.title}`;
           }
         }
         return columns;
@@ -172,4 +178,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>