Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sh-ds
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
李良停
sh-ds
Commits
f15caf2f
Commit
f15caf2f
authored
Jul 07, 2021
by
喻春霖
Browse files
Options
Browse Files
Download
Plain Diff
fixed
parents
e0d0f172
ba0ebbc2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
948 additions
and
698 deletions
+948
-698
settings.json
.vscode/settings.json
+3
-0
AuthController.java
...eall/eden/authcenter/agent/controller/AuthController.java
+14
-7
OauthType.java
...com/chineseall/eden/authcenter/agent/oauth/OauthType.java
+30
-10
application.yml
eden-authcenter-agent/src/main/resources/application.yml
+113
-9
bootstrap.yml
eden-authcenter-agent/src/main/resources/bootstrap.yml
+107
-0
ds.html
eden-authcenter-agent/src/main/resources/templates/ds.html
+37
-28
statistics.html
...center-agent/src/main/resources/templates/statistics.html
+644
-644
No files found.
.vscode/settings.json
0 → 100644
View file @
f15caf2f
{
"liveServer.settings.port"
:
5501
}
\ No newline at end of file
eden-authcenter-agent/src/main/java/com/chineseall/eden/authcenter/agent/controller/AuthController.java
View file @
f15caf2f
...
...
@@ -120,14 +120,21 @@ public class AuthController {
authLogService
.
save
(
authLog
);
String
url1
=
generateLoginUrl
(
returnUrl
,
OauthType
.
dianjiaoguan
.
getCode
(),
authLog
.
getId
());
modelAndView
.
addObject
(
"loginUrl1"
,
url1
);
String
url2
=
generateLoginUrl
(
returnUrl
,
OauthType
.
edenoperation
.
getCode
(),
authLog
.
getId
());
modelAndView
.
addObject
(
"loginUrl2"
,
url2
);
String
url3
=
generateSpLoginUrl
(
returnUrl
,
OauthType
.
qpjy
.
getCode
(),
authLog
.
getId
());
modelAndView
.
addObject
(
"loginUrl3"
,
url3
);
modelAndView
.
addObject
(
"logId"
,
authLog
.
getId
());
String
dianjiaoguanLoinUrl
=
generateLoginUrl
(
returnUrl
,
OauthType
.
dianjiaoguan
.
getCode
(),
authLog
.
getId
());
modelAndView
.
addObject
(
"dianjiaoguanLoinUrl"
,
dianjiaoguanLoinUrl
);
String
edenoperationLoginUrl
=
generateLoginUrl
(
returnUrl
,
OauthType
.
edenoperation
.
getCode
(),
authLog
.
getId
());
modelAndView
.
addObject
(
"edenoperationLoginUrl"
,
edenoperationLoginUrl
);
OauthType
[]
oauthTypes
=
OauthType
.
values
();
for
(
OauthType
oauthType
:
oauthTypes
)
{
if
(
"idp"
.
equals
(
oauthType
.
getType
())){
String
idpAuthTypeUrl
=
generateSpLoginUrl
(
returnUrl
,
oauthType
.
getCode
(),
authLog
.
getId
());
modelAndView
.
addObject
(
oauthType
.
getCode
()+
"LoginUrl"
,
idpAuthTypeUrl
);
}
}
modelAndView
.
addObject
(
"logId"
,
authLog
.
getId
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
modelAndView
.
setViewName
(
"error"
);
...
...
eden-authcenter-agent/src/main/java/com/chineseall/eden/authcenter/agent/oauth/OauthType.java
View file @
f15caf2f
...
...
@@ -2,17 +2,30 @@ package com.chineseall.eden.authcenter.agent.oauth;
import
lombok.Getter
;
import
java.util.List
;
public
enum
OauthType
{
dianjiaoguan
(
"dianjiaoguan"
,
"电教馆账号认证"
),
idp
(
"idp"
,
"idp认证"
),
jsyd
(
"jsyd"
,
"金山教育"
),
qpjy
(
"qpjy"
,
"青浦教育"
),
hpjy
(
"hpjy"
,
"黄浦教育"
),
fxjy
(
"fxjy"
,
"奉贤教育"
),
pdjy
(
"pdjy"
,
"浦东教育"
),
ypjy
(
"ypjy"
,
"杨浦教育"
),
edenoperation
(
"edenoperation"
,
"数字教材账号认证"
);
dianjiaoguan
(
"dianjiaoguan"
,
"电教馆账号认证"
,
"oauth"
),
edenoperation
(
"edenoperation"
,
"数字教材账号认证"
,
"oauth"
),
qpjy
(
"qpjy"
,
"青浦教育"
,
"idp"
),
xhjy
(
"xhjy"
,
"徐汇教育"
,
"idp"
),
cnjy
(
"cnjy"
,
"长宁教育"
,
"idp"
),
jajy
(
"jajy"
,
"静安教育"
,
"idp"
),
ptjy
(
"ptjy"
,
"普陀教育"
,
"idp"
),
hkjy
(
"hkjy"
,
"虹口教育"
,
"idp"
),
mhjy
(
"mhjy"
,
"闵行教育"
,
"idp"
),
bsjy
(
"bsjy"
,
"宝山教育"
,
"idp"
),
jdjy
(
"jdjy"
,
"嘉定教育"
,
"idp"
),
jsjy
(
"jsjy"
,
"金山教育"
,
"idp"
),
sjjy
(
"sjjy"
,
"松江教育"
,
"idp"
),
fxjy
(
"fxjy"
,
"奉贤教育"
,
"idp"
),
cmjy
(
"cmjy"
,
"崇明教育"
,
"idp"
),
hpjy
(
"hpjy"
,
"黄浦教育"
,
"idp"
),
pdjy
(
"pdjy"
,
"浦东教育"
,
"idp"
),
ypjy
(
"ypjy"
,
"杨浦教育"
,
"idp"
);
@Getter
...
...
@@ -20,9 +33,16 @@ public enum OauthType {
@Getter
private
final
String
description
;
OauthType
(
String
code
,
String
description
)
{
@Getter
private
final
String
type
;
OauthType
(
String
code
,
String
description
,
String
type
)
{
this
.
code
=
code
;
this
.
description
=
description
;
this
.
type
=
type
;
}
public
static
OauthType
getValue
(
String
name
)
{
...
...
eden-authcenter-agent/src/main/resources/application.yml
View file @
f15caf2f
...
...
@@ -27,9 +27,9 @@ spring:
oauth
:
items
:
dianjiaoguan
:
#电教馆
# oauthUrl: https://castest.edu.sh.cn/CAS
# clientId: testClentId
# clientSecret: testClientSecret
# oauthUrl: https://castest.edu.sh.cn/CAS
# clientId: testClentId
# clientSecret: testClientSecret
oauthUrl
:
https://cas2.edu.sh.cn/CAS
clientId
:
clientid
clientSecret
:
clientSecret
...
...
@@ -49,14 +49,121 @@ oauth:
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
cmjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
fxjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
sjjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
jsjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
jdjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
bsjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
mhjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
pdjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
ypjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
hkjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
ptjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
jajy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
cnjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
xhjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
hpjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
oauthclient
:
clients
:
-
clientName
:
数字教材
clientId
:
testClentId
clientSecret
:
testClientSecret
# - clientName: 接入样例
# clientId: testClentId2
# clientSecret: testClientSecret2
# - clientName: 接入样例
# clientId: testClentId2
# clientSecret: testClientSecret2
-
clientName
:
资源评价系统
clientId
:
xhzyClientId
clientSecret
:
xhzyClientSecret
...
...
@@ -69,6 +176,3 @@ oauthclient:
-
clientName
:
自适应学习
clientId
:
adaptive-learning
clientSecret
:
adaptive-learningSecret
eden-authcenter-agent/src/main/resources/bootstrap.yml
View file @
f15caf2f
...
...
@@ -49,6 +49,113 @@ oauth:
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
cmjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
fxjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
sjjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
jsjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
jdjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
bsjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
mhjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
pdjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
ypjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
hkjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
ptjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
jajy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
cnjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
xhjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
hpjy
:
#idp
#oauthUrl: https://operator-api-test.etextbook.cn/cas
oauthUrl
:
https://sp.etextbook.cn/authcenter/auth
clientId
:
dsClentId
clientSecret
:
VjyqUkkM5Znu
loginSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/idp/loginsuccess
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
oauthclient
:
clients
:
-
clientName
:
数字教材
...
...
eden-authcenter-agent/src/main/resources/templates/ds.html
View file @
f15caf2f
...
...
@@ -9,21 +9,39 @@
<script
type=
"text/javascript"
th:src=
"@{/static/js/browser.js}"
></script>
<script
th:inline=
"javascript"
>
/*<![CDATA[*/
var
loginUrl1
=
[[
$
{
loginUrl1
}]];
var
loginUrl2
=
[[
$
{
loginUrl2
}]];
var
loginUrl3
=
[[
$
{
loginUrl3
}]];
var
dianjiaoguanLoinUrl
=
[[
$
{
dianjiaoguanLoinUrl
}]];
var
edenoperationLoginUrl
=
[[
$
{
edenoperationLoginUrl
}]];
var
logId
=
[[
$
{
logId
}]];
var
loginType
=
[[
$
{
loginType
}]];
var
ctxPath
=
/*[[@{/}]]*/
''
;
var
idpList
=
{
qpjy
:
[[
$
{
qpjyLoginUrl
}]],
hpjy
:
[[
$
{
hpjyLoginUrl
}]],
xhjy
:
[[
$
{
xhjyLoginUrl
}]],
cnjy
:
[[
$
{
cnjyLoginUrl
}]],
ptjy
:
[[
$
{
ptjyLoginUrl
}]],
hkjy
:
[[
$
{
hkjyLoginUrl
}]],
ypjy
:
[[
$
{
ypjyLoginUrl
}]],
pdjy
:
[[
$
{
pdjyLoginUrl
}]],
mhjy
:
[[
$
{
mhjyLoginUrl
}]],
bsjy
:
[[
$
{
bsjyLoginUrl
}]],
jsjy
:
[[
$
{
jsjyLoginUrl
}]],
sjjy
:
[[
$
{
sjjyLoginUrl
}]],
fxjy
:
[[
$
{
fxjyLoginUrl
}]],
cmjy
:
[[
$
{
cmjyLoginUrl
}]],
jajy
:
[[
$
{
jajyLoginUrl
}]],
jdjy
:
[[
$
{
jdjyLoginUrl
}]],
}
function
toLogin
(
idp
)
{
var
info
=
new
Browser
();
var
baseUrl
=
ctxPath
+
"auth/tologin?logId="
+
logId
+
"&oauthType="
;
if
(
idp
==
"dianjiaoguan"
)
{
window
.
location
.
href
=
baseUrl
+
"dianjiaoguan&loginUrl="
+
encodeURIComponent
(
loginUrl1
)
+
"&browser="
+
info
.
browser
+
"&device="
+
info
.
device
+
"&os="
+
info
.
os
+
"&version="
+
info
.
version
;
window
.
location
.
href
=
baseUrl
+
"dianjiaoguan&loginUrl="
+
encodeURIComponent
(
dianjiaoguanLoinUrl
)
+
"&browser="
+
info
.
browser
+
"&device="
+
info
.
device
+
"&os="
+
info
.
os
+
"&version="
+
info
.
version
;
}
else
if
(
idp
==
"edenoperation"
)
{
window
.
location
.
href
=
baseUrl
+
"edenoperation&loginUrl="
+
encodeURIComponent
(
loginUrl2
)
+
"&browser="
+
info
.
browser
+
"&device="
+
info
.
device
+
"&os="
+
info
.
os
+
"&version="
+
info
.
version
;
window
.
location
.
href
=
baseUrl
+
"edenoperation&loginUrl="
+
encodeURIComponent
(
edenoperationLoginUrl
)
+
"&browser="
+
info
.
browser
+
"&device="
+
info
.
device
+
"&os="
+
info
.
os
+
"&version="
+
info
.
version
;
}
else
{
window
.
location
.
href
=
baseUrl
+
idp
+
"&loginUrl="
+
encodeURIComponent
(
loginUrl3
+
"&auth_source="
+
idp
)
+
"&browser="
+
info
.
browser
+
"&device="
+
info
.
device
+
"&os="
+
info
.
os
+
"&version="
+
info
.
version
;
window
.
location
.
href
=
baseUrl
+
idp
+
"&loginUrl="
+
encodeURIComponent
(
idpList
[
idp
]
+
"&auth_source="
+
idp
)
+
"&browser="
+
info
.
browser
+
"&device="
+
info
.
device
+
"&os="
+
info
.
os
+
"&version="
+
info
.
version
;
}
}
if
(
loginType
&&
loginType
.
length
>
0
){
...
...
@@ -93,24 +111,24 @@
<p>
区域认证
</p>
</div>
<div
class=
"login-btn-district"
>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('hpjy')"
type=
"button"
>
黄浦区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('xhjy')"
type=
"button"
>
徐汇区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('cnjy')"
type=
"button"
>
长宁区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('hpjy')"
type=
"button"
>
黄浦区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('xhjy')"
type=
"button"
>
徐汇区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('cnjy')"
type=
"button"
>
长宁区
</button>
<button
class=
"login-btn-idp"
disabled=
"disabled"
onclick=
"toLogin('jajy')"
type=
"button"
>
静安区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('ptjy')"
type=
"button"
>
普陀区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('hkjy')"
type=
"button"
>
虹口区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('ypjy')"
type=
"button"
>
杨浦区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('pdjy')"
type=
"button"
>
浦东新区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('ptjy')"
type=
"button"
>
普陀区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('hkjy')"
type=
"button"
>
虹口区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('ypjy')"
type=
"button"
>
杨浦区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('pdjy')"
type=
"button"
>
浦东新区
</button>
</div>
<div
class=
"login-btn-district"
>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('mhjy')"
type=
"button"
>
闵行区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('bsjy')"
type=
"button"
>
宝山区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('mhjy')"
type=
"button"
>
闵行区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('bsjy')"
type=
"button"
>
宝山区
</button>
<button
class=
"login-btn-idp"
disabled=
"disabled"
onclick=
"toLogin('jdjy')"
type=
"button"
>
嘉定区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('jsjy')"
type=
"button"
>
金山区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('sjjy')"
type=
"button"
>
松江区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('jsjy')"
type=
"button"
>
金山区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('sjjy')"
type=
"button"
>
松江区
</button>
<button
class=
"login-btn-idp login-btn-idp-enable"
onclick=
"toLogin('qpjy')"
type=
"button"
>
青浦区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('fxjy')"
type=
"button"
>
奉贤区
</button>
<button
class=
"login-btn-idp
"
disabled=
"disabled
"
onclick=
"toLogin('cmjy')"
type=
"button"
>
崇明区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('fxjy')"
type=
"button"
>
奉贤区
</button>
<button
class=
"login-btn-idp
login-btn-idp-enable
"
onclick=
"toLogin('cmjy')"
type=
"button"
>
崇明区
</button>
</div>
</div>
</div>
...
...
@@ -119,14 +137,5 @@
<div
class=
"footer"
>
<p
class=
"footer-text"
>
版权所有
©
上海教育认证中心
</p>
</div>
<script
th:inline=
"javascript"
>
/*<![CDATA[*/
var
loginUrl1
=
[[
$
{
loginUrl1
}]];
var
loginUrl2
=
[[
$
{
loginUrl2
}]];
var
loginUrl3
=
[[
$
{
loginUrl3
}]];
var
logId
=
[[
$
{
logId
}]];
var
ctxPath
=
/*[[@{/}]]*/
''
;
/*]]>*/
</script>
</body>
</html>
eden-authcenter-agent/src/main/resources/templates/statistics.html
View file @
f15caf2f
...
...
@@ -36,726 +36,726 @@
</head>
<body
style=
"background-color: rgb(244, 245, 245);"
>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a
href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a
href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div
id=
"app"
class=
"static"
>
<div
class=
"statistics-header"
>
<div
class=
"flex"
style=
"display: flex; align-items: center;"
>
<img
src=
"../static/img/Rlogo.png"
style=
"margin:5px 0; margin-left: 30px; width: 250px;"
alt=
""
>
<Divider
type=
"vertical"
style=
"height: 26px;"
></Divider>
<p
style=
"font-size: 14px; font-weight: 700;"
>
发现服务 · 速享之旅
</p>
</div>
<div
class=
"flex"
>
<img
src=
"../static/img/top-title.png"
style=
"height: 22px;"
alt=
""
>
</div>
<div
class=
"flex"
style=
"display: flex;"
>
<i-select
v-model=
"app"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in appList"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
<i-select
v-model=
"time"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in timeType"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
<i-select
v-if=
"time === 'year'"
v-model=
"year"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in yearList"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
<i-select
v-if=
"time === 'month'"
v-model=
"month"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in monthList"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
</div>
</div>
<div
class=
"statistics-content"
>
<div
style=
"width: 25%; height: 100%;"
>
<div
class=
"statistics-content-item item-height"
>
<p
class=
"statistics-content-item-title"
>
应用来源
</p>
<div
id=
"app-source"
style=
"width: 95%;height: calc(100% - 40px); margin: 5px 5px;"
></div>
<!-- Add your site or application content here -->
<div
id=
"app"
class=
"static"
>
<div
class=
"statistics-header"
>
<div
class=
"flex"
style=
"display: flex; align-items: center;"
>
<img
src=
"../static/img/Rlogo.png"
style=
"margin:5px 0; margin-left: 30px; width: 250px;"
alt=
""
>
<Divider
type=
"vertical"
style=
"height: 26px;"
></Divider>
<p
style=
"font-size: 14px; font-weight: 700;"
>
发现服务 · 速享之旅
</p>
</div>
<div
class=
"statistics-content-item item-height-higher"
>
<p
class=
"statistics-content-item-title"
>
来源环境分析
</p>
<div
id=
"app-env-browser"
style=
"width: 95%;height: calc(50% - 30px); margin: 5px 5px;"
></div>
<div
id=
"app-env-system"
style=
"width: 95%;height: calc(50% - 30px); margin: 5px 5px;"
></div>
<div
class=
"flex"
>
<img
src=
"../static/img/top-title.png"
style=
"height: 22px;"
alt=
""
>
</div>
<div
class=
"flex"
style=
"display: flex;"
>
<i-select
v-model=
"app"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in appList"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
<i-select
v-model=
"time"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in timeType"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
<i-select
v-if=
"time === 'year'"
v-model=
"year"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in yearList"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
<i-select
v-if=
"time === 'month'"
v-model=
"month"
@
on-change=
"refresh"
style=
"width: 120px; margin: 0 5px;"
>
<i-option
v-for=
"item in monthList"
:value=
"item.code"
:label=
"item.name"
></i-option>
</i-select>
</div>
</div>
<div
style=
"width: 50%; height: 100%;"
>
<div
class=
"statistics-content-item"
style=
"height: 30%;"
>
<p
class=
"statistics-content-item-title"
>
认证数据统计
<span
class=
"statistics-content-item-title-remark"
>
累计登录用户总数:
<div
class=
"statistics-content"
>
<div
style=
"width: 25%; height: 100%;"
>
<div
class=
"statistics-content-item item-height"
>
<p
class=
"statistics-content-item-title"
>
应用来源
</p>
<div
id=
"app-source"
style=
"width: 95%;height: calc(100% - 40px); margin: 5px 5px;"
></div>
</div>
<div
class=
"statistics-content-item item-height-higher"
>
<p
class=
"statistics-content-item-title"
>
来源环境分析
</p>
<div
id=
"app-env-browser"
style=
"width: 95%;height: calc(50% - 30px); margin: 5px 5px;"
></div>
<div
id=
"app-env-system"
style=
"width: 95%;height: calc(50% - 30px); margin: 5px 5px;"
></div>
</div>
</div>
<div
style=
"width: 50%; height: 100%;"
>
<div
class=
"statistics-content-item"
style=
"height: 30%;"
>
<p
class=
"statistics-content-item-title"
>
认证数据统计
<span
class=
"statistics-content-item-title-remark"
>
累计登录用户总数:
<span
v-text=
"numsOfPeople"
></span>
人
</span>
</p>
<div
style=
"display: flex; height: 100%;"
>
<div
class=
"nums-by-idp"
style=
"height: calc(100% - 40px);"
>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-1.png);"
>
<p
class=
"nums-title"
>
总人次
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"nums"
></span>
人次
</p>
</p>
<div
style=
"display: flex; height: 100%;"
>
<div
class=
"nums-by-idp"
style=
"height: calc(100% - 40px);"
>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-1.png);"
>
<p
class=
"nums-title"
>
总人次
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"nums"
></span>
人次
</p>
</div>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-2.png);"
>
<p
class=
"nums-title"
>
基础教育统一认证
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"numsJcjy"
></span>
人次
</p>
</div>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-3.png);"
>
<p
class=
"nums-title"
>
青浦区认证子域
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"numsQp"
></span>
人次
</p>
</div>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-4.png);"
>
<p
class=
"nums-title"
>
数字教材实验用户
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"numsSy"
></span>
人次
</p>
</div>
<!-- <div style="margin-top: 10px; line-height: 1.5;">
<p v-for="item in numsIdpList">通过<span v-text="item.name"></span>子域认证:<span class="idp-total-nums"
v-text="item.value"></span>
</p>
</div> -->
</div>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-2.png);"
>
<p
class=
"nums-title"
>
基础教育统一认证
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"numsJcjy"
></span>
人次
</p>
</div>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-3.png);"
>
<p
class=
"nums-title"
>
青浦区认证子域
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"numsQp"
></span>
人次
</p>
</div>
<div
class=
"nums-total"
style=
"background: url(../static/img/center-bg-4.png);"
>
<p
class=
"nums-title"
>
数字教材实验用户
</p>
<p
class=
"nums-title-num"
><span
class=
"nums-total-nums"
v-text=
"numsSy"
></span>
人次
</p>
</div>
<!-- <div style="margin-top: 10px; line-height: 1.5;">
<p v-for="item in numsIdpList">通过<span v-text="item.name"></span>子域认证:<span class="idp-total-nums"
v-text="item.value"></span>
</p>
</div> -->
<!-- <div id="idp" style="width: 48%; height: calc(100% - 40px); margin: 5px 5px;"></div> -->
</div>
<!-- <div id="idp" style="width: 48%; height: calc(100% - 40px); margin: 5px 5px;"></div> -->
</div>
<div
class=
"statistics-content-item"
style=
"height: 70%;"
>
<p
class=
"statistics-content-item-title"
>
认证登陆高峰时间
</p>
<div
id=
"nums-by-time"
style=
"width: 100%; height: calc(100% - 40px); margin: 0;"
></div>
</div>
</div>
<div
class=
"statistics-content-item"
style=
"height: 70%;"
>
<p
class=
"statistics-content-item-title"
>
认证登陆高峰时间
</p>
<div
id=
"nums-by-time"
style=
"width: 100%; height: calc(100% - 40px); margin: 0;"
></div>
</div>
</div>
<div
style=
"width: 25%; height: 100%;"
>
<div
class=
"statistics-content-item item-height"
>
<p
class=
"statistics-content-item-title"
>
身份认证
</p>
<div
id=
"user-type"
style=
"width: 95%;height: calc(100% - 40px); margin: 5px 5px;"
></div>
</div>
<div
class=
"statistics-content-item item-height-higher"
>
<p
class=
"statistics-content-item-title"
>
认证热点单位
</p>
<div
id=
"user-org"
style=
"height: calc(100% - 40px); margin-top: 8px;"
>
<p
style=
"padding: 5px 20px 0 20px; color: #5f646a; font-size: 12px; line-height: 1.8;"
v-for=
"item in userOrgList"
><span
style=
"color: orange; font-weight: 900; padding-right: 8px;"
>
·
</span><span
v-text=
"item.name"
></span><span
style=
"float: right;"
v-text=
"item.count + ' 人次'"
></span></p>
<div
style=
"width: 25%; height: 100%;"
>
<div
class=
"statistics-content-item item-height"
>
<p
class=
"statistics-content-item-title"
>
身份认证
</p>
<div
id=
"user-type"
style=
"width: 95%;height: calc(100% - 40px); margin: 5px 5px;"
></div>
</div>
<div
class=
"statistics-content-item item-height-higher"
>
<p
class=
"statistics-content-item-title"
>
认证热点单位
</p>
<div
id=
"user-org"
style=
"height: calc(100% - 40px); margin-top: 8px;"
>
<p
style=
"padding: 5px 20px 0 20px; color: #5f646a; font-size: 12px; line-height: 1.8;"
v-for=
"item in userOrgList"
><span
style=
"color: orange; font-weight: 900; padding-right: 8px;"
>
·
</span><span
v-text=
"item.name"
></span><span
style=
"float: right;"
v-text=
"item.count + ' 人次'"
></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- iview使用了includes方法,兼容ie11 -->
<script>
if
(
!
Array
.
prototype
.
includes
)
{
Object
.
defineProperty
(
Array
.
prototype
,
'includes'
,
{
value
:
function
(
valueToFind
,
fromIndex
)
{
<!-- iview使用了includes方法,兼容ie11 -->
<script>
if
(
!
Array
.
prototype
.
includes
)
{
Object
.
defineProperty
(
Array
.
prototype
,
'includes'
,
{
value
:
function
(
valueToFind
,
fromIndex
)
{
if
(
this
==
null
)
{
throw
new
TypeError
(
'"this" is null or not defined'
);
}
// 1. Let O be ? ToObject(this value).
var
o
=
Object
(
this
);
if
(
this
==
null
)
{
throw
new
TypeError
(
'"this" is null or not defined'
);
}
// 2. Let len be ? ToLength(? Get(O, "length")
).
var
len
=
o
.
length
>>>
0
;
// 1. Let O be ? ToObject(this value
).
var
o
=
Object
(
this
)
;
// 3. If len is 0, return false.
if
(
len
===
0
)
{
return
false
;
}
// 2. Let len be ? ToLength(? Get(O, "length")).
var
len
=
o
.
length
>>>
0
;
// 4. Let n be ? ToInteger(fromIndex).
// (If fromIndex is undefined, this step produces the value 0.)
var
n
=
fromIndex
|
0
;
// 3. If len is 0, return false.
if
(
len
===
0
)
{
return
false
;
}
// 5. If n ≥ 0, then
// a. Let k be n.
// 6. Else n
<
0
,
// a. Let k be len + n.
// b. If k
<
0
,
let
k
be
0
.
var
k
=
Math
.
max
(
n
>=
0
?
n
:
len
-
Math
.
abs
(
n
),
0
);
// 4. Let n be ? ToInteger(fromIndex).
// (If fromIndex is undefined, this step produces the value 0.)
var
n
=
fromIndex
|
0
;
function
sameValueZero
(
x
,
y
)
{
return
x
===
y
||
(
typeof
x
===
'number'
&&
typeof
y
===
'number'
&&
isNaN
(
x
)
&&
isNaN
(
y
));
}
// 5. If n ≥ 0, then
// a. Let k be n.
// 6. Else n
<
0
,
// a. Let k be len + n.
// b. If k
<
0
,
let
k
be
0
.
var
k
=
Math
.
max
(
n
>=
0
?
n
:
len
-
Math
.
abs
(
n
),
0
);
// 7. Repeat, while k
<
len
while
(
k
<
len
)
{
// a. Let elementK be the result of ? Get(O, ! ToString(k)).
// b. If SameValueZero(valueToFind, elementK) is true, return true.
if
(
sameValueZero
(
o
[
k
],
valueToFind
))
{
return
true
;
function
sameValueZero
(
x
,
y
)
{
return
x
===
y
||
(
typeof
x
===
'number'
&&
typeof
y
===
'number'
&&
isNaN
(
x
)
&&
isNaN
(
y
));
}
// c. Increase k by 1.
k
++
;
}
// 8. Return false
return
false
;
}
});
}
</script>
<script
type=
"text/javascript"
>
var
baseUrl
=
"/"
;
// 7. Repeat, while k
<
len
while
(
k
<
len
)
{
// a. Let elementK be the result of ? Get(O, ! ToString(k)).
// b. If SameValueZero(valueToFind, elementK) is true, return true.
if
(
sameValueZero
(
o
[
k
],
valueToFind
))
{
return
true
;
}
// c. Increase k by 1.
k
++
;
}
var
colorList
=
[
'#6c5df1'
,
'#a78bf4'
,
'#fdbf3c'
,
'#ec6367'
,
'#2fcaa8'
,
'#79c161'
]
new
Vue
({
el
:
'#app'
,
data
:
{
year
:
'all'
,
yearList
:
[],
month
:
1
,
monthList
:
[],
time
:
'year'
,
timeType
:
[
{
code
:
'year'
,
name
:
'按年统计'
},
{
code
:
'month'
,
name
:
'按月统计'
},
],
app
:
'all'
,
appList
:
[],
numsIdpList
:
[],
userOrgList
:
[],
nums
:
0
,
numsJcjy
:
0
,
numsQp
:
0
,
numsSy
:
0
,
numsOfPeople
:
0
},
mounted
:
function
()
{
this
.
init
();
this
.
refresh
();
var
_this
=
this
;
window
.
onresize
=
function
()
{
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'app-source'
));
var
myChartBrowser
=
echarts
.
init
(
document
.
getElementById
(
'app-env-browser'
));
var
myChartSystem
=
echarts
.
init
(
document
.
getElementById
(
'app-env-system'
));
// var myChartNums = echarts.init(document.getElementById("idp"));
var
myChartNumsByTime
=
echarts
.
init
(
document
.
getElementById
(
"nums-by-time"
));
var
myChartUserType
=
echarts
.
init
(
document
.
getElementById
(
'user-type'
));
myChart
.
resize
();
myChartBrowser
.
resize
();
myChartSystem
.
resize
();
// myChartNums.resize();
myChartNumsByTime
.
resize
();
myChartUserType
.
resize
();
}
},
methods
:
{
init
:
function
()
{
this
.
appList
=
[{
code
:
'all'
,
name
:
'全部'
}]
// 8. Return false
return
false
;
}
});
}
</script>
var
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
var
month
=
date
.
getMonth
()
+
1
;
<script
type=
"text/javascript"
>
var
baseUrl
=
"/"
;
this
.
yearList
=
[{
code
:
'all'
,
name
:
'全部'
},]
for
(
var
i
=
2020
;
i
<=
year
;
i
++
)
{
this
.
yearList
.
push
({
code
:
i
,
name
:
i
+
"年"
})
}
for
(
var
i
=
1
;
i
<=
month
;
i
++
)
{
this
.
monthList
.
push
({
code
:
i
,
name
:
year
+
'年'
+
i
+
"月"
})
var
colorList
=
[
'#6c5df1'
,
'#a78bf4'
,
'#fdbf3c'
,
'#ec6367'
,
'#2fcaa8'
,
'#79c161'
]
new
Vue
({
el
:
'#app'
,
data
:
{
year
:
'all'
,
yearList
:
[],
month
:
1
,
monthList
:
[],
time
:
'year'
,
timeType
:
[
{
code
:
'year'
,
name
:
'按年统计'
},
{
code
:
'month'
,
name
:
'按月统计'
},
],
app
:
'all'
,
appList
:
[],
numsIdpList
:
[],
userOrgList
:
[],
nums
:
0
,
numsJcjy
:
0
,
numsQp
:
0
,
numsSy
:
0
,
numsOfPeople
:
0
},
mounted
:
function
()
{
this
.
init
();
this
.
refresh
();
var
_this
=
this
;
window
.
onresize
=
function
()
{
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'app-source'
));
var
myChartBrowser
=
echarts
.
init
(
document
.
getElementById
(
'app-env-browser'
));
var
myChartSystem
=
echarts
.
init
(
document
.
getElementById
(
'app-env-system'
));
// var myChartNums = echarts.init(document.getElementById("idp"));
var
myChartNumsByTime
=
echarts
.
init
(
document
.
getElementById
(
"nums-by-time"
));
var
myChartUserType
=
echarts
.
init
(
document
.
getElementById
(
'user-type'
));
myChart
.
resize
();
myChartBrowser
.
resize
();
myChartSystem
.
resize
();
// myChartNums.resize();
myChartNumsByTime
.
resize
();
myChartUserType
.
resize
();
}
},
methods
:
{
init
:
function
()
{
this
.
appList
=
[{
code
:
'all'
,
name
:
'全部'
}]
var
_this
=
this
;
$
.
ajax
({
type
:
'GET'
,
url
:
baseUrl
+
'authcenter/logstatistics/auth_apps'
,
success
:
function
(
result
)
{
_this
.
appList
=
_this
.
appList
.
concat
(
result
.
data
)
},
error
:
function
(
e
)
{
console
.
log
(
e
)
var
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
var
month
=
date
.
getMonth
()
+
1
;
this
.
yearList
=
[{
code
:
'all'
,
name
:
'全部'
},]
for
(
var
i
=
2020
;
i
<=
year
;
i
++
)
{
this
.
yearList
.
push
({
code
:
i
,
name
:
i
+
"年"
})
}
})
},
refresh
:
function
()
{
this
.
initSource
();
this
.
initAppEnv
();
this
.
initNums
();
this
.
initNumsByTime
();
this
.
initUserType
();
this
.
initUserOrg
();
},
initSource
:
function
()
{
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'app-source'
));
var
option
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)"
,
position
:
[
20
,
20
],
},
legend
:
{
icon
:
"circle"
,
bottom
:
0
,
data
:
[
"数字教材"
,
"阅览室"
,
"其他"
]
},
series
:
[
{
name
:
"应用来源"
,
type
:
"pie"
,
radius
:
[
"40%"
,
"60%"
],
center
:
[
"50%"
,
"48%"
],
label
:
{
position
:
'outside'
,
formatter
:
"{per|{d}%}"
,
rich
:
{
per
:
{
color
:
"black"
for
(
var
i
=
1
;
i
<=
month
;
i
++
)
{
this
.
monthList
.
push
({
code
:
i
,
name
:
year
+
'年'
+
i
+
"月"
})
}
var
_this
=
this
;
$
.
ajax
({
type
:
'GET'
,
url
:
baseUrl
+
'authcenter/logstatistics/auth_apps'
,
success
:
function
(
result
)
{
_this
.
appList
=
_this
.
appList
.
concat
(
result
.
data
)
},
error
:
function
(
e
)
{
console
.
log
(
e
)
}
})
},
refresh
:
function
()
{
this
.
initSource
();
this
.
initAppEnv
();
this
.
initNums
();
this
.
initNumsByTime
();
this
.
initUserType
();
this
.
initUserOrg
();
},
initSource
:
function
()
{
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'app-source'
));
var
option
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)"
,
position
:
[
20
,
20
],
},
legend
:
{
icon
:
"circle"
,
bottom
:
0
,
data
:
[
"数字教材"
,
"阅览室"
,
"其他"
]
},
series
:
[
{
name
:
"应用来源"
,
type
:
"pie"
,
radius
:
[
"40%"
,
"60%"
],
center
:
[
"50%"
,
"48%"
],
label
:
{
position
:
'outside'
,
formatter
:
"{per|{d}%}"
,
rich
:
{
per
:
{
color
:
"black"
}
}
}
}
,
data
:
[],
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
}
,
data
:
[]
,
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
}
}
}
}
}
]
};
]
};
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/app?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
// _this.appList = _this.appList.concat(result.data.data)
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/app?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
// _this.appList = _this.appList.concat(result.data.data)
var
legend
=
[];
var
data
=
[];
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
var
element
=
result
.
data
[
i
];
legend
.
push
(
element
.
name
);
data
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
var
legend
=
[];
var
data
=
[];
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
var
element
=
result
.
data
[
i
];
legend
.
push
(
element
.
name
);
data
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
option
.
legend
.
data
=
legend
;
option
.
series
[
0
].
data
=
data
;
myChart
.
setOption
(
option
);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
}
option
.
legend
.
data
=
legend
;
option
.
series
[
0
].
data
=
data
;
myChart
.
setOption
(
option
);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
})
},
initAppEnv
:
function
()
{
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
})
},
initAppEnv
:
function
()
{
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/environment?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
var
legendSystem
=
[],
dataSystem
=
[],
legendBroswer
=
[],
dataBrowser
=
[];
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/environment?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
var
legendSystem
=
[],
dataSystem
=
[],
legendBroswer
=
[],
dataBrowser
=
[];
if
(
result
.
data
.
os
.
length
)
{
result
.
data
.
os
.
sort
(
function
(
a
,
b
)
{
return
b
.
count
-
a
.
count
})
}
var
others
=
{
name
:
'其他'
,
value
:
0
};
var
t
=
0
;
for
(
var
i
=
0
;
i
<
result
.
data
.
os
.
length
;
i
++
)
{
var
element
=
result
.
data
.
os
[
i
];
if
(
element
.
name
===
'unknown'
)
element
.
name
=
'未知'
if
(
element
.
name
===
'others'
||
t
>=
4
)
{
others
.
value
+=
element
.
count
;
continue
;
if
(
result
.
data
.
os
.
length
)
{
result
.
data
.
os
.
sort
(
function
(
a
,
b
)
{
return
b
.
count
-
a
.
count
})
}
var
others
=
{
name
:
'其他'
,
value
:
0
};
var
t
=
0
;
for
(
var
i
=
0
;
i
<
result
.
data
.
os
.
length
;
i
++
)
{
var
element
=
result
.
data
.
os
[
i
];
if
(
element
.
name
===
'unknown'
)
element
.
name
=
'未知'
if
(
element
.
name
===
'others'
||
t
>=
4
)
{
others
.
value
+=
element
.
count
;
continue
;
}
t
++
;
legendSystem
.
push
(
element
.
name
);
dataSystem
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
if
(
others
.
value
)
{
legendSystem
.
push
(
'其他'
);
dataSystem
.
push
(
others
)
}
t
++
;
legendSystem
.
push
(
element
.
name
);
dataSystem
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
if
(
others
.
value
)
{
legendSystem
.
push
(
'其他'
);
dataSystem
.
push
(
others
)
}
if
(
result
.
data
.
browser
.
length
)
{
result
.
data
.
browser
.
sort
(
function
(
a
,
b
)
{
return
b
.
count
-
a
.
count
})
}
others
=
{
name
:
'其他'
,
value
:
0
};
t
=
0
;
for
(
var
i
=
0
;
i
<
result
.
data
.
browser
.
length
;
i
++
)
{
var
element
=
result
.
data
.
browser
[
i
];
if
(
element
.
name
===
'unknown'
)
element
.
name
=
'未知'
if
(
element
.
name
===
'others'
||
t
>=
4
)
{
others
.
value
+=
element
.
count
;
continue
;
if
(
result
.
data
.
browser
.
length
)
{
result
.
data
.
browser
.
sort
(
function
(
a
,
b
)
{
return
b
.
count
-
a
.
count
})
}
others
=
{
name
:
'其他'
,
value
:
0
};
t
=
0
;
for
(
var
i
=
0
;
i
<
result
.
data
.
browser
.
length
;
i
++
)
{
var
element
=
result
.
data
.
browser
[
i
];
if
(
element
.
name
===
'unknown'
)
element
.
name
=
'未知'
if
(
element
.
name
===
'others'
||
t
>=
4
)
{
others
.
value
+=
element
.
count
;
continue
;
}
t
++
;
legendBroswer
.
push
(
element
.
name
);
dataBrowser
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
if
(
others
.
value
)
{
legendBroswer
.
push
(
'其他'
);
dataBrowser
.
push
(
others
)
}
t
++
;
legendBroswer
.
push
(
element
.
name
);
dataBrowser
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
if
(
others
.
value
)
{
legendBroswer
.
push
(
'其他'
);
dataBrowser
.
push
(
others
)
}
var
myChartBrowser
=
echarts
.
init
(
document
.
getElementById
(
'app-env-browser'
));
var
optionBrowser
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)"
,
position
:
[
20
,
20
],
},
legend
:
{
icon
:
"circle"
,
orient
:
'vertical'
,
right
:
'right'
,
top
:
'middle'
,
data
:
legendBroswer
,
formatter
:
function
(
name
)
{
var
target
;
for
(
var
i
=
0
,
l
=
dataBrowser
.
length
;
i
<
l
;
i
++
)
{
if
(
dataBrowser
[
i
].
name
==
name
)
{
target
=
dataBrowser
[
i
].
value
;
var
myChartBrowser
=
echarts
.
init
(
document
.
getElementById
(
'app-env-browser'
));
var
optionBrowser
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)"
,
position
:
[
20
,
20
],
},
legend
:
{
icon
:
"circle"
,
orient
:
'vertical'
,
right
:
'right'
,
top
:
'middle'
,
data
:
legendBroswer
,
formatter
:
function
(
name
)
{
var
target
;
for
(
var
i
=
0
,
l
=
dataBrowser
.
length
;
i
<
l
;
i
++
)
{
if
(
dataBrowser
[
i
].
name
==
name
)
{
target
=
dataBrowser
[
i
].
value
;
}
}
return
name
+
' '
+
target
;
}
return
name
+
' '
+
target
;
}
},
series
:
[
{
name
:
"浏览器类型"
,
type
:
"pie"
,
radius
:
[
"30%"
,
"70%"
],
center
:
[
'30%'
,
'50%'
],
labelLine
:
{
show
:
false
},
label
:
{
show
:
false
},
data
:
dataBrowser
,
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
},
series
:
[
{
name
:
"浏览器类型"
,
type
:
"pie"
,
radius
:
[
"30%"
,
"70%"
],
center
:
[
'30%'
,
'50%'
],
labelLine
:
{
show
:
false
},
label
:
{
show
:
false
},
data
:
dataBrowser
,
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
}
}
}
}
}
]
}
;
myChartBrowser
.
setOption
(
optionBrowser
);
var
myChartSystem
=
echarts
.
init
(
document
.
getElementById
(
'app-env-system'
));
var
optionSystem
=
{
tooltip
:
{
trigger
:
"item
"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)"
,
position
:
[
20
,
20
]
,
},
legend
:
{
icon
:
"circle"
,
orient
:
'vertical
'
,
right
:
'right
'
,
top
:
'middle'
,
data
:
legendSystem
,
formatter
:
function
(
name
)
{
var
target
;
for
(
var
i
=
0
,
l
=
dataSystem
.
length
;
i
<
l
;
i
++
)
{
if
(
dataSystem
[
i
].
name
==
name
)
{
target
=
dataSystem
[
i
].
value
;
]
};
myChartBrowser
.
setOption
(
optionBrowser
)
;
var
myChartSystem
=
echarts
.
init
(
document
.
getElementById
(
'app-env-system'
));
var
optionSystem
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)
"
,
position
:
[
20
,
20
]
,
}
,
legend
:
{
icon
:
"circle"
,
orient
:
'vertical'
,
right
:
'right
'
,
top
:
'middle
'
,
data
:
legendSystem
,
formatter
:
function
(
name
)
{
var
target
;
for
(
var
i
=
0
,
l
=
dataSystem
.
length
;
i
<
l
;
i
++
)
{
if
(
dataSystem
[
i
].
name
==
name
)
{
target
=
dataSystem
[
i
].
value
;
}
}
return
name
+
' '
+
target
;
}
return
name
+
' '
+
target
;
}
},
series
:
[
{
name
:
"操作系统类型"
,
type
:
"pie"
,
radius
:
[
"30%"
,
"70%"
],
center
:
[
'30%'
,
'50%'
],
labelLine
:
{
show
:
false
},
label
:
{
show
:
false
},
data
:
dataSystem
,
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
},
series
:
[
{
name
:
"操作系统类型"
,
type
:
"pie"
,
radius
:
[
"30%"
,
"70%"
],
center
:
[
'30%'
,
'50%'
],
labelLine
:
{
show
:
false
},
label
:
{
show
:
false
},
data
:
dataSystem
,
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
}
}
}
}
}
]
};
myChartSystem
.
setOption
(
optionSystem
);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
}
})
},
initNums
:
function
()
{
var
_this
=
this
;
// $.getJSON('./static/js/SHdata.json', function (SHjson) {
// var myChartNums = echarts.init(document.getElementById("idp"));
// // 第二个参数为导入地图文件
// echarts.registerMap('shanghai', SHjson);
// var optionNums = {
// tooltip: {
// trigger: 'item',
// formatter: "{b}: {c}"
// },
// visualMap: {
// show: false,
// min: 0,
// max: 418,
// text: ['高', '低'],
// realtime: false,
// calculable: true,
// inRange: {
// color: ['lightskyblue', 'yellow', 'orangered']
// }
// },
// series: [
// {
// type: 'map',
// mapType: 'shanghai',
// data: [],
// }
// ]
// };
]
};
myChartSystem
.
setOption
(
optionSystem
);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
}
})
},
initNums
:
function
()
{
var
_this
=
this
;
// $.getJSON('./static/js/SHdata.json', function (SHjson) {
// var myChartNums = echarts.init(document.getElementById("idp"));
// // 第二个参数为导入地图文件
// echarts.registerMap('shanghai', SHjson);
var
params
=
{
clientId
:
_this
.
app
,
year
:
_this
.
year
,
month
:
_this
.
month
}
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
_this
.
nums
=
result
.
data
.
all_auth
;
_this
.
numsJcjy
=
result
.
data
.
cas_edu_auth
;
_this
.
numsQp
=
result
.
data
.
qp_auth
;
_this
.
numsSy
=
result
.
data
.
operator_auth
;
_this
.
numsOfPeople
=
result
.
data
.
num_of_people
;
// var optionNums = {
// tooltip: {
// trigger: 'item',
// formatter: "{b}: {c}"
// },
// visualMap: {
// show: false,
// min: 0,
// max: 418,
// text: ['高', '低'],
// realtime: false,
// calculable: true,
// inRange: {
// color: ['lightskyblue', 'yellow', 'orangered']
// }
// },
// series: [
// {
// type: 'map',
// mapType: 'shanghai',
// data: [],
// }
// ]
// };
// _this.numsIdpList = result.data.area_auth;
// var legend = [], data = [];
// for (var i = 0; i
<
result
.
data
.
area_auth
.
length
;
i
++
)
{
// var element = result.data.area_auth[i];
// legend.push(element.name);
// data.push({ value: element.count, name: element.name })
// }
// _this.numsIdpList = data.filter(function (element) { return element.value > 0 });
// optionNums.series[0].data = data
// myChartNums.setOption(optionNums);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
var
params
=
{
clientId
:
_this
.
app
,
year
:
_this
.
year
,
month
:
_this
.
month
}
})
// })
},
initNumsByTime
:
function
()
{
var
optionNumsByTime
=
{
grid
:
{
top
:
'20px'
,
left
:
'40px'
,
right
:
'40px'
,
bottom
:
'20px'
,
containLabel
:
true
},
tooltip
:
{
trigger
:
'axis'
,
axisPointer
:
{
type
:
'cross'
,
label
:
{
backgroundColor
:
'#6a7985'
}
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
_this
.
nums
=
result
.
data
.
all_auth
;
_this
.
numsJcjy
=
result
.
data
.
cas_edu_auth
;
_this
.
numsQp
=
result
.
data
.
qp_auth
;
_this
.
numsSy
=
result
.
data
.
operator_auth
;
_this
.
numsOfPeople
=
result
.
data
.
num_of_people
;
// _this.numsIdpList = result.data.area_auth;
// var legend = [], data = [];
// for (var i = 0; i
<
result
.
data
.
area_auth
.
length
;
i
++
)
{
// var element = result.data.area_auth[i];
// legend.push(element.name);
// data.push({ value: element.count, name: element.name })
// }
// _this.numsIdpList = data.filter(function (element) { return element.value > 0 });
// optionNums.series[0].data = data
// myChartNums.setOption(optionNums);
},
formatter
:
"{b}: {c}人次 "
},
xAxis
:
{
type
:
'category'
,
boundaryGap
:
false
,
axisLine
:
{
// show: false,//不显示坐标轴线
lineStyle
:
{
color
:
'lightgray'
}
error
:
function
(
e
)
{
console
.
log
(
e
)
}
})
// })
},
initNumsByTime
:
function
()
{
var
optionNumsByTime
=
{
grid
:
{
top
:
'20px'
,
left
:
'40px'
,
right
:
'40px'
,
bottom
:
'20px'
,
containLabel
:
true
},
axisLabel
:
{
color
:
"black"
//Y轴刻度字颜色
tooltip
:
{
trigger
:
'axis'
,
axisPointer
:
{
type
:
'cross'
,
label
:
{
backgroundColor
:
'#6a7985'
}
},
formatter
:
"{b}: {c}人次 "
},
splitLine
:
{
show
:
true
xAxis
:
{
type
:
'category'
,
boundaryGap
:
false
,
axisLine
:
{
// show: false,//不显示坐标轴线
lineStyle
:
{
color
:
'lightgray'
}
},
axisLabel
:
{
color
:
"black"
//Y轴刻度字颜色
},
splitLine
:
{
show
:
true
},
data
:
[]
},
data
:
[]
},
yAxis
:
{
type
:
'value'
,
axisLine
:
{
// show: false,//不显示坐标轴线
yAxis
:
{
type
:
'value'
,
axisLine
:
{
// show: false,//不显示坐标轴线
lineStyle
:
{
color
:
'lightgray'
}
},
axisLabel
:
{
show
:
false
,
//不显示坐标轴上的文字
},
},
series
:
[{
data
:
[],
type
:
'line'
,
smooth
:
true
,
lineStyle
:
{
color
:
'lightgray'
color
:
"#4583f4"
},
areaStyle
:
{
color
:
'#4583f4'
}
}]
};
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth_pick_times?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
var
legend
=
[],
data
=
[];
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
var
element
=
result
.
data
[
i
];
legend
.
push
(
element
.
name
);
data
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
optionNumsByTime
.
xAxis
.
data
=
legend
;
optionNumsByTime
.
series
[
0
].
data
=
data
;
var
myChartNumsByTime
=
echarts
.
init
(
document
.
getElementById
(
"nums-by-time"
));
myChartNumsByTime
.
setOption
(
optionNumsByTime
);
},
axisLabel
:
{
show
:
false
,
//不显示坐标轴上的文字
error
:
function
(
e
)
{
console
.
log
(
e
)
}
})
},
initUserType
:
function
()
{
var
optionUserType
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)"
,
position
:
[
20
,
20
],
},
},
series
:
[{
data
:
[],
type
:
'line'
,
smooth
:
true
,
lineStyle
:
{
color
:
"#4583f4"
legend
:
{
icon
:
"circle"
,
bottom
:
0
,
data
:
[]
},
areaStyle
:
{
color
:
'#4583f4'
}
}]
};
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth_pick_times?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
var
legend
=
[],
data
=
[];
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
var
element
=
result
.
data
[
i
];
legend
.
push
(
element
.
name
);
data
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
optionNumsByTime
.
xAxis
.
data
=
legend
;
optionNumsByTime
.
series
[
0
].
data
=
data
;
var
myChartNumsByTime
=
echarts
.
init
(
document
.
getElementById
(
"nums-by-time"
));
myChartNumsByTime
.
setOption
(
optionNumsByTime
);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
}
})
},
initUserType
:
function
()
{
var
optionUserType
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c}人次 ({d}%)"
,
position
:
[
20
,
20
],
},
legend
:
{
icon
:
"circle"
,
bottom
:
0
,
data
:
[]
},
series
:
[
{
name
:
"访客身份"
,
type
:
"pie"
,
radius
:
[
"30%"
,
"50%"
],
center
:
[
"50%"
,
"48%"
],
label
:
{
position
:
'outside'
,
formatter
:
"{per|{d}%}"
,
rich
:
{
per
:
{
color
:
"black"
series
:
[
{
name
:
"访客身份"
,
type
:
"pie"
,
radius
:
[
"30%"
,
"50%"
],
center
:
[
"50%"
,
"48%"
],
label
:
{
position
:
'outside'
,
formatter
:
"{per|{d}%}"
,
rich
:
{
per
:
{
color
:
"black"
}
}
}
}
,
data
:
[],
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
}
,
data
:
[]
,
itemStyle
:
{
normal
:
{
color
:
function
(
params
)
{
// build a color map as your need.
return
colorList
[
params
.
dataIndex
]
}
}
}
}
]
};
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth_user_type?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
var
legend
=
[],
data
=
[];
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
var
element
=
result
.
data
[
i
];
legend
.
push
(
element
.
name
);
data
.
push
({
value
:
element
.
count
,
name
:
element
.
name
})
}
optionUserType
.
legend
.
data
=
legend
;
optionUserType
.
series
[
0
].
data
=
data
;
var
myChartUserType
=
echarts
.
init
(
document
.
getElementById
(
'user-type'
));
myChartUserType
.
setOption
(
optionUserType
);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
}
]
}
;
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth_user_type?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
var
legend
=
[],
data
=
[];
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
var
element
=
result
.
data
[
i
];
legend
.
push
(
element
.
name
);
data
.
push
({
value
:
element
.
count
,
name
:
element
.
name
}
)
})
}
,
initUserOrg
:
function
()
{
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth_hot_org?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
_this
.
userOrgList
=
result
.
data
},
error
:
function
(
e
)
{
console
.
log
(
e
)
}
optionUserType
.
legend
.
data
=
legend
;
optionUserType
.
series
[
0
].
data
=
data
;
var
myChartUserType
=
echarts
.
init
(
document
.
getElementById
(
'user-type'
));
myChartUserType
.
setOption
(
optionUserType
);
},
error
:
function
(
e
)
{
console
.
log
(
e
)
})
},
getParams
:
function
(
params
)
{
if
(
!
params
)
return
''
;
var
res
=
''
;
var
keys
=
Object
.
keys
(
params
);
if
(
this
.
time
===
'month'
)
{
var
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
params
.
year
=
year
;
params
.
month
=
year
+
'-'
+
(
this
.
month
<
10
?
(
'0'
+
this
.
month
)
:
this
.
month
);
}
})
},
initUserOrg
:
function
()
{
var
params
=
{
clientId
:
this
.
app
,
year
:
this
.
year
,
month
:
this
.
month
}
var
_this
=
this
;
$
.
ajax
({
url
:
baseUrl
+
'authcenter/logstatistics/auth_hot_org?'
+
_this
.
getParams
(
params
),
success
:
function
(
result
)
{
_this
.
userOrgList
=
result
.
data
},
error
:
function
(
e
)
{
console
.
log
(
e
)
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
if
(
this
.
time
!==
'month'
&&
keys
[
i
]
===
'month'
)
continue
;
if
(
params
[
keys
[
i
]]
!==
'all'
)
{
if
(
res
!==
''
)
res
+=
'&'
res
=
res
+
keys
[
i
]
+
'='
+
params
[
keys
[
i
]];
}
}
})
},
getParams
:
function
(
params
)
{
if
(
!
params
)
return
''
;
var
res
=
''
;
var
keys
=
Object
.
keys
(
params
);
if
(
this
.
time
===
'month'
)
{
var
date
=
new
Date
();
var
year
=
date
.
getFullYear
();
params
.
year
=
year
;
params
.
month
=
year
+
'-'
+
(
this
.
month
<
10
?
(
'0'
+
this
.
month
)
:
this
.
month
);
}
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
if
(
this
.
time
!==
'month'
&&
keys
[
i
]
===
'month'
)
continue
;
if
(
params
[
keys
[
i
]]
!==
'all'
)
{
if
(
res
!==
''
)
res
+=
'&'
res
=
res
+
keys
[
i
]
+
'='
+
params
[
keys
[
i
]];
return
res
;
},
randomFun
:
function
(
arr
)
{
for
(
var
i
=
0
,
len
=
arr
.
length
;
i
<
len
;
i
++
)
{
var
index
=
parseInt
(
Math
.
random
()
*
(
len
-
1
));
var
tempValue
=
arr
[
i
];
arr
[
i
]
=
arr
[
index
];
arr
[
index
]
=
tempValue
;
}
return
arr
;
}
return
res
;
},
randomFun
:
function
(
arr
)
{
for
(
var
i
=
0
,
len
=
arr
.
length
;
i
<
len
;
i
++
)
{
var
index
=
parseInt
(
Math
.
random
()
*
(
len
-
1
));
var
tempValue
=
arr
[
i
];
arr
[
i
]
=
arr
[
index
];
arr
[
index
]
=
tempValue
;
}
return
arr
;
}
},
})
})
</script>
</script>
</body>
...
...
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