Browse Source

(*)水利视频初始加载失败问题修复

master
peng.peng 12 months ago
parent
commit
75974c9be3
  1. 9
      super-screen/client/src/sections/water-prevention/components/right-bottom.js
  2. 4
      super-screen/client/src/sections/water-prevention/containers/homePage.js

9
super-screen/client/src/sections/water-prevention/components/right-bottom.js

@ -7,10 +7,15 @@ const { Option } = Select;
function DataTop5(props) {
const { structures, accessToken, videoList } = props;
const [showVideoList, setShowVideoList] = useState(videoList[0]?.url);
const [showVideoList, setShowVideoList] = useState();
useEffect(() => {
if (videoList.length && structures.length) setShowVideoList(videoList.filter(v => v.structId === structures[0].id));
if (videoList.length && structures.length) {
setShowVideoList(videoList.filter(v => v.structId === structures[0].id));
if (!showVideoList) {
setShowVideoList(videoList[0]?.url)
}
}
}, [videoList])
const renderSubtitle = () => (

4
super-screen/client/src/sections/water-prevention/containers/homePage.js

@ -118,7 +118,9 @@ function homePage(props) {
const at = resArr[1].payload.data.accessToken;
const list = resArr[0].payload.data?.map(v => ({ url: v.yingshi.hlsAddress, name: v.name, structId: v.structId }));
setAccessToken(at)
setVideoList(list);
let videoTop = list?.find(x => x.name == '玉湖公园')
setVideoList([videoTop].concat(list?.filter(v => v.name != '玉湖公园')));
// setVideoList(list);
}
})
// 告警

Loading…
Cancel
Save