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/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx b/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx
index 913df71..da7e7b1 100644
--- a/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx
+++ b/src/templates/sharecomponent/settingcalcomponent/verifycard/settingform/index.jsx
@@ -13,7 +13,6 @@
   static propTpyes = {
     dict: PropTypes.object,       // 瀛楀吀椤�
     menuId: PropTypes.string,     // 鑿滃崟Id
-    permFuncField: PropTypes.any, // 鑿滃崟Id
     setting: PropTypes.object,    // 鏁版嵁婧愰厤缃�
     columns: PropTypes.array,     // 鍒楄缃�
     scripts: PropTypes.array,     // 鑷畾涔夎剼鏈�
@@ -21,6 +20,24 @@
 
   state = {
     interType: this.props.setting.interType || 'system',
+    usefulFields: []
+  }
+
+  UNSAFE_componentWillMount() {
+    let usefulFields = sessionStorage.getItem('permFuncField')
+    if (usefulFields) {
+      try {
+        usefulFields = JSON.parse(usefulFields)
+      } catch {
+        usefulFields = []
+      }
+    } else {
+      usefulFields = []
+    }
+
+    this.setState({
+      usefulFields
+    })
   }
 
   handleConfirm = () => {
@@ -123,9 +140,9 @@
   }
 
   render() {
-    const { setting, permFuncField } = this.props
+    const { setting } = this.props
     const { getFieldDecorator } = this.props.form
-    const { interType } = this.state
+    const { interType, usefulFields } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -141,9 +158,9 @@
     let tooltip = null
     let rules = []
 
-    if (permFuncField && permFuncField.length > 0) {
-      tooltip = '寮�澶村彲鐢ㄥ瓧绗︼細' + permFuncField.join(', ')
-      let str = '^(' + permFuncField.join('|') + ')'
+    if (usefulFields.length > 0) {
+      tooltip = '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', ')
+      let str = '^(' + usefulFields.join('|') + ')'
       let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
 
       rules.push({

--
Gitblit v1.8.0