From 5e920f1e31b44edee5c3f8485595f9483cf11028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E5=BA=86=E6=89=8D=E4=B8=A8=E9=9D=99=E8=A7=85?= Date: Tue, 2 Jan 2024 13:43:30 +0800 Subject: [PATCH] Adapt for Mobile Screen (#14) --- ...-bf95337c-cdeb-4103-a356-38668274b45e.json | 7 + src/components/chat/Introduction.vue | 10 +- src/components/chat/SidePanel.vue | 4 +- src/components/common/Navigator.vue | 4 +- src/components/midjourney/ChannelSelector.vue | 8 + .../midjourney/tasks/TaskFullList.vue | 14 +- .../midjourney/tasks/TaskPreview.vue | 2 +- src/layouts/Chat.vue | 71 ++++++--- src/layouts/Console.vue | 42 +++++- src/layouts/Main.vue | 11 +- src/layouts/Midjourney.vue | 139 ++++++++++++++++++ src/pages/chat/Conversation.vue | 98 ++++++------ src/pages/midjourney/History.vue | 75 ++++------ src/pages/midjourney/Index.vue | 20 +-- src/router/chat.ts | 2 +- 15 files changed, 355 insertions(+), 152 deletions(-) create mode 100644 change/@zhishuyun-hub-bf95337c-cdeb-4103-a356-38668274b45e.json create mode 100644 src/layouts/Midjourney.vue diff --git a/change/@zhishuyun-hub-bf95337c-cdeb-4103-a356-38668274b45e.json b/change/@zhishuyun-hub-bf95337c-cdeb-4103-a356-38668274b45e.json new file mode 100644 index 0000000..7002cbe --- /dev/null +++ b/change/@zhishuyun-hub-bf95337c-cdeb-4103-a356-38668274b45e.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "adapt for mobile screen", + "packageName": "@zhishuyun/hub", + "email": "cqc@cuiqingcai.com", + "dependentChangeType": "patch" +} diff --git a/src/components/chat/Introduction.vue b/src/components/chat/Introduction.vue index e0e436b..577f579 100644 --- a/src/components/chat/Introduction.vue +++ b/src/components/chat/Introduction.vue @@ -125,9 +125,15 @@ export default defineComponent({ @media (max-width: 767px) { .introduction { + position: relative; + top: initial; + left: initial; + transform: initial; width: 90%; - left: 5%; - transform: translateY(-50%); + margin: auto; + .introduction-items { + margin-bottom: 0; + } } } diff --git a/src/components/chat/SidePanel.vue b/src/components/chat/SidePanel.vue index 6aab239..27898c2 100644 --- a/src/components/chat/SidePanel.vue +++ b/src/components/chat/SidePanel.vue @@ -1,5 +1,5 @@ diff --git a/src/layouts/Console.vue b/src/layouts/Console.vue index 06f4cff..0bbbed1 100644 --- a/src/layouts/Console.vue +++ b/src/layouts/Console.vue @@ -4,9 +4,15 @@
- - + +
+ + + + + + @@ -14,12 +20,22 @@ import { defineComponent } from 'vue'; import Navigator from '@/components/common/Navigator.vue'; import SidePanel from '@/components/console/SidePanel.vue'; +import { ElDrawer, ElButton } from 'element-plus'; +import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; export default defineComponent({ name: 'LayoutConsole', components: { SidePanel, - Navigator + Navigator, + ElDrawer, + ElButton, + FontAwesomeIcon + }, + data() { + return { + drawer: false + }; } }); @@ -43,4 +59,24 @@ export default defineComponent({ flex-direction: row; } } + +@media screen and (max-width: 767px) { + .main { + .side { + display: none; + } + .panel { + width: 100%; + height: 100%; + overflow-y: scroll; + } + } + .menu { + display: block; + position: fixed; + right: 20px; + top: 20px; + z-index: 1000; + } +} diff --git a/src/layouts/Main.vue b/src/layouts/Main.vue index d3cc03b..8d7b4ee 100644 --- a/src/layouts/Main.vue +++ b/src/layouts/Main.vue @@ -1,11 +1,7 @@ @@ -27,7 +23,8 @@ export default defineComponent({ height: 100%; display: flex; flex-direction: row; - .left { + overflow: hidden; + .navigator { width: 60px; height: 100%; border-right: 1px solid var(--el-border-color); diff --git a/src/layouts/Midjourney.vue b/src/layouts/Midjourney.vue new file mode 100644 index 0000000..3797b02 --- /dev/null +++ b/src/layouts/Midjourney.vue @@ -0,0 +1,139 @@ + + + + + + + diff --git a/src/pages/chat/Conversation.vue b/src/pages/chat/Conversation.vue index 956d89a..85dac72 100644 --- a/src/pages/chat/Conversation.vue +++ b/src/pages/chat/Conversation.vue @@ -1,28 +1,30 @@ diff --git a/src/pages/midjourney/History.vue b/src/pages/midjourney/History.vue index 220ea35..35e81d7 100644 --- a/src/pages/midjourney/History.vue +++ b/src/pages/midjourney/History.vue @@ -1,23 +1,18 @@ @@ -44,7 +39,6 @@ const CALLBACK_URL = 'https://webhook.zhishuyun.com/midjourney'; export default defineComponent({ name: 'MidjourneyIndex', components: { - PresetPanel, TaskFullList, ChannelSelector, ApiStatus, @@ -121,35 +115,24 @@ export default defineComponent({ diff --git a/src/pages/midjourney/Index.vue b/src/pages/midjourney/Index.vue index c9ea5de..6f3ae4b 100644 --- a/src/pages/midjourney/Index.vue +++ b/src/pages/midjourney/Index.vue @@ -1,9 +1,9 @@