From 7975c7bdd7fc06f954cdf6bfe263f839d5dee33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Fri, 27 Jun 2025 09:34:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enterpriseKnowledge/brandMaterials.less | 8 ++++++++ .../enterpriseKnowledge/brandMaterials.vue | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/property-marketing/enterpriseKnowledge/brandMaterials.less b/src/views/property-marketing/enterpriseKnowledge/brandMaterials.less index 23e6a7c..26aec80 100644 --- a/src/views/property-marketing/enterpriseKnowledge/brandMaterials.less +++ b/src/views/property-marketing/enterpriseKnowledge/brandMaterials.less @@ -56,12 +56,14 @@ margin: 20px 20px; } + //添加按钮 .add-btn { font-size: 16px; padding: 0 24px; border-radius: 4px; } + //分页 .materials-page { background: #fff; border-radius: 8px; @@ -179,4 +181,10 @@ .a-modal .a-modal-footer { justify-content: flex-end; } + + //弹窗样式 + .a-modal-title { + position: absolute; + left: 10px; + } } diff --git a/src/views/property-marketing/enterpriseKnowledge/brandMaterials.vue b/src/views/property-marketing/enterpriseKnowledge/brandMaterials.vue index 3beb3aa..5c541d9 100644 --- a/src/views/property-marketing/enterpriseKnowledge/brandMaterials.vue +++ b/src/views/property-marketing/enterpriseKnowledge/brandMaterials.vue @@ -87,7 +87,7 @@ @cancel="handleModalCancel" > Date: Fri, 27 Jun 2025 16:26:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=8A=95?= =?UTF-8?q?=E6=94=BE=E6=8C=87=E5=8D=97=E7=BB=84=E4=BB=B6=E5=92=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=93=81=E7=89=8C=E7=89=A9=E6=96=99=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/upload/ImageUpload.vue | 65 +- .../routes/modules/propertyMarketing.ts | 4 +- .../index.vue} | 144 +++-- .../style.scss} | 52 +- .../action-guide-distribution/index.vue | 233 ++++++++ .../action-guide-distribution/style.scss | 0 .../components/month-data/index.vue | 35 ++ .../components/month-data/style.scss | 0 .../placement-suggestions/index.vue | 73 +++ .../placement-suggestions/style.scss | 0 .../table-data/guideListHistory.vue | 117 ++++ .../components/table-data/listSearchForm.vue | 98 +++ .../table-data/placementGuideList.vue | 217 +++++++ .../investment-guidelines/index.vue | 71 +++ .../investment-guidelines/style.scss | 196 ++++++ .../put-account/investmentGuidelines.less | 198 ------- .../put-account/investmentGuidelines.vue | 560 ------------------ 17 files changed, 1167 insertions(+), 896 deletions(-) rename src/views/property-marketing/enterpriseKnowledge/{brandMaterials.vue => brand-materials/index.vue} (60%) rename src/views/property-marketing/enterpriseKnowledge/{brandMaterials.less => brand-materials/style.scss} (83%) create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/action-guide-distribution/index.vue create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/action-guide-distribution/style.scss create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/month-data/index.vue create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/month-data/style.scss create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/placement-suggestions/index.vue create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/placement-suggestions/style.scss create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/table-data/guideListHistory.vue create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/table-data/listSearchForm.vue create mode 100644 src/views/property-marketing/put-account/investment-guidelines/components/table-data/placementGuideList.vue create mode 100644 src/views/property-marketing/put-account/investment-guidelines/index.vue create mode 100644 src/views/property-marketing/put-account/investment-guidelines/style.scss delete mode 100644 src/views/property-marketing/put-account/investmentGuidelines.less delete mode 100644 src/views/property-marketing/put-account/investmentGuidelines.vue diff --git a/src/components/upload/ImageUpload.vue b/src/components/upload/ImageUpload.vue index 450ac52..0054575 100644 --- a/src/components/upload/ImageUpload.vue +++ b/src/components/upload/ImageUpload.vue @@ -107,54 +107,27 @@ const handleError = (error) => { console.error(error); }; -const customRequest = (option) => { +const customRequest = async (option) => { const { onProgress, onError, onSuccess, fileItem, name } = option; - const xhr = new XMLHttpRequest(); - if (xhr.upload) { - xhr.upload.onprogress = function (event) { - let percent; - if (event.total > 0) { - // 0 ~ 1 - percent = event.loaded / event.total; - } - onProgress(percent, event); - }; - } - xhr.onerror = function error(e) { - onError(e); - }; - xhr.onload = function onload() { - if (xhr.status < 200 || xhr.status >= 300) { - return onError(xhr.responseText); - } - let response = JSON.parse(xhr.response); - if (response && response.data.upload_url) { - const blob = new Blob([fileItem.file], { type: fileItem.file.type }); - axios - .put(response.data.upload_url, blob, { - headers: { 'Content-Type': fileItem.file.type }, - }) - .then(() => { - onSuccess(xhr.response); - }) - .catch((error) => { - onError(error); - }); - } else { - onError(xhr.response); - } - }; + try { + // 1. 获取预签名上传URL + const response = await fetchImageUploadFile({ suffix: getFileExtension(fileItem.file.name) }); + const preSignedUrl = response?.data?.upload_url; - const formData = new FormData(); - formData.append(name || 'file', fileItem.file); - xhr.open('get', '/api/v1/oss/image-pre-signed-url?suffix=png', true); - xhr.send(formData); - let extension = getFileExtension(fileItem.file.name); - return { - abort() { - xhr.abort(); - }, - }; + if (!preSignedUrl) { + throw new Error('未能获取有效的预签名上传地址'); + } + console.log('preSignedUrl', preSignedUrl); + // 2. 使用预签名URL上传文件 + const blob = new Blob([fileItem.file], { type: fileItem.file.type }); + await axios.put(preSignedUrl, blob, { + headers: { 'Content-Type': fileItem.file.type }, + }); + + onSuccess(JSON.stringify(response)); + } catch (error) { + onError(error); + } }; function getFileExtension(filename: string): string { diff --git a/src/router/routes/modules/propertyMarketing.ts b/src/router/routes/modules/propertyMarketing.ts index 33e6b63..affcb1e 100644 --- a/src/router/routes/modules/propertyMarketing.ts +++ b/src/router/routes/modules/propertyMarketing.ts @@ -28,7 +28,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ requiresAuth: true, roles: ['*'], }, - component: () => import('@/views/property-marketing/enterpriseKnowledge/brandMaterials.vue'), + component: () => import('@/views/property-marketing/enterpriseKnowledge/brand-materials/index.vue'), }, ], }, @@ -128,7 +128,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ requiresAuth: true, roles: ['*'], }, - component: () => import('@/views/property-marketing/put-account/investmentGuidelines'), + component: () => import('@/views/property-marketing/put-account/investment-guidelines'), }, ], }, diff --git a/src/views/property-marketing/enterpriseKnowledge/brandMaterials.vue b/src/views/property-marketing/enterpriseKnowledge/brand-materials/index.vue similarity index 60% rename from src/views/property-marketing/enterpriseKnowledge/brandMaterials.vue rename to src/views/property-marketing/enterpriseKnowledge/brand-materials/index.vue index 5c541d9..0913a1a 100644 --- a/src/views/property-marketing/enterpriseKnowledge/brandMaterials.vue +++ b/src/views/property-marketing/enterpriseKnowledge/brand-materials/index.vue @@ -1,53 +1,44 @@