lrf402788946 5 years ago
parent
commit
773102c9d2

+ 1 - 1
src/pages/index/views/home.vue

@@ -158,7 +158,7 @@ export default {
     async getSite() {
       let site = sessionStorage.getItem('site');
       if (!site) {
-        let result = await this.siteOperation({ type: 'search', data: { site: this.$site } });
+        let result = await this.siteOperation({ type: 'search', data: {} });
         if (`${result.errcode}` === `0`) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
           this.$set(this, `site`, result.data);

+ 52 - 47
src/pages/jobfairList/views/list.vue

@@ -2,55 +2,57 @@
   <div id="jobfair">
     <list-layout searchPlaceHolder="请输入招聘会标题" @search="search" @searchBar="searchBar" :hasMore="hasMore" :searchName="`title`">
       <template v-slot:content>
-        <span v-if="list.length > 0">
-          <el-row class="jobfair_list" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
-            <el-row>
-              <span class="time_off" v-if="item.is_over === '0'">过</span>
-              <el-col :span="6" class="jobfair_icon">
-                招聘
-              </el-col>
-              <el-col :span="18" class="jobfair_info">
-                <div style="float:left">
-                  <el-tag effect="plain" v-if="item.schid === $site" class="jobfair_tags">校内</el-tag>
-                  <el-tag type="warning" effect="plain" v-else>校外</el-tag>
-                </div>
-                <div class="info_word">
-                  {{ item.title }}
-                </div>
-              </el-col>
-            </el-row>
-            <el-row type="flex" align="top" :gutter="10" class="jobfair_under_info">
-              <el-col :span="1">
-                <div class="el-icon-s-flag info_icon"></div>
-              </el-col>
-              <el-col :span="15" :offset="1"> 主办方:{{ item.organizer }} </el-col>
-              <el-col :span="6" class="info_date">
-                {{ item.meet_day }}
-              </el-col>
-            </el-row>
-            <el-row type="flex" align="top" :gutter="10" class="jobfair_under_info">
-              <el-col :span="1">
-                <div class="el-icon-position info_icon"></div>
-              </el-col>
-              <el-col :span="15" :offset="1">
-                {{ item.address }}
-              </el-col>
-              <el-col :span="6" class="info_time">
-                {{ item.meet_time }}
-              </el-col>
-            </el-row>
-            <el-row type="flex" align="middle" :gutter="10" class="jobfair_under_info">
-              <el-col :span="1">
-                <div class="el-icon-user-solid info_icon"></div>
-              </el-col>
-              <el-col :span="15" :offset="1"> 时间:{{ item.time }} </el-col>
-              <!-- <el-col :span="6" class="el-icon-view info_icon info_date view_icon">
+        <el-row v-loading="loading">
+          <span v-if="list.length > 0">
+            <el-row class="jobfair_list" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
+              <el-row>
+                <span class="time_off" v-if="item.is_over === '0'">过</span>
+                <el-col :span="6" class="jobfair_icon">
+                  招聘
+                </el-col>
+                <el-col :span="18" class="jobfair_info">
+                  <div style="float:left">
+                    <el-tag effect="plain" v-if="item.schid === $site" class="jobfair_tags">校内</el-tag>
+                    <el-tag type="warning" effect="plain" v-else>校外</el-tag>
+                  </div>
+                  <div class="info_word">
+                    {{ item.title }}
+                  </div>
+                </el-col>
+              </el-row>
+              <el-row type="flex" align="top" :gutter="10" class="jobfair_under_info">
+                <el-col :span="1">
+                  <div class="el-icon-s-flag info_icon"></div>
+                </el-col>
+                <el-col :span="15" :offset="1"> 主办方:{{ item.organizer }} </el-col>
+                <el-col :span="6" class="info_date">
+                  {{ item.meet_day }}
+                </el-col>
+              </el-row>
+              <el-row type="flex" align="top" :gutter="10" class="jobfair_under_info">
+                <el-col :span="1">
+                  <div class="el-icon-position info_icon"></div>
+                </el-col>
+                <el-col :span="15" :offset="1">
+                  {{ item.address }}
+                </el-col>
+                <el-col :span="6" class="info_time">
+                  {{ item.meet_time }}
+                </el-col>
+              </el-row>
+              <el-row type="flex" align="middle" :gutter="10" class="jobfair_under_info">
+                <el-col :span="1">
+                  <div class="el-icon-user-solid info_icon"></div>
+                </el-col>
+                <el-col :span="15" :offset="1"> 时间:{{ item.time }} </el-col>
+                <!-- <el-col :span="6" class="el-icon-view info_icon info_date view_icon">
                 {{ item.fact_c_count }}
               </el-col> -->
+              </el-row>
             </el-row>
-          </el-row>
-        </span>
-        <nodata v-else></nodata>
+          </span>
+          <nodata v-else></nodata>
+        </el-row>
       </template>
     </list-layout>
   </div>
@@ -75,6 +77,7 @@ export default {
     nodata,
   },
   data: () => ({
+    loading: true,
     list: {},
     totalRow: 20,
     hasMore: true,
@@ -92,6 +95,7 @@ export default {
   methods: {
     ...mapActions(['fairsOperation']),
     async search(type) {
+      this.loading = true;
       let skip = 0;
       //判断下type,如果type存在.当前页加一
       if (type && type === 'nextPage') {
@@ -110,6 +114,7 @@ export default {
         this.$set(this, `totalRow`, result.total); //将数据库返回的总数放到页面的totalRow变量中,用来判断
         this.$set(this, `hasMore`, this.list.length < this.totalRow); //此处是根据数据库总数的结果和当前列表的总条数比较,看看是否可以继续请求数据
       }
+      this.loading = false;
     },
     searchBar({ type, value }) {
       this.$set(this, `searchInfo`, value);
@@ -120,7 +125,7 @@ export default {
     },
     changeState(type) {
       if (typeof this.user !== 'object') {
-        this.$message.error('请先登录');
+        // this.$message.error('请先登录');
         return false;
       }
       if (type === 'in') {

+ 28 - 18
src/pages/jobinfoList/views/list.vue

@@ -17,24 +17,26 @@
               ></nut-actionsheet>
             </el-col>
           </el-row>
-          <span v-if="list.length > 0">
-            <el-row class="list_row" v-for="(item, index) in list" :key="index" @click.native="link(item.id)" :gutter="10">
-              <el-col :span="4">
-                <el-image fit="cover" :src="item.corp.identity.logo_url"></el-image>
-              </el-col>
-              <el-col :span="20">
-                <el-col :span="24" class="title">
-                  {{ item.corpname }}
+          <el-col :span="24" v-loading="loading">
+            <span v-if="list.length > 0">
+              <el-row class="list_row" v-for="(item, index) in list" :key="index" @click.native="link(item.id)" :gutter="10">
+                <el-col :span="4">
+                  <el-image fit="cover" :src="getImg(`corp.identity.logo_url`, item)"></el-image>
                 </el-col>
-                <el-col :span="24" class="corpname"> 招聘类型:{{ item.is_practice === 0 ? '正式招聘' : '实习招聘' }} </el-col>
-                <el-col :span="20" class="corpname title_display"> {{ item.title }} </el-col>
-                <el-col :span="4" class="view">
-                  <i class="el-icon-view info_icon"></i>
+                <el-col :span="20">
+                  <el-col :span="24" class="title">
+                    {{ item.corpname }}
+                  </el-col>
+                  <el-col :span="24" class="corpname"> 招聘类型:{{ item.is_practice === 0 ? '正式招聘' : '实习招聘' }} </el-col>
+                  <el-col :span="20" class="corpname title_display"> {{ item.title }} </el-col>
+                  <el-col :span="4" class="view">
+                    <i class="el-icon-view info_icon"></i>
+                  </el-col>
                 </el-col>
-              </el-col>
-            </el-row>
-          </span>
-          <nodata v-else></nodata>
+              </el-row>
+            </span>
+            <nodata v-else></nodata>
+          </el-col>
         </el-row>
       </template>
     </list-layout>
@@ -125,6 +127,7 @@ export default {
     nodata,
   },
   data: () => ({
+    loading: true,
     hasMore: true,
     totalRow: 20,
     searchInfo: {},
@@ -158,6 +161,7 @@ export default {
     ...mapActions(['jobinfoOperation', 'corpOperation']),
     //添加type形参
     async search(type) {
+      this.loading = true;
       let skip = 0;
       //判断下type,如果type存在.当前页加一
       if (type && type === 'nextPage') {
@@ -179,6 +183,7 @@ export default {
         this.$set(this, `totalRow`, result.total); //将数据库返回的总数放到页面的totalRow变量中,用来判断
         this.$set(this, `hasMore`, this.list.length < this.totalRow); //此处是根据数据库总数的结果和当前列表的总条数比较,看看是否可以继续请求数据
       }
+      this.loading = false;
     },
     searchBar({ type, value }) {
       //1)实时同步查询框中的内容至当前组件内
@@ -209,11 +214,16 @@ export default {
     },
     async searchCorp(data) {
       for (let item of data) {
-        let res = await this.corpOperation({ type: 'search', data: { corpid: item.corpid } });
-        item.corp = res;
+        if (_.get(item, `corpid`)) {
+          let res = await this.corpOperation({ type: 'search', data: { corpid: item.corpid } });
+          item.corp = res;
+        }
       }
       return data;
     },
+    getImg(item, data) {
+      return _.get(data, item);
+    },
   },
   filters: {
     getData(search) {

+ 1 - 1
src/pages/newsList/views/list.vue

@@ -46,7 +46,7 @@ export default {
     async getSite() {
       let site = sessionStorage.getItem('site');
       if (!site) {
-        let result = await this.siteOperation({ type: 'search', data: { site: this.$site } });
+        let result = await this.siteOperation({ type: 'search', data: {} });
         if (`${result.errcode}` === `0`) {
           sessionStorage.setItem('site', JSON.stringify(result.data));
           this.$set(this, `site`, result.data);

+ 48 - 24
src/pages/talkList/views/list.vue

@@ -9,29 +9,32 @@
               <el-col :span="8" style="text-align:center;border-right: 1px solid #ccc;"><el-button @click="btnIn('out')">校外</el-button></el-col>
             </span>
             <el-col :span="canSpan" style="text-align:center;border-right: 1px solid #ccc;">
-              <el-button icon="el-icon-date" @click="toggle()">
+              <el-button icon="el-icon-date" @click="toggle()" style="border:0px">
                 {{ Rili }}
                 <i class="el-icon-arrow-down el-icon--right"></i>
               </el-button>
+              <el-button type="text" icon="el-icon-circle-close" @click="reset()"></el-button>
             </el-col>
             <nut-calendar :is-visible="isVisible2" :is-auto-back-fill="true" @close="switchPicker('isVisible2')" @choose="talkRili"> </nut-calendar>
           </el-row>
-          <span v-if="list.length > 0">
-            <el-row :span="24" class="talk_li" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
-              <el-col :span="4"><el-image :src="item.corp.identity.logo_url"></el-image> </el-col>
-              <el-col :span="14" class="talk_li14">
-                <el-row class="talk_li14_1" :span="4">{{ item.title }}</el-row>
-                <el-row><i class="el-icon-office-building el-icon--left"></i>{{ item.corpname }}</el-row>
-                <el-row><i class="el-icon-location-outline el-icon--left"></i>{{ item.schname }}</el-row>
-                <el-row class="talk_li14_3"><i class="el-icon-office-building el-icon--left"></i>{{ item.address }} </el-row>
-              </el-col>
-              <el-col :span="6" class="talk_li6">
-                <el-row class="talk_li6_2"> {{ item.date }}<br /> </el-row>
-                <el-row class="talk_li6_3"><i class="el-icon-view el-icon--left"></i>2019</el-row>
-              </el-col>
-            </el-row>
-          </span>
-          <nodata v-else></nodata>
+          <el-col :span="24" v-loading="loading">
+            <span v-if="list.length > 0">
+              <el-row :span="24" class="talk_li" v-for="(item, index) in list" :key="index" @click.native="link(item.id)">
+                <el-col :span="4"><el-image :src="getImg(`corp.identity.logo_url`, item)"></el-image> </el-col>
+                <el-col :span="14" class="talk_li14">
+                  <el-row class="talk_li14_1" :span="4">{{ item.title }}</el-row>
+                  <el-row><i class="el-icon-office-building el-icon--left"></i>{{ item.corpname }}</el-row>
+                  <el-row><i class="el-icon-location-outline el-icon--left"></i>{{ item.schname }}</el-row>
+                  <el-row class="talk_li14_3"><i class="el-icon-office-building el-icon--left"></i>{{ item.address }} </el-row>
+                </el-col>
+                <el-col :span="6" class="talk_li6">
+                  <el-row class="talk_li6_2"> {{ item.date }}<br /> </el-row>
+                  <el-row class="talk_li6_3"><i class="el-icon-view el-icon--left"></i>2019</el-row>
+                </el-col>
+              </el-row>
+            </span>
+            <nodata v-else></nodata>
+          </el-col>
         </el-row>
       </template>
     </list-layout>
@@ -42,6 +45,7 @@
 import listLayout from '@/layout/list-layout.vue';
 import { mapActions, mapState } from 'vuex';
 import nodata from '@/components/nodata.vue';
+import _ from 'lodash';
 export default {
   metaInfo() {
     return {
@@ -57,6 +61,7 @@ export default {
     nodata,
   },
   data: () => ({
+    loading: true,
     hasMore: true,
     totalRow: 20,
     searchInfo: {},
@@ -108,6 +113,7 @@ export default {
   methods: {
     ...mapActions(['talksOperation', 'corpOperation']),
     async search(type) {
+      this.loading = true;
       let skip = 0;
       //判断下type,如果type存在.当前页加一
       if (type && type === 'nextPage') {
@@ -128,6 +134,7 @@ export default {
         this.$set(this, `totalRow`, result.total); //将数据库返回的总数放到页面的totalRow变量中,用来判断
         this.$set(this, `hasMore`, this.list.length < this.totalRow); //此处是根据数据库总数的结果和当前列表的总条数比较,看看是否可以继续请求数据
       }
+      this.loading = false;
     },
     searchBar({ type, value }) {
       this.$set(this, `searchInfo`, value);
@@ -160,25 +167,42 @@ export default {
       this.search();
     },
     changeState(schIn) {
-      if (this.$site === 'master') {
-        this.searchInfo.schid = undefined;
-        this.changeStateBtn = false;
-        this.canSpan = 24;
-      } else {
+      let site = sessionStorage.getItem('site');
+      let notMaster = schIn => {
         if (schIn === 'in') {
           this.searchInfo.schid = this.user.schid || undefined;
         } else {
           this.searchInfo.schid = undefined;
         }
+      };
+      if (!site) notMaster(schIn);
+      site = JSON.parse(site);
+      if (_.get(site, `site`) === 'master') {
+        this.searchInfo.schid = undefined;
+        this.changeStateBtn = false;
+        this.canSpan = 24;
+      } else {
+        notMaster(schIn);
       }
     },
     async searchCorp(data) {
       for (const item of data) {
-        let res = await this.corpOperation({ type: 'search', data: { corpid: item.corpid } });
-        item.corp = res;
+        if (_.get(item, `corpid`)) {
+          let res = await this.corpOperation({ type: 'search', data: { corpid: item.corpid } });
+          item.corp = res;
+        }
       }
       return data;
     },
+    getImg(item, data) {
+      return _.get(data, item);
+    },
+    reset() {
+      this.$set(this, `Rili`, '日历');
+      delete this.searchInfo.date;
+      this.hasMore = true;
+      this.search();
+    },
   },
 };
 </script>

+ 2 - 1
src/store/jobfair.js

@@ -59,7 +59,8 @@ export const actions = {
       result = await this.$axios.$get(api.faircorps, {}, { schid: schid, fairid: fairid, corpid: corpid, status: status });
     }
     if (type === 'searchCorp') {
-      result = await this.$axios.$get(api.faircorps, {}, { ...data });
+      let { id } = data;
+      result = await this.$axios.$get(api.faircorpsInfo, { id: id });
     }
     if (type === 'applyUpdate') {
       let { info, id } = data;