index.vue 5.2 KB

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