index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 ?? 'DataRoom大屏设计器'
  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. document.title = this.title
  121. },
  122. mounted () {
  123. this.giteeHref = 'https://gitee.com/gcpaas/DataRoom'
  124. this.giteeSvg = 'https://gitee.com/gcpaas/DataRoom/widgets/widget_1.svg?color=007bff'
  125. },
  126. methods: {
  127. changeTab (tab) {
  128. if (this.$route.query.edit) {
  129. this.$router.push({
  130. path: tab.path,
  131. query: { edit: 1 }
  132. })
  133. } else {
  134. this.$router.push({
  135. path: tab.path
  136. })
  137. }
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. .big-screen-home-wrap > * {
  144. box-sizing: border-box;
  145. }
  146. .big-screen-home-wrap {
  147. height: 100%;
  148. .big-screen-home-wrap-top {
  149. position: fixed;
  150. top: 0;
  151. width: 100%;
  152. height: 150px;
  153. background-image: url('./images/nav_img.png');
  154. background-size: 100% 150px;
  155. background-color: #0D0F12;
  156. background-position: center right;
  157. .logo-title {
  158. // 禁用可选
  159. user-select: none;
  160. font-size: 30px;
  161. position: absolute;
  162. z-index: 23;
  163. top: 40px;
  164. left: 40px;
  165. display: flex;
  166. align-items: center;
  167. color: var(--bs-el-color-primary);
  168. .logo {
  169. height: 30px;
  170. }
  171. span {
  172. font-family: Source Han Sans CN;
  173. font-size: 30px;
  174. font-weight: 700;
  175. padding-left: 8px;
  176. -webkit-background-clip: text;
  177. background-size: 400% 400%;
  178. }
  179. }
  180. }
  181. .big-screen-router-view-wrap {
  182. position: absolute;
  183. top: 150px;
  184. overflow: hidden;
  185. // padding-top: 16px;
  186. width: 100%;
  187. height: calc(100vh - 150px);
  188. background-color: var(--bs-background-1);
  189. box-sizing: border-box;
  190. padding-top: 16px;
  191. padding-right: 16px;
  192. padding-bottom: 16px;
  193. }
  194. }
  195. @keyframes text-animate {
  196. 0% {
  197. background-position: 0 0;
  198. -webkit-background-clip: text;
  199. }
  200. 50% {
  201. background-position: 0 0;
  202. -webkit-background-clip: text;
  203. }
  204. 100% {
  205. background-position: 0 0;
  206. -webkit-background-clip: text;
  207. }
  208. }
  209. .fork-me-on-gitee{
  210. position: absolute;
  211. top: 0;
  212. right: 0;
  213. z-index: 999;
  214. img{
  215. width: 120px;
  216. height: 120px;
  217. }
  218. }
  219. </style>