index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <Page title="工作">
  3. <template v-slot:body>
  4. <div class="w-full h-full">
  5. <div class="workLayout" @click.stop>
  6. <div class="text-gray-950 text-center modulistImage" v-for="(item) in moduleList" :key="item.id"
  7. @click.stop="toModuleList(item)">
  8. <img :src="returnImageAddress(item)" />
  9. <div class="modulistText">{{ item.name }}</div>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <template v-slot:footer>
  15. <Footer />
  16. </template>
  17. </Page>
  18. </template>
  19. <script setup>
  20. import { ref } from "vue";
  21. import { useLifecycle } from "@hooks/useCommon.js";
  22. import { routingInfos } from "@utility/generalVariables.js";
  23. import useInfoStore from "@store/useInfoStore"
  24. import useRouterStore from "@store/useRouterStore.js";
  25. import Footer from "@components/page/footer.vue";
  26. const userInfo = useInfoStore()
  27. const router = useRouterStore()
  28. const moduleList = ref((userInfo.modularList || []).filter((item) => item.path != '/biReport'))
  29. function toModuleList(item) {
  30. const jumpTo = routingInfos[item.path.replace('/', '')]
  31. router.navigateTo({
  32. pathName: 'moduleList',
  33. success: () => {
  34. router.emit('moduleListDetailParameter', {
  35. row: JSON.stringify(jumpTo)
  36. })
  37. }
  38. })
  39. }
  40. function returnImageAddress(rows) {
  41. const row = routingInfos[rows.path.replace('/', '')]
  42. return row?.moduleImage
  43. }
  44. useLifecycle({
  45. load: () => {
  46. }
  47. });
  48. </script>
  49. <style lang="scss" scoped>
  50. .workLayout {
  51. margin: 20px;
  52. padding-bottom: 20px;
  53. overflow: auto;
  54. background-color: #fff;
  55. border-radius: 8px;
  56. display: flex;
  57. flex-wrap: wrap;
  58. }
  59. .modulistImage {
  60. width: 140px;
  61. height: 140px;
  62. position: relative;
  63. margin-left: 18px;
  64. margin-top: 18px;
  65. img {
  66. width: 100%;
  67. height: 100%;
  68. }
  69. .modulistText {
  70. position: absolute;
  71. font-size: 18px;
  72. top: 20px;
  73. left: 16px;
  74. }
  75. }
  76. </style>