main.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import ElementUI from 'element-ui';
  5. import {base} from '@/configue/base'
  6. import 'element-ui/lib/theme-chalk/index.css';
  7. import {axios, serverName} from './configue/http'
  8. import '../theme/index.css'
  9. import {isImage,isTypeBySend} from "@/util/index.js";
  10. //全局过滤器
  11. import * as filters from '@/filters/index.js'
  12. Object.keys(filters).forEach(key=>{
  13. Vue.filter(key,filters[key])//插入过滤器名和对应方法
  14. })
  15. //弹框
  16. import layer from 'vue-layer'
  17. import 'vue-layer/lib/vue-layer.css';
  18. Vue.prototype.$layer = layer(Vue);
  19. //富文本
  20. import VueQuillEditor from 'vue-quill-editor'
  21. // require styles
  22. import 'quill/dist/quill.core.css'
  23. import 'quill/dist/quill.snow.css'
  24. import 'quill/dist/quill.bubble.css'
  25. Vue.use(VueQuillEditor, /* { default global options } */)
  26. Vue.use(ElementUI)
  27. Vue.config.productionTip = false
  28. Vue.prototype.$base = base
  29. Vue.prototype.$bus = new Vue()
  30. Vue.prototype.$http = axios
  31. Vue.prototype.isImage = isImage
  32. Vue.prototype.isTypeBySend = isTypeBySend
  33. Vue.prototype.OSSURL = "https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/"
  34. Vue.prototype.MAXLENGTH = 200
  35. Vue.prototype.FONTLENGTH = 25
  36. Vue.prototype.PAGESIZES = [25,50,75,100]
  37. Vue.prototype.loading = {
  38. close(){
  39. }
  40. }
  41. Vue.prototype.loadOption = {
  42. lock: true,
  43. text: '上传中',
  44. spinner: 'el-icon-loading',
  45. background: 'rgba(0, 0, 0, 0.7)'
  46. }
  47. Vue.prototype.statusStr = {
  48. 1: "草稿中",
  49. 2: "待审核",
  50. 3: "审核不通过",
  51. 4: "审核通过"
  52. };
  53. let tmpYear = []
  54. for (let i = 2000; i <= 2050; i++) {
  55. tmpYear.push({
  56. id:i,
  57. name:i+'年'
  58. })
  59. }
  60. Vue.prototype.yearStr = [
  61. {
  62. id:1001,
  63. name:'革命战争时期'
  64. },
  65. {
  66. id:1002,
  67. name:'和平建设时期'
  68. },
  69. {
  70. id:1003,
  71. name:'军区联勤时期'
  72. }
  73. ].concat(tmpYear);
  74. Vue.prototype.typeStr = {
  75. news: "新闻",
  76. notice: "公告"
  77. };
  78. Vue.prototype.statusArr = [
  79. {
  80. id:1,
  81. name:'草稿中'
  82. },
  83. {
  84. id:2,
  85. name:'待审核'
  86. },
  87. {
  88. id:3,
  89. name:'审核不通过'
  90. },
  91. {
  92. id:4,
  93. name:'审核通过'
  94. }
  95. ]
  96. Vue.prototype.sysRole=[
  97. {
  98. name:'系统管理员',
  99. id:'sys_admin'
  100. },
  101. {
  102. name:'普通用户',
  103. id:'sys_normal'
  104. },
  105. ]
  106. Vue.prototype.collectType = {
  107. 1:'专题图库',
  108. 2:'视频文件',
  109. 3:'模型文件'
  110. };
  111. Vue.prototype.juese = {
  112. sys_admin: "系统管理员",
  113. sys_high: "高级管理员",
  114. sys_normal: "普通用户",
  115. sys_visitor: "游客",
  116. };
  117. Vue.prototype.sex = {
  118. 0: "男",
  119. 1: "女"
  120. };
  121. Vue.prototype.$serverName = serverName// 挂载到Vue实例上面
  122. new Vue({
  123. router,
  124. render: h => h(App)
  125. }).$mount('#app')