From a7c7356d1f0a7a668520f91cdd368a4addff9538 Mon Sep 17 00:00:00 2001 From: pengjian Date: Mon, 30 Jan 2023 17:37:56 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=BD=AE=E6=92=AD=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E8=BD=AE?= =?UTF-8?q?=E6=92=AD=E6=96=B9=E5=BC=8F=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Tables/Tables/TableScrollBoard/config.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/packages/components/Tables/Tables/TableScrollBoard/config.vue b/src/packages/components/Tables/Tables/TableScrollBoard/config.vue index 834cfb5b..1aec6363 100644 --- a/src/packages/components/Tables/Tables/TableScrollBoard/config.vue +++ b/src/packages/components/Tables/Tables/TableScrollBoard/config.vue @@ -40,6 +40,15 @@ + + + From c40d922ddb3c23567fb6095dbc1841379dc313c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=94=E5=90=AC=E9=A3=8E=E5=90=9F720?= Date: Thu, 2 Feb 2023 09:34:50 +0000 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=EF=BC=8C=E5=8F=B3=E4=BE=A7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=85=8D=E7=BD=AE=E5=86=85=E5=AE=B9=E8=A2=AB=E6=8C=A4?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 且听风吟720 --- src/views/chart/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/chart/index.vue b/src/views/chart/index.vue index 89c60d95..856ddea2 100644 --- a/src/views/chart/index.vue +++ b/src/views/chart/index.vue @@ -14,8 +14,10 @@ - - +
+ + +
From 68b8809a1e0d4d513a71ae1c56a7344fb95dfa16 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: Thu, 2 Feb 2023 20:54:02 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=87=BD=E6=95=B0=EF=BC=8C=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E9=94=99=E8=AF=AF=E6=8D=95=E8=8E=B7=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 6 ++++-- src/plugins/index.ts | 1 + src/plugins/initFunction.ts | 9 +++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src/plugins/initFunction.ts diff --git a/src/main.ts b/src/main.ts index cf9b86df..d85d46cb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,7 +3,7 @@ import App from './App.vue' import router, { setupRouter } from '@/router' import i18n from '@/i18n/index' import { setupStore } from '@/store' -import { setupNaive, setupDirectives, setupCustomComponents } from '@/plugins' +import { setupNaive, setupDirectives, setupCustomComponents, initFunction } from '@/plugins' import { GoAppProvider } from '@/components/GoAppProvider/index' import { setHtmlTheme } from '@/utils' @@ -53,4 +53,6 @@ async function appInit() { window['$vue'] = app } -void appInit() +await appInit() + +await initFunction() diff --git a/src/plugins/index.ts b/src/plugins/index.ts index c500f63a..d1ac07ba 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -2,3 +2,4 @@ export { setupNaive } from '@/plugins/naive' export { setupDirectives } from '@/plugins/directives' export { setupCustomComponents } from '@/plugins/customComponents' export { icon } from '@/plugins/icon' +export { initFunction } from '@/plugins/initFunction' diff --git a/src/plugins/initFunction.ts b/src/plugins/initFunction.ts new file mode 100644 index 00000000..1df1db45 --- /dev/null +++ b/src/plugins/initFunction.ts @@ -0,0 +1,9 @@ +/** + * * 页面初始化就执行的函数 + */ +export const initFunction = async () => { + // 捕获全局错误 + window.addEventListener("unhandledrejection", event => { + console.warn(`UNHANDLED PROMISE REJECTION: ${event.reason}`); + }); +} \ No newline at end of file From d774a52c4fc03a47094ef38823d9d591949e8646 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, 8 Feb 2023 16:38:38 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8C=96=E9=81=97=E6=BC=8F=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/storage.ts b/src/utils/storage.ts index 5b9f6922..5804ae8d 100644 --- a/src/utils/storage.ts +++ b/src/utils/storage.ts @@ -44,7 +44,7 @@ export const clearLocalStorage = (name: string) => { */ export const setSessionStorage = (k: string, v: T) => { try { - window.sessionStorage.setItem(k, JSON.stringify(v)) + window.sessionStorage.setItem(k, JSONStringify(v)) } catch (error) { return false } From dea849cfdb46de6cd290ccfce6de4463e1307a8d 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: Thu, 9 Feb 2023 11:29:23 +0800 Subject: [PATCH 5/5] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E4=BD=93=E9=AA=8C=EF=BC=8C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Charts/Bars/CapsuleChart/index.vue | 25 +++++++++++-------- .../ChartDataMonacoEditor/index.vue | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/packages/components/Charts/Bars/CapsuleChart/index.vue b/src/packages/components/Charts/Bars/CapsuleChart/index.vue index 804ae0dc..73a6ae0d 100644 --- a/src/packages/components/Charts/Bars/CapsuleChart/index.vue +++ b/src/packages/components/Charts/Bars/CapsuleChart/index.vue @@ -122,23 +122,28 @@ const calcData = (data: any, type?: string) => { // 数据解析 const calcCapsuleLengthAndLabelData = (dataset: any) => { - const { source } = dataset - if (!source.length) return + try { + const { source } = dataset + if (!source || !source.length) return - state.capsuleItemHeight = numberSizeHandle(state.mergedConfig.itemHeight) - const capsuleValue = source.map((item: DataProps) => item[state.mergedConfig.dataset.dimensions[1]]) + state.capsuleItemHeight = numberSizeHandle(state.mergedConfig.itemHeight) + const capsuleValue = source.map((item: DataProps) => item[state.mergedConfig.dataset.dimensions[1]]) - const maxValue = Math.max(...capsuleValue) + const maxValue = Math.max(...capsuleValue) - state.capsuleValue = capsuleValue + state.capsuleValue = capsuleValue - state.capsuleLength = capsuleValue.map((v: any) => (maxValue ? v / maxValue : 0)) + state.capsuleLength = capsuleValue.map((v: any) => (maxValue ? v / maxValue : 0)) - const oneFifth = maxValue / 5 + const oneFifth = maxValue / 5 - const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth)))) + const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth)))) - state.labelData = labelData + state.labelData = labelData + + } catch (error) { + console.warn(error); + } } const numberSizeHandle = (val: string | number) => { diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue index a0078f15..205f3328 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataMonacoEditor/index.vue @@ -150,7 +150,7 @@ const filterRes = computed(() => { } catch (error) { // eslint-disable-next-line vue/no-side-effects-in-computed-properties errorFlag.value = true - return '过滤函数错误' + return `过滤函数错误,日志:${error}` } })