|
|
|
@ -256,6 +256,8 @@ export default { |
|
|
|
|
components: {Transfers}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
//区分行数 |
|
|
|
|
lineNumber:null, |
|
|
|
|
//选中行的id |
|
|
|
|
taskId: null, |
|
|
|
|
//分组 |
|
|
|
@ -318,7 +320,7 @@ export default { |
|
|
|
|
{required: true, message: "排序编码不能为空", trigger: "blur"} |
|
|
|
|
], |
|
|
|
|
patrolType: [ |
|
|
|
|
{required: true, message: "巡更类型不能为空", trigger: "change"} |
|
|
|
|
{required: true, message: "巡更类型不能为空", trigger: "blur"} |
|
|
|
|
], |
|
|
|
|
taskState: [ |
|
|
|
|
{required: true, message: "任务状态 1:未开始2:执行中3:已停止4:已过期不能为空", trigger: "blur"} |
|
|
|
@ -561,13 +563,10 @@ export default { |
|
|
|
|
icon: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png', |
|
|
|
|
position: [val.lang, val.lat], |
|
|
|
|
offset: new AMap.Pixel(-16, -60), |
|
|
|
|
|
|
|
|
|
extData:(val) |
|
|
|
|
}) |
|
|
|
|
this.myMarker.setExtData(val) |
|
|
|
|
this.map.add(this.myMarker) |
|
|
|
|
this.myMarker.on('click', (e) => { |
|
|
|
|
console.log(e) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.markers.push(this.myMarker) |
|
|
|
|
this.map.setFitView() |
|
|
|
|
}, |
|
|
|
@ -586,33 +585,42 @@ export default { |
|
|
|
|
deleteEvent(val, num) { |
|
|
|
|
this.form.taskMatter.splice(num, 1) |
|
|
|
|
}, |
|
|
|
|
selectPoint(val, index) { |
|
|
|
|
console.log(val, index, this.form.taskMatter, 'jjj') |
|
|
|
|
this.markers.forEach(marker => { |
|
|
|
|
marker.on('click', () => { |
|
|
|
|
selectPoint(val, index1) { |
|
|
|
|
console.log(val, index1, this.form.taskMatter, 'jjj') |
|
|
|
|
this.lineNumber = index1 |
|
|
|
|
let obj = {} |
|
|
|
|
this.markers.forEach((item,index) => { |
|
|
|
|
item.on('click', () => { |
|
|
|
|
if (this.selectedMarker) { |
|
|
|
|
this.selectedMarker.setIcon( |
|
|
|
|
"//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png" |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
this.selectedMarker = marker |
|
|
|
|
marker.setIcon('//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png') |
|
|
|
|
this.selectedMarker = item |
|
|
|
|
item.setIcon('//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png') |
|
|
|
|
obj = item.getExtData() |
|
|
|
|
this.setData(obj,index1) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
if (this.selectedMarker !== null) { |
|
|
|
|
this.setData(this.selectedMarker, val, index) |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning('选择右侧点位') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (this.selectedMarker !== null) { |
|
|
|
|
// this.setData(this.selectedMarker, val, index) |
|
|
|
|
// } else { |
|
|
|
|
// this.$message.warning('选择右侧点位') |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
setData(point, val, index) { |
|
|
|
|
console.log(point, val, index) |
|
|
|
|
let obj = { |
|
|
|
|
id: point.getExtData().id, |
|
|
|
|
patrolPointName: point.getExtData().patrolPointName |
|
|
|
|
} |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.taskMatter[index] = obj |
|
|
|
|
|
|
|
|
|
setData(point, index) { |
|
|
|
|
let this_ = this |
|
|
|
|
console.log(point, index,this_.form.taskMatter) |
|
|
|
|
this.$nextTick(()=>{ |
|
|
|
|
// if (this_.form.taskMatter[this.lineNumber].patrolPointId==''){ |
|
|
|
|
this_.form.taskMatter[this.lineNumber].patrolPointId = point.id |
|
|
|
|
this_.form.taskMatter[this.lineNumber].patrolPointName = point.patrolPointName |
|
|
|
|
this.$forceUpdate() |
|
|
|
|
console.log(point,this_.form.taskMatter) |
|
|
|
|
// } |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|