Parcourir la source

Merge branch 'master' of http://git.cc-lotus.info/smart-jobs/web-center

guhongwei il y a 5 ans
Parent
commit
97882431d8

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

@@ -90,7 +90,7 @@ export default {
           message: '请进入您的分站进行登录',
           message: '请进入您的分站进行登录',
           type: 'warning',
           type: 'warning',
         });
         });
-      else window.open('http://hr.smart.cc-lotus.info/www/login');
+      else window.open('http://hr.smart.jilinjobs.cn/www/login');
     },
     },
   },
   },
   filters: {
   filters: {

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

@@ -50,7 +50,7 @@ export default {
           message: '请进入您的分站进行登录',
           message: '请进入您的分站进行登录',
           type: 'warning',
           type: 'warning',
         });
         });
-      else window.open('http://hr.smart.cc-lotus.info/www/login');
+      else window.open('http://hr.smart.jilinjobs.cn/www/login');
     },
     },
   },
   },
 };
 };

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

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

+ 15 - 0
src/store/column.js

@@ -1,5 +1,6 @@
 import Vue from 'vue';
 import Vue from 'vue';
 import Vuex from 'vuex';
 import Vuex from 'vuex';
+import axios from 'axios';
 import _ from 'lodash';
 import _ from 'lodash';
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
@@ -9,6 +10,20 @@ const api = {
 export const state = () => ({});
 export const state = () => ({});
 export const mutations = {};
 export const mutations = {};
 export const actions = {
 export const actions = {
+  //请求所有的栏目
+  async getAllColumn({ commit, dispatch }, payload) {
+    let toGet = () => {
+      let res = [];
+      for (const id of payload) {
+        res.push(dispatch('getColumn', { type: 'list', data: { parent_id: id } }));
+      }
+      return res;
+    };
+    let result = await axios.all(toGet());
+    //降维
+    let arr = _.flattenDeep(_.flattenDeep(result).map(item => item.data));
+    return arr;
+  },
   async getColumn({ commit }, { type, data }) {
   async getColumn({ commit }, { type, data }) {
     let result;
     let result;
     if (type === `list`) {
     if (type === `list`) {

+ 31 - 0
src/store/news.js

@@ -1,5 +1,6 @@
 import Vue from 'vue';
 import Vue from 'vue';
 import Vuex from 'vuex';
 import Vuex from 'vuex';
+import axios from 'axios';
 import _ from 'lodash';
 import _ from 'lodash';
 Vue.use(Vuex);
 Vue.use(Vuex);
 const api = {
 const api = {
@@ -10,6 +11,36 @@ const api = {
 export const state = () => ({});
 export const state = () => ({});
 export const mutations = {};
 export const mutations = {};
 export const actions = {
 export const actions = {
+  //请求所有新闻
+  async getAllNews({ commit, dispatch }, payload) {
+    let toGet = () => {
+      let res = [];
+      for (const item of payload) {
+        let data = {
+          skip: 0,
+          limit: 8,
+        };
+        if (item.type === 'bugList') {
+          data.news_type = `0`;
+          data.parent_id = item.content_id;
+        } else {
+          data.news_type = `1`;
+          data.parent_id = item.id;
+        }
+        res.push(
+          dispatch('getNews', {
+            type: 'bugList',
+            data,
+          })
+        );
+      }
+      return res;
+    };
+    let result = await axios.all(toGet());
+    //降维
+    let arr = _.flattenDeep(_.flattenDeep(result).map(item => item.data));
+    return arr;
+  },
   async getNews({ commit }, { type, data }) {
   async getNews({ commit }, { type, data }) {
     let result;
     let result;
     if (type !== 'fetch') {
     if (type !== 'fetch') {

+ 0 - 0
src/store/test.js


+ 1 - 1
src/views/detail.vue

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

+ 45 - 12
src/views/index.vue

@@ -72,7 +72,7 @@ export default {
   },
   },
   computed: {},
   computed: {},
   methods: {
   methods: {
-    ...mapActions(['getSite', `getMenu`, 'getColumn', 'getModule', 'getNews', 'getJobInfo', 'getPosts', 'getLink']),
+    ...mapActions(['getSite', `getMenu`, 'getColumn', 'getAllNews', 'getAllColumn', 'getModule', 'getNews', 'getJobInfo', 'getPosts', 'getLink']),
     //站点信息
     //站点信息
     async toGetSite() {
     async toGetSite() {
       let site = sessionStorage.getItem('site');
       let site = sessionStorage.getItem('site');
@@ -147,7 +147,7 @@ export default {
         this.$set(this, `modules`, JSON.parse(modules));
         this.$set(this, `modules`, JSON.parse(modules));
         return;
         return;
       }
       }
-      this.toGetMenu();
+      this.toGetModule();
     },
     },
     async toGetModule() {
     async toGetModule() {
       let result = await this.getModule({ type: `list` });
       let result = await this.getModule({ type: `list` });
@@ -159,17 +159,21 @@ export default {
     },
     },
     async finishedModule() {
     async finishedModule() {
       let modules = JSON.parse(JSON.stringify(this.modules));
       let modules = JSON.parse(JSON.stringify(this.modules));
-      for (const item of modules) {
-        if (`${item.is_use}` === `0`) {
-          let res = await this.completeModules(item);
-          item.children = res;
-        }
-      }
-      for (const item of modules) {
-        this.$set(this, `${item.category}List`, item);
-      }
+      // for (const item of modules) {
+      //   if (`${item.is_use}` === `0`) {
+      //     let res = await this.completeModules(item);
+      //     item.children = res;
+      //     this.$set(this, `${item.category}List`, item);
+      //   }
+      // }
+      //获取了所有栏目
+      let res = await this.completeAllModules(modules);
+      // for (const item of modules) {
+      //   this.$set(this, `${item.category}List`, item);
+      // }
       this.$set(this, `modules`, modules);
       this.$set(this, `modules`, modules);
     },
     },
+    //弃用
     async completeModules(item) {
     async completeModules(item) {
       let result = await this.getColumn({
       let result = await this.getColumn({
         type: `list`,
         type: `list`,
@@ -191,6 +195,7 @@ export default {
         return columns;
         return columns;
       }
       }
     },
     },
+    //弃用
     async completeColumn(item) {
     async completeColumn(item) {
       let data = { skip: 0, limit: 8 };
       let data = { skip: 0, limit: 8 };
       if (item.type === `bugList`) {
       if (item.type === `bugList`) {
@@ -227,8 +232,36 @@ export default {
       let result = await this.getPosts({ type: 'fetch', data: { id: id } });
       let result = await this.getPosts({ type: 'fetch', data: { id: id } });
       if (result.errcode === 0) return result.data;
       if (result.errcode === 0) return result.data;
     },
     },
+    //合并请求模块
+    async completeAllModules(modules) {
+      let ids = modules.map(item => item.id);
+      let result = await this.getAllColumn(ids);
+      // result = _.flattenDeep(result);
+      if (result.length > 0) {
+        //整理栏目
+        result = result.map(item => {
+          if (item.type === 'column') item.path = `/newsList/module/${item.id}`;
+          else item.path = `/newsList/module/${item.content_id}`;
+          return item;
+        });
+        //请求信息
+        let res = await this.getAllNews(result);
+        //合并栏目和信息
+        result = result.map(item => {
+          let newsList = res.filter(fil => fil.parent_id === item.id);
+          item.children = newsList;
+          return item;
+        });
+        modules = modules.map(item => {
+          let children = result.filter(fil => fil.parent_id === item.id);
+          item.children = children;
+          this.$set(this, `${item.category}List`, item);
+          return item;
+        });
+      }
+    },
   },
   },
 };
 };
 </script>
 </script>
 
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 29 - 15
src/views/member.vue

@@ -71,7 +71,7 @@ export default {
   },
   },
   computed: {},
   computed: {},
   methods: {
   methods: {
-    ...mapActions(['getSite', `getMenu`, 'getColumn', 'getModule', 'getNews', 'getJobInfo', 'getPosts', 'getLink']),
+    ...mapActions(['getSite', `getMenu`, 'getColumn', 'getAllNews', 'getAllColumn', 'getModule', 'getNews', 'getJobInfo', 'getPosts', 'getLink']),
     //站点信息
     //站点信息
     async toGetSite() {
     async toGetSite() {
       let site = sessionStorage.getItem('site');
       let site = sessionStorage.getItem('site');
@@ -160,20 +160,9 @@ export default {
     },
     },
     async finishedModule() {
     async finishedModule() {
       let modules = JSON.parse(JSON.stringify(this.modules));
       let modules = JSON.parse(JSON.stringify(this.modules));
-      let object = {};
-      for (const item of modules) {
-        if (item.category === 'member') {
-          if (`${item.is_use}` === `0`) {
-            let res = await this.completeModules(item);
-            item.children = res;
-            object = item;
-          }
-        }
-      }
-      for (const item of object.children) {
-        this.$set(this, `${item.category}List`, item);
-      }
+      let res = await this.completeAllModules(modules);
     },
     },
+    //弃用
     async completeModules(item) {
     async completeModules(item) {
       let result = await this.getColumn({
       let result = await this.getColumn({
         type: `list`,
         type: `list`,
@@ -195,6 +184,7 @@ export default {
         return columns;
         return columns;
       }
       }
     },
     },
+    //弃用
     async completeColumn(item) {
     async completeColumn(item) {
       let data = { skip: 0, limit: 8 };
       let data = { skip: 0, limit: 8 };
       if (item.type === `bugList`) {
       if (item.type === `bugList`) {
@@ -209,8 +199,32 @@ export default {
         return result.data;
         return result.data;
       }
       }
     },
     },
+    //合并请求模块
+    async completeAllModules(modules) {
+      let newMod = modules.filter(fil => fil.category === 'member');
+      let ids = newMod.map(item => item.id);
+      let result = await this.getAllColumn(ids);
+
+      if (result.length > 0) {
+        //整理栏目
+        result = result.map(item => {
+          if (item.type === 'column') item.path = `/memberList/module/${item.id}`;
+          else item.path = `/memberList/module/${item.content_id}`;
+          return item;
+        });
+        //请求信息
+        let res = await this.getAllNews(result);
+        //合并栏目和信息 这部分少一层,直接将栏目set就可以
+        result = result.map(item => {
+          let newsList = res.filter(fil => fil.parent_id === item.id);
+          item.children = newsList;
+          this.$set(this, `${item.category}List`, item);
+          return item;
+        });
+      }
+    },
   },
   },
 };
 };
 </script>
 </script>
 
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>

+ 1 - 1
src/views/memberDetail.vue

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

+ 1 - 1
src/views/memberList.vue

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

+ 1 - 1
src/views/recruit/corp.vue

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

+ 1 - 1
src/views/recruit/jobfair.vue

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

+ 1 - 1
src/views/recruit/jobinfo.vue

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

+ 1 - 1
src/views/recruit/jobs.vue

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

+ 1 - 1
src/views/recruit/talk.vue

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