fix: bug#10540、10542

This commit is contained in:
JiangQiming 2023-03-17 18:20:22 +08:00
parent 7c9028dab4
commit efcfa42adb
2 changed files with 50 additions and 6 deletions

View File

@ -22,10 +22,18 @@
: '停止录像' : '停止录像'
}} }}
</div> </div>
<div class="tool-item">刷新</div> <div class="tool-item" @click.stop="handleRefresh">
刷新
</div>
<div class="tool-item" @click.stop="handleReset">重置</div> <div class="tool-item" @click.stop="handleReset">重置</div>
</div> </div>
<LivePlayer :live="true" :url="url" :protocol="mediaType" autoplay /> <LivePlayer
ref="player"
:live="true"
:url="url"
:protocol="mediaType"
autoplay
/>
</div> </div>
<MediaTool <MediaTool
@onMouseDown="handleMouseDown" @onMouseDown="handleMouseDown"
@ -70,6 +78,8 @@ const _vis = computed({
set: (val) => emit('update:visible', val), set: (val) => emit('update:visible', val),
}); });
//
const player = ref();
// //
const url = ref(''); const url = ref('');
// //
@ -126,6 +136,13 @@ const handleRecord = async () => {
} }
}; };
/**
* 刷新
*/
const handleRefresh = () => {
player.value.play();
};
/** /**
* 重置 * 重置
*/ */

View File

@ -131,7 +131,10 @@
style="padding: 0px" style="padding: 0px"
:hasPermission=" :hasPermission="
'media/Device:' + 'media/Device:' +
(i.key !== 'updateChannel' ? i.key : 'update') (i.key !== 'updateChannel' &&
i.key !== 'viewDevice'
? i.key
: 'update')
" "
> >
<template #icon><AIcon :type="i.icon" /></template> <template #icon><AIcon :type="i.icon" /></template>
@ -325,6 +328,17 @@ const getActions = (
); );
}, },
}, },
{
key: 'viewDevice',
text: '查看',
tooltip: {
title: '查看',
},
icon: 'EyeOutlined',
onClick: () => {
menuStory.jumpPage('device/Instance/Detail', { id: data.id });
},
},
{ {
key: 'updateChannel', key: 'updateChannel',
text: '更新通道', text: '更新通道',
@ -374,8 +388,21 @@ const getActions = (
icon: 'DeleteOutlined', icon: 'DeleteOutlined',
}, },
]; ];
return data.provider === 'fixed-media'
? actions.filter((f: any) => f.key !== 'updateChannel') let acts: any = [];
: actions; if (type === 'card') {
//
const tempActs = actions.filter((f: any) => f.key !== 'viewDevice');
acts =
data.provider === 'fixed-media'
? tempActs.filter((f: any) => f.key !== 'updateChannel')
: tempActs;
} else {
acts =
data.provider === 'fixed-media'
? actions.filter((f: any) => f.key !== 'updateChannel')
: actions;
}
return acts;
}; };
</script> </script>