From 42fae277ae5ebe794fc070bf38482a919eb661fc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 25 十一月 2020 14:36:02 +0800
Subject: [PATCH] 2020-11-25

---
 src/templates/formtabconfig/index.jsx |   36 ++++++++++++++++--------------------
 1 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx
index 627a566..6ccf8df 100644
--- a/src/templates/formtabconfig/index.jsx
+++ b/src/templates/formtabconfig/index.jsx
@@ -478,21 +478,10 @@
       })
     }
 
-    let roleList = []
-    if (this.props.sysRoles && this.props.sysRoles.length > 0) {
-      roleList = this.props.sysRoles.map(role => {
-        return {
-          uuid: role.uuid,
-          field: role.value,
-          label: role.text
-        }
-      })
-    }
-
     this.setState({
       modaltype: 'search',
       card: card,
-      formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false, roleList).map(item => {
+      formlist: getModalForm(card, _inputfields, _linkableFields, _linksupFields, false).map(item => {
         if (item.key === 'type') {
           item.options = item.options.filter(option => !['switch', 'checkbox', 'radio', 'checkcard', 'hint'].includes(option.value))
         }
@@ -502,7 +491,18 @@
   }
 
   handleAction = (card) => {
-    let ableField = this.props.permFuncField.join(', ')
+    let usefulFields = sessionStorage.getItem('permFuncField')
+    if (usefulFields) {
+      try {
+        usefulFields = JSON.parse(usefulFields)
+      } catch {
+        usefulFields = []
+      }
+    } else {
+      usefulFields = []
+    }
+
+    let ableField = usefulFields.join(', ')
     let functip = <div>
       <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p>
       <p>{this.state.dict['model.tooltip.func.outface']}</p>
@@ -511,7 +511,7 @@
     this.setState({
       modaltype: 'actionEdit',
       card: card,
-      formlist: getActionForm(card, functip, this.state.config, this.props.permFuncField)
+      formlist: getActionForm(card, functip, this.state.config, usefulFields)
     })
   }
 
@@ -2073,7 +2073,6 @@
             menu={this.props.menu}
             config={this.state.config}
             inputSubmit={this.settingSave}
-            usefulFields={this.props.permFuncField}
             wrappedComponentRef={(inst) => this.settingRef = inst}
           />
         </Modal>
@@ -2130,11 +2129,8 @@
   }
 }
 
-const mapStateToProps = (state) => {
-  return {
-    sysRoles: state.sysRoles,
-    permFuncField: state.permFuncField
-  }
+const mapStateToProps = () => {
+  return {}
 }
 
 const mapDispatchToProps = () => {

--
Gitblit v1.8.0