main.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import Vue from "vue";
  2. import Cookies from "js-cookie";
  3. import Element from "element-ui";
  4. import Vant from 'vant';
  5. import 'vant/lib/index.css';
  6. import "./assets/styles/element-variables.scss";
  7. import "@/assets/styles/tailwindcss.css"
  8. import "@/assets/styles/index.scss"; // global css
  9. import "@/assets/styles/rcBase.scss"; // rcBase css
  10. // 阿里云矢量图标
  11. import "@/assets/icons/alIcon/iconfont.css"
  12. import App from "./App";
  13. import store from "./store";
  14. import router from "./router";
  15. import directive from "./directive"; // directive
  16. import plugins from "./plugins"; // plugins
  17. import { download } from "@/utils/request";
  18. import "./assets/icons"; // icon
  19. import "./permission"; // permission control
  20. import { getDicts } from "@/api/system/dict/data";
  21. import { getConfigKey } from "@/api/system/config";
  22. import {
  23. parseTime,
  24. resetForm,
  25. addDateRange,
  26. selectDictLabel,
  27. selectDictLabels,
  28. handleTree,
  29. } from "@/utils/rcBase";
  30. import {
  31. userPohotoError,
  32. AIPohotoError
  33. } from "@/utils/index.js";
  34. import Icon from 'vue-awesome/components/Icon'
  35. Vue.component('v-icon', Icon)
  36. // import Button from 'vant/lib/button';
  37. // import 'vant/lib/button/style';
  38. // 分页组件
  39. import Pagination from "@/components/Pagination";
  40. // 自定义表格工具组件
  41. import RightToolbar from "@/components/RightToolbar";
  42. // 富文本组件
  43. import Editor from "@/components/Editor";
  44. // 文件上传组件
  45. import FileUpload from "@/components/FileUpload";
  46. // 图片上传组件
  47. import ImageUpload from "@/components/ImageUpload";
  48. // 图片预览组件
  49. import ImagePreview from "@/components/ImagePreview";
  50. // 字典标签组件
  51. import DictTag from "@/components/DictTag";
  52. // 头部标签组件
  53. import VueMeta from "vue-meta";
  54. // 字典数据组件
  55. import DictData from "@/components/DictData";
  56. const baseApi = process.env.VUE_APP_BASE_API
  57. // 全局方法挂载
  58. Vue.prototype.baseApi = baseApi;
  59. Vue.prototype.getDicts = getDicts;
  60. Vue.prototype.getConfigKey = getConfigKey;
  61. Vue.prototype.parseTime = parseTime;
  62. Vue.prototype.resetForm = resetForm;
  63. Vue.prototype.addDateRange = addDateRange;
  64. Vue.prototype.selectDictLabel = selectDictLabel;
  65. Vue.prototype.selectDictLabels = selectDictLabels;
  66. Vue.prototype.$userPohotoError = userPohotoError;
  67. Vue.prototype.$AIPohotoError = AIPohotoError;
  68. Vue.prototype.download = download;
  69. Vue.prototype.handleTree = handleTree;
  70. // 全局组件挂载
  71. Vue.component("DictTag", DictTag);
  72. Vue.component("Pagination", Pagination);
  73. Vue.component("RightToolbar", RightToolbar);
  74. Vue.component("Editor", Editor);
  75. Vue.component("FileUpload", FileUpload);
  76. Vue.component("ImageUpload", ImageUpload);
  77. Vue.component("ImagePreview", ImagePreview);
  78. Vue.use(Vant);
  79. Vue.use(directive);
  80. Vue.use(plugins);
  81. Vue.use(VueMeta);
  82. DictData.install();
  83. /**
  84. * If you don't want to use mock-server
  85. * you want to use MockJs for mock api
  86. * you can execute: mockXHR()
  87. *
  88. * Currently MockJs will be used in the production environment,
  89. * please remove it before going online! ! !
  90. */
  91. Vue.use(Element, {
  92. size: Cookies.get("size") || "medium", // set element-ui default size
  93. });
  94. Vue.config.productionTip = false;
  95. new Vue({
  96. el: "#app",
  97. router,
  98. store,
  99. render: (h) => h(App),
  100. });