accidentPhotos.ts 846 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { ref, watch, watchEffect } from "vue";
  2. import type { PhotoRaw } from "./photos";
  3. import { ui18n } from "@/lang";
  4. export type AccidentPhoto = {
  5. id: string;
  6. photoUrl: string;
  7. title: string;
  8. url: string;
  9. time: number;
  10. data: any;
  11. updateTime?: number;
  12. type?: string;
  13. sceneData: {
  14. meterPerPixel: number;
  15. fixGraphs: PhotoRaw["fixGraphs"];
  16. measures: PhotoRaw["measures"];
  17. fixPoints: PhotoRaw["fixPoints"];
  18. basePoints: PhotoRaw["basePoints"];
  19. baseLines: PhotoRaw["baseLines"];
  20. };
  21. };
  22. export const types = [
  23. ui18n.t("tl.aptypes[0]"),
  24. ui18n.t("tl.aptypes[1]"),
  25. ui18n.t("tl.aptypes[2]"),
  26. ui18n.t("tl.aptypes[3]"),
  27. ];
  28. export const accidentPhotos = ref<AccidentPhoto[]>([]);
  29. watch(
  30. accidentPhotos,
  31. (val) => {
  32. console.error(accidentPhotos.value[1]);
  33. },
  34. { deep: true, flush: "sync" }
  35. );