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
ffd8373e
Commit
ffd8373e
authored
4 months ago
by
杨子龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表格组件
- 增加列固定配置 - 增加行点击事件
parent
b132ca42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
18 deletions
+78
-18
settings.js
src/core/FormDesigner/config/settings.js
+28
-16
index.js
src/core/widgets/coord/DataTable/index.js
+19
-1
index.js
src/core/widgets/settings/groupSource/StatusOption/index.js
+31
-1
No files found.
src/core/FormDesigner/config/settings.js
View file @
ffd8373e
...
...
@@ -4857,20 +4857,6 @@ const advancedWidgets = [
type
:
'string'
,
widget
:
'htmlInput'
,
},
optionWidth
:
{
title
:
"操作栏宽度"
,
type
:
"number"
,
default
:
120
},
optionRender
:
{
title
:
''
,
name
:
'操作栏内容配置'
,
type
:
'array'
,
default
:
[
{
type
:
"icon"
,
value
:
'DeleteOutlined'
,
action
:
"delete"
},
],
widget
:
'OptionRender'
,
},
pagination
:
{
title
:
'是否启用分页(关闭分页后,需要配制滚动)'
,
type
:
'boolean'
,
...
...
@@ -4882,14 +4868,40 @@ const advancedWidgets = [
type
:
'number'
,
widget
:
"inputNumber"
,
hidden
:
'{{formData.pagination}}'
,
required
:
true
},
scrollY
:
{
title
:
'y轴滚动'
,
type
:
'number'
,
widget
:
"inputNumber"
,
hidden
:
'{{formData.pagination}}'
,
required
:
true
},
optionWidth
:
{
title
:
"操作栏宽度"
,
type
:
"number"
,
default
:
120
},
optionFixed
:
{
title
:
"操作栏固定"
,
type
:
"string"
,
default
:
"false"
,
widget
:
'select'
,
enum
:
[
'false'
,
'left'
,
'right'
],
enumNames
:
[
'关闭固定'
,
'靠左'
,
'靠右'
],
},
optionRender
:
{
title
:
''
,
name
:
'操作栏内容配置'
,
type
:
'array'
,
default
:
[
{
type
:
"icon"
,
value
:
'DeleteOutlined'
,
action
:
"delete"
},
],
widget
:
'OptionRender'
,
},
isOpenRowEvent
:
{
title
:
'是否启动行点击事件'
,
type
:
'boolean'
,
widget
:
"switch"
,
default
:
true
,
},
hiddenCondition
:
{
title
:
'隐藏条件'
,
...
...
This diff is collapsed.
Click to expand it.
src/core/widgets/coord/DataTable/index.js
View file @
ffd8373e
...
...
@@ -21,7 +21,9 @@ const DataTable = props => {
scrollY
,
statusOption
,
areaTaskShine
,
optionWidth
optionWidth
,
optionFixed
,
isOpenRowEvent
}
=
schema
;
const
[
dataSource
,
setDataSource
]
=
useState
([]);
...
...
@@ -243,6 +245,7 @@ const DataTable = props => {
dataIndex,
key: dataIndex,
width: item.width || 120,
fixed: item.fixed || false,
render: (_, row, index) => {
return (
<Fragment>
...
...
@@ -263,6 +266,7 @@ const DataTable = props => {
dataIndex: '',
key: '',
width: optionWidth || 120,
fixed: optionFixed,
render: (_, row, index) => {
return getOptionRender(_, row, index);
},
...
...
@@ -323,6 +327,17 @@ const DataTable = props => {
window.relationForm.data = data;
};
const rowClickEvent = (record) => {
return {
onClick: () => {
eventEmitter.emit(`
$
{
addons
?.
dataPath
}
_event
`, {
...record,
action: "rowOnClick",
});
}
}
}
useEffect(() => {
eventEmitter.removeAllListeners(addons?.dataPath);
...
...
@@ -378,6 +393,9 @@ const DataTable = props => {
y: scrollY,
}
}
onRow={
record => isOpenRowEvent && rowClickEvent(record)
}
dataSource={dataSource}
/>
) : (
...
...
This diff is collapsed.
Click to expand it.
src/core/widgets/settings/groupSource/StatusOption/index.js
View file @
ffd8373e
...
...
@@ -62,12 +62,14 @@ const StatusOption = props => {
item
.
parseStr
=
currentItem
.
parseStr
;
item
.
isMapped
=
currentItem
.
isMapped
||
false
;
item
.
width
=
currentItem
.
width
||
120
;
item
.
fixed
=
currentItem
.
fixed
;
}
else
{
item
.
type
=
showType
(
current
?.
Widget
)
?
current
?
current
.
Widget
:
"文本"
:
'文本'
;
item
.
editType
=
current
?
current
.
Widget
:
"文本"
;
item
.
color
=
'rgb(65,68,69)'
;
item
.
isMapped
=
false
;
item
.
width
=
120
;
item
.
fixed
=
false
;
}
});
...
...
@@ -211,6 +213,34 @@ const StatusOption = props => {
);
},
},
{
title
:
'列固定'
,
dataIndex
:
'fixed'
,
width
:
80
,
render
:
(
r
,
_
,
i
)
=>
{
return
(
<
Select
value
=
{
r
||
"false"
}
options
=
{[
{
label
:
"靠左"
,
value
:
"left"
},
{
label
:
"靠右"
,
value
:
"right"
},
{
label
:
"关闭列固定"
,
value
:
"false"
}
]}
style
=
{{
width
:
'100%'
,
}}
onChange
=
{
e
=>
inputChange
(
e
,
i
,
'fixed'
,
_
)}
/
>
);
},
},
{
title
:
'样式映射'
,
dataIndex
:
'isMapped'
,
...
...
@@ -389,7 +419,7 @@ const StatusOption = props => {
ItemTypes
=
"stadingOrder"
color
=
{
color
}
scroll
=
{{
x
:
5
00
,
x
:
6
00
,
}}
columns
=
{
columns
}
pagination
=
{
false
}
...
...
This diff is collapsed.
Click to expand it.
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