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
971bb696
Commit
971bb696
authored
Nov 07, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 组态自动缩放问题修改
parent
472ace35
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+9
-0
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+9
-0
configuration_custom.js
...mponents/EC_ConfigurationView/src/configuration_custom.js
+9
-0
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
971bb696
...
...
@@ -623,6 +623,7 @@ const ConfigurationView = (props) => {
return
()
=>
{
isClose
=
true
;
if
(
myDiagram
)
{
myDiagram
.
removeDiagramListener
(
'ViewportBoundsChanged'
,
viewportBoundsChang
);
myDiagram
.
div
=
null
;
myDiagram
=
null
;
}
...
...
@@ -1112,6 +1113,12 @@ const ConfigurationView = (props) => {
setIsHIModalVisible(true);
};
// 监听画布zoom变化
const viewportBoundsChang = () => {
myDiagram.contentAlignment = go.Spot.Default;
myDiagram.contentAlignment = go.Spot.Center;
};
/** **********************************画布渲染************************************ */
const diagramRender = (jsonStr, chartInfo) => {
myDiagram = goJS(
...
...
@@ -2583,6 +2590,8 @@ const ConfigurationView = (props) => {
if (item.controlType === '开关展示') item.switch = '是';
if (item.category === 'valCase') item.shType = '值显示';
});
// 监听画布变化
myDiagram.addDiagramListener('ViewportBoundsChanged', viewportBoundsChang);
myDiagram.model = go.Model.fromJson(json);
};
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
971bb696
...
...
@@ -915,6 +915,7 @@ const ConfigurationView = (props) => {
mqttView
=
null
;
if
(
myDiagram
)
{
myDiagram
.
removeDiagramListener
(
'InitialAnimationStarting'
,
animationStarting
);
myDiagram
.
removeDiagramListener
(
'ViewportBoundsChanged'
,
viewportBoundsChang
);
myDiagram
.
div
=
null
;
myDiagram
=
null
;
setIsDiagram
(
null
);
...
...
@@ -1758,6 +1759,12 @@ const ConfigurationView = (props) => {
if (entryAnim === '
opacity
') animations.add(e.diagram, '
opacity
', 0, 1);
};
// 监听画布zoom变化
const viewportBoundsChang = () => {
myDiagram.contentAlignment = go.Spot.Default;
myDiagram.contentAlignment = go.Spot.Center;
};
/** **********************************画布渲染************************************ */
const diagramRender = (jsonStr, chartInfo) => {
myDiagram = goJS(
...
...
@@ -3337,6 +3344,8 @@ const ConfigurationView = (props) => {
}
// 动画监听
myDiagram.addDiagramListener('InitialAnimationStarting', animationStarting);
// 监听画布变化
myDiagram.addDiagramListener('ViewportBoundsChanged', viewportBoundsChang);
myDiagram.model = go.Model.fromJson(json);
getDataModel();
setIsDiagram(myDiagram);
...
...
packages/extend-components/EC_ConfigurationView/src/configuration_custom.js
View file @
971bb696
...
...
@@ -884,6 +884,7 @@ const ConfigurationView = (props) => {
mqttView
&&
mqttView
.
disSaveWaconnect
();
mqttView
=
null
;
if
(
myDiagram
)
{
myDiagram
.
removeDiagramListener
(
'ViewportBoundsChanged'
,
viewportBoundsChang
);
myDiagram
.
div
=
null
;
myDiagram
=
null
;
setIsDiagram
(
null
);
...
...
@@ -1687,6 +1688,12 @@ const ConfigurationView = (props) => {
return modalComponent && nodeData ? modalComponent() : null;
};
// 监听画布zoom变化
const viewportBoundsChang = () => {
myDiagram.contentAlignment = go.Spot.Default;
myDiagram.contentAlignment = go.Spot.Center;
};
/** **********************************画布渲染************************************ */
const diagramRender = (jsonStr, chartInfo) => {
myDiagram = goJS(
...
...
@@ -3244,6 +3251,8 @@ const ConfigurationView = (props) => {
if (item.controlType === '开关展示') item.switch = '是';
if (item.category === 'valCase') item.shType = '值显示';
});
// 监听画布变化
myDiagram.addDiagramListener('ViewportBoundsChanged', viewportBoundsChang);
myDiagram.model = go.Model.fromJson(json);
getDataModel();
setIsDiagram(myDiagram);
...
...
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