Commit acaad5caec7bb19f4211dc789fb256bbef35a535

Authored by fengwotao
1 parent d3b75617

fix(src/views/chart): 修复单个摄像头,部分配置项回显问题

... ... @@ -34,7 +34,8 @@ export const option = {
34 34 autoplay: true,
35 35 poster: '',
36 36 sourceType: 'custom',
37   - organization: ''
  37 + organization: '',
  38 + videoId : ''
38 39 }
39 40
40 41 export default class Config extends PublicConfigClass implements CreateComponentType {
... ...
... ... @@ -82,7 +82,7 @@ const sourceTypes = [
82 82
83 83 const originationOption = ref([])
84 84
85   -const url = ref('')
  85 +const url = ref<string | null>(null)
86 86
87 87 const videoOptions = ref<videoListInterface[]>([])
88 88
... ... @@ -116,6 +116,8 @@ const getVideoUrlById = async (id: string) => {
116 116
117 117 const handleChecked = (value: string) => {
118 118 props.optionData.dataset = ''
  119 + props.optionData.organization = ''
  120 + url.value = null
119 121 if (value === sourceTypeEnum.PLATFORM) {
120 122 getOriginationList()
121 123 }
... ... @@ -126,17 +128,20 @@ const handleSelect = (_: string, e: videoListInterface) => {
126 128 //1表示,需要从服务端调取接口换取播放的地址,0则不需要
127 129 if (accessMode === AccessMode.Streaming) {
128 130 getVideoUrlById(id)
  131 + url.value = id
  132 + props.optionData.videoId = id
129 133 } else {
130 134 props.optionData.dataset = value as string
131 135 }
132 136 }
133 137
134   -onMounted(() => {
  138 +onMounted(async() => {
135 139 if (props.optionData.sourceType === sourceTypeEnum.PLATFORM) {
136 140 getOriginationList()
137 141 if (props.optionData.organization) {
138   - getVideoLists(props.optionData.organization)
  142 + await getVideoLists(props.optionData.organization)
139 143 }
  144 + url.value = props.optionData.videoId
140 145 }
141 146 })
142 147
... ...