app.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import routes from './routes'
  4. import VueRouter from 'vue-router'
  5. import ViewUI from 'view-design';
  6. import Language from '../_modules/language'
  7. import '../common'
  8. import './main'
  9. Vue.use(VueRouter);
  10. Vue.use(ViewUI);
  11. Vue.use(Language);
  12. import Title from '../_components/Title.vue'
  13. import sreachTitle from '../_components/sreachTitle.vue'
  14. import UserInput from './components/UserInput'
  15. import UserView from './components/UserView'
  16. import WLoading from './components/WLoading'
  17. Vue.component('VTitle', Title);
  18. Vue.component('sreachTitle', sreachTitle);
  19. Vue.component('UserInput', UserInput);
  20. Vue.component('UserView', UserView);
  21. Vue.component('WLoading', WLoading);
  22. import TaskDetail from './components/project/task/detail'
  23. Vue.prototype.taskDetail = TaskDetail;
  24. import ReportDetail from './components/report/detail'
  25. Vue.prototype.reportDetail = ReportDetail;
  26. const router = new VueRouter({routes});
  27. //进度条配置
  28. ViewUI.LoadingBar.config({
  29. color: '#3fcc25',
  30. failedColor: '#ff0000'
  31. });
  32. router.beforeEach((to, from, next) => {
  33. ViewUI.LoadingBar.start();
  34. next();
  35. });
  36. router.afterEach((to, from, next) => {
  37. ViewUI.LoadingBar.finish();
  38. });
  39. //加载函数
  40. Vue.prototype.goForward = function(location, isReplace) {
  41. if (typeof location === 'string') location = {name: location};
  42. if (isReplace === true) {
  43. this.$router.replace(location);
  44. }else{
  45. this.$router.push(location);
  46. }
  47. };
  48. //返回函数
  49. Vue.prototype.goBack = function(number) {
  50. window.history.go(typeof number==='number'?number:-1)
  51. };
  52. Vue.prototype.$A = $A;
  53. Vue.config.productionTip = false;
  54. const app = new Vue({
  55. el: '#app',
  56. router,
  57. template: '<App/>',
  58. components: { App }
  59. });
  60. $A.app = app;
  61. window.localStorage.setItem("__::WookTeam:check", "success")