From b3547d1c531e479021219fda5df153a11b9b52a3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 31 八月 2020 17:28:09 +0800 Subject: [PATCH] 2020-08-31 --- src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx | 29 ++++------------------------- 1 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx index 97eaa07..9a85eba 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx @@ -8,9 +8,9 @@ import Utils from '@/utils/utils.js' import SettingUtils from './utils.jsx' import CustomScript from './customscript' +import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' -const { TextArea } = Input const { confirm } = Modal const { Paragraph } = Typography @@ -72,9 +72,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -237,8 +236,6 @@ if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.sqlverify(_setting, resolve, reject) }, @@ -421,8 +418,6 @@ if (_loading) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氬垏鎹㈠悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.setState({ view: 'normal' @@ -568,7 +563,7 @@ } else if (item.type === 'datasource') { fields.push( <Col span={24} key={index} style={{paddingLeft: '7px'}}> - <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } help={item.help} label={ + <Form.Item className="text-area" labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } help={item.help} label={ <Tooltip placement="topLeft" title={item.tooltip}> <Icon type="question-circle" /> {item.label} @@ -576,23 +571,7 @@ }> {getFieldDecorator(item.key, { initialValue: item.initVal - })(<TextArea rows={4} />)} - </Form.Item> - </Col> - ) - } else if (item.type === 'textarea') { - fields.push( - <Col span={20} offset={4} key={index}> - <Form.Item className="text-area"> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [ - { - required: !!item.required, - message: this.props.dict['form.required.input'] + item.label + '!' - } - ] - })(<TextArea rows={4} />)} + })(<CodeMirror />)} </Form.Item> </Col> ) -- Gitblit v1.8.0