4e3c426dc6ff2cdf8dca63dce6acfa5a29a9990a.svn-base 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <el-container>
  3. <el-aside width="20%">
  4. <el-tree
  5. ref="trees"
  6. :data="nodeInfos"
  7. :props="defaultProps"
  8. node-key="id"
  9. @node-click="handleNodeClick">
  10. </el-tree>
  11. </el-aside>
  12. <el-main id="dxdcListMain" style="padding:5px 20px;">
  13. <div :style="{'width': '100%','height': iframeHeight + 'px'}">
  14. <iframe ref="frameMain" id="frameMain" name="frameMain" :src="tableSrc" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  15. </div>
  16. </el-main>
  17. </el-container>
  18. </template>
  19. <script>
  20. import request from "@util/gw_ajax_request.js";
  21. import {getTrees} from "@util/gw_formatTree.js"
  22. import {getRyNodeProvincialNogroup} from '@api/reportApi.js'
  23. import {reportHosturl} from '@util/global_variable.js'
  24. export default {
  25. components: {
  26. },
  27. props: [],
  28. data() {
  29. return {
  30. iframeHeight: window.innerHeight - 200,
  31. nodeInfos: [],
  32. defaultProps: {
  33. children: 'children',
  34. label: 'pnm'
  35. },
  36. adCode: '',
  37. name: '',
  38. tableSrc: '',
  39. id: '', //组id
  40. };
  41. },
  42. computed: {
  43. persId() {
  44. return localStorage.getItem("userid")
  45. ? localStorage.getItem("userid")
  46. : "1098101939614724096";
  47. }
  48. },
  49. mounted() {
  50. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=fujian/DZXSKWTHZ&adCode=${this.adCode}&name=${this.name}&id=${this.id}&persId=${this.persId}`
  51. this.getLeftTreeData()
  52. },
  53. watch: {
  54. adCode(val){
  55. this.tableSrc = `${reportHosturl}/demo/reportJsp/showReport.jsp?rpx=fujian/DZXSKWTHZ&adCode=${this.adCode}&name=${this.name}&id=${this.id}&persId=${this.persId}`
  56. }
  57. },
  58. methods: {
  59. getLeftTreeData(){
  60. let params = {
  61. userId: this.persId,
  62. orgType: '022',
  63. level: '3'
  64. }
  65. getRyNodeProvincialNogroup(params).then(res=>{
  66. if(res.success){
  67. this.nodeInfos = getTrees(res.data)
  68. }
  69. })
  70. },
  71. handleNodeClick(data,node){
  72. if(node.isLeaf){
  73. this.adCode = data.id.substr(0,4)
  74. this.name = data.pnm
  75. this.id = data.pid
  76. }
  77. }
  78. }
  79. };
  80. </script>
  81. <style>
  82. </style>