From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 十一月 2022 16:11:55 +0800
Subject: [PATCH] 2022-11-21

---
 src/menu/datasource/verifycard/settingform/index.jsx |  102 ++++++++++++++++++++++++++++++++-------------------
 1 files changed, 64 insertions(+), 38 deletions(-)

diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx
index 69041eb..923a39e 100644
--- a/src/menu/datasource/verifycard/settingform/index.jsx
+++ b/src/menu/datasource/verifycard/settingform/index.jsx
@@ -8,6 +8,7 @@
 import Utils from '@/utils/utils.js'
 import MenuUtils from '@/utils/utils-custom.js'
 import CodeMirror from '@/templates/zshare/codemirror'
+import KeyInterface from '@/components/keyInterface'
 import './index.scss'
 
 const { TextArea } = Input
@@ -16,7 +17,6 @@
   static propTpyes = {
     config: PropTypes.object,     // 缁勪欢閰嶇疆
     setting: PropTypes.object,    // 鏁版嵁婧愰厤缃�
-    modules: PropTypes.array,     // 鍙粦瀹氱殑涓婄骇缁勪欢
     columns: PropTypes.array,     // 鍒楄缃�
     scripts: PropTypes.array,     // 鑷畾涔夎剼鏈�
   }
@@ -26,13 +26,18 @@
     modules: [],
     innerRules: [],
     innertip: '',
-    appType: sessionStorage.getItem('appType')
+    ismain: false
   }
 
   UNSAFE_componentWillMount () {
     const { config, setting } = this.props
 
-    let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid) || []
+    let modules = MenuUtils.getSupModules(window.GLOB.customMenu.components, config.uuid, window.GLOB.customMenu.interfaces)
+    let ismain = false
+
+    if (window.GLOB.customMenu.Template === 'BaseTable') {
+      ismain = config.name === '涓昏〃'
+    }
 
     modules.unshift({
       value: 'empty',
@@ -69,20 +74,22 @@
     _setting.supModule = setting.supModule || []
     _setting.execute = setting.execute || 'true'
 
-    this.setState({modules, innerRules, innertip, setting: _setting})
+    if (_setting.supModule.length > 0 && _setting.supModule[0] !== 'empty') {
+      let has = MenuUtils.checkSupModules(modules, _setting.supModule.slice(-1)[0])
+      if (!has) {
+        _setting.supModule = []
+      }
+    }
+
+    this.setState({modules, innerRules, innertip, setting: _setting, ismain})
   }
 
   handleConfirm = () => {
-    const { appType } = this.state
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
           values.sync = values.sync || 'false'
-
-          if (appType === 'mob' && values.useMSearch === 'true') {
-            values.syncRefresh = 'true'
-          }
 
           // 鏁版嵁婧愬墠绔獙璇�
           if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) {
@@ -155,7 +162,7 @@
   render() {
     const { columns, config } = this.props
     const { getFieldDecorator } = this.props.form
-    const { setting, modules, innerRules, appType, innertip } = this.state
+    const { setting, modules, innerRules, innertip } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -225,19 +232,25 @@
               </Form.Item>
             </Col>
             {setting.interType === 'outer' ? <Col span={8}>
-              <Form.Item label="绯荤粺鎺ュ彛">
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="涓氬姟绯荤粺鎸囧悓涓�sso涓嬬殑鍏朵粬涓氬姟绯荤粺锛屽閮ㄧ郴缁熸寚涓嶅悓sso涓嬬殑鍏朵粬涓氬姟绯荤粺銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  绯荤粺绫诲瀷
+                </Tooltip>
+              }>
                 {getFieldDecorator('sysInterface', {
                   initialValue: setting.sysInterface,
                   rules: [
                     {
                       required: true,
-                      message: '璇烽�夋嫨鏄惁浣跨敤绯荤粺鎺ュ彛!'
+                      message: '璇烽�夋嫨绯荤粺绫诲瀷!'
                     }
                   ]
                 })(
                 <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'sysInterface')}}>
-                  <Radio value="true">鏄�</Radio>
-                  <Radio value="false">鍚�</Radio>
+                  <Radio value="false">涓氬姟</Radio>
+                  <Radio value="true">鍗曠偣</Radio>
+                  <Radio value="external">澶栭儴</Radio>
                 </Radio.Group>)}
               </Form.Item>
             </Col> : null}
@@ -260,7 +273,7 @@
                 })(<Input placeholder={''} autoComplete="off" />)}
               </Form.Item>
             </Col> : null}
