From 6c91fca4e77b1fee26d8f3f13114ec18225f0361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Wed, 25 May 2022 23:04:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=85=A5?= =?UTF-8?q?id=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContentEdit/components/EditTools/hooks/useFile.hooks.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/chart/ContentEdit/components/EditTools/hooks/useFile.hooks.ts b/src/views/chart/ContentEdit/components/EditTools/hooks/useFile.hooks.ts index 72606710..396863e6 100644 --- a/src/views/chart/ContentEdit/components/EditTools/hooks/useFile.hooks.ts +++ b/src/views/chart/ContentEdit/components/EditTools/hooks/useFile.hooks.ts @@ -6,7 +6,7 @@ import { CreateComponentType } from '@/packages/index.d' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { ChartEditStoreEnum } from '@/store/modules/chartEditStore/chartEditStore.d' import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore' -import { readFile, goDialog } from '@/utils' +import { getUUID, readFile, goDialog } from '@/utils' import { createComponent } from '@/packages' // 更新函数 @@ -40,14 +40,14 @@ const updateComponent = async (fileData: any, isSplace = false) => { ) // 不保存到记录 chartEditStore.addComponentList( - Object.assign(newComponent, comItem), + Object.assign(newComponent, { ...comItem, id: getUUID() }), false, true ) } } else { // 非组件(顺便排除脏数据) - if(key !== 'editCanvasConfig' && key !== 'requestGlobalConfig') return + if (key !== 'editCanvasConfig' && key !== 'requestGlobalConfig') return Object.assign((chartEditStore as any)[key], fileData[key]) } } From fcf8d9d99d4b82bcf259ab44572386ec72e310c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sat, 28 May 2022 00:40:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=E6=96=B0=E5=A2=9Eput=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/axios.ts | 2 -- src/api/http.ts | 34 +++++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/api/axios.ts b/src/api/axios.ts index 384ef3be..2e20ebd0 100644 --- a/src/api/axios.ts +++ b/src/api/axios.ts @@ -28,8 +28,6 @@ axiosInstance.interceptors.response.use( return Promise.resolve(res.data) }, (err: AxiosResponse) => { - const { code } = err.data as { code: number } - if (ErrorPageNameMap.get(code)) redirectErrorPage(code) window['$message'].error('接口异常,请检查!') Promise.reject(err) } diff --git a/src/api/http.ts b/src/api/http.ts index 13d69659..0e1fef82 100644 --- a/src/api/http.ts +++ b/src/api/http.ts @@ -19,6 +19,17 @@ export const post = (url: string, params: object, headersType?: string) => { }) } +export const put = (url: string, data?: object, headersType?: string) => { + return axiosInstance({ + url: url, + method: RequestHttpEnum.PUT, + data: data, + headers: { + 'Content-Type': headersType || ContentTypeEnum.JSON + } + }) +} + export const del = (url: string, params: object) => { return axiosInstance({ url: url, @@ -29,11 +40,20 @@ export const del = (url: string, params: object) => { // 获取请求函数,默认get export const http = (type?: RequestHttpEnum) => { - return type === RequestHttpEnum.GET - ? get - : type === RequestHttpEnum.POST - ? post - : type === RequestHttpEnum.DELETE - ? del - : get + switch (type) { + case RequestHttpEnum.GET: + return get + + case RequestHttpEnum.POST: + return post + + case RequestHttpEnum.PUT: + return put + + case RequestHttpEnum.DELETE: + return del + + default: + return get + } } From 0ec9fd8534d83e1f9b7d3e2dbb69af26729f42f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sat, 28 May 2022 12:43:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E6=A0=87=E7=82=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContentEdit/components/EditShapeBox/index.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/chart/ContentEdit/components/EditShapeBox/index.vue b/src/views/chart/ContentEdit/components/EditShapeBox/index.vue index f75b7008..d796dae5 100644 --- a/src/views/chart/ContentEdit/components/EditShapeBox/index.vue +++ b/src/views/chart/ContentEdit/components/EditShapeBox/index.vue @@ -3,7 +3,7 @@
{ .shape-point { z-index: 1; position: absolute; - width: 7px; - height: 7px; + width: 10px; + height: 10px; border: 3px solid v-bind('themeColor'); border-radius: 5px; background-color: #fff; transform: translate(-40%, -30%); + &.t, + &.b { + width: 30px; + } + &.l, + &.r { + height: 30px; + } } /* 选中 */ .shape-modal {