forked from github/dataease
Merge pull request #8130 from dataease/pr@dev-v2@fix_watermark
fix(仪表板): 修复社区板仪表板因不支持水印设置导致的控制台报错问题
This commit is contained in:
commit
8db132bd12
@ -215,25 +215,14 @@ watch(
|
||||
)
|
||||
|
||||
const initWatermark = (waterDomId = 'editor-canvas-main') => {
|
||||
if (
|
||||
dvInfo.value.watermarkInfo &&
|
||||
dvInfo.value.watermarkInfo.settingContent &&
|
||||
isMainCanvas(canvasId.value)
|
||||
) {
|
||||
const scale = dashboardActive.value ? 1 : curScale.value
|
||||
if (userInfo.value) {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
} else {
|
||||
const method = personInfoApi
|
||||
method().then(res => {
|
||||
userInfo.value = res.data
|
||||
try {
|
||||
if (
|
||||
dvInfo.value.watermarkInfo &&
|
||||
dvInfo.value.watermarkInfo.settingContent &&
|
||||
isMainCanvas(canvasId.value)
|
||||
) {
|
||||
const scale = dashboardActive.value ? 1 : curScale.value
|
||||
if (userInfo.value) {
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
@ -242,8 +231,23 @@ const initWatermark = (waterDomId = 'editor-canvas-main') => {
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
})
|
||||
} else {
|
||||
const method = personInfoApi
|
||||
method().then(res => {
|
||||
userInfo.value = res.data
|
||||
activeWatermark(
|
||||
dvInfo.value.watermarkInfo.settingContent,
|
||||
userInfo.value,
|
||||
waterDomId,
|
||||
canvasId.value,
|
||||
dvInfo.value.selfWatermarkStatus,
|
||||
scale
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Watermarks are not supported!')
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user