collect.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div class="main">
  3. <div class="content">
  4. <sub-header />
  5. <div class="left">
  6. <n-tabs type="line" pane-class="tab-content">
  7. <template #prefix>
  8. <span class="meta-title">
  9. <img src="@/assets/subtitle_3.png" />
  10. </span>
  11. </template>
  12. <template #suffix>
  13. <span class="input-container">
  14. <!-- <n-input
  15. v-model:value="inputValue"
  16. placeholder="请输入要搜索的藏品"
  17. /> -->
  18. <n-input-group round>
  19. <n-input
  20. round
  21. v-model:value="inputValue"
  22. placeholder="请输入要搜索的藏品"
  23. />
  24. <n-button round type="primary"> 搜索 </n-button>
  25. </n-input-group>
  26. </span>
  27. </template>
  28. <n-tab-pane name="all" tab="全部">
  29. <!-- {{ collectLists }} -->
  30. <n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
  31. <template v-for="item in collectLists">
  32. <n-gi>
  33. <collect-box
  34. :id="item.id"
  35. :title="item.name"
  36. :cover="domain + item.thumb"
  37. :time="item.publishDate"
  38. />
  39. </n-gi>
  40. </template>
  41. </n-grid>
  42. </n-tab-pane>
  43. <n-tab-pane name="one" tab="一级">
  44. <n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
  45. <template v-for="(_, index) in 16">
  46. <n-gi>
  47. <collect-box
  48. :id="index + 1"
  49. title="里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》"
  50. cover="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
  51. time="2023-01-02"
  52. />
  53. </n-gi>
  54. </template>
  55. </n-grid>
  56. </n-tab-pane>
  57. <n-tab-pane name="two" tab="二级">
  58. <n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
  59. <template v-for="(_, index) in 16">
  60. <n-gi>
  61. <collect-box
  62. :id="index + 1"
  63. title="里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》"
  64. cover="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
  65. time="2023-01-02"
  66. />
  67. </n-gi>
  68. </template>
  69. </n-grid>
  70. </n-tab-pane>
  71. <n-tab-pane name="three" tab="三级">
  72. <n-grid :x-gap="XGap" :y-gap="YGap" :cols="3" class="tab-grid">
  73. <template v-for="(_, index) in 16">
  74. <n-gi>
  75. <collect-box
  76. :id="index + 1"
  77. title="里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》里仁学校学生使用的课本——日本东洋博物学 会编《博物标本图汇》"
  78. cover="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
  79. time="2023-01-02"
  80. />
  81. </n-gi>
  82. </template>
  83. </n-grid>
  84. </n-tab-pane>
  85. </n-tabs>
  86. </div>
  87. <side-menu />
  88. </div>
  89. </div>
  90. </template>
  91. <script setup>
  92. import { computed, onMounted, ref } from "vue";
  93. import { useFullscreen } from "@vueuse/core";
  94. import collectBox from "../components/collectBox";
  95. import subHeader from "../components/subHeader";
  96. import sideMenu from "../components/sideMenu";
  97. // import noticeBox from "../components/noticeBox";
  98. import { useCollectStore } from "../store/collect";
  99. const collectStore = useCollectStore();
  100. const domain = ref(import.meta.env.VITE_DOMAIN_URL);
  101. const collectLists = computed(() => collectStore.lists);
  102. const XGap = ref(50);
  103. const YGap = ref(50);
  104. const inputValue = ref("");
  105. onMounted(() => {
  106. collectStore.getCollectList();
  107. });
  108. </script>
  109. <style lang="scss" scoped>
  110. :deep(.n-tabs-nav__suffix) {
  111. min-width: 100px;
  112. flex: 1;
  113. .input-container {
  114. width: 100%;
  115. max-width: 515px;
  116. padding: 0 20px;
  117. }
  118. }
  119. </style>