From d441fa1e1cc80f4ea462a750a42a2b25c1f2b202 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 04 十二月 2020 15:17:51 +0800
Subject: [PATCH] 2020-12-04

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   23 ++++++-----------------
 1 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 8570727..fbaec64 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1052,6 +1052,7 @@
           })
           this.updateStatus('over')
         } else {
+          let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID
           if (_LongParam.groups.length > 0) {
             _LongParam.groups.forEach(group => {
               group.sublist = group.sublist.map(cell => {
@@ -1059,7 +1060,7 @@
                 if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') {
                   let _option = Utils.getSelectQueryOptions(cell)
 
-                  if (this.props.dataManager) { // 鏁版嵁鏉冮檺
+                  if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
                     _option.sql = _option.sql.replace(/\$@/ig, '/*')
                     _option.sql = _option.sql.replace(/@\$/ig, '*/')
                   } else {
@@ -1077,12 +1078,7 @@
 
                 // 瀛楁鏉冮檺榛戝悕鍗�
                 if (!cell.blacklist || cell.blacklist.length === 0) return cell
-
-                let _black = cell.blacklist.filter(v => {
-                  return this.props.permRoles.indexOf(v) !== -1
-                })
-
-                if (_black.length > 0) {
+                if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
                   cell.hidden = 'true'
                 }
 
@@ -1095,7 +1091,7 @@
               if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') {
                 let _option = Utils.getSelectQueryOptions(cell)
 
-                if (this.props.dataManager) { // 鏁版嵁鏉冮檺
+                if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
                   _option.sql = _option.sql.replace(/\$@/ig, '/*')
                   _option.sql = _option.sql.replace(/@\$/ig, '*/')
                 } else {
@@ -1109,12 +1105,7 @@
 
               // 瀛楁鏉冮檺榛戝悕鍗�
               if (!cell.blacklist || cell.blacklist.length === 0) return cell
-
-              let _black = cell.blacklist.filter(v => {
-                return this.props.permRoles.indexOf(v) !== -1
-              })
-
-              if (_black.length > 0) {
+              if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
                 cell.hidden = 'true'
               }
 
@@ -1302,9 +1293,7 @@
 const mapStateToProps = (state) => {
   return {
     tabviews: state.tabviews,
-    menuType: state.editLevel,
-    permRoles: state.permRoles,
-    dataManager: state.dataManager
+    menuType: state.editLevel
   }
 }
 

--
Gitblit v1.8.0