// 每一个存储的模块，命名规则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
type InitialProjectData = {
	text: string
	images: Array<{ url: string; name: string }>
	type: string
	area: string
	style: string
	useReport:boolean
	needSuggestion:boolean
	quoteList: Array<string>
	parameterTags?: Array<{ kind: string; label: string }>
	tempImages: any[]
}
export const useAgentStore = defineStore('agent', () => {
	const initialProjectData = ref<InitialProjectData | null>(null)  

	// 保存项目初始数据
	const setInitialProjectData = (data: InitialProjectData) => {
		initialProjectData.value = data
	}

	// 获取项目初始数据
	const getInitialProjectData = computed(() => initialProjectData.value)

	// 清空项目初始数据
	const clearInitialProjectData = () => {
		initialProjectData.value = null
	}

	return {
		initialProjectData,
		setInitialProjectData,
		getInitialProjectData,
		clearInitialProjectData
	}
})
