Bladeren bron

[update] 首页周期事务提醒数据获取增加角色条件

cfort 2 jaren geleden
bovenliggende
commit
4acbe70a80
3 gewijzigde bestanden met toevoegingen van 5 en 3 verwijderingen
  1. 2 0
      src/store/getters.js
  2. 0 1
      src/store/modules/ibps/modules/licence.js
  3. 3 2
      src/views/system/dashboard/page.vue

+ 2 - 0
src/store/getters.js

@@ -4,6 +4,8 @@ export default {
     name: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.name : '', // 姓名
     status: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.status : '', // 用户状态
     org: state => state.ibps.user.info ? state.ibps.user.info.org : {}, // 用户部门信息
+    role: state => state.ibps.user.info ? state.ibps.user.info.role : [], // 用户角色信息
+    position: state => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.positions : '', // 用户部门信息
     isSuper: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.isSuper === 'Y' : false, // 是否超级管理员
     account: state => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.account : '', // 用户名
     regOpen: state => state.ibps.user.regOpen, // 注册状态

+ 0 - 1
src/store/modules/ibps/modules/licence.js

@@ -10,7 +10,6 @@ export default {
     },
     actions: {
         setLicence ({ commit }, data) {
-            console.log(data)
             commit('updateLicJson', data)
         }
     }

+ 3 - 2
src/views/system/dashboard/page.vue

@@ -525,8 +525,9 @@
                 }
             },
             getPeriodTask () {
-                const { userId } = this.$store.getters
-                const sql = `select * from t_zqswtxb where shi_fou_ti_xing_ = '是' and zhi_xing_ren_yuan like '%${userId}%' order by field(zhi_xing_zhou_qi_, '1次/天', '1次/周', '1次/月', '1次/季度', '1次/半年', '1次/年')`
+                const { userId, role = [] } = this.$store.getters
+                const roles = role.map(i => i.id)
+                const sql = `select * from t_zqswtxb where shi_fou_ti_xing_ = '是' and (zhi_xing_ren_yuan like '%${userId}%' or find_in_set(zhi_xing_jiao_se_, '${roles.join(',')}')) order by field(zhi_xing_zhou_qi_, '1次/天', '1次/周', '1次/月', '1次/季度', '1次/半年', '1次/年')`
                 this.$common.request('sql', sql).then(res => {
                     const { data = [] } = res.variables || {}
                     if (data.length) {