refactor(嵌入式): 嵌入式交互参数数据结构优化

This commit is contained in:
wangjiahao 2024-05-29 14:01:18 +08:00
parent 091a7d6673
commit db98be4e7c

View File

@ -34,9 +34,9 @@ const winMsgHandle = event => {
const msgInfo = event.data
// targetSourceId
if (msgInfo && msgInfo.type === 'attachParams' && msgInfo.targetSourceId === state.chartId + '') {
const attachParam = msgInfo.params
if (attachParam) {
dvMainStore.addOuterParamsFilter(attachParam, state.canvasDataPreview, 'outer')
const attachParams = msgInfo.params
if (attachParams) {
dvMainStore.addOuterParamsFilter(attachParams, state.canvasDataPreview, 'outer')
}
}
}
@ -59,7 +59,7 @@ onBeforeMount(async () => {
window.addEventListener('message', winMsgHandle)
//
let attachParam
let attachParams
await getOuterParamsInfo(embeddedStore.dvId).then(rsp => {
dvMainStore.setNowPanelOuterParamsInfo(rsp.data)
})
@ -68,7 +68,7 @@ onBeforeMount(async () => {
if (embeddedStore.outerParams) {
try {
const outerPramsParse = JSON.parse(embeddedStore.outerParams)
attachParam = outerPramsParse.attachParam
attachParams = outerPramsParse.attachParams
dvMainStore.setEmbeddedCallBack(outerPramsParse.callBackFlag || 'no')
} catch (e) {
console.error(e)
@ -91,8 +91,8 @@ onBeforeMount(async () => {
state.canvasViewInfoPreview = canvasViewInfoPreview
state.dvInfo = dvInfo
state.curPreviewGap = curPreviewGap
if (attachParam) {
dvMainStore.addOuterParamsFilter(attachParam, canvasDataResult)
if (attachParams) {
dvMainStore.addOuterParamsFilter(attachParams, canvasDataResult)
}
viewInfo.value = canvasViewInfoPreview[embeddedStore.chartId]