Merge pull request #8944 from dataease/pr@dev-v2@perf_embedded_interactive

perf(X-Pack): 嵌入式与宿主交互
This commit is contained in:
fit2cloud-chenyw 2024-04-03 16:41:50 +08:00 committed by GitHub
commit 7a181aec1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 5 deletions

View File

@ -179,13 +179,28 @@ const backToMain = () => {
autofocus: false, autofocus: false,
showClose: false showClose: false
}).then(() => { }).then(() => {
window.open(url, '_self') backHandler(url)
}) })
} else { } else {
window.open(url, '_self') backHandler(url)
} }
} }
const backHandler = (url: string) => {
if (window['dataease-embedded-host'] && openHandler?.value) {
const pm = {
methodName: 'interactive',
args: {
eventName: 'de-dashboard-editor-back',
args: 'Just a demo that descript dataease embedded interactive'
}
}
openHandler.value.invokeMethod(pm)
return
}
window.open(url, '_self')
}
const multiplexingCanvasOpen = () => { const multiplexingCanvasOpen = () => {
multiplexingRef.value.dialogInit() multiplexingRef.value.dialogInit()
} }

View File

@ -16,6 +16,7 @@ import DeResourceGroupOpt from '@/views/common/DeResourceGroupOpt.vue'
import { canvasSave } from '@/utils/canvasUtils' import { canvasSave } from '@/utils/canvasUtils'
import { changeSizeWithScale } from '@/utils/changeComponentsSizeWithScale' import { changeSizeWithScale } from '@/utils/changeComponentsSizeWithScale'
import MoreComGroup from '@/custom-component/component-group/MoreComGroup.vue' import MoreComGroup from '@/custom-component/component-group/MoreComGroup.vue'
import { XpackComponent } from '@/components/plugin'
let nameEdit = ref(false) let nameEdit = ref(false)
let inputName = ref('') let inputName = ref('')
let nameInput = ref(null) let nameInput = ref(null)
@ -121,12 +122,27 @@ const backToMain = () => {
autofocus: false, autofocus: false,
showClose: false showClose: false
}).then(() => { }).then(() => {
window.open(url, '_self') backHandler(url)
}) })
} else { } else {
window.open(url, '_self') backHandler(url)
} }
} }
const backHandler = (url: string) => {
if (window['dataease-embedded-host'] && openHandler?.value) {
const pm = {
methodName: 'interactive',
args: {
eventName: 'de-dashboard-editor-back',
args: 'Just a demo that descript dataease embedded interactive'
}
}
openHandler.value.invokeMethod(pm)
return
}
window.open(url, '_self')
}
const openHandler = ref(null)
const onDvNameChange = () => { const onDvNameChange = () => {
snapshotStore.recordSnapshotCache() snapshotStore.recordSnapshotCache()
@ -252,6 +268,7 @@ eventBus.on('clearCanvas', clearCanvas)
ref="resourceGroupOpt" ref="resourceGroupOpt"
/> />
</div> </div>
<XpackComponent ref="openHandler" jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI=" />
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>

@ -1 +1 @@
Subproject commit 2151cb380739f315e3c55586630d70249edde67c Subproject commit 426a7ed9f81ac63d9a95e1a58bd96d64a3c7b662