bimShow.vue 679 B

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