3a75c3bfa034e0789448322d582923fc67d80e8b.svn-base 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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: '350105',
  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/DZXSKWTQD&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/DZXSKWTQD&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: '4'
  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. if(data.id.endsWith("000000")){
  74. this.adCode = data.id.substr(0,6)
  75. }else{
  76. this.adCode = data.id.substr(0,4)
  77. }
  78. this.name = data.pnm
  79. this.id = node.parent.data.pid
  80. }
  81. }
  82. }
  83. };
  84. </script>
  85. <style>
  86. </style>