Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xform
Project
Project
Details
Activity
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
田翔
xform
Commits
700f0cf1
Commit
700f0cf1
authored
Apr 27, 2023
by
田翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bug修复
parent
2e2c6966
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
175 deletions
+150
-175
index.js
src/core/Account/components/SearchGroup/index.js
+55
-54
search.less
src/core/Account/components/SearchGroup/search.less
+18
-72
index.js
src/core/Account/components/TablePack/index.js
+64
-45
index.js
src/core/Account/index.js
+7
-0
index.js
src/core/widgets/select/ComboBox/index.js
+6
-4
No files found.
src/core/Account/components/SearchGroup/index.js
View file @
700f0cf1
...
...
@@ -206,62 +206,63 @@ const SearchGroup = forwardRef((props, ref) => {
};
return
(
<
div
className
=
{
styles
.
accountFlexWrapper
}
>
<
Row
className
=
{
styles
.
controlRow
}
>
<
Form
layout
=
{
'horizontal'
}
form
=
{
form
}
onValuesChange
=
{
onValuesChange
}
>
<
Space
className
=
{
styles
.
controlRowLeft
}
wrap
>
{
showPicker
?
(
<
Form
.
Item
label
=
{
`录入时间`
}
name
=
"time"
className
=
{
styles
.
noMarginBottom
}
>
<
RangePicker
size
=
"middle"
value
=
{[...
dateArray
]}
locale
=
{
locale
}
// defaultValue={rangerOptions[timeQuantumStr]}
showTime
=
{
formatterStr
===
'YYYY-MM-DD HH:mm:ss'
}
ranges
=
{{
...
rangerOptions
}}
format
=
{
formatterStr
}
style
=
{{
width
:
300
}}
// onChange={dateChange}
/
>
<
/Form.Item
>
)
:
(
''
)}
<
Form
.
Item
label
=
{
'快捷搜索'
}
name
=
"info"
className
=
{
styles
.
noMarginBottom
}
>
<
Search
<
Row
className
=
{
styles
.
controlRow
}
>
<
Form
layout
=
{
'inline'
}
form
=
{
form
}
onValuesChange
=
{
onValuesChange
}
>
{
showPicker
?
(
<
Form
.
Item
label
=
{
`录入时间`
}
name
=
"time"
style
=
{{
marginBottom
:
0
}}
>
<
RangePicker
size
=
"middle"
style
=
{{
width
:
320
,
verticalAlign
:
'middle'
,
marginLeft
:
'10px'
,
}}
placeholder
=
"请输入值"
onSearch
=
{
onSearch
}
value
=
{[...
dateArray
]}
locale
=
{
locale
}
// defaultValue={rangerOptions[timeQuantumStr]}
showTime
=
{
formatterStr
===
'YYYY-MM-DD HH:mm:ss'
}
ranges
=
{{
...
rangerOptions
}}
format
=
{
formatterStr
}
style
=
{{
width
:
300
}}
// onChange={dateChange}
/
>
<
/Form.Item
>
<
/Space
>
<
/Form
>
{
/* 按钮区域 */
}
<
div
className
=
{
styles
.
controlRowRight
}
>
<
div
className
=
{
styles
.
controlBtns
}
>
{
!
readOnly
?
(
<
Button
type
=
"primary"
size
=
"middle"
onClick
=
{()
=>
btnsClick
(
'添加'
)}
icon
=
{
<
PlusOutlined
/>
}
style
=
{{
marginLeft
:
20
}}
>
添加
<
/Button
>
)
:
null
}
<
/div
>
)
:
null
}
<
Form
.
Item
label
=
{
'快捷搜索'
}
name
=
"info"
style
=
{{
marginBottom
:
0
}}
>
<
Search
size
=
"middle"
style
=
{{
width
:
320
,
verticalAlign
:
'middle'
,
marginLeft
:
'10px'
,
}}
placeholder
=
"请输入值"
onSearch
=
{
onSearch
}
/
>
<
/Form.Item
>
<
Form
.
Item
style
=
{{
marginBottom
:
0
}}
>
<
Button
type
=
"primary"
onClick
=
{()
=>
btnsClick
(
'重置'
)}
>
重置
<
/Button
>
<
/Form.Item
>
<
/Form
>
{
/* 按钮区域 */
}
<
div
className
=
{
styles
.
controlRowRight
}
>
<
div
className
=
{
styles
.
controlBtns
}
>
{
!
readOnly
?
(
<
Button
type
=
"primary"
size
=
"middle"
onClick
=
{()
=>
btnsClick
(
'添加'
)}
icon
=
{
<
PlusOutlined
/>
}
style
=
{{
marginLeft
:
20
}}
>
添加
<
/Button
>
)
:
null
}
<
/div
>
<
/
Row
>
<
/
div
>
)
;
})
;
<
/
div
>
<
/
Row
>
)
})
export
default
SearchGroup
;
export
default
SearchGroup
src/core/Account/components/SearchGroup/search.less
View file @
700f0cf1
.
accountFlexWrapper
{
.
controlRow
{
width: 100%;
height: 100%;
//min-height: 630px;
height: 100%;
display: flex;
flex-direction: column;
.controlRow {
justify-content: space-between;
align-items: center;
background: #ffffff;
.controlRowRight {
max-width: 30%;
display: flex;
justify-content: space-between;
background: #ffffff;
margin: 8px;
// padding: 8px;
gap: 10px;
:global {
.panda-civ-water-form-horizontal {
max-width: 68%;
}
}
.controlRowLeft {
flex: 1;
}
.controlRowRight {
// max-width: 230px;
max-width: 30%;
align-items: flex-end;
.controlBtns {
display: flex;
align-items: flex-end;
.controlBtns {
justify-content: flex-end;
}
:global {
.panda-civ-water-dropdown-button {
display: flex;
justify-content: flex-end;
}
:global {
.panda-civ-water-dropdown-button {
display: flex;
justify-content: flex-end;
}
}
}
.noMarginBottom {
margin-bottom: 0;
:global {
.panda-civ-water-form-item-control-input-content {
display: flex;
}
}
}
}
.accountManageControlWrapper {
position: relative;
padding: 6px 10px;
margin: 8px 8px 10px;
background: #fff;
.firstRow {
.searchBtn {
margin-left: 10px;
margin-right: 10px;
.noMarginBottom {
margin-bottom: 0;
:global {
.panda-civ-water-form-item-control-input-content {
display: flex;
}
}
.collapseButton {
display: flex;
justify-content: center;
align-items: center;
background: #ffffff;
color: rgba(0, 0, 0, .65);
padding: 0;
position: absolute;
height: 10px;
width: 25px;
left: 0;
bottom: -10px;
border: 1px solid rgba(0, 0, 0, .2);
border-top: none;
cursor: pointer;
}
}
.accountTableWrapper {
flex: 1;
padding: 8px 8px 0px 8px;
margin: 0px 8px 8px;
background: #fff;
overflow: hidden;
.buttonHover:hover {
opacity: 0.6;
}
}
}
\ No newline at end of file
src/core/Account/components/TablePack/index.js
View file @
700f0cf1
import
React
,
{
useMemo
,
use
Ref
}
from
'react'
import
{
Table
,
Tooltip
,
Button
,
Popconfirm
,
Input
,
Space
}
from
'antd'
import
React
,
{
useMemo
,
use
State
,
useRef
,
forwardRef
,
useImperativeHandle
}
from
'react'
import
{
Table
,
Tooltip
,
Button
,
Popconfirm
,
Input
,
Space
,
useTable
}
from
'antd'
import
{
SearchOutlined
}
from
'@ant-design/icons'
import
FileView
from
'./components/FileView'
import
CoordView
from
'./components/CoordView'
...
...
@@ -23,10 +23,15 @@ const getFileInfo = (formJson) => {
return
obj
}
const
TablePack
=
(
props
)
=>
{
const
TablePack
=
(
props
,
ref
)
=>
{
useImperativeHandle
(
ref
,
()
=>
({
setFilteredInfo
,
}))
const
{
parent
,
readOnly
,
config
,
loading
,
dataSource
,
rowSelection
,
onRow
,
tableChange
,
btnsClick
}
=
props
const
searchInput
=
useRef
(
null
)
const
[
filteredInfo
,
setFilteredInfo
]
=
useState
({})
const
inputRef
=
useRef
()
const
handleReset
=
(
clearFilters
,
confirm
)
=>
{
clearFilters
()
...
...
@@ -34,43 +39,57 @@ const TablePack = (props) => {
}
const
getColumnSearchProps
=
(
dataIndex
)
=>
({
filterDropdown
:
({
setSelectedKeys
,
selectedKeys
,
confirm
,
clearFilters
,
close
})
=>
(
<
div
style
=
{{
padding
:
8
}}
onKeyDown
=
{(
e
)
=>
e
.
stopPropagation
()}
>
<
Input
ref
=
{
searchInput
}
placeholder
=
{
`搜索
${
dataIndex
}
`
}
value
=
{
selectedKeys
[
0
]}
onChange
=
{
e
=>
setSelectedKeys
(
e
.
target
.
value
?
[
e
.
target
.
value
]
:
[])}
onPressEnter
=
{()
=>
confirm
({
closeDropdown
:
true
})}
style
=
{{
marginBottom
:
8
,
display
:
'block'
,
width
:
'280px'
,
}}
/
>
<
Space
>
<
Button
type
=
"primary"
onClick
=
{()
=>
confirm
({
closeDropdown
:
true
})}
icon
=
{
<
SearchOutlined
/>
}
size
=
"small"
style
=
{{
width
:
90
}}
>
搜索
<
/Button
>
<
Button
onClick
=
{()
=>
handleReset
(
clearFilters
,
confirm
)}
size
=
"small"
style
=
{{
width
:
90
}}
>
重置
<
/Button
>
<
/Space
>
<
/div
>
),
filterDropdown
:
({
setSelectedKeys
,
selectedKeys
,
confirm
,
clearFilters
,
close
})
=>
{
return
(
<
div
style
=
{{
padding
:
8
}}
onKeyDown
=
{(
e
)
=>
e
.
stopPropagation
()}
>
<
Input
ref
=
{
inputRef
}
placeholder
=
{
`搜索
${
dataIndex
}
`
}
value
=
{
selectedKeys
[
0
]}
onChange
=
{
e
=>
{
setSelectedKeys
(
e
.
target
.
value
?
[
e
.
target
.
value
]
:
[])
}}
onPressEnter
=
{()
=>
{
setFilteredInfo
({
...
filteredInfo
,
[
dataIndex
]:
selectedKeys
[
0
]
})
confirm
({
closeDropdown
:
true
})
}}
style
=
{{
marginBottom
:
8
,
display
:
'block'
,
width
:
'280px'
,
}}
/
>
<
Space
>
<
Button
type
=
"primary"
onClick
=
{()
=>
{
setFilteredInfo
({
...
filteredInfo
,
[
dataIndex
]:
selectedKeys
[
0
]
})
confirm
({
closeDropdown
:
true
})
}}
icon
=
{
<
SearchOutlined
/>
}
size
=
"small"
style
=
{{
width
:
90
}}
>
搜索
<
/Button
>
<
Button
onClick
=
{()
=>
{
setFilteredInfo
({
...
filteredInfo
,
[
dataIndex
]:
[]
})
clearFilters
()
confirm
({
closeDropdown
:
true
})
}}
size
=
"small"
style
=
{{
width
:
90
}}
>
重置
<
/Button
>
<
/Space
>
<
/div
>
)
},
filterIcon
:
(
filtered
)
=>
(
<
SearchOutlined
style
=
{{
...
...
@@ -117,7 +136,7 @@ const TablePack = (props) => {
width
:
120
,
ellipsis
:
true
,
sorter
:
true
,
filter
Search
:
true
,
filter
edValue
:
filteredInfo
[
v
]
||
null
,
...
getColumnSearchProps
(
v
),
render
:
(
value
,
r
)
=>
{
let
props
=
{
...
json
[
v
],
value
}
...
...
@@ -138,7 +157,7 @@ const TablePack = (props) => {
})
})
return
array
},
[
config
])
},
[
config
,
filteredInfo
])
const
columns
=
useMemo
(()
=>
{
let
columns
=
[
...
...
@@ -221,4 +240,4 @@ const TablePack = (props) => {
}
export
default
TablePack
\ No newline at end of file
export
default
forwardRef
(
TablePack
)
\ No newline at end of file
src/core/Account/index.js
View file @
700f0cf1
...
...
@@ -37,6 +37,7 @@ const Account = (props) => {
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
)
const
[
operation
,
setOperation
]
=
useState
({
id
:
null
,
state
:
'添加'
})
const
formRenderRef
=
useRef
()
const
tablePackRef
=
useRef
()
const
btnsClick
=
async
(
type
,
id
)
=>
{
const
{
addFieldGroup
,
editFieldGroup
,
formJson
}
=
config
...
...
@@ -46,6 +47,11 @@ const Account = (props) => {
if
(
type
===
'添加'
)
{
saveClick
(
addField
,
formJson
,
[],
type
)
}
if
(
type
===
'重置'
)
{
tablePackRef
.
current
.
setFilteredInfo
({})
setParams
({
...
params
,
queryWheres
:
[]
})
getDataSource
({
queryWheres
:
[]
})
}
if
(
type
===
'编辑'
||
type
===
'详情'
)
{
const
{
code
,
data
,
msg
}
=
await
GetTableDataInfo
({
accountName
,
id
})
if
(
code
===
0
)
{
...
...
@@ -197,6 +203,7 @@ const Account = (props) => {
dataSource
=
{
dataSource
}
btnsClick
=
{
btnsClick
}
tableChange
=
{
tableChange
}
ref
=
{
tablePackRef
}
/
>
<
/div
>
<
/div
>
...
...
src/core/widgets/select/ComboBox/index.js
View file @
700f0cf1
...
...
@@ -65,10 +65,12 @@ const ComboBox = (props) => {
},
[
sourceType
,
enums
,
isStoreID
])
const
handleChange
=
(
value
)
=>
{
if
(
isMultiple
||
isEdit
)
{
onChange
(
value
.
join
(
','
)
||
''
)
}
else
{
onChange
(
value
||
''
)
if
(
addons
)
{
if
(
isMultiple
||
isEdit
)
{
onChange
(
value
.
join
(
','
)
||
''
)
}
else
{
onChange
(
value
||
''
)
}
}
}
...
...
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