Commit 2f8b38f648761185760548e9d4ea94a1ccfb86b5

Authored by 邱嘉伟
1 parent cdc672d8

pref:参数设计器 部分样式修改

@@ -18,7 +18,6 @@ import { @@ -18,7 +18,6 @@ import {
18 Divider, 18 Divider,
19 message, 19 message,
20 } from 'antd'; 20 } from 'antd';
21 -import type { FormInstance } from 'antd/es/form';  
22 import React, { 21 import React, {
23 useCallback, 22 useCallback,
24 useEffect, 23 useEffect,
@@ -86,7 +85,6 @@ interface ParameterSettingProps { @@ -86,7 +85,6 @@ interface ParameterSettingProps {
86 nodeType?: string | 'START' | 'END'; 85 nodeType?: string | 'START' | 'END';
87 appId?: string; // 当前应用ID 86 appId?: string; // 当前应用ID
88 } 87 }
89 -const EditableContext = React.createContext<FormInstance<any> | null>(null);  
90 88
91 const onChange = (e: React.ChangeEvent<HTMLInputElement>) => { 89 const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
92 console.log('onChange', e); 90 console.log('onChange', e);
@@ -178,7 +176,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -178,7 +176,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
178 </div> 176 </div>
179 ), 177 ),
180 dataIndex: 'code', 178 dataIndex: 'code',
181 - width: '12%', 179 + width: '150px',
182 key: 'code', 180 key: 'code',
183 render: (text, record) => ( 181 render: (text, record) => (
184 < Form.Item 182 < Form.Item
@@ -201,7 +199,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -201,7 +199,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
201 </div> 199 </div>
202 ), 200 ),
203 dataIndex: 'title', 201 dataIndex: 'title',
204 - width: '12%', 202 + width: '112px',
205 key: 'title', 203 key: 'title',
206 render: (text, record) => ( 204 render: (text, record) => (
207 <Form.Item 205 <Form.Item
@@ -224,7 +222,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -224,7 +222,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
224 </div> 222 </div>
225 ), 223 ),
226 dataIndex: 'type', 224 dataIndex: 'type',
227 - width: '8%', 225 + width: '102px',
228 key: 'type', 226 key: 'type',
229 render: (text, record) => 227 render: (text, record) =>
230 <Form.Item 228 <Form.Item
@@ -248,7 +246,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -248,7 +246,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
248 { 246 {
249 title: '默认值', 247 title: '默认值',
250 dataIndex: 'valueMapping', 248 dataIndex: 'valueMapping',
251 - width: '13%', 249 + width: '116px',
252 key: 'valueMapping', 250 key: 'valueMapping',
253 render: (text, record) => 251 render: (text, record) =>
254 <div className="editable-cell "> 252 <div className="editable-cell ">
@@ -273,6 +271,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -273,6 +271,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
273 title: '参数说明', 271 title: '参数说明',
274 dataIndex: 'description', 272 dataIndex: 'description',
275 key: 'description', 273 key: 'description',
  274 + width: '102px',
276 render: (text, record) => ( 275 render: (text, record) => (
277 <Form.Item 276 <Form.Item
278 name={'description' + record.id} 277 name={'description' + record.id}
@@ -290,7 +289,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -290,7 +289,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
290 { 289 {
291 title: '操作', 290 title: '操作',
292 key: 'action', 291 key: 'action',
293 - width: '8%', 292 + width: '96px',
294 render: (text, record) => { 293 render: (text, record) => {
295 const isShowAdd = (record && checkShowAdd(record)); 294 const isShowAdd = (record && checkShowAdd(record));
296 const isShowTree = (record && checkShowTree(record)); 295 const isShowTree = (record && checkShowTree(record));
@@ -333,6 +332,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -333,6 +332,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
333 title: '取值范围', 332 title: '取值范围',
334 dataIndex: 'qxProps', 333 dataIndex: 'qxProps',
335 editable: true, 334 editable: true,
  335 + width: '314px',
336 key: 'qxProps', 336 key: 'qxProps',
337 render: (qxProps: any, record: any) => { 337 render: (qxProps: any, record: any) => {
338 switch (record.type) { 338 switch (record.type) {
@@ -388,7 +388,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -388,7 +388,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
388 size='small' 388 size='small'
389 defaultValue={qxProps.min} 389 defaultValue={qxProps.min}
390 onBlur={(e) => handleChange(e, record, 'qxProps-min')} 390 onBlur={(e) => handleChange(e, record, 'qxProps-min')}
391 - style={{ width: '110px' }} 391 + // style={{ width: '110px' }}
392 placeholder="最小值" 392 placeholder="最小值"
393 /> 393 />
394 </Form.Item> 394 </Form.Item>
@@ -403,7 +403,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -403,7 +403,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
403 precision={qxProps.precision || 0} 403 precision={qxProps.precision || 0}
404 defaultValue={qxProps.max} 404 defaultValue={qxProps.max}
405 onBlur={(e) => handleChange(e, record, 'qxProps-max')} 405 onBlur={(e) => handleChange(e, record, 'qxProps-max')}
406 - style={{ width: '110px' }} 406 + // style={{ width: '110px' }}
407 placeholder="最大值" 407 placeholder="最大值"
408 /> 408 />
409 </Form.Item> 409 </Form.Item>
@@ -444,7 +444,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -444,7 +444,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
444 : undefined 444 : undefined
445 } 445 }
446 format={formatEnum[qxProps?.format]} 446 format={formatEnum[qxProps?.format]}
447 - style={{ width: '110px' }} 447 + // style={{ width: '110px' }}
448 showTime 448 showTime
449 onChange={(e) => handleChange(e, record, 'qxProps-min')} 449 onChange={(e) => handleChange(e, record, 'qxProps-min')}
450 placeholder="开始日期" 450 placeholder="开始日期"
@@ -459,7 +459,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -459,7 +459,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
459 : undefined 459 : undefined
460 } 460 }
461 format={formatEnum[qxProps?.format]} 461 format={formatEnum[qxProps?.format]}
462 - style={{ width: '110px' }} 462 + // style={{ width: '110px' }}
463 showTime 463 showTime
464 onChange={(e) => handleChange(e, record, 'qxProps-max')} 464 onChange={(e) => handleChange(e, record, 'qxProps-max')}
465 placeholder="结束日期" 465 placeholder="结束日期"
@@ -469,7 +469,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -469,7 +469,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
469 <div className='range-cell'> 469 <div className='range-cell'>
470 <Select 470 <Select
471 size='small' 471 size='small'
472 - style={{ width: '90px' }} 472 + // style={{ width: '90px' }}
473 bordered={false} 473 bordered={false}
474 placeholder="格式" 474 placeholder="格式"
475 popupMatchSelectWidth={false} 475 popupMatchSelectWidth={false}
@@ -524,7 +524,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -524,7 +524,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
524 dataIndex: 'required', 524 dataIndex: 'required',
525 editable: true, 525 editable: true,
526 key: 'required', 526 key: 'required',
527 - width: '5%', 527 + width: '76px',
528 render: (text, record) => ( 528 render: (text, record) => (
529 <Form.Item 529 <Form.Item
530 name={'required' + record.id} 530 name={'required' + record.id}
@@ -804,7 +804,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -804,7 +804,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
804 childrenColumnName: 'child' 804 childrenColumnName: 'child'
805 }} 805 }}
806 onRow={() => onRow()} 806 onRow={() => onRow()}
807 - scroll={{ x: 960 }} 807 + scroll={{ x: 960, y: 432 }}
808 // rowClassName={() => 'editable-row'} 808 // rowClassName={() => 'editable-row'}
809 bordered 809 bordered
810 pagination={false} 810 pagination={false}