main.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. import VCalendar from 'v-calendar';
  60. // 全局方法挂载
  61. Vue.prototype.getDicts = getDicts;
  62. //根据参数键名查询参数值
  63. Vue.prototype.getConfigKey = getConfigKey;
  64. //格式化时间
  65. Vue.prototype.parseTime = parseTime;
  66. //格式化时间
  67. Vue.prototype.formatTime = formatTime;
  68. //重置表单
  69. Vue.prototype.resetForm = resetForm;
  70. //添加日期范围
  71. Vue.prototype.addDateRange = addDateRange;
  72. //回显数据字典
  73. Vue.prototype.selectDictLabel = selectDictLabel;
  74. // 回显数据字典(字符串、数组)
  75. Vue.prototype.selectDictLabels = selectDictLabels;
  76. Vue.prototype.download = download;
  77. Vue.prototype.handleTree = handleTree;
  78. Vue.prototype.imageUrl = imageUrl;
  79. // 全局组件挂载
  80. Vue.component("watercom", watercom);
  81. Vue.component("DictTag", DictTag);
  82. Vue.component("Pagination", Pagination);
  83. Vue.component("RightToolbar", RightToolbar);
  84. Vue.component("Editor", Editor);
  85. Vue.component("FileUpload", FileUpload);
  86. Vue.component("ImageUpload", ImageUpload);
  87. Vue.component("ImagePreview", ImagePreview);
  88. Vue.component("ImageListPreview", ImageListPreview);
  89. Vue.component("TreeSelect", TreeSelect);
  90. Vue.component("DialogCom", DialogCom);
  91. Vue.component("layoutCom", layoutCom);
  92. Vue.use(directive);
  93. Vue.use(plugins);
  94. Vue.use(VueMeta);
  95. DictData.install();
  96. /**
  97. * If you don't want to use mock-server
  98. * you want to use MockJs for mock api
  99. * you can execute: mockXHR()
  100. *
  101. * Currently MockJs will be used in the production environment,
  102. * please remove it before going online! ! !
  103. */
  104. Vue.use(Element, {
  105. size: sessionStorage.getItem("size") || "medium", // set element-ui default size
  106. });
  107. Vue.use(VCalendar, {
  108. componentPrefix: 'v', // Use <vc-calendar /> instead of <v-calendar />
  109. });
  110. Vue.config.productionTip = false;
  111. new Vue({
  112. el: "#app",
  113. router,
  114. store,
  115. render: (h) => h(App),
  116. });