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
2e7ffd8a
Commit
2e7ffd8a
authored
Sep 02, 2024
by
fulixin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'V20240805' of
http://192.168.60.201/root/dsk-cr20g
into V20240805
parents
23f2c1be
54caecf3
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
411 additions
and
3293 deletions
+411
-3293
logo.ico
dsk-operate-ui/public/logo.ico
+0
-0
index.vue
dsk-operate-ui/src/layout/components/TagsView/index.vue
+4
-0
permission.js
dsk-operate-ui/src/permission.js
+15
-3
index.js
dsk-operate-ui/src/router/index.js
+222
-130
auth.js
dsk-operate-ui/src/utils/auth.js
+19
-7
index2.vue
...ate-ui/src/views/radar/components/MajorProject/index2.vue
+0
-1831
index2.vue
...rate-ui/src/views/radar/components/debtProject/index2.vue
+0
-907
index.vue
dsk-operate-ui/src/views/radar/index.vue
+151
-257
index2.vue
dsk-operate-ui/src/views/radar/index2.vue
+0
-158
No files found.
dsk-operate-ui/public/logo.ico
deleted
100644 → 0
View file @
23f2c1be
16.6 KB
dsk-operate-ui/src/layout/components/TagsView/index.vue
View file @
2e7ffd8a
...
@@ -351,6 +351,10 @@ export default {
...
@@ -351,6 +351,10 @@ export default {
position
:
relative
;
position
:
relative
;
cursor
:
pointer
;
cursor
:
pointer
;
min-width
:
128px
;
min-width
:
128px
;
max-width
:
400px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
height
:
32px
;
height
:
32px
;
line-height
:
32px
;
line-height
:
32px
;
color
:
#495060
;
color
:
#495060
;
...
...
dsk-operate-ui/src/permission.js
View file @
2e7ffd8a
...
@@ -3,18 +3,27 @@ import store from './store';
...
@@ -3,18 +3,27 @@ import store from './store';
import
{
Message
}
from
'element-ui'
;
import
{
Message
}
from
'element-ui'
;
import
NProgress
from
'nprogress'
;
import
NProgress
from
'nprogress'
;
import
'nprogress/nprogress.css'
;
import
'nprogress/nprogress.css'
;
import
{
getToken
,
getThirdPlatform
}
from
'@/utils/auth'
;
import
{
getToken
,
getThirdPlatform
,
checkThirdPlatformChange
,
removeThirdPlatform
,
setThirdPlatform
}
from
'@/utils/auth'
;
import
{
isRelogin
}
from
'@/utils/request'
;
import
{
isRelogin
}
from
'@/utils/request'
;
NProgress
.
configure
({
showSpinner
:
false
});
NProgress
.
configure
({
showSpinner
:
false
});
const
whiteList
=
[
'/login'
,
"/404"
,
"/401"
];
const
whiteList
=
[
'/login'
,
"/404"
,
"/401"
];
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
// 存在platFormkey但是 已经更换 或本地session不存在 已经存在其它token 重写拉取所有信息
const
onlyUrlKey
=
getThirdPlatform
(
true
);
if
(
onlyUrlKey
&&
checkThirdPlatformChange
(
onlyUrlKey
))
{
// 前端退出登录
await
store
.
dispatch
(
"FedLogOut"
);
removeThirdPlatform
();
setThirdPlatform
(
onlyUrlKey
);
}
// 默认跳转路径 本系统跳转首页,第三方跳转宏观市场
// 默认跳转路径 本系统跳转首页,第三方跳转宏观市场
const
platFormKey
=
getThirdPlatform
();
const
platFormKey
=
getThirdPlatform
();
let
defaultRedirectPath
=
platFormKey
?
"/macro/nationalEconomies"
:
"/"
;
let
defaultRedirectPath
=
platFormKey
?
"/macro/nationalEconomies"
:
"/"
;
NProgress
.
start
();
NProgress
.
start
();
// 正常登录 不带第三方
if
(
getToken
())
{
if
(
getToken
())
{
// tab页签title
// tab页签title
const
{
tabTitle
,
url
}
=
to
.
query
;
const
{
tabTitle
,
url
}
=
to
.
query
;
...
@@ -29,7 +38,10 @@ router.beforeEach((to, from, next) => {
...
@@ -29,7 +38,10 @@ router.beforeEach((to, from, next) => {
if
(
!
store
.
state
?.
user
?.
userId
&&
!
store
.
state
?.
user
?.
roles
?.
length
)
{
if
(
!
store
.
state
?.
user
?.
userId
&&
!
store
.
state
?.
user
?.
roles
?.
length
)
{
isRelogin
.
show
=
true
;
isRelogin
.
show
=
true
;
// 判断当前用户是否已拉取完user_info信息
// 判断当前用户是否已拉取完user_info信息
store
.
dispatch
(
'GetInfo'
).
then
(()
=>
{
store
.
dispatch
(
'GetInfo'
).
then
(
async
(
res
)
=>
{
if
(
res
?.
data
?.
isThirdPlatformLogin
&&
!
platFormKey
)
{
throw
new
Error
(
"第三方登录重置,请重新使用platFormKey进入"
);
}
isRelogin
.
show
=
false
;
isRelogin
.
show
=
false
;
store
.
dispatch
(
'GenerateRoutes'
).
then
(
accessRoutes
=>
{
store
.
dispatch
(
'GenerateRoutes'
).
then
(
accessRoutes
=>
{
// 根据roles权限生成可访问的路由表
// 根据roles权限生成可访问的路由表
...
...
dsk-operate-ui/src/router/index.js
View file @
2e7ffd8a
This diff is collapsed.
Click to expand it.
dsk-operate-ui/src/utils/auth.js
View file @
2e7ffd8a
...
@@ -34,24 +34,36 @@ export function setBiAuth(token) {
...
@@ -34,24 +34,36 @@ export function setBiAuth(token) {
/**
/**
* 获取第三方app key
* 获取第三方app key
* @returns
* @param {*} onlyUrl 是否仅从url获取
* @returns
*/
*/
export
function
getThirdPlatform
()
{
export
function
getThirdPlatform
(
onlyUrl
=
false
)
{
const
platForm
=
sessionStorage
.
getItem
(
"PLAT_FORM"
);
if
(
!
onlyUrl
)
{
if
(
platForm
)
return
platForm
;
const
platForm
=
sessionStorage
.
getItem
(
"PLAT_FORM"
);
if
(
platForm
)
return
platForm
;
}
// sessiongStorage 未获取到appkey 寻找url上的参数
// sessiongStorage 未获取到appkey 寻找url上的参数
const
{
platFormKey
}
=
getUrlSearchQuery
();
const
{
platFormKey
}
=
getUrlSearchQuery
();
if
(
platFormKey
)
{
if
(
platFormKey
)
{
return
setThirdPlatform
(
platFormKey
)
?
platFormKey
:
""
;
return
platFormKey
;
}
else
{
}
else
{
return
""
;
return
""
;
};
};
}
}
/**
* 检测 appkey是否存在变动
* @param {*} appkey
*/
export
function
checkThirdPlatformChange
(
appkey
)
{
const
platForm
=
sessionStorage
.
getItem
(
"PLAT_FORM"
);
return
platForm
!==
appkey
;
}
/**
/**
* 储存第三方app key
* 储存第三方app key
* @param {*} appkey
* @param {*} appkey
* @returns
* @returns
*/
*/
export
function
setThirdPlatform
(
appkey
)
{
export
function
setThirdPlatform
(
appkey
)
{
try
{
try
{
...
...
dsk-operate-ui/src/views/radar/components/MajorProject/index2.vue
deleted
100644 → 0
View file @
23f2c1be
This diff is collapsed.
Click to expand it.
dsk-operate-ui/src/views/radar/components/debtProject/index2.vue
deleted
100644 → 0
View file @
23f2c1be
This diff is collapsed.
Click to expand it.
dsk-operate-ui/src/views/radar/index.vue
View file @
2e7ffd8a
This diff is collapsed.
Click to expand it.
dsk-operate-ui/src/views/radar/index2.vue
deleted
100644 → 0
View file @
23f2c1be
<
template
>
<div
v-loading=
"loading"
class=
"radar-container"
>
<iframe
id=
"companyIframe"
class=
"radar-iframe"
marginwidth=
"0"
marginheight=
"0"
scrolling=
"no"
frameborder=
"0"
width=
"100%"
:src=
"src"
/>
</div>
</
template
>
<
script
>
import
{
steerScroll
}
from
'@/assets/js/jskplug'
;
import
{
dskAccessToken
}
from
'@/api/common'
;
import
{
encodeStr
}
from
"@/assets/js/common"
;
import
MaxPageSizeTip
from
"@/views/components/MaxPageSizeTip.vue"
;
import
{
getUipIdByCid
}
from
'@/api/macro/macro'
;
export
default
{
name
:
'Enterprise'
,
components
:
{
MaxPageSizeTip
},
data
()
{
return
{
encodeStr
,
loading
:
false
,
// 是否加载完成-当前页控制
iframeTimer
:
''
,
// 是否加载中定时器-当前页控制
footHeight
:
0
,
//底部高度,若为0(页面内部嵌套或者没有底部板块)
iframeHight
:
`
${
window
.
innerHeight
}
px`
,
// iframe高度-当前页控制
navigation
:
{
isFixed
:
true
,
fixedHeight
:
56
,
totalHeight
:
68
},
// iframe之外页面顶部对象,ifFixed:是否浮动;fixedHeight:浮动对象高度;totalHeight:顶部整体高度
src
:
''
,
//iframe嵌套页面地址
domain
:
'https://plug.jiansheku.com'
,
// 插件地址
// domain: 'https://pre-plug.jiansheku.com', // 插件地址测试
// domain: 'http://192.168.60.104:3400',
ak
:
'aec7b3ff2y2q8x6t49a7e2c463ce21912'
,
// 需要携带的sdkId
timelongs
:
7200
,
//刷新token时间
tokentimer
:
null
,
showMaxPageTip
:
false
,
iframeIns
:
null
,
};
},
created
()
{
this
.
domain
=
process
.
env
.
VUE_APP_SUB_SYSTEM_ADDRESS
;
this
.
gettokens
();
this
.
iframeObserver
();
let
that
=
this
;
window
.
addEventListener
(
"message"
,
this
.
pagecapListener
,
{
passive
:
true
});
window
.
addEventListener
(
'message'
,
this
.
linkListener
,
false
);
},
mounted
()
{
this
.
iframeLoading
();
// 判断iframe页面是否加载完成-当前页控制
// steerScroll('companyIframe', this.navigation, this.footHeight, true); // iframeId: iframe的id;navigation:页面排除iframe后剩下的顶部高度;footHeight: 页面排除iframe后剩下的底部高度;state:监听or移除监听;parentId: 父级id[不带默认就是铺满整个页面]];_this:指向当前实例(可忽略)
},
beforeDestroy
()
{
clearInterval
(
this
.
iframeTimer
);
// -当前页控制
steerScroll
(
'companyIframe'
,
this
.
navigation
,
this
.
footHeight
);
// iframeId: iframe的id;navigation:页面排除iframe后剩下的顶部高度;footHeight: 页面排除iframe后剩下的底部高度;state:监听or移除监听;parentId: 父级id[不带默认就是铺满整个页面]];_this:指向当前实例(可忽略)
clearInterval
(
this
.
tokentimer
);
window
.
removeEventListener
(
"message"
,
this
.
pagecapListener
,
{
passive
:
true
});
window
.
removeEventListener
(
"message"
,
this
.
linkListener
);
// 移除layout样式
this
.
iframeIns
?.
contentWindow
?
this
.
iframeIns
.
contentWindow
.
postMessage
(
"removeHtmlLayoutStyle"
,
{
targetOrigin
:
this
.
domain
,
})
:
null
;
},
methods
:
{
linkListener
(
event
)
{
let
{
data
,
origin
}
=
event
;
if
(
origin
!=
this
.
domain
)
return
;
if
(
data
.
id
)
{
getUipIdByCid
([
data
.
id
]).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
&&
res
.
data
[
0
].
uipId
)
{
this
.
$router
.
push
({
path
:
'/enterprise/'
+
this
.
encodeStr
(
data
.
id
)
});
}
else
{
this
.
$tab
.
openPage
(
data
.
title
,
'/company/'
+
this
.
encodeStr
(
data
.
id
));
}
}
}).
catch
(
error
=>
{
});
}
else
{
if
(
data
.
url
)
{
this
.
$tab
.
openPage
(
data
.
title
,
data
.
url
);
}
}
},
async
iframeObserver
()
{
try
{
await
this
.
$nextTick
();
this
.
iframeIns
=
document
.
querySelector
(
".radar-iframe"
);
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
// 列表翻页上限
pagecapListener
(
e
)
{
const
{
origin
,
data
}
=
e
;
if
(
origin
!=
this
.
domain
)
return
;
if
(
data
==
"pageCurrentMaxSize"
)
{
this
.
$maxTip
(
"您可通过筛选工具来查询数据~若有更多需求请联系客服 0262798729!"
).
then
(({
done
,
uid
})
=>
{
done
();
});
}
},
gettokens
()
{
dskAccessToken
().
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
timelongs
=
res
.
data
.
expire
;
this
.
ak
=
res
.
data
.
accessToken
;
this
.
src
=
`
${
this
.
domain
}
/radar?ak=
${
this
.
ak
}
&initTime=
${
new
Date
().
getTime
()}
&uid=
${
this
.
ak
}
&origin=
${
window
.
location
.
origin
}
`
;
this
.
refreshtoken
();
}
else
{
clearTimeout
(
this
.
tokentimer
);
}
});
},
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
);
},
//判断iframe页面是否加载完成-当前页控制
iframeLoading
()
{
let
iframeHeight
=
document
.
getElementById
(
"companyIframe"
).
clientHeight
,
number
=
0
;
this
.
iframeTimer
=
setInterval
(()
=>
{
number
++
;
if
(
document
.
getElementById
(
"companyIframe"
).
clientHeight
!=
iframeHeight
||
number
==
5000
)
{
this
.
loading
=
false
;
clearInterval
(
this
.
iframeTimer
);
}
});
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.radar-container
{
width
:
100%
;
height
:
100%
;
padding
:
16px
24px
;
/*padding-right: 15px;*/
box-sizing
:
border-box
;
position
:
absolute
;
left
:
0
;
top
:
0
;
.radar-iframe
{
width
:
100%
;
height
:
100%
;
}
}
</
style
>
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