forked from Leaf/amber-ui
改进 移动端显示
This commit is contained in:
parent
288879c740
commit
7fca95c131
@ -43,7 +43,11 @@
|
|||||||
</n-result>
|
</n-result>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<n-drawer placement="left" v-model:show="showSettingsDialog" :width="600">
|
<n-drawer
|
||||||
|
placement="left"
|
||||||
|
v-model:show="showSettingsDialog"
|
||||||
|
:width="drawerWidth"
|
||||||
|
>
|
||||||
<n-drawer-content closable title="编辑助理">
|
<n-drawer-content closable title="编辑助理">
|
||||||
<div v-if="currentAssistant">
|
<div v-if="currentAssistant">
|
||||||
<n-form>
|
<n-form>
|
||||||
@ -121,13 +125,11 @@
|
|||||||
{{ c.token }}
|
{{ c.token }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<n-popconfirm @positive-click="deleteAssistantShare(c.id ?? 0)">
|
<n-popconfirm
|
||||||
|
@positive-click="deleteAssistantShare(c.id ?? 0)"
|
||||||
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<n-button
|
<n-button quaternary circle type="warning">
|
||||||
quaternary
|
|
||||||
circle
|
|
||||||
type="warning"
|
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<n-icon size="16" class="cursor-pointer">
|
<n-icon size="16" class="cursor-pointer">
|
||||||
<TrashBinOutline />
|
<TrashBinOutline />
|
||||||
@ -135,9 +137,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</n-button>
|
</n-button>
|
||||||
</template>
|
</template>
|
||||||
<div>
|
<div>删除后,应用将无法访问此助理。</div>
|
||||||
删除后,应用将无法访问此助理。
|
|
||||||
</div>
|
|
||||||
</n-popconfirm>
|
</n-popconfirm>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -187,7 +187,6 @@ import { useDialog } from "naive-ui";
|
|||||||
import { TrashBinOutline, SettingsOutline } from "@vicons/ionicons5";
|
import { TrashBinOutline, SettingsOutline } from "@vicons/ionicons5";
|
||||||
import getApi from "@/plugins/api";
|
import getApi from "@/plugins/api";
|
||||||
import { useChatStore } from "@/stores/chat";
|
import { useChatStore } from "@/stores/chat";
|
||||||
import router from "@/router";
|
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import {
|
import {
|
||||||
EntityAssistant,
|
EntityAssistant,
|
||||||
@ -196,6 +195,7 @@ import {
|
|||||||
EntityLibrary,
|
EntityLibrary,
|
||||||
EntityTool,
|
EntityTool,
|
||||||
} from "@/api";
|
} from "@/api";
|
||||||
|
import { useIsMobile } from "@/utils/composables";
|
||||||
|
|
||||||
const dialog = useDialog();
|
const dialog = useDialog();
|
||||||
const chatStore = useChatStore();
|
const chatStore = useChatStore();
|
||||||
@ -210,6 +210,15 @@ const librarySelects: any = ref([]);
|
|||||||
const libraries: Ref<EntityLibrary[]> = ref([]);
|
const libraries: Ref<EntityLibrary[]> = ref([]);
|
||||||
const assistantShares: Ref<EntityAssistantShare[]> = ref([]);
|
const assistantShares: Ref<EntityAssistantShare[]> = ref([]);
|
||||||
|
|
||||||
|
const isMobile = useIsMobile();
|
||||||
|
const drawerWidth = computed(() => {
|
||||||
|
if (isMobile.value) {
|
||||||
|
return 300;
|
||||||
|
} else {
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function getChats() {
|
async function getChats() {
|
||||||
chatStore.chats = (await getApi().Chat.apiV1ChatsGet()).data.data;
|
chatStore.chats = (await getApi().Chat.apiV1ChatsGet()).data.data;
|
||||||
}
|
}
|
||||||
|
@ -48,10 +48,14 @@
|
|||||||
</n-result>
|
</n-result>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<n-drawer placement="left" v-model:show="showSettingsDialog" :width="600">
|
<n-drawer
|
||||||
|
placement="left"
|
||||||
|
v-model:show="showSettingsDialog"
|
||||||
|
:width="drawerWidth"
|
||||||
|
>
|
||||||
<n-drawer-content closable title="编辑对话">
|
<n-drawer-content closable title="编辑对话">
|
||||||
<div v-if="currentChat">
|
<div v-if="currentChat">
|
||||||
<n-form >
|
<n-form>
|
||||||
<n-form-item label="对话名称">
|
<n-form-item label="对话名称">
|
||||||
<n-input
|
<n-input
|
||||||
v-model:value="currentChat.name"
|
v-model:value="currentChat.name"
|
||||||
@ -76,19 +80,23 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { NMenu, useDialog } from "naive-ui";
|
import { useDialog } from "naive-ui";
|
||||||
import { useRoute } from "vue-router";
|
import { TrashBinOutline, SettingsOutline } from "@vicons/ionicons5";
|
||||||
import { leftMenuOptions } from "../../plugins/menus/left";
|
|
||||||
import {
|
|
||||||
ChatboxOutline,
|
|
||||||
TrashBinOutline,
|
|
||||||
SettingsOutline,
|
|
||||||
} from "@vicons/ionicons5";
|
|
||||||
import getApi from "../../plugins/api";
|
import getApi from "../../plugins/api";
|
||||||
import { useChatStore } from "../../stores/chat";
|
import { useChatStore } from "../../stores/chat";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { EntityAssistant, EntityChat } from "@/api";
|
import { EntityAssistant, EntityChat } from "@/api";
|
||||||
|
import { useIsMobile } from "@/utils/composables";
|
||||||
|
|
||||||
|
const isMobile = useIsMobile();
|
||||||
|
const drawerWidth = computed(() => {
|
||||||
|
if (isMobile.value) {
|
||||||
|
return 300;
|
||||||
|
} else {
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const dialog = useDialog();
|
const dialog = useDialog();
|
||||||
const chatStore = useChatStore();
|
const chatStore = useChatStore();
|
||||||
|
@ -14,7 +14,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<n-drawer placement="left" v-model:show="showCreateDialog" :width="600">
|
<n-drawer
|
||||||
|
placement="left"
|
||||||
|
v-model:show="showCreateDialog"
|
||||||
|
:width="drawerWidth"
|
||||||
|
>
|
||||||
<n-drawer-content closable title="新建工具">
|
<n-drawer-content closable title="新建工具">
|
||||||
<n-form>
|
<n-form>
|
||||||
<n-form-item label="名称">
|
<n-form-item label="名称">
|
||||||
@ -47,6 +51,7 @@
|
|||||||
import { EntityTool, SchemaToolCreateRequest } from "@/api";
|
import { EntityTool, SchemaToolCreateRequest } from "@/api";
|
||||||
import getApi from "@/plugins/api";
|
import getApi from "@/plugins/api";
|
||||||
import { useToolStore } from "@/stores/tools";
|
import { useToolStore } from "@/stores/tools";
|
||||||
|
import { useIsMobile } from "@/utils/composables";
|
||||||
import { HammerOutline } from "@vicons/ionicons5";
|
import { HammerOutline } from "@vicons/ionicons5";
|
||||||
|
|
||||||
const toolStore = useToolStore();
|
const toolStore = useToolStore();
|
||||||
@ -59,6 +64,15 @@ const createToolRequest: Ref<SchemaToolCreateRequest> = ref({
|
|||||||
url: "",
|
url: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isMobile = useIsMobile();
|
||||||
|
const drawerWidth = computed(() => {
|
||||||
|
if (isMobile.value) {
|
||||||
|
return 300;
|
||||||
|
} else {
|
||||||
|
return 600;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const getTools = async () => {
|
const getTools = async () => {
|
||||||
toolStore.tools = (await getApi().Tool.apiV1ToolsGet()).data.data ?? [];
|
toolStore.tools = (await getApi().Tool.apiV1ToolsGet()).data.data ?? [];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user