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
a495f503
Commit
a495f503
authored
Apr 27, 2023
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改
parent
6db86a42
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
26 deletions
+53
-26
HistoryModel.js
...xtend-components/EC_ConfigurationView/src/HistoryModel.js
+26
-12
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+27
-14
No files found.
packages/extend-components/EC_ConfigurationView/src/HistoryModel.js
View file @
a495f503
...
...
@@ -50,6 +50,7 @@ const ConfigurationView = (props) => {
const
ConfigurationRef
=
useRef
();
const
customBack
=
props
.
customBack
?
props
.
customBack
:
()
=>
{};
const
{
devices
=
[],
config
,
isZoom
=
false
,
flowShow
=
true
,
deviceName
=
[]
}
=
props
;
let
devicesCode
=
[];
const
globalConfig
=
window
.
globalConfig
||
config
;
let
isClose
=
false
;
...
...
@@ -84,6 +85,19 @@ const ConfigurationView = (props) => {
stationList
.
push
(
stationData
[
remain
]);
}
}
const
siteInfoArr
=
Object
.
getOwnPropertyNames
(
siteInfo
);
devicesCode
=
[];
bindData
=
[];
siteInfoArr
.
forEach
((
name
,
index
)
=>
{
const
deviceList
=
devices
[
index
]
||
(
siteInfo
&&
siteInfo
[
name
]
?
siteInfo
[
name
].
Code
||
''
:
''
);
bindData
.
push
({
code
:
deviceList
,
name
,
type
:
siteInfo
&&
siteInfo
[
name
]
?
siteInfo
[
name
].
Type
:
''
,
});
devicesCode
.
push
(
deviceList
);
});
getDiagramJson
(
data
[
0
],
siteInfo
);
}
else
{
setDescription
(
'咦~未查询到工艺图画板信息哦~'
);
...
...
@@ -100,7 +114,7 @@ const ConfigurationView = (props) => {
// 获取点表信息
const
pointInfo
=
await
getPointAddress
({
code
:
devices
.
join
(
','
),
code
:
devices
Code
.
join
(
','
),
_site
:
globalConfig
.
userInfo
&&
globalConfig
.
userInfo
.
LocalSite
?
globalConfig
.
userInfo
.
LocalSite
...
...
@@ -536,7 +550,7 @@ const ConfigurationView = (props) => {
};
useEffect
(()
=>
{
if
(
!
props
.
name
||
!
props
.
devices
||
!
props
.
devices
.
length
)
{
if
(
!
props
.
name
)
{
setDescription
(
'咦~工艺图配置信息不全哦~'
);
setIsEmpty
(
true
);
setSpinning
(
false
);
...
...
@@ -588,15 +602,15 @@ const ConfigurationView = (props) => {
nodeDataArray: [],
linkDataArray: [],
};
bindData = [];
devices.forEach((item, index) => {
const name = `设备${stationList[index]}`;
bindData.push({
code: item,
name,
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
});
});
//
bindData = [];
//
devices.forEach((item, index) => {
//
const name = `设备${stationList[index]}`;
//
bindData.push({
//
code: item,
//
name,
//
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
//
});
//
});
diagramRender(typeof fromJson === '
string
' ? fromJson : JSON.stringify(fromJson), list);
getHistoryData(true);
} else {
...
...
@@ -621,7 +635,7 @@ const ConfigurationView = (props) => {
jsonCopy.linkDataArray.forEach((item) => {
item.shName && item.stationName === list.name && sensors.push(item.shName);
});
if (sensors.length)
if (sensors.length
&& list.code
)
acrossTables.push({
deviceType: list.type,
sensors: Array.from(new Set(sensors)).join('
,
'),
...
...
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
a495f503
...
...
@@ -78,6 +78,7 @@ const ConfigurationView = (props) => {
const
ConfigurationRef
=
useRef
();
const
customBack
=
props
.
customBack
?
props
.
customBack
:
()
=>
{};
const
{
devices
=
[],
config
,
isZoom
=
false
,
flowShow
=
true
,
deviceName
=
[]
}
=
props
;
let
devicesCode
=
[];
const
globalConfig
=
window
.
globalConfig
||
config
;
let
isClose
=
false
;
...
...
@@ -112,6 +113,18 @@ const ConfigurationView = (props) => {
stationList
.
push
(
stationData
[
remain
]);
}
}
const
siteInfoArr
=
Object
.
getOwnPropertyNames
(
siteInfo
);
devicesCode
=
[];
siteInfoArr
.
forEach
((
name
,
index
)
=>
{
const
deviceList
=
devices
[
index
]
||
(
siteInfo
&&
siteInfo
[
name
]
?
siteInfo
[
name
].
Code
||
''
:
''
);
bindData
.
push
({
code
:
deviceList
,
name
,
type
:
siteInfo
&&
siteInfo
[
name
]
?
siteInfo
[
name
].
Type
:
''
,
});
devicesCode
.
push
(
deviceList
);
});
getDiagramJson
(
data
[
0
],
siteInfo
);
}
else
{
setDescription
(
'咦~未查询到工艺图画板信息哦~'
);
...
...
@@ -127,9 +140,9 @@ const ConfigurationView = (props) => {
}
// 获取点表信息
const
pointInfo
=
devices
.
length
const
pointInfo
=
devices
Code
.
length
?
await
getPointAddress
({
code
:
devices
.
join
(
','
),
code
:
devices
Code
.
join
(
','
),
_site
:
globalConfig
.
userInfo
&&
globalConfig
.
userInfo
.
LocalSite
?
globalConfig
.
userInfo
.
LocalSite
...
...
@@ -689,7 +702,7 @@ const ConfigurationView = (props) => {
};
useEffect
(()
=>
{
if
(
!
props
.
name
||
!
props
.
devices
||
!
props
.
devices
.
length
)
{
if
(
!
props
.
name
)
{
setDescription
(
'咦~工艺图配置信息不全哦~'
);
setIsEmpty
(
true
);
setSpinning
(
false
);
...
...
@@ -743,21 +756,21 @@ const ConfigurationView = (props) => {
nodeDataArray: [],
linkDataArray: [],
};
devices.forEach((item, index) => {
const name = `设备${stationList[index]}`;
bindData.push({
code: item,
name,
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
});
});
mqttView = devices.length
//
devices.forEach((item, index) => {
//
const name = `设备${stationList[index]}`;
//
bindData.push({
//
code: item,
//
name,
//
type: siteInfo && siteInfo[name] ? siteInfo[name].Type : '',
//
});
//
});
mqttView = devices
Code
.length
? new MqttView({
mqttIP: globalConfig.mqtt_iotIP,
mqttPath: globalConfig.mqtt_path,
mqttSsl: globalConfig.mqtt_IsSSL,
siteCode: globalConfig.mqtt_mess.site_code,
devices,
devices
: devicesCode
,
callback: refreshData,
controlback: controlData,
})
...
...
@@ -785,7 +798,7 @@ const ConfigurationView = (props) => {
});
}
const params = {
equipmentCode: devices.join('
,
'),
equipmentCode: devices
Code
.join('
,
'),
accountFieldParams,
};
const results = await getDeviceRealInfo(params);
...
...
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