feat: 标准库文件夹展示

This commit is contained in:
JiangSheng
2026-03-23 13:50:26 +08:00
parent eb9bc399f9
commit 4f1c510ef1
2 changed files with 92 additions and 17 deletions

View File

@@ -100,6 +100,18 @@
</el-button>
</div>
</template>
<template #originalName="{ row }">
<span class="file-name">
<template v-if="row.dataType === 1">
<span class="name link" @dblclick="onCellDblclickFun(row)">
{{ row.originalName }}
</span>
</template>
<template v-else>
<span class="name">{{ row.originalName }}</span>
</template>
</span>
</template>
<template #fileSize="{ row }">
{{ formatFileSize(row.fileSize) }}
</template>
@@ -431,23 +443,34 @@ const actionList = computed(() => {
title: t('通用.预览'),
type: 'primary',
click: (row: any) => previewFileFun(row),
hide: (row: any) => row.dataType !== 2 || (!props.readonly && !parsePermission(row.permissionValue).read),
hide: (row: any) => {
return (
row.dataType !== 2 || (!props.readonly && !parsePermission(row.permissionValue).read)
);
},
},
{
title: t('通用.下载'),
type: 'primary',
click: (row: any) => downloadFileById(row.id, props.readonly),
hide: (row: any) => row.dataType !== 2 || (!props.readonly && !parsePermission(row.permissionValue).export),
hide: (row: any) => {
return (
row.dataType !== 2 || (!props.readonly && !parsePermission(row.permissionValue).export)
);
},
},
{
title: t('通用.编辑'),
type: 'primary',
click: (row: any) => editFileFun(row),
hide: (row: any) =>
props.readonly ||
row.dataType !== 2 ||
row.approvalStatus === 'pending' ||
!parsePermission(row.permissionValue).write,
hide: (row: any) => {
return (
props.readonly ||
row.dataType !== 2 ||
row.approvalStatus === 'pending' ||
!parsePermission(row.permissionValue).write
);
},
},
];
@@ -457,11 +480,14 @@ const actionList = computed(() => {
title: t('通用.删除'),
type: 'danger',
click: (row: any) => delFileWithApprovalFun(row),
hide: (row: any) =>
props.readonly ||
row.dataType !== 2 ||
row.approvalStatus === 'pending' ||
!parsePermission(row.permissionValue).delete,
hide: (row: any) => {
return (
props.readonly ||
row.dataType !== 2 ||
row.approvalStatus === 'pending' ||
!parsePermission(row.permissionValue).delete
);
},
});
} else {
list.push({
@@ -470,11 +496,14 @@ const actionList = computed(() => {
needConfirm: true,
confirmTip: t('通用.确认删除吗'),
click: (row: any) => delFileFun(row),
hide: (row: any) =>
props.readonly ||
row.dataType !== 2 ||
row.approvalStatus === 'pending' ||
!parsePermission(row.permissionValue).delete,
hide: (row: any) => {
return (
props.readonly ||
row.dataType !== 2 ||
row.approvalStatus === 'pending' ||
!parsePermission(row.permissionValue).delete
);
},
} as any);
}
@@ -734,4 +763,21 @@ onDeactivated(() => {
}
}
}
.file-name {
.name {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.link {
color: var(--el-color-primary);
&:hover {
text-decoration: underline;
cursor: pointer;
}
}
}
.el-icon {
color: var(--el-color-primary);
}
}
</style>

View File

@@ -99,6 +99,18 @@
</el-button>
</div>
</template>
<template #originalName="{ row }">
<span class="file-name">
<template v-if="row.dataType === 1">
<span class="name link" @dblclick="onCellDblclickFun(row)">
{{ row.originalName }}
</span>
</template>
<template v-else>
<span class="name">{{ row.originalName }}</span>
</template>
</span>
</template>
<template #fileSize="{ row }">
{{ formatFileSize(row.fileSize) }}
</template>
@@ -574,4 +586,21 @@ const openProcessFun = (row: any) => {
}
}
}
.file-name {
.name {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.link {
color: var(--el-color-primary);
&:hover {
text-decoration: underline;
cursor: pointer;
}
}
}
.el-icon {
color: var(--el-color-primary);
}
}
</style>