Browse Source

修改地图编辑问题

master
邓宏 2 years ago
parent
commit
2f8bdc0c06
  1. 5
      common/request.js
  2. 20
      common/utils.js
  3. 3
      main.js
  4. 6
      node_modules/.package-lock.json
  5. 9
      node_modules/uview-ui/components/u-navbar/u-navbar.vue
  6. 14
      package-lock.json
  7. 2
      package.json
  8. 29
      pages/home/index.vue
  9. 10
      pages/massif/info.vue
  10. 55
      pages/massif/mana/index.vue
  11. 39
      pages/stock/mana.vue
  12. 40
      pages/warehouse/detail.vue
  13. 75
      pages/warehouse/mana.vue
  14. BIN
      static/map_point_1.gif
  15. BIN
      static/map_point_3.png
  16. BIN
      static/map_point_4.png
  17. 6
      store/index.js
  18. 67
      uni_modules/d-form/components/d-form/d-form.vue

5
common/request.js

@ -2,8 +2,9 @@ import store from "@/store"
export function host(host='default',suffix='/plant_manage'){
var url=process.env.NODE_ENV === 'development'?{
// default:`http://wmyrzw.natappfree.cc` //陈
default:`http://czixnn.natappfree.cc` //马
// default:`http://dtkswx.natappfree.cc` //陈
// default:`http://czixnn.natappfree.cc` //马
default:`http://usex4q.natappfree.cc` //何
// default:`http://192.168.0.116:8080` //孙
}:{
default:``

20
common/utils.js

@ -0,0 +1,20 @@
export var computeArea=function(val){
var longitude={
min: Math.min(...val.map(v=>v.longitude)),
max: Math.max(...val.map(v=>v.longitude)),
}
var latitude={
min: Math.min(...val.map(v=>v.latitude)),
max: Math.max(...val.map(v=>v.latitude)),
}
longitude.len=longitude.max-longitude.min
latitude.len=latitude.max-latitude.min
return {
longitude,
latitude,
center: {
longitude: longitude.min+longitude.len/2,
latitude: latitude.min+latitude.len/2,
}
}
}

3
main.js

@ -2,11 +2,12 @@ import Vue from 'vue'
import App from './App'
import store from './store'
import uView from 'uview-ui';
import {defineObj} from 'black-knight/lib/config/custom'
import {defineObj,defineArray} from 'black-knight/lib/config/custom'
Vue.use(uView)
Vue.prototype.$store=store
Vue.prototype.$defineArray=defineArray
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({

6
node_modules/.package-lock.json

@ -5,9 +5,9 @@
"requires": true,
"packages": {
"node_modules/black-knight": {
"version": "1.3.25",
"resolved": "https://registry.npmjs.org/black-knight/-/black-knight-1.3.25.tgz",
"integrity": "sha512-cIUMwiGO4Gsn9cD/lXy5RHlxAxR9aLZp2S5RyD76sGLFGNqWsc5rSFutpTJolwC/mvO9EOfMETo/6iVPetUdxQ=="
"version": "1.3.26",
"resolved": "https://registry.npmjs.org/black-knight/-/black-knight-1.3.26.tgz",
"integrity": "sha512-7WWFooFRLdt337DyMfXqLcYCllYJslxT388tAdxtJtTd0gjsTGGEqG7Wi/Kt2gCj8Ip3s/mPblj4rvA0LByhjg=="
},
"node_modules/callsites": {
"version": "3.1.0",

9
node_modules/uview-ui/components/u-navbar/u-navbar.vue

@ -5,7 +5,8 @@
v-if="fixed && placeholder"
:style="{
height: $u.addUnit($u.getPx(height) + $u.sys().statusBarHeight,'px'),
}" ></view>
}"
></view>
<view :class="[fixed && 'u-navbar--fixed']">
<u-status-bar
v-if="safeAreaInsetTop"
@ -23,7 +24,8 @@
class="u-navbar__content__left"
hover-class="u-navbar__content__left--hover"
hover-start-time="150"
@tap="leftClick" >
@tap="leftClick"
>
<slot name="left">
<u-icon
v-if="leftIcon"
@ -51,7 +53,8 @@
<view
class="u-navbar__content__right"
v-if="$slots.right || rightIcon || rightText"
@tap="rightClick" >
@tap="rightClick"
>
<slot name="right">
<u-icon
v-if="rightIcon"

14
package-lock.json

@ -8,15 +8,15 @@
"name": "plant_manage_mobile",
"version": "1.0.0",
"dependencies": {
"black-knight": "^1.3.25",
"black-knight": "^1.3.26",
"uni-pages-hot-modules": "^0.1.1",
"uview-ui": "^2.0.35"
}
},
"node_modules/black-knight": {
"version": "1.3.25",
"resolved": "https://registry.npmjs.org/black-knight/-/black-knight-1.3.25.tgz",
"integrity": "sha512-cIUMwiGO4Gsn9cD/lXy5RHlxAxR9aLZp2S5RyD76sGLFGNqWsc5rSFutpTJolwC/mvO9EOfMETo/6iVPetUdxQ=="
"version": "1.3.26",
"resolved": "https://registry.npmjs.org/black-knight/-/black-knight-1.3.26.tgz",
"integrity": "sha512-7WWFooFRLdt337DyMfXqLcYCllYJslxT388tAdxtJtTd0gjsTGGEqG7Wi/Kt2gCj8Ip3s/mPblj4rvA0LByhjg=="
},
"node_modules/callsites": {
"version": "3.1.0",
@ -45,9 +45,9 @@
},
"dependencies": {
"black-knight": {
"version": "1.3.25",
"resolved": "https://registry.npmjs.org/black-knight/-/black-knight-1.3.25.tgz",
"integrity": "sha512-cIUMwiGO4Gsn9cD/lXy5RHlxAxR9aLZp2S5RyD76sGLFGNqWsc5rSFutpTJolwC/mvO9EOfMETo/6iVPetUdxQ=="
"version": "1.3.26",
"resolved": "https://registry.npmjs.org/black-knight/-/black-knight-1.3.26.tgz",
"integrity": "sha512-7WWFooFRLdt337DyMfXqLcYCllYJslxT388tAdxtJtTd0gjsTGGEqG7Wi/Kt2gCj8Ip3s/mPblj4rvA0LByhjg=="
},
"callsites": {
"version": "3.1.0",

2
package.json

@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "main.js",
"dependencies": {
"black-knight": "^1.3.25",
"black-knight": "^1.3.26",
"uni-pages-hot-modules": "^0.1.1",
"uview-ui": "^2.0.35"
}

29
pages/home/index.vue

@ -294,16 +294,10 @@
<view class="title">
<text class="plant-cangkuguanliguanli"/> 仓库管理 <text class="more" @click="$u.route({url:'pages/warehouse/mana'})">更多>></text>
</view>
<view class="item">
<text class="over">东方红一号仓库</text> <text>23</text>
<view class="item" v-for="(v,k) in stockList" :key="k">
<text class="over">{{v.warehouseName}}</text> <text>{{v.warehouseVolume}}</text>
</view>
<view class="item">
<text class="over">东方红一号仓库</text> <text>23</text>
</view>
<view class="item">
<text class="over">东方红一号仓库</text> <text>23</text>
</view>
<u-empty v-if="false" text=" " width="70%" icon="/static/noData.png"/>
<u-empty v-if="stockList.length<=0" text=" " width="70%" icon="/static/noData.png"/>
</view>
</view>
<view style="display:flex;">
@ -357,6 +351,7 @@ import request from '@/common/request.js'
massif:{},
baseInfo:{},
baseIndex:"",
stockList:[],
}
},
computed:{
@ -373,6 +368,7 @@ import request from '@/common/request.js'
"$store.state.plantBaseInfoId"(n){
this.getMassif(n)
this.getBaseInfo(n)
this.getStock(n)
}
},
onLoad() {
@ -428,6 +424,21 @@ import request from '@/common/request.js'
})
}
},
//
async getStock(baseId){
var res=await request("/api/plantIndex/queryWarehouse",{
params:{baseId}
})
if(res.statu){
this.stockList=res.data
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取仓库信息失败!",
showCancel:false,
})
}
},
}
}
</script>

