From 4a8970e43aa886987c39ddc85ca1dd8b6e43806e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 24 八月 2022 14:46:54 +0800
Subject: [PATCH] 2022-08-24

---
 src/menu/datasource/verifycard/settingform/index.jsx |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx
index 9f89d35..cc9c58e 100644
--- a/src/menu/datasource/verifycard/settingform/index.jsx
+++ b/src/menu/datasource/verifycard/settingform/index.jsx
@@ -27,6 +27,7 @@
     modules: [],
     usefulFields: [],
     useMSearch: this.props.setting.useMSearch || 'false',
+    sysInterface: this.props.setting.sysInterface || 'false',
     supModule: this.props.setting.supModule || [],
     appType: sessionStorage.getItem('appType')
   }
@@ -141,10 +142,13 @@
       })
     }
   }
-
+  
   onSysInter = (e) => {
     let value = e.target.value
-
+    
+    this.setState({
+      sysInterface: value
+    })
     if (value === 'true') {
       this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi})
     }
@@ -157,7 +161,7 @@
   render() {
     const { setting, columns, config } = this.props
     const { getFieldDecorator } = this.props.form
-    const { interType, modules, useMSearch, laypage, supModule, usefulFields, appType } = this.state
+    const { interType, modules, useMSearch, laypage, supModule, usefulFields, appType, sysInterface } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -226,7 +230,13 @@
             {interType === 'outer' ? <Col span={8}>
               <Form.Item label="绯荤粺鎺ュ彛">
                 {getFieldDecorator('sysInterface', {
-                  initialValue: setting.sysInterface || 'false'
+                  initialValue: sysInterface,
+                  rules: [
+                    {
+                      required: true,
+                      message: '璇烽�夋嫨鏄惁浣跨敤绯荤粺鎺ュ彛!'
+                    }
+                  ]
                 })(
                 <Radio.Group onChange={this.onSysInter}>
                   <Radio value="true">鏄�</Radio>
@@ -256,17 +266,17 @@
             {interType === 'outer' ? <Col className="outer-interface" span={24}>
               <Form.Item label="鎺ュ彛鍦板潃">
                 {getFieldDecorator('interface', {
-                  initialValue: setting.interface || '',
+                  initialValue: setting.interface || (sysInterface === 'true' ? window.GLOB.mainSystemApi : ''),
                   rules: [
                     {
-                      required: true,
+                      required: sysInterface !== 'true' ? true : false,
                       message: this.props.dict['form.required.input'] + '鎺ュ彛鍦板潃!'
                     }
                   ]
-                })(<TextArea rows={2}/>)}
+                })(<TextArea rows={2} readOnly={sysInterface === 'true'}/>)}
               </Form.Item>
             </Col> : null}
-            {interType === 'outer' ? <Col className="outer-interface" span={24}>
+            {interType === 'outer' && sysInterface !== 'true' ? <Col className="outer-interface" span={24}>
               <Form.Item label={<Tooltip placement="topLeft" title="姝e紡绯荤粺鎺ュ彛鍦板潃锛屼负绌烘椂浣跨敤鎺ュ彛鍦板潃">
                   <QuestionCircleOutlined className="mk-form-tip" />
                   姝e紡鍦板潃

--
Gitblit v1.8.0