main.js 4.5 KB

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