fix: 大屏优化403问题 以及conData组件不加载问题

This commit is contained in:
huanghao1412 2024-03-04 10:17:33 +08:00
parent 2cfcfe48b7
commit 3c662921f7
3 changed files with 16 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<n-space vertical> <n-space vertical>
<setting-item-box name="组态ID" :alone="true"> <setting-item-box name="组态ID" :alone="true">
<n-input-number v-model:value="mapId" size="small" placeholder="请输入组态ID"/> <n-input-number :value="props.customData.mapId" @update:value="setMapId" size="small" placeholder="请输入组态ID"/>
</setting-item-box> </setting-item-box>
</n-space> </n-space>
</template> </template>
@ -14,17 +14,17 @@ import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
const props = defineProps(['customData', 'request']) const props = defineProps(['customData', 'request'])
let mapId: Ref<null | number> = ref(null) // let mapId: Ref<null | number> = ref(null)
mapId.value = props.customData.mapId as (null | number) // mapId.value = props.customData.mapId as (null | number)
const setMapId = debounce((v: null | number) => { const setMapId = debounce((v: null | number) => {
props.customData.mapId = v props.customData.mapId = v
}, 500) }, 500)
watch(() => { // watch(() => {
return mapId.value // return mapId.value
}, (v: null | number) => { // }, (v: null | number) => {
setMapId(v) // setMapId(v)
}) // })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -47,7 +47,8 @@ const handleMsg = (event: any) => {
if (event.origin === origin) { if (event.origin === origin) {
// //
let obj = event.data let obj = event.data
if(obj.type === 'changeRoute') { if(obj.page !== 'engineering') return
if(obj.type === 'changeTopmostRoute') {
postMessageToParent({ postMessageToParent({
type: 'changeRouterV1', type: 'changeRouterV1',
url: obj.path url: obj.path

View File

@ -126,7 +126,13 @@ export const useSync = () => {
const intComponent = (target: CreateComponentType) => { const intComponent = (target: CreateComponentType) => {
if (!window['$vue'].component(target.chartConfig.chartKey)) { if (!window['$vue'].component(target.chartConfig.chartKey)) {
window['$vue'].component(target.chartConfig.chartKey, fetchChartComponent(target.chartConfig)) window['$vue'].component(target.chartConfig.chartKey, fetchChartComponent(target.chartConfig))
// window['$vue'].component(target.chartConfig.conKey, fetchConfigComponent(target.chartConfig))
// window['$vue'].component(target.chartConfig.conDataKey, fetchConfigDataComponent(target.chartConfig))
}
if (!window['$vue'].component(target.chartConfig.conKey)) {
window['$vue'].component(target.chartConfig.conKey, fetchConfigComponent(target.chartConfig)) window['$vue'].component(target.chartConfig.conKey, fetchConfigComponent(target.chartConfig))
}
if (!window['$vue'].component(target.chartConfig.conDataKey)) {
window['$vue'].component(target.chartConfig.conDataKey, fetchConfigDataComponent(target.chartConfig)) window['$vue'].component(target.chartConfig.conDataKey, fetchConfigDataComponent(target.chartConfig))
} }
} }