|
|
import Vue from 'vue';
|
|
|
import {get} from 'lodash';
|
|
|
import App from './app.vue';
|
|
|
import {createRouter} from './router';
|
|
|
import {createStore} from './store';
|
...
|
...
|
@@ -8,6 +9,7 @@ import titleMixin from './mixins/title'; |
|
|
import pluginCore from './plugins/core';
|
|
|
import lazyload from 'vue-lazyload';
|
|
|
import reportError from 'report-error';
|
|
|
import ReportApp from './common/report-app';
|
|
|
|
|
|
Vue.use(lazyload, {
|
|
|
preLoad: 2
|
...
|
...
|
@@ -15,11 +17,12 @@ Vue.use(lazyload, { |
|
|
Vue.use(pluginCore);
|
|
|
Vue.mixin(titleMixin);
|
|
|
|
|
|
|
|
|
export function createApp(context) {
|
|
|
const router = createRouter();
|
|
|
const store = createStore(context);
|
|
|
|
|
|
const reportApp = new ReportApp(store.$context.env);
|
|
|
|
|
|
const app = new Vue({
|
|
|
router,
|
|
|
store,
|
...
|
...
|
@@ -27,6 +30,19 @@ export function createApp(context) { |
|
|
reportError(context, 'server')(error);
|
|
|
return false;
|
|
|
},
|
|
|
methods: {
|
|
|
async reportApp(type, pn, params = {}, pt) {
|
|
|
let user = await this.$sdk.getUser();
|
|
|
|
|
|
if (!params.ei) {
|
|
|
params.ei = get(this.$router, 'history.current.name', '');
|
|
|
}
|
|
|
reportApp.report(type, pt || 'BUSINESS', pn, params, get(user, 'uid'));
|
|
|
},
|
|
|
reportAppStart() {
|
|
|
this.reportApp('start', 'BUSINESS_PLAN_A_ENTER', {locfun: 'mounted'});
|
|
|
}
|
|
|
},
|
|
|
render: h => h(App)
|
|
|
});
|
|
|
|
...
|
...
|
|