main.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 Attachments from "@/components/Attachments"
  35. // 表单纯展示文本
  36. import TextItem from "@/components/TextItem"
  37. // 导入
  38. import UploadImport from '@/components/UploadImport/index.vue'
  39. // 日期过滤器
  40. import "@/filters/date.js"
  41. // 全局方法挂载
  42. Vue.prototype.getDicts = getDicts
  43. Vue.prototype.getConfigKey = getConfigKey
  44. Vue.prototype.parseTime = parseTime
  45. Vue.prototype.resetForm = resetForm
  46. Vue.prototype.addDateRange = addDateRange
  47. Vue.prototype.selectDictLabel = selectDictLabel
  48. Vue.prototype.selectDictLabels = selectDictLabels
  49. Vue.prototype.download = download
  50. Vue.prototype.handleTree = handleTree
  51. Vue.prototype.msgSuccess = function (msg) {
  52. this.$message({ showClose: true, message: msg, type: "success" });
  53. }
  54. Vue.prototype.msgError = function (msg) {
  55. this.$message({ showClose: true, message: msg, type: "error" });
  56. }
  57. Vue.prototype.msgInfo = function (msg) {
  58. this.$message.info(msg);
  59. }
  60. // 全局组件挂载
  61. Vue.component('Pagination', Pagination)
  62. Vue.component('RightToolbar', RightToolbar)
  63. Vue.component('ZapTip', ZapTip)
  64. Vue.component('ContentTitle', ContentTitle)
  65. Vue.component('ContentTotal', ContentTotal)
  66. Vue.component('SearchBar', SearchBar)
  67. Vue.component('HeaderBar', HeaderBar)
  68. Vue.component('StatisticalData', StatisticalData)
  69. Vue.component('Attachments', Attachments)
  70. Vue.component('TextItem', TextItem)
  71. Vue.component('UploadImport', UploadImport)
  72. Vue.use(permission)
  73. //拖拽
  74. import VueI18n from 'vue-i18n'
  75. import enLocale from 'element-ui/lib/locale/lang/en'
  76. import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
  77. Vue.use(VueI18n)
  78. Vue.locale('en-US', {...enLocale })
  79. Vue.locale('zh-CN', {...zhLocale })
  80. Vue.config.lang = 'zh-CN'
  81. import FormMaking from './index'
  82. import CustomComponent from './views/tool/model/CustomComponent.vue'
  83. Vue.use(FormMaking, {
  84. components: [{
  85. name: 'custom-width-height',
  86. component: CustomComponent
  87. }]
  88. })
  89. //阿里icon图标
  90. import './assets/icon/iconfont.css'
  91. //echarts图表
  92. import echarts from 'echarts'
  93. Vue.prototype.$echarts = echarts;
  94. /**
  95. * If you don't want to use mock-server
  96. * you want to use MockJs for mock api
  97. * you can execute: mockXHR()
  98. *
  99. * Currently MockJs will be used in the production environment,
  100. * please remove it before going online! ! !
  101. */
  102. Vue.use(Element, {
  103. size: Cookies.get('size') || 'medium' // set element-ui default size
  104. })
  105. Vue.config.productionTip = false
  106. new Vue({
  107. el: '#app',
  108. router,
  109. store,
  110. render: h => h(App)
  111. })