Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
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
耿迪迪
gassafety-progress
Commits
8b1c4a26
Commit
8b1c4a26
authored
Mar 03, 2022
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化map的报警bug
parent
65d7d9d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
25 deletions
+49
-25
Device.vue
gassafetyprogress-web/src/components/bigWindow/Device.vue
+26
-9
User.vue
gassafetyprogress-web/src/components/bigWindow/User.vue
+12
-9
map.js
gassafetyprogress-web/src/utils/mapClass/map.js
+11
-7
No files found.
gassafetyprogress-web/src/components/bigWindow/Device.vue
View file @
8b1c4a26
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-0
2 17:52:36
* @LastEditTime: 2022-03-0
3 11:51:13
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...
...
@@ -109,6 +109,7 @@
<
script
>
import
{
companyType
,
deviceType
}
from
"@/utils/mapClass/config.js"
;
import
{
getTyx
,
getFm
}
from
"@/api/bigWindow/getDevice.js"
;
export
default
{
data
()
{
return
{
...
...
@@ -134,14 +135,7 @@ export default {
});
}
// 当点开infowindow的时候,重新调接口
detectorUserList
({
DeviceId
:
this
.
deviceData
.
DeviceId
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
const
data
=
res
.
data
.
filter
(
(
item
)
=>
item
.
deviceId
==
this
.
deviceData
.
deviceId
)[
0
].
detectorCountList
;
this
.
deviceData
.
detectorCountList
=
data
;
}
});
this
.
myHttp
();
// console.log(this.deviceData);
},
methods
:
{
...
...
@@ -151,6 +145,29 @@ export default {
btnClick
()
{
this
.
vueRoot
.
centerDataFunc
(
this
.
deviceData
.
pressureFlows
);
},
myHttp
()
{
console
.
log
(
this
.
deviceData
.
iconType
)
if
(
this
.
deviceData
.
iconType
==
2
)
{
getTyx
({
DeviceId
:
this
.
deviceData
.
DeviceId
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
const
data
=
res
.
data
.
filter
(
(
item
)
=>
item
.
deviceId
==
this
.
deviceData
.
deviceId
)[
0
].
detectorCountList
;
this
.
deviceData
.
detectorCountList
=
data
;
}
});
}
else
{
getFm
({
DeviceId
:
this
.
deviceData
.
DeviceId
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
const
data
=
res
.
data
.
filter
(
(
item
)
=>
item
.
deviceId
==
this
.
deviceData
.
deviceId
)[
0
].
detectorCountList
;
this
.
deviceData
.
detectorCountList
=
data
;
}
});
}
},
},
};
</
script
>
...
...
gassafetyprogress-web/src/components/bigWindow/User.vue
View file @
8b1c4a26
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-0
2 18:04:10
* @LastEditTime: 2022-03-0
3 11:51:48
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...
...
@@ -105,14 +105,7 @@ export default {
this
.
companyType
[
item
.
conpanyId
]
=
item
.
companyName
;
});
}
detectorUserList
({
userId
:
this
.
deviceData
.
userId
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
const
data
=
res
.
data
.
filter
(
(
item
)
=>
item
.
userId
==
this
.
deviceData
.
userId
)[
0
].
detectorCountList
;
this
.
deviceData
.
detectorCountList
=
data
;
}
});
this
.
myHttp
();
// console.log(this.deviceData);
},
methods
:
{
...
...
@@ -126,6 +119,16 @@ export default {
this
.
deviceData
.
nickName
);
},
myHttp
()
{
detectorUserList
({
userId
:
this
.
deviceData
.
userId
}).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
const
data
=
res
.
data
.
filter
(
(
item
)
=>
item
.
userId
==
this
.
deviceData
.
userId
)[
0
].
detectorCountList
;
this
.
deviceData
.
detectorCountList
=
data
;
}
});
},
},
};
</
script
>
...
...
gassafetyprogress-web/src/utils/mapClass/map.js
View file @
8b1c4a26
/*
* @Author: your name
* @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-03-03 1
0:23:10
* @LastEditTime: 2022-03-03 1
1:51:16
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js
...
...
@@ -523,7 +523,7 @@ export class EditorMap {
}
// 报警时候,可能发生infowindowComponent存在,也要变化
alarmInfowindowChange
(
obj
)
{
return
;
if
(
!
this
.
infowindowComponent
)
return
;
// 如果infowindow是打开的,就改变里面的数据 必须是 调压箱2 阀门3 用户6 才会发生变化电话
const
infowindowDeviceType
=
[
2
,
3
,
6
].
includes
(
...
...
@@ -542,7 +542,10 @@ export class EditorMap {
infowindowDeviceType
&&
infowindowComponentHas
)
{
this
.
infowindowComponentChange
(
obj
);
// this.infowindowComponentChange(obj);
if
(
this
.
infowindowComponent
.
http
){
this
.
infowindowComponent
.
myHttp
()
}
}
}
//如果传过来的报警设备中,有不在deviceAlarm中,就是恢复的设备恢复
...
...
@@ -563,10 +566,11 @@ export class EditorMap {
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
// 看看现有报警设备中有没有不在 报警数组中的值,有就恢复可能是userId,也可能是deviceId
const
publicId
=
arr
[
i
];
// 看看接口传来的数据中还有没有这些
User
Id,如果没有了,就是修好了
const
index
=
httpObj
[
iconType
]?.
indexOf
(
publicId
);
// 看看接口传来的数据中还有没有这些Id,如果没有了,就是修好了
const
hasId
=
httpObj
[
iconType
]?.
includes
(
publicId
);
// 如果已经不在报警数组中,就要去大数组中找他,利用userId
if
(
index
<
0
)
{
// 如果id不存在了,说明不报警了
if
(
!
hasId
)
{
// 过滤出来这个要恢复的设备
const
device
=
this
.
allDevice
[
iconType
].
filter
(
(
item
)
=>
...
...
@@ -581,7 +585,7 @@ export class EditorMap {
// device.setExtData(deviceData);
// device.oldData = null;
// 如果infowindow是打开的
// this.alarmInfowindowChange(deviceData
);
this
.
alarmInfowindowChange
(
device
.
getExtData
()
);
// 在arr中删掉
arr
.
splice
(
i
,
1
);
// 由于删掉了当前,所以要--恢复位置
...
...
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