ESOP.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <el-scrollbar>
  3. <Empty v-if="srcList.length < 1" />
  4. <div class="grid-container" v-else>
  5. <div v-for="(box, index) in srcList" :key="index" class="suit-box">
  6. <div class="pdf-box" @click="toShowPDF(box)">
  7. <el-image class="pdf-box" :src="baseUrl + box.filePath + '.jpg'">
  8. <template #error>
  9. <el-image class="pdf-box" :src="DefaultPDF" fit="cover" />
  10. </template>
  11. </el-image>
  12. <!-- <PDFView :need-to-show-pdf="true" :pdf-source="baseUrl + box.pdfPath" />-->
  13. </div>
  14. <div class="suit-title">{{ box?.title }}</div>
  15. <div class="suit-desc">{{ box?.created }}</div>
  16. </div>
  17. <PDFDrawerView ref="PDFDrawerViewRef"></PDFDrawerView>
  18. </div>
  19. </el-scrollbar>
  20. </template>
  21. <script lang="ts" setup>
  22. import { esopData } from "@/api/prosteps/espo";
  23. import { useProcessStore } from "@/store";
  24. import DefaultPDF from "@/assets/images/401.gif";
  25. const store = useProcessStore();
  26. const baseUrl = import.meta.env.VITE_APP_UPLOAD_URL;
  27. defineOptions({
  28. name: "Esop",
  29. });
  30. const srcList = ref([]);
  31. const getPdfListData = async () => {
  32. const { data } = await esopData({
  33. operationId: store.odersData.operationId,
  34. pageNo: 1,
  35. pageSize: 999,
  36. });
  37. srcList.value = data.records;
  38. };
  39. onMounted(() => {
  40. getPdfListData();
  41. });
  42. const PDFDrawerViewRef = ref(null);
  43. const toShowPDF = (row) => {
  44. let url = import.meta.env.VITE_APP_UPLOAD_URL + row.filePath;
  45. PDFDrawerViewRef.value && PDFDrawerViewRef.value.showPdf(url);
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .grid-container {
  50. display: grid;
  51. /*行间距*/
  52. grid-row-gap: 24px;
  53. /*列间距*/
  54. grid-column-gap: 24px;
  55. overflow-y: auto;
  56. //padding: 24px;
  57. width: calc(100% - 48px);
  58. grid-template-columns: 1fr 1fr 1fr;
  59. height: calc(100vh - 260px);
  60. .suit-box {
  61. height: 343px;
  62. background-color: white;
  63. border-radius: 16px 16px 16px 16px;
  64. display: flex;
  65. flex-direction: column;
  66. align-items: start;
  67. justify-content: center;
  68. position: relative;
  69. .pdf-box {
  70. height: 263px;
  71. width: 100%;
  72. overflow: hidden;
  73. }
  74. .suit-title {
  75. font-weight: 500;
  76. font-size: 20px;
  77. color: rgba(0, 0, 0, 0.9);
  78. text-align: left;
  79. margin-left: 24px;
  80. }
  81. .suit-desc {
  82. font-size: 20px;
  83. color: rgba(0, 0, 0, 0.6);
  84. text-align: left;
  85. margin-left: 24px;
  86. }
  87. .download-btn {
  88. position: absolute;
  89. right: 20px;
  90. top: 20px;
  91. }
  92. }
  93. }
  94. </style>