Sksjglyl.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="container">
  3. <div id="header">
  4. <div class="logo">
  5. <img
  6. src="/static/images/logo.png"
  7. style="width: 24px; height: 24px; vertical-align: middle"
  8. alt=""
  9. />
  10. 青浦区“一张图”区级节点
  11. </div>
  12. </div>
  13. <div style="z-index: 999;right: 20px; position: absolute;line-height: 44px;">
  14. <span v-for="item in funcList" :key="item.label" :class="{'tab-item_active': item.type == activeName , 'tab-item': item.type != activeName}" @click="handleClick(item)">{{item.label}}</span>
  15. <!-- <el-tabs
  16. v-model="activeName"
  17. type="border-card"
  18. class="demo-tabs"
  19. @tab-click="handleClick"
  20. >
  21. <el-tab-pane v-for="item in funcList" :key="item.label" :label="item.label" :name="item.label">
  22. </el-tab-pane>
  23. </el-tabs> -->
  24. </div>
  25. <div style="height: 44px;"></div>
  26. <!-- 复用的iframe:根据激活标签动态改src -->
  27. <div class="win-iframe-container">
  28. <iframe
  29. :src="iframeSrc"
  30. width="100%"
  31. height="100%"
  32. frameborder="0"
  33. allowfullscreen
  34. ></iframe>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. activeName: "",
  43. funcList: systemConfig.sksjgl.list,
  44. nowFuncContent: [],
  45. iframeSrc: "",
  46. };
  47. },
  48. mounted() {
  49. this.dmsDataProxy = systemConfig.dmsDataProxy;
  50. this.activeName = this.$route.query.activePanel ? this.$route.query.activePanel : "";
  51. this.changePanel(this.activeName);
  52. },
  53. methods: {
  54. changePanel(active) {
  55. console.log("========"+active);
  56. this.activeName = parseInt(active);
  57. this.nowFuncContent = this.funcList[this.activeName - 1];
  58. this.iframeSrc = this.nowFuncContent.url;
  59. },
  60. handleClick(tab) {
  61. console.log("========"+tab);
  62. this.iframeSrc = this.funcList.find(item => item.label == tab.label).url;
  63. this.activeName = tab.type;
  64. },
  65. handleClick2(tab, event) {
  66. let label = tab.props.label;
  67. this.iframeSrc = this.funcList.find(item => item.label == label).url;
  68. }
  69. },
  70. };
  71. </script>
  72. <style>
  73. .el-tabs--border-card>.el-tabs__content {
  74. padding: 0;
  75. display: none;
  76. }
  77. </style>
  78. <style lang="less" scoped>
  79. .container {
  80. width: 100%;
  81. height: 100%;
  82. margin: 0 auto;
  83. padding: 0;
  84. }
  85. .win-iframe {
  86. width: 100%;
  87. height: 100%;
  88. }
  89. .win-iframe-container {
  90. width: 100%;
  91. height: 100%;
  92. }
  93. .tab-item {
  94. display: inline-block;
  95. padding: 0 10px;
  96. cursor: pointer;
  97. color: #ffffff;
  98. &:hover {
  99. color: #409eff;
  100. }
  101. }
  102. .tab-item_active {
  103. display: inline-block;
  104. padding: 0 10px;
  105. cursor: pointer;
  106. color: #409eff;
  107. }
  108. #header::after {
  109. content: "";
  110. position: absolute;
  111. bottom: 0;
  112. left: 0;
  113. width: 100%;
  114. height: 1px; /* 边框厚度 */
  115. background-image: linear-gradient(to right, #071b3c, #71a5d4, #071b3c);
  116. }
  117. #header {
  118. width: 100vw;
  119. height: 44px;
  120. background: linear-gradient(180deg, #2c2f74, #494d98);
  121. color: #ffffff;
  122. margin: 0 auto;
  123. position: absolute;
  124. background: #002153;
  125. z-index: 999;
  126. .logo {
  127. display: inline-block;
  128. height: 44px;
  129. // width: 200px;
  130. // padding: 0 20px;
  131. padding: 0 20px 0px 20px;
  132. text-align: center;
  133. line-height: 44px;
  134. font-size: 18px;
  135. font-weight: bold;
  136. }
  137. }
  138. </style>