From 28ebe609e47b28794450cefc72d3e0f62fd904e7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 09 五月 2022 01:04:19 +0800
Subject: [PATCH] 2022-05-09

---
 src/templates/sharecomponent/settingcomponent/index.jsx             |   21 +++---
 src/menu/components/share/actioncomponent/actionform/index.jsx      |    8 ++
 src/templates/sharecomponent/actioncomponent/index.jsx              |   10 ++-
 src/templates/zshare/createinterface/index.jsx                      |    4 
 src/menu/components/card/cardcellcomponent/index.jsx                |    6 +
 src/templates/sharecomponent/settingcomponent/settingform/index.jsx |   51 ++++------------
 src/templates/formtabconfig/index.jsx                               |    8 --
 src/templates/sharecomponent/actioncomponent/actionform/index.jsx   |    9 ++
 src/tabviews/zshare/actionList/funcMegvii/index.jsx                 |    4 -
 src/menu/components/share/actioncomponent/index.jsx                 |    9 +-
 src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx |    2 
 11 files changed, 60 insertions(+), 72 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx
index dbe882a..c88cf52 100644
--- a/src/menu/components/card/cardcellcomponent/index.jsx
+++ b/src/menu/components/card/cardcellcomponent/index.jsx
@@ -12,6 +12,7 @@
 import MKEmitter from '@/utils/events.js'
 import MenuUtils from '@/utils/utils-custom.js'
 import ElementForm from './elementform'
+import CreateFunc from '@/templates/zshare/createfunc'
 import DragElement from './dragaction'
 import './index.scss'
 
@@ -41,6 +42,7 @@
     visible: false,      // 妯℃�佹鎺у埗
     actvisible: false,   // 鎸夐挳缂栬緫妯℃�佹
     profVisible: false,  // 楠岃瘉淇℃伅缂栬緫
+    record: null
   }
 
   /**
@@ -627,7 +629,7 @@
 
   render() {
     const { cards, cardCell } = this.props
-    const { elements, visible, actvisible, profVisible, card, dict } = this.state
+    const { elements, visible, actvisible, profVisible, card, dict, record } = this.state
 
     return (
       <div className="model-menu-card-cell-list">
@@ -672,6 +674,7 @@
             maskClosable={false}
             onCancel={this.editModalCancel}
             footer={[
+              record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null,
               <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>,
               <Button key="confirm" type="primary" onClick={this.handleActionSubmit}>{dict['model.confirm']}</Button>
             ]}
@@ -684,6 +687,7 @@
               formlist={this.state.formlist}
               inputSubmit={this.handleActionSubmit}
               setting={cards.setting}
+              updRecord={(record) => this.setState({record: fromJS(record).toJS()})}
               wrappedComponentRef={(inst) => this.actionFormRef = inst}
             />
           </Modal>
diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index 7e218b0..10f04ea 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -30,7 +30,8 @@
     setting: PropTypes.object,   // 椤甸潰璁剧疆
     formlist: PropTypes.any,     // 琛ㄥ崟淇℃伅
     card: PropTypes.any,         // 鎸夐挳淇℃伅
-    inputSubmit: PropTypes.any   // 鍥炶溅鎻愪氦浜嬩欢
+    inputSubmit: PropTypes.func, // 鍥炶溅鎻愪氦浜嬩欢
+    updRecord: PropTypes.func    // 鏇存柊淇℃伅
   }
 
   state = {
@@ -140,6 +141,7 @@
         }
       }, 100)
     }
+    this.props.updRecord && this.props.updRecord(this.record)
   }
 
   getMutilOptions = (requireOptions) => {
@@ -489,6 +491,8 @@
         this.record.control = ''
         _fieldval.control = ''
       }
+
+      this.props.updRecord && this.props.updRecord(this.record)
     } else if (key === 'funcType') {
       if (value === 'print') {
         _fieldval.label = '鎵撳嵃'
@@ -553,6 +557,8 @@
       }
     } else if (key === 'intertype') {
       this.record.sysInterface = 'false'
+      
+      this.props.updRecord && this.props.updRecord(this.record)
     } else if (key === 'sysInterface') {
       if (value === 'true') {
         _fieldval.interface = window.GLOB.mainSystemApi || ''
diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx
index de91452..e215195 100644
--- a/src/menu/components/share/actioncomponent/index.jsx
+++ b/src/menu/components/share/actioncomponent/index.jsx
@@ -38,7 +38,8 @@
     formlist: null,      // 琛ㄥ崟淇℃伅
     actionlist: null,    // 鎸夐挳缁�
     visible: false,      // 妯℃�佹鎺у埗
-    profVisible: false   // 楠岃瘉淇℃伅妯℃�佹
+    profVisible: false,  // 楠岃瘉淇℃伅妯℃�佹
+    record: null
   }
 
   /**
@@ -494,7 +495,7 @@
 
   render() {
     const { config, type } = this.props
-    const { actionlist, visible, appType, card, dict, profVisible } = this.state
+    const { actionlist, visible, appType, card, dict, profVisible, record } = this.state
 
     return (
       <div className={'model-menu-action-list'}>
@@ -511,14 +512,13 @@
         />
         {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */}
         <Modal
