瀏覽代碼

待办事项移至主页

lrf402788946 5 年之前
父節點
當前提交
b177bbf258
共有 2 個文件被更改,包括 41 次插入13 次删除
  1. 8 8
      src/layout/layout-part/heads.vue
  2. 33 5
      src/views/home/index.vue

+ 8 - 8
src/layout/layout-part/heads.vue

@@ -9,7 +9,7 @@
         <h3 class="headCompany">{{ user.corpname }}</h3>
       </div>
       <div class="headBtn">
-        <notice :list="noticeList" :total="total" @delete="noticeDelete"></notice>
+        <!-- <notice :list="noticeList" :total="total" @delete="noticeDelete"></notice> -->
         <!-- <span class="mr14">|</span> -->
         <!-- <a href="" class="mr14" style="color:red" title="云校招企业服务平台简明使用手册"> <span class="el-icon-question info_icon"></span> 帮助 </a> -->
         <span class="mr14">|</span>
@@ -45,14 +45,14 @@
 </template>
 
 <script>
-import notice from '@publics/src/components/notice.vue';
+// import notice from '@publics/src/components/notice.vue';
 import { mapActions, mapState, mapMutations } from 'vuex';
 const jwt = require('jsonwebtoken');
 export default {
   name: 'heads',
   props: {},
   components: {
-    notice,
+    // notice,
   },
   data: () => ({
     dialog: false,
@@ -70,11 +70,11 @@ export default {
     this.check();
   },
   watch: {
-    $route: {
-      handler(val) {
-        this.getNoticeList();
-      },
-    },
+    // $route: {
+    //   handler(val) {
+    //     this.getNoticeList();
+    //   },
+    // },
   },
   computed: {
     ...mapState(['user']),

+ 33 - 5
src/views/home/index.vue

@@ -67,6 +67,23 @@
         </ul>
       </el-col>
     </el-row>
+    <el-row class="homeMessage" style="margin-bottom:1rem;">
+      <el-col class="homeResTop">
+        <h4>待办事项</h4>
+        <a href=""></a>
+      </el-col>
+      <ul class="homeMessageMain">
+        <li v-for="(item, index) in noticeList" :key="index">
+          <el-col class="MessageMainTit text-owt"> {{ item.name }} {{ item.content }} </el-col>
+          <el-col class="MessageMainDay text-owt">
+            <el-link type="primary" @click="handleDelete(item.id)">[不再提示]</el-link>
+          </el-col>
+        </li>
+        <li v-if="noticeList.length <= 0">
+          <el-col :span="24" style="text-align:center">暂无待办事项</el-col>
+        </li>
+      </ul>
+    </el-row>
     <el-row class="homeRes">
       <el-col class="homeResTop">
         <h4>最新简历</h4>
@@ -96,7 +113,7 @@
         </li>
       </ul>
     </el-row>
-    <el-row class="homeMessage">
+    <el-row class="homeMessage" style="margin-bottom:1rem">
       <el-col class="homeResTop">
         <h4>系统消息</h4>
         <a href=""></a>
@@ -123,9 +140,6 @@ import resumes from '@publics/src/views/resume.vue';
 import { mapActions, mapState } from 'vuex';
 export default {
   name: 'home',
-  // metaInfo: {
-  //   title: '企业主页',
-  // },
   components: {
     resumes,
   },
@@ -146,15 +160,17 @@ export default {
       { message: '【在线招聘】您申请的在线招聘:"fffffff,已通过审批', day: '2019-07-02 16:05' },
     ],
     info: {},
+    noticeList: [],
   }),
   created() {
     this.search();
+    this.getNoticeList();
   },
   computed: {
     ...mapState(['user']),
   },
   methods: {
-    ...mapActions(['resumesOperation', 'lettersOperation', 'corpSchInfo', 'postOperation', 'stucorpOperation']),
+    ...mapActions(['resumesOperation', 'lettersOperation', 'corpSchInfo', 'postOperation', 'stucorpOperation', 'noticeOperation']),
     async search(searchInfo) {
       //1直接拿着参数发送请求
       let result = await this.lettersOperation({ type: 'list', data: { corpname: this.user.corpname } });
@@ -206,6 +222,18 @@ export default {
         this.resumeDialog = true;
       }
     },
+    async getNoticeList() {
+      let result = await this.noticeOperation({ type: 'list', data: { userid: this.user.corpid, type: 1 } });
+      if (`${result.errcode}` === '0') {
+        this.$set(this, `noticeList`, result.data ? result.data : []);
+      }
+    },
+    async noticeDelete(id) {
+      let result = await this.noticeOperation({ type: 'delete', data: { id: id } });
+      if (`${result.errcode}` === '0') {
+        this.getNoticeList();
+      }
+    },
   },
 };
 </script>