Commit c2a73d18a44257b86e3e67fe39b9deb00cbc67f4

Authored by xp.Huang
2 parents b5725d18 f1be41a3

Merge branch 'fix/page-crash/06-27' into 'main_dev'

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

See merge request yunteng/thingskit-view!277
... ... @@ -7,7 +7,7 @@
7 7 </template>
8 8
9 9 <script setup lang="ts">
10   -import { PropType, toRefs, watch, ref, computed, unref } from 'vue'
  10 +import { PropType, toRefs, watch, ref } from 'vue'
11 11 import { CreateComponentType } from '@/packages/index.d'
12 12 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
13 13 import { useChartDataFetch } from '@/hooks'
... ... @@ -25,8 +25,11 @@ const props = defineProps({
25 25
26 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 33 const isWebsocket = computed(() => {
31 34 const result = query(chartEditStore.getComponentList) as unknown as any
32 35 if (result === false) return false
... ... @@ -53,9 +56,9 @@ function query(list: CreateComponentType[]) {
53 56 }
54 57 }
55 58 }
56   -
57 59 return false
58 60 }
  61 +*/
59 62
60 63 const {
61 64 flipperLength,
... ... @@ -98,7 +101,7 @@ watch(
98 101 )
99 102
100 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 105 updateDatasetHandler(newVal)
103 106 })
104 107 </script>
... ...