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
44648b45
Commit
44648b45
authored
Apr 03, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 组态兼容V1前
parent
730a995b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+9
-3
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+8
-2
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
44648b45
...
...
@@ -591,7 +591,7 @@ const ConfigurationView = (props) => {
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
});
});
diagramRender(typeof fromJson === '
string
' ? fromJson : JSON.stringify(fromJson));
diagramRender(typeof fromJson === '
string
' ? fromJson : JSON.stringify(fromJson)
, list
);
getHistoryData(true);
} else {
message.error(response.msg);
...
...
@@ -614,7 +614,7 @@ const ConfigurationView = (props) => {
});
return {
deviceType: list.type,
sensors:
sensors
.join('
,
'),
sensors:
Array.from(new Set(sensors))
.join('
,
'),
deviceCode: list.code,
};
});
...
...
@@ -817,7 +817,7 @@ const ConfigurationView = (props) => {
};
/** **********************************画布渲染************************************ */
const diagramRender = (jsonStr) => {
const diagramRender = (jsonStr
, chartInfo
) => {
myDiagram = goJS(
go.Diagram,
twoID, // must name or refer to the DIV HTML element
...
...
@@ -1919,6 +1919,12 @@ const ConfigurationView = (props) => {
});
if (device) item.text = device;
}
// 兼容V1之前版本(部分展示可支持)
if (chartInfo.version === 'V1') return false;
item.shName = item.showName || '';
item.hbControl = item.authoControl || '否';
if (item.controlType === '开关展示') item.switch = '是';
if (item.category === 'valCase') item.shType = '值显示';
});
myDiagram.model = go.Model.fromJson(json);
};
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
44648b45
...
...
@@ -756,7 +756,7 @@ const ConfigurationView = (props) => {
controlback: controlData,
})
: null;
diagramRender(typeof fromJson === '
string
' ? fromJson : JSON.stringify(fromJson));
diagramRender(typeof fromJson === '
string
' ? fromJson : JSON.stringify(fromJson)
, list
);
try {
mqttView && mqttView.saveWaterMqtt();
} catch (e) {
...
...
@@ -1232,7 +1232,7 @@ const ConfigurationView = (props) => {
};
/** **********************************画布渲染************************************ */
const diagramRender = (jsonStr) => {
const diagramRender = (jsonStr
, chartInfo
) => {
myDiagram = goJS(
go.Diagram,
twoID, // must name or refer to the DIV HTML element
...
...
@@ -2372,6 +2372,12 @@ const ConfigurationView = (props) => {
});
if (device) item.text = device;
}
// 兼容V1之前版本(部分展示可支持)
if (chartInfo.version === 'V1') return false;
item.shName = item.showName || '';
item.hbControl = item.authoControl || '否';
if (item.controlType === '开关展示') item.switch = '是';
if (item.category === 'valCase') item.shType = '值显示';
});
myDiagram.model = go.Model.fromJson(json);
};
...
...
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