import Vue from 'vue';
import store from 'store';
import AdvanceViewImage from 'components/AdvanceViewImage.vue';
import IssueTypeItem from 'views/helpInfo/issueType/modal/ItemModal.vue';
import InformationItem from 'views/helpInfo/information/modal/ItemModal.vue';
import BannerItem from 'views/baseManagement/bannerManagement/modal/ItemModal.vue';
import InfoItem from 'views/baseManagement/infoManagement/modal/ItemModal.vue';
import MemberLeverItem from 'views/memberManagement/memberLever/modal/ItemModal.vue';
import TrendItem from 'views/baseManagement/trending/modal/ItemModal.vue';
import SceneVerifyItem from 'views/sceneManagement/sceneVerify/modal/ItemModal.vue';
import SceneItem from 'views/sceneManagement/sceneList/modal/ItemModal.vue';
import WithdrawalRecordVerifyItem from 'views/statistics/withdrawalRecord/modal/ItemModal.vue';
import PhotoerVerifyItem from 'views/photographerManagement/photographerVerify/modal/ItemModal.vue';
import ActivityItem from 'views/photoManagement/eventsList/modal/ItemModal.vue';
import PhotoVerifyItem from 'views/photoManagement/photoVerifyManagement/modal/ItemModal.vue';
import PhotoVerifyMultItem from 'views/photoManagement/photoVerifyManagement/modal/MultItemModal.vue';
import ImageGoodsItem from 'views/photoManagement/imageGoodsManagement/modal/ItemModal.vue';
import PhotoUpload from 'views/photographerManagement/photoVerify/modal/ItemModal.vue';
import PhotoMultUpload from 'views/photographerManagement/photoVerify/modal/MultItemModal.vue';
import AliOssMulti from 'views/photographerManagement/photoVerify/modal/ali-oss-multi.vue';

const modal = (Component, props) => {
  let _component = null;
  const Instance = new Vue({
    props,
    store,
    render(h) {
      return h(Component, {
        props: props,
        on: {
          cancel: () => {
            Instance.$destroy();
            document.body.removeChild(_component.$el);
          }
        }
      });
    }
  });
  _component = Instance.$mount();
  document.body.appendChild(_component.$el);
};

let AliOssMultiModal = data => {
  modal(AliOssMulti, data);
};
Vue.prototype.$AliOssMultiModal = params => {
  AliOssMultiModal(params);
};


let PhotoVerifyMultItemModal = data => {
  modal(PhotoVerifyMultItem, data);
};
Vue.prototype.$PhotoVerifyMultItemModal = params => {
  PhotoVerifyMultItemModal(params);
};

let PhotoMultUploadModal = data => {
  modal(PhotoMultUpload, data);
};
Vue.prototype.$PhotoMultUploadModal = params => {
  PhotoMultUploadModal(params);
};

let AdvanceViewImageModal = data => {
  modal(AdvanceViewImage, data);
};
Vue.prototype.$AdvanceViewImageModal = params => {
  AdvanceViewImageModal(params);
};

let IssueTypeItemModal = data => {
  modal(IssueTypeItem, data);
};
Vue.prototype.$IssueTypeItemModal = params => {
  IssueTypeItemModal(params);
};

let InformationItemModal = data => {
  modal(InformationItem, data);
};
Vue.prototype.$InformationItemModal = params => {
  InformationItemModal(params);
};

let BannerItemModal = data => {
  modal(BannerItem, data);
};
Vue.prototype.$BannerItemModal = params => {
  BannerItemModal(params);
};

let InfoItemModal = data => {
  modal(InfoItem, data);
};
Vue.prototype.$InfoItemModal = params => {
  InfoItemModal(params);
};

let MemberLeverItemModal = data => {
  modal(MemberLeverItem, data);
};
Vue.prototype.$MemberLeverItemModal = params => {
  MemberLeverItemModal(params);
};

let TrendItemModal = data => {
  modal(TrendItem, data);
};
Vue.prototype.$TrendItemModal = params => {
  TrendItemModal(params);
};

let SceneVerifyItemModal = data => {
  modal(SceneVerifyItem, data);
};
Vue.prototype.$SceneVerifyItemModal = params => {
  SceneVerifyItemModal(params);
};

let SceneItemModal = data => {
  modal(SceneItem, data);
};
Vue.prototype.$SceneItemModal = params => {
  SceneItemModal(params);
};

let WithdrawalRecordVerifyItemModal = data => {
  modal(WithdrawalRecordVerifyItem, data);
};
Vue.prototype.$WithdrawalRecordVerifyItemModal = params => {
  WithdrawalRecordVerifyItemModal(params);
};

let PhotoerVerifyItemModal = data => {
  modal(PhotoerVerifyItem, data);
};
Vue.prototype.$PhotoerVerifyItemModal = params => {
  PhotoerVerifyItemModal(params);
};

let ActivityItemModal = data => {
  modal(ActivityItem, data);
};
Vue.prototype.$ActivityItemModal = params => {
  ActivityItemModal(params);
};

let PhotoVerifyItemModal = data => {
  modal(PhotoVerifyItem, data);
};
Vue.prototype.$PhotoVerifyItemModal = params => {
  PhotoVerifyItemModal(params);
};

let ImageGoodsItemModal = data => {
  modal(ImageGoodsItem, data);
};
Vue.prototype.$ImageGoodsItemModal = params => {
  ImageGoodsItemModal(params);
};

let PhotoUploadModal = data => {
  modal(PhotoUpload, data);
};
Vue.prototype.$PhotoUploadModal = params => {
  PhotoUploadModal(params);
};
