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
ee16fabb
Commit
ee16fabb
authored
Apr 10, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 刷新组态不出现问题
parent
6ed78a9d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
RealModel.js
...s/extend-components/EC_ConfigurationView/src/RealModel.js
+6
-12
No files found.
packages/extend-components/EC_ConfigurationView/src/RealModel.js
View file @
ee16fabb
...
@@ -114,7 +114,7 @@ const ConfigurationView = (props) => {
...
@@ -114,7 +114,7 @@ const ConfigurationView = (props) => {
const
{
devices
=
[],
config
,
isZoom
=
false
,
flowShow
=
true
,
deviceName
=
[]
}
=
props
;
const
{
devices
=
[],
config
,
isZoom
=
false
,
flowShow
=
true
,
deviceName
=
[]
}
=
props
;
let
devicesCode
=
[];
let
devicesCode
=
[];
const
globalConfig
=
window
.
globalConfig
||
config
;
const
globalConfig
=
window
.
globalConfig
||
config
;
let
isClose
=
useRef
(
false
)
;
let
isClose
=
false
;
// 子应用包名查找
// 子应用包名查找
const
widgets
=
queryProduct
(
globalConfig
?.
widgets
||
[],
decodeURI
(
window
.
location
.
pathname
));
const
widgets
=
queryProduct
(
globalConfig
?.
widgets
||
[],
decodeURI
(
window
.
location
.
pathname
));
const
_JessibucaObj
=
{
const
_JessibucaObj
=
{
...
@@ -474,7 +474,7 @@ const ConfigurationView = (props) => {
...
@@ -474,7 +474,7 @@ const ConfigurationView = (props) => {
/** *********************************MQTT请求数据回调****************************** */
/** *********************************MQTT请求数据回调****************************** */
const
refreshData
=
(
mqttDatas
,
code
)
=>
{
const
refreshData
=
(
mqttDatas
,
code
)
=>
{
if
(
isClose
.
current
||
!
myDiagram
)
return
false
;
if
(
isClose
||
!
myDiagram
)
return
false
;
const
bindList
=
bindData
.
find
((
item
)
=>
{
const
bindList
=
bindData
.
find
((
item
)
=>
{
return
item
.
code
===
code
;
return
item
.
code
===
code
;
});
});
...
@@ -687,7 +687,7 @@ const ConfigurationView = (props) => {
...
@@ -687,7 +687,7 @@ const ConfigurationView = (props) => {
let
timer
;
let
timer
;
const
stime
=
+
new
Date
();
const
stime
=
+
new
Date
();
const
myLoop
=
()
=>
{
const
myLoop
=
()
=>
{
if
(
isClose
.
current
)
return
timer
&&
cancelAnimationFrame
(
timer
);
if
(
isClose
)
return
timer
&&
cancelAnimationFrame
(
timer
);
const
etime
=
+
new
Date
();
const
etime
=
+
new
Date
();
if
(
stime
+
delay
<=
etime
)
{
if
(
stime
+
delay
<=
etime
)
{
fn
();
fn
();
...
@@ -707,7 +707,7 @@ const ConfigurationView = (props) => {
...
@@ -707,7 +707,7 @@ const ConfigurationView = (props) => {
let
etime
;
let
etime
;
let
myLoop
=
()
=>
{
let
myLoop
=
()
=>
{
etime
=
+
new
Date
();
etime
=
+
new
Date
();
if
(
isClose
.
current
)
return
timer
&&
cancelAnimationFrame
(
timer
);
if
(
isClose
)
return
timer
&&
cancelAnimationFrame
(
timer
);
timer
=
requestAnimationFrame
(
myLoop
);
timer
=
requestAnimationFrame
(
myLoop
);
if
(
etime
-
stime
>=
interval
)
{
if
(
etime
-
stime
>=
interval
)
{
stime
=
etime
=
+
new
Date
();
stime
=
etime
=
+
new
Date
();
...
@@ -884,6 +884,7 @@ const ConfigurationView = (props) => {
...
@@ -884,6 +884,7 @@ const ConfigurationView = (props) => {
const
url
=
globalConfig
.
mainserver
?
globalConfig
.
mainserver
:
'https://panda-water.cn/'
;
const
url
=
globalConfig
.
mainserver
?
globalConfig
.
mainserver
:
'https://panda-water.cn/'
;
onlineMethod
(
`
${
url
}
civweb4/assets/images/bootPage/熊猫图标.png`
,
url
);
onlineMethod
(
`
${
url
}
civweb4/assets/images/bootPage/熊猫图标.png`
,
url
);
return
()
=>
{
return
()
=>
{
isClose
=
true
;
mqttView
&&
mqttView
.
disSaveWaconnect
();
mqttView
&&
mqttView
.
disSaveWaconnect
();
mqttView
=
null
;
mqttView
=
null
;
if
(
myDiagram
)
{
if
(
myDiagram
)
{
...
@@ -894,13 +895,6 @@ const ConfigurationView = (props) => {
...
@@ -894,13 +895,6 @@ const ConfigurationView = (props) => {
};
};
},
[
props
.
name
,
numerals
]);
},
[
props
.
name
,
numerals
]);
useEffect
(()
=>
{
isClose
.
current
=
false
;
return
()
=>
{
isClose
.
current
=
true
;
}
},
[]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
isModalVisible
)
{
if
(
!
isModalVisible
)
{
modalConfirmFn
=
null
;
modalConfirmFn
=
null
;
...
@@ -998,7 +992,7 @@ const ConfigurationView = (props) => {
...
@@ -998,7 +992,7 @@ const ConfigurationView = (props) => {
});
});
setSpinning(false);
setSpinning(false);
if (response.code === 0) {
if (response.code === 0) {
if (isClose
.current
) return false;
if (isClose) return false;
const fromJson = response.data
const fromJson = response.data
? response.data
? response.data
: {
: {
...
...
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