Commit f1be41a3b0021dc636a84f5c97a62d1056dc28f7

Authored by fengtao
1 parent b5725d18

fix(src/packages): 修复翻牌组件,ws判断方式,递归调用导致浏览器页面崩溃无法点击

@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 </template> 7 </template>
8 8
9 <script setup lang="ts"> 9 <script setup lang="ts">
10 -import { PropType, toRefs, watch, ref, computed, unref } from 'vue' 10 +import { PropType, toRefs, watch, ref } from 'vue'
11 import { CreateComponentType } from '@/packages/index.d' 11 import { CreateComponentType } from '@/packages/index.d'
12 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' 12 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
13 import { useChartDataFetch } from '@/hooks' 13 import { useChartDataFetch } from '@/hooks'
@@ -25,8 +25,11 @@ const props = defineProps({ @@ -25,8 +25,11 @@ const props = defineProps({
25 25
26 const { w, h } = toRefs(props.chartConfig.attr) 26 const { w, h } = toRefs(props.chartConfig.attr)
27 27
28 -const { targetData, chartEditStore } = useTargetData() 28 +const { targetData } = useTargetData()
29 29
  30 +/**
  31 + * 递归判断是否是ws会造成页面崩溃,浏览器无法点击
  32 + *
30 const isWebsocket = computed(() => { 33 const isWebsocket = computed(() => {
31 const result = query(chartEditStore.getComponentList) as unknown as any 34 const result = query(chartEditStore.getComponentList) as unknown as any
32 if (result === false) return false 35 if (result === false) return false
@@ -53,9 +56,9 @@ function query(list: CreateComponentType[]) { @@ -53,9 +56,9 @@ function query(list: CreateComponentType[]) {
53 } 56 }
54 } 57 }
55 } 58 }
56 -  
57 return false 59 return false
58 } 60 }
  61 +*/
59 62
60 const { 63 const {
61 flipperLength, 64 flipperLength,
@@ -98,7 +101,7 @@ watch( @@ -98,7 +101,7 @@ watch(
98 ) 101 )
99 102
100 useChartDataFetch(props.chartConfig, useChartEditStore, (newVal: string | number) => { 103 useChartDataFetch(props.chartConfig, useChartEditStore, (newVal: string | number) => {
101 - if (unref(isWebsocket)) return 104 + if(targetData.value?.request?.requestContentType === RequestContentTypeEnum.WEB_SOCKET) return //请求类型是ws,则终止
102 updateDatasetHandler(newVal) 105 updateDatasetHandler(newVal)
103 }) 106 })
104 </script> 107 </script>