| | |
| | | } |
| | | |
| | | selectScript = (value, option) => { |
| | | if (!value || !option) return |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (_sql) { |
| | | _sql = _sql + ` |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verify-custom-scripts"> |
| | | <Form {...formItemLayout} className="verify-form" id="verify-custom-callback-scripts"> |
| | | <Row gutter={24}> |
| | | {btn.cbTable ? <Col span={8}> |
| | | <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | {btn.cbTable} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Col> |
| | | <Col span={16}> |
| | | <Form.Item label={'报错字段'} style={{margin: 0}}> |
| | | ErrorCode, retmsg |
| | |
| | | <Col span={10}> |
| | | <Form.Item label={'快捷添加'} style={{marginBottom: 0}}> |
| | | <Select |
| | | allowClear |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={this.selectScript} |
| | | getPopupContainer={() => document.getElementById('verify-custom-scripts')} |
| | | getPopupContainer={() => document.getElementById('verify-custom-callback-scripts')} |
| | | > |
| | | <Select.Option key="default" value={`declare @${btn.cbTable} table (mk_api_key nvarchar(100))`}>默认sql</Select.Option> |
| | | {systemScripts.map((option, i) => |
| | | <Select.Option key={i} value={option.value}>{option.name}</Select.Option> |
| | | )} |