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 SelectMapleaftImages from "./draw/selectMapImagess.vue";
// import SelectMapleaftImages, { MapImage } from "./draw/selectMapleaftImages.vue";
import SelectMapImage, { MapImage } from "./draw/selectMapImage.vue";
import { quiskMountFactory } from "@/helper/mount";
import { nextTick } from "vue";
import { strToParams } from "@/util";
const params = strToParams(window.location.search);

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>;
console.log('params.testMap', params)

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

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