history record

master
冯凯 2023-11-26 15:28:22 +08:00
parent 243e5057db
commit 393f5de05d
4 changed files with 149 additions and 72 deletions

View File

@ -49,6 +49,7 @@ import AMapLoader from '@amap/amap-jsapi-loader';
console.log(e);
});
},
drawPolygon() {
this.mouseTool.polygon({
strokeColor: "#FF33FF",

View File

@ -0,0 +1,14 @@
<script setup>
</script>
<template>
<div>
<el-button type="warning">按钮</el-button>
<img src="https://ts1.cn.mm.bing.net/th/id/R-C.66d7b796377883a92aad65b283ef1f84?rik=sQ%2fKoYAcr%2bOwsw&riu=http%3a%2f%2fwww.quazero.com%2fuploads%2fallimg%2f140305%2f1-140305131415.jpg&ehk=Hxl%2fQ9pbEiuuybrGWTEPJOhvrFK9C3vyCcWicooXfNE%3d&risl=&pid=ImgRaw&r=0">
</div>
</template>
<style scoped lang="scss">
</style>

View File

@ -1,11 +0,0 @@
<script setup>
</script>
<template>
</template>
<style scoped lang="scss">
</style>

View File

@ -1,14 +1,13 @@
<script >
import path from "path";
import AMapLoader from '@amap/amap-jsapi-loader';
window._AMapSecurityConfig = {
securityJsCode:'6dc027fe91257ed0b06af9924201212c'
}
export default {
components: {},
props: {},
data() {
return{
multiple: true,
duration:2000,
AMap: null,
map: null,
mouseTool: null,
@ -17,6 +16,16 @@ export default {
carVin:"VIN123465798",
startTime:"2023-01-01 12:01:59",
endTime:"2023-01-01 12:10:21"
},
{
carVin:"VIN66666666",
startTime:"2022-01-01 12:01:59",
endTime:"2022-01-01 12:10:21"
},
{
carVin:"VIN88888888",
startTime:"2021-01-01 12:01:59",
endTime:"2021-01-01 12:10:21"
}
],
lineArr: [
@ -44,32 +53,74 @@ export default {
mounted() {
},
created() {
this.initAMap()
},
methods: {
doDo(){
// this.$router.push('/cmpany/firm')
this.initAMap()
this.initMap()
this.startAnimation()
},
initAMap() {
initMap() {
AMapLoader.load({
key: 'e31845f75485d475ad64b1946691f717',
version: '2.0',
plugins: ['AMap.MouseTool','AMap.LngLat', 'AMap.Scale', 'AMap.ToolBar', 'AMap.ControlBar', 'AMap.Geocoder', 'AMap.Marker',
'AMap.CitySearch', 'AMap.Geolocation', 'AMap.AutoComplete', 'AMap.InfoWindow', 'AMap.PolyEditor','AMap.MouseTool','AMap.PlaceSearch'],
key: "0b5f26b194361cbc9571101bc2856962", // WebKey load
version: "2.0", // JSAPI 1.4.15
plugins: [
"AMap.Scale",
"AMap.HawkEye",
"AMap.ToolBar",
"AMap.AutoComplete",
"AMap.PlaceSearch",
"AMap.ControlBar",
"AMap.MouseTool",
"AMap.DragRoute",
"AMap.MoveAnimation"], // 使'AMap.Scale'
}).then((AMap) => {
this.map = new AMap.Map('container', {
// DOM
this.map = new AMap.Map("container", { //id
resizeEnable: true,
viewMode: '2D',
zoomEnable: true,
dragEnable: true,
doubleClickZoom: true,
zoom: 17,
showBuildingBlock: true,
pitch: 55,
viewMode: "2D", // 使3D
zoomEnable: true, // true
dragEnable: true, // true
doubleClickZoom: true, // true
zoom: 13, //
center: this.lineArr[0], //
// mapStyle: "amap://styles/darkblue", //
})
}).catch(e => {
console.log(e)
this.marker = new AMap.Marker({
position: this.lineArr[0],
icon: "https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",
offset: new AMap.Pixel(-13, -26),
});
this.map.add(this.marker)
//
this.polyline = new AMap.Polyline({
path: this.lineArr,
showDir: true,
strokeColor: "#28F", //线
// strokeOpacity: 1, //线
strokeWeight: 6, //线
// strokeStyle: "solid" //线
});
this.map.add(this.polyline)
//
this.passedPolyline = new AMap.Polyline({
strokeColor: "#AF5", //线
strokeWeight: 6, //线
});
this.map.add(this.passedPolyline)
// marker
this.marker.on('moving', (e) => {
console.log('marker动了', e)
this.passedPolyline.setPath(e.passedPath); //
this.map.setCenter(e.target.getPosition(), true) //
});
this.map.setFitView(); //
})
},
startAnimation () {
@ -90,8 +141,9 @@ export default {
</script>
<template>
<div>
<div id="container"></div>
<div>
<div>
<el-form>
<table style="width: 100% ">
<tr>
@ -108,6 +160,21 @@ export default {
</tr>
</table>
</el-form>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
v-hasPermi="['vehicle:record:add']"
>新增</el-button>
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
v-hasPermi="['vehicle:record:remove']"
>删除</el-button>
<el-table :data="historyList">
<el-table-column label="VIN">
<template slot-scope="scope">
@ -129,9 +196,15 @@ export default {
<el-button type="warning">删除</el-button>
</el-table-column>
</el-table>
</div>
</div>
<div id="container"></div>
</div>
</template>
<style scoped lang="scss">
#container{
width: 50%;
height: 400px;
}
</style>