From 911a9fbe2f809049a25311fd55682ffe170658c1 Mon Sep 17 00:00:00 2001 From: xudan Date: Mon, 15 Sep 2025 15:50:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=8A=98=E5=8F=A0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E5=B8=83=E5=B1=80=E5=92=8C=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BB=A5=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7=E4=BD=93?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 1 + src/assets/icons/png/expand.png | Bin 0 -> 597 bytes src/assets/icons/png/fold.png | Bin 0 -> 597 bytes src/pages/movement-supervision.vue | 52 +++++++++++++++++++++++++--- src/pages/scene-editor.vue | 53 ++++++++++++++++++++++++++--- 5 files changed, 96 insertions(+), 10 deletions(-) create mode 100644 src/assets/icons/png/expand.png create mode 100644 src/assets/icons/png/fold.png diff --git a/AGENTS.md b/AGENTS.md index daabfa0..a8eec6a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1 +1,2 @@ -Always reply to me in Chinese +文件编码使用 UTF‑8 diff --git a/src/assets/icons/png/expand.png b/src/assets/icons/png/expand.png new file mode 100644 index 0000000000000000000000000000000000000000..942ec0846ac34402ee70eaeb9f58dd99bcd26bac GIT binary patch literal 597 zcmV-b0;>IqP)_ut6yM~f~D-Qz6nMq7;5ty9G&5^`sawbJ0 zw{mi3WJj*Ue9-wqoVzn#wVr|)=*+ot7jqJXq=PfEVaZr(Ym~W*X^@?taLBTopUw)u z+hW|r+OZ+pB9GHLurjPbqfZi}v7_(cmj%?y=rfT% zxW^z6qXK;f8S37P4F)DC1|f;rV2nY!Y!y^uWNA{*LD=;ibd&uE+&v5ynWh|CW6!yF zdb^-TQawi1N7@{_a7Kj?g5WVUj13zq<_=S@eb~2X^hsijKoF&(Gd2*zVOIqP)aMX_7&FSM)!3H{{R!^@G=a;dDuyZM)!N@E6GOp$3VBB^JJOpZir z<-d!JS8Q(y&A*VYiwp?4jx^!9wP{uBSp}02*++z$j?N+&f`Jg9AkCKq)-V9Zf`Gq? zivX~GcYL~(Ao0}W!s<~wU<0O>C& zz_y~w1$HKJ+=VYS&&bHu)W_I1ea2jWOxtgb!4S30I)Lm>U)O2Ez!2ggdWwTF;|-GIZM0g*P!@)aOsT}q)X`wfXzK%N-zFmN9kORz4Z{n> ziic8t-WK`h&mZ)75ljjKgg)y{gAln2#(DG6v;*asuUT6ML%4YfM5*4aZ35G*_*&Qm zQ;$e1^(iu~M55L)MW!B+L)Y{EM;jS0it_p1K5UTgm#jA<14J$@h0dt;Qd)?y7E%6n z4gg3m;+N?>zK route.path.includes('/monitor')); // 场景标题 const title = ref(''); +// 左侧侧边栏折叠状态 +const leftCollapsed = ref(false); + // 监听标题变化,动态更新页面标题 watch( isMonitorMode, @@ -417,13 +422,15 @@ const focusFindKeydownHandler = (event: KeyboardEvent) => { const isFindKey = event.key === 'f' || event.key === 'F'; if ((event.ctrlKey || event.metaKey) && isFindKey && !isTypingElement(event.target)) { const raw: any = leftSiderEl.value as any; - const sider: HTMLElement | null = (raw && raw.$el) ? (raw.$el as HTMLElement) : (raw as HTMLElement | null); + const sider: HTMLElement | null = raw && raw.$el ? (raw.$el as HTMLElement) : (raw as HTMLElement | null); if (sider) { const input = sider.querySelector('.search input, .search .ant-input') as HTMLInputElement | null; if (input) { event.preventDefault(); input.focus(); - try { input.select?.(); } catch {} + try { + input.select?.(); + } catch {} } } } @@ -454,9 +461,20 @@ const handleGlobalKeydown = (event: KeyboardEvent) => { - - - + + toggle-sider + + @@ -532,4 +550,28 @@ const handleGlobalKeydown = (event: KeyboardEvent) => { pointer-events: all; } } +.main-layout { + position: relative; +} + +.left-sider { + position: relative; + left: 36px; +} + +.sider-toggle { + position: absolute; + top: 20px; + left: 8px; + width: 36px; + height: 36px; + padding: 8px; + cursor: pointer; + z-index: 10; + background-color: #fff; + border-radius: 4px; + body[data-theme='dark'] & { + background-color: #000; + } +} diff --git a/src/pages/scene-editor.vue b/src/pages/scene-editor.vue index 057a960..40386aa 100644 --- a/src/pages/scene-editor.vue +++ b/src/pages/scene-editor.vue @@ -4,6 +4,8 @@ import { computed, onMounted, onUnmounted, provide, ref, type ShallowRef, shallo import { useI18n } from 'vue-i18n'; import { getSceneById, importBinTaskExcel, pushSceneById, saveSceneById } from '../apis/scene'; +import expandIcon from '../assets/icons/png/expand.png'; +import foldIcon from '../assets/icons/png/fold.png'; import BatchEditToolbar from '../components/batch-edit-toolbar.vue'; import AutoCreateStorageModal from '../components/modal/auto-create-storage-modal.vue'; import { EditorService } from '../services/editor.service'; @@ -111,13 +113,15 @@ const focusFindKeydownHandler = (event: KeyboardEvent) => { const isFindKey = event.key === 'f' || event.key === 'F'; if ((event.ctrlKey || event.metaKey) && isFindKey && !isTypingElement(event.target)) { const raw: any = leftSiderEl.value as any; - const sider: HTMLElement | null = (raw && raw.$el) ? (raw.$el as HTMLElement) : (raw as HTMLElement | null); + const sider: HTMLElement | null = raw && raw.$el ? (raw.$el as HTMLElement) : (raw as HTMLElement | null); if (sider) { const input = sider.querySelector('.search input, .search .ant-input') as HTMLInputElement | null; if (input) { event.preventDefault(); input.focus(); - try { input.select?.(); } catch {} + try { + input.select?.(); + } catch {} } } } @@ -135,6 +139,9 @@ onUnmounted(() => { const editable = ref(false); watch(editable, (v) => editor.value?.setState(v)); +// 左侧侧边栏折叠状态 +const leftCollapsed = ref(false); + const toPush = () => { Modal.confirm({ class: 'confirm', @@ -275,9 +282,20 @@ const handleAutoCreateStorageCancel = () => { - - - + + toggle-sider + + { pointer-events: all; } } + +.main-layout { + position: relative; +} + +.left-sider { + position: relative; + left: 36px; +} + +.sider-toggle { + position: absolute; + top: 20px; + left: 8px; + width: 36px; + height: 36px; + padding: 8px; + cursor: pointer; + z-index: 10; + background-color: #fff; + border-radius: 4px; + body[data-theme='dark'] & { + background-color: #000; + } +}