DSDSWeb/src/main.js

51 lines
2.0 KiB
JavaScript
Raw Normal View History

2024-07-11 18:02:47 +08:00
import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import echarts from 'echarts'
// import 'element-ui/lib/theme-chalk/index.css'
import '../static/css/index.css'
import '../static/css/fonts.css'
import Enlocale from '../node_modules/element-ui/lib/locale/lang/en'
import Zhlocale from '../node_modules/element-ui/lib/locale/lang/zh-CN'
import router from './router/index.js'
2025-11-18 15:33:41 +08:00
2024-07-11 18:02:47 +08:00
import 'echarts-gl'
2025-11-18 15:33:41 +08:00
2024-07-11 18:02:47 +08:00
import axios from 'axios'
import qs from 'qs'
import store from './store/index'
import { extractWMTSBoundsInfo } from '@/utils/mapbox-utils'
2024-07-11 18:02:47 +08:00
window.sessionStorage.setItem('webInfo', 'ASOS')
Vue.use(ElementUI, { locale: Zhlocale })
2025-11-18 15:33:41 +08:00
2024-07-11 18:02:47 +08:00
Vue.prototype.$axios = axios
Vue.prototype.$qs = qs
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
})
2025-11-21 23:00:53 +08:00
// 定义部分全局变量
Vue.config.maps = {};
Vue.config.firstRender = true;
Vue.config.boundsInfoList = [];
2025-11-21 23:00:53 +08:00
Vue.config.baseUrl = process.env.NODE_ENV === 'development' ? 'http://124.222.8.13:9801' : `${window.location.protocol}//${window.location.hostname}:${window.location.port}`
Vue.config.wwwrootBaseUrl = "_content/IDSSE.OceanExplorer.Shared";
Vue.config.sprites = ["go.png", "ship.png", "ship1.png", "ship2.png", "ship3.png", "fdz.png", "shys.png", "auv.png", "aircraft.png", "aircraft-r.png", "arrow.png", "dot.png", "dot_red.png", "default.png", "info-dark.png", "warning-dark.png", "warning-red.png", "slow_sog.png", "stop_sog.png", "海底主基站.png", "石油平台.png", "岸基站.png", "circle-red.png", "circle-green.png", "circle-blue.png", "circle-yellow.png", "circle-purple.png", "circle-black.png", "circle-white.png"];
if (Vue.config.firstRender) {
Vue.config.firstRender = !Vue.config.firstRender;
fetch(`${Vue.config.baseUrl}/geoserver/gwc/service/wmts?service=WMTS&acceptVersions=1.0.0&request=GetCapabilities`)
.then(response => response.text())
.then(async (xmlContent) => {
Vue.config.boundsInfoList = await extractWMTSBoundsInfo(xmlContent);
});
}