main.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import Vue from 'vue'
  2. import Cookies from 'js-cookie'
  3. import Element from 'element-ui'
  4. import './assets/styles/element-variables.scss'
  5. import '@/assets/styles/index.scss' // global css
  6. import '@/assets/styles/huyi.scss' // huyi css
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import permission from './directive/permission'
  11. import { download } from '@/utils/request'
  12. import './assets/icons' // icon
  13. import './assets/iconfont/iconfont.css' // 导航栏菜单图标
  14. import './permission' // permission control
  15. import { getDicts } from "@/api/system/dict/data";
  16. import { getConfigKey } from "@/api/system/config";
  17. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/huyi";
  18. import Pagination from "@/components/Pagination";
  19. //自定义表格工具扩展
  20. import RightToolbar from "@/components/RightToolbar"
  21. // 提示信息
  22. import ZapTip from "@/components/ZapTip"
  23. // 表格标题
  24. import ContentTitle from "@/components/ContentTitle"
  25. // 表格合计额
  26. import ContentTotal from "@/components/ContentTotal"
  27. // 表格顶部搜索栏
  28. import SearchBar from "@/components/SearchBar"
  29. // 页面头部栏:融信编号、创建时间、创建人
  30. import HeaderBar from "@/components/HeaderBar"
  31. // 表格底部数字统计
  32. import StatisticalData from "@/components/StatisticalData"
  33. // 日期过滤器
  34. import "@/filters/date.js"
  35. // 全局方法挂载
  36. Vue.prototype.getDicts = getDicts
  37. Vue.prototype.getConfigKey = getConfigKey
  38. Vue.prototype.parseTime = parseTime
  39. Vue.prototype.resetForm = resetForm
  40. Vue.prototype.addDateRange = addDateRange
  41. Vue.prototype.selectDictLabel = selectDictLabel
  42. Vue.prototype.selectDictLabels = selectDictLabels
  43. Vue.prototype.download = download
  44. Vue.prototype.handleTree = handleTree
  45. Vue.prototype.msgSuccess = function (msg) {
  46. this.$message({ showClose: true, message: msg, type: "success" });
  47. }
  48. Vue.prototype.msgError = function (msg) {
  49. this.$message({ showClose: true, message: msg, type: "error" });
  50. }
  51. Vue.prototype.msgInfo = function (msg) {
  52. this.$message.info(msg);
  53. }
  54. // 全局组件挂载
  55. Vue.component('Pagination', Pagination)
  56. Vue.component('RightToolbar', RightToolbar)
  57. Vue.component('ZapTip', ZapTip)
  58. Vue.component('ContentTitle', ContentTitle)
  59. Vue.component('ContentTotal', ContentTotal)
  60. Vue.component('SearchBar', SearchBar)
  61. Vue.component('HeaderBar', HeaderBar)
  62. Vue.component('StatisticalData', StatisticalData)
  63. Vue.use(permission)
  64. //拖拽
  65. import VueI18n from 'vue-i18n'
  66. import enLocale from 'element-ui/lib/locale/lang/en'
  67. import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
  68. Vue.use(VueI18n)
  69. Vue.locale('en-US', {...enLocale })
  70. Vue.locale('zh-CN', {...zhLocale })
  71. Vue.config.lang = 'zh-CN'
  72. import FormMaking from './index'
  73. import CustomComponent from './views/tool/model/CustomComponent.vue'
  74. Vue.use(FormMaking, {
  75. components: [{
  76. name: 'custom-width-height',
  77. component: CustomComponent
  78. }]
  79. })
  80. //阿里icon图标
  81. import './assets/icon/iconfont.css'
  82. //echarts图表
  83. import echarts from 'echarts'
  84. Vue.prototype.$echarts = echarts;
  85. /**
  86. * If you don't want to use mock-server
  87. * you want to use MockJs for mock api
  88. * you can execute: mockXHR()
  89. *
  90. * Currently MockJs will be used in the production environment,
  91. * please remove it before going online! ! !
  92. */
  93. Vue.use(Element, {
  94. size: Cookies.get('size') || 'medium' // set element-ui default size
  95. })
  96. Vue.config.productionTip = false
  97. new Vue({
  98. el: '#app',
  99. router,
  100. store,
  101. render: h => h(App)
  102. })