Commit 08895bc13ce4031c6dc5be3f6e4a4cdc200b0247
Merge branch 'fix/DEFECT-1599' into 'main_dev'
fix: 修复上传部分表单上传图片约束类型 See merge request yunteng/thingskit-front!888
Showing
6 changed files
with
6 additions
and
0 deletions
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | <template #iconSelect> | 11 | <template #iconSelect> |
| 12 | <Upload | 12 | <Upload |
| 13 | name="avatar" | 13 | name="avatar" |
| 14 | + accept=".png,.jpg,.jpeg,.gif" | ||
| 14 | list-type="picture-card" | 15 | list-type="picture-card" |
| 15 | class="avatar-uploader" | 16 | class="avatar-uploader" |
| 16 | :show-upload-list="false" | 17 | :show-upload-list="false" |
| @@ -93,6 +93,7 @@ export const formSchema: FormSchema[] = [ | @@ -93,6 +93,7 @@ export const formSchema: FormSchema[] = [ | ||
| 93 | return { | 93 | return { |
| 94 | listType: 'picture-card', | 94 | listType: 'picture-card', |
| 95 | maxFileLimit: 1, | 95 | maxFileLimit: 1, |
| 96 | + accept: '.png,.jpg,.jpeg,.gif', | ||
| 96 | api: async (file: File) => { | 97 | api: async (file: File) => { |
| 97 | try { | 98 | try { |
| 98 | const formData = new FormData(); | 99 | const formData = new FormData(); |
| @@ -59,6 +59,7 @@ export const formSchema: FormSchema[] = [ | @@ -59,6 +59,7 @@ export const formSchema: FormSchema[] = [ | ||
| 59 | return { | 59 | return { |
| 60 | listType: 'picture-card', | 60 | listType: 'picture-card', |
| 61 | maxFileLimit: 1, | 61 | maxFileLimit: 1, |
| 62 | + accept: '.png,.jpg,.jpeg,.gif', | ||
| 62 | api: async (file: File) => { | 63 | api: async (file: File) => { |
| 63 | try { | 64 | try { |
| 64 | const formData = new FormData(); | 65 | const formData = new FormData(); |
| @@ -25,6 +25,7 @@ | @@ -25,6 +25,7 @@ | ||
| 25 | <template #iconSelect> | 25 | <template #iconSelect> |
| 26 | <Upload | 26 | <Upload |
| 27 | name="avatar" | 27 | name="avatar" |
| 28 | + accept=".png,.jpg,.jpeg,.gif" | ||
| 28 | :show-upload-list="false" | 29 | :show-upload-list="false" |
| 29 | list-type="picture-card" | 30 | list-type="picture-card" |
| 30 | class="avatar-uploader" | 31 | class="avatar-uploader" |
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | <Upload | 5 | <Upload |
| 6 | style="width: 20vw" | 6 | style="width: 20vw" |
| 7 | name="avatar" | 7 | name="avatar" |
| 8 | + accept=".png,.jpg,.jpeg,.gif" | ||
| 8 | list-type="picture-card" | 9 | list-type="picture-card" |
| 9 | class="avatar-uploader" | 10 | class="avatar-uploader" |
| 10 | :show-upload-list="false" | 11 | :show-upload-list="false" |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | <template #iconSelect> | 11 | <template #iconSelect> |
| 12 | <Upload | 12 | <Upload |
| 13 | name="avatar" | 13 | name="avatar" |
| 14 | + accept=".png,.jpg,.jpeg,.gif" | ||
| 14 | list-type="picture-card" | 15 | list-type="picture-card" |
| 15 | class="avatar-uploader" | 16 | class="avatar-uploader" |
| 16 | :show-upload-list="false" | 17 | :show-upload-list="false" |