Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 487d13bd
authored
Dec 07, 2022
by
wuwx
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
看板展示假性离线
1 parent
4ddb678a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
33 deletions
src/styles/home.scss
src/views/home/index.vue
src/styles/home.scss
View file @
487d13b
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
width
:
100%
;
width
:
100%
;
height
:
100px
;
height
:
100px
;
}
}
.c_canvass
{
width
:
100px
;
height
:
134px
;
}
.static_list_box
{
.static_list_box
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
@@ -43,6 +47,13 @@
...
@@ -43,6 +47,13 @@
border-top
:
2px
solid
#eee
;
border-top
:
2px
solid
#eee
;
font-size
:
13px
;
font-size
:
13px
;
}
}
.equipment_box
{
display
:
flex
;
.equipment_boxs
{
display
:
flex
;
flex
:
1
;
}
}
}
}
}
}
.cell_box
:last-child
{
.cell_box
:last-child
{
...
...
src/views/home/index.vue
View file @
487d13b
...
@@ -58,14 +58,23 @@
...
@@ -58,14 +58,23 @@
</div>
</div>
<!-- 总激活数 end -->
<!-- 总激活数 end -->
<!-- 设备
在线
数 开始 -->
<!-- 设备数 开始 -->
<div
class=
"cell_box"
>
<div
class=
"cell_box"
style=
"flex: 2;"
>
<!-- 表头 开始 -->
<!-- 表头 开始 -->
<div
class=
"head"
>
<div
class=
"head"
>
<span>
设备数
</span>
</div>
<!-- 表头 end -->
<!-- 数据 开始 -->
<div
class=
"info_box"
>
<div
class=
"equipment_box"
>
<!-- 设备在线数 -->
<div
class=
"equipment_boxs"
>
<div>
<span>
设备在线数
</span>
<span>
设备在线数
</span>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"right-start"
>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"right-start"
>
<div
slot=
"content"
>
<div
slot=
"content"
>
<p>
在线数 = 有线设备在线数 + 无线设备在线数
</p>
<p>
{{
hasPermission
(
'data_doard_offLine'
)
?
'总在线数 = 有线设备在线数 + 无线设备在线数 + 假性离线数'
:
'在线数 = 有线设备在线数 + 无线设备在线数'
}}
</p>
<p>
有线设备在线数:
</p>
<p>
有线设备在线数:
</p>
<p>
<p>
统计该账号权限下,在统计当日所有设备在线率情况,
统计该账号权限下,在统计当日所有设备在线率情况,
...
@@ -76,33 +85,35 @@
...
@@ -76,33 +85,35 @@
统计该账号权限下,在统计当日所有设备在线率情况,
统计该账号权限下,在统计当日所有设备在线率情况,
<span>
3天内(72小时内)
</span>
连接服务器即认为在线;
<span>
3天内(72小时内)
</span>
连接服务器即认为在线;
</p>
</p>
<p>
在线率 = 在线数 / 总激活数;
</p>
<p
v-show=
"hasPermission('data_doard_offLine')"
>
假性离线数:
</p>
<p>
在线率只保留整数,四舍五入
</p>
<p
v-show=
"hasPermission('data_doard_offLine')"
>
统计该账号权限下,在统计当日所有设备十日内反复离线情况,
<span>
若满足则判定为假性离线,即在线;
</span>
</p>
<p>
{{
hasPermission
(
'data_doard_offLine'
)
?
'总在线率 = (在线数+假性离线数)/ 总激活数;'
:
'在线率 = 在线数 / 总激活数;'
}}
</p>
<p>
{{
hasPermission
(
'data_doard_offLine'
)
?
'总在线率保留百分位,四舍五入'
:
'在线率保留百分位,四舍五入'
}}
</p>
</div>
</div>
<i
class=
"el-icon-question"
></i>
<i
class=
"el-icon-question"
></i>
</el-tooltip>
</el-tooltip>
<div
class=
"title"
style=
"margin-top: 10px;"
>
{{
staticInfo
.
onlineNumber
}}
</div>
</div>
</div>
<!-- 表头 end -->
<div
id=
"onlineChart"
class=
"c_canvass"
></div>
<!-- 数据 开始 -->
<div
class=
"info_box"
>
<div
class=
"title"
>
{{
staticInfo
.
onlineNumber
}}
</div>
<div
id=
"onlineChart"
class=
"c_canvas"
></div>
<div
class=
"footer"
>
设备在线率:
{{
staticInfo
.
onlineRate
}}
%
</div>
</div>
<!-- 假性离线数 -->
<div
class=
"equipment_boxs"
v-show=
"hasPermission('data_doard_offLine')"
>
<div>
<span>
假性离线数
</span>
<div
class=
"title"
style=
"margin-top: 10px;"
>
{{
staticInfo
.
fakeOfflineNumber
}}
</div>
</div>
</div>
<!-- 数据 end --
>
<div
id=
"fakeOfflineChart"
class=
"c_canvass"
></div
>
</div>
</div>
<!-- 设备在线数 end -->
<!-- 设备离线数 -->
<div
class=
"equipment_boxs"
>
<!-- 设备离线数 开始 -->
<div>
<div
class=
"cell_box"
>
<!-- 表头 开始 -->
<div
class=
"head"
>
<span>
设备离线数
</span>
<span>
设备离线数
</span>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"right-start"
>
<el-tooltip
class=
"item"
effect=
"dark"
placement=
"right-start"
>
<div
slot=
"content"
>
<div
slot=
"content"
>
<p>
离线数 = 有线设备离线数 + 无线设备离线数
</p>
<p>
{{
hasPermission
(
'data_doard_offLine'
)
?
'离线数 = 有线设备离线数 + 无线设备离线数 - 假性离线数'
:
'离线数 = 有线设备离线数 + 无线设备离线数'
}}
</p>
<p>
有线设备离线数:
</p>
<p>
有线设备离线数:
</p>
<p>
<p>
统计该账号权限下,在统计当日所有设备在线率情况,
统计该账号权限下,在统计当日所有设备在线率情况,
...
@@ -115,25 +126,30 @@
...
@@ -115,25 +126,30 @@
<span>
3天内(72小时内)
</span>
<span>
3天内(72小时内)
</span>
无连接服务器即认为离线;
无连接服务器即认为离线;
</p>
</p>
<p>
离线率 = 离线数 / 总激活数;
</p>
<p
v-show=
"hasPermission('data_doard_offLine')"
>
<p>
离线率只保留整数,四舍五入
</p>
统计该账号权限下,在统计当日所有设备十日内反复离线情况,若满足则判定为假性离线,即在线,并从离线率中剔除;
</p>
<p>
{{
hasPermission
(
'data_doard_offLine'
)
?
'离线率 = (离线数 - 假性离线数) / 总激活数;'
:
'离线率 = 离线数 / 总激活数;'
}}
</p>
<p>
离线率保留百分位,四舍五入
</p>
<p
v-if=
"isZhongli && staticInfo.offlineSnNum>0"
>
确认
{{
staticInfo
.
offlineSnNum
}}
台设备加入白名单,不予统计
</p>
<p
v-if=
"isZhongli && staticInfo.offlineSnNum>0"
>
确认
{{
staticInfo
.
offlineSnNum
}}
台设备加入白名单,不予统计
</p>
</div>
</div>
<i
class=
"el-icon-question"
></i>
<i
class=
"el-icon-question"
></i>
</el-tooltip>
</el-tooltip>
<div
class=
"title"
style=
"margin-top: 10px;"
>
{{
staticInfo
.
offlineNumber
}}
</div>
</div>
<div
id=
"offlineChart"
class=
"c_canvass"
></div>
</div>
</div>
</div>
<!-- 表头 end -->
<!-- 数据 开始 -->
<div
class=
"info_box"
>
<div
class=
"title"
>
{{
staticInfo
.
offlineNumber
}}
</div>
<div
id=
"offlineChart"
class=
"c_canvas"
></div>
<div
class=
"footer"
>
<div
class=
"footer"
>
设备离线率:
{{
staticInfo
.
offlineRate
}}
%
<span
style=
"margin-right: 276px;color: #0196FA;"
>
设备在线率:
{{
hasPermission
(
'data_doard_offLine'
)
?
number
(
staticInfo
.
onlineRate
)
+
number
(
staticInfo
.
fakeOfflineRate
)
:
staticInfo
.
onlineRate
}}
%
</span>
<span
style=
"color: #F47F13;"
>
设备离线率:
{{
hasPermission
(
'data_doard_offLine'
)
?
number
(
staticInfo
.
offlineRate
)
-
number
(
staticInfo
.
fakeOfflineRate
)
:
staticInfo
.
offlineRate
}}
%
</span>
</div>
</div>
</div>
</div>
<!-- 数据 end -->
<!-- 数据 end -->
</div>
</div>
<!-- 设备离线数 end -->
<!-- 设备数 end -->
</div>
</div>
<!-- 数据列表 end -->
<!-- 数据列表 end -->
...
@@ -243,7 +259,6 @@ export default {
...
@@ -243,7 +259,6 @@ export default {
};
};
},
},
mounted
()
{
mounted
()
{
this
.
getStatic
();
this
.
getAlarm
();
this
.
getAlarm
();
this
.
getActived
(
this
.
createActivedLineChart
);
this
.
getActived
(
this
.
createActivedLineChart
);
this
.
getActived
(
this
.
createAllActivedLineChart
,
11
);
this
.
getActived
(
this
.
createAllActivedLineChart
,
11
);
...
@@ -251,7 +266,24 @@ export default {
...
@@ -251,7 +266,24 @@ export default {
//GET_HOME_AUTHUSERORG().then((res) => {});
//GET_HOME_AUTHUSERORG().then((res) => {});
this
.
getRoles
();
this
.
getRoles
();
},
},
activated
()
{
this
.
getStatic
();
},
methods
:
{
methods
:
{
// 转number类型
number
(
a
)
{
return
Number
(
a
)
},
// 是否有权限
hasPermission
(
id
)
{
let
list
=
this
.
$root
.
parentCommon
.
getAuthData
();
let
idx
=
list
.
findIndex
((
k
)
=>
k
.
origin
.
permissionTag
==
id
);
if
(
idx
<
0
)
{
return
false
;
}
else
{
return
true
;
}
},
// 切换日期
// 切换日期
linkEvent
(
row
)
{
linkEvent
(
row
)
{
this
.
active
=
row
.
id
;
this
.
active
=
row
.
id
;
...
@@ -266,20 +298,38 @@ export default {
...
@@ -266,20 +298,38 @@ export default {
// 在线率
// 在线率
let
m
=
[];
let
m
=
[];
m
.
push
({
value
:
100
-
obj
.
onlineRate
,
name
:
""
});
m
.
push
({
value
:
this
.
accSub
(
100
,
obj
.
onlineRate
)
,
name
:
""
});
m
.
push
({
value
:
obj
.
onlineRate
,
name
:
""
});
m
.
push
({
value
:
obj
.
onlineRate
,
name
:
""
});
if
(
this
.
hasPermission
(
'data_doard_offLine'
))
{
m
=
[]
m
.
push
({
value
:
this
.
accSub
(
100
,
obj
.
onlineRate
)
-
Number
(
obj
.
fakeOfflineRate
),
name
:
""
});
m
.
push
({
value
:
Number
(
obj
.
onlineRate
)
+
Number
(
obj
.
fakeOfflineRate
),
name
:
""
});
}
this
.
createBindChart
(
"onlineChart"
,
m
);
this
.
createBindChart
(
"onlineChart"
,
m
);
// 离线率
// 离线率
let
n
=
[];
let
n
=
[];
// console.log('obj.offlineRate', this.accSub(100, obj.offlineRate));
n
.
push
({
value
:
this
.
accSub
(
100
,
obj
.
offlineRate
),
name
:
""
});
n
.
push
({
value
:
100
-
obj
.
offlineRate
,
name
:
""
});
n
.
push
({
value
:
obj
.
offlineRate
,
name
:
""
});
n
.
push
({
value
:
obj
.
offlineRate
,
name
:
""
});
if
(
this
.
hasPermission
(
'data_doard_offLine'
))
{
n
=
[]
n
.
push
({
value
:
Number
(
this
.
accSub
(
100
,
obj
.
offlineRate
))
+
Number
(
obj
.
fakeOfflineRate
),
name
:
""
});
n
.
push
({
value
:
Number
(
obj
.
offlineRate
)
-
Number
(
obj
.
fakeOfflineRate
),
name
:
""
});
}
this
.
createBindChart
(
"offlineChart"
,
n
);
this
.
createBindChart
(
"offlineChart"
,
n
);
// 假性离线率
let
x
=
[]
if
(
this
.
hasPermission
(
'data_doard_offLine'
))
{
x
.
push
({
value
:
this
.
accSub
(
100
,
obj
.
fakeOfflineRate
),
name
:
""
});
x
.
push
({
value
:
obj
.
fakeOfflineRate
,
name
:
""
});
}
this
.
createBindChart
(
"fakeOfflineChart"
,
x
);
});
});
},
},
// 计算函数
accSub
(
arg1
,
arg2
)
{
accSub
(
arg1
,
arg2
)
{
let
r1
,
r2
,
m
,
n
let
r1
,
r2
,
m
,
n
try
{
try
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment