Эх сурвалжийг харах

Merge branch 'master' of http://106.55.241.82:3000/lzf/zhbsq-vue-web

Sanmu8 1 жил өмнө
parent
commit
d777c527ff

+ 10 - 0
src/layout/components/HeaderNotice.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 查询咨询信息列表
+export function listByusers(id) {
+  return request({
+    url: '/actionTask/queryBy',
+    method: 'get',
+    data: id
+  })
+}

+ 56 - 13
src/layout/components/HeaderNotice.vue

@@ -1,30 +1,73 @@
 <template>
-  <el-popover
-    placement="bottom"
-    title="标题"
-    width="200"
-    trigger="click"
-    content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
-  >
-    <el-button slot="reference">待开发</el-button>
-  </el-popover>
+  <div>
+<!--    <el-badge :value="this.listByusers" class="item" :max="99">-->
+<!--    <el-popover-->
+<!--      placement="bottom"-->
+<!--      width="200"-->
+<!--      trigger="hover">-->
+<!--      <el-table :data="gridData">-->
+<!--        <el-table-column property="name" label="姓名"></el-table-column>-->
+<!--      </el-table>-->
+<!--      <i style="color: white"  class="el-icon-bell"  slot="reference"></i>-->
+<!--    </el-popover>-->
+<!--    </el-badge>-->
+    <el-badge :value="this.listByusers" class="item" :max="99">
+      <router-link to="task/task">
+        <i class="el-icon-bell" style="color: white"></i>
+      </router-link>
+    </el-badge>
+  </div>
 </template>
 
 <script>
+import { mapGetters } from 'vuex';
+import { listByusers} from '@/layout/components/HeaderNotice';
+
 export default {
   name: "HeaderNotice",
   components: {},
+  computed: {
+    ...mapGetters(['userId']),
+  },
   data() {
     return {
+      listByusers:'',
       visible: false,
+    WfInstActionTaskVo:{
+        userId:200,
+      },
+      gridData: [{
+        date: '2016-05-02',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1518 弄'
+      }]
     };
   },
-  computed: {},
-  mounted() {},
-  methods: {},
+  created() {
+    this.getNotice();
+  },
+  mounted() {
+  },
+  methods: {
+    /** 查询待办信息 */
+    getNotice() {
+      this.loading = true;
+      let p = {
+        WfInstActionTaskVo:{
+          userId:200,
+        },
+      }
+      listByusers(p).then(response => {
+        this.listByusers = response;
+        this.loading = false;
+      });
+    },
+  },
 };
 </script>
 
 <style coped>
+.el-badge__content{
+  margin-top: 12px;
+}
 </style>
- 

+ 1 - 0
src/store/getters.js

@@ -8,6 +8,7 @@ const getters = {
   token: state => state.user.token,
   avatar: state => state.user.avatar,
   name: state => state.user.name,
+  userId: state => state.user.userId,
   introduction: state => state.user.introduction,
   roles: state => state.user.roles,
   permissions: state => state.user.permissions,

+ 6 - 1
src/store/modules/user.js

@@ -7,7 +7,8 @@ const user = {
     name: '',
     avatar: '',
     roles: [],
-    permissions: []
+    permissions: [],
+    userId:'',
   },
 
   mutations: {
@@ -25,6 +26,9 @@ const user = {
     },
     SET_PERMISSIONS: (state, permissions) => {
       state.permissions = permissions
+    },
+    SET_USERID: (state, userId) => {
+      state.userId = userId
     }
   },
 
@@ -60,6 +64,7 @@ const user = {
           }
           commit('SET_NAME', user.userName)
           commit('SET_AVATAR', avatar)
+          commit('SET_USERID', user.userId)
           resolve(res)
         }).catch(error => {
           reject(error)