File tree Expand file tree Collapse file tree
frontend/packages/flow-pc
flow-pc-design/src/components/design-panel/tabs
flow-pc-form/src/components/item Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,6 +260,7 @@ const FormTable: React.FC<FormTableProps> = (props) => {
260260 return (
261261 < Space >
262262 < a onClick = { ( ) => {
263+ fieldForm . resetFields ( ) ;
263264 fieldForm . setFieldsValue ( record ) ;
264265 setEditable ( true ) ;
265266 } } > 编辑</ a >
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ const $Switch: React.FC<FormItemProps> = (props) => {
1111
1212 return (
1313 < Switch
14- { ...props }
1514 value = { value }
1615 defaultValue = { defaultValue }
1716 onChange = { ( value ) => {
Original file line number Diff line number Diff line change @@ -7,17 +7,22 @@ import {FormItemProps} from "@/type";
77const $Date : React . FC < FormItemProps > = ( props ) => {
88
99 const handlerChange = ( value : any ) => {
10- props . onChange ?.( dayjs ( value ) . format ( 'YYYY-MM-DD' ) ) ;
10+ if ( value ) {
11+ props . onChange ?.( dayjs ( value ) . format ( 'YYYY-MM-DD' ) ) ;
12+ } else {
13+ props . onChange ?.( '' ) ;
14+ }
1115 }
1216
1317 const value = props . value ? dayjs ( props . value ) : undefined ;
18+ const defaultValue = props . defaultValue ? dayjs ( props . defaultValue ) : undefined ;
1419
1520 return (
1621 < DatePicker
17- { ...props }
1822 value = { value as any }
1923 onChange = { handlerChange }
2024 placeholder = { props . placeholder }
25+ defaultValue = { defaultValue }
2126 />
2227 )
2328}
Original file line number Diff line number Diff line change @@ -5,12 +5,14 @@ import {FormItemProps} from "@/type";
55
66
77const $Input :React . FC < FormItemProps > = ( props ) => {
8-
8+ const value = props . value || undefined ;
99
1010 return (
1111 < Input
12- { ...props }
1312 type = "number"
13+ value = { value }
14+ placeholder = { props . placeholder }
15+ defaultValue = { props . defaultValue }
1416 onChange = { ( event ) => {
1517 props . onChange ?.( event . target . value ) ;
1618 } }
Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ import {FormItemProps} from "@/type";
66
77const $Input : React . FC < FormItemProps > = ( props ) => {
88
9+ const value = props . value || undefined ;
10+
911 return (
1012 < Input
11- { ...props }
13+ value = { value }
14+ placeholder = { props . placeholder }
15+ defaultValue = { props . defaultValue }
1216 onChange = { ( event ) => {
1317 props . onChange ?.( event . target . value ) ;
1418 } }
You can’t perform that action at this time.
0 commit comments