index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <div class="big-screen-home-wrap">
  3. <header class="big-screen-home-wrap-top">
  4. <div class="logo-title">
  5. <img
  6. class="logo"
  7. :src="logo"
  8. >
  9. <span>{{ title || 'GCPAAS大屏设计器' }}</span>
  10. </div>
  11. <div class="big-screen-nav-container">
  12. <Nav
  13. :navs="tabList"
  14. @change="changeTab"
  15. />
  16. </div>
  17. </header>
  18. <div class="big-screen-router-view-wrap">
  19. <keep-alive>
  20. <router-view />
  21. </keep-alive>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import Nav from './NavTop.vue'
  27. // import Nav from './Nav.vue'
  28. export default {
  29. name: 'BigScreenHome',
  30. components: {
  31. Nav
  32. },
  33. props: [],
  34. data () {
  35. return {
  36. // 和此处路由保持一致,将会激活tab,请按需更改
  37. }
  38. },
  39. computed: {
  40. title () {
  41. if (this.$route.query.edit) return '大屏设计器'
  42. return window?.BS_CONFIG?.starter?.title
  43. },
  44. logo () {
  45. return window?.BS_CONFIG?.starter?.logo || require('./images/logo.png')
  46. },
  47. tabList () {
  48. if (this.$route.query.edit) {
  49. return [
  50. {
  51. id: 1,
  52. name: '资源库',
  53. path: window?.BS_CONFIG?.routers?.sourceUrl || '/big-screen-source',
  54. icon: 'icon-tupian'
  55. },
  56. {
  57. id: 2,
  58. name: '组件库',
  59. path: window?.BS_CONFIG?.routers?.componentUrl || '/big-screen-components',
  60. icon: 'icon-zujian1'
  61. }
  62. ]
  63. }
  64. return [
  65. {
  66. id: 0,
  67. name: '大屏管理',
  68. path: window?.BS_CONFIG?.routers?.pageListUrl || '/big-screen-list',
  69. icon: 'icon-icon-shujudaping'
  70. },
  71. // {
  72. // id: 1,
  73. // name: '模版管理',
  74. // path: window?.BS_CONFIG?.routers?.templateListUrl || '/big-screen-template',
  75. // icon: 'icon-xiangmuwenjianmobanku_mobanku'
  76. // },
  77. {
  78. id: 1,
  79. name: '资源库',
  80. path: window?.BS_CONFIG?.routers?.sourceUrl || '/big-screen-source',
  81. icon: 'icon-tupian'
  82. },
  83. {
  84. id: 2,
  85. name: '组件库',
  86. path: window?.BS_CONFIG?.routers?.componentUrl || '/big-screen-components',
  87. icon: 'icon-zujian1'
  88. },
  89. {
  90. id: 3,
  91. name: '数据源管理',
  92. path:
  93. window?.BS_CONFIG?.routers?.dataSourceUrl ||
  94. '/big-screen-dataSource',
  95. icon: 'icon-datafull'
  96. },
  97. {
  98. id: 4,
  99. name: '数据集管理',
  100. path: window?.BS_CONFIG?.routers?.dataSetUrl || '/big-screen-dataSet',
  101. icon: 'icon-data'
  102. }
  103. ]
  104. }
  105. },
  106. created () {},
  107. methods: {
  108. changeTab (tab) {
  109. if (this.$route.query.edit) {
  110. this.$router.push({
  111. path: tab.path,
  112. query: { edit: 1 }
  113. })
  114. } else {
  115. this.$router.push({
  116. path: tab.path
  117. })
  118. }
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .big-screen-home-wrap > * {
  125. box-sizing: border-box;
  126. }
  127. .big-screen-home-wrap {
  128. height: 100%;
  129. .big-screen-home-wrap-top {
  130. position: fixed;
  131. top: 0;
  132. width: 100%;
  133. height: 150px;
  134. background-image: url('./images/nav_img.png');
  135. background-size: 100% 150px;
  136. background-color: #0D0F12;
  137. background-position: center right;
  138. .logo-title {
  139. // 禁用可选
  140. user-select: none;
  141. font-size: 30px;
  142. position: absolute;
  143. z-index: 23;
  144. top: 40px;
  145. left: 40px;
  146. display: flex;
  147. align-items: center;
  148. color: var(--bs-el-color-primary);
  149. .logo {
  150. height: 30px;
  151. }
  152. span {
  153. font-family: Source Han Sans CN;
  154. font-size: 30px;
  155. font-weight: 700;
  156. padding-left: 8px;
  157. -webkit-background-clip: text;
  158. background-size: 400% 400%;
  159. }
  160. }
  161. }
  162. .big-screen-router-view-wrap {
  163. position: absolute;
  164. top: 150px;
  165. overflow: hidden;
  166. // padding-top: 16px;
  167. width: 100%;
  168. height: calc(100vh - 150px);
  169. background-color: var(--bs-background-1);
  170. box-sizing: border-box;
  171. padding-top: 16px;
  172. padding-right: 16px;
  173. padding-bottom: 16px;
  174. }
  175. }
  176. @keyframes text-animate {
  177. 0% {
  178. background-position: 0 0;
  179. -webkit-background-clip: text;
  180. }
  181. 50% {
  182. background-position: 0 0;
  183. -webkit-background-clip: text;
  184. }
  185. 100% {
  186. background-position: 0 0;
  187. -webkit-background-clip: text;
  188. }
  189. }
  190. </style>