fix: 修复过滤组件图层标题名称未同步问题

This commit is contained in:
wangjiahao 2025-01-20 11:46:26 +08:00 committed by 王嘉豪
parent 7e50e1db81
commit d345071290
3 changed files with 17 additions and 28 deletions

View File

@ -985,11 +985,12 @@ export function mobileViewStyleSwitch(component) {
} }
export function syncViewTitle(element) { export function syncViewTitle(element) {
if ( if (element && canvasViewInfo.value[element.id]) {
element && if (['UserView'].includes(element.component)) {
['UserView', 'VQuery'].includes(element.component) && canvasViewInfo.value[element.id].title = element.name
canvasViewInfo.value[element.id] } else if (['VQuery'].includes(element.component)) {
) { canvasViewInfo.value[element.id].title = element.name
canvasViewInfo.value[element.id].title = element.name canvasViewInfo.value[element.id].customStyle.component.title = element.name
}
} }
} }

View File

@ -1,8 +1,7 @@
<script lang="tsx" setup> <script lang="tsx" setup>
import { ElMessage } from 'element-plus-secondary' import { ElMessage } from 'element-plus-secondary'
import icon_bold_outlined from '@/assets/svg/icon_bold_outlined.svg' import icon_bold_outlined from '@/assets/svg/icon_bold_outlined.svg'
import { beforeUploadCheck, uploadFileResult } from '@/api/staticResource' import { uploadFileResult } from '@/api/staticResource'
import ImgViewDialog from '@/custom-component/ImgViewDialog.vue'
import icon_italic_outlined from '@/assets/svg/icon_italic_outlined.svg' import icon_italic_outlined from '@/assets/svg/icon_italic_outlined.svg'
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg' import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg'
@ -143,26 +142,6 @@ const init = () => {
state.fileList = [] state.fileList = []
} }
} }
const handleRemove = () => {
state.commonBackground['outerImage'] = null
state.fileList = []
onBackgroundChange()
}
const handlePictureCardPreview = file => {
state.dialogImageUrl = file.url
state.dialogVisible = true
}
const upload = file => {
return uploadFileResult(file.file, fileUrl => {
state.commonBackground['outerImage'] = fileUrl
state.fileList = [{ url: imgUrlTrans(state.commonBackground['outerImage']) }]
onBackgroundChange()
})
}
const goFile = () => {
files.value.click()
}
const onBackgroundChangeV2 = val => { const onBackgroundChangeV2 = val => {
snapshotStore.recordSnapshotCache('onBackgroundChange') snapshotStore.recordSnapshotCache('onBackgroundChange')
element.value.commonBackground = val element.value.commonBackground = val
@ -247,6 +226,11 @@ const initParams = () => {
} }
} }
initParams() initParams()
const onTitleChange = () => {
element.value.label = chart.value.customStyle.component.title
element.value.name = chart.value.customStyle.component.title
chart.value.title = chart.value.customStyle.component.title
}
</script> </script>
<template> <template>
@ -286,6 +270,7 @@ initParams()
:effect="themes" :effect="themes"
:disabled="!chart.customStyle.component.titleShow" :disabled="!chart.customStyle.component.titleShow"
v-model.lazy="chart.customStyle.component.title" v-model.lazy="chart.customStyle.component.title"
@change="onTitleChange"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item

View File

@ -151,6 +151,9 @@ const closeEditComponentName = () => {
return return
} }
view.value.title = inputComponentName.value.name view.value.title = inputComponentName.value.name
if (view.value.type === 'VQuery') {
view.value.customStyle.component.title = inputComponentName.value.name
}
if (curComponent.value) { if (curComponent.value) {
curComponent.value.label = inputComponentName.value.name curComponent.value.label = inputComponentName.value.name
curComponent.value.name = inputComponentName.value.name curComponent.value.name = inputComponentName.value.name