From 4aff4858166cf40b5a9e68f9923ad2414ccd9823 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, 7 Apr 2022 15:28:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/utils.ts | 5 +++-- src/views/chart/HeaderRightBtn/index.vue | 4 ++++ src/views/chart/hooks/useKeyboard.hook.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 62f74ca5..e8db216c 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -141,12 +141,13 @@ export const addEventListener = ( target: HTMLElement | Document, type: K, listener: any, + delay?: number, options?: boolean | AddEventListenerOptions | undefined ) => { if (!target) return target.addEventListener( type, - throttle(listener, 300, { + throttle(listener, delay || 300, { leading: true, trailing: false, }), @@ -167,7 +168,7 @@ export const removeEventListener = ( } /** - * * 截取画面为图片 + * * 截取画面为图片并下载 * @param html 需要截取的 DOM */ export const canvasCut = (html: HTMLElement | null, callback?: Function) => { diff --git a/src/views/chart/HeaderRightBtn/index.vue b/src/views/chart/HeaderRightBtn/index.vue index 15928c9c..db13dd65 100644 --- a/src/views/chart/HeaderRightBtn/index.vue +++ b/src/views/chart/HeaderRightBtn/index.vue @@ -54,6 +54,9 @@ const previewHandle = () => { routerTurnByPath(path, [previewId], undefined, true) } +// 导入 +const importHandle = () => {} + // 导出 const exportHandle = () => { // 导出数据 @@ -115,6 +118,7 @@ const btnList = shallowReactive([ event: sendHandle } ]) +