Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
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
Administrator
dsk-cr20g
Commits
7a4371c6
Commit
7a4371c6
authored
Oct 19, 2023
by
danfuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
25d65d6e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
157 additions
and
0 deletions
+157
-0
index.js
dsk-operate-ui/src/router/index.js
+14
-0
detail.vue
dsk-operate-ui/src/views/market/detail.vue
+142
-0
index.vue
dsk-operate-ui/src/views/market/index.vue
+1
-0
No files found.
dsk-operate-ui/src/router/index.js
View file @
7a4371c6
...
...
@@ -130,6 +130,20 @@ export const constantRoutes = [
}
]
},
{
path
:
''
,
component
:
Layout
,
hidden
:
true
,
redirect
:
'noredirect'
,
children
:
[
{
path
:
'/performance/gzsc/:id'
,
component
:
()
=>
import
(
'@/views/market/detail'
),
name
:
'gzsc'
,
meta
:
{
title
:
'公招市场详情'
,
icon
:
'enterprise'
,
noCache
:
false
},
}
]
},
{
path
:
'/groupAccount'
,
component
:
Layout
,
...
...
dsk-operate-ui/src/views/market/detail.vue
0 → 100644
View file @
7a4371c6
<
template
>
<div>
<div
:style=
"
{'minHeight':minHeight+'px'}">
<div
:style=
"
{'height':navigation.totalHeight+'px'}">
</div>
<div
class=
"iframe"
v-loading=
"loading"
>
<iframe
id=
"companyIframe"
marginwidth=
"0"
marginheight=
"0"
frameborder=
"0"
scrolling=
"no"
width=
"100%"
:style=
"
{height:iframeHight+'px'}" :src="src" />
</div>
</div>
</div>
</
template
>
<
script
>
import
{
steerScroll
}
from
'@/assets/js/jskplug'
;
import
{
dskAccessToken
}
from
'@/api/common'
;
export
default
{
name
:
'Detail'
,
data
()
{
return
{
currentUrl
:
''
,
loading
:
false
,
iframeHight
:
800
,
// iframe高度-当前页控制
navigation
:
{
isFixed
:
true
,
fixedHeight
:
0
,
totalHeight
:
0
},
// iframe之外页面顶部对象,ifFixed:是否浮动;fixedHeight:浮动对象高度;totalHeight:顶部整体高度
footHeight
:
160
,
//底部高度,若为0(页面内部嵌套或者没有底部板块)
src
:
''
,
//
domain
:
'https://pre-plug.jiansheku.com'
,
uid
:
''
,
// 需要携带的uid
loginDialogVisible
:
false
,
vipDialogVisible
:
false
,
dataVip
:{},
minHeight
:
0
}
},
computed
:
{
},
created
()
{
console
.
log
(
"11111"
)
if
(
window
.
location
.
host
===
'http://szh.jiansheku.com'
||
window
.
location
.
host
===
'szh.jiansheku.com'
){
this
.
domain
=
'https://plug.jiansheku.com'
}
else
{
this
.
domain
=
'https://pre-plug.jiansheku.com'
// this.domain='http://192.168.60.8:3400'
}
this
.
loading
=
true
if
(
process
.
browser
){
this
.
getAccesstoken
(
true
)
}
},
mounted
()
{
this
.
setInitHeight
()
//设置初始相关高度
this
.
iframeLoading
()
// 判断iframe页面是否加载完成-当前页控制
steerScroll
(
'companyIframe'
,
this
.
navigation
,
this
.
footHeight
,
true
,
''
,
this
)
// 监听滚动(iframe的id、页面排除iframe后页面剩下高度[例:80]、增加监听[不传就是移除监听]、父级id[不带默认就是铺满整个页面]])
//控制页面内容最低高度
this
.
setMainHeight
()
},
beforeDestroy
()
{
clearInterval
(
this
.
iframeTimer
)
// -当前页控制
clearInterval
(
this
.
tokenTimer
)
// -当前页控制
steerScroll
(
'companyIframe'
,
this
.
navigation
,
this
.
footHeight
)
// 监听滚动(iframe的id、页面排除iframe后页面剩下高度[例:80]、增加监听[不传就是移除监听]、父级id[不带默认就是铺满整个页面]])
},
methods
:
{
setInitHeight
(){
let
headerHeight
=
document
.
getElementById
(
'header'
).
offsetHeight
this
.
navigation
.
fixedHeight
=
this
.
navigation
.
totalHeight
=
headerHeight
+
10
},
// 判断iframe页面是否加载完成-当前页控制
iframeLoading
()
{
const
iframeHeight
=
document
.
getElementById
(
'companyIframe'
).
clientHeight
let
number
=
0
this
.
iframeTimer
=
setInterval
(()
=>
{
number
=
number
+
1
if
(
document
.
getElementById
(
'companyIframe'
).
clientHeight
!==
iframeHeight
||
number
===
5000
)
{
this
.
loading
=
false
clearInterval
(
this
.
iframeTimer
)
}
})
},
// 获取accessToken
async
getAccesstoken
(
init
){
dskAccessToken
().
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
timelongs
=
res
.
data
.
expire
;
this
.
ak
=
res
.
data
.
accessToken
;
if
(
init
){
//首次加载iframe地址
if
(
window
.
location
.
search
){
this
.
src
=
`
${
this
.
domain
+
this
.
$route
.
fullPath
}
&ak=
${
this
.
ak
}
&initTime=
${
new
Date
().
getTime
()}
&uid=
${
this
.
uid
}
&origin=
${
window
.
location
.
origin
}
`
}
else
{
this
.
src
=
`
${
this
.
domain
+
this
.
$route
.
fullPath
}
?ak=
${
this
.
ak
}
&initTime=
${
new
Date
().
getTime
()}
&uid=
${
this
.
uid
}
&origin=
${
window
.
location
.
origin
}
`
}
}
else
{
//更新iframe地址的accessToken
let
ifam
=
document
.
getElementById
(
'companyIframe'
)
ifam
.
contentWindow
.
postMessage
({
'accessToken'
:
this
.
ak
,
'initTime'
:
new
Date
().
getTime
()
},
'*'
)
}
this
.
refreshtoken
();
}
else
{
clearTimeout
(
this
.
tokentimer
);
}
});
},
setMainHeight
(){
let
cliHight
=
document
.
body
.
clientHeight
,
footerHeight
=
document
.
getElementById
(
'footer'
)
?
document
.
getElementById
(
'footer'
).
offsetHeight
:
0
this
.
minHeight
=
cliHight
-
footerHeight
},
refreshtoken
()
{
this
.
tokentimer
=
setTimeout
(()
=>
{
dskAccessToken
().
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
timelongs
=
res
.
data
.
expire
;
this
.
ak
=
res
.
data
.
accessToken
;
let
ifam
=
document
.
getElementById
(
'companyIframe'
);
//iframe的id
let
akObj
=
res
.
data
.
expire
;
//accessToken接口的返回值
let
initTime
=
new
Date
().
getTime
();
//accessToken接口返回后的当前时间戳
ifam
.
contentWindow
.
postMessage
({
'accessToken'
:
akObj
.
accessToken
,
'initTime'
:
initTime
},
'*'
);
}
else
{
clearTimeout
(
this
.
tokentimer
);
}
});
},
this
.
timelongs
*
1000
);
},
},
watch
:
{
'$store.state.akObj.expire'
(
newValue
,
oldValue
)
{
if
(
newValue
){
let
t
=
(
newValue
-
20
)
*
1000
,
_this
=
this
_this
.
tokenTimer
=
setTimeout
(
function
()
{
_this
.
getAccesstoken
()
},
t
)
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.iframe
{
background
:
#fafafa
;
}
#companyIframe
{
min-height
:
500px
;
}
</
style
>
dsk-operate-ui/src/views/market/index.vue
View file @
7a4371c6
...
...
@@ -35,6 +35,7 @@ export default {
this
.
domain
=
'https://plug.jiansheku.com'
}
else
{
this
.
domain
=
'https://pre-plug.jiansheku.com'
// this.domain='http://192.168.60.8:3400'
}
this
.
gettokens
();
},
...
...
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