Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8abb0439f6 | ||
|
50501a73cd | ||
|
73a46b08dc | ||
|
cdafe30d33 | ||
|
2e0cb8a084 | ||
|
ef0d0af2e4 |
@ -12,6 +12,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
"prod": "vite --mode prod",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"build-prod": "vite build --mode prod",
|
"build-prod": "vite build --mode prod",
|
||||||
|
@ -17,11 +17,11 @@ import {Local} from './utils/storage/storage.js'
|
|||||||
} *!/ */
|
} *!/ */
|
||||||
const themeOverrides = {
|
const themeOverrides = {
|
||||||
common: {
|
common: {
|
||||||
primaryColorHover:'#764CF6',
|
primaryColorHover:Local.get('setting-info')?.themeColor?.split("@")?.[1]??'#764CF6',
|
||||||
primaryColor:'#764CF6'
|
primaryColor:Local.get('setting-info')?.themeColor?.split("@")?.[1]??'#764CF6',
|
||||||
},
|
},
|
||||||
Button: {
|
Button: {
|
||||||
textColor: '#764CF6'
|
textColor: Local.get('setting-info')?.themeColor?.split("@")?.[1]??'#764CF6',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,6 +11,7 @@ const currentListUuid=ref('')
|
|||||||
const isStop = ref(false);
|
const isStop = ref(false);
|
||||||
const isGPT4 = ref(false);
|
const isGPT4 = ref(false);
|
||||||
const loading=ref(false)
|
const loading=ref(false)
|
||||||
|
const show=ref(false)
|
||||||
const getDataList = async () => {
|
const getDataList = async () => {
|
||||||
const data = {
|
const data = {
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -18,7 +19,7 @@ const currentListUuid=ref('')
|
|||||||
}
|
}
|
||||||
const res=await getSessionList(data)
|
const res=await getSessionList(data)
|
||||||
if (res.code===0){
|
if (res.code===0){
|
||||||
dataList.value=res.data.data
|
dataList.value=res.data.data??[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const detailData=ref([])
|
const detailData=ref([])
|
||||||
@ -45,7 +46,7 @@ const currentListUuid=ref('')
|
|||||||
conversationOpt:null,
|
conversationOpt:null,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
detailData.value=res.data
|
detailData.value=res.data??[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const createSessionStore=async ()=>{
|
const createSessionStore=async ()=>{
|
||||||
@ -64,5 +65,5 @@ const currentListUuid=ref('')
|
|||||||
//getDataList()
|
//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'
|
import {Local} from '@/utils/storage/storage.js'
|
||||||
const request = axios.create({
|
const request = axios.create({
|
||||||
baseURL:import.meta.env.VITE_APP_API_BASE_URL,
|
baseURL:import.meta.env.VITE_APP_API_BASE_URL,
|
||||||
timeout:5000
|
timeout:60000
|
||||||
});
|
});
|
||||||
let loading
|
let loading
|
||||||
request.interceptors.request.use((config)=>{
|
request.interceptors.request.use((config)=>{
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {ref} from 'vue'
|
import {ref} from 'vue'
|
||||||
import { NAvatar } from 'naive-ui'
|
import { NAvatar } from 'naive-ui'
|
||||||
|
|
||||||
|
|
||||||
const defaultAvatar=ref(JSON.parse(localStorage.getItem('userInfo')).Avatar)
|
const defaultAvatar=ref(JSON.parse(localStorage.getItem('userInfo')).Avatar)
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
image: Boolean
|
image: Boolean
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="image">
|
<template v-if="image">
|
||||||
<NAvatar :src="defaultAvatar" :fallback-src="defaultAvatar" />
|
<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 API_URL = `${import.meta.env.VITE_APP_API_BASE_URL}/chat/completion`;
|
||||||
const createParams = () => {
|
const createParams = () => {
|
||||||
const messages = dataSources.value.map((x) => {
|
const messages = dataSources.value.map((x) => {
|
||||||
@ -336,7 +335,7 @@ const footerClass = computed(() => {
|
|||||||
const isShowBottom=ref(false)
|
const isShowBottom=ref(false)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
scrollRef.value.addEventListener('scroll', function() {
|
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
|
isShowBottom.value=false
|
||||||
}else {
|
}else {
|
||||||
isShowBottom.value=true
|
isShowBottom.value=true
|
||||||
@ -425,6 +424,7 @@ watch(dataSources,()=>{
|
|||||||
loading.value=false
|
loading.value=false
|
||||||
scrollToBottom('auto')
|
scrollToBottom('auto')
|
||||||
})
|
})
|
||||||
|
const inputKey=ref(1)
|
||||||
const customRequest = async (file) => {
|
const customRequest = async (file) => {
|
||||||
console.log(file,'file')
|
console.log(file,'file')
|
||||||
const res = await uploadImg({
|
const res = await uploadImg({
|
||||||
@ -486,7 +486,7 @@ const customRequest = async (file) => {
|
|||||||
<div>
|
<div>
|
||||||
<Message
|
<Message
|
||||||
v-for="(item, index) of dataSources"
|
v-for="(item, index) of dataSources"
|
||||||
:key="index"
|
:key="item.dateTime"
|
||||||
:date-time="item.dateTime"
|
:date-time="item.dateTime"
|
||||||
:text="item.text"
|
:text="item.text"
|
||||||
:fileList="item.fileList"
|
:fileList="item.fileList"
|
||||||
@ -616,7 +616,9 @@ const customRequest = async (file) => {
|
|||||||
/> -->
|
/> -->
|
||||||
|
|
||||||
<NInput
|
<NInput
|
||||||
|
v-memo="[prompt]"
|
||||||
style="width:75%"
|
style="width:75%"
|
||||||
|
:key="inputKey"
|
||||||
ref="inputRef"
|
ref="inputRef"
|
||||||
v-model:value="prompt"
|
v-model:value="prompt"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@ -626,6 +628,8 @@ const customRequest = async (file) => {
|
|||||||
@keypress="handleEnter"
|
@keypress="handleEnter"
|
||||||
>
|
>
|
||||||
</NInput>
|
</NInput>
|
||||||
|
|
||||||
|
|
||||||
<NButton color="#8a2be2" type="primary" size="large" :disabled="buttonDisabled" @click="handleSubmit">
|
<NButton color="#8a2be2" type="primary" size="large" :disabled="buttonDisabled" @click="handleSubmit">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<span class="dark:text-black" v-if="!loading">
|
<span class="dark:text-black" v-if="!loading">
|
||||||
|
@ -81,7 +81,7 @@ const options = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'GPT-4.0',
|
label: 'GPT-4.0',
|
||||||
value: 'gpt-4-1106-preview',
|
value: 'gpt-4o',
|
||||||
permission: 'gpt-4-btn'
|
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