diff --git a/package.json b/package.json index 2413824..d14de20 100644 --- a/package.json +++ b/package.json @@ -14,14 +14,16 @@ "test:ci": "npm run lint && npm run test:unit" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "axios": "0.18.1", "core-js": "3.6.5", - "element-ui": "2.13.2", + "element-ui": "^2.15.12", "js-cookie": "2.2.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", "path-to-regexp": "2.4.0", "vue": "2.6.10", + "vue-baidu-map": "^0.21.22", "vue-router": "3.0.6", "vuex": "3.1.0" }, diff --git a/public/index.html b/public/index.html index fa2be91..fbc0706 100644 --- a/public/index.html +++ b/public/index.html @@ -15,3 +15,5 @@ + + diff --git a/src/api/system/dept.js b/src/api/system/dept.js new file mode 100644 index 0000000..e69de29 diff --git a/src/api/tree/mark.js b/src/api/tree/mark.js new file mode 100644 index 0000000..e69de29 diff --git a/src/main.js b/src/main.js index 01cba2f..c97ed84 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,35 @@ import router from './router' import '@/icons' // icon import '@/permission' // permission control +//百度地图 全局注册一次性引入 +import BaiduMap from 'vue-baidu-map' + +/** + * 百度 + */ +Vue.use(BaiduMap, { + /* 需要注册百度地图开发者来获取你的ak */ + ak: 'tqZyKtiyv367BS34ve0D92UBadXlf3LP' +}) +/** + * 高德 + */ +import AMapLoader from "@amap/amap-jsapi-loader"; + +AMapLoader.load({ + 'key': '44ea4ac03cbd3cefc6397e1af606a3c0', + 'version': '2.0', // 指定要加载的 JSAPI 的版本,缺少时默认为 1.4.15 + 'plugins': ['AMap.Scale','AMap.GeoJSON'] // 需要使用的的插件列表,如比例尺'AMap.Scale'等,更多插件请看官方文档 +}).then((AMap) => { + Vue.use(AMap) +}) +Vue.prototype.mapJsKey = '44ea4ac03cbd3cefc6397e1af606a3c0'; // jsApi +Vue.prototype.mapServiceKey = '5756347f1804ff075028f0888516402c'; // 服务端 +// 配置安全密钥 +window._AMapSecurityConfig = { + securityJsCode: '5690e34e121bb31129a44487f03bf7e5', //* 安全密钥 +}; + /** * If you don't want to use mock-server * you want to use MockJs for mock api diff --git a/src/router/index.js b/src/router/index.js index 13459e9..605ff9f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -89,7 +89,42 @@ export const constantRoutes = [ } ] }, - + { + path: '/百度地图', + component: Layout, + children: [ + { + path: 'index', + name: '百度地图', + component: () => import('@/views/baidu/index'), + meta: { title: '百度地图', icon: '百度地图' } + } + ] + }, + { + path: '/高德地图', + component: Layout, + children: [ + { + path: 'index', + name: '高德地图', + component: () => import('@/views/gaode/index'), + meta: { title: '高德地图', icon: '高德地图' } + } + ] + }, + { + path: '/websocket', + component: Layout, + children: [ + { + path: 'index', + name: 'websocket', + component: () => import('@/views/websocket/index'), + meta: { title: 'websocket', icon: 'websocket' } + } + ] + }, { path: '/nested', component: Layout, diff --git a/src/views/baidu/index.vue b/src/views/baidu/index.vue new file mode 100644 index 0000000..3cef748 --- /dev/null +++ b/src/views/baidu/index.vue @@ -0,0 +1,135 @@ + + + + + + + + diff --git a/src/views/gaode/index.vue b/src/views/gaode/index.vue new file mode 100644 index 0000000..f1f32ff --- /dev/null +++ b/src/views/gaode/index.vue @@ -0,0 +1,107 @@ + + + + diff --git a/src/views/websocket/index.vue b/src/views/websocket/index.vue new file mode 100644 index 0000000..0a23d02 --- /dev/null +++ b/src/views/websocket/index.vue @@ -0,0 +1,60 @@ +
+
+
掘金多多
+
大展鸿图
+
+
+
+
+
+
+
+
+
+
步步高升
+
年年有鱼
+
+
+
+
+
+
+
+
+
+
+
心想事成
+
万事如意
+
+
+
+
+
+
+
+
+
+
+
蒸蒸日上
+
一帆风顺
+
+
+
+
+
+
+
+
+
+
+
自强不息
+
恭喜发财
+
龙年大吉
+
+
+
+
+
+
+
+
diff --git a/vue.config.js b/vue.config.js index 4856ed0..ab082b9 100644 --- a/vue.config.js +++ b/vue.config.js @@ -46,6 +46,10 @@ module.exports = { alias: { '@': resolve('src') } + }, + externals: { + 'AMap': 'AMap', + 'AMapUI': 'AMapUI' } }, chainWebpack(config) {