10
pages/massif/info.vue

@ -38,7 +38,7 @@ import request from '@/common/request'
realityArea:{label:"实际面积",type:'digit'},
image:{label:"地块图片",type:"upImg",num:3,value:''},
date:{label:"使用日期",type:"dateRange",value:[]},
jw:{label:"经/纬度",type:"map",value:[]},
longitude:{label:"经/纬度",type:"map",value:[]},
address:{label:"详细地址",type:"textarea"},
},
formData:{
@ -133,7 +133,7 @@ import request from '@/common/request'
this.fields.date.value=[res.data.beginTime, res.data.endTime]
this.fields.plantBaseInfoId.value=[res.data.plantBaseInfoId]
this.fields.image.value=res.data.image.join(',')
this.fields.jw.value=this.formData.jw.split("|").map(v=>{
this.fields.longitude.value=this.formData.longitude.split("|").map(v=>{
var point=v.split(",")
if(point.length==2){
return {longitude:point[0],latitude:point[1]}
@ -149,12 +149,12 @@ import request from '@/common/request'
}
},
editorMap(e){
this.fields.jw.value=e
this.formData.jw=e.map(v=>`${v.longitude},${v.latitude}`).join('|')
this.fields.longitude.value=e
this.formData.longitude=e.map(v=>`${v.longitude},${v.latitude}`).join('|')
},
},
onBackPress(e){
var dForm=this.$refs.dForm.find(v=>v.field=='jw')
var dForm=this.$refs.dForm.find(v=>v.field=='longitude')
if(dForm?.showMap){//
dForm.showMap=false
return true

55
pages/massif/mana/index.vue

@ -42,6 +42,8 @@
import plantPlan from './plantPlan.vue'
import farmRecord from './farmRecord.vue'
import recovery from './recovery.vue'
import request from '@/common/request.js'
import {computeArea} from '@/common/utils'
export default {
components:{plantPlan,farmRecord,recovery},
data(){
@ -53,35 +55,58 @@ export default {
{name:"采收记录",},
],
plotId:"",
maps:null,
}
},
onLoad(options){
this.plotId=options.id
},
onReady(){
async onReady(){
/* #ifdef APP-PLUS */
var a=uni.createMapContext("amap",this)
var amap=uni.createMapContext("amap",this)
var points=await this.getDetail()
var maps=a.$getAppMap()
maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE)
maps.onclick=(e)=>{
console.log(e,'-------maps--click---------')
}
var polygon=new plus.maps.Polygon([
new plus.maps.Point(116.39524,39.925301),
new plus.maps.Point(116.400444,39.925285),
new plus.maps.Point(116.400558,39.923282),
new plus.maps.Point(116.395502,39.923082),
])
this.maps=amap.$getAppMap()
this.maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE)
if(points.length>0){
var bound=computeArea(points)
this.maps.centerAndZoom(new plus.maps.Point(bound.center.longitude, bound.center.latitude),10)
var polygon=new plus.maps.Polygon( points.map(v=>new plus.maps.Point(v.longitude, v.latitude)) )
polygon.setLineWidth(2)
polygon.setStrokeColor("#10C176")
polygon.setFillColor("#10C176")
polygon.setFillOpacity(0.3)
maps.addOverlay(polygon)
this.maps.addOverlay(polygon)
}else{
this.maps.centerAndZoom(new plus.maps.Point(102.712251,25.040609),10)
}
/* #endif */
},
methods:{
async getDetail(){
var res=await request('/api/plantPlot/queryById',{
params:{id:this.plotId}
})
if(res.statu){
return res.data.longitude.split("|").map(v=>{
var point=v.split(",")
if(point.length==2){
return {longitude:point[0],latitude:point[1]}
}
return null
}).filter(v=>v)
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取地块详情失败!",
showCancel:false,
})
return[]
}
},
}
}
</script>

39
pages/stock/mana.vue

@ -77,21 +77,34 @@
&>.btns{
margin-left:auto;
button{
background:transparent;
border:2rpx solid transparent;
color:var(--c);
font-weight: bold;
font-size:30rpx;
height:50rpx;
width:50rpx;
padding:0;
height:48rpx;
width: 96rpx;
font-size:24rpx;
&:first-child{
border-radius: 30rpx 0 0 30rpx;
border-color:var(--c);
color:#10C176;
background:rgba(16, 193, 119, 0.1);
}
&:nth-child(2){
border-radius: 0 30rpx 30rpx 0;
border-color:var(--c);
margin-left:20rpx;
color:#fff;
background:#10C176;
}
// background:transparent;
// border:2rpx solid transparent;
// color:var(--c);
// font-weight: bold;
// font-size:30rpx;
// height:50rpx;
// width:50rpx;
// &:first-child{
// border-radius: 30rpx 0 0 30rpx;
// border-color:var(--c);
// }
// &:nth-child(2){
// border-radius: 0 30rpx 30rpx 0;
// border-color:var(--c);
// }
}
}
}
@ -127,8 +140,8 @@
<view class="num">
<text>库存量200kg</text>
<view class="btns" @click="$u.route({url:'pages/stock/list'})">
<button class="cu-btn plant-jian" style="--c:#FC9F24;"/>
<button class="cu-btn plant-zengjia" style="--c:#9DE6BC;"/>
<button class="cu-btn">出库</button>
<button class="cu-btn">入库</button>
</view>
</view>
</view>

