|
|
|
@ -4,11 +4,12 @@ import {Local} from "@/utils/storage/storage";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import {computed, onMounted, onUnmounted, ref, watch} from 'vue'
|
|
|
|
|
import {useRoute} from 'vue-router'
|
|
|
|
|
import {NAutoComplete, NButton, NInput, useDialog, useMessage, NBackTop} from 'naive-ui'
|
|
|
|
|
import {NAutoComplete, NButton, NInput, useDialog, useMessage, NBackTop,NIcon} from 'naive-ui'
|
|
|
|
|
import {AreaChartOutlined, PlusOutlined} from '@ant-design/icons-vue';
|
|
|
|
|
import html2canvas from 'html2canvas'
|
|
|
|
|
import {Message} from './components'
|
|
|
|
|
import {useScroll} from './hooks/useScroll'
|
|
|
|
|
import { FlashOutline } from '@vicons/ionicons5'
|
|
|
|
|
import {useChat} from './hooks/useChat'
|
|
|
|
|
import {useUsingContext} from './hooks/useUsingContext'
|
|
|
|
|
import HeaderComponent from './components/Header/index.vue'
|
|
|
|
@ -71,6 +72,7 @@ function handleSubmit() {
|
|
|
|
|
if (loading.value){
|
|
|
|
|
handleStop()
|
|
|
|
|
}else {
|
|
|
|
|
loading.value = true
|
|
|
|
|
dataSources.value.push({
|
|
|
|
|
dateTime: dayjs().format('YYYY/MM/DD HH:mm:ss'),
|
|
|
|
|
text: prompt.value?.trim(),
|
|
|
|
@ -512,7 +514,7 @@ const customRequest = async (file) => {
|
|
|
|
|
</main>
|
|
|
|
|
<footer :class="footerClass">
|
|
|
|
|
<div class="w-full max-w-screen-xl m-auto">
|
|
|
|
|
<div class="flex items-center justify-between space-x-2" style="flex-wrap: initial">
|
|
|
|
|
<div class="flex items-center justify-center space-x-2" style="flex-wrap: initial">
|
|
|
|
|
<a-popover :open="visible1" trigger="click">
|
|
|
|
|
<template #content>
|
|
|
|
|
<div class="clearfix">
|
|
|
|
@ -570,32 +572,47 @@ const customRequest = async (file) => {
|
|
|
|
|
<SvgIcon icon="ri:delete-bin-line" />
|
|
|
|
|
</span>
|
|
|
|
|
</HoverButton>-->
|
|
|
|
|
<HoverButton v-if="!isMobile" @click="handleExport">
|
|
|
|
|
<!-- <HoverButton v-if="!isMobile" @click="handleExport">
|
|
|
|
|
<span class="text-xl text-[#4f555e] dark:text-white">
|
|
|
|
|
<SvgIcon icon="ri:download-2-line"/>
|
|
|
|
|
</span>
|
|
|
|
|
</HoverButton>
|
|
|
|
|
</HoverButton>-->
|
|
|
|
|
<!-- <HoverButton @click="toggleUsingContext">
|
|
|
|
|
<span class="text-xl" :class="{ 'text-[#4b9e5f]': usingContext, 'text-[#a8071a]': !usingContext }">
|
|
|
|
|
<SvgIcon icon="ri:chat-history-line" />
|
|
|
|
|
</span>
|
|
|
|
|
</HoverButton>-->
|
|
|
|
|
<NAutoComplete v-model:value="prompt" :options="searchOptions" :render-label="renderOption">
|
|
|
|
|
<!-- <NAutoComplete v-model:value="prompt" :options="searchOptions" :render-label="renderOption">
|
|
|
|
|
<template #default="{ handleInput, handleBlur, handleFocus }">
|
|
|
|
|
<NInput
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</NAutoComplete>-->
|
|
|
|
|
<!-- <NInput
|
|
|
|
|
ref="inputRef"
|
|
|
|
|
v-model:value="prompt"
|
|
|
|
|
type="textarea"
|
|
|
|
|
size="large"
|
|
|
|
|
:placeholder="placeholder"
|
|
|
|
|
:autosize="{ minRows: 1, maxRows: isMobile ? 4 : 8 }"
|
|
|
|
|
@input="handleInput"
|
|
|
|
|
@focus="handleFocus"
|
|
|
|
|
@blur="handleBlur"
|
|
|
|
|
@keypress="handleEnter"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</NAutoComplete>
|
|
|
|
|
<NButton color="#8a2be2" type="primary" :disabled="buttonDisabled" @click="handleSubmit">
|
|
|
|
|
/> -->
|
|
|
|
|
<NInput
|
|
|
|
|
style="width:75%"
|
|
|
|
|
ref="inputRef"
|
|
|
|
|
v-model:value="prompt"
|
|
|
|
|
type="textarea"
|
|
|
|
|
size="large"
|
|
|
|
|
:placeholder="placeholder"
|
|
|
|
|
:autosize="{ minRows: 1, maxRows: isMobile ? 4 : 8 }"
|
|
|
|
|
@keypress="handleEnter"
|
|
|
|
|
>
|
|
|
|
|
</NInput>
|
|
|
|
|
<NButton color="#8a2be2" type="primary" size="large" :disabled="buttonDisabled" @click="handleSubmit">
|
|
|
|
|
<template #icon>
|
|
|
|
|
<span class="dark:text-black" v-if="!loading">
|
|
|
|
|
<SvgIcon icon="ri:send-plane-fill"/>
|
|
|
|
|