Skip to content

Commit

Permalink
Merge pull request #25 from peersafe/historyshow
Browse files Browse the repository at this point in the history
history show and hide
  • Loading branch information
wangxp2016 authored Aug 12, 2017
2 parents 4648c33 + 59abef4 commit c647666
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 21 deletions.
2 changes: 1 addition & 1 deletion public/css/main.min.css

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions public/js/main.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions public/src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ table a{color: #30bfa1;}
.nblock table tr{height: 40px; border-bottom: 1px solid #eee;}
#bejy{border: none; background: none;}
#sp-jy{margin-left: 205px;}
.bot{width: 80px; height: 40px; position: absolute; left: 50%; bottom: 20px;}
.bot span{position: absolute; left: 0; top: 0; cursor: pointer;}
.bot .span2{display: none;}
.thar{height: 50px;}
.bot{width: 80px; height: 40px; bottom: 20px;margin-right: 30%;float: right;}
.bot span{left: 0; top: 0; cursor: pointer;}
.mp-tit{text-align: center;font-size: 22px;}
.smid{width: 1200px; margin: 30px auto;}
.clear{zoom:1;}
Expand All @@ -119,7 +119,7 @@ table a{color: #30bfa1;}
.hdr .tab1 .td2{text-align: right;}
.hdr .tab2{width: 1140px;height: 50px; border: 1px solid #ddd; border-radius: 3px; background: #fff; margin-top: 10px; font-size: 14px; font-weight: normal; margin-bottom: 0;}
.hdr .tab2 tr td{padding:0 10px;}
.hdr b{width:200px; height: 40px; text-align: center;line-height: 40px; color: #fff; border-radius: 3px;background: #30bfa1;position: absolute; right: 30px; bottom: 20px;}
.hdr b{width:200px; height: 40px; text-align: center;line-height: 40px; color: #fff; border-radius: 3px;background: #30bfa1;float: right;}
.dc{color: #30bfa1;}
/* 黑名单 */
.bla-tit{height: 40px; margin-bottom: 30px;}
Expand All @@ -141,7 +141,7 @@ table a{color: #30bfa1;}
.tian-pop span{float: left; width: 50px; display: inline-block; text-align: right; margin-top: 8px;margin-right: 10px;}
.tian-pop textarea{width: 500px;height: 250px; resize: none; margin-top: 30px;border: 1px solid #ddd; padding-left: 10px;background: #fff;}
.tian-pop .bzh{margin-top: 27px;}
.tian-pop button{width: 150px; height: 40px; margin-left: 260px; margin-top: 30px; border: none; color: #fff;border-radius: 3px; background: #30bfa1; cursor: pointer;}
.tian-pop button{width: 150px; height: 40px; margin-left: 160px; margin-top: 30px; border: none; color: #fff;border-radius: 3px; background: #30bfa1; cursor: pointer;}
.bxg{cursor: pointer;}
.wquan{width: 1200px; margin: 0 auto;}
.wban , .wban .wtab1{width: 1000px; float: left; margin-top: 0;}
Expand Down
139 changes: 137 additions & 2 deletions public/src/js/controllers/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,153 @@
angular.module('insight.history').controller('HistoryController',
function ($scope, $rootScope, $routeParams, HistoryService) {
console.log("historys controller start");

// $scope.historys = HistoryService.list();
$scope.datashow20170811145006 = true;
$scope.list = function () {
HistoryService.get({}, function (res) {
// console.log('tp::',typeof res.data,'res', res.data)
if (res.code === 0) {
$scope.histories = res.data;
//$scope.histories = res.data;
}
});
}
$scope.list();
$scope.histories = [
{
"import_time":"20170811145006",
"user":[
{
"id":"history.blacklist.20170811-145006.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-145006"
},
{
"id":"history.blacklist.20170811-145219.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-145219"
},
{
"id":"history.blacklist.20170811-165334.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-165334"
},
{
"id":"history.blacklist.20170811-165341.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-165341"
},
{
"id":"history.blacklist.20170811-183227.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183227"
},
{
"id":"history.blacklist.20170811-183427.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183427"
}
],
"txsnum":2,
"limitpage":5
},
{
"import_time":"20170811183827",
"user":[
{
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}, {
"id":"history.blacklist.20170811-183827.muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"addr":"muv8WgxDydvKB82JZhLcyX1dsmyAmkFKhR",
"comment":"nkbjb",
"txsnum":2,
"time":"20170811-183827"
}
],
"txsnum":2,
"limitpage":5
}
]

$scope.histories.forEach(function(history,index){
$scope["datashow"+history.import_time]=true;
history.idnum=index;
})
$scope.records = [
"菜鸟教程1",
"菜鸟教程2",
"菜鸟教程3",
"菜鸟教程4",
]

$scope.params = $routeParams;
$scope.expand = function(showDiv,num,id){
$scope["datashow"+showDiv] =!$scope["datashow"+showDiv];
$scope.histories[id].limitpage=num;
}

console.log($scope);
});
18 changes: 8 additions & 10 deletions public/views/history.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<div class="history" data-ng-controller="HistoryController">
<div class="history" data-ng-controller="HistoryController" ng-init="pg='limitpage'">
<h1>黑名单地址历史交易量统计</h1>
<div class="hdr" data-ng-repeat="history in histories">
<table class="tab1">
<tr>
<tr class="thar">
<td class="td1">导入时间:{{history.import_time}}</td>
<td class="td2 dc">导出</td>
<td class="td2 daochu" data-ng-show="history.user.length>0">导出</td>
</tr>
</table>
<table class="tab1 tab2" data-ng-repeat="user in history.user">
<tr>
<tr class="tab2" data-ng-repeat="user in history.user|limitTo:history.limitpage">
<td class="td1"><a href="address/{{user.addr}}">{{user.addr}}</a></td>
<td class="">{{user.comment}}</td>
<td class="td2">{{user.txsnum}}个交易</td>
</tr>
</table>
<b>{{history.txsnum}}个交易</b>
<b data-ng-show="history.user.length>0">{{history.txsnum}}个交易</b>
<!--<div class="zs">-->
<!--<table class="tab1 tab2">-->
<!--<tr>-->
Expand All @@ -24,9 +22,9 @@ <h1>黑名单地址历史交易量统计</h1>
<!--</tr>-->
<!--</table> -->
<!--</div>-->
<div class="bot">
<span class="span1"><img src="images/zk.png" width="30" alt="" data-ng-click="expand(true, h)"></span>
<span class="span2"><img src="images/sq.png" width="30" alt="" data-ng-click="expand(false, h)"></span>
<div class="bot" data-ng-show="history.user.length>5">
<span class="span1"><img src="images/zk.png" width="30" alt="" data-ng-show="datashow{{history.import_time}}" data-ng-click="expand(history.import_time, history.user.length,history.idnum)"></span>
<span class="span2"><img src="images/sq.png" width="30" alt="" data-ng-show="!datashow{{history.import_time}}" data-ng-click="expand(history.import_time, 5,history.idnum)"></span>
</div>
</div>
</div>

0 comments on commit c647666

Please sign in to comment.