main.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import Vue from "vue";
  2. import App from "./App";
  3. import store from "./store";
  4. import router from "./router";
  5. import "./assets/styles/element-variables.scss";
  6. import "@/assets/styles/index.scss"; // global css
  7. import "@/assets/styles/ruoyi.scss"; // ruoyi css
  8. import Element from "element-ui";
  9. import directive from "./directive"; // directive
  10. import plugins from "./plugins"; // plugins
  11. import { download } from "@/utils/request";
  12. import "./assets/icons"; // icon
  13. import "./permission"; // permission control
  14. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  15. import { getDicts } from "@/api/system/dict/data";
  16. import { getConfigKey } from "@/api/system/config";
  17. import '@/assets/styles/globalForm.scss'
  18. import {
  19. parseTime,
  20. resetForm,
  21. addDateRange,
  22. selectDictLabel,
  23. selectDictLabels,
  24. handleTree,
  25. formatTime,
  26. imageUrl,
  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 ImageListPreview from "@/components/ImageListPreview";
  42. // 字典标签组件
  43. import DictTag from "@/components/DictTag";
  44. // 头部标签组件
  45. import VueMeta from "vue-meta";
  46. // 字典数据组件
  47. import DictData from "@/components/DictData";
  48. // 下拉tree组件
  49. import TreeSelect from "@riophae/vue-treeselect";
  50. // elementui Dialog组件
  51. import DialogCom from "@/components/elDialog/dialog.vue";
  52. //布局容器
  53. import layoutCom from "@/components/layoutContainer/index.vue";
  54. //dialog拖拽指令
  55. import "@/utils/dialogdrag.js";
  56. // 水印组件
  57. import watercom from '@/components/waterCom.vue'
  58. // 全局方法挂载
  59. Vue.prototype.getDicts = getDicts;
  60. //根据参数键名查询参数值
  61. Vue.prototype.getConfigKey = getConfigKey;
  62. //格式化时间
  63. Vue.prototype.parseTime = parseTime;
  64. //格式化时间
  65. Vue.prototype.formatTime = formatTime;
  66. //重置表单
  67. Vue.prototype.resetForm = resetForm;
  68. //添加日期范围
  69. Vue.prototype.addDateRange = addDateRange;
  70. //回显数据字典
  71. Vue.prototype.selectDictLabel = selectDictLabel;
  72. // 回显数据字典(字符串、数组)
  73. Vue.prototype.selectDictLabels = selectDictLabels;
  74. Vue.prototype.download = download;
  75. Vue.prototype.handleTree = handleTree;
  76. Vue.prototype.imageUrl = imageUrl;
  77. // 全局组件挂载
  78. Vue.component("watercom", watercom);
  79. Vue.component("DictTag", DictTag);
  80. Vue.component("Pagination", Pagination);
  81. Vue.component("RightToolbar", RightToolbar);
  82. Vue.component("Editor", Editor);
  83. Vue.component("FileUpload", FileUpload);
  84. Vue.component("ImageUpload", ImageUpload);
  85. Vue.component("ImagePreview", ImagePreview);
  86. Vue.component("ImageListPreview", ImageListPreview);
  87. Vue.component("TreeSelect", TreeSelect);
  88. Vue.component("DialogCom", DialogCom);
  89. Vue.component("layoutCom", layoutCom);
  90. Vue.use(directive);
  91. Vue.use(plugins);
  92. Vue.use(VueMeta);
  93. DictData.install();
  94. /**
  95. * If you don't want to use mock-server
  96. * you want to use MockJs for mock api
  97. * you can execute: mockXHR()
  98. *
  99. * Currently MockJs will be used in the production environment,
  100. * please remove it before going online! ! !
  101. */
  102. Vue.use(Element, {
  103. size: sessionStorage.getItem("size") || "medium", // set element-ui default size
  104. });
  105. Vue.config.productionTip = false;
  106. new Vue({
  107. el: "#app",
  108. router,
  109. store,
  110. render: (h) => h(App),
  111. });