Yxgl.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <el-affix :offset="0">
  3. <div style="height: 70px;width: 100vw;background: #08224a;"></div>
  4. </el-affix>
  5. <el-affix :offset="70">
  6. <div id="yxgl_box">
  7. <el-menu
  8. :default-active="menuActive"
  9. class="el-menu-vertical-demo"
  10. :collapse="isCollapse"
  11. @open="handleOpen"
  12. @close="handleClose"
  13. @select="changeMenu"
  14. >
  15. <el-sub-menu index="/#">
  16. <template #title>
  17. <el-icon><Platform /></el-icon>
  18. <span>信息反馈子系统</span>
  19. </template>
  20. <el-menu-item index="StatisticalAnalysis">
  21. <el-icon><Histogram /></el-icon>
  22. <template #title>信息反馈</template>
  23. </el-menu-item>
  24. </el-sub-menu>
  25. <el-sub-menu index="2" v-if="$getUserType() == 3">
  26. <template #title>
  27. <el-icon><Tools /></el-icon>
  28. <span>运行管理子系统</span>
  29. </template>
  30. <el-menu-item index="oauth">
  31. <el-icon><UserFilled /></el-icon>
  32. <template #title>用户权限</template>
  33. </el-menu-item>
  34. <el-menu-item index="dms">
  35. <el-icon><Ticket /></el-icon>
  36. <template #title>数据管理</template>
  37. </el-menu-item>
  38. </el-sub-menu>
  39. </el-menu>
  40. <div
  41. class="viewBox"
  42. :style="{
  43. width: isCollapse ? 'calc(100vw - 60px)' : 'calc(100% - 200px)',
  44. background: menuActive == 'StatisticalAnalysis' ? '#08224a' : '#08224a',
  45. overflowY: menuActive == 'StatisticalAnalysis' ? 'auto' : 'hidden',
  46. }"
  47. >
  48. <el-backtop target=".viewBox" :right="20" :bottom="70" />
  49. <StatisticalAnalysis v-if="menuActive == 'StatisticalAnalysis'" />
  50. <iframe v-else :src="iframeUrl" frameborder="0"></iframe>
  51. </div>
  52. </div>
  53. </el-affix>
  54. </template>
  55. <script>
  56. import StatisticalAnalysis from "@/views/yxgl/StatisticalAnalysis.vue";
  57. export default {
  58. name: "yxgl",
  59. data() {
  60. return {
  61. isCollapse: false,
  62. menuActive: "StatisticalAnalysis",
  63. iframeUrl: "",
  64. };
  65. },
  66. // 2. 局部注册组件(键值同名可简写)
  67. components: {
  68. StatisticalAnalysis, // 完整写法:MyButton: MyButton
  69. },
  70. mounted() {},
  71. methods: {
  72. handleOpen(key, keyPath) {
  73. console.log(key, keyPath);
  74. },
  75. handleClose(key, keyPath) {
  76. console.log(key, keyPath);
  77. },
  78. changeMenu(key, keyPath) {
  79. this.menuActive = key;
  80. switch (key) {
  81. case "dms":
  82. // window.open(
  83. // systemConfig.backServerPath + ":" + systemConfig.dmsWebUrlPort,
  84. // "_blank"
  85. // );
  86. this.iframeUrl = systemConfig.backServerPath + ":" + systemConfig.dmsWebUrlPort;
  87. break;
  88. case "oauth":
  89. // window.open(
  90. // systemConfig.backServerPath + ":" + systemConfig.oauthWebUrlPort,
  91. // "_blank"
  92. // );
  93. this.iframeUrl =
  94. systemConfig.backServerPath + ":" + systemConfig.oauthWebUrlPort;
  95. break;
  96. default:
  97. break;
  98. }
  99. console.log(this.menuActive, this.iframeUrl);
  100. },
  101. },
  102. };
  103. </script>
  104. <style lang="less" scoped>
  105. #yxgl_box {
  106. width: 100vw;
  107. // height: calc(100vh - 120px);
  108. height: 100vh;
  109. margin: 0;
  110. display: flex;
  111. overflow: hidden;
  112. }
  113. .el-menu-vertical-demo:not(.el-menu--collapse) {
  114. width: 200px;
  115. // height: calc(100vh - 120px);
  116. height: 100vh;
  117. margin: 0;
  118. background: #08224a;
  119. }
  120. .viewBox {
  121. width: calc(100vw - 200px);
  122. margin: 0;
  123. // height: calc(100vh - 120px);
  124. height: 100vh;
  125. position: relative;
  126. overflow: hidden;
  127. overflow-y: auto;
  128. padding-bottom: 120px;
  129. }
  130. iframe {
  131. width: 100%;
  132. height: calc(100%);
  133. background: #08224a;
  134. }
  135. </style>