@ -0,0 +1,5 @@ |
|||||||
|
import request from '@/utils/request' |
||||||
|
|
||||||
|
export function getMailOverall() { |
||||||
|
return request.get({ url: '/home/mail/overall'}) |
||||||
|
} |
||||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,86 @@ |
|||||||
|
<template> |
||||||
|
<div> |
||||||
|
<el-upload |
||||||
|
:action="`${VITE_API_URL}/api/file/upload`" |
||||||
|
:headers="{ Admin: getToken() }" |
||||||
|
multiple |
||||||
|
@before-upload="beforeUpload" |
||||||
|
@success="handleSuccess" |
||||||
|
:show-file-list="false" |
||||||
|
> |
||||||
|
<el-button |
||||||
|
>上传 |
||||||
|
|
||||||
|
<template #icon> |
||||||
|
<icon name="el-icon-Upload" /> |
||||||
|
</template> |
||||||
|
</el-button> |
||||||
|
</el-upload> |
||||||
|
<div class="flex wrap img-box mt-10"> |
||||||
|
<template v-for="(item, index) in files" :key="index"> |
||||||
|
<div class="releative"> |
||||||
|
<img |
||||||
|
:src="`${VITE_API_URL}/api/file/stream/${item.filepath}`" |
||||||
|
/> |
||||||
|
<a class="close-btn" @click="remove(index)"> |
||||||
|
<icon name="el-icon-CircleCloseFilled" :size="20" /> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
<script setup> |
||||||
|
import { getToken } from "@/utils/auth"; |
||||||
|
const { VITE_API_URL } = process.env; |
||||||
|
|
||||||
|
const props = defineProps({ |
||||||
|
value: { |
||||||
|
type: Array, |
||||||
|
default: () => [], |
||||||
|
}, |
||||||
|
}); |
||||||
|
|
||||||
|
const emit = defineEmits(["update:value"]); |
||||||
|
|
||||||
|
const files = ref([]); |
||||||
|
|
||||||
|
function beforeUpload() {} |
||||||
|
|
||||||
|
function handleSuccess(data, file) { |
||||||
|
if (data.code !== 200) { |
||||||
|
return; |
||||||
|
} |
||||||
|
files.value.push({ |
||||||
|
filepath: data.data.filepath, |
||||||
|
orgiinFilename: file.name, |
||||||
|
type: file.raw.type, |
||||||
|
}); |
||||||
|
emit("update:value", files.value); |
||||||
|
} |
||||||
|
|
||||||
|
function remove(index) { |
||||||
|
files.value.splice(index, 1); |
||||||
|
emit("update:value", files.value); |
||||||
|
} |
||||||
|
</script> |
||||||
|
<style lang="scss" scoped> |
||||||
|
.img-box { |
||||||
|
img { |
||||||
|
width: 80px; |
||||||
|
height: 80px; |
||||||
|
} |
||||||
|
.close-btn { |
||||||
|
position: absolute; |
||||||
|
top: -10px; |
||||||
|
right: -10px; |
||||||
|
display: block; |
||||||
|
border-radius: 50%; |
||||||
|
height: 20px; |
||||||
|
&:hover { |
||||||
|
color: red; |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
||||||