import { ref } from "vue";
import { useAppStoreHook } from "/@/store/modules/app";

export function useParams(onlySelf: boolean) {
  const { searchParams } = useAppStoreHook();
  

  console.log(onlySelf, '--')

  //查询参数
  const basicParams = ref<Record<string, any>>(!onlySelf && searchParams.basic ? searchParams.basic : {});

  function changeBasicParams(newParams: any = {}) {
    basicParams.value = newParams;
  }

  function getBasicParams() {
    return basicParams.value;
  }

  return {
    changeBasicParams,
    getBasicParams
  };
}
