Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
robot-monitor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
汪晓凯
robot-monitor
Commits
e6f0f773
Commit
e6f0f773
authored
Apr 23, 2019
by
xiedong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持开关机器人
parent
5232ed00
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
14 deletions
+29
-14
index.js
config/index.js
+2
-3
api-config.js
src/config/api-config.js
+1
-0
overview.vue
src/views/overview.vue
+26
-11
No files found.
config/index.js
View file @
e6f0f773
...
...
@@ -11,9 +11,8 @@ module.exports = {
assetsPublicPath
:
'/'
,
proxyTable
:
{
'/asset_monitor'
:
{
// target: 'http://13.70.1.145:4567', //正式
target
:
'http://172.16.100.22:46656'
,
// 测试
// target: 'http://172.16.100.22:46657', // 测试
target
:
'http://47.52.169.49:4567'
,
//正式
// target: 'http://172.16.100.22:46656', // 测试
// secure: false, // 如果是https接口,需要配置这个参数
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
pathRewrite
:
{
...
...
src/config/api-config.js
View file @
e6f0f773
...
...
@@ -22,6 +22,7 @@ const Api = {
GetRobotConfig
:
originUrl
+
'/getRobotConfig'
,
//获取机器人配置
UpdateRobotConfig
:
originUrl
+
'/updateRobotConfig'
,
//修改机器人配置接口
transferStatusChange
:
originUrl
+
'/updateTransferStatus'
,
//充提状态开关
changeStatus
:
originUrl
+
'/changeStatus'
,
//修改机器人运行状态
}
export
default
Api
;
src/views/overview.vue
View file @
e6f0f773
...
...
@@ -89,14 +89,14 @@
<i
class=
"el-icon-caret-right"
></i>
</div>
<div
class=
"switch"
>
<span
v-show=
"
value1
"
>
关闭
</span>
<span
v-show=
"!
value1
"
>
开启
</span>
<span
v-show=
"
item.status=='normal'
"
>
关闭
</span>
<span
v-show=
"!
item.status=='normal'
"
>
开启
</span>
<el-switch
v-model=
"value1
"
:value=
"item.status=='normal'
"
active-color=
"rgba(119,146,167,1)"
inactive-color=
"rgba(236,239,241,1)"
@
change=
"clickSwitch"
disabled
>
@
change=
"clickSwitch
(item)
"
>
</el-switch>
</div>
</div>
...
...
@@ -398,17 +398,32 @@
this
.
$router
.
push
(
`/monitor/
${
this
.
$route
.
params
.
name
}
/RobotDetail`
);
},
clickSwitch
(
val
)
{
const
Tips
=
val
?
'此操作将开启机器人, 是否继续?'
:
'此操作将关闭机器人, 是否继续?'
;
const
Message
=
val
?
'开启机器人成功'
:
'关闭机器人成功'
;
const
Tips
=
val
.
status
==
'close'
?
'此操作将开启机器人, 是否继续?'
:
'此操作将关闭机器人, 是否继续?'
;
// const Message = val.status=='close'
? '开启机器人成功' : '关闭机器人成功';
this
.
$confirm
(
Tips
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
$message
({
type
:
'success'
,
message
:
Message
});
axios
.
post
(
ApiConfig
.
changeStatus
,{
account
:
val
.
account
,
symbol
:
`
${
val
.
coin
}
/
${
val
.
base
}
`
,
new_status
:
val
.
status
==
'normal'
&&
'close'
||
'open'
}).
then
(
res
=>
{
if
(
res
.
data
.
code
=
200
){
this
.
init
()
//为了改变switch的状态
this
.
$message
({
type
:
'success'
,
message
:
res
.
data
.
msg
});
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
data
.
msg
});
}
})
}).
catch
(()
=>
{
this
.
value1
=
!
val
;
this
.
$message
({
...
...
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