main.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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/ruoyi.scss"; // ruoyi css
  7. import "quill/dist/quill.core.css";
  8. import "quill/dist/quill.snow.css";
  9. import "quill/dist/quill.bubble.css";
  10. import App from "./App";
  11. import store from "./store";
  12. import router from "./router";
  13. import directive from "./directive"; // directive
  14. import plugins from "./plugins"; // plugins
  15. import { download } from "@/utils/request";
  16. import "./assets/icons"; // icon
  17. import "./permission"; // permission control
  18. import { getDicts } from "@/api/system/dict/data";
  19. import { getConfigKey } from "@/api/system/config";
  20. import {
  21. parseTime,
  22. resetForm,
  23. addDateRange,
  24. selectDictLabel,
  25. selectDictLabels,
  26. handleTree,
  27. } from "@/utils/ruoyi";
  28. // 分页组件
  29. import Pagination from "@/components/Pagination";
  30. // 自定义表格工具组件
  31. import RightToolbar from "@/components/RightToolbar";
  32. // 富文本组件
  33. import Editor from "@/components/Editor";
  34. // 文件上传组件
  35. import FileUpload from "@/components/FileUpload";
  36. // 图片上传组件
  37. import ImageUpload from "@/components/ImageUpload";
  38. // 图片预览组件
  39. import ImagePreview from "@/components/ImagePreview";
  40. // 字典标签组件
  41. import DictTag from "@/components/DictTag";
  42. // 头部标签组件
  43. import VueMeta from "vue-meta";
  44. // 字典数据组件
  45. import DictData from "@/components/DictData";
  46. // 图片上传返回json组件
  47. import ImageUploadJson from "@/components/ImageUploadJson";
  48. // 文件上传返回json组件
  49. import FileUploadJson from "@/components/FileUploadJson";
  50. // 全局方法挂载
  51. Vue.prototype.getDicts = getDicts;
  52. Vue.prototype.getConfigKey = getConfigKey;
  53. Vue.prototype.parseTime = parseTime;
  54. Vue.prototype.resetForm = resetForm;
  55. Vue.prototype.addDateRange = addDateRange;
  56. Vue.prototype.selectDictLabel = selectDictLabel;
  57. Vue.prototype.selectDictLabels = selectDictLabels;
  58. Vue.prototype.download = download;
  59. Vue.prototype.handleTree = handleTree;
  60. // 全局组件挂载
  61. Vue.component("DictTag", DictTag);
  62. Vue.component("Pagination", Pagination);
  63. Vue.component("RightToolbar", RightToolbar);
  64. Vue.component("Editor", Editor);
  65. Vue.component("FileUpload", FileUpload);
  66. Vue.component("ImageUpload", ImageUpload);
  67. Vue.component("ImageUploadJson", ImageUploadJson);
  68. Vue.component("FileUploadJson", FileUploadJson);
  69. Vue.component("ImagePreview", ImagePreview);
  70. Vue.use(directive);
  71. Vue.use(plugins);
  72. Vue.use(VueMeta);
  73. DictData.install();
  74. /**
  75. * If you don't want to use mock-server
  76. * you want to use MockJs for mock api
  77. * you can execute: mockXHR()
  78. *
  79. * Currently MockJs will be used in the production environment,
  80. * please remove it before going online! ! !
  81. */
  82. Vue.use(Element, {
  83. size: Cookies.get("size") || "medium", // set element-ui default size
  84. });
  85. Vue.config.productionTip = false;
  86. new Vue({
  87. el: "#app",
  88. router,
  89. store,
  90. render: (h) => h(App),
  91. });