flat:4.7暂存
This commit is contained in:
38
pages/chat/components/fileText.vue
Normal file
38
pages/chat/components/fileText.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<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>
|
Reference in New Issue
Block a user