notesIndex.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <el-row class="notes animate__animated animate__backInRight">
  3. <el-col :span="24" class="info">
  4. <div
  5. :class="['list', item.id == active ? 'activeList' : '']"
  6. v-for="item in list"
  7. :key="item.title"
  8. @mouseover="mouseOver(item)"
  9. @click="toChange(item)"
  10. >
  11. <el-col :span="24" class="imgs">
  12. <el-image class="images" :src="item.url"></el-image>
  13. </el-col>
  14. <el-col class="mess">
  15. <el-col :span="24" class="title">
  16. <span class="titles">{{ item.title }}</span>
  17. <span class="borderBottom"></span>
  18. </el-col>
  19. <el-col :span="24" class="other" v-if="item.id == active">
  20. <!-- <p>{{ item.brief1 }}</p>
  21. <p>{{ item.brief2 }}</p>
  22. <p>{{ item.brief3 }}</p> -->
  23. </el-col>
  24. </el-col>
  25. </div>
  26. </el-col>
  27. </el-row>
  28. </template>
  29. <script setup lang="ts">
  30. defineOptions({ name: 'notesIndex' })
  31. import { ElMessageBox } from 'element-plus'
  32. import { get } from 'lodash-es'
  33. // 基础
  34. import { ref } from 'vue'
  35. const active = ref('1')
  36. const list = ref([
  37. {
  38. id: '1',
  39. title: '水务公告',
  40. url: 'notes1.png',
  41. to: '/watersupplyIndex?tag=1',
  42. // brief1: '结果公式20240701',
  43. // brief2: '暖心供水服务,优化营商环境',
  44. // brief3: '长春水务集团自来水有限公司2022年--2023年末发行的新增地方政府专项债券资金收支情况表',
  45. },
  46. {
  47. id: '2',
  48. title: '水质报告',
  49. url: 'notes2.png',
  50. to: '/watersupplyIndex?tag=2',
  51. // brief1: '2024年9月水质报告',
  52. // brief2: '2024年8月水质信息',
  53. // brief3: '长春水务集团2024年7月 管网末梢水水质检测数据',
  54. },
  55. {
  56. id: '3',
  57. title: '停水信息',
  58. url: 'notes3.png',
  59. to: '/watersupplyIndex?tag=3',
  60. // brief1: '2024年11月10日 长春市高新区延时停水通知',
  61. // brief2: '2024年11月10日 长春市高新区延时停水通知',
  62. // brief3: '',
  63. },
  64. {
  65. id: '4',
  66. title: '管网压力',
  67. url: 'notes4.png',
  68. to: '/watersupplyIndex?tag=4',
  69. // brief1: '公示压力数据(1001-1031)',
  70. // brief2: '公示压力数据(1001-1031)',
  71. // brief3: '长春市城市供水管网 压力数据监测表2024年8月',
  72. },
  73. {
  74. id: '5',
  75. title: '长水e办',
  76. url: 'notes5.png',
  77. to: 'login',
  78. // brief1: '涉民入口',
  79. // brief2: '涉民入口',
  80. // brief3: '',
  81. },
  82. {
  83. id: '6',
  84. title: '网上缴费',
  85. url: 'notes6.png',
  86. to: '/watersupplyIndex?tag=6',
  87. // brief1: '业务办理',
  88. // brief2: '网络缴费',
  89. // brief3: '操作步骤',
  90. },
  91. ])
  92. /* 切换 */
  93. const toChange = (event: { id: string }) => {
  94. active.value = event?.id
  95. const item = list.value.find((f) => f.id == event.id)
  96. if (item) {
  97. const to = get(item, 'to')
  98. if (to == 'login') {
  99. // TODO:提示去登录
  100. ElMessageBox.alert('请登录', '提示', {
  101. confirmButtonText: '确定',
  102. callback: () => {
  103. // TODO:跳转
  104. },
  105. })
  106. } else {
  107. // 新开页面
  108. window.open(`${to}`)
  109. }
  110. }
  111. }
  112. // 类型
  113. const mouseOver = async (data: any) => {
  114. active.value = data.id
  115. }
  116. </script>
  117. <style scoped lang="scss">
  118. .notes {
  119. .info {
  120. display: flex;
  121. gap: 10px;
  122. .list {
  123. width: 16%;
  124. height: 260px;
  125. position: relative;
  126. .imgs {
  127. .images {
  128. width: 100%;
  129. height: 260px;
  130. border-radius: 10px;
  131. }
  132. }
  133. .mess {
  134. position: absolute;
  135. top: 0;
  136. width: 100%;
  137. height: 260px;
  138. border-radius: 10px;
  139. padding: 0 10px;
  140. background-color: #ffffff5f;
  141. .title {
  142. display: flex;
  143. flex-direction: column;
  144. padding: 20px 0 10px 0;
  145. .titles {
  146. color: rgb(2, 68, 139);
  147. // font-family: '黑体';
  148. font-size: 24px;
  149. font-weight: 500;
  150. line-height: 35px;
  151. letter-spacing: 0px;
  152. }
  153. }
  154. .other {
  155. position: absolute;
  156. bottom: 30px;
  157. p {
  158. color: #ffffff;
  159. font-size: 12px;
  160. margin: 0 0 10px 0;
  161. }
  162. }
  163. }
  164. }
  165. .activeList {
  166. width: 20%;
  167. animation: mymove 1s;
  168. animation-iteration-count: 1;
  169. .mess {
  170. background-color: #30a0ff9f;
  171. .title {
  172. .titles {
  173. color: rgb(255, 255, 255);
  174. // font-family: '黑体';
  175. font-size: 24px;
  176. font-weight: 500;
  177. line-height: 35px;
  178. letter-spacing: 2px;
  179. margin: 0 0 10px 0;
  180. }
  181. .borderBottom {
  182. display: inline-block;
  183. width: 60px;
  184. border-bottom: 2px solid #ffffff;
  185. }
  186. }
  187. .other {
  188. p {
  189. color: rgb(255, 255, 255);
  190. // font-family: '黑体';
  191. font-size: 16px;
  192. font-weight: 500;
  193. line-height: 23px;
  194. letter-spacing: 0px;
  195. }
  196. }
  197. }
  198. }
  199. }
  200. }
  201. @keyframes mymove {
  202. from {
  203. width: 15%;
  204. }
  205. to {
  206. width: 20%;
  207. }
  208. }
  209. </style>