Merge pull request #9422 from dataease/pr@dev-v2@fix_tabel-details

Pr@dev v2@fix tabel details
This commit is contained in:
王嘉豪 2024-04-28 19:18:14 +08:00 committed by GitHub
commit 76779aa45c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 31 additions and 8 deletions

View File

@ -867,6 +867,7 @@ function removeItem(index) {
})
}
componentData.value.splice(index, 1)
dvMainStore.removeLinkageInfo(item['id'])
if (!!checkedFields.length) {
Array.from(new Set(checkedFields)).forEach(ele => {
emitter.emit(`query-data-${ele}`)

View File

@ -793,6 +793,9 @@ export const dvMainStore = defineStore('dataVisualization', {
setNowPanelJumpInfo(jumpInfo) {
this.nowPanelJumpInfo = jumpInfo.baseJumpInfoMap
},
setNowPanelJumpInfoInner(jumpInfo) {
this.nowPanelJumpInfo = jumpInfo
},
setNowTargetPanelJumpInfo(jumpInfo) {
this.nowPanelJumpInfoTargetPanel = jumpInfo.baseJumpInfoVisualizationMap
},
@ -1122,6 +1125,24 @@ export const dvMainStore = defineStore('dataVisualization', {
this.componentData = []
this.canvasViewInfo = {}
},
removeLinkageInfo(targetId) {
if (!!targetId && !!this.nowPanelTrackInfo) {
Object.keys(this.nowPanelTrackInfo).forEach(trackId => {
const targetInfo = this.nowPanelTrackInfo[trackId]
for (let i = 0; i < targetInfo.length; i++) {
if (targetInfo[i].indexOf(targetId) > -1) {
targetInfo.splice(i, 1)
i--
}
}
})
Object.keys(this.nowPanelTrackInfo).forEach(trackId => {
if (trackId.indexOf(targetId) > -1 || this.nowPanelTrackInfo[trackId].length === 0) {
delete this.nowPanelTrackInfo[trackId]
}
})
}
},
canvasDataInit() {
this.canvasViewInfo = {}
this.componentData = []

View File

@ -13,7 +13,8 @@ const {
canvasStyleData,
canvasViewInfo,
curOriginThemes,
dataPrepareState
dataPrepareState,
nowPanelTrackInfo
} = storeToRefs(dvMainStore)
let defaultCanvasInfo = {
@ -81,6 +82,7 @@ export const snapshotStore = defineStore('snapshot', {
dvMainStore.setComponentData(snapshotInfo.componentData)
dvMainStore.setCanvasStyle(snapshotInfo.canvasStyleData)
dvMainStore.setCanvasViewInfo(snapshotInfo.canvasViewInfo)
dvMainStore.setNowPanelJumpInfoInner(snapshotInfo.nowPanelTrackInfo)
const curCacheViewIdInfo = deepCopy(this.cacheViewIdInfo)
this.cacheViewIdInfo = snapshotInfo.cacheViewIdInfo
@ -139,7 +141,8 @@ export const snapshotStore = defineStore('snapshot', {
componentData: deepCopy(componentData.value),
canvasStyleData: deepCopy(canvasStyleData.value),
canvasViewInfo: deepCopy(canvasViewInfo.value),
cacheViewIdInfo: deepCopy(this.cacheViewIdInfo)
cacheViewIdInfo: deepCopy(this.cacheViewIdInfo),
nowPanelTrackInfo: deepCopy(nowPanelTrackInfo.value)
}
this.snapshotData[++this.snapshotIndex] = newSnapshot
// undo 过程中添加新的快照时要将它后面的快照清理掉

View File

@ -21,7 +21,7 @@ import { BASE_VIEW_CONFIG } from '../util/chart'
import { cloneDeep, defaultsDeep } from 'lodash-es'
const dvMainStore = dvMainStoreWithOut()
const { nowPanelTrackInfo, nowPanelJumpInfo, dvInfo } = storeToRefs(dvMainStore)
const { nowPanelTrackInfo, nowPanelJumpInfo, dvInfo, componentData } = storeToRefs(dvMainStore)
const { t } = useI18n()
const linkJumpRef = ref(null)

View File

@ -408,10 +408,9 @@ onBeforeUnmount(() => {
const autoStyle = computed(() => {
return {
height: 100 / scale.value + '%!important',
height: 20 * scale.value + 8 + 'px',
width: 100 / scale.value + '%!important',
left: 50 * (1 - 1 / scale.value) + '%', // 2
top: 50 * (1 - 1 / scale.value) + '%', // 2
transform: 'scale(' + scale.value + ')'
}
})
@ -435,8 +434,8 @@ const autoHeightStyle = computed(() => {
<div v-if="!isError" class="canvas-content">
<div style="position: relative; height: 100%" :id="containerId"></div>
</div>
<el-row :style="autoHeightStyle" v-if="showPage && !isError">
<div :style="autoStyle" class="table-page-info">
<el-row :style="autoStyle" v-if="showPage && !isError">
<div class="table-page-info">
<div>{{ state.pageInfo.total }}</div>
<el-pagination
class="table-page-content"
@ -475,7 +474,6 @@ const autoHeightStyle = computed(() => {
height: 20px;
display: flex;
width: 100%;
justify-content: space-between;
color: grey;
:deep(.table-page-content) {
button,