|
@@ -6,156 +6,100 @@
|
|
|
left-arrow
|
|
|
@click-left="goBack()"
|
|
|
/>
|
|
|
- <div id="map-container" style="width: 100%; height: calc(100vh - 46px)"></div>
|
|
|
+ <div
|
|
|
+ id="map-container"
|
|
|
+ style="width: 100%; height: calc(100vh - 46px)"
|
|
|
+ ></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getTrajectoryInfo } from '@/api'
|
|
|
-import { Notify } from 'vant'
|
|
|
+import { getTrack } from "@/api";
|
|
|
+import { Notify } from "vant";
|
|
|
export default {
|
|
|
- name: 'trajectory',
|
|
|
- components: {
|
|
|
- },
|
|
|
- data () {
|
|
|
+ name: "trajectory",
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
return {
|
|
|
- }
|
|
|
+ recordId: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.recordId = this.$route.query.recordId;
|
|
|
},
|
|
|
- mounted () {
|
|
|
- getTrajectoryInfo({
|
|
|
- }).then(res => {
|
|
|
+ mounted() {
|
|
|
+ let that = this
|
|
|
+ getTrack({ recordId: this.recordId }).then((res) => {
|
|
|
if (res.status == 10000) {
|
|
|
- const map = new AMap.Map('map-container')
|
|
|
- map.setCenter(new AMap.LngLat(res.data.coordPoint.log, res.data.coordPoint.lat))
|
|
|
- map.setZoom(13)
|
|
|
- map.add(new AMap.Polyline({
|
|
|
- path: res.data.coordPointList.map(item => {
|
|
|
- return new AMap.LngLat(item.log, item.lat)
|
|
|
- }),
|
|
|
- strokeWeight: 6,
|
|
|
- strokeColor: '#ee0a24',
|
|
|
- lineJoin: 'round',
|
|
|
- lineCap: 'round',
|
|
|
- showDir: true
|
|
|
- }))
|
|
|
+ const map = new AMap.Map("map-container");
|
|
|
+ // 如果为圆形
|
|
|
+ map.setCenter(
|
|
|
+ new AMap.LngLat(res.data.coordPoint.log, res.data.coordPoint.lat)
|
|
|
+ );
|
|
|
+ map.setZoom(13);
|
|
|
+ map.add(
|
|
|
+ new AMap.Polyline({
|
|
|
+ path: res.data.guijicoord.map((item) => {
|
|
|
+ return new AMap.LngLat(item.log, item.lat);
|
|
|
+ }),
|
|
|
+ strokeWeight: 6,
|
|
|
+ strokeColor: "#ee0a24",
|
|
|
+ lineJoin: "round",
|
|
|
+ lineCap: "round",
|
|
|
+ showDir: true,
|
|
|
+ })
|
|
|
+ );
|
|
|
if (res.data.fenceType == 0) {
|
|
|
- map.add(new AMap.Circle({
|
|
|
- center: new AMap.LngLat(res.data.coordPoint.log, res.data.coordPoint.lat),
|
|
|
- radius: parseFloat(res.data.fenceRadii),
|
|
|
- fillColor: '#409eff66',
|
|
|
- strokeColor: '#409eff',
|
|
|
- strokeWeight: 1
|
|
|
- }))
|
|
|
+ map.add(
|
|
|
+ new AMap.Circle({
|
|
|
+ center: new AMap.LngLat(
|
|
|
+ res.data.coordPoint.log,
|
|
|
+ res.data.coordPoint.lat
|
|
|
+ ),
|
|
|
+ radius: parseFloat(res.data.fenceRadii),
|
|
|
+ fillColor: "#409eff66",
|
|
|
+ strokeColor: "#409eff",
|
|
|
+ strokeWeight: 1,
|
|
|
+ })
|
|
|
+ );
|
|
|
} else {
|
|
|
- map.add(new AMap.Polygon({
|
|
|
- path: res.data.coordPointList.map(item => {
|
|
|
- return [item.log, item.lat]
|
|
|
- }),
|
|
|
- fillColor: '#409eff66',
|
|
|
- borderWeight: 1,
|
|
|
- strokeColor: '#409eff'
|
|
|
- }))
|
|
|
+ map.add(
|
|
|
+ new AMap.Polygon({
|
|
|
+ path: res.data.coordPointList.map((item) => {
|
|
|
+ return [item.log, item.lat];
|
|
|
+ }),
|
|
|
+ fillColor: "#409eff66",
|
|
|
+ borderWeight: 1,
|
|
|
+ strokeColor: "#409eff",
|
|
|
+ })
|
|
|
+ );
|
|
|
}
|
|
|
} else {
|
|
|
- Notify({ type: 'warning', message: '查看轨迹信息失败' })
|
|
|
+ Notify({ type: "warning", message: res.message || "查看轨迹信息失败",duration:1000 });
|
|
|
+ setTimeout(()=>that.$router.back(),1000)
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
- goBack () {
|
|
|
- this.$router.back()
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ goBack() {
|
|
|
+ this.$router.back();
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
-$width: 1.2vw;
|
|
|
-$height: 0.6vh;
|
|
|
-.punch-img-style {
|
|
|
- padding-bottom: 2vh;
|
|
|
-}
|
|
|
-.yc-style {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
-}
|
|
|
-.redDot {
|
|
|
- width: $width;
|
|
|
- height: $height;
|
|
|
- border-radius: 50%;
|
|
|
- background: #932562;
|
|
|
-}
|
|
|
-.blueDot {
|
|
|
- width: $width;
|
|
|
- height: $height;
|
|
|
- border-radius: 50%;
|
|
|
- background: #0000ff;
|
|
|
-}
|
|
|
-.orangeDot {
|
|
|
- width: $width;
|
|
|
- height: $height;
|
|
|
- border-radius: 50%;
|
|
|
- background: #ff9900;
|
|
|
-}
|
|
|
-.rest-style {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- width: 100%;
|
|
|
- color: #aaa;
|
|
|
-}
|
|
|
-.table-head {
|
|
|
- height: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
-}
|
|
|
-/deep/ .el-calendar__body {
|
|
|
- padding: 0;
|
|
|
- table > thead > th {
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table tr:first-child td {
|
|
|
- border: none;
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table td {
|
|
|
- border: none;
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table .el-calendar-day {
|
|
|
- height: 6vh;
|
|
|
- /* width: 14.5vw; */
|
|
|
- padding: 1vh 2vw 0 2vw;
|
|
|
- /* padding: 0; */
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table td.is-selected {
|
|
|
- background: #fff;
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table .el-calendar-day:hover {
|
|
|
- background: transparent;
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table td.is-selected .el-calendar-day .table-head {
|
|
|
- border-radius: 50%;
|
|
|
+$white: #fff;
|
|
|
+.van-nav-bar {
|
|
|
background: #67a2ff;
|
|
|
- color: #fff;
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table__row .prev {
|
|
|
- pointer-events: none;
|
|
|
-}
|
|
|
-/deep/ .el-calendar-table__row .next {
|
|
|
- pointer-events: none;
|
|
|
-}
|
|
|
-/deep/ .van-empty__image {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
}
|
|
|
-/deep/ .van-empty {
|
|
|
- padding: 0;
|
|
|
+/deep/ .van-icon {
|
|
|
+ color: $white;
|
|
|
}
|
|
|
-/deep/ .custom-image .van-empty__image img {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
+/deep/ .van-nav-bar__text {
|
|
|
+ color: $white;
|
|
|
}
|
|
|
-/deep/ .van-empty__description {
|
|
|
- color: #aaa;
|
|
|
+/deep/ .van-nav-bar__title {
|
|
|
+ color: $white;
|
|
|
}
|
|
|
</style>
|