4a6b6d5cd103d83bed9727cc6337e36ee5b4858c.svn-base 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div style="width: 100%;height: 100%;" v-loading="loading">
  3. <iframe id="frameMain"
  4. :src="currentSrc"
  5. frameborder="0"></iframe>
  6. </div>
  7. </template>
  8. <script>
  9. export default {
  10. name: "dcskfb",
  11. data() {
  12. return {
  13. loading:true,
  14. currentSrc:'',
  15. screenHeight: window.innerHeight,
  16. screenWidth: window.innerWidth,
  17. }
  18. },
  19. mounted(){
  20. const that = this;
  21. window.onresize = () => {
  22. return (() => {
  23. that.screenHeight = window.innerHeight - 90
  24. that.screenWidth = window.innerWidth
  25. })()
  26. }
  27. console.log(`当前高度${that.screenHeight},当前宽度${that.screenWidth}`);
  28. that.currentSrc = `http://slbdc.mwr.gov.cn/JsReport/reportFiles/reportjsp/showReport_hzz.jsp?raq=problemIdentified4.raq&width=${that.screenWidth}&height=${that.screenHeight}`
  29. },
  30. activated() {
  31. let _this = this;
  32. let iframe = document.getElementById("frameMain");
  33. iframe.onload = function(){
  34. _this.loading = false;
  35. };
  36. iframe.width = _this.screenWidth;
  37. iframe.height = _this.screenHeight;
  38. }
  39. }
  40. </script>
  41. <style scoped>
  42. </style>