guhongwei před 5 roky
rodič
revize
8f89bdcd98

+ 3 - 6
src/layout/detail/jobfair/head.vue

@@ -7,9 +7,9 @@
       <el-col :span="24" style="padding: 20px 15px;">
         <el-col :span="18">
           <span style="font-size: 16px;">{{ info && info.title ? info.title : '' }}</span>
-          <el-button type="danger" class="btn">参会单位</el-button>
+          <a href="#corpList"><el-button type="danger" class="btn">参会单位</el-button></a>
         </el-col>
-        <el-col :span="6" class="ticketBtn">
+        <el-col :span="6" class="ticketBtn" style="text-align:right">
           <el-button type="primary" @click="applyTicket()">领取门票</el-button>
         </el-col>
         <el-col :span="24">
@@ -46,10 +46,7 @@ export default {
     // detail: {},
   }),
   created() {},
-  mounted() {
-    // this.$set(this, `detail`, this.list);
-    // this.$set(this, `list`, this.info);
-  },
+  mounted() {},
   computed: {},
   methods: {
     applyTicket() {

+ 1 - 1
src/layout/detail/talk/talk-head.vue

@@ -9,7 +9,7 @@
           <span style="font-size: .875rem;">宣讲单位:{{ info && info.title ? info.title : '' }}</span>
           <el-button type="danger" icon="el-icon-search" class="btn" @click="turnTo">工商查询</el-button>
         </el-col>
-        <el-col :span="6" class="ticketBtn">
+        <el-col :span="6" class="ticketBtn" style="text-align:right">
           <el-button type="primary" @click="applyTicket()">领取门票</el-button>
         </el-col>
         <el-col :span="24">

+ 13 - 6
src/layout/detail/web-jobs.vue

@@ -9,17 +9,17 @@
       <el-row class="rowStyle" v-for="(item, index) in list" :key="index" :gutter="10">
         <el-col :span="16">
           <el-link class="job__name" :underline="false" @click="turnToJobs(item.id)">
-            <span title="查看职位">{{ item.job_name ? item.job_name : '广东省德庆县2019年引进高层次紧缺人才公告' }}</span>
+            <span title="查看职位">{{ item.job_name ? item.job_name : '' }}</span>
           </el-link>
         </el-col>
         <el-col class="money" :span="4">
-          {{ item.salary ? item.salary.text : '5K-10K/月' }}
+          {{ item.salary ? item.salary.text : '' }}
         </el-col>
-        <el-col :span="4">
-          {{ item.num ? item.num : '13人' }}
+        <el-col :span="4" style="text-align:center;">
+          {{ item.job_number | jobNum }}
         </el-col>
-        <el-col :span="16"> 招聘专业 : {{ item.subject ? item.subject : '法学,经济学,人文地理与城乡规划,环境科学,劳动与社会保障' }} </el-col>
-        <el-col :span="8"> {{ item.edu ? item.edu : '本科及以上' }} | {{ item.city ? item.city : '肇庆市' }} </el-col>
+        <el-col :span="16"> 招聘专业 : {{ item.zy_req ? item.zy_req : '' }} </el-col>
+        <el-col :span="8"> {{ item.xl_req ? item.xl_req : '' }} | {{ item.city ? item.city : '' }} </el-col>
       </el-row>
       <el-row v-if="!type">
         <el-col :span="24" style="text-align:center">
@@ -78,6 +78,13 @@ export default {
       this.$set(this, `list`, this.info.data);
     },
   },
+  filters: {
+    jobNum(num) {
+      if (!num) return '';
+      num = num.includes('人') ? num : `${num}人`;
+      return num;
+    },
+  },
 };
 </script>
 

+ 18 - 7
src/layout/layout-part/top-menu.vue

@@ -12,16 +12,19 @@
                 </template>
                 <el-menu-item v-for="(sub, subIndex) in jobs.children" :key="subIndex" :index="sub.path">{{ sub.title }}</el-menu-item>
               </el-submenu>
-              <!-- <el-menu-item v-else :index="item.path" :key="index">{{ item.title }}</el-menu-item> -->
             </template>
             <template v-for="(item, index) in menu">
-              <el-submenu :index="`${index}`" :key="index">
+              <el-submenu :index="`${index}`" :key="index" v-if="item.type !== 'url' && item.type !== 'content'">
                 <template slot="title">
                   {{ item.title }}
                 </template>
