瀏覽代碼

日历更新

guhongwei 5 年之前
父節點
當前提交
ad1b266abc

+ 1 - 1
src/components/self-calendar.vue

@@ -28,7 +28,7 @@ export default {
   props: {},
   components: {},
   data: () => ({
-    value: new Date(),
+    calendar: new Date(),
     list: [],
     loading: false,
   }),

+ 215 - 0
src/components/self-calendars.vue

@@ -0,0 +1,215 @@
+<template>
+  <div id="self-calendar">
+    <el-col :span="24">
+      <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>
+          </template>
+        </el-calendar>
+      </el-col>
+      <el-col :span="12" class="right">
+        <el-col :span="24" class="info">
+          <el-col :span="24" class="time">
+            <p>
+              <i class="el-icon-time"></i><span value-format="MM-dd">{{ info.time | getTime }}</span>
+            </p>
+          </el-col>
+          <el-col :span="24" class="organizer">
+            {{ info.organizer }}
+          </el-col>
+          <el-col :span="24" class="title">
+            {{ info.title }}
+          </el-col>
+          <el-col :span="24" class="date">
+            <p>时间:{{ info.date }}</p>
+          </el-col>
+          <el-col :span="24" class="address">
+            <p>地点:{{ info.address }}</p>
+          </el-col>
+        </el-col>
+        <span class="jiantou"></span>
+      </el-col>
+    </el-col>
+  </div>
+</template>
+
+<script>
+import { mapActions, mapState } from 'vuex';
+export default {
+  name: 'self-calendar',
+  props: {},
+  components: {},
+  data: () => ({
+    calendar: new Date(),
+    list: [],
+    loading: false,
+    infoList: {
+      time: '9:00',
+      organizer: '一汽大众大型招聘会',
+      title: '应届毕业生大型招聘会',
+      date: '2019-11-7',
+      address: '长春会展中心',
+    },
+    info: {},
+  }),
+  created() {
+    this.search();
+  },
+  computed: {},
+  methods: {
+    ...mapActions(['jobfairOperation']),
+    async search() {
+      // 1直接拿着参数发送请求
+      let result = await this.jobfairOperation({ type: 'list', data: {} });
+      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.$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];
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+/deep/.el-calendar {
+  background-color: transparent;
+}
+/deep/.el-calendar__body {
+  padding: 0;
+}
+/deep/.el-calendar__header {
+  border-bottom: none;
+}
+/deep/.el-calendar__title {
+  color: yellow;
+  font-weight: 微软雅黑;
+  font-size: 20px;
+}
+/deep/.el-calendar__button-group {
+  display: none;
+}
+/deep/.el-calendar-table thead th {
+  padding: 12px 0;
+  color: #ffff;
+  font-weight: bold;
+}
+/deep/.el-calendar-table .el-calendar-day {
+  line-height: 70px;
+  font-size: 25px;
+  text-align: center;
+}
+/deep/.el-calendar-table tr td:first-child {
+  border-left: none;
+}
+/deep/.el-calendar-table tr:first-child td {
+  border-top: none;
+}
+/deep/.el-calendar-table td {
+  border-bottom: none;
+  border-right: none;
+}
+/deep/.el-calendar-table td.is-today {
+  color: yellow;
+  background: #f8ab55;
+  border-radius: 90px;
+}
+.right {
+  width: 540px;
+  height: 623px;
+  background: #fff;
+  border-radius: 10px;
+  position: relative;
+  float: right;
+}
+.jiantou {
+  top: 50%;
+  left: -60px;
+  display: inline-block;
+  position: absolute;
+  width: 0px;
+  height: 0;
+  border-width: 30px;
+  border-style: solid;
+  border-color: #789699 #fff #789699 #789699;
+}
+.time p {
+  width: 185px;
+  height: 57px;
+  line-height: 57px;
+  text-align: center;
+  border-radius: 50px;
+  background: #139cac;
+  font-size: 30px;
+  color: #fff;
+  float: right;
+  margin: 45px 25px 43px 0;
+}
+.time p i {
+  margin: 0 15px 0 0;
+}
+.organizer {
+  font-size: 50px;
+  color: #000;
+  text-align: center;
+  padding: 0 25px;
+  margin: 70px 0 100px 0;
+}
+.title {
+  font-size: 30px;
+  color: #000;
+  padding: 15px 25px;
+}
+.date {
+  font-size: 24px;
+  color: #000;
+  text-align: cener;
+  padding: 10px 25px;
+}
+.address {
+  font-size: 24px;
+  color: #000;
+  text-align: cener;
+  padding: 10px 25px;
+}
+</style>

+ 8 - 3
src/views/index/index.vue

@@ -47,7 +47,12 @@
         :unitlist="coopList"
         :footinfo="site"
         :rilitop="master.rilitop"
-      ></master>
+        :rightInfo="master.rightInfo"
+      >
+        <template #rili>
+          <self-calendars></self-calendars>
+        </template>
+      </master>
       <!--  :companylist="companylist" -->
     </el-row>
   </div>
@@ -58,7 +63,7 @@ import _ from 'lodash';
 import { jobMenu } from '@/config/jobs-menu';
 import master from '@publics/src/views/master/index/index.vue';
 import topMenu from '@/layout/layout-part/top-menu.vue';
-import selfCalendar from '@/components/self-calendar.vue';
+import selfCalendars from '@/components/self-calendars.vue';
 import pagesOne from '@publics/src/views/index.vue';
 //master部分
 import { masterInfo } from '@/config/master-info';
@@ -69,7 +74,7 @@ export default {
   components: {
     pagesOne,
     topMenu,
-    selfCalendar,
+    selfCalendars,
     master,
   },
   data: () => ({

+ 10 - 1
src/views/master/index/index.vue

@@ -21,7 +21,6 @@
       :teganglist="teganglist"
       :sanzhilist="sanzhilist"
       :cunguanlist="cunguanlist"
-      :rilitop="rilitop"
       :fasttop="fasttop"
       :fastlist="fastlist"
       :contactinfo="contactinfo"
@@ -30,20 +29,30 @@
       :unittop="unittop"
       :unitlist="unitlist"
       :footinfo="footinfo"
+      :rilitop="rilitop"
+      :rightInfo="rightInfo"
     >
+      <template #rili>
+        <self-calendar></self-calendar>
+      </template>
+      <template #rilitop></template>
     </indexDetail>
   </div>
 </template>
 
 <script>
 import indexDetail from '@publics/src/views/master/index/index.vue';
+import selfCalendar from '@/components/self-calendar.vue';
 export default {
   name: 'index',
   props: {},
   components: {
     indexDetail,
+    selfCalendar,
   },
   data: () => ({
+    user: 'master',
+    loading: true,
     topinfo: {
       logo: require('@/assets/master/masterlogo.png'),
       title: '长春工业大学就业信息网',

+ 1 - 1
src/views/master/style.vue

@@ -98,7 +98,7 @@ export default {
   height: 0;
   border-width: 10px;
   border-style: solid;
-  border-color: #ccc #ccc #ccc #008000;
+  border-color: #ccc red #ccc #008000;
 }
 .right-image {
   text-align: right;