fix: bug#10561

This commit is contained in:
JiangQiming 2023-03-20 17:36:33 +08:00
parent 48b6bbc0a7
commit c08f29d4da
2 changed files with 13 additions and 6 deletions

View File

@ -12,10 +12,14 @@
</j-empty> </j-empty>
<template v-else> <template v-else>
<j-tabs v-model:activeKey="activeKey"> <j-tabs v-model:activeKey="activeKey">
<j-tab-pane key="Simple" tab="精简模式" /> <j-tab-pane key="Simple" tab="精简模式">
<j-tab-pane key="Advance" tab="高级模式" /> <Simple />
</j-tab-pane>
<j-tab-pane key="Advance" tab="高级模式">
<Advance />
</j-tab-pane>
</j-tabs> </j-tabs>
<component :is="tabs[activeKey]" /> <!-- <component :is="tabs[activeKey]" /> -->
</template> </template>
</j-card> </j-card>
</template> </template>

View File

@ -406,13 +406,16 @@ const uploader: uploaderType = {
'image/pjp', 'image/pjp',
'image/pjpeg', 'image/pjpeg',
], ],
// imageTypes: ['.jpg','.png','.jfif','.pjp','.pjpeg','.jpeg'],
iconTypes: ['image/x-icon'], iconTypes: ['image/x-icon'],
// logo // logo
beforeLogoUpload: ({ size, type }: File) => { // beforeLogoUpload: ({ size, type }: File) => {
beforeLogoUpload: (file: File) => {
console.log('file: ', file);
const typeBool = const typeBool =
uploader.imageTypes.filter((typeStr) => type.includes(typeStr)) uploader.imageTypes.filter((typeStr) => file.type.includes(typeStr))
.length > 0; .length > 0;
const sizeBool = size / 1024 / 1024 < 4; const sizeBool = file.size / 1024 / 1024 < 4;
if (!typeBool) { if (!typeBool) {
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`); message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);
} else if (!sizeBool) { } else if (!sizeBool) {