bimShow.vue 703 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view>
  3. <web-view v-if="webViewUrl" :src="webViewUrl"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. import config from "@/config";
  8. import {
  9. getBimViewToken
  10. } from '@/request/api/bim.js'
  11. export default {
  12. data() {
  13. return {
  14. webViewUrl: null,
  15. option: {}
  16. }
  17. },
  18. onLoad(body) {
  19. this.option = body;
  20. if (body.type == 'model') this.initModel();
  21. },
  22. methods: {
  23. initModel() {
  24. getBimViewToken(this.option.fileId).then(res => {
  25. this.webViewUrl =
  26. `${config.baseUrl}/webview/bim/preview.html?viewToken=${res.data}&title=${this.option.title}&showType=${this.option.showType}`;
  27. })
  28. }
  29. }
  30. }
  31. </script>
  32. <style>
  33. </style>