-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
118 lines (102 loc) · 2.69 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html ng-app="sjs">
<head>
<title>微信群活跃用户统计</title>
<script src="https://cdn.staticfile.org/angular.js/1.6.3/angular.min.js"></script>
<script src="shim.js"></script>
<script src="xlsx.full.min.js"></script>
</head>
<style>
.container {
width: 1200px;
margin: 0 auto;
}
table {
margin: 0 auto;
border-collapse: collapse;
}
table tr {
height: 30px;
}
table tr:nth-child(odd) {
background-color: #f1f1f1;
}
table tr:nth-child(even) {
background-color: #ffffff;
}
table tr:hover {
background-color: ghostwhite;
}
h4 {
width: 1200px;
height: 25px;
text-align: center;
}
.export {
width: 1200px;
}
.qrimg{
width: 100px;
height: 100px;
margin: 0 auto;
}
#exportbtn {
float: right;
color: blue;
border: 1px solid #000;
padding: 5px;
border-radius: 10px;
cursor: pointer;
}
</style>
<body>
<div ng-controller="sheetjs" class="container">
<h4>微信群活跃用户统计</h4>
<h4 class="export">
<span id="exportbtn">导出数据</span>
</h4>
<img style="width: 100px; height: 100px;" class="qrimg" src="./QR.png" alt="">
<table id="sjs-table" border="1" c>
<tr>
<td>序号</td>
<td>群名称</td>
<td>群总人数</td>
<td>活跃人数</td>
<td>活跃度</td>
</tr>
<tr ng-repeat="x in data">
<td width="100">{{ $index + 1 }}</td>
<td width="400">{{ x.qunmingcheng }}</td>
<td width="100">{{ x.qunrenshu }}</td>
<td width="100">{{ x.huoyuwrenshu }}</td>
<td width="200">{{(x.huoyuedu).toFixed(8)}}</td>
</tr>
</table>
</div>
<script>
var app = angular.module('sjs', []);
app.controller('sheetjs', function ($scope, $http) {
$http({
method: 'GET',
url: '../data.json'
}).then(function (res) {
$scope.data = res.data
}, function (err) { console.log(err); });
});
exportbtn.addEventListener('click', function () {
var wb = XLSX.utils.table_to_book(document.getElementById('sjs-table'));
XLSX.writeFile(wb, "微信群用户活跃度.xlsx");
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36810333-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>