import { ref } from 'vue'
import { defineStore } from 'pinia'

export const usePageStore = defineStore('page', () => {
  // 当前的页面信息
  const currentPage = ref<Record<string, string>>({
    pageId: '',
    pageName: '',
  })
  // 设置页面信息
  const setCurrentPage = (pageData: Record<string, string>) => {
    currentPage.value = pageData
  }

  // 当前的服务信息
  const currentService = ref<Record<string, string>>({
    serviceId: '',
    serviceName: '',
  })
  // 设置服务信息
  const setCurrentService = (serviceData: Record<string, string>) => {
    currentService.value = serviceData
  }

  return { currentPage, setCurrentPage, currentService, setCurrentService }
})
