From 94e0fb8cedd704db471972fb890b0b66bd8c988c Mon Sep 17 00:00:00 2001 From: 13218645326 Date: Fri, 8 Dec 2023 18:46:09 +0800 Subject: [PATCH 1/2] no message --- src/components/uploadComponent/index.vue | 31 +++++++++++++++--------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/uploadComponent/index.vue b/src/components/uploadComponent/index.vue index bf30694..fd26d14 100644 --- a/src/components/uploadComponent/index.vue +++ b/src/components/uploadComponent/index.vue @@ -2,7 +2,7 @@
- +
+ + +
@@ -31,13 +34,15 @@ import { ref, nextTick } from 'vue' import { ElMessage } from 'element-plus' import { Base64 } from 'js-base64' - import {apiUpload} from "http/api/myInfo" + const tmpUploadUrl = import.meta.env.VITE_API_URL +"/zlpt-file/file/cos/upload" + console.log("tmpUploadUrl",tmpUploadUrl) + const actionUrl = ref(tmpUploadUrl) const props = defineProps({ - actionUrl: { - //上传的地址 - type: String, - default: "" - }, + // actionUrl: { + // //上传的地址 + // type: String, + // default: "" + // }, width: { //上传的地址 type: String, @@ -165,6 +170,7 @@ }) } const beforeUpload = (file:any) => { + console.log("file",file) const { name = '', size } = file if (size > props.maxSize * 1024 * 1000) { ElMessage({ @@ -173,11 +179,14 @@ }) return false } - - if (!props.acceptTypeList.includes(name.split('.').pop()) + '.') { + let names = name.split(".") + let currentName = names[names.length-1] + console.log("acceptTypeListacceptTypeList",props.acceptTypeList,currentName) + console.log("name.split().pop()",) + if (!props.acceptTypeList.includes( '.'+currentName) ) { ElMessage({ type: 'warning', - message: `文件格式仅支持${props.acceptTypeList.join(',')}M` + message: `文件格式仅支持${props.acceptTypeList.join(',')}` }) return false } From 046b292316c6c3f368283620b9b6b0265ab67643 Mon Sep 17 00:00:00 2001 From: 13218645326 Date: Fri, 8 Dec 2023 19:56:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 18 ++++++++++++++++++ env/.env.dev | 3 +-- env/.env.serve1 | 2 ++ env/.env.sit | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/components.d.ts b/components.d.ts index 7f1699f..02bd1a8 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,17 +10,35 @@ declare module 'vue' { ElButton: typeof import('element-plus/es')['ElButton'] ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] + ElCascader: typeof import('element-plus/es')['ElCascader'] + ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] + ElCol: typeof import('element-plus/es')['ElCol'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] + ElDialog: typeof import('element-plus/es')['ElDialog'] + ElDivider: typeof import('element-plus/es')['ElDivider'] + ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] + ElIcon: typeof import('element-plus/es')['ElIcon'] ElImage: typeof import('element-plus/es')['ElImage'] ElInput: typeof import('element-plus/es')['ElInput'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] + ElOption: typeof import('element-plus/es')['ElOption'] + ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] + ElProgress: typeof import('element-plus/es')['ElProgress'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] + ElRow: typeof import('element-plus/es')['ElRow'] + ElSelect: typeof import('element-plus/es')['ElSelect'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] + ElTag: typeof import('element-plus/es')['ElTag'] + ElTimeline: typeof import('element-plus/es')['ElTimeline'] + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] + ElUpload: typeof import('element-plus/es')['ElUpload'] EquipCard: typeof import('./src/components/equipCard.vue')['default'] EquipDetailTable: typeof import('./src/components/equipDetailTable.vue')['default'] FooterInfo: typeof import('./src/components/FooterInfo/index.vue')['default'] diff --git a/env/.env.dev b/env/.env.dev index cae1be7..6a4c522 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -13,7 +13,6 @@ VITE_proxyTarget = 'http://10.40.92.74:8080' #盛旭 # VITE_proxyTarget = 'http://10.40.92.253:8080' # 牛 (个人中心 基础信息企业申请认证) -VITE_UPLOAD_URL='apiUpload - + diff --git a/env/.env.serve1 b/env/.env.serve1 index bafb909..75c8e19 100644 --- a/env/.env.serve1 +++ b/env/.env.serve1 @@ -16,3 +16,5 @@ VITE_LocalFlag = 0 + + diff --git a/env/.env.sit b/env/.env.sit index 71559b1..827c0dc 100644 --- a/env/.env.sit +++ b/env/.env.sit @@ -3,4 +3,4 @@ VITE_ENV = 'production' VITE_BUILD_MODE = 'sit' # 线上环境接口地址 -VITE_API_URL = 'http://192.168.1.3:10086' \ No newline at end of file +VITE_API_URL = 'http://112.29.103.165:1619/zlpt/' \ No newline at end of file