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
dae7deda
Commit
dae7deda
authored
Apr 28, 2023
by
田翔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加台账选择器列表显示
parent
700f0cf1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
118 additions
and
9 deletions
+118
-9
index.js
src/core/Account/components/SearchGroup/index.js
+1
-1
index.js
src/core/Account/components/TablePack/index.js
+8
-3
settings.js
src/core/FormDesigner/config/settings.js
+8
-2
index.js
src/core/FormRender/index.js
+1
-0
index.js
src/core/widgets/business/AccountSelector/index.js
+16
-3
index.js
src/core/widgets/settings/groupSource/FieldList/index.js
+82
-0
index.js
src/core/widgets/settings/groupSource/index.js
+2
-0
No files found.
src/core/Account/components/SearchGroup/index.js
View file @
dae7deda
...
...
@@ -202,7 +202,7 @@ const SearchGroup = forwardRef((props, ref) => {
};
const
btnsClick
=
type
=>
{
props
&&
props
.
btnsClick
(
type
,
null
);
props
?.
btnsClick
?.
(
type
,
null
);
};
return
(
...
...
src/core/Account/components/TablePack/index.js
View file @
dae7deda
...
...
@@ -29,7 +29,7 @@ const TablePack = (props, ref) => {
setFilteredInfo
,
}))
const
{
parent
,
readOnly
,
config
,
loading
,
dataSource
,
rowSelection
,
onRow
,
tableChange
,
btnsClick
}
=
props
const
{
parent
,
readOnly
,
config
,
fieldList
,
loading
,
dataSource
,
rowSelection
,
onRow
,
tableChange
,
btnsClick
}
=
props
const
[
filteredInfo
,
setFilteredInfo
]
=
useState
({})
const
inputRef
=
useRef
()
...
...
@@ -126,7 +126,12 @@ const TablePack = (props, ref) => {
const
fileColumns
=
useMemo
(()
=>
{
const
{
webShowFieldGroup
,
formJson
}
=
config
let
showField
=
webShowFieldGroup
?
webShowFieldGroup
.
split
(
','
).
filter
(
v
=>
v
)
:
[]
let
showField
=
[]
if
(
Array
.
isArray
(
fieldList
)
&&
fieldList
.
length
>
0
)
{
showField
=
fieldList
}
else
{
showField
=
webShowFieldGroup
?
webShowFieldGroup
.
split
(
','
).
filter
(
v
=>
v
)
:
[]
}
let
json
=
getFileInfo
(
formJson
)
let
array
=
[]
showField
.
forEach
(
v
=>
{
...
...
@@ -157,7 +162,7 @@ const TablePack = (props, ref) => {
})
})
return
array
},
[
config
,
filteredInfo
])
},
[
config
,
fi
eldList
,
fi
lteredInfo
])
const
columns
=
useMemo
(()
=>
{
let
columns
=
[
...
...
src/core/FormDesigner/config/settings.js
View file @
dae7deda
...
...
@@ -1761,18 +1761,24 @@ const businessWidgets = [
name
:
'台账名称'
,
type
:
'string'
,
widget
:
'AccountName'
,
// required: true,
},
fieldshine
:
{
title
:
'映射字段'
,
name
:
'映射字段'
,
type
:
'array'
,
widget
:
'Fieldshine'
,
// required: true,
dependencies
:
[
'accountName'
,
'$id'
],
default
:
[],
description
:
'多字段映射仅支持单选'
,
},
fieldList
:
{
title
:
'前端显示字段'
,
type
:
'array'
,
default
:
[],
widget
:
'FieldList'
,
dependencies
:
[
'accountName'
,
'$id'
],
description
:
'默认获取前端台账字段'
,
},
siteFilter
:
{
title
:
'站点过滤'
,
name
:
'站点过滤'
,
...
...
src/core/FormRender/index.js
View file @
dae7deda
...
...
@@ -90,6 +90,7 @@ const XRender = (props, ref) => {
},
[
schemaForm
,
form
,
startTime
])
const
getValues
=
async
()
=>
{
console
.
log
(
'form'
,
form
)
let
{
data
,
errors
}
=
await
form
.
submit
()
let
formValue
=
[]
Object
.
keys
(
data
).
map
((
k
)
=>
{
...
...
src/core/widgets/business/AccountSelector/index.js
View file @
dae7deda
import
React
,
{
useState
,
useEffect
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
Input
,
message
,
Pagination
}
from
'antd'
import
{
SnippetsOutlined
}
from
'@ant-design/icons'
import
{
GetAccountConfigInfo
,
GetAccountPageList
,
getStationListByUserID
}
from
'../../../../apis/process'
...
...
@@ -12,7 +12,7 @@ const AccountSelector = (props) => {
const
userID
=
window
?.
globalConfig
?.
userInfo
?.
OID
||
1
const
{
value
,
onChange
,
schema
,
addons
}
=
props
const
{
disabled
,
accountName
,
fieldshine
,
siteFilter
,
sql
,
isMultiple
,
presetValue
,
placeholder
}
=
schema
const
{
disabled
,
accountName
,
fieldshine
,
siteFilter
,
sql
,
isMultiple
,
presetValue
,
placeholder
,
fieldList
}
=
schema
const
[
params
,
setParams
]
=
useState
({
userID
:
userID
,
...
...
@@ -28,6 +28,7 @@ const AccountSelector = (props) => {
const
[
config
,
setConfig
]
=
useState
({
webShowFieldGroup
:
''
})
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
keys
,
setKeys
]
=
useState
([])
const
tablePackRef
=
useRef
(
null
)
const
iconClick
=
()
=>
{
if
(
addons
)
{
...
...
@@ -154,6 +155,15 @@ const AccountSelector = (props) => {
getDataSource
({
...
values
})
}
const
btnsClick
=
(
type
)
=>
{
if
(
type
===
'重置'
)
{
console
.
log
(
'type'
,
type
)
tablePackRef
.
current
.
setFilteredInfo
({})
setParams
({
...
params
,
queryWheres
:
[]
})
getDataSource
({
queryWheres
:
[]
})
}
}
const
pageChange
=
(
pageIndex
,
pageSize
)
=>
{
getDataSource
({
pageIndex
,
pageSize
})
}
...
...
@@ -191,15 +201,18 @@ const AccountSelector = (props) => {
<
SearchGroup
onChange
=
{
search
}
readOnly
=
{
true
}
btnsClick
=
{
btnsClick
}
/
>
<
/div
>
<
div
className
=
{
styles
.
bottom
}
>
<
TablePack
ref
=
{
tablePackRef
}
loading
=
{
loading
}
readOnly
=
{
true
}
config
=
{
config
}
dataSource
=
{
dataSource
}
btnsClick
=
{()
=>
{
}}
btnsClick
=
{
btnsClick
}
fieldList
=
{
fieldList
}
tableChange
=
{
tableChange
}
parent
=
'台账选择器'
rowSelection
=
{{
...
...
src/core/widgets/settings/groupSource/FieldList/index.js
0 → 100644
View file @
dae7deda
import
React
,
{
useMemo
,
useState
}
from
'react'
import
{
Input
,
message
,
Row
,
Col
,
Checkbox
}
from
'antd'
import
Drag
from
'../../../../components/Drag'
import
{
GetAccountPageList
,
GetAccountConfigInfo
,
GetTableGroupMeta
,
GetTableDataInfo
,
SaveTableDataInfo
,
EditTableDataInfo
,
DeleteTableDataInfo
}
from
'../../../../../apis/process'
const
FieldList
=
(
props
)
=>
{
const
{
value
,
addons
,
onChange
}
=
props
const
{
accountName
}
=
addons
.
formData
const
[
visible
,
setVisible
]
=
useState
(
false
)
const
[
conifg
,
setConfig
]
=
useState
({})
const
options
=
useMemo
(()
=>
{
const
{
webShowFieldGroup
}
=
conifg
return
webShowFieldGroup
?
webShowFieldGroup
.
split
(
','
).
filter
(
v
=>
v
)
:
[]
},
[
conifg
])
const
getConfig
=
async
()
=>
{
const
{
code
,
data
}
=
await
GetAccountConfigInfo
(
accountName
)
if
(
code
===
0
)
{
setConfig
(
data
)
}
}
const
onOk
=
()
=>
{
setVisible
(
false
)
}
const
checkChange
=
(
value
)
=>
{
onChange
(
value
)
}
const
inputClick
=
()
=>
{
if
(
!
accountName
)
{
return
message
.
error
(
'请配置台账名称!'
)
}
getConfig
()
setVisible
(
true
)
}
return
(
<
div
>
<
Input
value
=
{
value
}
onClick
=
{
inputClick
}
/
>
<
Drag
title
=
'前端显示字段'
onOk
=
{
onOk
}
onCancel
=
{()
=>
setVisible
(
false
)}
visible
=
{
visible
}
>
<
Checkbox
.
Group
value
=
{
value
}
style
=
{{
width
:
'100%'
}}
onChange
=
{
checkChange
}
>
<
Row
>
{
options
.
map
(
v
=>
{
return
(
<
Col
span
=
{
8
}
>
<
Checkbox
value
=
{
v
}
>
{
v
}
<
/Checkbox
>
<
/Col
>
)
})
}
<
/Row
>
<
/Checkbox.Group
>
<
/Drag
>
<
/div
>
)
}
export
default
FieldList
\ No newline at end of file
src/core/widgets/settings/groupSource/index.js
View file @
dae7deda
...
...
@@ -6,6 +6,7 @@ import MappedField from './MappedField'
import
ControlRules
from
'./ControlRules'
import
SourceType
from
'./SourceType'
import
TableName
from
'./TableName'
import
FieldList
from
'./FieldList'
import
FieldName
from
'./FieldName'
import
CalculateRule
from
'./CalculateRule'
import
AddressSync
from
'./AddressSync'
...
...
@@ -21,6 +22,7 @@ const groupSource = {
ControlRules
,
SourceType
,
TableName
,
FieldList
,
FieldName
,
CalculateRule
,
AddressSync
,
...
...
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