Browse Source

问题优化

master
liujiangyong 1 year ago
parent
commit
f21c17d799
  1. 4
      super-screen/client/src/sections/water-prevention/components/right-bottom.js

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

@ -8,6 +8,7 @@ const { Option } = Select;
function DataTop5(props) {
const { structures, accessToken, videoList } = props;
const [showVideoList, setShowVideoList] = useState([]);
const [structure, setStructure] = useState(structures[0]?.id);
useEffect(() => {
if (videoList.length && structures.length) setShowVideoList(videoList.filter(v => v.structId === structures[0].id));
@ -22,7 +23,8 @@ function DataTop5(props) {
optionFilterProp="children"
key={Math.random()}
defaultValue={structures[0]?.id}
onChange={(value) => { setShowVideoList(videoList.filter(v => v.structId === value)) }}
value={structure}
onChange={(value) => { setShowVideoList(videoList.filter(v => v.structId === value)); setStructure(value) }}
>
{structures.map(s => <Option key={s.id} value={s.id}>{s.name}</Option>)}
</Select>

Loading…
Cancel
Save