ToggleTenant.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template >
  2. <div class="ms-login2" :class="$route.path !== '/nav' ? 'ms-login' : ''">
  3. <div class="ms-main">
  4. <div class="ms-content">
  5. <div class="ms-tenantslist-title">
  6. <p class="">你有多个租户节点,请选择租户</p>
  7. </div>
  8. <hr />
  9. <div class="tanantslist-box">
  10. <el-scrollbar style="height: 260px; padding: 20px 0px; margin-right: -21px">
  11. <ul class="ms-tenantslist">
  12. <li v-for="(item, index) in selectDta" :key="index" @click="selectTenant(item)">
  13. <div>{{ item.tenantName }}</div>
  14. </li>
  15. </ul>
  16. </el-scrollbar>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. props: {
  25. selectDta: {
  26. type: Array,
  27. default: () => []
  28. }
  29. },
  30. methods: {
  31. selectTenant(item) {
  32. if (this.$route.query.tenantId == item.tenantId) {
  33. this.$parent.toggleTenant();
  34. return;
  35. }
  36. if (this.$route.path == '/nav') {
  37. this.$parent.selectTenant(item);
  38. } else {
  39. window.sessionStorage.setItem('loginJson', JSON.stringify(this.selectDta));
  40. window.sessionStorage.setItem('loginJsonActive', JSON.stringify(item ));
  41. this.$router.push({
  42. path: '/nav',
  43. // query: {
  44. // phone: item.phone,
  45. // tenantId: item.tenantId
  46. // }
  47. });
  48. }
  49. }
  50. }
  51. };
  52. </script>
  53. <style lang='scss' scoped>
  54. .ms-login2 {
  55. position: absolute;
  56. top: 50%;
  57. left: 50%;
  58. transform: translate(-50%, -50%);
  59. // background: rgba(255, 255, 255, 0.05);
  60. z-index: 10;
  61. & > .ms-main {
  62. display: flex;
  63. justify-content: center;
  64. align-content: center;
  65. flex-direction: row;
  66. position: relative;
  67. z-index: 999;
  68. border: 1px solid rgba(240, 238, 241, 0.2);
  69. border-radius: 10px;
  70. padding: 20px !important;
  71. .ms-content {
  72. display: flex;
  73. justify-content: center;
  74. align-content: center;
  75. flex-direction: column;
  76. position: relative;
  77. height: 100%;
  78. width: 100%;
  79. .ms-tenantslist-title {
  80. padding: 0px 30px 20px;
  81. height: 90px;
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. margin: 0 8px;
  86. p {
  87. font-size: 20px;
  88. font-family: PingFang SC;
  89. font-weight: 600;
  90. color: #ffffff;
  91. opacity: 0.5;
  92. }
  93. }
  94. hr {
  95. width: 100%;
  96. height: 1px;
  97. padding-left: 30px;
  98. padding-right: 30px;
  99. background: #ffffff;
  100. opacity: 0.2;
  101. }
  102. }
  103. }
  104. .ms-tenantslist {
  105. margin: 30px 0;
  106. li {
  107. margin: 0 auto 20px auto;
  108. background: rgba(255, 255, 255, 0.05);
  109. padding: 20px;
  110. border-radius: 6px;
  111. border: 1px solid rgba(255, 255, 255, 0.3);
  112. div {
  113. background-size: 340px 61px;
  114. font-size: 16px;
  115. font-family: Microsoft YaHei;
  116. font-weight: 400;
  117. color: #ffffff;
  118. line-height: 61px;
  119. height: 61px;
  120. }
  121. }
  122. li:hover {
  123. border-radius: 6px;
  124. background: linear-gradient(-80deg, #2a68e6 0%, #2887f2) no-repeat;
  125. }
  126. }
  127. .tanantslist-box {
  128. width: 100%;
  129. display: flex;
  130. align-items: center;
  131. justify-content: center;
  132. flex-direction: column;
  133. position: relative;
  134. .el-scrollbar {
  135. padding: 0 !important;
  136. margin-right: -2px !important;
  137. }
  138. /deep/.el-scrollbar {
  139. width: 100%;
  140. height: 260px;
  141. }
  142. /deep/.el-scrollbar__wrap {
  143. overflow-x: hidden;
  144. }
  145. /deep/ .is-horizontal {
  146. display: none;
  147. }
  148. /deep/ .el-scrollbar__bar {
  149. right: 0px;
  150. }
  151. }
  152. }
  153. .ms-login.ms-login2 {
  154. right: 215px;
  155. left: auto;
  156. transform: translateY(-50%);
  157. .ms-main {
  158. width: 400px;
  159. opacity: 0.8;
  160. background: linear-gradient(0deg, #101327 0%, #29314c 100%);
  161. }
  162. }
  163. </style>