main.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 * as $dataRoomAxios from '../packages/js/utils/http.js'
  12. import { registerConfig } from '@gcpaas/data-room-ui'
  13. import remoteComponents from '@/remoteComponents/exports.js'
  14. import customDatasetComponents from '@/customDatasetComponents/exports.js'
  15. import { Column } from '@antv/g2plot'
  16. // import customPlots from '@/customPlots/exports'
  17. Vue.use(ElementUI, { size: 'mini' })
  18. Vue.prototype.Column = Column
  19. console.log('window.CONFIG', window.CONFIG)
  20. registerConfig(
  21. {
  22. routers: {
  23. // 大屏设计路由
  24. designUrl: '/bigscreen/design',
  25. // 预览路由
  26. previewUrl: '/bigscreen/preview',
  27. // 页面管理路由(带头部跳转路由)
  28. pageManagementUrl: '/',
  29. // 页面列表路由
  30. pageListUrl: '/big-screen-list',
  31. // 模版列表
  32. templateListUrl: '/big-screen-template',
  33. // 数据源管理
  34. dataSourceUrl: '/big-screen-dataSource',
  35. // 数据集管理
  36. dataSetUrl: '/big-screen-dataSet',
  37. // 资源管理
  38. sourceUrl: '/big-screen-source',
  39. // 组件库
  40. componentUrl: '/big-screen-components'
  41. },
  42. httpConfigs: {
  43. baseURL: window.CONFIG?.baseURL,
  44. // 现在文件路径保存的是相对路径,所以需要加上前缀,这个值一般和后端的gc.starter.file.urlPrefix一致
  45. fileUrlPrefix: window.CONFIG?.fileUrlPrefix ? window.CONFIG.fileUrlPrefix : window.CONFIG?.baseURL + '/static'
  46. },
  47. customTheme: {
  48. '--bs-background-1': '#151a26', // 整体背景色
  49. '--bs-background-2': '#232832', // 布局背景色
  50. '--bs-el-background-1': '#151A26', // 组件背景色,输入框...
  51. '--bs-el-background-2': '#35393F', // 组件背景色,按钮、分页、加载...
  52. '--bs-el-background-3': '#303640', // 组件背景色,表格头部、下拉框hover...
  53. '--bs-el-title': '#ffffff', // 标题字体颜色
  54. '--bs-el-text': '#ffffff', // 一般字体颜色
  55. '--bs-el-color-primary': '#409EFF', // 样式主题色
  56. '--bs-el-color-primary-active': '64, 158, 255', // 主要激活 => rgba(64, 158, 255, 1) = #409EFF
  57. '--bs-el-border': 'transparent' // 边框颜色
  58. },
  59. // 允许上传的资源库文件类型
  60. sourceExtends: ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp', 'ico', 'xls', 'xlsx', 'csv'],
  61. // datasetAuth: ['unAdd', 'unEdit', 'unDelete'], // 数据集按钮权限 新增 编辑 删除
  62. // datasetTypeList: ['original', 'custom', 'http'],
  63. // sourceTypeList: [
  64. // { label: 'Mysql', code: 'mysql', name: 'com.mysql.jdbc.Driver', url: 'jdbc:mysql://localhost:3306/db_name?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8&useSSL=false&useOldAliasMetadataBehavior=true' },
  65. // { label: 'ClickHouse', code: 'clickhouse', name: 'ru.yandex.clickhouse.ClickHouseDriver', url: 'jdbc:clickhouse://localhost:8123/db_name' },
  66. // { label: 'test', code: 'test', name: 'test', url: 'test' }
  67. // ],
  68. // customPlots: [],
  69. // 远程组件列表
  70. remoteComponents,
  71. customDatasetComponents
  72. },
  73. router
  74. )
  75. promise.polyfill()
  76. // 自定义指令
  77. Vue.use(ElementUI, { size: 'mini' })
  78. Vue.config.productionTip = false
  79. Vue.prototype.$dataRoomAxios = $dataRoomAxios
  80. // 兼容ie下双向绑定事件
  81. Vue.prototype.inputChange = function (e) {
  82. return e.target.value
  83. }
  84. /* eslint-disable no-new */
  85. new Vue({
  86. el: '#app',
  87. router,
  88. store,
  89. render: (h) => h(App)
  90. })