Files
ks-app-employment-service/pages/chat/components/fileText.vue
2025-04-07 09:10:55 +08:00

39 lines
979 B
Vue

<template>
<view class="file-type-box">
{{ fileAbbreviation }}
</view>
</template>
<script setup>
import { computed } from 'vue';
const props = defineProps({
type: String,
});
const fileAbbreviation = computed(() => {
const typeMap = {
'application/pdf': 'PDF',
'application/msword': 'DOC',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'DOCX',
'application/vnd.ms-powerpoint': 'PPT',
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'PPTX',
'application/vnd.ms-excel': 'XLS',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'XLSX',
'text/markdown': 'MD',
'text/plain': 'TXT',
'text/html': 'HTML',
};
return typeMap[props.type] || 'OTHER';
});
</script>
<style scoped>
.file-type-box {
font-weight: 400;
font-size: 24rpx;
color: #7b7b7b;
line-height: 28rpx;
}
</style>