Commit 3f8783f55c7b13f1328edbf014b6bca7a0265d76
1 parent
af1c801c
perf(src/packages/components): 修改单个摄像头,多个时,点击切换,右边配置回显问题
Showing
1 changed file
with
14 additions
and
1 deletions
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | </template> | 55 | </template> |
56 | 56 | ||
57 | <script setup lang="ts"> | 57 | <script setup lang="ts"> |
58 | -import { PropType, ref, onMounted } from 'vue' | 58 | +import { PropType, ref, onMounted, watch } from 'vue' |
59 | import { AccessMode, option, sourceTypeEnum, videoListInterface, sourceTypeNameEnum, Dataset } from './config' | 59 | import { AccessMode, option, sourceTypeEnum, videoListInterface, sourceTypeNameEnum, Dataset } from './config' |
60 | import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting' | 60 | import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting' |
61 | import { NTreeSelect } from 'naive-ui' | 61 | import { NTreeSelect } from 'naive-ui' |
@@ -135,6 +135,19 @@ const handleSelect = (_: string, e: videoListInterface) => { | @@ -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 | onMounted(() => { | 151 | onMounted(() => { |
139 | if (props.optionData.sourceType === sourceTypeEnum.PLATFORM) { | 152 | if (props.optionData.sourceType === sourceTypeEnum.PLATFORM) { |
140 | getOriginationList() | 153 | getOriginationList() |