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
903645f1
Commit
903645f1
authored
Jul 14, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加临时启停用效果
parent
109d41a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
4 deletions
+86
-4
sample-form-client-ui/admin/.env.production
sample-form-client-ui/admin/.env.production
+1
-1
sample-form-client-ui/admin/src/App.vue
sample-form-client-ui/admin/src/App.vue
+26
-2
sample-form-client-ui/admin/src/api/index.js
sample-form-client-ui/admin/src/api/index.js
+15
-1
sample-form-client-ui/admin/src/assets/img/tingyong.png
sample-form-client-ui/admin/src/assets/img/tingyong.png
+0
-0
sample-form-client-ui/admin/src/components/EnabledDev.vue
sample-form-client-ui/admin/src/components/EnabledDev.vue
+44
-0
No files found.
sample-form-client-ui/admin/.env.production
View file @
903645f1
#生产环境
NODE_ENV = "production"
VUE_APP_API_PHP_URL=
/basics_api
VUE_APP_API_PHP_URL=
zwfw_api/
sample-form-client-ui/admin/src/App.vue
View file @
903645f1
...
...
@@ -2,19 +2,22 @@
<div
class=
"app"
>
<router-view></router-view>
<NetworkError
:isShowError=
"isShowError"
></NetworkError>
<EnabledDev
:enabled=
"enabled"
></EnabledDev>
</div>
</
template
>
<
script
>
import
local
from
"
@/utils/local
"
;
import
NetworkError
from
"
@/components/NetworkError.vue
"
;
import
EnabledDev
from
"
@/components/EnabledDev.vue
"
;
import
mq
from
"
@/mixin/mq
"
;
import
{
getHomeInfo
,
getSkinList
}
from
"
@/api
"
;
import
{
getHomeInfo
,
getSkinList
,
getDeviceList
}
from
"
@/api
"
;
import
{
mapMutations
}
from
"
vuex
"
;
export
default
{
mixins
:
[
mq
],
components
:
{
NetworkError
,
EnabledDev
,
},
data
()
{
return
{
...
...
@@ -22,10 +25,12 @@ export default {
devicenum
:
""
,
linkDom
:
null
,
// 换皮
isShowError
:
false
,
enabled
:
1
,
};
},
watch
:
{
"
$route.path
"
(
newVal
)
{
this
.
getDeviceList
();
if
(
newVal
==
"
/
"
||
newVal
==
"
/home
"
)
{
this
.
getHomeInfo
();
this
.
getSetinfo
();
...
...
@@ -59,7 +64,7 @@ export default {
},
serviceInfo
:
{
homeUrl
:
"
http://192.168.0.24:8080/#/
"
,
serverUrl
:
"
http://1
92.168.0.98
:11078/
"
,
serverUrl
:
"
http://1
12.19.80.237
:11078/
"
,
},
devicenum
:
"
18-93-7F-C0-AD-B5
"
,
// devicenum: "B8-13-32-86-9F-04",
...
...
@@ -79,6 +84,7 @@ export default {
window
.
addEventListener
(
"
offline
"
,
()
=>
{
this
.
isShowError
=
true
;
});
this
.
getDevInfo
();
},
methods
:
{
...
mapMutations
([
...
...
@@ -148,6 +154,24 @@ export default {
}
}
},
async
getDeviceList
()
{
let
res
=
await
getDeviceList
({
page
:
1
,
size
:
-
1
,
});
if
(
res
.
data
.
code
==
1
)
{
let
{
data
}
=
res
.
data
.
data
;
if
(
!
data
.
length
)
return
;
let
{
enabled
}
=
data
[
0
];
this
.
enabled
=
enabled
;
}
},
// 轮询设备状态
getDevInfo
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
getDeviceList
();
},
1000
*
60
);
},
},
};
</
script
>
...
...
sample-form-client-ui/admin/src/api/index.js
View file @
903645f1
...
...
@@ -117,9 +117,23 @@ export const getSkinList = (data) => {
};
// 排队编号查询对应事项
export
const
getMatterForFlownum
=
(
params
)
=>
{
let
baseUrl
=
local
.
getLocal
(
"
serverUrl
"
);
return
request
({
url
:
`
${
PHP_URL
}
/
api/matter/matterForFlownum`
,
url
:
`
${
baseUrl
}${
PHP_URL
}
api/matter/matterForFlownum`
,
method
:
"
get
"
,
params
,
});
};
//获取设备列表
export
const
getDeviceList
=
(
data
)
=>
{
let
baseUrl
=
local
.
getLocal
(
"
serverUrl
"
);
let
deviceCode
=
local
.
getLocal
(
"
devicenum
"
);
return
request
({
url
:
`
${
baseUrl
}
sampleform/device/list`
,
method
:
"
post
"
,
data
:
{
deviceCode
,
...
data
,
},
});
};
sample-form-client-ui/admin/src/assets/img/tingyong.png
0 → 100644
View file @
903645f1
29 KB
sample-form-client-ui/admin/src/components/EnabledDev.vue
0 → 100644
View file @
903645f1
<
template
>
<div
class=
"enabled"
v-show=
"!enabled"
>
<div
class=
"enabled_box"
>
<img
class=
"enabled_img"
src=
"../assets/img/tingyong.png"
/>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
enabled
:
{
type
:
Number
,
required
:
true
,
default
:
1
,
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.enabled {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0px;
left: 0px;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
.enabled_box {
width: 400px;
height: 400px;
background-color: #fff;
border-radius: 4px;
.enabled_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