67 lines
2.2 KiB
JavaScript
67 lines
2.2 KiB
JavaScript
import Vue from 'vue';
|
|
import App from './App.vue';
|
|
import router from './router';
|
|
import ElementUI from 'element-ui'
|
|
import 'element-ui/lib/theme-chalk/index.css'
|
|
import store from './store';
|
|
import dataV from '@jiaminghi/data-view';
|
|
// import VueAxios from 'vue-axios';
|
|
// import axios from 'axios';
|
|
|
|
// 引入全局css
|
|
import './assets/scss/style.scss';
|
|
// 按需引入vue-awesome图标
|
|
import Icon from 'vue-awesome/components/Icon';
|
|
import 'vue-awesome/icons/chart-bar.js';
|
|
import 'vue-awesome/icons/chart-area.js';
|
|
import 'vue-awesome/icons/chart-pie.js';
|
|
import 'vue-awesome/icons/chart-line.js';
|
|
import 'vue-awesome/icons/align-left.js';
|
|
|
|
//引入echart
|
|
//4.x 引用方式
|
|
import echarts from 'echarts'
|
|
import 'echarts-liquidfill'
|
|
//5.x 引用方式为按需引用
|
|
//希望使用5.x版本的话,需要在package.json中更新版本号,并切换引用方式
|
|
//import * as echarts from 'echarts'
|
|
Vue.prototype.$echarts = echarts
|
|
Vue.config.productionTip = false;
|
|
Vue.use(ElementUI)
|
|
|
|
// 全局注册
|
|
Vue.component('icon', Icon);
|
|
Vue.use(dataV);
|
|
// Vue.prototype.$axios = axios;
|
|
// Vue.use(axios);
|
|
router.beforeEach((to, from, next) => {
|
|
// 根据路由元信息设置文档标题
|
|
window.document.title = to.meta.title
|
|
next()
|
|
})
|
|
function receiveMessageFromIframePage (event) {
|
|
console.log(event.data,event)
|
|
console.log(event.data.params,'event.data.params')
|
|
console.log(event.data.type,'event.data.type')
|
|
if (event.data.data.includes('办公用地')) {
|
|
var id = event.data.params
|
|
var type = event.data.type
|
|
// router.push({name:'landChild',params: { id: id, type:type}})
|
|
router.push({name:'land',params: { id: id, type:type}})
|
|
} else if (event.data.data=='变电站'&& event.data.params!="双闸变") {
|
|
var idsB = event.data.params
|
|
var typesB = event.data.type
|
|
router.push({name: 'landChildren', params: { id: idsB, type:typesB}})
|
|
}else if (event.data.data=='变电站'&&event.data.params=="双闸变") {
|
|
var idsS = event.data.params
|
|
var typess = event.data.type
|
|
router.push({name:'landChild',params: { id: idsS, type:typess}})
|
|
}
|
|
}
|
|
|
|
window.addEventListener("message", receiveMessageFromIframePage, false);
|
|
new Vue({
|
|
router,
|
|
store,
|
|
render: (h) => h(App),
|
|
}).$mount('#app'); |