main_20220317203004.js 3.1 KB

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