|
1 | 1 | import React, {useState} from "react"; |
2 | 2 | import {Panel} from "@flow-engine/flow-pc-ui"; |
3 | 3 | import {Table, TableProps} from"@flow-engine/flow-pc-ui"; |
4 | | -import {Button, Flex, Form, FormInstance, Input, Modal, Popconfirm, Select, Space, Switch, Tabs,Empty} from "antd"; |
| 4 | +import {Button, Flex, Form, FormInstance, Input, Modal, Popconfirm, Select, Space, Switch, Tabs,Empty, Row, Col} from "antd"; |
5 | 5 | import {dataTypeOptions} from "@flow-engine/flow-types"; |
6 | 6 | import {useDesignContext} from "@/components/design-panel/hooks/use-design-context"; |
7 | 7 | import {WorkflowFormManager} from "@/components/design-panel/manager/form"; |
@@ -54,93 +54,102 @@ const FormFieldModal: React.FC<FormFieldModalProps> = (props) => { |
54 | 54 | > |
55 | 55 | <Input/> |
56 | 56 | </Form.Item> |
57 | | - |
58 | | - <Form.Item |
59 | | - name={"name"} |
60 | | - label={"字段名称"} |
61 | | - labelCol={labelCol} |
62 | | - rules={[ |
63 | | - { |
64 | | - required: true, |
65 | | - message: '字段名称不能为空' |
66 | | - } |
67 | | - ]} |
68 | | - > |
69 | | - <Input placeholder={"请输入字段名称"}/> |
70 | | - </Form.Item> |
71 | | - |
72 | | - <Form.Item |
73 | | - name={"code"} |
74 | | - label={"字段编码"} |
75 | | - labelCol={labelCol} |
76 | | - rules={[ |
77 | | - { |
78 | | - required: true, |
79 | | - message: '字段编码不能为空' |
80 | | - } |
81 | | - ]} |
82 | | - > |
83 | | - <Input placeholder={"请输入字段编码"}/> |
84 | | - </Form.Item> |
85 | | - |
86 | | - <Form.Item |
87 | | - name={"type"} |
88 | | - label={"字段类型"} |
89 | | - labelCol={labelCol} |
90 | | - rules={[ |
91 | | - { |
92 | | - required: true, |
93 | | - message: '字段类型不能为空' |
94 | | - } |
95 | | - ]} |
96 | | - > |
97 | | - <Select |
98 | | - placeholder={"请输入字段类型"} |
99 | | - options={dataTypeOptions} |
100 | | - /> |
101 | | - </Form.Item> |
102 | | - |
103 | | - <Form.Item |
104 | | - name={"required"} |
105 | | - label={"是否必填"} |
106 | | - labelCol={labelCol} |
107 | | - > |
108 | | - <Switch/> |
109 | | - </Form.Item> |
110 | | - |
111 | | - <Form.Item |
112 | | - name={"placeholder"} |
113 | | - label={"输入提示信息"} |
114 | | - labelCol={labelCol} |
115 | | - > |
116 | | - <Input placeholder={"请输入输入提示信息"}/> |
117 | | - </Form.Item> |
118 | | - |
119 | | - <Form.Item |
120 | | - name={"defaultValue"} |
121 | | - label={"默认值"} |
122 | | - labelCol={labelCol} |
123 | | - > |
124 | | - <Input placeholder={"请输入默认值"}/> |
125 | | - </Form.Item> |
126 | | - |
127 | | - <Form.Item |
128 | | - name={"tooltip"} |
129 | | - label={"提示信息"} |
130 | | - labelCol={labelCol} |
131 | | - > |
132 | | - <Input placeholder={"请输入提示信息"}/> |
133 | | - </Form.Item> |
134 | | - |
135 | | - <Form.Item |
136 | | - name={"help"} |
137 | | - label={"帮助提示"} |
138 | | - labelCol={labelCol} |
139 | | - > |
140 | | - <Input placeholder={"请输入帮助提示"}/> |
141 | | - </Form.Item> |
| 57 | + <Row gutter={[8,8]}> |
| 58 | + <Col span={12}> |
| 59 | + <Form.Item |
| 60 | + name={"name"} |
| 61 | + label={"字段名称"} |
| 62 | + labelCol={labelCol} |
| 63 | + rules={[ |
| 64 | + { |
| 65 | + required: true, |
| 66 | + message: '字段名称不能为空' |
| 67 | + } |
| 68 | + ]} |
| 69 | + > |
| 70 | + <Input placeholder={"请输入字段名称"}/> |
| 71 | + </Form.Item> |
| 72 | + </Col> |
| 73 | + <Col span={12}> |
| 74 | + <Form.Item |
| 75 | + name={"code"} |
| 76 | + label={"字段编码"} |
| 77 | + labelCol={labelCol} |
| 78 | + rules={[ |
| 79 | + { |
| 80 | + required: true, |
| 81 | + message: '字段编码不能为空' |
| 82 | + } |
| 83 | + ]} |
| 84 | + > |
| 85 | + <Input placeholder={"请输入字段编码"}/> |
| 86 | + </Form.Item> |
| 87 | + </Col> |
| 88 | + <Col span={12}> |
| 89 | + <Form.Item |
| 90 | + name={"type"} |
| 91 | + label={"字段类型"} |
| 92 | + labelCol={labelCol} |
| 93 | + rules={[ |
| 94 | + { |
| 95 | + required: true, |
| 96 | + message: '字段类型不能为空' |
| 97 | + } |
| 98 | + ]} |
| 99 | + > |
| 100 | + <Select |
| 101 | + placeholder={"请输入字段类型"} |
| 102 | + options={dataTypeOptions} |
| 103 | + /> |
| 104 | + </Form.Item> |
| 105 | + </Col> |
| 106 | + <Col span={12}> |
| 107 | + <Form.Item |
| 108 | + name={"required"} |
| 109 | + label={"是否必填"} |
| 110 | + labelCol={labelCol} |
| 111 | + > |
| 112 | + <Switch/> |
| 113 | + </Form.Item> |
| 114 | + </Col> |
| 115 | + <Col span={12}> |
| 116 | + <Form.Item |
| 117 | + name={"placeholder"} |
| 118 | + label={"输入提示信息"} |
| 119 | + labelCol={labelCol} |
| 120 | + > |
| 121 | + <Input placeholder={"请输入输入提示信息"}/> |
| 122 | + </Form.Item> |
| 123 | + </Col> |
| 124 | + <Col span={12}> |
| 125 | + <Form.Item |
| 126 | + name={"defaultValue"} |
| 127 | + label={"默认值"} |
| 128 | + labelCol={labelCol} |
| 129 | + > |
| 130 | + <Input placeholder={"请输入默认值"}/> |
| 131 | + </Form.Item> |
| 132 | + </Col> |
| 133 | + <Col span={12}> |
| 134 | + <Form.Item |
| 135 | + name={"tooltip"} |
| 136 | + label={"提示信息"} |
| 137 | + labelCol={labelCol} |
| 138 | + > |
| 139 | + <Input placeholder={"请输入提示信息"}/> |
| 140 | + </Form.Item> |
| 141 | + </Col> |
| 142 | + <Col span={12}> |
| 143 | + <Form.Item |
| 144 | + name={"help"} |
| 145 | + label={"帮助提示"} |
| 146 | + labelCol={labelCol} |
| 147 | + > |
| 148 | + <Input placeholder={"请输入帮助提示"}/> |
| 149 | + </Form.Item> |
| 150 | + </Col> |
| 151 | + </Row> |
142 | 152 | </Form> |
143 | | - |
144 | 153 | </Modal> |
145 | 154 | ) |
146 | 155 | } |
|
0 commit comments