Commit acaad5caec7bb19f4211dc789fb256bbef35a535

Authored by fengwotao
1 parent d3b75617

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

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