index.vue 5.0 KB

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