fix(脑图): 导航器修复

--bug=1047036 --user=白奇 【测试计划】首次进入计划详情页,需要双击导航器图标才能打开预览图弹窗 https://www.tapd.cn/55049933/s/1584885
This commit is contained in:
baiqi 2024-09-24 15:38:01 +08:00 committed by 刘瑞斌
parent f9336890e8
commit b54e2d4660
1 changed files with 5 additions and 11 deletions

View File

@ -151,7 +151,7 @@
import { useI18n } from '@/hooks/useI18n';
import { navigatorProps } from '../props';
import { getLocalStorage, setLocalStorage } from '../script/store';
import { setLocalStorage } from '../script/store';
import type { Ref } from 'vue';
const props = defineProps(navigatorProps);
@ -160,7 +160,7 @@
const navPreviewer: Ref<HTMLDivElement | null> = ref(null);
const isNavOpen = ref(false);
const isNavOpen = ref(window.localStorage.getItem('navigator-hidden') || false);
const previewNavigator: Ref<HTMLDivElement | null> = ref(null);
const contentView = ref('');
@ -171,11 +171,6 @@
let paper = reactive<any>({});
let minder = reactive<any>({});
//
function getNavOpenState() {
return getLocalStorage('navigator-hidden');
}
const zoomPercent = ref(50); // 100% 50% 50
/**
* 缩放
@ -291,13 +286,11 @@
}
function toggleNavOpen() {
let isNavOpenState = false;
isNavOpenState = !JSON.parse(getNavOpenState());
isNavOpen.value = isNavOpenState;
isNavOpen.value = !isNavOpen.value;
setLocalStorage('navigator-hidden', isNavOpen.value);
nextTick(() => {
if (isNavOpenState) {
if (isNavOpen.value) {
bind();
updateContentView();
updateVisibleView();
@ -306,6 +299,7 @@
}
});
}
function navigate() {
function moveView(center: Record<string, any>, duration?: number) {
if (!minder.getPaper || !visibleView.width || !visibleView.height) return;