index.vue 965 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="ele-body">
  3. <jimureportBrowse :url="fileUrl"></jimureportBrowse>
  4. </div>
  5. </template>
  6. <script>
  7. import jimureportBrowse from '@/components/jimureport/browse.vue';
  8. import { getServiceurl } from '@/components/jimureport/api.js';
  9. import { getToken } from '@/utils/token-util';
  10. export default {
  11. components: {
  12. jimureportBrowse
  13. },
  14. data() {
  15. return {
  16. fileUrl: ''
  17. };
  18. },
  19. computed: {},
  20. watch: {
  21. '$route'(to, from) {
  22. if (to.path) {
  23. this.getJmPrintBrowse(); // 重新加载数据
  24. }
  25. }
  26. },
  27. created() {
  28. this.getJmPrintBrowse()
  29. },
  30. methods: {
  31. async getJmPrintBrowse(){
  32. let id = this.$route.path.split('/').pop()
  33. let url = await getServiceurl();
  34. this.fileUrl = `${url}/jmreport/view/${id}?token=${getToken()}`;
  35. }
  36. }
  37. };
  38. </script>
  39. <style lang="scss" scoped>
  40. </style>