diff --git a/src/api/agent.ts b/src/api/agent.ts index 85043af..d233a5f 100644 --- a/src/api/agent.ts +++ b/src/api/agent.ts @@ -3,8 +3,8 @@ import request from '@/utils/request' // 对话 export interface AgentParamsType { message: string // 消息 - threadId: string // 对话ID - checkpointId?: string // 检查点ID + projectID: string // + versionID?: string // imageUrlList?: string[] // 图片URL列表 configParams: Record // 其他配置参数 token: string diff --git a/src/api/upload.ts b/src/api/upload.ts new file mode 100644 index 0000000..d95ed38 --- /dev/null +++ b/src/api/upload.ts @@ -0,0 +1,2 @@ +import request from '@/utils/request' + diff --git a/src/assets/images/checked.png b/src/assets/images/checked.png new file mode 100644 index 0000000..cafcfde Binary files /dev/null and b/src/assets/images/checked.png differ diff --git a/src/stores/agent.ts b/src/stores/agent.ts new file mode 100644 index 0000000..cd26e89 --- /dev/null +++ b/src/stores/agent.ts @@ -0,0 +1,44 @@ +// 每一个存储的模块,命名规则use开头,store结尾 +import router from '@/router' +import { defineStore } from 'pinia' +import { ref, computed } from 'vue' +import { removeLocal, setLocal } from '@/utils/local' +import MyEvent from '@/utils/myEvent' + + +// Agent 项目初始数据 store +export const useAgentStore = defineStore('agent', () => { + const initialProjectData = ref<{ + text: string + images: Array<{ url: string; name: string }> + type: string + area: string + style: string + } | null>(null) + + // 保存项目初始数据 + const setInitialProjectData = (data: { + text: string + images: Array<{ url: string; name: string }> + type: string + area: string + style: string + }) => { + initialProjectData.value = data + } + + // 获取项目初始数据 + const getInitialProjectData = computed(() => initialProjectData.value) + + // 清空项目初始数据 + const clearInitialProjectData = () => { + initialProjectData.value = null + } + + return { + initialProjectData, + setInitialProjectData, + getInitialProjectData, + clearInitialProjectData + } +}) diff --git a/src/stores/projectData.ts b/src/stores/projectData.ts index 80d8184..d8e0d19 100644 --- a/src/stores/projectData.ts +++ b/src/stores/projectData.ts @@ -13,8 +13,13 @@ export const useProjectStore = defineStore('project', () => { } } + const setId = id=>{ + state.value.id = id + } + return { state, setProject, + setId } }) diff --git a/src/views/home/agent/components/Agent.vue b/src/views/home/agent/components/Agent.vue index 3b39c0c..55518a4 100644 --- a/src/views/home/agent/components/Agent.vue +++ b/src/views/home/agent/components/Agent.vue @@ -15,14 +15,17 @@