paging.ts 900 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { usePagging } from "@/hook/pagging";
  2. // import { SceneType, getScenePagging } from "@/store/scene";
  3. import { CameraType } from "@/store/camera";
  4. import { getcameraVersionAppList } from '@/store/cameraVersionApp'
  5. import { computed, reactive, watch, watchEffect } from "vue";
  6. export const useScenePaggingParams = () => {
  7. const pagging = usePagging({
  8. get: getcameraVersionAppList,
  9. paramsTemlate: {
  10. type: 1,
  11. version: '',
  12. },
  13. });
  14. watchEffect(() => {
  15. });
  16. watch(
  17. () => pagging.state.query.type,
  18. () => {
  19. pagging.state.pag.currentPage = 1;
  20. }
  21. );
  22. const queryResetRaw = pagging.queryReset;
  23. pagging.queryReset = () => {
  24. const type = pagging.state.query.type;
  25. queryResetRaw();
  26. pagging.state.query.type = type;
  27. };
  28. return reactive({ pagging });
  29. };
  30. export type ScenePagging = ReturnType<typeof useScenePaggingParams>["pagging"];