Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web_component
submodule
Commits
c2b0f651
Commit
c2b0f651
authored
Jan 04, 2021
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update sub
parent
b9ba9c62
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
12 deletions
+33
-12
index.tsx
components/apolloTable/component/base/edit/date/index.tsx
+4
-1
index.tsx
components/apolloTable/component/base/edit/input/index.tsx
+4
-1
index.tsx
components/apolloTable/component/base/edit/number/index.tsx
+4
-1
index.tsx
components/apolloTable/component/base/edit/search/index.tsx
+4
-1
index.tsx
components/apolloTable/component/base/edit/select/index.tsx
+4
-1
index.tsx
components/apolloTable/editFormV3/index.tsx
+13
-7
No files found.
components/apolloTable/component/base/edit/date/index.tsx
View file @
c2b0f651
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
Ref
,
useState
}
from
'react'
;
import
{
DatePicker
}
from
'antd'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
import
styles
from
'./styles.less'
;
...
...
@@ -23,6 +23,9 @@ export const ApolloDate = (props: any) => {
selfProps
.
disabled
=
!!
props
.
disabled
;
const
isOpen
:
any
=
useRef
();
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
useEffect
(()
=>
{
setCurValue
(
value
);
},
[
value
]);
const
changeValue
=
(
date
:
any
,
dateString
:
string
)
=>
{
setCurValue
(
date
);
if
(
typeof
onChange
===
'function'
)
{
...
...
components/apolloTable/component/base/edit/input/index.tsx
View file @
c2b0f651
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
{
Input
}
from
'antd'
;
import
styles
from
'./styles.less'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
...
...
@@ -25,6 +25,9 @@ export const ApolloInput = (props: ApolloInputProps) => {
]);
selfProps
.
disabled
=
!!
props
.
disabled
;
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
useEffect
(()
=>
{
setCurValue
(
value
);
},
[
value
]);
const
changeValue
=
(
value
:
any
)
=>
{
setCurValue
(
value
);
if
(
typeof
onChange
===
'function'
)
{
...
...
components/apolloTable/component/base/edit/number/index.tsx
View file @
c2b0f651
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
{
InputNumber
}
from
'antd'
;
import
styles
from
'./styles.less'
;
import
{
ApolloNumberProps
}
from
'../editInterface'
;
...
...
@@ -24,6 +24,9 @@ export const ApolloNumber = (props: ApolloNumberProps) => {
]);
selfProps
.
disabled
=
!!
props
.
disabled
;
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
useEffect
(()
=>
{
setCurValue
(
value
);
},
[
value
]);
const
changeValue
=
(
value
:
any
)
=>
{
setCurValue
(
value
);
if
(
typeof
onChange
===
'function'
)
{
...
...
components/apolloTable/component/base/edit/search/index.tsx
View file @
c2b0f651
import
React
,
{
useState
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useRef
,
useEffect
}
from
'react'
;
import
{
message
}
from
'antd'
;
import
Search
from
'../../extra/associationSearch'
;
import
{
ApolloSearchProps
}
from
'../editInterface'
;
...
...
@@ -31,6 +31,9 @@ export const ApolloSearch = (props: ApolloSearchProps) => {
selfProps
.
mode
=
'multiple'
;
}
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
useEffect
(()
=>
{
setCurValue
(
value
);
},
[
value
]);
const
isOpen
:
any
=
useRef
();
const
changeValue
=
(
value
:
any
)
=>
{
if
(
isMultiple
&&
maxCount
&&
maxCount
<
value
.
length
)
{
...
...
components/apolloTable/component/base/edit/select/index.tsx
View file @
c2b0f651
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
Ref
,
useState
}
from
'react'
;
import
{
Select
}
from
'antd'
;
import
{
ApolloSelectProps
}
from
'../editInterface'
;
import
{
antiAssign
}
from
'../../../../utils/utils'
;
...
...
@@ -31,6 +31,9 @@ export const ApolloSelect = (props: ApolloSelectProps) => {
selfProps
.
mode
=
'multiple'
;
}
const
[
curValue
,
setCurValue
]
=
useState
(
value
);
useEffect
(()
=>
{
setCurValue
(
value
);
},
[
value
]);
const
isOpen
:
any
=
useRef
();
const
changeValue
=
(
value
:
any
)
=>
{
setCurValue
(
value
);
...
...
components/apolloTable/editFormV3/index.tsx
View file @
c2b0f651
...
...
@@ -14,7 +14,7 @@
* 失去焦点:onBlurFn
* */
import
React
,
{
Component
}
from
'react'
;
import
{
Form
,
Button
,
message
,
Tooltip
}
from
'antd'
;
import
{
Form
,
Button
,
Tooltip
}
from
'antd'
;
import
_
from
'lodash'
;
import
IconFont
from
'@/submodule/components/IconFont/IconFont'
;
import
{
emptyModel
}
from
'../component/base/_utils/setFormatter'
;
...
...
@@ -35,7 +35,7 @@ class FormWrap extends Component {
e
.
preventDefault
();
e
.
stopPropagation
();
const
{
rowId
,
form
,
handleSubmit
,
data
,
rowData
,
detailType
,
form
,
handleSubmit
,
data
,
rowData
,
detailType
,
}
=
this
.
props
;
form
.
validateFieldsAndScroll
((
err
,
values
)
=>
{
if
(
!
err
)
{
...
...
@@ -44,10 +44,11 @@ class FormWrap extends Component {
const
item
=
data
.
find
((
temp
:
any
)
=>
{
return
temp
.
columnName
===
key
;
});
const
{
columnType
,
columnAttrObj
,
renderEditForm
,
readOnlyFlag
,
dynamicCellConfigDTO
}
=
item
;
if
(
readOnlyFlag
||
(
dynamicCellConfigDTO
&&
dynamicCellConfigDTO
.
readonlyFlag
))
{
return
;
}
const
{
columnType
,
renderEditForm
,
readOnlyFlag
,
dynamicCellConfigDTO
}
=
item
;
/** !!此方法只在新增时使用,因此只读数据也上传,此段代码暂时注释,后有问题再看 * */
// if (readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag)) {
// return;
// }
let
detailConfig
:
any
;
if
(
typeof
renderEditForm
===
'function'
)
{
detailConfig
=
renderEditForm
({
cellData
:
values
[
key
],
rowData
,
columnConfig
:
item
});
...
...
@@ -117,7 +118,7 @@ class FormWrap extends Component {
renderEditForm
=
(
item
)
=>
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
const
{
rowData
,
rowId
,
getInstanceDetail
,
onEmitChange
}
=
this
.
props
;
const
{
rowData
,
rowId
,
getInstanceDetail
,
onEmitChange
,
changeParams
}
=
this
.
props
;
const
{
columnType
,
columnName
,
...
...
@@ -169,9 +170,14 @@ class FormWrap extends Component {
columnCode
:
columnName
,
cellValueList
:
changedValue
,
});
// 编辑时回调,调接口
if
(
typeof
onEmitChange
===
'function'
)
{
onEmitChange
(
extraData
);
}
// 新增时回调,不调接口
if
(
typeof
changeParams
===
'function'
)
{
changeParams
(
columnName
,
changedValue
,
optionValue
);
}
};
return
(
<
FormItem
key=
{
columnName
}
label=
{
this
.
renderLabel
(
item
)
}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment