import addPhotoFile from "./addPhotoFile.vue";
import addPhotoFileAll from "./addPhotoFileAll.vue";
import AddCaseFile from "./addCaseFile.vue";
import AddScenes from "./addScenes.vue";
import ShareCase from "./share.vue";
import EditEshapeTable, {
  EshapeTableContent,
} from "./draw/editEshapeTable.vue";
import SceneList from "./sceneList.vue";
import SelectFuseImage, { FuseImage } from "./draw/selectFuseImage.vue";
import SelectMapImage, { MapImage } from "./draw/selectMapImage.vue";
import { quiskMountFactory } from "@/helper/mount";
import { nextTick } from "vue";

export const addCaseFile = quiskMountFactory(AddCaseFile, {
  title: "上传附件",
  width: 500,
});
export const addCaseImgFile = quiskMountFactory(addPhotoFile, {
  title: "上传照片",
  width: 500,
});

export const addCaseImgFileAll = quiskMountFactory(addPhotoFileAll, {
  title: "上传照片",
  width: 500,
});


export const addCaseScenes = quiskMountFactory(AddScenes, {
  title: "添加场景",
  width: 800,
});

const editEshapeTableRaw = quiskMountFactory(EditEshapeTable, {
  title: "表格内容编辑",
})<EshapeTableContent>;
export const editEshapeTable = (
  props: Parameters<typeof editEshapeTableRaw>["0"]
) =>
  props.track
    ? editEshapeTableRaw(props, ({ submit }) => nextTick().then(submit))
    : editEshapeTableRaw(props);

export const showCaseScenes = quiskMountFactory(SceneList, {
  title: "案件场景管理",
  width: 900,
  notSubmit: true,
  hideFloor: true,
});

export const selectFuseImage = quiskMountFactory(SelectFuseImage, {
  title: "选择户型图",
  width: 1300,
})<FuseImage>;

export const selectMapImage = quiskMountFactory(SelectMapImage, {
  title: "选择地址",
  width: 588,
})<MapImage>;

export const shareCase = quiskMountFactory(ShareCase, {
  title: "分享",
  enterText: "复制链接及密码",
})<string>;
