Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8abb0439f6 | ||
|
50501a73cd | ||
|
73a46b08dc | ||
|
cdafe30d33 | ||
|
2e0cb8a084 | ||
|
ef0d0af2e4 |
@ -12,6 +12,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"prod": "vite --mode prod",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"build-prod": "vite build --mode prod",
|
||||
|
@ -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>
|
||||
|
@ -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};
|
||||
});
|
||||
|
@ -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)=>{
|
||||
|
@ -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" />
|
||||
|
@ -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({
|
||||
@ -469,7 +469,7 @@ const customRequest = async (file) => {
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<div id="scrollRef" ref="scrollRef" class="h-full overflow-hidden overflow-y-auto">
|
||||
<div id="scrollRef" ref="scrollRef" class="h-full overflow-hidden overflow-y-auto">
|
||||
<div
|
||||
id="image-wrapper"
|
||||
class="w-full max-w-screen-xl m-auto dark:bg-[#101014]"
|
||||
@ -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"
|
||||
@ -615,17 +615,21 @@ const customRequest = async (file) => {
|
||||
@keypress="handleEnter"
|
||||
/> -->
|
||||
|
||||
<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>
|
||||
<NInput
|
||||
v-memo="[prompt]"
|
||||
style="width:75%"
|
||||
:key="inputKey"
|
||||
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">
|
||||
|
@ -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
11
src/views/chat/test.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user