quisk.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import addPhotoFile from "./addPhotoFile.vue";
  2. import addPhotoFileAll from "./addPhotoFileAll.vue";
  3. import AddCaseFile from "./addCaseFile.vue";
  4. import AddScenes from "./addScenes.vue";
  5. // import ShareCase from "./share.vue";
  6. import ShareCase from "./newShare.vue";
  7. import EditEshapeTable, {
  8. EshapeTableContent,
  9. } from "./draw/editEshapeTable.vue";
  10. import SceneList from "./sceneList.vue";
  11. import SelectFuseImage, { FuseImage } from "./draw/selectFuseImage.vue";
  12. import SelectMapImage, { MapImage } from "./draw/selectMapImage.vue";
  13. import { quiskMountFactory } from "@/helper/mount";
  14. import { nextTick } from "vue";
  15. import { axios, checkCaseHasDownload, checkHasDownload } from "@/request";
  16. import CaseDownload from "./download.vue";
  17. import SceneShare from "./sceneShare.vue";
  18. export const addCaseFile = quiskMountFactory(AddCaseFile, {
  19. title: "上传附件",
  20. width: 500,
  21. });
  22. export const addCaseImgFile = quiskMountFactory(addPhotoFile, {
  23. title: "上传照片",
  24. width: 500,
  25. });
  26. export const addCaseImgFileAll = quiskMountFactory(addPhotoFileAll, {
  27. title: "上传照片",
  28. width: 500,
  29. });
  30. export const addCaseScenes = quiskMountFactory(AddScenes, {
  31. title: "添加场景",
  32. width: 800,
  33. });
  34. const editEshapeTableRaw = quiskMountFactory(EditEshapeTable, {
  35. title: "表格内容编辑",
  36. })<EshapeTableContent>;
  37. export const editEshapeTable = (
  38. props: Parameters<typeof editEshapeTableRaw>["0"]
  39. ) =>
  40. props.track
  41. ? editEshapeTableRaw(props, ({ submit }) => nextTick().then(submit))
  42. : editEshapeTableRaw(props);
  43. export const showCaseScenes = quiskMountFactory(SceneList, {
  44. title: "案件场景管理",
  45. width: 900,
  46. notSubmit: true,
  47. hideFloor: true,
  48. });
  49. export const selectFuseImage = quiskMountFactory(SelectFuseImage, {
  50. title: "选择户型图",
  51. width: 1300,
  52. })<FuseImage>;
  53. export const selectMapImage = quiskMountFactory(SelectMapImage, {
  54. title: "选择地址",
  55. width: 800,
  56. })<MapImage>;
  57. export const shareCase = quiskMountFactory(ShareCase, {
  58. title: "权限",
  59. enterText: "确定",
  60. width: 750,
  61. })<string>;
  62. export const sceneShare = quiskMountFactory(SceneShare, {
  63. title: "权限",
  64. enterText: "确定",
  65. width: 750,
  66. })<string>;
  67. export type caseDownloadProps = { caseId: number; title: string };
  68. export const downloadCase = async (props: caseDownloadProps) => {
  69. const params = {
  70. caseId: props.caseId,
  71. };
  72. const res = await axios.get(checkCaseHasDownload, { params });
  73. const hideFloor = Number(res.data.downloadStatus) !== 3;
  74. const sceneDownloadDialog = quiskMountFactory(CaseDownload, {
  75. title: "案件离线包下载",
  76. width: 500,
  77. hideFloor: hideFloor,
  78. enterText: "下 载",
  79. });
  80. return await sceneDownloadDialog({...props, res:res });
  81. };