40
pages/warehouse/detail.vue

@ -27,29 +27,53 @@
<view class="card">
<view class="title">基本信息</view>
<view class="item" v-for="i in 1">
<text>仓库名称</text> <text>东方红一号仓库</text>
<view class="item">
<text>仓库名称</text> <text>{{detail.warehouseName}}</text>
</view>
<view class="item">
<text>仓库位置</text> <text>东方红一号基地进门右边冷库</text>
<text>仓库位置</text> <text>{{detail.warehouseAddress}}</text>
</view>
<view class="item">
<text>仓库容量</text> <text>12</text>
<text>仓库容量</text> <text>{{detail.warehouseVolume}}</text>
</view>
<view class="item">
<text>仓库类型</text> <text>冷库</text>
<text>仓库类型</text> <text>{{detail.warehouseType}}</text>
</view>
<view class="item">
<text>仓库管理员</text> <text>张小红</text>
<text>仓库管理员</text> <text>{{detail.warehouseKeeper}}</text>
</view>
<view class="item">
<text>库管员电话</text> <text>12323443434</text>
<text>库管员电话</text> <text>{{detail.warehouseKeeperTelephone}}</text>
</view>
</view>
</view>
</template>
<script>
import request from '@/common/request.js'
export default{
data(){
return{
detail:{}
}
},
onLoad(options){
this.getDetail(options.id)
},
methods:{
async getDetail(warehouseId){
var res=await request("/api/WarehouseManageApi/querysWarehouseDetails",{
params:{warehouseId}
})
if(res.statu){
this.detail=res.data
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取仓库详情失败!",
showCancel:false,
})
}
}
}
}
</script>

