refactor: 修改oss对应的上传代码
This commit is contained in:
parent
b78b599a06
commit
f4a88efb0f
@ -1,10 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import { Alert } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { FileUpload } from '#/components/upload';
|
import { FileUpload } from '#/components/upload';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
@ -23,13 +21,6 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const accept = ref(['xlsx', 'word', 'pdf']);
|
|
||||||
const maxNumber = ref(3);
|
|
||||||
|
|
||||||
const message = computed(() => {
|
|
||||||
return `支持 [${accept.value.join(', ')}] 格式,最多上传 ${maxNumber.value} 个文件`;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -40,13 +31,7 @@ const message = computed(() => {
|
|||||||
title="文件上传"
|
title="文件上传"
|
||||||
>
|
>
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<Alert :message="message" show-icon type="info">aaa</Alert>
|
<FileUpload v-model:value="fileList" :enable-drag-upload="true" />
|
||||||
<FileUpload
|
|
||||||
v-model:value="fileList"
|
|
||||||
:accept="accept"
|
|
||||||
:max-number="maxNumber"
|
|
||||||
:max-size="5"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import { Alert } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { ImageUpload } from '#/components/upload';
|
import { ImageUpload } from '#/components/upload';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
@ -23,13 +21,6 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const accept = ref(['jpg', 'jpeg', 'png', 'gif', 'webp']);
|
|
||||||
const maxNumber = ref(3);
|
|
||||||
|
|
||||||
const message = computed(() => {
|
|
||||||
return `支持 [${accept.value.join(', ')}] 格式,最多上传 ${maxNumber.value} 张图片`;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -40,12 +31,7 @@ const message = computed(() => {
|
|||||||
title="图片上传"
|
title="图片上传"
|
||||||
>
|
>
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<Alert :message="message" show-icon type="info">aaa</Alert>
|
<ImageUpload v-model:value="fileList" />
|
||||||
<ImageUpload
|
|
||||||
v-model:value="fileList"
|
|
||||||
:accept="accept"
|
|
||||||
:max-number="maxNumber"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user