model.vue 754 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. type: 'model',
  17. fileId: 10000898047083,
  18. showType: '1',
  19. title: '模型'
  20. }
  21. }
  22. },
  23. onLoad(body) {
  24. this.initModel();
  25. },
  26. methods: {
  27. initModel() {
  28. getBimViewToken(this.option.fileId).then(res => {
  29. this.webViewUrl =
  30. `${config.baseUrl}/webview/bim/preview.html?viewToken=${res.data}&title=${this.option.title}&showType=${this.option.showType}`;
  31. })
  32. }
  33. }
  34. }
  35. </script>
  36. <style>
  37. </style>