+
+
@@ -82,45 +67,6 @@ const { menus } = store.state;
const route = useRoute();
const backgroundColor = ref('#000');
-const windowSize = JSON.parse(localStorage.getItem('windowSize') || '{}');
-const mainWidth = ref(windowSize.width || document.documentElement.clientWidth * 0.8); // 初始宽度
-const mainHeight = ref(windowSize.height || document.documentElement.clientHeight * 0.85); // 初始高度
-let isResizing = false;
-
-const startResize = (direction: string, event: MouseEvent) => {
- if (isElectron.value) return;
- isResizing = true;
- document.body.style.cursor =
- direction === 'right' ? 'ew-resize' : direction === 'bottom' ? 'ns-resize' : 'nwse-resize';
- const startX = event.clientX;
- const startY = event.clientY;
- const startWidth = mainWidth.value;
- const startHeight = mainHeight.value;
-
- const doResize = (moveEvent: MouseEvent) => {
- if (!isResizing) return;
- requestAnimationFrame(() => {
- if (direction === 'right' || direction === 'corner') {
- mainWidth.value = Math.max(300, startWidth + (moveEvent.clientX - startX)); // 设置最小宽度
- }
- if (direction === 'bottom' || direction === 'corner') {
- mainHeight.value = Math.max(200, startHeight + (moveEvent.clientY - startY)); // 设置最小高度
- }
-
- localStorage.setItem('windowSize', JSON.stringify({ width: mainWidth.value, height: mainHeight.value }));
- });
- };
-
- const stopResize = () => {
- isResizing = false;
- document.body.style.cursor = 'default'; // 恢复鼠标样式
- window.removeEventListener('mousemove', doResize);
- window.removeEventListener('mouseup', stopResize);
- };
-
- window.addEventListener('mousemove', doResize);
- window.addEventListener('mouseup', stopResize);
-};