feat: 🚀 添加悬浮图上传
This commit is contained in:
@@ -73,7 +73,7 @@ const props = withDefaults(defineProps<UploadFileProps>(), {
|
|||||||
drag: true,
|
drag: true,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
fileSize: 5,
|
fileSize: 5,
|
||||||
fileType: () => ["image/jpeg", "image/png", "image/gif"],
|
fileType: () => ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
||||||
height: "150px",
|
height: "150px",
|
||||||
width: "150px",
|
width: "150px",
|
||||||
borderRadius: "8px"
|
borderRadius: "8px"
|
||||||
@@ -151,7 +151,9 @@ const editImg = () => {
|
|||||||
* @param rawFile 选择的文件
|
* @param rawFile 选择的文件
|
||||||
* */
|
* */
|
||||||
const beforeUpload: UploadProps["beforeUpload"] = rawFile => {
|
const beforeUpload: UploadProps["beforeUpload"] = rawFile => {
|
||||||
|
// console.log(rowFile.type, "=============1111111111");
|
||||||
const imgSize = rawFile.size / 1024 / 1024 < props.fileSize;
|
const imgSize = rawFile.size / 1024 / 1024 < props.fileSize;
|
||||||
|
|
||||||
const imgType = props.fileType.includes(rawFile.type as File.ImageMimeType);
|
const imgType = props.fileType.includes(rawFile.type as File.ImageMimeType);
|
||||||
|
|
||||||
if (!imgType)
|
if (!imgType)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const props = withDefaults(defineProps<UploadFileProps>(), {
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
limit: 9,
|
limit: 9,
|
||||||
fileSize: 5,
|
fileSize: 5,
|
||||||
fileType: () => ["image/jpeg", "image/png", "image/gif"],
|
fileType: () => ["image/jpeg", "image/png", "image/gif", "image/webp"],
|
||||||
height: "150px",
|
height: "150px",
|
||||||
width: "150px",
|
width: "150px",
|
||||||
borderRadius: "8px"
|
borderRadius: "8px"
|
||||||
|
|||||||
@@ -70,7 +70,11 @@ export const EDIT_FORM_DATA: FormItem[] = [
|
|||||||
type: "upImg",
|
type: "upImg",
|
||||||
label: "Banner图片: "
|
label: "Banner图片: "
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: "extra_image",
|
||||||
|
type: "upImg",
|
||||||
|
label: "悬浮图: "
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: "banner_id",
|
prop: "banner_id",
|
||||||
placeholder: "请选择",
|
placeholder: "请选择",
|
||||||
@@ -166,7 +170,11 @@ export const EDIT_FORM_DATA1: FormItem[] = [
|
|||||||
type: "upImg",
|
type: "upImg",
|
||||||
label: "Banner图片: "
|
label: "Banner图片: "
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// prop: "image1",
|
||||||
|
// type: "upImg",
|
||||||
|
// label: "Banner图片1: "
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
prop: "banner_id",
|
prop: "banner_id",
|
||||||
placeholder: "请选择",
|
placeholder: "请选择",
|
||||||
|
|||||||
Reference in New Issue
Block a user