-                <el-menu-item v-for="(sub, subIndex) in item.children" :key="subIndex" :index="sub.path">{{ sub.title }}</el-menu-item>
+                <template v-for="(sub, subIndex) in item.children">
+                  <el-menu-item :index="sub.path" :key="subIndex" v-if="sub.type !== 'url'">{{ sub.title }}</el-menu-item>
+                  <el-menu-item :index="``" :key="subIndex" @click="turnTo(sub.url)" v-else> {{ sub.title }}</el-menu-item>
+                </template>
               </el-submenu>
-              <!-- <el-menu-item v-else :index="item.path" :key="index">{{ item.title }}</el-menu-item> -->
+              <el-menu-item v-else-if="item.type === 'content'" :index="item.path" :key="index">{{ item.title }}</el-menu-item>
+              <el-menu-item v-else :index="``" :key="index" @click="turnTo(item.url)">{{ item.title }}</el-menu-item>
             </template>
           </el-menu>
         </el-col>
@@ -62,8 +65,12 @@ export default {
         //获取菜单的栏目
         let allMenu = result.data;
         for (let item of allMenu) {
-          let res = await this.completeMenu(item);
-          item.children = res;
+          if (item.type === 'content') {
+            item.path = `/info/detail?id=${item.content_id}`;
+          } else if (item.type !== 'url') {
+            let res = await this.completeMenu(item);
+            item.children = res;
+          }
         }
         sessionStorage.setItem('menu', JSON.stringify(allMenu));
         this.$set(this, `menu`, allMenu);
@@ -74,11 +81,15 @@ export default {
       if (`${res.errcode}` === '0') {
         //组合path:res.data内容都为栏目.所以,点击这些栏目显示的列表应该是信息列表,需要用栏目的id作为查询信息的parten_id查出不同栏目的信息
         for (const col of res.data) {
-          col.path = `/info/list/${col.id}`;
+          if (col.type === 'content') col.path = `/info/detail?id=${col.content_id}`;
+          else if (item.type !== 'url') col.path = `/info/list/${col.id}`;
         }
         return res.data;
       }
     },
+    turnTo(url) {
+      window.open(url);
+    },
   },
 };
 </script>

+ 5 - 1
src/router.js

@@ -3,7 +3,7 @@ import Router from 'vue-router';
 
 Vue.use(Router);
 
