feat: fileicon, filetext 组件改为全局,新增一体机上传简历(接口待调)
This commit is contained in:
54
components/FileIcon/fileIcon.vue
Normal file
54
components/FileIcon/fileIcon.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<image v-if="type === 'application/pdf' || type === 'pdf'" :src="pdfIcon" class="file-icon" />
|
||||
<image
|
||||
v-else-if="
|
||||
type === 'application/msword' ||
|
||||
type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ||
|
||||
type === 'doc' ||
|
||||
type === 'docx'
|
||||
"
|
||||
:src="docIcon"
|
||||
class="file-icon"
|
||||
/>
|
||||
<image
|
||||
v-else-if="
|
||||
type === 'application/vnd.ms-powerpoint' ||
|
||||
type === 'application/vnd.openxmlformats-officedocument.presentationml.presentation'||
|
||||
type === 'ppt' ||
|
||||
type === 'pptx'
|
||||
"
|
||||
:src="pptIcon"
|
||||
class="file-icon"
|
||||
/>
|
||||
<image v-else-if="type === 'text/markdown' || type === 'md'" :src="mdIcon" class="file-icon" />
|
||||
<image v-else-if="type === 'text/plain' || type=== 'txt'" :src="txtIcon" class="file-icon" />
|
||||
<image v-else-if="type === 'text/html' || type === 'html'" :src="htmlIcon" class="file-icon" />
|
||||
<image
|
||||
v-else-if="
|
||||
type === 'application/vnd.ms-excel' ||
|
||||
type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'||
|
||||
type === 'xls' ||
|
||||
type === 'xlsx'
|
||||
"
|
||||
:src="excelIcon"
|
||||
class="file-icon"
|
||||
/>
|
||||
<image v-else :src="otherIcon" class="file-icon" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import pdfIcon from '@/static/file/pdf.png';
|
||||
import docIcon from '@/static/file/doc.png';
|
||||
import pptIcon from '@/static/file/ppt.png';
|
||||
import mdIcon from '@/static/file/md.png';
|
||||
import txtIcon from '@/static/file/txt.png';
|
||||
import htmlIcon from '@/static/file/html.png';
|
||||
import excelIcon from '@/static/file/excel.png';
|
||||
import otherIcon from '@/static/file/other.png';
|
||||
|
||||
const props = defineProps({
|
||||
type: String,
|
||||
});
|
||||
|
||||
const type = props.type;
|
||||
</script>
|
||||
Reference in New Issue
Block a user