Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

main.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* eslint-disable */
  2. import Vue from "vue";
  3. import EvaIcons from "vue-eva-icons";
  4. import axios from "axios";
  5. import moment from "moment";
  6. import App from "./App.vue";
  7. import router from "./router";
  8. import store from "./store";
  9. import * as VueGoogleMaps from "vue2-google-maps";
  10. import Vuetify from "vuetify";
  11. import VueSocialSharing from "vue-social-sharing";
  12. import VueCurrencyInput from "vue-currency-input";
  13. import VueFloatLabel from "vue-float-label";
  14. import VueCryptojs from "vue-cryptojs";
  15. import VueAnalytics from 'vue-analytics';
  16. import JsonExcel from "vue-json-excel";
  17. import 'vue-loaders/dist/vue-loaders.css';
  18. import VueLoaders from 'vue-loaders';
  19. Vue.use(VueLoaders);
  20. Vue.use(VueSocialSharing);
  21. Vue.use(EvaIcons);
  22. Vue.use(Vuetify);
  23. Vue.use(VueFloatLabel);
  24. Vue.use(VueCryptojs);
  25. Vue.component("downloadExcel", JsonExcel);
  26. Vue.use(VueGoogleMaps, {
  27. load: {
  28. key: "AIzaSyD8k_Kwml_C8IDfs-gX8JFV8acli3L9cAE",
  29. libraries: "places,directions" // This is required if you use the Autocomplete plugin
  30. // OR: libraries: 'places,drawing'
  31. // OR: libraries: 'places,drawing,visualization'
  32. // (as you require)
  33. //// If you want to set the version, you can do so:
  34. // v: '3.26',
  35. }
  36. });
  37. //More info @ https://webdeasy.de/en/vue-analytics-en/
  38. // Vue.use(VueAnalytics, {
  39. // id: 'UA-128891091-1',
  40. // router
  41. // });
  42. Vue.config.productionTip = false;
  43. //axios.defaults.baseURL = "http://localhost:57260";
  44. //axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
  45. axios.defaults.baseURL = "http://training.provision-sa.com:82/";
  46. //axios.defaults.baseURL = "http://localhost:8080/"
  47. Vue.prototype.$axios = axios;
  48. const pluginOptions = {
  49. /* see config reference */
  50. globalOptions: {
  51. currency: ["ZAR", null, { prefix: "R" }][2],
  52. precision: 0
  53. }
  54. };
  55. Vue.use(VueCurrencyInput, pluginOptions);
  56. Vue.prototype.$http = axios;
  57. const token = localStorage.getItem("token");
  58. if (token) {
  59. Vue.prototype.$http.defaults.headers.common.Authorization = token;
  60. }
  61. router.beforeEach((to, from, next) => {
  62. if (to.matched.some(record => record.meta.requiresAuth)) {
  63. if (store.getters.isLoggedIn) {
  64. next();
  65. return;
  66. }
  67. next("/users/login");
  68. } else {
  69. next();
  70. }
  71. });
  72. Vue.filter("toCurrency", value => {
  73. if (typeof value !== "number") {
  74. return value;
  75. }
  76. const formatter = new Intl.NumberFormat("en-US", {
  77. minimumFractionDigits: 0
  78. });
  79. return `R ${formatter.format(value)}`;
  80. });
  81. Vue.filter("toProper", value => {
  82. if (typeof value !== "string") {
  83. console.log(typeof value);
  84. return value;
  85. }
  86. value = value.replace(/([a-z])([A-Z])/g, "$1 $2");
  87. return value.charAt(0).toUpperCase() + value.slice(1);
  88. });
  89. Vue.filter("toDate", value => value.substring(0, value.length > 9 ? 10 : value.length));
  90. Vue.filter("toTime", value => moment(String(value)).format("hh:mm"));
  91. new Vue({
  92. render: h => h(App),
  93. router,
  94. store
  95. }).$mount("#app");