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
eb7aeced
Commit
eb7aeced
authored
Dec 05, 2024
by
杨子龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化控件
parent
1786c99f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
36 deletions
+41
-36
settings.js
src/core/FormDesigner/config/settings.js
+3
-1
index.jsx
src/core/widgets/advanced/IndicatorCard/index.jsx
+1
-1
index.js
src/core/widgets/coord/DataTable/index.js
+9
-5
index.js
...ore/widgets/settings/groupSource/IndicatorDevice/index.js
+2
-2
index.js
src/core/widgets/settings/groupSource/IndicatorType/index.js
+4
-4
index.js
src/core/widgets/settings/groupSource/StatusOption/index.js
+22
-23
No files found.
src/core/FormDesigner/config/settings.js
View file @
eb7aeced
...
...
@@ -4838,7 +4838,7 @@ const advancedWidgets = [
widget
:
'OptionRender'
,
},
pagination
:
{
title
:
'是否启用分页'
,
title
:
'是否启用分页
(关闭分页后,需要配制滚动)
'
,
type
:
'boolean'
,
widget
:
"switch"
,
default
:
true
,
...
...
@@ -4848,12 +4848,14 @@ const advancedWidgets = [
type
:
'number'
,
widget
:
"inputNumber"
,
hidden
:
'{{formData.pagination}}'
,
required
:
true
},
scrollY
:
{
title
:
'y轴滚动'
,
type
:
'number'
,
widget
:
"inputNumber"
,
hidden
:
'{{formData.pagination}}'
,
required
:
true
},
hiddenCondition
:
{
title
:
'隐藏条件'
,
...
...
src/core/widgets/advanced/IndicatorCard/index.jsx
View file @
eb7aeced
...
...
@@ -57,7 +57,7 @@ const IndicatorCard = props => {
name
:
child
.
dName
,
value
:
child
.
pv
,
time
:
item
.
pt
,
unit
:
window
.
_IndicatorType
[
child
.
dName
]
unit
:
schema
.
_IndicatorType
[
child
.
dName
]
})
}
})
...
...
src/core/widgets/coord/DataTable/index.js
View file @
eb7aeced
...
...
@@ -173,8 +173,9 @@ const DataTable = props => {
if
(
item
.
fieldType
===
'台账'
&&
schema
?.
widget
===
'FileUpload'
)
{
arr
.
push
({
title
:
item
.
fieldAliasName
,
dataIndex
:
isGIS
?
item
.
fieldName
:
`
${
item
.
fieldType
}
-
${
item
.
fieldName
}
`
,
key
:
isGIS
?
item
.
fieldName
:
`
${
item
.
fieldType
}
-
${
item
.
fieldName
}
`
,
dataIndex
:
!
isGIS
?
item
.
fieldName
:
`
${
item
.
fieldType
}
-
${
item
.
fieldName
}
`
,
key
:
!
isGIS
?
item
.
fieldName
:
`
${
item
.
fieldType
}
-
${
item
.
fieldName
}
`
,
width
:
item
.
width
||
120
,
render
:
(
_
,
row
)
=>
{
return
<
FileView
value
=
{
row
[
`
${
item
.
fieldType
}
-
${
item
.
fieldName
}
`
]}
{...
schema
}
/>
;
},
...
...
@@ -182,12 +183,13 @@ const DataTable = props => {
}
else
if
(
item
.
fieldType
===
'台账'
&&
item
.
fieldName
===
'反馈状态'
)
{
//统一最后一行添加
}
else
{
const
dataIndex
=
isGIS
?
item
.
fieldName
:
`
${
item
.
fieldType
}
-
${
item
.
fieldName
}
`
;
const
dataIndex
=
!
isGIS
?
item
.
fieldName
:
`
${
item
.
fieldType
}
-
${
item
.
fieldName
}
`
;
arr
.
push
({
title
:
item
.
fieldAliasName
,
dataIndex
,
key
:
dataIndex
,
width
:
item
.
width
||
120
,
render
:
(
_
,
row
,
index
)
=>
{
return
(
<
Fragment
>
...
...
@@ -209,6 +211,7 @@ const DataTable = props => {
title
:
'操作'
,
dataIndex
:
''
,
key
:
''
,
width
:
120
,
render
:
(
_
,
row
,
index
)
=>
{
return
getOptionRender
(
_
,
row
,
index
);
},
...
...
@@ -250,10 +253,11 @@ const DataTable = props => {
rowKey
=
{
disabled
?
'gis-设备编号'
:
'ID'
}
bordered
columns
=
{
columns
}
pagination
=
{
!
pagination
?
{
pagination
=
{
pagination
}
scroll
=
{
!
pagination
&&
{
x
:
scrollX
,
y
:
scrollY
}
:
true
}
}}
dataSource
=
{
value
}
/
>
)
:
(
...
...
src/core/widgets/settings/groupSource/IndicatorDevice/index.js
View file @
eb7aeced
...
...
@@ -22,7 +22,7 @@ const IndicatorDevice = (props) => {
if
(
ret
.
code
===
0
){
ret
.
data
.
list
.
forEach
(
item
=>
{
arr
.
push
({
label
:
`
${
item
.
sN
ame
}
(
${
item
.
code
}
)`
,
label
:
`
${
item
.
n
ame
}
(
${
item
.
code
}
)`
,
key
:
item
.
code
,
value
:
item
.
code
,
extra
:
item
.
dataList
...
...
@@ -50,7 +50,7 @@ const IndicatorDevice = (props) => {
optionFilterProp
=
{
"label"
}
onChange
=
{(
value
,
option
)
=>
{
if
(
value
){
window
.
_IndicatorDeviceExtra
=
option
.
extra
;
addons
.
formData
.
_IndicatorDeviceExtra
=
option
.
extra
;
}
onChange
(
value
)
...
...
src/core/widgets/settings/groupSource/IndicatorType/index.js
View file @
eb7aeced
...
...
@@ -3,14 +3,14 @@ import { GetSensorType } from "../../../../../apis/process";
import
{
Select
}
from
'antd'
;
const
IndicatorType
=
(
props
)
=>
{
const
{
onChange
,
value
,
addons
,
schema
}
=
props
;
const
{
onChange
,
value
,
addons
,
schema
}
=
props
;
const
{
deviceCode
}
=
addons
.
formData
;
const
[
options
,
setOptions
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
_IndicatorDeviceExtra
:
[]}
=
window
;
const
getSensorList
=
async
()
=>
{
setLoading
(
true
);
const
_IndicatorDeviceExtra
=
addons
.
formData
.
_IndicatorDeviceExtra
||
[];
const
ret
=
await
GetSensorType
();
const
arr
=
[]
,
obj
=
{};
...
...
@@ -18,7 +18,7 @@ const IndicatorType = (props) => {
if
(
ret
.
code
===
0
){
const
{
data
}
=
ret
;
_IndicatorDeviceExtra
.
forEach
((
extraItem
,
index
)
=>
{
_IndicatorDeviceExtra
?
.
forEach
((
extraItem
,
index
)
=>
{
const
currenItem
=
data
.
find
(
item
=>
extraItem
.
typeID
===
item
.
id
);
let
unit
;
...
...
@@ -36,7 +36,7 @@ const IndicatorType = (props) => {
}
setOptions
(
arr
);
window
.
_IndicatorType
=
obj
;
addons
.
formData
.
_IndicatorType
=
obj
;
setLoading
(
false
);
}
...
...
src/core/widgets/settings/groupSource/StatusOption/index.js
View file @
eb7aeced
import
React
,
{
useState
,
useEffect
,
useMemo
,
Fragment
}
from
'react'
import
styles
from
'./index.less'
import
{
Switch
,
Input
,
Popconfirm
,
Popover
,
Select
,
Button
,
Space
}
from
'antd'
import
{
Switch
,
Input
,
Popconfirm
,
Popover
,
Select
,
Button
,
Space
,
InputNumber
}
from
'antd'
import
DragTable
from
'../../../../components/DragTable'
import
{
CheckOutlined
,
SettingOutlined
}
from
'@ant-design/icons'
;
import
{
colors
}
from
'../../../../../constant'
...
...
@@ -8,21 +8,6 @@ import { getNanoid } from '../../../../../utils'
import
{
SketchPicker
}
from
'react-color'
import
Drag
from
"../../../../components/Drag"
;
function
getSelectOption
(
list
)
{
if
(
list
){
const
arr
=
[...
list
];
arr
?.
forEach
(
item
=>
{
item
.
label
=
item
.
fieldName
;
item
.
value
=
item
.
fieldName
;
})
return
arr
}
else
{
return
[]
}
}
function
getTableData
(
list
)
{
if
(
list
){
const
arr
=
[...
list
];
...
...
@@ -47,8 +32,6 @@ const StatusOption = (props) => {
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
parseObj
,
setParseObj
]
=
useState
(
`{"key": {"color": "" , "label": ""}}`
);
const
options
=
getSelectOption
(
fieldList
);
const
data
=
value
?.
length
?
value
:
getTableData
(
fieldList
);
const
initData
=
()
=>
{
...
...
@@ -58,10 +41,12 @@ const StatusOption = (props) => {
if
(
currentItem
){
item
.
color
=
currentItem
.
color
;
item
.
type
=
currentItem
.
type
;
item
.
width
=
currentItem
.
width
;
}
else
{
item
.
type
=
"text"
;
item
.
color
=
"rgb(65,68,69)"
;
item
.
isMapped
=
false
;
item
.
width
=
120
;
}
});
...
...
@@ -145,13 +130,12 @@ const StatusOption = (props) => {
{
title
:
'字段'
,
dataIndex
:
'fieldName'
,
width
:
6
0
,
width
:
10
0
,
render
:
(
r
,
_
,
i
)
=>
{
return
(
<
Select
options
=
{
options
}
disabled
value
=
{
r
}
style
=
{{
<
Input
disabled
value
=
{
r
}
style
=
{{
width
:
"100%"
}}
/
>
)
...
...
@@ -181,6 +165,21 @@ const StatusOption = (props) => {
)
}
},
{
title
:
'表头宽度'
,
dataIndex
:
'width'
,
width
:
100
,
render
:
(
r
,
_
,
i
)
=>
{
return
(
<
InputNumber
value
=
{
r
||
120
}
style
=
{{
width
:
"100%"
}}
onPressEnter
=
{()
=>
onPressEnter
(
i
)}
onChange
=
{(
e
)
=>
inputChange
(
e
,
i
,
"width"
,
_
)}
/
>
)
}
},
{
title
:
'样式映射'
,
dataIndex
:
'isMapped'
,
...
...
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