index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div class="exhibitions">
  3. <img
  4. :aria-description="`You've reached the banner area of the ${curRoute?.name} page; this area has one image; please use the tab key to navigate through the content.`"
  5. class="exhibitions-banner"
  6. src="@/assets/images/Exhibitions/banner_1.jpg"
  7. />
  8. <PageNav :list="NAV_LIST" :cur-route-name="curRoute.name" />
  9. <div class="container">
  10. <Breadcrumb
  11. :parents="[
  12. {
  13. label: 'Exhibitions',
  14. routeParams: {
  15. name: 'Exhibitions',
  16. params: { type: 1 },
  17. },
  18. },
  19. ]"
  20. :cur-route="curRoute"
  21. />
  22. <PageTitle :title="curRoute?.name" />
  23. <div
  24. class="exhibitions-filter"
  25. data-aria-interaction-area
  26. tabindex="2"
  27. aria-description="You've reached search box under the Exhibitions page; please use the tab key to go through the content."
  28. >
  29. <div class="exhibitions-filter__input">
  30. <input
  31. type="text"
  32. autocomplete="off"
  33. v-model="keyword"
  34. tabindex="3"
  35. :aria-description="keyword || 'search'"
  36. />
  37. <SvgIcon name="search" color="var(--van-primary-color)" />
  38. </div>
  39. <!-- 使用el-select组件会无法在选择年份过程中得到选项的无障碍信息,所以改用原生元素 -->
  40. <select
  41. v-model="year"
  42. tabindex="4"
  43. class="exhibitions-filter__year"
  44. aria-label="Select"
  45. aria-description="Select Year"
  46. >
  47. <option value="">Select Year</option>
  48. <option value="2021">2021</option>
  49. <option value="2020">2020</option>
  50. <option value="2019">2019</option>
  51. <option value="2018">2018</option>
  52. <option value="2017">2017</option>
  53. <option value="2016">2016</option>
  54. <option value="2015">2015</option>
  55. </select>
  56. <div style="flex: 1" />
  57. <div class="exhibitions-filter-right">
  58. <img
  59. :src="mode === MODE.LIST ? ActListModeIcon : ListModeIcon"
  60. alt="Button: List mode"
  61. aria-label="Button"
  62. aria-description="List mode"
  63. @click="mode = MODE.LIST"
  64. @keydown.enter.passive="mode = MODE.LIST"
  65. />
  66. <img
  67. :src="mode === MODE.IMG ? ActImgModeIcon : ImgModeIcon"
  68. alt="Button: Image mode"
  69. aria-label="Button"
  70. aria-description="Image mode"
  71. @click="mode = MODE.IMG"
  72. @keydown.enter.passive="mode = MODE.IMG"
  73. />
  74. </div>
  75. </div>
  76. <div
  77. class="exhibitions-list"
  78. data-aria-viewport-area
  79. :aria-description="`You've reached the content area of the ${curRoute.name} page. To browse the content, please use the tab key.`"
  80. >
  81. <ListItem v-if="mode === MODE.LIST" />
  82. <ImgItem v-else />
  83. </div>
  84. <div class="exhibitions__more">Show More</div>
  85. </div>
  86. </div>
  87. </template>
  88. <script lang="ts" setup>
  89. import { useRoute } from "vue-router";
  90. import { computed, ref } from "vue";
  91. import PageNav from "@/components/PageNav/index.vue";
  92. import PageTitle from "@/components/PageTitle/index.vue";
  93. import ListModeIcon from "@/assets/images/Exhibitions/cut1.png";
  94. import ActListModeIcon from "@/assets/images/Exhibitions/cut1Ac.png";
  95. import ImgModeIcon from "@/assets/images/Exhibitions/cut2.png";
  96. import ActImgModeIcon from "@/assets/images/Exhibitions/cut2Ac.png";
  97. import Breadcrumb from "@/components/Breadcrumb/index.vue";
  98. import ListItem from "./components/ListItem/index.vue";
  99. import ImgItem from "./components/ImgItem/index.vue";
  100. import { NAV_LIST } from "./constants";
  101. enum MODE {
  102. LIST = 0,
  103. IMG = 1,
  104. }
  105. const route = useRoute();
  106. const curRoute = computed(() => NAV_LIST[Number(route.params.type) - 1]);
  107. const keyword = ref("");
  108. const year = ref("");
  109. const mode = ref(MODE.LIST);
  110. </script>
  111. <style lang="scss" scoped>
  112. @import "./index.scss";
  113. </style>