Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
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
ReactWeb5
wisdom-components
Commits
9b6bda81
Commit
9b6bda81
authored
Jun 25, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 组态实时值增加单位设置
parent
d4cfd50a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
225 additions
and
99 deletions
+225
-99
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+75
-33
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+75
-33
configuration_custom.js
...mponents/EC_ConfigurationView/src/configuration_custom.js
+75
-33
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
9b6bda81
...
...
@@ -1289,10 +1289,10 @@ const ConfigurationView = (props) => {
const
padding
=
v
?
v
.
split
(
','
)
:
null
;
return
padding
?
new
go
.
Margin
(
padding
[
0
]
*
1
||
0
,
padding
[
1
]
*
1
||
0
,
padding
[
2
]
*
1
||
0
,
padding
[
3
]
*
1
||
0
,
padding
?.
[
0
]
*
1
||
0
,
padding
?.
[
1
]
*
1
||
0
,
padding
?.
[
2
]
*
1
||
0
,
padding
?.
[
3
]
*
1
||
0
,
)
:
0
;
}).
makeTwoWay
(),
...
...
@@ -1915,35 +1915,77 @@ const ConfigurationView = (props) => {
new
go
.
Binding
(
'angle'
).
makeTwoWay
(),
roleVisibleBinding
(),
// 绑定角色可见
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
{
name
:
'SHAPE'
,
strokeWidth
:
10
,
stroke
:
'#000000'
,
parameter1
:
0
},
new
go
.
Binding
(
'fill'
,
'fillColor'
),
new
go
.
Binding
(
'stroke'
),
new
go
.
Binding
(
'strokeWidth'
),
new
go
.
Binding
(
'parameter1'
,
'radius'
).
makeTwoWay
(),
new
go
.
Binding
(
'desiredSize'
,
'size'
,
go
.
Size
.
parse
).
makeTwoWay
(
go
.
Size
.
stringify
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
maxSize
:
new
go
.
Size
(
NaN
,
NaN
),
minSize
:
new
go
.
Size
(
NaN
,
1
),
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
true
,
font
:
'bold 12px Helvetica, Arial, sans-serif'
,
stroke
:
'#454545'
,
flip
:
go
.
GraphObject
.
None
,
},
new
go
.
Binding
(
'text'
,
'showVal'
),
new
go
.
Binding
(
'font'
,
'fontStyle'
),
new
go
.
Binding
(
'stroke'
,
'fontStroke'
),
new
go
.
Binding
(
'textAlign'
,
'fontAlign'
),
new
go
.
Binding
(
'maxSize'
,
'textSize'
),
new
go
.
Binding
(
'minSize'
,
'textSize'
),
new
go
.
Binding
(
'flip'
,
'flip'
),
go
.
Panel
,
'Horizontal'
,
goJS
(
go
.
Panel
,
'Auto'
,
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
{
name
:
'SHAPE'
,
strokeWidth
:
10
,
stroke
:
'#000000'
,
parameter1
:
0
},
new
go
.
Binding
(
'fill'
,
'fillColor'
),
new
go
.
Binding
(
'stroke'
),
new
go
.
Binding
(
'strokeWidth'
),
new
go
.
Binding
(
'parameter1'
,
'radius'
).
makeTwoWay
(),
new
go
.
Binding
(
'desiredSize'
,
'size'
,
go
.
Size
.
parse
).
makeTwoWay
(
go
.
Size
.
stringify
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
maxSize
:
new
go
.
Size
(
NaN
,
NaN
),
minSize
:
new
go
.
Size
(
NaN
,
1
),
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
true
,
font
:
'bold 12px Helvetica, Arial, sans-serif'
,
stroke
:
'#454545'
,
flip
:
go
.
GraphObject
.
None
,
},
new
go
.
Binding
(
'text'
,
'showVal'
),
new
go
.
Binding
(
'font'
,
'fontStyle'
),
new
go
.
Binding
(
'stroke'
,
'fontStroke'
),
new
go
.
Binding
(
'textAlign'
,
'fontAlign'
),
new
go
.
Binding
(
'maxSize'
,
'textSize'
),
new
go
.
Binding
(
'minSize'
,
'textSize'
),
new
go
.
Binding
(
'flip'
,
'flip'
),
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
false
,
font
:
'normal 10px Helvetica,Arial,sans-serif'
,
stroke
:
'#ffffff'
,
},
new
go
.
Binding
(
'text'
,
'unitText'
),
new
go
.
Binding
(
'font'
,
''
,
(
v
)
=>
{
return
`normal
${
v
?.
unitSize
||
10
}
pt
$
{
v
?.
unitStyle
||
'Helvetica,Arial,sans-serif'
}
`;
}),
new go.Binding('stroke', 'unitColor'),
new go.Binding('visible', '', (v) => {
return (v?.unitSwitch && !!v?.unitText) || false;
}),
new go.Binding('margin', '', (v) => {
const unitGap = v?.unitGap || '0,0,0,5';
if (unitGap && isNumber(unitGap)) return unitGap;
const margin = unitGap?.split(',') || null;
return margin
? new go.Margin(
margin?.[0] * 1 || 0,
margin?.[1] * 1 || 0,
margin?.[2] * 1 || 0,
margin?.[3] * 1 || 0,
)
: 0;
}),
),
),
{
click(e, node) {
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
9b6bda81
...
...
@@ -1856,10 +1856,10 @@ const ConfigurationView = (props) => {
const
padding
=
v
?
v
.
split
(
','
)
:
null
;
return
padding
?
new
go
.
Margin
(
padding
[
0
]
*
1
||
0
,
padding
[
1
]
*
1
||
0
,
padding
[
2
]
*
1
||
0
,
padding
[
3
]
*
1
||
0
,
padding
?.
[
0
]
*
1
||
0
,
padding
?.
[
1
]
*
1
||
0
,
padding
?.
[
2
]
*
1
||
0
,
padding
?.
[
3
]
*
1
||
0
,
)
:
0
;
}).
makeTwoWay
(),
...
...
@@ -2532,35 +2532,77 @@ const ConfigurationView = (props) => {
new
go
.
Binding
(
'angle'
).
makeTwoWay
(),
roleVisibleBinding
(),
// 绑定角色可见
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
{
name
:
'SHAPE'
,
strokeWidth
:
10
,
stroke
:
'#000000'
,
parameter1
:
0
},
new
go
.
Binding
(
'fill'
,
'fillColor'
),
new
go
.
Binding
(
'stroke'
),
new
go
.
Binding
(
'strokeWidth'
),
new
go
.
Binding
(
'parameter1'
,
'radius'
).
makeTwoWay
(),
new
go
.
Binding
(
'desiredSize'
,
'size'
,
go
.
Size
.
parse
).
makeTwoWay
(
go
.
Size
.
stringify
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
maxSize
:
new
go
.
Size
(
NaN
,
NaN
),
minSize
:
new
go
.
Size
(
NaN
,
1
),
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
true
,
font
:
'bold 12px Helvetica, Arial, sans-serif'
,
stroke
:
'#454545'
,
flip
:
go
.
GraphObject
.
None
,
},
new
go
.
Binding
(
'text'
,
'showVal'
),
new
go
.
Binding
(
'font'
,
'fontStyle'
),
new
go
.
Binding
(
'stroke'
,
'fontStroke'
),
new
go
.
Binding
(
'textAlign'
,
'fontAlign'
),
new
go
.
Binding
(
'maxSize'
,
'textSize'
),
new
go
.
Binding
(
'minSize'
,
'textSize'
),
new
go
.
Binding
(
'flip'
,
'flip'
),
go
.
Panel
,
'Horizontal'
,
goJS
(
go
.
Panel
,
'Auto'
,
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
{
name
:
'SHAPE'
,
strokeWidth
:
10
,
stroke
:
'#000000'
,
parameter1
:
0
},
new
go
.
Binding
(
'fill'
,
'fillColor'
),
new
go
.
Binding
(
'stroke'
),
new
go
.
Binding
(
'strokeWidth'
),
new
go
.
Binding
(
'parameter1'
,
'radius'
).
makeTwoWay
(),
new
go
.
Binding
(
'desiredSize'
,
'size'
,
go
.
Size
.
parse
).
makeTwoWay
(
go
.
Size
.
stringify
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
maxSize
:
new
go
.
Size
(
NaN
,
NaN
),
minSize
:
new
go
.
Size
(
NaN
,
1
),
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
true
,
font
:
'bold 12px Helvetica, Arial, sans-serif'
,
stroke
:
'#454545'
,
flip
:
go
.
GraphObject
.
None
,
},
new
go
.
Binding
(
'text'
,
'showVal'
),
new
go
.
Binding
(
'font'
,
'fontStyle'
),
new
go
.
Binding
(
'stroke'
,
'fontStroke'
),
new
go
.
Binding
(
'textAlign'
,
'fontAlign'
),
new
go
.
Binding
(
'maxSize'
,
'textSize'
),
new
go
.
Binding
(
'minSize'
,
'textSize'
),
new
go
.
Binding
(
'flip'
,
'flip'
),
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
false
,
font
:
'normal 10px Helvetica,Arial,sans-serif'
,
stroke
:
'#ffffff'
,
},
new
go
.
Binding
(
'text'
,
'unitText'
),
new
go
.
Binding
(
'font'
,
''
,
(
v
)
=>
{
return
`normal
${
v
?.
unitSize
||
10
}
pt
$
{
v
?.
unitStyle
||
'Helvetica,Arial,sans-serif'
}
`;
}),
new go.Binding('stroke', 'unitColor'),
new go.Binding('visible', '', (v) => {
return (v?.unitSwitch && !!v?.unitText) || false;
}),
new go.Binding('margin', '', (v) => {
const unitGap = v?.unitGap || '0,0,0,5';
if (unitGap && isNumber(unitGap)) return unitGap;
const margin = unitGap?.split(',') || null;
return margin
? new go.Margin(
margin?.[0] * 1 || 0,
margin?.[1] * 1 || 0,
margin?.[2] * 1 || 0,
margin?.[3] * 1 || 0,
)
: 0;
}),
),
),
{
click(e, node) {
...
...
packages/extend-components/EC_ConfigurationView/src/configuration_custom.js
View file @
9b6bda81
...
...
@@ -1862,10 +1862,10 @@ const ConfigurationView = (props) => {
const
padding
=
v
?
v
.
split
(
','
)
:
null
;
return
padding
?
new
go
.
Margin
(
padding
[
0
]
*
1
||
0
,
padding
[
1
]
*
1
||
0
,
padding
[
2
]
*
1
||
0
,
padding
[
3
]
*
1
||
0
,
padding
?.
[
0
]
*
1
||
0
,
padding
?.
[
1
]
*
1
||
0
,
padding
?.
[
2
]
*
1
||
0
,
padding
?.
[
3
]
*
1
||
0
,
)
:
0
;
}).
makeTwoWay
(),
...
...
@@ -2538,35 +2538,77 @@ const ConfigurationView = (props) => {
new
go
.
Binding
(
'angle'
).
makeTwoWay
(),
roleVisibleBinding
(),
// 绑定角色可见
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
{
name
:
'SHAPE'
,
strokeWidth
:
10
,
stroke
:
'#000000'
,
parameter1
:
0
},
new
go
.
Binding
(
'fill'
,
'fillColor'
),
new
go
.
Binding
(
'stroke'
),
new
go
.
Binding
(
'strokeWidth'
),
new
go
.
Binding
(
'parameter1'
,
'radius'
).
makeTwoWay
(),
new
go
.
Binding
(
'desiredSize'
,
'size'
,
go
.
Size
.
parse
).
makeTwoWay
(
go
.
Size
.
stringify
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
maxSize
:
new
go
.
Size
(
NaN
,
NaN
),
minSize
:
new
go
.
Size
(
NaN
,
1
),
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
true
,
font
:
'bold 12px Helvetica, Arial, sans-serif'
,
stroke
:
'#454545'
,
flip
:
go
.
GraphObject
.
None
,
},
new
go
.
Binding
(
'text'
,
'showVal'
),
new
go
.
Binding
(
'font'
,
'fontStyle'
),
new
go
.
Binding
(
'stroke'
,
'fontStroke'
),
new
go
.
Binding
(
'textAlign'
,
'fontAlign'
),
new
go
.
Binding
(
'maxSize'
,
'textSize'
),
new
go
.
Binding
(
'minSize'
,
'textSize'
),
new
go
.
Binding
(
'flip'
,
'flip'
),
go
.
Panel
,
'Horizontal'
,
goJS
(
go
.
Panel
,
'Auto'
,
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
{
name
:
'SHAPE'
,
strokeWidth
:
10
,
stroke
:
'#000000'
,
parameter1
:
0
},
new
go
.
Binding
(
'fill'
,
'fillColor'
),
new
go
.
Binding
(
'stroke'
),
new
go
.
Binding
(
'strokeWidth'
),
new
go
.
Binding
(
'parameter1'
,
'radius'
).
makeTwoWay
(),
new
go
.
Binding
(
'desiredSize'
,
'size'
,
go
.
Size
.
parse
).
makeTwoWay
(
go
.
Size
.
stringify
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
maxSize
:
new
go
.
Size
(
NaN
,
NaN
),
minSize
:
new
go
.
Size
(
NaN
,
1
),
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
true
,
font
:
'bold 12px Helvetica, Arial, sans-serif'
,
stroke
:
'#454545'
,
flip
:
go
.
GraphObject
.
None
,
},
new
go
.
Binding
(
'text'
,
'showVal'
),
new
go
.
Binding
(
'font'
,
'fontStyle'
),
new
go
.
Binding
(
'stroke'
,
'fontStroke'
),
new
go
.
Binding
(
'textAlign'
,
'fontAlign'
),
new
go
.
Binding
(
'maxSize'
,
'textSize'
),
new
go
.
Binding
(
'minSize'
,
'textSize'
),
new
go
.
Binding
(
'flip'
,
'flip'
),
),
),
goJS
(
go
.
TextBlock
,
textStyle
(),
{
wrap
:
go
.
TextBlock
.
WrapFit
,
textAlign
:
'center'
,
editable
:
false
,
font
:
'normal 10px Helvetica,Arial,sans-serif'
,
stroke
:
'#ffffff'
,
},
new
go
.
Binding
(
'text'
,
'unitText'
),
new
go
.
Binding
(
'font'
,
''
,
(
v
)
=>
{
return
`normal
${
v
?.
unitSize
||
10
}
pt
$
{
v
?.
unitStyle
||
'Helvetica,Arial,sans-serif'
}
`;
}),
new go.Binding('stroke', 'unitColor'),
new go.Binding('visible', '', (v) => {
return (v?.unitSwitch && !!v?.unitText) || false;
}),
new go.Binding('margin', '', (v) => {
const unitGap = v?.unitGap || '0,0,0,5';
if (unitGap && isNumber(unitGap)) return unitGap;
const margin = unitGap?.split(',') || null;
return margin
? new go.Margin(
margin?.[0] * 1 || 0,
margin?.[1] * 1 || 0,
margin?.[2] * 1 || 0,
margin?.[3] * 1 || 0,
)
: 0;
}),
),
),
{
click(e, node) {
...
...
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