master
wuxiaolong 2023-11-22 11:35:17 +08:00
parent 6e36933742
commit 516fcd534c
4 changed files with 103 additions and 9 deletions

View File

@ -36,6 +36,7 @@
"url": "https://gitee.com/y_project/RuoYi-Cloud.git" "url": "https://gitee.com/y_project/RuoYi-Cloud.git"
}, },
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"axios": "0.24.0", "axios": "0.24.0",
"clipboard": "2.0.8", "clipboard": "2.0.8",

View File

@ -9,14 +9,6 @@
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" /> <search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom">
<ruo-yi-git id="dragon-git" class="right-menu-item hover-effect" />
</el-tooltip>
<el-tooltip content="文档地址" effect="dark" placement="bottom">
<ruo-yi-doc id="dragon-doc" class="right-menu-item hover-effect" />
</el-tooltip>
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip content="布局大小" effect="dark" placement="bottom"> <el-tooltip content="布局大小" effect="dark" placement="bottom">

View File

@ -89,7 +89,6 @@ export const constantRoutes = [
] ]
} }
] ]
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [ export const dynamicRoutes = [
{ {

View File

@ -0,0 +1,102 @@
<template>
<div class="dashboard-container">
<div class="dashboard-text">name: {{ name }}</div>
<div id="container"></div>
<el-button type="primary" @click="drawPolygon"></el-button>
</div>
</template>
<script>
//jsjsjson,
//import from ', AMapLoader
import AMapLoader from '@amap/amap-jsapi-loader';
export default {
//import使"
components: {},
props: {},
data() {
//"
return {
name: "map-view",
map: null,
mouseTool: null,
};
},
// data",
computed: {},
//data",
watch: {},
//",
methods: {
initAMap() {
AMapLoader.load({
key: "164dc573bc4daf5bf1f1ebcebdae0717", // WebKey load
version: "2.0", // JSAPI 1.4.15
plugins: ['AMap.MouseTool'], // 使'AMap.Scale'
})
.then((AMap) => {
this.map = new AMap.Map("container", {
// id
viewMode: "3D", // 3D
zoom: 11, //
center: [116.397428, 39.90923], //
});
this.mouseTool = new AMap.MouseTool(this.map)
this.mouseTool.on('draw', this.drawPolygonComplate)
})
.catch((e) => {
console.log(e);
});
},
drawPolygon() {
this.mouseTool.polygon({
strokeColor: "#FF33FF",
strokeOpacity: 1,
strokeWeight: 6,
strokeOpacity: 0.2,
fillColor: '#1791fc',
fillOpacity: 0.4,
// 线 'dashed'
strokeStyle: "solid",
// strokeStyledashed
// strokeDasharray: [30,10],
})
},
drawPolygonComplate(event){
console.log(event.obj.getPath())
alert("覆盖对象绘制完成")
}
},
// - 访this",
created() {
},
// - 访DOM",
mounted() {
this.initAMap();
},
unmounted() {
this.map?.destroy();
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
}, // - ",
destroyed() {
}, // - ",
activated() {
} //keep-alive",
};
</script>
<style scoped>
#container{
width: 100%;
height: 800px;
}
</style>