-            {setting.interType === 'outer' ? <Col className="outer-interface" span={24}>
+            {setting.interType === 'outer' && setting.sysInterface !== 'external' ? <Col className="outer-interface" span={24}>
               <Form.Item label="鎺ュ彛鍦板潃">
                 {getFieldDecorator('interface', {
                   initialValue: setting.interface || (setting.sysInterface === 'true' ? window.GLOB.mainSystemApi : ''),
@@ -273,8 +286,21 @@
                 })(<TextArea rows={2} readOnly={setting.sysInterface === 'true'}/>)}
               </Form.Item>
             </Col> : null}
-            {setting.interType === 'outer' && setting.sysInterface !== 'true' ? <Col className="outer-interface" span={24}>
-              <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃锛屼负绌烘椂浣跨敤鎺ュ彛鍦板潃">
+            {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}>
+              <Form.Item label="鎺ュ彛鍦板潃">
+                {getFieldDecorator('exInterface', {
+                  initialValue: setting.exInterface,
+                  rules: [
+                    {
+                      required: true,
+                      message: '璇风紪杈戞帴鍙e湴鍧�!'
+                    }
+                  ]
+                })(<KeyInterface type="develop"/>)}
+              </Form.Item>
+            </Col> : null}
+            {setting.interType === 'outer' && setting.sysInterface === 'false' ? <Col className="outer-interface" span={24}>
+              <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃锛屼负绌烘椂浣跨敤鎺ュ彛鍦板潃銆�">
                   <QuestionCircleOutlined className="mk-form-tip" />
                   姝e紡鍦板潃
                 </Tooltip>
@@ -282,6 +308,17 @@
                 {getFieldDecorator('proInterface', {
                   initialValue: setting.proInterface || ''
                 })(<TextArea rows={2}/>)}
+              </Form.Item>
+            </Col> : null}
+            {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}>
+              <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃銆�">
+                  <QuestionCircleOutlined className="mk-form-tip" />
+                  姝e紡鍦板潃
+                </Tooltip>
+              }>
+                {getFieldDecorator('exProInterface', {
+                  initialValue: setting.exProInterface || ''
+                })(<KeyInterface type="product"/>)}
               </Form.Item>
             </Col> : null}
             {setting.interType === 'outer' ? <Col span={8}>
@@ -416,7 +453,7 @@
               </Form.Item>
             </Col> : null}
             {/* 1銆佷笉鍒嗛〉涓斾笉瀛樺湪涓婄骇妯″潡 */}
-            {!['navbar', 'interface'].includes(config.type) && !['editable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') ? <Col span={8}>
+            {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'鍒濆鍖栧姞杞芥椂锛屾槸鍚︿笌鍏朵粬缁勪欢涓�鍚屽姞杞芥暟鎹紝娉細浠呭湪浣跨敤绯荤粺鍑芥暟锛屼笖鍒濆鍖栧姞杞芥暟鎹椂鏈夋晥锛屽垎椤佃姹傛椂鏃犳晥銆�'}>
                   <QuestionCircleOutlined className="mk-form-tip" />
@@ -433,7 +470,7 @@
                 )}
               </Form.Item>
             </Col> : null}
-            {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}>
+            {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && !['basetable'].includes(config.subtype) ? <Col span={8}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title={'浼樺厛浣跨敤鍚岀骇鐨勬悳绱㈡潯浠剁粍浠讹紝鍚岀骇鎼滅储涓嶅瓨鍦ㄦ椂锛屼緷娆″悜涓婇�夊彇锛屼笌褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵竴鍚岀敤浣滄暟鎹繃婊わ紙褰撳墠缁勪欢鐨勬悳绱㈡潯浠朵紭鍏堬級銆�'}>
                   <QuestionCircleOutlined className="mk-form-tip" />
@@ -450,34 +487,23 @@
                 )}
               </Form.Item>
             </Col> : null}
-            {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) && setting.useMSearch === 'true' && appType !== 'mob' ? <Col span={8}>
+            {config.subtype === 'basetable' && !this.state.ismain ? <Col span={8}>
               <Form.Item label={
-                <Tooltip placement="topLeft" title={'澶栧眰鎼滅储鏉′欢鏀瑰彉鏃讹紝鏄惁鍒锋柊褰撳墠缁勪欢鏁版嵁銆�'}>
+                <Tooltip placement="topLeft" title="鏄惁浣跨敤涓昏〃鐨勬悳绱㈡潯浠�">
                   <QuestionCircleOutlined className="mk-form-tip" />
-                  鍚屾鍒锋柊
+                  涓昏〃鎼滅储
                 </Tooltip>
               }>
-                {getFieldDecorator('syncRefresh', {
-                  initialValue: setting.syncRefresh || 'true'
+                {getFieldDecorator('useMSearch', {
+                  initialValue: setting.useMSearch || 'false'
                 })(
-                  <Radio.Group>
-                    <Radio value="true">鏄�</Radio>
-                    <Radio value="false">鍚�</Radio>
+                  <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'useMSearch')}}>
+                    <Radio value="true">浣跨敤</Radio>
+                    <Radio value="false">涓嶄娇鐢�</Radio>
                   </Radio.Group>
                 )}
               </Form.Item>
             </Col> : null}
-            {/* <Col span={8}>
-              <Form.Item label="浜嬪姟">
-                {getFieldDecorator('transaction', {
-                  initialValue: setting.transaction || 'false'
-                })(
-                <Radio.Group>
-                  <Radio value="true">浣跨敤</Radio>
-                  <Radio value="false">涓嶄娇鐢�</Radio>
-                </Radio.Group>)}
-              </Form.Item>
-            </Col> */}
             {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}>
               <Form.Item label="鍒濆鍖栨暟鎹�">
                 {getFieldDecorator('onload', {

--
Gitblit v1.8.0