index.vue 4.8 KB

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