main.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import 'babel-polyfill'
  2. import promise from 'es6-promise'
  3. import Vue from 'vue'
  4. import ElementUI from 'element-ui'
  5. import App from './App'
  6. import store from './store'
  7. import router from './router'
  8. import 'element-ui/lib/theme-chalk/index.css'
  9. import '@/assets/styles/index.scss'
  10. import * as $dataRoomAxios from 'data-room-ui/js/utils/http.js'
  11. import { registerConfig } from '@gcpaas/data-room-ui'
  12. import remoteComponents from '@/remoteComponents/exports.js'
  13. import customDatasetComponents from '@/customDatasetComponents/exports.js'
  14. import { Column } from '@antv/g2plot';
  15. // import customPlots from '@/customPlots/exports'
  16. Vue.use(ElementUI, { size: 'mini' })
  17. Vue.prototype.Column = Column
  18. registerConfig(
  19. {
  20. routers: {
  21. // 大屏设计路由
  22. designUrl: '/bigscreen/design',
  23. // 预览路由
  24. previewUrl: '/bigscreen/preview',
  25. // 页面管理路由(带头部跳转路由)
  26. pageManagementUrl: '/',
  27. // 页面列表路由
  28. pageListUrl: '/big-screen-list',
  29. // 模版列表
  30. templateListUrl: '/big-screen-template',
  31. // 数据源管理
  32. dataSourceUrl: '/big-screen-dataSource',
  33. // 数据集管理
  34. dataSetUrl: '/big-screen-dataSet',
  35. // 资源管理
  36. sourceUrl: '/big-screen-source',
  37. // 组件库
  38. componentUrl: '/big-screen-components'
  39. },
  40. httpConfigs: {
  41. baseURL: window.CONFIG?.baseUrl,
  42. // 现在文件路径保存的是相对路径,所以需要加上前缀,这个值一般和后端的gc.starter.file.urlPrefix一致
  43. fileUrlPrefix: window.CONFIG.fileUrlPrefix ? window.CONFIG.fileUrlPrefix : window.CONFIG?.baseUrl + '/static',
  44. },
  45. customTheme: {
  46. '--bs-background-1': '#151a26', // 整体背景色
  47. '--bs-background-2': '#232832', // 布局背景色
  48. '--bs-el-background-1': '#151A26', // 组件背景色,输入框...
  49. '--bs-el-background-2': '#35393F', // 组件背景色,按钮、分页、加载...
  50. '--bs-el-background-3': '#303640', // 组件背景色,表格头部、下拉框hover...
  51. '--bs-el-title': '#ffffff', // 标题字体颜色
  52. '--bs-el-text': '#ffffff', // 一般字体颜色
  53. '--bs-el-color-primary': '#409EFF', // 样式主题色
  54. '--bs-el-color-primary-active': '64, 158, 255', // 主要激活 => rgba(64, 158, 255, 1) = #409EFF
  55. '--bs-el-border': 'transparent' // 边框颜色
  56. },
  57. // datasetAuth: ['unAdd', 'unEdit', 'unDelete'], // 数据集按钮权限 新增 编辑 删除
  58. // datasetTypeList: ['original', 'custom', 'http'],
  59. // customPlots: [],
  60. // 远程组件列表
  61. remoteComponents,
  62. customDatasetComponents
  63. },
  64. router
  65. )
  66. promise.polyfill()
  67. // 自定义指令
  68. Vue.use(ElementUI, { size: 'mini' })
  69. Vue.config.productionTip = false
  70. Vue.prototype.$dataRoomAxios = $dataRoomAxios
  71. // 兼容ie下双向绑定事件
  72. Vue.prototype.inputChange = function (e) {
  73. return e.target.value
  74. }
  75. /* eslint-disable no-new */
  76. new Vue({
  77. el: '#app',
  78. router,
  79. store,
  80. render: (h) => h(App)
  81. })