From e8edfdadb561cd83bf6e1c3e00d55b8cc2aee6d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 17 十月 2022 17:57:34 +0800 Subject: [PATCH] 2022-10-17 --- src/templates/formtabconfig/settingform/index.jsx | 49 +++++++++++++++++++++++++------------------------ 1 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/templates/formtabconfig/settingform/index.jsx b/src/templates/formtabconfig/settingform/index.jsx index 9a407ea..bc10e56 100644 --- a/src/templates/formtabconfig/settingform/index.jsx +++ b/src/templates/formtabconfig/settingform/index.jsx @@ -1,6 +1,8 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification, InputNumber } from 'antd' +import { Form, Row, Col, Input, Radio, Select, Tooltip, notification, InputNumber } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' + import { formRule } from '@/utils/option.js' import Utils from '@/utils/utils.js' import './index.scss' @@ -9,7 +11,6 @@ class SettingForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� menu: PropTypes.object, config: PropTypes.object, inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 @@ -43,7 +44,7 @@ return true } }) - } catch { + } catch (e) { notification.warning({ top: 92, message: '鑿滃崟淇℃伅閿欒锛�', @@ -55,7 +56,7 @@ if (usefulFields) { try { usefulFields = JSON.parse(usefulFields) - } catch { + } catch (e) { usefulFields = [] } } else { @@ -166,7 +167,7 @@ } render() { - const { dict, menu } = this.props + const { menu } = this.props const { getFieldDecorator } = this.props.form const { interType, setting, datatype, usefulFields } = this.state @@ -194,11 +195,11 @@ rules: [ { required: true, - message: dict['form.required.input'] + '琛ㄥ悕!' + message: '璇疯緭鍏ヨ〃鍚�!' }, { - max: formRule.input.max, - message: formRule.input.message + max: 50, + message: '琛ㄥ悕鏈�闀夸负50涓瓧绗�!' } ] })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} @@ -219,13 +220,13 @@ </Form.Item> </Col> <Col span={12}> - <Form.Item label={dict['header.menu.datasource']}> + <Form.Item label="鏁版嵁鏉ユ簮"> {getFieldDecorator('datatype', { initialValue: setting.datatype || 'query' })( <Radio.Group onChange={this.sourceChange}> - <Radio value="maintable">{dict['header.menu.maintable']}</Radio> - <Radio value="query">{dict['header.menu.query']}</Radio> + <Radio value="maintable">涓昏〃</Radio> + <Radio value="query">鏌ヨ</Radio> </Radio.Group> )} </Form.Item> @@ -238,37 +239,37 @@ </Form.Item> </Col> {datatype === 'query' ? <Col span={12}> - <Form.Item label={dict['header.form.intertype']}> + <Form.Item label="鎺ュ彛绫诲瀷"> {getFieldDecorator('interType', { initialValue: interType })( <Radio.Group onChange={this.onChange}> - <Radio value="inner">{dict['model.interface.inner']}</Radio> - <Radio value="outer">{dict['model.interface.outer']}</Radio> + <Radio value="inner">鍐呴儴</Radio> + <Radio value="outer">澶栭儴</Radio> </Radio.Group> )} </Form.Item> </Col> : null} {datatype === 'query' && interType === 'outer' ? <Col span={12}> - <Form.Item label={dict['header.form.sysInterface']}> + <Form.Item label="绯荤粺鎺ュ彛"> {getFieldDecorator('sysInterface', { initialValue: setting.sysInterface || 'false' })( <Radio.Group onChange={this.onSysChange}> - <Radio value="true">{dict['model.true']}</Radio> - <Radio value="false">{dict['model.false']}</Radio> + <Radio value="true">鏄�</Radio> + <Radio value="false">鍚�</Radio> </Radio.Group> )} </Form.Item> </Col> : null} {datatype === 'query' && interType === 'outer' ? <Col span={12}> - <Form.Item label={dict['header.form.interface']}> + <Form.Item label="鎺ュ彛鍦板潃"> {getFieldDecorator('interface', { initialValue: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''), rules: [ { required: true, - message: dict['form.required.input'] + dict['header.form.interface'] + '!' + message: '璇疯緭鍏ユ帴鍙e湴鍧�!' }, { max: formRule.input.max, @@ -281,8 +282,8 @@ {datatype === 'query' && interType !== 'outer' ? <Col span={12}> <Form.Item label={ <Tooltip placement="topLeft" overlayClassName="middle" title={`鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屽嚱鏁板悕绉伴渶浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬶紱鏈缃椂浼氳皟鐢ㄧ郴缁熷嚱鏁帮紝浣跨敤绯荤粺鍑芥暟闇�瀹屽杽鏁版嵁婧愩�俙}> - <Icon type="question-circle" /> - {dict['header.form.innerFunc']} + <QuestionCircleOutlined className="mk-form-tip" /> + 鍐呴儴鍑芥暟 </Tooltip> }> {getFieldDecorator('innerFunc', { @@ -302,8 +303,8 @@ {datatype === 'query' && interType !== 'outer' ? <Col span={24}> <Form.Item help={'鏁版嵁ID锛�' + menu.MenuID} label={ <Tooltip placement="topLeft" title="浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愶紝鑷畾涔夊嚱鏁版椂锛屽彲蹇界暐銆�"> - <Icon type="question-circle" /> - {'鏁版嵁婧�'} + <QuestionCircleOutlined className="mk-form-tip" /> + 鏁版嵁婧� </Tooltip> } className="textarea"> {getFieldDecorator('dataresource', { @@ -312,7 +313,7 @@ </Form.Item> </Col> : null} {datatype === 'query' && interType === 'outer' ? <Col span={12}> - <Form.Item label={dict['header.form.outerFunc']}> + <Form.Item label="澶栭儴鍑芥暟"> {getFieldDecorator('outerFunc', { initialValue: setting.outerFunc || '', rules: [ -- Gitblit v1.8.0