districtCountyRollCall.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div class="container">
  3. <div v-for="(item, index) in menuData" :key="index" class="box" @click="handleClick(item.key)">
  4. <div class="box-left">
  5. <i :class="item.img" />
  6. </div>
  7. <div class="label">{{ item.name }}</div>
  8. <div class="box-right" />
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" setup name="districtCountyRollCall">
  13. import {reactive} from "vue";
  14. import {useRouter} from "vue-router";
  15. const router = useRouter();
  16. const menuData = reactive([
  17. { name: '茂南区', key: '茂南区', img: 'icon-mn' },
  18. { name: '电白区', key: '电白区', img: 'icon-db' },
  19. { name: '高州市', key: '高州市', img: 'icon-gz' },
  20. { name: '化州市', key: '化州市', img: 'icon-hz' },
  21. { name: '信宜市', key: '信宜市', img: 'icon-xy' },
  22. { name: '滨海新区', key: '滨海新区', img: 'icon-bh' },
  23. { name: '高新区', key: '高新区', img: 'icon-gx' }
  24. ])
  25. const handleClick = (key: string) => {
  26. router.push({ name : 'SpotCheckUnits', query: { key } })
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .container {
  31. display: flex;
  32. flex-direction: column;
  33. padding: 20px 0;
  34. align-items: center;
  35. width: 100%;
  36. min-height: calc(100vh - 50px);
  37. .box {
  38. width: 359px;
  39. height: 65px;
  40. background: url('@/assets/images/onlineRollCall/box2.png') no-repeat;
  41. background-size: 100% 100%;
  42. display: flex;
  43. justify-content: space-between;
  44. align-items: center;
  45. margin-top: 16px;
  46. position: relative;
  47. padding: 0 27px;
  48. .box-left, .box-right {
  49. display: flex;
  50. justify-content: center;
  51. align-items: center;
  52. width: 47px;
  53. }
  54. .icon-mn {
  55. width: 47px;
  56. height: 46px;
  57. background: url('@/assets/images/onlineRollCall/icon_mn.png') no-repeat;
  58. background-size: 100% 100%;
  59. }
  60. .icon-db {
  61. width: 47px;
  62. height: 50px;
  63. background: url('@/assets/images/onlineRollCall/icon_db.png') no-repeat;
  64. background-size: 100% 100%;
  65. }
  66. .icon-gz {
  67. width: 47px;
  68. height: 46px;
  69. background: url('@/assets/images/onlineRollCall/icon_gz.png') no-repeat;
  70. background-size: 100% 100%;
  71. }
  72. .icon-hz {
  73. width: 47px;
  74. height: 50px;
  75. background: url('@/assets/images/onlineRollCall/icon_hz.png') no-repeat;
  76. background-size: 100% 100%;
  77. }
  78. .icon-xy {
  79. width: 47px;
  80. height: 46px;
  81. background: url('@/assets/images/onlineRollCall/icon_xy.png') no-repeat;
  82. background-size: 100% 100%;
  83. }
  84. .icon-bh {
  85. width: 47px;
  86. height: 50px;
  87. background: url('@/assets/images/onlineRollCall/icon_bh.png') no-repeat;
  88. background-size: 100% 100%;
  89. }
  90. .icon-gx {
  91. width: 47px;
  92. height: 49px;
  93. background: url('@/assets/images/onlineRollCall/icon_gx.png') no-repeat;
  94. background-size: 100% 100%;
  95. }
  96. .label {
  97. flex: 1;
  98. text-align: center;
  99. color: #414F64;
  100. font-size: 16px;
  101. }
  102. }
  103. }
  104. </style>