Merge pull request #13457 from dataease/pr@dev-v2@fix_jump

fix(仪表板、数据大屏): 修改跳转配置界面单个条件删除会串行问题
This commit is contained in:
王嘉豪
2024-11-21 13:43:32 +08:00
committed by GitHub
2 changed files with 18 additions and 4 deletions

View File

@@ -324,7 +324,7 @@
<el-button
class="m-del-icon-btn"
text
@click="deleteLinkJumpField(index)"
@click="deleteLinkJumpFieldById(targetViewInfo.targetId)"
>
<el-icon size="20px">
<Icon name="icon_delete-trash_outlined"
@@ -442,7 +442,7 @@
<el-button
class="m-del-icon-btn"
text
@click="deleteLinkJumpField(index)"
@click="deleteLinkJumpFieldById(targetViewInfo.targetId)"
>
<el-icon size="20px">
<Icon name="icon_delete-trash_outlined"
@@ -601,6 +601,7 @@ import { useAppStoreWithOut } from '@/store/modules/app'
import { XpackComponent } from '@/components/plugin'
import { useCache } from '@/hooks/web/useCache'
import { useEmbedded } from '@/store/modules/embedded'
import { guid } from '@/views/visualized/data/dataset/form/util'
const dvMainStore = dvMainStoreWithOut()
const { dvInfo, canvasViewInfo, componentData } = storeToRefs(dvMainStore)
const linkJumpInfoTree = ref(null)
@@ -909,14 +910,25 @@ const dvNodeClick = data => {
}
const addLinkJumpField = (type = 'view') => {
state.linkJumpInfo.targetViewInfoList.push({
targetId: guid(),
targetViewId: '',
targetType: type,
targetFieldId: ''
})
}
const deleteLinkJumpFieldById = index => {
state.linkJumpInfo.targetViewInfoList.splice(index, 1)
const deleteLinkJumpFieldById = targetId => {
if (targetId) {
let indexResult
state.linkJumpInfo.targetViewInfoList.forEach((item, index) => {
if (targetId === item.targetId) {
indexResult = index
}
})
if (indexResult !== undefined) {
state.linkJumpInfo.targetViewInfoList.splice(indexResult, 1)
}
}
}
const deleteLinkJumpField = index => {