From 365ea069f179ee71a7a8cc7785ccd2d86bd4881c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 03 二月 2021 18:33:45 +0800 Subject: [PATCH] 2021-02-03 --- src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 56 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 53ea2eb..e303c63 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -19,11 +19,12 @@ setting: PropTypes.object, // 鏁版嵁婧愰厤缃� columns: PropTypes.array, // 鍒楄缃� scripts: PropTypes.array, // 鑷畾涔夎剼鏈� + updateStatus: PropTypes.func, // 鐘舵�佹洿鏂� } state = { interType: 'system', - procMode: 'system', + procMode: 'script', requestMode: 'system', funcTooltip: '', funcRules: [] @@ -59,7 +60,7 @@ this.setState({ interType: setting.interType || 'system', - procMode: setting.procMode || 'system', + procMode: setting.procMode || 'script', requestMode: setting.requestMode || 'system', funcTooltip: tooltip, funcRules: rules @@ -175,6 +176,7 @@ interface: window.GLOB.mainSystemApi || '' }) } + this.props.updateStatus({[key]: value}) } primaryKeyChange = (val) => { @@ -279,7 +281,7 @@ ] })( <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => {this.onRadioChange(e, 'procMode')}}> - <Radio value="system">鍓嶇疆鑴氭湰</Radio> + <Radio value="script">鍓嶇疆鑴氭湰</Radio> <Radio value="inner">鍓嶇疆鍑芥暟</Radio> </Radio.Group>)} </Form.Item> @@ -291,8 +293,8 @@ 鍓嶇疆鍑芥暟 </Tooltip> }> - {getFieldDecorator('innerFunc', { - initialValue: setting.innerFunc || '', + {getFieldDecorator('prevFunc', { + initialValue: setting.prevFunc || '', rules: [ { required: true, @@ -308,19 +310,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 || '', rules: [ { required: true, - message: dict['form.required.input'] + '鎺ュ彛鍦板潃!' + message: dict['form.required.input'] + '娴嬭瘯鍦板潃!' }, ] })(<TextArea rows={2} />)} </Form.Item> </Col> : null} - {interType === 'custom' ? <Col className="data-source" span={24}> + {interType === 'outer' || interType === 'custom' ? <Col className="data-source" span={24}> <Form.Item label={ <Tooltip placement="topLeft" title="姝e紡绯荤粺鎵�浣跨敤鐨勭殑鎺ュ彛鍦板潃銆�"> <Icon type="question-circle" /> @@ -330,6 +332,23 @@ {getFieldDecorator('proInterface', { initialValue: setting.proInterface || '' })(<TextArea rows={2} />)} + </Form.Item> + </Col> : null} + {interType === 'custom' ? <Col span={12}> + <Form.Item label="璇锋眰鏂瑰紡"> + {getFieldDecorator('method', { + initialValue: setting.method || 'post', + rules: [ + { + required: true, + message: dict['form.required.select'] + '璇锋眰鏂瑰紡!' + }, + ] + })( + <Radio.Group> + <Radio value="get">GET</Radio> + <Radio value="post">POST</Radio> + </Radio.Group>)} </Form.Item> </Col> : null} {interType === 'custom' ? <Col span={12}> @@ -463,15 +482,32 @@ {interType === 'custom' ? <Col span={12}> <Form.Item label="鍥炶皟鏂瑰紡"> {getFieldDecorator('callbackType', { - initialValue: setting.callbackType || 'default' + initialValue: setting.callbackType || 'script' })( - <Radio.Group> + <Radio.Group onChange={(e) => {this.onRadioChange(e, 'callbackType')}}> <Radio value="default">榛樿鑴氭湰</Radio> <Radio value="script">鑷畾涔夎剼鏈�</Radio> </Radio.Group>)} </Form.Item> </Col> : null} {interType === 'custom' ? <Col span={12}> + <Form.Item label="鍥炶皟琛ㄥ悕"> + {getFieldDecorator('cbTable', { + initialValue: setting.cbTable || '', + rules: [ + { + required: true, + message: dict['form.required.input'] + '鍥炶皟琛ㄥ悕!' + }, + { + max: formRule.input.max, + message: formRule.input.message + } + ] + })(<Input placeholder={''} autoComplete="off" />)} + </Form.Item> + </Col> : null} + {interType === 'custom' ? <Col span={12}> <Form.Item label={ <Tooltip placement="topLeft" title={'鍚屾鎵ц锛氬閮ㄦ帴鍙h皟鐢ㄦ垚鍔熷悗鍐嶈姹傛暟鎹紱寮傛鎵ц锛氬閮ㄦ帴鍙h皟鐢ㄤ笌璇锋眰鏁版嵁鍚屾椂杩涜銆�'}> <Icon type="question-circle" /> -- Gitblit v1.8.0