75
pages/warehouse/mana.vue

@ -1,20 +1,14 @@
<style lang="scss" scoped>
.container{
min-height: 100%;
height: 100%;
background:#F6F6F6;
padding-bottom:20rpx;
&>.item{
display:flex;
&>image{
flex-shrink: 0;
width:164rpx;
height:164rpx;
border-radius: 16rpx;
margin-right:24rpx;
}
&>.info{
scroll-view{
flex-grow: 1;
height:1rpx;
.item{
.title{
display:flex;
align-items: center;
@ -36,7 +30,7 @@
margin-top:16rpx;
color:#999;
font-size:24rpx;
text:nth-child(3){
text:nth-child(2){
color:#10C176;
font-weight: bold;
font-size: 32rpx;
@ -63,20 +57,19 @@
}
</style>
<template>
<view class="container">
<view class="container flex">
<d-navbar style="--bg:#10C176;--c:#fff;" text="仓库管理" isBack>
<text class="plant-xinjian" slot="right" @click="$u.route({url:'pages/warehouse/info'})"/>
</d-navbar>
<d-search style="margin-top:30rpx;"/>
<d-search v-model="searchVal.search" style="margin-top:30rpx;" @search="clean();search()"/>
<view class="card item" v-for="i in 1" :key="i" @click="$u.route({url:'pages/warehouse/detail'})">
<image src="https://ts1.cn.mm.bing.net/th?id=OIP-C.wc_dCG_KbIKZwMdtD3gL2QHaEt&w=313&h=199&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2"/>
<view class="info">
<view class="title">西南角1号仓库 <text class="plant-youbian"/></view>
<view class="adder">种植基地进门右手边第3个</view>
<scroll-view scroll-y @scrolltolower="search">
<view class="card item" v-for="(v,k) in list" :key="k" @click="$u.route({url:'pages/warehouse/detail',params:{id:v.warehouseId}})">
<view class="title">{{v.warehouseName}} <text class="plant-youbian"/></view>
<view class="adder">{{v.warehouseAddress}}</view>
<view class="data">
<text>库存种类x</text> <text>库存量xkg</text> <text>453</text>
<text>库存种类{{v.inventoryType||0}}</text> <text>{{v.capacity||0}}</text>
</view>
<view class="btns">
<text class="plant-xiugai">修改</text>
@ -84,13 +77,51 @@
<text class="plant-chakan" @click.stop="$u.route({url:'pages/warehouse/info'})">查看库存</text>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import request from '@/common/request.js'
export default {
data(){
return{
searchVal:{
baseId: this.$store.state.plantBaseInfoId,
search:"",
pageNo:1,
pageSize:6
},
list:[],
total:0,
}
},
onLoad(options){
this.search()
},
methods:{
rightClick(){}
clean(){
this.list=[]
this.total=0
this.searchVal.pageNo=1
},
async search(){
if(this.total==0||this.list.length<this.total){
var res=await request("/api/WarehouseManageApi/queryWarehouseList",{
method:"post",
body: this.searchVal
})
if(res.statu){
this.list=this.list.concat(res.data.warehouseList)
this.total=res.data.total
}else{
uni.showModal({
title:"提示",
content:res.msg||"获取仓库列表失败!",
showCancel:false,
})
}
}
}
}
}
</script>

BIN
static/map_point_1.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
static/map_point_3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
static/map_point_4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

6
store/index.js

@ -23,9 +23,9 @@ export default new Vuex.Store({
outLogin(state){
state.userInfo={}
state.token=''
uni.reLaunch({
url:"/pages/home/login",
})
// uni.reLaunch({
// url:"/pages/home/login",
// })
},
setHeadImg(state,val){
state.userInfo.avatar=val

67
uni_modules/d-form/components/d-form/d-form.vue

@ -191,7 +191,7 @@
</u-input>
<button v-if="btnText" @click="btnFun" class="cu-btn bg-green shadow">{{btnText}}</button>
</view>
<view v-else-if="type=='map'" class="map plant-dingweixiao" :class="{noData:value.length<=0}" @click="openMap">{{value.length>0?value[0].join():"选择经纬度"}}</view>
<view v-else-if="type=='map'" class="map plant-dingweixiao" :class="{noData:value.length<=0}" @click="openMap">{{value.length>0?Object.values(value[0]).join():"选择经纬度"}}</view>
<view v-else-if="type=='select'" class="plant-youbian" :class="{noData: !value[0]}" @click="show=true">{{pickerContent}}</view>
<u-upload v-else-if="type=='upImg'" :fileList="imgs" previewFullImage multiple :maxCount="num" @delete="delImg" @afterRead="afterRead">
<view class="album">
@ -258,6 +258,7 @@
<script>
import request,{host} from '@/common/request'
import {dataType} from 'black-knight/lib/config/tools'
import {computeArea} from '@/common/utils'
function setPickerCol(columns, value, n){
if(columns.length<=0)return
@ -339,8 +340,8 @@ import {dataType} from 'black-knight/lib/config/tools'
showMap:false,
maps:null,
markerList:[],
temp_markerList:[],
markerList: this.$defineArray([]),
temp_markerList: this.$defineArray([]),
areaPolygon:null,
}
},
@ -370,7 +371,7 @@ import {dataType} from 'black-knight/lib/config/tools'
},
pickerContent(){//
if(this.type=='select'){
return setPickerVal(this.columns[0], this.value).filter(v=>v).at(-1)?.label||this.placeholder||`请选择${this.label}`
return this.$defineArray(setPickerVal(this.columns[0], this.value).filter(v=>v)).at(-1)?.label||this.placeholder||`请选择${this.label}`
}
return ''
},
@ -387,6 +388,11 @@ import {dataType} from 'black-knight/lib/config/tools'
setPickerCol.bind(this.$refs.picker)(this.columns[0]||[],this.value,1)
})
}
this.$nextTick(()=>{
uni.$u.getRect(".amap").then(res=>{
console.log(res,'---res----')
})
})
},
methods:{
async afterRead(e){
@ -443,7 +449,16 @@ import {dataType} from 'black-knight/lib/config/tools'
polyline.setLineWidth(8)
polyline.setStrokeColor("#10C176")
this.value.forEach(v=>this.addMarker(v,polyline))
if(this.value.length>0){
var bound=computeArea(this.value)
for(var i=0;i<this.value.length;i++){
this.maps.addOverlay(this.addMarker(this.value[i],polyline))
}
this.markerList[0].pre=this.markerList[this.markerList.length-1].value
this.markerList[this.markerList.length-1].next=this.markerList[0].value
this.maps.centerAndZoom(new plus.maps.Point(bound.center.longitude, bound.center.latitude),10)
this.drawOver(true)
}
this.maps.onclick=(e)=>{
this.markerList.length<=0 && this.maps.addOverlay(polyline)
@ -460,8 +475,9 @@ import {dataType} from 'black-knight/lib/config/tools'
}
/* #endif */
},
drawOver(){
this.$emit("editorMap",this.markerList.map(({value})=>value.getPoint()))
drawOver(init=false){
!init && this.$emit("editorMap",this.markerList.map(({value})=>value.getPoint()))
this.areaPolygon=new plus.maps.Polygon( this.markerList.map(({value})=>new plus.maps.Point(...Object.values(value.getPoint()))) )
this.areaPolygon.setLineWidth(3)
this.areaPolygon.setStrokeColor("#10C176")
@ -476,7 +492,7 @@ import {dataType} from 'black-knight/lib/config/tools'
},
addMarker({longitude,latitude},polyline){
var marker=new plus.maps.Marker(new plus.maps.Point(longitude, latitude));
marker.setIcon("/static/map_point_1.png");
marker.setIcon("/static/map_point_3.png");
marker.bringToTop()
marker.setDraggable(false)
marker.onDrag= this.onDrag
@ -516,19 +532,20 @@ import {dataType} from 'black-knight/lib/config/tools'
onClick(e){
if(this.markerList.length>3){
this.maps.removeOverlay(e)
this.markerList = this.markerList.filter(v=>v.value!=e)
var preMarker=this.markerList.find(v=>v.pre==e)
var nextMarker=this.markerList.find(v=>v.next==e)
preMarker.pre=nextMarker.value
nextMarker.next=preMarker.value
this.markerList.splice( this.markerList.Dfind(v=>v.value==e), 1)
var preMarker=this.markerList.find(v=>v.next==e)
var nextMarker=this.markerList.find(v=>v.pre==e)
preMarker.next=nextMarker.value
nextMarker.pre=preMarker.value
// this.maps.removeOverlay(this.temp_markerList.find(v=>v.next==e).value)
// this.maps.removeOverlay(this.temp_markerList.find(v=>v.pre==e).value)
// this.temp_markerList=this.temp_markerList.filter(v=>v.pre!=e&&v.next!=e)
// this.addTempMarker({value:preMarker.value, next:nextMarker.value})
this.temp_markerList.forEach(v=>this.maps.removeOverlay(v.value))
this.temp_markerList=[]
this.markerList.forEach(v=>this.addTempMarker(v))
this.maps.removeOverlay(this.temp_markerList.find(v=>v.next==e).value)
this.maps.removeOverlay(this.temp_markerList.find(v=>v.pre==e).value)
this.temp_markerList.splice(this.temp_markerList.Dfind(v=>v.pre==e),1)
this.temp_markerList.splice(this.temp_markerList.Dfind(v=>v.next==e),1)
this.addTempMarker(preMarker)
// this.temp_markerList.forEach(v=>this.maps.removeOverlay(v.value))
// this.temp_markerList.length=0
// this.markerList.forEach(v=>this.addTempMarker(v))
this.reComputArea()
}else{
@ -546,7 +563,7 @@ import {dataType} from 'black-knight/lib/config/tools'
return new plus.maps.Point(point.longitude, point.latitude)
}))
},
addTempMarker({value,pre,next}){
addTempMarker({value,next}){
var point1=value.getPoint()
var point2=next.getPoint()
@ -554,7 +571,7 @@ import {dataType} from 'black-knight/lib/config/tools'
Math.min(point1.longitude,point2.longitude)+Math.abs(point1.longitude-point2.longitude)/2,
Math.min(point1.latitude,point2.latitude)+Math.abs(point1.latitude-point2.latitude)/2
));
marker.setIcon("/static/map_point_2.png");
marker.setIcon("/static/map_point_4.png");
marker.bringToTop()
marker.setDraggable(true)
marker.onDrag= e=>{
@ -582,9 +599,9 @@ import {dataType} from 'black-knight/lib/config/tools'
})
}
}
this.temp_markerList=this.temp_markerList.filter(v=>v.value!=e)
this.temp_markerList.splice(this.temp_markerList.Dfind(v=>v.value==e),1)
this.reComputArea()
e.setIcon('/static/map_point_1.png')
e.setIcon('/static/map_point_3.png')
e.onDrag= this.onDrag
e.onclick= this.onClick
@ -592,8 +609,8 @@ import {dataType} from 'black-knight/lib/config/tools'
}
this.maps.addOverlay(marker)
this.temp_markerList.push({
value:marker,
pre:value,
value:marker,
next:next
})
},

Loading…
Cancel
Save