Sfoglia il codice sorgente

修改待办事项至主页

lrf402788946 5 anni fa
parent
commit
185c4c369d
2 ha cambiato i file con 62 aggiunte e 10 eliminazioni
  1. 8 8
      src/layout/layout-part/heads.vue
  2. 54 2
      src/views/home/index.vue

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

@@ -8,7 +8,7 @@
         <h3 class="headCompany">学生管理</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 class="mr14" style="color:red"> <span class="el-icon-question info_icon"></span> 帮助 </a> -->
         <span class="mr14">|</span>
@@ -46,14 +46,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: () => ({
     visible: false,
@@ -71,11 +71,11 @@ export default {
     this.check();
   },
   watch: {
-    $route: {
-      handler(val) {
-        this.getNoticeList();
-      },
-    },
+    // $route: {
+    //   handler(val) {
+    //     this.getNoticeList();
+    //   },
+    // },
   },
   computed: {
     ...mapState(['user']),

+ 54 - 2
src/views/home/index.vue

@@ -45,6 +45,25 @@
           </el-col>
         </el-col>
       </el-col>
+      <el-col class="main">
+        <el-col class="line">待办事项</el-col>
+        <el-card size="mini">
+          <el-col class="newest">
+            <el-table :data="noticeList" border :max-height="200">
+              <el-table-column width="700">
+                <template slot-scope="scoped">
+                  {{ scoped.row.name }} {{ scoped.row.content }}
+                </template>
+              </el-table-column>
+              <el-table-column align="center">
+                <template slot-scope="scoped">
+                  <el-link type="primary" @click="handleDelete(scoped.row.id)">[不再提示]</el-link>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-col>
+        </el-card>
+      </el-col>
       <el-col class="main">
         <el-col class="line">求职招聘</el-col>
         <el-col class="newest">
@@ -104,6 +123,8 @@
 
 <script>
 import formItem from '@/components/form-item.vue';
+import { mapActions, mapState, mapMutations } from 'vuex';
+
 export default {
   name: 'index',
   props: {},
@@ -122,14 +143,45 @@ export default {
     tableDataSch: [],
     tableDataSign: [],
     tableDataWhe: [],
+    noticeList: [
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+      { name: '测试企业', content: '刚刚添加一条测试信息' },
+    ],
   }),
-  created() {},
+  created() {
+    this.getNoticeList();
+  },
   computed: {},
-  methods: {},
+  methods: {
+    ...mapActions(['noticeOperation']),
+    async getNoticeList() {
+      let result = await this.noticeOperation({ type: 'list', data: { userid: this.user.corpid, type: 3 } });
+      if (`${result.errcode}` === '0') {
+        this.$set(this, `total`, result.total);
+        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>
 
 <style lang="less" scoped>
+/deep/.has-gutter {
+  display: none;
+}
 ul {
   margin: 0;
   padding: 0;