index.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import modal from './modal';
  2. import tab from './tab';
  3. import download from './download';
  4. import cache from './cache';
  5. import auth from './auth';
  6. // 预设动画
  7. import animate from '@/animate';
  8. import { download as dl } from '@/utils/request';
  9. import { useDict } from '@/utils/dict';
  10. import { getConfigKey, updateConfigByKey } from '@/api/system/config';
  11. import { parseTime, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi';
  12. import { App } from 'vue';
  13. export default function installPlugin(app: App) {
  14. // 页签操作
  15. app.config.globalProperties.$tab = tab;
  16. // 模态框对象
  17. app.config.globalProperties.$modal = modal;
  18. // 缓存对象
  19. app.config.globalProperties.$cache = cache;
  20. // 下载文件
  21. app.config.globalProperties.$download = download;
  22. // 认证对象
  23. app.config.globalProperties.$auth = auth;
  24. // 全局方法挂载
  25. app.config.globalProperties.useDict = useDict;
  26. app.config.globalProperties.getConfigKey = getConfigKey;
  27. app.config.globalProperties.updateConfigByKey = updateConfigByKey;
  28. app.config.globalProperties.download = dl;
  29. app.config.globalProperties.parseTime = parseTime;
  30. app.config.globalProperties.handleTree = handleTree;
  31. app.config.globalProperties.addDateRange = addDateRange;
  32. app.config.globalProperties.selectDictLabel = selectDictLabel;
  33. app.config.globalProperties.selectDictLabels = selectDictLabels;
  34. app.config.globalProperties.animate = animate;
  35. }