main_20220317202953.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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/supervision.scss' // supervision css
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import directive from './directive' //directive
  11. import plugins from './plugins' // plugins
  12. // 引入jquery
  13. import $ from "jquery";
  14. window.$ = $;
  15. window.jQuery = $;
  16. export default $;
  17. //引入file-saver
  18. import saveAs from "file-saver/dist/FileSaver";
  19. Vue.call(saveAs)
  20. import './assets/icons' // icon
  21. import './permission' // permission control
  22. import { getDicts } from "@/api/system/dict/data";
  23. import { getConfigKey } from "@/api/system/config";
  24. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree ,getNowWeek} from "@/utils/supervision";
  25. // 分页组件
  26. import Pagination from "@/components/Pagination";
  27. // 自定义表格工具组件
  28. import RightToolbar from "@/components/RightToolbar"
  29. // 富文本组件
  30. import Editor from "@/components/Editor"
  31. // 文件上传组件
  32. import FileUpload from "@/components/FileUpload"
  33. // 图片上传组件
  34. import ImageUpload from "@/components/ImageUpload"
  35. // 字典标签组件
  36. import DictTag from '@/components/DictTag'
  37. // 头部标签组件
  38. import VueMeta from 'vue-meta'
  39. // 字典数据组件
  40. import DictData from '@/components/DictData'
  41. // 公共样式
  42. import '@/assets/styles/global.css'
  43. // 全局挂载 VueQuillEditor
  44. import VueQuillEditor from 'vue-quill-editor'
  45. import 'quill/dist/quill.core.css'
  46. import 'quill/dist/quill.snow.css'
  47. import 'quill/dist/quill.bubble.css'
  48. import '@/utils/lodJs.js'
  49. // 全局方法挂载
  50. Vue.prototype.getDicts = getDicts
  51. Vue.prototype.getConfigKey = getConfigKey
  52. Vue.prototype.parseTime = parseTime
  53. Vue.prototype.resetForm = resetForm
  54. Vue.prototype.addDateRange = addDateRange
  55. Vue.prototype.selectDictLabel = selectDictLabel
  56. Vue.prototype.selectDictLabels = selectDictLabels
  57. Vue.prototype.handleTree = handleTree
  58. Vue.prototype.getNowWeek = getNowWeek
  59. // originVal 后台返回的中国标准时间
  60. Vue.filter('dataFormat', originVal => {
  61. const dt = new Date(originVal)
  62. if(originVal) {
  63. const y = dt.getFullYear()
  64. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  65. const d = (dt.getDate() + '').padStart(2, '0')
  66. return `${y}-${m}-${d}`
  67. }
  68. })
  69. // 全局组件挂载
  70. Vue.component('DictTag', DictTag)
  71. Vue.component('Pagination', Pagination)
  72. Vue.component('RightToolbar', RightToolbar)
  73. Vue.component('Editor', Editor)
  74. Vue.component('FileUpload', FileUpload)
  75. Vue.component('ImageUpload', ImageUpload)
  76. Vue.use(directive)
  77. Vue.use(plugins)
  78. Vue.use(VueMeta)
  79. Vue.use(VueQuillEditor)
  80. DictData.install()
  81. /**
  82. * If you don't want to use mock-server
  83. * you want to use MockJs for mock api
  84. * you can execute: mockXHR()
  85. *
  86. * Currently MockJs will be used in the production environment,
  87. * please remove it before going online! ! !
  88. */
  89. Vue.use(Element, {
  90. size: Cookies.get('size') || 'medium' // set element-ui default size
  91. })
  92. Vue.config.productionTip = false
  93. new Vue({
  94. el: '#app',
  95. router,
  96. store,
  97. render: h => h(App)
  98. })