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
795c2e04
Commit
795c2e04
authored
Jul 19, 2018
by
wxk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
结构优化,解决详情页刷新问题
parent
fa026470
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
20 deletions
+39
-20
navLeft.vue
src/components/navLeft.vue
+15
-6
index.js
src/router/index.js
+9
-1
RobotDetails.vue
src/views/RobotDetails.vue
+8
-3
overview.vue
src/views/overview.vue
+7
-10
No files found.
src/components/navLeft.vue
View file @
795c2e04
<
template
>
<div
class=
"nav-left"
>
<el-menu
:default-active=
"
$route.path
"
:default-active=
"
active
"
class=
"el-menu-vertical-demo"
:router=
"true"
@
select=
"navClick"
>
<el-menu-item
index=
"
/monitor/
home"
>
<el-menu-item
index=
"home"
>
<span
slot=
"title"
>
首页
</span>
</el-menu-item>
<el-submenu
index=
"1"
>
<template
slot=
"title"
>
网站监控
</
template
>
<el-menu-item
:index=
"
'/monitor/' + index
"
v-for=
"(item, index) in platInfo"
:key=
"item.platform"
>
{{item.platform}}
</el-menu-item>
<el-menu-item
:index=
"
index+''
"
v-for=
"(item, index) in platInfo"
:key=
"item.platform"
>
{{item.platform}}
</el-menu-item>
</el-submenu>
<el-submenu
index=
"2"
>
<
template
slot=
"title"
>
币种监控
</
template
>
<el-menu-item
index=
"
/monitor/
BTY"
>
BTY
</el-menu-item>
<el-menu-item
index=
"
/monitor/
YCC"
>
YCC
</el-menu-item>
<el-menu-item
index=
"BTY"
>
BTY
</el-menu-item>
<el-menu-item
index=
"YCC"
>
YCC
</el-menu-item>
</el-submenu>
</el-menu>
</div>
...
...
@@ -26,14 +26,23 @@
export
default
{
data
(){
return
{
active
:
''
}
},
props
:
[
'platInfo'
],
created
()
{
this
.
active
=
this
.
$route
.
params
.
name
;
},
methods
:
{
navClick
()
{
this
.
$router
.
push
(
'/monitor/'
+
this
.
active
)
Bus
.
$emit
(
'navClick'
)
}
},
watch
:
{
$route
()
{
this
.
active
=
this
.
$route
.
params
.
name
;
}
}
}
</
script
>
...
...
src/router/index.js
View file @
795c2e04
...
...
@@ -27,7 +27,15 @@ export default new Router({
path
:
":name"
,
component
:
function
(
resolve
){
require
([
'../views/overview.vue'
],
resolve
);
}
},
children
:
[
{
path
:
'RobotDetail'
,
component
:
function
(
resolve
){
require
([
'../views/RobotDetails.vue'
],
resolve
);
},
}
]
}
]
}
...
...
src/views/RobotDetails.vue
View file @
795c2e04
...
...
@@ -457,6 +457,7 @@
export
default
{
data
(){
return
{
robotDetailInfo
:
JSON
.
parse
(
sessionStorage
.
getItem
(
'robotDetailInfo'
)),
robotInfo
:
{},
username
:
localStorage
.
getItem
(
'username'
),
value1
:
true
,
...
...
@@ -503,13 +504,14 @@
recordsLoading
:
false
,
//交易记录查询加载
}
},
props
:
[
'robot
DetailInfo'
,
'robot
BankList'
],
props
:
[
'robotBankList'
],
created
()
{
this
.
init
();
},
methods
:
{
//页面初始化
init
()
{
// this.robotDetailInfo = JSON.parse(sessionStorage.getItem('robotDetailInfo'));
this
.
getWalletInfo
();
this
.
getTransaction
();
this
.
getRecords
();
...
...
@@ -517,7 +519,8 @@
},
//返回上一页(关闭详情)
closeDetails
()
{
Bus
.
$emit
(
'hideDetails'
)
Bus
.
$emit
(
'navClick'
);
this
.
$router
.
go
(
-
1
);
},
//查询当前机器人信息
getCurrentRobot
()
{
...
...
@@ -610,7 +613,9 @@
duration
:
'2000'
,
});
this
.
Loading
=
false
;
this
.
init
();
setTimeout
(()
=>
{
this
.
init
();
},
500
)
}
else
{
this
.
Loading
=
false
;
this
.
$notify
({
...
...
src/views/overview.vue
View file @
795c2e04
<
template
>
<div
class=
"overview"
>
<div
v-
show=
"!robotDetails
"
>
<div
v-
if=
"$route.path.split('/').pop() !== 'RobotDetail'
"
>
<div
class=
"overview-title"
>
<span>
机器人监控
</span>
</div>
...
...
@@ -130,10 +130,10 @@
</ul>
<p
v-if=
"robotList === null"
class=
"no-data"
>
暂无数据
</p>
</div>
<robot-details
v-if=
"robotDetails"
:robotDetailInfo=
"robotDetailInfo"
:robotBankList=
"robotBankList"
></robot-details>
<router-view
:robotBankList=
"robotBankList"
></router-view>
<!--
<robot-details
v-if=
"robotDetails"
:robotDetailInfo=
"robotDetailInfo"
:robotBankList=
"robotBankList"
></robot-details>
-->
</div>
</
template
>
<
script
>
import
RobotDetails
from
'./RobotDetails'
import
Bus
from
'../assets/js/bus'
...
...
@@ -144,7 +144,6 @@
return
{
platform
:
''
,
//导航选中的交易所
value1
:
true
,
//是否开启机器人
robotDetails
:
false
,
//是否查看机器人详情
robotStatus
:
''
,
//机器人状态
robotStatusList
:
[],
//状态预警信息
RobotListParams
:
{
...
...
@@ -184,7 +183,6 @@
created
()
{
this
.
init
();
Bus
.
$on
(
'navClick'
,
()
=>
{
this
.
robotDetails
=
false
;
this
.
robotStatus
=
''
;
this
.
subtitle
=
'所有机器人'
;
this
.
checkAll
=
false
;
//交易所筛选
...
...
@@ -204,9 +202,6 @@
this
.
init
();
},
0
)
});
Bus
.
$on
(
'hideDetails'
,()
=>
{
this
.
robotDetails
=
false
;
})
},
methods
:
{
init
()
{
...
...
@@ -332,8 +327,10 @@
this
.
getRobotList
(
ListParams
);
},
showDetails
(
index
)
{
this
.
robotDetails
=
true
;
this
.
robotDetailInfo
=
this
.
robotList
[
index
];
// console.log(this.$route.path);
// this.RobotDetails = true;
sessionStorage
.
setItem
(
'robotDetailInfo'
,
JSON
.
stringify
(
this
.
robotList
[
index
]));
this
.
$router
.
push
(
this
.
$route
.
path
+
'/RobotDetail'
);
// console.log(this.robotDetailInfo)
},
clickSwitch
(
val
)
{
...
...
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