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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
12 deletions
+138
-12
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+46
-4
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+46
-4
configuration_custom.js
...mponents/EC_ConfigurationView/src/configuration_custom.js
+46
-4
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
(),
...
...
@@ -1914,6 +1914,12 @@ const ConfigurationView = (props) => {
new
go
.
Binding
(
'location'
,
'loc'
,
go
.
Point
.
parse
).
makeTwoWay
(
go
.
Point
.
stringify
),
new
go
.
Binding
(
'angle'
).
makeTwoWay
(),
roleVisibleBinding
(),
// 绑定角色可见
goJS
(
go
.
Panel
,
'Horizontal'
,
goJS
(
go
.
Panel
,
'Auto'
,
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
...
...
@@ -1945,6 +1951,42 @@ const ConfigurationView = (props) => {
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) {
const { data } = 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
(),
...
...
@@ -2531,6 +2531,12 @@ const ConfigurationView = (props) => {
new
go
.
Binding
(
'location'
,
'loc'
,
go
.
Point
.
parse
).
makeTwoWay
(
go
.
Point
.
stringify
),
new
go
.
Binding
(
'angle'
).
makeTwoWay
(),
roleVisibleBinding
(),
// 绑定角色可见
goJS
(
go
.
Panel
,
'Horizontal'
,
goJS
(
go
.
Panel
,
'Auto'
,
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
...
...
@@ -2562,6 +2568,42 @@ const ConfigurationView = (props) => {
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) {
if (navigatorAgent) return false;
...
...
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
(),
...
...
@@ -2537,6 +2537,12 @@ const ConfigurationView = (props) => {
new
go
.
Binding
(
'location'
,
'loc'
,
go
.
Point
.
parse
).
makeTwoWay
(
go
.
Point
.
stringify
),
new
go
.
Binding
(
'angle'
).
makeTwoWay
(),
roleVisibleBinding
(),
// 绑定角色可见
goJS
(
go
.
Panel
,
'Horizontal'
,
goJS
(
go
.
Panel
,
'Auto'
,
goJS
(
go
.
Shape
,
'RoundedRectanglePlus'
,
...
...
@@ -2568,6 +2574,42 @@ const ConfigurationView = (props) => {
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) {
if (navigatorAgent) return false;
...
...
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