-          // title={dict['model.action'] + '-' + (card && card.copyType === 'action' ? dict['model.copy'] : dict['model.edit'])}
           title="鎸夐挳路缂栬緫"
           visible={visible}
           width={850}
           maskClosable={false}
           onCancel={this.editModalCancel}
           footer={[
-            <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/>,
+            record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null,
             <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>,
             <Button key="confirm" type="primary" onClick={this.handleSubmit}>{dict['model.confirm']}</Button>
           ]}
@@ -530,6 +530,7 @@
             formlist={this.state.formlist}
             inputSubmit={this.handleSubmit}
             setting={config.setting}
+            updRecord={(record) => this.setState({record: fromJS(record).toJS()})}
             wrappedComponentRef={(inst) => this.actionFormRef = inst}
           />
         </Modal>
diff --git a/src/tabviews/zshare/actionList/funcMegvii/index.jsx b/src/tabviews/zshare/actionList/funcMegvii/index.jsx
index 42a12e9..a8c9643 100644
--- a/src/tabviews/zshare/actionList/funcMegvii/index.jsx
+++ b/src/tabviews/zshare/actionList/funcMegvii/index.jsx
@@ -233,7 +233,7 @@
             id: item.id || '',
             card_number: item.card_number || '',
             person_code: item.person_code || '',
-            group_list: item.group_list ? item.group_list.split(',') : [],
+            group_list: item.group_list ? item.group_list.split(',') : [1],
             password: item.password || '',
             id_number: item.id_number || '',
             face_list: [{
@@ -262,8 +262,6 @@
       error = '浜哄憳鍚嶇О涓嶅彲涓虹┖'
     } else if (!data.id) {
       error = '浜哄憳id涓嶅彲涓虹┖'
-    } else if (data.group_list.length === 0) {
-      error = '浜哄憳鍒嗙粍涓嶅彲涓虹┖'
     } else if (!data.face_list[0].data) {
       error = '浜哄憳鍥剧墖涓嶅彲涓虹┖'
     } else if (data.password) {
diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx
index 317f850..a13d249 100644
--- a/src/templates/formtabconfig/index.jsx
+++ b/src/templates/formtabconfig/index.jsx
@@ -756,13 +756,7 @@
       let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
       let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc))          // 鍒犻櫎瀛樺偍杩囩▼sql
 
-      this.refs.tableCreatFunc.exec(setting.innerFunc, newLText, DelText).then(result => {
-        if (result === 'success') {
-          this.setState({
-            config: _config
-          })
-        }
-      })
+      this.refs.tableCreatFunc.exec(setting.innerFunc, newLText, DelText)
     })
   }
 
diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx
index 66d820d..dfc113a 100644
--- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx
@@ -30,7 +30,8 @@
     setting: PropTypes.object,   // 椤甸潰璁剧疆
     formlist: PropTypes.any,     // 琛ㄥ崟淇℃伅
     card: PropTypes.any,         // 鎸夐挳淇℃伅
-    inputSubmit: PropTypes.any   // 鍥炶溅鎻愪氦浜嬩欢
+    inputSubmit: PropTypes.func, // 鍥炶溅鎻愪氦浜嬩欢
+    updRecord: PropTypes.func
   }
 
   state = {
@@ -126,6 +127,8 @@
         console.warn('琛ㄥ崟focus澶辫触锛�')
       }
     }
+
+    this.props.updRecord && this.props.updRecord(this.record)
   }
 
   getMutilOptions = () => {
@@ -385,6 +388,8 @@
       if (!['funcbutton', 'excelIn', 'excelOut'].includes(value)) {
         _fieldval.position = 'toolbar'
       }
+
+      this.props.updRecord && this.props.updRecord(this.record)
     } else if (key === 'position') {
       if (value === 'grid') {
         _fieldval.Ot = 'requiredSgl'
@@ -439,6 +444,8 @@
       }
     } else if (key === 'intertype') {
       this.record.sysInterface = 'false'
+
+      this.props.updRecord && this.props.updRecord(this.record)
     } else if (key === 'sysInterface') {
       if (value === 'true') {
         _fieldval.interface = window.GLOB.mainSystemApi || ''
diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx
index da66039..9f3c992 100644
--- a/src/templates/sharecomponent/actioncomponent/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/index.jsx
@@ -45,7 +45,8 @@
     copying: false,      // 鎸夐挳澶嶅埗涓�
     visible: false,      // 妯℃�佹鎺у埗
     printTemps: [],      // 鍗曟嵁鎵撳嵃妯℃澘
-    profVisible: false   // 楠岃瘉淇℃伅妯℃�佹
+    profVisible: false,  // 楠岃瘉淇℃伅妯℃�佹
+    record: null
   }
 
   /**
@@ -906,7 +907,7 @@
 
   render() {
     const { config } = this.props
-    const { actionlist, visible, card, dict, copying, profVisible } = this.state
+    const { actionlist, visible, card, dict, copying, profVisible, record } = this.state
 
     return (
       <div className="model-table-action-list" style={config.charts.length > 1 ? {paddingTop: 25} : null}>
@@ -931,8 +932,8 @@
           maskClosable={false}
           onCancel={this.editModalCancel}
           footer={[
-            <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/>,
-            <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/>,
+            record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null,
+            record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null,
             <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>,
             <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>{dict['model.confirm']}</Button>
           ]}
@@ -944,6 +945,7 @@
             formlist={this.state.formlist}
             inputSubmit={this.handleSubmit}
             setting={config.setting}
+            updRecord={(record) => this.setState({record: fromJS(record).toJS()})}
             wrappedComponentRef={(inst) => this.actionFormRef = inst}
           />
         </Modal>
diff --git a/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx b/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx
index 66780c3..4e65b0c 100644
--- a/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifymegvii/index.jsx
@@ -47,8 +47,8 @@
     excelData: [
       {field: 'id', datatype: 'string', type: 'nvarchar(50)', required: '蹇呴』', remark: '浜哄憳id'},
       {field: 'person_name', datatype: 'string', type: 'nvarchar(50)', required: '蹇呴』', remark: '浜哄憳鍚嶇О'},
-      {field: 'group_list', datatype: 'string', type: 'nvarchar(50)', required: '蹇呴』', remark: '缁戝畾浜哄憳缁勭殑鍒楄〃锛屽涓娇鐢ㄩ�楀彿鍒嗛殧锛岀ず渚嬶細\'1,2\''},
       {field: 'face_data', datatype: 'string', type: 'text', required: '蹇呴』', remark: 'Base64缂栫爜鐨勭収鐗囨暟鎹紙浜鸿劯淇℃伅锛�'},
+      {field: 'group_list', datatype: 'string', type: 'nvarchar(50)', required: '闈炲繀椤�', remark: '缁戝畾浜哄憳缁勭殑鍒楄〃锛屽涓娇鐢ㄩ�楀彿鍒嗛殧锛岀ず渚嬶細\'1,2\''},
       {field: 'face_idx', datatype: 'integer', type: 'int', required: '闈炲繀椤�', remark: '鐓х墖绱㈠紩锛岄粯璁や负0'},
       {field: 'is_admin', datatype: 'string', type: 'nvarchar(50)', required: '闈炲繀椤�', remark: '鏄惁鍚敤绠$悊鍛樻潈闄愶紝榛樿涓篭'false\''},
       {field: 'recognition_type', datatype: 'string', type: 'nvarchar(50)', required: '闈炲繀椤�', remark: '浜哄憳绫诲瀷锛宻taff 鈥� 鏅�氫汉鍛橈紙榛樿锛夛紝visitor 鈥� 璁垮锛宐lacklist 鈥� 榛戝悕鍗�'},
diff --git a/src/templates/sharecomponent/settingcomponent/index.jsx b/src/templates/sharecomponent/settingcomponent/index.jsx
index eaf65ba..51f4216 100644
--- a/src/templates/sharecomponent/settingcomponent/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/index.jsx
@@ -28,7 +28,9 @@
     search: null,        // 鎼滅储鏉′欢锛屽寘鎷富琛ㄦ悳绱�
     formlist: null,      // 琛ㄥ崟淇℃伅
     visible: false,      // 妯℃�佹鎺у埗
-    loading: false       // 璁剧疆淇℃伅楠岃瘉淇濆瓨涓�
+    loading: false,      // 璁剧疆淇℃伅楠岃瘉淇濆瓨涓�
+    record: null
+    
   }
 
   /**
@@ -84,17 +86,13 @@
     const { config } = this.props
     const { menu } = this.state
 
-    this.settingRef.handleConfirm('func').then(setting => {
+    this.settingRef.handleConfirm('loading').then(setting => {
       let res = this.resetSetting(setting)
       let _config = {...config, setting: res}
       let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
       let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc))          // 鍒犻櫎瀛樺偍杩囩▼sql
 
-      this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText).then(result => {
-        if (result === 'success') {
-          this.props.updatesetting(_config)
-        }
-      })
+      this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText)
     })
   }
 
@@ -105,7 +103,7 @@
     const { config } = this.props
     const { menu } = this.state
 
-    this.settingRef.handleConfirm('interface').then(setting => {
+    this.settingRef.handleConfirm('loading').then(setting => {
       let res = this.resetSetting(setting)
       let _config = {...config, setting: res}
       let _menu = {
@@ -169,7 +167,7 @@
 
   render() {
     const { config } = this.props
-    const { dict, visible, search, menu } = this.state
+    const { dict, visible, search, menu, record } = this.state
 
     return (
       <div className="model-menu-setting">
@@ -183,8 +181,8 @@
           maskClosable={false}
           onCancel={() => { this.setState({ visible: false, loading: false })}}
           footer={[
-            <CreateInterface key="interface" loading={this.state.interloading} dict={dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>,
-            <CreateFunc key="create" dict={dict} ref="funcCreatComponent" trigger={this.tableCreatFunc}/>,
+            record && record.interType === 'system' ? <CreateInterface key="interface" loading={this.state.interloading} dict={dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/> : null,
+            record && record.interType === 'inner' ? <CreateFunc key="create" dict={dict} ref="funcCreatComponent" trigger={this.tableCreatFunc}/> : null,
             <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>{this.state.dict['model.cancel']}</Button>,
             <Button key="confirm" type="primary" loading={this.state.loading} onClick={this.settingSave}>{this.state.dict['model.confirm']}</Button>
           ]}
@@ -195,6 +193,7 @@
             menu={menu}
             config={config}
             search={search}
+            updRecord={(record) => this.setState({record: fromJS(record).toJS()})}
             wrappedComponentRef={(inst) => this.settingRef = inst}
           />
         </Modal>
diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx
index 6ef30e6..b60fc7f 100644
--- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -20,7 +20,8 @@
     dict: PropTypes.object,         // 瀛楀吀椤�
     menu: PropTypes.object,         // 鑿滃崟淇℃伅
     config: PropTypes.object,       // 椤甸潰閰嶇疆淇℃伅
-    search: PropTypes.array         // 鎼滅储鏉′欢
+    search: PropTypes.array,        // 鎼滅储鏉′欢
+    updRecord: PropTypes.func
   }
 
   state = {
@@ -126,6 +127,10 @@
       cbScripts: _cbScripts,
       status
     })
+  }
+
+  componentDidMount () {
+    this.props.updRecord(this.state.status)
   }
 
   getRegOptions = (searches) => {
@@ -257,26 +262,6 @@
     if (activeKey === 'setting') {
       return new Promise((resolve, reject) => {
         this.settingForm.handleConfirm().then(res => {
-          if (trigger === 'func' && res.interType !== 'inner') {
-            notification.warning({
-              top: 92,
-              message: '浣跨敤鍐呴儴鎺ュ彛锛屾墠鍙互鍒涘缓瀛樺偍杩囩▼锛�',
-              duration: 5
-            })
-            this.setState({loading: false})
-            reject()
-            return
-          } else if (trigger === 'interface' && res.interType !== 'system') {
-            notification.warning({
-              top: 92,
-              message: '浣跨敤绯荤粺鎺ュ彛鏃讹紝鎵嶅彲浠ュ垱寤烘帴鍙o紒',
-              duration: 5
-            })
-            this.setState({loading: false})
-            reject()
-            return
-          }
-
           this.setState({
             setting: res
           }, () => {
@@ -295,23 +280,13 @@
       })
     } else if (activeKey === 'scripts') {
       return new Promise((resolve, reject) => {
-        if (trigger === 'func' && setting.interType !== 'inner') {
-          notification.warning({
-            top: 92,
-            message: '浣跨敤鍐呴儴鎺ュ彛锛屾墠鍙互鍒涘缓瀛樺偍杩囩▼锛�',
-            duration: 5
-          })
+        this.sqlverify(() => {
+          this.setState({loading: false})
+          resolve({...setting, scripts, preScripts, cbScripts})
+        }, () => {
           this.setState({loading: false})
           reject()
-        } else {
-          this.sqlverify(() => {
-            this.setState({loading: false})
-            resolve({...setting, scripts, preScripts, cbScripts})
-          }, () => {
-            this.setState({loading: false})
-            reject()
-          }, 'submit')
-        }
+        }, 'submit')
       })
     } else {
       this.setState({loading: false})
@@ -519,7 +494,9 @@
   }
 
   updateStatus = (status) => {
-    this.setState({status: {...this.state.status, ...status}})
+    let _status = {...this.state.status, ...status}
+    this.setState({status: _status})
+    this.props.updRecord(_status)
   }
 
   render() {
diff --git a/src/templates/zshare/createinterface/index.jsx b/src/templates/zshare/createinterface/index.jsx
index 275251a..4156e22 100644
--- a/src/templates/zshare/createinterface/index.jsx
+++ b/src/templates/zshare/createinterface/index.jsx
@@ -11,7 +11,7 @@
 import Api from '@/api'
 import './index.scss'
 
-class CreateFunc extends Component {
+class CreateInterface extends Component {
   static propTypes = {
     dict: PropTypes.object,  // 瀛楀吀椤�
     trigger: PropTypes.func
@@ -1135,4 +1135,4 @@
   }
 }
 
-export default CreateFunc
+export default CreateInterface

--
Gitblit v1.8.0