Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
Details
Activity
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
wangqinghua
smart
Commits
dee21ce5
Commit
dee21ce5
authored
Jun 11, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全屏兼容
parent
2830ed68
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
common.service.ts
src/main/webapp/app/shared/common/common.service.ts
+18
-0
No files found.
src/main/webapp/app/shared/common/common.service.ts
View file @
dee21ce5
...
@@ -2,6 +2,11 @@ import {Injectable, OnInit} from '@angular/core';
...
@@ -2,6 +2,11 @@ import {Injectable, OnInit} from '@angular/core';
import
{
NzMessageService
,
NzModalService
}
from
'ng-zorro-antd'
;
import
{
NzMessageService
,
NzModalService
}
from
'ng-zorro-antd'
;
import
{
SERVER_API_URL
,
SERVER_API_URL_COMS
}
from
'../../app.constants'
;
import
{
SERVER_API_URL
,
SERVER_API_URL_COMS
}
from
'../../app.constants'
;
import
{
DatePipe
}
from
'@angular/common'
;
import
{
DatePipe
}
from
'@angular/common'
;
declare
var
ActiveXObject
:
ActiveXObject
;
interface
ActiveXObject
{
new
(
type
:
string
):
ActiveXObject
;
SendKeys
(
key
:
string
):
void
;
}
@
Injectable
()
@
Injectable
()
export
class
CommonService
implements
OnInit
{
export
class
CommonService
implements
OnInit
{
...
@@ -134,6 +139,19 @@ export class CommonService implements OnInit {
...
@@ -134,6 +139,19 @@ export class CommonService implements OnInit {
*/
*/
showInFullScreen
(
element
,
method
)
{
showInFullScreen
(
element
,
method
)
{
let
usablePrefixMethod
;
let
usablePrefixMethod
;
const
ie
=
navigator
.
userAgent
.
match
(
/MSIE
\s([\d
.
]
+
)
/
),
ie11
=
navigator
.
userAgent
.
match
(
/Trident
\/
7.0/
)
&&
navigator
.
userAgent
.
match
(
/rv:11/
),
ieEDGE
=
navigator
.
userAgent
.
match
(
/Edge/g
),
ieVer
=
(
ie
?
ie
[
1
]
:
(
ie11
?
11
:
(
ieEDGE
?
12
:
-
1
)));
if
(
ieVer
>
-
1
)
{
if
(
typeof
(
<
any
>
window
).
ActiveXObject
!==
"undefined"
)
{
//这的方法 模拟f11键,使浏览器全屏
const
wscript
=
new
ActiveXObject
(
"WScript.Shell"
);
if
(
wscript
!=
null
)
{
wscript
.
SendKeys
(
"{F11}"
);
}
}
}
[
'webkit'
,
'moz'
,
'ms'
,
'o'
,
''
].
forEach
((
prefix
)
=>
{
[
'webkit'
,
'moz'
,
'ms'
,
'o'
,
''
].
forEach
((
prefix
)
=>
{
if
(
usablePrefixMethod
)
{
if
(
usablePrefixMethod
)
{
return
;
return
;
...
...
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