main.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import Vue from 'vue';
  2. import App from './App.vue';
  3. import store from './store';
  4. import router from './router';
  5. import permission from './permission';
  6. import '@/assets/styles/index.css';
  7. import {
  8. parseTime,
  9. selectDictLabelu,
  10. selectDictLabel,
  11. selectDictLabels,
  12. CJ02BD,
  13. twoPointSum,
  14. parseTimeParagraph,
  15. Micrometer,
  16. weeklyTimeDivision,
  17. gcj02BD,
  18. verifyStoreType,
  19. formatChineseDate,
  20. validatePhone,
  21. } from '@/utils/index';
  22. import { toastLoading } from '@/utils/commonVant';
  23. import '@vant/touch-emulator';
  24. Vue.config.productionTip = false;
  25. import Vant from 'vant';
  26. import { Toast, Notify } from 'vant';
  27. import 'vant/lib/index.css';
  28. import ClipboardJS from 'clipboard';
  29. Vue.use(Vant);
  30. import ElTable from 'element-ui/lib/table';
  31. import 'element-ui/lib/theme-chalk/table.css';
  32. import 'element-ui/lib/theme-chalk/icon.css';
  33. import ElTableColumn from 'element-ui/lib/table-column';
  34. import ElPopover from 'element-ui/lib/popover';
  35. import 'element-ui/lib/theme-chalk/table-column.css';
  36. import 'element-ui/lib/theme-chalk/popover.css';
  37. import Vconsole from 'vconsole';
  38. import ElProgress from 'element-ui/lib/progress';
  39. import 'element-ui/lib/theme-chalk/progress.css';
  40. import ElDialog from 'element-ui/lib/dialog';
  41. import 'element-ui/lib/theme-chalk/dialog.css';
  42. import directive from './directive'; // directive
  43. // import wx from 'weixin-js-sdk';
  44. // jenkins 测试打包前先合并
  45. Vue.use(ElTable);
  46. Vue.use(ElTableColumn);
  47. Vue.use(ElPopover);
  48. Vue.use(ElProgress);
  49. Vue.use(ElDialog);
  50. Vue.config.productionTip = false;
  51. Vue.prototype.parseTime = parseTime;
  52. Vue.prototype.selectDictLabel = selectDictLabel;
  53. Vue.prototype.selectDictLabels = selectDictLabels;
  54. Vue.prototype.selectDictLabelu = selectDictLabelu;
  55. Vue.prototype.weeklyTimeDivision = weeklyTimeDivision;
  56. Vue.prototype.toastLoading = toastLoading;
  57. Vue.prototype.CJ02BD = CJ02BD;
  58. Vue.prototype.gcj02BD = gcj02BD;
  59. Vue.prototype.twoPointSum = twoPointSum;
  60. Vue.prototype.wx = wx;
  61. Vue.prototype.parseTimeParagraph = parseTimeParagraph;
  62. Vue.prototype.Micrometer = Micrometer;
  63. Vue.prototype.verifyStoreType = verifyStoreType;
  64. Vue.prototype.formatChineseDate = formatChineseDate;
  65. Vue.prototype.validatePhone = validatePhone;
  66. Vue.prototype.Toast = Toast;
  67. Vue.prototype.notify = Notify;
  68. var clipboard = new ClipboardJS('.btn');
  69. clipboard.on('success', function (e) {
  70. Toast('编码复制成功!');
  71. });
  72. clipboard.on('error', function (e) {
  73. Toast('编码复制失败!');
  74. });
  75. const isProd = process.env.NODE_ENV !== 'production';
  76. if (isProd) {
  77. const vConsole = new Vconsole();
  78. Vue.use(vConsole);
  79. }
  80. Vue.use(directive);
  81. new Vue({
  82. router,
  83. store,
  84. render: (h) => h(App),
  85. }).$mount('#app');