import Vue from 'vue';

import { download } from '@/utils/request';
import { getDicts } from '@/api/system/dict/data';
import { getConfigKey } from '@/api/system/config';
import {
  resetForm,
  addDateRange,
  selectDictLabel,
  selectDictLabels,
  handleTree
} from '@/utils/ruoyi';
import { formatDate, debounce, throttle, cloneDeep } from '@/utils/index';

// 全局方法挂载
Vue.prototype.$getDicts = getDicts;
Vue.prototype.$getConfigKey = getConfigKey;
Vue.prototype.$resetForm = resetForm;
Vue.prototype.$addDateRange = addDateRange;
Vue.prototype.$selectDictLabel = selectDictLabel;
Vue.prototype.$selectDictLabels = selectDictLabels;
Vue.prototype.$download = download;
Vue.prototype.$handleTree = handleTree;

Vue.prototype.$formatDate = formatDate;
Vue.prototype.$debounce = debounce;
Vue.prototype.$throttle = throttle;
Vue.prototype.$cloneDeep = cloneDeep;
