index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <script setup>
  2. import { closeToast, showLoadingToast } from 'vant'
  3. import Pdfh5 from 'pdfh5'
  4. const { currentRoute } = useRouter()
  5. const route = currentRoute.value
  6. const gw_id = route.query.gw_id
  7. const detailData = ref({})
  8. let pdfHeight = $ref('')
  9. showLoadingToast({
  10. message: '加载中...',
  11. forbidClick: true,
  12. })
  13. request({
  14. url: '/jdbg/gwgl_gw/detail',
  15. data: {
  16. gw_id,
  17. },
  18. }).then((res) => {
  19. closeToast()
  20. detailData.value = res.data.one_info
  21. const appendUrl = res.data.one_info.gw_content.split('|')[0]
  22. const curFileShowUrl = window.globalVariables.api
  23. + appendUrl.replace(/\.\w+$/, '.pdf')
  24. const pdfh5 = new Pdfh5('#pdfContent', {
  25. pdfurl: curFileShowUrl,
  26. scrollEnable: false,
  27. zoomEnable: false,
  28. })
  29. pdfh5.on('complete', (status, msg) => {
  30. const height = document.getElementsByClassName("pageContainer")[0].style['min-height'];
  31. const num = document.getElementsByClassName("pageContainer").length
  32. pdfHeight = parseFloat(height) * num + 50
  33. });
  34. })
  35. </script>
  36. <template>
  37. <div>
  38. <div class="tableContainer">
  39. <div class="topPart">
  40. <table class="Tb" width="100%" cellspacing="0" cellpadding="0">
  41. <tr>
  42. <td class="titleOpt">
  43. 类型:
  44. </td>
  45. <td>{{ detailData.lb_name }}</td>
  46. </tr>
  47. <tr>
  48. <td class="titleOpt">
  49. 标题:
  50. </td>
  51. <td>{{ detailData.gw_title }}</td>
  52. </tr>
  53. <tr>
  54. <td class="titleOpt">
  55. 发文字号:
  56. </td>
  57. <td>{{ detailData.gw_zh }}</td>
  58. </tr>
  59. <tr>
  60. <td class="titleOpt">
  61. 发起人:
  62. </td>
  63. <td>{{ detailData.gw_fqr_name }}</td>
  64. </tr>
  65. <tr>
  66. <td class="titleOpt">
  67. 发起科室:
  68. </td>
  69. <td>{{ detailData.gw_fqks_name }}</td>
  70. </tr>
  71. <tr>
  72. <td class="titleOpt">
  73. 发起时间:
  74. </td>
  75. <td>{{ detailData.create_dateline }}</td>
  76. </tr>
  77. <tr>
  78. <td class="titleOpt">
  79. 当前步骤:
  80. </td>
  81. <td>{{ detailData.gw_bz }}</td>
  82. </tr>
  83. <tr>
  84. <td class="titleOpt">
  85. 当前审核人:
  86. </td>
  87. <td>{{ detailData.gw_shr }}</td>
  88. </tr>
  89. <tr>
  90. <td class="titleOpt">
  91. 状态:
  92. </td>
  93. <td>{{ detailData.gw_status_option_n }}</td>
  94. </tr>
  95. </table>
  96. </div>
  97. </div>
  98. <div id="pdfContent" :style="{ height: pdfHeight + 'px' }" />
  99. </div>
  100. </template>
  101. <style lang="scss" scoped></style>