main.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. import Vue from 'vue'
  2. import App from '@/App'
  3. import router from '@/router'
  4. import store from '@/store'
  5. import VueCookie from 'vue-cookie'
  6. import ElementUI from 'element-ui'
  7. import 'element-ui/lib/theme-chalk/index.css'
  8. import '@/assets/scss/index.scss'
  9. import httpRequest from '@/utils/httpRequest'
  10. import dictUtils from '@/utils/dictUtils'
  11. import utils from '@/utils'
  12. import sortUtils from '@/utils/sortUtils'
  13. import '@/utils/filter'
  14. import validator from '@/utils/validator'
  15. import validatorXG from '@/utils/validatorXG'
  16. import validateXG from '@/utils/validateXG'
  17. import cloneDeep from 'lodash/cloneDeep'
  18. import lodash from 'lodash/object'
  19. import axios from 'axios'
  20. import moment from 'moment'
  21. import 'font-awesome/css/font-awesome.min.css'
  22. // import i18n from './lang' // Internationalization
  23. import VueClipboard from 'vue-clipboard2'
  24. import VCharts from 'v-charts'
  25. import JeeplusGencode from 'jeeplus-gencode'
  26. import JeeplusFlow from 'jeeplus-flowable'
  27. import 'jeeplus-flowable/lib/jeeplus-flowable.css'
  28. import './directive'
  29. import FormMaking from 'jeeplus-form/dist/JpFormMaking.common'
  30. import 'jeeplus-form/dist/JpFormMaking.css'
  31. import VueEditor from 'vue2-editor'
  32. import Print from 'vue-print-nb'
  33. import XEUtils from 'xe-utils'
  34. import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
  35. // 按需导入 vxeTable
  36. import {
  37. // 核心
  38. VXETable,
  39. // 功能模块
  40. Icon,
  41. Filter,
  42. Menu,
  43. Edit,
  44. Export,
  45. Keyboard,
  46. Validator,
  47. Header,
  48. Footer,
  49. // 可选组件
  50. Column,
  51. Colgroup,
  52. Grid,
  53. Toolbar,
  54. Pager,
  55. Checkbox,
  56. CheckboxGroup,
  57. Radio,
  58. RadioGroup,
  59. RadioButton,
  60. Input,
  61. Textarea,
  62. Button,
  63. Modal,
  64. Tooltip,
  65. Form,
  66. FormItem,
  67. FormGather,
  68. Select,
  69. Optgroup,
  70. Option,
  71. Switch,
  72. List,
  73. Pulldown,
  74. // 表格
  75. Table
  76. } from 'vxe-table'
  77. import zhCN from 'vxe-table/lib/locale/lang/zh-CN'
  78. // 按需加载的方式默认是不带国际化的,自定义国际化需要自行解析占位符 '{0}',例如:
  79. VXETable.setup({
  80. i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCN, key), args)
  81. })
  82. VXETable.use(VXETablePluginExportXLSX)
  83. // 表格功能
  84. Vue.use(Header)
  85. .use(Footer)
  86. .use(Icon)
  87. .use(Filter)
  88. .use(Edit)
  89. .use(Menu)
  90. .use(Export)
  91. .use(Keyboard)
  92. .use(Validator)
  93. // 可选组件
  94. .use(Column)
  95. .use(Colgroup)
  96. .use(Grid)
  97. .use(Toolbar)
  98. .use(Pager)
  99. .use(Checkbox)
  100. .use(CheckboxGroup)
  101. .use(Radio)
  102. .use(RadioGroup)
  103. .use(RadioButton)
  104. .use(Input)
  105. .use(Textarea)
  106. .use(Button)
  107. .use(Modal)
  108. .use(Tooltip)
  109. .use(Form)
  110. .use(FormItem)
  111. .use(FormGather)
  112. .use(Select)
  113. .use(Optgroup)
  114. .use(Option)
  115. .use(Switch)
  116. .use(List)
  117. .use(Pulldown)
  118. // 安装表格
  119. .use(Table)
  120. Vue.use(Print)
  121. Vue.use(VueEditor)
  122. Vue.use(FormMaking)
  123. Vue.use(JeeplusGencode)
  124. Vue.use(JeeplusFlow)
  125. VueClipboard.config.autoSetContainer = true
  126. Vue.use(VCharts)
  127. Vue.use(VueClipboard)
  128. Vue.use(VueCookie)
  129. Vue.use(ElementUI)
  130. // Vue.use(ElementUI, {
  131. // i18n: (key, value) => i18n.t(key, value)
  132. // })
  133. Vue.config.productionTip = false
  134. // 挂载全局
  135. Vue.prototype.$http = httpRequest // ajax请求方法
  136. Vue.prototype.hasPermission = utils.hasPermission // 权限方法
  137. Vue.prototype.treeDataTranslate = utils.treeDataTranslate // 树形数据转换
  138. Vue.prototype.$utils = utils
  139. Vue.prototype.$window = window
  140. Vue.prototype.$dictUtils = dictUtils
  141. Vue.prototype.$sortUtils = sortUtils
  142. Vue.prototype.recover = utils.recover
  143. Vue.prototype.recoverNotNull = utils.recoverNotNull
  144. Vue.prototype.$axios = axios
  145. Vue.prototype.validator = validator
  146. Vue.prototype.validatorXG = validatorXG
  147. Vue.prototype.validateXG = validateXG
  148. Vue.prototype.lodash = lodash
  149. Vue.prototype.moment = moment
  150. Vue.prototype.deepClone = utils.deepClone
  151. Vue.prototype.validatenull = utils.validatenull
  152. Vue.prototype.$events = new Vue()
  153. utils.printLogo()
  154. // 保存整站vuex本地储存初始状态
  155. window.SITE_CONFIG = {}
  156. window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
  157. /* eslint-disable no-new */
  158. new Vue({
  159. el: '#app',
  160. router,
  161. store,
  162. render: h => h(App)
  163. })