-export default new Router({
+const router = new Router({
   mode: 'history',
   base: process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER,
   routes: [
@@ -87,3 +87,7 @@ export default new Router({
     },
   ],
 });
+router.afterEach((to, from, next) => {
+  window.scrollTo(0, 0);
+});
+export default router;

+ 0 - 1
src/views/index/index.vue

@@ -199,7 +199,6 @@ export default {
       } else if (item.category === 'self1') {
         this.$set(this, `self1List`, item.children);
       } else if (item.category === 'self2') {
-        console.log(item.children);
         this.$set(this, `self2List`, item.children);
       }
     },

+ 4 - 0
src/views/info/detail.vue

@@ -29,6 +29,10 @@
             <el-image :src="info.pic" style="height:60%;width:60%" v-if="info.pic"></el-image>
           </el-col>
           <el-col :span="24" style="padding-top: 1rem;font-size: 20px;text-indent: 2rem;line-height: 30px;" v-html="info.content"> </el-col>
+          <el-col :span="24">附件:</el-col>
+          <el-col :span="24" v-for="(item, index) in info.attachment" :key="index">
+            <el-link type="primary" :href="item.uri">{{ item.name }}</el-link>
+          </el-col>
         </el-row>
       </template>
     </recruitdetail-layout>

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

@@ -19,7 +19,7 @@
       <template v-slot:mainLeft>
         <jobfair-head title="招聘会信息" :info="info" @getTicket="getTicket"></jobfair-head>
         <jobfair-context title="招聘会说明" :info="info"></jobfair-context>
-        <user-defined title="招聘会相关">
+        <user-defined title="招聘会相关" id="corpList">
           <el-tabs v-model="tabs" type="card">
             <el-tab-pane label="企业列表" name="corp">
               <el-table :data="corpList" style="width: 100%" stripe :show-header="false">

+ 9 - 3
src/views/jobfair/list.vue

@@ -31,9 +31,14 @@
             {{ item.time }}
           </el-col>
         </el-col>
-        <el-col :span="24" class="common schname">
-          <i class="el-icon-school"></i>
-          主办学校:<span>{{ item.organizer }}</span>
+        <el-col :span="24">
+          <el-col :span="18" class="common schname">
+            <i class="el-icon-school"></i>
+            主办学校:<span>{{ item.organizer }}</span>
+          </el-col>
+          <el-col :span="6" class="time">
+            报名截止日期:<span>{{ item.end_date }}</span>
+          </el-col>
         </el-col>
         <el-col :span="24" class="common address">
           <i class="el-icon-location"></i>
@@ -126,6 +131,7 @@ export default {
 }
 .list .time {
   color: #ff0000;
+  text-align: right;
 }
 .list .common {
   padding: 2px 0;

+ 27 - 11
src/views/jobinfo/list.vue

@@ -33,21 +33,24 @@
       </el-col>
       <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
         <el-col :span="24">
-          <el-col :span="24" class="title">
+          <el-col :span="20" class="title">
             <el-link :underline="false" @click="$router.push({ path: '/jobinfo/detail', query: { id: item.id } })">{{ item.title }}</el-link>
           </el-col>
-          <el-col :span="24" class="common practice">
-            招聘类型:<span>{{ `${item.is_practice}` === `0` ? '全职' : '实习' }}</span>
-          </el-col>
-          <el-col :span="24" class="common corpname">
-            <i class="el-icon-office-building"></i>
-            举办企业:<span>{{ item.corpname }}</span>
-          </el-col>
-          <el-col :span="24" class="common schname">
-            <i class="el-icon-school"></i>
-            主办学校:<span>{{ item.schname }}</span>
+          <el-col :span="4" class="time">
+            {{ item | getTime(`meta.createdAt`) }}
           </el-col>
         </el-col>
+        <el-col :span="24" class="common practice">
+          招聘类型:<span>{{ `${item.is_practice}` === `0` ? '全职' : '实习' }}</span>
+        </el-col>
+        <el-col :span="24" class="common corpname">
+          <i class="el-icon-office-building"></i>
+          举办企业:<span>{{ item.corpname }}</span>
+        </el-col>
+        <el-col :span="24" class="common schname">
+          <i class="el-icon-school"></i>
+          主办学校:<span>{{ item.schname }}</span>
+        </el-col>
       </el-col>
       <el-col :span="24" class="page">
         <el-pagination @current-change="search" :current-page="currentPage" :page-size="$limit" layout="total, prev, pager, next, jumper" :total="totalRow">
@@ -59,6 +62,7 @@
 
 <script>
 import { mapActions, mapState } from 'vuex';
+import _ from 'lodash';
 export default {
   name: 'list',
   props: {},
@@ -92,6 +96,18 @@ export default {
       }
     },
   },
+  filters: {
+    getTime(data, col) {
+      let time = _.get(data, col);
+      time = time
+        ? new Date(time)
+            .toLocaleDateString()
+            .replace('/', '-')
+            .replace('/', '-')
+        : '';
+      return time;
+    },
+  },
 };
 </script>
 

+ 16 - 3
src/views/jobs/list.vue

@@ -21,7 +21,7 @@
     </el-row>
     <el-row class="rowstyle" v-for="(item, index) in list" :key="index">
       <el-col :span="3">
-        <div class="block"><el-avatar shape="square" :size="75" :src="squareUrl"></el-avatar></div>
+        <div class="block"><el-avatar shape="square" fit="contain" :size="75" :src="getProp(item, 'corpInfo.logo_url')"></el-avatar></div>
       </el-col>
       <el-col :span="10" class="info">
         <el-row>
@@ -55,7 +55,7 @@
 
 <script>
 import { mapActions, mapState } from 'vuex';
-
+import _ from 'lodash';
 export default {
   name: 'list',
   props: {},
@@ -80,7 +80,7 @@ export default {
     type: 'search',
   },
   methods: {
-    ...mapActions(['postOperation']),
+    ...mapActions(['postOperation', 'corpOperation']),
     async search(page) {
       let skip = 0;
       if (page) {
@@ -91,12 +91,25 @@ export default {
       let result = await this.postOperation({ type: 'list', data: newData });
       if (`${result.errcode}` === '0') {
         //给this=>vue的实例下在中的list属性,赋予result.data的值
+        for (const item of result.data) {
+          let corpInfo = await this.getLogo(item.corpid);
+          item.corpInfo = corpInfo;
+        }
         this.$set(this, `list`, result.data);
         this.$set(this, `totalRow`, result.total);
+        // this.$set(this, `loading`);
       } else {
         this.$message.error(result.errmsg ? result.errmsg : 'error');
       }
     },
+    async getLogo(corpid) {
+      let result = await this.corpOperation({ type: 'component', data: { corpid: corpid } });
+      if (`${result.errcode}` === '0') return result.data;
+    },
+    getProp(data, pos) {
+      let res = _.get(data, pos);
+      return res;
+    },
   },
 };
 </script>