refactor: 文案、大屏背景优化

This commit is contained in:
wangjiahao 2023-10-30 12:01:33 +08:00
parent fd88f001e9
commit d470e2b1c9
2 changed files with 16 additions and 12 deletions

View File

@ -110,7 +110,7 @@
{{ t('visualization.view') }} {{ t('visualization.view') }}
</el-radio> </el-radio>
<el-radio label="custom" :effect="themes"> <el-radio label="custom" :effect="themes">
{{ t('visualization.panel') }} {{ resourceType }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -175,6 +175,8 @@ const props = defineProps({
const toolTip = computed(() => { const toolTip = computed(() => {
return props.themes === 'dark' ? 'ndark' : 'dark' return props.themes === 'dark' ? 'ndark' : 'dark'
}) })
const resourceType = computed(() => (dvInfo.value.type === 'dashboard' ? '仪表板' : '数据大屏'))
const themeChange = modifyName => { const themeChange = modifyName => {
if (modifyName === 'themeColor') { if (modifyName === 'themeColor') {
// //

View File

@ -4,17 +4,19 @@ import JsPDF from 'jspdf'
const basePath = import.meta.env.VITE_API_BASEPATH const basePath = import.meta.env.VITE_API_BASEPATH
export function imgUrlTrans(url) { export function imgUrlTrans(url) {
if (url && typeof url === 'string' && url.indexOf('static-resource') > -1) { if (url) {
const rawUrl = url if (typeof url === 'string' && url.indexOf('static-resource') > -1) {
? (basePath.endsWith('/') ? basePath.substring(0, basePath.length - 1) : basePath) + url const rawUrl = url
: null ? (basePath.endsWith('/') ? basePath.substring(0, basePath.length - 1) : basePath) + url
return window.DataEaseBi : null
? `${window.DataEaseBi.baseUrl}${ return window.DataEaseBi
rawUrl.startsWith('/api') ? rawUrl.slice(5) : rawUrl ? `${window.DataEaseBi.baseUrl}${
}`.replace('com//', 'com/') rawUrl.startsWith('/api') ? rawUrl.slice(5) : rawUrl
: rawUrl }`.replace('com//', 'com/')
} else { : rawUrl
return url.replace('com//', 'com/') } else {
return url.replace('com//', 'com/')
}
} }
} }