feat: update jobs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import { mediaService } from '@/api/mediaService';
|
||||
import { postService } from '@/api/postService';
|
||||
import { formatDate } from "@/utils/date";
|
||||
import { formatFileSize } from "@/utils/filesize";
|
||||
import { getFileIcon, getFileTypeByMimeCN } from "@/utils/filetype";
|
||||
import { useToast } from 'primevue/usetoast';
|
||||
@@ -375,7 +376,7 @@ const loadHeadImagePreviews = async () => {
|
||||
<div class="text-sm font-medium text-gray-900 truncate">{{ media.name }}
|
||||
</div>
|
||||
|
||||
<Badge :value="getFileTypeByMimeCN(media.media_type)" />
|
||||
<Badge :value="getFileTypeByMimeCN(media.mime_type)" />
|
||||
</div>
|
||||
<Button icon="pi pi-times" class="p-button-rounded p-button-text p-button-sm"
|
||||
@click="removeMedia(media)" aria-label="移除" />
|
||||
@@ -434,7 +435,7 @@ const loadHeadImagePreviews = async () => {
|
||||
|
||||
<Column field="fileType" header="文件类型">
|
||||
<template #body="{ data }">
|
||||
<Badge :value="getFileTypeByMimeCN(data.media_type)" />
|
||||
<Badge :value="getFileTypeByMimeCN(data.mime_type)" />
|
||||
</template>
|
||||
</Column>
|
||||
|
||||
@@ -446,7 +447,7 @@ const loadHeadImagePreviews = async () => {
|
||||
|
||||
<Column field="createdAt" header="上传时间">
|
||||
<template #body="{ data }">
|
||||
{{ new Date(data.upload_time).toLocaleString('zh-CN') }}
|
||||
{{ formatDate(data.upload_time) }}
|
||||
</template>
|
||||
</Column>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import { mediaService } from '@/api/mediaService';
|
||||
import { postService } from '@/api/postService';
|
||||
import { formatDate } from "@/utils/date";
|
||||
import { formatFileSize } from "@/utils/filesize";
|
||||
import { getFileIcon, getFileTypeByMimeCN } from "@/utils/filetype";
|
||||
import { useToast } from 'primevue/usetoast';
|
||||
@@ -424,7 +425,7 @@ onMounted(() => {
|
||||
<div class="text-sm font-medium text-gray-900 truncate">{{ media.name }}
|
||||
</div>
|
||||
|
||||
<Badge :value="getFileTypeByMimeCN(media.media_type)" />
|
||||
<Badge :value="getFileTypeByMimeCN(media.mime_type)" />
|
||||
</div>
|
||||
<Button icon="pi pi-times" class="p-button-rounded p-button-text p-button-sm"
|
||||
@click="removeMedia(media)" aria-label="移除" />
|
||||
@@ -483,19 +484,19 @@ onMounted(() => {
|
||||
|
||||
<Column field="fileType" header="文件类型">
|
||||
<template #body="{ data }">
|
||||
<Badge :value="getFileTypeByMimeCN(data.media_type)" />
|
||||
<Badge :value="getFileTypeByMimeCN(data.mime_type)" />
|
||||
</template>
|
||||
</Column>
|
||||
|
||||
<Column field="fileSize" header="文件大小">
|
||||
<template #body="{ data }">
|
||||
{{ formatFileSize(data.file_size) }}
|
||||
{{ formatFileSize(data.size) }}
|
||||
</template>
|
||||
</Column>
|
||||
|
||||
<Column field="createdAt" header="上传时间">
|
||||
<template #body="{ data }">
|
||||
{{ new Date(data.upload_time).toLocaleString('zh-CN') }}
|
||||
{{ formatDate(data.upload_time) }}
|
||||
</template>
|
||||
</Column>
|
||||
</DataTable>
|
||||
|
||||
@@ -63,6 +63,7 @@ export function getFileTypeByMime(mime) {
|
||||
* @returns {string} The Chinese file type category
|
||||
*/
|
||||
export function getFileTypeByMimeCN(mime) {
|
||||
console.log("mime:", mime)
|
||||
const typeMap = {
|
||||
'video': '视频',
|
||||
'audio': '音频',
|
||||
@@ -73,7 +74,6 @@ export function getFileTypeByMimeCN(mime) {
|
||||
'other': '其他',
|
||||
'unknown': '未知'
|
||||
};
|
||||
console.log(mime)
|
||||
|
||||
return typeMap[getFileTypeByMime(mime)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user