Commit 3f8783f55c7b13f1328edbf014b6bca7a0265d76

Authored by fengtao
1 parent af1c801c

perf(src/packages/components): 修改单个摄像头,多个时,点击切换,右边配置回显问题

... ... @@ -55,7 +55,7 @@
55 55 </template>
56 56
57 57 <script setup lang="ts">
58   -import { PropType, ref, onMounted } from 'vue'
  58 +import { PropType, ref, onMounted, watch } from 'vue'
59 59 import { AccessMode, option, sourceTypeEnum, videoListInterface, sourceTypeNameEnum, Dataset } from './config'
60 60 import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
61 61 import { NTreeSelect } from 'naive-ui'
... ... @@ -135,6 +135,19 @@ const handleSelect = (_: string, e: videoListInterface) => {
135 135 }
136 136 }
137 137
  138 +watch(()=>props.optionData, (newData)=>{
  139 + if (newData.sourceType === sourceTypeEnum.PLATFORM) {
  140 + getOriginationList()
  141 + if (newData.organization) {
  142 + getVideoLists(newData.organization)
  143 + }
  144 + }
  145 +},
  146 +{
  147 + immediate: true,
  148 + deep: true
  149 +})
  150 +
138 151 onMounted(() => {
139 152 if (props.optionData.sourceType === sourceTypeEnum.PLATFORM) {
140 153 getOriginationList()
... ...