main.js 3.6 KB

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