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
4980304e
Commit
4980304e
authored
Feb 26, 2022
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
假数据调整为新数据
parent
d5b7ceb7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
497 additions
and
178 deletions
+497
-178
getDevice.js
gassafetyprogress-web/src/api/bigWindow/getDevice.js
+70
-0
DeviceA.vue
gassafetyprogress-web/src/components/bigWindow/DeviceA.vue
+25
-8
Line.vue
gassafetyprogress-web/src/components/bigWindow/Line.vue
+34
-12
User.vue
gassafetyprogress-web/src/components/bigWindow/User.vue
+24
-5
index.js
gassafetyprogress-web/src/directive/permission/index.js
+10
-0
unValue.js
gassafetyprogress-web/src/directive/permission/unValue.js
+19
-0
getters.js
gassafetyprogress-web/src/store/getters.js
+10
-0
index.js
gassafetyprogress-web/src/store/index.js
+12
-1
bigWindowCompany.js
gassafetyprogress-web/src/store/modules/bigWindowCompany.js
+40
-0
user.js
gassafetyprogress-web/src/store/modules/user.js
+7
-2
config.js
gassafetyprogress-web/src/utils/mapClass/config.js
+86
-87
map.js
gassafetyprogress-web/src/utils/mapClass/map.js
+60
-30
index.vue
gassafetyprogress-web/src/views/bigWindow/index.vue
+98
-32
vue.config.js
gassafetyprogress-web/vue.config.js
+2
-1
No files found.
gassafetyprogress-web/src/api/bigWindow/getDevice.js
0 → 100644
View file @
4980304e
/*
* @Author: your name
* @Date: 2022-02-23 15:28:07
* @LastEditTime: 2022-02-25 18:43:58
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/api/bigWindow/getdevice.js
*/
import
request
from
'@/utils/request'
// 查询管道
export
function
getPipe
(
query
)
{
return
request
({
url
:
'/pipe/pipe/selectPipeData'
,
method
:
'get'
,
params
:
query
})
}
// 调压箱
export
function
getTyx
(
query
)
{
return
request
({
url
:
'/pipe/pipe/selectDeviceData'
,
method
:
'get'
,
params
:
query
})
}
// 是阀门
export
function
getFm
(
query
)
{
return
request
({
url
:
'/pipe/pipe/selectvalveData'
,
method
:
'get'
,
params
:
query
})
}
// 厂站
export
function
getCz
(
query
)
{
return
request
({
url
:
'/pipe/pipe/selectTSiteStationInfoData'
,
method
:
'get'
,
params
:
query
})
}
// 监控
export
function
getVideo
(
query
)
{
return
request
({
url
:
'/pipe/pipe/selectTvideoManagerData'
,
method
:
'get'
,
params
:
query
})
}
// 燃气用户接口
export
function
getUser
(
query
)
{
return
request
({
url
:
'/pipe/pipe/selectTdetectorUser'
,
method
:
'get'
,
params
:
query
})
}
// 获取公司名称以及id
export
function
getCompany
(
query
)
{
return
request
({
url
:
'/pipe/pipe/selectTenterpriseInfoData'
,
method
:
'get'
,
params
:
query
})
}
\ No newline at end of file
gassafetyprogress-web/src/components/bigWindow/DeviceA.vue
View file @
4980304e
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-02-
17 10:13:02
* @LastEditTime: 2022-02-
25 18:34:00
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...
...
@@ -62,22 +62,22 @@
</div>
<div
class=
"tbody flex"
>
<div
class=
"first zzz"
>
{{
"流量计与压力表"
}}
</div>
<div
class=
""
>
{{
deviceData
.
pressureFlow
.
length
}}
</div>
<div
class=
""
>
{{
deviceData
.
pressureFlow
s
.
length
}}
</div>
<div
class=
""
>
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
.
length
)
>>
1
}}
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
s
.
length
)
>>
1
}}
</div>
<div
class=
""
>
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
.
length
)
>>
1
}}
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
s
.
length
)
>>
1
}}
</div>
<div
class=
""
>
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
.
length
)
>>
1
}}
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
s
.
length
)
>>
1
}}
</div>
<div
class=
""
>
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
.
length
)
>>
1
}}
{{
(
Math
.
random
()
*
deviceData
.
pressureFlow
s
.
length
)
>>
1
}}
</div>
<div
class=
"last zzz"
>
{{
deviceData
.
pressureFlow
.
filter
((
item
)
=>
{
deviceData
.
pressureFlow
s
.
filter
((
item
)
=>
{
return
item
.
deviceState
==
2
;
}
).
length
}}
...
...
@@ -102,12 +102,29 @@ export default {
"公司位于长江三角洲经济快速增长、风景秀丽的太湖之畔——无锡。 公司自1984年成立至今,已经过了3次跨越式的发展。2004年至今公司投入5000多万元资金建设新的生产基地,目前已竣工并投入生产,占地面积达40000m2,厂房面积近15000m2。公司2004年的年产值达4350多万元,并且每年以平均30%的速度快速增长。"
,
}
;
}
,
computed
:
{
prodTest
()
{
return
this
.
vueRoot
.
$store
.
state
.
user
.
systemSetting
.
prod_test
;
}
,
company
()
{
return
this
.
vueRoot
.
$store
.
state
.
bigWindowCompany
.
company
;
}
,
}
,
mounted
()
{
// 如果不是测试,而是真数据,就要用帧数据的东西
if
(
this
.
prodTest
!=
"test"
)
{
this
.
companyType
=
{
}
;
this
.
company
.
forEach
((
item
)
=>
{
this
.
companyType
[
item
.
conpanyId
]
=
item
.
companyName
;
}
);
}
}
,
methods
:
{
close
()
{
this
.
mapClass
.
infowindowClose
();
}
,
btnClick
()
{
this
.
vueRoot
.
centerDataFunc
(
this
.
deviceData
.
pressureFlow
);
this
.
vueRoot
.
centerDataFunc
(
this
.
deviceData
.
pressureFlow
s
);
}
,
}
,
}
;
...
...
gassafetyprogress-web/src/components/bigWindow/Line.vue
View file @
4980304e
<!--
* @Author: your name
* @Date: 2022-01-27 14:25:45
* @LastEditTime: 2022-02-
17 10:11:42
* @LastEditTime: 2022-02-
25 17:53:43
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /hello-world/src/views/components/User.vue
...
...
@@ -26,8 +26,8 @@
<div
class=
"group flex"
>
<div
class=
"left first"
>
管道压力:
</div>
<div
:title=
"deviceData.
address
"
class=
"right zzz"
>
{{
pipePressure
[
deviceData
.
pipePressure
]
}}
<div
:title=
"deviceData.
pipePressure
"
class=
"right zzz"
>
{{
pipePressure
[
deviceData
.
pipePressure
+
1
]
}}
</div>
<div
class=
"left"
>
所属公司:
</div>
<div
class=
"right last"
>
{{
companyType
[
deviceData
.
companyType
]
}}
</div>
...
...
@@ -44,7 +44,9 @@
<div
class=
"left first"
>
管道走向:
</div>
<div
class=
"right"
>
{{
deviceData
.
pipeTrend
}}
</div>
<div
class=
"left"
>
权属单位:
</div>
<div
:title=
"deviceData.powerCompany"
class=
"right last zzz"
>
{{
deviceData
.
powerCompany
}}
</div>
<div
:title=
"deviceData.powerCompany"
class=
"right last zzz"
>
{{
deviceData
.
powerCompany
}}
</div>
</div>
<div
class=
"group flex"
>
<div
class=
"first left"
>
建设年代:
</div>
...
...
@@ -53,10 +55,13 @@
<div
class=
"last right"
>
{{
deviceData
.
buildCompany
}}
</div>
</div>
<div
class=
"group flex"
>
<div
class=
"first once left"
>
管道位置:
</div>
<div
:title=
"deviceData.pipeAddr"
class=
" last pipeAddr right zzz"
>
<div
v-unValue
:title=
"deviceData.pipeAddr"
class=
"last pipeAddr right zzz"
>
{{
deviceData
.
pipeAddr
}}
</div>
</div>
...
...
@@ -65,7 +70,6 @@
<
script
>
import
{
companyType
,
pipePressure
}
from
"@/utils/mapClass/config.js"
;
export
default
{
data
()
{
return
{
...
...
@@ -73,6 +77,24 @@ export default {
pipePressure
,
};
},
computed
:{
prodTest
(){
return
this
.
vueRoot
.
$store
.
state
.
user
.
systemSetting
.
prod_test
},
company
(){
return
this
.
vueRoot
.
$store
.
state
.
bigWindowCompany
.
company
;
}
},
mounted
(){
// 如果不是测试,而是真数据,就要用帧数据的东西
if
(
this
.
prodTest
!=
"test"
){
this
.
companyType
=
{};
this
.
company
.
forEach
(
item
=>
{
this
.
companyType
[
item
.
conpanyId
]
=
item
.
companyName
;
})
}
},
methods
:
{
close
()
{
this
.
mapClass
.
infowindowClose
();
...
...
@@ -125,12 +147,12 @@ export default {
.last
{
border
:
none
;
}
.once
{
flex
:
1
;
.once
{
flex
:
1
;
}
.pipeAddr
{
flex
:
3
;
padding
:
0
3em
0
1em
;
.pipeAddr
{
flex
:
3
;
padding
:
0
3em
0
1em
;
}
}
.flex
{
...
...
gassafetyprogress-web/src/components/bigWindow/User.vue
View file @
4980304e
...
...
@@ -15,7 +15,9 @@
<div
class=
"group flex first"
>
<div
class=
"left"
>
用户姓名:
</div>
<div
:title=
"deviceData.usrName"
class=
"right zzz"
>
{{
deviceData
.
usrName
}}
</div>
<div
:title=
"deviceData.usrName"
class=
"right zzz"
>
{{
deviceData
.
usrName
}}
</div>
</div>
<div
class=
"group flex"
>
...
...
@@ -39,6 +41,7 @@
<
script
>
import
{
companyType
}
from
"@/utils/mapClass/config.js"
;
import
{
mapGetters
}
from
"vuex"
;
export
default
{
data
()
{
...
...
@@ -46,6 +49,23 @@ export default {
companyType
,
};
},
computed
:
{
prodTest
()
{
return
this
.
vueRoot
.
$store
.
state
.
user
.
systemSetting
.
prod_test
;
},
company
()
{
return
this
.
vueRoot
.
$store
.
state
.
bigWindowCompany
.
company
;
},
},
mounted
()
{
// 如果不是测试,而是真数据,就要用帧数据的东西
if
(
this
.
prodTest
!=
"test"
)
{
this
.
companyType
=
{};
this
.
company
.
forEach
((
item
)
=>
{
this
.
companyType
[
item
.
conpanyId
]
=
item
.
companyName
;
});
}
},
methods
:
{
close
()
{
this
.
mapClass
.
infowindowClose
();
...
...
@@ -73,18 +93,17 @@ export default {
}
.group
{
border
:
1px
solid
#cccccc
;
border-top
:none
;
border-top
:
none
;
height
:
28px
;
font-size
:
14px
;
line-height
:
28px
;
color
:
#ffffff
;
&
.first
{
border-top
:
1px
solid
#cccccc
;
border-top
:
1px
solid
#cccccc
;
margin-top
:
10px
;
}
div
{
flex
:
1
;
}
.left
{
border-right
:
1px
solid
#cccccc
;
...
...
@@ -94,7 +113,7 @@ export default {
.right
{
box-sizing
:
border-box
;
text-align
:
left
;
padding
:
0
1em
;
padding
:
0
1em
;
}
}
.flex
{
...
...
gassafetyprogress-web/src/directive/permission/index.js
View file @
4980304e
/*
* @Author: your name
* @Date: 2022-01-07 11:29:13
* @LastEditTime: 2022-02-25 17:17:17
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/directive/permission/index.js
*/
import
hasRole
from
'./hasRole'
import
hasPermi
from
'./hasPermi'
import
unValue
from
'./unValue'
const
install
=
function
(
Vue
)
{
Vue
.
directive
(
'hasRole'
,
hasRole
)
Vue
.
directive
(
'hasPermi'
,
hasPermi
)
Vue
.
directive
(
'unValue'
,
unValue
)
}
if
(
window
.
Vue
)
{
...
...
gassafetyprogress-web/src/directive/permission/unValue.js
0 → 100644
View file @
4980304e
/*
* @Author: your name
* @Date: 2022-02-25 17:07:40
* @LastEditTime: 2022-02-25 17:15:54
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/directive/permission/hasValue.js
*/
/**
* 无内容显示-
* Copyright (c) 2021 gassafety
*/
export
default
{
inserted
(
el
,
binding
,
vnode
)
{
console
.
log
(
"el"
,
el
)
el
.
innerHTML
=
el
.
innerHTML
.
replace
(
/
\s
+/g
,
""
)
?
el
.
innerHTML
:
"-"
;
}
};
gassafetyprogress-web/src/store/getters.js
View file @
4980304e
/*
* @Author: your name
* @Date: 2022-01-07 11:29:13
* @LastEditTime: 2022-02-25 15:36:12
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/store/getters.js
*/
const
getters
=
{
sidebar
:
state
=>
state
.
app
.
sidebar
,
size
:
state
=>
state
.
app
.
size
,
...
...
@@ -10,9 +18,11 @@ const getters = {
introduction
:
state
=>
state
.
user
.
introduction
,
roles
:
state
=>
state
.
user
.
roles
,
permissions
:
state
=>
state
.
user
.
permissions
,
systemSetting
:
state
=>
state
.
user
.
systemSetting
,
permission_routes
:
state
=>
state
.
permission
.
routes
,
topbarRouters
:
state
=>
state
.
permission
.
topbarRouters
,
defaultRoutes
:
state
=>
state
.
permission
.
defaultRoutes
,
sidebarRouters
:
state
=>
state
.
permission
.
sidebarRouters
,
company
:
state
=>
state
.
bigWindowCompany
.
company
,
}
export
default
getters
gassafetyprogress-web/src/store/index.js
View file @
4980304e
/*
* @Author: your name
* @Date: 2022-01-07 11:29:13
* @LastEditTime: 2022-02-25 15:36:22
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/store/index.js
*/
import
Vue
from
'vue'
import
Vuex
from
'vuex'
import
app
from
'./modules/app'
import
user
from
'./modules/user'
import
bigWindowCompany
from
'./modules/bigWindowCompany'
import
tagsView
from
'./modules/tagsView'
import
permission
from
'./modules/permission'
import
settings
from
'./modules/settings'
...
...
@@ -15,7 +25,8 @@ const store = new Vuex.Store({
user
,
tagsView
,
permission
,
settings
settings
,
bigWindowCompany
},
getters
})
...
...
gassafetyprogress-web/src/store/modules/bigWindowCompany.js
0 → 100644
View file @
4980304e
/*
* @Author: your name
* @Date: 2022-02-25 13:53:11
* @LastEditTime: 2022-02-25 15:01:59
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/store/modules/bigWindowDevice.js
*/
import
{
getCompany
}
from
"@/api/bigWindow/getDevice"
;
const
state
=
{
// 公司名称
company
:
{},
};
const
mutations
=
{
SET_COMPANY
:
(
state
,
company
)
=>
{
state
.
company
=
company
.
map
((
item
)
=>
({
conpanyId
:
item
.
enterpriseId
,
companyName
:
item
.
enterpriseName
,
}));
console
.
log
(
state
.
company
);
},
};
const
actions
=
{
// 登录
GetCompany
({
commit
})
{
getCompany
().
then
((
res
)
=>
{
commit
(
"SET_COMPANY"
,
res
);
});
},
};
export
default
{
namespaced
:
true
,
state
,
mutations
,
actions
,
};
gassafetyprogress-web/src/store/modules/user.js
View file @
4980304e
...
...
@@ -57,9 +57,8 @@ const user = {
})
})
},
// 获取用户信息
GetInfo
({
commit
,
state
})
{
GetInfo
({
commit
,
state
,
dispatch
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getInfo
().
then
(
res
=>
{
const
user
=
res
.
user
...
...
@@ -77,6 +76,12 @@ const user = {
commit
(
'SET_SYSTEMSETTING'
,
res
.
systemSetting
)
commit
(
'SET_POSTS'
,
res
.
posts
)
commit
(
'SET_ENTERPRISEID'
,
user
.
deptId
)
// 大屏公司获取
// 第一个参数是其他模块的 actions 路径,
// 第二个是传给 actions 的数据, 如果不需要传数据, 也必须预留,
// 第三个参数是配置选项, 申明这个 acitons 不是当前模块的
dispatch
(
"bigWindowCompany/GetCompany"
,{},{
root
:
true
})
console
.
log
(
res
.
systemSetting
)
resolve
(
res
)
}).
catch
(
error
=>
{
...
...
gassafetyprogress-web/src/utils/mapClass/config.js
View file @
4980304e
This diff is collapsed.
Click to expand it.
gassafetyprogress-web/src/utils/mapClass/map.js
View file @
4980304e
/*
* @Author: your name
* @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-02-
17 10:12:27
* @LastEditTime: 2022-02-
26 09:55:44
* @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
...
...
@@ -31,7 +31,7 @@ export class EditorMap {
mouseToolPolineOptions
=
null
;
// 存放所有的设备的数组集合,这是一个对象,对象里面是各种设备的数组
allDevic
=
{};
allDevic
e
=
{};
// 存放所有的管道
pipeArr
=
{};
// 当前的infowindow的组件
...
...
@@ -247,8 +247,8 @@ export class EditorMap {
* @return {*}
*/
addDevice
(
deviceData
,
compontent
)
{
const
{
longitude
:
lng
,
latitude
:
lat
,
type
,
company
Type
}
=
deviceData
;
const
icon
=
svgUrl
[
t
ype
];
const
{
longitude
:
lng
,
latitude
:
lat
,
icon
Type
}
=
deviceData
;
const
icon
=
svgUrl
[
iconT
ype
];
let
device
=
this
.
createMarker
({
map
:
this
.
map
,
anchor
:
"bottom-center"
,
...
...
@@ -258,10 +258,10 @@ export class EditorMap {
});
// device.hide();
// 如果没有有这个公司的数组,就创建,有就直接push
if
(
!
Array
.
isArray
(
this
.
allDevic
[
company
Type
]))
{
this
.
allDevic
[
company
Type
]
=
[];
if
(
!
Array
.
isArray
(
this
.
allDevic
e
[
icon
Type
]))
{
this
.
allDevic
e
[
icon
Type
]
=
[];
}
this
.
allDevic
[
company
Type
].
push
(
device
);
this
.
allDevic
e
[
icon
Type
].
push
(
device
);
// 设备的事件函数
this
.
deviceEvent
(
device
,
compontent
);
...
...
@@ -287,7 +287,9 @@ export class EditorMap {
*/
markerClick
(
target
,
compontent
)
{
const
deviceExtData
=
target
.
getExtData
();
const
{
longitude
:
lng
,
latitude
:
lat
}
=
deviceExtData
;
// 创建一个可以控制的组件,将其dom插入infowindow
this
.
infowindowComponent
=
this
.
createInfowindowDom
(
this
.
vue
,
...
...
@@ -295,6 +297,7 @@ export class EditorMap {
deviceExtData
,
compontent
);
// 没恩么用,控制台测试的时候用着玩的
window
.
func
=
()
=>
{
const
{
longitude
:
lng
,
latitude
:
lat
}
=
target
.
getExtData
();
...
...
@@ -316,6 +319,7 @@ export class EditorMap {
anchor
:
"middle-left"
,
offset
:
[
20
,
-
10
],
});
this
.
infowindow
.
open
(
this
.
map
);
}
// 创建要加入到infowindow里的
...
...
@@ -344,22 +348,25 @@ export class EditorMap {
}
// 地图上add管道
addPipeLine
(
objData
,
component
)
{
const
{
path
,
pipePressure
,
companyType
}
=
objData
;
const
{
path
,
pipePressure
,
iconType
}
=
objData
;
console
.
log
(
path
);
// 根据压力获取颜色
const
color
=
pipeColor
[
pipePressure
];
const
color
=
pipeColor
[
pipePressure
+
1
];
const
pipe
=
this
.
createPipeLine
({
path
,
path
:
eval
(
path
)
,
strokeWeight
:
4
,
strokeColor
:
color
,
extData
:
objData
,
cursor
:
"pointer"
,
});
this
.
map
.
add
(
pipe
);
console
.
log
(
pipe
.
getExtData
());
// pipe.hide();
if
(
!
Array
.
isArray
(
this
.
pipeArr
[
company
Type
]))
{
this
.
pipeArr
[
company
Type
]
=
[];
if
(
!
Array
.
isArray
(
this
.
pipeArr
[
icon
Type
]))
{
this
.
pipeArr
[
icon
Type
]
=
[];
}
this
.
pipeArr
[
company
Type
].
push
(
pipe
);
this
.
pipeArr
[
icon
Type
].
push
(
pipe
);
// console.log(this.pipeArr);
// this.map.panTo([path[0][0], path[0][1]]);
this
.
pipeEvent
(
pipe
,
component
);
...
...
@@ -380,7 +387,7 @@ export class EditorMap {
const
target
=
e
.
target
;
// 根据管道压力获取颜色
const
{
pipePressure
}
=
target
.
getExtData
();
const
color
=
pipeColor
[
pipePressure
];
const
color
=
pipeColor
[
pipePressure
+
1
];
// 获取当前颜色
const
options
=
target
.
getOptions
();
options
.
strokeColor
=
color
;
...
...
@@ -434,33 +441,56 @@ export class EditorMap {
this
.
infowindow
.
open
(
this
.
map
);
}
infowindowClose
()
{
if
(
!
this
.
infowindow
)
return
;
if
(
!
this
.
infowindow
)
return
;
this
.
infowindow
.
close
();
}
// 根据公司过滤是否显示 公司由一个数组传过来
companyFilter
(
companyArr
)
{
for
(
let
pipeItem
in
this
.
pipeArr
)
{
// 如果item属于数组说明要显示,凑则就是隐藏
if
(
companyArr
.
indexOf
(
+
pipeItem
)
>=
0
)
{
this
.
pipeArr
[
pipeItem
].
forEach
((
pipe
)
=>
{
// if (companyArr.indexOf(+pipeItem+'') >= 0) {
// this.pipeArr[pipeItem].forEach((pipe) => {
// pipe.show();
// });
// } else {
// this.pipeArr[pipeItem].forEach((pipe) => {
// pipe.hide();
// });
// }
this
.
pipeArr
[
pipeItem
].
forEach
((
pipe
)
=>
{
const
data
=
pipe
.
getExtData
();
if
(
companyArr
.
indexOf
(
data
.
companyType
+
""
)
>=
0
)
{
pipe
.
show
();
});
}
else
{
this
.
pipeArr
[
pipeItem
].
forEach
((
pipe
)
=>
{
}
else
{
pipe
.
hide
();
}
);
}
}
}
);
}
for
(
let
deviceItem
in
this
.
allDevic
)
{
if
(
companyArr
.
indexOf
(
+
deviceItem
)
>=
0
)
{
this
.
allDevic
[
deviceItem
].
forEach
((
device
)
=>
{
for
(
let
deviceItem
in
this
.
allDevice
)
{
// if (companyArr.indexOf(+deviceItem+'') >= 0) {
// this.allDevice[deviceItem].forEach((device) => {
// device.show();
// });
// } else {
// this.allDevice[deviceItem].forEach((device) => {
// device.hide();
// });
// }
console
.
log
(
this
.
allDevice
);
this
.
allDevice
[
deviceItem
].
forEach
((
device
)
=>
{
const
data
=
device
.
getExtData
();
// 燃气没有公司,所以没有device.companyType不收到公司的控制
if
(
companyArr
.
indexOf
(
data
.
companyType
+
""
)
>=
0
||
!
data
.
companyType
)
{
device
.
show
();
});
}
else
{
this
.
allDevic
[
deviceItem
].
forEach
((
device
)
=>
{
}
else
{
device
.
hide
();
}
);
}
}
}
);
}
}
// 卫星图切换
...
...
gassafetyprogress-web/src/views/bigWindow/index.vue
View file @
4980304e
<!--
* @Author: your name
* @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-02-2
2 15:09:22
* @LastEditTime: 2022-02-2
6 10:08:49
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue
...
...
@@ -13,15 +13,11 @@
<Center
:show=
"show"
:centerData=
"centerData"
/>
<PipeColor
/>
<div
class=
"home-div"
>
<img
src=
"@/assets/mapinages/bottombanner.png"
alt=
""
style=
"width: 100%; height: 100%; z-index: 999"
/>
<img
src=
"@/assets/mapinages/bottombanner.png"
alt=
""
style=
""
/>
<div
class=
"listingsSty fangy"
>
<div
@
click=
"allCompany"
:class=
"selarr.length ==
3
? 'active' : ''"
:class=
"selarr.length ==
companyLength
? 'active' : ''"
class=
"firsty"
>
全部
...
...
@@ -118,6 +114,7 @@
<
script
>
// @ is an alias to /src
import
{
EditorMap
}
from
"@/utils/mapClass/map"
;
import
{
mapGetters
,
mapActions
}
from
"vuex"
;
import
{
pipeData
,
tiaoyaxiang
,
...
...
@@ -126,6 +123,14 @@ import {
jiankong
,
user
,
}
from
"@/utils/mapClass/config.js"
;
import
{
getPipe
,
getTyx
,
getFm
,
getCz
,
getVideo
,
getUser
,
}
from
"@/api/bigWindow/getDevice"
;
import
Line
from
"@/components/bigWindow/Line.vue"
;
import
VideoView
from
"@/components/bigWindow/VideoView.vue"
;
import
DeviceA
from
"@/components/bigWindow/DeviceA.vue"
;
...
...
@@ -173,41 +178,80 @@ export default {
],
};
},
computed
:
{
...
mapGetters
([
"company"
,
"systemSetting"
]),
companyLength
()
{
return
this
.
typeList
.
length
;
},
},
watch
:
{
selarr
(
newValue
)
{
if
(
newValue
.
length
==
3
)
{
if
(
newValue
.
length
==
this
.
companyLength
)
{
this
.
$refs
.
mychild
.
choice
(
0
);
this
.
$refs
.
mychild2
.
choice
(
0
);
}
},
},
mounted
()
{
const
path
=
eval
(
this
.
$store
.
state
.
user
.
systemSetting
.
map_center
);
// console.log(99999999999999)
// getPipe().then(res=>{
// console.log("成功成功成功成功成功成功成功成功成功成功成功成功成功成功成功成功成功成功成功成功",res)
// }).catch(res=>{
// console.log(123)
// })
// return;
const
path
=
eval
(
this
.
systemSetting
.
map_center
);
this
.
map
=
new
EditorMap
(
"map"
,
{
center
:
path
,
center
:
path
,
mapStyle
:
"amap://styles/f71d3a3d73e14f5b2bf5508bf1411758"
,
zoom
:
14.5
,
},
this
);
this
.
addPipeLine
();
this
.
addDevice
(
tiaoyaxiang
,
DeviceA
);
this
.
addDevice
(
famen
,
DeviceA
);
this
.
addDevice
(
changzhan
,
DeviceA
);
this
.
addDevice
(
user
,
User
);
this
.
addDevice
(
jiankong
,
VideoView
);
// 这是测试,用本地数据
if
(
this
.
systemSetting
.
prod_test
===
"test"
)
{
this
.
addPipeLine
(
pipeData
,
Line
);
this
.
addDevice
(
tiaoyaxiang
,
DeviceA
);
this
.
addDevice
(
famen
,
DeviceA
);
this
.
addDevice
(
changzhan
,
DeviceA
);
this
.
addDevice
(
user
,
User
);
this
.
addDevice
(
jiankong
,
VideoView
);
}
else
{
// 调用状态管理器方法获取公司信息每次都要调取,因为每次进来都是更新的
this
.
GetCompany
();
this
.
typeList
=
this
.
company
.
map
((
item
)
=>
({
val
:
item
.
conpanyId
,
name
:
item
.
companyName
,
}));
this
.
selarr
=
this
.
company
.
map
((
item
)
=>
item
.
conpanyId
);
// getPipe() getTyx() getFm() getCz() getVideo() getUser()
this
.
goMap
(
getPipe
,
this
.
addPipeLine
,
Line
);
this
.
goMap
(
getTyx
,
this
.
addDevice
,
DeviceA
);
this
.
goMap
(
getFm
,
this
.
addDevice
,
DeviceA
);
this
.
goMap
(
getCz
,
this
.
addDevice
,
DeviceA
);
this
.
goMap
(
getVideo
,
this
.
addDevice
,
VideoView
);
this
.
goMap
(
getUser
,
this
.
addDevice
,
User
);
// getVideo().then((res) => {
// console.log("getVideo", res);
// });
}
this
.
currentTime
();
this
.
$refs
.
mychild
.
choice
(
0
);
this
.
$refs
.
mychild2
.
choice
(
0
);
},
methods
:
{
addPipeLine
()
{
for
(
let
comp
in
pipeData
)
{
pipeData
[
comp
].
forEach
((
pipe
)
=>
{
this
.
map
.
addPipeLine
(
pipe
,
Line
);
...
mapActions
({
GetCompany
:
"bigWindowCompany/GetCompany"
,
}),
// 管道上图
addPipeLine
(
data
,
component
)
{
for
(
let
comp
in
data
)
{
data
[
comp
].
forEach
((
pipe
)
=>
{
this
.
map
.
addPipeLine
(
pipe
,
component
);
});
}
},
...
...
@@ -219,6 +263,20 @@ export default {
});
}
},
goMap
(
httpFunc
,
addFunc
,
component
)
{
httpFunc
().
then
((
res
)
=>
{
console
.
log
(
"resresres"
,
res
);
// 根据数据格式不同,赋值不同,如果是个数组,就用res,如果不是就用res.data
let
config
=
{};
if
(
Array
.
isArray
(
res
))
{
config
=
{
data
:
res
};
}
else
{
config
=
{
data
:
res
.
data
};
}
addFunc
(
config
,
component
);
});
},
centerShow
(
boolean
)
{
this
.
show
=
boolean
;
},
...
...
@@ -229,10 +287,10 @@ export default {
},
allCompany
()
{
if
(
this
.
selarr
.
length
==
3
)
{
if
(
this
.
selarr
.
length
==
this
.
companyLength
)
{
this
.
selarr
=
[];
}
else
{
this
.
selarr
=
[
1
,
2
,
3
]
;
this
.
selarr
=
this
.
company
.
map
((
item
)
=>
item
.
conpanyId
)
;
}
this
.
map
.
companyFilter
(
this
.
selarr
);
...
...
@@ -367,28 +425,36 @@ export default {
position
:
fixed
;
bottom
:
0
;
margin-left
:
25%
;
z-index
:
1000
;
// z-index: 1000;
img
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
z-index
:
-1
;
}
}
.listingsSty
{
/* height: 25px; */
position
:
fixed
;
//
position: fixed;
/* border: 1px solid #fff; */
bottom
:
0
;
margin-bottom
:
10px
;
width
:
30%
;
margin-left
:
10%
;
// font-family: 'arialbd';
margin-left
:
25%
;
width
:
50%
;
display
:
flex
;
justify-content
:
space-between
;
padding-top
:
25px
;
// font-family: 'arialbd';
}
.firsty
{
width
:
15%
;
// width: 15%;
min-width
:
80px
;
height
:
35px
;
text-align
:
center
;
line-height
:
35px
;
/* border: 1px solid #fff; */
color
:
#fff
;
font-size
:
16px
;
float
:
left
;
margin-left
:
8%
;
//
float: left;
//
margin-left: 8%;
cursor
:
pointer
;
// font-family: 'arialbd';
}
...
...
gassafetyprogress-web/vue.config.js
View file @
4980304e
...
...
@@ -34,7 +34,8 @@ module.exports = {
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
target
:
`http://222.223.203.154:8092/gassafety`
,
// target: `http://222.223.203.154:8092/gassafety`,
target
:
`http://192.168.2.14:8903/gassafety`
,
changeOrigin
:
true
,
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
...
...
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