Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
cda6b751
提交
cda6b751
authored
12月 21, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 仪表板适配后端长屏截图
上级
b191c845
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
59 行增加
和
10 行删除
+59
-10
Preview.vue
frontend/src/components/canvas/components/Editor/Preview.vue
+32
-4
PreviewEject.vue
.../src/components/canvas/components/Editor/PreviewEject.vue
+21
-4
permission.js
frontend/src/permission.js
+1
-1
index.js
frontend/src/router/index.js
+5
-1
没有找到文件。
frontend/src/components/canvas/components/Editor/Preview.vue
浏览文件 @
cda6b751
<
template
>
<div
class=
"bg"
:style=
"customStyle"
>
<div
id=
"canvasInfoMain"
ref=
"canvasInfoMain"
style=
"width: 100%;height: 100%
"
>
<div
id=
"canvasInfoMain"
ref=
"canvasInfoMain"
:style=
"canvasInfoMainStyle
"
>
<div
id=
"canvasInfoTemp"
ref=
"canvasInfoTemp"
...
...
@@ -73,6 +73,11 @@ export default {
event
:
'change'
},
props
:
{
// 后端截图
backScreenShot
:
{
type
:
Boolean
,
default
:
false
},
screenShot
:
{
type
:
Boolean
,
default
:
false
...
...
@@ -125,6 +130,19 @@ export default {
created
()
{
},
computed
:
{
canvasInfoMainStyle
()
{
if
(
this
.
backScreenShot
)
{
return
{
width
:
'100%'
,
height
:
this
.
mainHeight
}
}
else
{
return
{
width
:
'100%'
,
height
:
'100%'
}
}
},
customStyle
()
{
let
style
=
{
width
:
'100%'
...
...
@@ -142,6 +160,11 @@ export default {
}
}
}
if
(
this
.
backScreenShot
)
{
style
.
height
=
this
.
mainHeight
}
else
{
style
.
padding
=
'5px'
}
return
style
},
screenShotStyle
()
{
...
...
@@ -189,6 +212,7 @@ export default {
_this
.
$nextTick
(()
=>
{
// 将mainHeight 修改为px 临时解决html2canvas 截图不全的问题
_this
.
mainHeight
=
tempCanvas
.
scrollHeight
+
'px!important'
this
.
$emit
(
'mainHeightChange'
,
_this
.
mainHeight
)
})
})
eventBus
.
$on
(
'openChartDetailsDialog'
,
this
.
openChartDetailsDialog
)
...
...
@@ -231,7 +255,12 @@ export default {
const
canvasHeight
=
document
.
getElementById
(
'canvasInfoMain'
).
offsetHeight
const
canvasWidth
=
document
.
getElementById
(
'canvasInfoMain'
).
offsetWidth
this
.
scaleWidth
=
(
canvasWidth
)
*
100
/
this
.
canvasStyleData
.
width
// 获取宽度比
this
.
scaleHeight
=
canvasHeight
*
100
/
this
.
canvasStyleData
.
height
// 获取高度比
// 如果是后端截图方式使用 的高度伸缩比例和宽度比例相同
if
(
this
.
backScreenShot
)
{
this
.
scaleHeight
=
this
.
scaleWidth
}
else
{
this
.
scaleHeight
=
canvasHeight
*
100
/
this
.
canvasStyleData
.
height
// 获取高度比
}
this
.
$store
.
commit
(
'setPreviewCanvasScale'
,
{
scaleWidth
:
(
this
.
scaleWidth
/
100
),
scaleHeight
:
(
this
.
scaleHeight
/
100
)
})
this
.
handleScaleChange
()
},
...
...
@@ -281,7 +310,7 @@ export default {
}
},
handleMouseDown
()
{
this
.
$store
.
commit
(
'setClickComponentStatus'
,
fals
e
)
this
.
$store
.
commit
(
'setClickComponentStatus'
,
fals
)
},
initMobileCanvas
()
{
this
.
$store
.
commit
(
'openMobileLayout'
)
...
...
@@ -292,7 +321,6 @@ export default {
<
style
lang=
"scss"
scoped
>
.bg
{
padding
:
5px
;
min-width
:
200px
;
min-height
:
300px
;
width
:
100%
;
...
...
frontend/src/components/canvas/components/Editor/PreviewEject.vue
浏览文件 @
cda6b751
<
template
>
<div
v-loading=
"dataLoading"
class=
"bg"
>
<Preview
v-if=
"!dataLoading"
/>
<div
v-loading=
"dataLoading"
class=
"bg"
:style=
"bgStyle"
>
<Preview
v-if=
"!dataLoading"
:back-screen-shot=
"backScreenShot"
@
mainHeightChange=
"mainHeightChange"
/>
</div>
</
template
>
<
script
>
...
...
@@ -14,16 +14,33 @@ export default {
components
:
{
Preview
},
data
()
{
return
{
dataLoading
:
false
dataLoading
:
false
,
backScreenShot
:
false
,
mainHeight
:
'100vh!important'
}
},
computed
:
{
bgStyle
()
{
if
(
this
.
backScreenShot
)
{
return
{
height
:
this
.
mainHeight
}
}
else
{
return
{
height
:
'100vh!important'
}
}
}
},
mounted
()
{
this
.
restore
()
},
methods
:
{
mainHeightChange
(
mainHeight
)
{
this
.
mainHeight
=
mainHeight
},
restore
()
{
this
.
dataLoading
=
true
this
.
panelId
=
this
.
$route
.
path
.
split
(
'/'
)[
2
]
this
.
panelId
=
this
.
$route
.
params
.
reportId
if
(
this
.
$route
.
params
.
backScreenShot
!==
undefined
)
{
this
.
backScreenShot
=
this
.
$route
.
params
.
backScreenShot
}
// 加载视图数据
findOne
(
this
.
panelId
).
then
(
response
=>
{
this
.
dataLoading
=
false
...
...
frontend/src/permission.js
浏览文件 @
cda6b751
...
...
@@ -29,7 +29,7 @@ router.beforeEach(async(to, from, next) => {
NProgress
.
done
()
}
else
{
const
hasGetUserInfo
=
store
.
getters
.
name
if
(
hasGetUserInfo
||
to
.
path
.
indexOf
(
'/preview/'
)
>
-
1
||
to
.
path
.
indexOf
(
'/delink'
)
>
-
1
||
to
.
path
.
indexOf
(
'/nolic'
)
>
-
1
)
{
if
(
hasGetUserInfo
||
to
.
path
.
indexOf
(
'/preview
ScreenShot/'
)
>
-
1
||
to
.
path
.
indexOf
(
'/preview
/'
)
>
-
1
||
to
.
path
.
indexOf
(
'/delink'
)
>
-
1
||
to
.
path
.
indexOf
(
'/nolic'
)
>
-
1
)
{
next
()
store
.
dispatch
(
'permission/setCurrentPath'
,
to
.
path
)
}
else
{
...
...
frontend/src/router/index.js
浏览文件 @
cda6b751
...
...
@@ -82,7 +82,11 @@ export const constantRoutes = [
component
:
()
=>
import
(
'@/components/canvas/components/Editor/PreviewEject'
),
hidden
:
true
},
{
path
:
'/previewScreenShot/:reportId/:backScreenShot'
,
component
:
()
=>
import
(
'@/components/canvas/components/Editor/PreviewEject'
),
hidden
:
true
},
{
path
:
'/previewFullScreen'
,
component
:
()
=>
import
(
'@/components/canvas/components/Editor/PreviewFullScreen'
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论