fix(功能用例): 脑图-修复附件里图片不显示预览按钮的缺陷

This commit is contained in:
teukkk 2024-07-12 10:56:44 +08:00 committed by 刘瑞斌
parent 9dded07e77
commit 0f07d05953
1 changed files with 3 additions and 4 deletions

View File

@ -30,7 +30,7 @@
<!-- 本地文件 -->
<div v-if="item.local || item.status === 'init'" class="flex flex-nowrap">
<MsButton
v-if="item.status !== 'init' && item.file.type.includes('image/')"
v-if="item.file.type.includes('/image')"
type="button"
status="primary"
class="!mr-[4px]"
@ -225,9 +225,7 @@
//
async function handlePreview(item: MsFileItem) {
try {
imageUrl.value = '';
previewVisible.value = true;
if (!item.local) {
if (item.status !== 'init') {
const res = await previewFile({
projectId: appStore.currentProjectId,
caseId: props.activeCase.id,
@ -239,6 +237,7 @@
} else {
imageUrl.value = item.url || '';
}
previewVisible.value = true;
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);