Compare commits

...

6 Commits
app ... main

Author SHA1 Message Date
Phoenix
8abb0439f6 123 2024-05-22 11:26:44 +08:00
Phoenix
50501a73cd 解决流式输出的时候input不能输入的问题 2024-04-16 10:46:08 +08:00
Phoenix
73a46b08dc 解决流式输出的时候input不能输入的问题 2024-04-16 10:44:53 +08:00
Phoenix
cdafe30d33 s 2024-03-05 16:19:33 +08:00
Phoenix
2e0cb8a084 s 2024-03-05 10:44:01 +08:00
Phoenix
ef0d0af2e4 s 2024-03-04 14:05:54 +08:00
8 changed files with 40 additions and 27 deletions

View File

@ -12,6 +12,7 @@
],
"scripts": {
"dev": "vite",
"prod": "vite --mode prod",
"build": "vite build",
"preview": "vite preview",
"build-prod": "vite build --mode prod",

View File

@ -17,11 +17,11 @@ import {Local} from './utils/storage/storage.js'
} *!/ */
const themeOverrides = {
common: {
primaryColorHover:'#764CF6',
primaryColor:'#764CF6'
primaryColorHover:Local.get('setting-info')?.themeColor?.split("@")?.[1]??'#764CF6',
primaryColor:Local.get('setting-info')?.themeColor?.split("@")?.[1]??'#764CF6',
},
Button: {
textColor: '#764CF6'
textColor: Local.get('setting-info')?.themeColor?.split("@")?.[1]??'#764CF6',
}
}
</script>

View File

@ -11,6 +11,7 @@ const currentListUuid=ref('')
const isStop = ref(false);
const isGPT4 = ref(false);
const loading=ref(false)
const show=ref(false)
const getDataList = async () => {
const data = {
page: 1,
@ -18,7 +19,7 @@ const currentListUuid=ref('')
}
const res=await getSessionList(data)
if (res.code===0){
dataList.value=res.data.data
dataList.value=res.data.data??[]
}
}
const detailData=ref([])
@ -45,7 +46,7 @@ const currentListUuid=ref('')
conversationOpt:null,
}
})
detailData.value=res.data
detailData.value=res.data??[]
}
}
const createSessionStore=async ()=>{
@ -64,5 +65,5 @@ const currentListUuid=ref('')
//getDataList()
}
}
return { sessionDetail,currentListUuid ,gptMode,getDataList,dataList,getSessionDetail,createSessionStore,deleteSession,isStop,isGPT4,loading};
return {show, sessionDetail,currentListUuid ,gptMode,getDataList,dataList,getSessionDetail,createSessionStore,deleteSession,isStop,isGPT4,loading};
});

View File

@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus'
import {Local} from '@/utils/storage/storage.js'
const request = axios.create({
baseURL:import.meta.env.VITE_APP_API_BASE_URL,
timeout:5000
timeout:60000
});
let loading
request.interceptors.request.use((config)=>{

View File

@ -1,16 +1,12 @@
<script setup>
import {ref} from 'vue'
import { NAvatar } from 'naive-ui'
const defaultAvatar=ref(JSON.parse(localStorage.getItem('userInfo')).Avatar)
defineProps({
image: Boolean
})
</script>
<template>
<template v-if="image">
<NAvatar :src="defaultAvatar" :fallback-src="defaultAvatar" />

View File

@ -93,7 +93,6 @@ function handleSubmit() {
}
} */
const API_URL = `${import.meta.env.VITE_APP_API_BASE_URL}/chat/completion`;
const createParams = () => {
const messages = dataSources.value.map((x) => {
@ -336,7 +335,7 @@ const footerClass = computed(() => {
const isShowBottom=ref(false)
onMounted(() => {
scrollRef.value.addEventListener('scroll', function() {
if (scrollRef.value.scrollTop + scrollRef.value.clientHeight +100>= scrollRef.value.scrollHeight) {
if (scrollRef.value.scrollTop + scrollRef.value.clientHeight>= scrollRef.value.scrollHeight) {
isShowBottom.value=false
}else {
isShowBottom.value=true
@ -425,6 +424,7 @@ watch(dataSources,()=>{
loading.value=false
scrollToBottom('auto')
})
const inputKey=ref(1)
const customRequest = async (file) => {
console.log(file,'file')
const res = await uploadImg({
@ -486,7 +486,7 @@ const customRequest = async (file) => {
<div>
<Message
v-for="(item, index) of dataSources"
:key="index"
:key="item.dateTime"
:date-time="item.dateTime"
:text="item.text"
:fileList="item.fileList"
@ -616,7 +616,9 @@ const customRequest = async (file) => {
/> -->
<NInput
v-memo="[prompt]"
style="width:75%"
:key="inputKey"
ref="inputRef"
v-model:value="prompt"
type="textarea"
@ -626,6 +628,8 @@ const customRequest = async (file) => {
@keypress="handleEnter"
>
</NInput>
<NButton color="#8a2be2" type="primary" size="large" :disabled="buttonDisabled" @click="handleSubmit">
<template #icon>
<span class="dark:text-black" v-if="!loading">

View File

@ -81,7 +81,7 @@ const options = () => {
},
{
label: 'GPT-4.0',
value: 'gpt-4-1106-preview',
value: 'gpt-4o',
permission: 'gpt-4-btn'
},
{

11
src/views/chat/test.vue Normal file
View File

@ -0,0 +1,11 @@
<script setup lang="ts">
</script>
<template>
</template>
<style scoped>
</style>