feat: update

This commit is contained in:
yanghao05
2025-04-09 19:27:05 +08:00
parent 8210787009
commit 05d2ecc2b9

View File

@@ -166,11 +166,11 @@ const cancelCreate = () => {
// File type badge severity mapping // File type badge severity mapping
const getBadgeSeverity = (fileType) => { const getBadgeSeverity = (fileType) => {
const map = { const map = {
'Image': 'info', 'image': 'info',
'PDF': 'danger', 'pdf': 'danger',
'Video': 'warning', 'video': 'warning',
'Document': 'primary', 'document': 'primary',
'Audio': 'success' 'audio': 'success'
}; };
return map[fileType] || 'info'; return map[fileType] || 'info';
}; };
@@ -178,11 +178,11 @@ const getBadgeSeverity = (fileType) => {
// File type icon mapping // File type icon mapping
const getFileIcon = (file) => { const getFileIcon = (file) => {
const map = { const map = {
'Image': 'pi-image', 'image': 'pi-image',
'PDF': 'pi-file-pdf', 'pdf': 'pi-file-pdf',
'Video': 'pi-video', 'video': 'pi-video',
'Document': 'pi-file', 'document': 'pi-file',
'Audio': 'pi-volume-up' 'audio': 'pi-volume-up'
}; };
return `pi ${map[file.fileType] || 'pi-file'}`; return `pi ${map[file.fileType] || 'pi-file'}`;
}; };
@@ -222,6 +222,13 @@ const formatFileSize = (bytes) => {
<small v-if="errors.title" class="p-error">{{ errors.title }}</small> <small v-if="errors.title" class="p-error">{{ errors.title }}</small>
</div> </div>
<!-- Price -->
<div class="col-span-2">
<label for="price" class="block text-sm font-medium text-gray-700 mb-1">价格 (¥)</label>
<InputNumber id="price" v-model="post.price" mode="currency" currency="CNY" :minFractionDigits="2"
class="w-full" />
</div>
<!-- Status --> <!-- Status -->
<div class="col-span-2"> <div class="col-span-2">
<label class="block text-sm font-medium text-gray-700 mb-1">状态</label> <label class="block text-sm font-medium text-gray-700 mb-1">状态</label>
@@ -234,12 +241,6 @@ const formatFileSize = (bytes) => {
</div> </div>
</div> </div>
<!-- Price -->
<div class="col-span-2">
<label for="price" class="block text-sm font-medium text-gray-700 mb-1">价格 (¥)</label>
<InputNumber id="price" v-model="post.price" mode="currency" currency="CNY" :minFractionDigits="2"
class="w-full" />
</div>
<!-- Introduction --> <!-- Introduction -->
<div class="col-span-2"> <div class="col-span-2">
@@ -255,7 +256,7 @@ const formatFileSize = (bytes) => {
<div class="p-4 border border-gray-200 rounded-md"> <div class="p-4 border border-gray-200 rounded-md">
<div v-if="post.selectedMedia.length === 0" <div v-if="post.selectedMedia.length === 0"
class="flex justify-center items-center flex-col space-y-3 py-6"> class="flex justify-center items-center flex-col space-y-3 py-6">
<i class="pi pi-image text-gray-400 text-3xl"></i> <i class="pi pi-image text-gray-400 text-5xl!"></i>
<p class="text-gray-500">尚未选择任何媒体文件</p> <p class="text-gray-500">尚未选择任何媒体文件</p>
<Button label="选择媒体" icon="pi pi-plus" @click="openMediaDialog" outlined /> <Button label="选择媒体" icon="pi pi-plus" @click="openMediaDialog" outlined />
<small v-if="errors.selectedMedia" class="p-error">{{ errors.selectedMedia }}</small> <small v-if="errors.selectedMedia" class="p-error">{{ errors.selectedMedia }}</small>