Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
sample-form-platform
Commits
be3844a9
Commit
be3844a9
authored
Mar 16, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加断网提示
parent
bc2d39d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
sample-form-client-ui/admin/src/App.vue
sample-form-client-ui/admin/src/App.vue
+17
-0
sample-form-client-ui/admin/src/components/NetworkError.vue
sample-form-client-ui/admin/src/components/NetworkError.vue
+44
-0
No files found.
sample-form-client-ui/admin/src/App.vue
View file @
be3844a9
<
template
>
<
template
>
<div
class=
"app"
>
<div
class=
"app"
>
<router-view></router-view>
<router-view></router-view>
<NetworkError
:isShowError=
"isShowError"
></NetworkError>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
local
from
"
@/utils/local
"
;
import
local
from
"
@/utils/local
"
;
import
NetworkError
from
"
@/components/NetworkError.vue
"
;
import
mq
from
"
@/mixin/mq
"
;
import
mq
from
"
@/mixin/mq
"
;
import
{
getHomeInfo
}
from
"
@/api
"
;
import
{
getHomeInfo
}
from
"
@/api
"
;
import
{
mapMutations
}
from
"
vuex
"
;
import
{
mapMutations
}
from
"
vuex
"
;
export
default
{
export
default
{
mixins
:
[
mq
],
mixins
:
[
mq
],
components
:
{
NetworkError
,
},
data
()
{
data
()
{
return
{
return
{
routeQuery
:
""
,
routeQuery
:
""
,
devicenum
:
""
,
devicenum
:
""
,
linkDom
:
null
,
// 换皮
linkDom
:
null
,
// 换皮
isShowError
:
false
,
};
};
},
},
watch
:
{
watch
:
{
...
@@ -58,6 +64,17 @@ export default {
...
@@ -58,6 +64,17 @@ export default {
this
.
WebSocketMq
(
obj
);
this
.
WebSocketMq
(
obj
);
}
}
},
},
mounted
()
{
// 设备在线
window
.
addEventListener
(
"
online
"
,
()
=>
{
this
.
isShowError
=
false
;
location
.
reload
();
});
// 设备离线
window
.
addEventListener
(
"
offline
"
,
()
=>
{
this
.
isShowError
=
true
;
});
},
methods
:
{
methods
:
{
...
mapMutations
([
"
SET_homeInfo
"
,
"
SET_datumList
"
,
"
SET_matterList
"
]),
...
mapMutations
([
"
SET_homeInfo
"
,
"
SET_datumList
"
,
"
SET_matterList
"
]),
// 简析url
// 简析url
...
...
sample-form-client-ui/admin/src/components/NetworkError.vue
0 → 100644
View file @
be3844a9
<
template
>
<div
class=
"network_error"
v-show=
"isShowError"
>
<div
class=
"network_error_box"
>
<img
class=
"network_error_img"
src=
"../assets/img/网络出错@3x.png"
/>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
isShowError
:
{
type
:
Boolean
,
required
:
true
,
default
:
false
,
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.network_error {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0px;
left: 0px;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
.network_error_box {
width: 400px;
height: 400px;
background-color: #fff;
border-radius: 4px;
.network_error_img {
width: 100%;
height: 100%;
}
}
}
</
style
>
\ No newline at end of file
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