AllPaperModal.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <teleport to="body">
  3. <div v-if="store.allPaperModal" class="dialog-container">
  4. <header class="tw-flex tw-place-content-between tw-items-center">
  5. <div class="tw-text-2xl ctw-text-base tw-ml-5 tw-my-2">全卷切换</div>
  6. <div class="tw-flex tw-items-center tw-gap-2 tw-mx-8 tw-flex-grow">
  7. <span
  8. v-for="(u, index) in urls"
  9. :key="index"
  10. @click="checkedIndex = index"
  11. class="image-index hover:tw-bg-gray-300"
  12. :class="checkedIndex === index && 'tw-bg-gray-300'"
  13. >
  14. {{ index + 1 }}
  15. </span>
  16. </div>
  17. <a-button shape="circle" @click="store.allPaperModal = false">
  18. <template #icon><CloseOutlined /></template>
  19. </a-button>
  20. </header>
  21. <div>
  22. <div
  23. v-for="(url, index) in urls"
  24. :key="index"
  25. style="display: none"
  26. :class="index === checkedIndex && 'show-image'"
  27. >
  28. <img :src="url" />
  29. </div>
  30. </div>
  31. </div>
  32. </teleport>
  33. </template>
  34. <script setup lang="ts">
  35. import { computed } from "vue";
  36. import { CloseOutlined } from "@ant-design/icons-vue";
  37. import { store } from "@/features/mark/store";
  38. const urls = computed(() => {
  39. return store.currentTask?.sliceUrls ?? [];
  40. });
  41. let checkedIndex = $ref(0);
  42. </script>
  43. <style scoped>
  44. .dialog-container {
  45. /* always top */
  46. z-index: 99999;
  47. position: absolute;
  48. background-color: white;
  49. top: 0;
  50. left: 0;
  51. width: 100vw;
  52. height: 100vh;
  53. overflow: auto;
  54. min-width: var(--app-min-width);
  55. }
  56. header {
  57. color: var(--app-main-text-color);
  58. border-bottom: 1px solid var(--app-main-bg-color);
  59. }
  60. .image-index {
  61. display: inline-block;
  62. border: 1px solid grey;
  63. width: 25px;
  64. text-align: center;
  65. border-radius: 5px;
  66. cursor: pointer;
  67. }
  68. .show-image {
  69. display: block !important;
  70. }
  71. </style>