<template>
  <!-- <vueImg /> -->
  <div class="w-1/1 h-100vh">
    <mt-edit
      :use-thumbnail="true"
      @on-preview-click="onPreviewClick"
      @on-return-click="onReturnClick"
      @on-save-click="onSaveClick"
      @on-thumbnail-click="onThumbnailClick"
    ></mt-edit>
  </div>
</template>

<script setup lang="ts">
import type { IExportJson } from '@/components/mt-edit/components/types';
import { useGenThumbnail } from '@/components/mt-edit/composables/thumbnail';
import { MtEdit } from '@/export';
import { useRouter, useRoute } from 'vue-router';
// xq
// import VueTable from '@/components/vue-xq-test/vue-table-complex.vue';
// import VueRunInfo from '@/components/vue-xq-test/vue-multi-type-info.vue';

console.log('重新渲染EDIT');

const router = useRouter();
const route = useRoute();
console.log('传递：', route.query);

const onPreviewClick = (exportJson: IExportJson) => {
  sessionStorage.setItem('exportJson', JSON.stringify(exportJson));
  const routeUrl = router.resolve({
    name: 'preview'
  });
  window.open(routeUrl.href, '_blank');
};
const onSaveClick = (e: IExportJson) => {
  console.log(e, '这是要保存的数据');
};
const onReturnClick = () => {
  router.go(-1);
};
const onThumbnailClick = () => {
  useGenThumbnail();
};
</script>

<style scoped>
.common-layout {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header-part {
  height: calc(100vh * 240 / 1280);
  background-color: #b3c0d1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  color: #333;
}

.main-part {
  height: calc(100vh * 950 / 1280);
  background-color: #e9eef3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #333;
}

.footer-part {
  height: calc(100vh * 90 / 1280);
  background-color: #d3dce6;
  padding: 0 !important; /* 移除默认内边距 */
  margin: 0 !important; /* 移除默认外边距 */
  /* display: flex; */
  /* align-items: center;
  justify-content: center; */
  /* font-size: 18px; */
  color: #333;
  margin-top: 0;
}

.footer-part-col {
  height: 100%;
  background-color: #333;
  color: #606266;

  border: 3px solid rgb(206, 12, 12);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}
</style>
