import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export const useProjectStore = defineStore('project', () => {
	const state = ref({// 项目参数
		id: '',
		nodeId: '',
		nodeCreateTime: '',
	})

	const setProject = (obj: any) => { 
		for (const key in obj) {
			state.value[key] = obj[key]
		}
	}

	const setId = id=>{
		state.value.id = id
	}

	const clearProject = ()=>{
		state.value = {
			id: '',
			nodeId: '',
			nodeCreateTime: '',
		}
	}

	return {
		state,
		setProject,
		setId,
		clearProject
	}
})

