From fa381753ef2a2b25b1c0722549ac17e333da79be Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 九月 2022 22:50:54 +0800
Subject: [PATCH] 2022-09-06

---
 src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
index 4e7dce8..df973b7 100644
--- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
@@ -29,6 +29,7 @@
     interType: 'system',
     procMode: 'script',
     requestMode: 'system',
+    sysInterface: 'false',
     controlField: '',
     tableType: '',
     funcTooltip: '',
@@ -68,6 +69,7 @@
       procMode: setting.procMode || 'script',
       requestMode: setting.requestMode || 'system',
       controlField: setting.controlField || '',
+      sysInterface: setting.sysInterface || 'false',
       tableType: setting.tableType,
       funcTooltip: tooltip,
       funcRules: rules
@@ -152,7 +154,7 @@
             param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
             param.secretkey = Utils.encrypt(param.LText, param.timestamp)
     
-            Api.getLocalConfig(param)
+            Api.genericInterface(param)
           }
 
           resolve(values)
@@ -178,10 +180,15 @@
       this.setState({
         requestMode: value
       })
-    } else if (key === 'sysInterface' && value === 'true') {
-      this.props.form.setFieldsValue({
-        interface: window.GLOB.mainSystemApi || ''
+    } else if (key === 'sysInterface') {
+      this.setState({
+        sysInterface: value
       })
+      if (value === 'true') {
+        this.props.form.setFieldsValue({
+          interface: window.GLOB.mainSystemApi || ''
+        })
+      }
     }
     this.props.updateStatus({[key]: value})
   }
@@ -197,7 +204,7 @@
   render() {
     const { setting, dict, menu, config, columns } = this.props
     const { getFieldDecorator } = this.props.form
-    const { interType, funcRules, funcTooltip, procMode, requestMode, tableType, controlField } = this.state
+    const { interType, funcRules, funcTooltip, procMode, requestMode, tableType, controlField, sysInterface } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -266,7 +273,7 @@
             {interType === 'outer' ? <Col span={12}>
               <Form.Item label={dict['header.form.sysInterface']}>
                 {getFieldDecorator('sysInterface', {
-                  initialValue: setting.sysInterface || 'false',
+                  initialValue: sysInterface,
                   rules: [
                     {
                       required: true,
@@ -321,19 +328,19 @@
               </Form.Item>
             </Col> : null}
             {interType === 'outer' || interType === 'custom' ? <Col className="data-source" span={24}>
-              <Form.Item label="娴嬭瘯鍦板潃">
+              <Form.Item label="鎺ュ彛鍦板潃">
                 {getFieldDecorator('interface', {
-                  initialValue: setting.interface || '',
+                  initialValue: setting.interface || (interType === 'outer' && sysInterface === 'true' ? window.GLOB.mainSystemApi : ''),
                   rules: [
                     {
-                      required: true,
-                      message: dict['form.required.input'] + '娴嬭瘯鍦板潃!'
+                      required: interType === 'outer' && sysInterface === 'true' ? false : true,
+                      message: dict['form.required.input'] + '鎺ュ彛鍦板潃!'
                     },
                   ]
-                })(<TextArea rows={2} />)}
+                })(<TextArea rows={2} readOnly={interType === 'outer' && sysInterface === 'true'}/>)}
               </Form.Item>
             </Col> : null}
-            {interType === 'outer' || interType === 'custom' ? <Col className="data-source" span={24}>
+            {(interType === 'outer' && sysInterface !== 'true') || interType === 'custom' ? <Col className="data-source" span={24}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="姝e紡绯荤粺鎵�浣跨敤鐨勭殑鎺ュ彛鍦板潃銆�">
                   <QuestionCircleOutlined className="mk-form-tip" />
@@ -682,7 +689,7 @@
                 </Radio.Group>)}
               </Form.Item>
             </Col>
-            <Col span={12}>
+            {/* <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="鍦ㄦ悳绱㈡潯浠跺瓨鍦ㄦ椂锛屾槸鍚︽樉绀烘悳绱㈠拰閲嶇疆鎸夐挳銆�">
                   <QuestionCircleOutlined className="mk-form-tip" />
@@ -697,7 +704,7 @@
                   <Radio value="false">闅愯棌</Radio>
                 </Radio.Group>)}
               </Form.Item>
-            </Col>
+            </Col> */}
             {tableType !== '' ? <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆傛敞锛氬湪鍚敤鏃犱汉鍊煎畧鍔熻兘鏃舵棤鏁堛��">
@@ -727,7 +734,7 @@
                 })(<InputNumber min={1} max={500} precision={0} />)}
               </Form.Item>
             </Col>
-            <Col span={12}>
+            {/* <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="楂樼骇鎼滅储寮圭獥鐨勫搴︼紝娉細褰撳搴﹀�煎皬浜�100鏃惰〃绀哄崰绐楀彛鐨勭櫨鍒嗘瘮锛屽ぇ浜�100鏃惰〃绀哄搴︾殑缁濆鍊笺��">
                   <QuestionCircleOutlined className="mk-form-tip" />
@@ -738,7 +745,7 @@
                   initialValue: setting.advanceWidth || 1000
                 })(<InputNumber min={10} max={3000} precision={0}/>)}
               </Form.Item>
-            </Col>
+            </Col> */}
             <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="鍙屽嚮琛ㄦ牸涓锛岃Е鍙戠殑鎸夐挳銆�">

--
Gitblit v1.8.0