From dad0bf4444a697a42671069747d821be05d108d1 Mon Sep 17 00:00:00 2001 From: JaguarJack <82664165@qq.com> Date: Wed, 24 Apr 2024 22:12:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=20catch=20form=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=BB=98=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/components/catchForm/components/Tree/Tree.vue | 4 ++-- .../catchForm/components/UploadFile/UploadFile.vue | 7 ++++--- .../catchForm/components/UploadFiles/UploadFiles.vue | 4 +++- .../catchForm/components/UploadImage/UploadImage.vue | 8 +++----- .../catchForm/components/UploadImages/UploadImages.vue | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/resources/admin/components/catchForm/components/Tree/Tree.vue b/resources/admin/components/catchForm/components/Tree/Tree.vue index 5997c37..17e53bf 100644 --- a/resources/admin/components/catchForm/components/Tree/Tree.vue +++ b/resources/admin/components/catchForm/components/Tree/Tree.vue @@ -18,7 +18,7 @@ import { $global} from '/admin/components/catchForm/config/symbol' const tree = ref() const modelValue = defineModel() const currentCheckedKeys = ref|Array|string|number>([]) -const data = ref([]) +const data = ref([]) const { http } = inject($global) const props = defineProps({ @@ -49,7 +49,7 @@ const props = defineProps({ }) if (props.api) { - http.get(props.api).then(r => { + http.get(props.api).then((r:any) => { data.value = r.data.data }) } else { diff --git a/resources/admin/components/catchForm/components/UploadFile/UploadFile.vue b/resources/admin/components/catchForm/components/UploadFile/UploadFile.vue index 70ddb12..eec9d7d 100644 --- a/resources/admin/components/catchForm/components/UploadFile/UploadFile.vue +++ b/resources/admin/components/catchForm/components/UploadFile/UploadFile.vue @@ -3,8 +3,7 @@ import { watch } from 'vue' import { uploadFile } from '/admin/composables/upload' const props = defineProps({ action: { - type: String, - required: true + type: String }, name: { type: String, @@ -29,7 +28,9 @@ const props = defineProps({ }, ext: { type: Array, - required: true + default: () => { + return ['docx', 'pdf', 'txt', 'html', 'zip', 'tar', 'doc', 'css', 'csv', 'ppt', 'xlsx', 'xls', 'xml'] + } } }) diff --git a/resources/admin/components/catchForm/components/UploadFiles/UploadFiles.vue b/resources/admin/components/catchForm/components/UploadFiles/UploadFiles.vue index 156c5a6..5b67763 100644 --- a/resources/admin/components/catchForm/components/UploadFiles/UploadFiles.vue +++ b/resources/admin/components/catchForm/components/UploadFiles/UploadFiles.vue @@ -32,7 +32,9 @@ const props = defineProps({ }, ext: { type: Array, - required: true + default: () => { + return ['docx', 'pdf', 'txt', 'html', 'zip', 'tar', 'doc', 'css', 'csv', 'ppt', 'xlsx', 'xls', 'xml'] + } } }) diff --git a/resources/admin/components/catchForm/components/UploadImage/UploadImage.vue b/resources/admin/components/catchForm/components/UploadImage/UploadImage.vue index 9ad3022..70e371a 100644 --- a/resources/admin/components/catchForm/components/UploadImage/UploadImage.vue +++ b/resources/admin/components/catchForm/components/UploadImage/UploadImage.vue @@ -26,8 +26,7 @@ import { Plus } from '@element-plus/icons-vue' const props = defineProps({ action: { - type: String, - required: true + type: String }, name: { type: String, @@ -47,12 +46,11 @@ const props = defineProps({ default: 'Dashboard' }, token:{ - type: String, - required: true + type: String }, ext: { type: Array, - required: true + default: () => ['jpg', 'jpeg', 'png', 'bmp', 'gif'] } }) diff --git a/resources/admin/components/catchForm/components/UploadImages/UploadImages.vue b/resources/admin/components/catchForm/components/UploadImages/UploadImages.vue index 3e1c5ac..057205f 100644 --- a/resources/admin/components/catchForm/components/UploadImages/UploadImages.vue +++ b/resources/admin/components/catchForm/components/UploadImages/UploadImages.vue @@ -64,7 +64,7 @@ const props = defineProps({ }, ext: { type: Array, - required: true + default: () => ['jpg', 'jpeg', 'png', 'bmp', 'gif'] } })