forked from github/dataease
refactor(嵌入式): 完善嵌入内外交互
This commit is contained in:
parent
b7f8321cf1
commit
2ed0a2b36a
@ -246,9 +246,9 @@ const winMsgHandle = event => {
|
||||
msgInfo.type === 'attachParams' &&
|
||||
msgInfo.targetSourceId === dvInfo.value.id + ''
|
||||
) {
|
||||
const attachParam = msgInfo.params
|
||||
if (attachParam) {
|
||||
dvMainStore.addOuterParamsFilter(attachParam, componentData.value, 'outer')
|
||||
const attachParams = msgInfo.params
|
||||
if (attachParams) {
|
||||
dvMainStore.addOuterParamsFilter(attachParams, componentData.value, 'outer')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ onBeforeMount(async () => {
|
||||
}
|
||||
|
||||
// 添加外部参数
|
||||
let attachParam
|
||||
let attachParams
|
||||
await getOuterParamsInfo(embeddedStore.dvId).then(rsp => {
|
||||
dvMainStore.setNowPanelOuterParamsInfo(rsp.data)
|
||||
})
|
||||
@ -48,7 +48,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)
|
||||
@ -74,8 +74,8 @@ onBeforeMount(async () => {
|
||||
nextTick(() => {
|
||||
dashboardPreview.value.restore()
|
||||
})
|
||||
if (attachParam) {
|
||||
dvMainStore.addOuterParamsFilter(attachParam, canvasDataResult, 'outer')
|
||||
if (attachParams) {
|
||||
dvMainStore.addOuterParamsFilter(attachParams, canvasDataResult, 'outer')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -291,9 +291,12 @@ const onPointClick = param => {
|
||||
type: 'de_inner_params',
|
||||
sourceDvId: dvInfo.value.id,
|
||||
sourceViewId: view.value.id,
|
||||
message: Base64.encode(param)
|
||||
message: Base64.encode(JSON.stringify(param))
|
||||
}
|
||||
if (window['dataease-embedded-host']) {
|
||||
console.info('de_inner_params send to host')
|
||||
window['dataease-embedded-host'].postMessage(msg, '*')
|
||||
}
|
||||
window.parent.postMessage(msg, '*')
|
||||
} catch (e) {
|
||||
console.warn('de_inner_params send error')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user