Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pingshan-ranqi
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
yaqizhang
pingshan-ranqi
Commits
6079d5b3
Commit
6079d5b3
authored
Nov 09, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
没完成的抽屉功能
parent
7b28d70e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
3 deletions
+73
-3
index.vue
gassafety-web/src/views/enterprise/mapView/index.vue
+73
-3
No files found.
gassafety-web/src/views/enterprise/mapView/index.vue
View file @
6079d5b3
...
...
@@ -182,7 +182,16 @@
{{ item.label }}
</div>
<!-- 有多少设备 -->
<div
class=
"diviceNum"
>
({{ allList[index].length }})个设备
</div>
<!-- 管道 -->
<!-- rightBototmData[0].number -->
<
template
v-if=
"item.type == '0'"
>
<div
class=
"diviceNum"
>
(
{{
pipeLength
}}
米)
</div>
</
template
>
<!-- 设备 -->
<
template
v-else
>
<div
class=
"diviceNum"
>
(
{{
allList
[
index
].
length
}}
个)
</div>
</
template
>
<!-- 对钩 -->
<i
class=
"el-icon-check bingo"
></i>
<!-- <i class="ju"></i> -->
...
...
@@ -383,6 +392,8 @@ export default {
// 左边的bar的active判定 被选中显示的设备
leftBarNum
:
[
1
,
2
,
3
,
4
,
7
,
8
,
9
,
10
],
// leftBarNum: [],
// 管道的长度
pipeLength
:
0
,
// 右转箭头的样式active判定
arrowRightNum
:
[],
// 新建里的值
...
...
@@ -517,6 +528,7 @@ export default {
// // immediate: true,
// },
},
methods
:
{
onResize
()
{
this
.
boxHeight
=
document
.
body
.
clientHeight
-
80
;
...
...
@@ -566,11 +578,11 @@ export default {
getCompList
()
{
listInfo
().
then
((
res
)
=>
{
console
.
log
(
"公司列表"
,
res
.
rows
);
this
.
comp
=
res
.
rows
.
map
((
item
)
=>
{
this
.
comp
=
res
.
rows
.
map
((
item
)
=>
{
const
{
infoId
,
unitName
}
=
item
;
return
{
infoId
,
unitName
unitName
,
};
});
});
...
...
@@ -650,6 +662,7 @@ export default {
if
(
res
.
code
==
200
)
{
this
.
gaoMap
.
addPolyline
(
res
.
data
);
this
.
pipeClassify
(
res
.
data
);
// 获取管道长度
}
return
res
.
code
;
});
...
...
@@ -889,6 +902,7 @@ export default {
obj
=
{
number
:
0
,
type
:
"99"
};
}
this
.
rightBototmData
.
push
(
obj
);
console
.
log
(
"rightBototmData"
,
this
.
rightBototmData
);
}
});
await
countDeviceByType
().
then
((
res
)
=>
{
...
...
@@ -932,6 +946,62 @@ export default {
this
.
compChangeArr
.
splice
(
index
,
1
);
}
console
.
log
(
this
.
compChangeArr
);
this
.
filterCompDevice
(
this
.
compChangeArr
);
// 管道长度获取
this
.
pipeLength
=
this
.
pipeLengthMath
(
this
.
allList
[
0
]);
},
// 过滤公司的设备并更新左侧抽屉数据
filterCompDevice
(
arr
)
{
// 管道跟4设备先重置
this
.
compDeviceDrawReset
();
// 管道
const
pipeArr
=
this
.
gaoMap
.
polyLines
.
filter
((
item
)
=>
{
const
{
enterpriseId
}
=
item
.
getExtData
().
lineData
;
return
arr
.
indexOf
(
enterpriseId
)
>=
0
;
})
.
map
((
item
)
=>
{
return
{
...
item
.
getExtData
().
lineData
};
});
// 管道存储
this
.
pipeClassify
(
pipeArr
);
// 4设备
const
deviceArr
=
this
.
gaoMap
.
markers
.
filter
((
item
)
=>
{
const
{
enterpriseId
}
=
item
.
getExtData
();
console
.
log
(
item
.
getExtData
());
return
arr
.
indexOf
(
enterpriseId
)
>=
0
;
})
.
map
((
item
)
=>
{
return
{
...
item
.
getExtData
()
};
});
// 4设备存储
this
.
deviceClassify
(
deviceArr
);
// 存储之后执行程序初始化抽屉里的设备
this
.
pipeList
();
console
.
log
(
"pipeArr"
,
pipeArr
,
deviceArr
);
},
// 切换公司的时候管道跟前4个设备重置
compDeviceDrawReset
()
{
this
.
changeBtnData
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
5
)
{
// 清空list
this
.
allList
[
index
]
=
[];
item
.
list
=
[];
item
.
maxPage
=
99
;
item
.
nowPage
=
1
;
}
});
},
// 管道长度
pipeLengthMath
(
arr
)
{
return
arr
.
reduce
((
a
,
b
)
=>
{
return
a
+
b
.
selfData
.
pipeLength
;
},
0
);
},
// 左边的Bar修改值 左边抽屉
leftBarChange
(
item
)
{
...
...
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