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
e72c114b
Commit
e72c114b
authored
Jul 26, 2018
by
wxk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:机器人详情返回保留筛选条件
parent
ecb636e5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
63 deletions
+48
-63
navLeft.vue
src/components/navLeft.vue
+4
-2
index.js
src/router/index.js
+10
-3
Login.vue
src/views/Login.vue
+1
-1
RobotContainer.vue
src/views/RobotContainer.vue
+3
-9
RobotDetails.vue
src/views/RobotDetails.vue
+4
-1
overview.vue
src/views/overview.vue
+26
-47
No files found.
src/components/navLeft.vue
View file @
e72c114b
...
...
@@ -37,9 +37,11 @@
this
.
active
=
this
.
$route
.
params
.
name
||
'account'
;
},
methods
:
{
navClick
()
{
navClick
(
index
)
{
this
.
active
=
index
;
Bus
.
$emit
(
'refresh'
);
if
(
this
.
active
!=
'account'
){
this
.
$router
.
push
(
'/monitor/'
+
this
.
active
)
this
.
$router
.
push
(
`/monitor/
${
index
}
`
)
}
else
{
this
.
$router
.
push
(
'/monitor/account'
);
}
...
...
src/router/index.js
View file @
e72c114b
...
...
@@ -24,23 +24,30 @@ export default new Router({
children
:
[
{
path
:
'account'
,
path
:
'
/monitor/
account'
,
component
:
function
(
resolve
){
require
([
'../views/account.vue'
],
resolve
);
},
},
{
path
:
":name"
,
path
:
"
/monitor/
:name"
,
component
:
function
(
resolve
){
require
([
'../views/RobotContainer.vue'
],
resolve
);
},
children
:
[
{
path
:
'/'
,
component
:
function
(
resolve
){
require
([
'../views/overview.vue'
],
resolve
);
},
},
{
path
:
'RobotDetail'
,
component
:
function
(
resolve
){
require
([
'../views/RobotDetails.vue'
],
resolve
);
},
}
},
]
}
]
...
...
src/views/Login.vue
View file @
e72c114b
...
...
@@ -255,7 +255,7 @@ export default {
localStorage
[
"username"
]
=
this
.
loginEmail
;
sessionStorage
.
setItem
(
"isLogin"
,
true
);
this
.
$router
.
push
({
path
:
'/monitor'
path
:
'/monitor
/home/overview
'
})
}
else
{
...
...
src/views/RobotContainer.vue
View file @
e72c114b
<
template
>
<div
class=
"box"
>
<overview
v-if=
"$route.path.split('/').pop() !== 'RobotDetail'"
:platInfo=
"platInfo"
></overview>
<router-view></router-view>
<keep-alive>
<router-view
:platInfo=
"platInfo"
></router-view>
</keep-alive>
</div>
</
template
>
<
script
>
import
overview
from
'./overview'
export
default
{
data
()
{
return
{
}
},
props
:
[
'platInfo'
],
components
:
{
overview
},
}
</
script
>
...
...
src/views/RobotDetails.vue
View file @
e72c114b
...
...
@@ -540,7 +540,7 @@
},
//返回上一页(关闭详情)
closeDetails
()
{
//
Bus.$emit('back');
Bus
.
$emit
(
'back'
);
this
.
$router
.
go
(
-
1
);
},
//查询行情信息
...
...
@@ -868,6 +868,9 @@
}
},
watch
:
{
$route
()
{
this
.
init
();
},
robotDetailInfo
()
{
this
.
init
();
},
...
...
src/views/overview.vue
View file @
e72c114b
...
...
@@ -173,39 +173,32 @@
props
:
[
'platInfo'
],
created
()
{
this
.
init
();
/*Bus.$on('back', ()=>
{
Bus
.
$on
(
'refresh'
,
()
=>
{
setTimeout
(()
=>
{
const overviewParams = JSON.parse(sessionStorage.getItem('overviewParams'));
this.robotStatus = overviewParams.robotStatus;
this.checkedWebs = overviewParams.checkedWebs;
this.checkedPairs = overviewParams.checkedPairs;
this.checkedCurrencies = overviewParams.checkedCurrencies;
this.subtitle = this.robotStatus === 'normal' ? '正在运行机器人' :
(this.robotStatus === 'stop' ? '停止运行机器人' :
(this.robotStatus === 'profit' ? '盈利异常机器人' :
(this.robotStatus === 'coin' ? '目标币异常机器人' :
(this.robotStatus === 'base' ? '基础币异常机器人':'所有机器人'))));
let Params = {
class: "robot", //账户级别
coin: [], //目标币种,用于首页里的筛选和币种监控 可选参数
symbol: [], //币种对,用于网站监控里的筛选 可选参数
status: "", //机器人运行状态 可选参数
abnormal: "", //有profit,coin,base这三种异常类别 可选参数
platform: [] //交易所种类 可选参数
};
if (this.robotStatus==='normal' || this.robotStatus==='stop') {
Params.status = this.robotStatus;
}else {
Params.abnormal = this.robotStatus;
}
if(!this.robotStatus) {
Params.coin = this.checkedCurrencies;
Params.symbol = this.checkedPairs;
Params.platform = this.checkedWebs;
}
this.getRobotList(Params);
},1000)
})*/
this
.
init
();
},
0
)
});
Bus
.
$on
(
'back'
,
()
=>
{
let
Params
=
{
class
:
"robot"
,
//账户级别
coin
:
[],
//目标币种,用于首页里的筛选和币种监控 可选参数
symbol
:
[],
//币种对,用于网站监控里的筛选 可选参数
status
:
""
,
//机器人运行状态 可选参数
abnormal
:
""
,
//有profit,coin,base这三种异常类别 可选参数
platform
:
[]
//交易所种类 可选参数
};
if
(
this
.
robotStatus
===
'normal'
||
this
.
robotStatus
===
'stop'
)
{
Params
.
status
=
this
.
robotStatus
;
}
else
{
Params
.
abnormal
=
this
.
robotStatus
;
}
if
(
!
this
.
robotStatus
)
{
Params
.
coin
=
this
.
checkedCurrencies
;
Params
.
symbol
=
this
.
checkedPairs
;
Params
.
platform
=
this
.
checkedWebs
;
}
this
.
getRobotList
(
Params
);
})
},
methods
:
{
init
()
{
...
...
@@ -336,17 +329,7 @@
this
.
getRobotList
(
ListParams
);
},
showDetails
(
index
)
{
const
overviewParams
=
{
robotStatus
:
this
.
robotStatus
,
checkedWebs
:
this
.
checkedWebs
,
checkedCurrencies
:
this
.
checkedCurrencies
,
checkedPairs
:
this
.
checkedPairs
,
};
// console.log(overviewParams);
sessionStorage
.
setItem
(
'overviewParams'
,
JSON
.
stringify
(
overviewParams
));
sessionStorage
.
setItem
(
'robotDetailInfo'
,
JSON
.
stringify
(
this
.
robotList
[
index
]));
this
.
$router
.
push
(
this
.
$route
.
path
+
'/RobotDetail'
);
// console.log(this.robotDetailInfo)
this
.
$router
.
push
(
`/monitor/
${
this
.
$route
.
params
.
name
}
/RobotDetail`
);
},
clickSwitch
(
val
)
{
const
Tips
=
val
?
'此操作将开启机器人, 是否继续?'
:
'此操作将关闭机器人, 是否继续?'
;
...
...
@@ -412,10 +395,6 @@
}
},
watch
:{
$route
(
newVal
,
oldVal
){
// console.log(newVal.params.name)
this
.
init
();
},
platInfo
(
val
){
this
.
webs
=
[];
//获取所有的交易所和币种
...
...
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