| | |
| | | <template> |
| | | <iframe ref="iframe" :src="url" scrolling="auto" :style="{height:'calc(100% - 5px)',width:'100%',border:'none'}" /> |
| | | <div class="report-box"> |
| | | <iframe id="iframe-box" @load="loadFrame" ref="iframe" :src="url" scrolling="auto" :style="{height:'100%',width:'100%',border:'none'}" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | let token = getToken(); |
| | | this.url = globalConf.baseUrl + `/jmreport/view/ff9bd143582a6dfed897ba8b6f93b175?token=${token}` |
| | | this.height = window.screen.availHeight |
| | | }, |
| | | methods:{ |
| | | loadFrame() { |
| | | const iframeBox = document.getElementById('iframe-box') |
| | | const doc = iframeBox.contentWindow.document |
| | | const head = doc.getElementsByTagName('head') |
| | | const linkTag = document.createElement('link') |
| | | linkTag.id = 'newstyle' |
| | | linkTag.href = `./iframe.css` |
| | | linkTag.setAttribute('rel', 'stylesheet') |
| | | linkTag.setAttribute('type', 'text/css') |
| | | head[0].append(linkTag) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <style lang="scss"> |
| | | .report-box{ |
| | | height: calc( 100vh - 150px ); |
| | | } |
| | | </style> |