فهرست منبع

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

guhongwei 5 سال پیش
والد
کامیت
d9391e4e65
1فایلهای تغییر یافته به همراه18 افزوده شده و 25 حذف شده
  1. 18 25
      src/components/self-calendars.vue

+ 18 - 25
src/components/self-calendars.vue

@@ -4,25 +4,14 @@
       <el-col :span="12">
         <el-calendar>
           <template #dateCell="{date, data}">
-            <el-popover ref="popover" placement="right" width="500" trigger="hover">
-              <el-row>
-                <el-col :span="24" style="padding:0.5rem;text-align:center;">{{ data.day }}招聘会</el-col>
-                <el-col :span="24" style="text-align:center;">
-                  <el-table :data="list" style="width: 100%" border v-loading="loading">
-                    <el-table-column prop="title" align="center" label="标题"> </el-table-column>
-                    <el-table-column prop="organizer" align="center" label="举办方"> </el-table-column>
-                  </el-table>
-                </el-col>
-              </el-row>
-              <span slot="reference">
-                {{ date | getDay }}
-              </span>
-            </el-popover>
+            <el-row>
+              <el-col :span="24" @click.native="search(data)">{{ date | getDay }}</el-col>
+            </el-row>
           </template>
         </el-calendar>
       </el-col>
       <el-col :span="12" class="right">
-        <el-col :span="24" class="info">
+        <el-col :span="24" class="info" v-if="info.id">
           <el-col :span="24" class="time">
             <p>
               <i class="el-icon-time"></i><span value-format="MM-dd">{{ info.time | getTime }}</span>
@@ -41,6 +30,14 @@
             <p>地点:{{ info.address }}</p>
           </el-col>
         </el-col>
+        <el-col :span="24" class="info" v-else>
+          <el-col :span="24" class="time">
+            <p><i class="el-icon-time"></i><span value-format="MM-dd">--:--</span></p>
+          </el-col>
+          <el-col :span="24" class="organizer">
+            该日无招聘会
+          </el-col>
+        </el-col>
         <span class="jiantou"></span>
       </el-col>
     </el-col>
@@ -72,32 +69,28 @@ export default {
   computed: {},
   methods: {
     ...mapActions(['jobfairOperation']),
-    async search() {
+    async search(date) {
+      console.log(date);
+      let options = { date: date ? date.day : undefined };
       // 1直接拿着参数发送请求
-      let result = await this.jobfairOperation({ type: 'list', data: {} });
+      let result = await this.jobfairOperation({ type: 'list', data: { ...options } });
       if (`${result.errcode}` === '0') {
         //给this=>vue的实例下在中的list属性,赋予result。data的值
         console.log(result.data);
         this.$set(this, `infoList`, result.data);
         if (result.data.length > 0) this.$set(this, `info`, result.data[0]);
+        else this.$set(this, `info`, {});
       } else {
+        this.$set(this, `info`, {});
         this.$message.error(result.errmsg ? result.errmsg : 'error');
       }
     },
-    async checkJobFair(data) {
-      let searchInfo = { date: data.day };
-      this.$set(this, `loading`, true);
-      let result = await this.jobfairOperation({ type: 'list', data: searchInfo });
-      this.$set(this, `list`, result.data ? result.data : []);
-      this.$set(this, `loading`, false);
-    },
   },
   filters: {
     getDay(data) {
       return data.getDate();
     },
     getTime(date) {
-      console.log(date);
       if (date) {
         let arr = date.split(' ');
         return arr[1];