From a8507cc8c42d17d4fb854594dbf1e084d61912ac Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 18 十月 2022 12:44:22 +0800 Subject: [PATCH] 2022-10-18 --- src/menu/components/share/markcomponent/markform/index.jsx | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/menu/components/share/markcomponent/markform/index.jsx b/src/menu/components/share/markcomponent/markform/index.jsx index c027d4b..f4adc4d 100644 --- a/src/menu/components/share/markcomponent/markform/index.jsx +++ b/src/menu/components/share/markcomponent/markform/index.jsx @@ -1,13 +1,14 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Select, Button, Input, Icon, Cascader, Tooltip } from 'antd' +import { Form, Row, Col, Select, Button, Input, Cascader, Tooltip } from 'antd' +import { QuestionCircleOutlined } from '@ant-design/icons' import ColorSketch from '@/mob/colorsketch' import './index.scss' class UniqueForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� + field: PropTypes.any, columns: PropTypes.array, // 鍒楀悕闆嗗悎 signs: PropTypes.array, // 鏍囪绫诲瀷 markChange: PropTypes.func // 淇敼鍑芥暟 @@ -23,7 +24,7 @@ } render() { - const { columns, signs } = this.props + const { columns, signs, field } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { labelCol: { @@ -36,21 +37,26 @@ } } + let initVal = [] + if (field) { + initVal = [field, 'static'] + } + return ( <Form {...formItemLayout} className="normal-table-mark-form"> <Row gutter={24}> <Col span={6}> <Form.Item label={'瀵规瘮瀛楁'}> {getFieldDecorator('field', { - initialValue: [], + initialValue: initVal, rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮瀛楁!' + message: '璇烽�夋嫨瀵规瘮瀛楁!' } ] })( - <Cascader options={columns} placeholder=""/> + <Cascader className="mark-type" options={columns} placeholder=""/> )} </Form.Item> </Col> @@ -61,7 +67,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '瀵规瘮鏂瑰紡!' + message: '璇烽�夋嫨瀵规瘮鏂瑰紡!' } ] })( @@ -77,7 +83,7 @@ </Col> <Col span={6}> <Form.Item label={<Tooltip placement="topLeft" title="瀵规瘮闈欐�佸�兼椂锛岄渶瑕佸~鍐欏姣斿�硷紝榛樿涓虹┖銆�"> - <Icon type="question-circle" /> + <QuestionCircleOutlined className="mk-form-tip" /> {'瀵规瘮鍊�'} </Tooltip> }> @@ -93,7 +99,7 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '棰滆壊!' + message: '璇烽�夋嫨棰滆壊!' } ] })( @@ -108,11 +114,11 @@ rules: [ { required: true, - message: this.props.dict['form.required.select'] + '鏍囪鏂瑰紡!' + message: '璇烽�夋嫨鏍囪鏂瑰紡!' } ] })( - <Cascader options={signs} placeholder=""/> + <Cascader popupClassName="mark-type" options={signs} placeholder=""/> )} </Form.Item> </Col> : null} -- Gitblit v1.8.0